@fabricorg/platform 1.0.0 → 1.2.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 +75 -0
- package/README.md +20 -7
- package/dist/adapters/index.cjs +18 -6
- package/dist/adapters/index.d.cts +76 -1
- package/dist/adapters/index.d.ts +76 -1
- package/dist/adapters/index.js +1 -1
- package/dist/{chunk-YZKUEC2J.cjs → chunk-3BGFHSSK.cjs} +4 -4
- package/dist/{chunk-YZKUEC2J.cjs.map → chunk-3BGFHSSK.cjs.map} +1 -1
- package/dist/{chunk-35LADVKK.cjs → chunk-3UBX7KQM.cjs} +65 -13
- package/dist/chunk-3UBX7KQM.cjs.map +1 -0
- package/dist/{chunk-T5ESIJ4K.js → chunk-63MYMAEX.js} +57 -5
- package/dist/chunk-63MYMAEX.js.map +1 -0
- package/dist/{chunk-OWSSGFNY.js → chunk-7GAWSUOG.js} +22 -3
- package/dist/chunk-7GAWSUOG.js.map +1 -0
- package/dist/{chunk-IFMZPLM4.js → chunk-AWP6JDD5.js} +3 -3
- package/dist/{chunk-IFMZPLM4.js.map → chunk-AWP6JDD5.js.map} +1 -1
- package/dist/{chunk-M5FGWXT3.cjs → chunk-CXR6KEKQ.cjs} +11 -10
- package/dist/chunk-CXR6KEKQ.cjs.map +1 -0
- package/dist/{chunk-3ZW5USXF.js → chunk-DTY3CHQZ.js} +24 -5
- package/dist/chunk-DTY3CHQZ.js.map +1 -0
- package/dist/chunk-IFW43ELT.cjs +331 -0
- package/dist/chunk-IFW43ELT.cjs.map +1 -0
- package/dist/{chunk-J5LS5BSI.js → chunk-JG35DT2G.js} +11 -10
- package/dist/chunk-JG35DT2G.js.map +1 -0
- package/dist/{chunk-53VEUYCS.cjs → chunk-LDPBQ72C.cjs} +2 -2
- package/dist/chunk-LDPBQ72C.cjs.map +1 -0
- package/dist/{chunk-CRAGTJ3B.js → chunk-LZNXUTJQ.js} +4 -3
- package/dist/chunk-LZNXUTJQ.js.map +1 -0
- package/dist/{chunk-NPVIFZQV.cjs → chunk-N2BBUKCX.cjs} +26 -4
- package/dist/chunk-N2BBUKCX.cjs.map +1 -0
- package/dist/{chunk-CQSA3BII.js → chunk-NHGBTPPE.js} +2 -2
- package/dist/chunk-NHGBTPPE.js.map +1 -0
- package/dist/{chunk-ANPJYXBK.cjs → chunk-TBS2S5AX.cjs} +8 -2
- package/dist/chunk-TBS2S5AX.cjs.map +1 -0
- package/dist/{chunk-JFMNLJLY.cjs → chunk-UITRHBZH.cjs} +7 -6
- package/dist/chunk-UITRHBZH.cjs.map +1 -0
- package/dist/{chunk-WAI4UNWQ.cjs → chunk-WI7CWNYI.cjs} +22 -2
- package/dist/chunk-WI7CWNYI.cjs.map +1 -0
- package/dist/{chunk-3OWMPDBD.js → chunk-Y2PJLRIY.js} +8 -2
- package/dist/chunk-Y2PJLRIY.js.map +1 -0
- package/dist/chunk-ZAEVQSB5.js +326 -0
- package/dist/chunk-ZAEVQSB5.js.map +1 -0
- package/dist/events/index.cjs +2 -2
- package/dist/events/index.d.cts +7 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.js +1 -1
- package/dist/governance/index.cjs +4 -4
- package/dist/governance/index.d.cts +4 -0
- package/dist/governance/index.d.ts +4 -0
- package/dist/governance/index.js +1 -1
- package/dist/index.cjs +64 -44
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +9 -9
- package/dist/manifest/index.cjs +11 -11
- package/dist/manifest/index.d.cts +1 -0
- package/dist/manifest/index.d.ts +1 -0
- package/dist/manifest/index.js +5 -5
- package/dist/modules/index.cjs +12 -12
- package/dist/modules/index.d.cts +33 -1
- package/dist/modules/index.d.ts +33 -1
- package/dist/modules/index.js +4 -4
- package/dist/objects/index.cjs +8 -4
- package/dist/objects/index.d.cts +11 -1
- package/dist/objects/index.d.ts +11 -1
- package/dist/objects/index.js +1 -1
- package/dist/projections/index.cjs +5 -5
- package/dist/projections/index.d.cts +9 -1
- package/dist/projections/index.d.ts +9 -1
- package/dist/projections/index.js +1 -1
- package/dist/state-machines/index.cjs +7 -3
- package/dist/state-machines/index.d.cts +10 -1
- package/dist/state-machines/index.d.ts +10 -1
- package/dist/state-machines/index.js +1 -1
- package/dist/testing/index.cjs +5 -5
- package/dist/testing/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-35LADVKK.cjs.map +0 -1
- package/dist/chunk-3OWMPDBD.js.map +0 -1
- package/dist/chunk-3ZW5USXF.js.map +0 -1
- package/dist/chunk-53VEUYCS.cjs.map +0 -1
- package/dist/chunk-ANPJYXBK.cjs.map +0 -1
- package/dist/chunk-CBY6GRJP.cjs +0 -140
- package/dist/chunk-CBY6GRJP.cjs.map +0 -1
- package/dist/chunk-CQSA3BII.js.map +0 -1
- package/dist/chunk-CRAGTJ3B.js.map +0 -1
- package/dist/chunk-J5LS5BSI.js.map +0 -1
- package/dist/chunk-JFMNLJLY.cjs.map +0 -1
- package/dist/chunk-M5FGWXT3.cjs.map +0 -1
- package/dist/chunk-NETLRKDS.js +0 -136
- package/dist/chunk-NETLRKDS.js.map +0 -1
- package/dist/chunk-NPVIFZQV.cjs.map +0 -1
- package/dist/chunk-OWSSGFNY.js.map +0 -1
- package/dist/chunk-T5ESIJ4K.js.map +0 -1
- package/dist/chunk-WAI4UNWQ.cjs.map +0 -1
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
// objects/index.ts
|
|
2
|
+
var BUILT_IN_OBJECT_TYPES = Object.freeze([
|
|
3
|
+
"AssetEvent",
|
|
4
|
+
"ActionInvocation",
|
|
5
|
+
"PolicyEvaluation",
|
|
6
|
+
"ApprovalRequest",
|
|
7
|
+
"ConsentRecord",
|
|
8
|
+
"AgentRun"
|
|
9
|
+
]);
|
|
10
|
+
var supportedSchemaKeywords = Object.freeze([
|
|
11
|
+
"$schema",
|
|
12
|
+
"$id",
|
|
13
|
+
"$ref",
|
|
14
|
+
"$defs",
|
|
15
|
+
"title",
|
|
16
|
+
"description",
|
|
17
|
+
"type",
|
|
18
|
+
"enum",
|
|
19
|
+
"const",
|
|
20
|
+
"properties",
|
|
21
|
+
"required",
|
|
22
|
+
"additionalProperties",
|
|
23
|
+
"items",
|
|
24
|
+
"prefixItems",
|
|
25
|
+
"propertyNames",
|
|
26
|
+
"patternProperties",
|
|
27
|
+
"dependentRequired",
|
|
28
|
+
"allOf",
|
|
29
|
+
"anyOf",
|
|
30
|
+
"oneOf",
|
|
31
|
+
"not",
|
|
32
|
+
"minimum",
|
|
33
|
+
"maximum",
|
|
34
|
+
"exclusiveMinimum",
|
|
35
|
+
"exclusiveMaximum",
|
|
36
|
+
"minLength",
|
|
37
|
+
"maxLength",
|
|
38
|
+
"pattern",
|
|
39
|
+
"format",
|
|
40
|
+
"minItems",
|
|
41
|
+
"maxItems",
|
|
42
|
+
"uniqueItems",
|
|
43
|
+
"default",
|
|
44
|
+
"readOnly",
|
|
45
|
+
"writeOnly",
|
|
46
|
+
"deprecated",
|
|
47
|
+
"contentEncoding",
|
|
48
|
+
"contentMediaType",
|
|
49
|
+
"multipleOf",
|
|
50
|
+
"if",
|
|
51
|
+
"then",
|
|
52
|
+
"else",
|
|
53
|
+
"examples",
|
|
54
|
+
"$comment"
|
|
55
|
+
]);
|
|
56
|
+
function assertPortableJsonSchema(schema, path = "schema") {
|
|
57
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
58
|
+
throw new Error(`${path} must be a JSON Schema object.`);
|
|
59
|
+
}
|
|
60
|
+
const value = schema;
|
|
61
|
+
for (const keyword of Object.keys(value)) {
|
|
62
|
+
if (!supportedSchemaKeywords.includes(keyword) && !keyword.startsWith("x-")) {
|
|
63
|
+
throw new Error(`${path} uses unsupported JSON Schema keyword "${keyword}".`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (value.properties !== void 0) {
|
|
67
|
+
if (!value.properties || typeof value.properties !== "object" || Array.isArray(value.properties)) {
|
|
68
|
+
throw new Error(`${path}.properties must be an object.`);
|
|
69
|
+
}
|
|
70
|
+
for (const [name, child] of Object.entries(value.properties)) {
|
|
71
|
+
assertPortableJsonSchema(child, `${path}.properties.${name}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (value.$defs !== void 0) {
|
|
75
|
+
if (!value.$defs || typeof value.$defs !== "object" || Array.isArray(value.$defs)) {
|
|
76
|
+
throw new Error(`${path}.$defs must be an object.`);
|
|
77
|
+
}
|
|
78
|
+
for (const [name, child] of Object.entries(value.$defs)) {
|
|
79
|
+
assertPortableJsonSchema(child, `${path}.$defs.${name}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (value.patternProperties !== void 0) {
|
|
83
|
+
if (!value.patternProperties || typeof value.patternProperties !== "object" || Array.isArray(value.patternProperties)) throw new Error(`${path}.patternProperties must be an object.`);
|
|
84
|
+
for (const [name, child] of Object.entries(value.patternProperties)) assertPortableJsonSchema(child, `${path}.patternProperties.${name}`);
|
|
85
|
+
}
|
|
86
|
+
for (const keyword of ["allOf", "anyOf", "oneOf"]) {
|
|
87
|
+
if (value[keyword] !== void 0) {
|
|
88
|
+
if (!Array.isArray(value[keyword])) throw new Error(`${path}.${keyword} must be an array.`);
|
|
89
|
+
value[keyword].forEach((child, index) => assertPortableJsonSchema(child, `${path}.${keyword}[${index}]`));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (value.not !== void 0) assertPortableJsonSchema(value.not, `${path}.not`);
|
|
93
|
+
for (const keyword of ["propertyNames", "if", "then", "else"]) if (value[keyword] !== void 0) assertPortableJsonSchema(value[keyword], `${path}.${keyword}`);
|
|
94
|
+
if (value.additionalProperties !== void 0 && typeof value.additionalProperties !== "boolean") {
|
|
95
|
+
assertPortableJsonSchema(value.additionalProperties, `${path}.additionalProperties`);
|
|
96
|
+
}
|
|
97
|
+
if (value.items !== void 0) {
|
|
98
|
+
if (Array.isArray(value.items)) {
|
|
99
|
+
value.items.forEach((child, index) => assertPortableJsonSchema(child, `${path}.items[${index}]`));
|
|
100
|
+
} else {
|
|
101
|
+
assertPortableJsonSchema(value.items, `${path}.items`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (value.prefixItems !== void 0) {
|
|
105
|
+
if (!Array.isArray(value.prefixItems)) throw new Error(`${path}.prefixItems must be an array.`);
|
|
106
|
+
value.prefixItems.forEach((child, index) => assertPortableJsonSchema(child, `${path}.prefixItems[${index}]`));
|
|
107
|
+
}
|
|
108
|
+
if (value.dependentRequired !== void 0) {
|
|
109
|
+
if (!value.dependentRequired || typeof value.dependentRequired !== "object" || Array.isArray(value.dependentRequired) || Object.values(value.dependentRequired).some((items) => !Array.isArray(items) || items.some((item) => typeof item !== "string"))) throw new Error(`${path}.dependentRequired must map property names to arrays of property names.`);
|
|
110
|
+
}
|
|
111
|
+
if (value.required !== void 0 && (!Array.isArray(value.required) || value.required.some((item) => typeof item !== "string"))) {
|
|
112
|
+
throw new Error(`${path}.required must be an array of property names.`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function validatePortableJson(schema, value) {
|
|
116
|
+
const issues = [];
|
|
117
|
+
validateSchema(schema, value, [], schema, issues, /* @__PURE__ */ new Set());
|
|
118
|
+
return issues;
|
|
119
|
+
}
|
|
120
|
+
function validateSchema(schema, value, path, root, issues, refStack) {
|
|
121
|
+
if (!isJsonValue(value)) {
|
|
122
|
+
issues.push({ path, message: "Value must contain JSON-serializable data." });
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (schema.$ref) {
|
|
126
|
+
const prefix = "#/$defs/";
|
|
127
|
+
if (!schema.$ref.startsWith(prefix)) {
|
|
128
|
+
issues.push({ path, message: `Unsupported JSON Schema reference "${schema.$ref}".` });
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const name = schema.$ref.slice(prefix.length);
|
|
132
|
+
const referenced = root.$defs?.[name];
|
|
133
|
+
if (!referenced) {
|
|
134
|
+
issues.push({ path, message: `JSON Schema reference "${schema.$ref}" was not found.` });
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (refStack.has(schema.$ref)) {
|
|
138
|
+
issues.push({ path, message: `Circular JSON Schema reference "${schema.$ref}" is not supported.` });
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const nextRefs = new Set(refStack);
|
|
142
|
+
nextRefs.add(schema.$ref);
|
|
143
|
+
validateSchema(referenced, value, path, root, issues, nextRefs);
|
|
144
|
+
}
|
|
145
|
+
if (schema.allOf) {
|
|
146
|
+
for (const child of schema.allOf) validateSchema(child, value, path, root, issues, refStack);
|
|
147
|
+
}
|
|
148
|
+
if (schema.anyOf && !schema.anyOf.some((child) => validateWithoutIssues(child, value, root, refStack))) {
|
|
149
|
+
issues.push({ path, message: "Value must satisfy at least one JSON Schema alternative." });
|
|
150
|
+
}
|
|
151
|
+
if (schema.oneOf && schema.oneOf.filter((child) => validateWithoutIssues(child, value, root, refStack)).length !== 1) {
|
|
152
|
+
issues.push({ path, message: "Value must satisfy exactly one JSON Schema alternative." });
|
|
153
|
+
}
|
|
154
|
+
if (schema.not && validateWithoutIssues(schema.not, value, root, refStack)) {
|
|
155
|
+
issues.push({ path, message: "Value must not satisfy the JSON Schema exclusion." });
|
|
156
|
+
}
|
|
157
|
+
if (schema.if) {
|
|
158
|
+
const condition = validateWithoutIssues(schema.if, value, root, refStack);
|
|
159
|
+
if (condition && schema.then) validateSchema(schema.then, value, path, root, issues, refStack);
|
|
160
|
+
if (!condition && schema.else) validateSchema(schema.else, value, path, root, issues, refStack);
|
|
161
|
+
}
|
|
162
|
+
if (schema.const !== void 0 && !jsonValuesEqual(value, schema.const)) {
|
|
163
|
+
issues.push({ path, message: "Value does not match the JSON Schema const." });
|
|
164
|
+
}
|
|
165
|
+
if (schema.enum && !schema.enum.some((item) => jsonValuesEqual(value, item))) {
|
|
166
|
+
issues.push({ path, message: "Value is not one of the allowed JSON Schema enum values." });
|
|
167
|
+
}
|
|
168
|
+
if (schema.type !== void 0) {
|
|
169
|
+
const types = Array.isArray(schema.type) ? schema.type : [schema.type];
|
|
170
|
+
if (!types.some((type) => matchesJsonType(type, value))) {
|
|
171
|
+
issues.push({ path, message: `Value must have JSON Schema type ${types.join(" or ")}.` });
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (typeof value === "string") {
|
|
176
|
+
if (schema.minLength !== void 0 && [...value].length < schema.minLength) issues.push({ path, message: `String must contain at least ${schema.minLength} characters.` });
|
|
177
|
+
if (schema.maxLength !== void 0 && [...value].length > schema.maxLength) issues.push({ path, message: `String must contain at most ${schema.maxLength} characters.` });
|
|
178
|
+
if (schema.pattern !== void 0) {
|
|
179
|
+
try {
|
|
180
|
+
if (!new RegExp(schema.pattern).test(value)) issues.push({ path, message: "String does not match the JSON Schema pattern." });
|
|
181
|
+
} catch {
|
|
182
|
+
issues.push({ path, message: "JSON Schema pattern is invalid." });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (typeof value === "number") {
|
|
187
|
+
if (schema.minimum !== void 0 && value < schema.minimum) issues.push({ path, message: `Number must be greater than or equal to ${schema.minimum}.` });
|
|
188
|
+
if (schema.maximum !== void 0 && value > schema.maximum) issues.push({ path, message: `Number must be less than or equal to ${schema.maximum}.` });
|
|
189
|
+
if (schema.exclusiveMinimum !== void 0 && value <= schema.exclusiveMinimum) issues.push({ path, message: `Number must be greater than ${schema.exclusiveMinimum}.` });
|
|
190
|
+
if (schema.exclusiveMaximum !== void 0 && value >= schema.exclusiveMaximum) issues.push({ path, message: `Number must be less than ${schema.exclusiveMaximum}.` });
|
|
191
|
+
if (schema.multipleOf !== void 0 && !isMultipleOf(value, schema.multipleOf)) issues.push({ path, message: `Number must be a multiple of ${schema.multipleOf}.` });
|
|
192
|
+
}
|
|
193
|
+
if (Array.isArray(value)) {
|
|
194
|
+
if (schema.minItems !== void 0 && value.length < schema.minItems) issues.push({ path, message: `Array must contain at least ${schema.minItems} items.` });
|
|
195
|
+
if (schema.maxItems !== void 0 && value.length > schema.maxItems) issues.push({ path, message: `Array must contain at most ${schema.maxItems} items.` });
|
|
196
|
+
if (schema.uniqueItems && value.some((item, index) => value.findIndex((other) => jsonValuesEqual(item, other)) !== index)) issues.push({ path, message: "Array items must be unique." });
|
|
197
|
+
if (schema.prefixItems) {
|
|
198
|
+
for (const [index, child] of schema.prefixItems.entries()) {
|
|
199
|
+
if (index < value.length) validateSchema(child, value[index], [...path, index], root, issues, refStack);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (schema.items && !Array.isArray(schema.items)) {
|
|
203
|
+
for (const [index, item] of value.entries()) validateSchema(schema.items, item, [...path, index], root, issues, refStack);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
207
|
+
const object = value;
|
|
208
|
+
for (const required of schema.required ?? []) {
|
|
209
|
+
if (!(required in object)) issues.push({ path: [...path, required], message: "Required property is missing." });
|
|
210
|
+
}
|
|
211
|
+
for (const [name, child] of Object.entries(schema.properties ?? {})) {
|
|
212
|
+
if (name in object) validateSchema(child, object[name], [...path, name], root, issues, refStack);
|
|
213
|
+
}
|
|
214
|
+
for (const [name, child] of Object.entries(schema.patternProperties ?? {})) {
|
|
215
|
+
let matcher;
|
|
216
|
+
try {
|
|
217
|
+
matcher = new RegExp(name);
|
|
218
|
+
} catch {
|
|
219
|
+
issues.push({ path, message: "JSON Schema patternProperties pattern is invalid." });
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
for (const property of Object.keys(object)) {
|
|
223
|
+
if (matcher.test(property)) validateSchema(child, object[property], [...path, property], root, issues, refStack);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (schema.propertyNames) {
|
|
227
|
+
for (const property of Object.keys(object)) validateSchema(schema.propertyNames, property, [...path, property], root, issues, refStack);
|
|
228
|
+
}
|
|
229
|
+
if (schema.additionalProperties === false) {
|
|
230
|
+
const declared = new Set(Object.keys(schema.properties ?? {}));
|
|
231
|
+
for (const property of Object.keys(schema.patternProperties ?? {})) declared.add(property);
|
|
232
|
+
for (const property of Object.keys(object)) {
|
|
233
|
+
const matchesPattern = Object.keys(schema.patternProperties ?? {}).some((pattern) => {
|
|
234
|
+
try {
|
|
235
|
+
return new RegExp(pattern).test(property);
|
|
236
|
+
} catch {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
if (!declared.has(property) && !matchesPattern) issues.push({ path: [...path, property], message: "Additional properties are not permitted." });
|
|
241
|
+
}
|
|
242
|
+
} else if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
|
|
243
|
+
const declared = new Set(Object.keys(schema.properties ?? {}));
|
|
244
|
+
for (const property of Object.keys(object)) {
|
|
245
|
+
if (!declared.has(property)) validateSchema(schema.additionalProperties, object[property], [...path, property], root, issues, refStack);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
for (const [property, dependencies] of Object.entries(schema.dependentRequired ?? {})) {
|
|
249
|
+
if (property in object) {
|
|
250
|
+
for (const dependency of dependencies) if (!(dependency in object)) issues.push({ path: [...path, dependency], message: `Property is required when "${property}" is present.` });
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function validateWithoutIssues(schema, value, root, refStack) {
|
|
256
|
+
const issues = [];
|
|
257
|
+
validateSchema(schema, value, [], root, issues, refStack);
|
|
258
|
+
return issues.length === 0;
|
|
259
|
+
}
|
|
260
|
+
function matchesJsonType(type, value) {
|
|
261
|
+
switch (type) {
|
|
262
|
+
case "null":
|
|
263
|
+
return value === null;
|
|
264
|
+
case "boolean":
|
|
265
|
+
return typeof value === "boolean";
|
|
266
|
+
case "object":
|
|
267
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
268
|
+
case "array":
|
|
269
|
+
return Array.isArray(value);
|
|
270
|
+
case "number":
|
|
271
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
272
|
+
case "integer":
|
|
273
|
+
return typeof value === "number" && Number.isSafeInteger(value);
|
|
274
|
+
case "string":
|
|
275
|
+
return typeof value === "string";
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function isMultipleOf(value, divisor) {
|
|
279
|
+
if (!Number.isFinite(divisor) || divisor <= 0) return false;
|
|
280
|
+
const quotient = value / divisor;
|
|
281
|
+
return Math.abs(quotient - Math.round(quotient)) < Number.EPSILON * Math.max(1, Math.abs(quotient));
|
|
282
|
+
}
|
|
283
|
+
function jsonValuesEqual(left, right) {
|
|
284
|
+
if (Object.is(left, right)) return true;
|
|
285
|
+
if (typeof left !== typeof right || left === null || right === null) return false;
|
|
286
|
+
if (Array.isArray(left) && Array.isArray(right)) return left.length === right.length && left.every((item, index) => jsonValuesEqual(item, right[index]));
|
|
287
|
+
if (typeof left === "object" && typeof right === "object") {
|
|
288
|
+
const leftObject = left;
|
|
289
|
+
const rightObject = right;
|
|
290
|
+
const keys = Object.keys(leftObject);
|
|
291
|
+
return keys.length === Object.keys(rightObject).length && keys.every((key) => key in rightObject && jsonValuesEqual(leftObject[key], rightObject[key]));
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
function isJsonValue(value) {
|
|
296
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return true;
|
|
297
|
+
if (typeof value === "number") return Number.isFinite(value);
|
|
298
|
+
if (Array.isArray(value)) return value.every(isJsonValue);
|
|
299
|
+
if (value && typeof value === "object") {
|
|
300
|
+
const prototype = Object.getPrototypeOf(value);
|
|
301
|
+
return (prototype === Object.prototype || prototype === null) && Object.values(value).every(isJsonValue);
|
|
302
|
+
}
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
function assertObjectType(type) {
|
|
306
|
+
if (!/^[A-Z][a-zA-Z0-9]*$/.test(type)) {
|
|
307
|
+
throw new Error(
|
|
308
|
+
`Invalid object type: "${type}". Object types must be PascalCase alphanumeric.`
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function createObjectTypeRegistry(initialTypes = []) {
|
|
313
|
+
const objectTypes = /* @__PURE__ */ new Set([...BUILT_IN_OBJECT_TYPES, ...initialTypes]);
|
|
314
|
+
return {
|
|
315
|
+
register(type) {
|
|
316
|
+
assertObjectType(type);
|
|
317
|
+
objectTypes.add(type);
|
|
318
|
+
},
|
|
319
|
+
has: (type) => objectTypes.has(type),
|
|
320
|
+
list: () => Array.from(objectTypes).sort()
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export { assertObjectType, assertPortableJsonSchema, createObjectTypeRegistry, validatePortableJson };
|
|
325
|
+
//# sourceMappingURL=chunk-ZAEVQSB5.js.map
|
|
326
|
+
//# sourceMappingURL=chunk-ZAEVQSB5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../objects/index.ts"],"names":[],"mappings":";AAAA,IAAM,qBAAA,GAAwB,OAAO,MAAA,CAAO;AAAA,EAC3C,YAAA;AAAA,EACA,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA;AACD,CAAC,CAAA;AA4DD,IAAM,uBAAA,GAA0B,OAAO,MAAA,CAAO;AAAA,EAC7C,SAAA;AAAA,EAAW,KAAA;AAAA,EAAO,MAAA;AAAA,EAAQ,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS,aAAA;AAAA,EAAe,MAAA;AAAA,EAAQ,MAAA;AAAA,EAAQ,OAAA;AAAA,EAC3E,YAAA;AAAA,EAAc,UAAA;AAAA,EAAY,sBAAA;AAAA,EAAwB,OAAA;AAAA,EAAS,aAAA;AAAA,EAAe,eAAA;AAAA,EAAiB,mBAAA;AAAA,EAAqB,mBAAA;AAAA,EAAqB,OAAA;AAAA,EAAS,OAAA;AAAA,EAAS,OAAA;AAAA,EACvJ,KAAA;AAAA,EAAO,SAAA;AAAA,EAAW,SAAA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ACD;AAQO,SAAS,wBAAA,CAAyB,YAAA,GAAkC,EAAC,EAAuB;AAClG,EAAA,MAAM,WAAA,uBAAkB,GAAA,CAAI,CAAC,GAAG,qBAAA,EAAuB,GAAG,YAAY,CAAC,CAAA;AACvE,EAAA,OAAO;AAAA,IACN,SAAS,IAAA,EAAM;AACd,MAAA,gBAAA,CAAiB,IAAI,CAAA;AACrB,MAAA,WAAA,CAAY,IAAI,IAAI,CAAA;AAAA,IACrB,CAAA;AAAA,IACA,GAAA,EAAK,CAAC,IAAA,KAAS,WAAA,CAAY,IAAI,IAAI,CAAA;AAAA,IACnC,MAAM,MAAM,KAAA,CAAM,IAAA,CAAK,WAAW,EAAE,IAAA;AAAK,GAC1C;AACD","file":"chunk-ZAEVQSB5.js","sourcesContent":["const BUILT_IN_OBJECT_TYPES = Object.freeze([\n\t\"AssetEvent\",\n\t\"ActionInvocation\",\n\t\"PolicyEvaluation\",\n\t\"ApprovalRequest\",\n\t\"ConsentRecord\",\n\t\"AgentRun\",\n]);\n\nexport type FabricObjectType = string;\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };\n\n/**\n * Dependency-free JSON Schema profile accepted in portable module manifests.\n * Unknown extension keywords must use an `x-` prefix. Runtime validators may\n * support more vocabulary, but exported entity contracts stay in this profile.\n */\nexport interface PortableJsonSchema {\n\t$schema?: string;\n\t$id?: string;\n\t$ref?: string;\n\t$defs?: Record<string, PortableJsonSchema>;\n\ttitle?: string;\n\tdescription?: string;\n\ttype?: \"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"integer\" | \"string\" | Array<\"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"integer\" | \"string\">;\n\tenum?: JsonValue[];\n\tconst?: JsonValue;\n\tproperties?: Record<string, PortableJsonSchema>;\n\trequired?: string[];\n\tadditionalProperties?: boolean | PortableJsonSchema;\n\titems?: PortableJsonSchema | PortableJsonSchema[];\n\tprefixItems?: PortableJsonSchema[];\n\tpropertyNames?: PortableJsonSchema;\n\tpatternProperties?: Record<string, PortableJsonSchema>;\n\tdependentRequired?: Record<string, string[]>;\n\tallOf?: PortableJsonSchema[];\n\tanyOf?: PortableJsonSchema[];\n\toneOf?: PortableJsonSchema[];\n\tnot?: PortableJsonSchema;\n\tif?: PortableJsonSchema;\n\tthen?: PortableJsonSchema;\n\telse?: PortableJsonSchema;\n\tminimum?: number;\n\tmaximum?: number;\n\texclusiveMinimum?: number;\n\texclusiveMaximum?: number;\n\tmultipleOf?: number;\n\tminLength?: number;\n\tmaxLength?: number;\n\tpattern?: string;\n\tformat?: string;\n\tminItems?: number;\n\tmaxItems?: number;\n\tuniqueItems?: boolean;\n\tdefault?: JsonValue;\n\treadOnly?: boolean;\n\twriteOnly?: boolean;\n\tdeprecated?: boolean;\n\tcontentEncoding?: string;\n\tcontentMediaType?: string;\n\texamples?: JsonValue[];\n\t$comment?: string;\n\t[key: `x-${string}`]: JsonValue | undefined;\n}\n\nconst supportedSchemaKeywords = Object.freeze([\n\t\"$schema\", \"$id\", \"$ref\", \"$defs\", \"title\", \"description\", \"type\", \"enum\", \"const\",\n\t\"properties\", \"required\", \"additionalProperties\", \"items\", \"prefixItems\", \"propertyNames\", \"patternProperties\", \"dependentRequired\", \"allOf\", \"anyOf\", \"oneOf\",\n\t\"not\", \"minimum\", \"maximum\", \"exclusiveMinimum\", \"exclusiveMaximum\", \"minLength\",\n\t\"maxLength\", \"pattern\", \"format\", \"minItems\", \"maxItems\", \"uniqueItems\", \"default\",\n\t\"readOnly\", \"writeOnly\", \"deprecated\", \"contentEncoding\", \"contentMediaType\", \"multipleOf\", \"if\", \"then\", \"else\", \"examples\", \"$comment\",\n]);\n\nexport function assertPortableJsonSchema(\n\tschema: unknown,\n\tpath = \"schema\",\n): asserts schema is PortableJsonSchema {\n\tif (!schema || typeof schema !== \"object\" || Array.isArray(schema)) {\n\t\tthrow new Error(`${path} must be a JSON Schema object.`);\n\t}\n\tconst value = schema as Record<string, unknown>;\n\tfor (const keyword of Object.keys(value)) {\n\t\tif (!supportedSchemaKeywords.includes(keyword) && !keyword.startsWith(\"x-\")) {\n\t\t\tthrow new Error(`${path} uses unsupported JSON Schema keyword \"${keyword}\".`);\n\t\t}\n\t}\n\tif (value.properties !== undefined) {\n\t\tif (!value.properties || typeof value.properties !== \"object\" || Array.isArray(value.properties)) {\n\t\t\tthrow new Error(`${path}.properties must be an object.`);\n\t\t}\n\t\tfor (const [name, child] of Object.entries(value.properties)) {\n\t\t\tassertPortableJsonSchema(child, `${path}.properties.${name}`);\n\t\t}\n\t}\n\tif (value.$defs !== undefined) {\n\t\tif (!value.$defs || typeof value.$defs !== \"object\" || Array.isArray(value.$defs)) {\n\t\t\tthrow new Error(`${path}.$defs must be an object.`);\n\t\t}\n\t\tfor (const [name, child] of Object.entries(value.$defs)) {\n\t\t\tassertPortableJsonSchema(child, `${path}.$defs.${name}`);\n\t\t}\n\t}\n\tif (value.patternProperties !== undefined) {\n\t\tif (!value.patternProperties || typeof value.patternProperties !== \"object\" || Array.isArray(value.patternProperties)) throw new Error(`${path}.patternProperties must be an object.`);\n\t\tfor (const [name, child] of Object.entries(value.patternProperties)) assertPortableJsonSchema(child, `${path}.patternProperties.${name}`);\n\t}\n\tfor (const keyword of [\"allOf\", \"anyOf\", \"oneOf\"] as const) {\n\t\tif (value[keyword] !== undefined) {\n\t\t\tif (!Array.isArray(value[keyword])) throw new Error(`${path}.${keyword} must be an array.`);\n\t\t\tvalue[keyword].forEach((child, index) => assertPortableJsonSchema(child, `${path}.${keyword}[${index}]`));\n\t\t}\n\t}\n\tif (value.not !== undefined) assertPortableJsonSchema(value.not, `${path}.not`);\n\tfor (const keyword of [\"propertyNames\", \"if\", \"then\", \"else\"] as const) if (value[keyword] !== undefined) assertPortableJsonSchema(value[keyword], `${path}.${keyword}`);\n\tif (value.additionalProperties !== undefined && typeof value.additionalProperties !== \"boolean\") {\n\t\tassertPortableJsonSchema(value.additionalProperties, `${path}.additionalProperties`);\n\t}\n\tif (value.items !== undefined) {\n\t\tif (Array.isArray(value.items)) {\n\t\t\tvalue.items.forEach((child, index) => assertPortableJsonSchema(child, `${path}.items[${index}]`));\n\t\t} else {\n\t\t\tassertPortableJsonSchema(value.items, `${path}.items`);\n\t\t}\n\t}\n\tif (value.prefixItems !== undefined) {\n\t\tif (!Array.isArray(value.prefixItems)) throw new Error(`${path}.prefixItems must be an array.`);\n\t\tvalue.prefixItems.forEach((child, index) => assertPortableJsonSchema(child, `${path}.prefixItems[${index}]`));\n\t}\n\tif (value.dependentRequired !== undefined) {\n\t\tif (!value.dependentRequired || typeof value.dependentRequired !== \"object\" || Array.isArray(value.dependentRequired) || Object.values(value.dependentRequired).some((items) => !Array.isArray(items) || items.some((item) => typeof item !== \"string\"))) throw new Error(`${path}.dependentRequired must map property names to arrays of property names.`);\n\t}\n\tif (value.required !== undefined && (!Array.isArray(value.required) || value.required.some((item) => typeof item !== \"string\"))) {\n\t\tthrow new Error(`${path}.required must be an array of property names.`);\n\t}\n}\n\nexport interface JsonSchemaValidationIssue {\n\tpath: Array<string | number>;\n\tmessage: string;\n}\n\n/**\n * Validate JSON data against the dependency-free JSON Schema profile used by\n * portable contracts. This intentionally returns issues instead of throwing so\n * hosts can expose a stable, typed validation failure without leaking values.\n */\nexport function validatePortableJson(\n\tschema: PortableJsonSchema,\n\tvalue: unknown,\n): JsonSchemaValidationIssue[] {\n\tconst issues: JsonSchemaValidationIssue[] = [];\n\tvalidateSchema(schema, value, [], schema, issues, new Set());\n\treturn issues;\n}\n\nfunction validateSchema(\n\tschema: PortableJsonSchema,\n\tvalue: unknown,\n\tpath: Array<string | number>,\n\troot: PortableJsonSchema,\n\tissues: JsonSchemaValidationIssue[],\n\trefStack: Set<string>,\n): void {\n\tif (!isJsonValue(value)) {\n\t\tissues.push({ path, message: \"Value must contain JSON-serializable data.\" });\n\t\treturn;\n\t}\n\tif (schema.$ref) {\n\t\tconst prefix = \"#/$defs/\";\n\t\tif (!schema.$ref.startsWith(prefix)) {\n\t\t\tissues.push({ path, message: `Unsupported JSON Schema reference \"${schema.$ref}\".` });\n\t\t\treturn;\n\t\t}\n\t\tconst name = schema.$ref.slice(prefix.length);\n\t\tconst referenced = root.$defs?.[name];\n\t\tif (!referenced) {\n\t\t\tissues.push({ path, message: `JSON Schema reference \"${schema.$ref}\" was not found.` });\n\t\t\treturn;\n\t\t}\n\t\tif (refStack.has(schema.$ref)) {\n\t\t\tissues.push({ path, message: `Circular JSON Schema reference \"${schema.$ref}\" is not supported.` });\n\t\t\treturn;\n\t\t}\n\t\tconst nextRefs = new Set(refStack);\n\t\tnextRefs.add(schema.$ref);\n\t\tvalidateSchema(referenced, value, path, root, issues, nextRefs);\n\t}\n\n\tif (schema.allOf) {\n\t\tfor (const child of schema.allOf) validateSchema(child, value, path, root, issues, refStack);\n\t}\n\tif (schema.anyOf && !schema.anyOf.some((child) => validateWithoutIssues(child, value, root, refStack))) {\n\t\tissues.push({ path, message: \"Value must satisfy at least one JSON Schema alternative.\" });\n\t}\n\tif (schema.oneOf && schema.oneOf.filter((child) => validateWithoutIssues(child, value, root, refStack)).length !== 1) {\n\t\tissues.push({ path, message: \"Value must satisfy exactly one JSON Schema alternative.\" });\n\t}\n\tif (schema.not && validateWithoutIssues(schema.not, value, root, refStack)) {\n\t\tissues.push({ path, message: \"Value must not satisfy the JSON Schema exclusion.\" });\n\t}\n\n\tif (schema.if) {\n\t\tconst condition = validateWithoutIssues(schema.if, value, root, refStack);\n\t\tif (condition && schema.then) validateSchema(schema.then, value, path, root, issues, refStack);\n\t\tif (!condition && schema.else) validateSchema(schema.else, value, path, root, issues, refStack);\n\t}\n\n\tif (schema.const !== undefined && !jsonValuesEqual(value, schema.const)) {\n\t\tissues.push({ path, message: \"Value does not match the JSON Schema const.\" });\n\t}\n\tif (schema.enum && !schema.enum.some((item) => jsonValuesEqual(value, item))) {\n\t\tissues.push({ path, message: \"Value is not one of the allowed JSON Schema enum values.\" });\n\t}\n\n\tif (schema.type !== undefined) {\n\t\tconst types = Array.isArray(schema.type) ? schema.type : [schema.type];\n\t\tif (!types.some((type) => matchesJsonType(type, value))) {\n\t\t\tissues.push({ path, message: `Value must have JSON Schema type ${types.join(\" or \")}.` });\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (typeof value === \"string\") {\n\t\tif (schema.minLength !== undefined && [...value].length < schema.minLength) issues.push({ path, message: `String must contain at least ${schema.minLength} characters.` });\n\t\tif (schema.maxLength !== undefined && [...value].length > schema.maxLength) issues.push({ path, message: `String must contain at most ${schema.maxLength} characters.` });\n\t\tif (schema.pattern !== undefined) {\n\t\t\ttry {\n\t\t\t\tif (!new RegExp(schema.pattern).test(value)) issues.push({ path, message: \"String does not match the JSON Schema pattern.\" });\n\t\t\t} catch {\n\t\t\t\tissues.push({ path, message: \"JSON Schema pattern is invalid.\" });\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof value === \"number\") {\n\t\tif (schema.minimum !== undefined && value < schema.minimum) issues.push({ path, message: `Number must be greater than or equal to ${schema.minimum}.` });\n\t\tif (schema.maximum !== undefined && value > schema.maximum) issues.push({ path, message: `Number must be less than or equal to ${schema.maximum}.` });\n\t\tif (schema.exclusiveMinimum !== undefined && value <= schema.exclusiveMinimum) issues.push({ path, message: `Number must be greater than ${schema.exclusiveMinimum}.` });\n\t\tif (schema.exclusiveMaximum !== undefined && value >= schema.exclusiveMaximum) issues.push({ path, message: `Number must be less than ${schema.exclusiveMaximum}.` });\n\t\tif (schema.multipleOf !== undefined && !isMultipleOf(value, schema.multipleOf)) issues.push({ path, message: `Number must be a multiple of ${schema.multipleOf}.` });\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tif (schema.minItems !== undefined && value.length < schema.minItems) issues.push({ path, message: `Array must contain at least ${schema.minItems} items.` });\n\t\tif (schema.maxItems !== undefined && value.length > schema.maxItems) issues.push({ path, message: `Array must contain at most ${schema.maxItems} items.` });\n\t\tif (schema.uniqueItems && value.some((item, index) => value.findIndex((other) => jsonValuesEqual(item, other)) !== index)) issues.push({ path, message: \"Array items must be unique.\" });\n\t\tif (schema.prefixItems) {\n\t\t\tfor (const [index, child] of schema.prefixItems.entries()) {\n\t\t\t\tif (index < value.length) validateSchema(child, value[index], [...path, index], root, issues, refStack);\n\t\t\t}\n\t\t}\n\t\tif (schema.items && !Array.isArray(schema.items)) {\n\t\t\tfor (const [index, item] of value.entries()) validateSchema(schema.items, item, [...path, index], root, issues, refStack);\n\t\t}\n\t}\n\n\tif (value && typeof value === \"object\" && !Array.isArray(value)) {\n\t\tconst object = value as Record<string, unknown>;\n\t\tfor (const required of schema.required ?? []) {\n\t\t\tif (!(required in object)) issues.push({ path: [...path, required], message: \"Required property is missing.\" });\n\t\t}\n\t\tfor (const [name, child] of Object.entries(schema.properties ?? {})) {\n\t\t\tif (name in object) validateSchema(child, object[name], [...path, name], root, issues, refStack);\n\t\t}\n\t\tfor (const [name, child] of Object.entries(schema.patternProperties ?? {})) {\n\t\t\tlet matcher: RegExp;\n\t\t\ttry {\n\t\t\t\tmatcher = new RegExp(name);\n\t\t\t} catch {\n\t\t\t\tissues.push({ path, message: \"JSON Schema patternProperties pattern is invalid.\" });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const property of Object.keys(object)) {\n\t\t\t\tif (matcher.test(property)) validateSchema(child, object[property], [...path, property], root, issues, refStack);\n\t\t\t}\n\t\t}\n\t\tif (schema.propertyNames) {\n\t\t\tfor (const property of Object.keys(object)) validateSchema(schema.propertyNames, property, [...path, property], root, issues, refStack);\n\t\t}\n\t\tif (schema.additionalProperties === false) {\n\t\t\tconst declared = new Set(Object.keys(schema.properties ?? {}));\n\t\t\tfor (const property of Object.keys(schema.patternProperties ?? {})) declared.add(property);\n\t\t\tfor (const property of Object.keys(object)) {\n\t\t\t\tconst matchesPattern = Object.keys(schema.patternProperties ?? {}).some((pattern) => {\n\t\t\t\t\ttry { return new RegExp(pattern).test(property); } catch { return false; }\n\t\t\t\t});\n\t\t\t\tif (!declared.has(property) && !matchesPattern) issues.push({ path: [...path, property], message: \"Additional properties are not permitted.\" });\n\t\t\t}\n\t\t} else if (schema.additionalProperties && typeof schema.additionalProperties === \"object\") {\n\t\t\tconst declared = new Set(Object.keys(schema.properties ?? {}));\n\t\t\tfor (const property of Object.keys(object)) {\n\t\t\t\tif (!declared.has(property)) validateSchema(schema.additionalProperties, object[property], [...path, property], root, issues, refStack);\n\t\t\t}\n\t\t}\n\t\tfor (const [property, dependencies] of Object.entries(schema.dependentRequired ?? {})) {\n\t\t\tif (property in object) {\n\t\t\t\tfor (const dependency of dependencies) if (!(dependency in object)) issues.push({ path: [...path, dependency], message: `Property is required when \"${property}\" is present.` });\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction validateWithoutIssues(\n\tschema: PortableJsonSchema,\n\tvalue: unknown,\n\troot: PortableJsonSchema,\n\trefStack: Set<string>,\n): boolean {\n\tconst issues: JsonSchemaValidationIssue[] = [];\n\tvalidateSchema(schema, value, [], root, issues, refStack);\n\treturn issues.length === 0;\n}\n\ntype PortableJsonType = \"null\" | \"boolean\" | \"object\" | \"array\" | \"number\" | \"integer\" | \"string\";\n\nfunction matchesJsonType(type: PortableJsonType, value: unknown): boolean {\n\tswitch (type) {\n\t\tcase \"null\": return value === null;\n\t\tcase \"boolean\": return typeof value === \"boolean\";\n\t\tcase \"object\": return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n\t\tcase \"array\": return Array.isArray(value);\n\t\tcase \"number\": return typeof value === \"number\" && Number.isFinite(value);\n\t\tcase \"integer\": return typeof value === \"number\" && Number.isSafeInteger(value);\n\t\tcase \"string\": return typeof value === \"string\";\n\t}\n}\n\nfunction isMultipleOf(value: number, divisor: number): boolean {\n\tif (!Number.isFinite(divisor) || divisor <= 0) return false;\n\tconst quotient = value / divisor;\n\treturn Math.abs(quotient - Math.round(quotient)) < Number.EPSILON * Math.max(1, Math.abs(quotient));\n}\n\nfunction jsonValuesEqual(left: unknown, right: unknown): boolean {\n\tif (Object.is(left, right)) return true;\n\tif (typeof left !== typeof right || left === null || right === null) return false;\n\tif (Array.isArray(left) && Array.isArray(right)) return left.length === right.length && left.every((item, index) => jsonValuesEqual(item, right[index]));\n\tif (typeof left === \"object\" && typeof right === \"object\") {\n\t\tconst leftObject = left as Record<string, unknown>;\n\t\tconst rightObject = right as Record<string, unknown>;\n\t\tconst keys = Object.keys(leftObject);\n\t\treturn keys.length === Object.keys(rightObject).length && keys.every((key) => key in rightObject && jsonValuesEqual(leftObject[key], rightObject[key]));\n\t}\n\treturn false;\n}\n\nfunction isJsonValue(value: unknown): value is JsonValue {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (Array.isArray(value)) return value.every(isJsonValue);\n\tif (value && typeof value === \"object\") {\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\treturn (prototype === Object.prototype || prototype === null) &&\n\t\t\tObject.values(value as Record<string, unknown>).every(isJsonValue);\n\t}\n\treturn false;\n}\n\nexport function assertObjectType(type: string): asserts type is FabricObjectType {\n\tif (!/^[A-Z][a-zA-Z0-9]*$/.test(type)) {\n\t\tthrow new Error(\n\t\t\t`Invalid object type: \"${type}\". Object types must be PascalCase alphanumeric.`,\n\t\t);\n\t}\n}\n\nexport interface ObjectTypeRegistry {\n\tregister(type: string): void;\n\thas(type: string): boolean;\n\tlist(): string[];\n}\n\nexport function createObjectTypeRegistry(initialTypes: readonly string[] = []): ObjectTypeRegistry {\n\tconst objectTypes = new Set([...BUILT_IN_OBJECT_TYPES, ...initialTypes]);\n\treturn {\n\t\tregister(type) {\n\t\t\tassertObjectType(type);\n\t\t\tobjectTypes.add(type);\n\t\t},\n\t\thas: (type) => objectTypes.has(type),\n\t\tlist: () => Array.from(objectTypes).sort(),\n\t};\n}\n"]}
|
package/dist/events/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLDPBQ72C_cjs = require('../chunk-LDPBQ72C.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "createEventContractRegistry", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkLDPBQ72C_cjs.createEventContractRegistry; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/events/index.d.cts
CHANGED
|
@@ -16,6 +16,13 @@ interface AssetEventEnvelope<TPayload = unknown> {
|
|
|
16
16
|
correlationId: string;
|
|
17
17
|
causationId?: string;
|
|
18
18
|
provenance?: EventProvenance;
|
|
19
|
+
/**
|
|
20
|
+
* Mirrors the emitting action's declared consistency. Present only when the
|
|
21
|
+
* action declares `provisional-until-reconciled`, so a consumer can tell a
|
|
22
|
+
* settled fact from one still awaiting reconciliation without a lookup.
|
|
23
|
+
* Additive and optional: tolerant consumers that ignore it stay correct.
|
|
24
|
+
*/
|
|
25
|
+
consistency?: "authoritative-now" | "provisional-until-reconciled";
|
|
19
26
|
}
|
|
20
27
|
interface EventProvenance {
|
|
21
28
|
source: "ui" | "api" | "agent" | "worker" | "system" | (string & {});
|
package/dist/events/index.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ interface AssetEventEnvelope<TPayload = unknown> {
|
|
|
16
16
|
correlationId: string;
|
|
17
17
|
causationId?: string;
|
|
18
18
|
provenance?: EventProvenance;
|
|
19
|
+
/**
|
|
20
|
+
* Mirrors the emitting action's declared consistency. Present only when the
|
|
21
|
+
* action declares `provisional-until-reconciled`, so a consumer can tell a
|
|
22
|
+
* settled fact from one still awaiting reconciliation without a lookup.
|
|
23
|
+
* Additive and optional: tolerant consumers that ignore it stay correct.
|
|
24
|
+
*/
|
|
25
|
+
consistency?: "authoritative-now" | "provisional-until-reconciled";
|
|
19
26
|
}
|
|
20
27
|
interface EventProvenance {
|
|
21
28
|
source: "ui" | "api" | "agent" | "worker" | "system" | (string & {});
|
package/dist/events/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTBS2S5AX_cjs = require('../chunk-TBS2S5AX.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "FABRIC_GOVERNANCE_CONTRACT_VERSION", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkTBS2S5AX_cjs.FABRIC_GOVERNANCE_CONTRACT_VERSION; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "assertGovernanceRuntimeEvidence", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkTBS2S5AX_cjs.assertGovernanceRuntimeEvidence; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "assertMutationGovernanceContext", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkTBS2S5AX_cjs.assertMutationGovernanceContext; }
|
|
18
18
|
});
|
|
19
19
|
//# sourceMappingURL=index.cjs.map
|
|
20
20
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -76,6 +76,10 @@ interface GovernanceRuntimeEvidence {
|
|
|
76
76
|
version: string;
|
|
77
77
|
};
|
|
78
78
|
policyRulesetVersion?: string;
|
|
79
|
+
/** Digest of the verified application assembly loaded by this runtime. */
|
|
80
|
+
assemblyDigest?: string;
|
|
81
|
+
/** Digest of the promoted experience release that initiated this invocation. */
|
|
82
|
+
initiatingReleaseDigest?: string;
|
|
79
83
|
}
|
|
80
84
|
interface MutationGovernanceResolutionInput {
|
|
81
85
|
actionInvocationId: string;
|
|
@@ -76,6 +76,10 @@ interface GovernanceRuntimeEvidence {
|
|
|
76
76
|
version: string;
|
|
77
77
|
};
|
|
78
78
|
policyRulesetVersion?: string;
|
|
79
|
+
/** Digest of the verified application assembly loaded by this runtime. */
|
|
80
|
+
assemblyDigest?: string;
|
|
81
|
+
/** Digest of the promoted experience release that initiated this invocation. */
|
|
82
|
+
initiatingReleaseDigest?: string;
|
|
79
83
|
}
|
|
80
84
|
interface MutationGovernanceResolutionInput {
|
|
81
85
|
actionInvocationId: string;
|
package/dist/governance/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from '../chunk-
|
|
1
|
+
export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from '../chunk-Y2PJLRIY.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|