@walkeros/transformer-validate 4.4.0 → 4.5.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/CHANGELOG.md +12 -0
- package/README.md +100 -0
- package/dist/walkerOS.json +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @walkeros/transformer-validate
|
|
2
2
|
|
|
3
|
+
## 4.5.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3571ca1: Add package READMEs and npm keywords. The MCP packages now ship
|
|
8
|
+
install instructions for Claude Code, Cursor, and VS Code plus MCP registry
|
|
9
|
+
metadata (mcpName).
|
|
10
|
+
- Updated dependencies [63845bb]
|
|
11
|
+
- Updated dependencies [79cdcb0]
|
|
12
|
+
- Updated dependencies [756b571]
|
|
13
|
+
- @walkeros/core@4.5.0
|
|
14
|
+
|
|
3
15
|
## 4.4.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<p align="left">
|
|
2
|
+
<a href="https://www.walkeros.io">
|
|
3
|
+
<img alt="walkerOS" title="walkerOS" src="https://www.walkeros.io/img/walkerOS_logo.svg" width="256px"/>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# @walkeros/transformer-validate
|
|
8
|
+
|
|
9
|
+
Enforce JSON Schema contracts on walkerOS events at runtime. Checks each event
|
|
10
|
+
against its contract and records a verdict, either annotating the event and
|
|
11
|
+
continuing or dropping it. Runs on both web and server.
|
|
12
|
+
|
|
13
|
+
[Documentation](https://www.walkeros.io/docs/transformers/validate) •
|
|
14
|
+
[NPM Package](https://www.npmjs.com/package/@walkeros/transformer-validate)
|
|
15
|
+
•
|
|
16
|
+
[Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/transformers/validate)
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @walkeros/transformer-validate
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { startFlow } from '@walkeros/collector';
|
|
28
|
+
import { transformerValidate } from '@walkeros/transformer-validate';
|
|
29
|
+
|
|
30
|
+
await startFlow({
|
|
31
|
+
transformers: {
|
|
32
|
+
validate: {
|
|
33
|
+
code: transformerValidate,
|
|
34
|
+
config: { settings: { contract: [contractWeb], mode: 'strict' } },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The same step in a bundled flow, referencing a named contract from the top-level
|
|
41
|
+
`contract` block:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"version": 4,
|
|
46
|
+
"contract": {
|
|
47
|
+
"web": {
|
|
48
|
+
"events": {
|
|
49
|
+
"order": {
|
|
50
|
+
"complete": {
|
|
51
|
+
"properties": { "data": { "required": ["total", "currency"] } }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"flows": {
|
|
58
|
+
"default": {
|
|
59
|
+
"transformers": {
|
|
60
|
+
"validate": {
|
|
61
|
+
"package": "@walkeros/transformer-validate",
|
|
62
|
+
"config": {
|
|
63
|
+
"settings": { "contract": ["$contract.web"], "mode": "strict" }
|
|
64
|
+
},
|
|
65
|
+
"next": "ga4"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Modes
|
|
74
|
+
|
|
75
|
+
`mode` decides what happens to an invalid event:
|
|
76
|
+
|
|
77
|
+
- **`pass`** (default) writes the verdict to the event and continues, so a
|
|
78
|
+
downstream step can route on `event.source.valid`.
|
|
79
|
+
- **`strict`** records the errors and stops the chain, so the event never
|
|
80
|
+
reaches downstream steps.
|
|
81
|
+
|
|
82
|
+
The boolean verdict goes onto the event as data that travels with it. The issue
|
|
83
|
+
list goes onto the ingest as diagnostics, so it survives even a strict-mode
|
|
84
|
+
drop.
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
Full configuration, contract references, and examples live in the docs:
|
|
89
|
+
**https://www.walkeros.io/docs/transformers/validate**
|
|
90
|
+
|
|
91
|
+
## Contribute
|
|
92
|
+
|
|
93
|
+
Feel free to contribute by submitting an
|
|
94
|
+
[issue](https://github.com/elbwalker/walkerOS/issues), starting a
|
|
95
|
+
[discussion](https://github.com/elbwalker/walkerOS/discussions), or getting in
|
|
96
|
+
[contact](https://calendly.com/elb-alexander/30min).
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
MIT
|
package/dist/walkerOS.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/transformer-validate",
|
|
3
3
|
"description": "JSON Schema contract validation transformer for walkerOS",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"test": "jest"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@walkeros/core": "4.
|
|
36
|
+
"@walkeros/core": "4.5.0",
|
|
37
37
|
"@cfworker/json-schema": "^4.1.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@walkeros/core": "4.
|
|
40
|
+
"@walkeros/core": "4.5.0"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|