@stacksjs/notifications 0.65.0 → 0.67.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/dist/index.js CHANGED
@@ -1,5 +1,2 @@
1
1
  // @bun
2
- import m from"process";import{log as s}from"@stacksjs/cli";import{notification as r}from"@stacksjs/config";import{err as p}from"@stacksjs/error-handling";import{ExitCode as u}from"@stacksjs/types";import*as i from"@stacksjs/chat";import*as a from"@stacksjs/email";import*as k from"@stacksjs/push";import*as n from"@stacksjs/sms";function c(t="slack"){return i[t]}function l(t="mailtrap"){return a[t]}function x(t="twilio"){return n[t]}function y(t="email",f="mailtrap"){if(!r.default)return s.error("No default notification type set in config/notification.ts"),m.exit(u.InvalidArgument);const e=t||r.default,o=f||r.default;switch(e){case"email":return l(o);case"chat":return c(o);case"sms":return x(o);default:return p(`Type ${e} not supported`)}}function j(){return y()}export{x as useSMS,y as useNotification,l as useEmail,c as useChat,j as notification};
3
-
4
- //# debugId=6264C0C1643D4B1264756E2164756E21
5
- //# sourceMappingURL=index.js.map
2
+ import m from"process";import{log as s}from"@stacksjs/cli";import{notification as r}from"@stacksjs/config";import{err as p}from"@stacksjs/error-handling";import{ExitCode as u}from"@stacksjs/types";import*as i from"@stacksjs/chat";import*as a from"@stacksjs/email";import*as k from"@stacksjs/push";import*as n from"@stacksjs/sms";function c(t="slack"){return i[t]}function l(t="mailtrap"){return a[t]}function x(t="twilio"){return n[t]}function y(t="email",f="mailtrap"){if(!r.default)return s.error("No default notification type set in config/notification.ts"),m.exit(u.InvalidArgument);let e=t||r.default,o=f||r.default;switch(e){case"email":return l(o);case"chat":return c(o);case"sms":return x(o);default:return p(`Type ${e} not supported`)}}function j(){return y()}export{x as useSMS,y as useNotification,l as useEmail,c as useChat,j as notification};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/notifications",
3
3
  "type": "module",
4
- "version": "0.65.0",
4
+ "version": "0.67.0",
5
5
  "description": "The Stacks notifications integration.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": ["Chris Breuer <chris@stacksjs.org>"],
@@ -31,33 +31,31 @@
31
31
  ],
32
32
  "exports": {
33
33
  ".": {
34
- "bun": "./src/index.ts",
35
34
  "import": "./dist/index.js"
36
35
  },
37
36
  "./*": {
38
- "bun": "./src/*",
39
37
  "import": "./dist/*"
40
38
  }
41
39
  },
42
40
  "module": "dist/index.js",
43
41
  "types": "dist/index.d.ts",
44
- "files": ["README.md", "dist", "src"],
42
+ "files": ["README.md", "dist"],
45
43
  "scripts": {
46
44
  "build": "bun build.ts",
47
45
  "typecheck": "bun tsc --noEmit",
48
46
  "prepublishOnly": "bun run build"
49
47
  },
50
48
  "dependencies": {
51
- "@stacksjs/chat": "0.64.6",
52
- "@stacksjs/cli": "0.64.6",
53
- "@stacksjs/config": "0.64.6",
54
- "@stacksjs/email": "0.64.6",
55
- "@stacksjs/error-handling": "0.64.6",
56
- "@stacksjs/push": "0.64.6",
57
- "@stacksjs/sms": "0.64.6",
58
- "@stacksjs/types": "0.64.6"
49
+ "@stacksjs/chat": "0.67.0",
50
+ "@stacksjs/cli": "0.67.0",
51
+ "@stacksjs/config": "0.67.0",
52
+ "@stacksjs/email": "0.67.0",
53
+ "@stacksjs/error-handling": "0.67.0",
54
+ "@stacksjs/push": "0.67.0",
55
+ "@stacksjs/sms": "0.67.0",
56
+ "@stacksjs/types": "0.67.0"
59
57
  },
60
58
  "devDependencies": {
61
- "@stacksjs/development": "0.64.6"
59
+ "@stacksjs/development": "0.67.0"
62
60
  }
63
61
  }
