@stacksjs/notifications 0.42.2 โ†’ 0.43.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.
Files changed (48) hide show
  1. package/README.md +30 -0
  2. package/dist/drivers/chat/discord.d.ts +4 -0
  3. package/dist/drivers/chat/discord.mjs +11 -0
  4. package/dist/drivers/chat/index.d.ts +2 -0
  5. package/dist/drivers/chat/index.mjs +2 -0
  6. package/dist/drivers/chat/slack.d.ts +4 -0
  7. package/dist/drivers/chat/slack.mjs +17 -0
  8. package/dist/drivers/email/emailjs.d.ts +4 -0
  9. package/dist/drivers/email/emailjs.mjs +20 -0
  10. package/dist/drivers/email/index.d.ts +9 -0
  11. package/dist/drivers/email/index.mjs +9 -0
  12. package/dist/drivers/email/mailgun.d.ts +4 -0
  13. package/dist/drivers/email/mailgun.mjs +18 -0
  14. package/dist/drivers/email/mailjet.d.ts +4 -0
  15. package/dist/drivers/email/mailjet.mjs +17 -0
  16. package/dist/drivers/email/mandrill.d.ts +4 -0
  17. package/dist/drivers/email/mandrill.mjs +16 -0
  18. package/dist/drivers/email/netcore.d.ts +4 -0
  19. package/dist/drivers/email/netcore.mjs +16 -0
  20. package/dist/drivers/email/nodemailer.d.ts +4 -0
  21. package/dist/drivers/email/nodemailer.mjs +20 -0
  22. package/dist/drivers/email/postmark.d.ts +4 -0
  23. package/dist/drivers/email/postmark.mjs +16 -0
  24. package/dist/drivers/email/sendgrid.d.ts +4 -0
  25. package/dist/drivers/email/sendgrid.mjs +17 -0
  26. package/dist/drivers/email/ses.d.ts +4 -0
  27. package/dist/drivers/email/ses.mjs +18 -0
  28. package/dist/drivers/sms/gupshup.d.ts +4 -0
  29. package/dist/drivers/sms/gupshup.mjs +16 -0
  30. package/dist/drivers/sms/index.d.ts +8 -0
  31. package/dist/drivers/sms/index.mjs +8 -0
  32. package/dist/drivers/sms/nexmo.d.ts +4 -0
  33. package/dist/drivers/sms/nexmo.mjs +17 -0
  34. package/dist/drivers/sms/plivo.d.ts +4 -0
  35. package/dist/drivers/sms/plivo.mjs +17 -0
  36. package/dist/drivers/sms/sms77.d.ts +4 -0
  37. package/dist/drivers/sms/sms77.mjs +16 -0
  38. package/dist/drivers/sms/sns.d.ts +4 -0
  39. package/dist/drivers/sms/sns.mjs +17 -0
  40. package/dist/drivers/sms/telnyx.d.ts +4 -0
  41. package/dist/drivers/sms/telnyx.mjs +17 -0
  42. package/dist/drivers/sms/termii.d.ts +4 -0
  43. package/dist/drivers/sms/termii.mjs +16 -0
  44. package/dist/drivers/sms/twilio.d.ts +4 -0
  45. package/dist/drivers/sms/twilio.mjs +17 -0
  46. package/dist/index.d.ts +3 -1
  47. package/dist/index.mjs +3 -2
  48. package/package.json +31 -4
package/README.md CHANGED
@@ -26,6 +26,36 @@ import notifications from '@stacksjs/notifications'
26
26
  // wip
