@stacksjs/notifications 0.50.0 → 0.52.0
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/README.md +1 -1
- package/dist/config.cjs +1 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +1 -3
- package/dist/index.cjs +19 -13
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +14 -9
- package/package.json +41 -41
package/README.md
CHANGED
|
@@ -243,7 +243,7 @@ pnpm test
|
|
|
243
243
|
|
|
244
244
|
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
|
|
245
245
|
|
|
246
|
-
##
|
|
246
|
+
## 🚜 Contributing
|
|
247
247
|
|
|
248
248
|
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
|
|
249
249
|
|
package/dist/config.cjs
CHANGED
package/dist/config.d.ts
CHANGED
package/dist/config.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -5,8 +5,10 @@ const config = require('@stacksjs/config');
|
|
|
5
5
|
const email = require('@stacksjs/email');
|
|
6
6
|
const chat = require('@stacksjs/chat');
|
|
7
7
|
const sms = require('@stacksjs/sms');
|
|
8
|
+
const types = require('@stacksjs/types');
|
|
8
9
|
|
|
9
|
-
function
|
|
10
|
+
function _interopNamespaceCompat(e) {
|
|
11
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
10
12
|
const n = Object.create(null);
|
|
11
13
|
if (e) {
|
|
12
14
|
for (const k in e) {
|
|
@@ -17,22 +19,26 @@ function _interopNamespaceDefault(e) {
|
|
|
17
19
|
return n;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
const email__namespace = /*#__PURE__*/
|
|
21
|
-
const chat__namespace = /*#__PURE__*/
|
|
22
|
-
const sms__namespace = /*#__PURE__*/
|
|
22
|
+
const email__namespace = /*#__PURE__*/_interopNamespaceCompat(email);
|
|
23
|
+
const chat__namespace = /*#__PURE__*/_interopNamespaceCompat(chat);
|
|
24
|
+
const sms__namespace = /*#__PURE__*/_interopNamespaceCompat(sms);
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
function useChat(driver = "slack") {
|
|
25
27
|
return chat__namespace[driver];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
+
}
|
|
29
|
+
function useEmail(driver = "mailtrap") {
|
|
28
30
|
return email__namespace[driver];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
+
}
|
|
32
|
+
function useSMS(driver = "twilio") {
|
|
31
33
|
return sms__namespace[driver];
|
|
32
|
-
}
|
|
33
|
-
function useNotification(typeParam = "email", driverParam = "
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
}
|
|
35
|
+
function useNotification(typeParam = "email", driverParam = "mailtrap") {
|
|
36
|
+
if (!config.notification.default) {
|
|
37
|
+
log.error("No default notification type set in config/notification.ts");
|
|
38
|
+
return process.exit(types.ExitCode.InvalidArgument);
|
|
39
|
+
}
|
|
40
|
+
const type = typeParam || config.notification.default;
|
|
41
|
+
const driver = driverParam || config.notification.default;
|
|
36
42
|
switch (type) {
|
|
37
43
|
case "email":
|
|
38
44
|
return useEmail(driver);
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export { chat };
|
|
|
5
5
|
import * as sms from '@stacksjs/sms';
|
|
6
6
|
export { sms };
|
|
7
7
|
|
|
8
|
-
declare
|
|
9
|
-
declare
|
|
10
|
-
declare
|
|
11
|
-
declare function useNotification(typeParam?: string, driverParam?: string):
|
|
12
|
-
declare function notification():
|
|
8
|
+
declare function useChat(driver?: string): typeof chat.slack | typeof chat.discord | typeof chat.teams;
|
|
9
|
+
declare function useEmail(driver?: string): typeof email.sendgrid | typeof email.mailgun | typeof email.mailjet | typeof email.mandrill | typeof email.netcore | typeof email.nodemailer | typeof email.postmark | typeof email.ses | typeof email.emailjs;
|
|
10
|
+
declare function useSMS(driver?: string): typeof sms.twilio | typeof sms.plivo | typeof sms.nexmo | typeof sms.sms77 | typeof sms.sns | typeof sms.gupshup | typeof sms.telnyx | typeof sms.termii;
|
|
11
|
+
declare function useNotification(typeParam?: string, driverParam?: string): typeof chat.slack;
|
|
12
|
+
declare function notification(): typeof chat.slack;
|
|
13
13
|
|
|
14
14
|
export { notification, useChat, useEmail, useNotification, useSMS };
|
package/dist/index.mjs
CHANGED
|
@@ -6,19 +6,24 @@ import * as chat from '@stacksjs/chat';
|
|
|
6
6
|
export { chat };
|
|
7
7
|
import * as sms from '@stacksjs/sms';
|
|
8
8
|
export { sms };
|
|
9
|
+
import { ExitCode } from '@stacksjs/types';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
function useChat(driver = "slack") {
|
|
11
12
|
return chat[driver];
|
|
12
|
-
}
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
function useEmail(driver = "mailtrap") {
|
|
14
15
|
return email[driver];
|
|
15
|
-
}
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
function useSMS(driver = "twilio") {
|
|
17
18
|
return sms[driver];
|
|
18
|
-
}
|
|
19
|
-
function useNotification(typeParam = "email", driverParam = "
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
}
|
|
20
|
+
function useNotification(typeParam = "email", driverParam = "mailtrap") {
|
|
21
|
+
if (!notification$1.default) {
|
|
22
|
+
log.error("No default notification type set in config/notification.ts");
|
|
23
|
+
return process.exit(ExitCode.InvalidArgument);
|
|
24
|
+
}
|
|
25
|
+
const type = typeParam || notification$1.default;
|
|
26
|
+
const driver = driverParam || notification$1.default;
|
|
22
27
|
switch (type) {
|
|
23
28
|
case "email":
|
|
24
29
|
return useEmail(driver);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/notifications",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@
|
|
4
|
+
"version": "0.52.0",
|
|
5
|
+
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "The Stacks notifications integration.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -30,7 +30,12 @@
|
|
|
30
30
|
"stacks",
|
|
31
31
|
"maizzle"
|
|
32
32
|
],
|
|
33
|
-
"
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.mjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
34
39
|
"module": "dist/index.mjs",
|
|
35
40
|
"types": "dist/index.d.ts",
|
|
36
41
|
"contributors": [
|
|
@@ -40,49 +45,44 @@
|
|
|
40
45
|
"dist",
|
|
41
46
|
"README.md"
|
|
42
47
|
],
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=v18.13.0",
|
|
45
|
-
"pnpm": ">=7.25.1"
|
|
46
|
-
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@novu/node": "^0.10.2",
|
|
57
|
-
"@novu/nodemailer": "^0.10.2",
|
|
58
|
-
"@novu/plivo": "^0.10.2",
|
|
59
|
-
"@novu/postmark": "^0.10.2",
|
|
60
|
-
"@novu/sendgrid": "^0.10.2",
|
|
61
|
-
"@novu/ses": "^0.10.2",
|
|
62
|
-
"@novu/slack": "^0.10.2",
|
|
63
|
-
"@novu/sms77": "^0.10.2",
|
|
64
|
-
"@novu/sns": "^0.10.2",
|
|
65
|
-
"@novu/stateless": "^0.10.2",
|
|
66
|
-
"@novu/telnyx": "^0.10.2",
|
|
67
|
-
"@novu/termii": "^0.10.2",
|
|
68
|
-
"@novu/twilio": "^0.10.2",
|
|
69
|
-
"@stacksjs/chat": "0.50.0",
|
|
70
|
-
"@stacksjs/cli": "0.50.0",
|
|
71
|
-
"@stacksjs/config": "0.50.0",
|
|
72
|
-
"@stacksjs/email": "0.50.0",
|
|
73
|
-
"@stacksjs/error-handling": "0.50.0",
|
|
74
|
-
"@stacksjs/push": "0.50.0",
|
|
75
|
-
"@stacksjs/sms": "0.50.0",
|
|
76
|
-
"@stacksjs/types": "0.50.0"
|
|
49
|
+
"@stacksjs/chat": "0.52.0",
|
|
50
|
+
"@stacksjs/cli": "0.52.0",
|
|
51
|
+
"@stacksjs/config": "0.52.0",
|
|
52
|
+
"@stacksjs/email": "0.52.0",
|
|
53
|
+
"@stacksjs/error-handling": "0.52.0",
|
|
54
|
+
"@stacksjs/push": "0.52.0",
|
|
55
|
+
"@stacksjs/sms": "0.52.0",
|
|
56
|
+
"@stacksjs/types": "0.52.0"
|
|
77
57
|
},
|
|
78
58
|
"dependencies": {
|
|
79
|
-
"@maizzle/framework": "^4.
|
|
59
|
+
"@maizzle/framework": "^4.4.4"
|
|
60
|
+
},
|
|
61
|
+
"optionalDependencies": {
|
|
62
|
+
"@novu/discord": "^0.14.0",
|
|
63
|
+
"@novu/emailjs": "^0.14.0",
|
|
64
|
+
"@novu/gupshup": "^0.14.0",
|
|
65
|
+
"@novu/mailgun": "^0.14.0",
|
|
66
|
+
"@novu/mailjet": "^0.14.0",
|
|
67
|
+
"@novu/mandrill": "^0.14.0",
|
|
68
|
+
"@novu/netcore": "^0.14.0",
|
|
69
|
+
"@novu/nexmo": "^0.14.0",
|
|
70
|
+
"@novu/node": "^0.14.0",
|
|
71
|
+
"@novu/nodemailer": "^0.14.0",
|
|
72
|
+
"@novu/plivo": "^0.14.0",
|
|
73
|
+
"@novu/postmark": "^0.14.0",
|
|
74
|
+
"@novu/sendgrid": "^0.14.0",
|
|
75
|
+
"@novu/ses": "^0.14.0",
|
|
76
|
+
"@novu/slack": "^0.14.0",
|
|
77
|
+
"@novu/sms77": "^0.14.0",
|
|
78
|
+
"@novu/sns": "^0.14.0",
|
|
79
|
+
"@novu/stateless": "^0.14.0",
|
|
80
|
+
"@novu/telnyx": "^0.14.0",
|
|
81
|
+
"@novu/termii": "^0.14.0",
|
|
82
|
+
"@novu/twilio": "^0.14.0"
|
|
80
83
|
},
|
|
81
84
|
"devDependencies": {
|
|
82
|
-
"
|
|
83
|
-
"typescript": "^4.9.4",
|
|
84
|
-
"unbuild": "^1.1.1",
|
|
85
|
-
"@stacksjs/testing": "0.50.0"
|
|
85
|
+
"@stacksjs/development": "0.52.0"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "unbuild",
|