From 9d8fe643a5ca422f3056d684e0fab52b5348a832 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Fri, 21 Jan 2022 15:30:23 +0100 Subject: [PATCH] refactor: include latest changes from core#145 --- config/default-f-u.ts | 42 ++- config/default.ts | 20 +- package-lock.json | 418 +++++++++++----------- package.json | 6 +- src/routes/index-route.ts | 1 + src/routes/plugin-register-route.ts | 11 +- src/routes/route.ts | 2 +- test/routes/bulk-route.spec.ts | 26 +- test/routes/index-route.spec.ts | 3 +- test/routes/plugin-register-route.spec.ts | 17 +- test/routes/route.spec.ts | 14 +- test/routes/search-route.spec.ts | 12 +- test/routes/thing-update-route.spec.ts | 4 +- 13 files changed, 316 insertions(+), 260 deletions(-) diff --git a/config/default-f-u.ts b/config/default-f-u.ts index 988fe365..d14f53db 100644 --- a/config/default-f-u.ts +++ b/config/default-f-u.ts @@ -2,25 +2,33 @@ // tslint:disable:no-magic-numbers import {SCConfigFile} from '@openstapps/core'; import {RecursivePartial} from '@openstapps/logger/lib/common'; -import moment from 'moment'; -import {inRangeInclusive} from '../src/common'; - -const ssRange = [4, 9]; -const wsRange = [10, 3]; -const month = moment() - .month(); -const year = moment() - .year(); -const wsYearOffset = (month < wsRange[0] ? -1 : 0); -const wsAcronym = `WS ${year + wsYearOffset}/${(year + 1 + wsYearOffset) - .toString() - .slice(-2)}`; -const ssAcronym = `SS ${year + (month <= wsRange[1] ? -1 : 0)}`; /** - * This is the default configuration for the technical university of Berlin + * This is the default configuration for the Goethe university of Frankfurt */ const config: RecursivePartial = { + auth: { + default: { + client: { + clientId: '1cac3f99-33fa-4234-8438-979f07e0cdab', + scopes: '', + url: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0', + }, + endpoints: { + authorization: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/authorize', + mapping: { + id: '$.id', + email: '$.attributes.mailPrimaryAddress', + familyName: '$.attributes.sn', + name: '$.attributes.givenName', + role: '$.attributes.eduPersonPrimaryAffiliation', + studentId: '$.attributes.employeeNumber', + }, + token: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/accessToken', + userinfo: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/profile', + }, + }, + }, internal: { boostings: { default: [ @@ -28,8 +36,8 @@ const config: RecursivePartial = { factor: 1, fields: { 'academicTerms.acronym': { - [ssAcronym]: inRangeInclusive(month, ssRange) ? 1.1 : 1.05, - [wsAcronym]: inRangeInclusive(month, wsRange) ? 1.1 : 1.05, + 'SS 2022': 1.05, + 'WS 2021/2022': 1.1, }, }, }, diff --git a/config/default.ts b/config/default.ts index 30917dc9..6676540a 100644 --- a/config/default.ts +++ b/config/default.ts @@ -362,7 +362,6 @@ const config: Partial = { type: 'Polygon', }, features: { - widgets: true, }, menus: [ { @@ -533,6 +532,25 @@ const config: Partial = { languageSetting, ], }, + auth: { + paia: { + client: { + clientId: '', + scopes: '', + url: 'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php', + }, + endpoints: { + authorization: 'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php', + mapping: { + id: '$.email', + name: '$.name', + role: '$.type', + }, + token: 'https://hds.hebis.de:8443/auth/login', + userinfo: 'https://hds.hebis.de:8443/core', + }, + }, + }, backend: { SCVersion: JSON.parse((readFileSync(resolve('.', '.', 'package.json'), 'utf-8')).toString()) .dependencies['@openstapps/core'], diff --git a/package-lock.json b/package-lock.json index 3580cdea..8606a10d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,34 +5,34 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "requires": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.16.7" } }, "@babel/compat-data": { - "version": "7.16.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", - "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", + "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", "dev": true }, "@babel/core": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.5.tgz", - "integrity": "sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==", + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", + "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.5", - "@babel/helper-compilation-targets": "^7.16.3", - "@babel/helper-module-transforms": "^7.16.5", - "@babel/helpers": "^7.16.5", - "@babel/parser": "^7.16.5", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.12", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.10", + "@babel/types": "^7.16.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -56,12 +56,12 @@ } }, "@babel/generator": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.5.tgz", - "integrity": "sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", "dev": true, "requires": { - "@babel/types": "^7.16.0", + "@babel/types": "^7.16.8", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -75,13 +75,13 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.16.3", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", - "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dev": true, "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" }, @@ -95,114 +95,114 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz", - "integrity": "sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", - "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-get-function-arity": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", - "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-hoist-variables": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", - "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-transforms": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz", - "integrity": "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-simple-access": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", - "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-split-export-declaration": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", - "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==" + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==" }, "@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true }, "@babel/helpers": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.5.tgz", - "integrity": "sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "dev": true, "requires": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.5", - "@babel/types": "^7.16.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -254,36 +254,36 @@ } }, "@babel/parser": { - "version": "7.16.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.6.tgz", - "integrity": "sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==", + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", + "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", "dev": true }, "@babel/template": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", - "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/traverse": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz", - "integrity": "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.5", - "@babel/helper-environment-visitor": "^7.16.5", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.5", - "@babel/types": "^7.16.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.10", + "@babel/types": "^7.16.8", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -297,12 +297,12 @@ } }, "@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" } }, @@ -516,27 +516,27 @@ } }, "@openstapps/core": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.56.0.tgz", - "integrity": "sha512-tG3CMwF1t0E3McoDGKRGef9suWJ7Bgs4PcbiAFZ8zLp75KJRUVmxxcjEQpGk/YwRFCorec4RrJHt/02+H7zV4w==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.63.0.tgz", + "integrity": "sha512-lNNzjPJhWOyh3J7+hbhiLgVgr6LfrXf3TOp5vl6gZOvMlDL9ti8upEzKL9BR2WFp5TT/vhzN9ZQ2JXwxothtwA==", "requires": { "@openstapps/core-tools": "0.28.0", "@types/geojson": "1.0.6", "@types/json-patch": "0.0.30", "@types/json-schema": "7.0.9", - "@types/node": "14.18.0", + "@types/node": "14.18.3", "fast-clone": "1.5.13", "fast-deep-equal": "3.1.3", - "http-status-codes": "2.1.4", + "http-status-codes": "2.2.0", "json-patch": "0.7.0", "json-schema": "0.4.0", "ts-optchain": "0.1.8" }, "dependencies": { "@types/node": { - "version": "14.18.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.0.tgz", - "integrity": "sha512-0GeIl2kmVMXEnx8tg1SlG6Gg8vkqirrW752KqolYo1PHevhhZN3bhJ67qHj+bQaINhX0Ra3TlWwRvMCd9iEfNQ==" + "version": "14.18.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.3.tgz", + "integrity": "sha512-GtTH2crF4MtOIrrAa+jgTV9JX/PfoUCYr6MiZw7O/dkZu5b6gm5dc1nAL0jwGo4ortSBBtGyeVaxdC8X6V+pLg==" } } }, @@ -651,9 +651,9 @@ } }, "@sindresorhus/is": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", - "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==" + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.3.0.tgz", + "integrity": "sha512-wwOvh0eO3PiTEivGJWiZ+b946SlMSb4pe+y+Ur/4S87cwo09pYi+FWHHnbrM3W9W7cBYKDqQXcrFYjYUCOJUEQ==" }, "@sinonjs/commons": { "version": "1.8.3", @@ -825,9 +825,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.26", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.26.tgz", - "integrity": "sha512-zeu3tpouA043RHxW0gzRxwCHchMgftE8GArRsvYT0ByDMbn19olQHx5jLue0LxWY6iYtXb7rXmuVtSkhy9YZvQ==", + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -874,9 +874,9 @@ "dev": true }, "@types/mocha": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", - "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", + "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", "dev": true }, "@types/morgan": { @@ -953,9 +953,9 @@ } }, "@types/sinon": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.6.tgz", - "integrity": "sha512-6EF+wzMWvBNeGrfP3Nx60hhx+FfwSg1JJBLAAP/IdIUq0EYkqCYf70VT3PhuhPX9eLD+Dp+lNdpb/ZeHG8Yezg==", + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.8.tgz", + "integrity": "sha512-XZbSLlox2KM7VaEJPZ5G/fMZXJNuAtYiFOax7UT51quZMAJRWKvugPMqNA0mV3jC9HIYpQSg6qbV+ilQMwLqyA==", "dev": true, "requires": { "@sinonjs/fake-timers": "^7.1.0" @@ -972,9 +972,9 @@ } }, "@types/superagent": { - "version": "4.1.13", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.13.tgz", - "integrity": "sha512-YIGelp3ZyMiH0/A09PMAORO0EBGlF5xIKfDpK74wdYvWUs2o96b5CItJcWPdH409b7SAXIIG6p8NdU/4U2Maww==", + "version": "4.1.14", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.14.tgz", + "integrity": "sha512-iiXaOL2wSbnSY4qg0mFPWJHL9iwyEsoNYwaHF2w58/fsVAQJlj+KUfFAFZu+nzbz+b7dUprJEAc+O9vhHHhQTA==", "dev": true, "requires": { "@types/cookiejar": "*", @@ -1033,12 +1033,19 @@ "requires": { "mime-types": "~2.1.24", "negotiator": "0.6.2" + }, + "dependencies": { + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + } } }, "acorn": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", - "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==" + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" }, "acorn-jsx": { "version": "5.3.2", @@ -1065,9 +1072,9 @@ } }, "agentkeepalive": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz", - "integrity": "sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.0.tgz", + "integrity": "sha512-0PhAp58jZNw13UJv7NVdTGb0ZcghHUb3DrZ046JiiJY/BOaTTpbwdHq2VObPCBV8M2GPh7sgrJ3AQ8Ey468LJw==", "requires": { "debug": "^4.1.0", "depd": "^1.1.2", @@ -1438,9 +1445,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001287", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001287.tgz", - "integrity": "sha512-4udbs9bc0hfNrcje++AxBuc6PfLNHwh3PO9kbwnfCQWyqtlzg3py0YgFu8jyRTTo85VAz4U+VLxSlID09vNtWA==", + "version": "1.0.30001301", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz", + "integrity": "sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA==", "dev": true }, "chai": { @@ -2068,9 +2075,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.4.23", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.23.tgz", - "integrity": "sha512-q3tB59Api3+DMbLnDPkW/UBHBO7KTGcF+rDCeb0GAGyqFj562s6y+c/2tDKTS/y5lbC+JOvT4MSUALJLPqlcSA==", + "version": "1.4.51", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.51.tgz", + "integrity": "sha512-JNEmcYl3mk1tGQmy0EvL5eik/CKSBuzAyGP0QFdG6LIgxQe3II0BL1m2zKc2MZMf3uGqHWE1TFddJML0RpjSHQ==", "dev": true }, "emoji-regex": { @@ -2255,16 +2262,16 @@ } }, "eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", + "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==" }, "espree": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", - "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", "requires": { - "acorn": "^8.6.0", + "acorn": "^8.7.0", "acorn-jsx": "^5.3.1", "eslint-visitor-keys": "^3.1.0" } @@ -2394,9 +2401,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", - "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -3271,15 +3278,15 @@ } }, "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" } }, @@ -3317,9 +3324,9 @@ } }, "graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" }, "growl": { "version": "1.10.5", @@ -3450,9 +3457,9 @@ } }, "http-status-codes": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.1.4.tgz", - "integrity": "sha512-MZVIsLKGVOVE1KEnldppe6Ij+vmemMuApDfjhVSLzyYP+td0bREEYyAoIw9yFePoBXManCuBqmiNP5FqJS5Xkg==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.2.0.tgz", + "integrity": "sha512-feERVo9iWxvnejp3SEfm/+oNG517npqL2/PIA8ORjyOZjGC7TwCRQsZylciLS64i6pJ0wRYz3rkXLRwbtFa8Ng==" }, "http2-wrapper": { "version": "1.0.3", @@ -3498,9 +3505,9 @@ } }, "ignore": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", - "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, "import-fresh": { "version": "3.3.0", @@ -3547,9 +3554,9 @@ "dev": true }, "install-artifact-from-github": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.2.0.tgz", - "integrity": "sha512-3OxCPcY55XlVM3kkfIpeCgmoSKnMsz2A3Dbhsq0RXpIknKQmrX1YiznCeW9cD2ItFmDxziA3w6Eg8d80AoL3oA==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.0.tgz", + "integrity": "sha512-iT8v1GwOAX0pPXifF/5ihnMhHOCo3OeK7z3TQa4CtSNCIg8k0UxqBEk9jRwz8OP68hHXvJ2gxRa89KYHtBkqGA==" }, "interpret": { "version": "1.4.0", @@ -3592,9 +3599,9 @@ } }, "is-core-module": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", - "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", "dev": true, "requires": { "has": "^1.0.3" @@ -3788,9 +3795,9 @@ } }, "istanbul-reports": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.1.tgz", - "integrity": "sha512-q1kvhAXWSsXfMjCdNHNPKZZv94OlspKnoGv+R9RGbnqOOQ0VbNfLFgQDVgi7hHenKsndGq3/o0OBdzDXthWcNw==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.3.tgz", + "integrity": "sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -3899,9 +3906,9 @@ "dev": true }, "keyv": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.4.tgz", - "integrity": "sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.5.tgz", + "integrity": "sha512-531pkGLqV3BMg0eDqqJFI0R1mkK1Nm5xIP2mM6keP5P8WfFtCkg2IOwplTUmlGoTgIg9yQYZ/kdihhz89XH3vA==", "requires": { "json-buffer": "3.0.1" } @@ -4568,9 +4575,9 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "neo-async": { "version": "2.6.2", @@ -5014,9 +5021,9 @@ "dev": true }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pify": { "version": "2.3.0", @@ -7514,13 +7521,14 @@ "dev": true }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-alpn": { @@ -7685,9 +7693,9 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "shelljs": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", - "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, "requires": { "glob": "^7.0.0", @@ -7928,9 +7936,9 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "superagent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.0.2.tgz", - "integrity": "sha512-2Kx35bZxLLJMBKtuXezxvD0aZQ7l923VwoCn7EtUx+aFxdG7co7PeRIddfrNtvvMuGaLZXA0mKzX+yWRhjrJ7A==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.1.tgz", + "integrity": "sha512-CQ2weSS6M+doIwwYFoMatklhRbx6sVNdB99OEJ5czcP3cng76Ljqus694knFWgOj3RkrtxZqIgpe6vhe0J7QWQ==", "dev": true, "requires": { "component-emitter": "^1.3.0", @@ -7975,13 +7983,13 @@ } }, "supertest": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.2.1.tgz", - "integrity": "sha512-2kBKhfZgnPLmjpzB0n7A2ZnEAWTaLXq4bn3EEVY9w8rUpLyIlSusqKKvWA1Cav7hxXBnXGpxBsSeOHj5wQGe1Q==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.2.2.tgz", + "integrity": "sha512-wCw9WhAtKJsBvh07RaS+/By91NNE0Wh0DN19/hWPlBOU8tAfOtbZoVSV4xXeoKoxgPx0rx2y+y+8660XtE7jzg==", "dev": true, "requires": { "methods": "^1.1.2", - "superagent": "^7.0.2" + "superagent": "^7.1.0" } }, "supports-color": { @@ -7992,6 +8000,12 @@ "has-flag": "^4.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", diff --git a/package.json b/package.json index b90effd2..d09cf7e6 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "dependencies": { "@elastic/elasticsearch": "5.6.22", - "@openstapps/core": "0.56.0", + "@openstapps/core": "0.63.0", "@openstapps/core-tools": "0.28.0", "@openstapps/logger": "0.8.0", "@types/express-prometheus-middleware": "1.2.1", @@ -66,7 +66,7 @@ "@types/elasticsearch": "5.0.40", "@types/express": "4.17.13", "@types/geojson": "1.0.6", - "@types/mocha": "9.0.0", + "@types/mocha": "9.1.0", "@types/morgan": "1.9.3", "@types/node-cron": "3.0.1", "@types/nodemailer": "6.4.4", @@ -86,7 +86,7 @@ "rimraf": "3.0.2", "sinon": "11.1.2", "sinon-express-mock": "2.2.1", - "supertest": "6.2.1", + "supertest": "6.2.2", "tslint": "6.1.3", "typedoc": "0.22.10", "typescript": "3.9.10" diff --git a/src/routes/index-route.ts b/src/routes/index-route.ts index f1b2ec02..dc1f4f47 100644 --- a/src/routes/index-route.ts +++ b/src/routes/index-route.ts @@ -30,6 +30,7 @@ export const indexRouter = createRoute( async (): Promise => { return { app: configFile.app, + auth: configFile.auth, backend: configFile.backend, }; }, diff --git a/src/routes/plugin-register-route.ts b/src/routes/plugin-register-route.ts index ff3c6d71..bb9991a4 100644 --- a/src/routes/plugin-register-route.ts +++ b/src/routes/plugin-register-route.ts @@ -23,7 +23,7 @@ import { } from '@openstapps/core'; import {Logger} from '@openstapps/logger'; import {deepStrictEqual} from 'assert'; -import {isTestEnvironment, plugins} from '../common'; +import {configFile, isTestEnvironment, plugins} from '../common'; import {createRoute} from './route'; /** @@ -76,6 +76,11 @@ function addPlugin(plugin: SCPluginMetaData): SCPluginRegisterResponse { } // it's a new plugin so it can be added to the map of plugins plugins.set(plugin.route, plugin); + // add plugin info to app config + if (typeof configFile.app.features.plugins === 'undefined') { + configFile.app.features.plugins = {}; + } + configFile.app.features.plugins[plugin.name] = {urlPath : plugin.route}; Logger.log(`Registered plugin (name: ${plugin.name}, address: ${plugin.address}) on the route "${plugin.route}".`); return {success: true}; @@ -92,6 +97,10 @@ function removePlugin(route: string): SCPluginRegisterResponse { isTestEnvironment, ); } + if (plugins.has(route)) { + const plugin = plugins.get(route)!; + delete configFile.app.features.plugins?.[plugin.name]; + } // remove the plugin information using its route as a key plugins.delete(route); Logger.log(`Removed plugin that used the route "${route}".`); diff --git a/src/routes/route.ts b/src/routes/route.ts index 515ffdab..fc1e97b9 100644 --- a/src/routes/route.ts +++ b/src/routes/route.ts @@ -47,7 +47,7 @@ export function createRoute( // create route // the given type has no index signature so we have to cast to get the IRouteHandler when a HTTP method is given - const route = router.route(routeClass.urlFragment); + const route = router.route(routeClass.urlPath); const verb = routeClass.method.toLowerCase(); diff --git a/test/routes/bulk-route.spec.ts b/test/routes/bulk-route.spec.ts index 89e6924d..27d3441a 100644 --- a/test/routes/bulk-route.spec.ts +++ b/test/routes/bulk-route.spec.ts @@ -44,7 +44,7 @@ describe('Bulk routes', async function () { it('should create bulk', async function () { const {status, body, error} = await testApp - .post(bulkRoute.urlFragment) + .post(bulkRoute.urlPath) .set('Content-Type', 'application/json') .send(request); @@ -56,13 +56,13 @@ describe('Bulk routes', async function () { it('should return (throw) error if a bulk with the provided UID cannot be found when adding to a bulk', async function () { await testApp - .post(bulkRoute.urlFragment) + .post(bulkRoute.urlPath) .set('Content-Type', 'application/json') .send(request); - const bulkAddRouteUrlFragment = bulkAddRoute.urlFragment.toLocaleLowerCase().replace(':uid', 'a-wrong-uid'); + const bulkAddRouteurlPath = bulkAddRoute.urlPath.toLocaleLowerCase().replace(':uid', 'a-wrong-uid'); const {status} = await testApp - .post(bulkAddRouteUrlFragment) + .post(bulkAddRouteurlPath) .set('Content-Type', 'application/json') .send(book); @@ -71,13 +71,13 @@ describe('Bulk routes', async function () { it('should add to a created bulk', async function () { const response = await testApp - .post(bulkRoute.urlFragment) + .post(bulkRoute.urlPath) .set('Content-Type', 'application/json') .send(request); - const bulkAddRouteUrlFragment = bulkAddRoute.urlFragment.toLocaleLowerCase().replace(':uid', response.body.uid); + const bulkAddRouteurlPath = bulkAddRoute.urlPath.toLocaleLowerCase().replace(':uid', response.body.uid); const {status, body} = await testApp - .post(bulkAddRouteUrlFragment) + .post(bulkAddRouteurlPath) .set('Content-Type', 'application/json') .send(book); @@ -87,13 +87,13 @@ describe('Bulk routes', async function () { it('should return (throw) error if a bulk with the provided UID cannot be found when closing a bulk (done)', async function () { await testApp - .post(bulkRoute.urlFragment) + .post(bulkRoute.urlPath) .set('Content-Type', 'application/json') .send(request); - const bulkDoneRouteUrlFragment = bulkDoneRoute.urlFragment.toLocaleLowerCase().replace(':uid', 'a-wrong-uid'); + const bulkDoneRouteurlPath = bulkDoneRoute.urlPath.toLocaleLowerCase().replace(':uid', 'a-wrong-uid'); const {status} = await testApp - .post(bulkDoneRouteUrlFragment) + .post(bulkDoneRouteurlPath) .set('Content-Type', 'application/json') .send({}); @@ -102,13 +102,13 @@ describe('Bulk routes', async function () { it ('should close the bulk (done)', async function () { const response = await testApp - .post(bulkRoute.urlFragment) + .post(bulkRoute.urlPath) .set('Content-Type', 'application/json') .send(request); - const bulkDoneRouteUrlFragment = bulkDoneRoute.urlFragment.toLocaleLowerCase().replace(':uid', response.body.uid); + const bulkDoneRouteurlPath = bulkDoneRoute.urlPath.toLocaleLowerCase().replace(':uid', response.body.uid); const response2 = await testApp - .post(bulkDoneRouteUrlFragment) + .post(bulkDoneRouteurlPath) .set('Content-Type', 'application/json') .send({}); diff --git a/test/routes/index-route.spec.ts b/test/routes/index-route.spec.ts index 872d91de..2b00b51a 100644 --- a/test/routes/index-route.spec.ts +++ b/test/routes/index-route.spec.ts @@ -27,7 +27,7 @@ describe('Index route', async function () { const request: SCIndexRequest = {}; const response = await testApp - .post(indexRoute.urlFragment) + .post(indexRoute.urlPath) .set('Content-Type', 'application/json') .send(request); @@ -35,5 +35,6 @@ describe('Index route', async function () { expect(response.status).to.equal(indexRoute.statusCodeSuccess); expect(response.body).to.haveOwnProperty('app'); expect(response.body).to.haveOwnProperty('backend'); + expect(response.body).to.haveOwnProperty('auth'); }); }); diff --git a/test/routes/plugin-register-route.spec.ts b/test/routes/plugin-register-route.spec.ts index 29ef8b19..4c531287 100644 --- a/test/routes/plugin-register-route.spec.ts +++ b/test/routes/plugin-register-route.spec.ts @@ -20,7 +20,7 @@ import { SCPluginRemove, SCValidationErrorResponse, } from '@openstapps/core'; import nock from 'nock'; -import {plugins} from '../../src/common'; +import {configFile, plugins} from '../../src/common'; import {pluginRegisterHandler} from '../../src/routes/plugin-register-route'; import {expect, use} from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -45,13 +45,16 @@ describe('Plugin registration', async function () { after(function () { // remove plugins plugins.clear(); + configFile.app.features = {}; }); it('should register a plugin', async function () { // register one plugin const response = await pluginRegisterHandler(registerAddRequest, {}); - expect(response).to.deep.equal(bodySuccess) && expect(plugins.size).to.equal(1); + expect(response).to.deep.equal(bodySuccess) + && expect(plugins.size).to.equal(1) + && expect(configFile.app.features.plugins!['Foo Plugin']).to.not.be.empty; }); it('should allow re-registering the same plugin', async function () { @@ -62,7 +65,8 @@ describe('Plugin registration', async function () { const response = await pluginRegisterHandler(registerAddRequest, {}); return expect(response).to.deep.equal(bodySuccess) - && expect(plugins.size).to.equal(1); + && expect(plugins.size).to.equal(1) + && expect(configFile.app.features.plugins!['Foo Plugin']).to.not.be.empty; }); it('should show an error if a plugin has already been registered', async function () { @@ -92,7 +96,8 @@ describe('Plugin registration', async function () { const response = await pluginRegisterHandler(registerRemoveRequest, {}); expect(response).to.deep.equal(bodySuccess) - && expect(plugins.size).to.equal(0); + && expect(plugins.size).to.equal(0) + && expect(configFile.app.features.plugins).to.be.empty; }); it('should throw a "not found" error when removing a plugin whose registered route does not exist', async function () { @@ -140,7 +145,7 @@ describe('Plugin registration', async function () { it('should respond with bad request if when providing invalid request', async function () { const {status} = await testApp - .post(pluginRegisterRoute.urlFragment) + .post(pluginRegisterRoute.urlPath) .set('Content-Type', 'application/json') .set('Accept', 'application/json') .send({foo: 'bar'}); @@ -155,7 +160,7 @@ describe('Plugin registration', async function () { const registerAddRequestAltered = {...registerAddRequest, plugin: {...registerAddRequest.plugin, name: 'FooBar Plugin'}}; const {status, body} = await testApp - .post(pluginRegisterRoute.urlFragment) + .post(pluginRegisterRoute.urlPath) .set('Content-Type', 'application/json') .set('Accept', 'application/json') .send(registerAddRequestAltered); diff --git a/test/routes/route.spec.ts b/test/routes/route.spec.ts index 1fb830be..b66360f3 100644 --- a/test/routes/route.spec.ts +++ b/test/routes/route.spec.ts @@ -56,7 +56,7 @@ describe('Create route', async function () { requestBodyName: 'fooBodyName', responseBodyName: 'barBodyName', statusCodeSuccess: statusCodeSuccess, - urlFragment: '/foo', + urlPath: '/foo', }; handler = (_request, _app) => { return Promise.resolve(bodySuccess); @@ -84,7 +84,7 @@ describe('Create route', async function () { const response = await supertest(app) // use method other than defined ("get" is not the method of the route) - .get(routeClass.urlFragment) + .get(routeClass.urlPath) .send(); expect(response.status).to.be.equal(methodNotAllowedError.statusCode); @@ -98,7 +98,7 @@ describe('Create route', async function () { app.use(router); const response = await supertest(app) - .post(routeClass.urlFragment) + .post(routeClass.urlPath) .send(); expect(response.status).to.be.equal(statusCodeSuccess); @@ -116,7 +116,7 @@ describe('Create route', async function () { validatorStub.withArgs(body, routeClass.requestBodyName).returns({errors: [new Error('Foo Error')]}); const response = await startApp - .post(routeClass.urlFragment) + .post(routeClass.urlPath) .set('Content-Type', 'application/json') .set('Accept', 'application/json') .send(body); @@ -134,7 +134,7 @@ describe('Create route', async function () { validatorStub.withArgs(bodySuccess, routeClass.responseBodyName).returns({errors: [new Error('Foo Error')]}); const response = await startApp - .post(routeClass.urlFragment) + .post(routeClass.urlPath) .send(); expect(response.status).to.be.equal(internalServerError.statusCode); @@ -174,7 +174,7 @@ describe('Create route', async function () { sandbox.stub(validator, 'validate').returns({errors:[]}); const response = await startApp - .post(routeClass.urlFragment) + .post(routeClass.urlPath) .send(); expect(response.status).to.be.equal(internalServerError.statusCode); @@ -209,7 +209,7 @@ describe('Create route', async function () { sandbox.stub(validator, 'validate').returns({errors:[]}); const response = await startApp - .post(routeClass.urlFragment) + .post(routeClass.urlPath) .send(); expect(response.status).to.be.equal(fooErrorResponse.statusCode); diff --git a/test/routes/search-route.spec.ts b/test/routes/search-route.spec.ts index c628e088..ca9ca531 100644 --- a/test/routes/search-route.spec.ts +++ b/test/routes/search-route.spec.ts @@ -50,7 +50,7 @@ describe('Search route', async function () { describe('Basic POST /search', async function() { it('should accept empty JSON object', async function () { const {status} = await testApp - .post(searchRoute.urlFragment) + .post(searchRoute.urlPath) .set('Accept', 'application/json') .send({}); @@ -59,7 +59,7 @@ describe('Search route', async function () { it('should accept valid search request', async function () { const {status} = await testApp - .post(searchRoute.urlFragment) + .post(searchRoute.urlPath) .set('Accept', 'application/json') .send({ query: 'Some search terms' @@ -70,7 +70,7 @@ describe('Search route', async function () { it('should respond with bad request on invalid search request (body)', async function () { const {status} = await testApp - .post(searchRoute.urlFragment) + .post(searchRoute.urlPath) .set('Content-Type', 'application/json') .set('Accept', 'application/json') .send({ @@ -84,7 +84,7 @@ describe('Search route', async function () { describe('Basic POST /multi/search', async function() { it('should respond with bad request on invalid search request (empty JSON object as body)', async function () { const {status} = await testApp - .post(multiSearchRoute.urlFragment) + .post(multiSearchRoute.urlPath) .set('Accept', 'application/json') .send({}); @@ -93,7 +93,7 @@ describe('Search route', async function () { it('should accept valid search request', async function () { const {status} = await testApp - .post(multiSearchRoute.urlFragment) + .post(multiSearchRoute.urlPath) .set('Accept', 'application/json') .send({ one: { query: 'Some search terms for one search'}, @@ -108,7 +108,7 @@ describe('Search route', async function () { sandbox.stub(configFile.backend, 'maxMultiSearchRouteQueries').value(2); const {status} = await testApp - .post(multiSearchRoute.urlFragment) + .post(multiSearchRoute.urlPath) .set('Content-Type', 'application/json') .send({ one: {}, diff --git a/test/routes/thing-update-route.spec.ts b/test/routes/thing-update-route.spec.ts index 82bd15f7..abfd986c 100644 --- a/test/routes/thing-update-route.spec.ts +++ b/test/routes/thing-update-route.spec.ts @@ -28,12 +28,12 @@ describe('Thing update route', async function () { const thingUpdateRoute = new SCThingUpdateRoute(); it('should update a thing', async function () { - const thingUpdateRouteUrlFragment = thingUpdateRoute.urlFragment.toLocaleLowerCase() + const thingUpdateRouteurlPath = thingUpdateRoute.urlPath.toLocaleLowerCase() .replace(':type', book.type) .replace(':uid', book.uid); const {status} = await testApp - .put(thingUpdateRouteUrlFragment) + .put(thingUpdateRouteurlPath) .set('Content-Type', 'application/json') .send(book);