@vyriy/smoke 0.1.9
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/LICENSE +21 -0
- package/README.md +54 -0
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/package.json +36 -0
- package/smoke.d.ts +4 -0
- package/smoke.js +8 -0
- package/types.d.ts +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vyriy contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @vyriy/smoke
|
|
2
|
+
|
|
3
|
+
Smoke request matcher for Vyriy projects.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This package provides a small helper for recognizing a dedicated smoke request and returning a predefined response without running the main handler logic.
|
|
8
|
+
|
|
9
|
+
It is intended to be used directly or through packages such as `@vyriy/handler`.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
With npm:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @vyriy/smoke
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
With Yarn:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add @vyriy/smoke
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
Use the default smoke request and response:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { smoke } from '@vyriy/smoke';
|
|
31
|
+
|
|
32
|
+
const result = smoke({ isSmoke: true });
|
|
33
|
+
|
|
34
|
+
if (result) {
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
- `request`
|
|
42
|
+
Default smoke request payload: `{ isSmoke: true }`.
|
|
43
|
+
|
|
44
|
+
- `response`
|
|
45
|
+
Default smoke response payload: `{ status: 'success' }`.
|
|
46
|
+
|
|
47
|
+
- `smoke(event)`
|
|
48
|
+
Returns the smoke response when `event` matches the smoke request, otherwise returns `false`.
|
|
49
|
+
|
|
50
|
+
## Notes
|
|
51
|
+
|
|
52
|
+
- matching is performed by comparing `JSON.stringify(event)` and `JSON.stringify(request)`
|
|
53
|
+
- if property order differs, objects that are otherwise structurally equal may not match
|
|
54
|
+
- the helper is best suited for small, stable smoke payloads
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './smoke.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vyriy/smoke",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "Smoke request matcher for short-circuiting handlers in Vyriy projects",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"import": "./index.js",
|
|
13
|
+
"default": "./index.js"
|
|
14
|
+
},
|
|
15
|
+
"./index": {
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"import": "./index.js",
|
|
18
|
+
"default": "./index.js"
|
|
19
|
+
},
|
|
20
|
+
"./index.js": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"import": "./index.js",
|
|
23
|
+
"default": "./index.js"
|
|
24
|
+
},
|
|
25
|
+
"./smoke": {
|
|
26
|
+
"types": "./smoke.d.ts",
|
|
27
|
+
"import": "./smoke.js",
|
|
28
|
+
"default": "./smoke.js"
|
|
29
|
+
},
|
|
30
|
+
"./smoke.js": {
|
|
31
|
+
"types": "./smoke.d.ts",
|
|
32
|
+
"import": "./smoke.js",
|
|
33
|
+
"default": "./smoke.js"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/smoke.d.ts
ADDED
package/smoke.js
ADDED
package/types.d.ts
ADDED