stacks 0.47.1 → 0.47.4

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 (92) hide show
  1. package/buddy/package.json +1 -1
  2. package/core/actions/package.json +1 -1
  3. package/core/ai/package.json +1 -1
  4. package/core/alias/package.json +1 -1
  5. package/core/alias/src/index.ts +8 -0
  6. package/core/arrays/package.json +1 -1
  7. package/core/auth/package.json +1 -1
  8. package/core/build/package.json +1 -1
  9. package/core/cache/package.json +1 -1
  10. package/core/chat/package.json +4 -5
  11. package/core/cli/package.json +1 -1
  12. package/core/cloud/package.json +1 -1
  13. package/core/collections/package.json +1 -1
  14. package/core/config/package.json +1 -1
  15. package/core/dashboard/package.json +1 -1
  16. package/core/database/package.json +1 -1
  17. package/core/datetime/package.json +1 -1
  18. package/core/desktop/package.json +1 -1
  19. package/core/docs/package.json +1 -1
  20. package/core/domains/package.json +1 -1
  21. package/core/drivers/package.json +1 -1
  22. package/core/email/package.json +10 -2
  23. package/core/email/src/{drivers/actions → actions}/send.ts +1 -1
  24. package/core/email/src/drivers/emailjs.ts +1 -1
  25. package/core/email/src/drivers/mailgun.ts +1 -1
  26. package/core/email/src/drivers/mailjet.ts +1 -1
  27. package/core/email/src/drivers/mandrill.ts +1 -1
  28. package/core/email/src/drivers/netcore.ts +1 -1
  29. package/core/email/src/drivers/nodemailer.ts +1 -1
  30. package/core/email/src/drivers/postmark.ts +1 -1
  31. package/core/email/src/drivers/sendgrid.ts +1 -1
  32. package/core/email/src/drivers/ses.ts +1 -1
  33. package/core/{notifications/src/drivers/email → email/src}/tailwind.config.ts +3 -1
  34. package/core/email/src/utils/config.ts +3 -1
  35. package/core/error-handling/package.json +1 -1
  36. package/core/events/package.json +1 -1
  37. package/core/git/package.json +1 -1
  38. package/core/health/package.json +1 -1
  39. package/core/lint/package.json +1 -1
  40. package/core/logging/package.json +1 -1
  41. package/core/modules/package.json +1 -1
  42. package/core/notifications/package.json +5 -1
  43. package/core/notifications/src/drivers/chat.ts +1 -0
  44. package/core/notifications/src/drivers/email.ts +1 -0
  45. package/core/notifications/src/drivers/push.ts +1 -0
  46. package/core/notifications/src/drivers/sms.ts +1 -0
  47. package/core/notifications/src/tailwind.config.ts +39 -0
  48. package/core/notifications/src/utils/config.ts +2 -2
  49. package/core/objects/package.json +1 -1
  50. package/core/path/package.json +1 -1
  51. package/core/path/src/index.ts +20 -0
  52. package/core/payments/package.json +1 -1
  53. package/core/push/package.json +1 -1
  54. package/core/realtime/package.json +1 -1
  55. package/core/router/package.json +1 -1
  56. package/core/search-engine/package.json +1 -1
  57. package/core/security/package.json +1 -1
  58. package/core/server/package.json +1 -1
  59. package/core/sms/package.json +10 -4
  60. package/core/storage/package.json +1 -1
  61. package/core/strings/package.json +1 -1
  62. package/core/testing/package.json +1 -1
  63. package/core/types/package.json +1 -1
  64. package/core/ui/package.json +1 -1
  65. package/core/utils/package.json +1 -1
  66. package/core/x-ray/package.json +1 -1
  67. package/package.json +2 -2
  68. package/core/notifications/src/drivers/chat/discord.ts +0 -15
  69. package/core/notifications/src/drivers/chat/index.ts +0 -2
  70. package/core/notifications/src/drivers/chat/slack.ts +0 -22
  71. package/core/notifications/src/drivers/email/actions/send.ts +0 -36
  72. package/core/notifications/src/drivers/email/emailjs.ts +0 -21
  73. package/core/notifications/src/drivers/email/index.ts +0 -9
  74. package/core/notifications/src/drivers/email/mailgun.ts +0 -19
  75. package/core/notifications/src/drivers/email/mailjet.ts +0 -18
  76. package/core/notifications/src/drivers/email/mandrill.ts +0 -17
  77. package/core/notifications/src/drivers/email/netcore.ts +0 -17
  78. package/core/notifications/src/drivers/email/nodemailer.ts +0 -21
  79. package/core/notifications/src/drivers/email/postmark.ts +0 -17
  80. package/core/notifications/src/drivers/email/sendgrid.ts +0 -18
  81. package/core/notifications/src/drivers/email/ses.ts +0 -19
  82. package/core/notifications/src/drivers/push/expo.ts +0 -19
  83. package/core/notifications/src/drivers/push/fcm.ts +0 -19
  84. package/core/notifications/src/drivers/sms/gupshup.ts +0 -21
  85. package/core/notifications/src/drivers/sms/index.ts +0 -8
  86. package/core/notifications/src/drivers/sms/nexmo.ts +0 -22
  87. package/core/notifications/src/drivers/sms/plivo.ts +0 -22
  88. package/core/notifications/src/drivers/sms/sms77.ts +0 -21
  89. package/core/notifications/src/drivers/sms/sns.ts +0 -22
  90. package/core/notifications/src/drivers/sms/telnyx.ts +0 -22
  91. package/core/notifications/src/drivers/sms/termii.ts +0 -21
  92. package/core/notifications/src/drivers/sms/twilio.ts +0 -22
