@1auth/notify 0.0.0-alpha.72
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/index.js +20 -0
- package/package.json +52 -0
package/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const options = {
|
|
2
|
+
log: false,
|
|
3
|
+
client: () => {},
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export default (params) => {
|
|
7
|
+
Object.assign(options, params);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
id: template id
|
|
12
|
+
sub: subject id
|
|
13
|
+
data: object of what will be used in templates. ie { token, username, expire }
|
|
14
|
+
notifyOptions: object of how and who to send message to
|
|
15
|
+
- messengers: array of { id } or { type, value }
|
|
16
|
+
- types: array of allowed types to be used
|
|
17
|
+
*/
|
|
18
|
+
export const trigger = (id, sub, data, notifyOptions = {}) => {
|
|
19
|
+
options.client({ id, sub, data, options: notifyOptions });
|
|
20
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@1auth/notify",
|
|
3
|
+
"version": "0.0.0-alpha.72",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22"
|
|
8
|
+
},
|
|
9
|
+
"engineStrict": true,
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"main": "./index.js",
|
|
14
|
+
"module": "./index.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./index.d.ts",
|
|
19
|
+
"default": "./index.js"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"types": "index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"index.js",
|
|
26
|
+
"index.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"test": "npm run test:unit",
|
|
30
|
+
"test:unit": "node --test"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"funding": {
|
|
34
|
+
"type": "github",
|
|
35
|
+
"url": "https://github.com/sponsors/willfarrell"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [],
|
|
38
|
+
"author": {
|
|
39
|
+
"name": "1auth contributors",
|
|
40
|
+
"url": "https://github.com/willfarrell/1auth/graphs/contributors"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/willfarrell/1auth.git",
|
|
45
|
+
"directory": "packages/notify"
|
|
46
|
+
},
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/willfarrell/1auth/issues"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/willfarrell/1auth",
|
|
51
|
+
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
|
|
52
|
+
}
|