diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 457d2c1451..f004e0acc5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,6 +6,8 @@ labels: bug assignees: '' --- +## Checklist +- [ ] I have searched budibase discussions and github issues to check if my issue already exists **Hosting** diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index cbf8a002f4..12fb8f5a9d 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -67,16 +67,24 @@ jobs: uses: azure/setup-helm@v1 id: helm-install + # due to helm repo index issue: https://github.com/helm/helm/issues/7363 + # we need to create new package in a different dir, merge the index and move the package back - name: Build and release helm chart run: | git config user.name "Budibase Helm Bot" git config user.email "<>" git reset --hard git pull - helm package charts/budibase --version "$RELEASE_VERSION" --app-version "$RELEASE_VERSION" + mkdir sync + echo "Packaging chart to sync dir" + helm package charts/budibase --version "$RELEASE_VERSION" --app-version "$RELEASE_VERSION" --destination sync + echo "Packaging successful" git checkout gh-pages - mv *.tgz docs - helm repo index docs + echo "Indexing helm repo" + helm repo index --merge docs/index.yaml sync + mv -f sync/* docs + rm -rf sync + echo "Pushing new helm release" git add -A git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}" git push diff --git a/charts/budibase/Chart.yaml b/charts/budibase/Chart.yaml index 9d02e19506..05b3f24dbd 100644 --- a/charts/budibase/Chart.yaml +++ b/charts/budibase/Chart.yaml @@ -17,7 +17,7 @@ version: 0.0.0 appVersion: 0.0.0 dependencies: - name: couchdb - version: 3.6.1 + version: 3.3.4 repository: https://apache.github.io/couchdb-helm condition: services.couchdb.enabled - name: ingress-nginx diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index e955992c66..01cd20f605 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -4,9 +4,6 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} -{{ end }} creationTimestamp: null labels: io.kompose.service: app-service @@ -23,6 +20,9 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.services.apps.annotations }} +{{- toYaml .Values.services.apps.annotations | indent 8 -}} +{{ end }} creationTimestamp: null labels: io.kompose.service: app-service diff --git a/charts/budibase/templates/proxy-service-deployment.yaml b/charts/budibase/templates/proxy-service-deployment.yaml index 00c12271db..6064905c4c 100644 --- a/charts/budibase/templates/proxy-service-deployment.yaml +++ b/charts/budibase/templates/proxy-service-deployment.yaml @@ -4,9 +4,6 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} -{{ end }} creationTimestamp: null labels: app.kubernetes.io/name: budibase-proxy @@ -23,6 +20,9 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.services.proxy.annotations }} +{{- toYaml .Values.services.proxy.annotations | indent 8 -}} +{{ end }} creationTimestamp: null labels: app.kubernetes.io/name: budibase-proxy diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index 7168764d56..ff56fb5019 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -4,9 +4,6 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.globals.logAnnotations }} -{{ toYaml .Values.globals.logAnnotations | indent 4 }} -{{ end }} creationTimestamp: null labels: io.kompose.service: worker-service @@ -24,6 +21,9 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.services.worker.annotations }} +{{- toYaml .Values.services.worker.annotations | indent 8 -}} +{{ end }} creationTimestamp: null labels: io.kompose.service: worker-service diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 1d49a46d59..889d7e9e23 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -22,12 +22,6 @@ serviceAccount: podAnnotations: {} -# logAnnotations: -# co.elastic.logs/multiline.type: pattern -# co.elastic.logs/multiline.pattern: '^[[:space:]]' -# co.elastic.logs/multiline.negate: false -# co.elastic.logs/multiline.match: after - podSecurityContext: {} # fsGroup: 2000 @@ -130,6 +124,10 @@ services: minio: 'http://minio-service.{{ .Release.Namespace }}.svc.{{ .Values.services.dns }}:{{ .Values.services.objectStore.port }}' couchdb: 'http://{{ .Release.Name }}-svc-couchdb:{{ .Values.services.couchdb.port }}' resources: {} +# annotations: +# co.elastic.logs/module: nginx +# co.elastic.logs/fileset.stdout: access +# co.elastic.logs/fileset.stderr: error apps: port: 4002 @@ -137,11 +135,20 @@ services: logLevel: info resources: {} # nodeDebug: "" # set the value of NODE_DEBUG - +# annotations: +# co.elastic.logs/multiline.type: pattern +# co.elastic.logs/multiline.pattern: '^[[:space:]]' +# co.elastic.logs/multiline.negate: false +# co.elastic.logs/multiline.match: after worker: port: 4003 replicaCount: 1 resources: {} +# annotations: +# co.elastic.logs/multiline.type: pattern +# co.elastic.logs/multiline.pattern: '^[[:space:]]' +# co.elastic.logs/multiline.negate: false +# co.elastic.logs/multiline.match: after couchdb: enabled: true diff --git a/examples/nextjs-api-sales/yarn.lock b/examples/nextjs-api-sales/yarn.lock index f47fb84e33..1f34ca2ee2 100644 --- a/examples/nextjs-api-sales/yarn.lock +++ b/examples/nextjs-api-sales/yarn.lock @@ -2,27 +2,6 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - -"@babel/helper-validator-identifier@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" - integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== - -"@babel/highlight@^7.16.7": - version "7.16.10" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" - integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@babel/runtime-corejs3@^7.10.2": version "7.17.2" resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.17.2.tgz#fdca2cd05fba63388babe85d349b6801b008fd13" @@ -53,11 +32,6 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@gar/promisify@^1.0.1": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" - integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== - "@humanwhocodes/config-array@^0.9.2": version "0.9.5" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" @@ -160,52 +134,21 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@npmcli/fs@^1.0.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257" - integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ== - dependencies: - "@gar/promisify" "^1.0.1" - semver "^7.3.5" - -"@npmcli/move-file@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" - integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg== - dependencies: - mkdirp "^1.0.4" - rimraf "^3.0.2" - "@rushstack/eslint-patch@^1.0.8": version "1.1.0" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.0.tgz#7f698254aadf921e48dda8c0a6b304026b8a9323" integrity sha512-JLo+Y592QzIE+q7Dl2pMUtt4q8SKYI5jDrZxrozEQxnGVOyYE+GWK9eLkwTaeN9DDctlaRAQ3TBmzZ1qdLE30A== -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/minimist@^1.2.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== - "@types/node@17.0.21": version "17.0.21" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== -"@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== - "@types/prop-types@*": version "15.7.4" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" @@ -269,11 +212,6 @@ "@typescript-eslint/types" "5.14.0" eslint-visitor-keys "^3.0.0" -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -284,31 +222,7 @@ acorn@^8.7.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== -agent-base@6, agent-base@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -agentkeepalive@^4.1.3: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717" - integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA== - dependencies: - debug "^4.1.0" - depd "^1.1.2" - humanize-ms "^1.2.1" - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -323,40 +237,20 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" -"aproba@^1.0.3 || ^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" - integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== - -are-we-there-yet@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" - integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: - delegates "^1.0.0" - readable-stream "^3.6.0" - -are-we-there-yet@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz#ba20bd6b553e31d62fc8c31bd23d22b95734390d" - integrity sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw== - dependencies: - delegates "^1.0.0" - readable-stream "^3.6.0" + normalize-path "^3.0.0" + picomatch "^2.0.4" argparse@^2.0.1: version "2.0.1" @@ -405,48 +299,11 @@ array.prototype.flatmap@^1.2.5: define-properties "^1.1.3" es-abstract "^1.19.0" -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - ast-types-flow@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= -async-foreach@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" - integrity sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI= - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - axe-core@^4.3.5: version "4.4.1" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.1.tgz#7dbdc25989298f9ad006645cd396782443757413" @@ -462,12 +319,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== brace-expansion@^1.1.7: version "1.1.11" @@ -477,7 +332,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.1: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -489,30 +344,6 @@ bulma@^0.9.3: resolved "https://registry.yarnpkg.com/bulma/-/bulma-0.9.3.tgz#ddccb7436ebe3e21bf47afe01d3c43a296b70243" integrity sha512-0d7GNW1PY4ud8TWxdNcP6Cc8Bu7MxcntD/RRLGWuiw/s0a9P+XlH/6QoOIrmbj6o8WWJzJYhytiu9nFjTszk1g== -cacache@^15.2.0: - version "15.3.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" - integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== - dependencies: - "@npmcli/fs" "^1.0.0" - "@npmcli/move-file" "^1.0.1" - chownr "^2.0.0" - fs-minipass "^2.0.0" - glob "^7.1.4" - infer-owner "^1.0.4" - lru-cache "^6.0.0" - minipass "^3.1.1" - minipass-collect "^1.0.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.2" - mkdirp "^1.0.3" - p-map "^4.0.0" - promise-inflight "^1.0.1" - rimraf "^3.0.2" - ssri "^8.0.1" - tar "^6.0.2" - unique-filename "^1.1.1" - call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -526,40 +357,12 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== - dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - caniuse-lite@^1.0.30001283: version "1.0.30001314" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001314.tgz#65c7f9fb7e4594fca0a333bec1d8939662377596" integrity sha512-0zaSO+TnCHtHJIbpLroX7nsD+vYuOVjl3uzFbJO1wMVbuveJA0RK2WcQA9ZUIOiO0/ArMiMgHJLxfEZhQiC0kw== -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0, chalk@^4.1.2: +chalk@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -567,31 +370,20 @@ chalk@^4.0.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chownr@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" - integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== +"chokidar@>=3.0.0 <4.0.0": + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" color-convert@^2.0.1: version "2.0.1" @@ -600,54 +392,22 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-support@^1.1.2, color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -console-control-strings@^1.0.0, console-control-strings@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - core-js-pure@^3.20.2: version "3.21.1" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.1.tgz#8c4d1e78839f5f46208de7230cebfb72bc3bdb51" integrity sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ== -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -666,25 +426,11 @@ damerau-levenshtein@^1.0.7: resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - data-uri-to-buffer@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b" integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA== -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -699,18 +445,12 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -decamelize-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= +debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - -decamelize@^1.1.0, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + ms "2.1.2" deep-is@^0.1.3: version "0.1.4" @@ -724,21 +464,6 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -760,48 +485,11 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - emoji-regex@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== -encoding@^0.1.12: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -err-code@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" - integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - es-abstract@^1.19.0, es-abstract@^1.19.1: version "1.19.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" @@ -837,16 +525,6 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" @@ -1055,21 +733,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -1132,14 +795,6 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" -find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -1153,20 +808,6 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - formdata-polyfill@^4.0.10: version "4.0.10" resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" @@ -1174,18 +815,16 @@ formdata-polyfill@^4.0.10: dependencies: fetch-blob "^3.1.2" -fs-minipass@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" - integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== - dependencies: - minipass "^3.0.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -1196,48 +835,6 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gauge@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" - integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== - dependencies: - aproba "^1.0.3 || ^2.0.0" - color-support "^1.1.2" - console-control-strings "^1.0.0" - has-unicode "^2.0.1" - object-assign "^4.1.1" - signal-exit "^3.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - wide-align "^1.1.2" - -gauge@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-4.0.2.tgz#c3777652f542b6ef62797246e8c7caddecb32cc7" - integrity sha512-aSPRm2CvA9R8QyU5eXMFPd+cYkyxLsXHd2l5/FOH2V/eml//M04G6KZOmTap07O1PvEwNcl2NndyLfK8g3QrKA== - dependencies: - ansi-regex "^5.0.1" - aproba "^1.0.3 || ^2.0.0" - color-support "^1.1.3" - console-control-strings "^1.1.0" - has-unicode "^2.0.1" - signal-exit "^3.0.7" - string-width "^4.2.3" - strip-ansi "^6.0.1" - wide-align "^1.1.5" - -gaze@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a" - integrity sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g== - dependencies: - globule "^1.0.0" - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" @@ -1247,11 +844,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.1" -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= - get-symbol-description@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" @@ -1260,14 +852,7 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -glob-parent@^5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -1281,7 +866,7 @@ glob-parent@^6.0.1: dependencies: is-glob "^4.0.3" -glob@7.1.7, glob@~7.1.1: +glob@7.1.7: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== @@ -1293,7 +878,7 @@ glob@7.1.7, glob@~7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.7: +glob@^7.1.3, glob@^7.1.7: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -1324,48 +909,11 @@ globby@^11.0.4: merge2 "^1.4.1" slash "^3.0.0" -globule@^1.0.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/globule/-/globule-1.3.3.tgz#811919eeac1ab7344e905f2e3be80a13447973c2" - integrity sha512-mb1aYtDbIjTu4ShMB85m3UzjX9BVKe9WCzsnfMSZk+K5GpIbBOexgg4PPCt5eHDEG5/ZQAUX2Kct02zfiPLsKg== - dependencies: - glob "~7.1.1" - lodash "~4.17.10" - minimatch "~3.0.2" - -graceful-fs@^4.2.6: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - -hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - has-bigints@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1383,11 +931,6 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" -has-unicode@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -1395,63 +938,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -hosted-git-info@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" - integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== - dependencies: - lru-cache "^6.0.0" - -http-cache-semantics@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - -humanize-ms@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= - dependencies: - ms "^2.0.0" - -iconv-lite@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -1462,6 +948,11 @@ ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== +immutable@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.2.1.tgz#8a4025691018c560a40c67e43d698f816edc44d4" + integrity sha512-7WYV7Q5BTs0nlQm7tl92rDYYoyELLKHoDMBKhrxEoiV4mrfVdRz8hzPiYOzH7yWjzoVEamxRuAqhxL2PLRwZYQ== + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -1475,16 +966,6 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -infer-owner@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" - integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1493,7 +974,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@~2.0.3: +inherits@2: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1507,16 +988,6 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" -ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" @@ -1524,6 +995,13 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" @@ -1537,7 +1015,7 @@ is-callable@^1.1.4, is-callable@^1.2.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== -is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.0, is-core-module@^2.8.1: +is-core-module@^2.2.0, is-core-module@^2.8.0, is-core-module@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== @@ -1556,23 +1034,13 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" -is-lambda@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" - integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= - is-negative-zero@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" @@ -1590,11 +1058,6 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -1622,11 +1085,6 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - is-weakref@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" @@ -1634,27 +1092,12 @@ is-weakref@^1.0.1: dependencies: call-bind "^1.0.2" -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -js-base64@^2.4.3: - version "2.6.4" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4" - integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ== - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== @@ -1666,53 +1109,23 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b" @@ -1721,11 +1134,6 @@ jsprim@^1.2.2: array-includes "^3.1.3" object.assign "^4.1.2" -kind-of@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - language-subtag-registry@~0.3.2: version "0.3.21" resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz#04ac218bea46f04cb039084602c6da9e788dd45a" @@ -1746,11 +1154,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -1759,23 +1162,11 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.17.11, lodash@^4.17.15, lodash@~4.17.10: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -1790,56 +1181,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -make-fetch-happen@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" - integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== - dependencies: - agentkeepalive "^4.1.3" - cacache "^15.2.0" - http-cache-semantics "^4.1.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-lambda "^1.0.1" - lru-cache "^6.0.0" - minipass "^3.1.3" - minipass-collect "^1.0.2" - minipass-fetch "^1.3.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - negotiator "^0.6.2" - promise-retry "^2.0.1" - socks-proxy-agent "^6.0.0" - ssri "^8.0.0" - -map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= - -map-obj@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" - integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== - -meow@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" - integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize "^1.2.0" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" @@ -1853,23 +1194,6 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.0" - -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - minimatch@^3.0.4, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -1877,85 +1201,10 @@ minimatch@^3.0.4, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@~3.0.2: - version "3.0.8" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" - integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q== - dependencies: - brace-expansion "^1.1.7" - -minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - minimist@^1.2.0: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -minipass-collect@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" - integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== - dependencies: - minipass "^3.0.0" - -minipass-fetch@^1.3.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" - integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== - dependencies: - minipass "^3.1.0" - minipass-sized "^1.0.3" - minizlib "^2.0.0" - optionalDependencies: - encoding "^0.1.12" - -minipass-flush@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" - integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== - dependencies: - minipass "^3.0.0" - -minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" - integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== - dependencies: - minipass "^3.0.0" - -minipass-sized@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" - integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== - dependencies: - minipass "^3.0.0" - -minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: - version "3.1.6" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" - integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== - dependencies: - yallist "^4.0.0" - -minizlib@^2.0.0, minizlib@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" - integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== - dependencies: - minipass "^3.0.0" - yallist "^4.0.0" - -mkdirp@^1.0.3, mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== ms@2.0.0: version "2.0.0" @@ -1967,16 +1216,11 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0, ms@^2.1.1: +ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nan@^2.13.2: - version "2.15.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" - integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== - nanoid@^3.1.30: version "3.3.1" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" @@ -1987,11 +1231,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -negotiator@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== - next@12.1.0: version "12.1.0" resolved "https://registry.yarnpkg.com/next/-/next-12.1.0.tgz#c33d753b644be92fc58e06e5a214f143da61dd5d" @@ -2029,94 +1268,10 @@ node-fetch@^3.2.10: fetch-blob "^3.1.4" formdata-polyfill "^4.0.10" -node-gyp@^8.4.1: - version "8.4.1" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-8.4.1.tgz#3d49308fc31f768180957d6b5746845fbd429937" - integrity sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w== - dependencies: - env-paths "^2.2.0" - glob "^7.1.4" - graceful-fs "^4.2.6" - make-fetch-happen "^9.1.0" - nopt "^5.0.0" - npmlog "^6.0.0" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.2" - which "^2.0.2" - -node-sass@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-7.0.1.tgz#ad4f6bc663de8acc0a9360db39165a1e2620aa72" - integrity sha512-uMy+Xt29NlqKCFdFRZyXKOTqGt+QaKHexv9STj2WeLottnlqZEEWx6Bj0MXNthmFRRdM/YwyNo/8Tr46TOM0jQ== - dependencies: - async-foreach "^0.1.3" - chalk "^4.1.2" - cross-spawn "^7.0.3" - gaze "^1.0.0" - get-stdin "^4.0.1" - glob "^7.0.3" - lodash "^4.17.15" - meow "^9.0.0" - nan "^2.13.2" - node-gyp "^8.4.1" - npmlog "^5.0.0" - request "^2.88.0" - sass-graph "4.0.0" - stdout-stream "^1.4.0" - "true-case-path" "^1.0.2" - -nopt@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" - integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== - dependencies: - abbrev "1" - -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - -npmlog@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" - integrity sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw== - dependencies: - are-we-there-yet "^2.0.0" - console-control-strings "^1.1.0" - gauge "^3.0.0" - set-blocking "^2.0.0" - -npmlog@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-6.0.1.tgz#06f1344a174c06e8de9c6c70834cfba2964bba17" - integrity sha512-BTHDvY6nrRHuRfyjt1MAufLxYdVXZfd099H4+i1f0lPywNQyI4foeNXJRObB/uy+TYqUW0vAD9gbdSOXPst7Eg== - dependencies: - are-we-there-yet "^3.0.0" - console-control-strings "^1.1.0" - gauge "^4.0.0" - set-blocking "^2.0.0" - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== object-assign@^4.1.1: version "4.1.1" @@ -2204,13 +1359,6 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" @@ -2218,30 +1366,11 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -2249,26 +1378,11 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -2289,17 +1403,12 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.2.3: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -2318,24 +1427,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -promise-inflight@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= - -promise-retry@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" - integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== - dependencies: - err-code "^2.0.2" - retry "^0.12.0" - prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -2345,31 +1436,16 @@ prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - react-dom@17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" @@ -2397,54 +1473,12 @@ react@17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -readable-stream@^2.0.1: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.6.0: +readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -redent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" - integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== - dependencies: - indent-string "^4.0.0" - strip-indent "^3.0.0" + picomatch "^2.2.1" regenerator-runtime@^0.13.4: version "0.13.9" @@ -2464,43 +1498,12 @@ regexpp@^3.2.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -request@^2.88.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@^1.10.0, resolve@^1.20.0: +resolve@^1.20.0: version "1.22.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== @@ -2517,11 +1520,6 @@ resolve@^2.0.0-next.3: is-core-module "^2.2.0" path-parse "^1.0.6" -retry@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= - reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -2541,30 +1539,14 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sass-graph@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-4.0.0.tgz#fff8359efc77b31213056dfd251d05dadc74c613" - integrity sha512-WSO/MfXqKH7/TS8RdkCX3lVkPFQzCgbqdGsmSKq6tlPU+GpGEsa/5aW18JqItnqh+lPtcjifqdZ/VmiILkKckQ== +sass@^1.52.3: + version "1.57.1" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.57.1.tgz#dfafd46eb3ab94817145e8825208ecf7281119b5" + integrity sha512-O2+LwLS79op7GI0xZ8fqzF7X2m/m8WFfI02dHOdsK5R2ECeS5F62zrwg/relM1rjSLy7Vd/DiMNIvPrQGsA0jw== dependencies: - glob "^7.0.0" - lodash "^4.17.11" - scss-tokenizer "^0.3.0" - yargs "^17.2.1" + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" scheduler@^0.20.2: version "0.20.2" @@ -2574,36 +1556,18 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" -scss-tokenizer@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.3.0.tgz#ef7edc3bc438b25cd6ffacf1aa5b9ad5813bf260" - integrity sha512-14Zl9GcbBvOT9057ZKjpz5yPOyUWG2ojd9D5io28wHRYsOrs7U95Q+KNL87+32p8rc+LvDpbu/i9ZYjM9Q+FsQ== - dependencies: - js-base64 "^2.4.3" - source-map "^0.7.1" - -"semver@2 || 3 || 4 || 5": - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.4, semver@^7.3.5: +semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -2625,112 +1589,16 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -smart-buffer@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" - integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== - -socks-proxy-agent@^6.0.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz#e664e8f1aaf4e1fb3df945f09e3d94f911137f87" - integrity sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew== - dependencies: - agent-base "^6.0.2" - debug "^4.3.1" - socks "^2.6.1" - -socks@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.2.tgz#ec042d7960073d40d94268ff3bb727dc685f111a" - integrity sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA== - dependencies: - ip "^1.1.5" - smart-buffer "^4.2.0" - -source-map-js@^1.0.1: +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map@^0.7.1: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.11" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz#50c0d8c40a14ec1bf449bae69a0ea4685a9d9f95" - integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== - -sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -ssri@^8.0.0, ssri@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" - integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== - dependencies: - minipass "^3.1.1" - -stdout-stream@^1.4.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.1.tgz#5ac174cdd5cd726104aa0c0b2bd83815d8d535de" - integrity sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA== - dependencies: - readable-stream "^2.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string.prototype.matchall@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa" @@ -2761,21 +1629,7 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -2787,13 +1641,6 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -2804,13 +1651,6 @@ styled-jsx@5.0.0: resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.0.tgz#816b4b92e07b1786c6b7111821750e0ba4d26e77" integrity sha512-qUqsWoBquEdERe10EW8vLp3jT25s/ssG1/qX5gZ4wu15OZpmSMFI2v+fWlRhLfykA5rFtlJ1ME8A8pm/peV4WA== -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -2823,18 +1663,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -tar@^6.0.2, tar@^6.1.2: - version "6.1.11" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== - dependencies: - chownr "^2.0.0" - fs-minipass "^2.0.0" - minipass "^3.0.0" - minizlib "^2.1.1" - mkdirp "^1.0.3" - yallist "^4.0.0" - text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -2847,26 +1675,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -trim-newlines@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" - integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== - -"true-case-path@^1.0.2": - version "1.0.3" - resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-1.0.3.tgz#f813b5a8c86b40da59606722b144e3225799f47d" - integrity sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew== - dependencies: - glob "^7.1.2" - tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: version "3.13.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.13.0.tgz#f3e9b8f6876698581d94470c03c95b3a48c0e3d7" @@ -2889,18 +1697,6 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -2908,26 +1704,11 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - typescript@4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4" @@ -2943,20 +1724,6 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" -unique-filename@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" - integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== - dependencies: - unique-slug "^2.0.0" - -unique-slug@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" - integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== - dependencies: - imurmurhash "^0.1.4" - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -2971,38 +1738,11 @@ use-subscription@1.5.1: dependencies: object-assign "^4.1.1" -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - web-streams-polyfill@^3.0.3: version "3.2.0" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965" @@ -3019,68 +1759,24 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which@^2.0.1, which@^2.0.2: +which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" -wide-align@^1.1.2, wide-align@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" - integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== - dependencies: - string-width "^1.0.2 || 2 || 3 || 4" - word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@^21.0.0: - version "21.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== - -yargs@^17.2.1: - version "17.3.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9" - integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.0.0" diff --git a/hosting/single/runner.sh b/hosting/single/runner.sh index ea825131db..6eebba62b6 100644 --- a/hosting/single/runner.sh +++ b/hosting/single/runner.sh @@ -78,7 +78,7 @@ mkdir -p ${DATA_DIR}/search chown -R couchdb:couchdb ${DATA_DIR}/couch redis-server --requirepass $REDIS_PASSWORD > /dev/stdout 2>&1 & /opt/clouseau/bin/clouseau > /dev/stdout 2>&1 & -/minio/minio server ${DATA_DIR}/minio > /dev/stdout 2>&1 & +/minio/minio server --console-address ":9001" ${DATA_DIR}/minio > /dev/stdout 2>&1 & /docker-entrypoint.sh /opt/couchdb/bin/couchdb & /etc/init.d/nginx restart if [[ ! -z "${CUSTOM_DOMAIN}" ]]; then diff --git a/lerna.json b/lerna.json index 57644cf4c0..dfc073b19e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/package.json b/package.json index ac09edf5ae..7da8db506d 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "dev:server": "yarn run kill-server && lerna run --parallel dev:builder --concurrency 1 --scope @budibase/backend-core --scope @budibase/worker --scope @budibase/server", "test": "lerna run test && yarn test:pro", "test:pro": "bash scripts/pro/test.sh", - "lint:eslint": "eslint packages", - "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\"", + "lint:eslint": "eslint packages && eslint qa-core", + "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --check \"qa-core/**/*.{js,ts,svelte}\"", "lint": "yarn run lint:eslint && yarn run lint:prettier", "lint:fix:eslint": "eslint --fix packages qa-core", "lint:fix:prettier": "prettier --write \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --write \"qa-core/**/*.{js,ts,svelte}\"", @@ -84,4 +84,4 @@ "install:pro": "bash scripts/pro/install.sh", "dep:clean": "yarn clean && yarn bootstrap" } -} \ No newline at end of file +} diff --git a/packages/backend-core/jest.config.ts b/packages/backend-core/jest.config.ts index d0e5d3d4e7..e5993f6596 100644 --- a/packages/backend-core/jest.config.ts +++ b/packages/backend-core/jest.config.ts @@ -6,6 +6,9 @@ const config: Config.InitialOptions = { setupFiles: ["./tests/jestSetup.ts"], collectCoverageFrom: ["src/**/*.{js,ts}"], coverageReporters: ["lcov", "json", "clover"], + transform: { + "^.+\\.ts?$": "@swc/jest", + }, } if (!process.env.CI) { diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 72f7825503..7121ee0ec2 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -23,7 +23,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "2.2.10-alpha.12", + "@budibase/types": "2.2.12-alpha.18", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", @@ -31,6 +31,7 @@ "bcrypt": "5.0.1", "bcryptjs": "2.4.3", "bull": "4.10.1", + "correlation-id": "4.0.0", "dotenv": "16.0.1", "emitter-listener": "1.1.2", "ioredis": "4.28.0", @@ -56,19 +57,23 @@ "zlib": "1.0.5" }, "devDependencies": { + "@swc/core": "^1.3.25", + "@swc/jest": "^0.2.24", "@types/chance": "1.1.3", "@types/ioredis": "4.28.0", "@types/jest": "27.5.1", "@types/koa": "2.13.4", + "@types/koa-pino-logger": "3.0.0", "@types/lodash": "4.14.180", "@types/node": "14.18.20", "@types/node-fetch": "2.6.1", + "@types/pino-http": "5.8.1", "@types/pouchdb": "6.4.0", "@types/redlock": "4.0.3", "@types/semver": "7.3.7", "@types/tar-fs": "2.0.1", "@types/uuid": "8.3.4", - "chance": "1.1.3", + "chance": "1.1.8", "ioredis-mock": "5.8.0", "jest": "28.1.1", "koa": "2.13.4", diff --git a/packages/backend-core/src/cache/base/index.ts b/packages/backend-core/src/cache/base/index.ts index ab620a900e..264984c6a5 100644 --- a/packages/backend-core/src/cache/base/index.ts +++ b/packages/backend-core/src/cache/base/index.ts @@ -7,7 +7,7 @@ function generateTenantKey(key: string) { return `${key}:${tenantId}` } -export = class BaseCache { +export default class BaseCache { client: Client | undefined constructor(client: Client | undefined = undefined) { diff --git a/packages/backend-core/src/cache/generic.ts b/packages/backend-core/src/cache/generic.ts index d8a54e4a3f..7cd5d6227f 100644 --- a/packages/backend-core/src/cache/generic.ts +++ b/packages/backend-core/src/cache/generic.ts @@ -1,6 +1,6 @@ const BaseCache = require("./base") -const GENERIC = new BaseCache() +const GENERIC = new BaseCache.default() export enum CacheKey { CHECKLIST = "checklist", diff --git a/packages/backend-core/src/cloud/api.ts b/packages/backend-core/src/cloud/api.ts index 287c447271..ef9b9d88e6 100644 --- a/packages/backend-core/src/cloud/api.ts +++ b/packages/backend-core/src/cloud/api.ts @@ -1,6 +1,7 @@ import fetch from "node-fetch" +import * as logging from "../logging" -export = class API { +export default class API { host: string constructor(host: string) { @@ -22,6 +23,9 @@ export = class API { let json = options.headers["Content-Type"] === "application/json" + // add x-budibase-correlation-id header + logging.correlation.setHeader(options.headers) + const requestOptions = { method: method, body: json ? JSON.stringify(options.body) : options.body, diff --git a/packages/backend-core/src/constants/misc.ts b/packages/backend-core/src/constants/misc.ts index 61b3cea1f6..0bf3df4094 100644 --- a/packages/backend-core/src/constants/misc.ts +++ b/packages/backend-core/src/constants/misc.ts @@ -22,6 +22,7 @@ export enum Header { TENANT_ID = "x-budibase-tenant-id", TOKEN = "x-budibase-token", CSRF_TOKEN = "x-csrf-token", + CORRELATION_ID = "x-budibase-correlation-id", } export enum GlobalRole { diff --git a/packages/backend-core/src/context/tests/index.spec.js b/packages/backend-core/src/context/tests/index.spec.ts similarity index 97% rename from packages/backend-core/src/context/tests/index.spec.js rename to packages/backend-core/src/context/tests/index.spec.ts index ea60806d21..c9b5870ffa 100644 --- a/packages/backend-core/src/context/tests/index.spec.js +++ b/packages/backend-core/src/context/tests/index.spec.ts @@ -1,7 +1,7 @@ require("../../../tests") const context = require("../") const { DEFAULT_TENANT_ID } = require("../../constants") -const env = require("../../environment") +import env from "../../environment" describe("context", () => { describe("doInTenant", () => { @@ -26,7 +26,7 @@ describe("context", () => { it("fails when no tenant id is set", () => { const test = () => { - let error + let error: any try { context.getTenantId() } catch (e) { @@ -45,7 +45,7 @@ describe("context", () => { it("fails when no tenant db is set", () => { const test = () => { - let error + let error: any try { context.getGlobalDB() } catch (e) { diff --git a/packages/backend-core/src/db/tests/utils.spec.js b/packages/backend-core/src/db/tests/utils.spec.ts similarity index 96% rename from packages/backend-core/src/db/tests/utils.spec.js rename to packages/backend-core/src/db/tests/utils.spec.ts index f95889c1cc..37b7ce51e2 100644 --- a/packages/backend-core/src/db/tests/utils.spec.js +++ b/packages/backend-core/src/db/tests/utils.spec.ts @@ -5,18 +5,13 @@ const { isDevAppID, isProdAppID, } = require("../conversions") -const { - generateAppID, - getPlatformUrl, - getScopedConfig -} = require("../utils") +const { generateAppID, getPlatformUrl, getScopedConfig } = require("../utils") const tenancy = require("../../tenancy") const { Config, DEFAULT_TENANT_ID } = require("../../constants") -const env = require("../../environment") +import env from "../../environment" describe("utils", () => { describe("app ID manipulation", () => { - function getID() { const appId = generateAppID() const split = appId.split("_") @@ -28,42 +23,42 @@ describe("utils", () => { it("should be able to generate a new app ID", () => { expect(generateAppID().startsWith("app_")).toEqual(true) }) - + it("should be able to convert a production app ID to development", () => { const { appId, uuid } = getID() expect(getDevelopmentAppID(appId)).toEqual(`app_dev_${uuid}`) }) - + it("should be able to convert a development app ID to development", () => { const { devAppId, uuid } = getID() expect(getDevelopmentAppID(devAppId)).toEqual(`app_dev_${uuid}`) }) - + it("should be able to convert a development ID to a production", () => { const { devAppId, uuid } = getID() expect(getProdAppID(devAppId)).toEqual(`app_${uuid}`) }) - + it("should be able to convert a production ID to production", () => { const { appId, uuid } = getID() expect(getProdAppID(appId)).toEqual(`app_${uuid}`) }) - + it("should be able to confirm dev app ID is development", () => { const { devAppId } = getID() expect(isDevAppID(devAppId)).toEqual(true) }) - + it("should be able to confirm prod app ID is not development", () => { const { appId } = getID() expect(isDevAppID(appId)).toEqual(false) }) - + it("should be able to confirm prod app ID is prod", () => { const { appId } = getID() expect(isProdAppID(appId)).toEqual(true) }) - + it("should be able to confirm dev app ID is not prod", () => { const { devAppId } = getID() expect(isProdAppID(devAppId)).toEqual(false) @@ -81,8 +76,8 @@ const setDbPlatformUrl = async () => { _id: "config_settings", type: Config.SETTINGS, config: { - platformUrl: DB_URL - } + platformUrl: DB_URL, + }, }) } @@ -92,17 +87,16 @@ const clearSettingsConfig = async () => { try { const config = await db.get("config_settings") await db.remove("config_settings", config._rev) - } catch (e) { + } catch (e: any) { if (e.status !== 404) { throw e } } }) } - + describe("getPlatformUrl", () => { describe("self host", () => { - beforeEach(async () => { env._set("SELF_HOST", 1) await clearSettingsConfig() @@ -129,10 +123,9 @@ describe("getPlatformUrl", () => { const url = await getPlatformUrl() expect(url).toBe(DB_URL) }) - }) + }) }) - describe("cloud", () => { const TENANT_AWARE_URL = "http://default.env.com" @@ -163,13 +156,12 @@ describe("getPlatformUrl", () => { const url = await getPlatformUrl() expect(url).toBe(TENANT_AWARE_URL) }) - }) + }) }) }) describe("getScopedConfig", () => { describe("settings config", () => { - beforeEach(async () => { env._set("SELF_HOSTED", 1) env._set("PLATFORM_URL", "") diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 60cf5b7882..91556ddcd6 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -102,4 +102,4 @@ for (let [key, value] of Object.entries(environment)) { } } -export = environment +export default environment diff --git a/packages/backend-core/src/errors/errors.ts b/packages/backend-core/src/errors/errors.ts new file mode 100644 index 0000000000..83e2ab5072 --- /dev/null +++ b/packages/backend-core/src/errors/errors.ts @@ -0,0 +1,37 @@ +import * as licensing from "./licensing" + +// combine all error codes into single object + +export const codes = { + ...licensing.codes, +} + +// combine all error types +export const types = [licensing.type] + +// combine all error contexts +const context = { + ...licensing.context, +} + +// derive a public error message using codes, types and any custom contexts +export const getPublicError = (err: any) => { + let error + if (err.code || err.type) { + // add generic error information + error = { + code: err.code, + type: err.type, + } + + if (err.code && context[err.code]) { + error = { + ...error, + // get any additional context from this error + ...context[err.code](err), + } + } + } + + return error +} diff --git a/packages/backend-core/src/errors/index.ts b/packages/backend-core/src/errors/index.ts index be6657093d..814d836590 100644 --- a/packages/backend-core/src/errors/index.ts +++ b/packages/backend-core/src/errors/index.ts @@ -1,47 +1,3 @@ -import { HTTPError } from "./http" -import { UsageLimitError, FeatureDisabledError } from "./licensing" -import * as licensing from "./licensing" - -const codes = { - ...licensing.codes, -} - -const types = [licensing.type] - -const context = { - ...licensing.context, -} - -const getPublicError = (err: any) => { - let error - if (err.code || err.type) { - // add generic error information - error = { - code: err.code, - type: err.type, - } - - if (err.code && context[err.code]) { - error = { - ...error, - // get any additional context from this error - ...context[err.code](err), - } - } - } - - return error -} - -const pkg = { - codes, - types, - errors: { - UsageLimitError, - FeatureDisabledError, - HTTPError, - }, - getPublicError, -} - -export = pkg +export * from "./errors" +export { UsageLimitError, FeatureDisabledError } from "./licensing" +export { HTTPError } from "./http" diff --git a/packages/backend-core/src/events/events.ts b/packages/backend-core/src/events/events.ts index cda90d12c9..01928221a0 100644 --- a/packages/backend-core/src/events/events.ts +++ b/packages/backend-core/src/events/events.ts @@ -1,6 +1,6 @@ import { Event } from "@budibase/types" import { processors } from "./processors" -import * as identification from "./identification" +import identification from "./identification" import * as backfill from "./backfill" export const publishEvent = async ( diff --git a/packages/backend-core/src/events/identification.ts b/packages/backend-core/src/events/identification.ts index b93bd44968..8ac22b471c 100644 --- a/packages/backend-core/src/events/identification.ts +++ b/packages/backend-core/src/events/identification.ts @@ -33,7 +33,7 @@ const pkg = require("../../package.json") * - tenant * - installation */ -export const getCurrentIdentity = async (): Promise => { +const getCurrentIdentity = async (): Promise => { let identityContext = identityCtx.getIdentity() const environment = getDeploymentEnvironment() @@ -94,7 +94,7 @@ export const getCurrentIdentity = async (): Promise => { } } -export const identifyInstallationGroup = async ( +const identifyInstallationGroup = async ( installId: string, timestamp?: string | number ): Promise => { @@ -118,7 +118,7 @@ export const identifyInstallationGroup = async ( await identify({ ...group, id: `$${type}_${id}` }, timestamp) } -export const identifyTenantGroup = async ( +const identifyTenantGroup = async ( tenantId: string, account: Account | undefined, timestamp?: string | number @@ -156,7 +156,7 @@ export const identifyTenantGroup = async ( await identify({ ...group, id: `$${type}_${id}` }, timestamp) } -export const identifyUser = async ( +const identifyUser = async ( user: User, account: CloudAccount | undefined, timestamp?: string | number @@ -191,7 +191,7 @@ export const identifyUser = async ( await identify(identity, timestamp) } -export const identifyAccount = async (account: Account) => { +const identifyAccount = async (account: Account) => { let id = account.accountId const tenantId = account.tenantId let type = IdentityType.USER @@ -224,17 +224,11 @@ export const identifyAccount = async (account: Account) => { await identify(identity) } -export const identify = async ( - identity: Identity, - timestamp?: string | number -) => { +const identify = async (identity: Identity, timestamp?: string | number) => { await processors.identify(identity, timestamp) } -export const identifyGroup = async ( - group: Group, - timestamp?: string | number -) => { +const identifyGroup = async (group: Group, timestamp?: string | number) => { await processors.identifyGroup(group, timestamp) } @@ -250,7 +244,7 @@ const getHostingFromEnv = () => { return env.SELF_HOSTED ? Hosting.SELF : Hosting.CLOUD } -export const getInstallationId = async () => { +const getInstallationId = async () => { if (isAccountPortal()) { return "account-portal" } @@ -300,3 +294,14 @@ const formatDistinctId = (id: string, type: IdentityType) => { return id } } + +export default { + getCurrentIdentity, + identifyInstallationGroup, + identifyTenantGroup, + identifyUser, + identifyAccount, + identify, + identifyGroup, + getInstallationId, +} diff --git a/packages/backend-core/src/events/index.ts b/packages/backend-core/src/events/index.ts index f94c8b0267..d0d59a5b22 100644 --- a/packages/backend-core/src/events/index.ts +++ b/packages/backend-core/src/events/index.ts @@ -1,7 +1,7 @@ export * from "./publishers" export * as processors from "./processors" export * as analytics from "./analytics" -export * as identification from "./identification" +export { default as identification } from "./identification" export * as backfillCache from "./backfill" import { processors } from "./processors" diff --git a/packages/backend-core/src/events/processors/LoggingProcessor.ts b/packages/backend-core/src/events/processors/LoggingProcessor.ts index d41a82fbb4..6bb691a83a 100644 --- a/packages/backend-core/src/events/processors/LoggingProcessor.ts +++ b/packages/backend-core/src/events/processors/LoggingProcessor.ts @@ -23,7 +23,7 @@ export default class LoggingProcessor implements EventProcessor { return } let timestampString = getTimestampString(timestamp) - let message = `[audit] [tenant=${identity.tenantId}] [identityType=${identity.type}] [identity=${identity.id}] ${timestampString} ${event} ` + let message = `[audit] [identityType=${identity.type}] ${timestampString} ${event} ` if (env.isDev()) { message = message + `[debug: [properties=${JSON.stringify(properties)}] ]` } diff --git a/packages/backend-core/src/events/publishers/account.ts b/packages/backend-core/src/events/publishers/account.ts index 3f1a8a9161..d337e404ef 100644 --- a/packages/backend-core/src/events/publishers/account.ts +++ b/packages/backend-core/src/events/publishers/account.ts @@ -7,23 +7,29 @@ import { AccountVerifiedEvent, } from "@budibase/types" -export async function created(account: Account) { +async function created(account: Account) { const properties: AccountCreatedEvent = { tenantId: account.tenantId, } await publishEvent(Event.ACCOUNT_CREATED, properties) } -export async function deleted(account: Account) { +async function deleted(account: Account) { const properties: AccountDeletedEvent = { tenantId: account.tenantId, } await publishEvent(Event.ACCOUNT_DELETED, properties) } -export async function verified(account: Account) { +async function verified(account: Account) { const properties: AccountVerifiedEvent = { tenantId: account.tenantId, } await publishEvent(Event.ACCOUNT_VERIFIED, properties) } + +export default { + created, + deleted, + verified, +} diff --git a/packages/backend-core/src/events/publishers/app.ts b/packages/backend-core/src/events/publishers/app.ts index dd77b0b8a2..90da21f3f5 100644 --- a/packages/backend-core/src/events/publishers/app.ts +++ b/packages/backend-core/src/events/publishers/app.ts @@ -15,7 +15,7 @@ import { AppExportedEvent, } from "@budibase/types" -export const created = async (app: App, timestamp?: string | number) => { +const created = async (app: App, timestamp?: string | number) => { const properties: AppCreatedEvent = { appId: app.appId, version: app.version, @@ -23,7 +23,7 @@ export const created = async (app: App, timestamp?: string | number) => { await publishEvent(Event.APP_CREATED, properties, timestamp) } -export async function updated(app: App) { +async function updated(app: App) { const properties: AppUpdatedEvent = { appId: app.appId, version: app.version, @@ -31,35 +31,35 @@ export async function updated(app: App) { await publishEvent(Event.APP_UPDATED, properties) } -export async function deleted(app: App) { +async function deleted(app: App) { const properties: AppDeletedEvent = { appId: app.appId, } await publishEvent(Event.APP_DELETED, properties) } -export async function published(app: App, timestamp?: string | number) { +async function published(app: App, timestamp?: string | number) { const properties: AppPublishedEvent = { appId: app.appId, } await publishEvent(Event.APP_PUBLISHED, properties, timestamp) } -export async function unpublished(app: App) { +async function unpublished(app: App) { const properties: AppUnpublishedEvent = { appId: app.appId, } await publishEvent(Event.APP_UNPUBLISHED, properties) } -export async function fileImported(app: App) { +async function fileImported(app: App) { const properties: AppFileImportedEvent = { appId: app.appId, } await publishEvent(Event.APP_FILE_IMPORTED, properties) } -export async function templateImported(app: App, templateKey: string) { +async function templateImported(app: App, templateKey: string) { const properties: AppTemplateImportedEvent = { appId: app.appId, templateKey, @@ -67,7 +67,7 @@ export async function templateImported(app: App, templateKey: string) { await publishEvent(Event.APP_TEMPLATE_IMPORTED, properties) } -export async function versionUpdated( +async function versionUpdated( app: App, currentVersion: string, updatedToVersion: string @@ -80,7 +80,7 @@ export async function versionUpdated( await publishEvent(Event.APP_VERSION_UPDATED, properties) } -export async function versionReverted( +async function versionReverted( app: App, currentVersion: string, revertedToVersion: string @@ -93,16 +93,30 @@ export async function versionReverted( await publishEvent(Event.APP_VERSION_REVERTED, properties) } -export async function reverted(app: App) { +async function reverted(app: App) { const properties: AppRevertedEvent = { appId: app.appId, } await publishEvent(Event.APP_REVERTED, properties) } -export async function exported(app: App) { +async function exported(app: App) { const properties: AppExportedEvent = { appId: app.appId, } await publishEvent(Event.APP_EXPORTED, properties) } + +export default { + created, + updated, + deleted, + published, + unpublished, + fileImported, + templateImported, + versionUpdated, + versionReverted, + reverted, + exported, +} diff --git a/packages/backend-core/src/events/publishers/auth.ts b/packages/backend-core/src/events/publishers/auth.ts index 93378501f3..4436045599 100644 --- a/packages/backend-core/src/events/publishers/auth.ts +++ b/packages/backend-core/src/events/publishers/auth.ts @@ -12,7 +12,7 @@ import { } from "@budibase/types" import { identification } from ".." -export async function login(source: LoginSource) { +async function login(source: LoginSource) { const identity = await identification.getCurrentIdentity() const properties: LoginEvent = { userId: identity.id, @@ -21,7 +21,7 @@ export async function login(source: LoginSource) { await publishEvent(Event.AUTH_LOGIN, properties) } -export async function logout() { +async function logout() { const identity = await identification.getCurrentIdentity() const properties: LogoutEvent = { userId: identity.id, @@ -29,30 +29,39 @@ export async function logout() { await publishEvent(Event.AUTH_LOGOUT, properties) } -export async function SSOCreated(type: SSOType, timestamp?: string | number) { +async function SSOCreated(type: SSOType, timestamp?: string | number) { const properties: SSOCreatedEvent = { type, } await publishEvent(Event.AUTH_SSO_CREATED, properties, timestamp) } -export async function SSOUpdated(type: SSOType) { +async function SSOUpdated(type: SSOType) { const properties: SSOUpdatedEvent = { type, } await publishEvent(Event.AUTH_SSO_UPDATED, properties) } -export async function SSOActivated(type: SSOType, timestamp?: string | number) { +async function SSOActivated(type: SSOType, timestamp?: string | number) { const properties: SSOActivatedEvent = { type, } await publishEvent(Event.AUTH_SSO_ACTIVATED, properties, timestamp) } -export async function SSODeactivated(type: SSOType) { +async function SSODeactivated(type: SSOType) { const properties: SSODeactivatedEvent = { type, } await publishEvent(Event.AUTH_SSO_DEACTIVATED, properties) } + +export default { + login, + logout, + SSOCreated, + SSOUpdated, + SSOActivated, + SSODeactivated, +} diff --git a/packages/backend-core/src/events/publishers/automation.ts b/packages/backend-core/src/events/publishers/automation.ts index 8b2574b739..6eb36ab067 100644 --- a/packages/backend-core/src/events/publishers/automation.ts +++ b/packages/backend-core/src/events/publishers/automation.ts @@ -12,10 +12,7 @@ import { AutomationsRunEvent, } from "@budibase/types" -export async function created( - automation: Automation, - timestamp?: string | number -) { +async function created(automation: Automation, timestamp?: string | number) { const properties: AutomationCreatedEvent = { appId: automation.appId, automationId: automation._id as string, @@ -25,7 +22,7 @@ export async function created( await publishEvent(Event.AUTOMATION_CREATED, properties, timestamp) } -export async function triggerUpdated(automation: Automation) { +async function triggerUpdated(automation: Automation) { const properties: AutomationTriggerUpdatedEvent = { appId: automation.appId, automationId: automation._id as string, @@ -35,7 +32,7 @@ export async function triggerUpdated(automation: Automation) { await publishEvent(Event.AUTOMATION_TRIGGER_UPDATED, properties) } -export async function deleted(automation: Automation) { +async function deleted(automation: Automation) { const properties: AutomationDeletedEvent = { appId: automation.appId, automationId: automation._id as string, @@ -45,7 +42,7 @@ export async function deleted(automation: Automation) { await publishEvent(Event.AUTOMATION_DELETED, properties) } -export async function tested(automation: Automation) { +async function tested(automation: Automation) { const properties: AutomationTestedEvent = { appId: automation.appId, automationId: automation._id as string, @@ -55,14 +52,14 @@ export async function tested(automation: Automation) { await publishEvent(Event.AUTOMATION_TESTED, properties) } -export const run = async (count: number, timestamp?: string | number) => { +const run = async (count: number, timestamp?: string | number) => { const properties: AutomationsRunEvent = { count, } await publishEvent(Event.AUTOMATIONS_RUN, properties, timestamp) } -export async function stepCreated( +async function stepCreated( automation: Automation, step: AutomationStep, timestamp?: string | number @@ -78,10 +75,7 @@ export async function stepCreated( await publishEvent(Event.AUTOMATION_STEP_CREATED, properties, timestamp) } -export async function stepDeleted( - automation: Automation, - step: AutomationStep -) { +async function stepDeleted(automation: Automation, step: AutomationStep) { const properties: AutomationStepDeletedEvent = { appId: automation.appId, automationId: automation._id as string, @@ -92,3 +86,13 @@ export async function stepDeleted( } await publishEvent(Event.AUTOMATION_STEP_DELETED, properties) } + +export default { + created, + triggerUpdated, + deleted, + tested, + run, + stepCreated, + stepDeleted, +} diff --git a/packages/backend-core/src/events/publishers/backfill.ts b/packages/backend-core/src/events/publishers/backfill.ts index c16b3cc9dc..f2f6c7add8 100644 --- a/packages/backend-core/src/events/publishers/backfill.ts +++ b/packages/backend-core/src/events/publishers/backfill.ts @@ -8,18 +8,18 @@ import { InstallationBackfillSucceededEvent, InstallationBackfillFailedEvent, } from "@budibase/types" -const env = require("../../environment") +import env from "../../environment" const shouldSkip = !env.SELF_HOSTED && !env.isDev() -export async function appSucceeded(properties: AppBackfillSucceededEvent) { +async function appSucceeded(properties: AppBackfillSucceededEvent) { if (shouldSkip) { return } await publishEvent(Event.APP_BACKFILL_SUCCEEDED, properties) } -export async function appFailed(error: any) { +async function appFailed(error: any) { if (shouldSkip) { return } @@ -29,16 +29,14 @@ export async function appFailed(error: any) { await publishEvent(Event.APP_BACKFILL_FAILED, properties) } -export async function tenantSucceeded( - properties: TenantBackfillSucceededEvent -) { +async function tenantSucceeded(properties: TenantBackfillSucceededEvent) { if (shouldSkip) { return } await publishEvent(Event.TENANT_BACKFILL_SUCCEEDED, properties) } -export async function tenantFailed(error: any) { +async function tenantFailed(error: any) { if (shouldSkip) { return } @@ -48,7 +46,7 @@ export async function tenantFailed(error: any) { await publishEvent(Event.TENANT_BACKFILL_FAILED, properties) } -export async function installationSucceeded() { +async function installationSucceeded() { if (shouldSkip) { return } @@ -56,7 +54,7 @@ export async function installationSucceeded() { await publishEvent(Event.INSTALLATION_BACKFILL_SUCCEEDED, properties) } -export async function installationFailed(error: any) { +async function installationFailed(error: any) { if (shouldSkip) { return } @@ -65,3 +63,12 @@ export async function installationFailed(error: any) { } await publishEvent(Event.INSTALLATION_BACKFILL_FAILED, properties) } + +export default { + appSucceeded, + appFailed, + tenantSucceeded, + tenantFailed, + installationSucceeded, + installationFailed, +} diff --git a/packages/backend-core/src/events/publishers/backup.ts b/packages/backend-core/src/events/publishers/backup.ts index 4a68364016..12263fe1ff 100644 --- a/packages/backend-core/src/events/publishers/backup.ts +++ b/packages/backend-core/src/events/publishers/backup.ts @@ -8,7 +8,7 @@ import { } from "@budibase/types" import { publishEvent } from "../events" -export async function appBackupRestored(backup: AppBackup) { +async function appBackupRestored(backup: AppBackup) { const properties: AppBackupRestoreEvent = { appId: backup.appId, restoreId: backup._id!, @@ -18,7 +18,7 @@ export async function appBackupRestored(backup: AppBackup) { await publishEvent(Event.APP_BACKUP_RESTORED, properties) } -export async function appBackupTriggered( +async function appBackupTriggered( appId: string, backupId: string, type: AppBackupType, @@ -32,3 +32,8 @@ export async function appBackupTriggered( } await publishEvent(Event.APP_BACKUP_TRIGGERED, properties) } + +export default { + appBackupRestored, + appBackupTriggered, +} diff --git a/packages/backend-core/src/events/publishers/datasource.ts b/packages/backend-core/src/events/publishers/datasource.ts index d3ea7402f9..39a81ff1bc 100644 --- a/packages/backend-core/src/events/publishers/datasource.ts +++ b/packages/backend-core/src/events/publishers/datasource.ts @@ -14,10 +14,7 @@ function isCustom(datasource: Datasource) { return !sources.includes(datasource.source) } -export async function created( - datasource: Datasource, - timestamp?: string | number -) { +async function created(datasource: Datasource, timestamp?: string | number) { const properties: DatasourceCreatedEvent = { datasourceId: datasource._id as string, source: datasource.source, @@ -26,7 +23,7 @@ export async function created( await publishEvent(Event.DATASOURCE_CREATED, properties, timestamp) } -export async function updated(datasource: Datasource) { +async function updated(datasource: Datasource) { const properties: DatasourceUpdatedEvent = { datasourceId: datasource._id as string, source: datasource.source, @@ -35,7 +32,7 @@ export async function updated(datasource: Datasource) { await publishEvent(Event.DATASOURCE_UPDATED, properties) } -export async function deleted(datasource: Datasource) { +async function deleted(datasource: Datasource) { const properties: DatasourceDeletedEvent = { datasourceId: datasource._id as string, source: datasource.source, @@ -43,3 +40,9 @@ export async function deleted(datasource: Datasource) { } await publishEvent(Event.DATASOURCE_DELETED, properties) } + +export default { + created, + updated, + deleted, +} diff --git a/packages/backend-core/src/events/publishers/email.ts b/packages/backend-core/src/events/publishers/email.ts index 42c5fb4d4c..df9e41b39e 100644 --- a/packages/backend-core/src/events/publishers/email.ts +++ b/packages/backend-core/src/events/publishers/email.ts @@ -1,12 +1,17 @@ import { publishEvent } from "../events" import { Event, SMTPCreatedEvent, SMTPUpdatedEvent } from "@budibase/types" -export async function SMTPCreated(timestamp?: string | number) { +async function SMTPCreated(timestamp?: string | number) { const properties: SMTPCreatedEvent = {} await publishEvent(Event.EMAIL_SMTP_CREATED, properties, timestamp) } -export async function SMTPUpdated() { +async function SMTPUpdated() { const properties: SMTPUpdatedEvent = {} await publishEvent(Event.EMAIL_SMTP_UPDATED, properties) } + +export default { + SMTPCreated, + SMTPUpdated, +} diff --git a/packages/backend-core/src/events/publishers/group.ts b/packages/backend-core/src/events/publishers/group.ts index b4fd0d1469..d79920562b 100644 --- a/packages/backend-core/src/events/publishers/group.ts +++ b/packages/backend-core/src/events/publishers/group.ts @@ -11,28 +11,28 @@ import { UserGroupRoles, } from "@budibase/types" -export async function created(group: UserGroup, timestamp?: number) { +async function created(group: UserGroup, timestamp?: number) { const properties: GroupCreatedEvent = { groupId: group._id as string, } await publishEvent(Event.USER_GROUP_CREATED, properties, timestamp) } -export async function updated(group: UserGroup) { +async function updated(group: UserGroup) { const properties: GroupUpdatedEvent = { groupId: group._id as string, } await publishEvent(Event.USER_GROUP_UPDATED, properties) } -export async function deleted(group: UserGroup) { +async function deleted(group: UserGroup) { const properties: GroupDeletedEvent = { groupId: group._id as string, } await publishEvent(Event.USER_GROUP_DELETED, properties) } -export async function usersAdded(count: number, group: UserGroup) { +async function usersAdded(count: number, group: UserGroup) { const properties: GroupUsersAddedEvent = { count, groupId: group._id as string, @@ -40,7 +40,7 @@ export async function usersAdded(count: number, group: UserGroup) { await publishEvent(Event.USER_GROUP_USERS_ADDED, properties) } -export async function usersDeleted(count: number, group: UserGroup) { +async function usersDeleted(count: number, group: UserGroup) { const properties: GroupUsersDeletedEvent = { count, groupId: group._id as string, @@ -48,7 +48,7 @@ export async function usersDeleted(count: number, group: UserGroup) { await publishEvent(Event.USER_GROUP_USERS_REMOVED, properties) } -export async function createdOnboarding(groupId: string) { +async function createdOnboarding(groupId: string) { const properties: GroupAddedOnboardingEvent = { groupId: groupId, onboarding: true, @@ -56,9 +56,19 @@ export async function createdOnboarding(groupId: string) { await publishEvent(Event.USER_GROUP_ONBOARDING, properties) } -export async function permissionsEdited(roles: UserGroupRoles) { +async function permissionsEdited(roles: UserGroupRoles) { const properties: UserGroupRoles = { ...roles, } await publishEvent(Event.USER_GROUP_PERMISSIONS_EDITED, properties) } + +export default { + created, + updated, + deleted, + usersAdded, + usersDeleted, + createdOnboarding, + permissionsEdited, +} diff --git a/packages/backend-core/src/events/publishers/index.ts b/packages/backend-core/src/events/publishers/index.ts index 7306312a8f..2316785ed7 100644 --- a/packages/backend-core/src/events/publishers/index.ts +++ b/packages/backend-core/src/events/publishers/index.ts @@ -1,22 +1,22 @@ -export * as account from "./account" -export * as app from "./app" -export * as auth from "./auth" -export * as automation from "./automation" -export * as datasource from "./datasource" -export * as email from "./email" -export * as license from "./license" -export * as layout from "./layout" -export * as org from "./org" -export * as query from "./query" -export * as role from "./role" -export * as screen from "./screen" -export * as rows from "./rows" -export * as table from "./table" -export * as serve from "./serve" -export * as user from "./user" -export * as view from "./view" -export * as installation from "./installation" -export * as backfill from "./backfill" -export * as group from "./group" -export * as plugin from "./plugin" -export * as backup from "./backup" +export { default as account } from "./account" +export { default as app } from "./app" +export { default as auth } from "./auth" +export { default as automation } from "./automation" +export { default as datasource } from "./datasource" +export { default as email } from "./email" +export { default as license } from "./license" +export { default as layout } from "./layout" +export { default as org } from "./org" +export { default as query } from "./query" +export { default as role } from "./role" +export { default as screen } from "./screen" +export { default as rows } from "./rows" +export { default as table } from "./table" +export { default as serve } from "./serve" +export { default as user } from "./user" +export { default as view } from "./view" +export { default as installation } from "./installation" +export { default as backfill } from "./backfill" +export { default as group } from "./group" +export { default as plugin } from "./plugin" +export { default as backup } from "./backup" diff --git a/packages/backend-core/src/events/publishers/installation.ts b/packages/backend-core/src/events/publishers/installation.ts index ef27935210..f1ca75a0dd 100644 --- a/packages/backend-core/src/events/publishers/installation.ts +++ b/packages/backend-core/src/events/publishers/installation.ts @@ -1,14 +1,14 @@ import { publishEvent } from "../events" import { Event, VersionCheckedEvent, VersionChangeEvent } from "@budibase/types" -export async function versionChecked(version: string) { +async function versionChecked(version: string) { const properties: VersionCheckedEvent = { currentVersion: version, } await publishEvent(Event.INSTALLATION_VERSION_CHECKED, properties) } -export async function upgraded(from: string, to: string) { +async function upgraded(from: string, to: string) { const properties: VersionChangeEvent = { from, to, @@ -17,7 +17,7 @@ export async function upgraded(from: string, to: string) { await publishEvent(Event.INSTALLATION_VERSION_UPGRADED, properties) } -export async function downgraded(from: string, to: string) { +async function downgraded(from: string, to: string) { const properties: VersionChangeEvent = { from, to, @@ -25,7 +25,14 @@ export async function downgraded(from: string, to: string) { await publishEvent(Event.INSTALLATION_VERSION_DOWNGRADED, properties) } -export async function firstStartup() { +async function firstStartup() { const properties = {} await publishEvent(Event.INSTALLATION_FIRST_STARTUP, properties) } + +export default { + versionChecked, + upgraded, + downgraded, + firstStartup, +} diff --git a/packages/backend-core/src/events/publishers/layout.ts b/packages/backend-core/src/events/publishers/layout.ts index 1eede40143..6abb226049 100644 --- a/packages/backend-core/src/events/publishers/layout.ts +++ b/packages/backend-core/src/events/publishers/layout.ts @@ -6,16 +6,21 @@ import { LayoutDeletedEvent, } from "@budibase/types" -export async function created(layout: Layout, timestamp?: string | number) { +async function created(layout: Layout, timestamp?: string | number) { const properties: LayoutCreatedEvent = { layoutId: layout._id as string, } await publishEvent(Event.LAYOUT_CREATED, properties, timestamp) } -export async function deleted(layoutId: string) { +async function deleted(layoutId: string) { const properties: LayoutDeletedEvent = { layoutId, } await publishEvent(Event.LAYOUT_DELETED, properties) } + +export default { + created, + deleted, +} diff --git a/packages/backend-core/src/events/publishers/license.ts b/packages/backend-core/src/events/publishers/license.ts index 84472e408f..aff3286c87 100644 --- a/packages/backend-core/src/events/publishers/license.ts +++ b/packages/backend-core/src/events/publishers/license.ts @@ -13,7 +13,7 @@ import { LicensePaymentRecoveredEvent, } from "@budibase/types" -export async function tierChanged(account: Account, from: number, to: number) { +async function tierChanged(account: Account, from: number, to: number) { const properties: LicenseTierChangedEvent = { accountId: account.accountId, to, @@ -22,11 +22,7 @@ export async function tierChanged(account: Account, from: number, to: number) { await publishEvent(Event.LICENSE_TIER_CHANGED, properties) } -export async function planChanged( - account: Account, - from: PlanType, - to: PlanType -) { +async function planChanged(account: Account, from: PlanType, to: PlanType) { const properties: LicensePlanChangedEvent = { accountId: account.accountId, to, @@ -35,44 +31,55 @@ export async function planChanged( await publishEvent(Event.LICENSE_PLAN_CHANGED, properties) } -export async function activated(account: Account) { +async function activated(account: Account) { const properties: LicenseActivatedEvent = { accountId: account.accountId, } await publishEvent(Event.LICENSE_ACTIVATED, properties) } -export async function checkoutOpened(account: Account) { +async function checkoutOpened(account: Account) { const properties: LicenseCheckoutOpenedEvent = { accountId: account.accountId, } await publishEvent(Event.LICENSE_CHECKOUT_OPENED, properties) } -export async function checkoutSuccess(account: Account) { +async function checkoutSuccess(account: Account) { const properties: LicenseCheckoutSuccessEvent = { accountId: account.accountId, } await publishEvent(Event.LICENSE_CHECKOUT_SUCCESS, properties) } -export async function portalOpened(account: Account) { +async function portalOpened(account: Account) { const properties: LicensePortalOpenedEvent = { accountId: account.accountId, } await publishEvent(Event.LICENSE_PORTAL_OPENED, properties) } -export async function paymentFailed(account: Account) { +async function paymentFailed(account: Account) { const properties: LicensePaymentFailedEvent = { accountId: account.accountId, } await publishEvent(Event.LICENSE_PAYMENT_FAILED, properties) } -export async function paymentRecovered(account: Account) { +async function paymentRecovered(account: Account) { const properties: LicensePaymentRecoveredEvent = { accountId: account.accountId, } await publishEvent(Event.LICENSE_PAYMENT_RECOVERED, properties) } + +export default { + tierChanged, + planChanged, + activated, + checkoutOpened, + checkoutSuccess, + portalOpened, + paymentFailed, + paymentRecovered, +} diff --git a/packages/backend-core/src/events/publishers/org.ts b/packages/backend-core/src/events/publishers/org.ts index 4567357db8..684bb68dac 100644 --- a/packages/backend-core/src/events/publishers/org.ts +++ b/packages/backend-core/src/events/publishers/org.ts @@ -1,29 +1,37 @@ import { publishEvent } from "../events" import { Event } from "@budibase/types" -export async function nameUpdated(timestamp?: string | number) { +async function nameUpdated(timestamp?: string | number) { const properties = {} await publishEvent(Event.ORG_NAME_UPDATED, properties, timestamp) } -export async function logoUpdated(timestamp?: string | number) { +async function logoUpdated(timestamp?: string | number) { const properties = {} await publishEvent(Event.ORG_LOGO_UPDATED, properties, timestamp) } -export async function platformURLUpdated(timestamp?: string | number) { +async function platformURLUpdated(timestamp?: string | number) { const properties = {} await publishEvent(Event.ORG_PLATFORM_URL_UPDATED, properties, timestamp) } // TODO -export async function analyticsOptOut() { +async function analyticsOptOut() { const properties = {} await publishEvent(Event.ANALYTICS_OPT_OUT, properties) } -export async function analyticsOptIn() { +async function analyticsOptIn() { const properties = {} await publishEvent(Event.ANALYTICS_OPT_OUT, properties) } + +export default { + nameUpdated, + logoUpdated, + platformURLUpdated, + analyticsOptOut, + analyticsOptIn, +} diff --git a/packages/backend-core/src/events/publishers/plugin.ts b/packages/backend-core/src/events/publishers/plugin.ts index 4e4d87cf56..b5a686f95d 100644 --- a/packages/backend-core/src/events/publishers/plugin.ts +++ b/packages/backend-core/src/events/publishers/plugin.ts @@ -7,7 +7,7 @@ import { PluginInitEvent, } from "@budibase/types" -export async function init(plugin: Plugin) { +async function init(plugin: Plugin) { const properties: PluginInitEvent = { type: plugin.schema.type, name: plugin.name, @@ -17,7 +17,7 @@ export async function init(plugin: Plugin) { await publishEvent(Event.PLUGIN_INIT, properties) } -export async function imported(plugin: Plugin) { +async function imported(plugin: Plugin) { const properties: PluginImportedEvent = { pluginId: plugin._id as string, type: plugin.schema.type, @@ -29,7 +29,7 @@ export async function imported(plugin: Plugin) { await publishEvent(Event.PLUGIN_IMPORTED, properties) } -export async function deleted(plugin: Plugin) { +async function deleted(plugin: Plugin) { const properties: PluginDeletedEvent = { pluginId: plugin._id as string, type: plugin.schema.type, @@ -39,3 +39,9 @@ export async function deleted(plugin: Plugin) { } await publishEvent(Event.PLUGIN_DELETED, properties) } + +export default { + init, + imported, + deleted, +} diff --git a/packages/backend-core/src/events/publishers/query.ts b/packages/backend-core/src/events/publishers/query.ts index 1bcf561fd0..7d28129cf6 100644 --- a/packages/backend-core/src/events/publishers/query.ts +++ b/packages/backend-core/src/events/publishers/query.ts @@ -13,7 +13,7 @@ import { /* eslint-disable */ -export const created = async ( +const created = async ( datasource: Datasource, query: Query, timestamp?: string | number @@ -27,7 +27,7 @@ export const created = async ( await publishEvent(Event.QUERY_CREATED, properties, timestamp) } -export const updated = async (datasource: Datasource, query: Query) => { +const updated = async (datasource: Datasource, query: Query) => { const properties: QueryUpdatedEvent = { queryId: query._id as string, datasourceId: datasource._id as string, @@ -37,7 +37,7 @@ export const updated = async (datasource: Datasource, query: Query) => { await publishEvent(Event.QUERY_UPDATED, properties) } -export const deleted = async (datasource: Datasource, query: Query) => { +const deleted = async (datasource: Datasource, query: Query) => { const properties: QueryDeletedEvent = { queryId: query._id as string, datasourceId: datasource._id as string, @@ -47,7 +47,7 @@ export const deleted = async (datasource: Datasource, query: Query) => { await publishEvent(Event.QUERY_DELETED, properties) } -export const imported = async ( +const imported = async ( datasource: Datasource, importSource: any, count: any @@ -61,14 +61,14 @@ export const imported = async ( await publishEvent(Event.QUERY_IMPORT, properties) } -export const run = async (count: number, timestamp?: string | number) => { +const run = async (count: number, timestamp?: string | number) => { const properties: QueriesRunEvent = { count, } await publishEvent(Event.QUERIES_RUN, properties, timestamp) } -export const previewed = async (datasource: Datasource, query: Query) => { +const previewed = async (datasource: Datasource, query: Query) => { const properties: QueryPreviewedEvent = { queryId: query._id, datasourceId: datasource._id as string, @@ -77,3 +77,12 @@ export const previewed = async (datasource: Datasource, query: Query) => { } await publishEvent(Event.QUERY_PREVIEWED, properties) } + +export default { + created, + updated, + deleted, + imported, + run, + previewed, +} diff --git a/packages/backend-core/src/events/publishers/role.ts b/packages/backend-core/src/events/publishers/role.ts index 99074d76a5..2fbdc8b76b 100644 --- a/packages/backend-core/src/events/publishers/role.ts +++ b/packages/backend-core/src/events/publishers/role.ts @@ -10,7 +10,7 @@ import { User, } from "@budibase/types" -export async function created(role: Role, timestamp?: string | number) { +async function created(role: Role, timestamp?: string | number) { const properties: RoleCreatedEvent = { roleId: role._id as string, permissionId: role.permissionId, @@ -19,7 +19,7 @@ export async function created(role: Role, timestamp?: string | number) { await publishEvent(Event.ROLE_CREATED, properties, timestamp) } -export async function updated(role: Role) { +async function updated(role: Role) { const properties: RoleUpdatedEvent = { roleId: role._id as string, permissionId: role.permissionId, @@ -28,7 +28,7 @@ export async function updated(role: Role) { await publishEvent(Event.ROLE_UPDATED, properties) } -export async function deleted(role: Role) { +async function deleted(role: Role) { const properties: RoleDeletedEvent = { roleId: role._id as string, permissionId: role.permissionId, @@ -37,7 +37,7 @@ export async function deleted(role: Role) { await publishEvent(Event.ROLE_DELETED, properties) } -export async function assigned(user: User, roleId: string, timestamp?: number) { +async function assigned(user: User, roleId: string, timestamp?: number) { const properties: RoleAssignedEvent = { userId: user._id as string, roleId, @@ -45,10 +45,18 @@ export async function assigned(user: User, roleId: string, timestamp?: number) { await publishEvent(Event.ROLE_ASSIGNED, properties, timestamp) } -export async function unassigned(user: User, roleId: string) { +async function unassigned(user: User, roleId: string) { const properties: RoleUnassignedEvent = { userId: user._id as string, roleId, } await publishEvent(Event.ROLE_UNASSIGNED, properties) } + +export default { + created, + updated, + deleted, + assigned, + unassigned, +} diff --git a/packages/backend-core/src/events/publishers/rows.ts b/packages/backend-core/src/events/publishers/rows.ts index 487e7ea074..b1180fd936 100644 --- a/packages/backend-core/src/events/publishers/rows.ts +++ b/packages/backend-core/src/events/publishers/rows.ts @@ -9,14 +9,14 @@ import { /* eslint-disable */ -export const created = async (count: number, timestamp?: string | number) => { +const created = async (count: number, timestamp?: string | number) => { const properties: RowsCreatedEvent = { count, } await publishEvent(Event.ROWS_CREATED, properties, timestamp) } -export const imported = async ( +const imported = async ( table: Table, format: RowImportFormat, count: number @@ -28,3 +28,8 @@ export const imported = async ( } await publishEvent(Event.ROWS_IMPORTED, properties) } + +export default { + created, + imported, +} diff --git a/packages/backend-core/src/events/publishers/screen.ts b/packages/backend-core/src/events/publishers/screen.ts index 966bf72e52..27264b5847 100644 --- a/packages/backend-core/src/events/publishers/screen.ts +++ b/packages/backend-core/src/events/publishers/screen.ts @@ -6,7 +6,7 @@ import { ScreenDeletedEvent, } from "@budibase/types" -export async function created(screen: Screen, timestamp?: string | number) { +async function created(screen: Screen, timestamp?: string | number) { const properties: ScreenCreatedEvent = { layoutId: screen.layoutId, screenId: screen._id as string, @@ -15,7 +15,7 @@ export async function created(screen: Screen, timestamp?: string | number) { await publishEvent(Event.SCREEN_CREATED, properties, timestamp) } -export async function deleted(screen: Screen) { +async function deleted(screen: Screen) { const properties: ScreenDeletedEvent = { layoutId: screen.layoutId, screenId: screen._id as string, @@ -23,3 +23,8 @@ export async function deleted(screen: Screen) { } await publishEvent(Event.SCREEN_DELETED, properties) } + +export default { + created, + deleted, +} diff --git a/packages/backend-core/src/events/publishers/serve.ts b/packages/backend-core/src/events/publishers/serve.ts index 128e0b9b11..64e24e20a7 100644 --- a/packages/backend-core/src/events/publishers/serve.ts +++ b/packages/backend-core/src/events/publishers/serve.ts @@ -7,14 +7,14 @@ import { AppServedEvent, } from "@budibase/types" -export async function servedBuilder(timezone: string) { +async function servedBuilder(timezone: string) { const properties: BuilderServedEvent = { timezone, } await publishEvent(Event.SERVED_BUILDER, properties) } -export async function servedApp(app: App, timezone: string) { +async function servedApp(app: App, timezone: string) { const properties: AppServedEvent = { appVersion: app.version, timezone, @@ -22,7 +22,7 @@ export async function servedApp(app: App, timezone: string) { await publishEvent(Event.SERVED_APP, properties) } -export async function servedAppPreview(app: App, timezone: string) { +async function servedAppPreview(app: App, timezone: string) { const properties: AppPreviewServedEvent = { appId: app.appId, appVersion: app.version, @@ -30,3 +30,9 @@ export async function servedAppPreview(app: App, timezone: string) { } await publishEvent(Event.SERVED_APP_PREVIEW, properties) } + +export default { + servedBuilder, + servedApp, + servedAppPreview, +} diff --git a/packages/backend-core/src/events/publishers/table.ts b/packages/backend-core/src/events/publishers/table.ts index ba53163ca3..878885c33b 100644 --- a/packages/backend-core/src/events/publishers/table.ts +++ b/packages/backend-core/src/events/publishers/table.ts @@ -11,28 +11,28 @@ import { TableImportedEvent, } from "@budibase/types" -export async function created(table: Table, timestamp?: string | number) { +async function created(table: Table, timestamp?: string | number) { const properties: TableCreatedEvent = { tableId: table._id as string, } await publishEvent(Event.TABLE_CREATED, properties, timestamp) } -export async function updated(table: Table) { +async function updated(table: Table) { const properties: TableUpdatedEvent = { tableId: table._id as string, } await publishEvent(Event.TABLE_UPDATED, properties) } -export async function deleted(table: Table) { +async function deleted(table: Table) { const properties: TableDeletedEvent = { tableId: table._id as string, } await publishEvent(Event.TABLE_DELETED, properties) } -export async function exported(table: Table, format: TableExportFormat) { +async function exported(table: Table, format: TableExportFormat) { const properties: TableExportedEvent = { tableId: table._id as string, format, @@ -40,10 +40,18 @@ export async function exported(table: Table, format: TableExportFormat) { await publishEvent(Event.TABLE_EXPORTED, properties) } -export async function imported(table: Table, format: TableImportFormat) { +async function imported(table: Table, format: TableImportFormat) { const properties: TableImportedEvent = { tableId: table._id as string, format, } await publishEvent(Event.TABLE_IMPORTED, properties) } + +export default { + created, + updated, + deleted, + exported, + imported, +} diff --git a/packages/backend-core/src/events/publishers/user.ts b/packages/backend-core/src/events/publishers/user.ts index 2c83b267d6..c296a8bc49 100644 --- a/packages/backend-core/src/events/publishers/user.ts +++ b/packages/backend-core/src/events/publishers/user.ts @@ -15,21 +15,21 @@ import { UserUpdatedEvent, } from "@budibase/types" -export async function created(user: User, timestamp?: number) { +async function created(user: User, timestamp?: number) { const properties: UserCreatedEvent = { userId: user._id as string, } await publishEvent(Event.USER_CREATED, properties, timestamp) } -export async function updated(user: User) { +async function updated(user: User) { const properties: UserUpdatedEvent = { userId: user._id as string, } await publishEvent(Event.USER_UPDATED, properties) } -export async function deleted(user: User) { +async function deleted(user: User) { const properties: UserDeletedEvent = { userId: user._id as string, } @@ -38,7 +38,7 @@ export async function deleted(user: User) { // PERMISSIONS -export async function permissionAdminAssigned(user: User, timestamp?: number) { +async function permissionAdminAssigned(user: User, timestamp?: number) { const properties: UserPermissionAssignedEvent = { userId: user._id as string, } @@ -49,17 +49,14 @@ export async function permissionAdminAssigned(user: User, timestamp?: number) { ) } -export async function permissionAdminRemoved(user: User) { +async function permissionAdminRemoved(user: User) { const properties: UserPermissionRemovedEvent = { userId: user._id as string, } await publishEvent(Event.USER_PERMISSION_ADMIN_REMOVED, properties) } -export async function permissionBuilderAssigned( - user: User, - timestamp?: number -) { +async function permissionBuilderAssigned(user: User, timestamp?: number) { const properties: UserPermissionAssignedEvent = { userId: user._id as string, } @@ -70,7 +67,7 @@ export async function permissionBuilderAssigned( ) } -export async function permissionBuilderRemoved(user: User) { +async function permissionBuilderRemoved(user: User) { const properties: UserPermissionRemovedEvent = { userId: user._id as string, } @@ -79,12 +76,12 @@ export async function permissionBuilderRemoved(user: User) { // INVITE -export async function invited() { +async function invited() { const properties: UserInvitedEvent = {} await publishEvent(Event.USER_INVITED, properties) } -export async function inviteAccepted(user: User) { +async function inviteAccepted(user: User) { const properties: UserInviteAcceptedEvent = { userId: user._id as string, } @@ -93,30 +90,46 @@ export async function inviteAccepted(user: User) { // PASSWORD -export async function passwordForceReset(user: User) { +async function passwordForceReset(user: User) { const properties: UserPasswordForceResetEvent = { userId: user._id as string, } await publishEvent(Event.USER_PASSWORD_FORCE_RESET, properties) } -export async function passwordUpdated(user: User) { +async function passwordUpdated(user: User) { const properties: UserPasswordUpdatedEvent = { userId: user._id as string, } await publishEvent(Event.USER_PASSWORD_UPDATED, properties) } -export async function passwordResetRequested(user: User) { +async function passwordResetRequested(user: User) { const properties: UserPasswordResetRequestedEvent = { userId: user._id as string, } await publishEvent(Event.USER_PASSWORD_RESET_REQUESTED, properties) } -export async function passwordReset(user: User) { +async function passwordReset(user: User) { const properties: UserPasswordResetEvent = { userId: user._id as string, } await publishEvent(Event.USER_PASSWORD_RESET, properties) } + +export default { + created, + updated, + deleted, + permissionAdminAssigned, + permissionAdminRemoved, + permissionBuilderAssigned, + permissionBuilderRemoved, + invited, + inviteAccepted, + passwordForceReset, + passwordUpdated, + passwordResetRequested, + passwordReset, +} diff --git a/packages/backend-core/src/events/publishers/view.ts b/packages/backend-core/src/events/publishers/view.ts index 17947758d5..ccbf960b04 100644 --- a/packages/backend-core/src/events/publishers/view.ts +++ b/packages/backend-core/src/events/publishers/view.ts @@ -19,28 +19,28 @@ import { /* eslint-disable */ -export async function created(view: View, timestamp?: string | number) { +async function created(view: View, timestamp?: string | number) { const properties: ViewCreatedEvent = { tableId: view.tableId, } await publishEvent(Event.VIEW_CREATED, properties, timestamp) } -export async function updated(view: View) { +async function updated(view: View) { const properties: ViewUpdatedEvent = { tableId: view.tableId, } await publishEvent(Event.VIEW_UPDATED, properties) } -export async function deleted(view: View) { +async function deleted(view: View) { const properties: ViewDeletedEvent = { tableId: view.tableId, } await publishEvent(Event.VIEW_DELETED, properties) } -export async function exported(table: Table, format: TableExportFormat) { +async function exported(table: Table, format: TableExportFormat) { const properties: ViewExportedEvent = { tableId: table._id as string, format, @@ -48,31 +48,28 @@ export async function exported(table: Table, format: TableExportFormat) { await publishEvent(Event.VIEW_EXPORTED, properties) } -export async function filterCreated(view: View, timestamp?: string | number) { +async function filterCreated(view: View, timestamp?: string | number) { const properties: ViewFilterCreatedEvent = { tableId: view.tableId, } await publishEvent(Event.VIEW_FILTER_CREATED, properties, timestamp) } -export async function filterUpdated(view: View) { +async function filterUpdated(view: View) { const properties: ViewFilterUpdatedEvent = { tableId: view.tableId, } await publishEvent(Event.VIEW_FILTER_UPDATED, properties) } -export async function filterDeleted(view: View) { +async function filterDeleted(view: View) { const properties: ViewFilterDeletedEvent = { tableId: view.tableId, } await publishEvent(Event.VIEW_FILTER_DELETED, properties) } -export async function calculationCreated( - view: View, - timestamp?: string | number -) { +async function calculationCreated(view: View, timestamp?: string | number) { const properties: ViewCalculationCreatedEvent = { tableId: view.tableId, calculation: view.calculation as ViewCalculation, @@ -80,7 +77,7 @@ export async function calculationCreated( await publishEvent(Event.VIEW_CALCULATION_CREATED, properties, timestamp) } -export async function calculationUpdated(view: View) { +async function calculationUpdated(view: View) { const properties: ViewCalculationUpdatedEvent = { tableId: view.tableId, calculation: view.calculation as ViewCalculation, @@ -88,10 +85,23 @@ export async function calculationUpdated(view: View) { await publishEvent(Event.VIEW_CALCULATION_UPDATED, properties) } -export async function calculationDeleted(existingView: View) { +async function calculationDeleted(existingView: View) { const properties: ViewCalculationDeletedEvent = { tableId: existingView.tableId, calculation: existingView.calculation as ViewCalculation, } await publishEvent(Event.VIEW_CALCULATION_DELETED, properties) } + +export default { + created, + updated, + deleted, + exported, + filterCreated, + filterUpdated, + filterDeleted, + calculationCreated, + calculationUpdated, + calculationDeleted, +} diff --git a/packages/backend-core/src/index.ts b/packages/backend-core/src/index.ts index a4d4ad0a80..b38a53e9e4 100644 --- a/packages/backend-core/src/index.ts +++ b/packages/backend-core/src/index.ts @@ -1,68 +1,42 @@ -import errors from "./errors" -const errorClasses = errors.errors -import * as events from "./events" -import * as migrations from "./migrations" -import * as users from "./users" -import * as roles from "./security/roles" -import * as permissions from "./security/permissions" -import * as accounts from "./cloud/accounts" -import * as installation from "./installation" -import env from "./environment" -import * as tenancy from "./tenancy" -import * as featureFlags from "./featureFlags" -import * as sessions from "./security/sessions" -import * as deprovisioning from "./context/deprovision" -import * as auth from "./auth" -import * as constants from "./constants" -import * as logging from "./logging" -import * as pino from "./pino" -import * as middleware from "./middleware" -import * as plugins from "./plugin" -import * as encryption from "./security/encryption" -import * as queue from "./queue" -import * as db from "./db" -import * as context from "./context" -import * as cache from "./cache" -import * as objectStore from "./objectStore" -import * as redis from "./redis" -import * as utils from "./utils" +export * as events from "./events" +export * as migrations from "./migrations" +export * as users from "./users" +export * as roles from "./security/roles" +export * as permissions from "./security/permissions" +export * as accounts from "./cloud/accounts" +export * as installation from "./installation" +export * as tenancy from "./tenancy" +export * as featureFlags from "./featureFlags" +export * as sessions from "./security/sessions" +export * as deprovisioning from "./context/deprovision" +export * as auth from "./auth" +export * as constants from "./constants" +export * as logging from "./logging" +export * as middleware from "./middleware" +export * as plugins from "./plugin" +export * as encryption from "./security/encryption" +export * as queue from "./queue" +export * as db from "./db" +export * as context from "./context" +export * as cache from "./cache" +export * as objectStore from "./objectStore" +export * as redis from "./redis" +export * as utils from "./utils" +export * as errors from "./errors" +export { default as env } from "./environment" -const init = (opts: any = {}) => { +// expose error classes directly +export * from "./errors" + +// expose constants directly +export * from "./constants" + +// expose inner locks from redis directly +import * as redis from "./redis" +export const locks = redis.redlock + +// expose package init function +import * as db from "./db" +export const init = (opts: any = {}) => { db.init(opts.db) } - -const core = { - init, - db, - ...constants, - redis, - locks: redis.redlock, - objectStore, - utils, - users, - cache, - auth, - constants, - migrations, - env, - accounts, - tenancy, - context, - featureFlags, - events, - sessions, - deprovisioning, - installation, - errors, - logging, - roles, - plugins, - ...pino, - ...errorClasses, - middleware, - encryption, - queue, - permissions, -} - -export = core diff --git a/packages/backend-core/src/logging.ts b/packages/backend-core/src/logging.ts index 3fc79a5fe7..8f2ae6e619 100644 --- a/packages/backend-core/src/logging.ts +++ b/packages/backend-core/src/logging.ts @@ -1,3 +1,9 @@ +import { Header } from "./constants" +import env from "./environment" +const correlator = require("correlation-id") +import { Options } from "pino-http" +import { IncomingMessage } from "http" + const NonErrors = ["AccountError"] function isSuppressed(e?: any) { @@ -29,8 +35,26 @@ export function logWarn(message: string) { console.warn(`bb-warn: ${message}`) } -export default { - logAlert, - logAlertWithInfo, - logWarn, +export function pinoSettings(): Options { + return { + prettyPrint: { + levelFirst: true, + }, + genReqId: correlator.getId, + level: env.LOG_LEVEL || "error", + autoLogging: { + ignore: (req: IncomingMessage) => !!req.url?.includes("/health"), + }, + } +} + +const setCorrelationHeader = (headers: any) => { + const correlationId = correlator.getId() + if (correlationId) { + headers[Header.CORRELATION_ID] = correlationId + } +} + +export const correlation = { + setHeader: setCorrelationHeader, } diff --git a/packages/backend-core/src/middleware/adminOnly.ts b/packages/backend-core/src/middleware/adminOnly.ts index 30fdf2907b..dbe1e3a501 100644 --- a/packages/backend-core/src/middleware/adminOnly.ts +++ b/packages/backend-core/src/middleware/adminOnly.ts @@ -1,6 +1,6 @@ import { BBContext } from "@budibase/types" -export = async (ctx: BBContext, next: any) => { +export default async (ctx: BBContext, next: any) => { if ( !ctx.internal && (!ctx.user || !ctx.user.admin || !ctx.user.admin.global) diff --git a/packages/backend-core/src/middleware/auditLog.ts b/packages/backend-core/src/middleware/auditLog.ts index a2c30ade8a..9b76bb10b7 100644 --- a/packages/backend-core/src/middleware/auditLog.ts +++ b/packages/backend-core/src/middleware/auditLog.ts @@ -1,6 +1,6 @@ import { BBContext } from "@budibase/types" -export = async (ctx: BBContext | any, next: any) => { +export default async (ctx: BBContext | any, next: any) => { // Placeholder for audit log middleware return next() } diff --git a/packages/backend-core/src/middleware/authenticated.ts b/packages/backend-core/src/middleware/authenticated.ts index fcf07c50a5..3b5e9ae162 100644 --- a/packages/backend-core/src/middleware/authenticated.ts +++ b/packages/backend-core/src/middleware/authenticated.ts @@ -66,7 +66,7 @@ async function checkApiKey(apiKey: string, populateUser?: Function) { * The tenancy modules should not be used here and it should be assumed that the tenancy context * has not yet been populated. */ -export = function ( +export default function ( noAuthPatterns: EndpointMatcher[] = [], opts: { publicAllowed?: boolean; populateUser?: Function } = { publicAllowed: false, diff --git a/packages/backend-core/src/middleware/builderOnly.ts b/packages/backend-core/src/middleware/builderOnly.ts index e13882d7f6..a00fd63a22 100644 --- a/packages/backend-core/src/middleware/builderOnly.ts +++ b/packages/backend-core/src/middleware/builderOnly.ts @@ -1,6 +1,6 @@ import { BBContext } from "@budibase/types" -export = async (ctx: BBContext, next: any) => { +export default async (ctx: BBContext, next: any) => { if ( !ctx.internal && (!ctx.user || !ctx.user.builder || !ctx.user.builder.global) diff --git a/packages/backend-core/src/middleware/builderOrAdmin.ts b/packages/backend-core/src/middleware/builderOrAdmin.ts index 26664695f8..26bb3a1bda 100644 --- a/packages/backend-core/src/middleware/builderOrAdmin.ts +++ b/packages/backend-core/src/middleware/builderOrAdmin.ts @@ -1,6 +1,6 @@ import { BBContext } from "@budibase/types" -export = async (ctx: BBContext, next: any) => { +export default async (ctx: BBContext, next: any) => { if ( !ctx.internal && (!ctx.user || !ctx.user.builder || !ctx.user.builder.global) && diff --git a/packages/backend-core/src/middleware/csrf.ts b/packages/backend-core/src/middleware/csrf.ts index 654ba47e07..cced4d5f7d 100644 --- a/packages/backend-core/src/middleware/csrf.ts +++ b/packages/backend-core/src/middleware/csrf.ts @@ -32,7 +32,7 @@ const INCLUDED_CONTENT_TYPES = [ * https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#synchronizer-token-pattern * */ -export = function ( +export default function ( opts: { noCsrfPatterns: EndpointMatcher[] } = { noCsrfPatterns: [] } ) { const noCsrfOptions = buildMatcherRegex(opts.noCsrfPatterns) diff --git a/packages/backend-core/src/middleware/index.ts b/packages/backend-core/src/middleware/index.ts index 2b332f5c49..4986cde64b 100644 --- a/packages/backend-core/src/middleware/index.ts +++ b/packages/backend-core/src/middleware/index.ts @@ -1,38 +1,19 @@ -import * as jwt from "./passport/jwt" -import * as local from "./passport/local" -import * as google from "./passport/google" -import * as oidc from "./passport/oidc" -import { authError, ssoCallbackUrl } from "./passport/utils" -import authenticated from "./authenticated" -import auditLog from "./auditLog" -import tenancy from "./tenancy" -import internalApi from "./internalApi" +export * as jwt from "./passport/jwt" +export * as local from "./passport/local" +export * as google from "./passport/google" +export * as oidc from "./passport/oidc" import * as datasourceGoogle from "./passport/datasource/google" -import csrf from "./csrf" -import adminOnly from "./adminOnly" -import builderOrAdmin from "./builderOrAdmin" -import builderOnly from "./builderOnly" -import * as joiValidator from "./joi-validator" - -const pkg = { - google, - oidc, - jwt, - local, - authenticated, - auditLog, - tenancy, - authError, - internalApi, - ssoCallbackUrl, - datasource: { - google: datasourceGoogle, - }, - csrf, - adminOnly, - builderOnly, - builderOrAdmin, - joiValidator, +export const datasource = { + google: datasourceGoogle, } - -export = pkg +export { authError, ssoCallbackUrl } from "./passport/utils" +export { default as authenticated } from "./authenticated" +export { default as auditLog } from "./auditLog" +export { default as tenancy } from "./tenancy" +export { default as internalApi } from "./internalApi" +export { default as csrf } from "./csrf" +export { default as adminOnly } from "./adminOnly" +export { default as builderOrAdmin } from "./builderOrAdmin" +export { default as builderOnly } from "./builderOnly" +export { default as logging } from "./logging" +export * as joiValidator from "./joi-validator" diff --git a/packages/backend-core/src/middleware/internalApi.ts b/packages/backend-core/src/middleware/internalApi.ts index f4f08ec2dd..fff761928b 100644 --- a/packages/backend-core/src/middleware/internalApi.ts +++ b/packages/backend-core/src/middleware/internalApi.ts @@ -5,7 +5,7 @@ import { BBContext } from "@budibase/types" /** * API Key only endpoint. */ -export = async (ctx: BBContext, next: any) => { +export default async (ctx: BBContext, next: any) => { const apiKey = ctx.request.headers[Header.API_KEY] if (apiKey !== env.INTERNAL_API_KEY) { ctx.throw(403, "Unauthorized") diff --git a/packages/backend-core/src/middleware/logging.ts b/packages/backend-core/src/middleware/logging.ts new file mode 100644 index 0000000000..d1f2d6566b --- /dev/null +++ b/packages/backend-core/src/middleware/logging.ts @@ -0,0 +1,88 @@ +const correlator = require("correlation-id") +import { Header } from "../constants" +import { v4 as uuid } from "uuid" +import * as context from "../context" + +const debug = console.warn +const trace = console.trace +const log = console.log +const info = console.info +const warn = console.warn +const error = console.error + +const getTenantId = () => { + let tenantId + try { + tenantId = context.getTenantId() + } catch (e: any) { + // do nothing + } + return tenantId +} + +const getAppId = () => { + let appId + try { + appId = context.getAppId() + } catch (e) { + // do nothing + } + return appId +} + +const getIdentityId = () => { + let identityId + try { + const identity = context.getIdentity() + identityId = identity?._id + } catch (e) { + // do nothing + } + return identityId +} + +const print = (fn: any, data: any[]) => { + let message = "" + + const correlationId = correlator.getId() + if (correlationId) { + message = message + `[correlationId=${correlator.getId()}]` + } + + const tenantId = getTenantId() + if (tenantId) { + message = message + ` [tenantId=${tenantId}]` + } + + const appId = getAppId() + if (appId) { + message = message + ` [appId=${appId}]` + } + + const identityId = getIdentityId() + if (identityId) { + message = message + ` [identityId=${identityId}]` + } + + fn(message, data) +} + +const logging = (ctx: any, next: any) => { + // use the provided correlation id header if present + let correlationId = ctx.headers[Header.CORRELATION_ID] + if (!correlationId) { + correlationId = uuid() + } + + return correlator.withId(correlationId, () => { + console.debug = data => print(debug, data) + console.trace = data => print(trace, data) + console.log = data => print(log, data) + console.info = data => print(info, data) + console.warn = data => print(warn, data) + console.error = data => print(error, data) + return next() + }) +} + +export default logging diff --git a/packages/backend-core/src/middleware/passport/oidc.ts b/packages/backend-core/src/middleware/passport/oidc.ts index 40bc22ec0c..7caa177cf0 100644 --- a/packages/backend-core/src/middleware/passport/oidc.ts +++ b/packages/backend-core/src/middleware/passport/oidc.ts @@ -2,7 +2,6 @@ import fetch from "node-fetch" import { authenticateThirdParty, SaveUserFunction } from "./third-party-common" import { ssoCallbackUrl } from "./utils" import { - Config, ConfigType, OIDCInnerCfg, Database, diff --git a/packages/backend-core/src/middleware/tenancy.ts b/packages/backend-core/src/middleware/tenancy.ts index 78da2bb3e8..a09c463045 100644 --- a/packages/backend-core/src/middleware/tenancy.ts +++ b/packages/backend-core/src/middleware/tenancy.ts @@ -8,7 +8,7 @@ import { TenantResolutionStrategy, } from "@budibase/types" -export = function ( +export default function ( allowQueryStringPatterns: EndpointMatcher[], noTenancyPatterns: EndpointMatcher[], opts: { noTenancyRequired?: boolean } = { noTenancyRequired: false } diff --git a/packages/backend-core/src/migrations/migrations.ts b/packages/backend-core/src/migrations/migrations.ts index 7bc2dec290..55b8ab1938 100644 --- a/packages/backend-core/src/migrations/migrations.ts +++ b/packages/backend-core/src/migrations/migrations.ts @@ -88,7 +88,7 @@ export const runMigration = async ( await doWithDB(dbName, async (db: any) => { try { - const doc = await exports.getMigrationsDoc(db) + const doc = await getMigrationsDoc(db) // the migration has already been run if (doc[migrationName]) { diff --git a/packages/backend-core/src/objectStore/objectStore.ts b/packages/backend-core/src/objectStore/objectStore.ts index 1cc8ad3add..f601d40a37 100644 --- a/packages/backend-core/src/objectStore/objectStore.ts +++ b/packages/backend-core/src/objectStore/objectStore.ts @@ -329,9 +329,9 @@ export const deleteFile = async (bucketName: string, filepath: string) => { await makeSureBucketExists(objectStore, bucketName) const params = { Bucket: bucketName, - Key: filepath, + Key: sanitizeKey(filepath), } - return objectStore.deleteObject(params) + return objectStore.deleteObject(params).promise() } export const deleteFiles = async (bucketName: string, filepaths: string[]) => { @@ -340,7 +340,7 @@ export const deleteFiles = async (bucketName: string, filepaths: string[]) => { const params = { Bucket: bucketName, Delete: { - Objects: filepaths.map((path: any) => ({ Key: path })), + Objects: filepaths.map((path: any) => ({ Key: sanitizeKey(path) })), }, } return objectStore.deleteObjects(params).promise() diff --git a/packages/backend-core/src/pino.ts b/packages/backend-core/src/pino.ts deleted file mode 100644 index 4140f428e1..0000000000 --- a/packages/backend-core/src/pino.ts +++ /dev/null @@ -1,13 +0,0 @@ -import env from "./environment" - -export function pinoSettings() { - return { - prettyPrint: { - levelFirst: true, - }, - level: env.LOG_LEVEL || "error", - autoLogging: { - ignore: (req: { url: string }) => req.url.includes("/health"), - }, - } -} diff --git a/packages/backend-core/src/queue/inMemoryQueue.ts b/packages/backend-core/src/queue/inMemoryQueue.ts index acfff1c7b8..b80aece418 100644 --- a/packages/backend-core/src/queue/inMemoryQueue.ts +++ b/packages/backend-core/src/queue/inMemoryQueue.ts @@ -137,4 +137,4 @@ class InMemoryQueue { } } -export = InMemoryQueue +export default InMemoryQueue diff --git a/packages/backend-core/src/redis/redis.ts b/packages/backend-core/src/redis/redis.ts index 58734fc4f1..0267709cdc 100644 --- a/packages/backend-core/src/redis/redis.ts +++ b/packages/backend-core/src/redis/redis.ts @@ -276,4 +276,4 @@ class RedisWrapper { } } -export = RedisWrapper +export default RedisWrapper diff --git a/packages/backend-core/src/security/sessions.ts b/packages/backend-core/src/security/sessions.ts index 48e75b0d60..5a535c0c46 100644 --- a/packages/backend-core/src/security/sessions.ts +++ b/packages/backend-core/src/security/sessions.ts @@ -1,7 +1,7 @@ const redis = require("../redis/init") const { v4: uuidv4 } = require("uuid") const { logWarn } = require("../logging") -const env = require("../environment") +import env from "../environment" import { Session, ScannedSession, diff --git a/packages/backend-core/src/utils/tests/utils.spec.ts b/packages/backend-core/src/utils/tests/utils.spec.ts index bb76a93653..498aff1555 100644 --- a/packages/backend-core/src/utils/tests/utils.spec.ts +++ b/packages/backend-core/src/utils/tests/utils.spec.ts @@ -1,7 +1,8 @@ import { structures } from "../../../tests" import * as utils from "../../utils" import * as events from "../../events" -import { DEFAULT_TENANT_ID } from "../../constants" +import * as db from "../../db" +import { DEFAULT_TENANT_ID, Header } from "../../constants" import { doInTenant } from "../../context" describe("utils", () => { @@ -14,4 +15,95 @@ describe("utils", () => { }) }) }) + + describe("getAppIdFromCtx", () => { + it("gets appId from header", async () => { + const ctx = structures.koa.newContext() + const expected = db.generateAppID() + ctx.request.headers = { + [Header.APP_ID]: expected, + } + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(expected) + }) + + it("gets appId from body", async () => { + const ctx = structures.koa.newContext() + const expected = db.generateAppID() + ctx.request.body = { + appId: expected, + } + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(expected) + }) + + it("gets appId from path", async () => { + const ctx = structures.koa.newContext() + const expected = db.generateAppID() + ctx.path = `/apps/${expected}` + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(expected) + }) + + it("gets appId from url", async () => { + const ctx = structures.koa.newContext() + const expected = db.generateAppID() + const app = structures.apps.app(expected) + + // set custom url + const appUrl = "custom-url" + app.url = `/${appUrl}` + ctx.path = `/app/${appUrl}` + + // save the app + const database = db.getDB(expected) + await database.put(app) + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(expected) + }) + + it("doesn't get appId from url when previewing", async () => { + const ctx = structures.koa.newContext() + const appId = db.generateAppID() + const app = structures.apps.app(appId) + + // set custom url + const appUrl = "preview" + app.url = `/${appUrl}` + ctx.path = `/app/${appUrl}` + + // save the app + const database = db.getDB(appId) + await database.put(app) + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(undefined) + }) + + it("gets appId from referer", async () => { + const ctx = structures.koa.newContext() + const expected = db.generateAppID() + ctx.request.headers = { + referer: `http://test.com/builder/app/${expected}/design/screen_123/screens`, + } + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(expected) + }) + + it("doesn't get appId from referer when not builder", async () => { + const ctx = structures.koa.newContext() + const appId = db.generateAppID() + ctx.request.headers = { + referer: `http://test.com/foo/app/${appId}/bar`, + } + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(undefined) + }) + }) }) diff --git a/packages/backend-core/src/utils/utils.ts b/packages/backend-core/src/utils/utils.ts index fd8d31b13f..c608686431 100644 --- a/packages/backend-core/src/utils/utils.ts +++ b/packages/backend-core/src/utils/utils.ts @@ -25,13 +25,16 @@ const jwt = require("jsonwebtoken") const APP_PREFIX = DocumentType.APP + SEPARATOR const PROD_APP_PREFIX = "/app/" +const BUILDER_PREVIEW_PATH = "/app/preview" +const BUILDER_REFERER_PREFIX = "/builder/app/" + function confirmAppId(possibleAppId: string | undefined) { return possibleAppId && possibleAppId.startsWith(APP_PREFIX) ? possibleAppId : undefined } -async function resolveAppUrl(ctx: Ctx) { +export async function resolveAppUrl(ctx: Ctx) { const appUrl = ctx.path.split("/")[2] let possibleAppUrl = `/${appUrl.toLowerCase()}` @@ -75,7 +78,7 @@ export function isServingApp(ctx: Ctx) { */ export async function getAppIdFromCtx(ctx: Ctx) { // look in headers - const options = [ctx.headers[Header.APP_ID]] + const options = [ctx.request.headers[Header.APP_ID]] let appId for (let option of options) { appId = confirmAppId(option as string) @@ -95,15 +98,23 @@ export async function getAppIdFromCtx(ctx: Ctx) { appId = confirmAppId(pathId) } - // look in the referer - const refererId = parseAppIdFromUrl(ctx.request.headers.referer) - if (!appId && refererId) { - appId = confirmAppId(refererId) + // lookup using custom url - prod apps only + // filter out the builder preview path which collides with the prod app path + // to ensure we don't load all apps excessively + const isBuilderPreview = ctx.path.startsWith(BUILDER_PREVIEW_PATH) + const isViewingProdApp = + ctx.path.startsWith(PROD_APP_PREFIX) && !isBuilderPreview + if (!appId && isViewingProdApp) { + appId = confirmAppId(await resolveAppUrl(ctx)) } - // look in the url - prod app - if (!appId && ctx.path.startsWith(PROD_APP_PREFIX)) { - appId = confirmAppId(await resolveAppUrl(ctx)) + // look in the referer - builder only + // make sure this is performed after prod app url resolution, in case the + // referer header is present from a builder redirect + const referer = ctx.request.headers.referer + if (!appId && referer?.includes(BUILDER_REFERER_PREFIX)) { + const refererId = parseAppIdFromUrl(ctx.request.headers.referer) + appId = confirmAppId(refererId) } return appId diff --git a/packages/backend-core/tests/utilities/mocks/accounts.ts b/packages/backend-core/tests/utilities/mocks/accounts.ts index cb4c68b65e..e40d32b276 100644 --- a/packages/backend-core/tests/utilities/mocks/accounts.ts +++ b/packages/backend-core/tests/utilities/mocks/accounts.ts @@ -1,9 +1,13 @@ -export const getAccount = jest.fn() -export const getAccountByTenantId = jest.fn() -export const getStatus = jest.fn() +const mockGetAccount = jest.fn() +const mockGetAccountByTenantId = jest.fn() +const mockGetStatus = jest.fn() jest.mock("../../../src/cloud/accounts", () => ({ - getAccount, - getAccountByTenantId, - getStatus, + getAccount: mockGetAccount, + getAccountByTenantId: mockGetAccountByTenantId, + getStatus: mockGetStatus, })) + +export const getAccount = mockGetAccount +export const getAccountByTenantId = mockGetAccountByTenantId +export const getStatus = mockGetStatus diff --git a/packages/backend-core/tests/utilities/mocks/events.ts b/packages/backend-core/tests/utilities/mocks/events.ts index 40c3706a55..ab0aaa93a6 100644 --- a/packages/backend-core/tests/utilities/mocks/events.ts +++ b/packages/backend-core/tests/utilities/mocks/events.ts @@ -1,9 +1,8 @@ -const processors = require("../../../src/events/processors") +import * as processors from "../../../src/events/processors" +import * as events from "../../../src/events" jest.spyOn(processors.analyticsProcessor, "processEvent") -const events = require("../../../src/events") - jest.spyOn(events.identification, "identifyTenantGroup") jest.spyOn(events.identification, "identifyUser") diff --git a/packages/backend-core/tests/utilities/structures/apps.ts b/packages/backend-core/tests/utilities/structures/apps.ts new file mode 100644 index 0000000000..f3743d99b2 --- /dev/null +++ b/packages/backend-core/tests/utilities/structures/apps.ts @@ -0,0 +1,21 @@ +import { generator } from "." +import { App } from "@budibase/types" +import { DEFAULT_TENANT_ID, DocumentType } from "../../../src/constants" + +export function app(id: string): App { + return { + _id: DocumentType.APP_METADATA, + appId: id, + type: "", + version: "0.0.1", + componentLibraries: [], + name: generator.name(), + url: `/custom-url`, + instance: { + _id: id, + }, + tenantId: DEFAULT_TENANT_ID, + status: "", + template: undefined, + } +} diff --git a/packages/backend-core/tests/utilities/structures/index.ts b/packages/backend-core/tests/utilities/structures/index.ts index e0ed4df9c4..0d0f0c507f 100644 --- a/packages/backend-core/tests/utilities/structures/index.ts +++ b/packages/backend-core/tests/utilities/structures/index.ts @@ -3,7 +3,8 @@ export * from "./common" import Chance from "chance" export const generator = new Chance() -export * as koa from "./koa" export * as accounts from "./accounts" +export * as apps from "./apps" +export * as koa from "./koa" export * as licenses from "./licenses" export * as plugins from "./plugins" diff --git a/packages/backend-core/tests/utilities/structures/koa.ts b/packages/backend-core/tests/utilities/structures/koa.ts index a33dca1546..102fe029de 100644 --- a/packages/backend-core/tests/utilities/structures/koa.ts +++ b/packages/backend-core/tests/utilities/structures/koa.ts @@ -5,9 +5,11 @@ export const newContext = (): BBContext => { const ctx = createMockContext() return { ...ctx, + path: "/", cookies: createMockCookies(), request: { ...ctx.request, + headers: {}, body: {}, }, } diff --git a/packages/backend-core/tsconfig.build.json b/packages/backend-core/tsconfig.build.json index 9682f3e32f..12f8255a7c 100644 --- a/packages/backend-core/tsconfig.build.json +++ b/packages/backend-core/tsconfig.build.json @@ -12,6 +12,7 @@ "declaration": true, "types": [ "node", "jest" ], "outDir": "dist", + "skipLibCheck": true }, "include": [ "**/*.js", @@ -22,6 +23,7 @@ "node_modules", "dist", "**/*.spec.ts", - "**/*.spec.js" + "**/*.spec.js", + "__mocks__" ] } \ No newline at end of file diff --git a/packages/backend-core/tsconfig.json b/packages/backend-core/tsconfig.json index 1d9da5f2ae..e95fb9ab4d 100644 --- a/packages/backend-core/tsconfig.json +++ b/packages/backend-core/tsconfig.json @@ -12,6 +12,6 @@ ], "exclude": [ "node_modules", - "dist" + "dist", ] } \ No newline at end of file diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock index 06c7370af4..d8dd7886f3 100644 --- a/packages/backend-core/yarn.lock +++ b/packages/backend-core/yarn.lock @@ -482,11 +482,6 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/types@2.2.10-alpha.11": - version "2.2.10-alpha.11" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.10-alpha.11.tgz#49986cdaca3c074eb500750905029b86cb0ca057" - integrity sha512-vm0JFxTuOtMdE7dFp2q04q998JRxSsGM0ckccWnKtKNFR8xWZE2J4UsPZSEzCtogHqrZFUV2hvVqeO3YFkTXQw== - "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -569,6 +564,13 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/create-cache-key-function@^27.4.2": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-27.5.1.tgz#7448fae15602ea95c828f5eceed35c202a820b31" + integrity sha512-dmH1yW+makpTSURTy8VzdUwFnfQh1G8R+DxO2Ho2FFmBbKFEVm+3jWdvFhE2VqB/LATCTokkP0dotjyQyw5/AQ== + dependencies: + "@jest/types" "^27.5.1" + "@jest/environment@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e" @@ -703,6 +705,17 @@ slash "^3.0.0" write-file-atomic "^4.0.1" +"@jest/types@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" + integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@jest/types@^28.1.1", "@jest/types@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" @@ -889,6 +902,80 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@swc/core-darwin-arm64@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.25.tgz#01ce7b8a88b545a4fc5283ed6f96b22c5733d6c4" + integrity sha512-8PWAVcjTJyj2VrqPBFOIi2w2P0Z8kOCbzHW3+pe+bSXxfGMG0MKPl5U2IXhsEL0ovm4xSFlqW0yygpoP3MmRPw== + +"@swc/core-darwin-x64@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.25.tgz#9fad102c507011f42c5a5d1f84919b81ab96d7f8" + integrity sha512-5DHGiMYFEj5aa208tCjo7Sn5tiG4xPz+4gUiWVlglxqXFptkNim5xu/1G6VYm5Zk7dI5jJkjTU76GQG7IRvPug== + +"@swc/core-linux-arm-gnueabihf@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.25.tgz#ecf3a34899fdbdc742523524caab29c0db97a6ad" + integrity sha512-YNfLxv9PhZk+jrJbpR1mMrYBUkufo0hiFv3S1OrX3l8edsIP4wPND5w9ZH0Oi898f6Jg9DBrY2zXJMQ+gWkbvA== + +"@swc/core-linux-arm64-gnu@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.25.tgz#50524c9db2dbf874570e45f0a66e0283f02bc2d9" + integrity sha512-kS+spM5/xQ6QvWF1ms3byfjnhUlpjTfFwgCyHnIKgjvsYkDa+vkAIhKq6HuEdaTPaCRCjts0Zarhub1nClUU0g== + +"@swc/core-linux-arm64-musl@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.25.tgz#f04a3d3784cff14f96ad9901861485ec0fa14ebf" + integrity sha512-vM3D7LWmjotUAJ2D4F+L+dspFeWrcPNVh0o8TCoTOYCt8DPD5YsUKTpIgOsZ+gReeWUAnNTh0Btx5pGGVfajGA== + +"@swc/core-linux-x64-gnu@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.25.tgz#761fb020b8a0130e4dccc9c8dce355fa06df63f4" + integrity sha512-xUCLLMDlYa/zB8BftVa4SrxuVpcDxkltCfmBg5r2pZPVskhC5ZJsQZ/AvWNChoAB11shRhjTaWDlmxJEsa7TIg== + +"@swc/core-linux-x64-musl@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.25.tgz#f944ee48c972ebdcb3e6d6fd62d67eb98dbb1268" + integrity sha512-QzHU3BIaUVRSFNsUn3Qxx1vgtF/f5NqsFMAAPSq9Y8Yq5nrlc2t7cNuOROxHLbUqE+NPUp6+RglleJMoeWz5mA== + +"@swc/core-win32-arm64-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.25.tgz#af63ae850ef6e7322e8a5a0959529e96096239d2" + integrity sha512-77VSVtneVOAUL4zkRyQZ6pWVpTsVVdqwly/DKnRnloglGKxYuk5DG5MUBsL72Nnfv4OCHjZ27eI3NUrpLsUb2Q== + +"@swc/core-win32-ia32-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.25.tgz#96a869aa4b4c41c44c9c9893ac4aad68d1233022" + integrity sha512-kz0v3K3H6OPEZR3ry72Ad/6C5GrZBRRUk69K58LORQ8tZXQD3UGl85pUbQqyHl8fR5NU76Muxgovj9CI9iTHGA== + +"@swc/core-win32-x64-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.25.tgz#9035c11626653322a404f3f44af11a02d989094c" + integrity sha512-nmQOAzIpNRRnupWzkenJmW4i+h1M76cVNUqEU2MjmtesEkRZEGqv//jefXiyCP2zcbeLNLKiB2ptVJhpd1BvRA== + +"@swc/core@^1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.25.tgz#53786ea51fac319684d6822de1738eb55b73a4b7" + integrity sha512-wqzvM/wu6OsTVYPMStOpm7kIQcPX3GoZ0sC85qzDdsCxmJ1rmItLAD91sXPUmmdk0XqPYjLgT9MRDEIP5woz4g== + optionalDependencies: + "@swc/core-darwin-arm64" "1.3.25" + "@swc/core-darwin-x64" "1.3.25" + "@swc/core-linux-arm-gnueabihf" "1.3.25" + "@swc/core-linux-arm64-gnu" "1.3.25" + "@swc/core-linux-arm64-musl" "1.3.25" + "@swc/core-linux-x64-gnu" "1.3.25" + "@swc/core-linux-x64-musl" "1.3.25" + "@swc/core-win32-arm64-msvc" "1.3.25" + "@swc/core-win32-ia32-msvc" "1.3.25" + "@swc/core-win32-x64-msvc" "1.3.25" + +"@swc/jest@^0.2.24": + version "0.2.24" + resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.24.tgz#35d9377ede049613cd5fdd6c24af2b8dcf622875" + integrity sha512-fwgxQbM1wXzyKzl1+IW0aGrRvAA8k0Y3NxFhKigbPjOJ4mCKnWEcNX9HQS3gshflcxq8YKhadabGUVfdwjCr6Q== + dependencies: + "@jest/create-cache-key-function" "^27.4.2" + jsonc-parser "^3.2.0" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -1096,6 +1183,15 @@ dependencies: "@types/koa" "*" +"@types/koa-pino-logger@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/koa-pino-logger/-/koa-pino-logger-3.0.0.tgz#275d4b000abc14b1928dc2e9ab476c8296a64b6a" + integrity sha512-sP+12JNX01q+nHpCRqkVIuLjaRemQEfDoFg0evpTnjUEI3jUI2ZrOkhQ5coxn3yVm2tedui/2YhlaPn/XrYNWA== + dependencies: + "@types/koa" "*" + "@types/pino" "*" + "@types/pino-http" "*" + "@types/koa@*", "@types/koa@2.13.4": version "2.13.4" resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.4.tgz#10620b3f24a8027ef5cbae88b393d1b31205726b" @@ -1143,6 +1239,44 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.20.tgz#268f028b36eaf51181c3300252f605488c4f0650" integrity sha512-Q8KKwm9YqEmUBRsqJ2GWJDtXltBDxTdC4m5vTdXBolu2PeQh8LX+f6BTwU+OuXPu37fLxoN6gidqBmnky36FXA== +"@types/pino-http@*", "@types/pino-http@5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@types/pino-http/-/pino-http-5.8.1.tgz#ebb194750ad2f9245c3028b5d2c4e6d64f685ba9" + integrity sha512-A9MW6VCnx5ii7s+Fs5aFIw+aSZcBCpsZ/atpxamu8tTsvWFacxSf2Hrn1Ohn1jkVRB/LiPGOapRXcFawDBnDnA== + dependencies: + "@types/pino" "6.3" + +"@types/pino-pretty@*": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@types/pino-pretty/-/pino-pretty-5.0.0.tgz#aa7a61cfd553b051764acfa0a49872f7a09a1722" + integrity sha512-N1uzqSzioqz8R3AkDbSJwcfDWeI3YMPNapSQQhnB2ISU4NYgUIcAh+hYT5ygqBM+klX4htpEhXMmoJv3J7GrdA== + dependencies: + pino-pretty "*" + +"@types/pino-std-serializers@*": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/pino-std-serializers/-/pino-std-serializers-4.0.0.tgz#1e28b80b554c8222858e99a4e0fc77fd070e10e8" + integrity sha512-gXfUZx2xIBbFYozGms53fT0nvkacx/+62c8iTxrEqH5PkIGAQvDbXg2774VWOycMPbqn5YJBQ3BMsg4Li3dWbg== + dependencies: + pino-std-serializers "*" + +"@types/pino@*": + version "7.0.5" + resolved "https://registry.yarnpkg.com/@types/pino/-/pino-7.0.5.tgz#1c84a81b924a6a9e263dbb581dffdbad7a3c60c4" + integrity sha512-wKoab31pknvILkxAF8ss+v9iNyhw5Iu/0jLtRkUD74cNfOOLJNnqfFKAv0r7wVaTQxRZtWrMpGfShwwBjOcgcg== + dependencies: + pino "*" + +"@types/pino@6.3": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@types/pino/-/pino-6.3.12.tgz#4425db6ced806109c3df957100cba9dfcd73c228" + integrity sha512-dsLRTq8/4UtVSpJgl9aeqHvbh6pzdmjYD3C092SYgLD2TyoCqHpTJk6vp8DvCTGGc7iowZ2MoiYiVUUCcu7muw== + dependencies: + "@types/node" "*" + "@types/pino-pretty" "*" + "@types/pino-std-serializers" "*" + sonic-boom "^2.1.0" + "@types/pouchdb-adapter-cordova-sqlite@*": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-cordova-sqlite/-/pouchdb-adapter-cordova-sqlite-1.0.1.tgz#49e5ee6df7cc0c23196fcb340f43a560e74eb1d6" @@ -1367,6 +1501,13 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== +"@types/yargs@^16.0.0": + version "16.0.5" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.5.tgz#12cc86393985735a283e387936398c2f9e5f88e3" + integrity sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ== + dependencies: + "@types/yargs-parser" "*" + "@types/yargs@^17.0.8": version "17.0.13" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.13.tgz#34cced675ca1b1d51fcf4d34c3c6f0fa142a5c76" @@ -1379,7 +1520,7 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abort-controller@3.0.0: +abort-controller@3.0.0, abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== @@ -1543,6 +1684,11 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + aws-cloudfront-sign@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/aws-cloudfront-sign/-/aws-cloudfront-sign-2.2.0.tgz#3910f5a6d0d90fec07f2b4ef8ab07f3eefb5625d" @@ -1735,6 +1881,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -1809,6 +1962,14 @@ buffer@^5.5.0, buffer@^5.6.0: base64-js "^1.3.1" ieee754 "^1.1.13" +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + bull@4.10.1: version "4.10.1" resolved "https://registry.yarnpkg.com/bull/-/bull-4.10.1.tgz#f14974b6089358b62b495a2cbf838aadc098e43f" @@ -1900,10 +2061,10 @@ chalk@^4.0.0, chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chance@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chance/-/chance-1.1.3.tgz#414f08634ee479c7a316b569050ea20751b82dd3" - integrity sha512-XeJsdoVAzDb1WRPRuMBesRSiWpW1uNTo5Fd7mYxPJsAfgX71+jfuCOHOdbyBz2uAUZ8TwKcXgWk3DMedFfJkbg== +chance@1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/chance/-/chance-1.1.8.tgz#5d6c2b78c9170bf6eb9df7acdda04363085be909" + integrity sha512-v7fi5Hj2VbR6dJEGRWLmJBA83LJMS47pkAbmROFxHWd9qmE1esHRZW8Clf1Fhzr3rjxnNZVCjOEv/ivFxeIMtg== char-regex@^1.0.2: version "1.0.2" @@ -2025,6 +2186,11 @@ color-support@^1.1.2: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== +colorette@^2.0.7: + version "2.0.19" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" + integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== + combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -2096,6 +2262,13 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== +correlation-id@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/correlation-id/-/correlation-id-4.0.0.tgz#c1d3038e5f30d7bfeae5728ff96f27a7506bc2c0" + integrity sha512-WvXtJBlovvOBKqTz/YwWP2gm6CXJZJArfGimp9s/ehmhJMPFbmnPMQe3K60Q9idGNixMvKojMjleyDhZEFdHfg== + dependencies: + uuid "^8.3.1" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -2134,6 +2307,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +dateformat@^4.6.3: + version "4.6.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" + integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA== + debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -2400,6 +2578,11 @@ events@1.1.1: resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" integrity sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw== +events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + execa@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" @@ -2446,6 +2629,11 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== +fast-copy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.0.tgz#875ebf33b13948ae012b6e51d33da5e6e7571ab8" + integrity sha512-4HzS+9pQ5Yxtv13Lhs1Z1unMXamBdn5nA4bEi1abYpDNSpSp7ODYQ1KPMF6nTatfEzgH6/zPvXKU1zvHiUjWlA== + fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2456,6 +2644,16 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-redact@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.1.2.tgz#d58e69e9084ce9fa4c1a6fa98a3e1ecf5d7839aa" + integrity sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw== + +fast-safe-stringify@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -2674,6 +2872,17 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.0.0: + version "8.0.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" + integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + global-dirs@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686" @@ -2760,6 +2969,14 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +help-me@^4.0.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/help-me/-/help-me-4.2.0.tgz#50712bfd799ff1854ae1d312c36eafcea85b0563" + integrity sha512-TAOnTB8Tz5Dw8penUuzHVrKNKlCIbwwbHnXraNJxPwf8LRtE2HlM84RYuezMFcwOJmoYOCWVDyJ8TQGxn9PgxA== + dependencies: + glob "^8.0.0" + readable-stream "^3.6.0" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -2823,7 +3040,7 @@ ieee754@1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== -ieee754@^1.1.13, ieee754@^1.1.4: +ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -3502,6 +3719,11 @@ join-component@^1.1.0: resolved "https://registry.yarnpkg.com/join-component/-/join-component-1.1.0.tgz#b8417b750661a392bee2c2537c68b2a9d4977cd5" integrity sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ== +joycon@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" + integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -3555,6 +3777,11 @@ json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + jsonwebtoken@9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" @@ -3995,6 +4222,13 @@ minimatch@^3.0.4, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff" + integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.0: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" @@ -4226,6 +4460,11 @@ object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +on-exit-leak-free@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/on-exit-leak-free/-/on-exit-leak-free-2.1.0.tgz#5c703c968f7e7f851885f6459bf8a8a57edc9cc4" + integrity sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w== + on-finished@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" @@ -4445,6 +4684,56 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +pino-abstract-transport@^1.0.0, pino-abstract-transport@v1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-1.0.0.tgz#cc0d6955fffcadb91b7b49ef220a6cc111d48bb3" + integrity sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA== + dependencies: + readable-stream "^4.0.0" + split2 "^4.0.0" + +pino-pretty@*: + version "9.1.1" + resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-9.1.1.tgz#e7d64c1db98266ca428ab56567b844ba780cd0e1" + integrity sha512-iJrnjgR4FWQIXZkUF48oNgoRI9BpyMhaEmihonHeCnZ6F50ZHAS4YGfGBT/ZVNsPmd+hzkIPGzjKdY08+/yAXw== + dependencies: + colorette "^2.0.7" + dateformat "^4.6.3" + fast-copy "^3.0.0" + fast-safe-stringify "^2.1.1" + help-me "^4.0.1" + joycon "^3.1.1" + minimist "^1.2.6" + on-exit-leak-free "^2.1.0" + pino-abstract-transport "^1.0.0" + pump "^3.0.0" + readable-stream "^4.0.0" + secure-json-parse "^2.4.0" + sonic-boom "^3.0.0" + strip-json-comments "^3.1.1" + +pino-std-serializers@*, pino-std-serializers@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-6.1.0.tgz#307490fd426eefc95e06067e85d8558603e8e844" + integrity sha512-KO0m2f1HkrPe9S0ldjx7za9BJjeHqBku5Ch8JyxETxT8dEFGz1PwgrHaOQupVYitpzbFSYm7nnljxD8dik2c+g== + +pino@*: + version "8.8.0" + resolved "https://registry.yarnpkg.com/pino/-/pino-8.8.0.tgz#1f0d6695a224aa06afc7ad60f2ccc4772d3b9233" + integrity sha512-cF8iGYeu2ODg2gIwgAHcPrtR63ILJz3f7gkogaHC/TXVVXxZgInmNYiIpDYEwgEkxZti2Se6P2W2DxlBIZe6eQ== + dependencies: + atomic-sleep "^1.0.0" + fast-redact "^3.1.1" + on-exit-leak-free "^2.1.0" + pino-abstract-transport v1.0.0 + pino-std-serializers "^6.0.0" + process-warning "^2.0.0" + quick-format-unescaped "^4.0.3" + real-require "^0.2.0" + safe-stable-stringify "^2.3.1" + sonic-boom "^3.1.0" + thread-stream "^2.0.0" + pirates@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" @@ -4707,6 +4996,16 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== +process-warning@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-2.1.0.tgz#1e60e3bfe8183033bbc1e702c2da74f099422d1a" + integrity sha512-9C20RLxrZU/rFnxWncDkuF6O999NdIf3E1ws4B0ZeY3sRVPzWBMsYDE2lxjxhiXxg464cQTgKUGm8/i6y2YGXg== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -4782,6 +5081,11 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== +quick-format-unescaped@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" + integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== + range-parser@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" @@ -4826,6 +5130,16 @@ readable-stream@1.1.14, readable-stream@^1.0.27-1: string_decoder "^1.1.1" util-deprecate "^1.0.1" +readable-stream@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.3.0.tgz#0914d0c72db03b316c9733bb3461d64a3cc50cba" + integrity sha512-MuEnA0lbSi7JS8XM+WNJlWZkHAAdm7gETHdFK//Q/mChGyj2akEFtdLZh32jSdkWGbRwCW9pn6g3LWDdDeZnBQ== + dependencies: + abort-controller "^3.0.0" + buffer "^6.0.3" + events "^3.3.0" + process "^0.11.10" + readable-stream@~0.0.2: version "0.0.4" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-0.0.4.tgz#f32d76e3fb863344a548d79923007173665b3b8d" @@ -4856,6 +5170,11 @@ readline-sync@^1.4.9: resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== +real-require@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.2.0.tgz#209632dea1810be2ae063a6ac084fee7e33fba78" + integrity sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg== + redis-commands@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.7.0.tgz#15a6fea2d58281e27b1cd1acfb4b293e278c3a89" @@ -4990,6 +5309,11 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-stable-stringify@^2.3.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.2.tgz#ec7b037768098bf65310d1d64370de0dc02353aa" + integrity sha512-gMxvPJYhP0O9n2pvcfYfIuYgbledAOJFcqRThtPRmjscaipiwcwPPKLytpVzMkG2HAN87Qmo2d4PtGiri1dSLA== + safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -5010,6 +5334,11 @@ sax@>=0.1.1, sax@>=0.6.0: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +secure-json-parse@^2.4.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862" + integrity sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw== + semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" @@ -5092,6 +5421,20 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +sonic-boom@^2.1.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-2.8.0.tgz#c1def62a77425090e6ad7516aad8eb402e047611" + integrity sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg== + dependencies: + atomic-sleep "^1.0.0" + +sonic-boom@^3.0.0, sonic-boom@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-3.2.1.tgz#972ceab831b5840a08a002fa95a672008bda1c38" + integrity sha512-iITeTHxy3B9FGu8aVdiDXUVAcHMF9Ss0cCsAOo2HfCrmVGT3/DT5oYaeu0M/YKZDlKTvChEyPq0zI9Hf33EX6A== + dependencies: + atomic-sleep "^1.0.0" + source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -5122,6 +5465,11 @@ split2@^2.1.0: dependencies: through2 "^2.0.2" +split2@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.1.0.tgz#101907a24370f85bb782f08adaabe4e281ecf809" + integrity sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ== + sprintf-js@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" @@ -5331,6 +5679,13 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" +thread-stream@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-2.2.0.tgz#310c03a253f729094ce5d4638ef5186dfa80a9e8" + integrity sha512-rUkv4/fnb4rqy/gGy7VuqK6wE1+1DOCOWy4RMeaV69ZHMP11tQKZvZSip1yTgrKCMZzEMcCL/bKfHvSfDHx+iQ== + dependencies: + real-require "^0.2.0" + through2@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" @@ -5624,7 +5979,7 @@ uuid@8.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.1.0.tgz#6f1536eb43249f473abc6bd58ff983da1ca30d8d" integrity sha512-CI18flHDznR0lq54xBycOVmphdCYnQLKn8abKn7PXUiKUGdEd+/l9LWNJmugXel4hXq7S+RMNl34ecyC9TntWg== -uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.2: +uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.1, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 51971b4137..f19a82ac27 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", - "@budibase/string-templates": "2.2.10-alpha.12", + "@budibase/string-templates": "2.2.12-alpha.18", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/avatar": "3.0.2", diff --git a/packages/bbui/yarn.lock b/packages/bbui/yarn.lock index e2baab55e6..72e36a6474 100644 --- a/packages/bbui/yarn.lock +++ b/packages/bbui/yarn.lock @@ -1549,9 +1549,9 @@ json-parse-even-better-errors@^2.3.0: integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" @@ -1662,16 +1662,11 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.0: +minimist@^1.2.0, minimist@^1.2.5: version "1.2.7" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== -minimist@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" diff --git a/packages/builder/cypress/integration/adminAndManagement/accountPortals.spec.js b/packages/builder/cypress/integration/adminAndManagement/accountPortals.spec.js index 7c69a5462e..d9eb5a9f25 100644 --- a/packages/builder/cypress/integration/adminAndManagement/accountPortals.spec.js +++ b/packages/builder/cypress/integration/adminAndManagement/accountPortals.spec.js @@ -2,7 +2,7 @@ import filterTests from "../../support/filterTests" const interact = require('../../support/interact') filterTests(["smoke", "all"], () => { - context("Account Portals", () => { + xcontext("Account Portals", () => { const bbUserEmail = "bbuser@test.com" @@ -44,7 +44,7 @@ filterTests(["smoke", "all"], () => { //cy.logoutNoAppGrid() }) - it("should verify Standard Portal", () => { + xit("should verify Standard Portal", () => { // Development access should be disabled (Admin access is already disabled) cy.login() cy.setUserRole("bbuser", "App User") diff --git a/packages/builder/cypress/integration/appPublishWorkflow.spec.js b/packages/builder/cypress/integration/appPublishWorkflow.spec.js index ab799f40fe..3376db0b2d 100644 --- a/packages/builder/cypress/integration/appPublishWorkflow.spec.js +++ b/packages/builder/cypress/integration/appPublishWorkflow.spec.js @@ -3,100 +3,101 @@ import { APP_TABLE_APP_NAME, DEPLOY_SUCCESS_MODAL } from "../support/interact"; const interact = require('../support/interact') filterTests(['all'], () => { - context("Publish Application Workflow", () => { + xcontext("Publish Application Workflow", () => { before(() => { cy.login() cy.deleteAllApps() cy.createApp("Cypress Tests", false) }) - it("Should reflect the unpublished status correctly", () => { + xit("Should reflect the unpublished status correctly", () => { cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) cy.get(interact.APP_TABLE_STATUS, { timeout: 3000 }).eq(0) - .within(() => { - cy.contains("Unpublished") - cy.get(interact.GLOBESTRIKE).should("exist") - }) + .within(() => { + cy.contains("Unpublished") + cy.get(interact.GLOBESTRIKE).should("exist") + }) cy.get(interact.APP_TABLE_ROW_ACTION).eq(0) - .within(() => { - cy.get(interact.SPECTRUM_BUTTON_TEMPLATE).contains("Edit").click({ force: true }) - }) + .within(() => { + cy.get(interact.SPECTRUM_BUTTON_TEMPLATE).contains("Edit").click({ force: true }) + }) cy.get(interact.DEPLOYMENT_TOP_NAV_GLOBESTRIKE).should("exist") cy.get(interact.DEPLOYMENT_TOP_GLOBE).should("not.exist") }) - it("Should publish an application and correctly reflect that", () => { + xit("Should publish an application and correctly reflect that", () => { //Assuming the previous test was run and the unpublished app is open in edit mode. - cy.get(interact.TOPRIGHTNAV_BUTTON_SPECTRUM).contains("Publish").click({ force : true }) + cy.get(interact.TOPRIGHTNAV_BUTTON_SPECTRUM).contains("Publish").click({ force: true }) cy.get(interact.DEPLOY_APP_MODAL).should("be.visible") - .within(() => { - cy.get(interact.SPECTRUM_BUTTON).contains("Publish").click({ force : true }) - }); + .within(() => { + cy.get(interact.SPECTRUM_BUTTON).contains("Publish").click({ force: true }) + }); //Verify that the app url is presented correctly to the user cy.get(interact.DEPLOY_SUCCESS_MODAL, { timeout: 1000 }) - .should("be.visible") - .within(() => { - let appUrl = Cypress.config().baseUrl + '/app/cypress-tests' - cy.get(interact.DEPLOY_APP_URL_INPUT).should('have.value', appUrl) - cy.get(interact.SPECTRUM_BUTTON).contains("Done").click({ force: true }) - }) + .should("be.visible") + .within(() => { + let appUrl = Cypress.config().baseUrl + '/app/cypress-tests' + cy.get(interact.DEPLOY_APP_URL_INPUT).should('have.value', appUrl) + cy.get(interact.SPECTRUM_BUTTON).contains("Done").click({ force: true }) + }) cy.visit(`${Cypress.config().baseUrl}/builder`) cy.get(interact.APP_TABLE_STATUS, { timeout: 3000 }).eq(0) - .within(() => { - cy.contains("Published") - cy.get(interact.GLOBE).should("exist") - }) + .within(() => { + cy.contains("Published") + cy.get(interact.GLOBE).should("exist") + }) cy.get(interact.APP_TABLE_ROW_ACTION).eq(0) - .within(() => { - cy.get(interact.SPECTRUM_BUTTON).contains("Manage") - cy.get(interact.SPECTRUM_BUTTON).contains("Edit").click({ force: true }) - }) + .within(() => { + cy.get(interact.SPECTRUM_BUTTON).contains("Manage") + cy.get(interact.SPECTRUM_BUTTON).contains("Edit").click({ force: true }) + }) cy.get(interact.DEPLOYMENT_TOP_GLOBE).should("exist").click({ force: true }) cy.get(interact.PUBLISH_POPOVER_MENU).should("be.visible") - .within(() => { - cy.get(interact.PUBLISH_POPOVER_ACTION).should("exist") - cy.get("button").contains("View app").should("exist") - cy.get(interact.PUBLISH_POPOVER_MESSAGE).should("have.text", "Last published a few seconds ago") - }) + .within(() => { + cy.get(interact.PUBLISH_POPOVER_ACTION).should("exist") + cy.get("button").contains("View app").should("exist") + cy.get(interact.PUBLISH_POPOVER_MESSAGE).should("have.text", "Last published a few seconds ago") + }) }) - it("Should unpublish an application using the link and reflect the status change", () => { + xit("Should unpublish an application using the link and reflect the status change", () => { //Assuming the previous test app exists and is published cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) cy.get(interact.APP_TABLE_STATUS).eq(0) - .within(() => { - cy.contains("Published") - cy.get("svg[aria-label='Globe']").should("exist") - }) + .within(() => { + cy.contains("Published") + cy.get("svg[aria-label='Globe']").should("exist") + }) cy.get(interact.APP_TABLE).eq(0) - .within(() => { - cy.get(interact.APP_TABLE_APP_NAME).click({ force: true }) - }) - + .within(() => { + cy.get(interact.APP_TABLE_APP_NAME).click({ force: true }) + }) + cy.get(interact.DEPLOYMENT_TOP_GLOBE).should("exist").click({ force: true }) - + cy.get("[data-cy='publish-popover-menu']") - .within(() => { - cy.get(interact.PUBLISH_POPOVER_ACTION).click({ force: true }) - }) + .within(() => { + cy.get(interact.PUBLISH_POPOVER_ACTION).click({ force: true }) + }) cy.get(interact.UNPUBLISH_MODAL).should("be.visible") - .within(() => { - cy.get(interact.CONFIRM_WRAP_BUTTON).click({ force: true } - )}) + .within(() => { + cy.get(interact.CONFIRM_WRAP_BUTTON).click({ force: true } + ) + }) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 6000 }) cy.wait(500) diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index 69d3a107a5..c1494b6756 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -2,7 +2,7 @@ import filterTests from "../support/filterTests" const interact = require('../support/interact') filterTests(['smoke', 'all'], () => { - context("Create a View", () => { + xcontext("Create a View", () => { before(() => { cy.login() cy.createTestApp() @@ -20,7 +20,7 @@ filterTests(['smoke', 'all'], () => { cy.addRow(["Teachers", 36, 3]) }) - it("creates a view", () => { + xit("creates a view", () => { cy.contains("Create view").click() cy.get(interact.MODAL_INNER_WRAPPER).within(() => { cy.get("input").type("Test View") @@ -38,7 +38,7 @@ filterTests(['smoke', 'all'], () => { }) }) - it("filters the view by age over 10", () => { + xit("filters the view by age over 10", () => { cy.contains("Filter").click() cy.contains("Add Filter").click() @@ -58,7 +58,7 @@ filterTests(['smoke', 'all'], () => { }) }) - it("creates a stats calculation view based on age", () => { + xit("creates a stats calculation view based on age", () => { cy.wait(1000) cy.contains("Calculate").click() cy.get(interact.MODAL_INNER_WRAPPER).within(() => { @@ -95,7 +95,7 @@ filterTests(['smoke', 'all'], () => { }) }) - it("groups the view by group", () => { + xit("groups the view by group", () => { cy.contains("Group by").click() cy.get(interact.MODAL_INNER_WRAPPER).within(() => { cy.get(interact.SPECTRUM_PICKER_LABEL).eq(0).click() @@ -127,7 +127,7 @@ filterTests(['smoke', 'all'], () => { }) }) - it("renames a view", () => { + xit("renames a view", () => { cy.contains(interact.NAV_ITEM, "Test View") .find(".actions .icon.open-popover") .click({ force: true }) diff --git a/packages/builder/cypress/integration/queryLevelTransformers.spec.js b/packages/builder/cypress/integration/queryLevelTransformers.spec.js index 00cae6f417..7357bbe905 100644 --- a/packages/builder/cypress/integration/queryLevelTransformers.spec.js +++ b/packages/builder/cypress/integration/queryLevelTransformers.spec.js @@ -13,9 +13,9 @@ filterTests(["smoke", "all"], () => { const datasource = "REST" const restUrl = "https://api.openbrewerydb.org/breweries" cy.selectExternalDatasource(datasource) - cy.createRestQuery("GET", restUrl, "/breweries") + cy.createRestQuery("GET", restUrl, "breweries") cy.reload() - cy.contains(".nav-item-content", "/breweries", { timeout: 20000 }).click() + cy.contains(".nav-item-content", "breweries", { timeout: 20000 }).click() cy.contains(interact.SPECTRUM_TABS_ITEM, "Transformer", { timeout: 5000 }).click({ force: true }) // Get Transformer Function from file cy.readFile("cypress/support/queryLevelTransformerFunction.js").then( @@ -44,9 +44,9 @@ filterTests(["smoke", "all"], () => { const datasource = "REST" const restUrl = "https://api.openbrewerydb.org/breweries" cy.selectExternalDatasource(datasource) - cy.createRestQuery("GET", restUrl, "/breweries") + cy.createRestQuery("GET", restUrl, "breweries") cy.reload() - cy.contains(".nav-item-content", "/breweries", { timeout: 2000 }).click() + cy.contains(".nav-item-content", "breweries", { timeout: 2000 }).click() cy.contains(interact.SPECTRUM_TABS_ITEM, "Transformer", { timeout: 5000 }).click({ force: true }) // Get Transformer Function with Data from file cy.readFile( @@ -75,9 +75,9 @@ filterTests(["smoke", "all"], () => { const datasource = "REST" const restUrl = "https://api.openbrewerydb.org/breweries" cy.selectExternalDatasource(datasource) - cy.createRestQuery("GET", restUrl, "/breweries") + cy.createRestQuery("GET", restUrl, "breweries") cy.reload() - cy.contains(".nav-item-content", "/breweries", { timeout: 2000 }).click() + cy.contains(".nav-item-content", "breweries", { timeout: 10000 }).click() cy.contains(interact.SPECTRUM_TABS_ITEM, "Transformer", { timeout: 5000 }).click({ force: true }) // Clear the code box and add "test" cy.get(interact.CODEMIRROR_TEXTAREA) diff --git a/packages/builder/package.json b/packages/builder/package.json index 31a8d68ee7..62518f976a 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.2.10-alpha.12", - "@budibase/client": "2.2.10-alpha.12", - "@budibase/frontend-core": "2.2.10-alpha.12", - "@budibase/string-templates": "2.2.10-alpha.12", + "@budibase/bbui": "2.2.12-alpha.18", + "@budibase/client": "2.2.12-alpha.18", + "@budibase/frontend-core": "2.2.12-alpha.18", + "@budibase/string-templates": "2.2.12-alpha.18", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 4defcbafab..ec39cc6d71 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -340,9 +340,7 @@ {:else if isManyToOne && toTable} s.key)} on:change={({ detail }) => { @@ -178,6 +183,7 @@ {#if index === query.fields.steps.length - 1} { query.fields.steps = [ ...query.fields.steps, diff --git a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte index 9e88cdacb8..fe3b9056e9 100644 --- a/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/plugins/_components/AddPluginModal.svelte @@ -26,7 +26,7 @@ [PluginSource.FILE]: [opt("File Upload")], } let file - let source = PluginSource.URL + let source = PluginSource.GITHUB let dynamicValues = {} let validation diff --git a/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte b/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte index 71a86f2fca..082dda43be 100644 --- a/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte +++ b/packages/builder/src/pages/builder/portal/overview/_components/AccessTab.svelte @@ -68,7 +68,8 @@ async function updateUserRole(role, user) { user.roles[fixedAppId] = role - await users.save(user) + const response = await users.save(user) + user._rev = response._rev } async function updateGroupRole(role, group) { diff --git a/packages/builder/yarn.lock b/packages/builder/yarn.lock index 21ad9bcb8b..db5e9dd62f 100644 --- a/packages/builder/yarn.lock +++ b/packages/builder/yarn.lock @@ -4279,17 +4279,10 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - -json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +json5@^2.1.2, json5@^2.2.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== jsonfile@^4.0.0: version "4.0.0" @@ -4320,7 +4313,7 @@ jsprim@^2.0.2: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== dependencies: is-buffer "^1.1.5" diff --git a/packages/cli/package.json b/packages/cli/package.json index e286661937..0da2389ae2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.2.10-alpha.12", - "@budibase/string-templates": "2.2.10-alpha.12", - "@budibase/types": "2.2.10-alpha.12", + "@budibase/backend-core": "2.2.12-alpha.18", + "@budibase/string-templates": "2.2.12-alpha.18", + "@budibase/types": "2.2.12-alpha.18", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 3138295484..206dc3059c 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "2.2.10-alpha.12", - "@budibase/frontend-core": "2.2.10-alpha.12", - "@budibase/string-templates": "2.2.10-alpha.12", + "@budibase/bbui": "2.2.12-alpha.18", + "@budibase/frontend-core": "2.2.12-alpha.18", + "@budibase/string-templates": "2.2.12-alpha.18", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/client/src/components/overlay/PeekScreenDisplay.svelte b/packages/client/src/components/overlay/PeekScreenDisplay.svelte index b9f4914624..6e0fa81b43 100644 --- a/packages/client/src/components/overlay/PeekScreenDisplay.svelte +++ b/packages/client/src/components/overlay/PeekScreenDisplay.svelte @@ -61,7 +61,7 @@ if (messageHandler) { messageHandler(message) } else { - console.warning("Unknown event type", message?.data?.type) + console.warn("Unknown event type", message?.data?.type) } } diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index aebda2efd0..68d29299a8 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -788,9 +788,9 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index a90bed84e2..9d63efbd26 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.2.10-alpha.12", + "@budibase/bbui": "2.2.12-alpha.18", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 091a92e61f..e69c37d2be 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/jest.config.ts b/packages/server/jest.config.ts index 5aa2899058..e9337001a4 100644 --- a/packages/server/jest.config.ts +++ b/packages/server/jest.config.ts @@ -2,15 +2,18 @@ import { Config } from "@jest/types" import * as fs from "fs" const config: Config.InitialOptions = { - preset: "ts-jest", testEnvironment: "node", - setupFiles: ["./src/tests/jestSetup.ts"], + setupFiles: ["./src/tests/jestEnv.ts"], + setupFilesAfterEnv: ["./src/tests/jestSetup.ts"], collectCoverageFrom: [ "src/**/*.{js,ts}", // The use of coverage with couchdb view functions breaks tests "!src/db/views/staticViews.*", ], coverageReporters: ["lcov", "json", "clover"], + transform: { + "^.+\\.ts?$": "@swc/jest", + }, } if (!process.env.CI) { diff --git a/packages/server/package.json b/packages/server/package.json index bf73d22c8d..1d7fbcb87f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.2.10-alpha.12", - "@budibase/client": "2.2.10-alpha.12", - "@budibase/pro": "2.2.10-alpha.12", - "@budibase/string-templates": "2.2.10-alpha.12", - "@budibase/types": "2.2.10-alpha.12", + "@budibase/backend-core": "2.2.12-alpha.18", + "@budibase/client": "2.2.12-alpha.18", + "@budibase/pro": "2.2.12-alpha.18", + "@budibase/string-templates": "2.2.12-alpha.18", + "@budibase/types": "2.2.12-alpha.18", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", @@ -123,6 +123,8 @@ "@babel/preset-env": "7.16.11", "@budibase/standard-components": "^0.9.139", "@jest/test-sequencer": "24.9.0", + "@swc/core": "^1.3.25", + "@swc/jest": "^0.2.24", "@types/apidoc": "0.50.0", "@types/bson": "4.2.0", "@types/global-agent": "2.1.1", diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index eade7ddab6..0aaf8bb3dd 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -4,12 +4,12 @@ import { Thread, ThreadType } from "../../../threads" import { save as saveDatasource } from "../datasource" import { RestImporter } from "./import" import { invalidateDynamicVariables } from "../../../threads/utils" -import { QUERY_THREAD_TIMEOUT } from "../../../environment" +import env from "../../../environment" import { quotas } from "@budibase/pro" import { events, context, utils, constants } from "@budibase/backend-core" const Runner = new Thread(ThreadType.QUERY, { - timeoutMs: QUERY_THREAD_TIMEOUT || 10000, + timeoutMs: env.QUERY_THREAD_TIMEOUT || 10000, }) // simple function to append "readable" to all read queries diff --git a/packages/server/src/api/controllers/static/index.ts b/packages/server/src/api/controllers/static/index.ts index 1113a2a1be..1d2bdba32a 100644 --- a/packages/server/src/api/controllers/static/index.ts +++ b/packages/server/src/api/controllers/static/index.ts @@ -10,7 +10,7 @@ const { NODE_MODULES_PATH, TOP_LEVEL_PATH, } = require("../../../utilities/fileSystem") -const env = require("../../../environment") +import env from "../../../environment" const { DocumentType } = require("../../../db/utils") const { context, objectStore, utils } = require("@budibase/backend-core") const AWS = require("aws-sdk") diff --git a/packages/server/src/api/controllers/table/internal.ts b/packages/server/src/api/controllers/table/internal.ts index a70ba4dcba..3229134bf0 100644 --- a/packages/server/src/api/controllers/table/internal.ts +++ b/packages/server/src/api/controllers/table/internal.ts @@ -3,7 +3,7 @@ import { getRowParams, generateTableID } from "../../../db/utils" import { FieldTypes } from "../../../constants" import { TableSaveFunctions, hasTypeChanged, handleDataImport } from "./utils" import { context } from "@budibase/backend-core" -import { isTest } from "../../../environment" +import env from "../../../environment" import { cleanupAttachments, fixAutoColumnSubType, @@ -13,7 +13,6 @@ import { Table } from "@budibase/types" import { quotas } from "@budibase/pro" import { isEqual } from "lodash" import { cloneDeep } from "lodash/fp" -import env from "../../../environment" import sdk from "../../../sdk" function checkAutoColumns(table: Table, oldTable: Table) { @@ -164,7 +163,7 @@ export async function destroy(ctx: any) { await db.remove(tableToDelete._id, tableToDelete._rev) // remove table search index - if (!isTest() || env.COUCH_DB_URL) { + if (!env.isTest() || env.COUCH_DB_URL) { const currentIndexes = await db.getIndexes() const existingIndex = currentIndexes.indexes.find( (existing: any) => existing.name === `search:${ctx.params.tableId}` diff --git a/packages/server/src/api/controllers/view/tests/viewBuilder.spec.js b/packages/server/src/api/controllers/view/tests/viewBuilder.spec.js index 58fb68cfa7..303bb09cf6 100644 --- a/packages/server/src/api/controllers/view/tests/viewBuilder.spec.js +++ b/packages/server/src/api/controllers/view/tests/viewBuilder.spec.js @@ -1,4 +1,4 @@ -const viewTemplate = require("../viewBuilder"); +const viewTemplate = require("../viewBuilder").default; describe("viewBuilder", () => { diff --git a/packages/server/src/api/controllers/view/viewBuilder.ts b/packages/server/src/api/controllers/view/viewBuilder.ts index 3076e311b1..626d0502d1 100644 --- a/packages/server/src/api/controllers/view/viewBuilder.ts +++ b/packages/server/src/api/controllers/view/viewBuilder.ts @@ -136,7 +136,7 @@ function parseEmitExpression(field: string, groupBy: string) { * filters: Array of filter objects containing predicates that are parsed into a JS expression * calculation: an optional calculation to be performed over the view data. */ -export = function ({ +export default function ({ field, tableId, groupBy, diff --git a/packages/server/src/api/routes/analytics.ts b/packages/server/src/api/routes/analytics.ts index 87dcb73eab..31483c5016 100644 --- a/packages/server/src/api/routes/analytics.ts +++ b/packages/server/src/api/routes/analytics.ts @@ -6,4 +6,4 @@ const router: Router = new Router() router.get("/api/bbtel", controller.isEnabled) router.post("/api/bbtel/ping", controller.ping) -export = router +export default router diff --git a/packages/server/src/api/routes/apikeys.ts b/packages/server/src/api/routes/apikeys.ts index 3afa1a0950..0e4ebef4b9 100644 --- a/packages/server/src/api/routes/apikeys.ts +++ b/packages/server/src/api/routes/apikeys.ts @@ -9,4 +9,4 @@ router .get("/api/keys", authorized(permissions.BUILDER), controller.fetch) .put("/api/keys/:key", authorized(permissions.BUILDER), controller.update) -export = router +export default router diff --git a/packages/server/src/api/routes/application.ts b/packages/server/src/api/routes/application.ts index 26b014c52f..0aa88568f3 100644 --- a/packages/server/src/api/routes/application.ts +++ b/packages/server/src/api/routes/application.ts @@ -54,4 +54,4 @@ router controller.destroy ) -export = router +export default router diff --git a/packages/server/src/api/routes/auth.ts b/packages/server/src/api/routes/auth.ts index 3b2aaca79e..c4e65a4c25 100644 --- a/packages/server/src/api/routes/auth.ts +++ b/packages/server/src/api/routes/auth.ts @@ -5,4 +5,4 @@ const router: Router = new Router() router.get("/api/self", controller.fetchSelf) -export = router +export default router diff --git a/packages/server/src/api/routes/automation.ts b/packages/server/src/api/routes/automation.ts index 1beb8e7d76..dc0f171584 100644 --- a/packages/server/src/api/routes/automation.ts +++ b/packages/server/src/api/routes/automation.ts @@ -84,4 +84,4 @@ router controller.test ) -export = router +export default router diff --git a/packages/server/src/api/routes/backup.ts b/packages/server/src/api/routes/backup.ts index 63e9fee5b6..fb455250a7 100644 --- a/packages/server/src/api/routes/backup.ts +++ b/packages/server/src/api/routes/backup.ts @@ -11,4 +11,4 @@ router.get( controller.exportAppDump ) -export = router +export default router diff --git a/packages/server/src/api/routes/cloud.ts b/packages/server/src/api/routes/cloud.ts index acc6b9e9c9..308ee260c1 100644 --- a/packages/server/src/api/routes/cloud.ts +++ b/packages/server/src/api/routes/cloud.ts @@ -15,4 +15,4 @@ router .post("/api/cloud/import", controller.importApps) .get("/api/cloud/import/complete", controller.hasBeenImported) -export = router +export default router diff --git a/packages/server/src/api/routes/component.ts b/packages/server/src/api/routes/component.ts index 20b3e54c81..da02a2ed14 100644 --- a/packages/server/src/api/routes/component.ts +++ b/packages/server/src/api/routes/component.ts @@ -11,4 +11,4 @@ router.get( controller.fetchAppComponentDefinitions ) -export = router +export default router diff --git a/packages/server/src/api/routes/datasource.ts b/packages/server/src/api/routes/datasource.ts index c9de7f51fb..85929d2180 100644 --- a/packages/server/src/api/routes/datasource.ts +++ b/packages/server/src/api/routes/datasource.ts @@ -57,4 +57,4 @@ router datasourceController.destroy ) -export = router +export default router diff --git a/packages/server/src/api/routes/deploy.ts b/packages/server/src/api/routes/deploy.ts index 30d33f4c97..dcc6913a86 100644 --- a/packages/server/src/api/routes/deploy.ts +++ b/packages/server/src/api/routes/deploy.ts @@ -17,4 +17,4 @@ router controller.deploymentProgress ) -export = router +export default router diff --git a/packages/server/src/api/routes/dev.ts b/packages/server/src/api/routes/dev.ts index d61c56d5ee..78b79f9229 100644 --- a/packages/server/src/api/routes/dev.ts +++ b/packages/server/src/api/routes/dev.ts @@ -35,4 +35,4 @@ router controller.revert ) -export = router +export default router diff --git a/packages/server/src/api/routes/integration.ts b/packages/server/src/api/routes/integration.ts index b21915a6d1..96f9c4a030 100644 --- a/packages/server/src/api/routes/integration.ts +++ b/packages/server/src/api/routes/integration.ts @@ -13,4 +13,4 @@ router controller.find ) -export = router +export default router diff --git a/packages/server/src/api/routes/layout.ts b/packages/server/src/api/routes/layout.ts index cdfdb4002a..edcafd42de 100644 --- a/packages/server/src/api/routes/layout.ts +++ b/packages/server/src/api/routes/layout.ts @@ -13,4 +13,4 @@ router controller.destroy ) -export = router +export default router diff --git a/packages/server/src/api/routes/metadata.ts b/packages/server/src/api/routes/metadata.ts index e46e0eeb01..0c59cc597f 100644 --- a/packages/server/src/api/routes/metadata.ts +++ b/packages/server/src/api/routes/metadata.ts @@ -35,4 +35,4 @@ router controller.getMetadata ) -export = router +export default router diff --git a/packages/server/src/api/routes/migrations.ts b/packages/server/src/api/routes/migrations.ts index 689373cf75..f530647c78 100644 --- a/packages/server/src/api/routes/migrations.ts +++ b/packages/server/src/api/routes/migrations.ts @@ -11,4 +11,4 @@ router auth.internalApi, migrationsController.fetchDefinitions ) -export = router +export default router diff --git a/packages/server/src/api/routes/permission.ts b/packages/server/src/api/routes/permission.ts index 8a26deb9ba..7f82d34052 100644 --- a/packages/server/src/api/routes/permission.ts +++ b/packages/server/src/api/routes/permission.ts @@ -38,4 +38,4 @@ router controller.removePermission ) -export = router +export default router diff --git a/packages/server/src/api/routes/query.ts b/packages/server/src/api/routes/query.ts index 439e3a6ec8..e7fe5c5c9b 100644 --- a/packages/server/src/api/routes/query.ts +++ b/packages/server/src/api/routes/query.ts @@ -58,4 +58,4 @@ router queryController.executeV2 as any ) -export = router +export default router diff --git a/packages/server/src/api/routes/role.ts b/packages/server/src/api/routes/role.ts index 48933a505b..816105c710 100644 --- a/packages/server/src/api/routes/role.ts +++ b/packages/server/src/api/routes/role.ts @@ -21,4 +21,4 @@ router controller.destroy ) -export = router +export default router diff --git a/packages/server/src/api/routes/routing.ts b/packages/server/src/api/routes/routing.ts index 56f2b40192..e55f1b7cbe 100644 --- a/packages/server/src/api/routes/routing.ts +++ b/packages/server/src/api/routes/routing.ts @@ -11,4 +11,4 @@ router // gets the full structure, not just the correct screen ID for user role .get("/api/routing", authorized(permissions.BUILDER), controller.fetch) -export = router +export default router diff --git a/packages/server/src/api/routes/screen.ts b/packages/server/src/api/routes/screen.ts index c8bab17b31..7caa37bbfc 100644 --- a/packages/server/src/api/routes/screen.ts +++ b/packages/server/src/api/routes/screen.ts @@ -20,4 +20,4 @@ router controller.destroy ) -export = router +export default router diff --git a/packages/server/src/api/routes/script.ts b/packages/server/src/api/routes/script.ts index 271cbc51c6..3780142ab5 100644 --- a/packages/server/src/api/routes/script.ts +++ b/packages/server/src/api/routes/script.ts @@ -7,4 +7,4 @@ const router: Router = new Router() router.post("/api/script", authorized(permissions.BUILDER), controller.save) -export = router +export default router diff --git a/packages/server/src/api/routes/static.ts b/packages/server/src/api/routes/static.ts index 992575fb74..58b2da11da 100644 --- a/packages/server/src/api/routes/static.ts +++ b/packages/server/src/api/routes/static.ts @@ -3,7 +3,7 @@ import * as controller from "../controllers/static" import { budibaseTempDir } from "../../utilities/budibaseDir" import authorized from "../../middleware/authorized" import { permissions } from "@budibase/backend-core" -import * as env from "../../environment" +import env from "../../environment" import { paramResource } from "../../middleware/resourceId" const { BUILDER, PermissionType, PermissionLevel } = permissions @@ -62,4 +62,4 @@ router controller.getSignedUploadURL ) -export = router +export default router diff --git a/packages/server/src/api/routes/table.ts b/packages/server/src/api/routes/table.ts index 0b6d80cdaf..23b1f4e988 100644 --- a/packages/server/src/api/routes/table.ts +++ b/packages/server/src/api/routes/table.ts @@ -190,4 +190,4 @@ router tableController.bulkImport ) -export = router +export default router diff --git a/packages/server/src/api/routes/templates.ts b/packages/server/src/api/routes/templates.ts index a05e1f12ac..3072b2cf6f 100644 --- a/packages/server/src/api/routes/templates.ts +++ b/packages/server/src/api/routes/templates.ts @@ -13,4 +13,4 @@ router controller.downloadTemplate ) -export = router +export default router diff --git a/packages/server/src/api/routes/tests/analytics.spec.js b/packages/server/src/api/routes/tests/analytics.spec.js index 51196943e1..f8b3a6763f 100644 --- a/packages/server/src/api/routes/tests/analytics.spec.js +++ b/packages/server/src/api/routes/tests/analytics.spec.js @@ -1,5 +1,5 @@ const setup = require("./utilities") -const { events, constants, db } = require("@budibase/backend-core") +const { events, constants } = require("@budibase/backend-core") describe("/static", () => { let request = setup.getRequest() diff --git a/packages/server/src/api/routes/tests/plugin.spec.ts b/packages/server/src/api/routes/tests/plugin.spec.ts index 8e59a9392c..788d3cf349 100644 --- a/packages/server/src/api/routes/tests/plugin.spec.ts +++ b/packages/server/src/api/routes/tests/plugin.spec.ts @@ -1,8 +1,3 @@ -let mockObjectStore = jest.fn().mockImplementation(() => { - return [{ name: "test.js" }] -}) - -let deleteFolder = jest.fn().mockImplementation() jest.mock("@budibase/backend-core", () => { const core = jest.requireActual("@budibase/backend-core") return { @@ -10,15 +5,20 @@ jest.mock("@budibase/backend-core", () => { objectStore: { ...core.objectStore, upload: jest.fn(), - uploadDirectory: mockObjectStore, - deleteFolder: deleteFolder, + uploadDirectory: jest.fn().mockImplementation(() => { + return [{ name: "test.js" }] + }), + deleteFolder: jest.fn().mockImplementation(), }, } }) -import { events } from "@budibase/backend-core" +import { events, objectStore } from "@budibase/backend-core" import * as setup from "./utilities" +const mockUploadDirectory = objectStore.uploadDirectory as jest.Mock +const mockDeleteFolder = objectStore.deleteFolder as jest.Mock + describe("/plugins", () => { let request = setup.getRequest() let config = setup.getConfig() @@ -57,7 +57,7 @@ describe("/plugins", () => { }) it("should not be able to create a plugin if there is an error", async () => { - mockObjectStore.mockImplementationOnce(() => { + mockUploadDirectory.mockImplementationOnce(() => { throw new Error() }) let res = await createPlugin(400) @@ -92,7 +92,7 @@ describe("/plugins", () => { expect(events.plugin.deleted).toHaveBeenCalledTimes(1) }) it("should handle an error deleting a plugin", async () => { - deleteFolder.mockImplementationOnce(() => { + mockDeleteFolder.mockImplementationOnce(() => { throw new Error() }) diff --git a/packages/server/src/api/routes/tests/utilities/TestFunctions.ts b/packages/server/src/api/routes/tests/utilities/TestFunctions.ts index 3ac7dea5ac..1c7998332d 100644 --- a/packages/server/src/api/routes/tests/utilities/TestFunctions.ts +++ b/packages/server/src/api/routes/tests/utilities/TestFunctions.ts @@ -3,7 +3,7 @@ import * as appController from "../../../controllers/application" import { AppStatus } from "../../../../db/utils" import { roles, tenancy, context } from "@budibase/backend-core" import { TENANT_ID } from "../../../../tests/utilities/structures" -import * as env from "../../../../environment" +import env from "../../../../environment" class Request { appId: any diff --git a/packages/server/src/api/routes/user.ts b/packages/server/src/api/routes/user.ts index 60eaf5b1b9..14deb111e6 100644 --- a/packages/server/src/api/routes/user.ts +++ b/packages/server/src/api/routes/user.ts @@ -48,4 +48,4 @@ router controller.getFlags ) -export = router +export default router diff --git a/packages/server/src/api/routes/view.ts b/packages/server/src/api/routes/view.ts index 3705e74984..8b366993c0 100644 --- a/packages/server/src/api/routes/view.ts +++ b/packages/server/src/api/routes/view.ts @@ -31,4 +31,4 @@ router ) .post("/api/views", authorized(permissions.BUILDER), viewController.save) -export = router +export default router diff --git a/packages/server/src/api/routes/webhook.ts b/packages/server/src/api/routes/webhook.ts index 8067ecac7c..3aa9525ed5 100644 --- a/packages/server/src/api/routes/webhook.ts +++ b/packages/server/src/api/routes/webhook.ts @@ -24,4 +24,4 @@ router // this shouldn't have authorisation, right now its always public .post("/api/webhooks/trigger/:instance/:id", controller.trigger) -export = router +export default router diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 0fb78d7525..177393dee7 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -1,5 +1,5 @@ // need to load environment first -import * as env from "./environment" +import env from "./environment" // enable APM if configured if (process.env.ELASTIC_APM_ENABLED) { @@ -19,7 +19,7 @@ import * as api from "./api" import * as automations from "./automations" import { Thread } from "./threads" import * as redis from "./utilities/redis" -import { events, logging } from "@budibase/backend-core" +import { events, logging, middleware } from "@budibase/backend-core" import { initialise as initialiseWebsockets } from "./websocket" import { startup } from "./startup" const Sentry = require("@sentry/node") @@ -40,6 +40,8 @@ app.use( }) ) +app.use(middleware.logging) + if (env.isProd()) { env._set("NODE_ENV", "production") Sentry.init() @@ -77,7 +79,7 @@ server.on("close", async () => { } }) -export = server.listen(env.PORT || 0, async () => { +export default server.listen(env.PORT || 0, async () => { await startup(app, server) }) diff --git a/packages/server/src/automations/logging/index.ts b/packages/server/src/automations/logging/index.ts index 80779f0846..e3cc9d273c 100644 --- a/packages/server/src/automations/logging/index.ts +++ b/packages/server/src/automations/logging/index.ts @@ -1,4 +1,4 @@ -import * as env from "../../environment" +import env from "../../environment" import { AutomationResults, Automation, App } from "@budibase/types" import { automations } from "@budibase/pro" import { db as dbUtils } from "@budibase/backend-core" diff --git a/packages/server/src/db/index.ts b/packages/server/src/db/index.ts index 60ea2f9987..fa8027dcc1 100644 --- a/packages/server/src/db/index.ts +++ b/packages/server/src/db/index.ts @@ -1,5 +1,5 @@ import { init as coreInit } from "@budibase/backend-core" -import env = require("../environment") +import env from "../environment" export function init() { const dbConfig: any = { diff --git a/packages/server/src/db/linkedRows/LinkController.ts b/packages/server/src/db/linkedRows/LinkController.ts index 690abc1feb..765efb9c8f 100644 --- a/packages/server/src/db/linkedRows/LinkController.ts +++ b/packages/server/src/db/linkedRows/LinkController.ts @@ -441,4 +441,4 @@ class LinkController { } } -export = LinkController +export default LinkController diff --git a/packages/server/src/db/linkedRows/LinkDocument.ts b/packages/server/src/db/linkedRows/LinkDocument.ts index d90f08e78c..9035641d5f 100644 --- a/packages/server/src/db/linkedRows/LinkDocument.ts +++ b/packages/server/src/db/linkedRows/LinkDocument.ts @@ -57,4 +57,4 @@ class LinkDocumentImpl implements LinkDocument { } } -export = LinkDocumentImpl +export default LinkDocumentImpl diff --git a/packages/server/src/db/newid.ts b/packages/server/src/db/newid.ts index 14a8305e8d..0037bc0353 100644 --- a/packages/server/src/db/newid.ts +++ b/packages/server/src/db/newid.ts @@ -1,5 +1,5 @@ const { v4 } = require("uuid") -export = function (): string { +export default function (): string { return v4().replace(/-/g, "") } diff --git a/packages/server/src/db/tests/linkController.spec.js b/packages/server/src/db/tests/linkController.spec.js index 730ec3a8b3..919a104ad2 100644 --- a/packages/server/src/db/tests/linkController.spec.js +++ b/packages/server/src/db/tests/linkController.spec.js @@ -1,6 +1,6 @@ const TestConfig = require("../../tests/utilities/TestConfiguration") const { basicRow, basicLinkedRow, basicTable } = require("../../tests/utilities/structures") -const LinkController = require("../linkedRows/LinkController") +const LinkController = require("../linkedRows/LinkController").default const { context } = require("@budibase/backend-core") const { RelationshipTypes } = require("../../constants") const { cloneDeep } = require("lodash/fp") diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index e2b81d88bd..6272e0e462 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -125,4 +125,4 @@ for (let [key, value] of Object.entries(environment)) { } } -export = environment +export default environment diff --git a/packages/server/src/events/AutomationEmitter.ts b/packages/server/src/events/AutomationEmitter.ts index d5ebc041ff..9d476d5088 100644 --- a/packages/server/src/events/AutomationEmitter.ts +++ b/packages/server/src/events/AutomationEmitter.ts @@ -55,4 +55,4 @@ class AutomationEmitter { } } -export = AutomationEmitter +export default AutomationEmitter diff --git a/packages/server/src/events/BudibaseEmitter.ts b/packages/server/src/events/BudibaseEmitter.ts index 8eb7bffd96..43871d8754 100644 --- a/packages/server/src/events/BudibaseEmitter.ts +++ b/packages/server/src/events/BudibaseEmitter.ts @@ -26,4 +26,4 @@ class BudibaseEmitter extends EventEmitter { } } -export = BudibaseEmitter +export default BudibaseEmitter diff --git a/packages/server/src/events/index.ts b/packages/server/src/events/index.ts index 145d399f56..fad7bcaa9a 100644 --- a/packages/server/src/events/index.ts +++ b/packages/server/src/events/index.ts @@ -2,4 +2,4 @@ import BudibaseEmitter from "./BudibaseEmitter" const emitter = new BudibaseEmitter() -export = emitter +export default emitter diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index 283deedd70..e2dd69da24 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -17,8 +17,8 @@ import oracle from "./oracle" import { getPlugins } from "../api/controllers/plugin" import { SourceName, Integration, PluginType } from "@budibase/types" import { getDatasourcePlugin } from "../utilities/fileSystem" -const environment = require("../environment") -const { cloneDeep } = require("lodash") +import env from "../environment" +import { cloneDeep } from "lodash" const DEFINITIONS: { [key: string]: Integration } = { [SourceName.POSTGRES]: postgres.schema, @@ -69,7 +69,7 @@ if ( export async function getDefinitions() { const pluginSchemas: { [key: string]: Integration } = {} - if (environment.SELF_HOSTED) { + if (env.SELF_HOSTED) { const plugins = await getPlugins(PluginType.DATASOURCE) // extract the actual schema from each custom for (let plugin of plugins) { @@ -93,7 +93,7 @@ export async function getIntegration(integration: string) { if (INTEGRATIONS[integration]) { return INTEGRATIONS[integration] } - if (environment.SELF_HOSTED) { + if (env.SELF_HOSTED) { const plugins = await getPlugins(PluginType.DATASOURCE) for (let plugin of plugins) { if (plugin.name === integration) { diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index 136d84361a..1cd9a356b3 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -151,6 +151,9 @@ class MySQLIntegration extends Sql implements DatasourcePlus { ) { return field.string() } + if (field.type === "BIT" && field.length === 1) { + return field.buffer()?.[0] + } return next() }, } diff --git a/packages/server/src/integrations/tests/rest.spec.ts b/packages/server/src/integrations/tests/rest.spec.ts index d53f9c7ce3..d7bd2965fd 100644 --- a/packages/server/src/integrations/tests/rest.spec.ts +++ b/packages/server/src/integrations/tests/rest.spec.ts @@ -1,16 +1,18 @@ -const mockFetch = jest.fn(() => ({ - headers: { - raw: () => { - return { "content-type": ["application/json"] } +jest.mock("node-fetch", () => { + return jest.fn(() => ({ + headers: { + raw: () => { + return { "content-type": ["application/json"] } + }, + get: () => ["application/json"], }, - get: () => ["application/json"], - }, - json: jest.fn(() => ({ - my_next_cursor: 123, - })), - text: jest.fn(), -})) -jest.mock("node-fetch", () => mockFetch) + json: jest.fn(() => ({ + my_next_cursor: 123, + })), + text: jest.fn(), + })) +}) + import fetch from "node-fetch" import { default as RestIntegration } from "../rest" const FormData = require("form-data") @@ -579,7 +581,7 @@ describe("REST Integration", () => { }) await config.integration.read({}) - const calls: any = mockFetch.mock.calls[0] + const calls: any = fetch.mock.calls[0] const url = calls[0] expect(url).toBe(`${BASE_URL}/`) diff --git a/packages/server/src/middleware/authorized.ts b/packages/server/src/middleware/authorized.ts index d47e5c42da..d3fd4de81d 100644 --- a/packages/server/src/middleware/authorized.ts +++ b/packages/server/src/middleware/authorized.ts @@ -63,7 +63,11 @@ const checkAuthorizedResource = async ( } } -export = (permType: any, permLevel: any = null, opts = { schema: false }) => +export default ( + permType: any, + permLevel: any = null, + opts = { schema: false } + ) => async (ctx: any, next: any) => { // webhooks don't need authentication, each webhook unique // also internal requests (between services) don't need authorized diff --git a/packages/server/src/middleware/builder.ts b/packages/server/src/middleware/builder.ts index 529818a916..7df6c7ad33 100644 --- a/packages/server/src/middleware/builder.ts +++ b/packages/server/src/middleware/builder.ts @@ -64,7 +64,7 @@ async function updateAppUpdatedAt(ctx: BBContext) { }) } -export = async function builder(ctx: BBContext, permType: string) { +export default async function builder(ctx: BBContext, permType: string) { const appId = ctx.appId // this only functions within an app context if (!appId) { diff --git a/packages/server/src/middleware/currentapp.ts b/packages/server/src/middleware/currentapp.ts index 3b50d62405..2cd11aa438 100644 --- a/packages/server/src/middleware/currentapp.ts +++ b/packages/server/src/middleware/currentapp.ts @@ -12,7 +12,7 @@ import env from "../environment" import { isWebhookEndpoint } from "./utils" import { BBContext } from "@budibase/types" -export = async (ctx: BBContext, next: any) => { +export default async (ctx: BBContext, next: any) => { // try to get the appID from the request let requestAppId = await utils.getAppIdFromCtx(ctx) // get app cookie if it exists diff --git a/packages/server/src/middleware/publicApi.ts b/packages/server/src/middleware/publicApi.ts index 9b9a34df46..e3897d1a49 100644 --- a/packages/server/src/middleware/publicApi.ts +++ b/packages/server/src/middleware/publicApi.ts @@ -1,7 +1,7 @@ import { constants, utils } from "@budibase/backend-core" import { BBContext } from "@budibase/types" -export = function ({ requiresAppId }: { requiresAppId?: boolean } = {}) { +export default function ({ requiresAppId }: { requiresAppId?: boolean } = {}) { return async (ctx: BBContext, next: any) => { const appId = await utils.getAppIdFromCtx(ctx) if (requiresAppId && !appId) { diff --git a/packages/server/src/middleware/selfhost.ts b/packages/server/src/middleware/selfhost.ts index 54b757d29c..fd2ca6517b 100644 --- a/packages/server/src/middleware/selfhost.ts +++ b/packages/server/src/middleware/selfhost.ts @@ -3,7 +3,7 @@ import { BBContext } from "@budibase/types" // if added as a middleware will stop requests unless builder is in self host mode // or cloud is in self host -export = async (ctx: BBContext, next: any) => { +export default async (ctx: BBContext, next: any) => { if (env.SELF_HOSTED) { await next() return diff --git a/packages/server/src/middleware/tests/authorized.spec.js b/packages/server/src/middleware/tests/authorized.spec.js index 85697b6052..436ab7d041 100644 --- a/packages/server/src/middleware/tests/authorized.spec.js +++ b/packages/server/src/middleware/tests/authorized.spec.js @@ -7,7 +7,7 @@ jest.mock("../../environment", () => ({ } }) ) -const authorizedMiddleware = require("../authorized") +const authorizedMiddleware = require("../authorized").default const env = require("../../environment") const { permissions } = require("@budibase/backend-core") diff --git a/packages/server/src/middleware/tests/currentapp.spec.js b/packages/server/src/middleware/tests/currentapp.spec.js index 6534c8ef2d..8770118da2 100644 --- a/packages/server/src/middleware/tests/currentapp.spec.js +++ b/packages/server/src/middleware/tests/currentapp.spec.js @@ -124,7 +124,7 @@ class TestConfiguration { // import as late as possible for mocks jest.resetModules() require("../../db").init() - const currentAppMiddleware = require("../currentapp") + const currentAppMiddleware = require("../currentapp").default return currentAppMiddleware(this.ctx, this.next) } } diff --git a/packages/server/src/middleware/tests/selfhost.spec.js b/packages/server/src/middleware/tests/selfhost.spec.js index 48f4e2f152..70ed981ac3 100644 --- a/packages/server/src/middleware/tests/selfhost.spec.js +++ b/packages/server/src/middleware/tests/selfhost.spec.js @@ -1,4 +1,4 @@ -const selfHostMiddleware = require("../selfhost") +const selfHostMiddleware = require("../selfhost").default const env = require("../../environment") jest.mock("../../environment") diff --git a/packages/server/src/sdk/app/backups/imports.ts b/packages/server/src/sdk/app/backups/imports.ts index a4eec35361..b63d4c5a40 100644 --- a/packages/server/src/sdk/app/backups/imports.ts +++ b/packages/server/src/sdk/app/backups/imports.ts @@ -1,17 +1,16 @@ import { db as dbCore, objectStore } from "@budibase/backend-core" -import { Database } from "@budibase/types" +import { Database, Row } from "@budibase/types" import { getAutomationParams, TABLE_ROW_PREFIX } from "../../../db/utils" import { budibaseTempDir } from "../../../utilities/budibaseDir" import { DB_EXPORT_FILE, GLOBAL_DB_EXPORT_FILE } from "./constants" import { downloadTemplate } from "../../../utilities/fileSystem" -import { FieldTypes, ObjectStoreBuckets } from "../../../constants" +import { ObjectStoreBuckets } from "../../../constants" import { join } from "path" import fs from "fs" import sdk from "../../" import { Automation, AutomationTriggerStepId, - CouchFindOptions, RowAttachment, } from "@budibase/types" const uuid = require("uuid/v4") @@ -25,54 +24,45 @@ type TemplateType = { key?: string } -async function updateAttachmentColumns(prodAppId: string, db: Database) { +function rewriteAttachmentUrl(appId: string, attachment: RowAttachment) { + // URL looks like: /prod-budi-app-assets/appId/attachments/file.csv + const urlParts = attachment.key.split("/") + // remove the app ID + urlParts.shift() + // add new app ID + urlParts.unshift(appId) + const key = urlParts.join("/") + return { + ...attachment, + key, + url: "", // calculated on retrieval using key + } +} + +export async function updateAttachmentColumns(prodAppId: string, db: Database) { // iterate through attachment documents and update them const tables = await sdk.tables.getAllInternalTables(db) + let updatedRows: Row[] = [] for (let table of tables) { - const attachmentCols: string[] = [] - for (let [key, column] of Object.entries(table.schema)) { - if (column.type === FieldTypes.ATTACHMENT) { - attachmentCols.push(key) - } - } - // no attachment columns, nothing to do - if (attachmentCols.length === 0) { - continue - } - // use the CouchDB Mango query API to lookup rows that have attachments - const params: CouchFindOptions = { - selector: { - _id: { - $regex: `^${TABLE_ROW_PREFIX}`, - }, - }, - } - attachmentCols.forEach(col => (params.selector[col] = { $exists: true })) - const { rows } = await dbCore.directCouchFind(db.name, params) - for (let row of rows) { - for (let column of attachmentCols) { - if (!Array.isArray(row[column])) { - continue - } - row[column] = row[column].map((attachment: RowAttachment) => { - // Key looks like: appId/attachments/file.csv - const urlParts = attachment.key.split("/") - // remove the app ID - urlParts.shift() - // add new app ID - urlParts.unshift(prodAppId) - const key = urlParts.join("/") - return { - ...attachment, - key, - url: "", // calculated on retrieval using key + const { rows, columns } = await sdk.rows.getRowsWithAttachments( + db.name, + table + ) + updatedRows = updatedRows.concat( + rows.map(row => { + for (let column of columns) { + if (Array.isArray(row[column])) { + row[column] = row[column].map((attachment: RowAttachment) => + rewriteAttachmentUrl(prodAppId, attachment) + ) } - }) - } - } - // write back the updated attachments - await db.bulkDocs(rows) + } + return row + }) + ) } + // write back the updated attachments + await db.bulkDocs(updatedRows) } async function updateAutomations(prodAppId: string, db: Database) { diff --git a/packages/server/src/sdk/app/rows/attachments.ts b/packages/server/src/sdk/app/rows/attachments.ts new file mode 100644 index 0000000000..67f58f8f2c --- /dev/null +++ b/packages/server/src/sdk/app/rows/attachments.ts @@ -0,0 +1,60 @@ +import { CouchFindOptions, Table, Row } from "@budibase/types" +import { db as dbCore } from "@budibase/backend-core" +import { DocumentType, SEPARATOR } from "../../../db/utils" +import { FieldTypes } from "../../../constants" + +// default limit - seems to work well for performance +export const FIND_LIMIT = 25 + +function generateAttachmentFindParams( + tableId: string, + attachmentCols: string[], + bookmark: null | string +) { + const params: CouchFindOptions = { + selector: { + _id: { + $regex: `^${DocumentType.ROW}${SEPARATOR}${tableId}`, + }, + }, + limit: FIND_LIMIT, + } + attachmentCols.forEach(col => (params.selector[col] = { $exists: true })) + if (bookmark) { + params.bookmark = bookmark + } + return params +} + +export async function getRowsWithAttachments(appId: string, table: Table) { + // iterate through attachment documents and update them + const db = dbCore.getDB(appId) + const attachmentCols: string[] = [] + for (let [key, column] of Object.entries(table.schema)) { + if (column.type === FieldTypes.ATTACHMENT) { + attachmentCols.push(key) + } + } + // no attachment columns, nothing to do + if (attachmentCols.length === 0) { + return { rows: [], columns: [] } + } + let bookmark: null | string = null, + rowsLength = 0, + rowList: Row[] = [] + do { + const params = generateAttachmentFindParams( + table._id!, + attachmentCols, + bookmark + ) + // use the CouchDB Mango query API to lookup rows that have attachments + const resp = await dbCore.directCouchFind(db.name, params) + bookmark = resp.bookmark + rowsLength = resp.rows.length + const rows = resp.rows + rowList = rowList.concat(rows) + } while (rowsLength === FIND_LIMIT) + // write back the updated attachments + return { rows: rowList, columns: attachmentCols } +} diff --git a/packages/server/src/sdk/app/rows/index.ts b/packages/server/src/sdk/app/rows/index.ts new file mode 100644 index 0000000000..12a44ded67 --- /dev/null +++ b/packages/server/src/sdk/app/rows/index.ts @@ -0,0 +1,7 @@ +import * as attachments from "./attachments" +import * as rows from "./rows" + +export default { + ...attachments, + ...rows, +} diff --git a/packages/server/src/sdk/app/rows/rows.ts b/packages/server/src/sdk/app/rows/rows.ts new file mode 100644 index 0000000000..8709180f0b --- /dev/null +++ b/packages/server/src/sdk/app/rows/rows.ts @@ -0,0 +1,18 @@ +import { db as dbCore, context } from "@budibase/backend-core" +import { Database, Row } from "@budibase/types" +import { getRowParams } from "../../../db/utils" + +export async function getAllInternalRows(appId?: string) { + let db: Database + if (appId) { + db = dbCore.getDB(appId) + } else { + db = context.getAppDB() + } + const response = await db.allDocs( + getRowParams(null, null, { + include_docs: true, + }) + ) + return response.rows.map(row => row.doc) as Row[] +} diff --git a/packages/server/src/sdk/index.ts b/packages/server/src/sdk/index.ts index 19df8b4388..2ee40992c8 100644 --- a/packages/server/src/sdk/index.ts +++ b/packages/server/src/sdk/index.ts @@ -2,6 +2,7 @@ import { default as backups } from "./app/backups" import { default as tables } from "./app/tables" import { default as automations } from "./app/automations" import { default as applications } from "./app/applications" +import { default as rows } from "./app/rows" import { default as users } from "./users" const sdk = { @@ -9,6 +10,7 @@ const sdk = { tables, automations, applications, + rows, users, } diff --git a/packages/server/src/sdk/tests/attachments.spec.ts b/packages/server/src/sdk/tests/attachments.spec.ts new file mode 100644 index 0000000000..f1abb246f8 --- /dev/null +++ b/packages/server/src/sdk/tests/attachments.spec.ts @@ -0,0 +1,76 @@ +import newid from "../../db/newid" + +const attachment = { + size: 73479, + name: "2022-12-14 11_11_44-.png", + url: "/prod-budi-app-assets/app_bbb/attachments/a.png", + extension: "png", + key: "app_bbb/attachments/a.png", +} + +const row = { + _id: "ro_ta_aaa", + photo: [attachment], + otherCol: "string", +} + +const table = { + _id: "ta_aaa", + name: "photos", + schema: { + photo: { + type: "attachment", + name: "photo", + }, + otherCol: { + type: "string", + name: "otherCol", + }, + }, +} + +jest.mock("@budibase/backend-core", () => { + const core = jest.requireActual("@budibase/backend-core") + return { + ...core, + db: { + ...core.db, + directCouchFind: jest.fn(), + }, + } +}) + +import { db as dbCore } from "@budibase/backend-core" +import sdk from "../index" + +describe("should be able to re-write attachment URLs", () => { + it("it should update URLs on a number of rows over the limit", async () => { + const db = dbCore.getDB("app_aaa") + await db.put(table) + const limit = 30 + let rows = [] + for (let i = 0; i < limit; i++) { + const rowToWrite = { + ...row, + _id: `${row._id}_${newid()}`, + } + const { rev } = await db.put(rowToWrite) + rows.push({ + ...rowToWrite, + _rev: rev, + }) + } + + dbCore.directCouchFind + // @ts-ignore + .mockReturnValueOnce({ rows: rows.slice(0, 25), bookmark: "aaa" }) + .mockReturnValueOnce({ rows: rows.slice(25, limit), bookmark: "bbb" }) + await sdk.backups.updateAttachmentColumns(db.name, db) + const finalRows = await sdk.rows.getAllInternalRows(db.name) + for (let rowToCheck of finalRows) { + expect(rowToCheck.otherCol).toBe(row.otherCol) + expect(rowToCheck.photo[0].url).toBe("") + expect(rowToCheck.photo[0].key).toBe(`${db.name}/attachments/a.png`) + } + }) +}) diff --git a/packages/server/src/startup.ts b/packages/server/src/startup.ts index 50c1122cef..f70694226d 100644 --- a/packages/server/src/startup.ts +++ b/packages/server/src/startup.ts @@ -1,16 +1,11 @@ -import * as env from "./environment" +import env from "./environment" import * as redis from "./utilities/redis" import { createAdminUser, generateApiKey, getChecklist, } from "./utilities/workerRequests" -import { - installation, - pinoSettings, - tenancy, - logging, -} from "@budibase/backend-core" +import { installation, tenancy, logging } from "@budibase/backend-core" import fs from "fs" import { watch } from "./watch" import * as automations from "./automations" @@ -26,7 +21,7 @@ const pino = require("koa-pino-logger") let STARTUP_RAN = false async function initRoutes(app: any) { - app.use(pino(pinoSettings())) + app.use(pino(logging.pinoSettings())) if (!env.isTest()) { const plugin = await bullboard.init() diff --git a/packages/server/src/tests/jestEnv.ts b/packages/server/src/tests/jestEnv.ts new file mode 100644 index 0000000000..913c1f0f5e --- /dev/null +++ b/packages/server/src/tests/jestEnv.ts @@ -0,0 +1,13 @@ +import env from "../environment" +import { tmpdir } from "os" + +env._set("SELF_HOSTED", "1") +env._set("NODE_ENV", "jest") +env._set("JWT_SECRET", "test-jwtsecret") +env._set("CLIENT_ID", "test-client-id") +env._set("BUDIBASE_DIR", tmpdir("budibase-unittests")) +env._set("LOG_LEVEL", "silent") +env._set("PORT", 0) +env._set("MINIO_URL", "http://localhost") +env._set("MINIO_ACCESS_KEY", "test") +env._set("MINIO_SECRET_KEY", "test") diff --git a/packages/server/src/tests/jestSetup.ts b/packages/server/src/tests/jestSetup.ts index b53ac2d9fa..fc1477a500 100644 --- a/packages/server/src/tests/jestSetup.ts +++ b/packages/server/src/tests/jestSetup.ts @@ -1,17 +1,3 @@ -const { tmpdir } = require("os") -import env from "../environment" - -env._set("SELF_HOSTED", "1") -env._set("NODE_ENV", "jest") -env._set("JWT_SECRET", "test-jwtsecret") -env._set("CLIENT_ID", "test-client-id") -env._set("BUDIBASE_DIR", tmpdir("budibase-unittests")) -env._set("LOG_LEVEL", "silent") -env._set("PORT", 0) -env._set("MINIO_URL", "http://localhost") -env._set("MINIO_ACCESS_KEY", "test") -env._set("MINIO_SECRET_KEY", "test") - import { mocks } from "@budibase/backend-core/tests" // mock all dates to 2020-01-01T00:00:00.000Z diff --git a/packages/server/src/tests/utilities/TestConfiguration.ts b/packages/server/src/tests/utilities/TestConfiguration.ts index 3ef9c6b513..7ac20e14ef 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.ts +++ b/packages/server/src/tests/utilities/TestConfiguration.ts @@ -67,7 +67,7 @@ class TestConfiguration { if (openServer) { // use a random port because it doesn't matter env.PORT = "0" - this.server = require("../../app") + this.server = require("../../app").default // we need the request for logging in, involves cookies, hard to fake this.request = supertest(this.server) this.started = true diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 315a508da2..44951869f4 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -419,7 +419,7 @@ class Orchestrator { // Delete the step after the loop step as it's irrelevant, since information is included // in the loop step - if (wasLoopStep) { + if (wasLoopStep && !loopStep) { this._context.steps.splice(loopStepNumber + 1, 1) wasLoopStep = false } @@ -438,8 +438,8 @@ class Orchestrator { }) this._context.steps[loopStepNumber] = tempOutput - loopSteps = undefined wasLoopStep = true + loopSteps = [] } } diff --git a/packages/server/src/threads/index.ts b/packages/server/src/threads/index.ts index cee85e2815..0723edad34 100644 --- a/packages/server/src/threads/index.ts +++ b/packages/server/src/threads/index.ts @@ -1,5 +1,5 @@ import workerFarm from "worker-farm" -import * as env from "../environment" +import env from "../environment" export const ThreadType = { QUERY: "query", diff --git a/packages/server/src/utilities/fileSystem/filesystem.ts b/packages/server/src/utilities/fileSystem/filesystem.ts index 0c9f1ee8cd..48810ffc47 100644 --- a/packages/server/src/utilities/fileSystem/filesystem.ts +++ b/packages/server/src/utilities/fileSystem/filesystem.ts @@ -3,7 +3,7 @@ const { budibaseTempDir } = require("../budibaseDir") const fs = require("fs") const { join } = require("path") const uuid = require("uuid/v4") -const env = require("../../environment") +import env from "../../environment" import tar from "tar" export const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..") diff --git a/packages/server/src/utilities/scriptRunner.ts b/packages/server/src/utilities/scriptRunner.ts index c5ed5010d0..a39641ec99 100644 --- a/packages/server/src/utilities/scriptRunner.ts +++ b/packages/server/src/utilities/scriptRunner.ts @@ -25,4 +25,4 @@ class ScriptRunner { } } -export = ScriptRunner +export default ScriptRunner diff --git a/packages/server/src/utilities/statusCodes.ts b/packages/server/src/utilities/statusCodes.ts index 4c4469b375..1d60c951ac 100644 --- a/packages/server/src/utilities/statusCodes.ts +++ b/packages/server/src/utilities/statusCodes.ts @@ -1,4 +1,4 @@ -export = { +export default { OK: 200, UNAUTHORIZED: 401, FORBIDDEN: 403, diff --git a/packages/server/src/utilities/workerRequests.ts b/packages/server/src/utilities/workerRequests.ts index b3a61ddd68..e318b12f82 100644 --- a/packages/server/src/utilities/workerRequests.ts +++ b/packages/server/src/utilities/workerRequests.ts @@ -1,7 +1,12 @@ import fetch from "node-fetch" import env from "../environment" import { checkSlashesInUrl } from "./index" -import { db as dbCore, constants, tenancy } from "@budibase/backend-core" +import { + db as dbCore, + constants, + tenancy, + logging, +} from "@budibase/backend-core" import { updateAppRole } from "./global" import { BBContext, User } from "@budibase/types" @@ -27,6 +32,10 @@ export function request(ctx?: BBContext, request?: any) { if (ctx && ctx.headers) { request.headers = ctx.headers } + + // add x-budibase-correlation-id header + logging.correlation.setHeader(request.headers) + return request } diff --git a/packages/server/src/watch.ts b/packages/server/src/watch.ts index 2ef132c19d..09c7312e3b 100644 --- a/packages/server/src/watch.ts +++ b/packages/server/src/watch.ts @@ -1,5 +1,5 @@ import path from "path" -import * as env from "./environment" +import env from "./environment" import chokidar from "chokidar" import fs from "fs" import { constants, tenancy } from "@budibase/backend-core" diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 6738dccca2..c0a80305a9 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.10-alpha.12": - version "2.2.10-alpha.12" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.10-alpha.12.tgz#57fbd4633b8475745f9d0bb968d24b173759aea3" - integrity sha512-gmx4DFO9s2yVlJPkWxOmicDDhIJhKjPM9+OhW1B8uBRCWhR4LMOFeM72fbSykgkzqlTFYinab8M6yiU40ko5Kg== +"@budibase/backend-core@2.2.12-alpha.18": + version "2.2.12-alpha.18" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.18.tgz#2d8443464afffd29551868e91debfddb9526c76c" + integrity sha512-wLYmaoo7uhgv2/37niTve7H9AGt2nuJH9uQbObaUJAOPeYn8jtSqlUjVyTyIYHzwIOOU38TbGF1Ks8jlZiImKQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.10-alpha.12" + "@budibase/types" "2.2.12-alpha.18" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1287,6 +1287,7 @@ bcrypt "5.0.1" bcryptjs "2.4.3" bull "4.10.1" + correlation-id "4.0.0" dotenv "16.0.1" emitter-listener "1.1.2" ioredis "4.28.0" @@ -1373,13 +1374,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.10-alpha.12": - version "2.2.10-alpha.12" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.10-alpha.12.tgz#ab356f6964faaff72289c170ee85468411c92c64" - integrity sha512-jSOlgbGEg1l1e0x/4Q7TqZSm1O58IDnupHJHiH9/zIORmxFNrC3jFczJT5NjbiZp4LEViObudzQyRCe9+6OYoQ== +"@budibase/pro@2.2.12-alpha.18": + version "2.2.12-alpha.18" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.18.tgz#f4daa97309bee79196311f68dfc73ec9a7028092" + integrity sha512-Awoj5wVTlg8zleADaQtVE4ZvUp5Gw1g7O9PWnSerJx72qbgFhLW0fTiapeZ+zt8eecsqxq3hkqOxxsfkvOWkDQ== dependencies: - "@budibase/backend-core" "2.2.10-alpha.12" - "@budibase/types" "2.2.10-alpha.12" + "@budibase/backend-core" "2.2.12-alpha.18" + "@budibase/types" "2.2.12-alpha.18" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1404,10 +1405,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.10-alpha.12": - version "2.2.10-alpha.12" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.10-alpha.12.tgz#c400c8f5601314b2906029643b613870385b8608" - integrity sha512-Yb9vjr+WSRXZ90qAj7vXR4XzIpjOjgB/9GDWTR9XDn1Ul996RSar0J2e6Yla1D7As4ok7bV3aumT7At+Wk+4pw== +"@budibase/types@2.2.12-alpha.18": + version "2.2.12-alpha.18" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.18.tgz#a5415ff0c80a72a1e34c74b5dc442b8873cbbfdc" + integrity sha512-ANcnGOW7Sf73VsmdyrHd6mDEnrUppU1xTj/grM2b0guCLPKiEsaRfdLxSJJBR0Q+UplRas6/suZxg+WzYk4Owg== "@bull-board/api@3.7.0": version "3.7.0" @@ -1639,6 +1640,13 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/create-cache-key-function@^27.4.2": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-27.5.1.tgz#7448fae15602ea95c828f5eceed35c202a820b31" + integrity sha512-dmH1yW+makpTSURTy8VzdUwFnfQh1G8R+DxO2Ho2FFmBbKFEVm+3jWdvFhE2VqB/LATCTokkP0dotjyQyw5/AQ== + dependencies: + "@jest/types" "^27.5.1" + "@jest/environment@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.9.0.tgz#21e3afa2d65c0586cbd6cbefe208bafade44ab18" @@ -2833,6 +2841,80 @@ resolved "https://registry.yarnpkg.com/@spectrum-css/vars/-/vars-8.0.0.tgz#b88a3b1165b63de50ab01f20ccafb42115d67443" integrity sha512-cClQgNyH1VdNu6zdiZ5M7kbQDZS4/wPAclk5IPO5+nMhSzqTesUL/zfiaPB95MTCKFyVJrFpOeJ37HmUifWJ3A== +"@swc/core-darwin-arm64@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.25.tgz#01ce7b8a88b545a4fc5283ed6f96b22c5733d6c4" + integrity sha512-8PWAVcjTJyj2VrqPBFOIi2w2P0Z8kOCbzHW3+pe+bSXxfGMG0MKPl5U2IXhsEL0ovm4xSFlqW0yygpoP3MmRPw== + +"@swc/core-darwin-x64@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.25.tgz#9fad102c507011f42c5a5d1f84919b81ab96d7f8" + integrity sha512-5DHGiMYFEj5aa208tCjo7Sn5tiG4xPz+4gUiWVlglxqXFptkNim5xu/1G6VYm5Zk7dI5jJkjTU76GQG7IRvPug== + +"@swc/core-linux-arm-gnueabihf@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.25.tgz#ecf3a34899fdbdc742523524caab29c0db97a6ad" + integrity sha512-YNfLxv9PhZk+jrJbpR1mMrYBUkufo0hiFv3S1OrX3l8edsIP4wPND5w9ZH0Oi898f6Jg9DBrY2zXJMQ+gWkbvA== + +"@swc/core-linux-arm64-gnu@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.25.tgz#50524c9db2dbf874570e45f0a66e0283f02bc2d9" + integrity sha512-kS+spM5/xQ6QvWF1ms3byfjnhUlpjTfFwgCyHnIKgjvsYkDa+vkAIhKq6HuEdaTPaCRCjts0Zarhub1nClUU0g== + +"@swc/core-linux-arm64-musl@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.25.tgz#f04a3d3784cff14f96ad9901861485ec0fa14ebf" + integrity sha512-vM3D7LWmjotUAJ2D4F+L+dspFeWrcPNVh0o8TCoTOYCt8DPD5YsUKTpIgOsZ+gReeWUAnNTh0Btx5pGGVfajGA== + +"@swc/core-linux-x64-gnu@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.25.tgz#761fb020b8a0130e4dccc9c8dce355fa06df63f4" + integrity sha512-xUCLLMDlYa/zB8BftVa4SrxuVpcDxkltCfmBg5r2pZPVskhC5ZJsQZ/AvWNChoAB11shRhjTaWDlmxJEsa7TIg== + +"@swc/core-linux-x64-musl@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.25.tgz#f944ee48c972ebdcb3e6d6fd62d67eb98dbb1268" + integrity sha512-QzHU3BIaUVRSFNsUn3Qxx1vgtF/f5NqsFMAAPSq9Y8Yq5nrlc2t7cNuOROxHLbUqE+NPUp6+RglleJMoeWz5mA== + +"@swc/core-win32-arm64-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.25.tgz#af63ae850ef6e7322e8a5a0959529e96096239d2" + integrity sha512-77VSVtneVOAUL4zkRyQZ6pWVpTsVVdqwly/DKnRnloglGKxYuk5DG5MUBsL72Nnfv4OCHjZ27eI3NUrpLsUb2Q== + +"@swc/core-win32-ia32-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.25.tgz#96a869aa4b4c41c44c9c9893ac4aad68d1233022" + integrity sha512-kz0v3K3H6OPEZR3ry72Ad/6C5GrZBRRUk69K58LORQ8tZXQD3UGl85pUbQqyHl8fR5NU76Muxgovj9CI9iTHGA== + +"@swc/core-win32-x64-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.25.tgz#9035c11626653322a404f3f44af11a02d989094c" + integrity sha512-nmQOAzIpNRRnupWzkenJmW4i+h1M76cVNUqEU2MjmtesEkRZEGqv//jefXiyCP2zcbeLNLKiB2ptVJhpd1BvRA== + +"@swc/core@^1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.25.tgz#53786ea51fac319684d6822de1738eb55b73a4b7" + integrity sha512-wqzvM/wu6OsTVYPMStOpm7kIQcPX3GoZ0sC85qzDdsCxmJ1rmItLAD91sXPUmmdk0XqPYjLgT9MRDEIP5woz4g== + optionalDependencies: + "@swc/core-darwin-arm64" "1.3.25" + "@swc/core-darwin-x64" "1.3.25" + "@swc/core-linux-arm-gnueabihf" "1.3.25" + "@swc/core-linux-arm64-gnu" "1.3.25" + "@swc/core-linux-arm64-musl" "1.3.25" + "@swc/core-linux-x64-gnu" "1.3.25" + "@swc/core-linux-x64-musl" "1.3.25" + "@swc/core-win32-arm64-msvc" "1.3.25" + "@swc/core-win32-ia32-msvc" "1.3.25" + "@swc/core-win32-x64-msvc" "1.3.25" + +"@swc/jest@^0.2.24": + version "0.2.24" + resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.24.tgz#35d9377ede049613cd5fdd6c24af2b8dcf622875" + integrity sha512-fwgxQbM1wXzyKzl1+IW0aGrRvAA8k0Y3NxFhKigbPjOJ4mCKnWEcNX9HQS3gshflcxq8YKhadabGUVfdwjCr6Q== + dependencies: + "@jest/create-cache-key-function" "^27.4.2" + jsonc-parser "^3.2.0" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -5440,6 +5522,13 @@ core-util-is@^1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== +correlation-id@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/correlation-id/-/correlation-id-4.0.0.tgz#c1d3038e5f30d7bfeae5728ff96f27a7506bc2c0" + integrity sha512-WvXtJBlovvOBKqTz/YwWP2gm6CXJZJArfGimp9s/ehmhJMPFbmnPMQe3K60Q9idGNixMvKojMjleyDhZEFdHfg== + dependencies: + uuid "^8.3.1" + cors@~2.8.5: version "2.8.5" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" @@ -9563,6 +9652,11 @@ json5@^2.1.2, json5@^2.2.0, json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -10312,9 +10406,9 @@ ltgt@2.2.1, ltgt@^2.1.2, ltgt@~2.2.0: integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA== luxon@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.0.1.tgz#6901111d10ad06fd267ad4e4128a84bef8a77299" - integrity sha512-hF3kv0e5gwHQZKz4wtm4c+inDtyc7elkanAsBq+fundaCdUBNJB1dHEGUZIM6SfSBUlbVFduPwEtNjFK8wLtcw== + version "3.2.1" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.2.1.tgz#14f1af209188ad61212578ea7e3d518d18cee45f" + integrity sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg== make-dir@^1.0.0: version "1.3.0" @@ -14716,7 +14810,7 @@ uuid@8.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.1.0.tgz#6f1536eb43249f473abc6bd58ff983da1ca30d8d" integrity sha512-CI18flHDznR0lq54xBycOVmphdCYnQLKn8abKn7PXUiKUGdEd+/l9LWNJmugXel4hXq7S+RMNl34ecyC9TntWg== -uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.2: +uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.1, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 881d87ea6d..3312cc330f 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/string-templates/yarn.lock b/packages/string-templates/yarn.lock index 5665d8eb02..4488e58d46 100644 --- a/packages/string-templates/yarn.lock +++ b/packages/string-templates/yarn.lock @@ -2874,11 +2874,9 @@ json-parse-even-better-errors@^2.3.0: integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.1.0, kind-of@^3.2.0: version "3.2.2" diff --git a/packages/types/package.json b/packages/types/package.json index ff0149f6cd..0595dd1a1a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/types/yarn.lock b/packages/types/yarn.lock index 4acf3737a0..4b45eb90ed 100644 --- a/packages/types/yarn.lock +++ b/packages/types/yarn.lock @@ -522,9 +522,9 @@ inherits@2, inherits@2.0.4: integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== json5@*: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== koa-body@4.2.0: version "4.2.0" diff --git a/packages/worker/jest.config.ts b/packages/worker/jest.config.ts index c482dffd38..21b7ee6763 100644 --- a/packages/worker/jest.config.ts +++ b/packages/worker/jest.config.ts @@ -2,11 +2,14 @@ import { Config } from "@jest/types" import * as fs from "fs" const config: Config.InitialOptions = { - preset: "ts-jest", testEnvironment: "node", - setupFiles: ["./src/tests/jestSetup.ts"], + setupFiles: ["./src/tests/jestEnv.ts"], + setupFilesAfterEnv: ["./src/tests/jestSetup.ts"], collectCoverageFrom: ["src/**/*.{js,ts}"], coverageReporters: ["lcov", "json", "clover"], + transform: { + "^.+\\.ts?$": "@swc/jest", + }, } if (!process.env.CI) { diff --git a/packages/worker/package.json b/packages/worker/package.json index 513b3bf5b3..3466bf1167 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.10-alpha.12", + "version": "2.2.12-alpha.18", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.2.10-alpha.12", - "@budibase/pro": "2.2.10-alpha.12", - "@budibase/string-templates": "2.2.10-alpha.12", - "@budibase/types": "2.2.10-alpha.12", + "@budibase/backend-core": "2.2.12-alpha.18", + "@budibase/pro": "2.2.12-alpha.18", + "@budibase/string-templates": "2.2.12-alpha.18", + "@budibase/types": "2.2.12-alpha.18", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", @@ -70,6 +70,8 @@ "server-destroy": "1.0.1" }, "devDependencies": { + "@swc/core": "^1.3.25", + "@swc/jest": "^0.2.24", "@types/jest": "26.0.23", "@types/jsonwebtoken": "8.5.1", "@types/koa": "2.13.4", diff --git a/packages/worker/src/api/controllers/global/auth.ts b/packages/worker/src/api/controllers/global/auth.ts index b76200c1f7..e6d3c329d7 100644 --- a/packages/worker/src/api/controllers/global/auth.ts +++ b/packages/worker/src/api/controllers/global/auth.ts @@ -13,7 +13,7 @@ import { isEmailConfigured, sendEmail } from "../../../utilities/email" import { checkResetPasswordCode } from "../../../utilities/redis" import env from "../../../environment" import sdk from "../../../sdk" -import { Config, ConfigType, User } from "@budibase/types" +import { ConfigType, User } from "@budibase/types" const { setCookie, getCookie, clearCookie, hash, platformLogout } = utils const { Cookie, Header } = constants diff --git a/packages/worker/src/api/routes/global/auth.ts b/packages/worker/src/api/routes/global/auth.ts index 05c799beb0..b13cef2fc6 100644 --- a/packages/worker/src/api/routes/global/auth.ts +++ b/packages/worker/src/api/routes/global/auth.ts @@ -85,4 +85,4 @@ router .get("/api/global/auth/oidc/callback", authController.oidcAuth) .get("/api/admin/auth/oidc/callback", authController.oidcAuth) -export = router +export default router diff --git a/packages/worker/src/api/routes/global/configs.ts b/packages/worker/src/api/routes/global/configs.ts index a4794abcc6..7420d749c2 100644 --- a/packages/worker/src/api/routes/global/configs.ts +++ b/packages/worker/src/api/routes/global/configs.ts @@ -121,4 +121,4 @@ router controller.upload ) -export = router +export default router diff --git a/packages/worker/src/api/routes/global/email.ts b/packages/worker/src/api/routes/global/email.ts index b49e5b5db2..94e6b9bce5 100644 --- a/packages/worker/src/api/routes/global/email.ts +++ b/packages/worker/src/api/routes/global/email.ts @@ -33,4 +33,4 @@ router.post( controller.sendEmail ) -export = router +export default router diff --git a/packages/worker/src/api/routes/global/roles.ts b/packages/worker/src/api/routes/global/roles.ts index 249d1b7076..6395873cb7 100644 --- a/packages/worker/src/api/routes/global/roles.ts +++ b/packages/worker/src/api/routes/global/roles.ts @@ -13,4 +13,4 @@ router controller.removeAppRole ) -export = router +export default router diff --git a/packages/worker/src/api/routes/global/self.ts b/packages/worker/src/api/routes/global/self.ts index bb7828c09d..8784bb8b20 100644 --- a/packages/worker/src/api/routes/global/self.ts +++ b/packages/worker/src/api/routes/global/self.ts @@ -15,4 +15,4 @@ router controller.updateSelf ) -export = router +export default router diff --git a/packages/worker/src/api/routes/global/templates.ts b/packages/worker/src/api/routes/global/templates.ts index a45e244a0b..051ee5d702 100644 --- a/packages/worker/src/api/routes/global/templates.ts +++ b/packages/worker/src/api/routes/global/templates.ts @@ -34,4 +34,4 @@ router .get("/api/global/template/:id", controller.find) .delete("/api/global/template/:id/:rev", adminOnly, controller.destroy) -export = router +export default router diff --git a/packages/worker/src/api/routes/global/tests/templates.spec.ts b/packages/worker/src/api/routes/global/tests/templates.spec.ts index aa0d808d60..982cae28b5 100644 --- a/packages/worker/src/api/routes/global/tests/templates.spec.ts +++ b/packages/worker/src/api/routes/global/tests/templates.spec.ts @@ -1,17 +1,9 @@ -import { - addBaseTemplates, - EmailTemplates, - getTemplates, -} from "../../../../constants/templates" import { EmailTemplatePurpose, TemplateMetadata, - TemplateMetadataNames, TemplateType, } from "../../../../constants" import { TestConfiguration } from "../../../../tests" -import { join } from "path" -import { readStaticFile } from "../../../../../src/utilities/fileSystem" // TODO diff --git a/packages/worker/src/api/routes/global/users.ts b/packages/worker/src/api/routes/global/users.ts index 399a412a61..26cba8e1ab 100644 --- a/packages/worker/src/api/routes/global/users.ts +++ b/packages/worker/src/api/routes/global/users.ts @@ -113,4 +113,4 @@ router selfController.updateSelf ) -export = router +export default router diff --git a/packages/worker/src/api/routes/global/workspaces.ts b/packages/worker/src/api/routes/global/workspaces.ts index 82d4af9230..79afb53b96 100644 --- a/packages/worker/src/api/routes/global/workspaces.ts +++ b/packages/worker/src/api/routes/global/workspaces.ts @@ -34,4 +34,4 @@ router .get("/api/global/workspaces", controller.fetch) .get("/api/global/workspaces/:id", controller.find) -export = router +export default router diff --git a/packages/worker/src/api/routes/system/accounts.ts b/packages/worker/src/api/routes/system/accounts.ts index a5996f3934..666f0f8db5 100644 --- a/packages/worker/src/api/routes/system/accounts.ts +++ b/packages/worker/src/api/routes/system/accounts.ts @@ -16,4 +16,4 @@ router controller.destroy ) -export = router +export default router diff --git a/packages/worker/src/api/routes/system/environment.ts b/packages/worker/src/api/routes/system/environment.ts index 841ec33c82..460ef19407 100644 --- a/packages/worker/src/api/routes/system/environment.ts +++ b/packages/worker/src/api/routes/system/environment.ts @@ -5,4 +5,4 @@ const router: Router = new Router() router.get("/api/system/environment", controller.fetch) -export = router +export default router diff --git a/packages/worker/src/api/routes/system/migrations.ts b/packages/worker/src/api/routes/system/migrations.ts index 958de6bb60..a8189b5a91 100644 --- a/packages/worker/src/api/routes/system/migrations.ts +++ b/packages/worker/src/api/routes/system/migrations.ts @@ -16,4 +16,4 @@ router migrationsController.fetchDefinitions ) -export = router +export default router diff --git a/packages/worker/src/api/routes/system/restore.ts b/packages/worker/src/api/routes/system/restore.ts index e348715405..f8a4208564 100644 --- a/packages/worker/src/api/routes/system/restore.ts +++ b/packages/worker/src/api/routes/system/restore.ts @@ -5,4 +5,4 @@ const router: Router = new Router() router.post("/api/system/restored", controller.systemRestored) -export = router +export default router diff --git a/packages/worker/src/api/routes/system/status.ts b/packages/worker/src/api/routes/system/status.ts index 7ae6d57699..f92e4c4be2 100644 --- a/packages/worker/src/api/routes/system/status.ts +++ b/packages/worker/src/api/routes/system/status.ts @@ -5,4 +5,4 @@ const router: Router = new Router() router.get("/api/system/status", controller.fetch) -export = router +export default router diff --git a/packages/worker/src/api/routes/system/tenants.ts b/packages/worker/src/api/routes/system/tenants.ts index 7967de34b3..111cfc5819 100644 --- a/packages/worker/src/api/routes/system/tenants.ts +++ b/packages/worker/src/api/routes/system/tenants.ts @@ -10,4 +10,4 @@ router.delete( controller.delete ) -export = router +export default router diff --git a/packages/worker/src/api/routes/system/tests/environment.spec.ts b/packages/worker/src/api/routes/system/tests/environment.spec.ts index f18ae1ba91..0f7a690abc 100644 --- a/packages/worker/src/api/routes/system/tests/environment.spec.ts +++ b/packages/worker/src/api/routes/system/tests/environment.spec.ts @@ -20,7 +20,7 @@ describe("/api/system/environment", () => { const env = await config.api.environment.getEnvironment() expect(env.body).toEqual({ cloud: true, - disableAccountPortal: false, + disableAccountPortal: 0, isDev: false, multiTenancy: true, }) diff --git a/packages/worker/src/db/index.ts b/packages/worker/src/db/index.ts index 76c6b83153..d74d00d910 100644 --- a/packages/worker/src/db/index.ts +++ b/packages/worker/src/db/index.ts @@ -1,4 +1,4 @@ -import core from "@budibase/backend-core" +import * as core from "@budibase/backend-core" import env from "../environment" export const init = () => { diff --git a/packages/worker/src/environment.ts b/packages/worker/src/environment.ts index c9c82b4e20..52fec210bc 100644 --- a/packages/worker/src/environment.ts +++ b/packages/worker/src/environment.ts @@ -98,4 +98,4 @@ for (let [key, value] of Object.entries(environment)) { } } -export = environment +export default environment diff --git a/packages/worker/src/index.ts b/packages/worker/src/index.ts index e88f4952f4..dfb96a061c 100644 --- a/packages/worker/src/index.ts +++ b/packages/worker/src/index.ts @@ -14,7 +14,7 @@ import { Event } from "@sentry/types/dist/event" import Application from "koa" import { bootstrap } from "global-agent" import * as db from "./db" -import { auth, logging, events, pinoSettings } from "@budibase/backend-core" +import { auth, logging, events, middleware } from "@budibase/backend-core" db.init() import Koa from "koa" import koaBody from "koa-body" @@ -36,7 +36,8 @@ app.keys = ["secret", "key"] // set up top level koa middleware app.use(koaBody({ multipart: true })) app.use(koaSession(app)) -app.use(logger(pinoSettings())) +app.use(middleware.logging) +app.use(logger(logging.pinoSettings())) // authentication app.use(auth.passport.initialize()) @@ -82,7 +83,7 @@ const shutdown = () => { server.destroy() } -export = server.listen(parseInt(env.PORT || "4002"), async () => { +export default server.listen(parseInt(env.PORT || "4002"), async () => { console.log(`Worker running on ${JSON.stringify(server.address())}`) await redis.init() }) diff --git a/packages/worker/src/middleware/cloudRestricted.ts b/packages/worker/src/middleware/cloudRestricted.ts index d2ca0c7964..5440629de3 100644 --- a/packages/worker/src/middleware/cloudRestricted.ts +++ b/packages/worker/src/middleware/cloudRestricted.ts @@ -6,7 +6,7 @@ import { BBContext } from "@budibase/types" * This is a restricted endpoint in the cloud. * Ensure that the correct API key has been supplied. */ -export = async (ctx: BBContext, next: any) => { +export default async (ctx: BBContext, next: any) => { if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { const apiKey = ctx.request.headers[constants.Header.API_KEY] if (apiKey !== env.INTERNAL_API_KEY) { diff --git a/packages/worker/src/tests/TestConfiguration.ts b/packages/worker/src/tests/TestConfiguration.ts index 21b59ba8ed..ecf7e14ebe 100644 --- a/packages/worker/src/tests/TestConfiguration.ts +++ b/packages/worker/src/tests/TestConfiguration.ts @@ -51,7 +51,7 @@ class TestConfiguration { if (opts.openServer) { env.PORT = "0" // random port - this.server = require("../index") + this.server = require("../index").default // we need the request for logging in, involves cookies, hard to fake this.request = supertest(this.server) } @@ -327,4 +327,4 @@ class TestConfiguration { } } -export = TestConfiguration +export default TestConfiguration diff --git a/packages/worker/src/tests/api/users.ts b/packages/worker/src/tests/api/users.ts index 280238ea90..f2c95a20a1 100644 --- a/packages/worker/src/tests/api/users.ts +++ b/packages/worker/src/tests/api/users.ts @@ -5,7 +5,7 @@ import { User, CreateAdminUserRequest, } from "@budibase/types" -import * as structures from "../structures" +import structures from "../structures" import { generator } from "@budibase/backend-core/tests" import TestConfiguration from "../TestConfiguration" import { TestAPI, TestAPIOpts } from "./base" diff --git a/packages/worker/src/tests/index.ts b/packages/worker/src/tests/index.ts index d153390da0..124f261d60 100644 --- a/packages/worker/src/tests/index.ts +++ b/packages/worker/src/tests/index.ts @@ -1,18 +1,6 @@ -import mocks from "./mocks" -import { generator } from "@budibase/backend-core/tests" -import TestConfiguration from "./TestConfiguration" -import structures from "./structures" -import API from "./api" -import { v4 as uuid } from "uuid" - -const pkg = { - structures, - generator, - uuid, - TENANT_1: structures.TENANT_1, - mocks, - TestConfiguration, - API, -} - -export = pkg +export { default as mocks } from "./mocks" +export { generator } from "@budibase/backend-core/tests" +export { default as TestConfiguration } from "./TestConfiguration" +export { default as structures } from "./structures" +export { default as API } from "./api" +export { v4 as uuid } from "uuid" diff --git a/packages/worker/src/tests/jestEnv.ts b/packages/worker/src/tests/jestEnv.ts new file mode 100644 index 0000000000..0b27cf52aa --- /dev/null +++ b/packages/worker/src/tests/jestEnv.ts @@ -0,0 +1,11 @@ +process.env.SELF_HOSTED = "0" +process.env.NODE_ENV = "jest" +process.env.JWT_SECRET = "test-jwtsecret" +process.env.LOG_LEVEL = "silent" +process.env.MULTI_TENANCY = "1" +process.env.MINIO_URL = "http://localhost" +process.env.MINIO_ACCESS_KEY = "test" +process.env.MINIO_SECRET_KEY = "test" +process.env.PLATFORM_URL = "http://localhost:10000" +process.env.INTERNAL_API_KEY = "tet" +process.env.DISABLE_ACCOUNT_PORTAL = "0" diff --git a/packages/worker/src/tests/jestSetup.ts b/packages/worker/src/tests/jestSetup.ts index ab82cb5be7..9a948b674d 100644 --- a/packages/worker/src/tests/jestSetup.ts +++ b/packages/worker/src/tests/jestSetup.ts @@ -1,17 +1,3 @@ -import env from "../environment" - -env._set("SELF_HOSTED", "0") -env._set("NODE_ENV", "jest") -env._set("JWT_SECRET", "test-jwtsecret") -env._set("LOG_LEVEL", "silent") -env._set("MULTI_TENANCY", true) -env._set("MINIO_URL", "http://localhost") -env._set("MINIO_ACCESS_KEY", "test") -env._set("MINIO_SECRET_KEY", "test") -env._set("PLATFORM_URL", "http://localhost:10000") -env._set("INTERNAL_API_KEY", "test") -env._set("DISABLE_ACCOUNT_PORTAL", false) - import { mocks } from "@budibase/backend-core/tests" // must explicitly enable fetch mock diff --git a/packages/worker/src/tests/mocks/index.ts b/packages/worker/src/tests/mocks/index.ts index 4d69e04716..30bb4e1d09 100644 --- a/packages/worker/src/tests/mocks/index.ts +++ b/packages/worker/src/tests/mocks/index.ts @@ -1,7 +1,7 @@ import * as email from "./email" import { mocks } from "@budibase/backend-core/tests" -export = { +export default { email, ...mocks, } diff --git a/packages/worker/src/tests/structures/index.ts b/packages/worker/src/tests/structures/index.ts index 0ac32e77ee..1223dfa019 100644 --- a/packages/worker/src/tests/structures/index.ts +++ b/packages/worker/src/tests/structures/index.ts @@ -4,9 +4,9 @@ import * as users from "./users" import * as groups from "./groups" import { v4 as uuid } from "uuid" -const TENANT_ID = "default" -const TENANT_1 = "tenant1" -const CSRF_TOKEN = "e3727778-7af0-4226-b5eb-f43cbe60a306" +export const TENANT_ID = "default" +export const TENANT_1 = "tenant1" +export const CSRF_TOKEN = "e3727778-7af0-4226-b5eb-f43cbe60a306" const pkg = { ...structures, @@ -19,4 +19,4 @@ const pkg = { groups, } -export = pkg +export default pkg diff --git a/packages/worker/src/utilities/appService.ts b/packages/worker/src/utilities/appService.ts index a0c4314f65..244f10336f 100644 --- a/packages/worker/src/utilities/appService.ts +++ b/packages/worker/src/utilities/appService.ts @@ -1,5 +1,5 @@ import fetch from "node-fetch" -import { constants, tenancy } from "@budibase/backend-core" +import { constants, tenancy, logging } from "@budibase/backend-core" import { checkSlashesInUrl } from "../utilities" import env from "../environment" @@ -17,6 +17,10 @@ async function makeAppRequest(url: string, method: string, body: any) { request.body = JSON.stringify(body) } request.method = method + + // add x-budibase-correlation-id header + logging.correlation.setHeader(request.headers) + return fetch(checkSlashesInUrl(env.APPS_URL + url), request) } diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 4bdf10c061..41b63f5f6a 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.10-alpha.12": - version "2.2.10-alpha.12" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.10-alpha.12.tgz#57fbd4633b8475745f9d0bb968d24b173759aea3" - integrity sha512-gmx4DFO9s2yVlJPkWxOmicDDhIJhKjPM9+OhW1B8uBRCWhR4LMOFeM72fbSykgkzqlTFYinab8M6yiU40ko5Kg== +"@budibase/backend-core@2.2.12-alpha.18": + version "2.2.12-alpha.18" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.18.tgz#2d8443464afffd29551868e91debfddb9526c76c" + integrity sha512-wLYmaoo7uhgv2/37niTve7H9AGt2nuJH9uQbObaUJAOPeYn8jtSqlUjVyTyIYHzwIOOU38TbGF1Ks8jlZiImKQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.10-alpha.12" + "@budibase/types" "2.2.12-alpha.18" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -484,6 +484,7 @@ bcrypt "5.0.1" bcryptjs "2.4.3" bull "4.10.1" + correlation-id "4.0.0" dotenv "16.0.1" emitter-listener "1.1.2" ioredis "4.28.0" @@ -520,23 +521,23 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.10-alpha.12": - version "2.2.10-alpha.12" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.10-alpha.12.tgz#ab356f6964faaff72289c170ee85468411c92c64" - integrity sha512-jSOlgbGEg1l1e0x/4Q7TqZSm1O58IDnupHJHiH9/zIORmxFNrC3jFczJT5NjbiZp4LEViObudzQyRCe9+6OYoQ== +"@budibase/pro@2.2.12-alpha.18": + version "2.2.12-alpha.18" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.18.tgz#f4daa97309bee79196311f68dfc73ec9a7028092" + integrity sha512-Awoj5wVTlg8zleADaQtVE4ZvUp5Gw1g7O9PWnSerJx72qbgFhLW0fTiapeZ+zt8eecsqxq3hkqOxxsfkvOWkDQ== dependencies: - "@budibase/backend-core" "2.2.10-alpha.12" - "@budibase/types" "2.2.10-alpha.12" + "@budibase/backend-core" "2.2.12-alpha.18" + "@budibase/types" "2.2.12-alpha.18" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" jsonwebtoken "8.5.1" node-fetch "^2.6.1" -"@budibase/types@2.2.10-alpha.12": - version "2.2.10-alpha.12" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.10-alpha.12.tgz#c400c8f5601314b2906029643b613870385b8608" - integrity sha512-Yb9vjr+WSRXZ90qAj7vXR4XzIpjOjgB/9GDWTR9XDn1Ul996RSar0J2e6Yla1D7As4ok7bV3aumT7At+Wk+4pw== +"@budibase/types@2.2.12-alpha.18": + version "2.2.12-alpha.18" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.18.tgz#a5415ff0c80a72a1e34c74b5dc442b8873cbbfdc" + integrity sha512-ANcnGOW7Sf73VsmdyrHd6mDEnrUppU1xTj/grM2b0guCLPKiEsaRfdLxSJJBR0Q+UplRas6/suZxg+WzYk4Owg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -639,6 +640,13 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/create-cache-key-function@^27.4.2": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-27.5.1.tgz#7448fae15602ea95c828f5eceed35c202a820b31" + integrity sha512-dmH1yW+makpTSURTy8VzdUwFnfQh1G8R+DxO2Ho2FFmBbKFEVm+3jWdvFhE2VqB/LATCTokkP0dotjyQyw5/AQ== + dependencies: + "@jest/types" "^27.5.1" + "@jest/environment@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e" @@ -784,6 +792,17 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" +"@jest/types@^27.5.1": + version "27.5.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" + integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@jest/types@^28.1.1", "@jest/types@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" @@ -1081,6 +1100,80 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@swc/core-darwin-arm64@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.25.tgz#01ce7b8a88b545a4fc5283ed6f96b22c5733d6c4" + integrity sha512-8PWAVcjTJyj2VrqPBFOIi2w2P0Z8kOCbzHW3+pe+bSXxfGMG0MKPl5U2IXhsEL0ovm4xSFlqW0yygpoP3MmRPw== + +"@swc/core-darwin-x64@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.25.tgz#9fad102c507011f42c5a5d1f84919b81ab96d7f8" + integrity sha512-5DHGiMYFEj5aa208tCjo7Sn5tiG4xPz+4gUiWVlglxqXFptkNim5xu/1G6VYm5Zk7dI5jJkjTU76GQG7IRvPug== + +"@swc/core-linux-arm-gnueabihf@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.25.tgz#ecf3a34899fdbdc742523524caab29c0db97a6ad" + integrity sha512-YNfLxv9PhZk+jrJbpR1mMrYBUkufo0hiFv3S1OrX3l8edsIP4wPND5w9ZH0Oi898f6Jg9DBrY2zXJMQ+gWkbvA== + +"@swc/core-linux-arm64-gnu@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.25.tgz#50524c9db2dbf874570e45f0a66e0283f02bc2d9" + integrity sha512-kS+spM5/xQ6QvWF1ms3byfjnhUlpjTfFwgCyHnIKgjvsYkDa+vkAIhKq6HuEdaTPaCRCjts0Zarhub1nClUU0g== + +"@swc/core-linux-arm64-musl@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.25.tgz#f04a3d3784cff14f96ad9901861485ec0fa14ebf" + integrity sha512-vM3D7LWmjotUAJ2D4F+L+dspFeWrcPNVh0o8TCoTOYCt8DPD5YsUKTpIgOsZ+gReeWUAnNTh0Btx5pGGVfajGA== + +"@swc/core-linux-x64-gnu@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.25.tgz#761fb020b8a0130e4dccc9c8dce355fa06df63f4" + integrity sha512-xUCLLMDlYa/zB8BftVa4SrxuVpcDxkltCfmBg5r2pZPVskhC5ZJsQZ/AvWNChoAB11shRhjTaWDlmxJEsa7TIg== + +"@swc/core-linux-x64-musl@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.25.tgz#f944ee48c972ebdcb3e6d6fd62d67eb98dbb1268" + integrity sha512-QzHU3BIaUVRSFNsUn3Qxx1vgtF/f5NqsFMAAPSq9Y8Yq5nrlc2t7cNuOROxHLbUqE+NPUp6+RglleJMoeWz5mA== + +"@swc/core-win32-arm64-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.25.tgz#af63ae850ef6e7322e8a5a0959529e96096239d2" + integrity sha512-77VSVtneVOAUL4zkRyQZ6pWVpTsVVdqwly/DKnRnloglGKxYuk5DG5MUBsL72Nnfv4OCHjZ27eI3NUrpLsUb2Q== + +"@swc/core-win32-ia32-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.25.tgz#96a869aa4b4c41c44c9c9893ac4aad68d1233022" + integrity sha512-kz0v3K3H6OPEZR3ry72Ad/6C5GrZBRRUk69K58LORQ8tZXQD3UGl85pUbQqyHl8fR5NU76Muxgovj9CI9iTHGA== + +"@swc/core-win32-x64-msvc@1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.25.tgz#9035c11626653322a404f3f44af11a02d989094c" + integrity sha512-nmQOAzIpNRRnupWzkenJmW4i+h1M76cVNUqEU2MjmtesEkRZEGqv//jefXiyCP2zcbeLNLKiB2ptVJhpd1BvRA== + +"@swc/core@^1.3.25": + version "1.3.25" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.25.tgz#53786ea51fac319684d6822de1738eb55b73a4b7" + integrity sha512-wqzvM/wu6OsTVYPMStOpm7kIQcPX3GoZ0sC85qzDdsCxmJ1rmItLAD91sXPUmmdk0XqPYjLgT9MRDEIP5woz4g== + optionalDependencies: + "@swc/core-darwin-arm64" "1.3.25" + "@swc/core-darwin-x64" "1.3.25" + "@swc/core-linux-arm-gnueabihf" "1.3.25" + "@swc/core-linux-arm64-gnu" "1.3.25" + "@swc/core-linux-arm64-musl" "1.3.25" + "@swc/core-linux-x64-gnu" "1.3.25" + "@swc/core-linux-x64-musl" "1.3.25" + "@swc/core-win32-arm64-msvc" "1.3.25" + "@swc/core-win32-ia32-msvc" "1.3.25" + "@swc/core-win32-x64-msvc" "1.3.25" + +"@swc/jest@^0.2.24": + version "0.2.24" + resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.24.tgz#35d9377ede049613cd5fdd6c24af2b8dcf622875" + integrity sha512-fwgxQbM1wXzyKzl1+IW0aGrRvAA8k0Y3NxFhKigbPjOJ4mCKnWEcNX9HQS3gshflcxq8YKhadabGUVfdwjCr6Q== + dependencies: + "@jest/create-cache-key-function" "^27.4.2" + jsonc-parser "^3.2.0" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -1583,6 +1676,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^16.0.0": + version "16.0.5" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.5.tgz#12cc86393985735a283e387936398c2f9e5f88e3" + integrity sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ== + dependencies: + "@types/yargs-parser" "*" + "@types/yargs@^17.0.8": version "17.0.15" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.15.tgz#5b62c89fb049e2fc8378394a2861a593055f0866" @@ -2615,6 +2715,13 @@ core-util-is@^1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== +correlation-id@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/correlation-id/-/correlation-id-4.0.0.tgz#c1d3038e5f30d7bfeae5728ff96f27a7506bc2c0" + integrity sha512-WvXtJBlovvOBKqTz/YwWP2gm6CXJZJArfGimp9s/ehmhJMPFbmnPMQe3K60Q9idGNixMvKojMjleyDhZEFdHfg== + dependencies: + uuid "^8.3.1" + crc@^3.4.4: version "3.8.0" resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6" @@ -4854,6 +4961,11 @@ json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + jsonwebtoken@8.5.1, jsonwebtoken@^8.2.0: version "8.5.1" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d" @@ -7782,7 +7894,7 @@ uuid@8.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.1.0.tgz#6f1536eb43249f473abc6bd58ff983da1ca30d8d" integrity sha512-CI18flHDznR0lq54xBycOVmphdCYnQLKn8abKn7PXUiKUGdEd+/l9LWNJmugXel4hXq7S+RMNl34ecyC9TntWg== -uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.2: +uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.1, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index a874ef0cb8..aac82df013 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -166,8 +166,8 @@ export default class AppApi { const body = { icon: { name: "ConversionFunnel", - color: "var(--spectrum-global-color-red-400)" - } + color: "var(--spectrum-global-color-red-400)", + }, } const response = await this.api.put(`/applications/${appId}`, { body }) const json = await response.json() diff --git a/qa-core/src/config/internal-api/TestConfiguration/index.ts b/qa-core/src/config/internal-api/TestConfiguration/index.ts index a82c1fdf03..08ca0d3cf3 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/index.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/index.ts @@ -26,7 +26,10 @@ export default class TestConfiguration { } async loginAsAdmin() { - await this.auth.login(process.env.BB_ADMIN_USER_EMAIL, process.env.BB_ADMIN_USER_PASSWORD) + await this.auth.login( + process.env.BB_ADMIN_USER_EMAIL, + process.env.BB_ADMIN_USER_PASSWORD + ) } async login(email: string, password: string) { diff --git a/qa-core/src/config/internal-api/TestConfiguration/rows.ts b/qa-core/src/config/internal-api/TestConfiguration/rows.ts index 3514dd1b35..7269807f56 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/rows.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/rows.ts @@ -37,7 +37,10 @@ export default class RowsApi { return [response, json] } - async searchNoPagination(tableId: string, body: any): Promise<[Response, Row[]]> { + async searchNoPagination( + tableId: string, + body: any + ): Promise<[Response, Row[]]> { const response = await this.api.post(`/${tableId}/search`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) @@ -45,7 +48,10 @@ export default class RowsApi { return [response, json.rows] } - async searchWithPagination(tableId: string, body: any): Promise<[Response, Row[]]> { + async searchWithPagination( + tableId: string, + body: any + ): Promise<[Response, Row[]]> { const response = await this.api.post(`/${tableId}/search`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 12a52034cc..20909e8e86 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -4,130 +4,128 @@ import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" export default class UserManagementApi { - api: InternalAPIClient + api: InternalAPIClient - constructor(apiClient: InternalAPIClient) { - this.api = apiClient - } + constructor(apiClient: InternalAPIClient) { + this.api = apiClient + } - async search(): Promise<[Response, Partial[]]> { - const response = await this.api.post(`/global/users/search`, {}) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.data.length).toBeGreaterThan(0) - return [response, json] - } + async search(): Promise<[Response, Partial[]]> { + const response = await this.api.post(`/global/users/search`, {}) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.data.length).toBeGreaterThan(0) + return [response, json] + } - async getSelf(): Promise<[Response, Partial]> { - const response = await this.api.get(`/global/self`) - const json = await response.json() - expect(response).toHaveStatusCode(200) - return [response, json] - } + async getSelf(): Promise<[Response, Partial]> { + const response = await this.api.get(`/global/self`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } - async getAll(): Promise<[Response, Partial[]]> { - const response = await this.api.get(`/global/users`) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.length).toBeGreaterThan(0) - return [response, json] - } + async getAll(): Promise<[Response, Partial[]]> { + const response = await this.api.get(`/global/users`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.length).toBeGreaterThan(0) + return [response, json] + } - // This endpoint is used for one or more users when we want add users with passwords set. - async addMultiple(userList: Partial[]): Promise<[Response, any]> { - const body = { - create: { - users: userList, - groups: [] - } - } - const response = await this.api.post(`/global/users/bulk`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.created.unsuccessful.length).toEqual(0) - expect(json.created.successful.length).toEqual(body.create.users.length) - return [response, json] + // This endpoint is used for one or more users when we want add users with passwords set. + async addMultiple(userList: Partial[]): Promise<[Response, any]> { + const body = { + create: { + users: userList, + groups: [], + }, } + const response = await this.api.post(`/global/users/bulk`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.created.unsuccessful.length).toEqual(0) + expect(json.created.successful.length).toEqual(body.create.users.length) + return [response, json] + } - async deleteMultiple(userId: string[]): Promise<[Response, responseMessage]> { - const body = { - delete: { - userIds: [ - userId - ] - } - } - const response = await this.api.post(`/global/users/bulk`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.deleted.successful.length).toEqual(1) - expect(json.deleted.unsuccessful.length).toEqual(0) - expect(json.deleted.successful[0].userId).toEqual(userId) - return [response, json] - } - async delete(userId: string): Promise<[Response, UserDeletedEvent]> { - const response = await this.api.del(`/global/users/${userId}`) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.message).toEqual(`User ${userId} deleted.`) - return [response, json] + async deleteMultiple(userId: string[]): Promise<[Response, responseMessage]> { + const body = { + delete: { + userIds: [userId], + }, } + const response = await this.api.post(`/global/users/bulk`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.deleted.successful.length).toEqual(1) + expect(json.deleted.unsuccessful.length).toEqual(0) + expect(json.deleted.successful[0].userId).toEqual(userId) + return [response, json] + } + async delete(userId: string): Promise<[Response, UserDeletedEvent]> { + const response = await this.api.del(`/global/users/${userId}`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.message).toEqual(`User ${userId} deleted.`) + return [response, json] + } - async invite(body: any): Promise<[Response, responseMessage]> { - const response = await this.api.post(`/global/users/multi/invite`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json.unsuccessful.length).toEqual(0) - expect(json.successful.length).toEqual(body.length) + async invite(body: any): Promise<[Response, responseMessage]> { + const response = await this.api.post(`/global/users/multi/invite`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.unsuccessful.length).toEqual(0) + expect(json.successful.length).toEqual(body.length) - return [response, json] - } + return [response, json] + } - async getRoles(): Promise<[Response, Role[]]> { - const response = await this.api.get(`/roles`) - const json = await response.json() - expect(response).toHaveStatusCode(200) - return [response, json] - } + async getRoles(): Promise<[Response, Role[]]> { + const response = await this.api.get(`/roles`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } - async updateInfo(body: any): Promise<[Response, User]> { - const response = await this.api.post(`/global/users/`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json._id).toEqual(body._id) - expect(json._rev).not.toEqual(body._rev) - return [response, json] - } + async updateInfo(body: any): Promise<[Response, User]> { + const response = await this.api.post(`/global/users/`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) + return [response, json] + } - async forcePasswordReset(body: any): Promise<[Response, User]> { - const response = await this.api.post(`/global/users/`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json._id).toEqual(body._id) - expect(json._rev).not.toEqual(body._rev) - return [response, json] - } + async forcePasswordReset(body: any): Promise<[Response, User]> { + const response = await this.api.post(`/global/users/`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) + return [response, json] + } - async getInfo(userId: string): Promise<[Response, User]> { - const response = await this.api.get(`/global/users/${userId}`) - const json = await response.json() - expect(response).toHaveStatusCode(200) - return [response, json] - } + async getInfo(userId: string): Promise<[Response, User]> { + const response = await this.api.get(`/global/users/${userId}`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } - async changeSelfPassword(body: Partial): Promise<[Response, User]> { - const response = await this.api.post(`/global/self`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - expect(json._id).toEqual(body._id) - expect(json._rev).not.toEqual(body._rev) - return [response, json] - } + async changeSelfPassword(body: Partial): Promise<[Response, User]> { + const response = await this.api.post(`/global/self`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) + return [response, json] + } - async createRole(body: Partial): Promise<[Response, UserRoles]> { - const response = await this.api.post(`/roles`, { body }) - const json = await response.json() - expect(response).toHaveStatusCode(200) - return [response, json] - } -} \ No newline at end of file + async createRole(body: Partial): Promise<[Response, UserRoles]> { + const response = await this.api.post(`/roles`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } +} diff --git a/qa-core/src/config/internal-api/fixtures/applications.ts b/qa-core/src/config/internal-api/fixtures/applications.ts index 0ce69bb889..45d82cf4f0 100644 --- a/qa-core/src/config/internal-api/fixtures/applications.ts +++ b/qa-core/src/config/internal-api/fixtures/applications.ts @@ -13,13 +13,12 @@ export const generateApp = ( // Applications type doesn't work here, save to add useTemplate parameter? export const appFromTemplate = (): any => { - return ({ + return { name: generator.word(), url: `/${generator.word()}`, useTemplate: "true", templateName: "Near Miss Register", templateKey: "app/near-miss-register", templateFile: undefined, - }) + } } - diff --git a/qa-core/src/config/internal-api/fixtures/rows.ts b/qa-core/src/config/internal-api/fixtures/rows.ts index fbb965c215..f1f1c00493 100644 --- a/qa-core/src/config/internal-api/fixtures/rows.ts +++ b/qa-core/src/config/internal-api/fixtures/rows.ts @@ -27,6 +27,6 @@ export const searchBody = (primaryDisplay: string): any => { }, sort: primaryDisplay, sortOrder: "ascending", - sortType: "string" + sortType: "string", } -} \ No newline at end of file +} diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index c036589089..90ea6bd738 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -1,80 +1,82 @@ -import generator from "../../generator"; -import { User } from "@budibase/types"; - +import generator from "../../generator" +import { User } from "@budibase/types" const generateDeveloper = (): Partial => { - const randomId = generator.guid(); - return ({ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - builder: { - global: true - } - }) + const randomId = generator.guid() + return { + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + builder: { + global: true, + }, + } } const generateAdmin = (): Partial => { - const randomId = generator.guid(); - return ({ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: true - }, - builder: { - global: true - } - }) + const randomId = generator.guid() + return { + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: true, + }, + builder: { + global: true, + }, + } } const generateAppUser = (): Partial => { - const randomId = generator.guid(); - return ({ - email: `pedro+${randomId}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: false - }, - builder: { - global: false - } - }) - + const randomId = generator.guid() + return { + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: false, + }, + builder: { + global: false, + }, + } } export const generateInviteUser = (): Object[] => { - const randomId = generator.guid(); - return [{ - email: `pedro+${randomId}@budibase.com`, - userInfo: { - userGroups: [] - } - }] - + const randomId = generator.guid() + return [ + { + email: `pedro+${randomId}@budibase.com`, + userInfo: { + userGroups: [], + }, + }, + ] } -export const generateUser = (amount: number = 1, role?: string): Partial[] => { - const userList: Partial[] = []; - for (let i = 0; i < amount; i++) { - switch (role) { - case "admin": - userList.push(generateAdmin()); - break; - case "developer": - userList.push(generateDeveloper()); - break; - case "appUser": - userList.push(generateAppUser()); - break; - default: - userList.push(generateAppUser()); - break; - } +export const generateUser = ( + amount: number = 1, + role?: string +): Partial[] => { + const userList: Partial[] = [] + for (let i = 0; i < amount; i++) { + switch (role) { + case "admin": + userList.push(generateAdmin()) + break + case "developer": + userList.push(generateDeveloper()) + break + case "appUser": + userList.push(generateAppUser()) + break + default: + userList.push(generateAppUser()) + break } - return userList -} \ No newline at end of file + } + return userList +} diff --git a/qa-core/src/tests/internal-api/applications/applications.spec.ts b/qa-core/src/tests/internal-api/applications/applications.spec.ts index e0e07e3fba..e7692740b8 100644 --- a/qa-core/src/tests/internal-api/applications/applications.spec.ts +++ b/qa-core/src/tests/internal-api/applications/applications.spec.ts @@ -2,7 +2,10 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" import { db } from "@budibase/backend-core" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import { generateApp, appFromTemplate } from "../../../config/internal-api/fixtures/applications" +import { + generateApp, + appFromTemplate, +} from "../../../config/internal-api/fixtures/applications" import generator from "../../../config/generator" import generateScreen from "../../../config/internal-api/fixtures/screens" @@ -18,7 +21,6 @@ describe("Internal API - Application creation, update, publish and delete", () = await config.afterAll() }) - it("Get applications without applications", async () => { await config.applications.fetchEmptyAppList() }) diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts index 2e4292afa8..ee3e97afc6 100644 --- a/qa-core/src/tests/internal-api/screens/screens.spec.ts +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -1,7 +1,10 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { App } from "@budibase/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import { generateApp, appFromTemplate } from "../../../config/internal-api/fixtures/applications" +import { + generateApp, + appFromTemplate, +} from "../../../config/internal-api/fixtures/applications" import { Screen } from "@budibase/types" import generateScreen from "../../../config/internal-api/fixtures/screens" diff --git a/qa-core/src/tests/internal-api/tables/tables.spec.ts b/qa-core/src/tests/internal-api/tables/tables.spec.ts index c6dd4ebf3d..7d79330304 100644 --- a/qa-core/src/tests/internal-api/tables/tables.spec.ts +++ b/qa-core/src/tests/internal-api/tables/tables.spec.ts @@ -6,7 +6,10 @@ import { generateTable, generateNewColumnForTable, } from "../../../config/internal-api/fixtures/table" -import { generateNewRowForTable, searchBody } from "../../../config/internal-api/fixtures/rows" +import { + generateNewRowForTable, + searchBody, +} from "../../../config/internal-api/fixtures/rows" describe("Internal API - Table Operations", () => { const api = new InternalAPIClient() @@ -119,7 +122,10 @@ describe("Internal API - Table Operations", () => { await config.rows.add(addColumnData._id, newRow) //Search single row - await config.rows.searchNoPagination(createdTableData._id, searchBody(createdTableData.primaryDisplay)) + await config.rows.searchNoPagination( + createdTableData._id, + searchBody(createdTableData.primaryDisplay) + ) //Add 10 more rows for (let i = 0; i < 10; i++) { @@ -128,7 +134,11 @@ describe("Internal API - Table Operations", () => { } //Search rows with pagination - const [allRowsResponse, allRowsJson] = await config.rows.searchWithPagination(createdTableData._id, searchBody(createdTableData.primaryDisplay)) + const [allRowsResponse, allRowsJson] = + await config.rows.searchWithPagination( + createdTableData._id, + searchBody(createdTableData.primaryDisplay) + ) //Delete Rows from table const rowToDelete = { @@ -140,7 +150,9 @@ describe("Internal API - Table Operations", () => { ) //Search single row - await config.rows.searchWithPagination(createdTableData._id, searchBody(createdTableData.primaryDisplay)) - + await config.rows.searchWithPagination( + createdTableData._id, + searchBody(createdTableData.primaryDisplay) + ) }) }) diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index fe985094fd..53ae78f42d 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -1,656 +1,740 @@ import TestConfiguration from "../../../config/internal-api/TestConfiguration" import { Application } from "@budibase/server/api/controllers/public/mapping/types" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" -import { generateApp, appFromTemplate } from "../../../config/internal-api/fixtures/applications" +import { + generateApp, + appFromTemplate, +} from "../../../config/internal-api/fixtures/applications" import { generateUser } from "../../../config/internal-api/fixtures/userManagement" import { User } from "@budibase/types" -import { generateNewColumnForTable, generateTable } from "../../../config/internal-api/fixtures/table" +import { + generateNewColumnForTable, + generateTable, +} from "../../../config/internal-api/fixtures/table" import generateScreen from "../../../config/internal-api/fixtures/screens" import { db } from "@budibase/backend-core" describe("Internal API - App Specific Roles & Permissions", () => { - const api = new InternalAPIClient() - const config = new TestConfiguration(api) + const api = new InternalAPIClient() + const config = new TestConfiguration(api) - // Before each test, login as admin. Some tests will require login as a different user - beforeEach(async () => { - await config.loginAsAdmin() + // Before each test, login as admin. Some tests will require login as a different user + beforeEach(async () => { + await config.loginAsAdmin() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("Add BASIC user to app", async () => { + // Create a user with BASIC role and check if it was created successfully + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + + // Add the user to the tenant. + const [createUserResponse, createUserJson] = await config.users.addMultiple( + appUser + ) + + const app = await config.applications.create(appFromTemplate()) + config.applications.api.appId = app.appId + + // Get all the information from the create user + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + + // Create the body with the information from the user and add the role to the app + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "BASIC", + }, + } + await config.users.updateInfo(body) + + // Get the user information again and check if the role was added + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + }) + + it("Add ADMIN user to app", async () => { + // Create a user with ADMIN role and check if it was created successfully + const adminUser = generateUser(1, "admin") + expect(adminUser[0].builder?.global).toEqual(true) + expect(adminUser[0].admin?.global).toEqual(true) + const [createUserResponse, createUserJson] = await config.users.addMultiple( + adminUser + ) + + const app = await config.applications.create(appFromTemplate()) + config.applications.api.appId = app.appId + + // Get all the information from the create user + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + + // Create the body with the information from the user and add the role to the app + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "ADMIN", + }, + } + await config.users.updateInfo(body) + + // Get the user information again and check if the role was added + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + + // publish app + await config.applications.publish(app.appId) + // check published app renders + config.applications.api.appId = db.getProdAppID(app.appId!) + await config.applications.canRender() + }) + + it("Add POWER user to app", async () => { + // Create a user with POWER role and check if it was created successfully + const powerUser = generateUser(1, "developer") + expect(powerUser[0].builder?.global).toEqual(true) + const [createUserResponse, createUserJson] = await config.users.addMultiple( + powerUser + ) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + // Get all the information from the create user + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + + // Create the body with the information from the user and add the role to the app + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "POWER", + }, + } + await config.users.updateInfo(body) + + // Get the user information again and check if the role was added + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + }) + + describe("Check Access for default roles", () => { + it("Check Table access for app user", async () => { + // Create a user with BASIC role and check if it was created successfully + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + // Get all the information from the create user + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + + // Create the body with the information from the user and add the role to the app + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "BASIC", + }, + } + await config.users.updateInfo(body) + + // Get the user information again and check if the role was added + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + + // Create a table + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + + // Login with the user created and try to create a column + await config.login(appUser[0].email, appUser[0].password) + const newColumn = generateNewColumnForTable(createdTableData) + await config.tables.forbiddenSave(newColumn) + await config.tables.forbiddenSave(generateTable()) }) - afterAll(async () => { - await config.afterAll() + it("Check Table access for developer", async () => { + // Create a user with POWER role and check if it was created successfully + const developer = generateUser(1, "developer") + expect(developer[0].builder?.global).toEqual(true) + + const [createUserResponse, createUserJson] = + await config.users.addMultiple(developer) + + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + // Get all the information from the create user + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + + // Create the body with the information from the user and add the role to the app + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "POWER", + }, + } + await config.users.updateInfo(body) + + // Get the user information again and check if the role was added + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + + // Create a table + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + + // Login with the user created and try to create a column + await config.login( + developer[0].email, + developer[0].password + ) + const newColumn = generateNewColumnForTable(createdTableData) + const [addColumnResponse, addColumnData] = await config.tables.save( + newColumn, + true + ) }) - it("Add BASIC user to app", async () => { - // Create a user with BASIC role and check if it was created successfully - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) + it("Check Table access for admin", async () => { + // Create a user with ADMIN role and check if it was created successfully + const adminUser = generateUser(1, "admin") + expect(adminUser[0].builder?.global).toEqual(true) + expect(adminUser[0].admin?.global).toEqual(true) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(adminUser) - // Add the user to the tenant. - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - const app = await config.applications.create(appFromTemplate()) - config.applications.api.appId = app.appId + // Get all the information from the create user + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) - // Get all the information from the create user - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + // Create the body with the information from the user and add the role to the app + const body: User = { + ...userInfoJson, + roles: { + [app.appId]: "ADMIN", + }, + } + await config.users.updateInfo(body) - // Create the body with the information from the user and add the role to the app - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "BASIC", - } - } - await config.users.updateInfo(body) + // Get the user information again and check if the role was added + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[app.appId]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") - // Get the user information again and check if the role was added - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + // Login with the created user and create a table + await config.login( + adminUser[0].email, + adminUser[0].password + ) + const [createdTableResponse, createdTableData] = await config.tables.save( + generateTable() + ) + const newColumn = generateNewColumnForTable(createdTableData) + const [addColumnResponse, addColumnData] = await config.tables.save( + newColumn, + true + ) + }) + }) + describe("Screen Access for App specific roles", () => { + it("Check Screen access for BASIC Role", async () => { + // Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: "BASIC", + }, + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("BASIC") + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with BASIC user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") }) - it("Add ADMIN user to app", async () => { - // Create a user with ADMIN role and check if it was created successfully - const adminUser = generateUser(1, "admin") - expect(adminUser[0].builder?.global).toEqual(true) - expect(adminUser[0].admin?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) + it("Check Screen access for POWER role", async () => { + // Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) - const app = await config.applications.create(appFromTemplate()) - config.applications.api.appId = app.appId + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - // Get all the information from the create user - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) - // Create the body with the information from the user and add the role to the app - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "ADMIN", - } - } - await config.users.updateInfo(body) + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: "POWER", + }, + } + await config.users.updateInfo(body) - // Get the user information again and check if the role was added - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("POWER") + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with POWER user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(2) }) - it("Add POWER user to app", async () => { - // Create a user with POWER role and check if it was created successfully - const powerUser = generateUser(1, 'developer') - expect(powerUser[0].builder?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.users.addMultiple(powerUser) + it("Check Screen access for ADMIN role", async () => { + // Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - // Get all the information from the create user - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) - // Create the body with the information from the user and add the role to the app - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "POWER", - } - } - await config.users.updateInfo(body) + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: "ADMIN", + }, + } + await config.users.updateInfo(body) - // Get the user information again and check if the role was added - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("ADMIN") + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with ADMIN user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(3) }) + }) + describe("Screen Access for custom roles", () => { + it("Custom role access for level 1 permissions", async () => { + // Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) - describe("Check Access for default roles", () => { - it("Check Table access for app user", async () => { - // Create a user with BASIC role and check if it was created successfully - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "public", + name: "level 1", + } + const [createRoleResponse, createRoleJson] = + await config.users.createRole(role) - // Get all the information from the create user - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) - // Create the body with the information from the user and add the role to the app - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "BASIC", - } - } - await config.users.updateInfo(body) + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + }, + } + await config.users.updateInfo(body) - // Get the user information again and check if the role was added - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - // Create a table - const [createdTableResponse, createdTableData] = await config.tables.save( - generateTable() - ) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) - // Login with the user created and try to create a column - await config.login(appUser[0].email, appUser[0].password) - const newColumn = generateNewColumnForTable(createdTableData) - await config.tables.forbiddenSave( - newColumn) - await config.tables.forbiddenSave(generateTable()) - }) + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) - it("Check Table access for developer", async () => { - // Create a user with POWER role and check if it was created successfully - const developer = generateUser(1, 'developer') - expect(developer[0].builder?.global).toEqual(true) + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - const [createUserResponse, createUserJson] = await config.users.addMultiple(developer) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - // Get all the information from the create user - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - - // Create the body with the information from the user and add the role to the app - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "POWER", - } - } - await config.users.updateInfo(body) - - // Get the user information again and check if the role was added - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") - - // Create a table - const [createdTableResponse, createdTableData] = await config.tables.save( - generateTable() - ) - - // Login with the user created and try to create a column - await config.login(developer[0].email, developer[0].password) - const newColumn = generateNewColumnForTable(createdTableData) - const [addColumnResponse, addColumnData] = await config.tables.save( - newColumn, - true - ) - }) - - it("Check Table access for admin", async () => { - // Create a user with ADMIN role and check if it was created successfully - const adminUser = generateUser(1, "admin") - expect(adminUser[0].builder?.global).toEqual(true) - expect(adminUser[0].admin?.global).toEqual(true) - const [createUserResponse, createUserJson] = await config.users.addMultiple(adminUser) - - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - // Get all the information from the create user - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - - // Create the body with the information from the user and add the role to the app - const body: User = { - ...userInfoJson, - roles: { - [app.appId]: "ADMIN", - } - } - await config.users.updateInfo(body) - - // Get the user information again and check if the role was added - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") - - // Login with the created user and create a table - await config.login(adminUser[0].email, adminUser[0].password) - const [createdTableResponse, createdTableData] = await config.tables.save( - generateTable() - ) - const newColumn = generateNewColumnForTable(createdTableData) - const [addColumnResponse, addColumnData] = await config.tables.save( - newColumn, - true - ) - }) + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) }) + it("Custom role access for level 2 permissions", async () => { + // Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) - describe("Screen Access for App specific roles", () => { - it("Check Screen access for BASIC Role", async () => { - // Set up user - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "read_only", + name: "level 2", + } + const [createRoleResponse, createRoleJson] = + await config.users.createRole(role) - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: "BASIC", - } - } - await config.users.updateInfo(body) + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + }, + } + await config.users.updateInfo(body) - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual("BASIC") + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) - // login with BASIC user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(1) - expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") - }) - - it("Check Screen access for POWER role", async () => { - // Set up user - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) - - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: "POWER", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual("POWER") - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) - - // login with POWER user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(2) - }) - - it("Check Screen access for ADMIN role", async () => { - // Set up user - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) - - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: "ADMIN", - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual("ADMIN") - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) - - // login with ADMIN user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(3) - }) + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) }) - describe("Screen Access for custom roles", () => { - it("Custom role access for level 1 permissions", async () => { - // Set up user - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + it("Custom role access for level 3 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId - //Create level 1 role - const role = { - inherits: "BASIC", - permissionId: "public", - name: "level 1" - } - const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "write", + name: "level 3", + } + const [createRoleResponse, createRoleJson] = + await config.users.createRole(role) + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + }, + } + await config.users.updateInfo(body) - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: createRoleJson._id, - } - } - await config.users.updateInfo(body) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) - - // login with level 1 user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(1) - }) - it("Custom role access for level 2 permissions", async () => {// Set up user - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - //Create level 1 role - const role = { - inherits: "BASIC", - permissionId: "read_only", - name: "level 2" - } - const [createRoleResponse, createRoleJson] = await config.users.createRole(role) - - - - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) - - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: createRoleJson._id, - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) - - // login with level 1 user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(1) - }) - it("Custom role access for level 3 permissions", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - //Create level 1 role - const role = { - inherits: "BASIC", - permissionId: "write", - name: "level 3" - } - const [createRoleResponse, createRoleJson] = await config.users.createRole(role) - - - - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) - - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: createRoleJson._id, - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) - - // login with level 1 user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(1) - }) - it("Custom role access for level 4 permissions", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - //Create level 1 role - const role = { - inherits: "BASIC", - permissionId: "power", - name: "level 4" - } - const [createRoleResponse, createRoleJson] = await config.users.createRole(role) - - - - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) - - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: createRoleJson._id, - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) - - // login with level 1 user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(1) - }) - it("Custom role access for level 5 permissions", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) - - // Create App - const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId - - //Create level 1 role - const role = { - inherits: "BASIC", - permissionId: "admin", - name: "level 5" - } - const [createRoleResponse, createRoleJson] = await config.users.createRole(role) - - - - // Update user roles - const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - const prodAppId = db.getProdAppID(app.appId!) - - // Roles must always be set with prod appID - const body: User = { - ...userInfoJson, - roles: { - [prodAppId]: createRoleJson._id, - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() - expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) - - await config.screen.create(generateScreen("BASIC")) - await config.screen.create(generateScreen("POWER")) - await config.screen.create(generateScreen("ADMIN")) - - await config.applications.publish(app.appId) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) - expect(firstappPackageJson.screens).toBeDefined() - expect(firstappPackageJson.screens.length).toEqual(3) - - // login with level 1 user - await config.login(appUser[0].email!, appUser[0].password!) - const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - - // fetch app package - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) - expect(appPackageJson.screens).toBeDefined() - expect(appPackageJson.screens.length).toEqual(1) - }) + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) }) + it("Custom role access for level 4 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "power", + name: "level 4", + } + const [createRoleResponse, createRoleJson] = + await config.users.createRole(role) + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + }, + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 5 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = + await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "admin", + name: "level 5", + } + const [createRoleResponse, createRoleJson] = + await config.users.createRole(role) + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + createUserJson.created.successful[0]._id + ) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + }, + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.appId) + const [firstappPackageResponse, firstappPackageJson] = + await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = + await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + }) }) diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 2290106731..fb61d5070f 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -5,91 +5,89 @@ import { generateUser } from "../../../config/internal-api/fixtures/userManageme import { User } from "@budibase/types" describe("Internal API - User Management & Permissions", () => { - const api = new InternalAPIClient() - const config = new TestConfiguration(api) + const api = new InternalAPIClient() + const config = new TestConfiguration(api) - // Before each test, login as admin. Some tests will require login as a different user - beforeEach(async () => { - await config.loginAsAdmin() - }) + // Before each test, login as admin. Some tests will require login as a different user + beforeEach(async () => { + await config.loginAsAdmin() + }) - afterAll(async () => { - await config.afterAll() - }) + afterAll(async () => { + await config.afterAll() + }) - it("Add Users with different roles", async () => { - // Get all users - await config.users.search() + it("Add Users with different roles", async () => { + // Get all users + await config.users.search() - // Get all roles - await config.users.getRoles() + // Get all roles + await config.users.getRoles() - // Add users with each role - const admin = generateUser(1, "admin") - expect(admin[0].builder?.global).toEqual(true) - expect(admin[0].admin?.global).toEqual(true) - const developer = generateUser(1, "developer") - expect(developer[0].builder?.global).toEqual(true) - const appUser = generateUser(1, "appUser") - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) + // Add users with each role + const admin = generateUser(1, "admin") + expect(admin[0].builder?.global).toEqual(true) + expect(admin[0].admin?.global).toEqual(true) + const developer = generateUser(1, "developer") + expect(developer[0].builder?.global).toEqual(true) + const appUser = generateUser(1, "appUser") + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) - const userList = [...admin, ...developer, ...appUser] + const userList = [...admin, ...developer, ...appUser] - await config.users.addMultiple(userList) + await config.users.addMultiple(userList) - // Check users are added - const [allUsersResponse, allUsersJson] = await config.users.getAll() - expect(allUsersJson.length).toBeGreaterThan(0) + // Check users are added + const [allUsersResponse, allUsersJson] = await config.users.getAll() + expect(allUsersJson.length).toBeGreaterThan(0) + }) + it("Delete User", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [userResponse, userJson] = await config.users.addMultiple(appUser) + const userId = userJson.created.successful[0]._id + await config.users.delete(userId) + }) + it("Reset Password", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [userResponse, userJson] = await config.users.addMultiple(appUser) + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + userJson.created.successful[0]._id + ) + const body: User = { + ...userInfoJson, + password: "newPassword", + } + await config.users.forcePasswordReset(body) + }) - }) - - it("Delete User", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [userResponse, userJson] = await config.users.addMultiple(appUser) - const userId = userJson.created.successful[0]._id - await config.users.delete(userId) - }) - - it("Reset Password", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [userResponse, userJson] = await config.users.addMultiple(appUser) - const [userInfoResponse, userInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - password: "newPassword" - - } - await config.users.forcePasswordReset(body) - }) - - it("Change User information", async () => { - const appUser = generateUser() - expect(appUser[0].builder?.global).toEqual(false) - expect(appUser[0].admin?.global).toEqual(false) - const [userResponse, userJson] = await config.users.addMultiple(appUser) - const [userInfoResponse, userInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) - const body: User = { - ...userInfoJson, - firstName: "newFirstName", - lastName: "newLastName", - builder: { - global: true - } - } - await config.users.updateInfo(body) - - const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(userJson.created.successful[0]._id) - expect(changedUserInfoJson.builder?.global).toBeDefined() - expect(changedUserInfoJson.builder?.global).toEqual(true) - }) - - + it("Change User information", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [userResponse, userJson] = await config.users.addMultiple(appUser) + const [userInfoResponse, userInfoJson] = await config.users.getInfo( + userJson.created.successful[0]._id + ) + const body: User = { + ...userInfoJson, + firstName: "newFirstName", + lastName: "newLastName", + builder: { + global: true, + }, + } + await config.users.updateInfo(body) + const [changedUserInfoResponse, changedUserInfoJson] = + await config.users.getInfo(userJson.created.successful[0]._id) + expect(changedUserInfoJson.builder?.global).toBeDefined() + expect(changedUserInfoJson.builder?.global).toEqual(true) + }) }) diff --git a/qa-core/src/tests/public-api/applications/applications.spec.ts b/qa-core/src/tests/public-api/applications/applications.spec.ts index ae0be01b75..cf85e6daf2 100644 --- a/qa-core/src/tests/public-api/applications/applications.spec.ts +++ b/qa-core/src/tests/public-api/applications/applications.spec.ts @@ -73,15 +73,15 @@ describe("Public API - /applications endpoints", () => { }) it("POST - unpublish an unpublished application", async () => { - const [response] = await config.applications.unpublish( - config.context._id - ) + const [response] = await config.applications.unpublish(config.context._id) expect(response).toHaveStatusCode(400) }) it("DELETE - delete a published application and the dev application", async () => { await config.applications.publish(config.context._id) - const [response, deletion] = await config.applications.delete(config.context._id) + const [response, deletion] = await config.applications.delete( + config.context._id + ) expect(response).toHaveStatusCode(200) expect(deletion._id).toEqual(config.context._id) diff --git a/tsconfig.json b/tsconfig.json index a0a2cc5905..8382281d99 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ { "path": "./packages/types" }, { "path": "./packages/backend-core" }, { "path": "./packages/server" }, - { "path": "./packages/worker" }, + { "path": "./packages/worker" } ], "files" :[] } \ No newline at end of file