@gorules/zen-engine 0.55.0-beta.6 → 1.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/index.d.ts +26 -5
- package/package.json +11 -10
package/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
export type PolicyPropertyKind = 'input' | 'computed';
|
|
5
5
|
export type PolicyFieldKind = 'scalar' | 'enum' | 'relationship' | 'reference';
|
|
6
|
-
export type PolicySeverity = 'error' | 'warning';
|
|
6
|
+
export type PolicySeverity = 'error' | 'warning' | 'hint';
|
|
7
7
|
|
|
8
8
|
/** Text range, `[start, end)` byte offsets. */
|
|
9
9
|
export type PolicySpan = [number, number];
|
|
@@ -28,11 +28,13 @@ export type PolicyCursorTarget =
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* How an entity field came into existence — declared by a DataModel
|
|
31
|
-
* (`schema`) or produced by a rule block (`computed`).
|
|
31
|
+
* (`schema`) or produced by a rule block (`computed`). Computed fields
|
|
32
|
+
* whose value provably consists of entity instances (identity preserved
|
|
33
|
+
* through filter / index / slice) carry `instanceOf`.
|
|
32
34
|
*/
|
|
33
35
|
export type PolicyFieldOrigin =
|
|
34
36
|
| { origin: 'schema'; source: string; fieldKind: PolicyFieldKindInfo }
|
|
35
|
-
| { origin: 'computed'; writtenBy: PolicyPropertyWriter };
|
|
37
|
+
| { origin: 'computed'; writtenBy: PolicyPropertyWriter; instanceOf?: PolicyInstanceOf };
|
|
36
38
|
export type PolicyDiagnosticCode =
|
|
37
39
|
| 'UNDEFINED_VARIABLE'
|
|
38
40
|
| 'TYPE_MISMATCH'
|
|
@@ -55,7 +57,13 @@ export type PolicyDiagnosticCode =
|
|
|
55
57
|
| 'INVALID_NAME'
|
|
56
58
|
| 'MAX_DEPTH_EXCEEDED'
|
|
57
59
|
| 'IMPORT_NOT_FOUND'
|
|
58
|
-
| 'CIRCULAR_IMPORT'
|
|
60
|
+
| 'CIRCULAR_IMPORT'
|
|
61
|
+
| 'REDUNDANT_NULLISH'
|
|
62
|
+
| 'REPEATED_DERIVATION'
|
|
63
|
+
| 'PREFER_MATCH'
|
|
64
|
+
| 'REDUNDANT_TABLE_ROW'
|
|
65
|
+
| 'NON_DISCRIMINATING_COLUMN'
|
|
66
|
+
| 'REDUNDANT_PARENTHESES';
|
|
59
67
|
|
|
60
68
|
export type PolicyVariableType =
|
|
61
69
|
| { type: 'any' }
|
|
@@ -178,6 +186,13 @@ export interface PolicyBlockExecution {
|
|
|
178
186
|
instancePath?: string;
|
|
179
187
|
trace: PolicyBlockTrace;
|
|
180
188
|
operandValues?: Record<string, unknown>;
|
|
189
|
+
writes?: PolicyWriteTrace[];
|
|
190
|
+
reads?: string[];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface PolicyWriteTrace {
|
|
194
|
+
path: string;
|
|
195
|
+
value: unknown;
|
|
181
196
|
}
|
|
182
197
|
|
|
183
198
|
export interface PolicyDecisionTableExtras {
|
|
@@ -437,11 +452,17 @@ export interface PolicyInspectResult {
|
|
|
437
452
|
label: string
|
|
438
453
|
}
|
|
439
454
|
|
|
455
|
+
export interface PolicyInstanceOf {
|
|
456
|
+
target: string
|
|
457
|
+
array: boolean
|
|
458
|
+
}
|
|
459
|
+
|
|
440
460
|
export interface PolicyOutputProperty {
|
|
441
461
|
path: string
|
|
442
462
|
resolvedType: PolicyVariableType
|
|
443
463
|
kind: PolicyPropertyKind
|
|
444
464
|
writtenBy?: PolicyPropertyWriter
|
|
465
|
+
instanceOf?: PolicyInstanceOf
|
|
445
466
|
}
|
|
446
467
|
|
|
447
468
|
export interface PolicyPrepareRenameResult {
|
|
@@ -508,7 +529,7 @@ export interface ZenEngineHandlerResponse {
|
|
|
508
529
|
}
|
|
509
530
|
|
|
510
531
|
export interface ZenEngineOptions {
|
|
511
|
-
loader?: ((key: string) => Promise<Buffer | ZenDecisionContent>) | { type: 'static'; content: Record<string, object
|
|
532
|
+
loader?: ((key: string) => Promise<Buffer | ZenDecisionContent>) | { type: 'static'; content: Record<string, object> } | { type: 'fs'; path: string } | { type: 'zip'; bytes: Buffer }
|
|
512
533
|
customHandler?: (request: ZenEngineHandlerRequest) => Promise<ZenEngineHandlerResponse>
|
|
513
534
|
httpHandler?: (request: ZenHttpHandlerRequest) => Promise<ZenHttpHandlerResponse>
|
|
514
535
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gorules/zen-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -91,20 +91,21 @@
|
|
|
91
91
|
"test": "cross-env __ZEN_MOCK_UTC_TIME=2025-08-19T16:55:02.078Z jest",
|
|
92
92
|
"artifacts": "napi artifacts -d ../../artifacts",
|
|
93
93
|
"createNpmDirs": "napi create-npm-dirs",
|
|
94
|
-
"prepublishOnly": "napi prepublish",
|
|
94
|
+
"prepublishOnly": "napi prepublish --no-gh-release",
|
|
95
95
|
"version": "napi version"
|
|
96
96
|
},
|
|
97
97
|
"resolutions": {
|
|
98
98
|
"form-data@^4.0.0": "4.0.4"
|
|
99
99
|
},
|
|
100
|
+
"gitHead": "c064ed0c4ceaf48a3ddfd6bf97608d92702c97e1",
|
|
100
101
|
"optionalDependencies": {
|
|
101
|
-
"@gorules/zen-engine-darwin-x64": "0.
|
|
102
|
-
"@gorules/zen-engine-linux-x64-gnu": "0.
|
|
103
|
-
"@gorules/zen-engine-linux-x64-musl": "0.
|
|
104
|
-
"@gorules/zen-engine-win32-x64-msvc": "0.
|
|
105
|
-
"@gorules/zen-engine-linux-arm64-gnu": "0.
|
|
106
|
-
"@gorules/zen-engine-linux-arm64-musl": "0.
|
|
107
|
-
"@gorules/zen-engine-darwin-arm64": "0.
|
|
108
|
-
"@gorules/zen-engine-wasm32-wasi": "0.
|
|
102
|
+
"@gorules/zen-engine-darwin-x64": "1.0.0-beta.2",
|
|
103
|
+
"@gorules/zen-engine-linux-x64-gnu": "1.0.0-beta.2",
|
|
104
|
+
"@gorules/zen-engine-linux-x64-musl": "1.0.0-beta.2",
|
|
105
|
+
"@gorules/zen-engine-win32-x64-msvc": "1.0.0-beta.2",
|
|
106
|
+
"@gorules/zen-engine-linux-arm64-gnu": "1.0.0-beta.2",
|
|
107
|
+
"@gorules/zen-engine-linux-arm64-musl": "1.0.0-beta.2",
|
|
108
|
+
"@gorules/zen-engine-darwin-arm64": "1.0.0-beta.2",
|
|
109
|
+
"@gorules/zen-engine-wasm32-wasi": "1.0.0-beta.2"
|
|
109
110
|
}
|
|
110
111
|
}
|