@budibase/server 1.0.115 → 1.0.118
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.dae9f8cf.js → index.b1f26359.js} +2 -2
- package/builder/index.html +1 -1
- package/coverage/clover.xml +1113 -1125
- package/coverage/coverage-final.json +85 -86
- 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 +126 -120
- 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 +23 -14
- package/coverage/lcov-report/api/controllers/index.html +17 -17
- 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/api/controllers/migrations.js.html +1 -1
- 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 +1 -1
- 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 +19 -19
- package/coverage/lcov-report/api/controllers/row/index.html +10 -10
- package/coverage/lcov-report/api/controllers/row/index.js.html +14 -14
- package/coverage/lcov-report/api/controllers/row/internal.js.html +37 -34
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +9 -9
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +10 -10
- package/coverage/lcov-report/api/controllers/row/utils.js.html +12 -12
- 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 +9 -9
- package/coverage/lcov-report/api/controllers/table/external.js.html +12 -12
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +14 -14
- package/coverage/lcov-report/api/controllers/table/internal.js.html +13 -13
- package/coverage/lcov-report/api/controllers/table/utils.js.html +30 -30
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +19 -19
- 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 +12 -12
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +7 -7
- package/coverage/lcov-report/api/controllers/webhook.js.html +17 -17
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/api/routes/index.js.html +1 -1
- 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/api/routes/migrations.js.html +1 -1
- 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/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.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 +5 -5
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +7 -7
- 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 +43 -40
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +27 -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/inMemoryView.js.html +52 -49
- package/coverage/lcov-report/db/index.html +21 -36
- package/coverage/lcov-report/db/index.js.html +49 -10
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +7 -7
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +18 -18
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +13 -13
- package/coverage/lcov-report/db/newid.js.html +2 -2
- package/coverage/lcov-report/db/utils.js.html +13 -13
- 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 +46 -46
- 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 +15 -12
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +4 -4
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- 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 +1 -1
- 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 +10 -10
- 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 +19 -22
- 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 +15 -15
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +26 -26
- 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 +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +18 -18
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +4 -4
- 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 +13 -13
- package/coverage/lcov-report/utilities/usageQuota/index.js.html +8 -8
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +38 -26
- 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 +28 -28
- package/coverage/lcov.info +1392 -1404
- package/dist/api/controllers/application.js +4 -1
- package/dist/api/controllers/deploy/index.js +5 -1
- package/dist/api/controllers/dev.js +9 -5
- package/dist/api/controllers/row/ExternalRequest.js +18 -7
- package/dist/api/controllers/row/internal.js +2 -1
- package/dist/api/controllers/webhook.js +2 -2
- package/dist/api/routes/tests/utilities/TestFunctions.js +1 -4
- package/dist/app.js +5 -2
- package/dist/automations/utils.js +6 -5
- package/dist/db/inMemoryView.js +33 -31
- package/dist/db/index.js +13 -2
- package/dist/integrations/couchdb.js +19 -25
- package/dist/integrations/mysql.js +13 -0
- package/dist/middleware/builder.js +10 -9
- package/dist/migrations/index.js +1 -5
- package/dist/package.json +5 -5
- package/dist/tests/utilities/TestConfiguration.js +66 -59
- package/dist/threads/utils.js +2 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/index.js +27 -26
- package/dist/utilities/usageQuota/rows.js +16 -16
- package/package.json +6 -6
- package/scripts/exportAppTemplate.js +10 -8
- package/src/api/controllers/application.js +3 -1
- package/src/api/controllers/deploy/index.js +4 -4
- package/src/api/controllers/dev.js +9 -6
- package/src/api/controllers/query/import/tests/index.spec.js +7 -11
- package/src/api/controllers/row/ExternalRequest.ts +25 -7
- package/src/api/controllers/row/internal.js +2 -1
- package/src/api/controllers/webhook.js +2 -2
- package/src/api/routes/tests/row.spec.js +15 -11
- package/src/api/routes/tests/table.spec.js +3 -2
- package/src/api/routes/tests/utilities/TestFunctions.js +1 -5
- package/src/app.ts +2 -2
- package/src/automations/tests/deleteRow.spec.js +1 -1
- package/src/automations/utils.js +6 -5
- package/src/db/inMemoryView.js +37 -36
- package/src/db/index.js +15 -2
- package/src/db/tests/linkTests.spec.js +8 -7
- package/src/integrations/couchdb.ts +28 -24
- package/src/integrations/mysql.ts +17 -1
- package/src/integrations/tests/airtable.spec.js +3 -1
- package/src/integrations/tests/couchdb.spec.js +4 -1
- package/src/middleware/builder.js +10 -9
- package/src/middleware/tests/authorized.spec.js +0 -1
- package/src/middleware/tests/usageQuota.spec.js +6 -20
- package/src/migrations/functions/tests/appUrls.spec.js +8 -11
- package/src/migrations/functions/tests/userEmailViewCasing.spec.js +13 -10
- package/src/migrations/functions/usageQuotas/tests/syncApps.spec.js +25 -21
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.js +26 -24
- package/src/migrations/index.ts +1 -2
- package/src/module.d.ts +8 -0
- package/src/tests/utilities/TestConfiguration.js +62 -55
- package/src/threads/utils.js +2 -3
- package/src/utilities/fileSystem/index.js +30 -30
- package/src/utilities/usageQuota/rows.js +22 -18
- package/coverage/lcov-report/db/client.js.html +0 -173
- package/dist/db/client.js +0 -25
- package/scripts/replicateApp.js +0 -50
- package/src/db/client.js +0 -31
|
@@ -8,9 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
const CouchDB = require("../../db");
|
|
13
|
-
core.init(CouchDB);
|
|
11
|
+
require("../../db").init();
|
|
14
12
|
const { BUILTIN_ROLE_IDS } = require("@budibase/backend-core/roles");
|
|
15
13
|
const env = require("../../environment");
|
|
16
14
|
const { basicTable, basicRow, basicRole, basicAutomation, basicDatasource, basicQuery, basicScreen, basicLayout, basicWebhook, TENANT_ID, } = require("./structures");
|
|
@@ -19,7 +17,7 @@ const supertest = require("supertest");
|
|
|
19
17
|
const { cleanup } = require("../../utilities/fileSystem");
|
|
20
18
|
const { Cookies, Headers } = require("@budibase/backend-core/constants");
|
|
21
19
|
const { jwt } = require("@budibase/backend-core/auth");
|
|
22
|
-
const {
|
|
20
|
+
const { doInTenant, doWithGlobalDB } = require("@budibase/backend-core/tenancy");
|
|
23
21
|
const { createASession } = require("@budibase/backend-core/sessions");
|
|
24
22
|
const { user: userCache } = require("@budibase/backend-core/cache");
|
|
25
23
|
const newid = require("../../db/newid");
|
|
@@ -50,8 +48,23 @@ class TestConfiguration {
|
|
|
50
48
|
getAppId() {
|
|
51
49
|
return this.appId;
|
|
52
50
|
}
|
|
53
|
-
|
|
54
|
-
return
|
|
51
|
+
doInContext(appId, task) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
if (!appId) {
|
|
54
|
+
appId = this.appId;
|
|
55
|
+
}
|
|
56
|
+
return doInTenant(TENANT_ID, () => {
|
|
57
|
+
// check if already in a context
|
|
58
|
+
if (context.getAppId() == null && appId !== null) {
|
|
59
|
+
return context.doInAppContext(appId, () => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return task();
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return task();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
55
68
|
}
|
|
56
69
|
_req(config, params, controlFunc) {
|
|
57
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -65,66 +78,57 @@ class TestConfiguration {
|
|
|
65
78
|
request.request = {
|
|
66
79
|
body: config,
|
|
67
80
|
};
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
// check if already in a context
|
|
78
|
-
if (context.getAppId() == null && this.appId !== null) {
|
|
79
|
-
return context.doInAppContext(this.appId, () => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
return run();
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
return run();
|
|
85
|
-
}
|
|
81
|
+
return this.doInContext(this.appId, () => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
if (params) {
|
|
83
|
+
request.params = params;
|
|
84
|
+
}
|
|
85
|
+
yield controlFunc(request);
|
|
86
|
+
return request.body;
|
|
87
|
+
}));
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
90
|
generateApiKey(userId = GLOBAL_USER_ID) {
|
|
89
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
return doWithGlobalDB(TENANT_ID, (db) => __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const id = generateDevInfoID(userId);
|
|
94
|
+
let devInfo;
|
|
95
|
+
try {
|
|
96
|
+
devInfo = yield db.get(id);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
devInfo = { _id: id, userId };
|
|
100
|
+
}
|
|
101
|
+
devInfo.apiKey = encrypt(`${TENANT_ID}${SEPARATOR}${newid()}`);
|
|
102
|
+
yield db.put(devInfo);
|
|
103
|
+
return devInfo.apiKey;
|
|
104
|
+
}));
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
107
|
globalUser({ id = GLOBAL_USER_ID, builder = true, email = EMAIL, roles, } = {}) {
|
|
105
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
109
|
+
return doWithGlobalDB(TENANT_ID, (db) => __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
let existing;
|
|
111
|
+
try {
|
|
112
|
+
existing = yield db.get(id);
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
existing = { email };
|
|
116
|
+
}
|
|
117
|
+
const user = Object.assign(Object.assign({ _id: id }, existing), { roles: roles || {}, tenantId: TENANT_ID });
|
|
118
|
+
yield createASession(id, {
|
|
119
|
+
sessionId: "sessionid",
|
|
120
|
+
tenantId: TENANT_ID,
|
|
121
|
+
csrfToken: CSRF_TOKEN,
|
|
122
|
+
});
|
|
123
|
+
if (builder) {
|
|
124
|
+
user.builder = { global: true };
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
user.builder = { global: false };
|
|
128
|
+
}
|
|
129
|
+
const resp = yield db.put(user);
|
|
130
|
+
return Object.assign({ _rev: resp._rev }, user);
|
|
131
|
+
}));
|
|
128
132
|
});
|
|
129
133
|
}
|
|
130
134
|
// use a new id as the name to avoid name collisions
|
|
@@ -182,9 +186,12 @@ class TestConfiguration {
|
|
|
182
186
|
createApp(appName) {
|
|
183
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
188
|
// create dev app
|
|
189
|
+
// clear any old app
|
|
190
|
+
this.appId = null;
|
|
191
|
+
yield context.updateAppId(null);
|
|
185
192
|
this.app = yield this._req({ name: appName }, null, controllers.app.create);
|
|
186
193
|
this.appId = this.app.appId;
|
|
187
|
-
context.updateAppId(this.appId);
|
|
194
|
+
yield context.updateAppId(this.appId);
|
|
188
195
|
// create production app
|
|
189
196
|
this.prodApp = yield this.deploy();
|
|
190
197
|
this.prodAppId = this.prodApp.appId;
|
package/dist/threads/utils.js
CHANGED
|
@@ -9,8 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
const env = require("../environment");
|
|
12
|
-
const
|
|
13
|
-
const { init } = require("@budibase/backend-core");
|
|
12
|
+
const db = require("../db");
|
|
14
13
|
const redis = require("@budibase/backend-core/redis");
|
|
15
14
|
const { SEPARATOR } = require("@budibase/backend-core/db");
|
|
16
15
|
const VARIABLE_TTL_SECONDS = 3600;
|
|
@@ -34,7 +33,7 @@ exports.threadSetup = () => {
|
|
|
34
33
|
}
|
|
35
34
|
// when thread starts, make sure it is recorded
|
|
36
35
|
env.setInThread();
|
|
37
|
-
init(
|
|
36
|
+
db.init();
|
|
38
37
|
};
|
|
39
38
|
function makeVariableKey(queryId, variable) {
|
|
40
39
|
return `${queryId}${SEPARATOR}${variable}`;
|