package/dist/index.js.map DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts", "../src/drivers/chat.ts", "../src/drivers/email.ts", "../src/drivers/push.ts", "../src/drivers/sms.ts"],
4
- "sourcesContent": [
5
- "import process from 'node:process'\nimport { log } from '@stacksjs/cli'\nimport { notification as config } from '@stacksjs/config'\nimport { err } from '@stacksjs/error-handling'\nimport { ExitCode } from '@stacksjs/types'\nimport { chat, email, sms } from './drivers'\n\nexport function useChat(driver = 'slack'): any {\n return chat[driver as keyof typeof chat]\n}\n\nexport function useEmail(driver = 'mailtrap'): any {\n return email[driver as keyof typeof email]\n}\n\nexport function useSMS(driver = 'twilio'): any {\n return sms[driver as keyof typeof sms]\n}\n\nexport function useNotification(typeParam = 'email', driverParam = 'mailtrap'): any {\n if (!config.default) {\n log.error('No default notification type set in config/notification.ts')\n return process.exit(ExitCode.InvalidArgument)\n }\n\n const type = typeParam || config.default\n const driver = driverParam || config.default\n\n switch (type) {\n case 'email':\n return useEmail(driver)\n case 'chat':\n return useChat(driver)\n case 'sms':\n return useSMS(driver)\n default:\n return err(`Type ${type} not supported`)\n }\n}\n\nexport function notification(): any {\n return useNotification()\n}\n",
6
- "export * as chat from '@stacksjs/chat'\n",
7
- "export * as email from '@stacksjs/email'\n",
8
- "export * as push from '@stacksjs/push'\n",
9
- "export * as sms from '@stacksjs/sms'\n"
10
- ],
11
- "mappings": ";AAAA,uBACA,cAAS,sBACT,uBAAS,yBACT,cAAS,iCACT,mBAAS,wBCJT,iCCAA,kCCAA,iCCAA,gCJOO,SAAS,CAAO,CAAC,EAAS,QAAc,CAC7C,OAAO,EAAK,GAGP,SAAS,CAAQ,CAAC,EAAS,WAAiB,CACjD,OAAO,EAAM,GAGR,SAAS,CAAM,CAAC,EAAS,SAAe,CAC7C,OAAO,EAAI,GAGN,SAAS,CAAe,CAAC,EAAY,QAAS,EAAc,WAAiB,CAClF,IAAK,EAAO,QAEV,OADA,EAAI,MAAM,4DAA4D,EAC/D,EAAQ,KAAK,EAAS,eAAe,EAG9C,MAAM,EAAO,GAAa,EAAO,QAC3B,EAAS,GAAe,EAAO,QAErC,OAAQ,OACD,QACH,OAAO,EAAS,CAAM,MACnB,OACH,OAAO,EAAQ,CAAM,MAClB,MACH,OAAO,EAAO,CAAM,UAEpB,OAAO,EAAI,QAAQ,iBAAoB,GAItC,SAAS,CAAY,EAAQ,CAClC,OAAO,EAAgB",
12
- "debugId": "6264C0C1643D4B1264756E2164756E21",
13
- "names": []
14
- }
@@ -1 +0,0 @@
1
- export * as chat from '@stacksjs/chat'
@@ -1 +0,0 @@
1
- export * as email from '@stacksjs/email'
@@ -1,4 +0,0 @@
1
- export * from './chat'
2
- export * from './email'
3
- export * from './push'
4
- export * from './sms'
@@ -1 +0,0 @@
1
- export * as push from '@stacksjs/push'
@@ -1 +0,0 @@
1
- export * as sms from '@stacksjs/sms'
package/src/index.ts DELETED
@@ -1,43 +0,0 @@
1
- import process from 'node:process'
2
- import { log } from '@stacksjs/cli'
3
- import { notification as config } from '@stacksjs/config'
4
- import { err } from '@stacksjs/error-handling'
5
- import { ExitCode } from '@stacksjs/types'
6
- import { chat, email, sms } from './drivers'
7
-
8
- export function useChat(driver = 'slack'): any {
9
- return chat[driver as keyof typeof chat]
10
- }
11
-
12
- export function useEmail(driver = 'mailtrap'): any {
13
- return email[driver as keyof typeof email]
14
- }
15
-
16
- export function useSMS(driver = 'twilio'): any {
17
- return sms[driver as keyof typeof sms]
18
- }
19
-
20
- export function useNotification(typeParam = 'email', driverParam = 'mailtrap'): any {
21
- if (!config.default) {
22
- log.error('No default notification type set in config/notification.ts')
23
- return process.exit(ExitCode.InvalidArgument)
24
- }
25
-
26
- const type = typeParam || config.default
27
- const driver = driverParam || config.default
28
-
29
- switch (type) {
30
- case 'email':
31
- return useEmail(driver)
32
- case 'chat':
33
- return useChat(driver)
34
- case 'sms':
35
- return useSMS(driver)
36
- default:
37
- return err(`Type ${type} not supported`)
38
- }
39
- }
40
-
41
- export function notification(): any {
42
- return useNotification()
43
- }
@@ -1,39 +0,0 @@
1
- // import notification from '~/config/notification'
2
-
3
- // const email = notification.email
4
-
5
- export default {
6
- // ...email.build,
7
- theme: {
8
- screens: {
9
- sm: '480px',
10
- md: '768px',
11
- lg: '976px',
12
- xl: '1440px',
13
- },
14
- colors: {
15
- 'blue': '#1fb6ff',
16
- 'purple': '#7e5bef',
17
- 'pink': '#ff49db',
18
- 'orange': '#ff7849',
19
- 'green': '#13ce66',
20
- 'yellow': '#ffc82c',
21
- 'gray-dark': '#273444',
22
- 'gray': '#8492a6',
23
- 'gray-light': '#d3dce6',
24
- },
25
- fontFamily: {
26
- sans: ['Graphik', 'sans-serif'],
27
- serif: ['Merriweather', 'serif'],
28
- },
29
- extend: {
30
- spacing: {
31
- 128: '32rem',
32
- 144: '36rem',
33
- },
34
- borderRadius: {
35
- '4xl': '2rem',
36
- },
37
- },
38
- },
39
- }
@@ -1,5 +0,0 @@
1
- // import notification from '~/config/notification'
2
-
3
- export default {
4
- purgeCSS: {},
5
- }
@@ -1,8 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- </head>
5
- <body>
6
- Testing...
7
- <block name="template"></block>
8
- </body>