From 522740a23eaa1b7d2498738e2f5c446d6cd3ab63 Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Fri, 30 Aug 2019 22:34:57 +0100 Subject: [PATCH 01/30] moved file for cloudfront routing --- docs/www/{ => demo}/admin.html | 18 +++++++++--------- docs/www/{ => demo}/api-demo.html | 18 +++++++++--------- docs/www/{ => demo}/crawl.html | 18 +++++++++--------- docs/www/{ => demo}/r/css/bootstrap.css | 0 docs/www/{ => demo}/r/css/bootstrap.min.css | 0 .../{ => demo}/r/css/highlight-darcula.css | 0 .../www/{ => demo}/r/css/highlight-vs2015.css | 0 .../r/css/ie10-viewport-bug-workaround.css | 0 docs/www/{ => demo}/r/css/site.css | 0 .../r/img/logo/logo-cinecert-2019-h0100.png | Bin .../r/img/logo/logo-dalet-2019-h0100.png | Bin .../r/img/logo/logo-dpp-2019-h0100.png | Bin .../logo-editshare-strapline-2019-h0100.png | Bin .../r/img/logo/logo-eidr-2019-h0100.png | Bin .../logo-hochschule-rheinmain-2019-h0100.png | Bin .../logo/logo-marquise-tech-2019-h0044.png | Bin .../r/img/logo/logo-ownzones-2019-h0100.png | Bin .../r/img/logo/logo-pbs-2019-h0100.jpg | Bin ...go-prime-focus-technologies-2019-h0100.png | Bin .../logo/logo-rohde-schwarz-2019-h0101.png | Bin .../r/img/logo/logo-signiant-2019-h0100.png | Bin .../r/img/logo/logo-tedial-2019-h0100.png | Bin .../img/logo/logo-turner-white-2019-h0100.png | Bin .../r/img/logo/mrmxf-icon-circle-128.png | Bin .../r/img/mm-card-rear-2019-1000h.png | Bin docs/www/{ => demo}/r/js/admin-scripts.js | 0 docs/www/{ => demo}/r/js/bootswatch.js | 0 docs/www/{ => demo}/r/js/common-scripts.js | 4 ++-- docs/www/{ => demo}/r/js/crawl-scripts.js | 0 docs/www/{ => demo}/r/js/demo-scripts.js | 0 docs/www/{ => demo}/r/js/highlight.js | 0 docs/www/{ => demo}/r/js/index-scripts.js | 0 docs/www/{ => demo}/r/js/marked.min.js | 0 docs/www/{ => demo}/r/js/mermaid.min.js | 0 .../www/{ => demo}/r/js/put-post-records.json | 0 docs/www/{ => demo}/r/js/test-records.json | 0 docs/www/index.html | 18 +++++++++--------- gulpfile.js | 5 +++++ src/demo-localize-test-data.js | 4 ++-- 39 files changed, 45 insertions(+), 40 deletions(-) rename docs/www/{ => demo}/admin.html (89%) rename docs/www/{ => demo}/api-demo.html (89%) rename docs/www/{ => demo}/crawl.html (89%) rename docs/www/{ => demo}/r/css/bootstrap.css (100%) rename docs/www/{ => demo}/r/css/bootstrap.min.css (100%) rename docs/www/{ => demo}/r/css/highlight-darcula.css (100%) rename docs/www/{ => demo}/r/css/highlight-vs2015.css (100%) rename docs/www/{ => demo}/r/css/ie10-viewport-bug-workaround.css (100%) rename docs/www/{ => demo}/r/css/site.css (100%) rename docs/www/{ => demo}/r/img/logo/logo-cinecert-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-dalet-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-dpp-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-editshare-strapline-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-eidr-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-marquise-tech-2019-h0044.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-ownzones-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-pbs-2019-h0100.jpg (100%) rename docs/www/{ => demo}/r/img/logo/logo-prime-focus-technologies-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-rohde-schwarz-2019-h0101.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-signiant-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-tedial-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/logo-turner-white-2019-h0100.png (100%) rename docs/www/{ => demo}/r/img/logo/mrmxf-icon-circle-128.png (100%) rename docs/www/{ => demo}/r/img/mm-card-rear-2019-1000h.png (100%) rename docs/www/{ => demo}/r/js/admin-scripts.js (100%) rename docs/www/{ => demo}/r/js/bootswatch.js (100%) rename docs/www/{ => demo}/r/js/common-scripts.js (97%) rename docs/www/{ => demo}/r/js/crawl-scripts.js (100%) rename docs/www/{ => demo}/r/js/demo-scripts.js (100%) rename docs/www/{ => demo}/r/js/highlight.js (100%) rename docs/www/{ => demo}/r/js/index-scripts.js (100%) rename docs/www/{ => demo}/r/js/marked.min.js (100%) rename docs/www/{ => demo}/r/js/mermaid.min.js (100%) rename docs/www/{ => demo}/r/js/put-post-records.json (100%) rename docs/www/{ => demo}/r/js/test-records.json (100%) diff --git a/docs/www/admin.html b/docs/www/demo/admin.html similarity index 89% rename from docs/www/admin.html rename to docs/www/demo/admin.html index 80e94c1..3e36189 100644 --- a/docs/www/admin.html +++ b/docs/www/demo/admin.html @@ -8,7 +8,7 @@ - + @@ -18,11 +18,11 @@ - - + + - + @@ -39,9 +39,9 @@ aria-label="Toggle navigation"> @@ -82,8 +82,8 @@

Admin response:

- - + + diff --git a/docs/www/api-demo.html b/docs/www/demo/api-demo.html similarity index 89% rename from docs/www/api-demo.html rename to docs/www/demo/api-demo.html index 6b0d746..48bed39 100644 --- a/docs/www/api-demo.html +++ b/docs/www/demo/api-demo.html @@ -8,7 +8,7 @@ - + @@ -18,11 +18,11 @@ - - + + - + @@ -39,9 +39,9 @@ aria-label="Toggle navigation"> @@ -83,8 +83,8 @@

API response:

- - + + diff --git a/docs/www/crawl.html b/docs/www/demo/crawl.html similarity index 89% rename from docs/www/crawl.html rename to docs/www/demo/crawl.html index c3aa10c..6b60e95 100644 --- a/docs/www/crawl.html +++ b/docs/www/demo/crawl.html @@ -8,7 +8,7 @@ - + @@ -18,11 +18,11 @@ - - + + - + @@ -39,9 +39,9 @@ aria-label="Toggle navigation"> @@ -83,8 +83,8 @@

Crawl response:

