@stacksjs/notifications 0.56.35 → 0.57.3
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.d.ts +1 -1
- package/dist/index.mjs +2 -1
- package/package.json +11 -11
- package/dist/config.cjs +0 -7
- package/dist/config.d.ts +0 -5
- package/dist/config.mjs +0 -5
- package/dist/index.cjs +0 -58
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as email from '@stacksjs/email';
|
|
2
1
|
import * as chat from '@stacksjs/chat';
|
|
2
|
+
import * as email from '@stacksjs/email';
|
|
3
3
|
import * as sms from '@stacksjs/sms';
|
|
4
4
|
|
|
5
5
|
declare function useChat(driver?: string): typeof chat.slack | typeof chat.discord | typeof chat.teams;
|
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,9 @@ import { err } from '@stacksjs/error-handling';
|
|
|
2
2
|
import { notification } from '@stacksjs/config';
|
|
3
3
|
import { log } from '@stacksjs/cli';
|
|
4
4
|
import { ExitCode } from '@stacksjs/types';
|
|
5
|
-
import * as email from '@stacksjs/email';
|
|
6
5
|
import * as chat from '@stacksjs/chat';
|
|
6
|
+
import * as email from '@stacksjs/email';
|
|
7
|
+
import '@stacksjs/push';
|
|
7
8
|
import * as sms from '@stacksjs/sms';
|
|
8
9
|
|
|
9
10
|
function useChat(driver = "slack") {
|
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@8.6.
|
|
4
|
+
"version": "0.57.3",
|
|
5
|
+
"packageManager": "pnpm@8.6.6",
|
|
6
6
|
"description": "The Stacks notifications integration.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"README.md"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@stacksjs/chat": "0.
|
|
50
|
-
"@stacksjs/cli": "0.
|
|
51
|
-
"@stacksjs/config": "0.
|
|
52
|
-
"@stacksjs/email": "0.
|
|
53
|
-
"@stacksjs/error-handling": "0.
|
|
54
|
-
"@stacksjs/push": "0.
|
|
55
|
-
"@stacksjs/sms": "0.
|
|
56
|
-
"@stacksjs/types": "0.
|
|
49
|
+
"@stacksjs/chat": "0.57.3",
|
|
50
|
+
"@stacksjs/cli": "0.57.3",
|
|
51
|
+
"@stacksjs/config": "0.57.3",
|
|
52
|
+
"@stacksjs/email": "0.57.3",
|
|
53
|
+
"@stacksjs/error-handling": "0.57.3",
|
|
54
|
+
"@stacksjs/push": "0.57.3",
|
|
55
|
+
"@stacksjs/sms": "0.57.3",
|
|
56
|
+
"@stacksjs/types": "0.57.3"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@maizzle/framework": "^4.4.6"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@novu/twilio": "^0.16.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@stacksjs/development": "0.
|
|
85
|
+
"@stacksjs/development": "0.57.3"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "unbuild",
|
package/dist/config.cjs
DELETED
package/dist/config.d.ts
DELETED
package/dist/config.mjs
DELETED
package/dist/index.cjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const errorHandling = require('@stacksjs/error-handling');
|
|
4
|
-
const config = require('@stacksjs/config');
|
|
5
|
-
const cli = require('@stacksjs/cli');
|
|
6
|
-
const types = require('@stacksjs/types');
|
|
7
|
-
const email = require('@stacksjs/email');
|
|
8
|
-
const chat = require('@stacksjs/chat');
|
|
9
|
-
const sms = require('@stacksjs/sms');
|
|
10
|
-
|
|
11
|
-
function _interopNamespaceCompat(e) {
|
|
12
|
-
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
13
|
-
const n = Object.create(null);
|
|
14
|
-
if (e) {
|
|
15
|
-
for (const k in e) {
|
|
16
|
-
n[k] = e[k];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return n;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const email__namespace = /*#__PURE__*/_interopNamespaceCompat(email);
|
|
24
|
-
const chat__namespace = /*#__PURE__*/_interopNamespaceCompat(chat);
|
|
25
|
-
const sms__namespace = /*#__PURE__*/_interopNamespaceCompat(sms);
|
|
26
|
-
|
|
27
|
-
function useChat(driver = "slack") {
|
|
28
|
-
return chat__namespace[driver];
|
|
29
|
-
}
|
|
30
|
-
function useEmail(driver = "mailtrap") {
|
|
31
|
-
return email__namespace[driver];
|
|
32
|
-
}
|
|
33
|
-
function useSMS(driver = "twilio") {
|
|
34
|
-
return sms__namespace[driver];
|
|
35
|
-
}
|
|
36
|
-
function useNotification(typeParam = "email", driverParam = "mailtrap") {
|
|
37
|
-
if (!config.notification.default) {
|
|
38
|
-
cli.log.error("No default notification type set in config/notification.ts");
|
|
39
|
-
return process.exit(types.ExitCode.InvalidArgument);
|
|
40
|
-
}
|
|
41
|
-
const type = typeParam || config.notification.default;
|
|
42
|
-
const driver = driverParam || config.notification.default;
|
|
43
|
-
switch (type) {
|
|
44
|
-
case "email":
|
|
45
|
-
return useEmail(driver);
|
|
46
|
-
case "chat":
|
|
47
|
-
return useChat(driver);
|
|
48
|
-
case "sms":
|
|
49
|
-
return useSMS(driver);
|
|
50
|
-
default:
|
|
51
|
-
return errorHandling.err(`Type ${type} not supported`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
exports.useChat = useChat;
|
|
56
|
-
exports.useEmail = useEmail;
|
|
57
|
-
exports.useNotification = useNotification;
|
|
58
|
-
exports.useSMS = useSMS;
|