@stacksjs/notifications 0.64.6 → 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.
@@ -0,0 +1 @@
1
+ export * as chat from "@stacksjs/chat";
@@ -0,0 +1 @@
1
+ export * as email from "@stacksjs/email";
@@ -0,0 +1,4 @@
1
+ export * from "./chat";
2
+ export * from "./email";
3
+ export * from "./push";
4
+ export * from "./sms";
@@ -0,0 +1 @@
1
+ export * as push from "@stacksjs/push";
@@ -0,0 +1 @@
1
+ export * as sms from "@stacksjs/sms";
@@ -0,0 +1,5 @@
1
+ export declare function useChat(driver?: string): any;
2
+ export declare function useEmail(driver?: string): any;
3
+ export declare function useSMS(driver?: string): any;
4
+ export declare function useNotification(typeParam?: string, driverParam?: string): any;
5
+ export declare function notification(): any;
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 f from"@stacksjs/sms";function c(t="slack"){return i[t]}function l(t="mailtrap"){return a[t]}function x(t="twilio"){return f[t]}function d(t="email",n="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=n||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 d()}export{x as useSMS,d as useNotification,l as useEmail,c as useChat,j as notification};
3
-
4
- //# debugId=D49DFD7988CA032764756E2164756E21
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};
@@ -0,0 +1,31 @@
1
+ declare const _default: { theme: {
2
+ screens: {
3
+ sm: string;
4
+ md: string;
5
+ lg: string;
6
+ xl: string;
7
+ };
8
+ colors: {
9
+ "blue": string;
10
+ "purple": string;
11
+ "pink": string;
12
+ "orange": string;
13
+ "green": string;
14
+ "yellow": string;
15
+ "gray-dark": string;
16
+ "gray": string;
17
+ "gray-light": string;
18
+ };
19
+ fontFamily: {
20
+ sans: unknown;
21
+ serif: unknown;
22
+ };
23
+ extend: {
24
+ spacing: {
25
+ 128: string;
26
+ 144: string;
27
+ };
28
+ borderRadius: { "4xl": string };
29
+ };
30
+ } };
31
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: { purgeCSS: {} };
2
+ export default _default;
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@stacksjs/notifications",
3
3
  "type": "module",
4
- "version": "0.64.6",
4
+ "version": "0.67.0",
5
5
  "description": "The Stacks notifications integration.",
6
6
  "author": "Chris Breuer",
7
+ "contributors": ["Chris Breuer <chris@stacksjs.org>"],
7
8
  "license": "MIT",
8
9
  "funding": "https://github.com/sponsors/chrisbbreuer",
9
10
  "homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/notifications#readme",
@@ -30,40 +31,31 @@
30
31
  ],
31
32
  "exports": {
32
33
  ".": {
33
- "bun": "./src/index.ts",
34
34
  "import": "./dist/index.js"
35
35
  },
36
36
  "./*": {
37
- "bun": "./src/*",
38
37
  "import": "./dist/*"
39
38
  }
40
39
  },
41
40
  "module": "dist/index.js",
42
41
  "types": "dist/index.d.ts",
43
- "contributors": [
44
- "Chris Breuer <chris@stacksjs.org>"
45
- ],
46
- "files": [
47
- "README.md",
48
- "dist",
49
- "src"
50
- ],
42
+ "files": ["README.md", "dist"],
51
43
  "scripts": {
52
- "build": "bun --bun build.ts",
53
- "typecheck": "bun --bun tsc --noEmit",
44
+ "build": "bun build.ts",
45
+ "typecheck": "bun tsc --noEmit",
54
46
  "prepublishOnly": "bun run build"
55
47
  },
56
48
  "dependencies": {
57
- "@stacksjs/chat": "latest",
58
- "@stacksjs/cli": "latest",
59
- "@stacksjs/config": "latest",
60
- "@stacksjs/email": "latest",
61
- "@stacksjs/error-handling": "latest",
62
- "@stacksjs/push": "latest",
63
- "@stacksjs/sms": "latest",
64
- "@stacksjs/types": "latest"
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"
65
57
  },
66
58
  "devDependencies": {
67
- "@stacksjs/development": "latest"
59
+ "@stacksjs/development": "0.67.0"
68
60
  }
69
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\nfunction useChat(driver = 'slack') {\n return chat[driver as keyof typeof chat]\n}\n\nfunction useEmail(driver = 'mailtrap') {\n return email[driver as keyof typeof email]\n}\n\nfunction useSMS(driver = 'twilio') {\n return sms[driver as keyof typeof sms]\n}\n\nfunction useNotification(typeParam = 'email', driverParam = 'mailtrap') {\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\nfunction notification() {\n return useNotification()\n}\n\nexport { useEmail, useChat, useSMS, useNotification, notification }\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,gCJOA,SAAS,CAAO,CAAC,EAAS,QAAS,CACjC,OAAO,EAAK,GAGd,SAAS,CAAQ,CAAC,EAAS,WAAY,CACrC,OAAO,EAAM,GAGf,SAAS,CAAM,CAAC,EAAS,SAAU,CACjC,OAAO,EAAI,GAGb,SAAS,CAAe,CAAC,EAAY,QAAS,EAAc,WAAY,CACtE,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,GAI7C,SAAS,CAAY,EAAG,CACtB,OAAO,EAAgB",
12
- "debugId": "D49DFD7988CA032764756E2164756E21",
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,45 +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
- function useChat(driver = 'slack') {
9
- return chat[driver as keyof typeof chat]
10
- }
11
-
12
- function useEmail(driver = 'mailtrap') {
13
- return email[driver as keyof typeof email]
14
- }
15
-
16
- function useSMS(driver = 'twilio') {
17
- return sms[driver as keyof typeof sms]
18
- }
19
-
20
- function useNotification(typeParam = 'email', driverParam = 'mailtrap') {
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
- function notification() {
42
- return useNotification()
43
- }
44
-
45
- export { useEmail, useChat, useSMS, useNotification, notification }
@@ -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>