@live-change/message-authentication-service 0.9.32 → 0.9.34

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/package.json +3 -3
  2. package/sign.js +7 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/message-authentication-service",
3
- "version": "0.9.32",
3
+ "version": "0.9.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,9 +21,9 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.9.32",
24
+ "@live-change/framework": "^0.9.34",
25
25
  "nodemailer": "^6.7.2"
26
26
  },
27
- "gitHead": "41022fc283020e2da3e82aa27274401052d2379a",
27
+ "gitHead": "e5f22de77fe6a3c0a0e1b91d17593e195aaae3b3",
28
28
  "type": "module"
29
29
  }
package/sign.js CHANGED
@@ -15,7 +15,7 @@ definition.trigger({
15
15
  const contactTypeUpperCase = contactType[0].toUpperCase() + contactType.slice(1)
16
16
  const user = app.generateUid()
17
17
  await service.trigger({ type: 'connect' + contactTypeUpperCase }, {
18
- [contactType]: contact,
18
+ [contactTypeName]: contact,
19
19
  user
20
20
  })
21
21
  await service.trigger({ type: 'signUpAndSignIn' }, {
@@ -34,7 +34,7 @@ definition.trigger({
34
34
  async execute({ contactType, contact, session }, { service }, _emit) {
35
35
  const contactTypeUpperCase = contactType[0].toUpperCase() + contactType.slice(1)
36
36
  const user = await service.trigger({ type: 'signIn' + contactTypeUpperCase }, {
37
- [contactType]: contact,
37
+ [contactTypeName]: contact,
38
38
  session
39
39
  })
40
40
  return user
@@ -50,7 +50,7 @@ definition.trigger({
50
50
  async execute({ contactType, contact, user }, { client, service }, _emit) {
51
51
  const contactTypeUpperCase = contactType[0].toUpperCase() + contactType.slice(1)
52
52
  await service.trigger({ type: 'connect' + contactTypeUpperCase }, {
53
- [contactType]: contact,
53
+ [contactTypeName]: contact,
54
54
  user
55
55
  })
56
56
  return user
@@ -99,8 +99,8 @@ for(const contactType of config.contactTypes) {
99
99
  ...contactTypeProperties
100
100
  },
101
101
  async execute({ [contactTypeName]: contact }, { _client, service }, _emit) {
102
- const contactData = await app.viewGet('get'+contactTypeUName, { [contactType]: contact })
103
- if(!contactData) throw { properties: { email: 'notFound' } }
102
+ const contactData = await app.viewGet('get'+contactTypeUName, { [contactTypeName]: contact })
103
+ if(!contactData) throw { properties: { email: contactTypeName +'NotFound' } }
104
104
  const messageData = {
105
105
  user: contactData.user
106
106
  }
@@ -159,7 +159,7 @@ for(const contactType of config.contactTypes) {
159
159
  const contactData = contacts.find(c =>
160
160
  c.type === contactTypeName && c.contact === contact
161
161
  )
162
- if(!contactData) throw 'notFound'
162
+ if(!contactData) throw contactTypeName+'MotFound'
163
163
  if(contacts.length === 1) throw 'lastOne'
164
164
  console.log("DISCONNECT", contact)
165
165
  return await service.trigger({ type: 'disconnect' + contactTypeUName }, {
@@ -178,7 +178,7 @@ for(const contactType of config.contactTypes) {
178
178
  ...contactTypeProperties
179
179
  },
180
180
  async execute({ [contactTypeName]: contact }, { client, service }, _emit) {
181
- const contactData = await app.viewGet('get'+contactTypeUName, { [contactType]: contact })
181
+ const contactData = await app.viewGet('get'+contactTypeUName, { [contactTypeName]: contact })
182
182
  if(contactData) {
183
183
  const messageData = {
184
184
  user: contactData.user