stacks 0.46.3 → 0.47.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.
Files changed (133) hide show
  1. package/.gitignore +4 -0
  2. package/README.md +2 -1
  3. package/buddy/README.md +2 -1
  4. package/buddy/package.json +13 -4
  5. package/buddy/src/cli.ts +37 -20
  6. package/buddy/src/commands/create.ts +13 -13
  7. package/buddy/src/commands/key.ts +12 -2
  8. package/buddy/src/index.ts +3 -0
  9. package/components/vue/package.json +1 -1
  10. package/components/web/package.json +1 -1
  11. package/core/actions/package.json +5 -4
  12. package/core/actions/src/helpers/package-json.ts +1 -1
  13. package/core/actions/src/key-generate.ts +10 -0
  14. package/core/actions/src/lint-fix.ts +2 -2
  15. package/core/ai/package.json +3 -3
  16. package/core/alias/package.json +3 -3
  17. package/core/arrays/package.json +3 -3
  18. package/core/auth/package.json +3 -3
  19. package/core/build/package.json +3 -3
  20. package/core/cache/package.json +4 -4
  21. package/core/chat/README.md +89 -0
  22. package/core/chat/node_modules/.bin/maizzle +17 -0
  23. package/core/chat/node_modules/.bin/mkdist +17 -0
  24. package/{buddy/node_modules/.bin/pnpm → core/chat/node_modules/.bin/tsc} +2 -2
  25. package/core/chat/node_modules/.bin/tsserver +17 -0
  26. package/core/chat/package.json +62 -0
  27. package/core/chat/src/drivers/discord.ts +15 -0
  28. package/core/chat/src/drivers/slack.ts +22 -0
  29. package/core/chat/src/index.ts +2 -0
  30. package/core/chat/tests/example.test.ts +7 -0
  31. package/core/cli/package.json +3 -3
  32. package/core/cloud/package.json +3 -3
  33. package/core/collections/package.json +3 -3
  34. package/core/config/package.json +3 -3
  35. package/core/config/src/index.ts +1 -1
  36. package/core/dashboard/package.json +3 -3
  37. package/core/database/package.json +3 -3
  38. package/core/datetime/package.json +3 -3
  39. package/core/desktop/package.json +3 -3
  40. package/core/docs/package.json +3 -3
  41. package/core/domains/package.json +3 -3
  42. package/core/drivers/package.json +3 -3
  43. package/core/email/dist/utils/template.html +8 -0
  44. package/core/email/node_modules/.bin/maizzle +17 -0
  45. package/core/email/package.json +15 -3
  46. package/core/email/src/drivers/actions/send.ts +36 -0
  47. package/core/email/src/drivers/emailjs.ts +21 -0
  48. package/core/email/src/drivers/mailgun.ts +19 -0
  49. package/core/email/src/drivers/mailjet.ts +18 -0
  50. package/core/email/src/drivers/mandrill.ts +17 -0
  51. package/core/email/src/drivers/netcore.ts +17 -0
  52. package/core/email/src/drivers/nodemailer.ts +21 -0
  53. package/core/email/src/drivers/postmark.ts +17 -0
  54. package/core/email/src/drivers/sendgrid.ts +18 -0
  55. package/core/email/src/drivers/ses.ts +19 -0
  56. package/core/email/src/index.ts +9 -1
  57. package/core/email/src/utils/config.ts +5 -0
  58. package/core/email/src/utils/template.html +8 -0
  59. package/core/error-handling/package.json +3 -3
  60. package/core/events/README.md +76 -0
  61. package/core/events/build.config.ts +15 -0
  62. package/core/events/node_modules/.bin/mkdist +17 -0
  63. package/{buddy/node_modules/.bin/pnpx → core/events/node_modules/.bin/tsc} +2 -2
  64. package/core/events/node_modules/.bin/tsserver +17 -0
  65. package/core/events/package.json +55 -0
  66. package/core/events/src/index.ts +30 -0
  67. package/core/events/tests/example.test.ts +7 -0
  68. package/core/git/package.json +3 -3
  69. package/core/health/package.json +3 -3
  70. package/core/lint/package.json +3 -3
  71. package/core/logging/package.json +3 -3
  72. package/core/modules/package.json +3 -3
  73. package/core/notifications/package.json +24 -24
  74. package/core/objects/package.json +3 -3
  75. package/core/path/package.json +3 -3
  76. package/core/path/src/index.ts +1 -0
  77. package/core/payments/package.json +3 -3
  78. package/core/push/README.md +89 -0
  79. package/core/push/node_modules/.bin/maizzle +17 -0
  80. package/core/push/node_modules/.bin/mkdist +17 -0
  81. package/core/push/node_modules/.bin/tsc +17 -0
  82. package/core/push/node_modules/.bin/tsserver +17 -0
  83. package/core/push/package.json +60 -0
  84. package/core/push/src/drivers/expo.ts +19 -0
  85. package/core/push/src/drivers/fcm.ts +19 -0
  86. package/core/push/src/index.ts +2 -0
  87. package/core/push/tests/example.test.ts +7 -0
  88. package/core/realtime/package.json +3 -3
  89. package/core/router/package.json +3 -3
  90. package/core/search-engine/package.json +4 -4
  91. package/core/security/package.json +3 -3
  92. package/core/security/src/crypt.ts +2 -2
  93. package/core/server/package.json +3 -3
  94. package/core/sms/README.md +89 -0
  95. package/core/sms/node_modules/.bin/maizzle +17 -0
  96. package/core/sms/node_modules/.bin/mkdist +17 -0
  97. package/core/sms/node_modules/.bin/tsc +17 -0
  98. package/core/sms/node_modules/.bin/tsserver +17 -0
  99. package/core/sms/package.json +68 -0
  100. package/core/sms/src/drivers/gupshup.ts +21 -0
  101. package/core/sms/src/drivers/nexmo.ts +22 -0
  102. package/core/sms/src/drivers/plivo.ts +22 -0
  103. package/core/sms/src/drivers/sms77.ts +21 -0
  104. package/core/sms/src/drivers/sns.ts +22 -0
  105. package/core/sms/src/drivers/telnyx.ts +22 -0
  106. package/core/sms/src/drivers/termii.ts +21 -0
  107. package/core/sms/src/drivers/twilio.ts +22 -0
  108. package/core/sms/src/index.ts +8 -0
  109. package/core/sms/tests/example.test.ts +7 -0
  110. package/core/storage/package.json +3 -3
  111. package/core/strings/package.json +3 -3
  112. package/core/testing/node_modules/.bin/playwright +17 -0
  113. package/core/testing/package.json +4 -3
  114. package/core/testing/src/index.ts +2 -1
  115. package/core/types/node_modules/.bin/vitepress +2 -2
  116. package/core/types/package.json +5 -5
  117. package/core/types/src/app.ts +0 -9
  118. package/core/types/src/cli.ts +1 -0
  119. package/core/types/src/debug.ts +1 -1
  120. package/core/types/src/deploy.ts +1 -1
  121. package/core/types/src/events.ts +22 -0
  122. package/core/types/src/index.ts +1 -0
  123. package/core/types/src/notifications.ts +2 -4
  124. package/core/ui/node_modules/.bin/vue-tsc +2 -2
  125. package/core/ui/package.json +4 -4
  126. package/core/utils/package.json +6 -6
  127. package/core/x-ray/package.json +3 -3
  128. package/functions/package.json +1 -1
  129. package/package.json +6 -4
  130. package/tests/feature/example.spec.ts +20 -0
  131. package/tests/unit/example.test.ts +7 -0
  132. package/tsconfig.json +2 -0
  133. package/core/actions/src/key.ts +0 -48
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/bin/tsserver" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/bin/tsserver" "$@"
17
+ fi
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@stacksjs/push",
3
+ "type": "module",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
+ "description": "The Stacks Push integration",
7
+ "author": "Chris Breuer",
8
+ "license": "MIT",
9
+ "funding": "https://github.com/sponsors/chrisbbreuer",
10
+ "homepage": "https://github.com/stacksjs/stacks/tree/main/.stacks/core/push#readme",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/stacksjs/stacks.git",
14
+ "directory": "./.stacks/core/push"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/stacksjs/stacks/issues"
18
+ },
19
+ "keywords": [
20
+ "push",
21
+ "ses",
22
+ "aws",
23
+ "maizzle",
24
+ "stacks"
25
+ ],
26
+ "main": "dist/index.mjs",
27
+ "module": "dist/index.mjs",
28
+ "types": "dist/index.d.ts",
29
+ "contributors": [
30
+ "Chris Breuer <chris@ow3.org>"
31
+ ],
32
+ "files": [
33
+ "dist",
34
+ "README.md"
35
+ ],
36
+ "engines": {
37
+ "node": ">=v18.12.1",
38
+ "pnpm": ">=7.20.0"
39
+ },
40
+ "scripts": {
41
+ "build": "mkdist -d",
42
+ "dev": "mkdist -d",
43
+ "prepublishOnly": "pnpm run build",
44
+ "typecheck": "tsc --noEmit"
45
+ },
46
+ "peerDependencies": {
47
+ "@maizzle/framework": "latest",
48
+ "@novu/node": "^0.10.0",
49
+ "@novu/stateless": "^0.10.0",
50
+ "@stacksjs/cli": "workspace:*",
51
+ "@stacksjs/config": "workspace:*",
52
+ "@stacksjs/error-handling": "workspace:*",
53
+ "@stacksjs/types": "workspace:*"
54
+ },
55
+ "devDependencies": {
56
+ "@stacksjs/testing": "workspace:*",
57
+ "mkdist": "^1.0.0",
58
+ "typescript": "^4.9.4"
59
+ }
60
+ }
@@ -0,0 +1,19 @@
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 }
@@ -0,0 +1,19 @@
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 }
@@ -0,0 +1,2 @@
1
+ export * as expo from './drivers/expo'
2
+ export * as fcm from './drivers/fcm'
@@ -0,0 +1,7 @@
1
+ import { assert, describe, test } from 'vitest'
2
+
3
+ describe('example test', () => {
4
+ test('assert', () => {
5
+ assert.equal(1, 1)
6
+ })
7
+ })
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/realtime",
3
3
  "type": "module",
