@budibase/server 2.4.42-alpha.6 → 2.4.42-alpha.7

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.
@@ -8,7 +8,7 @@
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.868689db.js"></script>
11
+ <script type="module" crossorigin src="/builder/assets/index.8b525942.js"></script>
12
12
  <link rel="stylesheet" href="/builder/assets/index.3cb1022d.css">
13
13
  </head>
14
14
 
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.5",
4
+ "version": "2.4.42-alpha.6",
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.5",
48
- "@budibase/client": "2.4.42-alpha.5",
49
- "@budibase/pro": "2.4.42-alpha.5",
50
- "@budibase/shared-core": "2.4.42-alpha.5",
51
- "@budibase/string-templates": "2.4.42-alpha.5",
52
- "@budibase/types": "2.4.42-alpha.5",
47
+ "@budibase/backend-core": "2.4.42-alpha.6",
48
+ "@budibase/client": "2.4.42-alpha.6",
49
+ "@budibase/pro": "2.4.42-alpha.6",
50
+ "@budibase/shared-core": "2.4.42-alpha.6",
51
+ "@budibase/string-templates": "2.4.42-alpha.6",
52
+ "@budibase/types": "2.4.42-alpha.6",
53
53
  "@bull-board/api": "3.7.0",
54
54
  "@bull-board/koa": "3.9.4",
55
55
  "@elastic/elasticsearch": "7.10.0",
@@ -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 = yield combineMetadataAndUser(user, metadata);
62
+ const combined = combineMetadataAndUser(user, metadata);
59
63
  if (combined) {
60
64
  toWrite.push(combined);
61
65
  }