From 701e2ff860af721c9944670abb07e9ddc6d15b7b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 6 Jan 2023 16:41:45 +0000 Subject: [PATCH 01/55] Types and stubs for environment variables feature. --- packages/backend-core/yarn.lock | 5 ----- .../src/api/web/global/environmentVariables.ts | 14 ++++++++++++++ packages/types/src/api/web/global/index.ts | 1 + packages/types/src/api/web/index.ts | 1 + .../src/documents/global/environmentVariables.ts | 16 ++++++++++++++++ packages/types/src/documents/global/index.ts | 1 + 6 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 packages/types/src/api/web/global/environmentVariables.ts create mode 100644 packages/types/src/api/web/global/index.ts create mode 100644 packages/types/src/documents/global/environmentVariables.ts diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock index db3857101e..5f25c6ba8e 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.13": - version "2.2.10-alpha.13" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.10-alpha.13.tgz#abc1a5bd9295a0fa63db67912c6520d12e8d6f66" - integrity sha512-XRmLQXCLKdOADxEoGB3h4QOrHlPIqbk9jOSxyOK2RDQIy8NdQ+aXanPw3TEHkgrDIYxrClVcf4KXrujqNnrk6g== - "@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" diff --git a/packages/types/src/api/web/global/environmentVariables.ts b/packages/types/src/api/web/global/environmentVariables.ts new file mode 100644 index 0000000000..9c39f1c239 --- /dev/null +++ b/packages/types/src/api/web/global/environmentVariables.ts @@ -0,0 +1,14 @@ +export interface CreateEnvironmentVariableRequest { + name: string + production: string + development: string +} + +export interface UpdateEnvironmentVariableRequest { + production: string + development: string +} + +export interface GetEnvironmentVariablesResponse { + variables: string[] +} diff --git a/packages/types/src/api/web/global/index.ts b/packages/types/src/api/web/global/index.ts new file mode 100644 index 0000000000..a99934c39c --- /dev/null +++ b/packages/types/src/api/web/global/index.ts @@ -0,0 +1 @@ +export * from "./environmentVariables" diff --git a/packages/types/src/api/web/index.ts b/packages/types/src/api/web/index.ts index 1dbe22aa46..9688a89c7b 100644 --- a/packages/types/src/api/web/index.ts +++ b/packages/types/src/api/web/index.ts @@ -3,3 +3,4 @@ export * from "./user" export * from "./errors" export * from "./schedule" export * from "./app" +export * from "./global" diff --git a/packages/types/src/documents/global/environmentVariables.ts b/packages/types/src/documents/global/environmentVariables.ts new file mode 100644 index 0000000000..62bd1e5633 --- /dev/null +++ b/packages/types/src/documents/global/environmentVariables.ts @@ -0,0 +1,16 @@ +import { Document } from "../document" + +export interface EnvironmentVariablesDoc extends Document { + variables: string +} + +export type EnvironmentVariableValue = { + production: string + development: string +} + +// what comes out of the "variables" when it is decrypted +export type EnvironmentVariablesDecrypted = Record< + string, + EnvironmentVariableValue +> diff --git a/packages/types/src/documents/global/index.ts b/packages/types/src/documents/global/index.ts index 40a30ee477..11ce7513f2 100644 --- a/packages/types/src/documents/global/index.ts +++ b/packages/types/src/documents/global/index.ts @@ -5,3 +5,4 @@ export * from "./plugin" export * from "./quotas" export * from "./schedule" export * from "./templates" +export * from "./environmentVariables" From c9d8668062898855420bab2f77c1d5b6a95bd1af Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 9 Jan 2023 15:42:09 +0000 Subject: [PATCH 02/55] Licensing updates for environment variables. --- packages/backend-core/src/constants/db.ts | 1 + packages/server/src/api/routes/index.ts | 2 ++ packages/types/src/sdk/licensing/feature.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/packages/backend-core/src/constants/db.ts b/packages/backend-core/src/constants/db.ts index 92392457d6..f7d15b3880 100644 --- a/packages/backend-core/src/constants/db.ts +++ b/packages/backend-core/src/constants/db.ts @@ -77,6 +77,7 @@ export const StaticDatabases = { apiKeys: "apikeys", usageQuota: "usage_quota", licenseInfo: "license_info", + environmentVariables: "environmentvariables", }, }, // contains information about tenancy and so on diff --git a/packages/server/src/api/routes/index.ts b/packages/server/src/api/routes/index.ts index 8d6b1754a7..9dc119ec83 100644 --- a/packages/server/src/api/routes/index.ts +++ b/packages/server/src/api/routes/index.ts @@ -33,6 +33,7 @@ export { default as publicRoutes } from "./public" const appBackupRoutes = pro.appBackups const scheduleRoutes = pro.schedules +const environmentVariableRoutes = pro.environmentVariables export const mainRoutes: Router[] = [ appBackupRoutes, @@ -63,6 +64,7 @@ export const mainRoutes: Router[] = [ migrationRoutes, pluginRoutes, scheduleRoutes, + environmentVariableRoutes, // these need to be handled last as they still use /api/:tableId // this could be breaking as koa may recognise other routes as this tableRoutes, diff --git a/packages/types/src/sdk/licensing/feature.ts b/packages/types/src/sdk/licensing/feature.ts index f06a8d1382..a39bcab18b 100644 --- a/packages/types/src/sdk/licensing/feature.ts +++ b/packages/types/src/sdk/licensing/feature.ts @@ -1,4 +1,5 @@ export enum Feature { USER_GROUPS = "userGroups", APP_BACKUPS = "appBackups", + ENVIRONMENT_VARIABLES = "environmentVariables", } From 7378d21fea565c388759ba4964cfcf58039738b8 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 9 Jan 2023 16:48:39 +0000 Subject: [PATCH 03/55] environment variables ui boilerplate --- .../portal/manage/envVars/index.svelte | 39 +++++++++++++++++++ packages/builder/src/stores/portal/envVars.js | 20 ++++++++++ packages/frontend-core/src/api/envVars.js | 11 ++++++ 3 files changed, 70 insertions(+) create mode 100644 packages/builder/src/pages/builder/portal/manage/envVars/index.svelte create mode 100644 packages/builder/src/stores/portal/envVars.js create mode 100644 packages/frontend-core/src/api/envVars.js diff --git a/packages/builder/src/pages/builder/portal/manage/envVars/index.svelte b/packages/builder/src/pages/builder/portal/manage/envVars/index.svelte new file mode 100644 index 0000000000..9fb19fe676 --- /dev/null +++ b/packages/builder/src/pages/builder/portal/manage/envVars/index.svelte @@ -0,0 +1,39 @@ + + + + + Envrironment Variables + Add and manage environment variable for development and production + + + + {#each $envVars as envVar} + + {envVar} + + + {/each} + + + + diff --git a/packages/builder/src/stores/portal/envVars.js b/packages/builder/src/stores/portal/envVars.js new file mode 100644 index 0000000000..9c9880511a --- /dev/null +++ b/packages/builder/src/stores/portal/envVars.js @@ -0,0 +1,20 @@ +import { writable } from "svelte/store" +import { API } from "api" + +export function createEnvVarsStore() { + const { subscribe, set, update } = writable([]) + + async function load() { + const envVars = await API.fetchEnvVars() + + let testVars = ['blah', 'blah123'] + set(testVars) + } + + return { + subscribe, + load, + } +} + +export const envVars = createEnvVarsStore() diff --git a/packages/frontend-core/src/api/envVars.js b/packages/frontend-core/src/api/envVars.js new file mode 100644 index 0000000000..5f02a2b889 --- /dev/null +++ b/packages/frontend-core/src/api/envVars.js @@ -0,0 +1,11 @@ +export const buildEnvironmentVariableEndpoints = API => ({ + /** + * Fetches a list of environment variables + */ + fetchEnvVars: async () => { + return await API.get({ + url: `/api/env/variables`, + json: false, + }) + } +}) From 7a78a0bf669dbeb0b2438651f78a61ef06886bfd Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 9 Jan 2023 16:49:29 +0000 Subject: [PATCH 04/55] more boilerplate --- packages/builder/src/pages/builder/portal/_layout.svelte | 4 ++++ .../portal/{manage/envVars => environment}/index.svelte | 0 2 files changed, 4 insertions(+) rename packages/builder/src/pages/builder/portal/{manage/envVars => environment}/index.svelte (100%) diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index 99a140f16a..a4bd22a692 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -53,6 +53,10 @@ title: "Plugins", href: "/builder/portal/plugins", }, + { + title: "Environment", + href: "/builder/portal/environment", + }, ] // Admin only pages diff --git a/packages/builder/src/pages/builder/portal/manage/envVars/index.svelte b/packages/builder/src/pages/builder/portal/environment/index.svelte similarity index 100% rename from packages/builder/src/pages/builder/portal/manage/envVars/index.svelte rename to packages/builder/src/pages/builder/portal/environment/index.svelte From 03df57d077254c9e99c858c63bb20216a2b4ec17 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 11 Jan 2023 17:57:51 +0000 Subject: [PATCH 05/55] Adding in basic implementation of variable usage, getting from pro and enriching through new datasource SDK. --- .../backend-core/src/security/encryption.ts | 8 +- packages/builder/src/stores/portal/envVars.js | 20 +- packages/builder/yarn.lock | 1018 +---------------- packages/frontend-core/src/api/envVars.js | 18 +- packages/server/__mocks__/node-fetch.ts | 2 + .../server/src/api/controllers/datasource.ts | 13 +- .../server/src/api/controllers/query/index.ts | 23 +- .../api/controllers/row/ExternalRequest.ts | 4 +- .../src/api/controllers/row/external.ts | 7 +- .../server/src/api/controllers/row/utils.ts | 4 +- .../src/api/controllers/static/index.ts | 37 +- .../src/api/controllers/table/external.ts | 14 +- .../server/src/integrations/base/query.ts | 4 +- .../src/sdk/app/datasources/datasources.ts | 24 + .../server/src/sdk/app/datasources/index.ts | 5 + packages/server/src/sdk/app/tables/index.ts | 9 +- packages/server/src/sdk/index.ts | 2 + packages/server/src/threads/query.ts | 5 +- .../types/src/documents/app/datasource.ts | 2 +- 19 files changed, 136 insertions(+), 1083 deletions(-) create mode 100644 packages/server/src/sdk/app/datasources/datasources.ts create mode 100644 packages/server/src/sdk/app/datasources/index.ts diff --git a/packages/backend-core/src/security/encryption.ts b/packages/backend-core/src/security/encryption.ts index a9006f302d..c673263202 100644 --- a/packages/backend-core/src/security/encryption.ts +++ b/packages/backend-core/src/security/encryption.ts @@ -12,9 +12,9 @@ function stretchString(string: string, salt: Buffer) { return crypto.pbkdf2Sync(string, salt, ITERATIONS, STRETCH_LENGTH, "sha512") } -export function encrypt(input: string) { +export function encrypt(input: string, secret: string | undefined = SECRET) { const salt = crypto.randomBytes(RANDOM_BYTES) - const stretched = stretchString(SECRET!, salt) + const stretched = stretchString(secret!, salt) const cipher = crypto.createCipheriv(ALGO, stretched, salt) const base = cipher.update(input) const final = cipher.final() @@ -22,10 +22,10 @@ export function encrypt(input: string) { return `${salt.toString("hex")}${SEPARATOR}${encrypted}` } -export function decrypt(input: string) { +export function decrypt(input: string, secret: string | undefined = SECRET) { const [salt, encrypted] = input.split(SEPARATOR) const saltBuffer = Buffer.from(salt, "hex") - const stretched = stretchString(SECRET!, saltBuffer) + const stretched = stretchString(secret!, saltBuffer) const decipher = crypto.createDecipheriv(ALGO, stretched, saltBuffer) const base = decipher.update(Buffer.from(encrypted, "hex")) const final = decipher.final() diff --git a/packages/builder/src/stores/portal/envVars.js b/packages/builder/src/stores/portal/envVars.js index 9c9880511a..00cae9e59a 100644 --- a/packages/builder/src/stores/portal/envVars.js +++ b/packages/builder/src/stores/portal/envVars.js @@ -2,19 +2,19 @@ import { writable } from "svelte/store" import { API } from "api" export function createEnvVarsStore() { - const { subscribe, set, update } = writable([]) + const { subscribe, set, update } = writable([]) - async function load() { - const envVars = await API.fetchEnvVars() + async function load() { + const envVars = await API.fetchEnvVars() - let testVars = ['blah', 'blah123'] - set(testVars) - } + let testVars = ["blah", "blah123"] + set(testVars) + } - return { - subscribe, - load, - } + return { + subscribe, + load, + } } export const envVars = createEnvVarsStore() diff --git a/packages/builder/yarn.lock b/packages/builder/yarn.lock index 90d60e4cf7..bf3f7defb7 100644 --- a/packages/builder/yarn.lock +++ b/packages/builder/yarn.lock @@ -2,11 +2,6 @@ # yarn lockfile v1 -"@adobe/spectrum-css-workflow-icons@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@adobe/spectrum-css-workflow-icons/-/spectrum-css-workflow-icons-1.2.1.tgz#7e2cb3fcfb5c8b12d7275afafbb6ec44913551b4" - integrity sha512-uVgekyBXnOVkxp+CUssjN/gefARtudZC8duEn1vm0lBQFwGRZFlDEzU1QC+aIRWCrD1Z8OgRpmBYlSZ7QS003w== - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" @@ -920,136 +915,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/bbui@2.2.10-alpha.13": - version "2.2.10-alpha.13" - resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-2.2.10-alpha.13.tgz#42bf24c5df4cea74a69fba571423fcf4527f16fa" - integrity sha512-l6TYaqizIxjIonqgyYewsEvWK+H+xwKTrJrQTHSsw5MWxKY+MZoh+i+pUM5tQKwpG0Z6kg3iZSYvm0GUk3HGFw== - dependencies: - "@adobe/spectrum-css-workflow-icons" "1.2.1" - "@budibase/string-templates" "2.2.10-alpha.13" - "@spectrum-css/actionbutton" "1.0.1" - "@spectrum-css/actiongroup" "1.0.1" - "@spectrum-css/avatar" "3.0.2" - "@spectrum-css/button" "3.0.1" - "@spectrum-css/buttongroup" "3.0.2" - "@spectrum-css/checkbox" "3.0.2" - "@spectrum-css/dialog" "3.0.1" - "@spectrum-css/divider" "1.0.3" - "@spectrum-css/dropzone" "3.0.2" - "@spectrum-css/fieldgroup" "3.0.2" - "@spectrum-css/fieldlabel" "3.0.1" - "@spectrum-css/icon" "3.0.1" - "@spectrum-css/illustratedmessage" "3.0.2" - "@spectrum-css/inlinealert" "2.0.1" - "@spectrum-css/inputgroup" "3.0.2" - "@spectrum-css/label" "2.0.10" - "@spectrum-css/link" "3.1.1" - "@spectrum-css/menu" "3.0.1" - "@spectrum-css/modal" "3.0.1" - "@spectrum-css/pagination" "3.0.3" - "@spectrum-css/picker" "1.0.1" - "@spectrum-css/popover" "3.0.1" - "@spectrum-css/progressbar" "1.0.2" - "@spectrum-css/progresscircle" "1.0.2" - "@spectrum-css/radio" "3.0.2" - "@spectrum-css/search" "3.0.2" - "@spectrum-css/sidenav" "3.0.2" - "@spectrum-css/slider" "3.0.1" - "@spectrum-css/statuslight" "3.0.2" - "@spectrum-css/stepper" "3.0.3" - "@spectrum-css/switch" "1.0.2" - "@spectrum-css/table" "3.0.1" - "@spectrum-css/tabs" "3.2.12" - "@spectrum-css/tags" "3.0.2" - "@spectrum-css/textfield" "3.0.1" - "@spectrum-css/toast" "3.0.1" - "@spectrum-css/tooltip" "3.0.3" - "@spectrum-css/treeview" "3.0.2" - "@spectrum-css/typography" "3.0.1" - "@spectrum-css/underlay" "2.0.9" - "@spectrum-css/vars" "3.0.1" - dayjs "^1.10.4" - easymde "^2.16.1" - svelte-flatpickr "^3.2.3" - svelte-portal "^1.0.0" - -"@budibase/client@2.2.10-alpha.13": - version "2.2.10-alpha.13" - resolved "https://registry.yarnpkg.com/@budibase/client/-/client-2.2.10-alpha.13.tgz#85983fa69b4079e56002e05428bcc832796ddd79" - integrity sha512-TsvIuy0RpjQ+SH7JYpqpdlPjinsv0fownpTlAIXxV/ig9GpS9wGtPIo9+ai45axtUcnAuvwFzNYLBF8j0NirvA== - dependencies: - "@budibase/bbui" "2.2.10-alpha.13" - "@budibase/frontend-core" "2.2.10-alpha.13" - "@budibase/string-templates" "2.2.10-alpha.13" - "@spectrum-css/button" "^3.0.3" - "@spectrum-css/card" "^3.0.3" - "@spectrum-css/divider" "^1.0.3" - "@spectrum-css/link" "^3.1.3" - "@spectrum-css/page" "^3.0.1" - "@spectrum-css/tag" "^3.1.4" - "@spectrum-css/typography" "^3.0.2" - "@spectrum-css/vars" "^3.0.1" - apexcharts "^3.22.1" - dayjs "^1.10.5" - downloadjs "1.4.7" - html5-qrcode "^2.2.1" - leaflet "^1.7.1" - regexparam "^1.3.0" - sanitize-html "^2.7.0" - screenfull "^6.0.1" - shortid "^2.2.15" - socket.io-client "^4.5.1" - svelte "^3.49.0" - svelte-apexcharts "^1.0.2" - svelte-flatpickr "^3.1.0" - svelte-spa-router "^3.0.5" - -"@budibase/frontend-core@2.2.10-alpha.13": - version "2.2.10-alpha.13" - resolved "https://registry.yarnpkg.com/@budibase/frontend-core/-/frontend-core-2.2.10-alpha.13.tgz#b6f49e65532eee31a19a6991740c9f55220271a9" - integrity sha512-iXDtSec2VHbDFwLkXOm7L8oah1CDBd3rrNbEnkL/8FyAIeguLp5iSwojtTWZ+wn+ZRa7yLwQDdqXIGVkj1XahA== - dependencies: - "@budibase/bbui" "2.2.10-alpha.13" - lodash "^4.17.21" - svelte "^3.46.2" - -"@budibase/handlebars-helpers@^0.11.8": - version "0.11.8" - resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.8.tgz#6953d29673a8c5c407e096c0a84890465c7ce841" - integrity sha512-ggWJUt0GqsHFAEup5tlWlcrmYML57nKhpNGGLzVsqXVYN8eVmf3xluYmmMe7fDYhQH0leSprrdEXmsdFQF3HAQ== - dependencies: - array-sort "^1.0.0" - define-property "^2.0.2" - extend-shallow "^3.0.2" - for-in "^1.0.2" - get-object "^0.2.0" - get-value "^3.0.1" - handlebars "^4.7.7" - handlebars-utils "^1.0.6" - has-value "^2.0.2" - helper-md "^0.2.2" - html-tag "^2.0.0" - is-even "^1.0.0" - is-glob "^4.0.1" - kind-of "^6.0.3" - micromatch "^3.1.5" - relative "^3.0.2" - striptags "^3.1.1" - to-gfm-code-block "^0.1.1" - year "^0.2.1" - -"@budibase/string-templates@2.2.10-alpha.13": - version "2.2.10-alpha.13" - resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-2.2.10-alpha.13.tgz#5b8c21542c0f9e7ec23ae266dbf7de30b45e82e2" - integrity sha512-RbFz9ARAqx/LrR74QTy/DuDRFkOsUkQh5sHpiecpmTSvGAXcS7NGDGSKQUaDrDP0pCtYrBD5mfEeFdD00YdYrQ== - dependencies: - "@budibase/handlebars-helpers" "^0.11.8" - dayjs "^1.10.4" - handlebars "^4.7.6" - handlebars-utils "^1.0.6" - lodash "^4.17.20" - vm2 "^3.9.4" - "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -1491,130 +1356,6 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@socket.io/component-emitter@~3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" - integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg== - -"@spectrum-css/actionbutton@1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/actionbutton/-/actionbutton-1.0.1.tgz#9c75da37ea6915919fb574c74bd60dacc03b6577" - integrity sha512-AUqtyNabHF451Aj9i3xz82TxS5Z6k1dttA68/1hMeU9kbPCSS4P6Viw3vaRGs9CSspuR8xnnhDgrq+F+zMy2Hw== - -"@spectrum-css/actiongroup@1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/actiongroup/-/actiongroup-1.0.1.tgz#b95b86e7af229e90fe1e70399d8d4b547b4bd31c" - integrity sha512-5Q6uMjzv5BFA2TwGASr/jAtJpTWl26fhWvgGY8kOA0RCSij35l+YJg/FPXf6Nnj2qCOl8DkNycjT9YXJ+bhyVA== - -"@spectrum-css/avatar@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/avatar/-/avatar-3.0.2.tgz#4f1826223eae330e64b6d3cc899e9bc2e98dac95" - integrity sha512-wEczvSqxttTWSiL3cOvXV/RmGRwSkw2w6+slcHhnf0kb7ovymMM+9oz8vvEpEsSeo5u598bc+7ktrKFpAd6soQ== - -"@spectrum-css/button@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/button/-/button-3.0.1.tgz#6db8c3e851baecd0f1c2d88fef37d49d01c6e643" - integrity sha512-YXrBtjIYisk4Vaxnp0RiE4gdElQX04P2mc4Pi2GlQ27dJKlHmufYcF+kAqGdtiyK5yjdN/vKRcC8y13aA4rusA== - -"@spectrum-css/button@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@spectrum-css/button/-/button-3.0.3.tgz#2df1efaab6c7e0b3b06cb4b59e1eae59c7f1fc84" - integrity sha512-6CnLPqqtaU/PcSSIGeGRi0iFIIxIUByYLKFO6zn5NEUc12KQ28dJ4PLwB6WBa0L8vRoAGlnWWH2ZZweTijbXgg== - -"@spectrum-css/buttongroup@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/buttongroup/-/buttongroup-3.0.2.tgz#fd3387973ca3131609e32112de42a1c0400a48d8" - integrity sha512-Wu7B4GJ/SAeVHz9SUGAkeIH8pLaZh4t+w2ykSKOPQIRuK2jCBoudkEClVxviNVwqekccf5XLFXg9GpYF1a3Uaw== - -"@spectrum-css/card@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@spectrum-css/card/-/card-3.0.3.tgz#56b2e2da6b80c1583228baa279de7407383bfb6b" - integrity sha512-+oKLUI2a0QmQP9EzySeq/G4FpUkkdaDNbuEbqCj2IkPMc/2v/nwzsPhh1fj2UIghGAiiUwXfPpzax1e8fyhQUg== - -"@spectrum-css/checkbox@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/checkbox/-/checkbox-3.0.2.tgz#53ca2fba0d9faa1fead10e7206eb1f6cdcfd6ddd" - integrity sha512-hPbGcnm7kJvJS4jp/P/bdaZvbyR1eIE9mteuZqcBgdmyp9m/k6+mW5jmsbtqb3Y4mMPWvOJFfz/sIvWJP0F0Zg== - -"@spectrum-css/dialog@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/dialog/-/dialog-3.0.1.tgz#33aae036282159f6aa998848b8c0828640a9620a" - integrity sha512-hUFbRR6RGT63MNuP7wP+k9KU+uRuICsduMihskh700e+jiQ+Gsv53fBFDlB843FoZYlIXzFQXgtjMUC5a4Qibw== - -"@spectrum-css/divider@1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@spectrum-css/divider/-/divider-1.0.3.tgz#639e2ebaa0834efa40f42397668bbd5c153ea385" - integrity sha512-Zy4Rn40w8UtzMh3wx/U9+CepSCpm1aOCGftHgWDub0XZuVTzh0c1WwyzTuLCx2Hf21z5VRGNiDh8bGEEzSbtNA== - dependencies: - "@spectrum-css/vars" "^3.0.2" - -"@spectrum-css/divider@^1.0.3": - version "1.0.27" - resolved "https://registry.yarnpkg.com/@spectrum-css/divider/-/divider-1.0.27.tgz#435bf738a65b4eb15c899edf5c536bea22f2d679" - integrity sha512-hWKPHOEo9lkOGN5zecpVVwVxE3x0SJHQJKDNx1g0xs/P/AthAboK+L1c9Rq29czNfcQ2kUjumi4igzQzcqABMQ== - dependencies: - "@spectrum-css/vars" "^8.0.0" - -"@spectrum-css/dropzone@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/dropzone/-/dropzone-3.0.2.tgz#34f137851054442b219fed7f32006b93fc5e0bcf" - integrity sha512-BuBBzm5re6lM0AWgd6V+mI5eEGnnmFEtcFiJBEn9jYNEQYgflFhvnERUt89jMX5WmspiecwI2JBWJFrtFsOzug== - -"@spectrum-css/fieldgroup@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/fieldgroup/-/fieldgroup-3.0.2.tgz#1c1afd3c444d8650fefac275dc66a7a913933846" - integrity sha512-Vyw0kQJdLW18J6w4H+YAsoLntvkw5rXmW3CH5H3SDTXkBztxtHSSe3e106Nw5MoZxTfHlom6CxbYXYCTjQfqGw== - -"@spectrum-css/fieldlabel@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/fieldlabel/-/fieldlabel-3.0.1.tgz#39f7c0f25cc2ff402afeff005341b0832f7c588c" - integrity sha512-LMfwrwIq8wEEvxFLobdLvXRwKrp8o9Fty4iJ9aYl2Rj1uXkfRd8qLz9HGZjLEE1OuJgoTBgamYABl7EvoA5PLw== - -"@spectrum-css/icon@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/icon/-/icon-3.0.1.tgz#e300a6fc353c85c6b5d6e7a364408a940c31b177" - integrity sha512-cGFtIrcQ/7tthdkHK1npuEFiCdYVHLqwmLxghUYQw8Tb8KgJaw3OBO1tpjgsUizexNgu26BjVRIbGxNWuBXIHQ== - -"@spectrum-css/illustratedmessage@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/illustratedmessage/-/illustratedmessage-3.0.2.tgz#6a480be98b027e050b086e7899e40d87adb0a8c0" - integrity sha512-dqnE8X27bGcO0HN8+dYx8O4o0dNNIAqeivOzDHhe2El+V4dTzMrNIerF6G0NLm3GjVf6XliwmitsZK+K6FmbtA== - -"@spectrum-css/inlinealert@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/inlinealert/-/inlinealert-2.0.1.tgz#7521f88f6c845806403cc7d925773c7414e204a2" - integrity sha512-Xy5RCOwgurqUXuGQCsEDUduDd5408bmEpmFg+feynG7VFUgLFZWBeylSENB/OqjlFtO76PHXNVdHkhDscPIHTA== - -"@spectrum-css/inputgroup@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/inputgroup/-/inputgroup-3.0.2.tgz#f1b13603832cbd22394f3d898af13203961f8691" - integrity sha512-O0G3Lw9gxsh8gTLQWIAKkN1O8cWhjpEUl+oR1PguIKFni72uNr2ikU9piOwy/r0gJG2Q/TVs6hAshoAAkmsSzw== - -"@spectrum-css/label@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@spectrum-css/label/-/label-2.0.10.tgz#2368651d7636a19385b5d300cdf6272db1916001" - integrity sha512-xCbtEiQkZIlLdWFikuw7ifDCC21DOC/KMgVrrVJHXFc4KRQe9LTZSqmGF3tovm+CSq1adE59mYoTbojVQ9YuEQ== - -"@spectrum-css/link@3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/link/-/link-3.1.1.tgz#cb526a2e10b50ef5a7ae29cca7272e2610d597eb" - integrity sha512-Bi88lRhTY7g6nM/ryW1yY4Cji211ZYNtRxkxbV7n2lPvwMAAQtyx0qVD3ru4kTGj/FFVvmPR3XiOE10K13HSNA== - -"@spectrum-css/link@^3.1.3": - version "3.1.23" - resolved "https://registry.yarnpkg.com/@spectrum-css/link/-/link-3.1.23.tgz#9d9ff64c41366edbfdb19d04a5deec88bf2ea8fd" - integrity sha512-CAJQGnGTrTtR4tF1L94ou9Y+c4vnx9d5rWhb3AMzKb2Focqz02xSkTyaCCH7OM/3CwD8TCLOMANon8LcRpGAjA== - -"@spectrum-css/menu@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/menu/-/menu-3.0.1.tgz#2a376f991acc24e12ec892bb6b9db2650fc41fbe" - integrity sha512-Qjg0+1O0eC89sb/bRFq2AGnQ8XqhVy23TUXHyffNM8qdcMssnlny3QmhzjURCZKvx/Y5UytCpzhedPQqSpQwZg== - -"@spectrum-css/modal@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/modal/-/modal-3.0.1.tgz#613a6b83d0330a4d38db41a98090800751c56d8d" - integrity sha512-F7D99F3cjDGT9DM9sogx/p49jrNYT7a1J6TUoqV73wUf+0gP+dTsskBOo9jB8VbUE+POQPjiDLB+SWLp6iBB+w== - "@spectrum-css/page@^3.0.1": version "3.0.8" resolved "https://registry.yarnpkg.com/@spectrum-css/page/-/page-3.0.8.tgz#001efa9e4c10095df9b2b37cf7d7d6eb60140190" @@ -1622,127 +1363,7 @@ dependencies: "@spectrum-css/vars" "^4.3.0" -"@spectrum-css/pagination@3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@spectrum-css/pagination/-/pagination-3.0.3.tgz#b204c3ada384c4af751a354bc428346d82eeea65" - integrity sha512-OJ/v9GeNXJOZ9Yr9LDBYPrR2NCiLOWP9wANT/a5sqFuugRnQbn/HYMnRp9TBxwpDY6ihaPo0T/wi7kLiAJFdDw== - -"@spectrum-css/picker@1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/picker/-/picker-1.0.1.tgz#98991198576d26bd14160824e7b6f3c278ff930b" - integrity sha512-Rv4/UBOdNW1gs7WVBCJnPD5VFly8MqP++psDX6kcugUIcfJy0GC3acvElotmKRlCDk8Qxks2W2A0jKeSgphTmA== - -"@spectrum-css/popover@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/popover/-/popover-3.0.1.tgz#5863c1efc53f98f9aba2de9186666780041303fc" - integrity sha512-LmOSj/yCwQQ9iGmCYnHiJsJR/HfPiGqI1Jl7pkKxBOCxYBMS/5+ans9vfCN2Qnd0eK7WSbfPg72S6mjye7db2Q== - -"@spectrum-css/progressbar@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/progressbar/-/progressbar-1.0.2.tgz#b5a59432517f9ae6dad49d9504691bc5ac42b424" - integrity sha512-+jExeBLtVCqo3BqtFq5WCtZ028Dzk+oUnX6y4z6ZamKPqOyOELOtFnhYnyhyRndQOqYwKUTXx9zsaWA/lpJOHw== - -"@spectrum-css/progresscircle@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/progresscircle/-/progresscircle-1.0.2.tgz#258ea9170fb70f795edda03e38a61d93bef4487c" - integrity sha512-JLULpyzjIY95lzlWR1yE1gv4l1K6p+scQ+edmuZZUHBzwM3pUtkvHJmUlA9TYdResUYW6Uka60VRdY6lZ8gnFQ== - -"@spectrum-css/radio@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/radio/-/radio-3.0.2.tgz#9c1386894920bbed604e4e174fbbd45d9d762152" - integrity sha512-0TDdzC9omNXnpKHEXNuuGeXdNh4x8jvTKVUqMRLb7vY4hY94hAdt6X01NBqka+jzK35HxGzpDdPADAz62yZLPQ== - -"@spectrum-css/search@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/search/-/search-3.0.2.tgz#70e93e321032d40b399498b2324e3b70e050551e" - integrity sha512-3UbT8yZmNOwrZxq+CUmumE+26ZySZ8OoKNM6U20SLMPLgdx6MrRugVE88r3Bl0sJ0RZX/5bU8nausdiHeX+Jlw== - -"@spectrum-css/sidenav@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/sidenav/-/sidenav-3.0.2.tgz#9d70f408d588ee79c69857751010333671f32713" - integrity sha512-YpIdH/F0jEICYmoduGrnkTmxwJq1kfKxEp0wOs+ZkQOsvKMv1an7nyhsfOKCQqcGNfYzJ9mJAk7/u5+vsxHa8g== - -"@spectrum-css/slider@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/slider/-/slider-3.0.1.tgz#5281e6f47eb5a4fd3d1816c138bf66d01d7f2e49" - integrity sha512-DI2dtMRnQuDM1miVzl3SGyR1khUEKnwdXfO5EHDFwkC3yav43F5QogkfjmjFmWWobMVovdJlAuiaaJ/IHejD0Q== - -"@spectrum-css/statuslight@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/statuslight/-/statuslight-3.0.2.tgz#dc54b6cd113413dcdb909c486b5d7bae60db65c5" - integrity sha512-xodB8g8vGJH20XmUj9ZsPlM1jHrGeRbvmVXkz0q7YvQrYAhim8pP3W+XKKZAletPFAuu8cmUOc6SWn6i4X4z6w== - -"@spectrum-css/stepper@3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@spectrum-css/stepper/-/stepper-3.0.3.tgz#ae89846886431e3edeee060207b8f81540f73a34" - integrity sha512-prAD61ImlOTs9b6PfB3cB08x4lAfxtvnW+RZiTYky0E8GgZdrc/MfCkL5/oqQaIQUtyQv/3Lb7ELAf/0K8QTXw== - -"@spectrum-css/switch@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/switch/-/switch-1.0.2.tgz#f0b4c69271964573e02b08e90998096e49e1de44" - integrity sha512-zqmHpgWPNg1gEwdUNFYV3CBX5JaeALfIqcJIxE0FLZqr9d1C4+oLE0ItIFzt1bwr4bFAOmkEpvtiY+amluzGxQ== - -"@spectrum-css/table@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/table/-/table-3.0.1.tgz#753e0e2498082c0c36b9600828516aff3ac338cd" - integrity sha512-XQ+srMTv9hK1H0nctWUtqyzitmvyb5TNR+7mjAmKRdkBRSTQQSipDhenxZp72ekzMtMoSYZVZ77kgo0Iw3Fpug== - -"@spectrum-css/tabs@3.2.12": - version "3.2.12" - resolved "https://registry.yarnpkg.com/@spectrum-css/tabs/-/tabs-3.2.12.tgz#9b08f23d5aa881b3441af7757800c7173e5685ff" - integrity sha512-rPFUW9SSW4+3/UJ3UrtY2/l3sQvlqB1fqxHLPDjgykvbfrnMejcCTNV4ZrFNHXpE/6+kGnk+yVViSPtWGwJzkA== - -"@spectrum-css/tag@^3.1.4": - version "3.3.15" - resolved "https://registry.yarnpkg.com/@spectrum-css/tag/-/tag-3.3.15.tgz#971184fd8cb977b85a529f808313851863123278" - integrity sha512-pF6Wh61Z7hmAy20twIlpjdDuivYj6UPtWIzK7giyJKr/qcn20BjVN2ChIeFB1N+vBamJdLsuQOewv4AJ3+LZ2Q== - -"@spectrum-css/tags@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/tags/-/tags-3.0.2.tgz#5bf35fb79c97cd9344de485bd4626ad5b9f07757" - integrity sha512-HbvMk+QHvCDD1/ScvSErpKROcpAbXuMD4Hl/Gz/1A1lQ0fJ/CJeCq/MMsL7zjK1nlItU/ySu8r8KIuRF+6F8SQ== - -"@spectrum-css/textfield@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/textfield/-/textfield-3.0.1.tgz#e875b8e37817378ad08fc4af7d53026df38911e5" - integrity sha512-MUV5q87CVxbkNdSNoxGrFbgyKc51ft/WWf3aVEoPdPw5yBnXqFe1w1YmAit5zYDOOhhs58sCLAlUcCMlOpkgrA== - -"@spectrum-css/toast@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/toast/-/toast-3.0.1.tgz#36f62ea05302761e59b9d53e05f6c04423861796" - integrity sha512-jov++S358BrN2tmMfaoYk1N6u9HojgeuQk61keXrK2m3VE5/n94x7Lg3kIPeSWO0odyDfBlMqT9jacbRey3QTg== - -"@spectrum-css/tooltip@3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@spectrum-css/tooltip/-/tooltip-3.0.3.tgz#26b8ca3b3d30e29630244d85eb4fc11d0c841281" - integrity sha512-ztRF7WW1FzyNavXBRc+80z67UoOrY9wl3cMYsVD3MpDnyxdzP8cjza1pCcolKBaFqRTcQKkxKw3GWtGICRKR5A== - -"@spectrum-css/treeview@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/treeview/-/treeview-3.0.2.tgz#d54d8f17290babb1c885f5d9355e225421beb0d2" - integrity sha512-foO7UBJv1JMFaKgDPVt8jBghZSVbqhXR8TaGaxHSnMubv7ygmKkc1AITrWC2STILCn84ju2vchOohMZfW6sYwg== - -"@spectrum-css/typography@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/typography/-/typography-3.0.1.tgz#957dafd9b18c314fa37a88b549042ba2175f5b3f" - integrity sha512-XyR68K2rIZX3u4j7HhMLOqLVHDJZcapp3XUqgYMzMWccBFleA0qPxKpfRWqVIA5DzTMSIw0wEcZPYKWFZ2e6dA== - -"@spectrum-css/typography@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@spectrum-css/typography/-/typography-3.0.2.tgz#ea3ca0a60e18064527819d48c8c4364cab4fcd38" - integrity sha512-5ZOLmQe0edzsDMyhghUd4hBb5uxGsFrxzf+WasfcUw9klSfTsRZ09n1BsaaWbgrLjlMQ+EEHS46v5VNo0Ms2CA== - -"@spectrum-css/underlay@2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@spectrum-css/underlay/-/underlay-2.0.9.tgz#fc10f971d1325cc844b727e6260f7217844060e8" - integrity sha512-X86xd0PG4QobmUyXA90BFGnyygaI8kW64dA4ysf4z0cOvUWjNbAAl3a/DB/WRyrnp63Zqv83T/cgNbetagTbWg== - -"@spectrum-css/vars@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@spectrum-css/vars/-/vars-3.0.1.tgz#561fd69098f896a647242dd8d6108af603bfa31e" - integrity sha512-l4oRcCOqInChYXZN6OQhpe3isk6l4OE6Ys8cgdlsiKp53suNoQxyyd9p/eGRbCjZgH3xQ8nK0t4DHa7QYC0S6w== - -"@spectrum-css/vars@^3.0.1", "@spectrum-css/vars@^3.0.2": +"@spectrum-css/vars@^3.0.1": version "3.0.2" resolved "https://registry.yarnpkg.com/@spectrum-css/vars/-/vars-3.0.2.tgz#ea9062c3c98dfc6ba59e5df14a03025ad8969999" integrity sha512-vzS9KqYXot4J3AEER/u618MXWAS+IoMvYMNrOoscKiLLKYQWenaueakUWulFonToPd/9vIpqtdbwxznqrK5qDw== @@ -1752,11 +1373,6 @@ resolved "https://registry.yarnpkg.com/@spectrum-css/vars/-/vars-4.3.0.tgz#03ddf67d3aa8a9a4cb0edbbd259465c9ced7e70d" integrity sha512-ZQ2XAhgu4G9yBeXQNDAz07Z8oZNnMt5o9vzf/mpBA7Teb/JI+8qXp2wt8D245SzmtNlFkG/bzRYvQc0scgZeCQ== -"@spectrum-css/vars@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@spectrum-css/vars/-/vars-8.0.0.tgz#b88a3b1165b63de50ab01f20ccafb42115d67443" - integrity sha512-cClQgNyH1VdNu6zdiZ5M7kbQDZS4/wPAclk5IPO5+nMhSzqTesUL/zfiaPB95MTCKFyVJrFpOeJ37HmUifWJ3A== - "@sveltejs/vite-plugin-svelte@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.1.tgz#7f468f03c933fcdfc60d4773671c73f33b9ef4d6" @@ -1868,18 +1484,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/codemirror@^5.60.4": - version "5.60.6" - resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.6.tgz#0511ed51d087ad2a2eedb6111fc74e739c4549f6" - integrity sha512-JIDPSvkYRlcv/2F0erqD+de2ni/Mz6FJMEGb0vwF6ByQOcHIKfiEfwrO4d6dSRwYeHyNUMpGjev0PyjX2M0XWw== - dependencies: - "@types/tern" "*" - -"@types/estree@*": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" - integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== - "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" @@ -1934,11 +1538,6 @@ jest-diff "^27.0.0" pretty-format "^27.0.0" -"@types/marked@^4.0.7": - version "4.0.8" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-4.0.8.tgz#b316887ab3499d0a8f4c70b7bd8508f92d477955" - integrity sha512-HVNzMT5QlWCOdeuBsgXP8EZzKUf0+AXzN+sLmjvaB3ZlLqO+e4u0uXrdw9ub69wBKFs+c6/pA4r9sy6cCDvImw== - "@types/minimatch@*": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" @@ -1984,13 +1583,6 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/tern@*": - version "0.23.4" - resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.4.tgz#03926eb13dbeaf3ae0d390caf706b2643a0127fb" - integrity sha512-JAUw1iXGO1qaWwEOzxTKJZ/5JxVeON9kvGZ/osgZaJImBnyjyn0cjovPsf6FNLmyGY8Vw9DoXZCMlfMkMwHRWg== - dependencies: - "@types/estree" "*" - "@types/testing-library__jest-dom@^5.9.1": version "5.14.1" resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.1.tgz#014162a5cee6571819d48e999980694e2f657c3c" @@ -2042,7 +1634,7 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.1.1, acorn-walk@^8.2.0: +acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -2062,11 +1654,6 @@ acorn@^8.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== -acorn@^8.7.0: - version "8.8.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" - integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== - agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -2134,18 +1721,6 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" -apexcharts@^3.19.2, apexcharts@^3.22.1: - version "3.36.3" - resolved "https://registry.yarnpkg.com/apexcharts/-/apexcharts-3.36.3.tgz#debd58ded07163d51e00aeb15827d594e0cc8129" - integrity sha512-8/FXEs0ohXMff07Gv28XjhPwEJphIUdq2/wii/pcvi54Tw6z1mjrV8ydN8rlWi/ve8BAPBefJkLmRWv7UOBsLw== - dependencies: - svg.draggable.js "^2.2.2" - svg.easing.js "^2.0.0" - svg.filter.js "^2.0.2" - svg.pathmorphing.js "^0.1.3" - svg.resize.js "^1.4.3" - svg.select.js "^3.0.1" - arch@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" @@ -2156,7 +1731,7 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== -argparse@^1.0.10, argparse@^1.0.7: +argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -2186,15 +1761,6 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-sort@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" - integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== - dependencies: - default-compare "^1.0.0" - get-value "^2.0.6" - kind-of "^5.0.2" - array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" @@ -2247,13 +1813,6 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -autolinker@~0.28.0: - version "0.28.1" - resolved "https://registry.yarnpkg.com/autolinker/-/autolinker-0.28.1.tgz#0652b491881879f0775dace0cdca3233942a4e47" - integrity sha512-zQAFO1Dlsn69eXaO6+7YZc+v84aquQKbwpzCE3L0stj56ERn9hutFxPopViLjo9G+rWwjozRhgS5KJ25Xy19cQ== - dependencies: - gulp-header "^1.7.1" - aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -2659,23 +2218,11 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= -codemirror-spell-checker@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz#1c660f9089483ccb5113b9ba9ca19c3f4993371e" - integrity sha512-2Tl6n0v+GJRsC9K3MLCdLaMOmvWL0uukajNJseorZJsslaxZyZMgENocPU8R0DyoTAiKsyqiemSOZo7kjGV0LQ== - dependencies: - typo-js "*" - codemirror@^5.59.0: version "5.63.3" resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.63.3.tgz#97042a242027fe0c87c09b36bc01931d37b76527" integrity sha512-1C+LELr+5grgJYqwZKqxrcbPsHFHapVaVAloBsFBASbpLnQqLw1U8yXJ3gT5D+rhxIiSpo+kTqN+hQ+9ialIXw== -codemirror@^5.63.1: - version "5.65.11" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.11.tgz#c818edc3274788c008f636520c5490a1f7009b4f" - integrity sha512-Gp62g2eKSCHYt10axmGhKq3WoJSvVpvhXmowNq7pZdRVowwtvBR/hi2LSP5srtctKkRT33T6/n8Kv1UGp7JW4A== - collect-v8-coverage@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" @@ -2760,13 +2307,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concat-with-sourcemaps@*: - version "1.1.0" - resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" - integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== - dependencies: - source-map "^0.6.1" - configent@^2.1.4: version "2.2.0" resolved "https://registry.yarnpkg.com/configent/-/configent-2.2.0.tgz#2de230fc43f22c47cfd99016aa6962d6f9546994" @@ -2804,11 +2344,6 @@ core-util-is@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== - create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -2955,11 +2490,6 @@ dayjs@^1.10.4: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468" integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig== -dayjs@^1.10.5: - version "1.11.7" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" - integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== - dayjs@^1.11.2: version "1.11.2" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.2.tgz#fa0f5223ef0d6724b3d8327134890cfe3d72fbe5" @@ -2986,7 +2516,7 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: +debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3018,13 +2548,6 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== -default-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" - integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== - dependencies: - kind-of "^5.0.2" - define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" @@ -3096,20 +2619,6 @@ dom-accessibility-api@^0.5.6: resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.10.tgz#caa6d08f60388d0bb4539dd75fe458a9a1d0014c" integrity sha512-Xu9mD0UjrJisTmv7lmVSDMagQcU9R5hwAbxsaAE/35XPnPLJobbuREfV/rraiSaEj/UOvgrzQs66zyTWTlyd+g== -dom-serializer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" - integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== - dependencies: - domelementtype "^2.3.0" - domhandler "^5.0.2" - entities "^4.2.0" - -domelementtype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== - domexception@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" @@ -3117,22 +2626,6 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -domhandler@^5.0.1, domhandler@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" - integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== - dependencies: - domelementtype "^2.3.0" - -domutils@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.0.1.tgz#696b3875238338cb186b6c0612bd4901c89a4f1c" - integrity sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q== - dependencies: - dom-serializer "^2.0.0" - domelementtype "^2.3.0" - domhandler "^5.0.1" - dotenv@^8.2.0: version "8.6.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" @@ -3148,17 +2641,6 @@ duplexer@~0.1.1: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== -easymde@^2.16.1: - version "2.18.0" - resolved "https://registry.yarnpkg.com/easymde/-/easymde-2.18.0.tgz#ff1397d07329b1a7b9187d2d0c20766fa16b3b1b" - integrity sha512-IxVVUxNWIoXLeqtBU4BLc+eS/ScYhT1Dcb6yF5Wchoj1iXAV+TIIDWx+NCaZhY7RcSHqDPKllbYq7nwGKILnoA== - dependencies: - "@types/codemirror" "^5.60.4" - "@types/marked" "^4.0.7" - codemirror "^5.63.1" - codemirror-spell-checker "1.1.2" - marked "^4.1.0" - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -3189,22 +2671,6 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -engine.io-client@~6.2.3: - version "6.2.3" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-6.2.3.tgz#a8cbdab003162529db85e9de31575097f6d29458" - integrity sha512-aXPtgF1JS3RuuKcpSrBtimSjYvrbhKW9froICH4s0F3XQWLxsKNxqzG39nnvQZQnva4CMvUK63T7shevxRyYHw== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.1" - engine.io-parser "~5.0.3" - ws "~8.2.3" - xmlhttprequest-ssl "~2.0.0" - -engine.io-parser@~5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.0.4.tgz#0b13f704fa9271b3ec4f33112410d8f3f41d0fc0" - integrity sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg== - enquirer@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -3212,16 +2678,6 @@ enquirer@^2.3.6: dependencies: ansi-colors "^4.1.1" -ent@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA== - -entities@^4.2.0, entities@^4.3.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" - integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== - error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -3376,11 +2832,6 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -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" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -3665,11 +3116,6 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -flatpickr@^4.5.2: - version "4.6.13" - resolved "https://registry.yarnpkg.com/flatpickr/-/flatpickr-4.6.13.tgz#8a029548187fd6e0d670908471e43abe9ad18d94" - integrity sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw== - fn-name@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-3.0.0.tgz#0596707f635929634d791f452309ab41558e3c5c" @@ -3720,11 +3166,6 @@ from@~0: resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= -fs-exists-sync@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" - integrity sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg== - fs-extra@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" @@ -3801,14 +3242,6 @@ get-intrinsic@^1.0.2: has "^1.0.3" has-symbols "^1.0.1" -get-object@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/get-object/-/get-object-0.2.0.tgz#d92ff7d5190c64530cda0543dac63a3d47fe8c0c" - integrity sha512-7P6y6k6EzEFmO/XyUyFlXm1YLJy9xeA1x/grNV8276abX5GuwUtYgKFkRFkLixw4hf4Pz9q2vgv/8Ar42R0HuQ== - dependencies: - is-number "^2.0.2" - isobject "^0.2.0" - get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -3838,13 +3271,6 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= -get-value@^3.0.0, get-value@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-3.0.1.tgz#5efd2a157f1d6a516d7524e124ac52d0a39ef5a8" - integrity sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA== - dependencies: - isobject "^3.0.1" - getos@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" @@ -3931,35 +3357,6 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -gulp-header@^1.7.1: - version "1.8.12" - resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-1.8.12.tgz#ad306be0066599127281c4f8786660e705080a84" - integrity sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ== - dependencies: - concat-with-sourcemaps "*" - lodash.template "^4.4.0" - through2 "^2.0.0" - -handlebars-utils@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/handlebars-utils/-/handlebars-utils-1.0.6.tgz#cb9db43362479054782d86ffe10f47abc76357f9" - integrity sha512-d5mmoQXdeEqSKMtQQZ9WkiUcO1E3tPbWxluCK9hVgIDPzQa9WsKo3Lbe/sGflTe7TomHEeZaOgwIkyIr1kfzkw== - dependencies: - kind-of "^6.0.0" - typeof-article "^0.1.1" - -handlebars@^4.7.6, handlebars@^4.7.7: - version "4.7.7" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - harmony-reflect@^1.4.6: version "1.6.2" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.2.tgz#31ecbd32e648a34d030d86adb67d4d47547fe710" @@ -3998,14 +3395,6 @@ has-value@^1.0.0: has-values "^1.0.0" isobject "^3.0.0" -has-value@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-2.0.2.tgz#d0f12e8780ba8e90e66ad1a21c707fdb67c25658" - integrity sha512-ybKOlcRsK2MqrM3Hmz/lQxXHZ6ejzSPzpNabKB45jb5qDgJvKPa3SdapTsTLwEb9WltgWpOmNax7i+DzNOk4TA== - dependencies: - get-value "^3.0.0" - has-values "^2.0.1" - has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" @@ -4019,13 +3408,6 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -has-values@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-2.0.1.tgz#3876200ff86d8a8546a9264a952c17d5fc17579d" - integrity sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w== - dependencies: - kind-of "^6.0.2" - has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -4033,16 +3415,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -helper-md@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/helper-md/-/helper-md-0.2.2.tgz#c1f59d7e55bbae23362fd8a0e971607aec69d41f" - integrity sha512-49TaQzK+Ic7ZVTq4i1UZxRUJEmAilTk8hz7q4I0WNUaTclLR8ArJV5B3A1fe1xF2HtsDTr2gYKLaVTof/Lt84Q== - dependencies: - ent "^2.2.0" - extend-shallow "^2.0.1" - fs-exists-sync "^0.1.0" - remarkable "^1.6.2" - 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" @@ -4060,29 +3432,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -html-tag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/html-tag/-/html-tag-2.0.0.tgz#36c3bc8d816fd30b570d5764a497a641640c2fed" - integrity sha512-XxzooSo6oBoxBEUazgjdXj7VwTn/iSTSZzTYKzYY6I916tkaYzypHxy+pbVU1h+0UQ9JlVf5XkNQyxOAiiQO1g== - dependencies: - is-self-closing "^1.0.1" - kind-of "^6.0.0" - -html5-qrcode@^2.2.1: - version "2.3.4" - resolved "https://registry.yarnpkg.com/html5-qrcode/-/html5-qrcode-2.3.4.tgz#7e2b4575a23b10ff5e26d2bf147c8027c1ece389" - integrity sha512-VPZrOTG8XR9HmIAhSSiGtJVPErZxKy/DuGc9cPQLburCWZEbvxQGJP9y4K4P+8vdalLtYB/vM5YP1BdWQKZ8jQ== - -htmlparser2@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.1.tgz#abaa985474fcefe269bc761a779b544d7196d010" - integrity sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA== - dependencies: - domelementtype "^2.3.0" - domhandler "^5.0.2" - domutils "^3.0.1" - entities "^4.3.0" - 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" @@ -4169,7 +3518,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4268,13 +3617,6 @@ is-docker@^2.0.0: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-even@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-even/-/is-even-1.0.0.tgz#76b5055fbad8d294a86b6a949015e1c97b717c06" - integrity sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg== - dependencies: - is-odd "^0.1.2" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -4317,13 +3659,6 @@ is-installed-globally@~0.4.0: global-dirs "^3.0.0" is-path-inside "^3.0.2" -is-number@^2.0.2: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg== - dependencies: - kind-of "^3.0.2" - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -4336,13 +3671,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-odd@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-0.1.2.tgz#bc573b5ce371ef2aad6e6f49799b72bef13978a7" - integrity sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw== - dependencies: - is-number "^3.0.0" - is-path-inside@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" @@ -4360,23 +3688,11 @@ is-plain-object@^3.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b" integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g== -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - is-potential-custom-element-name@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-self-closing@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-self-closing/-/is-self-closing-1.0.1.tgz#5f406b527c7b12610176320338af0fa3896416e4" - integrity sha512-E+60FomW7Blv5GXTlYee2KDrnG6srxF7Xt1SjrhWUGUEsTFIqY/nq2y3DaftCsgUMdh89V07IVfhY9KIJhLezg== - dependencies: - self-closing-tags "^1.0.1" - is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -4409,7 +3725,7 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@1.0.0, isarray@~1.0.0: +isarray@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= @@ -4419,11 +3735,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isobject@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-0.2.0.tgz#a3432192f39b910b5f02cc989487836ec70aa85e" - integrity sha512-VaWq6XYAsbvM0wf4dyBO7WH9D7GosB7ZZlqrawI9BBiTMINBeCyqSKBa35m870MY3O4aM31pYyZi9DfGrYMJrQ== - isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" @@ -4999,7 +4310,7 @@ jsprim@^2.0.2: json-schema "0.4.0" verror "1.10.0" -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.1.0, kind-of@^3.2.0: +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 sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== @@ -5013,12 +4324,12 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0, kind-of@^5.0.2: +kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.0, kind-of@^6.0.2: 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== @@ -5038,11 +4349,6 @@ lazy-ass@1.6.0, lazy-ass@^1.6.0: resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" integrity sha1-eZllXoZGwX8In90YfRUNMyTVRRM= -leaflet@^1.7.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.9.3.tgz#52ec436954964e2d3d39e0d433da4b2500d74414" - integrity sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ== - leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -5087,11 +4393,6 @@ lodash-es@^4.17.11: resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== - lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -5122,22 +4423,7 @@ lodash.once@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash.template@^4.4.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" - integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.templatesettings "^4.0.0" - -lodash.templatesettings@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" - integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== - dependencies: - lodash._reinterpolate "^3.0.0" - -lodash@4.17.21, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0: +lodash@4.17.21, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5236,11 +4522,6 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -marked@^4.1.0: - version "4.2.5" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.5.tgz#979813dfc1252cc123a79b71b095759a32f42a5d" - integrity sha512-jPueVhumq7idETHkb203WDD4fMA3yV9emQ5vLwop58lu8bTclMghBWcYAavlDqIEMaisADinV1TooIFCfqOsYQ== - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -5256,7 +4537,7 @@ methods@^1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= -micromatch@^3.1.4, micromatch@^3.1.5: +micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -5420,11 +4701,6 @@ ncp@^2.0.0: resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= -neo-async@^2.6.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -5635,11 +4911,6 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse-srcset@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-srcset/-/parse-srcset-1.0.2.tgz#f2bd221f6cc970a938d88556abc589caaaa2bde1" - integrity sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q== - parse5@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" @@ -5731,15 +5002,6 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= -postcss@^8.3.11: - version "8.4.20" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.20.tgz#64c52f509644cecad8567e949f4081d98349dc56" - integrity sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - postcss@^8.4.16: version "8.4.16" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c" @@ -5788,11 +5050,6 @@ pretty-format@^27.0.0, pretty-format@^27.3.1: ansi-styles "^5.0.0" react-is "^17.0.1" -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== - prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -5884,19 +5141,6 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -readable-stream@~2.3.6: - 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" - redent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" @@ -5937,16 +5181,6 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexparam@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-2.0.1.tgz#c912f5dae371e3798100b3c9ce22b7414d0889fa" - integrity sha512-zRgSaYemnNYxUv+/5SeoHI0eJIgTL/A2pUtXUPLHQxUldagouJ9p+K6IbIZ/JiQuCEv2E2B1O11SjVQy3aMCkw== - -regexparam@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-1.3.0.tgz#2fe42c93e32a40eff6235d635e0ffa344b92965f" - integrity sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g== - regexpu-core@^4.7.1: version "4.8.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0" @@ -5971,21 +5205,6 @@ regjsparser@^0.7.0: dependencies: jsesc "~0.5.0" -relative@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/relative/-/relative-3.0.2.tgz#0dcd8ec54a5d35a3c15e104503d65375b5a5367f" - integrity sha512-Q5W2qeYtY9GbiR8z1yHNZ1DGhyjb4AnLEjt8iE6XfcC1QIu+FAtj3HQaO0wH28H1mX6cqNLvAqWhP402dxJGyA== - dependencies: - isobject "^2.0.0" - -remarkable@^1.6.2: - version "1.7.4" - resolved "https://registry.yarnpkg.com/remarkable/-/remarkable-1.7.4.tgz#19073cb960398c87a7d6546eaa5e50d2022fcd00" - integrity sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg== - dependencies: - argparse "^1.0.10" - autolinker "~0.28.0" - remixicon@2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/remixicon/-/remixicon-2.5.0.tgz#b5e245894a1550aa23793f95daceadbf96ad1a41" @@ -6155,7 +5374,7 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.2: 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: +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== @@ -6187,18 +5406,6 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -sanitize-html@^2.7.0: - version "2.8.1" - resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.8.1.tgz#319c4fdba67e1edf35b1fd6d9362210044826d47" - integrity sha512-qK5neD0SaMxGwVv5txOYv05huC3o6ZAA4h5+7nJJgWMNFUNRjcjLO6FpwAtKzfKCZ0jrG6xTk6eVFskbvOGblg== - dependencies: - deepmerge "^4.2.2" - escape-string-regexp "^4.0.0" - htmlparser2 "^8.0.0" - is-plain-object "^5.0.0" - parse-srcset "^1.0.2" - postcss "^8.3.11" - saxes@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" @@ -6206,16 +5413,6 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -screenfull@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-6.0.2.tgz#3dbe4b8c4f8f49fb8e33caa8f69d0bca730ab238" - integrity sha512-AQdy8s4WhNvUZ6P8F6PB21tSPIYKniic+Ogx0AacBMjKP1GUHN2E9URxQHtCusiwxudnCKkdy4GrHXPPJSkCCw== - -self-closing-tags@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/self-closing-tags/-/self-closing-tags-1.0.1.tgz#6c5fa497994bb826b484216916371accee490a5d" - integrity sha512-7t6hNbYMxM+VHXTgJmxwgZgLGktuXtVVD5AivWzNTdJBM4DBjnDKDzkf2SrNjihaArpeJYNjxkELBu1evI4lQA== - "semver@2 || 3 || 4 || 5", semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -6289,13 +5486,6 @@ shortid@2.2.15: dependencies: nanoid "^2.1.0" -shortid@^2.2.15: - version "2.2.16" - resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.16.tgz#b742b8f0cb96406fd391c76bfc18a67a57fe5608" - integrity sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g== - dependencies: - nanoid "^2.1.0" - signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.5" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" @@ -6359,24 +5549,6 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -socket.io-client@^4.5.1: - version "4.5.4" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.5.4.tgz#d3cde8a06a6250041ba7390f08d2468ccebc5ac9" - integrity sha512-ZpKteoA06RzkD32IbqILZ+Cnst4xewU7ZYK12aS1mzHftFFjpoMz69IuhP/nL25pJfao/amoPI527KnuhFm01g== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.2" - engine.io-client "~6.2.3" - socket.io-parser "~4.2.1" - -socket.io-parser@~4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.1.tgz#01c96efa11ded938dcb21cbe590c26af5eff65e5" - integrity sha512-V4GrkLy+HeF1F/en3SpUaM+7XxYXpuMUWLGde1kSSh5nQMN4hLrbPIkD+otwh6q9R6NOQBN4AMaOZ2zVjui82g== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.1" - source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" @@ -6546,13 +5718,6 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -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: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -6587,11 +5752,6 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -striptags@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.2.0.tgz#cc74a137db2de8b0b9a370006334161f7dd67052" - integrity sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw== - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -6626,25 +5786,11 @@ 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== -svelte-apexcharts@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/svelte-apexcharts/-/svelte-apexcharts-1.0.2.tgz#4e000f8b8f7c901c05658c845457dfc8314d54c1" - integrity sha512-6qlx4rE+XsonZ0FZudfwqOQ34Pq+3wpxgAD75zgEmGoYhYBJcwmikTuTf3o8ZBsZue9U/pAwhNy3ed1Bkq1gmA== - dependencies: - apexcharts "^3.19.2" - svelte-dnd-action@^0.9.8: version "0.9.12" resolved "https://registry.yarnpkg.com/svelte-dnd-action/-/svelte-dnd-action-0.9.12.tgz#78cf33097986488c6d069eca517af473cd998730" integrity sha512-GlXIB3/56IMR5A0+qUx+FX7Q7n8uCAIeuYdgSBmn9iOlxWc+mgM8P1kNwAKCMSTdQ4IQETVQILNgWVY1KIFzsg== -svelte-flatpickr@^3.1.0, svelte-flatpickr@^3.2.3: - version "3.2.6" - resolved "https://registry.yarnpkg.com/svelte-flatpickr/-/svelte-flatpickr-3.2.6.tgz#595a97b2f25a669e61fe743f90a10dce783bbd49" - integrity sha512-0ePUyE9OjInYFqQwRKOxnFSu4dQX9+/rzFMynq2fKYXx406ZUThzSx72gebtjr0DoAQbsH2///BBZa5qk4qZXg== - dependencies: - flatpickr "^4.5.2" - svelte-hmr@^0.14.12: version "0.14.12" resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.14.12.tgz#a127aec02f1896500b10148b2d4d21ddde39973f" @@ -6665,83 +5811,11 @@ svelte-portal@1.0.0: resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-1.0.0.tgz#36a47c5578b1a4d9b4dc60fa32a904640ec4cdd3" integrity sha512-nHf+DS/jZ6jjnZSleBMSaZua9JlG5rZv9lOGKgJuaZStfevtjIlUJrkLc3vbV8QdBvPPVmvcjTlazAzfKu0v3Q== -svelte-portal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-1.0.0.tgz#36a47c5578b1a4d9b4dc60fa32a904640ec4cdd3" - integrity sha512-nHf+DS/jZ6jjnZSleBMSaZua9JlG5rZv9lOGKgJuaZStfevtjIlUJrkLc3vbV8QdBvPPVmvcjTlazAzfKu0v3Q== - -svelte-spa-router@^3.0.5: - version "3.3.0" - resolved "https://registry.yarnpkg.com/svelte-spa-router/-/svelte-spa-router-3.3.0.tgz#2fc0967a49dc361dfe4d38dddad6e662eed5b42c" - integrity sha512-cwRNe7cxD43sCvSfEeaKiNZg3FCizGxeMcf7CPiWRP3jKXjEma3vxyyuDtPOam6nWbVxl9TNM3hlE/i87ZlqcQ== - dependencies: - regexparam "2.0.1" - -svelte@^3.46.2, svelte@^3.49.0: - version "3.55.0" - resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.55.0.tgz#29cb958750a23e751309a6535ccd811fcabc9038" - integrity sha512-uGu2FVMlOuey4JoKHKrpZFkoYyj0VLjJdz47zX5+gVK5odxHM40RVhar9/iK2YFRVxvfg9FkhfVlR0sjeIrOiA== - svelte@^3.48.0: version "3.49.0" resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.49.0.tgz#5baee3c672306de1070c3b7888fc2204e36a4029" integrity sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA== -svg.draggable.js@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/svg.draggable.js/-/svg.draggable.js-2.2.2.tgz#c514a2f1405efb6f0263e7958f5b68fce50603ba" - integrity sha512-JzNHBc2fLQMzYCZ90KZHN2ohXL0BQJGQimK1kGk6AvSeibuKcIdDX9Kr0dT9+UJ5O8nYA0RB839Lhvk4CY4MZw== - dependencies: - svg.js "^2.0.1" - -svg.easing.js@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/svg.easing.js/-/svg.easing.js-2.0.0.tgz#8aa9946b0a8e27857a5c40a10eba4091e5691f12" - integrity sha512-//ctPdJMGy22YoYGV+3HEfHbm6/69LJUTAqI2/5qBvaNHZ9uUFVC82B0Pl299HzgH13rKrBgi4+XyXXyVWWthA== - dependencies: - svg.js ">=2.3.x" - -svg.filter.js@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/svg.filter.js/-/svg.filter.js-2.0.2.tgz#91008e151389dd9230779fcbe6e2c9a362d1c203" - integrity sha512-xkGBwU+dKBzqg5PtilaTb0EYPqPfJ9Q6saVldX+5vCRy31P6TlRCP3U9NxH3HEufkKkpNgdTLBJnmhDHeTqAkw== - dependencies: - svg.js "^2.2.5" - -svg.js@>=2.3.x, svg.js@^2.0.1, svg.js@^2.2.5, svg.js@^2.4.0, svg.js@^2.6.5: - version "2.7.1" - resolved "https://registry.yarnpkg.com/svg.js/-/svg.js-2.7.1.tgz#eb977ed4737001eab859949b4a398ee1bb79948d" - integrity sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA== - -svg.pathmorphing.js@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/svg.pathmorphing.js/-/svg.pathmorphing.js-0.1.3.tgz#c25718a1cc7c36e852ecabc380e758ac09bb2b65" - integrity sha512-49HWI9X4XQR/JG1qXkSDV8xViuTLIWm/B/7YuQELV5KMOPtXjiwH4XPJvr/ghEDibmLQ9Oc22dpWpG0vUDDNww== - dependencies: - svg.js "^2.4.0" - -svg.resize.js@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/svg.resize.js/-/svg.resize.js-1.4.3.tgz#885abd248e0cd205b36b973c4b578b9a36f23332" - integrity sha512-9k5sXJuPKp+mVzXNvxz7U0uC9oVMQrrf7cFsETznzUDDm0x8+77dtZkWdMfRlmbkEEYvUn9btKuZ3n41oNA+uw== - dependencies: - svg.js "^2.6.5" - svg.select.js "^2.1.2" - -svg.select.js@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/svg.select.js/-/svg.select.js-2.1.2.tgz#e41ce13b1acff43a7441f9f8be87a2319c87be73" - integrity sha512-tH6ABEyJsAOVAhwcCjF8mw4crjXSI1aa7j2VQR8ZuJ37H2MBUbyeqYr5nEO7sSN3cy9AR9DUwNg0t/962HlDbQ== - dependencies: - svg.js "^2.2.5" - -svg.select.js@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/svg.select.js/-/svg.select.js-3.0.1.tgz#a4198e359f3825739226415f82176a90ea5cc917" - integrity sha512-h5IS/hKkuVCbKSieR9uQCj9w+zLHoPh+ce19bBYyqF53g6mnPB8sAtIbe1s9dh2S2fCmYX2xel1Ln3PJBbK4kw== - dependencies: - svg.js "^2.6.5" - symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -6791,14 +5865,6 @@ throttleit@^1.0.0: resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" integrity sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw= -through2@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - through@2, through@^2.3.8, through@~2.3, through@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -6821,11 +5887,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -to-gfm-code-block@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/to-gfm-code-block/-/to-gfm-code-block-0.1.1.tgz#25d045a5fae553189e9637b590900da732d8aa82" - integrity sha512-LQRZWyn8d5amUKnfR9A9Uu7x9ss7Re8peuWR2gkh1E+ildOfv2aF26JpuDg8JtvCduu5+hOrMIH+XstZtnagqg== - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -6981,28 +6042,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typeof-article@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/typeof-article/-/typeof-article-0.1.1.tgz#9f07e733c3fbb646ffa9e61c08debacd460e06af" - integrity sha512-Vn42zdX3FhmUrzEmitX3iYyLb+Umwpmv8fkZRIknYh84lmdrwqZA5xYaoKiIj2Rc5i/5wcDrpUmZcbk1U51vTw== - dependencies: - kind-of "^3.1.0" - typescript@4.7.3: version "4.7.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== -typo-js@*: - version "1.2.2" - resolved "https://registry.yarnpkg.com/typo-js/-/typo-js-1.2.2.tgz#340484d81fe518e77c81a5a770162b14492f183b" - integrity sha512-C7pYBQK17EjSg8tVNY91KHdUt5Nf6FMJ+c3js076quPmBML57PmNMzAcIq/2kf/hSYtFABNDIYNYlJRl5BJhGw== - -uglify-js@^3.1.4: - version "3.17.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" - integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== - unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" @@ -7076,11 +6120,6 @@ utf-8-validate@^5.0.2: dependencies: node-gyp-build "^4.3.0" -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - uuid@8.3.1: version "8.3.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" @@ -7139,14 +6178,6 @@ vite@^3.0.8: optionalDependencies: fsevents "~2.3.2" -vm2@^3.9.4: - version "3.9.13" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.13.tgz#774a1a3d73b9b90b1aa45bcc5f25e349f2eef649" - integrity sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q== - dependencies: - acorn "^8.7.0" - acorn-walk "^8.2.0" - w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" @@ -7247,11 +6278,6 @@ word-wrap@~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== -wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== - wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -7290,11 +6316,6 @@ ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== -ws@~8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba" - integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA== - xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" @@ -7305,16 +6326,6 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xmlhttprequest-ssl@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" - integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== - -xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - y18n@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" @@ -7381,11 +6392,6 @@ yauzl@^2.10.0: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" -year@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/year/-/year-0.2.1.tgz#4083ae520a318b23ec86037f3000cb892bdf9bb0" - integrity sha512-9GnJUZ0QM4OgXuOzsKNzTJ5EOkums1Xc+3YQXp+Q+UxFjf7zLucp9dQ8QMIft0Szs1E1hUiXFim1OYfEKFq97w== - yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" diff --git a/packages/frontend-core/src/api/envVars.js b/packages/frontend-core/src/api/envVars.js index 5f02a2b889..7a728e9d18 100644 --- a/packages/frontend-core/src/api/envVars.js +++ b/packages/frontend-core/src/api/envVars.js @@ -1,11 +1,11 @@ export const buildEnvironmentVariableEndpoints = API => ({ - /** - * Fetches a list of environment variables - */ - fetchEnvVars: async () => { - return await API.get({ - url: `/api/env/variables`, - json: false, - }) - } + /** + * Fetches a list of environment variables + */ + fetchEnvVars: async () => { + return await API.get({ + url: `/api/env/variables`, + json: false, + }) + }, }) diff --git a/packages/server/__mocks__/node-fetch.ts b/packages/server/__mocks__/node-fetch.ts index 44d1e54a32..78071dc8af 100644 --- a/packages/server/__mocks__/node-fetch.ts +++ b/packages/server/__mocks__/node-fetch.ts @@ -1,5 +1,7 @@ +// @ts-ignore import fs from "fs" module FetchMock { + // @ts-ignore const fetch = jest.requireActual("node-fetch") let failCount = 0 diff --git a/packages/server/src/api/controllers/datasource.ts b/packages/server/src/api/controllers/datasource.ts index d47629ed3e..323dd1457e 100644 --- a/packages/server/src/api/controllers/datasource.ts +++ b/packages/server/src/api/controllers/datasource.ts @@ -13,6 +13,8 @@ import { getDatasourceAndQuery } from "./row/utils" import { invalidateDynamicVariables } from "../../threads/utils" import { db as dbCore, context, events } from "@budibase/backend-core" import { BBContext, Datasource, Row } from "@budibase/types" +import sdk from "../../sdk" +import { cloneDeep } from "lodash/fp" export async function fetch(ctx: BBContext) { // Get internal tables @@ -61,7 +63,7 @@ export async function fetch(ctx: BBContext) { export async function buildSchemaFromDb(ctx: BBContext) { const db = context.getAppDB() - const datasource = await db.get(ctx.params.datasourceId) + const datasource = await sdk.datasources.get(ctx.params.datasourceId) const tablesFilter = ctx.request.body.tablesFilter let { tables, error } = await buildSchemaHelper(datasource) @@ -149,8 +151,8 @@ async function invalidateVariables( export async function update(ctx: BBContext) { const db = context.getAppDB() const datasourceId = ctx.params.datasourceId - let datasource = await db.get(datasourceId) - const auth = datasource.config.auth + let datasource = await sdk.datasources.get(datasourceId) + const auth = datasource.config?.auth await invalidateVariables(datasource, ctx.request.body) const isBudibaseSource = datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE @@ -162,7 +164,7 @@ export async function update(ctx: BBContext) { datasource = { ...datasource, ...dataSourceBody } if (auth && !ctx.request.body.auth) { // don't strip auth config from DB - datasource.config.auth = auth + datasource.config!.auth = auth } const response = await db.put(datasource) @@ -255,7 +257,7 @@ export async function destroy(ctx: BBContext) { const db = context.getAppDB() const datasourceId = ctx.params.datasourceId - const datasource = await db.get(datasourceId) + const datasource = await sdk.datasources.get(datasourceId) // Delete all queries for the datasource if (datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE) { @@ -313,6 +315,7 @@ function updateError(error: any, newError: any, tables: string[]) { async function buildSchemaHelper(datasource: Datasource) { const Connector = await getIntegration(datasource.source) + datasource = await sdk.datasources.enrichDatasourceWithValues(datasource) // Connect to the DB and build the schema const connector = new Connector(datasource.config) diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index eade7ddab6..e7e2b8e1a5 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -7,6 +7,7 @@ import { invalidateDynamicVariables } from "../../../threads/utils" import { QUERY_THREAD_TIMEOUT } from "../../../environment" import { quotas } from "@budibase/pro" import { events, context, utils, constants } from "@budibase/backend-core" +import sdk from "../../../sdk" const Runner = new Thread(ThreadType.QUERY, { timeoutMs: QUERY_THREAD_TIMEOUT || 10000, @@ -81,7 +82,7 @@ export async function save(ctx: any) { const db = context.getAppDB() const query = ctx.request.body - const datasource = await db.get(query.datasourceId) + const datasource = await sdk.datasources.get(query.datasourceId) let eventFn if (!query._id) { @@ -126,9 +127,9 @@ function getAuthConfig(ctx: any) { } export async function preview(ctx: any) { - const db = context.getAppDB() - - const datasource = await db.get(ctx.request.body.datasourceId) + const datasource = await sdk.datasources.get(ctx.request.body.datasourceId, { + withEnvVars: true, + }) const query = ctx.request.body // preview may not have a queryId as it hasn't been saved, but if it does // this stops dynamic variables from calling the same query @@ -201,7 +202,9 @@ async function execute( const db = context.getAppDB() const query = await db.get(ctx.params.queryId) - const datasource = await db.get(query.datasourceId) + const datasource = await sdk.datasources.get(query.datasourceId, { + withEnvVars: true, + }) let authConfigCtx: any = {} if (!opts.isAutomation) { @@ -266,18 +269,18 @@ export async function executeV2( const removeDynamicVariables = async (queryId: any) => { const db = context.getAppDB() const query = await db.get(queryId) - const datasource = await db.get(query.datasourceId) - const dynamicVariables = datasource.config.dynamicVariables + const datasource = await sdk.datasources.get(query.datasourceId) + const dynamicVariables = datasource.config?.dynamicVariables as any[] if (dynamicVariables) { // delete dynamic variables from the datasource - datasource.config.dynamicVariables = dynamicVariables.filter( + datasource.config!.dynamicVariables = dynamicVariables!.filter( (dv: any) => dv.queryId !== queryId ) await db.put(datasource) // invalidate the deleted variables - const variablesToDelete = dynamicVariables.filter( + const variablesToDelete = dynamicVariables!.filter( (dv: any) => dv.queryId === queryId ) await invalidateDynamicVariables(variablesToDelete) @@ -289,7 +292,7 @@ export async function destroy(ctx: any) { const queryId = ctx.params.queryId await removeDynamicVariables(queryId) const query = await db.get(queryId) - const datasource = await db.get(query.datasourceId) + const datasource = await sdk.datasources.get(query.datasourceId) await db.remove(ctx.params.queryId, ctx.params.revId) ctx.message = `Query deleted.` ctx.status = 200 diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index 80ba4fd808..f5ac028ead 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -25,6 +25,7 @@ import { cloneDeep } from "lodash/fp" import { processFormulas, processDates } from "../../../utilities/rowProcessor" import { context } from "@budibase/backend-core" import { removeKeyNumbering } from "./utils" +import sdk from "../../../sdk" export interface ManyRelationship { tableId?: string @@ -664,8 +665,7 @@ export class ExternalRequest { throw "Unable to run without a table name" } if (!this.datasource) { - const db = context.getAppDB() - this.datasource = await db.get(datasourceId) + this.datasource = await sdk.datasources.get(datasourceId!) if (!this.datasource || !this.datasource.entities) { throw "No tables found, fetch tables before query." } diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts index 83564564b8..ed14eb6929 100644 --- a/packages/server/src/api/controllers/row/external.ts +++ b/packages/server/src/api/controllers/row/external.ts @@ -19,6 +19,7 @@ import { Table, Datasource, } from "@budibase/types" +import sdk from "../../../sdk" export async function handleRequest( operation: Operation, @@ -179,10 +180,9 @@ export async function validate(ctx: BBContext) { export async function exportRows(ctx: BBContext) { const { datasourceId } = breakExternalTableId(ctx.params.tableId) - const db = context.getAppDB() const format = ctx.query.format const { columns } = ctx.request.body - const datasource = await db.get(datasourceId) + const datasource = await sdk.datasources.get(datasourceId!) if (!datasource || !datasource.entities) { ctx.throw(400, "Datasource has not been configured for plus API.") } @@ -225,8 +225,7 @@ export async function fetchEnrichedRow(ctx: BBContext) { const id = ctx.params.rowId const tableId = ctx.params.tableId const { datasourceId, tableName } = breakExternalTableId(tableId) - const db = context.getAppDB() - const datasource: Datasource = await db.get(datasourceId) + const datasource: Datasource = await sdk.datasources.get(datasourceId!) if (!tableName) { ctx.throw(400, "Unable to find table.") } diff --git a/packages/server/src/api/controllers/row/utils.ts b/packages/server/src/api/controllers/row/utils.ts index 60aa8a6b7a..aa58ca6055 100644 --- a/packages/server/src/api/controllers/row/utils.ts +++ b/packages/server/src/api/controllers/row/utils.ts @@ -8,6 +8,7 @@ export { removeKeyNumbering } from "../../../integrations/base/utils" const validateJs = require("validate.js") const { cloneDeep } = require("lodash/fp") import { Ctx } from "@budibase/types" +import sdk from "../../../sdk" validateJs.extend(validateJs.validators.datetime, { parse: function (value: string) { @@ -21,8 +22,7 @@ validateJs.extend(validateJs.validators.datetime, { export async function getDatasourceAndQuery(json: any) { const datasourceId = json.endpoint.datasourceId - const db = context.getAppDB() - const datasource = await db.get(datasourceId) + const datasource = await sdk.datasources.get(datasourceId) return makeExternalQuery(datasource, json) } diff --git a/packages/server/src/api/controllers/static/index.ts b/packages/server/src/api/controllers/static/index.ts index 1113a2a1be..9a61741d46 100644 --- a/packages/server/src/api/controllers/static/index.ts +++ b/packages/server/src/api/controllers/static/index.ts @@ -1,20 +1,21 @@ require("svelte/register") -const send = require("koa-send") -const { resolve, join } = require("../../../utilities/centralPath") +import { resolve, join } from "../../../utilities/centralPath" const uuid = require("uuid") import { ObjectStoreBuckets } from "../../../constants" -const { processString } = require("@budibase/string-templates") -const { +import { processString } from "@budibase/string-templates" +import { loadHandlebarsFile, NODE_MODULES_PATH, TOP_LEVEL_PATH, -} = require("../../../utilities/fileSystem") -const env = require("../../../environment") -const { DocumentType } = require("../../../db/utils") -const { context, objectStore, utils } = require("@budibase/backend-core") -const AWS = require("aws-sdk") -const fs = require("fs") +} from "../../../utilities/fileSystem" +import env from "../../../environment" +import { DocumentType } from "../../../db/utils" +import { context, objectStore, utils } from "@budibase/backend-core" +import AWS from "aws-sdk" +import fs from "fs" +import sdk from "../../../sdk" +const send = require("koa-send") async function prepareUpload({ s3Key, bucket, metadata, file }: any) { const response = await objectStore.upload({ @@ -110,7 +111,7 @@ export const serveApp = async function (ctx: any) { title: appInfo.name, production: env.isProd(), appId, - clientLibPath: objectStore.clientLibraryUrl(appId, appInfo.version), + clientLibPath: objectStore.clientLibraryUrl(appId!, appInfo.version), usedPlugins: plugins, }) @@ -135,7 +136,7 @@ export const serveBuilderPreview = async function (ctx: any) { let appId = context.getAppId() const previewHbs = loadHandlebarsFile(`${__dirname}/templates/preview.hbs`) ctx.body = await processString(previewHbs, { - clientLibPath: objectStore.clientLibraryUrl(appId, appInfo.version), + clientLibPath: objectStore.clientLibraryUrl(appId!, appInfo.version), }) } else { // just return the app info for jest to assert on @@ -150,13 +151,11 @@ export const serveClientLibrary = async function (ctx: any) { } export const getSignedUploadURL = async function (ctx: any) { - const database = context.getAppDB() - // Ensure datasource is valid let datasource try { const { datasourceId } = ctx.params - datasource = await database.get(datasourceId) + datasource = await sdk.datasources.get(datasourceId, { withEnvVars: true }) if (!datasource) { ctx.throw(400, "The specified datasource could not be found") } @@ -172,8 +171,8 @@ export const getSignedUploadURL = async function (ctx: any) { // Determine type of datasource and generate signed URL let signedUrl let publicUrl - const awsRegion = datasource?.config?.region || "eu-west-1" - if (datasource.source === "S3") { + const awsRegion = (datasource?.config?.region || "eu-west-1") as string + if (datasource?.source === "S3") { const { bucket, key } = ctx.request.body || {} if (!bucket || !key) { ctx.throw(400, "bucket and key values are required") @@ -182,8 +181,8 @@ export const getSignedUploadURL = async function (ctx: any) { try { const s3 = new AWS.S3({ region: awsRegion, - accessKeyId: datasource?.config?.accessKeyId, - secretAccessKey: datasource?.config?.secretAccessKey, + accessKeyId: datasource?.config?.accessKeyId as string, + secretAccessKey: datasource?.config?.secretAccessKey as string, apiVersion: "2006-03-01", signatureVersion: "v4", }) diff --git a/packages/server/src/api/controllers/table/external.ts b/packages/server/src/api/controllers/table/external.ts index 8bb8886479..9d56a83206 100644 --- a/packages/server/src/api/controllers/table/external.ts +++ b/packages/server/src/api/controllers/table/external.ts @@ -219,7 +219,7 @@ export async function save(ctx: BBContext) { } const db = context.getAppDB() - const datasource = await db.get(datasourceId) + const datasource = await sdk.datasources.get(datasourceId) if (!datasource.entities) { datasource.entities = {} } @@ -322,15 +322,17 @@ export async function destroy(ctx: BBContext) { const datasourceId = getDatasourceId(tableToDelete) const db = context.getAppDB() - const datasource = await db.get(datasourceId) + const datasource = await sdk.datasources.get(datasourceId!) const tables = datasource.entities const operation = Operation.DELETE_TABLE - await makeTableRequest(datasource, operation, tableToDelete, tables) + if (tables) { + await makeTableRequest(datasource, operation, tableToDelete, tables) + cleanupRelationships(tableToDelete, tables) + delete tables[tableToDelete.name] + datasource.entities = tables + } - cleanupRelationships(tableToDelete, tables) - - delete datasource.entities[tableToDelete.name] await db.put(datasource) return tableToDelete diff --git a/packages/server/src/integrations/base/query.ts b/packages/server/src/integrations/base/query.ts index 7435b28141..9dcba7b10d 100644 --- a/packages/server/src/integrations/base/query.ts +++ b/packages/server/src/integrations/base/query.ts @@ -1,10 +1,12 @@ import { QueryJson, Datasource } from "@budibase/types" -const { getIntegration } = require("../index") +import { getIntegration } from "../index" +import sdk from "../../sdk" export async function makeExternalQuery( datasource: Datasource, json: QueryJson ) { + datasource = await sdk.datasources.enrichDatasourceWithValues(datasource) const Integration = await getIntegration(datasource.source) // query is the opinionated function if (Integration.prototype.query) { diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts new file mode 100644 index 0000000000..ffd379c30d --- /dev/null +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -0,0 +1,24 @@ +import { environmentVariables } from "@budibase/pro" +import { context } from "@budibase/backend-core" +import { processObject } from "@budibase/string-templates" +import { Datasource } from "@budibase/types" +import { cloneDeep } from "lodash/fp" + +export async function enrichDatasourceWithValues(datasource: Datasource) { + const cloned = cloneDeep(datasource) + const envVars = await environmentVariables.fetchValues() + return (await processObject(cloned, envVars)) as Datasource +} + +export async function get( + datasourceId: string, + opts?: { withEnvVars: boolean } +): Promise { + const appDb = context.getAppDB() + const datasource = await appDb.get(datasourceId) + if (opts?.withEnvVars) { + return await enrichDatasourceWithValues(datasource) + } else { + return datasource + } +} diff --git a/packages/server/src/sdk/app/datasources/index.ts b/packages/server/src/sdk/app/datasources/index.ts new file mode 100644 index 0000000000..1ce6b0e689 --- /dev/null +++ b/packages/server/src/sdk/app/datasources/index.ts @@ -0,0 +1,5 @@ +import * as datasources from "./datasources" + +export default { + ...datasources, +} diff --git a/packages/server/src/sdk/app/tables/index.ts b/packages/server/src/sdk/app/tables/index.ts index 98c7fc6a8b..58e70ef39d 100644 --- a/packages/server/src/sdk/app/tables/index.ts +++ b/packages/server/src/sdk/app/tables/index.ts @@ -6,6 +6,7 @@ import { isSQL, } from "../../../integrations/utils" import { Table, Database } from "@budibase/types" +import datasources from "../datasources" async function getAllInternalTables(db?: Database): Promise { if (!db) { @@ -23,9 +24,11 @@ async function getAllInternalTables(db?: Database): Promise { })) } -async function getAllExternalTables(datasourceId: any): Promise { +async function getAllExternalTables( + datasourceId: any +): Promise> { const db = context.getAppDB() - const datasource = await db.get(datasourceId) + const datasource = await datasources.get(datasourceId, { withEnvVars: true }) if (!datasource || !datasource.entities) { throw "Datasource is not configured fully." } @@ -44,7 +47,7 @@ async function getTable(tableId: any): Promise { const db = context.getAppDB() if (isExternalTable(tableId)) { let { datasourceId, tableName } = breakExternalTableId(tableId) - const datasource = await db.get(datasourceId) + const datasource = await datasources.get(datasourceId!) const table = await getExternalTable(datasourceId, tableName) return { ...table, sql: isSQL(datasource) } } else { diff --git a/packages/server/src/sdk/index.ts b/packages/server/src/sdk/index.ts index 2ee40992c8..9da905910f 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 datasources } from "./app/datasources" import { default as rows } from "./app/rows" import { default as users } from "./users" @@ -12,6 +13,7 @@ const sdk = { applications, rows, users, + datasources, } // default export for TS diff --git a/packages/server/src/threads/query.ts b/packages/server/src/threads/query.ts index 3d6428dd56..dbbaa5d2ff 100644 --- a/packages/server/src/threads/query.ts +++ b/packages/server/src/threads/query.ts @@ -6,6 +6,7 @@ import { getIntegration } from "../integrations" import { processStringSync } from "@budibase/string-templates" import { context, cache, auth } from "@budibase/backend-core" import { getGlobalIDFromUserMetadataID } from "../db/utils" +import sdk from "../sdk" import { cloneDeep } from "lodash/fp" const { isSQL } = require("../integrations/utils") @@ -166,7 +167,9 @@ class QueryRunner { async runAnotherQuery(queryId: string, parameters: any) { const db = context.getAppDB() const query = await db.get(queryId) - const datasource = await db.get(query.datasourceId) + const datasource = await sdk.datasources.get(query.datasourceId, { + withEnvVars: true, + }) return new QueryRunner( { datasource, diff --git a/packages/types/src/documents/app/datasource.ts b/packages/types/src/documents/app/datasource.ts index efdc2ca1bd..a37e3d3ddc 100644 --- a/packages/types/src/documents/app/datasource.ts +++ b/packages/types/src/documents/app/datasource.ts @@ -8,7 +8,7 @@ export interface Datasource extends Document { source: SourceName // the config is defined by the schema config?: { - [key: string]: string | number | boolean + [key: string]: string | number | boolean | any[] } plus?: boolean entities?: { From d27674de5cee1f25629870b11a37dd42a719291b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 11 Jan 2023 19:07:01 +0000 Subject: [PATCH 06/55] Replacing some require statements with imports. --- packages/server/src/api/routes/row.ts | 2 +- packages/server/src/index.ts | 2 +- .../server/src/integrations/base/sqlTable.ts | 2 +- packages/server/src/integrations/dynamodb.ts | 6 +++--- packages/server/src/integrations/mysql.ts | 2 +- packages/server/src/integrations/rest.ts | 16 ++++++++-------- packages/server/src/threads/query.ts | 6 +++--- .../src/utilities/fileSystem/filesystem.ts | 10 ++++++---- .../server/src/utilities/fileSystem/plugin.ts | 7 +++---- .../server/src/utilities/fileSystem/template.ts | 4 ++-- 10 files changed, 29 insertions(+), 28 deletions(-) diff --git a/packages/server/src/api/routes/row.ts b/packages/server/src/api/routes/row.ts index f4462b3595..6d1cd206c6 100644 --- a/packages/server/src/api/routes/row.ts +++ b/packages/server/src/api/routes/row.ts @@ -3,7 +3,7 @@ import * as rowController from "../controllers/row" import authorized from "../../middleware/authorized" import { paramResource, paramSubResource } from "../../middleware/resourceId" import { permissions } from "@budibase/backend-core" -const { internalSearchValidator } = require("./utils/validators") +import { internalSearchValidator } from "./utils/validators" const { PermissionType, PermissionLevel } = permissions const router: Router = new Router() diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index fac8403c49..b3fbb22bde 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1,6 +1,6 @@ import { bootstrap } from "global-agent" const fixPath = require("fix-path") -const { checkDevelopmentEnvironment } = require("./utilities/fileSystem") +import { checkDevelopmentEnvironment } from "./utilities/fileSystem" function runServer() { // this will shutdown the system if development environment not ready diff --git a/packages/server/src/integrations/base/sqlTable.ts b/packages/server/src/integrations/base/sqlTable.ts index 2ab610fecd..58b2b7a3d1 100644 --- a/packages/server/src/integrations/base/sqlTable.ts +++ b/packages/server/src/integrations/base/sqlTable.ts @@ -3,7 +3,7 @@ import { Operation, QueryJson, RenameColumn, Table } from "@budibase/types" import { breakExternalTableId } from "../utils" import SchemaBuilder = Knex.SchemaBuilder import CreateTableBuilder = Knex.CreateTableBuilder -const { FieldTypes, RelationshipTypes } = require("../../constants") +import { FieldTypes, RelationshipTypes } from "../../constants" function generateSchema( schema: CreateTableBuilder, diff --git a/packages/server/src/integrations/dynamodb.ts b/packages/server/src/integrations/dynamodb.ts index bf9a0c3b52..28c1c7b52b 100644 --- a/packages/server/src/integrations/dynamodb.ts +++ b/packages/server/src/integrations/dynamodb.ts @@ -5,8 +5,8 @@ import { IntegrationBase, } from "@budibase/types" -const AWS = require("aws-sdk") -const { AWS_REGION } = require("../db/dynamoClient") +import AWS from "aws-sdk" +import { AWS_REGION } from "../db/dynamoClient" interface DynamoDBConfig { region: string @@ -182,7 +182,7 @@ class DynamoDBIntegration implements IntegrationBase { return response } - async describe(query: { table: string }) { + async describe(query: { table: string }): Promise { const params = { TableName: query.table, } diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index 1cd9a356b3..b3881c63a9 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -16,7 +16,7 @@ import { finaliseExternalTables, } from "./utils" import dayjs from "dayjs" -const { NUMBER_REGEX } = require("../utilities") +import { NUMBER_REGEX } from "../utilities" import Sql from "./base/sql" import { MySQLColumn } from "./base/types" diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index 08d2337593..f13c14e504 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -16,11 +16,11 @@ import { import { get } from "lodash" import * as https from "https" import qs from "querystring" -const fetch = require("node-fetch") -const { formatBytes } = require("../utilities") -const { performance } = require("perf_hooks") -const FormData = require("form-data") -const { URLSearchParams } = require("url") +import fetch from "node-fetch" +import { formatBytes } from "../utilities" +import { performance } from "perf_hooks" +import FormData from "form-data" +import { URLSearchParams } from "url" const BodyTypes = { NONE: "none", @@ -204,12 +204,12 @@ class RestIntegration implements IntegrationBase { // Append page number or cursor param if configured if (pageParam && paginationValues.page != null) { - params.append(pageParam, paginationValues.page) + params.append(pageParam, paginationValues.page as string) } // Append page size param if configured if (sizeParam && paginationValues.limit != null) { - params.append(sizeParam, paginationValues.limit) + params.append(sizeParam, String(paginationValues.limit)) } // Prepend query string with pagination params @@ -280,7 +280,7 @@ class RestIntegration implements IntegrationBase { case BodyTypes.ENCODED: const params = new URLSearchParams() for (let [key, value] of Object.entries(object)) { - params.append(key, value) + params.append(key, value as string) } addPaginationToBody((key: string, value: any) => { params.append(key, value) diff --git a/packages/server/src/threads/query.ts b/packages/server/src/threads/query.ts index dbbaa5d2ff..5eb027883f 100644 --- a/packages/server/src/threads/query.ts +++ b/packages/server/src/threads/query.ts @@ -9,11 +9,11 @@ import { getGlobalIDFromUserMetadataID } from "../db/utils" import sdk from "../sdk" import { cloneDeep } from "lodash/fp" -const { isSQL } = require("../integrations/utils") -const { +import { isSQL } from "../integrations/utils" +import { enrichQueryFields, interpolateSQL, -} = require("../integrations/queries/sql") +} from "../integrations/queries/sql" class QueryRunner { datasource: any diff --git a/packages/server/src/utilities/fileSystem/filesystem.ts b/packages/server/src/utilities/fileSystem/filesystem.ts index 48810ffc47..086eaa835a 100644 --- a/packages/server/src/utilities/fileSystem/filesystem.ts +++ b/packages/server/src/utilities/fileSystem/filesystem.ts @@ -1,10 +1,10 @@ import { PathLike } from "fs" -const { budibaseTempDir } = require("../budibaseDir") -const fs = require("fs") -const { join } = require("path") -const uuid = require("uuid/v4") +import fs from "fs" +import { budibaseTempDir } from "../budibaseDir" +import { join } from "path" import env from "../../environment" import tar from "tar" +const uuid = require("uuid/v4") export const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..") @@ -112,6 +112,7 @@ export const sendTempFile = (fileContents: any) => { * allows a centralised location to check logic is all good. */ export const readFileSync = (filepath: PathLike, options = "utf8") => { + // @ts-ignore return fs.readFileSync(filepath, options) } @@ -147,6 +148,7 @@ export const findFileRec = (startPath: PathLike, filter: string): any => { const files = fs.readdirSync(startPath) for (let i = 0, len = files.length; i < len; i++) { + // @ts-ignore const filename = join(startPath, files[i]) const stat = fs.lstatSync(filename) diff --git a/packages/server/src/utilities/fileSystem/plugin.ts b/packages/server/src/utilities/fileSystem/plugin.ts index ea1742faba..0bc2b7de44 100644 --- a/packages/server/src/utilities/fileSystem/plugin.ts +++ b/packages/server/src/utilities/fileSystem/plugin.ts @@ -1,8 +1,7 @@ import { Plugin } from "@budibase/types" - -const { budibaseTempDir } = require("../budibaseDir") -const fs = require("fs") -const { join } = require("path") +import { budibaseTempDir } from "../budibaseDir" +import fs from "fs" +import { join } from "path" import { objectStore } from "@budibase/backend-core" const DATASOURCE_PATH = join(budibaseTempDir(), "datasource") diff --git a/packages/server/src/utilities/fileSystem/template.ts b/packages/server/src/utilities/fileSystem/template.ts index 17a959007e..87e0b44e5c 100644 --- a/packages/server/src/utilities/fileSystem/template.ts +++ b/packages/server/src/utilities/fileSystem/template.ts @@ -1,5 +1,5 @@ -const fs = require("fs") -const { join } = require("path") +import fs from "fs" +import { join } from "path" import { ObjectStoreBuckets } from "../../constants" import { objectStore } from "@budibase/backend-core" From 87cf52192de9b6600a90dcf1eade3c5a995f4aeb Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 12 Jan 2023 14:38:12 +0000 Subject: [PATCH 07/55] Small update to properly support environments with environment variables, making sure that datasources correctly select based on app ID. --- .../server/src/sdk/app/datasources/datasources.ts | 15 ++++++++++----- packages/server/src/threads/query.ts | 5 +---- packages/types/src/sdk/environmentVariables.ts | 4 ++++ packages/types/src/sdk/index.ts | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 packages/types/src/sdk/environmentVariables.ts diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts index ffd379c30d..c6a036ef20 100644 --- a/packages/server/src/sdk/app/datasources/datasources.ts +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -1,13 +1,18 @@ import { environmentVariables } from "@budibase/pro" -import { context } from "@budibase/backend-core" -import { processObject } from "@budibase/string-templates" -import { Datasource } from "@budibase/types" +import { context, db as dbCore } from "@budibase/backend-core" +import { processObjectSync } from "@budibase/string-templates" +import { AppEnvironment, Datasource } from "@budibase/types" import { cloneDeep } from "lodash/fp" export async function enrichDatasourceWithValues(datasource: Datasource) { + const appId = context.getAppId() + const appEnv = dbCore.isDevAppID(appId) + ? AppEnvironment.DEVELOPMENT + : AppEnvironment.PRODUCTION const cloned = cloneDeep(datasource) - const envVars = await environmentVariables.fetchValues() - return (await processObject(cloned, envVars)) as Datasource + const envVars = await environmentVariables.fetchValues(appEnv) + const processed = processObjectSync(cloned, { env: envVars }) + return processed as Datasource } export async function get( diff --git a/packages/server/src/threads/query.ts b/packages/server/src/threads/query.ts index 5eb027883f..9ab96c078f 100644 --- a/packages/server/src/threads/query.ts +++ b/packages/server/src/threads/query.ts @@ -10,10 +10,7 @@ import sdk from "../sdk" import { cloneDeep } from "lodash/fp" import { isSQL } from "../integrations/utils" -import { - enrichQueryFields, - interpolateSQL, -} from "../integrations/queries/sql" +import { enrichQueryFields, interpolateSQL } from "../integrations/queries/sql" class QueryRunner { datasource: any diff --git a/packages/types/src/sdk/environmentVariables.ts b/packages/types/src/sdk/environmentVariables.ts new file mode 100644 index 0000000000..0fe01de1bb --- /dev/null +++ b/packages/types/src/sdk/environmentVariables.ts @@ -0,0 +1,4 @@ +export enum AppEnvironment { + PRODUCTION = "production", + DEVELOPMENT = "development", +} diff --git a/packages/types/src/sdk/index.ts b/packages/types/src/sdk/index.ts index e5512b062b..f8f9d9cb97 100644 --- a/packages/types/src/sdk/index.ts +++ b/packages/types/src/sdk/index.ts @@ -11,3 +11,4 @@ export * from "./locks" export * from "./db" export * from "./middleware" export * from "./featureFlag" +export * from "./environmentVariables" From a4fd65b49542464da9e7debeea0ce836de7437a6 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 12 Jan 2023 14:38:30 +0000 Subject: [PATCH 08/55] add edit and add modals --- .../src/pages/builder/portal/_layout.svelte | 9 +- .../_components/editVariableModal.svelte | 69 ++++++++++++++ .../builder/portal/environment/index.svelte | 91 +++++++++++++++---- packages/builder/src/stores/portal/envVars.js | 9 +- packages/builder/src/stores/portal/index.js | 1 + 5 files changed, 157 insertions(+), 22 deletions(-) create mode 100644 packages/builder/src/pages/builder/portal/environment/_components/editVariableModal.svelte diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index a4bd22a692..27a914105e 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -53,10 +53,6 @@ title: "Plugins", href: "/builder/portal/plugins", }, - { - title: "Environment", - href: "/builder/portal/environment", - }, ] // Admin only pages @@ -74,6 +70,11 @@ title: "Plugins", href: "/builder/portal/plugins", }, + { + title: "Environment", + href: "/builder/portal/environment", + }, + { title: "Settings", href: "/builder/portal/settings", diff --git a/packages/builder/src/pages/builder/portal/environment/_components/editVariableModal.svelte b/packages/builder/src/pages/builder/portal/environment/_components/editVariableModal.svelte new file mode 100644 index 0000000000..a6e9cd50bb --- /dev/null +++ b/packages/builder/src/pages/builder/portal/environment/_components/editVariableModal.svelte @@ -0,0 +1,69 @@ + + +Edit + + + + + +
+ Production + (productionTouched = true)} + label="Value" + bind:value={productionValue} + /> +
+
+ Development + (developmentTouched = true)} + label="Value" + bind:value={developmentValue} + /> + +
+ + +
+
+ + { + console.log("delete") + }} + okText="Delete Environment Variable" + title="Confirm Deletion" +> + Are you sure you wish to delete the environment variable + {row.name}? + This action cannot be undone. + diff --git a/packages/builder/src/pages/builder/portal/environment/index.svelte b/packages/builder/src/pages/builder/portal/environment/index.svelte index 9fb19fe676..4c377d2051 100644 --- a/packages/builder/src/pages/builder/portal/environment/index.svelte +++ b/packages/builder/src/pages/builder/portal/environment/index.svelte @@ -7,33 +7,92 @@ Select, Divider, Modal, + ModalContent, Search, + Page, + Table, + Input, + Checkbox, } from "@budibase/bbui" - + import { envVars } from "stores/portal" import { onMount } from "svelte" + import EditVariableModal from "./_components/editVariableModal.svelte" + + let modal + + let useProductionValue = true + + let developmentValue + let productionValue + const schema = { + name: { + width: "2fr", + }, + edit: { + width: "auto", + borderLeft: true, + displayName: "", + }, + } + + const customRenderers = [{ column: "edit", component: EditVariableModal }] onMount(async () => { await envVars.load() }) - - - Envrironment Variables - Add and manage environment variable for development and production - - + - {#each $envVars as envVar} - - {envVar} - - - {/each} + + Envrironment Variables + Add and manage environment variable for development and production + + + +
+ +
+ +
- + + + + + + +
+ Production + +
+
+ Development + + { + developmentValue = productionValue + }} + bind:value={useProductionValue} + text="Use production value" + /> +
+
+
diff --git a/packages/builder/src/stores/portal/envVars.js b/packages/builder/src/stores/portal/envVars.js index 9c9880511a..81d3143f15 100644 --- a/packages/builder/src/stores/portal/envVars.js +++ b/packages/builder/src/stores/portal/envVars.js @@ -5,10 +5,15 @@ export function createEnvVarsStore() { const { subscribe, set, update } = writable([]) async function load() { - const envVars = await API.fetchEnvVars() + // const envVars = await API.fetchEnvVars() let testVars = ['blah', 'blah123'] - set(testVars) + + // turn the testVars array in to a map with "name" being the value of each + // item in the array + const vars = testVars.map((name) => ({ name })) + console.log(vars) + set(vars) } return { diff --git a/packages/builder/src/stores/portal/index.js b/packages/builder/src/stores/portal/index.js index 81d26b900e..370c448bb3 100644 --- a/packages/builder/src/stores/portal/index.js +++ b/packages/builder/src/stores/portal/index.js @@ -11,3 +11,4 @@ export { groups } from "./groups" export { plugins } from "./plugins" export { backups } from "./backups" export { overview } from "./overview" +export { envVars } from "./envVars" \ No newline at end of file From a0dacc9717fd4ea04fd831f352d36bed76165cd4 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 12 Jan 2023 16:09:05 +0000 Subject: [PATCH 09/55] add create store method and tidy up --- .../src/pages/builder/portal/_layout.svelte | 5 -- .../builder/portal/settings/_layout.svelte | 5 ++ .../_components/editVariableModal.svelte | 0 .../{ => settings}/environment/index.svelte | 47 +++++++++---------- packages/builder/src/stores/portal/envVars.js | 11 +++-- packages/builder/src/stores/portal/index.js | 2 +- packages/frontend-core/src/api/envVars.js | 9 +++- 7 files changed, 43 insertions(+), 36 deletions(-) rename packages/builder/src/pages/builder/portal/{ => settings}/environment/_components/editVariableModal.svelte (100%) rename packages/builder/src/pages/builder/portal/{ => settings}/environment/index.svelte (70%) diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index dc8e60edd6..9048502550 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -55,11 +55,6 @@ title: "Plugins", href: "/builder/portal/plugins", }, - { - title: "Environment", - href: "/builder/portal/environment", - }, - { title: "Settings", href: "/builder/portal/settings", diff --git a/packages/builder/src/pages/builder/portal/settings/_layout.svelte b/packages/builder/src/pages/builder/portal/settings/_layout.svelte index 57410bcaeb..6d9f306991 100644 --- a/packages/builder/src/pages/builder/portal/settings/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/settings/_layout.svelte @@ -26,6 +26,11 @@ url={$url("./organisation")} active={$isActive("./organisation")} /> + {#if !$admin.cloud} - - - - Envrironment Variables - Add and manage environment variable for development and production - - - -
- -
- -
+ + + Envrironment Variables + Add and manage environment variable for development and production - + + +
+ +
+ +
+ diff --git a/packages/builder/src/stores/portal/envVars.js b/packages/builder/src/stores/portal/envVars.js index ec3af53d8f..0d257d6bf7 100644 --- a/packages/builder/src/stores/portal/envVars.js +++ b/packages/builder/src/stores/portal/envVars.js @@ -6,16 +6,21 @@ export function createEnvVarsStore() { async function load() { // const envVars = await API.fetchEnvVars() - - let testVars = ['blah', 'blah123'] - const vars = testVars.map((name) => ({ name })) + let testVars = ["blah", "blah123"] + const vars = testVars.map(name => ({ name })) console.log(vars) set(vars) } + async function create() { + const envVar = await API.createEnvVar() + update(envVars => [envVar, ...envVars]) + } + return { subscribe, load, + create, } } diff --git a/packages/builder/src/stores/portal/index.js b/packages/builder/src/stores/portal/index.js index 370c448bb3..a1ed6615a1 100644 --- a/packages/builder/src/stores/portal/index.js +++ b/packages/builder/src/stores/portal/index.js @@ -11,4 +11,4 @@ export { groups } from "./groups" export { plugins } from "./plugins" export { backups } from "./backups" export { overview } from "./overview" -export { envVars } from "./envVars" \ No newline at end of file +export { envVars } from "./envVars" diff --git a/packages/frontend-core/src/api/envVars.js b/packages/frontend-core/src/api/envVars.js index 7a728e9d18..44f81cd6c9 100644 --- a/packages/frontend-core/src/api/envVars.js +++ b/packages/frontend-core/src/api/envVars.js @@ -2,7 +2,14 @@ export const buildEnvironmentVariableEndpoints = API => ({ /** * Fetches a list of environment variables */ - fetchEnvVars: async () => { + fetchVariables: async () => { + return await API.get({ + url: `/api/env/variables`, + json: false, + }) + }, + + createVariable: async () => { return await API.get({ url: `/api/env/variables`, json: false, From f00034544fc41f22a70db2b68be95a333d36516b Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 13 Jan 2023 16:39:26 +0000 Subject: [PATCH 10/55] reuse modal for edit and create and add delete function --- .../CreateEditVariableModal.svelte | 89 +++++++++++++++++++ .../_components/EditVariableColumn.svelte | 35 ++++++++ .../_components/editVariableModal.svelte | 69 -------------- .../portal/settings/environment/index.svelte | 48 +++------- packages/builder/src/stores/portal/envVars.js | 27 ------ .../builder/src/stores/portal/environment.js | 38 ++++++++ packages/builder/src/stores/portal/index.js | 2 +- packages/frontend-core/src/api/envVars.js | 18 ---- .../src/api/environmentVariables.js | 30 +++++++ packages/frontend-core/src/api/index.js | 3 +- 10 files changed, 207 insertions(+), 152 deletions(-) create mode 100644 packages/builder/src/pages/builder/portal/settings/environment/_components/CreateEditVariableModal.svelte create mode 100644 packages/builder/src/pages/builder/portal/settings/environment/_components/EditVariableColumn.svelte delete mode 100644 packages/builder/src/pages/builder/portal/settings/environment/_components/editVariableModal.svelte delete mode 100644 packages/builder/src/stores/portal/envVars.js create mode 100644 packages/builder/src/stores/portal/environment.js delete mode 100644 packages/frontend-core/src/api/envVars.js create mode 100644 packages/frontend-core/src/api/environmentVariables.js diff --git a/packages/builder/src/pages/builder/portal/settings/environment/_components/CreateEditVariableModal.svelte b/packages/builder/src/pages/builder/portal/settings/environment/_components/CreateEditVariableModal.svelte new file mode 100644 index 0000000000..0ea487c885 --- /dev/null +++ b/packages/builder/src/pages/builder/portal/settings/environment/_components/CreateEditVariableModal.svelte @@ -0,0 +1,89 @@ + + + + save({ + name, + production: productionValue, + development: developmentValue, + })} + title={!row ? "Add new environment variable" : "Edit environment variable"} +> + +
+ Production + { + productionValue = e.detail + if (useProductionValue) { + developmentValue = e.detail + } + }} + value={productionValue} + /> +
+
+ Development + { + developmentValue = e.target.value + }} + disabled={useProductionValue} + label="Value" + value={useProductionValue ? productionValue : developmentValue} + /> + +
+ + +
+ + { + deleteVariable(row.name) + }} + okText="Delete Environment Variable" + title="Confirm Deletion" +> + Are you sure you wish to delete the environment variable + {row.name}? + This action cannot be undone. + diff --git a/packages/builder/src/pages/builder/portal/settings/environment/_components/EditVariableColumn.svelte b/packages/builder/src/pages/builder/portal/settings/environment/_components/EditVariableColumn.svelte new file mode 100644 index 0000000000..83f37d3fdb --- /dev/null +++ b/packages/builder/src/pages/builder/portal/settings/environment/_components/EditVariableColumn.svelte @@ -0,0 +1,35 @@ + + +Edit + + + + + + { + environment.deleteVariable(row.name) + }} + okText="Delete Environment Variable" + title="Confirm Deletion" +> + Are you sure you wish to delete the environment variable + {row.name}? + This action cannot be undone. + diff --git a/packages/builder/src/pages/builder/portal/settings/environment/_components/editVariableModal.svelte b/packages/builder/src/pages/builder/portal/settings/environment/_components/editVariableModal.svelte deleted file mode 100644 index a6e9cd50bb..0000000000 --- a/packages/builder/src/pages/builder/portal/settings/environment/_components/editVariableModal.svelte +++ /dev/null @@ -1,69 +0,0 @@ - - -Edit - - - - - -
- Production - (productionTouched = true)} - label="Value" - bind:value={productionValue} - /> -
-
- Development - (developmentTouched = true)} - label="Value" - bind:value={developmentValue} - /> - -
- - -
-
- - { - console.log("delete") - }} - okText="Delete Environment Variable" - title="Confirm Deletion" -> - Are you sure you wish to delete the environment variable - {row.name}? - This action cannot be undone. - diff --git a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte index ab52ceb1bf..06cfc02085 100644 --- a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte @@ -6,21 +6,15 @@ Button, Divider, Modal, - ModalContent, Table, - Input, - Checkbox, } from "@budibase/bbui" - import { envVars } from "stores/portal" + import { environment } from "stores/portal" import { onMount } from "svelte" - import EditVariableModal from "./_components/editVariableModal.svelte" + import CreateEditVariableModal from "./_components/CreateEditVariableModal.svelte" + import EditVariableColumn from "./_components/EditVariableColumn.svelte" let modal - let useProductionValue = true - - let developmentValue - let productionValue const schema = { name: { width: "2fr", @@ -32,11 +26,16 @@ }, } - const customRenderers = [{ column: "edit", component: EditVariableModal }] + const customRenderers = [{ column: "edit", component: EditVariableColumn }] onMount(async () => { - await envVars.load() + await environment.loadVariables() }) + + const save = data => { + environment.createVariable(data) + modal.hide() + } @@ -50,7 +49,7 @@
- - - -
- Production - -
-
- Development - - { - developmentValue = productionValue - }} - bind:value={useProductionValue} - text="Use production value" - /> -
-
+
diff --git a/packages/builder/src/stores/portal/environment.js b/packages/builder/src/stores/portal/environment.js index ba33f22e6f..fa06242cf5 100644 --- a/packages/builder/src/stores/portal/environment.js +++ b/packages/builder/src/stores/portal/environment.js @@ -26,6 +26,7 @@ export function createEnvironmentStore() { async function updateVariable(data) { await API.updateEnvironmentVariable(data) } + return { subscribe, loadVariables, diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js index 59a1622c9f..f6e96b1dcd 100644 --- a/packages/builder/src/stores/portal/licensing.js +++ b/packages/builder/src/stores/portal/licensing.js @@ -60,7 +60,9 @@ export const createLicensingStore = () => { const backupsEnabled = license.features.includes( Constants.Features.BACKUPS ) - + let environmentVariablesEnabled = license.features.includes( + Constants.Features.ENVIRONMENT_VARIABLES + ) store.update(state => { return { ...state, @@ -68,6 +70,7 @@ export const createLicensingStore = () => { isFreePlan, groupsEnabled, backupsEnabled, + environmentVariablesEnabled, } }) }, From e29a828abc2d17aaa08cf8c35cd8dfa00da62737 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 17 Jan 2023 10:51:26 +0000 Subject: [PATCH 17/55] add export modal warning --- .../builder/src/components/start/ExportAppModal.svelte | 5 ++++- .../pages/builder/portal/settings/environment/index.svelte | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte index 25c0606c14..948416b192 100644 --- a/packages/builder/src/components/start/ExportAppModal.svelte +++ b/packages/builder/src/components/start/ExportAppModal.svelte @@ -1,5 +1,5 @@ + Apps can be exported with or without data that is within internal tables - select this below.Add Variable {:else} -
+ +
+
{:else}
From b659060beb4246ad943b4660fb06f7a823d12a3d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 18 Jan 2023 19:16:19 +0000 Subject: [PATCH 20/55] Updating datasource API to remove secrets when returning datasources. --- .../portal/settings/environment/index.svelte | 2 +- .../builder/src/stores/backend/datasources.js | 4 +- .../server/src/api/controllers/datasource.ts | 52 +++++++++++-------- .../src/sdk/app/datasources/datasources.ts | 37 ++++++++++++- packages/types/src/sdk/datasources.ts | 13 ++++- 5 files changed, 81 insertions(+), 27 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte index 28258ccf4b..9af22ba942 100644 --- a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte @@ -53,7 +53,7 @@
- Envrironment Variables + Environment Variables {#if !$licensing.environmentVariablesEnabled} Pro plan diff --git a/packages/builder/src/stores/backend/datasources.js b/packages/builder/src/stores/backend/datasources.js index bbbf86a41d..ed84bb8ee9 100644 --- a/packages/builder/src/stores/backend/datasources.js +++ b/packages/builder/src/stores/backend/datasources.js @@ -28,7 +28,7 @@ export function createDatasourcesStore() { })) } - const updateDatasource = async response => { + const updateDatasource = response => { const { datasource, error } = response store.update(state => { const currentIdx = state.list.findIndex(ds => ds._id === datasource._id) @@ -52,7 +52,7 @@ export function createDatasourcesStore() { datasourceId: datasource?._id, tablesFilter, }) - return await updateDatasource(response) + return updateDatasource(response) } const save = async (body, fetchSchema = false) => { diff --git a/packages/server/src/api/controllers/datasource.ts b/packages/server/src/api/controllers/datasource.ts index 47fde0764b..9568b40243 100644 --- a/packages/server/src/api/controllers/datasource.ts +++ b/packages/server/src/api/controllers/datasource.ts @@ -8,18 +8,24 @@ import { } from "../../db/utils" import { destroy as tableDestroy } from "./table/internal" import { BuildSchemaErrors, InvalidColumns } from "../../constants" -import { getIntegration } from "../../integrations" +import { getIntegration, getDefinitions } from "../../integrations" import { getDatasourceAndQuery } from "./row/utils" import { invalidateDynamicVariables } from "../../threads/utils" import { db as dbCore, context, events } from "@budibase/backend-core" -import { BBContext, Datasource, Row } from "@budibase/types" +import { + UserCtx, + Datasource, + Row, + DatasourceFieldType, + PASSWORD_REPLACEMENT, +} from "@budibase/types" import sdk from "../../sdk" -import { cloneDeep } from "lodash/fp" -import { enrich } from "../../sdk/app/datasources/datasources" +import { removeSecrets } from "../../sdk/app/datasources/datasources" -export async function fetch(ctx: BBContext) { +export async function fetch(ctx: UserCtx) { // Get internal tables const db = context.getAppDB() + const definitions = await getDefinitions() const internalTables = await db.allDocs( getTableParams(null, { include_docs: true, @@ -46,23 +52,19 @@ export async function fetch(ctx: BBContext) { ) ).rows.map(row => row.doc) - const allDatasources = [bbInternalDb, ...datasources] + const allDatasources: Datasource[] = [bbInternalDb, ...datasources] for (let datasource of allDatasources) { - if (datasource.config && datasource.config.auth) { - // strip secrets from response so they don't show in the network request - delete datasource.config.auth - } - + datasource = sdk.datasources.removeSecrets(definitions, datasource) if (datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE) { - datasource.entities = internal[datasource._id] + datasource.entities = internal[datasource._id!] } } ctx.body = [bbInternalDb, ...datasources] } -export async function buildSchemaFromDb(ctx: BBContext) { +export async function buildSchemaFromDb(ctx: UserCtx) { const db = context.getAppDB() const datasource = await sdk.datasources.get(ctx.params.datasourceId) const tablesFilter = ctx.request.body.tablesFilter @@ -149,11 +151,12 @@ async function invalidateVariables( await invalidateDynamicVariables(toInvalidate) } -export async function update(ctx: BBContext) { +export async function update(ctx: UserCtx) { const db = context.getAppDB() const datasourceId = ctx.params.datasourceId let datasource = await sdk.datasources.get(datasourceId) const auth = datasource.config?.auth + const definitions = await getDefinitions() await invalidateVariables(datasource, ctx.request.body) const isBudibaseSource = datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE @@ -182,13 +185,16 @@ export async function update(ctx: BBContext) { ctx.status = 200 ctx.message = "Datasource saved successfully." - ctx.body = { datasource } + ctx.body = { + datasource: sdk.datasources.removeSecrets(definitions, datasource), + } } -export async function save(ctx: BBContext) { +export async function save(ctx: UserCtx) { const db = context.getAppDB() const plus = ctx.request.body.datasource.plus const fetchSchema = ctx.request.body.fetchSchema + const definitions = await getDefinitions() const datasource = { _id: generateDatasourceID({ plus }), @@ -216,7 +222,9 @@ export async function save(ctx: BBContext) { } } - const response: any = { datasource } + const response: any = { + datasource: sdk.datasources.removeSecrets(definitions, datasource), + } if (schemaError) { response.error = schemaError } @@ -254,7 +262,7 @@ async function destroyInternalTablesBySourceId(datasourceId: string) { } } -export async function destroy(ctx: BBContext) { +export async function destroy(ctx: UserCtx) { const db = context.getAppDB() const datasourceId = ctx.params.datasourceId @@ -282,13 +290,15 @@ export async function destroy(ctx: BBContext) { ctx.status = 200 } -export async function find(ctx: BBContext) { +export async function find(ctx: UserCtx) { const database = context.getAppDB() - ctx.body = await database.get(ctx.params.datasourceId) + const definitions = await getDefinitions() + const datasource = await database.get(ctx.params.datasourceId) + ctx.body = sdk.datasources.removeSecrets(definitions, datasource) } // dynamic query functionality -export async function query(ctx: BBContext) { +export async function query(ctx: UserCtx) { const queryJson = ctx.request.body try { ctx.body = await getDatasourceAndQuery(queryJson) diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts index 10f9ac889c..52204d7482 100644 --- a/packages/server/src/sdk/app/datasources/datasources.ts +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -1,6 +1,11 @@ import { context } from "@budibase/backend-core" -import { processObjectSync } from "@budibase/string-templates" -import { Datasource } from "@budibase/types" +import { processObjectSync, findHBSBlocks } from "@budibase/string-templates" +import { + Datasource, + DatasourceFieldType, + Integration, + PASSWORD_REPLACEMENT, +} from "@budibase/types" import { cloneDeep } from "lodash/fp" import { getEnvironmentVariables } from "../../utils" @@ -37,3 +42,31 @@ export async function getWithEnvVars(datasourceId: string) { const datasource = await appDb.get(datasourceId) return enrichDatasourceWithValues(datasource) } + +export function removeSecrets( + definitions: Record, + datasource: Datasource +) { + const schema = definitions[datasource.source] + if (datasource.config) { + // strip secrets from response, so they don't show in the network request + if (datasource.config.auth) { + delete datasource.config.auth + } + // remove passwords + for (let key of Object.keys(datasource.config)) { + if (typeof datasource.config[key] !== "string") { + continue + } + const blocks = findHBSBlocks(datasource.config[key] as string) + const usesEnvVars = blocks.find(block => block.includes("env.")) != null + if ( + !usesEnvVars && + schema.datasource?.[key]?.type === DatasourceFieldType.PASSWORD + ) { + datasource.config[key] = PASSWORD_REPLACEMENT + } + } + } + return datasource +} diff --git a/packages/types/src/sdk/datasources.ts b/packages/types/src/sdk/datasources.ts index 279a76446f..9d5b001a4b 100644 --- a/packages/types/src/sdk/datasources.ts +++ b/packages/types/src/sdk/datasources.ts @@ -1,5 +1,7 @@ import { Table } from "../documents" +export const PASSWORD_REPLACEMENT = "--secret-value--" + export enum Operation { CREATE = "CREATE", READ = "READ", @@ -104,7 +106,16 @@ export interface Integration { friendlyName: string type?: string iconUrl?: string - datasource: {} + datasource: Record< + string, + { + type: string + display?: string + deprecated?: boolean + default?: any + required?: boolean + } + > query: { [key: string]: QueryDefinition } From eae7b529a71bf2763dc61848b18d0631cfc9da9c Mon Sep 17 00:00:00 2001 From: Mateus Badan de Pieri Date: Thu, 19 Jan 2023 15:07:56 +0000 Subject: [PATCH 21/55] adding validation for envvar bindings adding validation for envvar bindings --- packages/server/src/sdk/app/datasources/datasources.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts index 52204d7482..13ef1113a6 100644 --- a/packages/server/src/sdk/app/datasources/datasources.ts +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -7,6 +7,7 @@ import { PASSWORD_REPLACEMENT, } from "@budibase/types" import { cloneDeep } from "lodash/fp" +import { env } from "process" import { getEnvironmentVariables } from "../../utils" async function enrichDatasourceWithValues(datasource: Datasource) { @@ -40,7 +41,13 @@ export async function get( export async function getWithEnvVars(datasourceId: string) { const appDb = context.getAppDB() const datasource = await appDb.get(datasourceId) - return enrichDatasourceWithValues(datasource) + const blocks = findHBSBlocks(JSON.stringify(datasource)) + const usesEnvVars = blocks.find(block => block.includes("env.")) != null + if (usesEnvVars) { + return enrichDatasourceWithValues(datasource) + } else { + throw new Error("Environment variables binding format incorrect") + } } export function removeSecrets( From 47663ca395c2f54ac2507f13229d148fcc983004 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 19 Jan 2023 16:43:06 +0000 Subject: [PATCH 22/55] update datasource config to allow env var selection --- .../bbui/src/Form/Core/EnvDropdown.svelte | 241 ++++++++++++++++++ packages/bbui/src/Form/EnvDropdown.svelte | 48 ++++ packages/bbui/src/index.js | 1 + .../IntegrationConfigForm.svelte | 28 +- .../common/bindings/BindingPanel.svelte | 1 + .../bindings/DrawerBindableInput.svelte | 3 +- .../integration/KeyValueBuilder.svelte | 2 +- .../CreateEditVariableModal.svelte | 0 .../components/start/ExportAppModal.svelte | 9 +- .../_components/EditVariableColumn.svelte | 2 +- .../portal/settings/environment/index.svelte | 4 +- .../builder/src/stores/portal/environment.js | 1 - .../builder/src/stores/portal/licensing.js | 2 + 13 files changed, 331 insertions(+), 11 deletions(-) create mode 100644 packages/bbui/src/Form/Core/EnvDropdown.svelte create mode 100644 packages/bbui/src/Form/EnvDropdown.svelte rename packages/builder/src/{pages/builder/portal/settings/environment/_components => components/portal/environment}/CreateEditVariableModal.svelte (100%) diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte new file mode 100644 index 0000000000..9b6346a8e1 --- /dev/null +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -0,0 +1,241 @@ + + +
+
+ + + +
+ {#if open} +
+
    + {#if variables.length} + {#each variables as variable, idx} +
  • handleVarSelect(variable.name)} + > + +
    + {variable.name} + +
    + +
    +
  • + {/each} + {:else} +
  • + +
    + You don't have any environment variables yet +
    +
    +
  • + {/if} +
+ +
+ +
showModal()} class="primary-text"> + Add Variable +
+
+
+ {/if} +
+ + diff --git a/packages/bbui/src/Form/EnvDropdown.svelte b/packages/bbui/src/Form/EnvDropdown.svelte new file mode 100644 index 0000000000..941b036e24 --- /dev/null +++ b/packages/bbui/src/Form/EnvDropdown.svelte @@ -0,0 +1,48 @@ + + + + + diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index 601c4dcbca..06f3c22037 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -27,6 +27,7 @@ export { default as RadioGroup } from "./Form/RadioGroup.svelte" export { default as Checkbox } from "./Form/Checkbox.svelte" export { default as InputDropdown } from "./Form/InputDropdown.svelte" export { default as PickerDropdown } from "./Form/PickerDropdown.svelte" +export { default as EnvDropdown } from "./Form/EnvDropdown.svelte" export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte" export { default as Popover } from "./Popover/Popover.svelte" export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte" diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte index 05649e1773..fab633ffa2 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte @@ -6,16 +6,22 @@ Toggle, Button, TextArea, + Modal, + EnvDropdown, } from "@budibase/bbui" import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte" import { capitalise } from "helpers" import { IntegrationTypes } from "constants/backend" import { createValidationStore } from "helpers/validation/yup" - import { createEventDispatcher } from "svelte" + import { createEventDispatcher, onMount } from "svelte" + import { environment } from "stores/portal" + import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte" export let datasource export let schema export let creating + + let createVariableModal const validation = createValidationStore() const dispatch = createEventDispatcher() @@ -60,6 +66,18 @@ } return capitalise(name) } + + function save(data) { + environment.createVariable(data) + createVariableModal.hide() + } + + function showModal() { + createVariableModal.show() + } + onMount(async () => { + await environment.loadVariables() + })
@@ -103,7 +121,9 @@ {:else}
- + + + + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte index fab633ffa2..f960c63c08 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte @@ -124,7 +124,6 @@ { try { environment.deleteVariable(name) + modalContext.hide() notifications.success("Environment variable deleted") } catch (err) { notifications.error(err.message) From 22e1c1cccf6119937815d1a357a930db68f40ead Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 24 Jan 2023 15:44:34 +0000 Subject: [PATCH 28/55] ensure object is passed to processObjectSync --- packages/server/src/sdk/app/datasources/datasources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts index 60ee2e8906..302b340600 100644 --- a/packages/server/src/sdk/app/datasources/datasources.ts +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -15,7 +15,7 @@ const ENV_VAR_PREFIX = "env." async function enrichDatasourceWithValues(datasource: Datasource) { const cloned = cloneDeep(datasource) const env = await getEnvironmentVariables() - const processed = processObjectSync(cloned, env) + const processed = processObjectSync(cloned, { env }) return { datasource: processed as Datasource, envVars: env as Record, From 6349b0888830b02b9e41224eb0befffdc2b48c1b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 24 Jan 2023 18:56:19 +0000 Subject: [PATCH 29/55] Don't check whether or not a datasource uses env vars when the function specifically includes the env vars, always fetch them so that they can be returned and put into context for queries to use. --- packages/server/src/sdk/app/datasources/datasources.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts index 302b340600..ed18e43928 100644 --- a/packages/server/src/sdk/app/datasources/datasources.ts +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -43,14 +43,7 @@ export async function get( export async function getWithEnvVars(datasourceId: string) { const appDb = context.getAppDB() const datasource = await appDb.get(datasourceId) - const blocks = findHBSBlocks(JSON.stringify(datasource)) - const usesEnvVars = - blocks.find(block => block.includes(ENV_VAR_PREFIX)) != null - if (usesEnvVars) { - return enrichDatasourceWithValues(datasource) - } else { - return datasource - } + return enrichDatasourceWithValues(datasource) } export function isValid(datasource: Datasource) { From 100571b6fe1258e65b88c13bc86e638ba40e40a0 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 25 Jan 2023 11:27:57 +0000 Subject: [PATCH 30/55] add licensing check to env dropdown --- .../bbui/src/Form/Core/EnvDropdown.svelte | 94 +++++++++++-------- packages/bbui/src/Form/EnvDropdown.svelte | 4 + .../IntegrationConfigForm.svelte | 10 +- 3 files changed, 70 insertions(+), 38 deletions(-) diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index e3cb33f555..178603ee5d 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -15,7 +15,8 @@ export let autofocus = false export let variables export let showModal - + export let environmentVariablesEnabled + export let handleUpgradePanel const dispatch = createEventDispatcher() let field @@ -131,34 +132,41 @@ class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open" >
    - {#if variables.length} - {#each variables as variable, idx} -
  • handleVarSelect(variable.name)} - > - -
    - {variable.name} - -
    - -
    -
  • - {/each} + {#if !environmentVariablesEnabled} +
    + Upgrade your plan to get environment variables +
    + {:else if variables.length} +
    + {#each variables as variable, idx} +
  • handleVarSelect(variable.name)} + > + +
    + {variable.name} + +
    + +
    +
  • + {/each} +
    {:else}
    You don't have any environment variables yet @@ -166,16 +174,29 @@ {/if}
-
showModal()} class="add-variable"> - -
Add Variable
-
+ {#if environmentVariablesEnabled} +
showModal()} class="add-variable"> + +
Add Variable
+
+ {:else} +
handleUpgradePanel()} class="add-variable"> + +
Upgrade plan
+
+ {/if}
{/if}
@@ -222,7 +243,6 @@ } .no-variables-height { - height: 100px; } .no-variables-text { diff --git a/packages/bbui/src/Form/EnvDropdown.svelte b/packages/bbui/src/Form/EnvDropdown.svelte index 941b036e24..33924af0a5 100644 --- a/packages/bbui/src/Form/EnvDropdown.svelte +++ b/packages/bbui/src/Form/EnvDropdown.svelte @@ -17,6 +17,8 @@ export let autofocus export let variables export let showModal + export let environmentVariablesEnabled + export let handleUpgradePanel const dispatch = createEventDispatcher() const onChange = e => { value = e.detail @@ -38,6 +40,8 @@ {autofocus} {variables} {showModal} + {environmentVariablesEnabled} + {handleUpgradePanel} on:change={onChange} on:click on:input diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte index f960c63c08..1a261008c2 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte @@ -14,7 +14,7 @@ import { IntegrationTypes } from "constants/backend" import { createValidationStore } from "helpers/validation/yup" import { createEventDispatcher, onMount } from "svelte" - import { environment } from "stores/portal" + import { environment, licensing } from "stores/portal" import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte" export let datasource @@ -75,6 +75,12 @@ function showModal() { createVariableModal.show() } + + async function handleUpgradePanel() { + await environment.upgradePanelOpened() + $licensing.goToUpgradePage() + } + onMount(async () => { await environment.loadVariables() }) @@ -127,6 +133,8 @@ on:change bind:value={config[configKey]} error={$validation.errors[configKey]} + environmentVariablesEnabled={$licensing.environmentVariablesEnabled} + {handleUpgradePanel} />
{/if} From fc6d20c0b2bcf22f7d823edeaae6f498e28f1d0e Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 25 Jan 2023 11:39:13 +0000 Subject: [PATCH 31/55] add environment bindings to rest query binding drawer --- .../builder/src/builderStore/dataBinding.js | 18 +++++++++++++++++- .../common/bindings/DrawerBindableInput.svelte | 2 +- .../integration/RestQueryViewer.svelte | 8 ++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index d188073b95..3f284f75c4 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -21,6 +21,7 @@ import { import { TableNames } from "../constants" import { JSONUtils } from "@budibase/frontend-core" import ActionDefinitions from "components/design/settings/controls/ButtonActionEditor/manifest.json" +import { environment } from "stores/portal" // Regex to match all instances of template strings const CAPTURE_VAR_INSIDE_TEMPLATE = /{{([^}]+)}}/g @@ -54,7 +55,7 @@ export const getBindableProperties = (asset, componentId) => { */ export const getRestBindings = () => { const userBindings = getUserBindings() - return [...userBindings, ...getAuthBindings()] + return [...userBindings, ...getAuthBindings(), ...getEnvironmentBindings()] } /** @@ -89,6 +90,21 @@ export const getAuthBindings = () => { return bindings } +export const getEnvironmentBindings = () => { + let envVars = get(environment).variables + let test = envVars.map(variable => { + return { + type: "context", + runtimeBinding: `env.${makePropSafe(variable.name)}`, + readableBinding: `env.${variable.name}`, + category: "Environment", + icon: "Key", + display: { type: "string", name: variable.name }, + } + }) + return test +} + /** * Utility - convert a key/value map to an array of custom 'context' bindings * @param {object} valueMap Key/value pairings diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index 6859e4f92b..f115ab89ce 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -20,7 +20,7 @@ export let allowHelpers = true export let updateOnChange = true export let drawerLeft - $: console.log(bindings) + const dispatch = createEventDispatcher() let bindingDrawer let valid = true diff --git a/packages/builder/src/components/integration/RestQueryViewer.svelte b/packages/builder/src/components/integration/RestQueryViewer.svelte index 2c381efa47..d67e4c939b 100644 --- a/packages/builder/src/components/integration/RestQueryViewer.svelte +++ b/packages/builder/src/components/integration/RestQueryViewer.svelte @@ -1,6 +1,7 @@
@@ -128,7 +139,7 @@
showModal(configKey)} variables={$environment.variables} on:change bind:value={config[configKey]} diff --git a/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte b/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte index 44fdbd0182..70029eb3c5 100644 --- a/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte +++ b/packages/builder/src/components/portal/environment/CreateEditVariableModal.svelte @@ -32,15 +32,23 @@ notifications.error(err.message) } } + + const saveVariable = () => { + try { + save({ + name, + production: productionValue, + development: developmentValue, + }) + notifications.success("Environment variable saved") + } catch (err) { + notifications.error("Error saving environment variable") + } + } - save({ - name, - production: productionValue, - development: developmentValue, - })} + onConfirm={() => saveVariable()} title={!row ? "Add new environment variable" : "Edit environment variable"} > From 843649eb5416ea3e3da27fa1ac5cb80a797b814d Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 26 Jan 2023 14:59:29 +0000 Subject: [PATCH 33/55] add envrionment bindings to automations --- .../builder/src/builderStore/dataBinding.js | 3 +-- .../SetupPanel/AutomationBlockSetup.svelte | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 3f284f75c4..701d6b99ed 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -92,7 +92,7 @@ export const getAuthBindings = () => { export const getEnvironmentBindings = () => { let envVars = get(environment).variables - let test = envVars.map(variable => { + return envVars.map(variable => { return { type: "context", runtimeBinding: `env.${makePropSafe(variable.name)}`, @@ -102,7 +102,6 @@ export const getEnvironmentBindings = () => { display: { type: "string", name: variable.name }, } }) - return test } /** diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index a73db5648b..6230ea1c41 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -18,6 +18,7 @@ import { automationStore } from "builderStore" import { tables } from "stores/backend" + import { environment } from "stores/portal" import WebhookDisplay from "../Shared/WebhookDisplay.svelte" import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte" import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte" @@ -33,6 +34,7 @@ import { Utils } from "@budibase/frontend-core" import { TriggerStepID, ActionStepID } from "constants/backend/automations" import { cloneDeep } from "lodash/fp" + import { onMount } from "svelte" export let block export let testData @@ -166,6 +168,23 @@ ) } + // Environment bindings + bindings = bindings.concat( + $environment.variables.map(variable => { + return { + label: `env.${variable.name}`, + path: `env.${variable.name}`, + type: "test", + icon: "Key", + category: "Environment", + display: { + type: "string", + name: variable.name, + }, + } + }) + ) + return bindings } @@ -196,6 +215,10 @@ onChange({ detail: tempFilters }, defKey) drawer.hide() } + + onMount(async () => { + await environment.loadVariables() + })
From debef20af516b30e4ea6670044d9230ccf38d041 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 26 Jan 2023 15:09:20 +0000 Subject: [PATCH 34/55] gate env vars in binding drawers behind license --- .../builder/src/builderStore/dataBinding.js | 9 +++-- .../SetupPanel/AutomationBlockSetup.svelte | 33 ++++++++++--------- .../bindings/DrawerBindableInput.svelte | 1 - .../builder/src/stores/portal/licensing.js | 1 - 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 701d6b99ed..b7b479bf2d 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -21,7 +21,7 @@ import { import { TableNames } from "../constants" import { JSONUtils } from "@budibase/frontend-core" import ActionDefinitions from "components/design/settings/controls/ButtonActionEditor/manifest.json" -import { environment } from "stores/portal" +import { environment, licensing } from "stores/portal" // Regex to match all instances of template strings const CAPTURE_VAR_INSIDE_TEMPLATE = /{{([^}]+)}}/g @@ -54,8 +54,13 @@ export const getBindableProperties = (asset, componentId) => { * Gets all rest bindable data fields */ export const getRestBindings = () => { + const hasEnvironmentVariablesEnabled = get(licensing).hasEnvironmentVariables const userBindings = getUserBindings() - return [...userBindings, ...getAuthBindings(), ...getEnvironmentBindings()] + return [ + ...userBindings, + ...getAuthBindings(), + ...(hasEnvironmentVariablesEnabled ? getEnvironmentBindings() : []), + ] } /** diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 6230ea1c41..c2ad6324f7 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -18,7 +18,7 @@ import { automationStore } from "builderStore" import { tables } from "stores/backend" - import { environment } from "stores/portal" + import { environment, licensing } from "stores/portal" import WebhookDisplay from "../Shared/WebhookDisplay.svelte" import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte" import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte" @@ -169,21 +169,22 @@ } // Environment bindings - bindings = bindings.concat( - $environment.variables.map(variable => { - return { - label: `env.${variable.name}`, - path: `env.${variable.name}`, - type: "test", - icon: "Key", - category: "Environment", - display: { - type: "string", - name: variable.name, - }, - } - }) - ) + if ($licensing.environmentVariablesEnabled) { + bindings = bindings.concat( + $environment.variables.map(variable => { + return { + label: `env.${variable.name}`, + path: `env.${variable.name}`, + icon: "Key", + category: "Environment", + display: { + type: "string", + name: variable.name, + }, + } + }) + ) + } return bindings } diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index f115ab89ce..cc64e28835 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -28,7 +28,6 @@ $: readableValue = runtimeToReadableBinding(bindings, value) $: tempValue = readableValue - $: console.log(tempValue) $: isJS = isJSBinding(value) const saveBinding = () => { diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js index ff302bfebd..96164ef2dc 100644 --- a/packages/builder/src/stores/portal/licensing.js +++ b/packages/builder/src/stores/portal/licensing.js @@ -64,7 +64,6 @@ export const createLicensingStore = () => { Constants.Features.ENVIRONMENT_VARIABLES ) - environmentVariablesEnabled = true store.update(state => { return { ...state, From 9175cab4cad3b958e25e1f420bea41050ca6da65 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 26 Jan 2023 15:34:03 +0000 Subject: [PATCH 35/55] add environmentVariables feature to constants --- packages/frontend-core/src/constants.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/frontend-core/src/constants.js b/packages/frontend-core/src/constants.js index f2e48b6fef..3a16013df2 100644 --- a/packages/frontend-core/src/constants.js +++ b/packages/frontend-core/src/constants.js @@ -114,6 +114,7 @@ export const ApiVersion = "1" export const Features = { USER_GROUPS: "userGroups", BACKUPS: "appBackups", + ENVIRONMENT_VARIABLES: "environmentVariables", } // Role IDs From c68b5ccb845cd525adc6e3441e818f987684d440 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 26 Jan 2023 16:16:56 +0000 Subject: [PATCH 36/55] fix license check --- packages/builder/src/builderStore/dataBinding.js | 4 ++-- packages/builder/src/stores/portal/licensing.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index b7b479bf2d..122cb0d519 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -54,12 +54,12 @@ export const getBindableProperties = (asset, componentId) => { * Gets all rest bindable data fields */ export const getRestBindings = () => { - const hasEnvironmentVariablesEnabled = get(licensing).hasEnvironmentVariables + const environmentVariablesEnabled = get(licensing).environmentVariablesEnabled const userBindings = getUserBindings() return [ ...userBindings, ...getAuthBindings(), - ...(hasEnvironmentVariablesEnabled ? getEnvironmentBindings() : []), + ...(environmentVariablesEnabled ? getEnvironmentBindings() : []), ] } diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js index 96164ef2dc..6f5c80e03c 100644 --- a/packages/builder/src/stores/portal/licensing.js +++ b/packages/builder/src/stores/portal/licensing.js @@ -60,7 +60,7 @@ export const createLicensingStore = () => { const backupsEnabled = license.features.includes( Constants.Features.BACKUPS ) - let environmentVariablesEnabled = license.features.includes( + const environmentVariablesEnabled = license.features.includes( Constants.Features.ENVIRONMENT_VARIABLES ) From 8372b50de1b842d08f73c9aed5d779a9014d88eb Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 27 Jan 2023 11:48:02 +0000 Subject: [PATCH 37/55] update env dropdown input to remove tags --- .../bbui/src/Form/Core/EnvDropdown.svelte | 62 ++++++++++--------- .../IntegrationConfigForm.svelte | 3 - .../common/bindings/BindingPanel.svelte | 1 - 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index c7a500372f..43240684c1 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -3,8 +3,6 @@ import { createEventDispatcher, onMount } from "svelte" import clickOutside from "../../Actions/click_outside" import Divider from "../../Divider/Divider.svelte" - import Tag from "../../Tags/Tag.svelte" - import Tags from "../../Tags/Tags.svelte" export let value = null export let placeholder = null @@ -31,7 +29,7 @@ const STRIP_NAME_REGEX = /(?<=\.)(.*?)(?=\ })/g // Strips the name out of the value which is {{ env.Variable }} resulting in an array like ["Variable"] - $: tags = String(value)?.match(STRIP_NAME_REGEX) || [] + $: hbsValue = String(value)?.match(STRIP_NAME_REGEX) || [] const updateValue = newValue => { if (readonly) { @@ -87,42 +85,46 @@ focus = autofocus if (focus) field.focus() }) + + function removeVariable() { + updateValue("") + } + + function openPopover() { + open = true + focus = true + iconFocused = true + }
-
+
- -
-
- {#each tags as tag} - updateValue("")}> - {tag} - - {/each} -
-
-
@@ -220,7 +222,7 @@ .icon-position { position: absolute; - top: 20%; + top: 25%; right: 2%; } @@ -275,9 +277,11 @@ background: var(--grey-1); } - .tags { - position: absolute; - bottom: 12%; - left: 1px; + .close-color { + color: var(--spectrum-global-color-gray-900) !important; + } + + .close-color:hover { + color: var(--spectrum-global-color-blue-400) !important; } diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte index 45dc75a1fe..47cf2957d1 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte @@ -87,7 +87,6 @@ function showModal(configKey) { selectedKey = configKey - console.log(selectedKey) createVariableModal.show() } @@ -103,8 +102,6 @@ await licensing.init() } }) - - $: console.log(config) diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index ae4cf60d4c..d995bd507b 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -122,7 +122,6 @@ // Adds a data binding to the expression const addBinding = (binding, { forceJS } = {}) => { - console.log(binding) if (usingJS || forceJS) { let js = decodeJSBinding(jsValue) js = addJSBinding(js, getCaretPosition(), binding.readableBinding) From 7ccce5c042e4157aacf5921178fe3c3f68de4476 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 27 Jan 2023 11:49:44 +0000 Subject: [PATCH 38/55] fix warnings --- packages/bbui/src/Form/Core/EnvDropdown.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index 43240684c1..61aa50e756 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -122,7 +122,7 @@ bind:this={field} disabled={false} {readonly} - id={"thisOne"} + {id} data-cy={dataCy} value={hbsValue.length ? `{{ ${hbsValue[0]} }}` : value} placeholder={placeholder || ""} @@ -135,7 +135,7 @@ on:focus={onFocus} on:input={onInput} {type} - style="color: white !important;" + style={align ? `text-align: ${align};` : ""} class="spectrum-Textfield-input" inputmode={type === "number" ? "decimal" : "text"} /> From d031a9157e1c341f4661dd375b6120d88c844695 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 27 Jan 2023 12:04:32 +0000 Subject: [PATCH 39/55] fix max-height in dropdown --- packages/bbui/src/Form/Core/EnvDropdown.svelte | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index 61aa50e756..0867e7ed2d 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -145,12 +145,7 @@ use:clickOutside={handleOutsideClick} class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open" > -
    +
      {#if !environmentVariablesEnabled}
      Upgrade your plan to get environment variables From 4ed239e5fd7800ef1ea2d5c81bc88b7dd8b0d233 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 27 Jan 2023 12:06:34 +0000 Subject: [PATCH 40/55] fix input not disabling properly --- packages/bbui/src/Form/Core/EnvDropdown.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index 0867e7ed2d..f51704248b 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -101,7 +101,7 @@
      Date: Fri, 27 Jan 2023 13:37:36 +0000 Subject: [PATCH 41/55] Fixing issue with apps not being created correctly due to the recent update to context. --- .../server/src/api/controllers/application.ts | 225 +++++++++--------- 1 file changed, 116 insertions(+), 109 deletions(-) diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index 68765cdbf4..33f5a53894 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -112,46 +112,45 @@ function checkAppName( } } -async function createInstance(template: any, includeSampleData: boolean) { - const tenantId = tenancy.isMultiTenant() ? tenancy.getTenantId() : null - const baseAppId = generateAppID(tenantId) - const appId = generateDevAppID(baseAppId) - return await context.doInAppContext(appId, async () => { - const db = context.getAppDB() - await db.put({ - _id: "_design/database", - // view collation information, read before writing any complex views: - // https://docs.couchdb.org/en/master/ddocs/views/collation.html#collation-specification - views: {}, - }) - - // NOTE: indexes need to be created before any tables/templates - // add view for linked rows - await createLinkView() - await createRoutingView() - await createAllSearchIndex() - - // replicate the template data to the instance DB - // this is currently very hard to test, downloading and importing template files - if (template && template.templateString) { - const { ok } = await db.load(stringToReadStream(template.templateString)) - if (!ok) { - throw "Error loading database dump from memory." - } - } else if (template && template.useTemplate === "true") { - await sdk.backups.importApp(appId, db, template) - } else { - // create the users table - await db.put(USERS_TABLE_SCHEMA) - - if (includeSampleData) { - // create ootb stock db - await addDefaultTables(db) - } - } - - return { _id: appId } +async function createInstance( + appId: string, + template: any, + includeSampleData: boolean +) { + const db = context.getAppDB() + await db.put({ + _id: "_design/database", + // view collation information, read before writing any complex views: + // https://docs.couchdb.org/en/master/ddocs/views/collation.html#collation-specification + views: {}, }) + + // NOTE: indexes need to be created before any tables/templates + // add view for linked rows + await createLinkView() + await createRoutingView() + await createAllSearchIndex() + + // replicate the template data to the instance DB + // this is currently very hard to test, downloading and importing template files + if (template && template.templateString) { + const { ok } = await db.load(stringToReadStream(template.templateString)) + if (!ok) { + throw "Error loading database dump from memory." + } + } else if (template && template.useTemplate === "true") { + await sdk.backups.importApp(appId, db, template) + } else { + // create the users table + await db.put(USERS_TABLE_SCHEMA) + + if (includeSampleData) { + // create ootb stock db + await addDefaultTables(db) + } + } + + return { _id: appId } } async function addDefaultTables(db: Database) { @@ -250,82 +249,90 @@ async function performAppCreate(ctx: BBContext) { instanceConfig.file = ctx.request.files.templateFile } const includeSampleData = isQsTrue(ctx.request.body.sampleData) - const instance = await createInstance(instanceConfig, includeSampleData) - const appId = instance._id - const db = context.getAppDB() + const tenantId = tenancy.isMultiTenant() ? tenancy.getTenantId() : null + const appId = generateDevAppID(generateAppID(tenantId)) - let newApplication: App = { - _id: DocumentType.APP_METADATA, - _rev: undefined, - appId, - type: "app", - version: packageJson.version, - componentLibraries: ["@budibase/standard-components"], - name: name, - url: url, - template: templateKey, - instance, - tenantId: tenancy.getTenantId(), - updatedAt: new Date().toISOString(), - createdAt: new Date().toISOString(), - status: AppStatus.DEV, - navigation: { - navigation: "Top", - title: name, - navWidth: "Large", - navBackground: "var(--spectrum-global-color-gray-100)", - links: [ - { - url: "/home", - text: "Home", - }, - ], - }, - theme: "spectrum--light", - customTheme: { - buttonBorderRadius: "16px", - }, - } + return await context.doInAppContext(appId, async () => { + const instance = await createInstance( + appId, + instanceConfig, + includeSampleData + ) + const db = context.getAppDB() - // If we used a template or imported an app there will be an existing doc. - // Fetch and migrate some metadata from the existing app. - try { - const existing: App = await db.get(DocumentType.APP_METADATA) - const keys: (keyof App)[] = [ - "_rev", - "navigation", - "theme", - "customTheme", - "icon", - ] - keys.forEach(key => { - if (existing[key]) { - // @ts-ignore - newApplication[key] = existing[key] - } - }) - - // Migrate navigation settings and screens if required - if (existing) { - const navigation = await migrateAppNavigation() - if (navigation) { - newApplication.navigation = navigation - } + let newApplication: App = { + _id: DocumentType.APP_METADATA, + _rev: undefined, + appId, + type: "app", + version: packageJson.version, + componentLibraries: ["@budibase/standard-components"], + name: name, + url: url, + template: templateKey, + instance, + tenantId: tenancy.getTenantId(), + updatedAt: new Date().toISOString(), + createdAt: new Date().toISOString(), + status: AppStatus.DEV, + navigation: { + navigation: "Top", + title: name, + navWidth: "Large", + navBackground: "var(--spectrum-global-color-gray-100)", + links: [ + { + url: "/home", + text: "Home", + }, + ], + }, + theme: "spectrum--light", + customTheme: { + buttonBorderRadius: "16px", + }, } - } catch (err) { - // Nothing to do - } - const response = await db.put(newApplication, { force: true }) - newApplication._rev = response.rev + // If we used a template or imported an app there will be an existing doc. + // Fetch and migrate some metadata from the existing app. + try { + const existing: App = await db.get(DocumentType.APP_METADATA) + const keys: (keyof App)[] = [ + "_rev", + "navigation", + "theme", + "customTheme", + "icon", + ] + keys.forEach(key => { + if (existing[key]) { + // @ts-ignore + newApplication[key] = existing[key] + } + }) - /* istanbul ignore next */ - if (!env.isTest()) { - await createApp(appId) - } + // Migrate navigation settings and screens if required + if (existing) { + const navigation = await migrateAppNavigation() + if (navigation) { + newApplication.navigation = navigation + } + } + } catch (err) { + // Nothing to do + } - await cache.app.invalidateAppMetadata(appId, newApplication) - return newApplication + const response = await db.put(newApplication, { force: true }) + newApplication._rev = response.rev + + /* istanbul ignore next */ + if (!env.isTest()) { + await createApp(appId) + } + + await cache.app.invalidateAppMetadata(appId, newApplication) + return newApplication + }) } async function creationEvents(request: any, app: App) { From d667276fa1b49565709e035b28f52d551973e065 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 27 Jan 2023 15:15:07 +0000 Subject: [PATCH 42/55] Adding a onlyFound option to our handlebars system so that we can enrich only the parts we have and leave other components for further enrichment. --- .../src/sdk/app/datasources/datasources.ts | 5 ++++- .../string-templates/src/helpers/index.js | 6 +++++- packages/string-templates/src/index.js | 21 ++++++++++++++++--- packages/string-templates/test/basic.spec.js | 6 ++++++ 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts index ed18e43928..8ad08ce980 100644 --- a/packages/server/src/sdk/app/datasources/datasources.ts +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -11,6 +11,7 @@ import { getEnvironmentVariables } from "../../utils" import { getDefinitions } from "../../../integrations" const ENV_VAR_PREFIX = "env." +const USER_PREFIX = "user" async function enrichDatasourceWithValues(datasource: Datasource) { const cloned = cloneDeep(datasource) @@ -48,7 +49,9 @@ export async function getWithEnvVars(datasourceId: string) { export function isValid(datasource: Datasource) { const blocks = findHBSBlocks(JSON.stringify(datasource)) - const validList = blocks.filter(block => block.includes(ENV_VAR_PREFIX)) + const validList = blocks.filter( + block => block.includes(ENV_VAR_PREFIX) || block.includes(USER_PREFIX) + ) return blocks.length === validList.length } diff --git a/packages/string-templates/src/helpers/index.js b/packages/string-templates/src/helpers/index.js index f04fa58399..bed3d0c3e3 100644 --- a/packages/string-templates/src/helpers/index.js +++ b/packages/string-templates/src/helpers/index.js @@ -32,11 +32,15 @@ const HELPERS = [ // javascript helper new Helper(HelperFunctionNames.JS, processJS, false), // this help is applied to all statements - new Helper(HelperFunctionNames.ALL, (value, { __opts }) => { + new Helper(HelperFunctionNames.ALL, (value, inputs) => { + const { __opts } = inputs if (isObject(value)) { return new SafeString(JSON.stringify(value)) } // null/undefined values produce bad results + if (__opts && __opts.onlyFound && value == null) { + return __opts.input + } if (value == null || typeof value !== "string") { return value == null ? "" : value } diff --git a/packages/string-templates/src/index.js b/packages/string-templates/src/index.js index ab7afc1dcc..26f44369b0 100644 --- a/packages/string-templates/src/index.js +++ b/packages/string-templates/src/index.js @@ -146,16 +146,31 @@ module.exports.processStringSync = (string, context, opts) => { if (typeof string !== "string") { throw "Cannot process non-string types." } - try { - const template = createTemplate(string, opts) + function process(stringPart) { + const template = createTemplate(stringPart, opts) const now = Math.floor(Date.now() / 1000) * 1000 return processors.postprocess( template({ now: new Date(now).toISOString(), - __opts: opts, + __opts: { + ...opts, + input: stringPart, + }, ...context, }) ) + } + try { + if (opts && opts.onlyFound) { + const blocks = exports.findHBSBlocks(string) + for (let block of blocks) { + const outcome = process(block) + string = string.replace(block, outcome) + } + return string + } else { + return process(string) + } } catch (err) { return input } diff --git a/packages/string-templates/test/basic.spec.js b/packages/string-templates/test/basic.spec.js index 8dd1aeb394..3346a81ddd 100644 --- a/packages/string-templates/test/basic.spec.js +++ b/packages/string-templates/test/basic.spec.js @@ -221,3 +221,9 @@ describe("check find hbs blocks function", () => { }) }) +describe("should leave HBS blocks if not found using option", () => { + it("should replace one, leave one", async () => { + const output = await processString("{{ a }}, {{ b }}", { b: 1 }, { onlyFound: true }) + expect(output).toBe("{{ a }}, 1") + }) +}) From 3a40a64d155894ee725743e1293b2fea13ce8076 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 27 Jan 2023 15:21:04 +0000 Subject: [PATCH 43/55] Updating datasources to use new onlyFound option. --- packages/server/src/sdk/app/datasources/datasources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/sdk/app/datasources/datasources.ts b/packages/server/src/sdk/app/datasources/datasources.ts index 8ad08ce980..df06f12739 100644 --- a/packages/server/src/sdk/app/datasources/datasources.ts +++ b/packages/server/src/sdk/app/datasources/datasources.ts @@ -16,7 +16,7 @@ const USER_PREFIX = "user" async function enrichDatasourceWithValues(datasource: Datasource) { const cloned = cloneDeep(datasource) const env = await getEnvironmentVariables() - const processed = processObjectSync(cloned, { env }) + const processed = processObjectSync(cloned, { env }, { onlyFound: true }) return { datasource: processed as Datasource, envVars: env as Record, From 92a2f23cde4b7230157561becd38a97cd6e8b1ab Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Fri, 27 Jan 2023 15:23:24 +0000 Subject: [PATCH 44/55] add divider on upgrade page --- .../portal/settings/environment/index.svelte | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte index fbe5a675c9..024c78df4c 100644 --- a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte @@ -56,7 +56,7 @@ Environment Variables {#if !$licensing.environmentVariablesEnabled} - Pro plan + Business plan {/if}
      @@ -64,6 +64,8 @@ >Add and manage environment variables for development and production + + {#if $licensing.environmentVariablesEnabled} {#if noEncryptionKey} {/if} - +
      + +
      +
-
- -
{:else}