From a047617d9acc234c9c2eb1126b261e374438962f Mon Sep 17 00:00:00 2001 From: Peter Baus Date: Mon, 8 Feb 2021 16:23:21 +0100 Subject: [PATCH] api,ui:documents stored in minio --- api/package-lock.json | 392 +++++++++++------- api/package.json | 2 + api/src/config/index.ts | 10 + api/src/http_errors/not_found.ts | 17 + api/src/httpd/server.ts | 2 +- api/src/index.ts | 15 + api/src/lib/minio.ts | 136 ++++++ api/src/service/domain/workflow/document.ts | 2 + .../workflow/workflowitem_create.spec.ts | 2 + .../domain/workflow/workflowitem_create.ts | 15 +- .../workflowitem_document_download.ts | 6 +- .../workflowitem_document_download_minio.ts | 48 +++ .../workflow/workflowitem_update.spec.ts | 5 +- .../domain/workflow/workflowitem_update.ts | 23 +- api/src/service/workflowitem_create.ts | 5 + .../service/workflowitem_document_download.ts | 22 +- .../workflowitem_document_minio_download.ts | 55 +++ api/src/service/workflowitem_update.ts | 10 + .../workflowitem_download_document_minio.ts | 133 ++++++ api/src/workflowitem_update.ts | 10 + .../development/docker-compose-slim.yml | 47 +++ docker-compose/development/docker-compose.yml | 34 ++ frontend/src/pages/Confirmation/validation.js | 3 +- .../src/pages/Documents/DocumentUpload.js | 33 +- .../Workflows/WorkflowDialogContainer.js | 2 +- frontend/src/pages/Workflows/actions.js | 5 +- frontend/src/pages/Workflows/reducer.js | 2 +- minio/.gitignore | 5 + minio/nginx/nginx.conf | 65 +++ scripts/development/start-dev-slim.sh | 22 +- 30 files changed, 945 insertions(+), 183 deletions(-) create mode 100644 api/src/config/index.ts create mode 100644 api/src/http_errors/not_found.ts create mode 100644 api/src/lib/minio.ts create mode 100644 api/src/service/domain/workflow/workflowitem_document_download_minio.ts create mode 100644 api/src/service/workflowitem_document_minio_download.ts create mode 100644 api/src/workflowitem_download_document_minio.ts create mode 100644 minio/.gitignore create mode 100644 minio/nginx/nginx.conf diff --git a/api/package-lock.json b/api/package-lock.json index 95a2d4fa9..9085df0fc 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -240,7 +240,7 @@ "@types/bcryptjs": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.2.tgz", - "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==", + "integrity": "sha1-41MOrJ3RNr/fsOQ98sTFzh93364=", "dev": true }, "@types/chai": { @@ -296,7 +296,7 @@ "@types/lodash.isequal": { "version": "4.5.5", "resolved": "https://registry.npmjs.org/@types/lodash.isequal/-/lodash.isequal-4.5.5.tgz", - "integrity": "sha512-4IKbinG7MGP131wRfceK6W4E/Qt3qssEFLF30LnJbjYiSfHGGRU/Io8YxXrZX109ir+iDETC8hw8QsDijukUVg==", + "integrity": "sha1-T+0bGwC+954wXeA1LXl+m7gWyP8=", "dev": true, "requires": { "@types/lodash": "*" @@ -308,10 +308,19 @@ "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", "dev": true }, + "@types/minio": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/minio/-/minio-7.0.6.tgz", + "integrity": "sha512-wSNdxcqse8pHdsIyZcSIbgqZq3qcgdLsvSzp1ZvuxzBb717s7/BvEORiRgkl9r/QDORpoaQGg9vsl387tVtjIA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/mocha": { "version": "5.2.7", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "integrity": "sha1-MV1XDMtWxTRS/4Y4c432BybVtuo=", "dev": true }, "@types/node": { @@ -751,7 +760,7 @@ "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "integrity": "sha1-V9NbhoboUeLMBMQD8cACA5dqGBM=", "dev": true }, "ansi-regex": { @@ -763,7 +772,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", "requires": { "color-convert": "^1.9.0" } @@ -781,7 +790,7 @@ "append-transform": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "integrity": "sha1-BGpSrlgqIovXL1is++KWfGeHWas=", "dev": true, "requires": { "default-require-extensions": "^2.0.0" @@ -801,7 +810,7 @@ "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", "requires": { "sprintf-js": "~1.0.2" } @@ -809,7 +818,7 @@ "args": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz", - "integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==", + "integrity": "sha1-S/KY35CkeZoJUhNixXknjML912E=", "requires": { "camelcase": "5.0.0", "chalk": "2.4.2", @@ -853,7 +862,7 @@ "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", "dev": true, "requires": { "safer-buffer": "~2.1.0" @@ -867,15 +876,20 @@ "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "integrity": "sha1-5gtrDo8wG9l+U3UhW9pAbIURjAs=", "dev": true }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "integrity": "sha1-bIw/uCfdQ+45GPJ7gngqt2WKb9k=", "dev": true }, + "async": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -971,6 +985,14 @@ "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.1.tgz", "integrity": "sha1-DmVcm5wkNeqraL9AJyJtK1WjRSQ=" }, + "block-stream2": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/block-stream2/-/block-stream2-2.0.0.tgz", + "integrity": "sha512-1oI+RHHUEo64xomy1ozLgVJetFlHkIfQfJzTBQrj6xWnEMEPooeo2fZoqFjp0yzfHMBrgxwgh70tKp6T17+i3g==", + "requires": { + "readable-stream": "^3.4.0" + } + }, "boxen": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", @@ -1086,7 +1108,7 @@ "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1104,7 +1126,7 @@ "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=", "dev": true }, "buffer-equal-constant-time": { @@ -1115,7 +1137,7 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", "dev": true }, "builtin-modules": { @@ -1127,7 +1149,7 @@ "bytes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + "integrity": "sha1-9s95M6Ng4FiPqf3oVlHNx/gF0fY=" }, "cacheable-request": { "version": "6.1.0", @@ -1164,7 +1186,7 @@ "caching-transform": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", - "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", + "integrity": "sha1-YB1GuR7Kh2h6KB5xzvmXkbDvynA=", "dev": true, "requires": { "hasha": "^3.0.0", @@ -1176,7 +1198,7 @@ "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { "pify": "^4.0.1", @@ -1186,7 +1208,7 @@ "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true }, "semver": { @@ -1210,13 +1232,13 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", "dev": true }, "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + "integrity": "sha1-AylVJ9WL081Kp1Nj81sujZe+L0I=" }, "camelcase-keys": { "version": "6.2.2", @@ -1246,7 +1268,7 @@ "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "integrity": "sha1-dgqnLPION5XoSxKHfODoNzeqKeU=", "dev": true, "requires": { "assertion-error": "^1.1.0", @@ -1260,7 +1282,7 @@ "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1330,7 +1352,7 @@ "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", "requires": { "color-name": "1.1.3" } @@ -1349,7 +1371,7 @@ "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", "dev": true, "requires": { "delayed-stream": "~1.0.0" @@ -1370,7 +1392,7 @@ "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "integrity": "sha1-FuQHD7qK4ptnnyIVhT7hgasuq8A=", "dev": true }, "concat-map": { @@ -1443,7 +1465,7 @@ "cookiejar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "integrity": "sha1-3YojVTB1L5iPmghE8/xYnjERElw=", "dev": true }, "core-util-is": { @@ -1468,7 +1490,7 @@ "cp-file": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", - "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", + "integrity": "sha1-QNXqSh3vKprN0HulwLAkbvc9wQ0=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -1481,7 +1503,7 @@ "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { "pify": "^4.0.1", @@ -1491,7 +1513,7 @@ "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true }, "semver": { @@ -1505,7 +1527,7 @@ "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "integrity": "sha1-Sl7Hxk364iw6FBJNus3uhG2Ay8Q=", "dev": true, "requires": { "nice-try": "^1.0.4", @@ -1541,12 +1563,12 @@ "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" + "integrity": "sha1-puN0maTZqc+F71hyBE1ikByYia4=" }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", "dev": true, "requires": { "ms": "2.0.0" @@ -1588,7 +1610,7 @@ "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=", "dev": true, "requires": { "type-detect": "^4.0.0" @@ -1629,7 +1651,7 @@ "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=", "dev": true, "requires": { "object-keys": "^1.0.12" @@ -1669,7 +1691,7 @@ "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "integrity": "sha1-rd6+rXKmV023g2OdyHoSF3OXOWE=", "dev": true, "requires": { "esutils": "^2.0.2" @@ -1703,7 +1725,7 @@ "ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "integrity": "sha1-rg8PothQRe8UqBfao86azQSJ5b8=", "requires": { "safe-buffer": "^5.0.1" } @@ -1752,7 +1774,7 @@ "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -1817,8 +1839,7 @@ "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true + "integrity": "sha1-njr0B0Wd7tR+mpH5uIWoTrBcVh0=" }, "escape-goat": { "version": "2.1.1", @@ -2265,7 +2286,7 @@ "eslint-plugin-promise": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", - "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", + "integrity": "sha1-hF/YsiYK2PglZMEiL85ErXHZQYo=", "dev": true }, "eslint-scope": { @@ -2342,7 +2363,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==" + "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=" }, "esquery": { "version": "1.3.1", @@ -2379,7 +2400,7 @@ "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "integrity": "sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=", "dev": true }, "etag": { @@ -2405,7 +2426,7 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=", "dev": true }, "extsprintf": { @@ -2441,7 +2462,7 @@ "fast-json-parse": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/fast-json-parse/-/fast-json-parse-1.0.3.tgz", - "integrity": "sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==" + "integrity": "sha1-Q+XGHuTvqSZWMwRrdw+2gqdXfE0=" }, "fast-json-stable-stringify": { "version": "2.0.0", @@ -2492,6 +2513,11 @@ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" }, + "fast-xml-parser": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.17.5.tgz", + "integrity": "sha512-lEvThd1Xq+CCylf1n+05bUZCDZjTufaaaqpxM3JZ+4iDqtlG+d/oKgtMmg9GEMOuzBgUoalIzFOaClht9YiGJQ==" + }, "fastfall": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/fastfall/-/fastfall-1.5.1.tgz", @@ -2676,7 +2702,7 @@ "file-entry-cache": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "integrity": "sha1-yg9u+m3T1WEzP7FFFQZcL6/fQ5w=", "dev": true, "requires": { "flat-cache": "^2.0.1" @@ -2694,7 +2720,7 @@ "find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "integrity": "sha1-jQ+UzRP+Q8bHwmGg2GEVypGMBfc=", "dev": true, "requires": { "commondir": "^1.0.1", @@ -2705,7 +2731,7 @@ "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", "dev": true, "requires": { "locate-path": "^3.0.0" @@ -2714,7 +2740,7 @@ "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -2724,7 +2750,7 @@ "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { "pify": "^4.0.1", @@ -2743,7 +2769,7 @@ "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", "dev": true, "requires": { "p-limit": "^2.0.0" @@ -2752,19 +2778,19 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "integrity": "sha1-J0kCDyOe2ZCIGx9xIQ1R62UjvqM=", "dev": true, "requires": { "find-up": "^3.0.0" @@ -2809,7 +2835,7 @@ "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "integrity": "sha1-XSltbwS9pEpGMKMBQTvbwuwIXsA=", "dev": true, "requires": { "flatted": "^2.0.0", @@ -2820,7 +2846,7 @@ "flatstr": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz", - "integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==" + "integrity": "sha1-wrpqCBc+27bJZA4wVbleKHzrWTE=" }, "flatted": { "version": "2.0.2", @@ -2829,9 +2855,9 @@ "dev": true }, "follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz", + "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==" }, "foreground-child": { "version": "1.5.6", @@ -2880,7 +2906,7 @@ "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", "dev": true, "requires": { "asynckit": "^0.4.0", @@ -2919,7 +2945,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", "dev": true }, "functional-red-black-tree": { @@ -2931,7 +2957,7 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "integrity": "sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=", "dev": true }, "get-func-name": { @@ -3070,7 +3096,7 @@ "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "integrity": "sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4=", "dev": true }, "har-schema": { @@ -3098,7 +3124,7 @@ "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", "dev": true, "requires": { "function-bind": "^1.1.1" @@ -3133,13 +3159,13 @@ "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "integrity": "sha1-hK5l+n6vsWX922FWauFLrwVmTw8=", "dev": true }, "hoek": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", - "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==" + "integrity": "sha1-c7fTOVLgH+J6OLBFcpS3ndjaJCw=" }, "hosted-git-info": { "version": "2.8.2", @@ -3165,7 +3191,7 @@ "http-errors": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "integrity": "sha1-T1ApzxMjnzEDblsuVSkrz7zIXI8=", "requires": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -3188,7 +3214,7 @@ "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", "requires": { "safer-buffer": ">= 2.1.2 < 3" } @@ -3196,7 +3222,7 @@ "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "integrity": "sha1-dQ49tYYgh7RzfrrIIH/9HvJ7Jfw=", "dev": true }, "ignore-by-default": { @@ -3329,7 +3355,7 @@ "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -3434,7 +3460,7 @@ "isemail": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", - "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", + "integrity": "sha1-WTEKAhkxqfsGu7UeFVzgs/I2gyw=", "requires": { "punycode": "2.x.x" } @@ -3454,13 +3480,13 @@ "istanbul-lib-coverage": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "integrity": "sha1-Z18KtpUD+tSx2En3NrqsqAM0T0k=", "dev": true }, "istanbul-lib-hook": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", - "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", + "integrity": "sha1-yVaV84PU+PYN8fBCUqlVDhW1sTM=", "dev": true, "requires": { "append-transform": "^1.0.0" @@ -3469,7 +3495,7 @@ "istanbul-lib-instrument": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "integrity": "sha1-pfY9kfC7wMPkee9MXeAnM17G1jA=", "dev": true, "requires": { "@babel/generator": "^7.4.0", @@ -3484,7 +3510,7 @@ "istanbul-lib-report": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", - "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "integrity": "sha1-WoETzXRtQ8SInro2qxDn1QybTzM=", "dev": true, "requires": { "istanbul-lib-coverage": "^2.0.5", @@ -3495,7 +3521,7 @@ "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { "pify": "^4.0.1", @@ -3505,7 +3531,7 @@ "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true }, "semver": { @@ -3517,7 +3543,7 @@ "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "integrity": "sha1-B2Srxpxj1ayELdSGfo0CXogN+PM=", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -3528,7 +3554,7 @@ "istanbul-lib-source-maps": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", - "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "integrity": "sha1-KEmXxIIRdS7EhiU9qX44ed77qMg=", "dev": true, "requires": { "debug": "^4.1.1", @@ -3550,7 +3576,7 @@ "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { "pify": "^4.0.1", @@ -3560,13 +3586,13 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", "dev": true }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true }, "semver": { @@ -3578,7 +3604,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } @@ -3600,7 +3626,7 @@ "joi": { "version": "14.3.1", "resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz", - "integrity": "sha512-LQDdM+pkOrpAn4Lp+neNIFV3axv1Vna3j38bisbQhETPMANYRbFJFUyOZcOClYvM/hppMhGWuKSFEK9vjrB+bQ==", + "integrity": "sha1-FkomLsC4VUZuDDXuoqiFrotscDw=", "requires": { "hoek": "6.x.x", "isemail": "3.x.x", @@ -3610,7 +3636,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", "dev": true }, "js-yaml": { @@ -3632,7 +3658,7 @@ "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "integrity": "sha1-gFZNLkg9rPbo7yCWUKZ98/DCg6Q=", "dev": true }, "json-buffer": { @@ -3644,7 +3670,7 @@ "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "integrity": "sha1-u4Z8+zRQ5pEHwTHRxRS6s9yLyqk=", "dev": true }, "json-parse-even-better-errors": { @@ -3687,7 +3713,7 @@ "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -3695,6 +3721,11 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-stream/-/json-stream-1.0.0.tgz", + "integrity": "sha1-GjhU4o0rvuqzHMfd9oPS3cVlJwg=" + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -3713,7 +3744,7 @@ "jsonwebtoken": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", - "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "integrity": "sha1-AOceC431TCEhofJhN98igGc7zA0=", "requires": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -3730,7 +3761,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" }, "semver": { "version": "5.7.0", @@ -3762,7 +3793,7 @@ "jwa": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "integrity": "sha1-dDwymFy56YZVUw1TZBtmyGRbA5o=", "requires": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -3772,7 +3803,7 @@ "jws": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "integrity": "sha1-ABCZ82OUaMlBQADpmZX6UvtHgwQ=", "requires": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" @@ -3902,8 +3933,7 @@ "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash.flattendeep": { "version": "4.4.0", @@ -3960,7 +3990,7 @@ "log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", + "integrity": "sha1-Y7lQIfBwL+36LJuwok53l9cYcdg=", "dev": true }, "log-symbols": { @@ -4251,7 +4281,7 @@ "merge-source-map": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "integrity": "sha1-L93n5gIJOfcJBqaPLXrmheTIxkY=", "dev": true, "requires": { "source-map": "^0.6.1" @@ -4260,7 +4290,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } @@ -4296,14 +4326,12 @@ "mime-db": { "version": "1.40.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", - "dev": true + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" }, "mime-types": { "version": "2.1.24", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dev": true, "requires": { "mime-db": "1.40.0" } @@ -4323,7 +4351,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "^1.1.7" } @@ -4331,8 +4359,7 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "minimist-options": { "version": "4.1.0", @@ -4345,11 +4372,28 @@ "kind-of": "^6.0.3" } }, + "minio": { + "version": "7.0.17", + "resolved": "https://registry.npmjs.org/minio/-/minio-7.0.17.tgz", + "integrity": "sha512-57Zg+evjZikR5QoUh0JwC0RPb/Q3BamR28ozJ1Aui3ry8qy6Ycj8Uc91Mfh+By+2AzKo4I7eyR/85EESmcJZfg==", + "requires": { + "async": "^3.1.0", + "block-stream2": "^2.0.0", + "es6-error": "^4.1.1", + "fast-xml-parser": "^3.17.4", + "json-stream": "^1.0.0", + "lodash": "^4.14.2", + "mime-types": "^2.1.14", + "mkdirp": "^0.5.1", + "querystring": "0.2.0", + "through2": "^3.0.1", + "xml": "^1.0.0" + } + }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, "requires": { "minimist": "^1.2.5" } @@ -4585,7 +4629,7 @@ "mri": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==" + "integrity": "sha1-fLHdG5tAkF8frAU6viW2cg9EdEo=" }, "ms": { "version": "2.0.0", @@ -4602,13 +4646,13 @@ "nested-error-stacks": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", - "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", + "integrity": "sha1-D73PPhP+SZR4EoBST4uWsM3/nGE=", "dev": true }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "integrity": "sha1-ozeKdpbOfSI+iPybdkvX7xCJ42Y=", "dev": true }, "node-environment-flags": { @@ -4687,7 +4731,7 @@ "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -4707,7 +4751,7 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=", "dev": true }, "normalize-url": { @@ -4734,7 +4778,7 @@ "nyc": { "version": "14.1.1", "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", - "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", + "integrity": "sha1-FR1kpqn59ZCKG3MjOTHkoKMHXus=", "dev": true, "requires": { "archy": "^1.0.0", @@ -4767,7 +4811,7 @@ "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", "dev": true, "requires": { "locate-path": "^3.0.0" @@ -4776,7 +4820,7 @@ "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -4786,7 +4830,7 @@ "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { "pify": "^4.0.1", @@ -4805,7 +4849,7 @@ "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", "dev": true, "requires": { "p-limit": "^2.0.0" @@ -4814,13 +4858,13 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true }, "semver": { @@ -4834,7 +4878,7 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=", "dev": true }, "object-inspect": { @@ -4846,7 +4890,7 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=", "dev": true }, "object.assign": { @@ -5094,7 +5138,7 @@ "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", "dev": true, "requires": { "p-try": "^1.0.0" @@ -5118,7 +5162,7 @@ "package-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", - "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "integrity": "sha1-UBg/LTbJ4+Uo6gqGBd/1fOl2+I4=", "dev": true, "requires": { "graceful-fs": "^4.1.15", @@ -5142,7 +5186,7 @@ "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "integrity": "sha1-aR0nCeeMefrjoVZiJFLQB2LKqqI=", "dev": true, "requires": { "callsites": "^3.0.0" @@ -5177,7 +5221,7 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", "dev": true }, "path-type": { @@ -5238,7 +5282,7 @@ "pino-pretty": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-2.6.1.tgz", - "integrity": "sha512-e/CWtKLidqkr7sinfIVVcsfcHgnFVlGvuEfKuuPFnxBo+9dZZsmgF8a9Rj7SYJ5LMZ8YBxNY9Ca46eam4ajKtQ==", + "integrity": "sha1-tajigTfesWKUKJMdmMcItR8OlVU=", "requires": { "args": "^5.0.0", "chalk": "^2.3.2", @@ -5301,13 +5345,13 @@ "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "integrity": "sha1-eCDZsWEgzFXKmud5JoCufbptf+I=", "dev": true }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=", "dev": true }, "prom-client": { @@ -5348,7 +5392,7 @@ "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "integrity": "sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ=", "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -5357,7 +5401,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=" }, "pupa": { "version": "2.0.1", @@ -5371,9 +5415,14 @@ "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "integrity": "sha1-QdwaAV49WB8WIXdr4xr7KHapsbw=", "dev": true }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, "queue-microtask": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.1.4.tgz", @@ -5398,7 +5447,7 @@ "raw-body": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", - "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", + "integrity": "sha1-MKyC+Yu1rowVLmcUnayNVRU7Fow=", "requires": { "bytes": "3.1.0", "http-errors": "1.7.3", @@ -5409,7 +5458,7 @@ "http-errors": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "integrity": "sha1-bGGeT5xgMIw4UZSYwU+7EKrOuwY=", "requires": { "depd": "~1.1.2", "inherits": "2.0.4", @@ -5421,7 +5470,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=" } } }, @@ -5576,7 +5625,7 @@ "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "integrity": "sha1-0LMp7MfMD2Fkn2IhW+aa9UqomJs=", "dev": true }, "resolve": { @@ -5591,7 +5640,7 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", "dev": true }, "responselike": { @@ -5611,7 +5660,7 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + "integrity": "sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=" }, "rfdc": { "version": "1.1.4", @@ -5649,7 +5698,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" }, "secure-json-parse": { "version": "2.1.0", @@ -5737,7 +5786,7 @@ "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + "integrity": "sha1-fpWsskqpL1iF4KvvW6ExMw1K5oM=" }, "shebang-command": { "version": "1.2.0", @@ -5769,7 +5818,7 @@ "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "integrity": "sha1-ys12k0YaY3pXiNkqfdT7oGjoFjY=", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -5872,7 +5921,7 @@ "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=", "dev": true, "requires": { "asn1": "~0.2.3", @@ -6175,7 +6224,7 @@ "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=", "requires": { "safe-buffer": "~5.2.0" } @@ -6219,7 +6268,7 @@ "superagent": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", - "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "integrity": "sha1-Rg6g29t9WxG8T3jeulZfhqF44Sg=", "dev": true, "requires": { "component-emitter": "^1.2.0", @@ -6252,13 +6301,13 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", "dev": true }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -6269,7 +6318,7 @@ "supertest": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/supertest/-/supertest-4.0.2.tgz", - "integrity": "sha512-1BAbvrOZsGA3YTCWqbmh14L0YEq0EGICX/nBnfkfVJn7SrxQV1I3pMYjSzG9y/7ZU2V9dWqyqk2POwxlb09duQ==", + "integrity": "sha1-wiNNvdbcebbxW5nI1ld7kOTOPzY=", "dev": true, "requires": { "methods": "^1.1.2", @@ -6279,7 +6328,7 @@ "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", "requires": { "has-flag": "^3.0.0" } @@ -6293,7 +6342,7 @@ "table": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "integrity": "sha1-EpLRlQDOP4YFOwXw6Ofko7shB54=", "dev": true, "requires": { "ajv": "^6.10.2", @@ -6311,7 +6360,7 @@ "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=", "dev": true, "requires": { "emoji-regex": "^7.0.1", @@ -6347,7 +6396,7 @@ "test-exclude": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "integrity": "sha1-w9Ph4xHrfuQF4JLawQrv0JCR6sA=", "dev": true, "requires": { "glob": "^7.1.3", @@ -6359,7 +6408,7 @@ "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", "dev": true, "requires": { "locate-path": "^3.0.0" @@ -6380,7 +6429,7 @@ "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -6399,7 +6448,7 @@ "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", "dev": true, "requires": { "p-limit": "^2.0.0" @@ -6408,7 +6457,7 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, "parse-json": { @@ -6424,7 +6473,7 @@ "path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "integrity": "sha1-zvMdyOCho7sNEFwM2Xzzv0f0428=", "dev": true, "requires": { "pify": "^3.0.0" @@ -6450,7 +6499,7 @@ "read-pkg-up": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "integrity": "sha1-GyIcYIi6d5lgHICPkRYcZuWPiXg=", "dev": true, "requires": { "find-up": "^3.0.0", @@ -6465,6 +6514,22 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } + } + }, "tiny-lru": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-7.0.6.tgz", @@ -6494,12 +6559,12 @@ "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + "integrity": "sha1-fhvjRw8ed5SLxD2Uo8j013UrpVM=" }, "topo": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz", - "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==", + "integrity": "sha1-1aZ/suaTB+vusIQC7Coqb1962Vw=", "requires": { "hoek": "6.x.x" } @@ -6653,7 +6718,7 @@ "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", "dev": true }, "type-fest": { @@ -6820,7 +6885,7 @@ "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -6840,7 +6905,7 @@ "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", "dev": true, "requires": { "isexe": "^2.0.0" @@ -6855,7 +6920,7 @@ "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "integrity": "sha1-rgdOa9wMFKQx6ATmJFScYzsABFc=", "dev": true, "requires": { "string-width": "^1.0.2 || 2" @@ -6971,7 +7036,7 @@ "write": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "integrity": "sha1-CADhRSO5I6OH5BUSPIZWFqrg9cM=", "dev": true, "requires": { "mkdirp": "^0.5.1" @@ -6994,6 +7059,11 @@ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "dev": true }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=" + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -7002,7 +7072,7 @@ "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", "dev": true }, "yallist": { @@ -7246,7 +7316,7 @@ "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "integrity": "sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=", "dev": true } } diff --git a/api/package.json b/api/package.json index c59df5d4b..c451154cb 100644 --- a/api/package.json +++ b/api/package.json @@ -77,6 +77,7 @@ "joi": "^14.3.1", "jsonwebtoken": "^8.5.0", "lodash.isequal": "^4.5.0", + "minio": "^7.0.17", "pino": "^5.8.0", "pino-pretty": "^2.2.3", "raw-body": "^2.3.3", @@ -90,6 +91,7 @@ "@types/joi": "^14.3.2", "@types/jsonwebtoken": "^8.0.0", "@types/lodash.isequal": "^4.5.5", + "@types/minio": "^7.0.6", "@types/mocha": "^5.2.6", "@types/node": "^14.6.4", "@types/pino": "^6.3.0", diff --git a/api/src/config/index.ts b/api/src/config/index.ts new file mode 100644 index 000000000..acd270a41 --- /dev/null +++ b/api/src/config/index.ts @@ -0,0 +1,10 @@ +export const host = process.env.API_HOST || "master-api"; +export const port = process.env.PORT || 8080; +export const isSsl = process.env.USE_SSL === "ssl" ? true : false; +export const hostPort = `${isSsl ? "https" : "http"}://${host}:${port}`; + +export const minioEndPoint = process.env.MINIO_ENDPOINT; // nginx in development +export const minioPort = process.env.MINIO_PORT && parseInt(process.env.MINIO_PORT as string, 10) || 9000; +export const minioUseSSL = process.env.MINIO_USE_SSL === "true" ? true : false; +export const minioAccessKey = process.env.MINIO_ACCESS_KEY || "minio"; +export const minioSecretKey = process.env.MINIO_SECRET_KEY || "minio123"; diff --git a/api/src/http_errors/not_found.ts b/api/src/http_errors/not_found.ts new file mode 100644 index 000000000..5726da2db --- /dev/null +++ b/api/src/http_errors/not_found.ts @@ -0,0 +1,17 @@ +export const schema = { + description: "Not found", + type: "object", + properties: { + apiVersion: { type: "string", example: "1.0" }, + error: { + type: "object", + properties: { + code: { type: "string", example: "404" }, + message: { + type: "string", + example: "The route you are looking for was not found.", + }, + }, + }, + }, +}; diff --git a/api/src/httpd/server.ts b/api/src/httpd/server.ts index befbb4e73..e10e60faa 100644 --- a/api/src/httpd/server.ts +++ b/api/src/httpd/server.ts @@ -126,7 +126,7 @@ export const createBasicApp = ( server.addContentTypeParser("application/gzip", async function (request, payload) { request.headers["content-length"] = "1024mb"; - return payload; + return payload; }); // app.use(logging); diff --git a/api/src/index.ts b/api/src/index.ts index dc10a018c..9bd3aea4a 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -84,6 +84,7 @@ import * as WorkflowitemAssignService from "./service/workflowitem_assign"; import * as WorkflowitemCloseService from "./service/workflowitem_close"; import * as WorkflowitemCreateService from "./service/workflowitem_create"; import * as WorkflowitemDocumentDownloadService from "./service/workflowitem_document_download"; +import * as WorkflowitemDocumentDownloadMinioService from "./service/workflowitem_document_minio_download"; import * as WorkflowitemGetService from "./service/workflowitem_get"; import * as WorkflowitemViewHistoryService from "./service/workflowitem_history_get"; import * as WorkflowitemListService from "./service/workflowitem_list"; @@ -119,6 +120,7 @@ import * as WorkflowitemAssignAPI from "./workflowitem_assign"; import * as WorkflowitemCloseAPI from "./workflowitem_close"; import * as WorkflowitemCreateAPI from "./workflowitem_create"; import * as WorkflowitemsDocumentDownloadAPI from "./workflowitem_download_document"; +import * as WorkflowitemsDocumentDownloadMinioAPI from "./workflowitem_download_document_minio"; import * as WorkflowitemListAPI from "./workflowitem_list"; import * as WorkflowitemPermissionGrantAPI from "./workflowitem_permission_grant"; import * as WorkflowitemPermissionRevokeAPI from "./workflowitem_permission_revoke"; @@ -159,6 +161,7 @@ if (!organizationVaultSecret) { const SWAGGER_BASEPATH = process.env.SWAGGER_BASEPATH || "/"; + /* * Initialize the components: */ @@ -774,6 +777,18 @@ WorkflowitemsDocumentDownloadAPI.addHttpHandler(server, URL_PREFIX, { ), }); +WorkflowitemsDocumentDownloadMinioAPI.addHttpHandler(server, URL_PREFIX, { + getDocumentMinio: (ctx, projectId, subprojectId, workflowitemId, documentId) => + WorkflowitemDocumentDownloadMinioService.getDocumentMinio( + db, + ctx, + projectId, + subprojectId, + workflowitemId, + documentId, + ), +}); + /* * Run the server. */ diff --git a/api/src/lib/minio.ts b/api/src/lib/minio.ts new file mode 100644 index 000000000..e6ab78047 --- /dev/null +++ b/api/src/lib/minio.ts @@ -0,0 +1,136 @@ +import * as Minio from "minio"; +import { v4 as uuid } from "uuid"; +import { minioEndPoint, minioPort, minioUseSSL, minioAccessKey, minioSecretKey } from "../config"; + +const Readable = require("stream").Readable; + +interface Metadata { + "Content-Type"?: string, + fileName: string, +} + +interface MetadataWithName extends Metadata { + name: string +} + +const minioClient: any = new Minio.Client({ + endPoint: minioEndPoint || "nginx", + port: minioPort, + useSSL: minioUseSSL, + accessKey: minioAccessKey, + secretKey: minioSecretKey, +}); + +const bucketName: string = "trubudget"; + + +const makeBucket = (bucket: string, cb: Function) => { + minioClient.bucketExists(bucket, (err, exists) => { + if (err) { + return console.error("Error during searching for bucket", err); + } + + if (!exists) { + minioClient.makeBucket(bucket, "us-east-1", (err) => { + if (err) { + console.error("Error creating bucket.", err); + return cb(err); + } + console.log(`Minio: Bucket ${bucket} created.`); + return cb(null, true); + }); + } + }); +}; + +export const makeBucketAsPromised = (bucket: string) => { + return new Promise((resolve, reject) => { + makeBucket(bucket, (err) => { + if (err) return reject(err); + + resolve(true); + }); + }); +}; + + +const upload = (file: string, content: string, metaData: Metadata, cb: Function) => { + const s = new Readable(); + s._read = () => {}; + s.push(content); + s.push(null); + + const metaDataWithName: MetadataWithName = { ...metaData, name: file }; + // Using putObject API upload your file to the bucket . + minioClient.putObject(bucketName, file, s, metaDataWithName, (err, etag) => { + if (err) { + console.error("minioClient.putObject", err); + return cb(err); + } + + return cb(null, etag); + }); +}; + +export const uploadAsPromised = (file: string, content: string, metaData: Metadata = {fileName: "default"}) => { + return new Promise((resolve, reject) => { + upload(file, content, metaData, (err, etag) => { + if (err) return reject(err); + + resolve(etag); + }); + }); +}; + +const download = (file: string, cb: Function) => { + let fileContent: string = ""; + minioClient.getObject(bucketName, file, (err, dataStream) => { + if (err) { + console.error("Error during getting file object", err); + cb(err); + } + dataStream.on("data", (chunk: string) => { + fileContent += chunk; + }); + dataStream.on("end", () => { + cb(null, fileContent); + }); + dataStream.on("error", function (err) { + console.error("Error during getting file object datastream", err); + }); + }); +}; + +export const downloadAsPromised = (file: string) => { + return new Promise((resolve, reject) => { + download(file, (err, fileContent: string) => { + if (err) return reject(err); + + resolve(fileContent); + }); + }); +}; + +const getMetadata = (fileHash: string, cb: Function) => { + minioClient.statObject(bucketName, fileHash, (err, stat: MetadataWithName) => { + if (err) { + console.error(err); + return cb(err); + } + cb(null, stat); + }); +}; + +export const getMetadataAsPromised = (fileHash: string) => { + return new Promise((resolve, reject) => { + getMetadata(fileHash, (err, metaData: MetadataWithName) => { + if (err) return reject(err); + + resolve(metaData); + }); + }); +}; + +makeBucketAsPromised(bucketName); + +export default minioClient; diff --git a/api/src/service/domain/workflow/document.ts b/api/src/service/domain/workflow/document.ts index 5e216552c..5c96f8ee4 100644 --- a/api/src/service/domain/workflow/document.ts +++ b/api/src/service/domain/workflow/document.ts @@ -22,6 +22,7 @@ export interface UploadedDocument { id: string; base64: string; fileName: string; + url?: string; } export const uploadedDocumentSchema = Joi.object({ @@ -30,6 +31,7 @@ export const uploadedDocumentSchema = Joi.object({ .required() .error(() => new Error("Document can't be an empty file")), fileName: Joi.string(), + orgAccess: Joi.array().items(Joi.string()).optional(), }); export async function hashDocument( diff --git a/api/src/service/domain/workflow/workflowitem_create.spec.ts b/api/src/service/domain/workflow/workflowitem_create.spec.ts index 5b69316c4..ea18cfb63 100644 --- a/api/src/service/domain/workflow/workflowitem_create.spec.ts +++ b/api/src/service/domain/workflow/workflowitem_create.spec.ts @@ -42,6 +42,7 @@ describe("Create workflowitem", () => { workflowitemExists: async (_projectId, _subprojectId, _workflowitemId) => false, getSubproject: async () => baseSubproject, applyWorkflowitemType: () => [], + uploadDocument: () => new Promise(() => undefined), }); assert.isTrue(Result.isErr(result)); @@ -61,6 +62,7 @@ describe("Create workflowitem", () => { workflowitemExists: async (_projectId, _subprojectId, _workflowitemId) => false, getSubproject: async () => baseSubproject, applyWorkflowitemType: () => [], + uploadDocument: () => new Promise(() => undefined), }); assert.isTrue(Result.isErr(result)); diff --git a/api/src/service/domain/workflow/workflowitem_create.ts b/api/src/service/domain/workflow/workflowitem_create.ts index 37aab82b2..5d132732d 100644 --- a/api/src/service/domain/workflow/workflowitem_create.ts +++ b/api/src/service/domain/workflow/workflowitem_create.ts @@ -1,5 +1,6 @@ import Joi = require("joi"); import { VError } from "verror"; +import { minioEndPoint, hostPort } from "../../../config"; import Intent, { workflowitemIntents } from "../../../authz/intents"; import { Ctx } from "../../../lib/ctx"; import * as Result from "../../../result"; @@ -77,6 +78,9 @@ interface Repository { event: BusinessEvent, workflowitem: Workflowitem.Workflowitem, ): Result.Type; + uploadDocument( + document: UploadedDocument + ): Promise; } export async function createWorkflowitem( @@ -199,7 +203,16 @@ export async function createWorkflowitem( if (Result.isErr(result)) { return result; } - documentUploadedEvents.push(result); + const { document } = result as WorkflowitemDocumentUploaded.Event; + // document should be private + if (minioEndPoint) { + await repository.uploadDocument(document); + const eventData = {...result, document: {...document, base64: "", url: hostPort}}; + documentUploadedEvents.push(eventData); + } else { + documentUploadedEvents.push(result); + } + } // Check the workflowitem type diff --git a/api/src/service/domain/workflow/workflowitem_document_download.ts b/api/src/service/domain/workflow/workflowitem_document_download.ts index 3049e7faa..2aeaa8611 100644 --- a/api/src/service/domain/workflow/workflowitem_document_download.ts +++ b/api/src/service/domain/workflow/workflowitem_document_download.ts @@ -6,6 +6,7 @@ import { ServiceUser } from "../organization/service_user"; import * as WorkflowitemDocument from "./document"; import * as Workflowitem from "./workflowitem"; import * as WorkflowitemDocumentUploaded from "./workflowitem_document_uploaded"; +import { getDocument as getDocumentService } from "../../workflowitem_document_download"; import VError = require("verror"); interface Repository { @@ -31,7 +32,10 @@ export async function getDocument( return new NotAuthorized({ ctx, userId: user.id, intent, target: workflowitem }); } - // Get all events from one document + /** + * Get all events from one document + * @see getDocumentService + */ const documentEvents = await repository.getDocumentEvents(documentId); if (Result.isErr(documentEvents)) { return new VError( diff --git a/api/src/service/domain/workflow/workflowitem_document_download_minio.ts b/api/src/service/domain/workflow/workflowitem_document_download_minio.ts new file mode 100644 index 000000000..8931e73f2 --- /dev/null +++ b/api/src/service/domain/workflow/workflowitem_document_download_minio.ts @@ -0,0 +1,48 @@ +import { Ctx } from "../../../lib/ctx"; +import * as Result from "../../../result"; +import { NotAuthorized } from "../errors/not_authorized"; +import { NotFound } from "../errors/not_found"; +import { ServiceUser } from "../organization/service_user"; +import * as WorkflowitemDocument from "./document"; +import * as Workflowitem from "./workflowitem"; +import * as WorkflowitemDocumentUploaded from "./workflowitem_document_uploaded"; +import VError = require("verror"); + +interface Repository { + getWorkflowitem(workflowitemId): Promise>; + getDocumentEvents(documentId): Promise>; +} + +export async function getDocumentMinio( + ctx: Ctx, + workflowitemId: string, + documentId: string, + repository: Repository, +): Promise> { + // check for permissions etc + const workflowitem = await repository.getWorkflowitem(workflowitemId); + if (Result.isErr(workflowitem)) { + return workflowitem; + } + + // Get all events from one document + const documentEvents = await repository.getDocumentEvents(documentId); + if (Result.isErr(documentEvents)) { + return new VError( + new NotFound(ctx, "document", documentId), + `couldn't get document events from ${workflowitem}`, + ); + } + + // Only return if document has relation to the workflowitem + if (!workflowitem.documents.some((d) => d.documentId === documentId)) { + return new VError( + new NotFound(ctx, "document", documentId), + `workfowitem ${workflowitem} has no link to document`, + ); + } + + return documentEvents + .filter((d) => d.workflowitemId === workflowitem.id) + .map((d) => d.document)[0]; +} diff --git a/api/src/service/domain/workflow/workflowitem_update.spec.ts b/api/src/service/domain/workflow/workflowitem_update.spec.ts index 3d7489f26..d05e008f2 100644 --- a/api/src/service/domain/workflow/workflowitem_update.spec.ts +++ b/api/src/service/domain/workflow/workflowitem_update.spec.ts @@ -6,9 +6,10 @@ import { BusinessEvent } from "../business_event"; import { NotAuthorized } from "../errors/not_authorized"; import { NotFound } from "../errors/not_found"; import { ServiceUser } from "../organization/service_user"; -import { hashDocument, StoredDocument } from "./document"; +import { hashDocument, StoredDocument, UploadedDocument } from "./document"; import { Workflowitem } from "./workflowitem"; import { updateWorkflowitem } from "./workflowitem_update"; +import * as Nodes from "../../../network/model/Nodes"; const ctx: Ctx = { requestId: "", source: "test" }; const root: ServiceUser = { id: "root", groups: [] }; @@ -51,6 +52,8 @@ const baseRepository = { if (identity === "root") return ["root"]; throw Error(`unexpected identity: ${identity}`); }, + uploadDocument: (document: UploadedDocument): Promise => { return new Promise((resolve) => resolve(undefined)); }, + getOrganizations: (): Promise => { return new Promise((resolve) => resolve([])); }, }; describe("update workflowitem: authorization", () => { diff --git a/api/src/service/domain/workflow/workflowitem_update.ts b/api/src/service/domain/workflow/workflowitem_update.ts index af2cee347..4c9067ad1 100644 --- a/api/src/service/domain/workflow/workflowitem_update.ts +++ b/api/src/service/domain/workflow/workflowitem_update.ts @@ -1,5 +1,6 @@ import isEqual = require("lodash.isequal"); import { VError } from "verror"; +import { minioEndPoint, hostPort } from "../../../config"; import { Ctx } from "../../../lib/ctx"; import * as Result from "../../../result"; import { BusinessEvent } from "../business_event"; @@ -11,6 +12,7 @@ import { ServiceUser } from "../organization/service_user"; import * as UserRecord from "../organization/user_record"; import { hashDocuments, StoredDocument, UploadedDocument } from "./document"; import * as NotificationCreated from "./notification_created"; +import * as Nodes from "../../../network/model/Nodes"; import * as Project from "./project"; import * as Subproject from "./subproject"; import * as Workflowitem from "./workflowitem"; @@ -18,6 +20,7 @@ import * as WorkflowitemDocumentUploaded from "./workflowitem_document_uploaded" import * as WorkflowitemEventSourcing from "./workflowitem_eventsourcing"; import * as WorkflowitemUpdated from "./workflowitem_updated"; + export interface RequestData { displayName?: string; description?: string; @@ -34,6 +37,9 @@ export interface RequestData { export type EventData = WorkflowitemUpdated.Modification; export const requestDataSchema = WorkflowitemUpdated.modificationSchema; +interface NodeInfoAddress { + organization: string +} interface Repository { getWorkflowitem(workflowitemId: Workflowitem.Id): Promise>; getUsersForIdentity(identity: Identity): Promise>; @@ -41,6 +47,8 @@ interface Repository { event: BusinessEvent, workflowitem: Workflowitem.Workflowitem, ): Result.Type; + uploadDocument(document: UploadedDocument): Promise; + getOrganizations(): Promise; } export async function updateWorkflowitem( @@ -136,7 +144,7 @@ export async function updateWorkflowitem( } // Handle new documents - let newDocumentUploadedEventsResult: Result.Type[] = []; + let newDocumentUploadedEventsResult: Result.Type[] = []; if (newEvent.update.documents && newEvent.update.documents.length > 0) { const { documents } = newEvent.update; if (modification.documents === undefined) { @@ -177,12 +185,21 @@ export async function updateWorkflowitem( }); } - const newDocumentUploadedEvents: BusinessEvent[] = []; + const newDocumentUploadedEvents: WorkflowitemDocumentUploaded.Event[] = []; for (const result of newDocumentUploadedEventsResult) { if (Result.isErr(result)) { return result; } - newDocumentUploadedEvents.push(result); + const { document } = result as WorkflowitemDocumentUploaded.Event; + // document should be private + if (minioEndPoint) { + await repository.uploadDocument(document); + + newDocumentUploadedEvents.push({...result, document: {...document, base64: "", url: hostPort}}); + } else { + newDocumentUploadedEvents.push(result); + } + } const workflowitemTypeEventsResult = repository.applyWorkflowitemType(newEvent, workflowitem); diff --git a/api/src/service/workflowitem_create.ts b/api/src/service/workflowitem_create.ts index 78101a2ca..61125682c 100644 --- a/api/src/service/workflowitem_create.ts +++ b/api/src/service/workflowitem_create.ts @@ -10,7 +10,9 @@ import * as Workflowitem from "./domain/workflow/workflowitem"; import * as WorkflowitemCreate from "./domain/workflow/workflowitem_create"; import * as WorkflowitemCreated from "./domain/workflow/workflowitem_created"; import * as TypeEvents from "./domain/workflowitem_types/apply_workflowitem_type"; +import { UploadedDocument } from "./domain/workflow/document"; import { store } from "./store"; +import { uploadAsPromised } from "../lib/minio"; export { RequestData } from "./domain/workflow/workflowitem_create"; @@ -35,6 +37,9 @@ export async function createWorkflowitem( applyWorkflowitemType: (event: BusinessEvent, workflowitem: Workflowitem.Workflowitem) => { return TypeEvents.applyWorkflowitemType(event, ctx, serviceUser, workflowitem); }, + uploadDocument: async (document: UploadedDocument) => { + await uploadAsPromised(document.id, document.base64, { fileName: document.fileName }); + }, }); }); diff --git a/api/src/service/workflowitem_document_download.ts b/api/src/service/workflowitem_document_download.ts index 7b297318f..3899c0db8 100644 --- a/api/src/service/workflowitem_document_download.ts +++ b/api/src/service/workflowitem_document_download.ts @@ -1,6 +1,10 @@ +import axios from "axios"; +import * as crypto from "crypto"; import { Ctx } from "../lib/ctx"; import * as Result from "../result"; import * as Cache from "./cache2"; +import { hostPort } from "../config/index"; +import { downloadAsPromised } from "../lib/minio"; import { ConnToken } from "./conn"; import { ServiceUser } from "./domain/organization/service_user"; import * as WorkflowitemDocument from "./domain/workflow/document"; @@ -33,7 +37,23 @@ export async function getDocument( 1, ); - const documentEvents: WorkflowitemDocumentUploaded.Event[] = items.map((i) => i.data.json); + const documentEvents: WorkflowitemDocumentUploaded.Event[] = []; + for (const item of items) { + const event = item.data.json; + if (event.document.base64 === "") { + // check if this file is stored locally + if (event.document.url === hostPort) { + event.document.base64 = await downloadAsPromised(event.document.id); + } else { + const remoteFile = await axios.get(`${event.document.url}/api/workflowitem.downloadDocumentMinio?projectId=${event.projectId}&subprojectId=${event.subprojectId}&workflowitemId=${event.workflowitemId}&documentId=${event.document.id}`); + event.document.base64 = Buffer.from(remoteFile.data).toString("base64"); + } + + } + documentEvents.push(event); + + } + return documentEvents; }, }), diff --git a/api/src/service/workflowitem_document_minio_download.ts b/api/src/service/workflowitem_document_minio_download.ts new file mode 100644 index 000000000..ea82c17f5 --- /dev/null +++ b/api/src/service/workflowitem_document_minio_download.ts @@ -0,0 +1,55 @@ +import { Ctx } from "../lib/ctx"; +import * as Result from "../result"; +import * as Cache from "./cache2"; +import { downloadAsPromised } from "../lib/minio"; +import { ConnToken } from "./conn"; +import { ServiceUser } from "./domain/organization/service_user"; +import * as WorkflowitemDocument from "./domain/workflow/document"; +import * as Project from "./domain/workflow/project"; +import * as Subproject from "./domain/workflow/subproject"; +import * as Workflowitem from "./domain/workflow/workflowitem"; +import * as WorkflowitemDocumentDownloadMinio from "./domain/workflow/workflowitem_document_download_minio"; +import * as WorkflowitemDocumentUploaded from "./domain/workflow/workflowitem_document_uploaded"; +import * as Liststreamkeyitems from "./liststreamkeyitems"; +import VError = require("verror"); + +export async function getDocumentMinio( + conn: ConnToken, + ctx: Ctx, + projectId: Project.Id, + subprojectId: Subproject.Id, + workflowitemId: Workflowitem.Id, + documentId: string, +): Promise> { + const documentResult = await Cache.withCache(conn, ctx, async (cache) => + WorkflowitemDocumentDownloadMinio.getDocumentMinio(ctx, workflowitemId, documentId, { + getWorkflowitem: async () => { + return cache.getWorkflowitem(projectId, subprojectId, workflowitemId); + }, + getDocumentEvents: async (documentId) => { + const items: Liststreamkeyitems.Item[] = await conn.multichainClient.v2_readStreamItems( + "offchain_documents", + documentId, + 1, + ); + + const documentEvents: WorkflowitemDocumentUploaded.Event[] = []; + for (const item of items) { + const event = item.data.json; + if (event.document.base64 === "") { + event.document.base64 = await downloadAsPromised(event.document.id); + } + documentEvents.push(event); + + } + return documentEvents; + }, + }), + ); + + return Result.mapErr( + documentResult, + (err) => + new VError(err, `could not get document ${documentId} of workflowitem ${workflowitemId}`), + ); +} diff --git a/api/src/service/workflowitem_update.ts b/api/src/service/workflowitem_update.ts index 309523a0f..f99fd7268 100644 --- a/api/src/service/workflowitem_update.ts +++ b/api/src/service/workflowitem_update.ts @@ -11,7 +11,10 @@ import * as Workflowitem from "./domain/workflow/workflowitem"; import * as WorkflowitemUpdate from "./domain/workflow/workflowitem_update"; import * as TypeEvents from "./domain/workflowitem_types/apply_workflowitem_type"; import * as GroupQuery from "./group_query"; +import { UploadedDocument } from "./domain/workflow/document"; +import * as Nodes from "../network/model/Nodes"; import { store } from "./store"; +import { uploadAsPromised } from "../lib/minio"; export type RequestData = WorkflowitemUpdate.RequestData; @@ -42,6 +45,13 @@ export async function updateWorkflowitem( applyWorkflowitemType: (event: BusinessEvent, workflowitem: Workflowitem.Workflowitem) => { return TypeEvents.applyWorkflowitemType(event, ctx, serviceUser, workflowitem); }, + uploadDocument: async (document: UploadedDocument) => { + await uploadAsPromised(document.id, document.base64, { fileName: document.fileName }); + }, + getOrganizations: async () => { + const nodes = await Nodes.get(conn.multichainClient); + return nodes; + }, }, ); }); diff --git a/api/src/workflowitem_download_document_minio.ts b/api/src/workflowitem_download_document_minio.ts new file mode 100644 index 000000000..03f31a98a --- /dev/null +++ b/api/src/workflowitem_download_document_minio.ts @@ -0,0 +1,133 @@ +import { FastifyInstance, RequestGenericInterface } from "fastify"; +import { VError } from "verror"; + +import { toHttpError } from "./http_errors"; +import * as NotFound from "./http_errors/not_found"; +import { AuthenticatedRequest } from "./httpd/lib"; +import { Ctx } from "./lib/ctx"; +import { isNonemptyString } from "./lib/validation"; +import * as Result from "./result"; +import { ServiceUser } from "./service/domain/organization/service_user"; +import * as WorkflowitemDocument from "./service/domain/workflow/document"; + +function mkSwaggerSchema() { + return { + schema: { + description: "Download documents attached to workflowitems", + tags: ["workflowitem"], + summary: "Download document attached to workflowitem", + querystring: { + type: "object", + properties: { + projectId: { + type: "string", + }, + subprojectId: { + type: "string", + }, + workflowitemId: { + type: "string", + }, + documentId: { + type: "string", + }, + }, + }, + security: [ + { + bearerToken: [], + }, + ], + response: { + 200: { + description: "successful response", + type: "string", + }, + 404: NotFound.schema, + }, + }, + }; +} + +interface Document { + data: string; + fileName: string; +} + +interface Service { + getDocumentMinio( + ctx: Ctx, + projectId: string, + subprojectId: string, + workflowitemId: string, + documentId: string, + ): Promise>; +} + +function sendErrorIfEmpty(reply, resourceParameter) { + if (!isNonemptyString(resourceParameter)) { + reply.status(400).send({ + apiVersion: "1.0", + error: { + code: 400, + message: `required query parameter ${resourceParameter} not present (must be non-empty string)`, + }, + }); + return true; + } + return false; +} + +interface Request extends RequestGenericInterface { + Querystring: { + projectId: string; + subprojectId: string; + workflowitemId: string; + documentId: string; + }; +} + +export function addHttpHandler(server: FastifyInstance, urlPrefix: string, service: Service) { + server.get( + `${urlPrefix}/workflowitem.downloadDocumentMinio`, + async (request, reply) => { + const ctx: Ctx = { requestId: request.id, source: "http" }; + + const { projectId, subprojectId, workflowitemId, documentId } = request.query; + + if ( + sendErrorIfEmpty(reply, projectId) || + sendErrorIfEmpty(reply, subprojectId) || + sendErrorIfEmpty(reply, workflowitemId) || + sendErrorIfEmpty(reply, documentId) + ) { + return; + } + + try { + const documentResult = await service.getDocumentMinio( + ctx, + projectId, + subprojectId, + workflowitemId, + documentId, + ); + + if (Result.isErr(documentResult)) { + throw new VError(documentResult, "workflowitem.downloadDocument"); + } + + const code = 200; + reply.headers({ + "Content-Type": "application/octet-stream", + "Content-Disposition": `attachment; filename="${documentResult.fileName}"`, + }); + + reply.status(code).send(Buffer.from(documentResult.base64, "base64")); + } catch (err) { + const { code, body } = toHttpError(err); + reply.status(code).send(body); + } + }, + ); +} diff --git a/api/src/workflowitem_update.ts b/api/src/workflowitem_update.ts index 9120c6b7d..aeb2f1cd2 100644 --- a/api/src/workflowitem_update.ts +++ b/api/src/workflowitem_update.ts @@ -101,6 +101,12 @@ function mkSwaggerSchema(server: FastifyInstance) { type: "string", example: "aGVsbG8gdGhpcyBpcyBhIHRlc3QgZm9yIHRoZSBhcGkgZG9j", }, + orgAccess: { + type: "array", + items: { + type: "string", + }, + }, }, }, }, @@ -156,6 +162,10 @@ export function addHttpHandler(server: FastifyInstance, urlPrefix: string, servi const { projectId, subprojectId, workflowitemId, ...data } = bodyResult.data; + + /** + * @see WorkflowitemUpdate.updateWorkflowitem + */ service .updateWorkflowitem(ctx, user, projectId, subprojectId, workflowitemId, data) .then((result) => { diff --git a/docker-compose/development/docker-compose-slim.yml b/docker-compose/development/docker-compose-slim.yml index d984fd813..5b66b49b1 100644 --- a/docker-compose/development/docker-compose-slim.yml +++ b/docker-compose/development/docker-compose-slim.yml @@ -15,11 +15,14 @@ services: - ${RPC_PORT}:${RPC_PORT} - "8085:8085" - "7447:7447" + networks: + - "trubudgetnetwork" master-api: build: ../../api environment: APP_NAME: Trubudget + API_HOST: master-api PORT: ${API_PORT} NODE_LOCATION_LAT: "30.11" NODE_LOCATION_LNG: "4.68" @@ -31,12 +34,22 @@ services: RPC_PORT: ${RPC_PORT} ROOT_SECRET: ${ROOT_SECRET} RPC_PASSWORD: ${RPC_PASSWORD} + MINIO_ENDPOINT: nginx + MINIO_PORT: 9000 + MINIO_USE_SSL: "false" + MINIO_ACCESS_KEY: minio + MINIO_SECRET_KEY: minio123 command: ["npm", "run", "dev"] + links: + - minio1 + - nginx volumes: - "../../api/src:/home/node/src:delegated" ports: - ${API_PORT}:${API_PORT} - "9230:9229" + networks: + - "trubudgetnetwork" depends_on: - master-node @@ -50,5 +63,39 @@ services: ENVIRONMENT_TYPE: PROD ROOT_SECRET: ${ROOT_SECRET} ORGANIZATION: ${ORGANIZATION} + networks: + - "trubudgetnetwork" depends_on: - master-api + + minio1: + image: minio/minio + volumes: + - ../../minio/data:/data + expose: + - "9000" + networks: + - "trubudgetnetwork" + environment: + MINIO_ACCESS_KEY: minio + MINIO_SECRET_KEY: minio123 + command: server /data + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + nginx: + image: nginx:1.19.2-alpine + volumes: + - ../../minio/nginx/nginx.conf:/etc/nginx/nginx.conf:ro + ports: + - "9000:9000" + networks: + - "trubudgetnetwork" + depends_on: + - minio1 + +networks: + trubudgetnetwork: diff --git a/docker-compose/development/docker-compose.yml b/docker-compose/development/docker-compose.yml index 6cdec29c4..3af8fb43e 100644 --- a/docker-compose/development/docker-compose.yml +++ b/docker-compose/development/docker-compose.yml @@ -20,6 +20,7 @@ services: build: ../../api environment: APP_NAME: Trubudget + API_HOST: master-api PORT: ${API_PORT} NODE_LOCATION_LAT: "30.11" NODE_LOCATION_LNG: "4.68" @@ -31,7 +32,15 @@ services: RPC_PORT: ${RPC_PORT} ROOT_SECRET: ${ROOT_SECRET} RPC_PASSWORD: ${RPC_PASSWORD} + MINIO_ENDPOINT: nginx + MINIO_PORT: 9000 + MINIO_USE_SSL: "false" + MINIO_ACCESS_KEY: minio + MINIO_SECRET_KEY: minio123 command: ["npm", "run", "dev"] + links: + - minio1 + - nginx volumes: - "../../api/src:/home/node/src:delegated" ports: @@ -94,3 +103,28 @@ services: - master-api - excel-export stdin_open: true + + minio1: + image: minio/minio + volumes: + - ../../minio/data:/data + expose: + - "9000" + environment: + MINIO_ACCESS_KEY: minio + MINIO_SECRET_KEY: minio123 + command: server /data + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + nginx: + image: nginx:1.19.2-alpine + volumes: + - ../../minio/nginx/nginx.conf:/etc/nginx/nginx.conf:ro + ports: + - "9000:9000" + depends_on: + - minio1 diff --git a/frontend/src/pages/Confirmation/validation.js b/frontend/src/pages/Confirmation/validation.js index b4a348cd9..ff69f602e 100644 --- a/frontend/src/pages/Confirmation/validation.js +++ b/frontend/src/pages/Confirmation/validation.js @@ -60,7 +60,8 @@ schemes base64: Joi.string() .required() .allow(""), - fileName: Joi.string().allow("") + fileName: Joi.string().allow(""), + orgAccess: Joi.array().items(Joi.string()).optional() }), status: Joi.string().valid("open"), dueDate: Joi.date().allow(null), diff --git a/frontend/src/pages/Documents/DocumentUpload.js b/frontend/src/pages/Documents/DocumentUpload.js index b26cfe64e..718282b3e 100644 --- a/frontend/src/pages/Documents/DocumentUpload.js +++ b/frontend/src/pages/Documents/DocumentUpload.js @@ -28,10 +28,28 @@ export default class DocumentUpload extends Component { constructor() { super(); this.state = { - name: "" + name: "", + orgAccess: [] }; } + checkOrgAccess = (org, checked) => { + this.setState((state) => { + const {orgAccess} = state; + // adding organisation + if (checked) { + if (!orgAccess.includes(org)) { + orgAccess.push(org); + } + } else { + if (orgAccess.includes(org)) { + orgAccess.splice(orgAccess.indexOf(org), 1); + } + } + return {orgAccess}; + }); + } + render = () => { const { storeWorkflowDocument, workflowDocuments } = this.props; return ( @@ -47,6 +65,17 @@ export default class DocumentUpload extends Component { id="documentnameinput" onChange={event => this.setState({ name: event.target.value })} /> + {/* { + ['Org1', 'Org2'].map((org) => { + return ( +
+ {org} + this.checkOrgAccess(event.target.value, event.target.checked)} /> +
+ + ); + }) + } */}