From 93877c9fc78580db7d338e968ae9fe3bf70d25f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wieland=20Sch=C3=B6bl?= Date: Wed, 16 Jun 2021 07:38:05 +0000 Subject: [PATCH] refactor: use range query for canteen module --- package-lock.json | 999 ++++++++++++------ package.json | 6 +- src/app/modules/data/data.provider.spec.ts | 61 +- src/app/modules/data/data.provider.ts | 54 +- .../mensa/place-mensa-detail.component.ts | 69 +- .../special/mensa/place-mensa-service.ts | 72 +- .../place/special/mensa/place-mensa.html | 10 +- 7 files changed, 832 insertions(+), 439 deletions(-) diff --git a/package-lock.json b/package-lock.json index ad53fb35..2bed0da0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1884,41 +1884,11 @@ "is-negated-glob": "^1.0.0" } }, - "@hapi/address": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@hapi/address/-/address-4.1.0.tgz", - "integrity": "sha512-SkszZf13HVgGmChdHo/PxchnSaCJ6cetVqLzyciudzZRT0jcOouIF/Q93mgjw8cce+D+4F4C1Z/WrfFN+O3VHQ==", - "requires": { - "@hapi/hoek": "^9.0.0" - } - }, - "@hapi/formula": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-2.0.0.tgz", - "integrity": "sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==" - }, "@hapi/hoek": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.0.tgz", "integrity": "sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug==" }, - "@hapi/joi": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-17.1.1.tgz", - "integrity": "sha512-p4DKeZAoeZW4g3u7ZeRo+vCDuSDgSvtsB/NpfjXEHTUjSeINAi/RrVOWiVQ1isaoLzMvFEhe8n5065mQq1AdQg==", - "requires": { - "@hapi/address": "^4.0.1", - "@hapi/formula": "^2.0.0", - "@hapi/hoek": "^9.0.0", - "@hapi/pinpoint": "^2.0.0", - "@hapi/topo": "^5.0.0" - } - }, - "@hapi/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-vzXR5MY7n4XeIvLpfl3HtE3coZYO4raKXW766R6DZw/6aLqR26iuZ109K7a0NtF2Db0jxqh7xz2AxkUwpUFybw==" - }, "@hapi/topo": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz", @@ -2309,39 +2279,44 @@ } }, "@openstapps/api": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/@openstapps/api/-/api-0.26.0.tgz", - "integrity": "sha512-PTE4rJGfOnDktuS1+08GeYSHt9onvYChgfdRgM6swdSspsvbPdYbhNQdwt4fkLEMAU3BbJfJgeMC07We9rBCZQ==", + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@openstapps/api/-/api-0.29.0.tgz", + "integrity": "sha512-2Y7akJv4EQUOTLVW1GB9I8PC7XHzrDUM5VRynL9rR/S0vy+DbgSR4OEk2gmbeib92Tni94gka42/so6ysE106A==", "requires": { "@krlwlfrt/async-pool": "0.5.0", - "@openstapps/core": "0.42.0", - "@openstapps/core-tools": "0.17.0", - "@openstapps/logger": "0.5.0", - "@types/cli-progress": "3.9.0", - "@types/express": "4.17.11", + "@openstapps/core": "0.46.0", + "@openstapps/core-tools": "0.21.0", + "@openstapps/logger": "0.7.0", + "@types/cli-progress": "3.9.1", + "@types/express": "4.17.12", "@types/morgan": "1.9.2", - "@types/node": "10.17.54", + "@types/node": "14.17.1", "@types/traverse": "0.6.32", - "@types/uuid": "3.4.9", - "@types/wait-on": "4.0.0", + "@types/uuid": "8.3.0", + "@types/wait-on": "5.3.0", "body-parser": "1.19.0", "cli-progress": "3.9.0", - "commander": "6.2.1", + "commander": "7.2.0", "express": "4.17.1", "fast-clone": "1.5.13", - "got": "11.8.1", + "got": "11.8.2", "json-schema": "0.3.0", "moment": "2.29.1", "morgan": "1.10.0", "traverse": "0.6.6", - "uuid": "3.4.0", - "wait-on": "4.0.2" + "uuid": "8.3.2", + "wait-on": "5.3.0" }, "dependencies": { "@types/node": { - "version": "10.17.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.54.tgz", - "integrity": "sha512-c8Lm7+hXdSPmWH4B9z/P/xIXhFK3mCQin4yCYMd2p1qpMG5AfgyJuYZ+3q2dT7qLiMMMGMd5dnkFpdqJARlvtQ==" + "version": "14.17.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.1.tgz", + "integrity": "sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" } } }, @@ -2374,98 +2349,231 @@ } }, "@openstapps/core": { - "version": "0.42.0", - "resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.42.0.tgz", - "integrity": "sha512-s9mDC3GoOj1NOsjJ4OzzUeqsQVDoqt84IYkG0Y69BJ+4qoZuOvOe5hSOp3L8Nkj1P82jp/q0qjO/63cMphp2yw==", + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.46.0.tgz", + "integrity": "sha512-nacn8ivrvi6auLYU5L+5aIB96EPRleWxMKZ/kzt5j+m1gV4q/tuM/WErsAB31hTNv6H5ax1MS1pNc9cVeoMJpA==", "requires": { - "@openstapps/core-tools": "0.17.0", + "@openstapps/core-tools": "0.19.0", "@types/geojson": "1.0.6", "@types/json-patch": "0.0.30", "@types/json-schema": "7.0.7", - "@types/node": "10.17.44", + "@types/node": "14.14.37", "fast-clone": "1.5.13", "fast-deep-equal": "3.1.3", "http-status-codes": "2.1.4", "json-patch": "0.7.0", - "json-schema": "0.2.5", + "json-schema": "0.3.0", "ts-optchain": "0.1.8" }, - "dependencies": { - "@types/node": { - "version": "10.17.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.44.tgz", - "integrity": "sha512-vHPAyBX1ffLcy4fQHmDyIUMUb42gHZjPHU66nhvbMzAWJqHnySGZ6STwN3rwrnSd1FHB0DI/RWgGELgKSYRDmw==" - }, - "json-schema": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.5.tgz", - "integrity": "sha512-gWJOWYFrhQ8j7pVm0EM8Slr+EPVq1Phf6lvzvD/WCeqkrx/f2xBI0xOsRRS9xCn3I4vKtP519dvs3TP09r24wQ==" - } - } - }, - "@openstapps/core-tools": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@openstapps/core-tools/-/core-tools-0.17.0.tgz", - "integrity": "sha512-YL0++bjhBEVb5qMHYdzCUgUb23ZGbqgkpCIHMUY5CuEZb2TUvP5HO1s1/7s/VpVVzE8lSqFqPGmeSBpHgs0K3g==", - "requires": { - "@krlwlfrt/async-pool": "0.3.0", - "@openstapps/logger": "0.5.0", - "@types/glob": "7.1.1", - "@types/got": "9.6.9", - "@types/json-schema": "7.0.6", - "@types/mustache": "4.0.0", - "@types/node": "10.17.21", - "ajv": "6.11.0", - "better-ajv-errors": "0.6.7", - "chai": "4.2.0", - "commander": "4.1.1", - "deepmerge": "4.2.2", - "del": "5.1.0", - "flatted": "2.0.1", - "glob": "7.1.6", - "got": "10.5.5", - "humanize-string": "2.1.0", - "json-schema": "0.2.5", - "mustache": "4.0.0", - "plantuml-encoder": "1.4.0", - "toposort": "2.0.2", - "ts-json-schema-generator": "0.60.0", - "ts-node": "8.6.2", - "typedoc": "0.18.0", - "typescript": "3.8.3" - }, "dependencies": { "@krlwlfrt/async-pool": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@krlwlfrt/async-pool/-/async-pool-0.3.0.tgz", "integrity": "sha512-N4uQIfGTsVw1/fE3Z7DWh878dyFhVkuFYyMiQyW8QTd21yjn91rlub5SERssQXMPKDzYKNGrban3FKSQAtXisQ==" }, - "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" + "@openstapps/core-tools": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@openstapps/core-tools/-/core-tools-0.19.0.tgz", + "integrity": "sha512-IJYa38e6FPgKd/YrmvP3Bubsc61yvC66X4vW/V+1ZsxG5PlUiMngXJ7eEVkl355ICQIeGp1VUhQkEJfOpaG1WQ==", + "requires": { + "@krlwlfrt/async-pool": "0.3.0", + "@openstapps/logger": "0.6.0", + "@types/glob": "7.1.3", + "@types/got": "9.6.11", + "@types/json-schema": "7.0.7", + "@types/mustache": "4.1.1", + "@types/node": "14.14.37", + "ajv": "6.12.6", + "better-ajv-errors": "0.7.0", + "chai": "4.3.4", + "commander": "4.1.1", + "deepmerge": "4.2.2", + "del": "5.1.0", + "flatted": "2.0.2", + "glob": "7.1.6", + "got": "10.7.0", + "humanize-string": "2.1.0", + "json-schema": "0.3.0", + "mustache": "4.2.0", + "plantuml-encoder": "1.4.0", + "toposort": "2.0.2", + "ts-json-schema-generator": "0.70.2", + "ts-node": "8.10.2", + "typedoc": "0.18.0", + "typescript": "3.8.3" + } }, - "@types/node": { - "version": "10.17.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.21.tgz", - "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==" + "@openstapps/logger": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@openstapps/logger/-/logger-0.6.0.tgz", + "integrity": "sha512-l/ILWPOSxhawcdDxn9vkdzib4xlRTnFmG4YygX8l8z0m9cocitMMZGw/DquZ0x6zGt2suOwSVRckYiSlk/6Erw==", + "requires": { + "@types/node": "14.14.37", + "@types/nodemailer": "6.4.1", + "chalk": "4.1.0", + "flatted": "3.1.1", + "moment": "2.29.1", + "nodemailer": "6.5.0" + }, + "dependencies": { + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" + } + } + }, + "@sindresorhus/is": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-2.1.1.tgz", + "integrity": "sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg==" + }, + "@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/got": { + "version": "9.6.11", + "resolved": "https://registry.npmjs.org/@types/got/-/got-9.6.11.tgz", + "integrity": "sha512-dr3IiDNg5TDesGyuwTrN77E1Cd7DCdmCFtEfSGqr83jMMtcwhf/SGPbN2goY4JUWQfvxwY56+e5tjfi+oXeSdA==", + "requires": { + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "@types/mustache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.1.1.tgz", + "integrity": "sha512-Sm0NWeLhS2QL7NNGsXvO+Fgp7e3JLHCO6RS3RCnfjAnkw6Y1bsji/AGfISdQZDIR/AeOyzkrxRk9jBkl55zdJw==" + }, + "@types/nodemailer": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.1.tgz", + "integrity": "sha512-8081UY/0XTTDpuGqCnDc8IY+Q3DSg604wB3dBH0CaZlj4nZWHWuxtZ3NRZ9c9WUrz1Vfm6wioAUnqL3bsh49uQ==", + "requires": { + "@types/node": "*" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "better-ajv-errors": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-0.7.0.tgz", + "integrity": "sha512-6GtJQ/AwVSo1pI1MDQU/yg8O86gMsrt5RKtELo08Epa2zWJPCOK85v/O8/U5A9JkWmwRkE16JpSgssKSx6moog==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/runtime": "^7.0.0", + "chalk": "^2.4.1", + "core-js": "^3.2.1", + "json-to-ast": "^2.0.3", + "jsonpointer": "^4.0.1", + "leven": "^3.1.0" + }, + "dependencies": { + "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==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "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==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" }, + "core-js": { + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.12.1.tgz", + "integrity": "sha512-Ne9DKPHTObRuB09Dru5AjwKjY4cJHVGu+y5f7coGn1E9Grkc3p2iBwE9AI/nJzsE29mQF7oq+mhYYRqOMFN1Bw==" + }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==" + }, "got": { - "version": "10.5.5", - "resolved": "https://registry.npmjs.org/got/-/got-10.5.5.tgz", - "integrity": "sha512-B13HHkCkTA7KxyxTrFoZfrurBX1fZxjMTKpmIfoVzh0Xfs9aZV7xEfI6EKuERQOIPbomh5LE4xDkfK6o2VXksw==", + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/got/-/got-10.7.0.tgz", + "integrity": "sha512-aWTDeNw9g+XqEZNcTjMMZSy7B7yE9toWOFYip7ofFTLleJhvZwUxxTxkTpKvF+p1SAA4VHmuEy7PiHTHyq8tJg==", "requires": { - "@sindresorhus/is": "^1.0.0", + "@sindresorhus/is": "^2.0.0", "@szmarczak/http-timer": "^4.0.0", "@types/cacheable-request": "^6.0.1", "cacheable-lookup": "^2.0.0", @@ -2474,55 +2582,254 @@ "duplexer3": "^0.1.4", "get-stream": "^5.0.0", "lowercase-keys": "^2.0.0", - "mimic-response": "^2.0.0", + "mimic-response": "^2.1.0", "p-cancelable": "^2.0.0", "p-event": "^4.0.0", "responselike": "^2.0.0", "to-readable-stream": "^2.0.0", - "type-fest": "^0.9.0" + "type-fest": "^0.10.0" } }, - "json-schema": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.5.tgz", - "integrity": "sha512-gWJOWYFrhQ8j7pVm0EM8Slr+EPVq1Phf6lvzvD/WCeqkrx/f2xBI0xOsRRS9xCn3I4vKtP519dvs3TP09r24wQ==" + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" + }, + "nodemailer": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.5.0.tgz", + "integrity": "sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw==" + }, + "ts-json-schema-generator": { + "version": "0.70.2", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-0.70.2.tgz", + "integrity": "sha512-4miuxRyxYvwzCGGzxGvN39fwlY7HDlj1KRpZq8Hi3IegeAnguc9q4gDvcqMaDKoRiNNnV5fwplRWZFhRrtvr4Q==", + "requires": { + "@types/json-schema": "^7.0.5", + "commander": "~5.1.0", + "glob": "~7.1.6", + "json-stable-stringify": "^1.0.1", + "typescript": "~3.9.5" + }, + "dependencies": { + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" + }, + "typescript": { + "version": "3.9.9", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", + "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==" + } + } }, "ts-node": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz", - "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==", + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", "requires": { "arg": "^4.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.6", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + }, + "type-fest": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.10.0.tgz", + "integrity": "sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw==" + } + } + }, + "@openstapps/core-tools": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@openstapps/core-tools/-/core-tools-0.21.0.tgz", + "integrity": "sha512-8zJfuGImeAjqUddYVxRD1mgqpVsmn8k5ZiEeDX0JW1q590OCbAZsoTiaLPtfHjUK4bu2hoNkaPs5cyYTAxD8Ew==", + "requires": { + "@krlwlfrt/async-pool": "0.5.0", + "@openstapps/logger": "0.6.0", + "@types/glob": "7.1.3", + "@types/json-schema": "7.0.7", + "@types/mustache": "4.1.1", + "@types/node": "14.14.41", + "ajv": "6.12.6", + "better-ajv-errors": "0.7.0", + "chai": "4.3.4", + "commander": "7.2.0", + "deepmerge": "4.2.2", + "del": "6.0.0", + "flatted": "3.1.1", + "glob": "7.1.6", + "got": "11.8.2", + "humanize-string": "2.1.0", + "json-schema": "0.3.0", + "mustache": "4.2.0", + "plantuml-encoder": "1.4.0", + "toposort": "2.0.2", + "ts-json-schema-generator": "0.70.2", + "ts-node": "9.1.1", + "typedoc": "0.18.0", + "typescript": "3.8.3" + }, + "dependencies": { + "@openstapps/logger": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@openstapps/logger/-/logger-0.6.0.tgz", + "integrity": "sha512-l/ILWPOSxhawcdDxn9vkdzib4xlRTnFmG4YygX8l8z0m9cocitMMZGw/DquZ0x6zGt2suOwSVRckYiSlk/6Erw==", + "requires": { + "@types/node": "14.14.37", + "@types/nodemailer": "6.4.1", + "chalk": "4.1.0", + "flatted": "3.1.1", + "moment": "2.29.1", + "nodemailer": "6.5.0" + }, + "dependencies": { + "@types/node": { + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==" + } + } + }, + "@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.14.41", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.41.tgz", + "integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==" + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + }, + "del": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", + "integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==", + "requires": { + "globby": "^11.0.1", + "graceful-fs": "^4.2.4", + "is-glob": "^4.0.1", + "is-path-cwd": "^2.2.0", + "is-path-inside": "^3.0.2", + "p-map": "^4.0.0", + "rimraf": "^3.0.2", + "slash": "^3.0.0" + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" + }, + "globby": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "requires": { + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", "yn": "3.1.1" } } } }, "@openstapps/logger": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@openstapps/logger/-/logger-0.5.0.tgz", - "integrity": "sha512-SLjoeFoXuCagz1WRlFvX2+zoIJr+zehAJe6egNPrYdlI3IpnUYNk06HzWzNM95Iozzfy7eKJjft8plO4VQtQQg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@openstapps/logger/-/logger-0.7.0.tgz", + "integrity": "sha512-oVtHX7Y6VplOlsM3MUOUk1tRsZEfFn4F1vqtb/3K1Bpi2UQ0rMhiMwnLZCea+9yXQkRUi96CtmOgdhGBHQ2jLw==", "requires": { - "@types/node": "10.17.17", - "@types/nodemailer": "6.4.0", - "chalk": "3.0.0", - "flatted": "2.0.1", - "moment": "2.24.0", - "nodemailer": "6.4.4" + "@types/node": "14.14.45", + "@types/nodemailer": "6.4.1", + "chalk": "4.1.1", + "flatted": "3.1.1", + "moment": "2.29.1", + "nodemailer": "6.6.0" }, "dependencies": { "@types/node": { - "version": "10.17.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.17.tgz", - "integrity": "sha512-gpNnRnZP3VWzzj5k3qrpRC6Rk3H/uclhAVo1aIvwzK5p5cOrs9yEyQ8H/HBsBY0u5rrWxXEiVPQ0dEB6pkjE8Q==" + "version": "14.14.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.45.tgz", + "integrity": "sha512-DssMqTV9UnnoxDWu959sDLZzfvqCF0qDNRjaWeYSui9xkFe61kKo4l1TWNTQONpuXEm+gLMRvdlzvNHBamzmEw==" }, - "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" + }, + "nodemailer": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.6.0.tgz", + "integrity": "sha512-ikSMDU1nZqpo2WUPE0wTTw/NGGImTkwpJKDIFPZT+YvvR9Sj+ze5wzu95JHkBMglQLoG2ITxU21WukCC/XsFkg==" } } }, @@ -2564,10 +2871,28 @@ } } }, + "@sideway/address": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.2.tgz", + "integrity": "sha512-idTz8ibqWFrPU8kMirL0CoPH/A29XOzzAzpyN3zQ4kAWnzmNfFmRaoMNN6VI8ske5M73HZyhIaW4OuSFIdM4oA==", + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@sideway/formula": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", + "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==" + }, + "@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" + }, "@sindresorhus/is": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-1.2.0.tgz", - "integrity": "sha512-mwhXGkRV5dlvQc4EgPDxDxO6WuMBVymGFd1CA+2Y+z5dG9MNspoQ+AWjl/Ld1MnpCL8AKbosZlDVohqcIwuWsw==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz", + "integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==" }, "@stencil/core": { "version": "2.5.2", @@ -2589,13 +2914,6 @@ "requires": { "@types/connect": "*", "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/cacheable-request": { @@ -2617,18 +2935,11 @@ } }, "@types/cli-progress": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.9.0.tgz", - "integrity": "sha512-tjjS3BcYACRt3TLxfccN0dkA8X1DHNc2bDsTvcHaOHwa710MTH7owylG8WOaFQtZzt04vojiLvsObPfZbO6Ncw==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.9.1.tgz", + "integrity": "sha512-X/tKJv/GoYlCBS9wwJTLrVSxzIOI/Cj1cCatYOAAoQne3aT1QbHBptBS5+zLe2ToSljAijHU1N/ouBNFvZ2H/g==", "requires": { "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/connect": { @@ -2637,13 +2948,6 @@ "integrity": "sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ==", "requires": { "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/cordova": { @@ -2666,9 +2970,9 @@ "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" }, "@types/express": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.11.tgz", - "integrity": "sha512-no+R6rW60JEc59977wIxreQVsIEOAYwgCqldrA/vkpCnbD7MqTefO97lmoBe4WE0F156bC4uLSP1XHDOySnChg==", + "version": "4.17.12", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.12.tgz", + "integrity": "sha512-pTYas6FrP15B1Oa0bkN5tQMNqOcVXa9j4FTFtO8DWI9kppKib+6NJtfTOOLcwxuuYvcX2+dVG6et1SxW/Kc17Q==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -2677,20 +2981,13 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.19.tgz", - "integrity": "sha512-DJOSHzX7pCiSElWaGR8kCprwibCB/3yW6vcT8VG3P0SJjnv19gnWG/AZMfM60Xj/YJIp/YCaDHyvzsFVeniARA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.21.tgz", + "integrity": "sha512-gwCiEZqW6f7EoR8TTEfalyEhb1zA5jQJnRngr97+3pzMaO1RKoI1w2bw07TK72renMUVWcWS5mLI6rk1NqN0nA==", "requires": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/form-data": { @@ -2724,23 +3021,6 @@ } } }, - "@types/got": { - "version": "9.6.9", - "resolved": "https://registry.npmjs.org/@types/got/-/got-9.6.9.tgz", - "integrity": "sha512-w+ZE+Ovp6fM+1sHwJB7RN3f3pTJHZkyABuULqbtknqezQyWadFEp5BzOXaZzRqAw2md6/d3ybxQJt+BNgpvzOg==", - "requires": { - "@types/node": "*", - "@types/tough-cookie": "*", - "form-data": "^2.5.0" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } - } - }, "@types/http-cache-semantics": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz", @@ -2786,6 +3066,21 @@ } } }, + "@types/lodash": { + "version": "4.14.168", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", + "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", + "dev": true + }, + "@types/lodash-es": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.4.tgz", + "integrity": "sha512-BBz79DCJbD2CVYZH67MBeHZRX++HF+5p8Mo5MzjZi64Wac39S3diedJYHZtScbRVf4DjZyN6LzA0SB0zy+HSSQ==", + "dev": true, + "requires": { + "@types/lodash": "*" + } + }, "@types/marked": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@types/marked/-/marked-0.7.4.tgz", @@ -2813,39 +3108,24 @@ "integrity": "sha512-edtGMEdit146JwwIeyQeHHg9yID4WSolQPxpEorHmN3KuytuCHyn2ELNr5Uxy8SerniFbbkmgKMrGM933am5BQ==", "requires": { "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/mustache": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.0.0.tgz", - "integrity": "sha512-AVBOcLJenbpCIJcHUvGWj+YMlaiwcFlGK1YEH2mePXkB5B/vQLrFkHG9IpBH71mXnkbibc4V8Nnn1wJSxcgCEA==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.1.1.tgz", + "integrity": "sha512-Sm0NWeLhS2QL7NNGsXvO+Fgp7e3JLHCO6RS3RCnfjAnkw6Y1bsji/AGfISdQZDIR/AeOyzkrxRk9jBkl55zdJw==" }, "@types/node": { "version": "14.14.37", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", - "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", - "dev": true + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==" }, "@types/nodemailer": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.0.tgz", - "integrity": "sha512-KY7bFWB0MahRZvVW4CuW83qcCDny59pJJ0MQ5ifvfcjNwPlIT0vW4uARO4u1gtkYnWdhSvURegecY/tzcukJcA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.1.tgz", + "integrity": "sha512-8081UY/0XTTDpuGqCnDc8IY+Q3DSg604wB3dBH0CaZlj4nZWHWuxtZ3NRZ9c9WUrz1Vfm6wioAUnqL3bsh49uQ==", "requires": { "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/normalize-package-data": { @@ -2913,13 +3193,6 @@ "requires": { "@types/mime": "^1", "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==" - } } }, "@types/source-list-map": { @@ -2939,14 +3212,17 @@ "integrity": "sha512-RBz2uRZVCXuMg93WD//aTS5B120QlT4lR/gL+935QtGsKHLS6sCtZBaKfWjIfk7ZXv/r8mtGbwjVIee6/3XTow==" }, "@types/uuid": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.9.tgz", - "integrity": "sha512-XDwyIlt/47l2kWLTzw/mtrpLdB+GPSskR2n/PIcPn+VYhVO77rGhRncIR5GPU0KRzXuqkDO+J5qqrG0Y8P6jzQ==" + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==" }, "@types/wait-on": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/wait-on/-/wait-on-4.0.0.tgz", - "integrity": "sha512-Cj2jcMOzrdvWMP+Vl+qlz942eQfJk96S9kRnB1ejVMl+w9/9mUn0+pF4J+v0Iv+6zCrmBBODZAXKsRo6Y91Cfw==" + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@types/wait-on/-/wait-on-5.3.0.tgz", + "integrity": "sha512-shduy6IRDu8ccaILJ2N7qj/43FsOpzQslIaaG0Pa4WVdIoUpnTxxViJgbEAW4xAOsHbsu9IBOF2DzLNkmYM0MQ==", + "requires": { + "@types/node": "*" + } }, "@types/webpack-sources": { "version": "0.1.8", @@ -3262,6 +3538,7 @@ "version": "6.11.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", + "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3534,6 +3811,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -3773,12 +4051,22 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.0" + } }, "axobject-query": { "version": "2.2.0", @@ -3959,6 +4247,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -3970,9 +4259,9 @@ "dev": true }, "better-ajv-errors": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-0.6.7.tgz", - "integrity": "sha512-PYgt/sCzR4aGpyNy5+ViSQ77ognMnWq7745zM+/flYO4/Yisdtp9wDQW2IKCyVYPUxQt3E/b5GBSwfhd1LPdlg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-0.7.0.tgz", + "integrity": "sha512-6GtJQ/AwVSo1pI1MDQU/yg8O86gMsrt5RKtELo08Epa2zWJPCOK85v/O8/U5A9JkWmwRkE16JpSgssKSx6moog==", "requires": { "@babel/code-frame": "^7.0.0", "@babel/runtime": "^7.0.0", @@ -4015,9 +4304,9 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "core-js": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.12.1.tgz", - "integrity": "sha512-Ne9DKPHTObRuB09Dru5AjwKjY4cJHVGu+y5f7coGn1E9Grkc3p2iBwE9AI/nJzsE29mQF7oq+mhYYRqOMFN1Bw==" + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.14.0.tgz", + "integrity": "sha512-3s+ed8er9ahK+zJpp9ZtuVcDoFzHNiZsPbNAAE4KXgrRHbjSqqNN6xGSXq6bq7TZIbKj4NLrLb6bJ5i+vSVjHA==" }, "has-flag": { "version": "3.0.0", @@ -4060,6 +4349,16 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "blob": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", @@ -4624,18 +4923,19 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", "requires": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", "deep-eql": "^3.0.1", "get-func-name": "^2.0.0", - "pathval": "^1.1.0", + "pathval": "^1.1.1", "type-detect": "^4.0.5" } }, @@ -5216,9 +5516,9 @@ } }, "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" }, "commondir": { "version": "1.0.1", @@ -6454,7 +6754,8 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "cors": { "version": "2.8.5", @@ -6523,6 +6824,11 @@ "sha.js": "^2.4.8" } }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -6866,6 +7172,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -7435,6 +7742,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -8072,7 +8380,8 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "extend-shallow": { "version": "3.0.2", @@ -8174,7 +8483,8 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "eyes": { "version": "0.1.8", @@ -8281,6 +8591,13 @@ "schema-utils": "^2.6.5" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "fileset": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", @@ -8402,7 +8719,8 @@ "flatted": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==" + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "dev": true }, "flush-write-stream": { "version": "1.1.1", @@ -8417,8 +8735,7 @@ "follow-redirects": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", - "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", - "dev": true + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" }, "fontkit": { "version": "1.8.1", @@ -8472,7 +8789,8 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "form-data": { "version": "2.5.0", @@ -8813,6 +9131,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -9297,9 +9616,9 @@ } }, "got": { - "version": "11.8.1", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.1.tgz", - "integrity": "sha512-9aYdZL+6nHmvJwHALLwKSUZ0hMwGaJGYv3hoPLPgnT8BoBXm1SjnZeky+91tfwJaDzun2s4RsBRy48IEYv2q2Q==", + "version": "11.8.2", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.2.tgz", + "integrity": "sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ==", "requires": { "@sindresorhus/is": "^4.0.0", "@szmarczak/http-timer": "^4.0.5", @@ -9314,11 +9633,6 @@ "responselike": "^2.0.0" }, "dependencies": { - "@sindresorhus/is": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz", - "integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==" - }, "cacheable-lookup": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", @@ -9370,12 +9684,14 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "har-validator": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -9385,6 +9701,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -9861,6 +10178,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -10534,7 +10852,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-unc-path": { "version": "1.0.0", @@ -10590,7 +10909,8 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "istanbul-api": { "version": "2.1.7", @@ -10823,6 +11143,18 @@ "supports-color": "^7.0.0" } }, + "joi": { + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.0.tgz", + "integrity": "sha512-F4WiW2xaV6wc1jxete70Rw4V/VuMd6IN+a5ilZsxG4uYtUXWu2kq9W5P2dz30e7Gmw8RCbY/u/uk+dMPma9tAg==", + "requires": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.0", + "@sideway/formula": "^3.0.0", + "@sideway/pinpoint": "^2.0.0" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -10840,7 +11172,8 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "jsesc": { "version": "2.5.2", @@ -10891,7 +11224,8 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "json-to-ast": { "version": "2.1.0", @@ -10946,6 +11280,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -10956,7 +11291,8 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true } } }, @@ -11468,7 +11804,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", @@ -11693,6 +12033,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -12510,9 +12855,9 @@ } }, "mustache": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.0.0.tgz", - "integrity": "sha512-FJgjyX/IVkbXBXYUwH+OYwQKqWpFPLaLVESd70yHjSDunwzV2hZOoTBvPf4KLoxesUzzyfTH6F784Uqd7Wm5yA==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" }, "mute-stream": { "version": "0.0.8", @@ -12520,6 +12865,13 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -12671,9 +13023,9 @@ "dev": true }, "nodemailer": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.4.tgz", - "integrity": "sha512-2GqGu5o3FBmDibczU3+LZh9lCEiKmNx7LvHl512p8Kj+Kn5FQVOICZv85MDFz/erK0BDd5EJp3nqQLpWCZD1Gg==" + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.5.0.tgz", + "integrity": "sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw==" }, "nopt": { "version": "4.0.3", @@ -12872,7 +13224,8 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.1.1", @@ -13648,7 +14001,8 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "picomatch": { "version": "2.2.3", @@ -14818,7 +15172,8 @@ "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true }, "public-encrypt": { "version": "4.0.3", @@ -15363,6 +15718,7 @@ "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -15390,6 +15746,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -15399,28 +15756,11 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true } } }, - "request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "requires": { - "lodash": "^4.17.19" - } - }, - "request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "requires": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -16655,6 +16995,7 @@ "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -16771,11 +17112,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" - }, "stream-browserify": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", @@ -17779,6 +18115,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, "requires": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -17808,26 +18145,26 @@ "dev": true }, "ts-json-schema-generator": { - "version": "0.60.0", - "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-0.60.0.tgz", - "integrity": "sha512-hXSlkb2kID3WJq9CHrnIxlLdIiGuRvrajJT8mQEaHI8xWNk5Sy+wRXvWlHRUn64RpUR9dyydI4d33aKb/CXssw==", + "version": "0.70.2", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-0.70.2.tgz", + "integrity": "sha512-4miuxRyxYvwzCGGzxGvN39fwlY7HDlj1KRpZq8Hi3IegeAnguc9q4gDvcqMaDKoRiNNnV5fwplRWZFhRrtvr4Q==", "requires": { - "@types/json-schema": "^7.0.4", - "commander": "~4.1.1", + "@types/json-schema": "^7.0.5", + "commander": "~5.1.0", "glob": "~7.1.6", "json-stable-stringify": "^1.0.1", - "typescript": "~3.7.5" + "typescript": "~3.9.5" }, "dependencies": { "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" }, "typescript": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz", - "integrity": "sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA==" + "version": "3.9.9", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", + "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==" } } }, @@ -18247,6 +18584,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -18254,7 +18592,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "type": { "version": "1.2.0", @@ -18276,11 +18615,6 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, - "type-fest": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.9.0.tgz", - "integrity": "sha512-j55pzONIdg7rdtJTRZPKIbV0FosUqYdhHK1aAYJIrUvejv1VVyBokrILE8KQDT4emW/1Ev9tx+yZG+AxuSBMmA==" - }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -18749,7 +19083,8 @@ "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true }, "validate-npm-package-license": { "version": "3.0.4", @@ -18785,6 +19120,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -18809,16 +19145,15 @@ "dev": true }, "wait-on": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-4.0.2.tgz", - "integrity": "sha512-Qpmgm3Hw/sXm7xK68FBsYy5r+Uid94/QymwnEjn9GTpfiWTUVYm0bccivVwY/BXGYO2r+5Cd8S/DzrRZqHK/9w==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-5.3.0.tgz", + "integrity": "sha512-DwrHrnTK+/0QFaB9a8Ol5Lna3k7WvUR4jzSKmz0YaPBpuN2sACyiPVKVfj6ejnjcajAcvn3wlbTyMIn9AZouOg==", "requires": { - "@hapi/joi": "^17.1.1", - "lodash": "^4.17.15", + "axios": "^0.21.1", + "joi": "^17.3.0", + "lodash": "^4.17.21", "minimist": "^1.2.5", - "request": "^2.88.2", - "request-promise-native": "^1.0.8", - "rxjs": "^6.5.5" + "rxjs": "^6.6.3" } }, "watchpack": { @@ -18955,7 +19290,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", @@ -19563,7 +19902,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", diff --git a/package.json b/package.json index 054be90f..4b6c7342 100644 --- a/package.json +++ b/package.json @@ -57,9 +57,9 @@ "@ionic/storage": "2.2.0", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", - "@openstapps/api": "0.26.0", + "@openstapps/api": "0.29.0", "@openstapps/configuration": "0.25.0", - "@openstapps/core": "0.42.0", + "@openstapps/core": "0.46.0", "cordova-android": "9.0.0", "cordova-browser": "6.0.0", "cordova-ios": "6.2.0", @@ -74,6 +74,7 @@ "core-js": "2.6.5", "deepmerge": "3.3.0", "form-data": "2.5.0", + "lodash-es": "4.17.21", "moment": "2.29.1", "ngx-logger": "4.1.9", "ngx-markdown": "9.1.1", @@ -95,6 +96,7 @@ "@ionic/angular-toolkit": "2.3.3", "@types/deepmerge": "2.2.0", "@types/form-data": "2.5.0", + "@types/lodash-es": "4.17.4", "@types/jasmine": "3.3.12", "@types/jasminewd2": "2.0.6", "@types/node": "14.14.37", diff --git a/src/app/modules/data/data.provider.spec.ts b/src/app/modules/data/data.provider.spec.ts index a480258a..6f486fdd 100644 --- a/src/app/modules/data/data.provider.spec.ts +++ b/src/app/modules/data/data.provider.spec.ts @@ -14,8 +14,10 @@ */ import {TestBed} from '@angular/core/testing'; import {Client} from '@openstapps/api/lib/client'; -import {SCDish, SCMessage, SCSaveableThing, SCSearchQuery, - SCSearchResponse, SCSearchValueFilter, SCThing, SCThingOriginType, SCThings, SCThingType} from '@openstapps/core'; +import { + SCDish, SCMessage, SCMultiSearchRequest, SCSaveableThing, SCSearchQuery, + SCSearchResponse, SCSearchValueFilter, SCThing, SCThingOriginType, SCThings, SCThingType, +} from '@openstapps/core'; import {sampleThingsMap} from '../../_helpers/data/sample-things'; import {StorageProvider} from '../storage/storage.provider'; import {DataModule} from './data.module'; @@ -96,6 +98,61 @@ describe('DataProvider', () => { expect(response).toEqual(sampleResponse); }); + it('should provide backend data items using multi search query', async () => { + spyOn(Client.prototype as any, 'multiSearch').and.callFake(() => ({ + then: (callback: any) => { + return callback({ + a: sampleResponse, + }); + }, + })); + const response = await dataProvider.multiSearch({a: sampleQuery}); + expect(response).toEqual({a: sampleResponse}); + }); + + it('should partition search requests correctly', async () => { + const request = { + a: 'a', + b: 'b', + c: 'c', + d: 'd', + e: 'e', + } as SCMultiSearchRequest; // and response... + const requestCheck = Object.assign({}, request); + const responseShould = { + a: 'A', + b: 'B', + c: 'C', + d: 'D', + e: 'E', + }; + + dataProvider.backendQueriesLimit = 2; + spyOn(Client.prototype as any, 'multiSearch').and.callFake((req: SCMultiSearchRequest) => ({ + then: (callback: any) => { + let i = 0; + for (const key in req) { + if (req.hasOwnProperty(key)) { + i++; + // @ts-ignore + expect(requestCheck[key]).not.toBeNull(); + expect(requestCheck[key]).toEqual(req[key]); + // @ts-ignore + requestCheck[key] = null; + // @ts-ignore + req[key] = req[key].toUpperCase(); + } + } + expect(i).toBeLessThanOrEqual(dataProvider.backendQueriesLimit); + + return callback(req); + }, + })); + + const response = await dataProvider.multiSearch(request); + expect(response).toEqual(responseShould); + }); + it('should put an data item into the local database (storage)', async () => { let providedThing: SCSaveableThing; spyOn(storageProvider, 'put' as any).and.callFake((_id: any, thing: any) => { diff --git a/src/app/modules/data/data.provider.ts b/src/app/modules/data/data.provider.ts index d5e735c0..bd7a8d18 100644 --- a/src/app/modules/data/data.provider.ts +++ b/src/app/modules/data/data.provider.ts @@ -14,8 +14,16 @@ */ import {Injectable} from '@angular/core'; import {Client} from '@openstapps/api/lib/client'; -import {SCSearchRequest, SCSearchResponse, SCThingOriginType, SCThings, SCThingType} from '@openstapps/core'; +import { + SCMultiSearchRequest, SCMultiSearchResponse, + SCSearchRequest, + SCSearchResponse, + SCThingOriginType, + SCThings, + SCThingType, +} from '@openstapps/core'; import {SCSaveableThing} from '@openstapps/core'; +import {chunk, fromPairs, toPairs} from 'lodash-es'; import {environment} from '../../../environments/environment'; import {StorageProvider} from '../storage/storage.provider'; import {StAppsWebHttpClient} from './stapps-web-http-client.provider'; @@ -35,6 +43,20 @@ export enum DataScope { providedIn: 'root', }) export class DataProvider { + + /** + * TODO + */ + get storagePrefix(): string { + return this._storagePrefix; + } + + /** + * TODO + */ + set storagePrefix(storagePrefix) { + this._storagePrefix = storagePrefix; + } /** * TODO */ @@ -43,6 +65,10 @@ export class DataProvider { * Version of the app (used for the header in communication with the backend) */ appVersion = environment.backend_version; + /** + * Maximum number of sub-queries in a multi-query allowed by the backend + */ + backendQueriesLimit = 5; /** * TODO */ @@ -144,6 +170,18 @@ export class DataProvider { return this.storageProvider.has(this.getDataKey(uid)); } + /** + * Performs multiple searches at once and returns their responses + * + * @param query - query to send to the backend (auto-splits according to the backend limit) + */ + async multiSearch(query: SCMultiSearchRequest): Promise { + // partition object into chunks, process those requests in parallel, then merge their responses again + return Object.assign({}, ...(await Promise.all(chunk(toPairs(query), this.backendQueriesLimit) + .map((request) => this.client.multiSearch(fromPairs(request))), + ))); + } + /** * Save a data item * @@ -174,18 +212,4 @@ export class DataProvider { async search(query: SCSearchRequest): Promise { return (this.client.search(query)); } - - /** - * TODO - */ - get storagePrefix(): string { - return this._storagePrefix; - } - - /** - * TODO - */ - set storagePrefix(storagePrefix) { - this._storagePrefix = storagePrefix; - } } diff --git a/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts b/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts index c32fb140..fe6f42ac 100644 --- a/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts +++ b/src/app/modules/data/types/place/special/mensa/place-mensa-detail.component.ts @@ -15,8 +15,9 @@ import moment, {Moment} from 'moment'; -import {AfterViewInit, ChangeDetectorRef, Component, Input} from '@angular/core'; -import {SCDish, SCPlace} from '@openstapps/core'; +import {AfterViewInit, Component, Input} from '@angular/core'; +import {SCDish, SCISO8601Date, SCPlace} from '@openstapps/core'; +import {keys} from 'lodash-es'; import {PlaceMensaService} from './place-mensa-service'; /** @@ -30,14 +31,14 @@ import {PlaceMensaService} from './place-mensa-service'; export class PlaceMensaDetailComponent implements AfterViewInit { /** - * TODO + * Map of dishes for each day */ - dishes: Promise> | null = null; + dishes: Promise> | null = null; /** * number of days to display mensa menus for */ - displayRange = 5; + @Input() displayRange = 5; /** * TODO @@ -45,7 +46,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit { @Input() item: SCPlace; /** - * TODO + * The currently selected day */ selectedDay: string; @@ -54,9 +55,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit { */ startingDay: Moment; - - constructor(private mensaService: PlaceMensaService, private changeDetectorRef: ChangeDetectorRef) { - // TODO: translation + constructor(private mensaService: PlaceMensaService) { this.startingDay = moment(); this.startingDay.hour(0); this.startingDay.minute(0); @@ -67,55 +66,7 @@ export class PlaceMensaDetailComponent implements AfterViewInit { * TODO */ ngAfterViewInit() { - this.dishes = this.mensaService.getAllDishes(this.item) - .then((dishesResult) => { - const out = this.splitDishes(dishesResult, this.item, this.startingDay, this.displayRange); - for (const key in out) { - if (out.hasOwnProperty(key)) { - this.selectedDay = key; - break; - } - } - this.changeDetectorRef.detectChanges(); - - return out; - }); - } - - /** - * Splits a list of dishes with availability start and end into multiple lists by day - */ - // tslint:disable-next-line:prefer-function-over-method - splitDishes(dishes: SCDish[], place: SCPlace, startingDay: Moment, displayRange: number): Record { - const out: Record = {}; - - for (let i = 0; i < displayRange; i++) { - const nextDay: Moment = moment(startingDay) - .add(1, 'days'); - const selectedDishes: SCDish[] = []; - for (const dish of dishes) { - // go through all offers - if (dish.offers === undefined) { continue; } - for (const offer of dish.offers) { - if (offer.inPlace === undefined || offer.inPlace.uid !== place.uid) { continue; } - // get availabilities - const availabilityStarts = offer.availabilityStarts === undefined ? undefined : moment(offer.availabilityStarts); - const availabilityEnds = offer.availabilityEnds === undefined ? undefined : moment(offer.availabilityEnds); - - if ((availabilityStarts === undefined || availabilityStarts.isBefore(nextDay)) - && (availabilityEnds === undefined || availabilityEnds.isAfter(startingDay))) { - selectedDishes.push(dish); - break; - } - } - } - if (selectedDishes.length > 0) { - out[startingDay.format('L')] = selectedDishes; - } - // tslint:disable-next-line:no-parameter-reassignment - startingDay = nextDay; - } - - return out; + this.dishes = this.mensaService.getAllDishes(this.item, this.displayRange); + this.dishes.then((result) => this.selectedDay = keys(result)[0]); } } diff --git a/src/app/modules/data/types/place/special/mensa/place-mensa-service.ts b/src/app/modules/data/types/place/special/mensa/place-mensa-service.ts index 0d2448b3..e12440b9 100644 --- a/src/app/modules/data/types/place/special/mensa/place-mensa-service.ts +++ b/src/app/modules/data/types/place/special/mensa/place-mensa-service.ts @@ -14,7 +14,9 @@ */ import {Injectable} from '@angular/core'; -import {SCDish, SCPlace, SCThingType} from '@openstapps/core'; +import {SCDish, SCISO8601Date, SCMultiSearchRequest, SCPlace, SCThingType} from '@openstapps/core'; +import {keyBy, mapValues, range} from 'lodash-es'; +import moment from 'moment'; import {DataProvider} from '../../../../data.provider'; /** @@ -24,40 +26,54 @@ import {DataProvider} from '../../../../data.provider'; providedIn: 'root', }) export class PlaceMensaService { - constructor(private dataProvider: DataProvider) { } + constructor(private dataProvider: DataProvider) { + } /** * Fetches all dishes for this building + * + * Splits dishes as such that each list contains all dishes that are available at that day. */ - async getAllDishes(place: SCPlace): Promise { - // use filter to get all dishes with the building's uid in one of the offer's inPlace field - // TODO: make sure this actually works with ES - const result = await this.dataProvider.search({ - filter: { - arguments: { - filters: [ - { - arguments: { - field: 'offers.inPlace.uid', - value: place.uid, + async getAllDishes(place: SCPlace, days: number): Promise> { + const request: SCMultiSearchRequest = mapValues( + keyBy(range(days) + .map((i) => moment() + .add(i, 'days') + .toISOString()), + ), (date: SCISO8601Date) => ({ + filter: { + arguments: { + filters: [ + { + arguments: { + field: 'offers.inPlace.uid', + value: place.uid, + }, + type: 'value', }, - type: 'value', - }, - { - arguments: { - field: 'type', - value: SCThingType.Dish, + { + arguments: { + field: 'type', + value: SCThingType.Dish, + }, + type: 'value', }, - type: 'value', - }, - ], - operation: 'and', + { + arguments: { + field: 'offers.availabilityRange', + scope: 'd', + time: date, + }, + type: 'availability', + }, + ], + operation: 'and', + }, + type: 'boolean', }, - type: 'boolean', - }, - size: 1000, - }); + size: 1000, + })); - return result.data as SCDish[]; + return mapValues(await this.dataProvider.multiSearch(request), 'data') as Record; } } diff --git a/src/app/modules/data/types/place/special/mensa/place-mensa.html b/src/app/modules/data/types/place/special/mensa/place-mensa.html index d6dbb57c..e2eec16d 100644 --- a/src/app/modules/data/types/place/special/mensa/place-mensa.html +++ b/src/app/modules/data/types/place/special/mensa/place-mensa.html @@ -1,14 +1,14 @@
- - {{day.key | amParse:'YYYY-MM-DD' | amDateFormat:'dddd, L'}} + + {{date.key | amDateFormat:'dddd, L'}}
-
- - +
+ +