@budibase/server 2.4.42-alpha.3 → 2.4.42
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/__mocks__/node-fetch.ts +1 -6
- package/builder/assets/favicon.e7fc7733.png +0 -0
- package/builder/assets/{index.7fec1a6d.js → index.3d64bc07.js} +384 -384
- package/builder/assets/index.b0e3aca6.css +6 -0
- package/builder/index.html +7 -7
- package/dist/api/controllers/application.js +24 -28
- package/dist/api/controllers/row/external.js +0 -15
- package/dist/api/controllers/row/utils.js +3 -4
- package/dist/api/controllers/static/index.js +24 -84
- package/dist/api/controllers/static/templates/BudibaseApp.svelte +10 -33
- package/dist/api/controllers/table/utils.js +1 -0
- package/dist/api/routes/public/index.js +0 -8
- package/dist/app.js +0 -1
- package/dist/integrations/redis.js +1 -1
- package/dist/package.json +12 -13
- package/dist/sdk/users/utils.js +1 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/global.js +7 -17
- package/jest.config.ts +0 -1
- package/package.json +13 -14
- package/scripts/test.sh +3 -3
- package/specs/openapi.json +0 -39
- package/specs/openapi.yaml +0 -169
- package/specs/resources/application.ts +0 -11
- package/specs/resources/index.ts +0 -2
- package/src/api/controllers/application.ts +21 -20
- package/src/api/controllers/row/external.ts +0 -14
- package/src/api/controllers/row/utils.ts +3 -4
- package/src/api/controllers/static/index.ts +26 -69
- package/src/api/controllers/static/templates/BudibaseApp.svelte +10 -33
- package/src/api/controllers/table/utils.ts +1 -0
- package/src/api/controllers/view/tests/__snapshots__/viewBuilder.spec.js.snap +48 -48
- package/src/api/routes/public/index.ts +1 -10
- package/src/api/routes/tests/__snapshots__/datasource.spec.ts.snap +22 -22
- package/src/api/routes/tests/__snapshots__/view.spec.js.snap +5 -5
- package/src/api/routes/tests/internalSearch.spec.js +7 -8
- package/src/app.ts +1 -2
- package/src/automations/automationUtils.ts +1 -1
- package/src/automations/tests/automation.spec.js +84 -0
- package/src/definitions/openapi.ts +0 -15
- package/src/integration-test/postgres.spec.ts +52 -46
- package/src/integrations/redis.ts +1 -1
- package/src/integrations/tests/googlesheets.spec.ts +13 -13
- package/src/integrations/tests/redis.spec.ts +5 -9
- package/src/middleware/currentapp.ts +2 -2
- package/src/sdk/users/utils.ts +1 -4
- package/src/tests/jestEnv.ts +0 -1
- package/src/tests/jestSetup.ts +1 -5
- package/src/tests/utilities/TestConfiguration.ts +0 -13
- package/src/tests/utilities/structures.ts +1 -13
- package/src/utilities/global.ts +9 -21
- package/builder/assets/index.3cb1022d.css +0 -6
- package/dist/api/controllers/public/metrics.js +0 -113
- package/dist/api/routes/public/metrics.js +0 -30
- package/specs/resources/metrics.ts +0 -81
- package/src/api/controllers/public/metrics.ts +0 -251
- package/src/api/routes/public/metrics.ts +0 -28
- package/src/api/routes/public/tests/metrics.spec.js +0 -34
- package/src/api/routes/tests/appSync.spec.ts +0 -31
- package/src/automations/tests/automation.spec.ts +0 -99
package/builder/index.html
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html class="spectrum spectrum--medium spectrum--darkest" lang="en" dir="ltr">
|
|
3
|
-
|
|
4
3
|
<head>
|
|
5
4
|
<meta charset='utf8'>
|
|
6
5
|
<meta name='viewport' content='width=device-width'>
|
|
7
6
|
<title>Budibase</title>
|
|
7
|
+
<link rel='icon' href='/builder/assets/favicon.e7fc7733.png'>
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
9
|
-
<link
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
|
11
|
+
rel="stylesheet"
|
|
12
|
+
/>
|
|
13
|
+
<script type="module" crossorigin src="/builder/assets/index.3d64bc07.js"></script>
|
|
14
|
+
<link rel="stylesheet" href="/builder/assets/index.b0e3aca6.css">
|
|
13
15
|
</head>
|
|
14
|
-
|
|
15
16
|
<body id="app">
|
|
16
17
|
|
|
17
18
|
</body>
|
|
18
|
-
|
|
19
19
|
</html>
|
|
@@ -320,7 +320,7 @@ function appPostCreate(ctx, app) {
|
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
catch (err) {
|
|
323
|
-
if (err.code && err.code === backend_core_1.
|
|
323
|
+
if (err.code && err.code === backend_core_1.errors.codes.USAGE_LIMIT_EXCEEDED) {
|
|
324
324
|
// this import resulted in row usage exceeding the quota
|
|
325
325
|
// delete the app
|
|
326
326
|
// skip pre and post-steps as no rows have been added to quotas yet
|
|
@@ -415,19 +415,17 @@ function revertClient(ctx) {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
exports.revertClient = revertClient;
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
});
|
|
430
|
-
}
|
|
418
|
+
const unpublishApp = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
419
|
+
let appId = ctx.params.appId;
|
|
420
|
+
appId = backend_core_1.db.getProdAppID(appId);
|
|
421
|
+
const db = backend_core_1.context.getProdAppDB();
|
|
422
|
+
const result = yield db.destroy();
|
|
423
|
+
yield backend_core_1.events.app.unpublished({ appId });
|
|
424
|
+
// automations only in production
|
|
425
|
+
yield (0, utils_2.cleanupAutomations)(appId);
|
|
426
|
+
yield backend_core_1.cache.app.invalidateAppMetadata(appId);
|
|
427
|
+
return result;
|
|
428
|
+
});
|
|
431
429
|
function destroyApp(ctx) {
|
|
432
430
|
return __awaiter(this, void 0, void 0, function* () {
|
|
433
431
|
let appId = ctx.params.appId;
|
|
@@ -478,20 +476,18 @@ function destroy(ctx) {
|
|
|
478
476
|
});
|
|
479
477
|
}
|
|
480
478
|
exports.destroy = destroy;
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
});
|
|
494
|
-
}
|
|
479
|
+
const unpublish = (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
480
|
+
const prodAppId = backend_core_1.db.getProdAppID(ctx.params.appId);
|
|
481
|
+
const dbExists = yield backend_core_1.db.dbExists(prodAppId);
|
|
482
|
+
// check app has been published
|
|
483
|
+
if (!dbExists) {
|
|
484
|
+
return ctx.throw(400, "App has not been published.");
|
|
485
|
+
}
|
|
486
|
+
yield preDestroyApp(ctx);
|
|
487
|
+
yield unpublishApp(ctx);
|
|
488
|
+
yield postDestroyApp(ctx);
|
|
489
|
+
ctx.status = 204;
|
|
490
|
+
});
|
|
495
491
|
exports.unpublish = unpublish;
|
|
496
492
|
function sync(ctx) {
|
|
497
493
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -54,7 +54,6 @@ const exporters = __importStar(require("../view/exporters"));
|
|
|
54
54
|
const fileSystem_1 = require("../../../utilities/fileSystem");
|
|
55
55
|
const types_1 = require("@budibase/types");
|
|
56
56
|
const sdk_1 = __importDefault(require("../../../sdk"));
|
|
57
|
-
const utils = __importStar(require("./utils"));
|
|
58
57
|
const { cleanExportRows } = require("./utils");
|
|
59
58
|
function handleRequest(operation, tableId, opts) {
|
|
60
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -84,13 +83,6 @@ function patch(ctx) {
|
|
|
84
83
|
const id = inputs._id;
|
|
85
84
|
// don't save the ID to db
|
|
86
85
|
delete inputs._id;
|
|
87
|
-
const validateResult = yield utils.validate({
|
|
88
|
-
row: inputs,
|
|
89
|
-
tableId,
|
|
90
|
-
});
|
|
91
|
-
if (!validateResult.valid) {
|
|
92
|
-
throw { validation: validateResult.errors };
|
|
93
|
-
}
|
|
94
86
|
return handleRequest(types_1.Operation.UPDATE, tableId, {
|
|
95
87
|
id: (0, utils_1.breakRowIdField)(id),
|
|
96
88
|
row: inputs,
|
|
@@ -103,13 +95,6 @@ function save(ctx) {
|
|
|
103
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
96
|
const inputs = ctx.request.body;
|
|
105
97
|
const tableId = ctx.params.tableId;
|
|
106
|
-
const validateResult = yield utils.validate({
|
|
107
|
-
row: inputs,
|
|
108
|
-
tableId,
|
|
109
|
-
});
|
|
110
|
-
if (!validateResult.valid) {
|
|
111
|
-
throw { validation: validateResult.errors };
|
|
112
|
-
}
|
|
113
98
|
return handleRequest(types_1.Operation.CREATE, tableId, {
|
|
114
99
|
row: inputs,
|
|
115
100
|
includeSqlRelationships: types_1.IncludeRelationship.EXCLUDE,
|
|
@@ -95,11 +95,10 @@ function validate({ tableId, row, table, }) {
|
|
|
95
95
|
}
|
|
96
96
|
const errors = {};
|
|
97
97
|
for (let fieldName of Object.keys(fetchedTable.schema)) {
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
const type = column.type;
|
|
98
|
+
const constraints = cloneDeep(fetchedTable.schema[fieldName].constraints);
|
|
99
|
+
const type = fetchedTable.schema[fieldName].type;
|
|
101
100
|
// formulas shouldn't validated, data will be deleted anyway
|
|
102
|
-
if (type === constants_1.FieldTypes.FORMULA
|
|
101
|
+
if (type === constants_1.FieldTypes.FORMULA) {
|
|
103
102
|
continue;
|
|
104
103
|
}
|
|
105
104
|
// special case for options, need to always allow unselected (null)
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -48,7 +25,6 @@ const backend_core_1 = require("@budibase/backend-core");
|
|
|
48
25
|
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
49
26
|
const fs_1 = __importDefault(require("fs"));
|
|
50
27
|
const sdk_1 = __importDefault(require("../../../sdk"));
|
|
51
|
-
const pro = __importStar(require("@budibase/pro"));
|
|
52
28
|
const send = require("koa-send");
|
|
53
29
|
function prepareUpload({ s3Key, bucket, metadata, file }) {
|
|
54
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -126,67 +102,31 @@ const deleteObjects = function (ctx) {
|
|
|
126
102
|
exports.deleteObjects = deleteObjects;
|
|
127
103
|
const serveApp = function (ctx) {
|
|
128
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
favicon: branding.faviconUrl !== ""
|
|
151
|
-
? backend_core_1.objectStore.getGlobalFileUrl("settings", "faviconUrl")
|
|
152
|
-
: "",
|
|
153
|
-
logo: (config === null || config === void 0 ? void 0 : config.logoUrl) !== ""
|
|
154
|
-
? backend_core_1.objectStore.getGlobalFileUrl("settings", "logoUrl")
|
|
155
|
-
: "",
|
|
156
|
-
});
|
|
157
|
-
const appHbs = (0, fileSystem_1.loadHandlebarsFile)(`${__dirname}/templates/app.hbs`);
|
|
158
|
-
ctx.body = yield (0, string_templates_1.processString)(appHbs, {
|
|
159
|
-
head,
|
|
160
|
-
body: html,
|
|
161
|
-
style: css.code,
|
|
162
|
-
appId,
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
// just return the app info for jest to assert on
|
|
167
|
-
ctx.body = appInfo;
|
|
168
|
-
}
|
|
105
|
+
const db = backend_core_1.context.getAppDB({ skip_setup: true });
|
|
106
|
+
const appInfo = yield db.get(utils_1.DocumentType.APP_METADATA);
|
|
107
|
+
let appId = backend_core_1.context.getAppId();
|
|
108
|
+
if (!environment_1.default.isJest()) {
|
|
109
|
+
const App = require("./templates/BudibaseApp.svelte").default;
|
|
110
|
+
const plugins = backend_core_1.objectStore.enrichPluginURLs(appInfo.usedPlugins);
|
|
111
|
+
const { head, html, css } = App.render({
|
|
112
|
+
metaImage: "https://res.cloudinary.com/daog6scxm/image/upload/v1666109324/meta-images/budibase-meta-image_uukc1m.png",
|
|
113
|
+
title: appInfo.name,
|
|
114
|
+
production: environment_1.default.isProd(),
|
|
115
|
+
appId,
|
|
116
|
+
clientLibPath: backend_core_1.objectStore.clientLibraryUrl(appId, appInfo.version),
|
|
117
|
+
usedPlugins: plugins,
|
|
118
|
+
});
|
|
119
|
+
const appHbs = (0, fileSystem_1.loadHandlebarsFile)(`${__dirname}/templates/app.hbs`);
|
|
120
|
+
ctx.body = yield (0, string_templates_1.processString)(appHbs, {
|
|
121
|
+
head,
|
|
122
|
+
body: html,
|
|
123
|
+
style: css.code,
|
|
124
|
+
appId,
|
|
125
|
+
});
|
|
169
126
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const { head, html, css } = App.render({
|
|
174
|
-
title: branding === null || branding === void 0 ? void 0 : branding.metaTitle,
|
|
175
|
-
metaTitle: branding === null || branding === void 0 ? void 0 : branding.metaTitle,
|
|
176
|
-
metaImage: (branding === null || branding === void 0 ? void 0 : branding.metaImageUrl) ||
|
|
177
|
-
"https://res.cloudinary.com/daog6scxm/image/upload/v1666109324/meta-images/budibase-meta-image_uukc1m.png",
|
|
178
|
-
metaDescription: (branding === null || branding === void 0 ? void 0 : branding.metaDescription) || "",
|
|
179
|
-
favicon: branding.faviconUrl !== ""
|
|
180
|
-
? backend_core_1.objectStore.getGlobalFileUrl("settings", "faviconUrl")
|
|
181
|
-
: "",
|
|
182
|
-
});
|
|
183
|
-
const appHbs = (0, fileSystem_1.loadHandlebarsFile)(`${__dirname}/templates/app.hbs`);
|
|
184
|
-
ctx.body = yield (0, string_templates_1.processString)(appHbs, {
|
|
185
|
-
head,
|
|
186
|
-
body: html,
|
|
187
|
-
style: css.code,
|
|
188
|
-
});
|
|
189
|
-
}
|
|
127
|
+
else {
|
|
128
|
+
// just return the app info for jest to assert on
|
|
129
|
+
ctx.body = appInfo;
|
|
190
130
|
}
|
|
191
131
|
});
|
|
192
132
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
export let title = ""
|
|
3
3
|
export let favicon = ""
|
|
4
|
-
|
|
5
4
|
export let metaImage = ""
|
|
6
|
-
export let metaTitle = ""
|
|
7
|
-
export let metaDescription = ""
|
|
8
5
|
|
|
9
6
|
export let clientLibPath
|
|
10
7
|
export let usedPlugins
|
|
@@ -16,33 +13,18 @@
|
|
|
16
13
|
name="viewport"
|
|
17
14
|
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
18
15
|
/>
|
|
19
|
-
|
|
20
|
-
<!-- Primary Meta Tags -->
|
|
21
|
-
<meta name="title" content={metaTitle} />
|
|
22
|
-
<meta name="description" content={metaDescription} />
|
|
23
|
-
|
|
24
16
|
<!-- Opengraph Meta Tags -->
|
|
17
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
18
|
+
<meta name="twitter:site" content="@budibase" />
|
|
19
|
+
<meta name="twitter:image" content={metaImage} />
|
|
20
|
+
<meta name="twitter:title" content="{title} - built with Budibase" />
|
|
25
21
|
<meta property="og:site_name" content="Budibase" />
|
|
26
22
|
<meta property="og:title" content="{title} - built with Budibase" />
|
|
27
|
-
<meta property="og:description" content={metaDescription} />
|
|
28
23
|
<meta property="og:type" content="website" />
|
|
29
24
|
<meta property="og:image" content={metaImage} />
|
|
30
25
|
|
|
31
|
-
<!-- Twitter -->
|
|
32
|
-
<meta property="twitter:card" content="summary_large_image" />
|
|
33
|
-
<meta property="twitter:site" content="@budibase" />
|
|
34
|
-
<meta property="twitter:image" content={metaImage} />
|
|
35
|
-
<meta property="twitter:image:alt" content="{title} - built with Budibase" />
|
|
36
|
-
<meta property="twitter:title" content="{title} - built with Budibase" />
|
|
37
|
-
<meta property="twitter:description" content={metaDescription} />
|
|
38
|
-
|
|
39
26
|
<title>{title}</title>
|
|
40
|
-
|
|
41
|
-
<link rel="icon" type="image/png" href={favicon} />
|
|
42
|
-
{:else}
|
|
43
|
-
<link rel="icon" type="image/png" href="https://i.imgur.com/Xhdt1YP.png" />
|
|
44
|
-
{/if}
|
|
45
|
-
|
|
27
|
+
<link rel="icon" type="image/png" href={favicon} />
|
|
46
28
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
|
47
29
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
48
30
|
<link
|
|
@@ -101,16 +83,11 @@
|
|
|
101
83
|
|
|
102
84
|
<body id="app">
|
|
103
85
|
<div id="error">
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
</h2>
|
|
110
|
-
{:else}
|
|
111
|
-
<h2>We couldn't find that application</h2>
|
|
112
|
-
<p />
|
|
113
|
-
{/if}
|
|
86
|
+
<h1>There was an error loading your app</h1>
|
|
87
|
+
<h2>
|
|
88
|
+
The Budibase client library could not be loaded. Try republishing your
|
|
89
|
+
app.
|
|
90
|
+
</h2>
|
|
114
91
|
</div>
|
|
115
92
|
<script type="application/javascript">
|
|
116
93
|
window.INIT_TIME = Date.now()
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.shutdown = void 0;
|
|
7
7
|
const applications_1 = __importDefault(require("./applications"));
|
|
8
|
-
const metrics_1 = __importDefault(require("./metrics"));
|
|
9
8
|
const queries_1 = __importDefault(require("./queries"));
|
|
10
9
|
const tables_1 = __importDefault(require("./tables"));
|
|
11
10
|
const rows_1 = __importDefault(require("./rows"));
|
|
@@ -87,12 +86,6 @@ function addToRouter(endpoints) {
|
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
|
-
function applyAdminRoutes(endpoints) {
|
|
91
|
-
addMiddleware(endpoints.read, backend_core_1.middleware.builderOrAdmin);
|
|
92
|
-
addMiddleware(endpoints.write, backend_core_1.middleware.builderOrAdmin);
|
|
93
|
-
addToRouter(endpoints.read);
|
|
94
|
-
addToRouter(endpoints.write);
|
|
95
|
-
}
|
|
96
89
|
function applyRoutes(endpoints, permType, resource, subResource) {
|
|
97
90
|
const paramMiddleware = subResource
|
|
98
91
|
? (0, resourceId_1.paramSubResource)(resource, subResource)
|
|
@@ -114,7 +107,6 @@ function applyRoutes(endpoints, permType, resource, subResource) {
|
|
|
114
107
|
addToRouter(endpoints.read);
|
|
115
108
|
addToRouter(endpoints.write);
|
|
116
109
|
}
|
|
117
|
-
applyAdminRoutes(metrics_1.default);
|
|
118
110
|
applyRoutes(applications_1.default, PermissionType.APP, "appId");
|
|
119
111
|
applyRoutes(tables_1.default, PermissionType.TABLE, "tableId");
|
|
120
112
|
applyRoutes(users_1.default, PermissionType.USER, "userId");
|
package/dist/app.js
CHANGED
|
@@ -105,7 +105,6 @@ server.on("close", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
105
105
|
}
|
|
106
106
|
shuttingDown = true;
|
|
107
107
|
console.log("Server Closed");
|
|
108
|
-
backend_core_1.timers.cleanup();
|
|
109
108
|
yield automations.shutdown();
|
|
110
109
|
yield redis.shutdown();
|
|
111
110
|
backend_core_1.events.shutdown();
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.41",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput",
|
|
15
15
|
"debug": "yarn build && node --expose-gc --inspect=9222 dist/index.js",
|
|
16
16
|
"postbuild": "copyfiles -u 1 src/**/*.svelte dist/ && copyfiles -u 1 src/**/*.hbs dist/ && copyfiles -u 1 src/**/*.json dist/",
|
|
17
|
-
"test": "
|
|
18
|
-
"test:memory": "jest --maxWorkers=2 --logHeapUsage --forceExit",
|
|
17
|
+
"test": "bash scripts/test.sh",
|
|
19
18
|
"test:watch": "jest --watch",
|
|
20
19
|
"predocker": "copyfiles -f ../client/dist/budibase-client.js ../client/manifest.json client",
|
|
21
20
|
"build:docker": "yarn run predocker && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION",
|
|
@@ -44,12 +43,12 @@
|
|
|
44
43
|
"license": "GPL-3.0",
|
|
45
44
|
"dependencies": {
|
|
46
45
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
47
|
-
"@budibase/backend-core": "2.4.
|
|
48
|
-
"@budibase/client": "2.4.
|
|
49
|
-
"@budibase/pro": "2.4.
|
|
50
|
-
"@budibase/shared-core": "2.4.
|
|
51
|
-
"@budibase/string-templates": "2.4.
|
|
52
|
-
"@budibase/types": "2.4.
|
|
46
|
+
"@budibase/backend-core": "^2.4.41",
|
|
47
|
+
"@budibase/client": "^2.4.41",
|
|
48
|
+
"@budibase/pro": "2.4.41",
|
|
49
|
+
"@budibase/shared-core": "^2.4.41",
|
|
50
|
+
"@budibase/string-templates": "^2.4.41",
|
|
51
|
+
"@budibase/types": "^2.4.41",
|
|
53
52
|
"@bull-board/api": "3.7.0",
|
|
54
53
|
"@bull-board/koa": "3.9.4",
|
|
55
54
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -126,7 +125,7 @@
|
|
|
126
125
|
"@babel/core": "7.17.4",
|
|
127
126
|
"@babel/preset-env": "7.16.11",
|
|
128
127
|
"@budibase/standard-components": "^0.9.139",
|
|
129
|
-
"@jest/test-sequencer": "
|
|
128
|
+
"@jest/test-sequencer": "24.9.0",
|
|
130
129
|
"@swc/core": "^1.3.25",
|
|
131
130
|
"@swc/jest": "^0.2.24",
|
|
132
131
|
"@trendyol/jest-testcontainers": "^2.1.1",
|
|
@@ -135,7 +134,7 @@
|
|
|
135
134
|
"@types/global-agent": "2.1.1",
|
|
136
135
|
"@types/google-spreadsheet": "3.1.5",
|
|
137
136
|
"@types/ioredis": "4.28.10",
|
|
138
|
-
"@types/jest": "
|
|
137
|
+
"@types/jest": "27.5.1",
|
|
139
138
|
"@types/koa": "2.13.4",
|
|
140
139
|
"@types/koa__router": "8.0.8",
|
|
141
140
|
"@types/lodash": "4.14.180",
|
|
@@ -155,7 +154,7 @@
|
|
|
155
154
|
"eslint": "6.8.0",
|
|
156
155
|
"ioredis-mock": "7.2.0",
|
|
157
156
|
"is-wsl": "2.2.0",
|
|
158
|
-
"jest": "
|
|
157
|
+
"jest": "28.1.1",
|
|
159
158
|
"jest-openapi": "0.14.2",
|
|
160
159
|
"jest-serial-runner": "^1.2.1",
|
|
161
160
|
"nodemon": "2.0.15",
|
|
@@ -167,7 +166,7 @@
|
|
|
167
166
|
"supertest": "6.2.2",
|
|
168
167
|
"swagger-jsdoc": "6.1.0",
|
|
169
168
|
"timekeeper": "2.2.0",
|
|
170
|
-
"ts-jest": "
|
|
169
|
+
"ts-jest": "28.0.4",
|
|
171
170
|
"ts-node": "10.8.1",
|
|
172
171
|
"tsconfig-paths": "4.0.0",
|
|
173
172
|
"typescript": "4.7.3",
|
package/dist/sdk/users/utils.js
CHANGED
|
@@ -16,8 +16,7 @@ const utils_1 = require("../../db/utils");
|
|
|
16
16
|
const lodash_1 = require("lodash");
|
|
17
17
|
function combineMetadataAndUser(user, metadata) {
|
|
18
18
|
// skip users with no access
|
|
19
|
-
if (user.roleId
|
|
20
|
-
user.roleId === backend_core_1.roles.BUILTIN_ROLE_IDS.PUBLIC) {
|
|
19
|
+
if (user.roleId === backend_core_1.roles.BUILTIN_ROLE_IDS.PUBLIC) {
|
|
21
20
|
return null;
|
|
22
21
|
}
|
|
23
22
|
delete user._rev;
|