@1auth/notify 0.0.0-beta.1 → 0.0.0-beta.2
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/README.md +44 -0
- package/index.js +4 -4
- package/package.json +12 -10
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@1auth/notify</h1>
|
|
3
|
+
<!--<img alt="1auth logo" src="https://raw.githubusercontent.com/willfarrell/1auth/main/docs/img/logo.svg"/>-->
|
|
4
|
+
<p><strong>Base notification interface for sending messages through various channels</strong></p>
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://github.com/willfarrell/1auth/actions/workflows/test-unit.yml"><img src="https://github.com/willfarrell/1auth/actions/workflows/test-unit.yml/badge.svg" alt="GitHub Actions unit test status"></a>
|
|
7
|
+
<a href="https://github.com/willfarrell/1auth/actions/workflows/test-dast.yml"><img src="https://github.com/willfarrell/1auth/actions/workflows/test-dast.yml/badge.svg" alt="GitHub Actions dast test status"></a>
|
|
8
|
+
<a href="https://github.com/willfarrell/1auth/actions/workflows/test-perf.yml"><img src="https://github.com/willfarrell/1auth/actions/workflows/test-perf.yml/badge.svg" alt="GitHub Actions perf test status"></a>
|
|
9
|
+
<a href="https://github.com/willfarrell/1auth/actions/workflows/test-sast.yml"><img src="https://github.com/willfarrell/1auth/actions/workflows/test-sast.yml/badge.svg" alt="GitHub Actions SAST test status"></a>
|
|
10
|
+
<a href="https://github.com/willfarrell/1auth/actions/workflows/test-lint.yml"><img src="https://github.com/willfarrell/1auth/actions/workflows/test-lint.yml/badge.svg" alt="GitHub Actions lint test status"></a>
|
|
11
|
+
<br/>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@1auth/notify"><img alt="npm version" src="https://img.shields.io/npm/v/@1auth/notify.svg"></a>
|
|
13
|
+
<a href="https://packagephobia.com/result?p=@1auth/notify"><img src="https://packagephobia.com/badge?p=@1auth/notify" alt="npm install size"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@1auth/notify">
|
|
15
|
+
<img alt="npm weekly downloads" src="https://img.shields.io/npm/dw/@1auth/notify.svg"></a>
|
|
16
|
+
<a href="https://www.npmjs.com/package/@1auth/notify#provenance">
|
|
17
|
+
<img alt="npm provenance" src="https://img.shields.io/badge/provenance-Yes-brightgreen"></a>
|
|
18
|
+
<br/>
|
|
19
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/willfarrell/1auth"><img src="https://api.scorecard.dev/projects/github.com/willfarrell/1auth/badge" alt="Open Source Security Foundation (OpenSSF) Scorecard"></a>
|
|
20
|
+
<a href="https://slsa.dev"><img src="https://slsa.dev/images/gh-badge-level3.svg" alt="SLSA 3"></a>
|
|
21
|
+
<a href="https://github.com/willfarrell/1auth/blob/main/docs/CODE_OF_CONDUCT.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg"></a>
|
|
22
|
+
<a href="https://biomejs.dev"><img alt="Checked with Biome" src="https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome"></a>
|
|
23
|
+
<a href="https://conventionalcommits.org"><img alt="Conventional Commits" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white"></a>
|
|
24
|
+
</p>
|
|
25
|
+
<p>You can read the documentation at: <a href="https://1auth.js.org">https://1auth.js.org</a></p>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @1auth/notify
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Documentation and examples
|
|
35
|
+
|
|
36
|
+
For documentation and examples, refer to the main [1auth monorepo on GitHub](https://github.com/willfarrell/1auth) or the [1auth website](https://1auth.js.org).
|
|
37
|
+
|
|
38
|
+
## Contributing
|
|
39
|
+
|
|
40
|
+
Everyone is very welcome to contribute to this repository. Feel free to [raise issues](https://github.com/willfarrell/1auth/issues) or to [submit Pull Requests](https://github.com/willfarrell/1auth/pulls).
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
Licensed under [MIT License](LICENSE). Copyright (c) 2020-2026 [will Farrell](https://github.com/willfarrell) and [contributors](https://github.com/willfarrell/1auth/graphs/contributors).
|
package/index.js
CHANGED
|
@@ -5,8 +5,8 @@ const options = {
|
|
|
5
5
|
client: () => {},
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
export default (
|
|
9
|
-
Object.assign(options,
|
|
8
|
+
export default (opt = {}) => {
|
|
9
|
+
Object.assign(options, opt);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
/*
|
|
@@ -17,6 +17,6 @@ notifyOptions: object of how and who to send message to
|
|
|
17
17
|
- messengers: array of { id } or { type, value }
|
|
18
18
|
- types: array of allowed types to be used
|
|
19
19
|
*/
|
|
20
|
-
export const trigger = (id, sub, data, notifyOptions = {}) => {
|
|
21
|
-
options.client({ id, sub, data, options: notifyOptions });
|
|
20
|
+
export const trigger = async (id, sub, data = {}, notifyOptions = {}) => {
|
|
21
|
+
await options.client({ id, sub, data, options: notifyOptions });
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1auth/notify",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "0.0.0-beta.2",
|
|
4
|
+
"description": "Base notification interface for sending messages through various channels",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24"
|
|
@@ -12,18 +12,14 @@
|
|
|
12
12
|
},
|
|
13
13
|
"main": "./index.js",
|
|
14
14
|
"module": "./index.js",
|
|
15
|
+
"sideEffects": false,
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
|
-
"import":
|
|
18
|
-
"types": "./index.d.ts",
|
|
19
|
-
"default": "./index.js"
|
|
20
|
-
}
|
|
18
|
+
"import": "./index.js"
|
|
21
19
|
}
|
|
22
20
|
},
|
|
23
|
-
"types": "index.d.ts",
|
|
24
21
|
"files": [
|
|
25
|
-
"index.js"
|
|
26
|
-
"index.d.ts"
|
|
22
|
+
"index.js"
|
|
27
23
|
],
|
|
28
24
|
"scripts": {
|
|
29
25
|
"test": "npm run test:unit",
|
|
@@ -34,7 +30,13 @@
|
|
|
34
30
|
"type": "github",
|
|
35
31
|
"url": "https://github.com/sponsors/willfarrell"
|
|
36
32
|
},
|
|
37
|
-
"keywords": [
|
|
33
|
+
"keywords": [
|
|
34
|
+
"1auth",
|
|
35
|
+
"OWASP",
|
|
36
|
+
"ASVS",
|
|
37
|
+
"notification",
|
|
38
|
+
"events"
|
|
39
|
+
],
|
|
38
40
|
"author": {
|
|
39
41
|
"name": "1auth contributors",
|
|
40
42
|
"url": "https://github.com/willfarrell/1auth/graphs/contributors"
|