@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.
- package/auth.js +9 -9
- 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({
|
|
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,
|
|
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,
|
|
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,
|
|
125
|
-
|
|
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
|
|
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
|
-
|
|
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,
|
|
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.
|
|
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.
|
|
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": "
|
|
32
|
+
"gitHead": "b8ac84cbe1a8c435c7b5003dfc64ddc41a4e15a6",
|
|
33
33
|
"type": "module"
|
|
34
34
|
}
|