@budibase/server 1.0.49-alpha.0 → 1.0.49-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builder/assets/{index.dd9e386f.css → index.83c0944f.css} +1 -1
- package/builder/assets/{index.8184eed9.js → index.f763d886.js} +206 -205
- package/builder/assets/{vendor.3bd2f661.js → vendor.d526bfe8.js} +1 -1
- package/builder/index.html +3 -3
- package/coverage/clover.xml +1743 -1610
- package/coverage/coverage-final.json +90 -89
- package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/application.js.html +106 -106
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +21 -21
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +16 -16
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +27 -12
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/api/controllers/layout.js.html +6 -6
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/{migrations/usageQuotas/syncApps.js.html → api/controllers/migrations.js.html} +30 -45
- package/coverage/lcov-report/api/controllers/permission.js.html +15 -15
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.js.html +19 -19
- package/coverage/lcov-report/api/controllers/query/validation.js.html +6 -6
- package/coverage/lcov-report/api/controllers/role.js.html +9 -9
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +16 -16
- package/coverage/lcov-report/api/controllers/row/index.html +40 -25
- package/coverage/lcov-report/api/controllers/row/index.js.html +13 -13
- package/coverage/lcov-report/api/controllers/row/internal.js.html +83 -146
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +41 -17
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +551 -0
- package/coverage/lcov-report/api/controllers/row/utils.js.html +13 -13
- package/coverage/lcov-report/api/controllers/screen.js.html +7 -7
- package/coverage/lcov-report/api/controllers/script.js.html +4 -4
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +629 -0
- package/coverage/lcov-report/api/controllers/table/external.js.html +12 -12
- package/coverage/lcov-report/api/controllers/table/index.html +45 -30
- package/coverage/lcov-report/api/controllers/table/index.js.html +23 -65
- package/coverage/lcov-report/api/controllers/table/internal.js.html +33 -15
- package/coverage/lcov-report/api/controllers/table/utils.js.html +161 -41
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +20 -20
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +4 -4
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +14 -14
- package/coverage/lcov-report/api/controllers/view/utils.js.html +11 -11
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +7 -7
- package/coverage/lcov-report/api/controllers/webhook.js.html +15 -15
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +3 -3
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/application.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +22 -7
- package/coverage/lcov-report/api/routes/index.js.html +10 -4
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/{migrations/usageQuotas/index.js.html → api/routes/migrations.js.html} +25 -55
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/row.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/static.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +24 -24
- package/coverage/lcov-report/automations/automationUtils.js.html +5 -5
- package/coverage/lcov-report/automations/bullboard.js.html +16 -16
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +6 -6
- package/coverage/lcov-report/automations/steps/createRow.js.html +7 -7
- package/coverage/lcov-report/automations/steps/delay.js.html +4 -4
- package/coverage/lcov-report/automations/steps/deleteRow.js.html +7 -7
- package/coverage/lcov-report/automations/steps/discord.js.html +7 -7
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +6 -6
- package/coverage/lcov-report/automations/steps/executeScript.js.html +6 -6
- package/coverage/lcov-report/automations/steps/filter.js.html +7 -7
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +5 -5
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +8 -8
- package/coverage/lcov-report/automations/steps/queryRows.js.html +10 -10
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +5 -5
- package/coverage/lcov-report/automations/steps/serverLog.js.html +3 -3
- package/coverage/lcov-report/automations/steps/slack.js.html +5 -5
- package/coverage/lcov-report/automations/steps/updateRow.js.html +6 -6
- package/coverage/lcov-report/automations/steps/utils.js.html +3 -3
- package/coverage/lcov-report/automations/steps/zapier.js.html +5 -5
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +2 -2
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +2 -2
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +8 -8
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +2 -2
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +2 -2
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +2 -2
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +2 -2
- package/coverage/lcov-report/automations/triggers.js.html +18 -18
- package/coverage/lcov-report/automations/utils.js.html +32 -32
- package/coverage/lcov-report/constants/index.html +5 -5
- package/coverage/lcov-report/constants/index.js.html +42 -27
- package/coverage/lcov-report/constants/layouts.js.html +5 -5
- package/coverage/lcov-report/constants/screens.js.html +4 -4
- package/coverage/lcov-report/db/client.js.html +18 -18
- package/coverage/lcov-report/db/inMemoryView.js.html +7 -7
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +3 -3
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +7 -7
- package/coverage/lcov-report/db/linkedRows/index.html +10 -10
- package/coverage/lcov-report/db/linkedRows/index.js.html +26 -29
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +13 -13
- package/coverage/lcov-report/db/newid.js.html +4 -4
- package/coverage/lcov-report/db/utils.js.html +71 -71
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +5 -5
- package/coverage/lcov-report/events/utils.js.html +3 -3
- package/coverage/lcov-report/index.html +61 -76
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/authorized.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +11 -11
- package/coverage/lcov-report/middleware/joi-validator.js.html +3 -3
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/usageQuota.js.html +6 -12
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +1 -1
- package/coverage/lcov-report/threads/index.html +1 -1
- package/coverage/lcov-report/threads/index.js.html +10 -10
- package/coverage/lcov-report/threads/query.js.html +1 -1
- package/coverage/lcov-report/threads/utils.js.html +14 -14
- package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +7 -7
- package/coverage/lcov-report/utilities/centralPath.js.html +4 -4
- package/coverage/lcov-report/utilities/csvParser.js.html +6 -6
- package/coverage/lcov-report/utilities/global.js.html +14 -14
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +24 -24
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +8 -8
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +27 -27
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +80 -44
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +75 -27
- package/coverage/lcov-report/utilities/scriptRunner.js.html +5 -5
- package/coverage/lcov-report/utilities/security.js.html +8 -8
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.js.html +10 -10
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +5 -5
- package/coverage/lcov-report/utilities/workerRequests.js.html +12 -12
- package/coverage/lcov.info +2545 -2257
- package/dist/api/controllers/application.js +18 -20
- package/dist/api/controllers/migrations.js +21 -0
- package/dist/api/controllers/row/internal.js +30 -53
- package/dist/api/controllers/row/internalSearch.js +12 -4
- package/dist/api/controllers/row/staticFormula.js +147 -0
- package/dist/api/controllers/table/bulkFormula.js +160 -0
- package/dist/api/controllers/table/index.js +3 -6
- package/dist/api/controllers/table/internal.js +7 -0
- package/dist/api/controllers/table/utils.js +32 -10
- package/dist/api/routes/index.js +2 -0
- package/dist/api/routes/migrations.js +9 -0
- package/dist/app.js +35 -5
- package/dist/constants/index.js +4 -0
- package/dist/db/linkedRows/index.js +4 -5
- package/dist/environment.js +1 -0
- package/dist/middleware/usageQuota.js +0 -2
- package/dist/migrations/functions/appUrls.js +46 -0
- package/dist/migrations/functions/quotas1.js +50 -0
- package/dist/migrations/{usageQuotas → functions/usageQuotas}/index.js +6 -10
- package/dist/migrations/{usageQuotas → functions/usageQuotas}/syncApps.js +11 -5
- package/dist/migrations/{usageQuotas → functions/usageQuotas}/syncRows.js +14 -8
- package/dist/migrations/functions/userEmailViewCasing.js +24 -0
- package/dist/migrations/index.js +62 -0
- package/dist/package.json +4 -4
- package/dist/tests/utilities/TestConfiguration.js +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/rowProcessor/index.js +18 -11
- package/dist/utilities/rowProcessor/utils.js +14 -4
- package/package.json +5 -5
- package/src/api/controllers/application.js +3 -3
- package/src/api/controllers/migrations.js +13 -0
- package/src/api/controllers/row/internal.js +29 -50
- package/src/api/controllers/row/internalSearch.js +12 -4
- package/src/api/controllers/row/staticFormula.js +157 -0
- package/src/api/controllers/table/bulkFormula.js +183 -0
- package/src/api/controllers/table/index.js +3 -17
- package/src/api/controllers/table/internal.js +7 -1
- package/src/api/controllers/table/utils.js +48 -8
- package/src/api/routes/index.js +2 -0
- package/src/api/routes/migrations.js +14 -0
- package/src/app.ts +18 -5
- package/src/constants/index.js +5 -0
- package/src/db/linkedRows/index.js +4 -5
- package/src/definitions/common.ts +3 -0
- package/src/environment.js +1 -0
- package/src/middleware/usageQuota.js +0 -2
- package/src/migrations/functions/appUrls.ts +34 -0
- package/src/migrations/functions/quotas1.ts +20 -0
- package/src/migrations/functions/tests/appUrls.spec.js +29 -0
- package/src/migrations/{tests/usageQuotas/index.spec.js → functions/tests/quotas1.spec.js} +5 -5
- package/src/migrations/functions/tests/userEmailViewCasing.spec.js +25 -0
- package/src/migrations/functions/usageQuotas/index.ts +8 -0
- package/src/migrations/{usageQuotas/syncApps.js → functions/usageQuotas/syncApps.ts} +3 -3
- package/src/migrations/{usageQuotas/syncRows.js → functions/usageQuotas/syncRows.ts} +5 -5
- package/src/migrations/{tests/usageQuotas → functions/usageQuotas/tests}/syncApps.spec.js +4 -4
- package/src/migrations/{tests/usageQuotas → functions/usageQuotas/tests}/syncRows.spec.js +4 -4
- package/src/migrations/functions/userEmailViewCasing.ts +13 -0
- package/src/migrations/index.ts +56 -0
- package/src/tests/utilities/TestConfiguration.js +4 -0
- package/src/utilities/rowProcessor/index.js +24 -12
- package/src/utilities/rowProcessor/utils.js +23 -7
- package/coverage/lcov-report/migrations/usageQuotas/index.html +0 -141
- package/coverage/lcov-report/migrations/usageQuotas/syncRows.js.html +0 -143
- package/src/migrations/usageQuotas/index.js +0 -24
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const { getGlobalDB, getTenantId } = require("@budibase/backend-core/tenancy")
|
|
2
2
|
const { getAllApps } = require("@budibase/backend-core/db")
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import CouchDB from "../../../db"
|
|
4
|
+
import { getUsageQuotaDoc } from "../../../utilities/usageQuota"
|
|
5
|
+
import { getUniqueRows } from "../../../utilities/usageQuota/rows"
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
export const run = async () => {
|
|
8
8
|
const db = getGlobalDB()
|
|
9
9
|
// get all rows in all apps
|
|
10
10
|
const allApps = await getAllApps(CouchDB, { all: true })
|
|
11
|
-
const appIds = allApps ? allApps.map(app => app.appId) : []
|
|
11
|
+
const appIds = allApps ? allApps.map((app: { appId: any }) => app.appId) : []
|
|
12
12
|
const rows = await getUniqueRows(appIds)
|
|
13
13
|
const rowCount = rows ? rows.length : 0
|
|
14
14
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { getGlobalDB } = require("@budibase/backend-core/tenancy")
|
|
2
|
-
const TestConfig = require("
|
|
3
|
-
const { getUsageQuotaDoc, update, Properties } = require("
|
|
4
|
-
const syncApps = require("
|
|
5
|
-
const env = require("
|
|
2
|
+
const TestConfig = require("../../../../tests/utilities/TestConfiguration")
|
|
3
|
+
const { getUsageQuotaDoc, update, Properties } = require("../../../../utilities/usageQuota")
|
|
4
|
+
const syncApps = require("../syncApps")
|
|
5
|
+
const env = require("../../../../environment")
|
|
6
6
|
|
|
7
7
|
describe("syncApps", () => {
|
|
8
8
|
let config = new TestConfig(false)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { getGlobalDB } = require("@budibase/backend-core/tenancy")
|
|
2
|
-
const TestConfig = require("
|
|
3
|
-
const { getUsageQuotaDoc, update, Properties } = require("
|
|
4
|
-
const syncRows = require("
|
|
5
|
-
const env = require("
|
|
2
|
+
const TestConfig = require("../../../../tests/utilities/TestConfiguration")
|
|
3
|
+
const { getUsageQuotaDoc, update, Properties } = require("../../../../utilities/usageQuota")
|
|
4
|
+
const syncRows = require("../syncRows")
|
|
5
|
+
const env = require("../../../../environment")
|
|
6
6
|
|
|
7
7
|
describe("syncRows", () => {
|
|
8
8
|
let config = new TestConfig(false)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { createUserEmailView } = require("@budibase/backend-core/db")
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Date:
|
|
5
|
+
* October 2021
|
|
6
|
+
*
|
|
7
|
+
* Description:
|
|
8
|
+
* Recreate the user email view to include latest changes i.e. lower casing the email address
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const run = async (db: any) => {
|
|
12
|
+
await createUserEmailView(db)
|
|
13
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import CouchDB from "../db"
|
|
2
|
+
const {
|
|
3
|
+
MIGRATION_TYPES,
|
|
4
|
+
runMigrations,
|
|
5
|
+
} = require("@budibase/backend-core/migrations")
|
|
6
|
+
|
|
7
|
+
// migration functions
|
|
8
|
+
import * as userEmailViewCasing from "./functions/userEmailViewCasing"
|
|
9
|
+
import * as quota1 from "./functions/quotas1"
|
|
10
|
+
import * as appUrls from "./functions/appUrls"
|
|
11
|
+
|
|
12
|
+
export interface Migration {
|
|
13
|
+
type: string
|
|
14
|
+
name: string
|
|
15
|
+
opts?: object
|
|
16
|
+
fn: Function
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* e.g.
|
|
21
|
+
* {
|
|
22
|
+
* tenantIds: ['bb'],
|
|
23
|
+
* force: {
|
|
24
|
+
* global: ['quota_1']
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
export interface MigrationOptions {
|
|
29
|
+
tenantIds?: string[]
|
|
30
|
+
forced?: {
|
|
31
|
+
[type: string]: string[]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const MIGRATIONS: Migration[] = [
|
|
36
|
+
{
|
|
37
|
+
type: MIGRATION_TYPES.GLOBAL,
|
|
38
|
+
name: "user_email_view_casing",
|
|
39
|
+
fn: userEmailViewCasing.run,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: MIGRATION_TYPES.GLOBAL,
|
|
43
|
+
name: "quotas_1",
|
|
44
|
+
fn: quota1.run,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: MIGRATION_TYPES.APP,
|
|
48
|
+
name: "app_urls",
|
|
49
|
+
opts: { all: true },
|
|
50
|
+
fn: appUrls.run,
|
|
51
|
+
},
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
export const migrate = async (options?: MigrationOptions) => {
|
|
55
|
+
await runMigrations(CouchDB, MIGRATIONS, options)
|
|
56
|
+
}
|
|
@@ -180,6 +180,8 @@ function processAutoColumn(
|
|
|
180
180
|
}
|
|
181
181
|
exports.processAutoColumn = processAutoColumn
|
|
182
182
|
|
|
183
|
+
exports.processFormulas = processFormulas
|
|
184
|
+
|
|
183
185
|
/**
|
|
184
186
|
* This will coerce a value to the correct types based on the type transform map
|
|
185
187
|
* @param {object} row The value to coerce
|
|
@@ -229,11 +231,12 @@ exports.inputProcessing = (
|
|
|
229
231
|
}
|
|
230
232
|
continue
|
|
231
233
|
}
|
|
232
|
-
//
|
|
233
|
-
// type coercion cannot completely remove the field, so have to do it here
|
|
234
|
+
// remove any formula values, they are to be generated
|
|
234
235
|
if (field.type === FieldTypes.FORMULA) {
|
|
235
236
|
delete clonedRow[key]
|
|
236
|
-
}
|
|
237
|
+
}
|
|
238
|
+
// otherwise coerce what is there to correct types
|
|
239
|
+
else {
|
|
237
240
|
clonedRow[key] = exports.coerce(value, field.type)
|
|
238
241
|
}
|
|
239
242
|
}
|
|
@@ -250,7 +253,7 @@ exports.inputProcessing = (
|
|
|
250
253
|
/**
|
|
251
254
|
* This function enriches the input rows with anything they are supposed to contain, for example
|
|
252
255
|
* link records or attachment links.
|
|
253
|
-
* @param {
|
|
256
|
+
* @param {string} appId the app in which the request is looking for enriched rows.
|
|
254
257
|
* @param {object} table the table from which these rows came from originally, this is used to determine
|
|
255
258
|
* the schema of the rows and then enrich.
|
|
256
259
|
* @param {object[]|object} rows the rows which are to be enriched.
|
|
@@ -258,22 +261,21 @@ exports.inputProcessing = (
|
|
|
258
261
|
* @returns {object[]|object} the enriched rows will be returned.
|
|
259
262
|
*/
|
|
260
263
|
exports.outputProcessing = async (
|
|
261
|
-
|
|
264
|
+
{ appId },
|
|
262
265
|
table,
|
|
263
266
|
rows,
|
|
264
267
|
opts = { squash: true }
|
|
265
268
|
) => {
|
|
266
|
-
const appId = ctx.appId
|
|
267
269
|
let wasArray = true
|
|
268
270
|
if (!(rows instanceof Array)) {
|
|
269
271
|
rows = [rows]
|
|
270
272
|
wasArray = false
|
|
271
273
|
}
|
|
272
274
|
// attach any linked row information
|
|
273
|
-
let enriched = await linkRows.attachFullLinkedDocs(
|
|
275
|
+
let enriched = await linkRows.attachFullLinkedDocs(appId, table, rows)
|
|
274
276
|
|
|
275
277
|
// process formulas
|
|
276
|
-
enriched = processFormulas(table, enriched)
|
|
278
|
+
enriched = processFormulas(table, enriched, { dynamic: true })
|
|
277
279
|
|
|
278
280
|
// update the attachments URL depending on hosting
|
|
279
281
|
for (let [property, column] of Object.entries(table.schema)) {
|
|
@@ -305,9 +307,15 @@ exports.outputProcessing = async (
|
|
|
305
307
|
* @param {any} row optional - the row being removed.
|
|
306
308
|
* @param {any} rows optional - if multiple rows being deleted can do this in bulk.
|
|
307
309
|
* @param {any} oldRow optional - if updating a row this will determine the difference.
|
|
310
|
+
* @param {any} oldTable optional - if updating a table, can supply the old table to look for
|
|
311
|
+
* deleted attachment columns.
|
|
308
312
|
* @return {Promise<void>} When all attachments have been removed this will return.
|
|
309
313
|
*/
|
|
310
|
-
exports.cleanupAttachments = async (
|
|
314
|
+
exports.cleanupAttachments = async (
|
|
315
|
+
appId,
|
|
316
|
+
table,
|
|
317
|
+
{ row, rows, oldRow, oldTable }
|
|
318
|
+
) => {
|
|
311
319
|
if (!isProdAppID(appId)) {
|
|
312
320
|
const prodAppId = getDeployedAppID(appId)
|
|
313
321
|
// if prod exists, then don't allow deleting
|
|
@@ -322,12 +330,16 @@ exports.cleanupAttachments = async (appId, table, { row, rows, oldRow }) => {
|
|
|
322
330
|
files = files.concat(row[key].map(attachment => attachment.key))
|
|
323
331
|
}
|
|
324
332
|
}
|
|
325
|
-
|
|
333
|
+
const schemaToUse = oldTable ? oldTable.schema : table.schema
|
|
334
|
+
for (let [key, schema] of Object.entries(schemaToUse)) {
|
|
326
335
|
if (schema.type !== FieldTypes.ATTACHMENT) {
|
|
327
336
|
continue
|
|
328
337
|
}
|
|
329
|
-
//
|
|
330
|
-
if (
|
|
338
|
+
// old table had this column, new table doesn't - delete it
|
|
339
|
+
if (oldTable && !table.schema[key]) {
|
|
340
|
+
rows.forEach(row => addFiles(row, key))
|
|
341
|
+
} else if (oldRow && row) {
|
|
342
|
+
// if updating, need to manage the differences
|
|
331
343
|
files = files.concat(getRemovedAttachmentKeys(oldRow, row, key))
|
|
332
344
|
} else if (row) {
|
|
333
345
|
addFiles(row, key)
|
|
@@ -1,23 +1,39 @@
|
|
|
1
|
-
const { FieldTypes } = require("../../constants")
|
|
1
|
+
const { FieldTypes, FormulaTypes } = require("../../constants")
|
|
2
2
|
const { processStringSync } = require("@budibase/string-templates")
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Looks through the rows provided and finds formulas - which it then processes.
|
|
6
6
|
*/
|
|
7
|
-
exports.processFormulas = (
|
|
7
|
+
exports.processFormulas = (
|
|
8
|
+
table,
|
|
9
|
+
rows,
|
|
10
|
+
{ dynamic, contextRows } = { dynamic: true }
|
|
11
|
+
) => {
|
|
8
12
|
const single = !Array.isArray(rows)
|
|
9
13
|
if (single) {
|
|
10
14
|
rows = [rows]
|
|
15
|
+
contextRows = contextRows ? [contextRows] : contextRows
|
|
11
16
|
}
|
|
12
17
|
for (let [column, schema] of Object.entries(table.schema)) {
|
|
13
|
-
|
|
18
|
+
const isStatic = schema.formulaType === FormulaTypes.STATIC
|
|
19
|
+
if (
|
|
20
|
+
schema.type !== FieldTypes.FORMULA ||
|
|
21
|
+
(dynamic && isStatic) ||
|
|
22
|
+
(!dynamic && !isStatic)
|
|
23
|
+
) {
|
|
14
24
|
continue
|
|
15
25
|
}
|
|
16
26
|
// iterate through rows and process formula
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
for (let i = 0; i < rows.length; i++) {
|
|
28
|
+
if (schema.formula) {
|
|
29
|
+
let row = rows[i]
|
|
30
|
+
let context = contextRows ? contextRows[i] : row
|
|
31
|
+
rows[i] = {
|
|
32
|
+
...row,
|
|
33
|
+
[column]: processStringSync(schema.formula, context),
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
21
37
|
}
|
|
22
38
|
return single ? rows[0] : rows
|
|
23
39
|
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for migrations/usageQuotas</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../index.html">All files</a> migrations/usageQuotas</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">100% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>40/40</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">62.5% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>5/8</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">100% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>5/5</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">100% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>39/39</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div class='status-line high'></div>
|
|
59
|
-
<div class="pad1">
|
|
60
|
-
<table class="coverage-summary">
|
|
61
|
-
<thead>
|
|
62
|
-
<tr>
|
|
63
|
-
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
64
|
-
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
65
|
-
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
66
|
-
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
67
|
-
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
68
|
-
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
69
|
-
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
70
|
-
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
71
|
-
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
72
|
-
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
-
</tr>
|
|
74
|
-
</thead>
|
|
75
|
-
<tbody><tr>
|
|
76
|
-
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
|
|
77
|
-
<td data-value="100" class="pic high">
|
|
78
|
-
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
79
|
-
</td>
|
|
80
|
-
<td data-value="100" class="pct high">100%</td>
|
|
81
|
-
<td data-value="10" class="abs high">10/10</td>
|
|
82
|
-
<td data-value="100" class="pct high">100%</td>
|
|
83
|
-
<td data-value="2" class="abs high">2/2</td>
|
|
84
|
-
<td data-value="100" class="pct high">100%</td>
|
|
85
|
-
<td data-value="2" class="abs high">2/2</td>
|
|
86
|
-
<td data-value="100" class="pct high">100%</td>
|
|
87
|
-
<td data-value="10" class="abs high">10/10</td>
|
|
88
|
-
</tr>
|
|
89
|
-
|
|
90
|
-
<tr>
|
|
91
|
-
<td class="file high" data-value="syncApps.js"><a href="syncApps.js.html">syncApps.js</a></td>
|
|
92
|
-
<td data-value="100" class="pic high">
|
|
93
|
-
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
94
|
-
</td>
|
|
95
|
-
<td data-value="100" class="pct high">100%</td>
|
|
96
|
-
<td data-value="13" class="abs high">13/13</td>
|
|
97
|
-
<td data-value="50" class="pct medium">50%</td>
|
|
98
|
-
<td data-value="2" class="abs medium">1/2</td>
|
|
99
|
-
<td data-value="100" class="pct high">100%</td>
|
|
100
|
-
<td data-value="1" class="abs high">1/1</td>
|
|
101
|
-
<td data-value="100" class="pct high">100%</td>
|
|
102
|
-
<td data-value="13" class="abs high">13/13</td>
|
|
103
|
-
</tr>
|
|
104
|
-
|
|
105
|
-
<tr>
|
|
106
|
-
<td class="file high" data-value="syncRows.js"><a href="syncRows.js.html">syncRows.js</a></td>
|
|
107
|
-
<td data-value="100" class="pic high">
|
|
108
|
-
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
109
|
-
</td>
|
|
110
|
-
<td data-value="100" class="pct high">100%</td>
|
|
111
|
-
<td data-value="17" class="abs high">17/17</td>
|
|
112
|
-
<td data-value="50" class="pct medium">50%</td>
|
|
113
|
-
<td data-value="4" class="abs medium">2/4</td>
|
|
114
|
-
<td data-value="100" class="pct high">100%</td>
|
|
115
|
-
<td data-value="2" class="abs high">2/2</td>
|
|
116
|
-
<td data-value="100" class="pct high">100%</td>
|
|
117
|
-
<td data-value="16" class="abs high">16/16</td>
|
|
118
|
-
</tr>
|
|
119
|
-
|
|
120
|
-
</tbody>
|
|
121
|
-
</table>
|
|
122
|
-
</div>
|
|
123
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
124
|
-
</div><!-- /wrapper -->
|
|
125
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
126
|
-
Code coverage generated by
|
|
127
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
128
|
-
at Mon Jan 31 2022 14:38:52 GMT+0000 (Coordinated Universal Time)
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
<script src="../../prettify.js"></script>
|
|
132
|
-
<script>
|
|
133
|
-
window.onload = function () {
|
|
134
|
-
prettyPrint();
|
|
135
|
-
};
|
|
136
|
-
</script>
|
|
137
|
-
<script src="../../sorter.js"></script>
|
|
138
|
-
<script src="../../block-navigation.js"></script>
|
|
139
|
-
</body>
|
|
140
|
-
</html>
|
|
141
|
-
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for migrations/usageQuotas/syncRows.js</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../index.html">All files</a> / <a href="index.html">migrations/usageQuotas</a> syncRows.js</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">100% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>17/17</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">50% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>2/4</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">100% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>2/2</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">100% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>16/16</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div class='status-line high'></div>
|
|
59
|
-
<pre><table class="coverage">
|
|
60
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
62
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
63
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
64
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
65
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
66
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
67
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
68
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
69
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
70
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
71
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
72
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
73
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
74
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
75
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
76
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
77
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
78
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
79
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
80
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
81
|
-
<a name='L22'></a><a href='#L22'>22</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">25x</span>
|
|
82
|
-
<span class="cline-any cline-yes">25x</span>
|
|
83
|
-
<span class="cline-any cline-yes">25x</span>
|
|
84
|
-
<span class="cline-any cline-yes">25x</span>
|
|
85
|
-
<span class="cline-any cline-yes">25x</span>
|
|
86
|
-
<span class="cline-any cline-neutral"> </span>
|
|
87
|
-
<span class="cline-any cline-yes">25x</span>
|
|
88
|
-
<span class="cline-any cline-yes">1x</span>
|
|
89
|
-
<span class="cline-any cline-neutral"> </span>
|
|
90
|
-
<span class="cline-any cline-yes">1x</span>
|
|
91
|
-
<span class="cline-any cline-yes">4x</span>
|
|
92
|
-
<span class="cline-any cline-yes">1x</span>
|
|
93
|
-
<span class="cline-any cline-yes">1x</span>
|
|
94
|
-
<span class="cline-any cline-neutral"> </span>
|
|
95
|
-
<span class="cline-any cline-neutral"> </span>
|
|
96
|
-
<span class="cline-any cline-yes">1x</span>
|
|
97
|
-
<span class="cline-any cline-yes">1x</span>
|
|
98
|
-
<span class="cline-any cline-yes">1x</span>
|
|
99
|
-
<span class="cline-any cline-yes">1x</span>
|
|
100
|
-
<span class="cline-any cline-yes">1x</span>
|
|
101
|
-
<span class="cline-any cline-neutral"> </span>
|
|
102
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const { getGlobalDB, getTenantId } = require("@budibase/backend-core/tenancy")
|
|
103
|
-
const { getAllApps } = require("@budibase/backend-core/db")
|
|
104
|
-
const CouchDB = require("../../db")
|
|
105
|
-
const { getUsageQuotaDoc } = require("../../utilities/usageQuota")
|
|
106
|
-
const { getUniqueRows } = require("../../utilities/usageQuota/rows")
|
|
107
|
-
|
|
108
|
-
exports.run = async () => {
|
|
109
|
-
const db = getGlobalDB()
|
|
110
|
-
// get all rows in all apps
|
|
111
|
-
const allApps = await getAllApps(CouchDB, { all: true })
|
|
112
|
-
const appIds = allApps ? allApps.map(app => app.appId) : <span class="branch-1 cbranch-no" title="branch not covered" >[]</span>
|
|
113
|
-
const rows = await getUniqueRows(appIds)
|
|
114
|
-
const rowCount = rows ? rows.length : <span class="branch-1 cbranch-no" title="branch not covered" >0</span>
|
|
115
|
-
|
|
116
|
-
// sync row count
|
|
117
|
-
const tenantId = getTenantId()
|
|
118
|
-
console.log(`[Tenant: ${tenantId}] Syncing row count: ${rowCount}`)
|
|
119
|
-
const usageDoc = await getUsageQuotaDoc(db)
|
|
120
|
-
usageDoc.usageQuota.rows = rowCount
|
|
121
|
-
await db.put(usageDoc)
|
|
122
|
-
}
|
|
123
|
-
</pre></td></tr></table></pre>
|
|
124
|
-
|
|
125
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
126
|
-
</div><!-- /wrapper -->
|
|
127
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
128
|
-
Code coverage generated by
|
|
129
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
130
|
-
at Mon Jan 31 2022 14:38:52 GMT+0000 (Coordinated Universal Time)
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
<script src="../../prettify.js"></script>
|
|
134
|
-
<script>
|
|
135
|
-
window.onload = function () {
|
|
136
|
-
prettyPrint();
|
|
137
|
-
};
|
|
138
|
-
</script>
|
|
139
|
-
<script src="../../sorter.js"></script>
|
|
140
|
-
<script src="../../block-navigation.js"></script>
|
|
141
|
-
</body>
|
|
142
|
-
</html>
|
|
143
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
MIGRATIONS,
|
|
3
|
-
MIGRATION_DBS,
|
|
4
|
-
migrateIfRequired,
|
|
5
|
-
} = require("@budibase/backend-core/migrations")
|
|
6
|
-
const { useQuotas } = require("../../utilities/usageQuota")
|
|
7
|
-
const syncApps = require("./syncApps")
|
|
8
|
-
const syncRows = require("./syncRows")
|
|
9
|
-
|
|
10
|
-
exports.run = async () => {
|
|
11
|
-
if (!useQuotas()) {
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Jan 2022
|
|
16
|
-
await migrateIfRequired(
|
|
17
|
-
MIGRATION_DBS.GLOBAL_DB,
|
|
18
|
-
MIGRATIONS.QUOTAS_1,
|
|
19
|
-
async () => {
|
|
20
|
-
await syncApps.run()
|
|
21
|
-
await syncRows.run()
|
|
22
|
-
}
|
|
23
|
-
)
|
|
24
|
-
}
|