@live-change/access-control-service 0.8.31 → 0.8.33

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.
Files changed (2) hide show
  1. package/invite.js +7 -13
  2. package/package.json +3 -3
package/invite.js CHANGED
@@ -107,10 +107,9 @@ definition.trigger({
107
107
  notificationType: 'accessControl_Invitation',
108
108
  id: undefined
109
109
  })
110
- if(to.contactOrUserType == 'user_User') {
111
- await service.trigger({
110
+ if(to.contactOrUserType === 'user_User') {
111
+ await service.trigger({ type: 'notify', }, {
112
112
  ...invitationData,
113
- type: 'notify',
114
113
  sessionOrUserType: 'user_User',
115
114
  sessionOrUser: to.contactOrUser,
116
115
  notificationType: 'accessControl_Invitation',
@@ -144,13 +143,11 @@ definition.trigger({
144
143
  const { roles } = invitationData
145
144
  /// Create account and sign-in:
146
145
  const user = app.generateUid()
147
- await service.trigger({
148
- type: 'connect' + contactTypeUpperCase,
146
+ await service.trigger({ type: 'connect' + contactTypeUpperCase }, {
149
147
  [contactType]: contact,
150
148
  user
151
149
  })
152
- await service.trigger({
153
- type: 'signUpAndSignIn',
150
+ await service.trigger({ type: 'signUpAndSignIn' }, {
154
151
  user, session
155
152
  })
156
153
  emit({
@@ -238,14 +235,12 @@ for(const contactType of config.contactTypes) {
238
235
  const invitationData = { fromType, from }
239
236
  for(const propertyName in invitationProperties) invitationData[propertyName] = params[propertyName]
240
237
 
241
- const contactData = (await service.trigger({
242
- type: 'get' + contactTypeUName + 'OrNull',
238
+ const contactData = (await service.trigger({ type: 'get' + contactTypeUName + 'OrNull' }, {
243
239
  [contactType]: contact,
244
240
  }))[0]
245
241
  if(contactData?.user) { // user exists
246
242
  const { user } = contactData
247
- await service.trigger({
248
- type: 'notify',
243
+ await service.trigger({ type: 'notify' }, {
249
244
  sessionOrUserType: 'user_User',
250
245
  sessionOrUser: user,
251
246
  notificationType: 'accessControl_Invitation',
@@ -265,8 +260,7 @@ for(const contactType of config.contactTypes) {
265
260
  objectType, object,
266
261
  ...invitationData, id: undefined
267
262
  }
268
- await service.trigger({
269
- type: 'authenticateWithMessage',
263
+ await service.trigger({ type: 'authenticateWithMessage' }, {
270
264
  contactType,
271
265
  contact,
272
266
  messageData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/access-control-service",
3
- "version": "0.8.31",
3
+ "version": "0.8.33",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,8 +21,8 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.8.31"
24
+ "@live-change/framework": "^0.8.33"
25
25
  },
26
- "gitHead": "9ab10c6f2854dd5472cc6becb128951db16218e3",
26
+ "gitHead": "98ff6f9c09e5fc1f408010df6cc8038eff571276",
27
27
  "type": "module"
28
28
  }