- - + + diff --git a/docs/www/r/css/bootstrap.css b/docs/www/demo/r/css/bootstrap.css similarity index 100% rename from docs/www/r/css/bootstrap.css rename to docs/www/demo/r/css/bootstrap.css diff --git a/docs/www/r/css/bootstrap.min.css b/docs/www/demo/r/css/bootstrap.min.css similarity index 100% rename from docs/www/r/css/bootstrap.min.css rename to docs/www/demo/r/css/bootstrap.min.css diff --git a/docs/www/r/css/highlight-darcula.css b/docs/www/demo/r/css/highlight-darcula.css similarity index 100% rename from docs/www/r/css/highlight-darcula.css rename to docs/www/demo/r/css/highlight-darcula.css diff --git a/docs/www/r/css/highlight-vs2015.css b/docs/www/demo/r/css/highlight-vs2015.css similarity index 100% rename from docs/www/r/css/highlight-vs2015.css rename to docs/www/demo/r/css/highlight-vs2015.css diff --git a/docs/www/r/css/ie10-viewport-bug-workaround.css b/docs/www/demo/r/css/ie10-viewport-bug-workaround.css similarity index 100% rename from docs/www/r/css/ie10-viewport-bug-workaround.css rename to docs/www/demo/r/css/ie10-viewport-bug-workaround.css diff --git a/docs/www/r/css/site.css b/docs/www/demo/r/css/site.css similarity index 100% rename from docs/www/r/css/site.css rename to docs/www/demo/r/css/site.css diff --git a/docs/www/r/img/logo/logo-cinecert-2019-h0100.png b/docs/www/demo/r/img/logo/logo-cinecert-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-cinecert-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-cinecert-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-dalet-2019-h0100.png b/docs/www/demo/r/img/logo/logo-dalet-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-dalet-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-dalet-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-dpp-2019-h0100.png b/docs/www/demo/r/img/logo/logo-dpp-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-dpp-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-dpp-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-editshare-strapline-2019-h0100.png b/docs/www/demo/r/img/logo/logo-editshare-strapline-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-editshare-strapline-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-editshare-strapline-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-eidr-2019-h0100.png b/docs/www/demo/r/img/logo/logo-eidr-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-eidr-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-eidr-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png b/docs/www/demo/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-marquise-tech-2019-h0044.png b/docs/www/demo/r/img/logo/logo-marquise-tech-2019-h0044.png similarity index 100% rename from docs/www/r/img/logo/logo-marquise-tech-2019-h0044.png rename to docs/www/demo/r/img/logo/logo-marquise-tech-2019-h0044.png diff --git a/docs/www/r/img/logo/logo-ownzones-2019-h0100.png b/docs/www/demo/r/img/logo/logo-ownzones-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-ownzones-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-ownzones-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-pbs-2019-h0100.jpg b/docs/www/demo/r/img/logo/logo-pbs-2019-h0100.jpg similarity index 100% rename from docs/www/r/img/logo/logo-pbs-2019-h0100.jpg rename to docs/www/demo/r/img/logo/logo-pbs-2019-h0100.jpg diff --git a/docs/www/r/img/logo/logo-prime-focus-technologies-2019-h0100.png b/docs/www/demo/r/img/logo/logo-prime-focus-technologies-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-prime-focus-technologies-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-prime-focus-technologies-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-rohde-schwarz-2019-h0101.png b/docs/www/demo/r/img/logo/logo-rohde-schwarz-2019-h0101.png similarity index 100% rename from docs/www/r/img/logo/logo-rohde-schwarz-2019-h0101.png rename to docs/www/demo/r/img/logo/logo-rohde-schwarz-2019-h0101.png diff --git a/docs/www/r/img/logo/logo-signiant-2019-h0100.png b/docs/www/demo/r/img/logo/logo-signiant-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-signiant-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-signiant-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-tedial-2019-h0100.png b/docs/www/demo/r/img/logo/logo-tedial-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-tedial-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-tedial-2019-h0100.png diff --git a/docs/www/r/img/logo/logo-turner-white-2019-h0100.png b/docs/www/demo/r/img/logo/logo-turner-white-2019-h0100.png similarity index 100% rename from docs/www/r/img/logo/logo-turner-white-2019-h0100.png rename to docs/www/demo/r/img/logo/logo-turner-white-2019-h0100.png diff --git a/docs/www/r/img/logo/mrmxf-icon-circle-128.png b/docs/www/demo/r/img/logo/mrmxf-icon-circle-128.png similarity index 100% rename from docs/www/r/img/logo/mrmxf-icon-circle-128.png rename to docs/www/demo/r/img/logo/mrmxf-icon-circle-128.png diff --git a/docs/www/r/img/mm-card-rear-2019-1000h.png b/docs/www/demo/r/img/mm-card-rear-2019-1000h.png similarity index 100% rename from docs/www/r/img/mm-card-rear-2019-1000h.png rename to docs/www/demo/r/img/mm-card-rear-2019-1000h.png diff --git a/docs/www/r/js/admin-scripts.js b/docs/www/demo/r/js/admin-scripts.js similarity index 100% rename from docs/www/r/js/admin-scripts.js rename to docs/www/demo/r/js/admin-scripts.js diff --git a/docs/www/r/js/bootswatch.js b/docs/www/demo/r/js/bootswatch.js similarity index 100% rename from docs/www/r/js/bootswatch.js rename to docs/www/demo/r/js/bootswatch.js diff --git a/docs/www/r/js/common-scripts.js b/docs/www/demo/r/js/common-scripts.js similarity index 97% rename from docs/www/r/js/common-scripts.js rename to docs/www/demo/r/js/common-scripts.js index c785172..8521e86 100644 --- a/docs/www/r/js/common-scripts.js +++ b/docs/www/demo/r/js/common-scripts.js @@ -86,7 +86,7 @@ demo.get_test_data = async () => { } }; //wait for the response of the call - xhr.open("GET", "/r/js/test-records.json", true); + xhr.open("GET", "/demo/r/js/test-records.json", true); xhr.send(); }) } @@ -94,7 +94,7 @@ demo.get_test_data = async () => { demo.get_non_crawl_data = async () => { return new Promise((resolve, reject) => { var xhr = new XMLHttpRequest() - xhr.open("GET", "/r/js/put-post-records.json", true); + xhr.open("GET", "/demo/r/js/put-post-records.json", true); xhr.onreadystatechange = function () { if (this.readyState == 4) { let data = JSON.parse(xhr.responseText) diff --git a/docs/www/r/js/crawl-scripts.js b/docs/www/demo/r/js/crawl-scripts.js similarity index 100% rename from docs/www/r/js/crawl-scripts.js rename to docs/www/demo/r/js/crawl-scripts.js diff --git a/docs/www/r/js/demo-scripts.js b/docs/www/demo/r/js/demo-scripts.js similarity index 100% rename from docs/www/r/js/demo-scripts.js rename to docs/www/demo/r/js/demo-scripts.js diff --git a/docs/www/r/js/highlight.js b/docs/www/demo/r/js/highlight.js similarity index 100% rename from docs/www/r/js/highlight.js rename to docs/www/demo/r/js/highlight.js diff --git a/docs/www/r/js/index-scripts.js b/docs/www/demo/r/js/index-scripts.js similarity index 100% rename from docs/www/r/js/index-scripts.js rename to docs/www/demo/r/js/index-scripts.js diff --git a/docs/www/r/js/marked.min.js b/docs/www/demo/r/js/marked.min.js similarity index 100% rename from docs/www/r/js/marked.min.js rename to docs/www/demo/r/js/marked.min.js diff --git a/docs/www/r/js/mermaid.min.js b/docs/www/demo/r/js/mermaid.min.js similarity index 100% rename from docs/www/r/js/mermaid.min.js rename to docs/www/demo/r/js/mermaid.min.js diff --git a/docs/www/r/js/put-post-records.json b/docs/www/demo/r/js/put-post-records.json similarity index 100% rename from docs/www/r/js/put-post-records.json rename to docs/www/demo/r/js/put-post-records.json diff --git a/docs/www/r/js/test-records.json b/docs/www/demo/r/js/test-records.json similarity index 100% rename from docs/www/r/js/test-records.json rename to docs/www/demo/r/js/test-records.json diff --git a/docs/www/index.html b/docs/www/index.html index d933812..cdcb9ee 100644 --- a/docs/www/index.html +++ b/docs/www/index.html @@ -8,7 +8,7 @@ - + @@ -19,11 +19,11 @@ integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"> - - + + - + @@ -40,9 +40,9 @@ aria-label="Toggle navigation"> @@ -108,8 +108,8 @@

imf-mm-api Home

