@stacksjs/notifications 0.51.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 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
- ## 💪🏼 Contributing
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
@@ -1,9 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const config$1 = require('@stacksjs/config');
4
-
5
3
  const config = {
6
- purgeCSS: config$1.notification.email.purgeCSS
4
+ purgeCSS: {}
7
5
  };
8
6
 
9
7
  module.exports = config;
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare const _default: {
2
- purgeCSS: boolean;
2
+ purgeCSS: {};
3
3
  };
4
4
 
5
5
  export { _default as default };
package/dist/config.mjs CHANGED
@@ -1,7 +1,5 @@
1
- import { notification } from '@stacksjs/config';
2
-
3
1
  const config = {
4
- purgeCSS: notification.email.purgeCSS
2
+ purgeCSS: {}
5
3
  };
6
4
 
7
5
  export { config as default };
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 _interopNamespaceDefault(e) {
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__*/_interopNamespaceDefault(email);
21
- const chat__namespace = /*#__PURE__*/_interopNamespaceDefault(chat);
22
- const sms__namespace = /*#__PURE__*/_interopNamespaceDefault(sms);
22
+ const email__namespace = /*#__PURE__*/_interopNamespaceCompat(email);
23
+ const chat__namespace = /*#__PURE__*/_interopNamespaceCompat(chat);
24
+ const sms__namespace = /*#__PURE__*/_interopNamespaceCompat(sms);
23
25
 
24
- const useChat = (driver = "slack") => {
26
+ function useChat(driver = "slack") {
25
27
  return chat__namespace[driver];
26
- };
27
- const useEmail = (driver = "sendgrid") => {
28
+ }
29
+ function useEmail(driver = "mailtrap") {
28
30
  return email__namespace[driver];
29
- };
30
- const useSMS = (driver = "twilio") => {
31
+ }
32
+ function useSMS(driver = "twilio") {
31
33
  return sms__namespace[driver];
32
- };
33
- function useNotification(typeParam = "email", driverParam = "sendgrid") {
34
- const type = typeParam || config.notification.type;
35
- const driver = driverParam || config.notification.driver;
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 const useChat: (driver?: string) => typeof chat.slack | typeof chat.discord;
9
- declare const useEmail: (driver?: string) => typeof email.sendgrid | typeof email.emailjs | typeof email.mailjet | typeof email.mandrill | typeof email.netcore | typeof email.nodemailer | typeof email.postmark | typeof email.ses | typeof email.mailgun;
10
- declare const useSMS: (driver?: string) => typeof sms.twilio | typeof sms.nexmo | typeof sms.gupshup | typeof sms.plivo | typeof sms.sms77 | typeof sms.sns | typeof sms.telnyx | typeof sms.termii;
11
- declare function useNotification(typeParam?: string, driverParam?: string): any;
12
- declare function notification(): any;
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
- const useChat = (driver = "slack") => {
11
+ function useChat(driver = "slack") {
11
12
  return chat[driver];
12
- };
13
- const useEmail = (driver = "sendgrid") => {
13
+ }
14
+ function useEmail(driver = "mailtrap") {
14
15
  return email[driver];
15
- };
16
- const useSMS = (driver = "twilio") => {
16
+ }
17
+ function useSMS(driver = "twilio") {
17
18
  return sms[driver];
18
- };
19
- function useNotification(typeParam = "email", driverParam = "sendgrid") {
20
- const type = typeParam || notification$1.type;
21
- const driver = driverParam || notification$1.driver;
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.51.0",
5
- "packageManager": "pnpm@7.26.3",
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
- "main": "dist/index.mjs",
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.14.0",
45
- "pnpm": ">=7.26.3"
46
- },
47
48
  "peerDependencies": {
48
- "@novu/discord": "^0.11.0",
49
- "@novu/emailjs": "^0.11.0",
50
- "@novu/gupshup": "^0.11.0",
51
- "@novu/mailgun": "^0.11.0",
52
- "@novu/mailjet": "^0.11.0",
53
- "@novu/mandrill": "^0.11.0",
54
- "@novu/netcore": "^0.11.0",
55
- "@novu/nexmo": "^0.11.0",
56
- "@novu/node": "^0.11.0",
57
- "@novu/nodemailer": "^0.11.0",
58
- "@novu/plivo": "^0.11.0",
59
- "@novu/postmark": "^0.11.0",
60
- "@novu/sendgrid": "^0.11.0",
61
- "@novu/ses": "^0.11.0",
62
- "@novu/slack": "^0.11.0",
63
- "@novu/sms77": "^0.11.0",
64
- "@novu/sns": "^0.11.0",
65
- "@novu/stateless": "^0.11.0",
66
- "@novu/telnyx": "^0.11.0",
67
- "@novu/termii": "^0.11.0",
68
- "@novu/twilio": "^0.11.0",
69
- "@stacksjs/chat": "0.51.0",
70
- "@stacksjs/cli": "0.51.0",
71
- "@stacksjs/config": "0.51.0",
72
- "@stacksjs/email": "0.51.0",
73
- "@stacksjs/error-handling": "0.51.0",
74
- "@stacksjs/push": "0.51.0",
75
- "@stacksjs/sms": "0.51.0",
76
- "@stacksjs/types": "0.51.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.3.1"
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
- "mkdist": "^1.1.0",
83
- "typescript": "^4.9.5",
84
- "unbuild": "^1.1.1",
85
- "@stacksjs/testing": "0.51.0"
85
+ "@stacksjs/development": "0.52.0"
86
86
  },
87
87
  "scripts": {
88
88
  "build": "unbuild",