@budibase/worker 2.22.0 → 2.22.2

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/Dockerfile CHANGED
@@ -16,17 +16,11 @@ COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.
16
16
  RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
17
17
 
18
18
 
19
- WORKDIR /string-templates
20
- COPY packages/string-templates/package.json package.json
21
- RUN ../scripts/removeWorkspaceDependencies.sh package.json
22
- RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
23
- COPY packages/string-templates .
24
19
 
25
20
 
26
21
  WORKDIR /app
27
22
  COPY packages/worker/package.json .
28
23
  COPY packages/worker/dist/yarn.lock .
29
- RUN cd ../string-templates && yarn link && cd - && yarn link @budibase/string-templates
30
24
 
31
25
  RUN ../scripts/removeWorkspaceDependencies.sh package.json
32
26
 
package/jest.config.ts CHANGED
@@ -15,6 +15,7 @@ const config: Config.InitialOptions = {
15
15
  "@budibase/backend-core": "<rootDir>/../backend-core/src",
16
16
  "@budibase/types": "<rootDir>/../types/src",
17
17
  "@budibase/shared-core": ["<rootDir>/../shared-core/src"],
18
+ "@budibase/string-templates": ["<rootDir>/../string-templates/src"],
18
19
  },
19
20
  }
20
21
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.22.0",
4
+ "version": "2.22.2",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -37,10 +37,10 @@
37
37
  "author": "Budibase",
38
38
  "license": "GPL-3.0",
39
39
  "dependencies": {
40
- "@budibase/backend-core": "2.22.0",
41
- "@budibase/pro": "2.22.0",
42
- "@budibase/string-templates": "2.22.0",
43
- "@budibase/types": "2.22.0",
40
+ "@budibase/backend-core": "2.22.2",
41
+ "@budibase/pro": "2.22.2",
42
+ "@budibase/string-templates": "2.22.2",
43
+ "@budibase/types": "2.22.2",
44
44
  "@koa/router": "8.0.8",
45
45
  "@techpass/passport-openidconnect": "0.3.2",
46
46
  "@types/global-agent": "2.1.1",
@@ -108,5 +108,5 @@
108
108
  }
109
109
  }
110
110
  },
111
- "gitHead": "45f438318a63b0f60cbee8cef5115ca7947f356b"
111
+ "gitHead": "ae1d0c57770298b70f02234d493b7b603783e0b3"
112
112
  }
@@ -114,9 +114,16 @@ export const syncAppFavourites = async (processedAppIds: string[]) => {
114
114
  if (processedAppIds.length === 0) {
115
115
  return []
116
116
  }
117
- const apps = await fetchAppsByIds(processedAppIds)
117
+
118
+ const tenantId = tenancy.getTenantId()
119
+ const appPrefix =
120
+ tenantId === tenancy.DEFAULT_TENANT_ID
121
+ ? dbCore.APP_DEV_PREFIX
122
+ : `${dbCore.APP_DEV_PREFIX}${tenantId}_`
123
+
124
+ const apps = await fetchAppsByIds(processedAppIds, appPrefix)
118
125
  return apps?.reduce((acc: string[], app) => {
119
- const id = app.appId.replace(dbCore.APP_DEV_PREFIX, "")
126
+ const id = app.appId.replace(appPrefix, "")
120
127
  if (processedAppIds.includes(id)) {
121
128
  acc.push(id)
122
129
  }
@@ -124,9 +131,14 @@ export const syncAppFavourites = async (processedAppIds: string[]) => {
124
131
  }, [])
125
132
  }
126
133
 
127
- export const fetchAppsByIds = async (processedAppIds: string[]) => {
134
+ export const fetchAppsByIds = async (
135
+ processedAppIds: string[],
136
+ appPrefix: string
137
+ ) => {
128
138
  return await dbCore.getAppsByIDs(
129
- processedAppIds.map(appId => `${dbCore.APP_DEV_PREFIX}${appId}`)
139
+ processedAppIds.map(appId => {
140
+ return `${appPrefix}${appId}`
141
+ })
130
142
  )
131
143
  }
132
144
 
@@ -52,7 +52,7 @@ export enum InternalTemplateBinding {
52
52
  RESET_URL = "resetUrl",
53
53
  RESET_CODE = "resetCode",
54
54
  INVITE_URL = "inviteUrl",
55
- INVITE_CODE = "inviteUrl",
55
+ INVITE_CODE = "inviteCode",
56
56
  CONTENTS = "contents",
57
57
  }
58
58
 
@@ -16,7 +16,8 @@
16
16
  "@budibase/backend-core": ["../backend-core/src"],
17
17
  "@budibase/backend-core/*": ["../backend-core/*"],
18
18
  "@budibase/shared-core": ["../shared-core/src"],
19
- "@budibase/pro": ["../pro/src"]
19
+ "@budibase/pro": ["../pro/src"],
20
+ "@budibase/string-templates": ["../string-templates/src"]
20
21
  }
21
22
  },
22
23
  "include": ["src/**/*"],