@@ -82,6 +82,10 @@ export function cachePath(path?: string) {
82
82
  return corePath(`cache/${path || ''}`)
83
83
  }
84
84
 
85
+ export function chatPath(path?: string) {
86
+ return corePath(`chat/${path || ''}`)
87
+ }
88
+
85
89
  export function cliPath(path?: string) {
86
90
  return corePath(`cli/${path || ''}`)
87
91
  }
@@ -126,6 +130,10 @@ export function customElementsDataPath() {
126
130
  return frameworkPath('custom-elements.json')
127
131
  }
128
132
 
133
+ export function emailPath(path?: string) {
134
+ return corePath(`email/${path || ''}`)
135
+ }
136
+
129
137
  export function errorHandlingPath(path?: string) {
130
138
  return corePath(`error-handling/${path || ''}`)
131
139
  }
@@ -222,6 +230,10 @@ export function projectPath(filePath = '') {
222
230
  return resolve(path, filePath)
223
231
  }
224
232
 
233
+ export function pushPath(path?: string) {
234
+ return corePath(`push/${path || ''}`)
235
+ }
236
+
225
237
  export function routerPath(path?: string) {
226
238
  return corePath(`router/${path || ''}`)
227
239
  }
@@ -230,6 +242,10 @@ export function searchEnginePath(path?: string) {
230
242
  return corePath(`search-engine/${path || ''}`)
231
243
  }
232
244
 
245
+ export function smsPath(path?: string) {
246
+ return corePath(`sms/${path || ''}`)
247
+ }
248
+
233
249
  export function routesPath(path?: string) {
234
250
  return projectPath(`routes/${path || ''}`)
235
251
  }
