@live-change/email-service 0.8.14 → 0.8.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.
Files changed (2) hide show
  1. package/auth.js +9 -9
  2. package/package.json +3 -3
package/auth.js CHANGED
@@ -64,7 +64,7 @@ definition.event({
64
64
  validation: ['nonEmpty']
65
65
  }
66
66
  },
67
- async execute({ user, email }) {
67
+ async execute({ email }) {
68
68
  await Email.delete(email)
69
69
  }
70
70
  })
@@ -91,7 +91,7 @@ definition.trigger({
91
91
  validation: ['nonEmpty', 'email']
92
92
  }
93
93
  },
94
- async execute({ email }, context, emit) {
94
+ async execute({ email }, context, _emit) {
95
95
  const emailData = await Email.get(email)
96
96
  if(emailData) throw { properties: { email: 'taken' } }
97
97
  return true
@@ -106,7 +106,7 @@ definition.trigger({
106
106
  validation: ['nonEmpty', 'email']
107
107
  }
108
108
  },
109
- async execute({ email }, context, emit) {
109
+ async execute({ email }, context, _emit) {
110
110
  const emailData = await Email.get(email)
111
111
  if(!emailData) throw { properties: { email: 'notFound' } }
112
112
  return emailData
@@ -121,9 +121,8 @@ definition.trigger({
121
121
  validation: ['nonEmpty', 'email']
122
122
  }
123
123
  },
124
- async execute({ email }, context, emit) {
125
- const emailData = await Email.get(email)
126
- return emailData
124
+ async execute({ email }, context, _emit) {
125
+ return await Email.get(email)
127
126
  }
128
127
  })
129
128
 
@@ -172,7 +171,7 @@ definition.trigger({
172
171
  async execute({ user, email }, { client, service }, emit) {
173
172
  const emailData = await Email.get(email)
174
173
  if(!emailData) throw { properties: { email: 'notFound' } }
175
- if(emailData.user != user) throw { properties: { email: 'notFound' } }
174
+ if(emailData.user !== user) throw { properties: { email: 'notFound' } }
176
175
  emit({
177
176
  type: 'emailDisconnected',
178
177
  user, email
@@ -188,7 +187,8 @@ definition.trigger({
188
187
  type: String
189
188
  }
190
189
  },
191
- async execute({ email, session }, { client, service }, emit) {
190
+ waitForEvents: true,
191
+ async execute({ email, session }, { service }, _emit) {
192
192
  const emailData = await Email.get(email)
193
193
  if(!emailData) throw { properties: { email: 'notFound' } }
194
194
  const { user } = emailData
@@ -207,7 +207,7 @@ definition.trigger({
207
207
  validation: ['nonEmpty', 'email']
208
208
  }
209
209
  },
210
- async execute({ user }, context, emit) {
210
+ async execute({ user }, context, _emit) {
211
211
  const emails = await Email.indexRangeGet('byUser', user)
212
212
  return emails.map(email => ({ ...email, type: 'email', contact: email.email }))
213
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/email-service",
3
- "version": "0.8.14",
3
+ "version": "0.8.16",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.8.14",
24
+ "@live-change/framework": "^0.8.16",
25
25
  "got": "^11.8.3",
26
26
  "html-to-text": "8.1.0",
27
27
  "inline-css": "4.0.2",
@@ -29,6 +29,6 @@
29
29
  "juice": "9.1.0",
30
30
  "nodemailer": "^6.7.2"
31
31
  },
32
- "gitHead": "d81b573fb8891746ae1c67f4f68558123c9f85f7",
32
+ "gitHead": "b8ac84cbe1a8c435c7b5003dfc64ddc41a4e15a6",
33
33
  "type": "module"
34
34
  }