@stacksjs/notifications 0.52.0 → 0.52.1
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/dist/index.cjs +3 -9
- package/dist/index.d.ts +1 -5
- package/dist/index.mjs +7 -12
- package/package.json +31 -31
package/dist/index.cjs
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const errorHandling = require('@stacksjs/error-handling');
|
|
4
4
|
const config = require('@stacksjs/config');
|
|
5
|
+
const cli = require('@stacksjs/cli');
|
|
6
|
+
const types = require('@stacksjs/types');
|
|
5
7
|
const email = require('@stacksjs/email');
|
|
6
8
|
const chat = require('@stacksjs/chat');
|
|
7
9
|
const sms = require('@stacksjs/sms');
|
|
8
|
-
const types = require('@stacksjs/types');
|
|
9
10
|
|
|
10
11
|
function _interopNamespaceCompat(e) {
|
|
11
12
|
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
@@ -34,7 +35,7 @@ function useSMS(driver = "twilio") {
|
|
|
34
35
|
}
|
|
35
36
|
function useNotification(typeParam = "email", driverParam = "mailtrap") {
|
|
36
37
|
if (!config.notification.default) {
|
|
37
|
-
log.error("No default notification type set in config/notification.ts");
|
|
38
|
+
cli.log.error("No default notification type set in config/notification.ts");
|
|
38
39
|
return process.exit(types.ExitCode.InvalidArgument);
|
|
39
40
|
}
|
|
40
41
|
const type = typeParam || config.notification.default;
|
|
@@ -50,14 +51,7 @@ function useNotification(typeParam = "email", driverParam = "mailtrap") {
|
|
|
50
51
|
return errorHandling.err(`Type ${type} not supported`);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
function notification() {
|
|
54
|
-
return useNotification();
|
|
55
|
-
}
|
|
56
54
|
|
|
57
|
-
exports.email = email__namespace;
|
|
58
|
-
exports.chat = chat__namespace;
|
|
59
|
-
exports.sms = sms__namespace;
|
|
60
|
-
exports.notification = notification;
|
|
61
55
|
exports.useChat = useChat;
|
|
62
56
|
exports.useEmail = useEmail;
|
|
63
57
|
exports.useNotification = useNotification;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import * as email from '@stacksjs/email';
|
|
2
|
-
export { email };
|
|
3
2
|
import * as chat from '@stacksjs/chat';
|
|
4
|
-
export { chat };
|
|
5
3
|
import * as sms from '@stacksjs/sms';
|
|
6
|
-
export { sms };
|
|
7
4
|
|
|
8
5
|
declare function useChat(driver?: string): typeof chat.slack | typeof chat.discord | typeof chat.teams;
|
|
9
6
|
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
7
|
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
8
|
declare function useNotification(typeParam?: string, driverParam?: string): typeof chat.slack;
|
|
12
|
-
declare function notification(): typeof chat.slack;
|
|
13
9
|
|
|
14
|
-
export {
|
|
10
|
+
export { useChat, useEmail, useNotification, useSMS };
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { err } from '@stacksjs/error-handling';
|
|
2
|
-
import { notification
|
|
2
|
+
import { notification } from '@stacksjs/config';
|
|
3
|
+
import { log } from '@stacksjs/cli';
|
|
4
|
+
import { ExitCode } from '@stacksjs/types';
|
|
3
5
|
import * as email from '@stacksjs/email';
|
|
4
|
-
export { email };
|
|
5
6
|
import * as chat from '@stacksjs/chat';
|
|
6
|
-
export { chat };
|
|
7
7
|
import * as sms from '@stacksjs/sms';
|
|
8
|
-
export { sms };
|
|
9
|
-
import { ExitCode } from '@stacksjs/types';
|
|
10
8
|
|
|
11
9
|
function useChat(driver = "slack") {
|
|
12
10
|
return chat[driver];
|
|
@@ -18,12 +16,12 @@ function useSMS(driver = "twilio") {
|
|
|
18
16
|
return sms[driver];
|
|
19
17
|
}
|
|
20
18
|
function useNotification(typeParam = "email", driverParam = "mailtrap") {
|
|
21
|
-
if (!notification
|
|
19
|
+
if (!notification.default) {
|
|
22
20
|
log.error("No default notification type set in config/notification.ts");
|
|
23
21
|
return process.exit(ExitCode.InvalidArgument);
|
|
24
22
|
}
|
|
25
|
-
const type = typeParam || notification
|
|
26
|
-
const driver = driverParam || notification
|
|
23
|
+
const type = typeParam || notification.default;
|
|
24
|
+
const driver = driverParam || notification.default;
|
|
27
25
|
switch (type) {
|
|
28
26
|
case "email":
|
|
29
27
|
return useEmail(driver);
|
|
@@ -35,8 +33,5 @@ function useNotification(typeParam = "email", driverParam = "mailtrap") {
|
|
|
35
33
|
return err(`Type ${type} not supported`);
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
|
-
function notification() {
|
|
39
|
-
return useNotification();
|
|
40
|
-
}
|
|
41
36
|
|
|
42
|
-
export {
|
|
37
|
+
export { useChat, useEmail, useNotification, useSMS };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/notifications",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.52.
|
|
4
|
+
"version": "0.52.1",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "The Stacks notifications integration.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -46,43 +46,43 @@
|
|
|
46
46
|
"README.md"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@stacksjs/chat": "0.52.
|
|
50
|
-
"@stacksjs/cli": "0.52.
|
|
51
|
-
"@stacksjs/config": "0.52.
|
|
52
|
-
"@stacksjs/email": "0.52.
|
|
53
|
-
"@stacksjs/
|
|
54
|
-
"@stacksjs/
|
|
55
|
-
"@stacksjs/sms": "0.52.
|
|
56
|
-
"@stacksjs/types": "0.52.
|
|
49
|
+
"@stacksjs/chat": "0.52.1",
|
|
50
|
+
"@stacksjs/cli": "0.52.1",
|
|
51
|
+
"@stacksjs/config": "0.52.1",
|
|
52
|
+
"@stacksjs/email": "0.52.1",
|
|
53
|
+
"@stacksjs/push": "0.52.1",
|
|
54
|
+
"@stacksjs/error-handling": "0.52.1",
|
|
55
|
+
"@stacksjs/sms": "0.52.1",
|
|
56
|
+
"@stacksjs/types": "0.52.1"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@maizzle/framework": "^4.4.4"
|
|
60
60
|
},
|
|
61
61
|
"optionalDependencies": {
|
|
62
|
-
"@novu/discord": "^0.
|
|
63
|
-
"@novu/emailjs": "^0.
|
|
64
|
-
"@novu/gupshup": "^0.
|
|
65
|
-
"@novu/mailgun": "^0.
|
|
66
|
-
"@novu/mailjet": "^0.
|
|
67
|
-
"@novu/mandrill": "^0.
|
|
68
|
-
"@novu/netcore": "^0.
|
|
69
|
-
"@novu/nexmo": "^0.
|
|
70
|
-
"@novu/node": "^0.
|
|
71
|
-
"@novu/nodemailer": "^0.
|
|
72
|
-
"@novu/plivo": "^0.
|
|
73
|
-
"@novu/postmark": "^0.
|
|
74
|
-
"@novu/sendgrid": "^0.
|
|
75
|
-
"@novu/ses": "^0.
|
|
76
|
-
"@novu/slack": "^0.
|
|
77
|
-
"@novu/sms77": "^0.
|
|
78
|
-
"@novu/sns": "^0.
|
|
79
|
-
"@novu/stateless": "^0.
|
|
80
|
-
"@novu/telnyx": "^0.
|
|
81
|
-
"@novu/termii": "^0.
|
|
82
|
-
"@novu/twilio": "^0.
|
|
62
|
+
"@novu/discord": "^0.15.0",
|
|
63
|
+
"@novu/emailjs": "^0.15.0",
|
|
64
|
+
"@novu/gupshup": "^0.15.0",
|
|
65
|
+
"@novu/mailgun": "^0.15.0",
|
|
66
|
+
"@novu/mailjet": "^0.15.0",
|
|
67
|
+
"@novu/mandrill": "^0.15.0",
|
|
68
|
+
"@novu/netcore": "^0.15.0",
|
|
69
|
+
"@novu/nexmo": "^0.15.0",
|
|
70
|
+
"@novu/node": "^0.15.0",
|
|
71
|
+
"@novu/nodemailer": "^0.15.0",
|
|
72
|
+
"@novu/plivo": "^0.15.0",
|
|
73
|
+
"@novu/postmark": "^0.15.0",
|
|
74
|
+
"@novu/sendgrid": "^0.15.0",
|
|
75
|
+
"@novu/ses": "^0.15.0",
|
|
76
|
+
"@novu/slack": "^0.15.0",
|
|
77
|
+
"@novu/sms77": "^0.15.0",
|
|
78
|
+
"@novu/sns": "^0.15.0",
|
|
79
|
+
"@novu/stateless": "^0.15.0",
|
|
80
|
+
"@novu/telnyx": "^0.15.0",
|
|
81
|
+
"@novu/termii": "^0.15.0",
|
|
82
|
+
"@novu/twilio": "^0.15.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@stacksjs/development": "0.52.
|
|
85
|
+
"@stacksjs/development": "0.52.1"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "unbuild",
|