- - + + diff --git a/gulpfile.js b/gulpfile.js index d892eac..0947aa9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,6 +8,7 @@ const fs = require('fs') const chalk = require('chalk') const jshint = require('gulp-jshint') const stylish = require('jshint-stylish') +const ftp = require('vinyl-ftp'); // handle the zip filename consistently with functions const zip_filename = () => { @@ -98,3 +99,7 @@ gulp.task("zip", function (cb) { })) .pipe(gulp.dest(zip_path())) }) + +gulp.task('mmupload', async () =>{ + +}) \ No newline at end of file diff --git a/src/demo-localize-test-data.js b/src/demo-localize-test-data.js index 441a7a3..995eb1e 100644 --- a/src/demo-localize-test-data.js +++ b/src/demo-localize-test-data.js @@ -16,8 +16,8 @@ const path = require('path') const _module = require('path').basename(__filename) const fs = require('fs') -const demo_json_filepath = 'docs/www/r/js/test-records.json' -const put_post_json_filepath = 'docs/www/r/js/put-post-records.json' +const demo_json_filepath = 'docs/www/demo/r/js/test-records.json' +const put_post_json_filepath = 'docs/www/demo/r/js/put-post-records.json' module.exports.localize = async function () { if (!config.get('enable.demo_localization')) { From ca583e8fce588fffd39e06fd49245fa18670c603 Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Tue, 3 Sep 2019 11:21:35 +0100 Subject: [PATCH 02/30] fixed mount point. Updated documentation --- README.md | 93 ++++++++++++++++-- config/default.json | 23 ++--- config/development.json | 2 +- docs/www/{demo => }/admin.html | 20 ++-- docs/www/{demo => }/api-demo.html | 21 ++-- docs/www/{demo => }/crawl.html | 21 ++-- docs/www/index.html | 20 ++-- docs/www/{demo => }/r/css/bootstrap.css | 0 docs/www/{demo => }/r/css/bootstrap.min.css | 0 .../{demo => }/r/css/highlight-darcula.css | 0 .../www/{demo => }/r/css/highlight-vs2015.css | 0 .../r/css/ie10-viewport-bug-workaround.css | 0 docs/www/{demo => }/r/css/site.css | 0 .../r/img/logo/logo-cinecert-2019-h0100.png | Bin .../r/img/logo/logo-dalet-2019-h0100.png | Bin .../r/img/logo/logo-dpp-2019-h0100.png | Bin .../logo-editshare-strapline-2019-h0100.png | Bin .../r/img/logo/logo-eidr-2019-h0100.png | Bin .../logo-hochschule-rheinmain-2019-h0100.png | Bin .../logo/logo-marquise-tech-2019-h0044.png | Bin .../r/img/logo/logo-ownzones-2019-h0100.png | Bin .../r/img/logo/logo-pbs-2019-h0100.jpg | Bin ...go-prime-focus-technologies-2019-h0100.png | Bin .../logo/logo-rohde-schwarz-2019-h0101.png | Bin .../r/img/logo/logo-signiant-2019-h0100.png | Bin .../r/img/logo/logo-tedial-2019-h0100.png | Bin .../img/logo/logo-turner-white-2019-h0100.png | Bin .../r/img/logo/mrmxf-icon-circle-128.png | Bin .../r/img/mm-card-rear-2019-1000h.png | Bin docs/www/{demo => }/r/js/admin-scripts.js | 6 +- docs/www/{demo => }/r/js/bootswatch.js | 0 docs/www/{demo => }/r/js/common-scripts.js | 58 +++++++---- docs/www/{demo => }/r/js/crawl-scripts.js | 4 +- docs/www/{demo => }/r/js/demo-scripts.js | 2 +- docs/www/{demo => }/r/js/highlight.js | 0 docs/www/{demo => }/r/js/index-scripts.js | 3 +- docs/www/{demo => }/r/js/marked.min.js | 0 docs/www/{demo => }/r/js/mermaid.min.js | 0 .../www/{demo => }/r/js/put-post-records.json | 0 docs/www/{demo => }/r/js/test-records.json | 0 package-lock.json | 24 +++++ package.json | 1 + src/api-admin.js | 59 +++++++---- src/api-assets.js | 2 +- src/api-crawl-fs.js | 6 +- src/api-scan-s3.js | 1 + src/demo-localize-test-data.js | 4 +- src/imf-mm-api-server.js | 17 ++-- src/start_local.js | 6 +- 49 files changed, 265 insertions(+), 128 deletions(-) rename docs/www/{demo => }/admin.html (86%) rename docs/www/{demo => }/api-demo.html (86%) rename docs/www/{demo => }/crawl.html (86%) rename docs/www/{demo => }/r/css/bootstrap.css (100%) rename docs/www/{demo => }/r/css/bootstrap.min.css (100%) rename docs/www/{demo => }/r/css/highlight-darcula.css (100%) rename docs/www/{demo => }/r/css/highlight-vs2015.css (100%) rename docs/www/{demo => }/r/css/ie10-viewport-bug-workaround.css (100%) rename docs/www/{demo => }/r/css/site.css (100%) rename docs/www/{demo => }/r/img/logo/logo-cinecert-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-dalet-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-dpp-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-editshare-strapline-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-eidr-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-marquise-tech-2019-h0044.png (100%) rename docs/www/{demo => }/r/img/logo/logo-ownzones-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-pbs-2019-h0100.jpg (100%) rename docs/www/{demo => }/r/img/logo/logo-prime-focus-technologies-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-rohde-schwarz-2019-h0101.png (100%) rename docs/www/{demo => }/r/img/logo/logo-signiant-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-tedial-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/logo-turner-white-2019-h0100.png (100%) rename docs/www/{demo => }/r/img/logo/mrmxf-icon-circle-128.png (100%) rename docs/www/{demo => }/r/img/mm-card-rear-2019-1000h.png (100%) rename docs/www/{demo => }/r/js/admin-scripts.js (97%) rename docs/www/{demo => }/r/js/bootswatch.js (100%) rename docs/www/{demo => }/r/js/common-scripts.js (79%) rename docs/www/{demo => }/r/js/crawl-scripts.js (93%) rename docs/www/{demo => }/r/js/demo-scripts.js (99%) rename docs/www/{demo => }/r/js/highlight.js (100%) rename docs/www/{demo => }/r/js/index-scripts.js (69%) rename docs/www/{demo => }/r/js/marked.min.js (100%) rename docs/www/{demo => }/r/js/mermaid.min.js (100%) rename docs/www/{demo => }/r/js/put-post-records.json (100%) rename docs/www/{demo => }/r/js/test-records.json (100%) diff --git a/README.md b/README.md index fff24b6..6b5aa9f 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,27 @@ A node server to implement the IMF Media Management API with a choice of databases +The default behaviour is to provide a simple app that will scan one or more folders for IMF +assets, build a database of those assets and then serve the locations of those assets based +on the IDs or hash values found. New assets can be registered using the API. + +The app is controlled via your system's default browser and has been tested with Chrome, Chromium +Firefox and Edge on Windows & Linux. The cloud deployment is available at [imf-mm-api.cloud](https://imf-mm-api.cloud). + +You can modify the behaviour by changing the config (see below). This will allow you to disable certain +funcitons or to mount the application on a server somethwere other than the root of the domain. + +This app is meant to demonstrate the API functionality. The backend is not intended for production. +Contact [Mr MXF](https://mrmxf.com) if you need something more robust. + ## installation ### to just run the code * install node 8.10 or above +* clone (or download and unzip) the repository into a folder +* `cd` into that folder +* install dependencies `npm install --production` * create a `.env` file with how you want to run the code and credentials for AWS if you are going to use AWS SimpleDB as your database @@ -32,9 +48,6 @@ export AWS_ACCESS_KEY_ID export AWS_SECRET_ACCESS_KEY ``` -* clone (or download and unzip) the repository into a folder -* `cd` into that folder -* install dependencies `npm install --production` * check the config file based on the value of `NODE_ENV` in `.env` * start the server * one off run: `npm start` @@ -69,6 +82,9 @@ properly until a few bugs are ironed out. Probably August 2019 for that update. ## AWS requirements +To use the simpledb cloud database as the backend, you will need to provide AWS keys that allow the +creation of a simpledb domain and access to Simpledb records. + All AWS credentials are taken from environment variables - it's up to you to make them right before executing the demo server if you're going to use the AWS facilities of the demo. @@ -124,10 +140,75 @@ to replicate the s3 bucket storage and replicated the SimpleDB back end: } ``` +## config + +`default.json` has the master list of all the configuration options. These properties are +overloaded by `NODE_ENV` that controls the functiona mode of the app. For example, you might +make some changes and run the software with `NODE_ENV` set to `staging` so that you can test +the changes along side your main server. + +### config options + +* `port {number}` controls the port that the server will respond to +* `app_name {string]` used when `GET admin/info` is requested +* `app_version {string]` used when `GET admin/info` is requested +* `app_authors {string]` used when `GET admin/info` is requested +* `api_prefix {string]` controls the url prefix for API response e.g. `GET staging/assets` +* `database {object}` + * `database.type {string}` is either `local` or `aws-simple-db` other values require updating `src/db.js` + * `database.local_filename {string}` relative filename for database when type is `local` e.g. `db/imf-mm-api-lowdb.json` + * `database.simpledb_domain_name {string}` domain name used for aws simpledb e.g. `imf-mm-api-server-js` +* `default_get_limit {number}` paging control for `GET` responses. API default is `20` +* `enable {object}` controls which functions are enabled or disabled + * `enable.admin {boolean}`": global switch for the `/admin` route + * `GET admin/info` information about the running app + * `GET admin/db-info` information about the database in use + * `GET admin/readme` the current (unprocessed) README.md for the app + * `DELETE admin/db` delete and recreate the current database + * `enable.admin_delete_db {boolean}` additional control to prevent database deletion when `enable.admin` is true + * `enable.assets {boolean}` enable the assets API + * `enable.crawl {boolean}` enable population of the database by crawling folders specified in the config files + * `enable.www {boolean}` enable serving static pages for interactive use + * `enable.load_home_page_on_boot {boolean}` when the app is run, use the OS to open a browser (turn off in the cloud!) + * `enable.extended_status_messages {boolean}` append the description text from the assets API swagger document to error responses + * `enable.synth_local_test_data {boolean}` recreate run time information for the local IMF test assets + (only needed if you make changes to the `__test__/assets-xxx` folders. Set to `false` if program folder is write protected) +* `mount_point` set the url to which all the end points are mounted - very handy with cloudfront + * e.g. `/` to respond to **GET /assets** + * e.g. `/my_cloudfront_host/web_root` to respond to **GET /my_cloudfront_host/web_root/assets** +* `imf_asset_sources {array}` determines where the crawl function will search for IMF assets. If the array + element is a string then it is treated as a file root and search is performed hierarchically below that folder. + If the array element is an object, then is is treated as an s3 bucket object and the appropriate access + permissions should be available via the environment keys + * e.g. `[ "__test__/assets-imf" ]` default value to search the test assets supplied with this app + * e.g. `[ "\\\\unc_mount\\win\\doze\\folder", "/mnt/nfs/nix/folder" ]` scanning network folders + * e.g. `[{"arn": "arn:aws:s3:::imf-mm-api-media","bucket": "imf-mm-api-media","root": "media/bs500","region": "us-east-2"}]` + * `object.arn {string}` the arn of the bucket to be crawled + * `object.bucket {string}` the name of the bucket + * `object.root {string}` the path below which the crawler should crawl for IMF assets + * `object.region {string` the region in which the bucet is located +* `lambda {object}` The lambda functionality is currently not working - **BO NOT USE** + * `lambda.params.name {string}` name of the lambda function implementing these end points e.g. "imf-api-staging-test", + * `lambda.params.role {string` role with access rights e.g. "arn:aws:iam::217890066136:role/service-role/mm-lambda-api-gateway-role" + * `lambda.options.region {string}` deployed region of the lambda function e.g. "eu-east-2" + * `lambda.options.profile" e.g. "default" +* `log_options {object}` controls the logging of the server. Logs are created in JSON format by [pino](https://github.com/pinojs). + There are many adapters and converters to make the logs usable in elasticsearch, excel or whatever religion is your favourite. + * `log_options.level {string}` minimum level of logs to be output. Values are: fatal, error, warn, info, debug, trace, silent + * `log_options.prettyPrint {boolean}` makes the console output of the logs pretty. This slows the world down. + * `log_options.show_config_sources {boolean}` dumps the configuration sources in the order they were loaded. A security risk in a live system + * `log_options.log_api_access {boolean}` loads the logger into the server stack to log all access to the server. +* `provider_id {string}` The provider id that will be insered into the database when this app uses the POST or PUT methods + e.g. "imf-mm-api Demo App", + ## API Change Log +* 2019-09-03 deployment updates + * fixed mounting of the app under defferent routes by providing `config.mount_point` + * updated cloud instance for testing with `staging`, `beta` and `1/` end points + * improved documentation * 2019-08-23 v0.4 of the API - * Added 415 response when POST body cannot be parsed by server - * Documented ETag behaviour in GET /asset/{id} - * Changed locationProviderId to an array of strings and added documentation on aggregation + * Added 415 response when POST body cannot be parsed by server + * Documented ETag behaviour in GET /asset/{id} + * Changed locationProviderId to an array of strings and added documentation on aggregation * 2019-06-10 v0.3 of the API and its initial publication diff --git a/config/default.json b/config/default.json index b60d905..8df3b44 100644 --- a/config/default.json +++ b/config/default.json @@ -5,7 +5,7 @@ "API messages are defined in the OpenAPI spec which is renamed and loaded as default.yaml", "the default port is 3000 assuming any serious use of this demo software is behing a proxy like NGINX", "config.api_prefix is the integer published version number for the url e.g. localhost:3000/1/assets", - "config.imf_asset_folders enumenrates a list of folders that the crawl API will search", + "config.imf_asset_sources enumenrates a list of folders that the crawl API will search", "default_get_limit controls the number of values returned in a page of the assets API" ], "port": 3000, @@ -23,16 +23,18 @@ }, "default_get_limit": 20, "enable":{ - "_help": "these booleans turn individual features and APIs on or off depending on how you want the software to work", + "_help": "these booleans turn individual features and APIs on or off depending on how you want the software to work - see README.md", "admin": true, + "admin_delete_db": false, "assets": true, "crawl": true, - "scan": true, "www": true, - "demo_localization": true, - "extended_status_messages": true + "load_home_page_on_boot": true, + "extended_status_messages": true, + "synth_local_test_data": true }, - "imf_asset_folders":[ + "mount_point": "/demo", + "imf_asset_sources":[ "__test__/assets-imf" ], "lambda": { @@ -52,12 +54,5 @@ "show_config_sources": false, "log_api_access": false }, - "provider_id": "imf-mm-api Demo App", - "s3_asset_buckets": [{ - "comment": "hierarichally scan below this public bs500 root for IMF assets", - "arn": "arn:aws:s3:::imf-mm-api-media", - "bucket": "imf-mm-api-media", - "root": "media/bs500", - "region": "us-east-2" - }] + "provider_id": "imf-mm-api Demo App" } \ No newline at end of file diff --git a/config/development.json b/config/development.json index f736091..151933d 100644 --- a/config/development.json +++ b/config/development.json @@ -10,7 +10,7 @@ "database":{ "type":"local" }, - "imf_asset_folders":[ + "imf_asset_sources":[ "__test__/assets-imf" ] } \ No newline at end of file diff --git a/docs/www/demo/admin.html b/docs/www/admin.html similarity index 86% rename from docs/www/demo/admin.html rename to docs/www/admin.html index 3e36189..49e8dd6 100644 --- a/docs/www/demo/admin.html +++ b/docs/www/admin.html @@ -8,7 +8,7 @@ - + @@ -18,11 +18,11 @@ - - + + - + @@ -34,14 +34,14 @@
@@ -82,8 +82,8 @@

