@budibase/worker 2.9.33-alpha.6 → 2.9.33-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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.9.33-alpha.6",
4
+ "version": "2.9.33-alpha.8",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -38,10 +38,10 @@
38
38
  "author": "Budibase",
39
39
  "license": "GPL-3.0",
40
40
  "dependencies": {
41
- "@budibase/backend-core": "2.9.33-alpha.6",
42
- "@budibase/pro": "2.9.33-alpha.6",
43
- "@budibase/string-templates": "2.9.33-alpha.6",
44
- "@budibase/types": "2.9.33-alpha.6",
41
+ "@budibase/backend-core": "2.9.33-alpha.8",
42
+ "@budibase/pro": "2.9.33-alpha.8",
43
+ "@budibase/string-templates": "2.9.33-alpha.8",
44
+ "@budibase/types": "2.9.33-alpha.8",
45
45
  "@koa/router": "8.0.8",
46
46
  "@sentry/node": "6.17.7",
47
47
  "@techpass/passport-openidconnect": "0.3.2",
@@ -118,5 +118,5 @@
118
118
  }
119
119
  }
120
120
  },
121
- "gitHead": "08157760a72e81f4deaa05a0d2959286694c3c0c"
121
+ "gitHead": "ddd0d83e89c202c576194361e072e488e1a11785"
122
122
  }
@@ -266,14 +266,17 @@ export const onboardUsers = async (ctx: Ctx<InviteUsersRequest>) => {
266
266
 
267
267
  // Temp password to be passed to the user.
268
268
  createdPasswords[invite.email] = password
269
-
269
+ let builder: { global: boolean; apps?: string[] } = { global: false }
270
+ if (invite.userInfo.appBuilders) {
271
+ builder.apps = invite.userInfo.appBuilders
272
+ }
270
273
  return {
271
274
  email: invite.email,
272
275
  password,
273
276
  forceResetPassword: true,
274
277
  roles: invite.userInfo.apps,
275
278
  admin: { global: false },
276
- builder: { global: false },
279
+ builder,
277
280
  tenantId: tenancy.getTenantId(),
278
281
  }
279
282
  })
@@ -368,6 +371,15 @@ export const updateInvite = async (ctx: any) => {
368
371
  ...invite,
369
372
  }
370
373
 
374
+ if (!updateBody?.appBuilders || !updateBody.appBuilders?.length) {
375
+ updated.info.appBuilders = []
376
+ } else {
377
+ updated.info.appBuilders = [
378
+ ...(invite.info.appBuilders ?? []),
379
+ ...updateBody.appBuilders,
380
+ ]
381
+ }
382
+
371
383
  if (!updateBody?.apps || !Object.keys(updateBody?.apps).length) {
372
384
  updated.info.apps = []
373
385
  } else {
@@ -392,7 +404,7 @@ export const inviteAccept = async (
392
404
  // info is an extension of the user object that was stored by global
393
405
  const { email, info }: any = await checkInviteCode(inviteCode)
394
406
  const user = await tenancy.doInTenant(info.tenantId, async () => {
395
- let request = {
407
+ let request: any = {
396
408
  firstName,
397
409
  lastName,
398
410
  password,
@@ -400,9 +412,14 @@ export const inviteAccept = async (
400
412
  roles: info.apps,
401
413
  tenantId: info.tenantId,
402
414
  }
415
+ let builder: { global: boolean; apps?: string[] } = { global: false }
403
416
 
417
+ if (info.appBuilders) {
418
+ builder.apps = info.appBuilders
419
+ request.builder = builder
420
+ delete info.appBuilders
421
+ }
404
422
  delete info.apps
405
-
406
423
  request = {
407
424
  ...request,
408
425
  ...info,