@budibase/server 2.4.42-alpha.6 → 2.4.42-alpha.8
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.3cb1022d.css → index.7f9a008b.css} +1 -1
- package/builder/assets/{index.868689db.js → index.89bb7cf4.js} +255 -254
- package/builder/index.html +2 -2
- package/dist/api/controllers/table/utils.js +3 -4
- package/dist/integrations/googlesheets.js +4 -0
- package/dist/package.json +7 -7
- package/dist/sdk/users/utils.js +9 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/api/controllers/table/tests/utils.spec.ts +97 -0
- package/src/api/controllers/table/utils.ts +21 -12
- package/src/db/defaultData/datasource_bb_default.ts +1 -1
- package/src/integrations/googlesheets.ts +4 -0
- package/src/sdk/users/tests/utils.spec.ts +159 -0
- package/src/sdk/users/utils.ts +14 -6
- package/src/tests/utilities/TestConfiguration.ts +2 -1
- package/src/utilities/rowProcessor/index.ts +1 -1
package/builder/index.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
|
10
10
|
rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="/builder/assets/index.
|
|
12
|
-
<link rel="stylesheet" href="/builder/assets/index.
|
|
11
|
+
<script type="module" crossorigin src="/builder/assets/index.89bb7cf4.js"></script>
|
|
12
|
+
<link rel="stylesheet" href="/builder/assets/index.7f9a008b.css">
|
|
13
13
|
</head>
|
|
14
14
|
|
|
15
15
|
<body id="app">
|
|
@@ -96,7 +96,7 @@ function makeSureTableUpToDate(table, tableToSave) {
|
|
|
96
96
|
return tableToSave;
|
|
97
97
|
}
|
|
98
98
|
exports.makeSureTableUpToDate = makeSureTableUpToDate;
|
|
99
|
-
function importToRows(data, table, user =
|
|
99
|
+
function importToRows(data, table, user = null) {
|
|
100
100
|
let finalData = [];
|
|
101
101
|
for (let i = 0; i < data.length; i++) {
|
|
102
102
|
let row = data[i];
|
|
@@ -106,9 +106,8 @@ function importToRows(data, table, user = {}) {
|
|
|
106
106
|
noAutoRelationships: true,
|
|
107
107
|
});
|
|
108
108
|
row = processed.row;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
for ([fieldName, schema] of Object.entries(table.schema)) {
|
|
109
|
+
table = processed.table;
|
|
110
|
+
for (const [fieldName, schema] of Object.entries(table.schema)) {
|
|
112
111
|
// check whether the options need to be updated for inclusion as part of the data import
|
|
113
112
|
if (schema.type === constants_1.FieldTypes.OPTIONS &&
|
|
114
113
|
row[fieldName] &&
|
|
@@ -201,6 +201,10 @@ class GoogleSheetsIntegration {
|
|
|
201
201
|
}
|
|
202
202
|
buildSchema(datasourceId, entities) {
|
|
203
203
|
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
// not fully configured yet
|
|
205
|
+
if (!this.config.auth) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
204
208
|
yield this.connect();
|
|
205
209
|
const sheets = this.client.sheetsByIndex;
|
|
206
210
|
const tables = {};
|
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.42-alpha.
|
|
4
|
+
"version": "2.4.42-alpha.7",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"license": "GPL-3.0",
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
47
|
-
"@budibase/backend-core": "2.4.42-alpha.
|
|
48
|
-
"@budibase/client": "2.4.42-alpha.
|
|
49
|
-
"@budibase/pro": "2.4.42-alpha.
|
|
50
|
-
"@budibase/shared-core": "2.4.42-alpha.
|
|
51
|
-
"@budibase/string-templates": "2.4.42-alpha.
|
|
52
|
-
"@budibase/types": "2.4.42-alpha.
|
|
47
|
+
"@budibase/backend-core": "2.4.42-alpha.7",
|
|
48
|
+
"@budibase/client": "2.4.42-alpha.7",
|
|
49
|
+
"@budibase/pro": "2.4.42-alpha.7",
|
|
50
|
+
"@budibase/shared-core": "2.4.42-alpha.7",
|
|
51
|
+
"@budibase/string-templates": "2.4.42-alpha.7",
|
|
52
|
+
"@budibase/types": "2.4.42-alpha.7",
|
|
53
53
|
"@bull-board/api": "3.7.0",
|
|
54
54
|
"@bull-board/koa": "3.9.4",
|
|
55
55
|
"@elastic/elasticsearch": "7.10.0",
|
package/dist/sdk/users/utils.js
CHANGED
|
@@ -15,17 +15,21 @@ const backend_core_1 = require("@budibase/backend-core");
|
|
|
15
15
|
const utils_1 = require("../../db/utils");
|
|
16
16
|
const lodash_1 = require("lodash");
|
|
17
17
|
function combineMetadataAndUser(user, metadata) {
|
|
18
|
+
const metadataId = (0, utils_1.generateUserMetadataID)(user._id);
|
|
19
|
+
const found = Array.isArray(metadata)
|
|
20
|
+
? metadata.find(doc => doc._id === metadataId)
|
|
21
|
+
: metadata;
|
|
18
22
|
// skip users with no access
|
|
19
23
|
if (user.roleId == null ||
|
|
20
24
|
user.roleId === backend_core_1.roles.BUILTIN_ROLE_IDS.PUBLIC) {
|
|
25
|
+
// If it exists and it should not, we must remove it
|
|
26
|
+
if (found === null || found === void 0 ? void 0 : found._id) {
|
|
27
|
+
return Object.assign(Object.assign({}, found), { _deleted: true });
|
|
28
|
+
}
|
|
21
29
|
return null;
|
|
22
30
|
}
|
|
23
31
|
delete user._rev;
|
|
24
|
-
const metadataId = (0, utils_1.generateUserMetadataID)(user._id);
|
|
25
32
|
const newDoc = Object.assign(Object.assign({}, user), { _id: metadataId, tableId: utils_1.InternalTables.USER_METADATA });
|
|
26
|
-
const found = Array.isArray(metadata)
|
|
27
|
-
? metadata.find(doc => doc._id === metadataId)
|
|
28
|
-
: metadata;
|
|
29
33
|
// copy rev over for the purposes of equality check
|
|
30
34
|
if (found) {
|
|
31
35
|
newDoc._rev = found._rev;
|
|
@@ -55,7 +59,7 @@ function syncGlobalUsers() {
|
|
|
55
59
|
]);
|
|
56
60
|
const toWrite = [];
|
|
57
61
|
for (let user of users) {
|
|
58
|
-
const combined =
|
|
62
|
+
const combined = combineMetadataAndUser(user, metadata);
|
|
59
63
|
if (combined) {
|
|
60
64
|
toWrite.push(combined);
|
|
61
65
|
}
|