27
27
  ```
28
28
 
29
+ ## ๐Ÿค– Drivers
30
+
31
+ ### Email
32
+
33
+ - Sendgrid
34
+ - Mailgun
35
+ - Mailjet
36
+ - Netcore
37
+ - Nodemailer
38
+ - Post Mark
39
+ - Ses
40
+ - Mandrill
41
+ - EmailJS
42
+
43
+ ### SMS
44
+
45
+ - Twilio
46
+ - Nexmo
47
+ - Gupshup
48
+ - Plivo
49
+ - SMS77
50
+ - SNS
51
+ - Telnyx
52
+ - Termii
53
+
54
+ ### Chat
55
+
56
+ - Discord
57
+ - Slack
58
+
29
59
  Learn more in the docs.
30
60
 
31
61
  ## ๐Ÿงช Testing
@@ -0,0 +1,4 @@
1
+ import type { ChatOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: ChatOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,11 @@
1
+ import { DiscordProvider } from "@novu/discord";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ const provider = new DiscordProvider({});
5
+ function send(options) {
6
+ return ResultAsync.fromPromise(
7
+ provider.sendMessage(options),
8
+ () => new Error(`Failed to send message using provider: ${italic("Discord")}`)
9
+ );
10
+ }
11
+ export { send as Send, send };
@@ -0,0 +1,2 @@
1
+ export * as discord from './discord';
2
+ export * as slack from './slack';
@@ -0,0 +1,2 @@
1
+ export * as discord from "./discord.mjs";
2
+ export * as slack from "./slack.mjs";
@@ -0,0 +1,4 @@
1
+ import type { ChatOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: ChatOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { SlackProvider } from "@novu/slack";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.chat.slack;
6
+ const provider = new SlackProvider({
7
+ applicationId: env.appId,
8
+ clientId: env.clientID,
9
+ secretKey: env.secret
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("Slack")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,20 @@
1
+ import { EmailJsProvider } from "@novu/emailjs";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.emailjs;
6
+ const provider = new EmailJsProvider({
7
+ from: env.from,
8
+ host: env.host,
9
+ user: env.user,
10
+ password: env.password,
11
+ port: env.port,
12
+ secure: env.secure
13
+ });
14
+ function send(options) {
15
+ return ResultAsync.fromPromise(
16
+ provider.sendMessage(options),
17
+ () => new Error(`Failed to send message using provider: ${italic("EmailJS")}`)
18
+ );
19
+ }
20
+ export { send as Send, send };
@@ -0,0 +1,9 @@
1
+ export * as sendgrid from './sendgrid';
2
+ export * as mailgun from './mailgun';
3
+ export * as mailjet from './mailjet';
4
+ export * as mandrill from './mandrill';
5
+ export * as netcore from './netcore';
6
+ export * as nodemailer from './nodemailer';
7
+ export * as postmark from './postmark';
8
+ export * as ses from './ses';
9
+ export * as emailjs from './emailjs';
@@ -0,0 +1,9 @@
1
+ export * as sendgrid from "./sendgrid.mjs";
2
+ export * as mailgun from "./mailgun.mjs";
3
+ export * as mailjet from "./mailjet.mjs";
4
+ export * as mandrill from "./mandrill.mjs";
5
+ export * as netcore from "./netcore.mjs";
6
+ export * as nodemailer from "./nodemailer.mjs";
7
+ export * as postmark from "./postmark.mjs";
8
+ export * as ses from "./ses.mjs";
9
+ export * as emailjs from "./emailjs.mjs";
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,18 @@
1
+ import { MailgunEmailProvider } from "@novu/mailgun";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.mailgun;
6
+ const provider = new MailgunEmailProvider({
7
+ apiKey: env.key,
8
+ domain: env.domain,
9
+ username: env.username,
10
+ from: env.from
11
+ });
12
+ function send(options) {
13
+ return ResultAsync.fromPromise(
14
+ provider.sendMessage(options),
15
+ () => new Error(`Failed to send message using provider: ${italic("Mailgun")}`)
16
+ );
17
+ }
18
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { MailjetEmailProvider } from "@novu/mailjet";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.mailjet;
6
+ const provider = new MailjetEmailProvider({
7
+ apiKey: env.key,
8
+ apiSecret: env.secret,
9
+ from: env.from
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("Mailjet")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,16 @@
1
+ import { MandrillProvider } from "@novu/mandrill";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.mandrill;
6
+ const provider = new MandrillProvider({
7
+ apiKey: env.key,
8
+ from: env.from
9
+ });
10
+ function send(options) {
11
+ return ResultAsync.fromPromise(
12
+ provider.sendMessage(options),
13
+ () => new Error(`Failed to send message using provider: ${italic("Mandrill")}`)
14
+ );
15
+ }
16
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,16 @@
1
+ import { NetCoreProvider } from "@novu/netcore";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.netcore;
6
+ const provider = new NetCoreProvider({
7
+ apiKey: env.key,
8
+ from: env.from
9
+ });
10
+ function send(options) {
11
+ return ResultAsync.fromPromise(
12
+ provider.sendMessage(options),
13
+ () => new Error(`Failed to send message using provider: ${italic("Netcore")}`)
14
+ );
15
+ }
16
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,20 @@
1
+ import { NodemailerProvider } from "@novu/nodemailer";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.nodemailer;
6
+ const provider = new NodemailerProvider({
7
+ from: env.from,
8
+ host: env.host,
9
+ user: env.user,
10
+ password: env.password,
11
+ port: env.port,
12
+ secure: env.secure
13
+ });
14
+ function send(options) {
15
+ return ResultAsync.fromPromise(
16
+ provider.sendMessage(options),
17
+ () => new Error(`Failed to send message using provider: ${italic("Nodemailer")}`)
18
+ );
19
+ }
20
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,16 @@
1
+ import { PostmarkEmailProvider } from "@novu/postmark";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.postmark;
6
+ const provider = new PostmarkEmailProvider({
7
+ apiKey: env.key,
8
+ from: env.from
9
+ });
10
+ function send(options) {
11
+ return ResultAsync.fromPromise(
12
+ provider.sendMessage(options),
13
+ () => new Error(`Failed to send message using provider: ${italic("PostMark")}`)
14
+ );
15
+ }
16
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { SendgridEmailProvider } from "@novu/sendgrid";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.sendgrid;
6
+ const provider = new SendgridEmailProvider({
7
+ apiKey: env.key,
8
+ from: env.from,
9
+ senderName: env.senderName
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("Sendgrid")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { EmailOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: EmailOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,18 @@
1
+ import { SESEmailProvider } from "@novu/ses";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.email.ses;
6
+ const provider = new SESEmailProvider({
7
+ region: env.region,
8
+ accessKeyId: env.key,
9
+ secretAccessKey: env.secret,
10
+ from: env.from
11
+ });
12
+ function send(options) {
13
+ return ResultAsync.fromPromise(
14
+ provider.sendMessage(options),
15
+ () => new Error(`Failed to send message using provider: ${italic("SES")}`)
16
+ );
17
+ }
18
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,16 @@
1
+ import { GupshupSmsProvider } from "@novu/gupshup";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.gupshup;
6
+ const provider = new GupshupSmsProvider({
7
+ userId: env.user,
8
+ password: env.password
9
+ });
10
+ function send(options) {
11
+ return ResultAsync.fromPromise(
12
+ provider.sendMessage(options),
13
+ () => new Error(`Failed to send message using provider: ${italic("Gupshup")}`)
14
+ );
15
+ }
16
+ export { send as Send, send };
@@ -0,0 +1,8 @@
1
+ export * as twilio from './twilio';
2
+ export * as plivo from './plivo';
3
+ export * as nexmo from './nexmo';
4
+ export * as sms77 from './sms77';
5
+ export * as sns from './sns';
6
+ export * as gupshup from './gupshup';
7
+ export * as telnyx from './telnyx';
8
+ export * as termii from './termii';
@@ -0,0 +1,8 @@
1
+ export * as twilio from "./twilio.mjs";
2
+ export * as plivo from "./plivo.mjs";
3
+ export * as nexmo from "./nexmo.mjs";
4
+ export * as sms77 from "./sms77.mjs";
5
+ export * as sns from "./sns.mjs";
6
+ export * as gupshup from "./gupshup.mjs";
7
+ export * as telnyx from "./telnyx.mjs";
8
+ export * as termii from "./termii.mjs";
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { NexmoSmsProvider } from "@novu/nexmo";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.nexmo;
6
+ const provider = new NexmoSmsProvider({
7
+ apiKey: env.key,
8
+ apiSecret: env.secret,
9
+ from: env.from
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("Nexmo")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { PlivoSmsProvider } from "@novu/plivo";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.plivo;
6
+ const provider = new PlivoSmsProvider({
7
+ accountSid: env.sid,
8
+ authToken: env.authToken,
9
+ from: env.from
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("Plivo")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,16 @@
1
+ import { Sms77SmsProvider } from "@novu/sms77";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.sms77;
6
+ const provider = new Sms77SmsProvider({
7
+ apiKey: env.key,
8
+ from: env.from
9
+ });
10
+ function send(options) {
11
+ return ResultAsync.fromPromise(
12
+ provider.sendMessage(options),
13
+ () => new Error(`Failed to send message using provider: ${italic("Sms77")}`)
14
+ );
15
+ }
16
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { SNSSmsProvider } from "@novu/sns";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.sns;
6
+ const provider = new SNSSmsProvider({
7
+ region: env.region,
8
+ accessKeyId: env.key,
9
+ secretAccessKey: env.secret
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("SNS")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { TelnyxSmsProvider } from "@novu/telnyx";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.telnyx;
6
+ const provider = new TelnyxSmsProvider({
7
+ apiKey: env.key,
8
+ messageProfileId: env.messageProfileId,
9
+ from: env.from
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("Telnyx")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,16 @@
1
+ import { TermiiSmsProvider } from "@novu/termii";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.termii;
6
+ const provider = new TermiiSmsProvider({
7
+ apiKey: env.key,
8
+ from: env.from
9
+ });
10
+ function send(options) {
11
+ return ResultAsync.fromPromise(
12
+ provider.sendMessage(options),
13
+ () => new Error(`Failed to send message using provider: ${italic("Termii")}`)
14
+ );
15
+ }
16
+ export { send as Send, send };
@@ -0,0 +1,4 @@
1
+ import type { SmsOptions } from '@stacksjs/types';
2
+ import { ResultAsync } from '@stacksjs/error-handling';
3
+ declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
4
+ export { send as Send, send };
@@ -0,0 +1,17 @@
1
+ import { TwilioSmsProvider } from "@novu/twilio";
2
+ import { italic } from "@stacksjs/cli";
3
+ import { ResultAsync } from "@stacksjs/error-handling";
4
+ import { notification } from "@stacksjs/config";
5
+ const env = notification.sms.twilio;
6
+ const provider = new TwilioSmsProvider({
7
+ accountSid: env.sid,
8
+ authToken: env.authToken,
9
+ from: env.from
10
+ });
11
+ function send(options) {
12
+ return ResultAsync.fromPromise(
13
+ provider.sendMessage(options),
14
+ () => new Error(`Failed to send message using provider: ${italic("Twilio")}`)
15
+ );
16
+ }
17
+ export { send as Send, send };
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export {};
1
+ export * as email from './drivers/email';
2
+ export * as chat from './drivers/chat';
3
+ export * as sms from './drivers/sms';
package/dist/index.mjs CHANGED
@@ -1,2 +1,3 @@
1
- export {
2
- };
1
+ export * as email from "./drivers/email/index.mjs";
2
+ export * as chat from "./drivers/chat/index.mjs";
3
+ export * as sms from "./drivers/sms/index.mjs";
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/notifications",
3
3
  "type": "module",
4
- "version": "0.42.2",
5
- "packageManager": "pnpm@7.17.0",
4
+ "version": "0.43.1",
5
+ "packageManager": "pnpm@7.17.1",
6
6
  "description": "The Stacks notifications integration.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -41,12 +41,39 @@
41
41
  ],
42
42
  "engines": {
43
43
  "node": ">=v18.12.1",
44
- "pnpm": ">=7.17.0"
44
+ "pnpm": ">=7.17.1"
45
+ },
46
+ "peerDependencies": {
47
+ "@novu/discord": "^0.9.0",
48
+ "@novu/emailjs": "^0.9.0",
49
+ "@novu/gupshup": "^0.9.0",
50
+ "@novu/mailgun": "^0.9.0",
51
+ "@novu/mailjet": "^0.9.0",
52
+ "@novu/mandrill": "^0.9.0",
53
+ "@novu/netcore": "^0.9.0",
54
+ "@novu/nexmo": "^0.9.0",
55
+ "@novu/node": "^0.9.0",
56
+ "@novu/nodemailer": "^0.9.0",
57
+ "@novu/plivo": "^0.9.0",
58
+ "@novu/postmark": "^0.9.0",
59
+ "@novu/sendgrid": "^0.9.0",
60
+ "@novu/ses": "^0.9.0",
61
+ "@novu/slack": "^0.9.0",
62
+ "@novu/sms77": "^0.9.0",
63
+ "@novu/sns": "^0.9.0",
64
+ "@novu/stateless": "^0.9.0",
65
+ "@novu/telnyx": "^0.9.0",
66
+ "@novu/termii": "^0.9.0",
67
+ "@novu/twilio": "^0.9.0",
68
+ "@stacksjs/cli": "0.43.1",
69
+ "@stacksjs/config": "0.43.1",
70
+ "@stacksjs/error-handling": "0.43.1",
71
+ "@stacksjs/types": "0.43.1"
45
72
  },
46
73
  "devDependencies": {
47
74
  "mkdist": "^1.0.0",
48
75
  "typescript": "^4.9.3",
49
- "@stacksjs/testing": "0.42.2"
76
+ "@stacksjs/testing": "0.43.1"
50
77
  },
51
78
  "scripts": {
52
79
  "build": "mkdist -d",