@dereekb/firebase-server 13.0.0 → 13.0.2
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/index.cjs.default.js +1 -0
- package/index.cjs.js +1923 -2001
- package/index.cjs.mjs +2 -0
- package/index.esm.js +1924 -2000
- package/mailgun/index.cjs.default.js +1 -0
- package/mailgun/index.cjs.js +28 -35
- package/mailgun/index.cjs.mjs +2 -0
- package/mailgun/index.esm.js +28 -35
- package/mailgun/package.json +17 -22
- package/model/index.cjs.default.js +1 -0
- package/model/index.cjs.js +4042 -4573
- package/model/index.cjs.mjs +2 -0
- package/model/index.esm.js +4042 -4573
- package/model/package.json +23 -27
- package/package.json +42 -61
- package/src/lib/function/error.d.ts +0 -8
- package/test/index.cjs.default.js +1 -0
- package/test/index.cjs.js +867 -933
- package/test/index.cjs.mjs +2 -0
- package/test/index.esm.js +867 -933
- package/test/package.json +22 -26
- package/zoho/index.cjs.default.js +1 -0
- package/zoho/index.cjs.js +82 -85
- package/zoho/index.cjs.mjs +2 -0
- package/zoho/index.esm.js +82 -85
- package/zoho/package.json +17 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./index.cjs.js').default;
|
package/mailgun/index.cjs.js
CHANGED
|
@@ -6,43 +6,36 @@ var firebaseServer = require('@dereekb/firebase-server');
|
|
|
6
6
|
* Abstract FirebaseServerNewUserService implementation that sends an email to a template on Mailgun.
|
|
7
7
|
*/
|
|
8
8
|
class AbstractMailgunContentFirebaseServerNewUserService extends firebaseServer.AbstractFirebaseServerNewUserService {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
async sendSetupContentToUser(user) {
|
|
15
|
-
const userRecord = await user.userContext.loadRecord();
|
|
16
|
-
const {
|
|
17
|
-
setupPassword
|
|
18
|
-
} = user.claims;
|
|
19
|
-
const {
|
|
20
|
-
uid,
|
|
21
|
-
displayName,
|
|
22
|
-
email
|
|
23
|
-
} = userRecord;
|
|
24
|
-
if (!email) {
|
|
25
|
-
throw new Error(`Email is not present/available for the user record "${userRecord.uid}"`);
|
|
9
|
+
mailgunService;
|
|
10
|
+
constructor(authService, mailgunService) {
|
|
11
|
+
super(authService);
|
|
12
|
+
this.mailgunService = mailgunService;
|
|
26
13
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
to: {
|
|
34
|
-
name: baseRequestTo?.name,
|
|
35
|
-
email,
|
|
36
|
-
userVariables: {
|
|
37
|
-
setupPassword,
|
|
38
|
-
...baseRequestTo?.userVariables,
|
|
39
|
-
displayName,
|
|
40
|
-
uid
|
|
14
|
+
async sendSetupContentToUser(user) {
|
|
15
|
+
const userRecord = await user.userContext.loadRecord();
|
|
16
|
+
const { setupPassword } = user.claims;
|
|
17
|
+
const { uid, displayName, email } = userRecord;
|
|
18
|
+
if (!email) {
|
|
19
|
+
throw new Error(`Email is not present/available for the user record "${userRecord.uid}"`);
|
|
41
20
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
const baseRequest = await this.buildNewUserMailgunContentRequest(user);
|
|
22
|
+
const baseRequestTo = baseRequest.to;
|
|
23
|
+
await this.mailgunService.sendTemplateEmail({
|
|
24
|
+
batchSend: false, // do not use batch sending by default, as we should only be sending to one user
|
|
25
|
+
...baseRequest,
|
|
26
|
+
to: {
|
|
27
|
+
name: baseRequestTo?.name,
|
|
28
|
+
email,
|
|
29
|
+
userVariables: {
|
|
30
|
+
setupPassword,
|
|
31
|
+
...baseRequestTo?.userVariables,
|
|
32
|
+
displayName,
|
|
33
|
+
uid
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
sendTestEmails: baseRequest.sendTestEmails || user.sendDetailsInTestEnvironment || undefined
|
|
37
|
+
});
|
|
38
|
+
}
|
|
46
39
|
}
|
|
47
40
|
|
|
48
41
|
exports.AbstractMailgunContentFirebaseServerNewUserService = AbstractMailgunContentFirebaseServerNewUserService;
|
package/mailgun/index.esm.js
CHANGED
|
@@ -4,43 +4,36 @@ import { AbstractFirebaseServerNewUserService } from '@dereekb/firebase-server';
|
|
|
4
4
|
* Abstract FirebaseServerNewUserService implementation that sends an email to a template on Mailgun.
|
|
5
5
|
*/
|
|
6
6
|
class AbstractMailgunContentFirebaseServerNewUserService extends AbstractFirebaseServerNewUserService {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
async sendSetupContentToUser(user) {
|
|
13
|
-
const userRecord = await user.userContext.loadRecord();
|
|
14
|
-
const {
|
|
15
|
-
setupPassword
|
|
16
|
-
} = user.claims;
|
|
17
|
-
const {
|
|
18
|
-
uid,
|
|
19
|
-
displayName,
|
|
20
|
-
email
|
|
21
|
-
} = userRecord;
|
|
22
|
-
if (!email) {
|
|
23
|
-
throw new Error(`Email is not present/available for the user record "${userRecord.uid}"`);
|
|
7
|
+
mailgunService;
|
|
8
|
+
constructor(authService, mailgunService) {
|
|
9
|
+
super(authService);
|
|
10
|
+
this.mailgunService = mailgunService;
|
|
24
11
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
to: {
|
|
32
|
-
name: baseRequestTo?.name,
|
|
33
|
-
email,
|
|
34
|
-
userVariables: {
|
|
35
|
-
setupPassword,
|
|
36
|
-
...baseRequestTo?.userVariables,
|
|
37
|
-
displayName,
|
|
38
|
-
uid
|
|
12
|
+
async sendSetupContentToUser(user) {
|
|
13
|
+
const userRecord = await user.userContext.loadRecord();
|
|
14
|
+
const { setupPassword } = user.claims;
|
|
15
|
+
const { uid, displayName, email } = userRecord;
|
|
16
|
+
if (!email) {
|
|
17
|
+
throw new Error(`Email is not present/available for the user record "${userRecord.uid}"`);
|
|
39
18
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
const baseRequest = await this.buildNewUserMailgunContentRequest(user);
|
|
20
|
+
const baseRequestTo = baseRequest.to;
|
|
21
|
+
await this.mailgunService.sendTemplateEmail({
|
|
22
|
+
batchSend: false, // do not use batch sending by default, as we should only be sending to one user
|
|
23
|
+
...baseRequest,
|
|
24
|
+
to: {
|
|
25
|
+
name: baseRequestTo?.name,
|
|
26
|
+
email,
|
|
27
|
+
userVariables: {
|
|
28
|
+
setupPassword,
|
|
29
|
+
...baseRequestTo?.userVariables,
|
|
30
|
+
displayName,
|
|
31
|
+
uid
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
sendTestEmails: baseRequest.sendTestEmails || user.sendDetailsInTestEnvironment || undefined
|
|
35
|
+
});
|
|
36
|
+
}
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
export { AbstractMailgunContentFirebaseServerNewUserService };
|
package/mailgun/package.json
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/mailgun",
|
|
3
|
-
"version": "13.0.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
"version": "13.0.2",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@dereekb/firebase": "13.0.2",
|
|
6
|
+
"@dereekb/firebase-server": "13.0.2",
|
|
7
|
+
"@dereekb/date": "13.0.2",
|
|
8
|
+
"@dereekb/nestjs": "13.0.2",
|
|
9
|
+
"@dereekb/model": "13.0.2",
|
|
10
|
+
"@dereekb/rxjs": "13.0.2",
|
|
11
|
+
"@dereekb/util": "13.0.2"
|
|
12
|
+
},
|
|
7
13
|
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
8
15
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"browser": {
|
|
14
|
-
"require": "./index.cjs.js",
|
|
15
|
-
"import": "./index.esm.js"
|
|
16
|
-
},
|
|
16
|
+
"module": "./index.esm.js",
|
|
17
|
+
"types": "./index.d.ts",
|
|
18
|
+
"import": "./index.cjs.mjs",
|
|
17
19
|
"default": "./index.cjs.js"
|
|
18
20
|
}
|
|
19
21
|
},
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"@dereekb/date": "13.0.0",
|
|
24
|
-
"@dereekb/nestjs": "13.0.0",
|
|
25
|
-
"@dereekb/model": "13.0.0",
|
|
26
|
-
"@dereekb/rxjs": "13.0.0",
|
|
27
|
-
"@dereekb/util": "13.0.0",
|
|
28
|
-
"core-js": "^3.0.0"
|
|
29
|
-
}
|
|
22
|
+
"module": "./index.esm.js",
|
|
23
|
+
"main": "./index.cjs.js",
|
|
24
|
+
"types": "./index.d.ts"
|
|
30
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./index.cjs.js').default;
|