@budibase/worker 2.9.33-alpha.14 → 2.9.33-alpha.16

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.14",
4
+ "version": "2.9.33-alpha.16",
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.14",
42
- "@budibase/pro": "2.9.33-alpha.14",
43
- "@budibase/string-templates": "2.9.33-alpha.14",
44
- "@budibase/types": "2.9.33-alpha.14",
41
+ "@budibase/backend-core": "2.9.33-alpha.16",
42
+ "@budibase/pro": "2.9.33-alpha.16",
43
+ "@budibase/string-templates": "2.9.33-alpha.16",
44
+ "@budibase/types": "2.9.33-alpha.16",
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": "c5e5b8bdded17dbc4ce5b99f459695145ee29e60"
121
+ "gitHead": "457d3a376f77c3d6dcfa12fc0dae21c3e6c93d4e"
122
122
  }
@@ -266,17 +266,14 @@ 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
- let builder: { global: boolean; apps?: string[] } = { global: false }
270
- if (invite.userInfo.appBuilders) {
271
- builder.apps = invite.userInfo.appBuilders
272
- }
269
+
273
270
  return {
274
271
  email: invite.email,
275
272
  password,
276
273
  forceResetPassword: true,
277
274
  roles: invite.userInfo.apps,
278
- admin: { global: false },
279
- builder,
275
+ admin: invite.userInfo.admin,
276
+ builder: invite.userInfo.builder,
280
277
  tenantId: tenancy.getTenantId(),
281
278
  }
282
279
  })
@@ -371,13 +368,10 @@ export const updateInvite = async (ctx: any) => {
371
368
  ...invite,
372
369
  }
373
370
 
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
- ]
371
+ if (!updateBody?.builder?.apps && updated.info?.builder?.apps) {
372
+ updated.info.builder.apps = []
373
+ } else if (updateBody?.builder) {
374
+ updated.info.builder = updateBody.builder
381
375
  }
382
376
 
383
377
  if (!updateBody?.apps || !Object.keys(updateBody?.apps).length) {
@@ -409,15 +403,17 @@ export const inviteAccept = async (
409
403
  lastName,
410
404
  password,
411
405
  email,
406
+ admin: { global: info?.admin?.global || false },
412
407
  roles: info.apps,
413
408
  tenantId: info.tenantId,
414
409
  }
415
- let builder: { global: boolean; apps?: string[] } = { global: false }
410
+ let builder: { global: boolean; apps?: string[] } = {
411
+ global: info?.builder?.global || false,
412
+ }
416
413
 
417
- if (info.appBuilders) {
418
- builder.apps = info.appBuilders
414
+ if (info?.builder?.apps) {
415
+ builder.apps = info.builder.apps
419
416
  request.builder = builder
420
- delete info.appBuilders
421
417
  }
422
418
  delete info.apps
423
419
  request = {