@stacksjs/notifications 0.64.6 → 0.65.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/drivers/chat.d.ts +1 -0
- package/dist/drivers/email.d.ts +1 -0
- package/dist/drivers/index.d.ts +4 -0
- package/dist/drivers/push.d.ts +1 -0
- package/dist/drivers/sms.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/tailwind.config.d.ts +31 -0
- package/dist/utils/config.d.ts +2 -0
- package/package.json +14 -20
- package/src/index.ts +5 -7
- package/src/tailwind.config.ts +7 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as chat from "@stacksjs/chat";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as email from "@stacksjs/email";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as push from "@stacksjs/push";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as sms from "@stacksjs/sms";
|
package/dist/index.d.ts
ADDED
|
@@ -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,5 @@
|
|
|
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
|
|
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
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=6264C0C1643D4B1264756E2164756E21
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/drivers/chat.ts", "../src/drivers/email.ts", "../src/drivers/push.ts", "../src/drivers/sms.ts"],
|
|
4
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\
|
|
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
6
|
"export * as chat from '@stacksjs/chat'\n",
|
|
7
7
|
"export * as email from '@stacksjs/email'\n",
|
|
8
8
|
"export * as push from '@stacksjs/push'\n",
|
|
9
9
|
"export * as sms from '@stacksjs/sms'\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": ";AAAA,uBACA,cAAS,sBACT,uBAAS,yBACT,cAAS,iCACT,mBAAS,wBCJT,iCCAA,kCCAA,iCCAA,
|
|
12
|
-
"debugId": "
|
|
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
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/notifications",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.65.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",
|
|
@@ -40,30 +41,23 @@
|
|
|
40
41
|
},
|
|
41
42
|
"module": "dist/index.js",
|
|
42
43
|
"types": "dist/index.d.ts",
|
|
43
|
-
"
|
|
44
|
-
"Chris Breuer <chris@stacksjs.org>"
|
|
45
|
-
],
|
|
46
|
-
"files": [
|
|
47
|
-
"README.md",
|
|
48
|
-
"dist",
|
|
49
|
-
"src"
|
|
50
|
-
],
|
|
44
|
+
"files": ["README.md", "dist", "src"],
|
|
51
45
|
"scripts": {
|
|
52
|
-
"build": "bun
|
|
53
|
-
"typecheck": "bun
|
|
46
|
+
"build": "bun build.ts",
|
|
47
|
+
"typecheck": "bun tsc --noEmit",
|
|
54
48
|
"prepublishOnly": "bun run build"
|
|
55
49
|
},
|
|
56
50
|
"dependencies": {
|
|
57
|
-
"@stacksjs/chat": "
|
|
58
|
-
"@stacksjs/cli": "
|
|
59
|
-
"@stacksjs/config": "
|
|
60
|
-
"@stacksjs/email": "
|
|
61
|
-
"@stacksjs/error-handling": "
|
|
62
|
-
"@stacksjs/push": "
|
|
63
|
-
"@stacksjs/sms": "
|
|
64
|
-
"@stacksjs/types": "
|
|
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"
|
|
65
59
|
},
|
|
66
60
|
"devDependencies": {
|
|
67
|
-
"@stacksjs/development": "
|
|
61
|
+
"@stacksjs/development": "0.64.6"
|
|
68
62
|
}
|
|
69
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,19 +5,19 @@ import { err } from '@stacksjs/error-handling'
|
|
|
5
5
|
import { ExitCode } from '@stacksjs/types'
|
|
6
6
|
import { chat, email, sms } from './drivers'
|
|
7
7
|
|
|
8
|
-
function useChat(driver = 'slack') {
|
|
8
|
+
export function useChat(driver = 'slack'): any {
|
|
9
9
|
return chat[driver as keyof typeof chat]
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function useEmail(driver = 'mailtrap') {
|
|
12
|
+
export function useEmail(driver = 'mailtrap'): any {
|
|
13
13
|
return email[driver as keyof typeof email]
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function useSMS(driver = 'twilio') {
|
|
16
|
+
export function useSMS(driver = 'twilio'): any {
|
|
17
17
|
return sms[driver as keyof typeof sms]
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function useNotification(typeParam = 'email', driverParam = 'mailtrap') {
|
|
20
|
+
export function useNotification(typeParam = 'email', driverParam = 'mailtrap'): any {
|
|
21
21
|
if (!config.default) {
|
|
22
22
|
log.error('No default notification type set in config/notification.ts')
|
|
23
23
|
return process.exit(ExitCode.InvalidArgument)
|
|
@@ -38,8 +38,6 @@ function useNotification(typeParam = 'email', driverParam = 'mailtrap') {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
function notification() {
|
|
41
|
+
export function notification(): any {
|
|
42
42
|
return useNotification()
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
export { useEmail, useChat, useSMS, useNotification, notification }
|
package/src/tailwind.config.ts
CHANGED
|
@@ -12,14 +12,14 @@ export default {
|
|
|
12
12
|
xl: '1440px',
|
|
13
13
|
},
|
|
14
14
|
colors: {
|
|
15
|
-
blue: '#1fb6ff',
|
|
16
|
-
purple: '#7e5bef',
|
|
17
|
-
pink: '#ff49db',
|
|
18
|
-
orange: '#ff7849',
|
|
19
|
-
green: '#13ce66',
|
|
20
|
-
yellow: '#ffc82c',
|
|
15
|
+
'blue': '#1fb6ff',
|
|
16
|
+
'purple': '#7e5bef',
|
|
17
|
+
'pink': '#ff49db',
|
|
18
|
+
'orange': '#ff7849',
|
|
19
|
+
'green': '#13ce66',
|
|
20
|
+
'yellow': '#ffc82c',
|
|
21
21
|
'gray-dark': '#273444',
|
|
22
|
-
gray: '#8492a6',
|
|
22
|
+
'gray': '#8492a6',
|
|
23
23
|
'gray-light': '#d3dce6',
|
|
24
24
|
},
|
|
25
25
|
fontFamily: {
|