4
- "version": "0.46.3",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks realtime integration.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "engines": {
37
37
  "node": ">=v18.12.1",
38
- "pnpm": ">=7.19.0"
38
+ "pnpm": ">=7.20.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "mkdist -d",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/router",
3
3
  "type": "module",
4
- "version": "0.46.3",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks framework router.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "engines": {
37
37
  "node": ">=v18.12.1",
38
- "pnpm": ">=7.19.0"
38
+ "pnpm": ">=7.20.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "mkdist -d",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/search-engine",
3
3
  "type": "module",
4
- "version": "0.46.3",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks search engine integrations.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "engines": {
43
43
  "node": ">=v18.12.1",
44
- "pnpm": ">=7.19.0"
44
+ "pnpm": ">=7.20.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "mkdist -d",
@@ -52,7 +52,7 @@
52
52
  "peerDependencies": {
53
53
  "@stacksjs/cli": "workspace:*",
54
54
  "@stacksjs/config": "workspace:*",
55
- "@vueuse/core": "^9.8.2",
55
+ "@vueuse/core": "^9.9.0",
56
56
  "meilisearch": "^0.30.0",
57
57
  "vue": "^3.2.45"
58
58
  },
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/security",
3
3
  "type": "module",
4
- "version": "0.46.3",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks framework security.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "engines": {
36
36
  "node": ">=v18.12.1",
37
- "pnpm": ">=7.19.0"
37
+ "pnpm": ">=7.20.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "mkdist -d",
@@ -1,13 +1,13 @@
1
1
  import aes from 'crypto-js/aes'
2
2
  import utf8 from 'crypto-js/enc-utf8'
3
3
 
4
- const passphrase = import.meta.env.APP_KEY as string
5
-
6
4
  function encrypt(message: string): string {
5
+ const passphrase = import.meta.env.APP_KEY as string
7
6
  return aes.encrypt(message, passphrase).toString()
8
7
  }
9
8
 
10
9
  function decrypt(encrypted: string): string {
10
+ const passphrase = import.meta.env.APP_KEY as string
11
11
  return aes.decrypt(encrypted, passphrase).toString(utf8)
12
12
  }
13
13
 
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/server",
3
3
  "type": "module",
4
- "version": "0.46.3",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "Local development and production-ready.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  ],
38
38
  "engines": {
39
39
  "node": ">=v18.12.1",
40
- "pnpm": ">=7.19.0"
40
+ "pnpm": ">=7.20.0"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "mkdist -d",
@@ -0,0 +1,89 @@
1
+ # Stacks Notifications
2
+
3
+ wip
4
+
5
+ ## ☘️ Features
6
+
7
+ wip
8
+
9
+ - ⚡️
10
+
11
+ wip
12
+
13
+ ## 🤖 Usage
14
+
15
+ wip
16
+
17
+ ```bash
18
+ pnpm i -D @stacksjs/notifications
19
+ ```
20
+
21
+ Now, you can use it in your project:
22
+
23
+ ```js
24
+ import notifications from '@stacksjs/notifications'
25
+
26
+ // wip
27
+ ```
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
+
59
+ Learn more in the docs.
60
+
61
+ ## 🧪 Testing
62
+
63
+ ```bash
64
+ pnpm test
65
+ ```
66
+
67
+ ## 📈 Changelog
68
+
69
+ Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
70
+
71
+ ## 💪🏼 Contributing
72
+
73
+ Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
74
+
75
+ ## 🏝 Community
76
+
77
+ For help, discussion about best practices, or any other conversation that would benefit from being searchable:
78
+
79
+ [Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
80
+
81
+ For casual chit-chat with others using this package:
82
+
83
+ [Join the Stacks Discord Server](https://discord.ow3.org)
84
+
85
+ ## 📄 License
86
+
87
+ The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
88
+
89
+ Made with ❤️
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/@maizzle+framework@4.3.1_glob@7.2.3/node_modules/@maizzle/framework/bin/maizzle" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/@maizzle+framework@4.3.1_glob@7.2.3/node_modules/@maizzle/framework/bin/maizzle" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/mkdist@1.0.0_typescript@4.9.4/node_modules/mkdist/dist/cli.cjs" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/mkdist@1.0.0_typescript@4.9.4/node_modules/mkdist/dist/cli.cjs" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/bin/tsc" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/bin/tsc" "$@"
17
+ fi
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/bin/tsserver" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/bin/tsserver" "$@"
17
+ fi
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@stacksjs/sms",
3
+ "type": "module",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
+ "description": "The Stacks SMS integration. Painlessly create & manage your inboxes, templates, and send sms.",
7
+ "author": "Chris Breuer",
8
+ "license": "MIT",
9
+ "funding": "https://github.com/sponsors/chrisbbreuer",
10
+ "homepage": "https://github.com/stacksjs/stacks/tree/main/.stacks/core/sms#readme",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/stacksjs/stacks.git",
14
+ "directory": "./.stacks/core/sms"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/stacksjs/stacks/issues"
18
+ },
19
+ "keywords": [
20
+ "sms",
21
+ "ses",
22
+ "aws",
23
+ "maizzle",
24
+ "stacks"
25
+ ],
26
+ "main": "dist/index.mjs",
27
+ "module": "dist/index.mjs",
28
+ "types": "dist/index.d.ts",
29
+ "contributors": [
30
+ "Chris Breuer <chris@ow3.org>"
31
+ ],
32
+ "files": [
33
+ "dist",
34
+ "README.md"
35
+ ],
36
+ "engines": {
37
+ "node": ">=v18.12.1",
38
+ "pnpm": ">=7.20.0"
39
+ },
40
+ "scripts": {
41
+ "build": "mkdist -d",
42
+ "dev": "mkdist -d",
43
+ "prepublishOnly": "pnpm run build",
44
+ "typecheck": "tsc --noEmit"
45
+ },
46
+ "peerDependencies": {
47
+ "@maizzle/framework": "latest",
48
+ "@novu/gupshup": "^0.10.0",
49
+ "@novu/nexmo": "^0.10.0",
50
+ "@novu/node": "^0.10.0",
51
+ "@novu/plivo": "^0.10.0",
52
+ "@novu/sms77": "^0.10.0",
53
+ "@novu/sns": "^0.10.0",
54
+ "@novu/stateless": "^0.10.0",
55
+ "@novu/telnyx": "^0.10.0",
56
+ "@novu/termii": "^0.10.0",
57
+ "@novu/twilio": "^0.10.0",
58
+ "@stacksjs/cli": "workspace:*",
59
+ "@stacksjs/config": "workspace:*",
60
+ "@stacksjs/error-handling": "workspace:*",
61
+ "@stacksjs/types": "workspace:*"
62
+ },
63
+ "devDependencies": {
64
+ "@stacksjs/testing": "workspace:*",
65
+ "mkdist": "^1.0.0",
66
+ "typescript": "^4.9.4"
67
+ }
68
+ }
@@ -0,0 +1,21 @@
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 }
@@ -0,0 +1,22 @@
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 }
@@ -0,0 +1,22 @@
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 }
@@ -0,0 +1,21 @@
1
+ import { Sms77SmsProvider } from '@novu/sms77'
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.sms77
8
+
9
+ const provider = new Sms77SmsProvider({
10
+ apiKey: env.key,
11
+ from: env.from,
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('Sms77')}`),
18
+ )
19
+ }
20
+
21
+ export { send as Send, send }
@@ -0,0 +1,22 @@
1
+ import { SNSSmsProvider } from '@novu/sns'
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.sns
8
+
9
+ const provider = new SNSSmsProvider({
10
+ region: env.region,
11
+ accessKeyId: env.key,
12
+ secretAccessKey: env.secret,
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('SNS')}`),
19
+ )
20
+ }
21
+
22
+ export { send as Send, send }
@@ -0,0 +1,22 @@
1
+ import { TelnyxSmsProvider } from '@novu/telnyx'
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.telnyx
8
+
9
+ const provider = new TelnyxSmsProvider({
10
+ apiKey: env.key,
11
+ messageProfileId: env.messageProfileId,
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('Telnyx')}`),
19
+ )
20
+ }
21
+
22
+ export { send as Send, send }
@@ -0,0 +1,21 @@
1
+ import { TermiiSmsProvider } from '@novu/termii'
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.termii
8
+
9
+ const provider = new TermiiSmsProvider({
10
+ apiKey: env.key,
11
+ from: env.from,
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('Termii')}`),
18
+ )
19
+ }
20
+
21
+ export { send as Send, send }