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.
- package/.gitignore +4 -0
- package/README.md +2 -1
- package/buddy/README.md +2 -1
- package/buddy/package.json +13 -4
- package/buddy/src/cli.ts +37 -20
- package/buddy/src/commands/create.ts +13 -13
- package/buddy/src/commands/key.ts +12 -2
- package/buddy/src/index.ts +3 -0
- package/components/vue/package.json +1 -1
- package/components/web/package.json +1 -1
- package/core/actions/package.json +5 -4
- package/core/actions/src/helpers/package-json.ts +1 -1
- package/core/actions/src/key-generate.ts +10 -0
- package/core/actions/src/lint-fix.ts +2 -2
- package/core/ai/package.json +3 -3
- package/core/alias/package.json +3 -3
- package/core/arrays/package.json +3 -3
- package/core/auth/package.json +3 -3
- package/core/build/package.json +3 -3
- package/core/cache/package.json +4 -4
- package/core/chat/README.md +89 -0
- package/core/chat/node_modules/.bin/maizzle +17 -0
- package/core/chat/node_modules/.bin/mkdist +17 -0
- package/{buddy/node_modules/.bin/pnpm → core/chat/node_modules/.bin/tsc} +2 -2
- package/core/chat/node_modules/.bin/tsserver +17 -0
- package/core/chat/package.json +62 -0
- package/core/chat/src/drivers/discord.ts +15 -0
- package/core/chat/src/drivers/slack.ts +22 -0
- package/core/chat/src/index.ts +2 -0
- package/core/chat/tests/example.test.ts +7 -0
- package/core/cli/package.json +3 -3
- package/core/cloud/package.json +3 -3
- package/core/collections/package.json +3 -3
- package/core/config/package.json +3 -3
- package/core/config/src/index.ts +1 -1
- package/core/dashboard/package.json +3 -3
- package/core/database/package.json +3 -3
- package/core/datetime/package.json +3 -3
- package/core/desktop/package.json +3 -3
- package/core/docs/package.json +3 -3
- package/core/domains/package.json +3 -3
- package/core/drivers/package.json +3 -3
- package/core/email/dist/utils/template.html +8 -0
- package/core/email/node_modules/.bin/maizzle +17 -0
- package/core/email/package.json +15 -3
- package/core/email/src/drivers/actions/send.ts +36 -0
- package/core/email/src/drivers/emailjs.ts +21 -0
- package/core/email/src/drivers/mailgun.ts +19 -0
- package/core/email/src/drivers/mailjet.ts +18 -0
- package/core/email/src/drivers/mandrill.ts +17 -0
- package/core/email/src/drivers/netcore.ts +17 -0
- package/core/email/src/drivers/nodemailer.ts +21 -0
- package/core/email/src/drivers/postmark.ts +17 -0
- package/core/email/src/drivers/sendgrid.ts +18 -0
- package/core/email/src/drivers/ses.ts +19 -0
- package/core/email/src/index.ts +9 -1
- package/core/email/src/utils/config.ts +5 -0
- package/core/email/src/utils/template.html +8 -0
- package/core/error-handling/package.json +3 -3
- package/core/events/README.md +76 -0
- package/core/events/build.config.ts +15 -0
- package/core/events/node_modules/.bin/mkdist +17 -0
- package/{buddy/node_modules/.bin/pnpx → core/events/node_modules/.bin/tsc} +2 -2
- package/core/events/node_modules/.bin/tsserver +17 -0
- package/core/events/package.json +55 -0
- package/core/events/src/index.ts +30 -0
- package/core/events/tests/example.test.ts +7 -0
- package/core/git/package.json +3 -3
- package/core/health/package.json +3 -3
- package/core/lint/package.json +3 -3
- package/core/logging/package.json +3 -3
- package/core/modules/package.json +3 -3
- package/core/notifications/package.json +24 -24
- package/core/objects/package.json +3 -3
- package/core/path/package.json +3 -3
- package/core/path/src/index.ts +1 -0
- package/core/payments/package.json +3 -3
- package/core/push/README.md +89 -0
- package/core/push/node_modules/.bin/maizzle +17 -0
- package/core/push/node_modules/.bin/mkdist +17 -0
- package/core/push/node_modules/.bin/tsc +17 -0
- package/core/push/node_modules/.bin/tsserver +17 -0
- package/core/push/package.json +60 -0
- package/core/push/src/drivers/expo.ts +19 -0
- package/core/push/src/drivers/fcm.ts +19 -0
- package/core/push/src/index.ts +2 -0
- package/core/push/tests/example.test.ts +7 -0
- package/core/realtime/package.json +3 -3
- package/core/router/package.json +3 -3
- package/core/search-engine/package.json +4 -4
- package/core/security/package.json +3 -3
- package/core/security/src/crypt.ts +2 -2
- package/core/server/package.json +3 -3
- package/core/sms/README.md +89 -0
- package/core/sms/node_modules/.bin/maizzle +17 -0
- package/core/sms/node_modules/.bin/mkdist +17 -0
- package/core/sms/node_modules/.bin/tsc +17 -0
- package/core/sms/node_modules/.bin/tsserver +17 -0
- package/core/sms/package.json +68 -0
- package/core/sms/src/drivers/gupshup.ts +21 -0
- package/core/sms/src/drivers/nexmo.ts +22 -0
- package/core/sms/src/drivers/plivo.ts +22 -0
- package/core/sms/src/drivers/sms77.ts +21 -0
- package/core/sms/src/drivers/sns.ts +22 -0
- package/core/sms/src/drivers/telnyx.ts +22 -0
- package/core/sms/src/drivers/termii.ts +21 -0
- package/core/sms/src/drivers/twilio.ts +22 -0
- package/core/sms/src/index.ts +8 -0
- package/core/sms/tests/example.test.ts +7 -0
- package/core/storage/package.json +3 -3
- package/core/strings/package.json +3 -3
- package/core/testing/node_modules/.bin/playwright +17 -0
- package/core/testing/package.json +4 -3
- package/core/testing/src/index.ts +2 -1
- package/core/types/node_modules/.bin/vitepress +2 -2
- package/core/types/package.json +5 -5
- package/core/types/src/app.ts +0 -9
- package/core/types/src/cli.ts +1 -0
- package/core/types/src/debug.ts +1 -1
- package/core/types/src/deploy.ts +1 -1
- package/core/types/src/events.ts +22 -0
- package/core/types/src/index.ts +1 -0
- package/core/types/src/notifications.ts +2 -4
- package/core/ui/node_modules/.bin/vue-tsc +2 -2
- package/core/ui/package.json +4 -4
- package/core/utils/package.json +6 -6
- package/core/x-ray/package.json +3 -3
- package/functions/package.json +1 -1
- package/package.json +6 -4
- package/tests/feature/example.spec.ts +20 -0
- package/tests/unit/example.test.ts +7 -0
- package/tsconfig.json +2 -0
- package/core/actions/src/key.ts +0 -48
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stacksjs/chat",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
|
+
"description": "The Stacks Chat Integration. Easy sending of messages for chat services",
|
|
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/chat#readme",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
14
|
+
"directory": "./.stacks/core/chat"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/stacksjs/stacks/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"chat",
|
|
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/discord": "^0.10.0",
|
|
49
|
+
"@novu/node": "^0.10.0",
|
|
50
|
+
"@novu/slack": "^0.10.0",
|
|
51
|
+
"@novu/stateless": "^0.10.0",
|
|
52
|
+
"@stacksjs/cli": "workspace:*",
|
|
53
|
+
"@stacksjs/config": "workspace:*",
|
|
54
|
+
"@stacksjs/error-handling": "workspace:*",
|
|
55
|
+
"@stacksjs/types": "workspace:*"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@stacksjs/testing": "workspace:*",
|
|
59
|
+
"mkdist": "^1.0.0",
|
|
60
|
+
"typescript": "^4.9.4"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 }
|
|
@@ -0,0 +1,22 @@
|
|
|
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 }
|
package/core/cli/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The simple way to create beautiful CLIs.",
|
|
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.
|
|
44
|
+
"pnpm": ">=7.20.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "mkdist -d",
|
package/core/cloud/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cloud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks cloud/serverless integration & implementation.",
|
|
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.
|
|
40
|
+
"pnpm": ">=7.20.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "mkdist -d",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/collections",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks collections.",
|
|
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.
|
|
40
|
+
"pnpm": ">=7.20.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "mkdist -d",
|
package/core/config/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks configuration.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=v18.12.1",
|
|
35
|
-
"pnpm": ">=7.
|
|
35
|
+
"pnpm": ">=7.20.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "unbuild",
|
package/core/config/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from '../../../../config/cache'
|
|
|
5
5
|
export * from '../../../../config/database'
|
|
6
6
|
export * from '../../../../config/debug'
|
|
7
7
|
export * from '../../../../config/deploy'
|
|
8
|
-
export * from '../../../../config/
|
|
8
|
+
export * from '../../../../config/events'
|
|
9
9
|
export * as docs from '../../../../config/docs'
|
|
10
10
|
export * from '../../../../config/git'
|
|
11
11
|
export * from '../../../../config/hashing'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/dashboard",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks Dashboard.",
|
|
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.
|
|
40
|
+
"pnpm": ">=7.20.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "mkdist -d",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/database",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks database integration.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=v18.12.1",
|
|
42
|
-
"pnpm": ">=7.
|
|
42
|
+
"pnpm": ">=7.20.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "mkdist -d",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/datetime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks datetime helpers.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=v18.12.1",
|
|
39
|
-
"pnpm": ">=7.
|
|
39
|
+
"pnpm": ">=7.20.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "mkdist -d",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/desktop",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks Desktop engine.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
],
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=v18.12.1",
|
|
46
|
-
"pnpm": ">=7.
|
|
46
|
+
"pnpm": ">=7.20.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "mkdist -d",
|
package/core/docs/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks way to document.",
|
|
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.
|
|
37
|
+
"pnpm": ">=7.20.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "mkdist -d",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/domains",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "Easily manage your domains.",
|
|
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.
|
|
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/drivers",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "Easily create a driver-based system.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=v18.12.1",
|
|
36
|
-
"pnpm": ">=7.
|
|
36
|
+
"pnpm": ">=7.20.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "mkdist -d",
|
|
@@ -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
|
package/core/email/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/email",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.47.0",
|
|
5
|
+
"packageManager": "pnpm@7.20.0",
|
|
6
6
|
"description": "The Stacks Email integration. Painlessly create & manage your inboxes, templates, and send emails.",
|
|
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.
|
|
38
|
+
"pnpm": ">=7.20.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "mkdist -d",
|
|
@@ -44,6 +44,18 @@
|
|
|
44
44
|
"typecheck": "tsc --noEmit"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
+
"@maizzle/framework": "latest",
|
|
48
|
+
"@novu/emailjs": "^0.10.0",
|
|
49
|
+
"@novu/mailgun": "^0.10.0",
|
|
50
|
+
"@novu/mailjet": "^0.10.0",
|
|
51
|
+
"@novu/mandrill": "^0.10.0",
|
|
52
|
+
"@novu/netcore": "^0.10.0",
|
|
53
|
+
"@novu/node": "^0.10.0",
|
|
54
|
+
"@novu/nodemailer": "^0.10.0",
|
|
55
|
+
"@novu/postmark": "^0.10.0",
|
|
56
|
+
"@novu/sendgrid": "^0.10.0",
|
|
57
|
+
"@novu/ses": "^0.10.0",
|
|
58
|
+
"@novu/stateless": "^0.10.0",
|
|
47
59
|
"@stacksjs/cli": "workspace:*",
|
|
48
60
|
"@stacksjs/config": "workspace:*",
|
|
49
61
|
"@stacksjs/error-handling": "workspace:*",
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 }
|
|
@@ -0,0 +1,19 @@
|
|
|
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 }
|
|
@@ -0,0 +1,18 @@
|
|
|
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 }
|
|
@@ -0,0 +1,17 @@
|
|
|
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 }
|
|
@@ -0,0 +1,17 @@
|
|
|
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 }
|
|
@@ -0,0 +1,21 @@
|
|
|
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 }
|
|
@@ -0,0 +1,17 @@
|
|
|
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 }
|
|
@@ -0,0 +1,18 @@
|
|
|
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 }
|
|
@@ -0,0 +1,19 @@
|
|
|
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 }
|
package/core/email/src/index.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * as sendgrid from './drivers/sendgrid'
|
|
2
|
+
export * as mailgun from './drivers/mailgun'
|
|
3
|
+
export * as mailjet from './drivers/mailjet'
|
|
4
|
+
export * as mandrill from './drivers/mandrill'
|
|
5
|
+
export * as netcore from './drivers/netcore'
|
|
6
|
+
export * as nodemailer from './drivers/nodemailer'
|
|
7
|
+
export * as postmark from './drivers/postmark'
|
|
8
|
+
export * as ses from './drivers/ses'
|
|
9
|
+
export * as emailjs from './drivers/emailjs'
|