From a908125ea3716e17795e3d4a2f1e6ff771d36399 Mon Sep 17 00:00:00 2001 From: Jonny McCullagh Date: Mon, 20 Feb 2023 19:56:04 +0000 Subject: [PATCH 01/88] add metrics endpoint to api --- .../src/api/controllers/public/metrics.ts | 122 ++++++++++++++++++ .../server/src/api/routes/public/index.ts | 2 + .../server/src/api/routes/public/metrics.ts | 28 ++++ 3 files changed, 152 insertions(+) create mode 100644 packages/server/src/api/controllers/public/metrics.ts create mode 100644 packages/server/src/api/routes/public/metrics.ts diff --git a/packages/server/src/api/controllers/public/metrics.ts b/packages/server/src/api/controllers/public/metrics.ts new file mode 100644 index 0000000000..264df7f415 --- /dev/null +++ b/packages/server/src/api/controllers/public/metrics.ts @@ -0,0 +1,122 @@ +import { App, BBContext } from "@budibase/types" +import { db as dbCore, context } from "@budibase/backend-core" +import os from "os" + +export async function fetch(ctx: BBContext) { + const allDatabases = await dbCore.getAllDbs() + const devAppIDs = await dbCore.getDevAppIDs({ idsOnly: true }) + const prodAppIDs = await dbCore.getProdAppIDs({ idsOnly: true }) + const allAppIds = await dbCore.getAllApps({ idsOnly: true }) + + var outputString = "" + + const freeMem = os.freemem() + const totalMem = os.totalmem() + const usedMem = totalMem - freeMem + const uptime = os.uptime() + + // **** budibase_os_uptime **** + outputString += convertToOpenMetrics( + "budibase_os_uptime", + "Time in seconds that the host operating system has been up", + "counter", + uptime + ) + + // **** budibase_os_free_mem **** + outputString += convertToOpenMetrics( + "budibase_os_free_mem", + "Bytes of memory free for usage on the host operating system", + "gauge", + freeMem + ) + + // **** budibase_os_total_mem **** + outputString += convertToOpenMetrics( + "budibase_os_total_mem", + "Total bytes of memory on the host operating system", + "gauge", + totalMem + ) + + // **** budibase_os_used_mem **** + outputString += convertToOpenMetrics( + "budibase_os_used_mem", + "Total bytes of memory in use on the host operating system", + "gauge", + usedMem + ) + + // **** budibase_os_load1 **** + outputString += convertToOpenMetrics( + "budibase_os_load1", + "Host operating system load average", + "gauge", + os.loadavg()[0] + ) + + // **** budibase_os_load5 **** + outputString += convertToOpenMetrics( + "budibase_os_load5", + "Host operating system load average", + "gauge", + os.loadavg()[1] + ) + // **** budibase_os_load15 **** + outputString += convertToOpenMetrics( + "budibase_os_load15", + "Host operating system load average", + "gauge", + os.loadavg()[2] + ) + + // **** budibase_tenant_app_count **** + outputString += convertToOpenMetrics( + "budibase_tenant_app_count", + "The number of apps created by a user", + "gauge", + allAppIds.length + ) + + // **** budibase_tenant_production_app_count **** + outputString += convertToOpenMetrics( + "budibase_tenant_production_app_count", + "The number of apps a user has published", + "gauge", + prodAppIDs.length + ) + + // **** budibase_tenant_dev_app_count **** + outputString += convertToOpenMetrics( + "budibase_tenant_dev_app_count", + "The number of apps a user has unpublished in development", + "gauge", + devAppIDs.length + ) + + // **** budibase_tenant_db_count **** + outputString += convertToOpenMetrics( + "budibase_tenant_db_count", + "The number of couchdb databases including global tables such as _users", + "gauge", + allDatabases.length + ) + + ctx.body = outputString +} + +export function convertToOpenMetrics( + metricName: string, + metricHelp: string, + metricType: string, + metricValue: number +) { + return ` + # HELP ${metricName} ${metricHelp}. + # TYPE ${metricName} ${metricType} + ${metricName} ${metricValue}` +} + +export default { + fetch, +} diff --git a/packages/server/src/api/routes/public/index.ts b/packages/server/src/api/routes/public/index.ts index 79e7731752..e67c10fe02 100644 --- a/packages/server/src/api/routes/public/index.ts +++ b/packages/server/src/api/routes/public/index.ts @@ -1,4 +1,5 @@ import appEndpoints from "./applications" +import metricEndpoints from "./metrics" import queryEndpoints from "./queries" import tableEndpoints from "./tables" import rowEndpoints from "./rows" @@ -120,6 +121,7 @@ function applyRoutes( } applyRoutes(appEndpoints, PermissionType.APP, "appId") +applyRoutes(metricEndpoints, PermissionType.APP, "appId") applyRoutes(tableEndpoints, PermissionType.TABLE, "tableId") applyRoutes(userEndpoints, PermissionType.USER, "userId") applyRoutes(queryEndpoints, PermissionType.QUERY, "queryId") diff --git a/packages/server/src/api/routes/public/metrics.ts b/packages/server/src/api/routes/public/metrics.ts new file mode 100644 index 0000000000..67cae14388 --- /dev/null +++ b/packages/server/src/api/routes/public/metrics.ts @@ -0,0 +1,28 @@ +import controller from "../../controllers/public/metrics" +import Endpoint from "./utils/Endpoint" + +const read = [] + +/** + * @openapi + * /metrics: + * get: + * operationId: getById + * summary: Retrieve Budibase tenant metrics + * description: Output metrics in openMetrics format compatible with Prometheus + * tags: + * - metrics + * responses: + * 200: + * description: Returns tenant metrics. + * content: + * text/plain: + * schema: + * $ref: '#/components/schemas/tableOutput' + * examples: + * table: + * $ref: '#/components/examples/table' + */ +read.push(new Endpoint("get", "/metrics", controller.fetch)) + +export default { read } From dde1237ed220e47202d7a29f5b92b8c7c15b4698 Mon Sep 17 00:00:00 2001 From: Jonny McCullagh Date: Wed, 22 Feb 2023 21:10:35 +0000 Subject: [PATCH 02/88] allUsers function & more metrics --- packages/backend-core/src/users.ts | 12 ++ .../src/api/controllers/public/metrics.ts | 147 ++++++++++++++++-- .../server/src/api/routes/public/metrics.ts | 7 +- 3 files changed, 150 insertions(+), 16 deletions(-) diff --git a/packages/backend-core/src/users.ts b/packages/backend-core/src/users.ts index 1720a79a83..7502ece47a 100644 --- a/packages/backend-core/src/users.ts +++ b/packages/backend-core/src/users.ts @@ -5,6 +5,8 @@ import { generateAppUserID, queryGlobalView, UNICODE_MAX, + DocumentType, + SEPARATOR, } from "./db" import { BulkDocsResponse, User } from "@budibase/types" import { getGlobalDB } from "./context" @@ -19,6 +21,16 @@ export const bulkGetGlobalUsersById = async (userIds: string[]) => { ).rows.map(row => row.doc) as User[] } +export const getAllUserIds = async () => { + const db = getGlobalDB() + const startKey = `${DocumentType.USER}${SEPARATOR}` + const response = await db.allDocs({ + startkey: startKey, + endkey: `${startKey}${UNICODE_MAX}`, + }) + return response.rows.map(row => row.id) +} + export const bulkUpdateGlobalUsers = async (users: User[]) => { const db = getGlobalDB() return (await db.bulkDocs(users)) as BulkDocsResponse diff --git a/packages/server/src/api/controllers/public/metrics.ts b/packages/server/src/api/controllers/public/metrics.ts index 264df7f415..65f8849f7f 100644 --- a/packages/server/src/api/controllers/public/metrics.ts +++ b/packages/server/src/api/controllers/public/metrics.ts @@ -1,19 +1,43 @@ import { App, BBContext } from "@budibase/types" -import { db as dbCore, context } from "@budibase/backend-core" +import { users as userCore, db as dbCore } from "@budibase/backend-core" +import { quotas, licensing } from "@budibase/pro" + import os from "os" export async function fetch(ctx: BBContext) { + // *** OPERATING SYSTEM *** + const freeMem = os.freemem() + const totalMem = os.totalmem() + const usedMem = totalMem - freeMem + const uptime = os.uptime() + + // *** APPS *** const allDatabases = await dbCore.getAllDbs() const devAppIDs = await dbCore.getDevAppIDs({ idsOnly: true }) const prodAppIDs = await dbCore.getProdAppIDs({ idsOnly: true }) const allAppIds = await dbCore.getAllApps({ idsOnly: true }) - var outputString = "" + // *** USERS *** + const usersObject = await userCore.getAllUserIds() - const freeMem = os.freemem() - const totalMem = os.totalmem() - const usedMem = totalMem - freeMem - const uptime = os.uptime() + // *** QUOTAS *** + const usage = await quotas.getQuotaUsage() + const license = await licensing.cache.getCachedLicense() + const appsQuotaUsage = usage.usageQuota.apps + const rowsQuotaUsage = usage.usageQuota.rows + const pluginsQuotaUsage = usage.usageQuota.plugins + const userGroupsQuotaUsage = usage.usageQuota.userGroups + const queryQuotaUsage = usage.monthly.current.queries + const automationsQuotaUsage = usage.monthly.current.automations + const appsQuotaLimit = license.quotas.usage.static.apps.value + const rowsQuotaLimit = license.quotas.usage.static.rows.value + const userGroupsQuotaLimit = license.quotas.usage.static.userGroups.value + const pluginsQuotaLimit = license.quotas.usage.static.plugins.value + const queryQuotaLimit = license.quotas.usage.monthly.queries.value + const automationsQuotaLimit = license.quotas.usage.monthly.automations.value + + // *** BUILD THE OUTPUT STRING *** + var outputString = "" // **** budibase_os_uptime **** outputString += convertToOpenMetrics( @@ -70,6 +94,14 @@ export async function fetch(ctx: BBContext) { os.loadavg()[2] ) + // **** budibase_tenant_user_count **** + outputString += convertToOpenMetrics( + "budibase_tenant_user_count", + "The number of users created", + "gauge", + usersObject.length + ) + // **** budibase_tenant_app_count **** outputString += convertToOpenMetrics( "budibase_tenant_app_count", @@ -102,6 +134,102 @@ export async function fetch(ctx: BBContext) { allDatabases.length ) + // **** budibase_quota_usage_apps **** + outputString += convertToOpenMetrics( + "budibase_quota_usage_apps", + "The number of apps created", + "gauge", + appsQuotaUsage + ) + + // **** budibase_quota_limit_apps **** + outputString += convertToOpenMetrics( + "budibase_quota_limit_apps", + "The limit on the number of apps that can be created", + "gauge", + appsQuotaLimit == -1 ? 3000000 : appsQuotaLimit + ) + + // **** budibase_quota_usage_rows **** + outputString += convertToOpenMetrics( + "budibase_quota_usage_rows", + "The number of database rows used from the quota", + "gauge", + rowsQuotaUsage + ) + + // **** budibase_quota_limit_rows **** + outputString += convertToOpenMetrics( + "budibase_quota_limit_rows", + "The limit on the number of rows that can be created", + "gauge", + rowsQuotaLimit == -1 ? 3000000 : rowsQuotaLimit + ) + + // **** budibase_quota_usage_plugins **** + outputString += convertToOpenMetrics( + "budibase_quota_usage_plugins", + "The number of plugins in use", + "gauge", + pluginsQuotaUsage + ) + + // **** budibase_quota_limit_plugins **** + outputString += convertToOpenMetrics( + "budibase_quota_limit_plugins", + "The limit on the number of plugins that can be created", + "gauge", + pluginsQuotaLimit == -1 ? 3000000 : pluginsQuotaLimit + ) + + // **** budibase_quota_usage_user_groups **** + outputString += convertToOpenMetrics( + "budibase_quota_usage_user_groups", + "The number of user groups created", + "gauge", + userGroupsQuotaUsage + ) + + // **** budibase_quota_limit_user_groups **** + outputString += convertToOpenMetrics( + "budibase_quota_limit_user_groups", + "The limit on the number of user groups that can be created", + "gauge", + userGroupsQuotaLimit == -1 ? 3000000 : userGroupsQuotaLimit + ) + + // **** budibase_quota_usage_queries **** + outputString += convertToOpenMetrics( + "budibase_quota_usage_queries", + "The number of queries used in the current month", + "gauge", + queryQuotaUsage + ) + + // **** budibase_quota_limit_queries **** + outputString += convertToOpenMetrics( + "budibase_quota_limit_queries", + "The limit on the number of queries for the current month", + "gauge", + queryQuotaLimit == -1 ? 3000000 : queryQuotaLimit + ) + + // **** budibase_quota_usage_automations **** + outputString += convertToOpenMetrics( + "budibase_quota_usage_automations", + "The number of automations used in the current month", + "gauge", + automationsQuotaUsage + ) + + // **** budibase_quota_limit_automations **** + outputString += convertToOpenMetrics( + "budibase_quota_limit_automations", + "The limit on the number of automations that can be created", + "gauge", + automationsQuotaLimit == -1 ? 3000000 : automationsQuotaLimit + ) + ctx.body = outputString } @@ -111,10 +239,9 @@ export function convertToOpenMetrics( metricType: string, metricValue: number ) { - return ` - # HELP ${metricName} ${metricHelp}. - # TYPE ${metricName} ${metricType} - ${metricName} ${metricValue}` + return `# HELP ${metricName} ${metricHelp}. +# TYPE ${metricName} ${metricType} +${metricName} ${metricValue}\n` } export default { diff --git a/packages/server/src/api/routes/public/metrics.ts b/packages/server/src/api/routes/public/metrics.ts index 67cae14388..35745e3b13 100644 --- a/packages/server/src/api/routes/public/metrics.ts +++ b/packages/server/src/api/routes/public/metrics.ts @@ -9,7 +9,7 @@ const read = [] * get: * operationId: getById * summary: Retrieve Budibase tenant metrics - * description: Output metrics in openMetrics format compatible with Prometheus + * description: Output metrics in OpenMetrics format compatible with Prometheus * tags: * - metrics * responses: @@ -17,11 +17,6 @@ const read = [] * description: Returns tenant metrics. * content: * text/plain: - * schema: - * $ref: '#/components/schemas/tableOutput' - * examples: - * table: - * $ref: '#/components/examples/table' */ read.push(new Endpoint("get", "/metrics", controller.fetch)) From 057abb5351b63fe78d44d8ddd43892fe7f95f70e Mon Sep 17 00:00:00 2001 From: Mateus Badan de Pieri Date: Mon, 27 Feb 2023 15:04:30 +0000 Subject: [PATCH 03/88] move component to bbui --- .../common/inputs => bbui/src/Input}/CopyInput.svelte | 0 .../src/components/automation/Shared/WebhookDisplay.svelte | 2 +- packages/builder/src/components/deploy/DeployModal.svelte | 2 +- packages/builder/src/components/settings/APIKeyModal.svelte | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename packages/{builder/src/components/common/inputs => bbui/src/Input}/CopyInput.svelte (100%) diff --git a/packages/builder/src/components/common/inputs/CopyInput.svelte b/packages/bbui/src/Input/CopyInput.svelte similarity index 100% rename from packages/builder/src/components/common/inputs/CopyInput.svelte rename to packages/bbui/src/Input/CopyInput.svelte diff --git a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte index 9ba4140b51..b0def87c90 100644 --- a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte +++ b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte @@ -1,5 +1,5 @@ + +
{ query = e.target.value.trim() }} diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index a4b4982fca..fe5edae1a4 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -120,89 +120,86 @@ }) -{#await promise} - -
-{:then _} - + - {#if $store.builderSidePanel} - - {/if} +{#if $store.builderSidePanel} + +{/if} -
-
-
- -
- -
- $goto("../../portal/apps")}> - Exit to portal - - $goto(`../../portal/overview/${application}`)} - > - Overview - - - $goto(`../../portal/overview/${application}/access`)} - > - Access - - - $goto(`../../portal/overview/${application}/automation-history`)} - > - Automation history - - - $goto(`../../portal/overview/${application}/backups`)} - > - Backups - +
+
+
+ +
+ +
+ $goto("../../portal/apps")}> + Exit to portal + + $goto(`../../portal/overview/${application}`)} + > + Overview + + $goto(`../../portal/overview/${application}/access`)} + > + Access + + + $goto(`../../portal/overview/${application}/automation-history`)} + > + Automation history + + $goto(`../../portal/overview/${application}/backups`)} + > + Backups + - - $goto(`../../portal/overview/${application}/name-and-url`)} - > - Name and URL - - - $goto(`../../portal/overview/${application}/version`)} - > - Version - -
- {$store.name || "App"} -
-
- - {#each $layout.children as { path, title }} - - - - {/each} - -
-
- -
+ + $goto(`../../portal/overview/${application}/name-and-url`)} + > + Name and URL + + $goto(`../../portal/overview/${application}/version`)} + > + Version + + + {$store.name} +
+
+ + {#each $layout.children as { path, title }} + + + + {/each} + +
+
+
-
-{:catch error} -

Something went wrong: {error.message}

-{/await} + {#await promise} + +
+ {:then _} + + {:catch error} +

Something went wrong: {error.message}

+ {/await} +
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsPanel.svelte index 096e47430c..1e889ffe93 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ComponentSettingsPanel.svelte @@ -10,6 +10,8 @@ getBindableProperties, getComponentBindableProperties, } from "builderStore/dataBinding" + import { ActionButton } from "@budibase/bbui" + import { capitalise } from "helpers" $: componentInstance = $selectedComponent $: componentDefinition = store.actions.components.getDefinition( @@ -25,32 +27,69 @@ ) $: isScreen = $selectedComponent?._id === $selectedScreen?.props._id $: title = isScreen ? "Screen" : $selectedComponent?._instanceName + + let section = "settings" + const tabs = ["settings", "styles", "conditions"] + + $: id = $selectedComponent?._id + $: id, (section = tabs[0]) {#if $selectedComponent} {#key $selectedComponent._id} - {#if componentDefinition?.info} - + +
+ {#each tabs as tab} + { + section = tab + }} + > + {capitalise(tab)} + + {/each} +
+
+ {#if section == "settings"} + {#if componentDefinition?.info} + + {/if} + + {/if} + {#if section == "styles"} + + + {/if} + {#if section == "conditions"} + {/if} - - - -
{/key} {/if} + + From 1c7c34718908e1592f1c007016487f0557e36c63 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 8 Mar 2023 14:47:29 +0000 Subject: [PATCH 40/88] v2.4.8-alpha.1 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index c5ed6dc80e..82be5bb8eb 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 807e686103..808236b713 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -24,7 +24,7 @@ "dependencies": { "@budibase/nano": "10.1.2", "@budibase/pouchdb-replication-stream": "1.2.10", - "@budibase/types": "2.4.8-alpha.0", + "@budibase/types": "2.4.8-alpha.1", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 509b95d844..b177df4ed0 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", - "@budibase/string-templates": "2.4.8-alpha.0", + "@budibase/string-templates": "2.4.8-alpha.1", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", diff --git a/packages/builder/package.json b/packages/builder/package.json index 112f094680..72193a2593 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "license": "GPL-3.0", "private": true, "scripts": { @@ -58,10 +58,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.4.8-alpha.0", - "@budibase/client": "2.4.8-alpha.0", - "@budibase/frontend-core": "2.4.8-alpha.0", - "@budibase/string-templates": "2.4.8-alpha.0", + "@budibase/bbui": "2.4.8-alpha.1", + "@budibase/client": "2.4.8-alpha.1", + "@budibase/frontend-core": "2.4.8-alpha.1", + "@budibase/string-templates": "2.4.8-alpha.1", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 2ee423194f..2d4825ff6d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "dist/index.js", "bin": { @@ -29,9 +29,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.4.8-alpha.0", - "@budibase/string-templates": "2.4.8-alpha.0", - "@budibase/types": "2.4.8-alpha.0", + "@budibase/backend-core": "2.4.8-alpha.1", + "@budibase/string-templates": "2.4.8-alpha.1", + "@budibase/types": "2.4.8-alpha.1", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 89860e46c8..7220320eab 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "2.4.8-alpha.0", - "@budibase/frontend-core": "2.4.8-alpha.0", - "@budibase/string-templates": "2.4.8-alpha.0", + "@budibase/bbui": "2.4.8-alpha.1", + "@budibase/frontend-core": "2.4.8-alpha.1", + "@budibase/string-templates": "2.4.8-alpha.1", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index c8cc75e231..e6014d6952 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.4.8-alpha.0", + "@budibase/bbui": "2.4.8-alpha.1", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 823f0059bc..92a040626e 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index b02a859be3..c244e0413a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.4.8-alpha.0", - "@budibase/client": "2.4.8-alpha.0", + "@budibase/backend-core": "2.4.8-alpha.1", + "@budibase/client": "2.4.8-alpha.1", "@budibase/pro": "2.4.8-alpha.0", - "@budibase/string-templates": "2.4.8-alpha.0", - "@budibase/types": "2.4.8-alpha.0", + "@budibase/string-templates": "2.4.8-alpha.1", + "@budibase/types": "2.4.8-alpha.1", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 362575e6d8..5564d33e19 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index b6efb63184..97f98f55cb 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index e5a151f501..5a81e54d0f 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.4.8-alpha.0", + "version": "2.4.8-alpha.1", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.4.8-alpha.0", + "@budibase/backend-core": "2.4.8-alpha.1", "@budibase/pro": "2.4.8-alpha.0", - "@budibase/string-templates": "2.4.8-alpha.0", - "@budibase/types": "2.4.8-alpha.0", + "@budibase/string-templates": "2.4.8-alpha.1", + "@budibase/types": "2.4.8-alpha.1", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 3328a9524ec3c3ef3bcb364527a6b988311bc295 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 8 Mar 2023 14:50:07 +0000 Subject: [PATCH 41/88] Update pro version to 2.4.8-alpha.1 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index c244e0413a..0198f3cdde 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "2.4.8-alpha.1", "@budibase/client": "2.4.8-alpha.1", - "@budibase/pro": "2.4.8-alpha.0", + "@budibase/pro": "2.4.8-alpha.1", "@budibase/string-templates": "2.4.8-alpha.1", "@budibase/types": "2.4.8-alpha.1", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 152f543144..57cc97a1db 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1278,14 +1278,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.4.8-alpha.0": - version "2.4.8-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.0.tgz#c5cfef3d6dad215d60d3ef89409d0e571c733b03" - integrity sha512-tqUtpaOIjuZIF2eRDghmT42LTOkC/bO1FPzF9s+LRZhuvrsHoKAfUXzDg156sBGzOMNaVDGWEj5XFLaofAn4YA== +"@budibase/backend-core@2.4.8-alpha.1": + version "2.4.8-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.1.tgz#7af207f5144e0cc005f9d050a773ad0d4741aa64" + integrity sha512-3kFYbGci48uFz1dix4cByBHSM+v3GIUtH/x144hGKWFZO6hCNEhuJ0ZHVUIHCAWsZK7DgHdwPP44jahWY8Z4rQ== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.4.8-alpha.0" + "@budibase/types" "2.4.8-alpha.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1417,14 +1417,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.4.8-alpha.0": - version "2.4.8-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.0.tgz#1b373066b9c174e777bc9b00d2738ba50b6f7e6d" - integrity sha512-lQnqUVURFBiRJ9LMWzqaVhJLJLchJ9o5iNjfNZIcdTOtd3v3KXFR8mhKPwV7XlTwTapIvZNY8P/Pr0Bfw6XMDw== +"@budibase/pro@2.4.8-alpha.1": + version "2.4.8-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.1.tgz#18b176ec7cce148e35d0b8c75355ca39e5340d8f" + integrity sha512-htKJCoulhNLSfi9TPxUmor3A69Df8y3pnLhz4R9z6LjFHHTSRk4ZqRQG053Ty1FOZNUuKhocpL4rpjpuYECfEQ== dependencies: - "@budibase/backend-core" "2.4.8-alpha.0" + "@budibase/backend-core" "2.4.8-alpha.1" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.4.8-alpha.0" + "@budibase/types" "2.4.8-alpha.1" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1463,10 +1463,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.4.8-alpha.0": - version "2.4.8-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.0.tgz#ef268b3c82658e3b66085c5c6d60b1759412e2bb" - integrity sha512-aMSFvhLBdMD2xQBNcBbLJuNBDj72xsqeWLRJrE96w2s63IPcx9oS56dgfFu1WSBGnY/6vrzdNWyYeOp/UzYrtg== +"@budibase/types@2.4.8-alpha.1": + version "2.4.8-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.1.tgz#160fb30cacb85b552d6aada82e1fc89b64ca5bba" + integrity sha512-T+0/AzWjj64iPigN3ytRangv7nAkJrf9bqRww21eZeFjS+PUHelx7Ijjd/FchcI+MJWq2YKfGXVS42F+Y2bLlg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 5a81e54d0f..753408ee3f 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "2.4.8-alpha.1", - "@budibase/pro": "2.4.8-alpha.0", + "@budibase/pro": "2.4.8-alpha.1", "@budibase/string-templates": "2.4.8-alpha.1", "@budibase/types": "2.4.8-alpha.1", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index c349878ea1..5062a380bf 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -475,14 +475,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.4.8-alpha.0": - version "2.4.8-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.0.tgz#c5cfef3d6dad215d60d3ef89409d0e571c733b03" - integrity sha512-tqUtpaOIjuZIF2eRDghmT42LTOkC/bO1FPzF9s+LRZhuvrsHoKAfUXzDg156sBGzOMNaVDGWEj5XFLaofAn4YA== +"@budibase/backend-core@2.4.8-alpha.1": + version "2.4.8-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.1.tgz#7af207f5144e0cc005f9d050a773ad0d4741aa64" + integrity sha512-3kFYbGci48uFz1dix4cByBHSM+v3GIUtH/x144hGKWFZO6hCNEhuJ0ZHVUIHCAWsZK7DgHdwPP44jahWY8Z4rQ== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.4.8-alpha.0" + "@budibase/types" "2.4.8-alpha.1" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -564,14 +564,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.4.8-alpha.0": - version "2.4.8-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.0.tgz#1b373066b9c174e777bc9b00d2738ba50b6f7e6d" - integrity sha512-lQnqUVURFBiRJ9LMWzqaVhJLJLchJ9o5iNjfNZIcdTOtd3v3KXFR8mhKPwV7XlTwTapIvZNY8P/Pr0Bfw6XMDw== +"@budibase/pro@2.4.8-alpha.1": + version "2.4.8-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.1.tgz#18b176ec7cce148e35d0b8c75355ca39e5340d8f" + integrity sha512-htKJCoulhNLSfi9TPxUmor3A69Df8y3pnLhz4R9z6LjFHHTSRk4ZqRQG053Ty1FOZNUuKhocpL4rpjpuYECfEQ== dependencies: - "@budibase/backend-core" "2.4.8-alpha.0" + "@budibase/backend-core" "2.4.8-alpha.1" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.4.8-alpha.0" + "@budibase/types" "2.4.8-alpha.1" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -592,10 +592,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.4.8-alpha.0": - version "2.4.8-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.0.tgz#ef268b3c82658e3b66085c5c6d60b1759412e2bb" - integrity sha512-aMSFvhLBdMD2xQBNcBbLJuNBDj72xsqeWLRJrE96w2s63IPcx9oS56dgfFu1WSBGnY/6vrzdNWyYeOp/UzYrtg== +"@budibase/types@2.4.8-alpha.1": + version "2.4.8-alpha.1" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.1.tgz#160fb30cacb85b552d6aada82e1fc89b64ca5bba" + integrity sha512-T+0/AzWjj64iPigN3ytRangv7nAkJrf9bqRww21eZeFjS+PUHelx7Ijjd/FchcI+MJWq2YKfGXVS42F+Y2bLlg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 04fc1be3d2d606b2f0b3d13dbacf4f1554759ba5 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Mar 2023 15:50:15 +0000 Subject: [PATCH 42/88] Add max height to popover when rendering above anchor (#9945) --- packages/bbui/src/Actions/position_dropdown.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/bbui/src/Actions/position_dropdown.js b/packages/bbui/src/Actions/position_dropdown.js index abc7188985..ecbb5747c4 100644 --- a/packages/bbui/src/Actions/position_dropdown.js +++ b/packages/bbui/src/Actions/position_dropdown.js @@ -31,6 +31,7 @@ export default function positionDropdown(element, opts) { styles.top = anchorBounds.top } else if (window.innerHeight - anchorBounds.bottom < 100) { styles.top = anchorBounds.top - elementBounds.height - offset + styles.maxHeight = 240 } else { styles.top = anchorBounds.bottom + offset styles.maxHeight = window.innerHeight - anchorBounds.bottom - 20 From 22b1e5e7904066bd27203f90988e5c37ce3a10aa Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 8 Mar 2023 15:57:28 +0000 Subject: [PATCH 43/88] v2.4.8-alpha.2 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 82be5bb8eb..c2704e3938 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 808236b713..26e0441ce4 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -24,7 +24,7 @@ "dependencies": { "@budibase/nano": "10.1.2", "@budibase/pouchdb-replication-stream": "1.2.10", - "@budibase/types": "2.4.8-alpha.1", + "@budibase/types": "2.4.8-alpha.2", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index b177df4ed0..0d921dc220 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", - "@budibase/string-templates": "2.4.8-alpha.1", + "@budibase/string-templates": "2.4.8-alpha.2", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", diff --git a/packages/builder/package.json b/packages/builder/package.json index 72193a2593..f3877d631e 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "license": "GPL-3.0", "private": true, "scripts": { @@ -58,10 +58,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.4.8-alpha.1", - "@budibase/client": "2.4.8-alpha.1", - "@budibase/frontend-core": "2.4.8-alpha.1", - "@budibase/string-templates": "2.4.8-alpha.1", + "@budibase/bbui": "2.4.8-alpha.2", + "@budibase/client": "2.4.8-alpha.2", + "@budibase/frontend-core": "2.4.8-alpha.2", + "@budibase/string-templates": "2.4.8-alpha.2", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 2d4825ff6d..f6703b65ea 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "dist/index.js", "bin": { @@ -29,9 +29,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.4.8-alpha.1", - "@budibase/string-templates": "2.4.8-alpha.1", - "@budibase/types": "2.4.8-alpha.1", + "@budibase/backend-core": "2.4.8-alpha.2", + "@budibase/string-templates": "2.4.8-alpha.2", + "@budibase/types": "2.4.8-alpha.2", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 7220320eab..e528a36ebf 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "2.4.8-alpha.1", - "@budibase/frontend-core": "2.4.8-alpha.1", - "@budibase/string-templates": "2.4.8-alpha.1", + "@budibase/bbui": "2.4.8-alpha.2", + "@budibase/frontend-core": "2.4.8-alpha.2", + "@budibase/string-templates": "2.4.8-alpha.2", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index e6014d6952..8dea0a85b3 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.4.8-alpha.1", + "@budibase/bbui": "2.4.8-alpha.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 92a040626e..ca127656c0 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 0198f3cdde..3c1aa670e1 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.4.8-alpha.1", - "@budibase/client": "2.4.8-alpha.1", + "@budibase/backend-core": "2.4.8-alpha.2", + "@budibase/client": "2.4.8-alpha.2", "@budibase/pro": "2.4.8-alpha.1", - "@budibase/string-templates": "2.4.8-alpha.1", - "@budibase/types": "2.4.8-alpha.1", + "@budibase/string-templates": "2.4.8-alpha.2", + "@budibase/types": "2.4.8-alpha.2", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5564d33e19..1caf5c65b3 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 97f98f55cb..48893e3cff 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 753408ee3f..16ba931cf2 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.4.8-alpha.1", + "version": "2.4.8-alpha.2", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.4.8-alpha.1", + "@budibase/backend-core": "2.4.8-alpha.2", "@budibase/pro": "2.4.8-alpha.1", - "@budibase/string-templates": "2.4.8-alpha.1", - "@budibase/types": "2.4.8-alpha.1", + "@budibase/string-templates": "2.4.8-alpha.2", + "@budibase/types": "2.4.8-alpha.2", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 306f20b7c8c4f300b285776a854f29a7ffb856fe Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 8 Mar 2023 16:00:30 +0000 Subject: [PATCH 44/88] Update pro version to 2.4.8-alpha.2 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 3c1aa670e1..7f95be9db0 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "2.4.8-alpha.2", "@budibase/client": "2.4.8-alpha.2", - "@budibase/pro": "2.4.8-alpha.1", + "@budibase/pro": "2.4.8-alpha.2", "@budibase/string-templates": "2.4.8-alpha.2", "@budibase/types": "2.4.8-alpha.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 57cc97a1db..4c7091df15 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1278,14 +1278,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.4.8-alpha.1": - version "2.4.8-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.1.tgz#7af207f5144e0cc005f9d050a773ad0d4741aa64" - integrity sha512-3kFYbGci48uFz1dix4cByBHSM+v3GIUtH/x144hGKWFZO6hCNEhuJ0ZHVUIHCAWsZK7DgHdwPP44jahWY8Z4rQ== +"@budibase/backend-core@2.4.8-alpha.2": + version "2.4.8-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.2.tgz#e567201c2fc3a6380635597568fb5b38a5eff005" + integrity sha512-gBrnfcH16k3YxPDyFXx2I4RFKbR148feK3wRixaxijdW7g2BGdZ7TDQVDueywhouVVw/G9XQqsv9rvgce94wbg== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.4.8-alpha.1" + "@budibase/types" "2.4.8-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1417,14 +1417,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.4.8-alpha.1": - version "2.4.8-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.1.tgz#18b176ec7cce148e35d0b8c75355ca39e5340d8f" - integrity sha512-htKJCoulhNLSfi9TPxUmor3A69Df8y3pnLhz4R9z6LjFHHTSRk4ZqRQG053Ty1FOZNUuKhocpL4rpjpuYECfEQ== +"@budibase/pro@2.4.8-alpha.2": + version "2.4.8-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.2.tgz#02cb875cd7e6fe819c1fadb48d3c8c10ee1018c3" + integrity sha512-Pt4RjJmbSak1uyKMIoOR8rmI9ket5ZHDtA2OxMZXyoI8SGv3oPHvIHAiN+KicdWLmDOjeGcCr51kxYPJ2UpUlg== dependencies: - "@budibase/backend-core" "2.4.8-alpha.1" + "@budibase/backend-core" "2.4.8-alpha.2" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.4.8-alpha.1" + "@budibase/types" "2.4.8-alpha.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1463,10 +1463,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.4.8-alpha.1": - version "2.4.8-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.1.tgz#160fb30cacb85b552d6aada82e1fc89b64ca5bba" - integrity sha512-T+0/AzWjj64iPigN3ytRangv7nAkJrf9bqRww21eZeFjS+PUHelx7Ijjd/FchcI+MJWq2YKfGXVS42F+Y2bLlg== +"@budibase/types@2.4.8-alpha.2": + version "2.4.8-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.2.tgz#e0bc17976058d55d00749bac6212c940922bf554" + integrity sha512-siCfgN7otou4fWgEUxeDur3dbAHse1ogs+pvTNy3By+KIOcCE6MOPvtQsJFo8j+/SU5A7y8EdTOVU1XhEh8aZg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 16ba931cf2..45a86b3a98 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "2.4.8-alpha.2", - "@budibase/pro": "2.4.8-alpha.1", + "@budibase/pro": "2.4.8-alpha.2", "@budibase/string-templates": "2.4.8-alpha.2", "@budibase/types": "2.4.8-alpha.2", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 5062a380bf..80cbff3d28 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -475,14 +475,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.4.8-alpha.1": - version "2.4.8-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.1.tgz#7af207f5144e0cc005f9d050a773ad0d4741aa64" - integrity sha512-3kFYbGci48uFz1dix4cByBHSM+v3GIUtH/x144hGKWFZO6hCNEhuJ0ZHVUIHCAWsZK7DgHdwPP44jahWY8Z4rQ== +"@budibase/backend-core@2.4.8-alpha.2": + version "2.4.8-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.2.tgz#e567201c2fc3a6380635597568fb5b38a5eff005" + integrity sha512-gBrnfcH16k3YxPDyFXx2I4RFKbR148feK3wRixaxijdW7g2BGdZ7TDQVDueywhouVVw/G9XQqsv9rvgce94wbg== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.4.8-alpha.1" + "@budibase/types" "2.4.8-alpha.2" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -564,14 +564,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.4.8-alpha.1": - version "2.4.8-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.1.tgz#18b176ec7cce148e35d0b8c75355ca39e5340d8f" - integrity sha512-htKJCoulhNLSfi9TPxUmor3A69Df8y3pnLhz4R9z6LjFHHTSRk4ZqRQG053Ty1FOZNUuKhocpL4rpjpuYECfEQ== +"@budibase/pro@2.4.8-alpha.2": + version "2.4.8-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.2.tgz#02cb875cd7e6fe819c1fadb48d3c8c10ee1018c3" + integrity sha512-Pt4RjJmbSak1uyKMIoOR8rmI9ket5ZHDtA2OxMZXyoI8SGv3oPHvIHAiN+KicdWLmDOjeGcCr51kxYPJ2UpUlg== dependencies: - "@budibase/backend-core" "2.4.8-alpha.1" + "@budibase/backend-core" "2.4.8-alpha.2" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.4.8-alpha.1" + "@budibase/types" "2.4.8-alpha.2" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -592,10 +592,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.4.8-alpha.1": - version "2.4.8-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.1.tgz#160fb30cacb85b552d6aada82e1fc89b64ca5bba" - integrity sha512-T+0/AzWjj64iPigN3ytRangv7nAkJrf9bqRww21eZeFjS+PUHelx7Ijjd/FchcI+MJWq2YKfGXVS42F+Y2bLlg== +"@budibase/types@2.4.8-alpha.2": + version "2.4.8-alpha.2" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.2.tgz#e0bc17976058d55d00749bac6212c940922bf554" + integrity sha512-siCfgN7otou4fWgEUxeDur3dbAHse1ogs+pvTNy3By+KIOcCE6MOPvtQsJFo8j+/SU5A7y8EdTOVU1XhEh8aZg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 158703daefbf2d600c1bde362900ae13c166a59f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 9 Mar 2023 08:50:26 +0000 Subject: [PATCH 45/88] Bug - BUDI-6068 filters do not work for google sheets (#9886) * Add data-utils with filters * Create data-utils * Add data-utils to compiled code * Reuse constants * Fix tests * Rename package to shared-core * Namespace export shared-core * Rely on rollup to bundle shared-core * Revert "Rely on rollup to bundle shared-core" This reverts commit e8b5a2bb9a5f5cfe41b5540737ac3ab64677cf1c. * Updating version and removing private. * Update version * Increment versions. * Implement sort * Enabling sort * v2.3.21-alpha.2 * Fix build * Improve readability * Move deepGet to shared helper * Better type usage * Fix types * Configure types * Fix vite refs * Add dep * Fixing depencencies on client * Add missing dev command * Fix loading issues * Update versions to latest * Multiple es6 and commonjs configs * Config * Use local packages on rollup for client * Change shared-core and types entry points --------- Co-authored-by: mike12345567 --- packages/bbui/package.json | 1 + packages/bbui/src/helpers.js | 27 +- packages/builder/package.json | 1 + packages/client/package.json | 2 + packages/client/rollup.config.js | 14 + packages/frontend-core/package.json | 1 + packages/frontend-core/src/constants.js | 72 +---- packages/frontend-core/src/fetch/DataFetch.js | 10 +- packages/frontend-core/src/utils/index.js | 2 +- packages/server/jest.config.ts | 1 + packages/server/package.json | 1 + .../api/controllers/row/ExternalRequest.ts | 14 +- .../src/api/controllers/row/external.ts | 6 +- packages/server/src/integrations/base/sql.ts | 3 +- .../server/src/integrations/googlesheets.ts | 34 ++- packages/server/tsconfig.json | 15 +- packages/shared-core/.gitignore | 2 + packages/shared-core/package.json | 30 ++ packages/shared-core/src/constants.ts | 69 +++++ .../lucene.js => shared-core/src/filters.ts} | 236 ++++++++++----- packages/shared-core/src/helpers.ts | 23 ++ packages/shared-core/src/index.ts | 4 + packages/shared-core/src/utils.ts | 6 + packages/shared-core/tsconfig-base.build.json | 25 ++ packages/shared-core/tsconfig-cjs.build.json | 8 + packages/shared-core/tsconfig.build.json | 8 + packages/shared-core/tsconfig.json | 11 + packages/shared-core/yarn.lock | 277 ++++++++++++++++++ packages/types/package.json | 16 +- packages/types/src/sdk/search.ts | 6 +- packages/types/tsconfig-base.build.json | 14 + packages/types/tsconfig-cjs.build.json | 8 + packages/types/tsconfig.build.json | 26 +- packages/types/yarn.lock | 185 ++++++++++++ scripts/link-dependencies.sh | 6 + 35 files changed, 949 insertions(+), 215 deletions(-) create mode 100644 packages/shared-core/.gitignore create mode 100644 packages/shared-core/package.json create mode 100644 packages/shared-core/src/constants.ts rename packages/{frontend-core/src/utils/lucene.js => shared-core/src/filters.ts} (60%) create mode 100644 packages/shared-core/src/helpers.ts create mode 100644 packages/shared-core/src/index.ts create mode 100644 packages/shared-core/src/utils.ts create mode 100644 packages/shared-core/tsconfig-base.build.json create mode 100644 packages/shared-core/tsconfig-cjs.build.json create mode 100644 packages/shared-core/tsconfig.build.json create mode 100644 packages/shared-core/tsconfig.json create mode 100644 packages/shared-core/yarn.lock create mode 100644 packages/types/tsconfig-base.build.json create mode 100644 packages/types/tsconfig-cjs.build.json diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 0d921dc220..2d7c33fa15 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -38,6 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", + "@budibase/shared-core": "2.4.8-alpha.2", "@budibase/string-templates": "2.4.8-alpha.2", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", diff --git a/packages/bbui/src/helpers.js b/packages/bbui/src/helpers.js index f2246fbb49..32030322d9 100644 --- a/packages/bbui/src/helpers.js +++ b/packages/bbui/src/helpers.js @@ -1,3 +1,6 @@ +import { helpers } from "@budibase/shared-core" +export const deepGet = helpers.deepGet + /** * Generates a DOM safe UUID. * Starting with a letter is important to make it DOM safe. @@ -41,30 +44,6 @@ export const hashString = string => { return hash.toString() } -/** - * Gets a key within an object. The key supports dot syntax for retrieving deep - * fields - e.g. "a.b.c". - * Exact matches of keys with dots in them take precedence over nested keys of - * the same path - e.g. getting "a.b" from { "a.b": "foo", a: { b: "bar" } } - * will return "foo" over "bar". - * @param obj the object - * @param key the key - * @return {*|null} the value or null if a value was not found for this key - */ -export const deepGet = (obj, key) => { - if (!obj || !key) { - return null - } - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key] - } - const split = key.split(".") - for (let i = 0; i < split.length; i++) { - obj = obj?.[split[i]] - } - return obj -} - /** * Sets a key within an object. The key supports dot syntax for retrieving deep * fields - e.g. "a.b.c". diff --git a/packages/builder/package.json b/packages/builder/package.json index f3877d631e..891aa94dbf 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -61,6 +61,7 @@ "@budibase/bbui": "2.4.8-alpha.2", "@budibase/client": "2.4.8-alpha.2", "@budibase/frontend-core": "2.4.8-alpha.2", + "@budibase/shared-core": "2.4.8-alpha.2", "@budibase/string-templates": "2.4.8-alpha.2", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", diff --git a/packages/client/package.json b/packages/client/package.json index e528a36ebf..c20edaeef6 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -21,7 +21,9 @@ "dependencies": { "@budibase/bbui": "2.4.8-alpha.2", "@budibase/frontend-core": "2.4.8-alpha.2", + "@budibase/shared-core": "2.4.8-alpha.2", "@budibase/string-templates": "2.4.8-alpha.2", + "@budibase/types": "2.4.8-alpha.2", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/client/rollup.config.js b/packages/client/rollup.config.js index f56714b51a..c22b928f10 100644 --- a/packages/client/rollup.config.js +++ b/packages/client/rollup.config.js @@ -20,6 +20,19 @@ const ignoredWarnings = [ "a11y-click-events-have-key-events", ] +const devPaths = production + ? [] + : [ + { + find: "@budibase/shared-core", + replacement: path.resolve("../shared-core/dist/mjs/src/index"), + }, + { + find: "@budibase/types", + replacement: path.resolve("../types/dist/mjs/index"), + }, + ] + export default { input: "src/index.js", output: [ @@ -69,6 +82,7 @@ export default { find: "sdk", replacement: path.resolve("./src/sdk"), }, + ...devPaths, ], }), svelte({ diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 8dea0a85b3..199ea5c358 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -7,6 +7,7 @@ "svelte": "src/index.js", "dependencies": { "@budibase/bbui": "2.4.8-alpha.2", + "@budibase/shared-core": "2.4.8-alpha.2", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/frontend-core/src/constants.js b/packages/frontend-core/src/constants.js index 09b7a00aec..bdf7abe36f 100644 --- a/packages/frontend-core/src/constants.js +++ b/packages/frontend-core/src/constants.js @@ -1,56 +1,7 @@ /** * Operator options for lucene queries */ -export const OperatorOptions = { - Equals: { - value: "equal", - label: "Equals", - }, - NotEquals: { - value: "notEqual", - label: "Not equals", - }, - Empty: { - value: "empty", - label: "Is empty", - }, - NotEmpty: { - value: "notEmpty", - label: "Is not empty", - }, - StartsWith: { - value: "string", - label: "Starts with", - }, - Like: { - value: "fuzzy", - label: "Like", - }, - MoreThan: { - value: "rangeLow", - label: "More than or equal to", - }, - LessThan: { - value: "rangeHigh", - label: "Less than or equal to", - }, - Contains: { - value: "contains", - label: "Contains", - }, - NotContains: { - value: "notContains", - label: "Does not contain", - }, - In: { - value: "oneOf", - label: "Is in", - }, - ContainsAny: { - value: "containsAny", - label: "Has any", - }, -} +export { OperatorOptions, SqlNumberTypeRangeMap } from "@budibase/shared-core" // Cookie names export const Cookies = { @@ -127,27 +78,6 @@ export const Roles = { PUBLIC: "PUBLIC", BUILDER: "BUILDER", } -/** - * Maximum minimum range for SQL number values - */ -export const SqlNumberTypeRangeMap = { - integer: { - max: 2147483647, - min: -2147483648, - }, - int: { - max: 2147483647, - min: -2147483648, - }, - smallint: { - max: 32767, - min: -32768, - }, - mediumint: { - max: 8388607, - min: -8388608, - }, -} export const Themes = [ { diff --git a/packages/frontend-core/src/fetch/DataFetch.js b/packages/frontend-core/src/fetch/DataFetch.js index 37e300e354..9b687e9844 100644 --- a/packages/frontend-core/src/fetch/DataFetch.js +++ b/packages/frontend-core/src/fetch/DataFetch.js @@ -1,13 +1,11 @@ import { writable, derived, get } from "svelte/store" import { cloneDeep } from "lodash/fp" -import { - buildLuceneQuery, - luceneLimit, - runLuceneQuery, - luceneSort, -} from "../utils/lucene" +import { LuceneUtils } from "../utils" import { convertJSONSchemaToTableSchema } from "../utils/json" +const { buildLuceneQuery, luceneLimit, runLuceneQuery, luceneSort } = + LuceneUtils + /** * Parent class which handles the implementation of fetching data from an * internal table or datasource plus. diff --git a/packages/frontend-core/src/utils/index.js b/packages/frontend-core/src/utils/index.js index 3ba3bf0fd4..6ac7c65c62 100644 --- a/packages/frontend-core/src/utils/index.js +++ b/packages/frontend-core/src/utils/index.js @@ -1,4 +1,4 @@ -export * as LuceneUtils from "./lucene" +export { dataFilters as LuceneUtils } from "@budibase/shared-core" export * as JSONUtils from "./json" export * as CookieUtils from "./cookies" export * as RoleUtils from "./roles" diff --git a/packages/server/jest.config.ts b/packages/server/jest.config.ts index f247e90bd1..03eca3705b 100644 --- a/packages/server/jest.config.ts +++ b/packages/server/jest.config.ts @@ -14,6 +14,7 @@ const baseConfig: Config.InitialProjectOptions = { moduleNameMapper: { "@budibase/backend-core/(.*)": "/../backend-core/$1", "@budibase/backend-core": "/../backend-core/src", + "@budibase/shared-core": "/../shared-core/src", "@budibase/types": "/../types/src", }, } diff --git a/packages/server/package.json b/packages/server/package.json index 7f95be9db0..4fd1307075 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -46,6 +46,7 @@ "@budibase/backend-core": "2.4.8-alpha.2", "@budibase/client": "2.4.8-alpha.2", "@budibase/pro": "2.4.8-alpha.2", + "@budibase/shared-core": "2.4.8-alpha.2", "@budibase/string-templates": "2.4.8-alpha.2", "@budibase/types": "2.4.8-alpha.2", "@bull-board/api": "3.7.0", diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index bdf8d485f2..44b38bbeac 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -11,6 +11,8 @@ import { Row, Table, RelationshipTypes, + FieldType, + SortType, } from "@budibase/types" import { breakRowIdField, @@ -749,8 +751,16 @@ export class ExternalRequest { ) //if the sort column is a formula, remove it for (let sortColumn of Object.keys(sort || {})) { - if (table.schema[sortColumn]?.type === "formula") { - delete sort?.[sortColumn] + if (!sort?.[sortColumn]) { + continue + } + switch (table.schema[sortColumn]?.type) { + case FieldType.FORMULA: + delete sort?.[sortColumn] + break + case FieldType.NUMBER: + sort[sortColumn].type = SortType.number + break } } filters = buildFilters(id, filters || {}, table) diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts index 1b2301f139..8a7a9a6c69 100644 --- a/packages/server/src/api/controllers/row/external.ts +++ b/packages/server/src/api/controllers/row/external.ts @@ -8,7 +8,6 @@ import { breakRowIdField, } from "../../../integrations/utils" import { ExternalRequest, RunConfig } from "./ExternalRequest" -import { context } from "@budibase/backend-core" import * as exporters from "../view/exporters" import { apiFileReturn } from "../../../utilities/fileSystem" import { @@ -19,6 +18,7 @@ import { Table, Datasource, IncludeRelationship, + SortJson, } from "@budibase/types" import sdk from "../../../sdk" @@ -142,14 +142,14 @@ export async function search(ctx: BBContext) { limit: limit, } } - let sort + let sort: SortJson | undefined if (params.sort) { const direction = params.sortOrder === "descending" ? SortDirection.DESCENDING : SortDirection.ASCENDING sort = { - [params.sort]: direction, + [params.sort]: { direction }, } } try { diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index 00e62d3ce4..a21c8e7d54 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -317,7 +317,8 @@ class InternalBuilder { const table = json.meta?.table if (sort) { for (let [key, value] of Object.entries(sort)) { - const direction = value === SortDirection.ASCENDING ? "asc" : "desc" + const direction = + value.direction === SortDirection.ASCENDING ? "asc" : "desc" query = query.orderBy(`${table?.name}.${key}`, direction) } } else if (this.client === SqlClient.MS_SQL && paginate?.limit) { diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 6f202f9c3a..0c658df0f5 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -2,8 +2,11 @@ import { DatasourceFieldType, DatasourcePlus, Integration, + PaginationJson, QueryJson, QueryType, + SearchFilters, + SortJson, Table, TableSchema, } from "@budibase/types" @@ -13,6 +16,7 @@ import { DataSourceOperation, FieldTypes } from "../constants" import { GoogleSpreadsheet } from "google-spreadsheet" import fetch from "node-fetch" import { configs, HTTPError } from "@budibase/backend-core" +import { dataFilters } from "@budibase/shared-core" interface GoogleSheetsConfig { spreadsheetId: string @@ -237,7 +241,7 @@ class GoogleSheetsIntegration implements DatasourcePlus { const handlers = { [DataSourceOperation.CREATE]: () => this.create({ sheet, row: json.body }), - [DataSourceOperation.READ]: () => this.read({ sheet }), + [DataSourceOperation.READ]: () => this.read({ ...json, sheet }), [DataSourceOperation.UPDATE]: () => this.update({ // exclude the header row and zero index @@ -345,18 +349,40 @@ class GoogleSheetsIntegration implements DatasourcePlus { } } - async read(query: { sheet: string }) { + async read(query: { + sheet: string + filters?: SearchFilters + sort?: SortJson + paginate?: PaginationJson + }) { try { await this.connect() const sheet = this.client.sheetsByTitle[query.sheet] const rows = await sheet.getRows() + const filtered = dataFilters.runLuceneQuery(rows, query.filters) const headerValues = sheet.headerValues - const response = [] - for (let row of rows) { + let response = [] + for (let row of filtered) { response.push( this.buildRowObject(headerValues, row._rawData, row._rowNumber) ) } + + if (query.sort) { + if (Object.keys(query.sort).length !== 1) { + console.warn("Googlesheets does not support multiple sorting", { + sortInfo: query.sort, + }) + } + const [sortField, sortInfo] = Object.entries(query.sort)[0] + response = dataFilters.luceneSort( + response, + sortField, + sortInfo.direction, + sortInfo.type + ) + } + return response } catch (err) { console.error("Error reading from google sheets", err) diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index dba0d6328a..5f4ee1a701 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -9,6 +9,7 @@ "@budibase/types": ["../types/src"], "@budibase/backend-core": ["../backend-core/src"], "@budibase/backend-core/*": ["../backend-core/*"], + "@budibase/shared-core": ["../shared-core/src"], "@budibase/pro": ["../../../budibase-pro/packages/pro/src"] } }, @@ -19,15 +20,9 @@ "references": [ { "path": "../types" }, { "path": "../backend-core" }, + { "path": "../shared-core" }, { "path": "../../../budibase-pro/packages/pro" } ], - "include": [ - "src/**/*", - "specs", - "package.json" - ], - "exclude": [ - "node_modules", - "dist" - ] -} \ No newline at end of file + "include": ["src/**/*", "specs", "package.json"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/shared-core/.gitignore b/packages/shared-core/.gitignore new file mode 100644 index 0000000000..04c01ba7ba --- /dev/null +++ b/packages/shared-core/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ \ No newline at end of file diff --git a/packages/shared-core/package.json b/packages/shared-core/package.json new file mode 100644 index 0000000000..a665bf7d53 --- /dev/null +++ b/packages/shared-core/package.json @@ -0,0 +1,30 @@ +{ + "name": "@budibase/shared-core", + "version": "2.4.8-alpha.2", + "description": "Shared data utils", + "main": "dist/cjs/src/index.js", + "types": "dist/mjs/src/index.d.ts", + "exports": { + ".": { + "import": "./dist/mjs/src/index.js", + "require": "./dist/cjs/src/index.js" + }, + "./package.json": "./dist/mjs/package.json" + }, + "author": "Budibase", + "license": "GPL-3.0", + "scripts": { + "prebuild": "rimraf dist/", + "build": "tsc -p tsconfig.build.json && tsc -p tsconfig-cjs.build.json", + "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", + "dev:builder": "yarn prebuild && concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc -p tsconfig-cjs.build.json --watch\"" + }, + "dependencies": { + "@budibase/types": "2.4.5-alpha.0" + }, + "devDependencies": { + "concurrently": "^7.6.0", + "typescript": "4.7.3", + "rimraf": "3.0.2" + } +} diff --git a/packages/shared-core/src/constants.ts b/packages/shared-core/src/constants.ts new file mode 100644 index 0000000000..35b02d1e15 --- /dev/null +++ b/packages/shared-core/src/constants.ts @@ -0,0 +1,69 @@ +export const OperatorOptions = { + Equals: { + value: "equal", + label: "Equals", + }, + NotEquals: { + value: "notEqual", + label: "Not equals", + }, + Empty: { + value: "empty", + label: "Is empty", + }, + NotEmpty: { + value: "notEmpty", + label: "Is not empty", + }, + StartsWith: { + value: "string", + label: "Starts with", + }, + Like: { + value: "fuzzy", + label: "Like", + }, + MoreThan: { + value: "rangeLow", + label: "More than or equal to", + }, + LessThan: { + value: "rangeHigh", + label: "Less than or equal to", + }, + Contains: { + value: "contains", + label: "Contains", + }, + NotContains: { + value: "notContains", + label: "Does not contain", + }, + In: { + value: "oneOf", + label: "Is in", + }, + ContainsAny: { + value: "containsAny", + label: "Has any", + }, +} + +export const SqlNumberTypeRangeMap = { + integer: { + max: 2147483647, + min: -2147483648, + }, + int: { + max: 2147483647, + min: -2147483648, + }, + smallint: { + max: 32767, + min: -32768, + }, + mediumint: { + max: 8388607, + min: -8388608, + }, +} diff --git a/packages/frontend-core/src/utils/lucene.js b/packages/shared-core/src/filters.ts similarity index 60% rename from packages/frontend-core/src/utils/lucene.js rename to packages/shared-core/src/filters.ts index 427d8f8b97..2486ca1050 100644 --- a/packages/frontend-core/src/utils/lucene.js +++ b/packages/shared-core/src/filters.ts @@ -1,5 +1,6 @@ -import { Helpers } from "@budibase/bbui" -import { OperatorOptions, SqlNumberTypeRangeMap } from "../constants" +import { Datasource, FieldType, SortDirection, SortType } from "@budibase/types" +import { OperatorOptions, SqlNumberTypeRangeMap } from "./constants" +import { deepGet } from "./helpers" const HBS_REGEX = /{{([^{].*?)}}/g @@ -7,7 +8,11 @@ const HBS_REGEX = /{{([^{].*?)}}/g * Returns the valid operator options for a certain data type * @param type the data type */ -export const getValidOperatorsForType = (type, field, datasource) => { +export const getValidOperatorsForType = ( + type: FieldType, + field: string, + datasource: Datasource & { tableId: any } // TODO: is this table id ever populated? +) => { const Op = OperatorOptions const stringOps = [ Op.Equals, @@ -27,7 +32,10 @@ export const getValidOperatorsForType = (type, field, datasource) => { Op.NotEmpty, Op.In, ] - let ops = [] + let ops: { + value: string + label: string + }[] = [] if (type === "string") { ops = stringOps } else if (type === "number") { @@ -70,13 +78,13 @@ export const NoEmptyFilterStrings = [ OperatorOptions.NotEquals.value, OperatorOptions.Contains.value, OperatorOptions.NotContains.value, -] +] as (keyof QueryFields)[] /** * Removes any fields that contain empty strings that would cause inconsistent * behaviour with how backend tables are filtered (no value means no filter). */ -const cleanupQuery = query => { +const cleanupQuery = (query: Query) => { if (!query) { return query } @@ -84,9 +92,10 @@ const cleanupQuery = query => { if (!query[filterField]) { continue } - for (let [key, value] of Object.entries(query[filterField])) { + + for (let [key, value] of Object.entries(query[filterField]!)) { if (value == null || value === "") { - delete query[filterField][key] + delete query[filterField]![key] } } } @@ -96,7 +105,7 @@ const cleanupQuery = query => { /** * Removes a numeric prefix on field names designed to give fields uniqueness */ -const removeKeyNumbering = key => { +const removeKeyNumbering = (key: string) => { if (typeof key === "string" && key.match(/\d[0-9]*:/g) != null) { const parts = key.split(":") parts.shift() @@ -106,12 +115,66 @@ const removeKeyNumbering = key => { } } +type Filter = { + operator: keyof Query + field: string + type: any + value: any + externalType: keyof typeof SqlNumberTypeRangeMap +} + +type Query = QueryFields & QueryConfig +type QueryFields = { + string?: { + [key: string]: string + } + fuzzy?: { + [key: string]: string + } + range?: { + [key: string]: { + high: number | string + low: number | string + } + } + equal?: { + [key: string]: any + } + notEqual?: { + [key: string]: any + } + empty?: { + [key: string]: any + } + notEmpty?: { + [key: string]: any + } + oneOf?: { + [key: string]: any[] + } + contains?: { + [key: string]: any[] + } + notContains?: { + [key: string]: any[] + } + containsAny?: { + [key: string]: any[] + } +} + +type QueryConfig = { + allOr?: boolean +} + +type QueryFieldsType = keyof QueryFields + /** * Builds a lucene JSON query from the filter structure generated in the builder * @param filter the builder filter structure */ -export const buildLuceneQuery = filter => { - let query = { +export const buildLuceneQuery = (filter: Filter[]) => { + let query: Query = { string: {}, fuzzy: {}, range: {}, @@ -128,7 +191,7 @@ export const buildLuceneQuery = filter => { filter.forEach(expression => { let { operator, field, type, value, externalType } = expression const isHbs = - typeof value === "string" && value.match(HBS_REGEX)?.length > 0 + typeof value === "string" && (value.match(HBS_REGEX) || []).length > 0 // Parse all values into correct types if (operator === "allOr") { query.allOr = true @@ -167,7 +230,7 @@ export const buildLuceneQuery = filter => { ) { value = value.split(",") } - if (operator.startsWith("range")) { + if (operator.startsWith("range") && query.range) { const minint = SqlNumberTypeRangeMap[externalType]?.min || Number.MIN_SAFE_INTEGER const maxint = @@ -178,9 +241,13 @@ export const buildLuceneQuery = filter => { high: type === "number" ? maxint : "9999-00-00T00:00:00.000Z", } } - if (operator === "rangeLow" && value != null && value !== "") { + if ((operator as any) === "rangeLow" && value != null && value !== "") { query.range[field].low = value - } else if (operator === "rangeHigh" && value != null && value !== "") { + } else if ( + (operator as any) === "rangeHigh" && + value != null && + value !== "" + ) { query.range[field].high = value } } else if (query[operator]) { @@ -189,14 +256,18 @@ export const buildLuceneQuery = filter => { // "equals false" needs to be "not equals true" // "not equals false" needs to be "equals true" if (operator === "equal" && value === false) { + query.notEqual = query.notEqual || {} query.notEqual[field] = true } else if (operator === "notEqual" && value === false) { + query.equal = query.equal || {} query.equal[field] = true } else { - query[operator][field] = value + query[operator] = query[operator] || {} + query[operator]![field] = value } } else { - query[operator][field] = value + query[operator] = query[operator] || {} + query[operator]![field] = value } } }) @@ -209,7 +280,7 @@ export const buildLuceneQuery = filter => { * @param docs the data * @param query the JSON lucene query */ -export const runLuceneQuery = (docs, query) => { +export const runLuceneQuery = (docs: any[], query?: Query) => { if (!docs || !Array.isArray(docs)) { return [] } @@ -221,87 +292,110 @@ export const runLuceneQuery = (docs, query) => { query = cleanupQuery(query) // Iterates over a set of filters and evaluates a fail function against a doc - const match = (type, failFn) => doc => { - const filters = Object.entries(query[type] || {}) - for (let i = 0; i < filters.length; i++) { - const [key, testValue] = filters[i] - const docValue = Helpers.deepGet(doc, removeKeyNumbering(key)) - if (failFn(docValue, testValue)) { - return false + const match = + ( + type: QueryFieldsType, + failFn: (docValue: any, testValue: any) => boolean + ) => + (doc: any) => { + const filters = Object.entries(query![type] || {}) + for (let i = 0; i < filters.length; i++) { + const [key, testValue] = filters[i] + const docValue = deepGet(doc, removeKeyNumbering(key)) + if (failFn(docValue, testValue)) { + return false + } } + return true } - return true - } // Process a string match (fails if the value does not start with the string) - const stringMatch = match("string", (docValue, testValue) => { + const stringMatch = match("string", (docValue: string, testValue: string) => { return ( !docValue || !docValue?.toLowerCase().startsWith(testValue?.toLowerCase()) ) }) // Process a fuzzy match (treat the same as starts with when running locally) - const fuzzyMatch = match("fuzzy", (docValue, testValue) => { + const fuzzyMatch = match("fuzzy", (docValue: string, testValue: string) => { return ( !docValue || !docValue?.toLowerCase().startsWith(testValue?.toLowerCase()) ) }) // Process a range match - const rangeMatch = match("range", (docValue, testValue) => { - return ( - docValue == null || - docValue === "" || - docValue < testValue.low || - docValue > testValue.high - ) - }) + const rangeMatch = match( + "range", + ( + docValue: string | number | null, + testValue: { low: number; high: number } + ) => { + return ( + docValue == null || + docValue === "" || + docValue < testValue.low || + docValue > testValue.high + ) + } + ) // Process an equal match (fails if the value is different) - const equalMatch = match("equal", (docValue, testValue) => { - return testValue != null && testValue !== "" && docValue !== testValue - }) + const equalMatch = match( + "equal", + (docValue: any, testValue: string | null) => { + return testValue != null && testValue !== "" && docValue !== testValue + } + ) // Process a not-equal match (fails if the value is the same) - const notEqualMatch = match("notEqual", (docValue, testValue) => { - return testValue != null && testValue !== "" && docValue === testValue - }) + const notEqualMatch = match( + "notEqual", + (docValue: any, testValue: string | null) => { + return testValue != null && testValue !== "" && docValue === testValue + } + ) // Process an empty match (fails if the value is not empty) - const emptyMatch = match("empty", docValue => { + const emptyMatch = match("empty", (docValue: string | null) => { return docValue != null && docValue !== "" }) // Process a not-empty match (fails is the value is empty) - const notEmptyMatch = match("notEmpty", docValue => { + const notEmptyMatch = match("notEmpty", (docValue: string | null) => { return docValue == null || docValue === "" }) // Process an includes match (fails if the value is not included) - const oneOf = match("oneOf", (docValue, testValue) => { + const oneOf = match("oneOf", (docValue: any, testValue: any) => { if (typeof testValue === "string") { testValue = testValue.split(",") if (typeof docValue === "number") { - testValue = testValue.map(item => parseFloat(item)) + testValue = testValue.map((item: string) => parseFloat(item)) } } return !testValue?.includes(docValue) }) - const containsAny = match("containsAny", (docValue, testValue) => { + const containsAny = match("containsAny", (docValue: any, testValue: any) => { return !docValue?.includes(...testValue) }) - const contains = match("contains", (docValue, testValue) => { - return !testValue?.every(item => docValue?.includes(item)) - }) + const contains = match( + "contains", + (docValue: string | any[], testValue: any[]) => { + return !testValue?.every((item: any) => docValue?.includes(item)) + } + ) - const notContains = match("notContains", (docValue, testValue) => { - return testValue?.every(item => docValue?.includes(item)) - }) + const notContains = match( + "notContains", + (docValue: string | any[], testValue: any[]) => { + return testValue?.every((item: any) => docValue?.includes(item)) + } + ) // Match a document against all criteria - const docMatch = doc => { + const docMatch = (doc: any) => { return ( stringMatch(doc) && fuzzyMatch(doc) && @@ -329,20 +423,28 @@ export const runLuceneQuery = (docs, query) => { * @param sortOrder the sort order ("ascending" or "descending") * @param sortType the type of sort ("string" or "number") */ -export const luceneSort = (docs, sort, sortOrder, sortType = "string") => { +export const luceneSort = ( + docs: any[], + sort: string, + sortOrder: SortDirection, + sortType = SortType.STRING +) => { if (!sort || !sortOrder || !sortType) { return docs } - const parse = sortType === "string" ? x => `${x}` : x => parseFloat(x) - return docs.slice().sort((a, b) => { - const colA = parse(a[sort]) - const colB = parse(b[sort]) - if (sortOrder === "Descending") { - return colA > colB ? -1 : 1 - } else { - return colA > colB ? 1 : -1 - } - }) + const parse = + sortType === "string" ? (x: any) => `${x}` : (x: string) => parseFloat(x) + return docs + .slice() + .sort((a: { [x: string]: any }, b: { [x: string]: any }) => { + const colA = parse(a[sort]) + const colB = parse(b[sort]) + if (sortOrder.toLowerCase() === "descending") { + return colA > colB ? -1 : 1 + } else { + return colA > colB ? 1 : -1 + } + }) } /** @@ -351,7 +453,7 @@ export const luceneSort = (docs, sort, sortOrder, sortType = "string") => { * @param docs the data * @param limit the number of docs to limit to */ -export const luceneLimit = (docs, limit) => { +export const luceneLimit = (docs: any[], limit: string) => { const numLimit = parseFloat(limit) if (isNaN(numLimit)) { return docs diff --git a/packages/shared-core/src/helpers.ts b/packages/shared-core/src/helpers.ts new file mode 100644 index 0000000000..8ecfc24b56 --- /dev/null +++ b/packages/shared-core/src/helpers.ts @@ -0,0 +1,23 @@ +/** + * Gets a key within an object. The key supports dot syntax for retrieving deep + * fields - e.g. "a.b.c". + * Exact matches of keys with dots in them take precedence over nested keys of + * the same path - e.g. getting "a.b" from { "a.b": "foo", a: { b: "bar" } } + * will return "foo" over "bar". + * @param obj the object + * @param key the key + * @return {*|null} the value or null if a value was not found for this key + */ +export const deepGet = (obj: { [x: string]: any }, key: string) => { + if (!obj || !key) { + return null + } + if (Object.prototype.hasOwnProperty.call(obj, key)) { + return obj[key] + } + const split = key.split(".") + for (let i = 0; i < split.length; i++) { + obj = obj?.[split[i]] + } + return obj +} diff --git a/packages/shared-core/src/index.ts b/packages/shared-core/src/index.ts new file mode 100644 index 0000000000..21f2f2c639 --- /dev/null +++ b/packages/shared-core/src/index.ts @@ -0,0 +1,4 @@ +export * from "./constants" +export * as dataFilters from "./filters" +export * as helpers from "./helpers" +export * as utils from "./utils" diff --git a/packages/shared-core/src/utils.ts b/packages/shared-core/src/utils.ts new file mode 100644 index 0000000000..720027d6a7 --- /dev/null +++ b/packages/shared-core/src/utils.ts @@ -0,0 +1,6 @@ +export function unreachable( + value: never, + message = `No such case in exhaustive switch: ${value}` +) { + throw new Error(message) +} diff --git a/packages/shared-core/tsconfig-base.build.json b/packages/shared-core/tsconfig-base.build.json new file mode 100644 index 0000000000..9715eb06cf --- /dev/null +++ b/packages/shared-core/tsconfig-base.build.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es6", + "moduleResolution": "node", + "lib": ["es2020"], + "strict": true, + "noImplicitAny": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "incremental": true, + "sourceMap": true, + "declaration": true, + "types": ["node"], + "outDir": "dist", + "skipLibCheck": true + }, + "include": ["**/*.js", "**/*.ts", "package.json"], + "exclude": [ + "node_modules", + "dist", + "**/*.spec.ts", + "**/*.spec.js", + "__mocks__" + ] +} diff --git a/packages/shared-core/tsconfig-cjs.build.json b/packages/shared-core/tsconfig-cjs.build.json new file mode 100644 index 0000000000..9b479b7b34 --- /dev/null +++ b/packages/shared-core/tsconfig-cjs.build.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig-base.build.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "dist/cjs", + "target": "es2015" + } +} diff --git a/packages/shared-core/tsconfig.build.json b/packages/shared-core/tsconfig.build.json new file mode 100644 index 0000000000..4d3c9fc2e0 --- /dev/null +++ b/packages/shared-core/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig-base.build.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/mjs", + "target": "esnext" + } +} diff --git a/packages/shared-core/tsconfig.json b/packages/shared-core/tsconfig.json new file mode 100644 index 0000000000..58c9a25d5e --- /dev/null +++ b/packages/shared-core/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": true, + "baseUrl": ".", + "paths": { + "@budibase/types": ["../types/src"] + } + }, + "references": [{ "path": "../types" }] +} diff --git a/packages/shared-core/yarn.lock b/packages/shared-core/yarn.lock new file mode 100644 index 0000000000..c1578954fc --- /dev/null +++ b/packages/shared-core/yarn.lock @@ -0,0 +1,277 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@budibase/types@2.4.5-alpha.0": + version "2.4.5-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.5-alpha.0.tgz#70fea09b5e471fe8fa6a760a1a2dd0dd74caac3a" + integrity sha512-tVFM9XnKwcCOo7nw6v7C8ZsK9hQLQBv3kHDn7/MFWnDMFCj72pUdtP/iFrAKr2c3tE84lkkWJfNHIolMSktHZA== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +concurrently@^7.6.0: + version "7.6.0" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-7.6.0.tgz#531a6f5f30cf616f355a4afb8f8fcb2bba65a49a" + integrity sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw== + dependencies: + chalk "^4.1.0" + date-fns "^2.29.1" + lodash "^4.17.21" + rxjs "^7.0.0" + shell-quote "^1.7.3" + spawn-command "^0.0.2-1" + supports-color "^8.1.0" + tree-kill "^1.2.2" + yargs "^17.3.1" + +date-fns@^2.29.1: + version "2.29.3" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8" + integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +glob@^7.1.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +rimraf@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +rxjs@^7.0.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" + integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== + dependencies: + tslib "^2.1.0" + +shell-quote@^1.7.3: + version "1.8.0" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.0.tgz#20d078d0eaf71d54f43bd2ba14a1b5b9bfa5c8ba" + integrity sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ== + +spawn-command@^0.0.2-1: + version "0.0.2-1" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg== + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +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" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.1.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + +tslib@^2.1.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + +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== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.3.1: + version "17.7.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.1.tgz#34a77645201d1a8fc5213ace787c220eabbd0967" + integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" diff --git a/packages/types/package.json b/packages/types/package.json index 48893e3cff..a96953be13 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -2,14 +2,21 @@ "name": "@budibase/types", "version": "2.4.8-alpha.2", "description": "Budibase types", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "types": "dist/mjs/index.d.ts", + "exports": { + ".": { + "import": "./dist/mjs/index.js", + "require": "./dist/cjs/index.js" + } + }, "author": "Budibase", "license": "GPL-3.0", "scripts": { "prebuild": "rimraf dist/", - "build": "tsc -p tsconfig.build.json", - "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput" + "build": "tsc -p tsconfig.build.json && tsc -p tsconfig-cjs.build.json", + "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", + "dev:builder": "yarn prebuild && concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc -p tsconfig-cjs.build.json --watch\"" }, "jest": {}, "devDependencies": { @@ -18,6 +25,7 @@ "@types/koa": "2.13.4", "@types/node": "14.18.20", "@types/pouchdb": "6.4.0", + "concurrently": "^7.6.0", "koa-body": "4.2.0", "rimraf": "3.0.2", "typescript": "4.7.3" diff --git a/packages/types/src/sdk/search.ts b/packages/types/src/sdk/search.ts index d5ea664c6b..d4c5135038 100644 --- a/packages/types/src/sdk/search.ts +++ b/packages/types/src/sdk/search.ts @@ -1,5 +1,6 @@ import { Operation, SortDirection } from "./datasources" import { Row, Table } from "../documents" +import { SortType } from "../api" export interface SearchFilters { allOr?: boolean @@ -42,7 +43,10 @@ export interface SearchFilters { } export interface SortJson { - [key: string]: SortDirection + [key: string]: { + direction: SortDirection + type?: SortType + } } export interface PaginationJson { diff --git a/packages/types/tsconfig-base.build.json b/packages/types/tsconfig-base.build.json new file mode 100644 index 0000000000..a955d2a179 --- /dev/null +++ b/packages/types/tsconfig-base.build.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "lib": ["es2020"], + "strict": true, + "noImplicitAny": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "incremental": true, + "sourceMap": true, + "declaration": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.spec.ts", "**/*.spec.js"] +} diff --git a/packages/types/tsconfig-cjs.build.json b/packages/types/tsconfig-cjs.build.json new file mode 100644 index 0000000000..9b479b7b34 --- /dev/null +++ b/packages/types/tsconfig-cjs.build.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig-base.build.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "dist/cjs", + "target": "es2015" + } +} diff --git a/packages/types/tsconfig.build.json b/packages/types/tsconfig.build.json index 86f128c056..9643676b52 100644 --- a/packages/types/tsconfig.build.json +++ b/packages/types/tsconfig.build.json @@ -1,24 +1,8 @@ { + "extends": "./tsconfig-base.build.json", "compilerOptions": { "target": "es6", - "module": "commonjs", - "lib": ["es2020"], - "strict": true, - "noImplicitAny": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "incremental": true, - "sourceMap": true, - "declaration": true, - "outDir": "dist" - }, - "include": [ - "src/**/*" - ], - "exclude": [ - "node_modules", - "dist", - "**/*.spec.ts", - "**/*.spec.js" - ] -} \ No newline at end of file + "moduleResolution": "node", + "outDir": "dist/mjs" + } +} diff --git a/packages/types/yarn.lock b/packages/types/yarn.lock index 4b45eb90ed..64aaf584a4 100644 --- a/packages/types/yarn.lock +++ b/packages/types/yarn.lock @@ -337,6 +337,18 @@ agent-base@^6.0.2: dependencies: debug "4" +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -377,6 +389,23 @@ call-bind@^1.0.0: function-bind "^1.1.1" get-intrinsic "^1.0.2" +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + co-body@^5.1.1: version "5.2.0" resolved "https://registry.yarnpkg.com/co-body/-/co-body-5.2.0.tgz#5a0a658c46029131e0e3a306f67647302f71c124" @@ -387,6 +416,18 @@ co-body@^5.1.1: raw-body "^2.2.0" type-is "^1.6.14" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -399,6 +440,26 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== +concurrently@^7.6.0: + version "7.6.0" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-7.6.0.tgz#531a6f5f30cf616f355a4afb8f8fcb2bba65a49a" + integrity sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw== + dependencies: + chalk "^4.1.0" + date-fns "^2.29.1" + lodash "^4.17.21" + rxjs "^7.0.0" + shell-quote "^1.7.3" + spawn-command "^0.0.2-1" + supports-color "^8.1.0" + tree-kill "^1.2.2" + yargs "^17.3.1" + +date-fns@^2.29.1: + version "2.29.3" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8" + integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA== + debug@4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -416,6 +477,16 @@ depd@2.0.0: resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + follow-redirects@^1.15.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" @@ -445,6 +516,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-intrinsic@^1.0.2: version "1.1.3" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" @@ -466,6 +542,11 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" @@ -521,6 +602,11 @@ inherits@2, inherits@2.0.4: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + json5@*: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" @@ -535,6 +621,11 @@ koa-body@4.2.0: co-body "^5.1.1" formidable "^1.1.1" +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -623,6 +714,11 @@ raw-body@^2.2.0: iconv-lite "0.4.24" unpipe "1.0.0" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -635,6 +731,13 @@ rimraf@3.0.2: dependencies: glob "^7.1.3" +rxjs@^7.0.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" + integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== + dependencies: + tslib "^2.1.0" + "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -645,6 +748,11 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== +shell-quote@^1.7.3: + version "1.8.0" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.0.tgz#20d078d0eaf71d54f43bd2ba14a1b5b9bfa5c8ba" + integrity sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ== + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -654,11 +762,46 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +spawn-command@^0.0.2-1: + version "0.0.2-1" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg== + statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +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" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.1.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + toidentifier@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" @@ -674,6 +817,16 @@ tough-cookie@^4.1.2: universalify "^0.2.0" url-parse "^1.5.3" +tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + +tslib@^2.1.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + type-is@^1.6.14: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -705,7 +858,39 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.3.1: + version "17.7.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.1.tgz#34a77645201d1a8fc5213ace787c220eabbd0967" + integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" diff --git a/scripts/link-dependencies.sh b/scripts/link-dependencies.sh index 9926f3dd2b..31d99fda3c 100755 --- a/scripts/link-dependencies.sh +++ b/scripts/link-dependencies.sh @@ -28,6 +28,12 @@ yarn unlink yarn link cd - +echo "Linking shared-core" +cd packages/shared-core +yarn unlink +yarn link +cd - + if [ -d "../budibase-pro" ]; then cd ../budibase-pro echo "Bootstrapping budibase-pro" From 1a4652e4c2415d02d35b8bf650c88379647559ed Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 9 Mar 2023 08:58:17 +0000 Subject: [PATCH 46/88] v2.4.8-alpha.3 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 6 +++--- packages/builder/package.json | 12 ++++++------ packages/cli/package.json | 8 ++++---- packages/client/package.json | 12 ++++++------ packages/frontend-core/package.json | 6 +++--- packages/sdk/package.json | 2 +- packages/server/package.json | 12 ++++++------ packages/shared-core/package.json | 6 +++--- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lerna.json b/lerna.json index c2704e3938..9c61d45296 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 26e0441ce4..9db08d7039 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -24,7 +24,7 @@ "dependencies": { "@budibase/nano": "10.1.2", "@budibase/pouchdb-replication-stream": "1.2.10", - "@budibase/types": "2.4.8-alpha.2", + "@budibase/types": "2.4.8-alpha.3", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 2d7c33fa15..c6623b06ff 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,8 +38,8 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", - "@budibase/shared-core": "2.4.8-alpha.2", - "@budibase/string-templates": "2.4.8-alpha.2", + "@budibase/shared-core": "2.4.8-alpha.3", + "@budibase/string-templates": "2.4.8-alpha.3", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", diff --git a/packages/builder/package.json b/packages/builder/package.json index 891aa94dbf..17d76f0307 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "license": "GPL-3.0", "private": true, "scripts": { @@ -58,11 +58,11 @@ } }, "dependencies": { - "@budibase/bbui": "2.4.8-alpha.2", - "@budibase/client": "2.4.8-alpha.2", - "@budibase/frontend-core": "2.4.8-alpha.2", - "@budibase/shared-core": "2.4.8-alpha.2", - "@budibase/string-templates": "2.4.8-alpha.2", + "@budibase/bbui": "2.4.8-alpha.3", + "@budibase/client": "2.4.8-alpha.3", + "@budibase/frontend-core": "2.4.8-alpha.3", + "@budibase/shared-core": "2.4.8-alpha.3", + "@budibase/string-templates": "2.4.8-alpha.3", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index f6703b65ea..54b156acbf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "dist/index.js", "bin": { @@ -29,9 +29,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.4.8-alpha.2", - "@budibase/string-templates": "2.4.8-alpha.2", - "@budibase/types": "2.4.8-alpha.2", + "@budibase/backend-core": "2.4.8-alpha.3", + "@budibase/string-templates": "2.4.8-alpha.3", + "@budibase/types": "2.4.8-alpha.3", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index c20edaeef6..81100b9210 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,11 +19,11 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "2.4.8-alpha.2", - "@budibase/frontend-core": "2.4.8-alpha.2", - "@budibase/shared-core": "2.4.8-alpha.2", - "@budibase/string-templates": "2.4.8-alpha.2", - "@budibase/types": "2.4.8-alpha.2", + "@budibase/bbui": "2.4.8-alpha.3", + "@budibase/frontend-core": "2.4.8-alpha.3", + "@budibase/shared-core": "2.4.8-alpha.3", + "@budibase/string-templates": "2.4.8-alpha.3", + "@budibase/types": "2.4.8-alpha.3", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 199ea5c358..bc649da768 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,13 +1,13 @@ { "name": "@budibase/frontend-core", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.4.8-alpha.2", - "@budibase/shared-core": "2.4.8-alpha.2", + "@budibase/bbui": "2.4.8-alpha.3", + "@budibase/shared-core": "2.4.8-alpha.3", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index ca127656c0..e4a63e0a97 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 4fd1307075..5b61c94853 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,12 +43,12 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.4.8-alpha.2", - "@budibase/client": "2.4.8-alpha.2", + "@budibase/backend-core": "2.4.8-alpha.3", + "@budibase/client": "2.4.8-alpha.3", "@budibase/pro": "2.4.8-alpha.2", - "@budibase/shared-core": "2.4.8-alpha.2", - "@budibase/string-templates": "2.4.8-alpha.2", - "@budibase/types": "2.4.8-alpha.2", + "@budibase/shared-core": "2.4.8-alpha.3", + "@budibase/string-templates": "2.4.8-alpha.3", + "@budibase/types": "2.4.8-alpha.3", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/shared-core/package.json b/packages/shared-core/package.json index a665bf7d53..8117cef631 100644 --- a/packages/shared-core/package.json +++ b/packages/shared-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/shared-core", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Shared data utils", "main": "dist/cjs/src/index.js", "types": "dist/mjs/src/index.d.ts", @@ -24,7 +24,7 @@ }, "devDependencies": { "concurrently": "^7.6.0", - "typescript": "4.7.3", - "rimraf": "3.0.2" + "rimraf": "3.0.2", + "typescript": "4.7.3" } } diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 1caf5c65b3..1131e5eda2 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index a96953be13..9ea09beed0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Budibase types", "main": "dist/cjs/index.js", "types": "dist/mjs/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 45a86b3a98..eb2b137bcf 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.4.8-alpha.2", + "version": "2.4.8-alpha.3", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.4.8-alpha.2", + "@budibase/backend-core": "2.4.8-alpha.3", "@budibase/pro": "2.4.8-alpha.2", - "@budibase/string-templates": "2.4.8-alpha.2", - "@budibase/types": "2.4.8-alpha.2", + "@budibase/string-templates": "2.4.8-alpha.3", + "@budibase/types": "2.4.8-alpha.3", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 93e9eaec8a05b1b22017e7349e173e2981e3160b Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 9 Mar 2023 09:01:11 +0000 Subject: [PATCH 47/88] Update pro version to 2.4.8-alpha.3 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 5b61c94853..c281f36af0 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "2.4.8-alpha.3", "@budibase/client": "2.4.8-alpha.3", - "@budibase/pro": "2.4.8-alpha.2", + "@budibase/pro": "2.4.8-alpha.3", "@budibase/shared-core": "2.4.8-alpha.3", "@budibase/string-templates": "2.4.8-alpha.3", "@budibase/types": "2.4.8-alpha.3", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 4c7091df15..4c8e012965 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1278,14 +1278,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.4.8-alpha.2": - version "2.4.8-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.2.tgz#e567201c2fc3a6380635597568fb5b38a5eff005" - integrity sha512-gBrnfcH16k3YxPDyFXx2I4RFKbR148feK3wRixaxijdW7g2BGdZ7TDQVDueywhouVVw/G9XQqsv9rvgce94wbg== +"@budibase/backend-core@2.4.8-alpha.3": + version "2.4.8-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.3.tgz#1b363ee5a307797b93fe956769c13640b027f217" + integrity sha512-Y4qraDiQaEF2mWliVD4nVxeaa/ja6QzhuUuc650p18ziJmKPL0cOo2WuelLM9paGROQ2V0RIKgYuSMaKbZ1V3Q== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.4.8-alpha.2" + "@budibase/types" "2.4.8-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1417,14 +1417,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.4.8-alpha.2": - version "2.4.8-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.2.tgz#02cb875cd7e6fe819c1fadb48d3c8c10ee1018c3" - integrity sha512-Pt4RjJmbSak1uyKMIoOR8rmI9ket5ZHDtA2OxMZXyoI8SGv3oPHvIHAiN+KicdWLmDOjeGcCr51kxYPJ2UpUlg== +"@budibase/pro@2.4.8-alpha.3": + version "2.4.8-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.3.tgz#3bedee6e648d84d97e221b7ef2d0ee95651a26c3" + integrity sha512-DHi6/K9p4VTQueNFXrkZANRsi+aX1HszDOOBTd2dhHFBBZfF4zCRzpozAIQXBwRsekBNuz1s4stFR6egaJeG3A== dependencies: - "@budibase/backend-core" "2.4.8-alpha.2" + "@budibase/backend-core" "2.4.8-alpha.3" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.4.8-alpha.2" + "@budibase/types" "2.4.8-alpha.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1463,10 +1463,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.4.8-alpha.2": - version "2.4.8-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.2.tgz#e0bc17976058d55d00749bac6212c940922bf554" - integrity sha512-siCfgN7otou4fWgEUxeDur3dbAHse1ogs+pvTNy3By+KIOcCE6MOPvtQsJFo8j+/SU5A7y8EdTOVU1XhEh8aZg== +"@budibase/types@2.4.8-alpha.3": + version "2.4.8-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.3.tgz#56672adaf6e9e54c4251b75f45872a7bad48a729" + integrity sha512-cUx+dcBoQIoKnL4oPMB6kEOkuq0iDdHQoriitXpnntBZGRNCVSXfwSw50Kt9tPkjiX0FP5l+/Wqj0kNtUoaOxg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index eb2b137bcf..1d7bcfb081 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "2.4.8-alpha.3", - "@budibase/pro": "2.4.8-alpha.2", + "@budibase/pro": "2.4.8-alpha.3", "@budibase/string-templates": "2.4.8-alpha.3", "@budibase/types": "2.4.8-alpha.3", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 80cbff3d28..267ead8f49 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -475,14 +475,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.4.8-alpha.2": - version "2.4.8-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.2.tgz#e567201c2fc3a6380635597568fb5b38a5eff005" - integrity sha512-gBrnfcH16k3YxPDyFXx2I4RFKbR148feK3wRixaxijdW7g2BGdZ7TDQVDueywhouVVw/G9XQqsv9rvgce94wbg== +"@budibase/backend-core@2.4.8-alpha.3": + version "2.4.8-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.8-alpha.3.tgz#1b363ee5a307797b93fe956769c13640b027f217" + integrity sha512-Y4qraDiQaEF2mWliVD4nVxeaa/ja6QzhuUuc650p18ziJmKPL0cOo2WuelLM9paGROQ2V0RIKgYuSMaKbZ1V3Q== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.4.8-alpha.2" + "@budibase/types" "2.4.8-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -564,14 +564,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.4.8-alpha.2": - version "2.4.8-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.2.tgz#02cb875cd7e6fe819c1fadb48d3c8c10ee1018c3" - integrity sha512-Pt4RjJmbSak1uyKMIoOR8rmI9ket5ZHDtA2OxMZXyoI8SGv3oPHvIHAiN+KicdWLmDOjeGcCr51kxYPJ2UpUlg== +"@budibase/pro@2.4.8-alpha.3": + version "2.4.8-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.8-alpha.3.tgz#3bedee6e648d84d97e221b7ef2d0ee95651a26c3" + integrity sha512-DHi6/K9p4VTQueNFXrkZANRsi+aX1HszDOOBTd2dhHFBBZfF4zCRzpozAIQXBwRsekBNuz1s4stFR6egaJeG3A== dependencies: - "@budibase/backend-core" "2.4.8-alpha.2" + "@budibase/backend-core" "2.4.8-alpha.3" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.4.8-alpha.2" + "@budibase/types" "2.4.8-alpha.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -592,10 +592,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.4.8-alpha.2": - version "2.4.8-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.2.tgz#e0bc17976058d55d00749bac6212c940922bf554" - integrity sha512-siCfgN7otou4fWgEUxeDur3dbAHse1ogs+pvTNy3By+KIOcCE6MOPvtQsJFo8j+/SU5A7y8EdTOVU1XhEh8aZg== +"@budibase/types@2.4.8-alpha.3": + version "2.4.8-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.8-alpha.3.tgz#56672adaf6e9e54c4251b75f45872a7bad48a729" + integrity sha512-cUx+dcBoQIoKnL4oPMB6kEOkuq0iDdHQoriitXpnntBZGRNCVSXfwSw50Kt9tPkjiX0FP5l+/Wqj0kNtUoaOxg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From e5271bdef16511a69b585e9a124bf9167dc6c1ec Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 9 Mar 2023 14:15:43 +0000 Subject: [PATCH 48/88] Command palette (#9942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * command palette E2E * tidy up * Improve theming with spectrum badges and dedupe spectrum label usage * Update data section nav to match designs and use panel component * Fix main content layout in data section * Update data section routing for tables * Improve data section routing for tables to account for edge cases * Update internal and sample datasource routing * Update external datasource routing * Update routing for queries and make a top level concept like everything else * Update routing for views * Fix undefined reference when deleting datasource * Reduce network calls and fix issues with stale datasourcenavigator state * Update routing for REST queries and unify routes for normal queries and REST queries * Lint * Fix links for queries from datasource details page * Remove redundant API calls and improve table deletion logic * Improve data entity deletion logic and redirection and fix query details keying * Improve determination of selected item in datasource tree * Update command palette to support new data routes * Update command palette, fix keybind issues and updating loading state * Lint * Fix publish command and fix preview published app URL * Fix BBUI import * Lint * Fix datasource navigator selected state not working for internal DB or sample data * Update command palette to use ctr+k/cmd+k * Update command palette to match new designs and add visible categories * Restore missing styles£ * Use proper theme constants for changing theme in command palette * Add command palette action for inviting users --------- Co-authored-by: Martin McKeaveney --- packages/bbui/src/Modal/Modal.svelte | 10 +- .../commandPalette/CommandPalette.svelte | 333 ++++++++++++++++++ .../builder/app/[application]/_layout.svelte | 21 +- .../data/table/[tableId]/index.svelte | 4 +- 4 files changed, 360 insertions(+), 8 deletions(-) create mode 100644 packages/builder/src/components/commandPalette/CommandPalette.svelte diff --git a/packages/bbui/src/Modal/Modal.svelte b/packages/bbui/src/Modal/Modal.svelte index 45081356c1..f56ef1187f 100644 --- a/packages/bbui/src/Modal/Modal.svelte +++ b/packages/bbui/src/Modal/Modal.svelte @@ -29,6 +29,14 @@ visible = false } + export function toggle() { + if (visible) { + hide() + } else { + show() + } + } + export function cancel() { if (!visible) { return @@ -61,7 +69,7 @@ } } - setContext(Context.Modal, { show, hide, cancel }) + setContext(Context.Modal, { show, hide, toggle, cancel }) onMount(() => { document.addEventListener("keydown", handleKey) diff --git a/packages/builder/src/components/commandPalette/CommandPalette.svelte b/packages/builder/src/components/commandPalette/CommandPalette.svelte new file mode 100644 index 0000000000..cf976a799e --- /dev/null +++ b/packages/builder/src/components/commandPalette/CommandPalette.svelte @@ -0,0 +1,333 @@ + + + + +
+
+ + +
+
+ {#each categories as [name, results], catIdx} +
+ {name} +
+ {#each results as command, cmdIdx} +
runAction(command)} + class:selected={command.idx === selected} + > + + {command.type}:  +
+ {command.name} +
+
+ {/each} +
+
+ {/each} +
+
+
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index fe5edae1a4..ff728312c1 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -10,6 +10,7 @@ Tabs, Tab, Heading, + Modal, notifications, } from "@budibase/bbui" @@ -18,6 +19,7 @@ import { isActive, goto, layout, redirect } from "@roxi/routify" import { capitalise } from "helpers" import { onMount, onDestroy } from "svelte" + import CommandPalette from "components/commandPalette/CommandPalette.svelte" import TourWrap from "components/portal/onboarding/TourWrap.svelte" import TourPopover from "components/portal/onboarding/TourPopover.svelte" import BuilderSidePanel from "./_components/BuilderSidePanel.svelte" @@ -25,12 +27,9 @@ export let application - // Get Package and set store let promise = getPackage() - // let betaAccess = false - - // Sync once when you load the app let hasSynced = false + let commandPaletteModal $: selected = capitalise( $layout.children.find(layout => $isActive(layout.path))?.title ?? "data" @@ -50,7 +49,6 @@ $redirect("../../") } } - // Handles navigation between frontend, backend, automation. // This remembers your last place on each of the sections // e.g. if one of your screens is selected on front end, then @@ -67,6 +65,14 @@ }) } + // Event handler for the command palette + const handleKeyDown = e => { + if (e.key === "k" && (e.ctrlKey || e.metaKey)) { + e.preventDefault() + commandPaletteModal.toggle() + } + } + const initTour = async () => { // Check if onboarding is enabled. if (isEnabled(TENANT_FEATURE_FLAGS.ONBOARDING_TOUR)) { @@ -201,6 +207,11 @@ {/await}
+ + + + +