Admin response:

- - + + diff --git a/docs/www/demo/api-demo.html b/docs/www/api-demo.html similarity index 86% rename from docs/www/demo/api-demo.html rename to docs/www/api-demo.html index 48bed39..7d6351d 100644 --- a/docs/www/demo/api-demo.html +++ b/docs/www/api-demo.html @@ -8,7 +8,7 @@ - + @@ -18,11 +18,11 @@ - - + + - + @@ -34,15 +34,14 @@
@@ -83,8 +82,8 @@

API response:

- - + + diff --git a/docs/www/demo/crawl.html b/docs/www/crawl.html similarity index 86% rename from docs/www/demo/crawl.html rename to docs/www/crawl.html index 6b60e95..6c480bc 100644 --- a/docs/www/demo/crawl.html +++ b/docs/www/crawl.html @@ -8,7 +8,7 @@ - + @@ -18,11 +18,11 @@ - - + + - + @@ -34,15 +34,14 @@
@@ -83,8 +82,8 @@

Crawl response:

- - + + diff --git a/docs/www/index.html b/docs/www/index.html index cdcb9ee..78c57de 100644 --- a/docs/www/index.html +++ b/docs/www/index.html @@ -8,7 +8,7 @@ - + @@ -19,11 +19,11 @@ integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"> - - + + - + @@ -35,14 +35,14 @@
- - + + diff --git a/docs/www/demo/r/css/bootstrap.css b/docs/www/r/css/bootstrap.css similarity index 100% rename from docs/www/demo/r/css/bootstrap.css rename to docs/www/r/css/bootstrap.css diff --git a/docs/www/demo/r/css/bootstrap.min.css b/docs/www/r/css/bootstrap.min.css similarity index 100% rename from docs/www/demo/r/css/bootstrap.min.css rename to docs/www/r/css/bootstrap.min.css diff --git a/docs/www/demo/r/css/highlight-darcula.css b/docs/www/r/css/highlight-darcula.css similarity index 100% rename from docs/www/demo/r/css/highlight-darcula.css rename to docs/www/r/css/highlight-darcula.css diff --git a/docs/www/demo/r/css/highlight-vs2015.css b/docs/www/r/css/highlight-vs2015.css similarity index 100% rename from docs/www/demo/r/css/highlight-vs2015.css rename to docs/www/r/css/highlight-vs2015.css diff --git a/docs/www/demo/r/css/ie10-viewport-bug-workaround.css b/docs/www/r/css/ie10-viewport-bug-workaround.css similarity index 100% rename from docs/www/demo/r/css/ie10-viewport-bug-workaround.css rename to docs/www/r/css/ie10-viewport-bug-workaround.css diff --git a/docs/www/demo/r/css/site.css b/docs/www/r/css/site.css similarity index 100% rename from docs/www/demo/r/css/site.css rename to docs/www/r/css/site.css diff --git a/docs/www/demo/r/img/logo/logo-cinecert-2019-h0100.png b/docs/www/r/img/logo/logo-cinecert-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-cinecert-2019-h0100.png rename to docs/www/r/img/logo/logo-cinecert-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-dalet-2019-h0100.png b/docs/www/r/img/logo/logo-dalet-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-dalet-2019-h0100.png rename to docs/www/r/img/logo/logo-dalet-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-dpp-2019-h0100.png b/docs/www/r/img/logo/logo-dpp-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-dpp-2019-h0100.png rename to docs/www/r/img/logo/logo-dpp-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-editshare-strapline-2019-h0100.png b/docs/www/r/img/logo/logo-editshare-strapline-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-editshare-strapline-2019-h0100.png rename to docs/www/r/img/logo/logo-editshare-strapline-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-eidr-2019-h0100.png b/docs/www/r/img/logo/logo-eidr-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-eidr-2019-h0100.png rename to docs/www/r/img/logo/logo-eidr-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png b/docs/www/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png rename to docs/www/r/img/logo/logo-hochschule-rheinmain-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-marquise-tech-2019-h0044.png b/docs/www/r/img/logo/logo-marquise-tech-2019-h0044.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-marquise-tech-2019-h0044.png rename to docs/www/r/img/logo/logo-marquise-tech-2019-h0044.png diff --git a/docs/www/demo/r/img/logo/logo-ownzones-2019-h0100.png b/docs/www/r/img/logo/logo-ownzones-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-ownzones-2019-h0100.png rename to docs/www/r/img/logo/logo-ownzones-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-pbs-2019-h0100.jpg b/docs/www/r/img/logo/logo-pbs-2019-h0100.jpg similarity index 100% rename from docs/www/demo/r/img/logo/logo-pbs-2019-h0100.jpg rename to docs/www/r/img/logo/logo-pbs-2019-h0100.jpg diff --git a/docs/www/demo/r/img/logo/logo-prime-focus-technologies-2019-h0100.png b/docs/www/r/img/logo/logo-prime-focus-technologies-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-prime-focus-technologies-2019-h0100.png rename to docs/www/r/img/logo/logo-prime-focus-technologies-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-rohde-schwarz-2019-h0101.png b/docs/www/r/img/logo/logo-rohde-schwarz-2019-h0101.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-rohde-schwarz-2019-h0101.png rename to docs/www/r/img/logo/logo-rohde-schwarz-2019-h0101.png diff --git a/docs/www/demo/r/img/logo/logo-signiant-2019-h0100.png b/docs/www/r/img/logo/logo-signiant-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-signiant-2019-h0100.png rename to docs/www/r/img/logo/logo-signiant-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-tedial-2019-h0100.png b/docs/www/r/img/logo/logo-tedial-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-tedial-2019-h0100.png rename to docs/www/r/img/logo/logo-tedial-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/logo-turner-white-2019-h0100.png b/docs/www/r/img/logo/logo-turner-white-2019-h0100.png similarity index 100% rename from docs/www/demo/r/img/logo/logo-turner-white-2019-h0100.png rename to docs/www/r/img/logo/logo-turner-white-2019-h0100.png diff --git a/docs/www/demo/r/img/logo/mrmxf-icon-circle-128.png b/docs/www/r/img/logo/mrmxf-icon-circle-128.png similarity index 100% rename from docs/www/demo/r/img/logo/mrmxf-icon-circle-128.png rename to docs/www/r/img/logo/mrmxf-icon-circle-128.png diff --git a/docs/www/demo/r/img/mm-card-rear-2019-1000h.png b/docs/www/r/img/mm-card-rear-2019-1000h.png similarity index 100% rename from docs/www/demo/r/img/mm-card-rear-2019-1000h.png rename to docs/www/r/img/mm-card-rear-2019-1000h.png diff --git a/docs/www/demo/r/js/admin-scripts.js b/docs/www/r/js/admin-scripts.js similarity index 97% rename from docs/www/demo/r/js/admin-scripts.js rename to docs/www/r/js/admin-scripts.js index 07e980e..f65bcb0 100644 --- a/docs/www/demo/r/js/admin-scripts.js +++ b/docs/www/r/js/admin-scripts.js @@ -21,14 +21,14 @@ demo.make_admin_buttons = function (response_element_id) { rows.push(demo.synth({ label: "App info", mode: "GET", - url: '/admin/info', + url: 'admin/info', element_id: response_element_id, help: 'get information about the running application', })) rows.push(demo.synth({ label: "DB info", mode: "GET", - url: '/admin/db-info', + url: 'admin/db-info', element_id: response_element_id, help: 'get information about the current database', })) @@ -37,7 +37,7 @@ demo.make_admin_buttons = function (response_element_id) { id: 'delete_button', label: "Reset the database (DANGER)", mode: "DELETE", - url: `/admin/db`, + url: `admin/db`, element_id: response_element_id, help: 'DANGER - this cannot be undone', eventListener: demo.delete_eventListener, diff --git a/docs/www/demo/r/js/bootswatch.js b/docs/www/r/js/bootswatch.js similarity index 100% rename from docs/www/demo/r/js/bootswatch.js rename to docs/www/r/js/bootswatch.js diff --git a/docs/www/demo/r/js/common-scripts.js b/docs/www/r/js/common-scripts.js similarity index 79% rename from docs/www/demo/r/js/common-scripts.js rename to docs/www/r/js/common-scripts.js index 8521e86..3e45f84 100644 --- a/docs/www/demo/r/js/common-scripts.js +++ b/docs/www/r/js/common-scripts.js @@ -55,25 +55,45 @@ demo.get_data = function (url, callback) { xhr.send(); } -demo.get_app_info = function () { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (this.readyState == 4) { - let inf = JSON.parse(xhr.responseText) - demo.info = inf - for (let z = 0; z < demo.overwrite_with_mode.length; z++) { - let thing = document.getElementById(demo.overwrite_with_mode[z]) - if (thing) { - thing.innerHTML += ` (${inf.app_name} ` + - `v${inf.app_version} in ` + - `${inf.node_env} mode)` +demo.get_app_info = async () => { + var xhr = new XMLHttpRequest() + + return new Promise((resolve, reject) => { + xhr.onreadystatechange = function () { + if (this.readyState == 4) { + let inf = JSON.parse(xhr.responseText) + demo.info = inf + for (let z = 0; z < demo.overwrite_with_mode.length; z++) { + let thing = document.getElementById(demo.overwrite_with_mode[z]) + if (thing) { + thing.innerHTML += ` (${inf.app_name} ` + + `v${inf.app_version} in ` + + `${inf.node_env} mode)` + } } + resolve(demo.info) } - } - }; - //wait for the response of the call - xhr.open("GET", "/admin/info", true); - xhr.send(); + }; + //wait for the response of the call + xhr.open("GET", "admin/info", true); + xhr.send(); + }) +} + +demo.get_readme = async () => { + var xhr = new XMLHttpRequest(); + + return new Promise((resolve, reject) => { + xhr.onreadystatechange = function () { + if (this.readyState == 4) { + demo.readme = xhr.responseText + resolve(demo.readme) + } + }; + //wait for the response of the call + xhr.open("GET", "admin/readme", true); + xhr.send(); + }) } demo.get_test_data = async () => { @@ -86,7 +106,7 @@ demo.get_test_data = async () => { } }; //wait for the response of the call - xhr.open("GET", "/demo/r/js/test-records.json", true); + xhr.open("GET", "r/js/test-records.json", true); xhr.send(); }) } @@ -94,7 +114,7 @@ demo.get_test_data = async () => { demo.get_non_crawl_data = async () => { return new Promise((resolve, reject) => { var xhr = new XMLHttpRequest() - xhr.open("GET", "/demo/r/js/put-post-records.json", true); + xhr.open("GET", "r/js/put-post-records.json", true); xhr.onreadystatechange = function () { if (this.readyState == 4) { let data = JSON.parse(xhr.responseText) diff --git a/docs/www/demo/r/js/crawl-scripts.js b/docs/www/r/js/crawl-scripts.js similarity index 93% rename from docs/www/demo/r/js/crawl-scripts.js rename to docs/www/r/js/crawl-scripts.js index 13ada64..da9230f 100644 --- a/docs/www/demo/r/js/crawl-scripts.js +++ b/docs/www/r/js/crawl-scripts.js @@ -4,14 +4,14 @@ demo.make_crawl_buttons = function (response_element_id) { rows.push(demo.synth({ label: "Initiate a crawl", mode: "POST", - url: '/crawl/start', + url: 'crawl/start', element_id: response_element_id, help: 'start a crawl', })) rows.push(demo.synth({ label: "Get crawl status", mode: "GET", - url: `/crawl`, + url: `crawl`, element_id: response_element_id, help: 'status of crawl', })) diff --git a/docs/www/demo/r/js/demo-scripts.js b/docs/www/r/js/demo-scripts.js similarity index 99% rename from docs/www/demo/r/js/demo-scripts.js rename to docs/www/r/js/demo-scripts.js index a3bd247..4f896c3 100644 --- a/docs/www/demo/r/js/demo-scripts.js +++ b/docs/www/r/js/demo-scripts.js @@ -13,7 +13,7 @@ demo.make_demo_buttons = function (response_element_id, data) { rows.push(demo.synth({ label: "home page", mode: "GET", - url: '/', + url: '', element_id: response_element_id, help: 'return the website home page to prove script is working', })) diff --git a/docs/www/demo/r/js/highlight.js b/docs/www/r/js/highlight.js similarity index 100% rename from docs/www/demo/r/js/highlight.js rename to docs/www/r/js/highlight.js diff --git a/docs/www/demo/r/js/index-scripts.js b/docs/www/r/js/index-scripts.js similarity index 69% rename from docs/www/demo/r/js/index-scripts.js rename to docs/www/r/js/index-scripts.js index 63b2386..5f0ffa2 100644 --- a/docs/www/demo/r/js/index-scripts.js +++ b/docs/www/r/js/index-scripts.js @@ -1,8 +1,9 @@ const init_page = async() => { await demo.get_app_info() + await demo.get_readme() let markdown = document.getElementById('markdown-rendered-to-html-then-hidden-on-page-load') let html_out = document.getElementById('replaced-with-html-on-page-load') markdown.setAttribute('style', 'display:none;') - html_out.innerHTML = marked(markdown.innerText) + html_out.innerHTML = marked(markdown.innerText) + '

README.md

' + marked(demo.readme) } \ No newline at end of file diff --git a/docs/www/demo/r/js/marked.min.js b/docs/www/r/js/marked.min.js similarity index 100% rename from docs/www/demo/r/js/marked.min.js rename to docs/www/r/js/marked.min.js diff --git a/docs/www/demo/r/js/mermaid.min.js b/docs/www/r/js/mermaid.min.js similarity index 100% rename from docs/www/demo/r/js/mermaid.min.js rename to docs/www/r/js/mermaid.min.js diff --git a/docs/www/demo/r/js/put-post-records.json b/docs/www/r/js/put-post-records.json similarity index 100% rename from docs/www/demo/r/js/put-post-records.json rename to docs/www/r/js/put-post-records.json diff --git a/docs/www/demo/r/js/test-records.json b/docs/www/r/js/test-records.json similarity index 100% rename from docs/www/demo/r/js/test-records.json rename to docs/www/r/js/test-records.json diff --git a/package-lock.json b/package-lock.json index 7291d72..6c40773 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5379,6 +5379,30 @@ "passthrough-counter": "^1.0.0" } }, + "koa-mount": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/koa-mount/-/koa-mount-4.0.0.tgz", + "integrity": "sha512-rm71jaA/P+6HeCpoRhmCv8KVBIi0tfGuO/dMKicbQnQW/YJntJ6MnnspkodoA4QstMVEZArsCphmd0bJEtoMjQ==", + "requires": { + "debug": "^4.0.1", + "koa-compose": "^4.1.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "koa-openapi": { "version": "3.13.5", "resolved": "https://registry.npmjs.org/koa-openapi/-/koa-openapi-3.13.5.tgz", diff --git a/package.json b/package.json index d128f84..1cdf438 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "koa-body": "^4.1.1", "koa-bodyparser": "^4.2.1", "koa-logger": "^3.2.1", + "koa-mount": "^4.0.0", "koa-pino-logger": "^2.1.3", "koa-router": "^7.4.0", "koa-static": "^5.0.0", diff --git a/src/api-admin.js b/src/api-admin.js index 293cd76..cacdee1 100644 --- a/src/api-admin.js +++ b/src/api-admin.js @@ -84,34 +84,53 @@ const get_database_info = async (ctx, next) => { await next() } -const reset_db = async (ctx, next) => { +/** return the current README file + * + * @returns {String} the readme.md file from the root folder + */ +const get_readme = async (ctx, next) => { + ctx.status = 200 ctx.set('Content-Type', 'application/json') - let db = require('./db') - let posted = await db.reset() - .catch(e => { - log.error(`${rJ(_module + ': ')}reset db: ${e.message} from ${e.fileName}(${e.lineNumber})`) - ctx.status = 500 - ctx.body = JSON.stringify( - { - db_type: db.type, - db_status: e.message, - } - ) - }) - .then(async (res) => { - ctx.status = 204 - let info = await db.info() + ctx.body = fs.readFileSync('README.md') + await next() +} - //prettify the JSON with an indent of 2 - ctx.body = JSON.stringify(info, undefined, 2) - await next() - }) +const reset_db = async (ctx, next) => { + ctx.set('Content-Type', 'application/json') + + if (config.get('enable.admin_delete_db')) { + let db = require('./db') + let posted = await db.reset() + .catch(e => { + log.error(`${rJ(_module + ': ')}reset db: ${e.message} from ${e.fileName}(${e.lineNumber})`) + ctx.status = 500 + ctx.body = JSON.stringify( + { + db_type: db.type, + db_status: e.message, + } + ) + }) + .then(async (res) => { + ctx.status = 204 + let info = await db.info() + + //prettify the JSON with an indent of 2 + ctx.body = JSON.stringify(info, undefined, 2) + await next() + }) + } else { + //deleting the dB has been disable + ctx.status = 405 + ctx.body = 'Deletion of the database has been disable. Please contact the administrator.' + } }; router.get(`/info`, get_system_info) router.get(`/db-info`, get_database_info) router.delete(`/db`, reset_db) +router.get(`/readme`, get_readme) log.info(`${rJ('module: ')}api-admin initialised`) diff --git a/src/api-assets.js b/src/api-assets.js index d2ba95b..96ade2c 100644 --- a/src/api-assets.js +++ b/src/api-assets.js @@ -172,6 +172,6 @@ router.put(`/${config.get('api_prefix')}/assets/:id`, not_implemented) router.post(`/${config.get('api_prefix')}/assets/`, add_new_asset) router.delete(`/${config.get('api_prefix')}/assets/:id`, delete_asset) -log.info(`${rJ('module: ')}api-assets initialised`) +log.info(`${rJ('module: ')}api-assets initialised at /${config.get('api_prefix')}/assets`) module.exports = router; \ No newline at end of file diff --git a/src/api-crawl-fs.js b/src/api-crawl-fs.js index f015edf..d62de98 100644 --- a/src/api-crawl-fs.js +++ b/src/api-crawl-fs.js @@ -77,7 +77,7 @@ const get_crawl_status = async (ctx, next) => { } for (let p = 0; p < 1; p++) { let cstat = { - root: path.resolve(config.get('imf_asset_folders')[p]), + root: path.resolve(config.get('imf_asset_sources')[p]), } if (state == 'crawling') { @@ -110,7 +110,7 @@ const start_crawl_in_folder = async (ctx, next) => { ctx.set('Content-Type', 'application/json') // only crawl a single folder for now - crawler.crawl(path.resolve(config.get('imf_asset_folders')[0])) + crawler.crawl(path.resolve(config.get('imf_asset_sources')[0])) .then(async crawled_assets => { asset_list = crawled_assets @@ -133,7 +133,7 @@ const start_crawl_in_folder = async (ctx, next) => { { id: crawl_id, state: 'crawling', - root: path.resolve(config.get('imf_asset_folders')[0]), + root: path.resolve(config.get('imf_asset_sources')[0]), progress: 0, } ) diff --git a/src/api-scan-s3.js b/src/api-scan-s3.js index ebc3101..809ce56 100644 --- a/src/api-scan-s3.js +++ b/src/api-scan-s3.js @@ -1,3 +1,4 @@ +/** DEPRECATED - to be incorporated into crawl */ /* jshint node: true */ 'use strict' const config = require('config') diff --git a/src/demo-localize-test-data.js b/src/demo-localize-test-data.js index 995eb1e..441a7a3 100644 --- a/src/demo-localize-test-data.js +++ b/src/demo-localize-test-data.js @@ -16,8 +16,8 @@ const path = require('path') const _module = require('path').basename(__filename) const fs = require('fs') -const demo_json_filepath = 'docs/www/demo/r/js/test-records.json' -const put_post_json_filepath = 'docs/www/demo/r/js/put-post-records.json' +const demo_json_filepath = 'docs/www/r/js/test-records.json' +const put_post_json_filepath = 'docs/www/r/js/put-post-records.json' module.exports.localize = async function () { if (!config.get('enable.demo_localization')) { diff --git a/src/imf-mm-api-server.js b/src/imf-mm-api-server.js index d934a1a..b0ec097 100644 --- a/src/imf-mm-api-server.js +++ b/src/imf-mm-api-server.js @@ -8,7 +8,8 @@ const Koa = require('koa'); const pino = require('koa-pino-logger')({ prettyPrint: true, }) const config = require('config') const process = require('process') -var bodyParser = require('koa-bodyparser'); +const bodyParser = require('koa-bodyparser'); +const mount = require('koa-mount') const db = require('./db') const log = require('pino')(config.get('log_options')) @@ -29,29 +30,25 @@ server.mm_init = async function (option) { server.use(pino) } - //load teh body parser + //load the body parser server.use(bodyParser()) //load all the server modules depending on what was configured if (config.get('enable.www')) { let www = require('koa-static') - server.use(www('docs/www/', {})) + server.use(mount(config.get('mount_point'), www('docs/www/', {}))) } if (config.get('enable.admin')) { let api = require('./api-admin.js') - server.use(api.routes()) + server.use(mount(config.get('mount_point'), api.routes())) } if (config.get('enable.assets')) { let api = require('./api-assets.js') - server.use(api.routes()) + server.use(mount(config.get('mount_point'), api.routes())) } if (config.get('enable.crawl')) { let api = require('./api-crawl-fs.js') - server.use(api.routes()) - } - if (config.get('enable.scan')) { - let api = require('./api-scan-s3.js') - server.use(api.routes()) + server.use(mount(config.get('mount_point'), api.routes())) } }) .catch((e) => { diff --git a/src/start_local.js b/src/start_local.js index 0967f23..cd2b750 100644 --- a/src/start_local.js +++ b/src/start_local.js @@ -54,6 +54,7 @@ if (process.env.PORT_OVERRIDE) { } const demo = require('./demo-localize-test-data.js') +if (config.get('enable.synth_local_test_data')) demo.localize() log.info(rJ('Using config') + config.get('_help')) @@ -84,8 +85,8 @@ server.mm_init() }) //if we have enabled serving of web pages then ask the OS to go to the home page -if (config.get('enable.www')) { - open(`http://localhost:${listen_on_port}`) +if (config.get('enable.www') && config.get('enable.load_home_page_on_boot')) { + open(`http://localhost:${listen_on_port}${config.get('mount_point')}/index.html`) } // The exports lines is only for the Jest test harness @@ -98,7 +99,6 @@ module.exports.server = server * Add config log access to aws Simple dB * Create gulp task to generate documentation * - documentation on methods - * - /scan * - /docs * - /crawl * Create gulp task to upload via sftp to a server From 820ca5f6cd819971ce4907eb560a249967af877f Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Tue, 3 Sep 2019 11:25:26 +0100 Subject: [PATCH 03/30] fixed typos, re-enabled deletion of db --- config/default.json | 2 +- docs/www/r/js/admin-scripts.js | 2 +- src/api-admin.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/default.json b/config/default.json index 8df3b44..4e51199 100644 --- a/config/default.json +++ b/config/default.json @@ -25,7 +25,7 @@ "enable":{ "_help": "these booleans turn individual features and APIs on or off depending on how you want the software to work - see README.md", "admin": true, - "admin_delete_db": false, + "admin_delete_db": true, "assets": true, "crawl": true, "www": true, diff --git a/docs/www/r/js/admin-scripts.js b/docs/www/r/js/admin-scripts.js index f65bcb0..ab63810 100644 --- a/docs/www/r/js/admin-scripts.js +++ b/docs/www/r/js/admin-scripts.js @@ -70,7 +70,7 @@ demo.make_admin_buttons = function (response_element_id) { let yes_button = demo.synth({ label: "Re-Init database", mode: "DELETE", - url: `/admin/db`, + url: `admin/db`, element_id: response_element_id, help: 'DANGER - this cannot be undone', }) diff --git a/src/api-admin.js b/src/api-admin.js index cacdee1..cef87da 100644 --- a/src/api-admin.js +++ b/src/api-admin.js @@ -123,7 +123,7 @@ const reset_db = async (ctx, next) => { } else { //deleting the dB has been disable ctx.status = 405 - ctx.body = 'Deletion of the database has been disable. Please contact the administrator.' + ctx.body = 'Deletion of the database has been disabled. Please contact the administrator.' } }; From a11f37ab665a9d7f63d0408870aa2b5337f73e9e Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Tue, 3 Sep 2019 13:44:58 +0100 Subject: [PATCH 04/30] start scripts lx & win for log routing --- config/default.json | 2 +- docs/www/r/css/site.css | 43 +++++++++++++----- go-demo.bat | 8 ++++ go-demo.sh | 9 ++++ package-lock.json | 79 ++++++++++++++++++++++++++++++++++ package.json | 1 + src/demo-localize-test-data.js | 2 +- src/start_local.js | 19 ++++---- 8 files changed, 140 insertions(+), 23 deletions(-) create mode 100644 go-demo.bat create mode 100644 go-demo.sh diff --git a/config/default.json b/config/default.json index 4e51199..05b444c 100644 --- a/config/default.json +++ b/config/default.json @@ -18,7 +18,7 @@ "database": { "_help": "databsae.type is either 'local' or 'aws-simple-db'", "type": "aws-simple-db", - "local_filename": "db/imf-mm-api-lowdb.json", + "local_filename": "db/imf-mm-api-lowdb.json", "simpledb_domain_name": "imf-mm-api-server-js" }, "default_get_limit": 20, diff --git a/docs/www/r/css/site.css b/docs/www/r/css/site.css index d5a47b2..310dd55 100755 --- a/docs/www/r/css/site.css +++ b/docs/www/r/css/site.css @@ -135,27 +135,50 @@ footer a { color: purple; } +/* style code elements */ +pre code.language-bash,pre code.language-json { + color: darkmagenta; + background-color: lightgrey; + display: block; + margin-left: 2rem; + padding: 1rem; +} + +pre code.language-json { + color: darkblue; +} + /* The Modal (background) */ .modal { - display: none; /* Hidden by default */ - position: fixed; /* Stay in place */ - z-index: 1; /* Sit on top */ + display: none; + /* Hidden by default */ + position: fixed; + /* Stay in place */ + z-index: 1; + /* Sit on top */ left: 0; top: 0; - width: 100%; /* Full width */ - height: 100%; /* Full height */ - overflow: auto; /* Enable scroll if needed */ - background-color: rgb(0,0,0); /* Fallback color */ - background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ + width: 100%; + /* Full width */ + height: 100%; + /* Full height */ + overflow: auto; + /* Enable scroll if needed */ + background-color: rgb(0, 0, 0); + /* Fallback color */ + background-color: rgba(0, 0, 0, 0.4); + /* Black w/ opacity */ } /* Modal Content/Box */ .modal-content { background-color: #fefefe; - margin: 15% auto; /* 15% from the top and centered */ + margin: 15% auto; + /* 15% from the top and centered */ padding: 20px; border: 1px solid #888; - width: 40em; /* Could be more or less, depending on text */ + width: 40em; + /* Could be more or less, depending on text */ } .close:hover, diff --git a/go-demo.bat b/go-demo.bat new file mode 100644 index 0000000..ecfba0d --- /dev/null +++ b/go-demo.bat @@ -0,0 +1,8 @@ +@echo off +rem @module go-demo.bat +rem +rem start the server and redirect the output to the logs folder +rem +rem MAKE SURE config.log_options.prettyPrint is OFF +rem +node src\start_local.js > logs\all-logs-win.log \ No newline at end of file diff --git a/go-demo.sh b/go-demo.sh new file mode 100644 index 0000000..7ddb5f2 --- /dev/null +++ b/go-demo.sh @@ -0,0 +1,9 @@ +# @module go-demo +# +# bash script to launch server under linux +# - run pino and the logger in different processes to get the best performance from node's single thread +# - output warnings and errors into a separate log +# +# MAKE SURE config.log_options.prettyPrint is OFF +# +node src/start_local.js | node node_modules/pino-tee/tee.js warn ./logs/warning.log > ./logs/all.log \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6c40773..037187d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6880,6 +6880,85 @@ "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-2.4.2.tgz", "integrity": "sha512-WaL504dO8eGs+vrK+j4BuQQq6GLKeCCcHaMB2ItygzVURcL1CycwNEUHTD/lHFHs/NL5qAz2UKrjYWXKSf4aMQ==" }, + "pino-tee": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pino-tee/-/pino-tee-0.2.2.tgz", + "integrity": "sha512-MqhqUtlHir0bsnU35qfuuoDEx9fq/vrW0pS5n4nWZKe9C1C67dvVDgYdaawRurQG/7SFxDKvfmEWz/1pEUbPbw==", + "requires": { + "cloneable-readable": "~1.0.0", + "fast-json-parse": "^1.0.3", + "minimist": "^1.2.0", + "pino": "^4.7.0", + "pump": "^1.0.2", + "readable-stream": "^2.3.3", + "split2": "^2.1.1" + }, + "dependencies": { + "cloneable-readable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", + "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^1.0.6", + "through2": "^2.0.1" + } + }, + "fast-safe-stringify": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-1.2.3.tgz", + "integrity": "sha512-QJYT/i0QYoiZBQ71ivxdyTqkwKkQ0oxACXHYxH2zYHJEgzi2LsbjgvtzTbLi1SZcF190Db2YP7I7eTsU2egOlw==" + }, + "pino": { + "version": "4.17.6", + "resolved": "https://registry.npmjs.org/pino/-/pino-4.17.6.tgz", + "integrity": "sha512-LFDwmhyWLBnmwO/2UFbWu1jEGVDzaPupaVdx0XcZ3tIAx1EDEBauzxXf2S0UcFK7oe+X9MApjH0hx9U1XMgfCA==", + "requires": { + "chalk": "^2.4.1", + "fast-json-parse": "^1.0.3", + "fast-safe-stringify": "^1.2.3", + "flatstr": "^1.0.5", + "pino-std-serializers": "^2.0.0", + "pump": "^3.0.0", + "quick-format-unescaped": "^1.1.2", + "split2": "^2.2.0" + }, + "dependencies": { + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "quick-format-unescaped": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-1.1.2.tgz", + "integrity": "sha1-DKWB3jF0vs7yWsPC6JVjQjgdtpg=", + "requires": { + "fast-safe-stringify": "^1.0.8" + } + } + } + }, "pirates": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", diff --git a/package.json b/package.json index 1cdf438..7043a19 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "moment": "^2.24.0", "open": "^6.4.0", "pino": "^5.13.2", + "pino-tee": "^0.2.2", "serverless-http": "^1.10.1", "simpledb": "^0.2.0", "xml2js": "^0.4.19" diff --git a/src/demo-localize-test-data.js b/src/demo-localize-test-data.js index 441a7a3..a6e959f 100644 --- a/src/demo-localize-test-data.js +++ b/src/demo-localize-test-data.js @@ -20,7 +20,7 @@ const demo_json_filepath = 'docs/www/r/js/test-records.json' const put_post_json_filepath = 'docs/www/r/js/put-post-records.json' module.exports.localize = async function () { - if (!config.get('enable.demo_localization')) { + if (!config.get('enable.synth_local_test_data')) { //if localization was turned off then return return } diff --git a/src/start_local.js b/src/start_local.js index cd2b750..17d6701 100644 --- a/src/start_local.js +++ b/src/start_local.js @@ -47,15 +47,11 @@ const open = require('open') const pino = require('pino') //log to stderr const log = pino(config.get('log_options'), pino.destination(2)) -let listen_on_port = config.get('port') -if (process.env.PORT_OVERRIDE) { - listen_on_port = process.env.PORT_OVERRIDE - console.log(`port: ${listen_on_port}`) -} const demo = require('./demo-localize-test-data.js') -if (config.get('enable.synth_local_test_data')) -demo.localize() +if (config.get('enable.synth_local_test_data')) { + demo.localize() +} log.info(rJ('Using config') + config.get('_help')) @@ -75,18 +71,19 @@ const server = require('./imf-mm-api-server') server.mm_init() .catch((e) => { //server failed to initialise - abort with a log - log.info(rJ('Server init failed:') + `port was ${listen_on_port}`) + log.info(rJ('Server init failed:') + `port was ${config.get('port')}`) }) .then(() => { //We should be ready to go now, so start the server on the required port - log.info(rJ('Listening on port:') + `${listen_on_port}`) + log.info(rJ('Listening on port:') + `${config.get('port')}`) log.info(rJ('Listening for api:') + `/${config.get('api_prefix')}/*`) - server.mm_http_instance = server.listen({ "port": listen_on_port, }) + server.mm_http_instance = server.listen({ "port": config.get('port'), }) }) //if we have enabled serving of web pages then ask the OS to go to the home page +let home_page = ('/' == config.get('mount_point')) ? '/index.html': `${config.get('mount_point')}/index.html` if (config.get('enable.www') && config.get('enable.load_home_page_on_boot')) { - open(`http://localhost:${listen_on_port}${config.get('mount_point')}/index.html`) + open(`http://localhost:${config.get('port')}${home_page}`) } // The exports lines is only for the Jest test harness From 7ebfc910cc8a4438e22d3ba396c3dac52b6fcfd8 Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Tue, 3 Sep 2019 14:11:34 +0100 Subject: [PATCH 05/30] added yaml parser for production --- db-local-test.json | 821 --------------------------------------------- go-demo.sh | 4 + package-lock.json | 8 +- package.json | 1 + 4 files changed, 7 insertions(+), 827 deletions(-) delete mode 100644 db-local-test.json diff --git a/db-local-test.json b/db-local-test.json deleted file mode 100644 index 695bfd7..0000000 --- a/db-local-test.json +++ /dev/null @@ -1,821 +0,0 @@ -{ - "assets": [ - { - "id": "urn:uuid:3c6102bf-7049-4d13-be87-bff2544d920b", - "value": { - "file_size": 2442, - "file_type": "ft.map", - "identifiers": [ - "urn:uuid:3c6102bf-7049-4d13-be87-bff2544d920b" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP1-imf-mm-api-put-post-1/ASSETMAP.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:sha1:67225712751c4ab8ec0412f874cf319a7348a2bf", - "value": { - "file_size": 16419, - "file_type": "ft.cpl", - "identifiers": [ - "urn:uuid:3a1eb9a5-5f16-4a6e-86be-e4d85cca2bd2", - "urn:sha1:67225712751c4ab8ec0412f874cf319a7348a2bf" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP1-imf-mm-api-put-post-1/CPL_3a1eb9a5-5f16-4a6e-86be-e4d85cca2bd2.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:9b8122f7-253e-4e28-874d-7e63172352f1", - "value": { - "file_size": 2027, - "file_type": "ft.pkl", - "identifiers": [ - "urn:uuid:9b8122f7-253e-4e28-874d-7e63172352f1" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP1-imf-mm-api-put-post-1/PKL_9b8122f7-253e-4e28-874d-7e63172352f1.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:3cbd6a6a-de57-745a-a47b-e16069e3581b", - "value": { - "file_size": 1346966, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:3cbd6a6a-de57-745a-a47b-e16069e3581b" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP1-imf-mm-api-put-post-1/testP1-imf-mm-api-put-post-1_a0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:987bfc4f-ecd2-246a-ada5-abf315d7a588", - "value": { - "file_size": 3295789, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:987bfc4f-ecd2-246a-ada5-abf315d7a588" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP1-imf-mm-api-put-post-1/testP1-imf-mm-api-put-post-1_v0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:342c218c-e22c-4320-83a6-9f939a965e3b", - "value": { - "file_size": 2442, - "file_type": "ft.map", - "identifiers": [ - "urn:uuid:342c218c-e22c-4320-83a6-9f939a965e3b" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP2-imf-mm-api-put-post-2/ASSETMAP.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:sha1:0a556ef1424d5e6fbd4e817c5df2b977d8cf6aa4", - "value": { - "file_size": 16420, - "file_type": "ft.cpl", - "identifiers": [ - "urn:uuid:da0c20d7-08c6-4803-bce5-8ad6583b1cfc", - "urn:sha1:0a556ef1424d5e6fbd4e817c5df2b977d8cf6aa4" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP2-imf-mm-api-put-post-2/CPL_da0c20d7-08c6-4803-bce5-8ad6583b1cfc.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:815aa2b2-caee-4207-b4f5-8bf2eeb7a87e", - "value": { - "file_size": 2027, - "file_type": "ft.pkl", - "identifiers": [ - "urn:uuid:815aa2b2-caee-4207-b4f5-8bf2eeb7a87e" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP2-imf-mm-api-put-post-2/PKL_815aa2b2-caee-4207-b4f5-8bf2eeb7a87e.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:f412b426-f1ad-2548-8f03-28df13ff9e50", - "value": { - "file_size": 1346966, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:f412b426-f1ad-2548-8f03-28df13ff9e50" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP2-imf-mm-api-put-post-2/testP2-imf-mm-api-put-post-2_a0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:3670998f-7f1a-b0d8-88d7-f100433e2515", - "value": { - "file_size": 3294509, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:3670998f-7f1a-b0d8-88d7-f100433e2515" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-put-post/testP2-imf-mm-api-put-post-2/testP2-imf-mm-api-put-post-2_v0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:b3bac52a-459b-4075-b2ab-2da51915c76b", - "value": { - "file_size": 2434, - "file_type": "ft.map", - "identifiers": [ - "urn:uuid:b3bac52a-459b-4075-b2ab-2da51915c76b" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/noise/test03-imf-mm-api-wnoise/ASSETMAP.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:sha1:44e4c5776622426278bd99e131be956636f571a8", - "value": { - "file_size": 16419, - "file_type": "ft.cpl", - "identifiers": [ - "urn:uuid:6396792b-6d65-45d5-aa0f-a59f1472338e", - "urn:sha1:44e4c5776622426278bd99e131be956636f571a8" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/noise/test03-imf-mm-api-wnoise/CPL_6396792b-6d65-45d5-aa0f-a59f1472338e.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:04085391-05d6-47c5-8dc3-ca7aefa79aa1", - "value": { - "file_size": 2019, - "file_type": "ft.pkl", - "identifiers": [ - "urn:uuid:04085391-05d6-47c5-8dc3-ca7aefa79aa1" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/noise/test03-imf-mm-api-wnoise/PKL_04085391-05d6-47c5-8dc3-ca7aefa79aa1.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:a0327d7d-b013-3f4b-b9f7-696fa07a24a5", - "value": { - "file_size": 1346966, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:a0327d7d-b013-3f4b-b9f7-696fa07a24a5" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/noise/test03-imf-mm-api-wnoise/test03-imf-mm-api-wnoise_a0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:6111757c-2fb5-f3ca-a48d-bebec5273410", - "value": { - "file_size": 3275801, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:6111757c-2fb5-f3ca-a48d-bebec5273410" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/noise/test03-imf-mm-api-wnoise/test03-imf-mm-api-wnoise_v0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:f0fcc3c8-79d5-4a9c-a1ba-250e2738825b", - "value": { - "file_size": 2434, - "file_type": "ft.map", - "identifiers": [ - "urn:uuid:f0fcc3c8-79d5-4a9c-a1ba-250e2738825b" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test00-imf-mm-api-0500Hz/ASSETMAP.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:sha1:a59f110dbed987eb86b6169e27867745806db4ad", - "value": { - "file_size": 16431, - "file_type": "ft.cpl", - "identifiers": [ - "urn:uuid:32e351c6-bf02-4b35-b4eb-36a283caf989", - "urn:sha1:a59f110dbed987eb86b6169e27867745806db4ad" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test00-imf-mm-api-0500Hz/CPL_32e351c6-bf02-4b35-b4eb-36a283caf989.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:8db0c988-a129-4654-a95e-c07321148d8d", - "value": { - "file_size": 2019, - "file_type": "ft.pkl", - "identifiers": [ - "urn:uuid:8db0c988-a129-4654-a95e-c07321148d8d" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test00-imf-mm-api-0500Hz/PKL_8db0c988-a129-4654-a95e-c07321148d8d.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:34ca64f5-300b-53fb-b4f3-d0035b015d9f", - "value": { - "file_size": 1346984, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:34ca64f5-300b-53fb-b4f3-d0035b015d9f" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test00-imf-mm-api-0500Hz/test00-imf-mm-api-0500Hz_a0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:80156451-2f8e-8138-8100-3d39b0f1c5fc", - "value": { - "file_size": 3277927, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:80156451-2f8e-8138-8100-3d39b0f1c5fc" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test00-imf-mm-api-0500Hz/test00-imf-mm-api-0500Hz_v0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:f5a782d8-08c9-461b-a266-37ccbcd4cd47", - "value": { - "file_size": 2434, - "file_type": "ft.map", - "identifiers": [ - "urn:uuid:f5a782d8-08c9-461b-a266-37ccbcd4cd47" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test01-imf-mm-api-1000Hz/ASSETMAP.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:sha1:c75fe60f16a05f58abb0cb4546d6608fe194002e", - "value": { - "file_size": 16427, - "file_type": "ft.cpl", - "identifiers": [ - "urn:uuid:8e0d6eec-1e41-49b8-92e1-db000f63d743", - "urn:sha1:c75fe60f16a05f58abb0cb4546d6608fe194002e" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test01-imf-mm-api-1000Hz/CPL_8e0d6eec-1e41-49b8-92e1-db000f63d743.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:dcceeba7-4860-4020-bc05-594a27e4472f", - "value": { - "file_size": 2019, - "file_type": "ft.pkl", - "identifiers": [ - "urn:uuid:dcceeba7-4860-4020-bc05-594a27e4472f" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test01-imf-mm-api-1000Hz/PKL_dcceeba7-4860-4020-bc05-594a27e4472f.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:fb9ec264-e88d-71e8-8a02-8611f2dc6861", - "value": { - "file_size": 1346978, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:fb9ec264-e88d-71e8-8a02-8611f2dc6861" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test01-imf-mm-api-1000Hz/test01-imf-mm-api-1000Hz_a0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:822fc1c1-cb0f-9d49-98bb-228651db4a5d", - "value": { - "file_size": 3263231, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:822fc1c1-cb0f-9d49-98bb-228651db4a5d" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test01-imf-mm-api-1000Hz/test01-imf-mm-api-1000Hz_v0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:9c264810-48f6-4d2f-a8ae-4cba2c22e4bc", - "value": { - "file_size": 2434, - "file_type": "ft.map", - "identifiers": [ - "urn:uuid:9c264810-48f6-4d2f-a8ae-4cba2c22e4bc" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test02-imf-mm-api-2000Hz/ASSETMAP.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:sha1:9ff0af71c888baefc8da63955d6044e794362528", - "value": { - "file_size": 16428, - "file_type": "ft.cpl", - "identifiers": [ - "urn:uuid:7da8c0b7-1078-494d-be68-f54639c61662", - "urn:sha1:9ff0af71c888baefc8da63955d6044e794362528" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test02-imf-mm-api-2000Hz/CPL_7da8c0b7-1078-494d-be68-f54639c61662.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:450c4465-2013-4304-9df6-5a59a4001486", - "value": { - "file_size": 2019, - "file_type": "ft.pkl", - "identifiers": [ - "urn:uuid:450c4465-2013-4304-9df6-5a59a4001486" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test02-imf-mm-api-2000Hz/PKL_450c4465-2013-4304-9df6-5a59a4001486.xml" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:70fa2807-8cc7-5eb9-90dd-931e4a0c56a6", - "value": { - "file_size": 1346978, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:70fa2807-8cc7-5eb9-90dd-931e4a0c56a6" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test02-imf-mm-api-2000Hz/test02-imf-mm-api-2000Hz_a0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - }, - { - "id": "urn:uuid:66c832b8-6c56-c038-853c-32d572716f23", - "value": { - "file_size": 3266285, - "file_type": "ft.mxf", - "identifiers": [ - "urn:uuid:66c832b8-6c56-c038-853c-32d572716f23" - ], - "locations": [ - "/home/bruce/git-hub/imf-mm-api/__test__/assets-imf/tones/test02-imf-mm-api-2000Hz/test02-imf-mm-api-2000Hz_v0.mxf" - ], - "providers": [ - "imf-mm-api Demo App" - ], - "user": { - "id": "usr-10000001", - "name": "mrmxf" - }, - "aws": { - "Key": "path/file.mxf", - "ETag": "value", - "LastModified": "date", - "StorageClasss": "STANDARD" - }, - "version": "0.1" - } - } - ], - "requests": [] -} \ No newline at end of file diff --git a/go-demo.sh b/go-demo.sh index 7ddb5f2..365d2b2 100644 --- a/go-demo.sh +++ b/go-demo.sh @@ -6,4 +6,8 @@ # # MAKE SURE config.log_options.prettyPrint is OFF # +# +# first make sure that the log folder exists +if [ ! -d "./logs" ]; then mkdir "./logs"; fi + node src/start_local.js | node node_modules/pino-tee/tee.js warn ./logs/warning.log > ./logs/all.log \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 037187d..a40e239 100644 --- a/package-lock.json +++ b/package-lock.json @@ -709,7 +709,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -2189,8 +2188,7 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "estraverse": { "version": "4.3.0", @@ -4954,7 +4952,6 @@ "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -7961,8 +7958,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "srcset": { "version": "1.0.0", diff --git a/package.json b/package.json index 7043a19..302f4a3 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "chokidar": "^3.0.2", "config": "^3.2.2", "dotenv": "^8.1.0", + "js-yaml": "^3.13.1", "json-format": "^1.0.1", "koa": "^2.8.1", "koa-body": "^4.1.1", From 32dfce13dce124071f6fc12c07ef5e79f6bd13b3 Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Tue, 3 Sep 2019 14:17:18 +0100 Subject: [PATCH 06/30] tweak ibc demo default logging profiles --- config/beta.json | 10 +++++++++- config/development.json | 4 +++- config/staging.json | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/config/beta.json b/config/beta.json index 84aa354..cbca466 100644 --- a/config/beta.json +++ b/config/beta.json @@ -1,5 +1,13 @@ { "annotation": "Beta Configuration", "port": 3001, - "prefix": "beta" + "prefix": "beta", + + "log_options": { + "_help": "you can set logging levels: fatal error warn info debug trace silent. prettyPrint and log_api_acces slow the world down", + "level": "error", + "prettyPrint": false, + "show_config_sources": false, + "log_api_access": true + } } \ No newline at end of file diff --git a/config/development.json b/config/development.json index 151933d..2588ff2 100644 --- a/config/development.json +++ b/config/development.json @@ -3,7 +3,9 @@ "port": 3333, "api_prefix": "dev", "log_options": { - "prettyPrint": true, + "_help": "you can set logging levels: fatal error warn info debug trace silent. prettyPrint and log_api_acces slow the world down", + "level": "info", + "prettyPrint": false, "show_config_sources": true, "log_api_access": true }, diff --git a/config/staging.json b/config/staging.json index 12d59a3..e40ef72 100644 --- a/config/staging.json +++ b/config/staging.json @@ -7,5 +7,13 @@ "type": "aws-simple-db", "local_filename": "db/imf-mm-api-lowdb-staging.json", "simpledb_domain_name": "imf-mm-api-staggin-test" + }, + + "log_options": { + "_help": "you can set logging levels: fatal error warn info debug trace silent. prettyPrint and log_api_acces slow the world down", + "level": "warn", + "prettyPrint": false, + "show_config_sources": true, + "log_api_access": true } } \ No newline at end of file From b028eef0acaa198845b339ea28718a07fae7190f Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Tue, 3 Sep 2019 14:18:47 +0100 Subject: [PATCH 07/30] second tweak of ibc profiles --- config/default.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.json b/config/default.json index 05b444c..045491e 100644 --- a/config/default.json +++ b/config/default.json @@ -17,7 +17,7 @@ "api_prefix": "1", "database": { "_help": "databsae.type is either 'local' or 'aws-simple-db'", - "type": "aws-simple-db", + "type": "local", "local_filename": "db/imf-mm-api-lowdb.json", "simpledb_domain_name": "imf-mm-api-server-js" }, From 1438084ea269dd5a3aad8e95e4bad2ab4bec582c Mon Sep 17 00:00:00 2001 From: Bruce Devlin Date: Wed, 4 Sep 2019 21:18:50 +0100 Subject: [PATCH 08/30] page link updates for IBC --- docs/www/admin.html | 4 +++- docs/www/api-demo.html | 4 +++- docs/www/crawl.html | 4 +++- docs/www/index.html | 5 +++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/www/admin.html b/docs/www/admin.html index 49e8dd6..b89d0cc 100644 --- a/docs/www/admin.html +++ b/docs/www/admin.html @@ -34,12 +34,14 @@