@@ -288,6 +304,7 @@ export const path = {
288
304
  buildEntriesPath,
289
305
  buildPath,
290
306
  cachePath,
307
+ chatPath,
291
308
  cliPath,
292
309
  collectionsPath,
293
310
  componentsPath,
@@ -299,6 +316,7 @@ export const path = {
299
316
  docsPath,
300
317
  domainsPath,
301
318
  driversPath,
319
+ emailPath,
302
320
  errorHandlingPath,
303
321
  examplesPath,
304
322
  frameworkPath,
@@ -317,8 +335,10 @@ export const path = {
317
335
  pagesPath,
318
336
  pathPath,
319
337
  projectPath,
338
+ pushPath,
320
339
  routerPath,
321
340
  searchEnginePath,
341
+ smsPath,
322
342
  routesPath,
323
343
  scriptsPath,
324
344
  securityPath,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/payments",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks payments package. Currently supporting Stripe.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/push",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks Push integration",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/realtime",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks realtime integration.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/router",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks framework router.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/search-engine",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks search engine integrations.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/security",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks framework security.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/server",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "Local development and production-ready.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/sms",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks SMS integration. Painlessly create & manage your inboxes, templates, and send sms.",
7
7
  "author": "Chris Breuer",
@@ -19,9 +19,15 @@
19
19
  "keywords": [
20
20
  "sms",
21
21
  "ses",
22
- "aws",
23
- "maizzle",
24
- "stacks"
22
+ "stacks",
23
+ "gupshup",
24
+ "nexmo",
25
+ "plivo",
26
+ "sms77",
27
+ "sns",
28
+ "telnyx",
29
+ "termii",
30
+ "twilio"
25
31
  ],
26
32
  "main": "dist/index.mjs",
27
33
  "module": "dist/index.mjs",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/storage",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks file system.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/strings",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks string utilities.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/testing",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks way to test.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks framework types.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ui",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks atomic UI engine, powered by UnoCSS.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/utils",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks helper functions.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/x-ray",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "All you need to debug, log & analyze.",
7
7
  "author": "Chris Breuer",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stacks",
3
3
  "type": "module",
4
- "version": "0.47.1",
4
+ "version": "0.47.4",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks framework.",
7
7
  "author": "Chris Breuer",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "web-types": "./web-types.json",
67
67
  "dependencies": {
68
- "@stacksjs/buddy": "0.47.1"
68
+ "@stacksjs/buddy": "0.47.4"
69
69
  },
70
70
  "scripts": {
71
71
  "buddy": "esno ./buddy/src/cli.ts",
@@ -1,15 +0,0 @@
1
- import { DiscordProvider } from '@novu/discord'
2
- import { italic } from '@stacksjs/cli'
3
- import type { ChatOptions } from '@stacksjs/types'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
-
6
- const provider = new DiscordProvider({})
7
-
8
- function send(options: ChatOptions) {
9
- return ResultAsync.fromPromise(
10
- provider.sendMessage(options),
11
- () => new Error(`Failed to send message using provider: ${italic('Discord')}`),
12
- )
13
- }
14
-
15
- export { send as Send, send }
@@ -1,2 +0,0 @@
1
- export * as discord from './discord'
2
- export * as slack from './slack'
@@ -1,22 +0,0 @@
1
- import { SlackProvider } from '@novu/slack'
2
- import { italic } from '@stacksjs/cli'
3
- import type { ChatOptions } from '@stacksjs/types'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
- import { notification } from '@stacksjs/config'
6
-
7
- const env = notification.chat.slack
8
-
9
- const provider = new SlackProvider({
10
- applicationId: env.appId,
11
- clientId: env.clientId,
12
- secretKey: env.secret,
13
- })
14
-
15
- function send(options: ChatOptions) {
16
- return ResultAsync.fromPromise(
17
- provider.sendMessage(options),
18
- () => new Error(`Failed to send message using provider: ${italic('Slack')}`),
19
- )
20
- }
21
-
22
- export { send as Send, send }
@@ -1,36 +0,0 @@
1
- import type { EmailOptions } from '@stacksjs/types'
2
- import { italic } from '@stacksjs/cli'
3
- import { log } from '@stacksjs/logging'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
- import * as Maizzle from '@maizzle/framework'
6
- import * as maizzleConfig from '../../../utils/config'
7
- import { config } from '../tailwind.config'
8
-
9
- export async function send(options: EmailOptions, provider: any, providerName: string, css?: string) {
10
- const template = `
11
- <extends src="./core/notifications/src/utils/template.html">
12
- <block name="template">
13
- ${options.html}
14
- </block>
15
- </extends>`
16
-
17
- await Maizzle.render(
18
- template,
19
- {
20
- tailwind: {
21
- config,
22
- css,
23
- maizzle: maizzleConfig,
24
- },
25
- },
26
- )
27
- .then(({ html }: any) => {
28
- options.html = html
29
- })
30
- .catch((error: any) => log.error(`Failed to render email template using provider: ${italic(providerName)}.`, error))
31
-
32
- return ResultAsync.fromPromise(
33
- provider.sendMessage(options),
34
- () => new Error(`Failed to send message using provider: ${italic(providerName)}`),
35
- )
36
- }
@@ -1,21 +0,0 @@
1
- import { EmailJsProvider } from '@novu/emailjs'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.emailjs
7
-
8
- const provider = new EmailJsProvider({
9
- from: env.from,
10
- host: env.host,
11
- user: env.user,
12
- password: env.password,
13
- port: env.port,
14
- secure: env.secure,
15
- })
16
-
17
- async function send(options: EmailOptions, css?: string) {
18
- return sendEmail(options, provider, 'EmailJS', css)
19
- }
20
-
21
- export { send as Send, send }
@@ -1,9 +0,0 @@
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'
@@ -1,19 +0,0 @@
1
- import { MailgunEmailProvider } from '@novu/mailgun'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.mailgun
7
-
8
- const provider = new MailgunEmailProvider({
9
- apiKey: env.key,
10
- domain: env.domain,
11
- username: env.username,
12
- from: env.from,
13
- })
14
-
15
- async function send(options: EmailOptions, css?: string) {
16
- return sendEmail(options, provider, 'Mailgun', css)
17
- }
18
-
19
- export { send as Send, send }
@@ -1,18 +0,0 @@
1
- import { MailjetEmailProvider } from '@novu/mailjet'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.mailjet
7
-
8
- const provider = new MailjetEmailProvider({
9
- apiKey: env.key,
10
- apiSecret: env.secret,
11
- from: env.from,
12
- })
13
-
14
- async function send(options: EmailOptions, css?: string) {
15
- return sendEmail(options, provider, 'Mailjet', css)
16
- }
17
-
18
- export { send as Send, send }
@@ -1,17 +0,0 @@
1
- import { MandrillProvider } from '@novu/mandrill'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.mandrill
7
-
8
- const provider = new MandrillProvider({
9
- apiKey: env.key,
10
- from: env.from,
11
- })
12
-
13
- async function send(options: EmailOptions, css?: string) {
14
- return sendEmail(options, provider, 'Mandrill', css)
15
- }
16
-
17
- export { send as Send, send }
@@ -1,17 +0,0 @@
1
- import { NetCoreProvider } from '@novu/netcore'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.netcore
7
-
8
- const provider = new NetCoreProvider({
9
- apiKey: env.key,
10
- from: env.from,
11
- })
12
-
13
- async function send(options: EmailOptions, css?: string) {
14
- return sendEmail(options, provider, 'Netcore', css)
15
- }
16
-
17
- export { send as Send, send }
@@ -1,21 +0,0 @@
1
- import { NodemailerProvider } from '@novu/nodemailer'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.nodemailer
7
-
8
- const provider = new NodemailerProvider({
9
- from: env.from,
10
- host: env.host,
11
- user: env.user,
12
- password: env.password,
13
- port: env.port,
14
- secure: env.secure,
15
- })
16
-
17
- async function send(options: EmailOptions, css?: string) {
18
- return sendEmail(options, provider, 'Nodemailer', css)
19
- }
20
-
21
- export { send as Send, send }
@@ -1,17 +0,0 @@
1
- import { PostmarkEmailProvider } from '@novu/postmark'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.postmark
7
-
8
- const provider = new PostmarkEmailProvider({
9
- apiKey: env.key,
10
- from: env.from,
11
- })
12
-
13
- async function send(options: EmailOptions, css?: string) {
14
- return sendEmail(options, provider, 'Postmark', css)
15
- }
16
-
17
- export { send as Send, send }
@@ -1,18 +0,0 @@
1
- import { SendgridEmailProvider } from '@novu/sendgrid'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.sendgrid
7
-
8
- const provider = new SendgridEmailProvider({
9
- apiKey: env.key,
10
- from: env.from,
11
- senderName: env.senderName,
12
- })
13
-
14
- async function send(options: EmailOptions, css?: string) {
15
- return sendEmail(options, provider, 'Sendgrid', css)
16
- }
17
-
18
- export { send as Send, send }
@@ -1,19 +0,0 @@
1
- import { SESEmailProvider } from '@novu/ses'
2
- import type { EmailOptions } from '@stacksjs/types'
3
- import { notification } from '@stacksjs/config'
4
- import { send as sendEmail } from './actions/send'
5
-
6
- const env = notification.email.ses
7
-
8
- const provider = new SESEmailProvider({
9
- region: env.region,
10
- accessKeyId: env.key,
11
- secretAccessKey: env.secret,
12
- from: env.from,
13
- })
14
-
15
- async function send(options: EmailOptions, css?: string) {
16
- return sendEmail(options, provider, 'Ses', css)
17
- }
18
-
19
- export { send as Send, send }
@@ -1,19 +0,0 @@
1
- import { Novu } from '@novu/node'
2
- import { notification } from '@stacksjs/config'
3
- import type { ExpoPushNotificationOptions } from '@stacksjs/types'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
- import { italic } from '@stacksjs/cli'
6
-
7
- const novu = new Novu(notification.novu.key)
8
-
9
- function send(options: ExpoPushNotificationOptions) {
10
- return ResultAsync.fromPromise(
11
- novu.trigger(options.eventName, {
12
- to: options.to,
13
- payload: options.payload,
14
- }),
15
- () => new Error(`Failed to send message using provider: ${italic('Expo')}`),
16
- )
17
- }
18
-
19
- export { send as Send, send }
@@ -1,19 +0,0 @@
1
- import { Novu } from '@novu/node'
2
- import { notification } from '@stacksjs/config'
3
- import type { FCMPushNotificationOptions } from '@stacksjs/types'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
- import { italic } from '@stacksjs/cli'
6
-
7
- const novu = new Novu(notification.novu.key)
8
-
9
- function send(options: FCMPushNotificationOptions) {
10
- return ResultAsync.fromPromise(
11
- novu.trigger(options.eventName, {
12
- to: options.to,
13
- payload: options.payload,
14
- }),
15
- () => new Error(`Failed to send message using provider: ${italic('FCM')}`),
16
- )
17
- }
18
-
19
- export { send as Send, send }
@@ -1,21 +0,0 @@
1
- import { GupshupSmsProvider } from '@novu/gupshup'
2
- import { italic } from '@stacksjs/cli'
3
- import type { SmsOptions } from '@stacksjs/types'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
- import { notification } from '@stacksjs/config'
6
-
7
- const env = notification.sms.gupshup
8
-
9
- const provider = new GupshupSmsProvider({
10
- userId: env.user,
11
- password: env.password,
12
- })
13
-
14
- function send(options: SmsOptions) {
15
- return ResultAsync.fromPromise(
16
- provider.sendMessage(options),
17
- () => new Error(`Failed to send message using provider: ${italic('Gupshup')}`),
18
- )
19
- }
20
-
21
- export { send as Send, send }
@@ -1,8 +0,0 @@
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'
@@ -1,22 +0,0 @@
1
- import { NexmoSmsProvider } from '@novu/nexmo'
2
- import { italic } from '@stacksjs/cli'
3
- import type { SmsOptions } from '@stacksjs/types'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
- import { notification } from '@stacksjs/config'
6
-
7
- const env = notification.sms.nexmo
8
-
9
- const provider = new NexmoSmsProvider({
10
- apiKey: env.key,
11
- apiSecret: env.secret,
12
- from: env.from,
13
- })
14
-
15
- function send(options: SmsOptions) {
16
- return ResultAsync.fromPromise(
17
- provider.sendMessage(options),
18
- () => new Error(`Failed to send message using provider: ${italic('Nexmo')}`),
19
- )
20
- }
21
-
22
- export { send as Send, send }
@@ -1,22 +0,0 @@
1
- import { PlivoSmsProvider } from '@novu/plivo'
2
- import { italic } from '@stacksjs/cli'
3
- import type { SmsOptions } from '@stacksjs/types'
4
- import { ResultAsync } from '@stacksjs/error-handling'
5
- import { notification } from '@stacksjs/config'
6
-
7
- const env = notification.sms.plivo
8
-
9
- const provider = new PlivoSmsProvider({
10
- accountSid: env.sid,
11
- authToken: env.authToken,
12
- from: env.from,
13
- })
14
-
15
- function send(options: SmsOptions) {
16
- return ResultAsync.fromPromise(
17
- provider.sendMessage(options),
18
- () => new Error(`Failed to send message using provider: ${italic('Plivo')}`),
19
- )
20
- }
21
-
22
- export { send as Send, send }