@fabricorg/platform 1.1.0 → 1.3.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 +77 -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-OWSSGFNY.js → chunk-7GAWSUOG.js} +22 -3
- package/dist/chunk-7GAWSUOG.js.map +1 -0
- package/dist/{chunk-A2VTSATF.cjs → chunk-7HPNONN7.cjs} +7 -6
- package/dist/chunk-7HPNONN7.cjs.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-6T6F3TNQ.cjs → chunk-G6WXP5ZZ.cjs} +13 -12
- package/dist/chunk-G6WXP5ZZ.cjs.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-53YJK3LK.js → chunk-KADDDQHO.js} +6 -5
- package/dist/chunk-KADDDQHO.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-ANPJYXBK.cjs → chunk-TBS2S5AX.cjs} +8 -2
- package/dist/chunk-TBS2S5AX.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/{chunk-ETONSTUW.js → chunk-ZOOGUUY4.js} +4 -3
- package/dist/chunk-ZOOGUUY4.js.map +1 -0
- 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 +62 -42
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/manifest/index.cjs +10 -10
- package/dist/manifest/index.d.cts +1 -0
- package/dist/manifest/index.d.ts +1 -0
- package/dist/manifest/index.js +4 -4
- package/dist/modules/index.cjs +11 -11
- package/dist/modules/index.d.cts +2 -0
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -3
- 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-3OWMPDBD.js.map +0 -1
- package/dist/chunk-3ZW5USXF.js.map +0 -1
- package/dist/chunk-53YJK3LK.js.map +0 -1
- package/dist/chunk-6T6F3TNQ.cjs.map +0 -1
- package/dist/chunk-A2VTSATF.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-ETONSTUW.js.map +0 -1
- package/dist/chunk-J5LS5BSI.js.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-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;AAAA,EAAW,kBAAA;AAAA,EAAoB,kBAAA;AAAA,EAAoB,WAAA;AAAA,EACrE,WAAA;AAAA,EAAa,SAAA;AAAA,EAAW,QAAA;AAAA,EAAU,UAAA;AAAA,EAAY,UAAA;AAAA,EAAY,aAAA;AAAA,EAAe,SAAA;AAAA,EACzE,UAAA;AAAA,EAAY,WAAA;AAAA,EAAa,YAAA;AAAA,EAAc,iBAAA;AAAA,EAAmB,kBAAA;AAAA,EAAoB,YAAA;AAAA,EAAc,IAAA;AAAA,EAAM,MAAA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S,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"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEventTypeName, getObjectTypeName, getModuleDependencyNamespace } from './chunk-
|
|
1
|
+
import { getEventTypeName, getObjectTypeName, getModuleDependencyNamespace } from './chunk-KADDDQHO.js';
|
|
2
2
|
|
|
3
3
|
// manifest/index.ts
|
|
4
4
|
var MODULE_MANIFEST_VERSION = 2;
|
|
@@ -189,6 +189,7 @@ function exportView(view) {
|
|
|
189
189
|
scope: view.scope,
|
|
190
190
|
snapshotVersion: view.snapshotVersion
|
|
191
191
|
};
|
|
192
|
+
if (view.parameterSchema !== void 0) output.parameterSchema = cloneJson(view.parameterSchema);
|
|
192
193
|
if (view.compatibleSnapshotVersions) output.compatibleSnapshotVersions = [...view.compatibleSnapshotVersions];
|
|
193
194
|
if (view.usage) output.usage = cloneJson(view.usage);
|
|
194
195
|
return output;
|
|
@@ -224,5 +225,5 @@ function exportModuleManifestBundle(modules) {
|
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
export { MODULE_MANIFEST_VERSION, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator, normalizeModuleManifest, normalizeModuleManifestBundle };
|
|
227
|
-
//# sourceMappingURL=chunk-
|
|
228
|
-
//# sourceMappingURL=chunk-
|
|
228
|
+
//# sourceMappingURL=chunk-ZOOGUUY4.js.map
|
|
229
|
+
//# sourceMappingURL=chunk-ZOOGUUY4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../manifest/index.ts"],"names":[],"mappings":";;;AA8BO,IAAM,uBAAA,GAA0B;AAkKhC,SAAS,wBACf,QAAA,EACiB;AACjB,EAAA,MAAM,UAAkB,QAAA,CAAS,eAAA;AACjC,EAAA,IAAI,OAAA,KAAY,CAAA,IAAK,OAAA,KAAY,uBAAA,EAAyB;AACzD,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,qCAAA,EAAwC,MAAA,CAAO,OAAO,CAAC,CAAA,CAAE,CAAA;AAAA,EAC1E;AACA,EAAA,OAAO;AAAA,IACN,GAAG,QAAA;AAAA,IACH,eAAA,EAAiB,uBAAA;AAAA,IACjB,KAAA,EAAO,OAAA,IAAW,QAAA,IAAY,KAAA,CAAM,OAAA,CAAQ,SAAS,KAAK,CAAA,GAAI,QAAA,CAAS,KAAA,GAAQ;AAAC,GACjF;AACD;AAEO,SAAS,8BACf,MAAA,EACuB;AACvB,EAAA,MAAM,UAAkB,MAAA,CAAO,eAAA;AAC/B,EAAA,IAAI,OAAA,KAAY,CAAA,IAAK,OAAA,KAAY,uBAAA,EAAyB;AACzD,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,4CAAA,EAA+C,MAAA,CAAO,OAAO,CA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A,IAClF,QAAQ,MAAA,CAAO,KAAA,IAAS,EAAC,EAAG,IAAI,UAAU;AAAA,GAC3C;AAEA,EAAA,IAAI,MAAA,CAAO,OAAA,KAAY,MAAA,EAAW,QAAA,CAAS,UAAU,MAAA,CAAO,OAAA;AAC5D,EAAA,IAAI,MAAA,CAAO,WAAA,KAAgB,MAAA,EAAW,QAAA,CAAS,cAAc,MAAA,CAAO,WAAA;AACpE,EAAA,IAAI,MAAA,CAAO,WAAA,KAAgB,MAAA,EAAW,QAAA,CAAS,cAAc,MAAA,CAAO,WAAA;AACpE,EAAA,IAAI,OAAO,UAAA,KAAe,MAAA,WAAoB,UAAA,GAAa,SAAA,CAAU,OAAO,UAAU,CAAA;AAEtF,EAAA,OAAO,QAAA;AACR;AAMO,SAAS,2BACf,OAAA,EACuB;AACvB,EAAA,OAAO;AAAA,IACN,eAAA,EAAiB,uBAAA;AAAA,IACjB,OAAA,EAAS,OAAA,CAAQ,GAAA,CAAI,oBAAoB;AAAA,GAC1C;AACD","file":"chunk-ZOOGUUY4.js","sourcesContent":["import type {\n\tActionExecutionContract,\n\tActionDefinition,\n\tAdapterStepRetryPolicy,\n\tSchemaValidator,\n} from \"../actions\";\nimport {\n\tgetEventTypeName,\n\tgetModuleDependencyNamespace,\n\tgetObjectTypeName,\n\ttype FabricModule,\n\ttype CapabilityMetadata,\n\ttype DeclarativeInvariant,\n\ttype ModuleDependency,\n\ttype ModuleDependencyInput,\n\ttype ObjectRelationDefinition,\n} from \"../modules\";\nimport type { JsonValue, PortableJsonSchema } from \"../objects\";\nimport type {\n\tDataPolicyDefinition,\n\tPolicyFallbackDefinition,\n\tPolicyKind,\n} from \"../policies\";\nimport type { StateDefinition, StateMachineDefinition } from \"../state-machines\";\nimport type { ViewContract } from \"../projections\";\n\n/**\n * Version of the module manifest contract. Bump when the serialized shape\n * changes in a way consumers must detect.\n */\nexport const MODULE_MANIFEST_VERSION = 2 as const;\n\nexport interface ModuleManifestObjectType {\n\ttype: string;\n\tdisplayName?: string;\n\tidPrefix?: string;\n\tschema?: PortableJsonSchema;\n\tsemantics?: Record<string, JsonValue>;\n\trelations?: ObjectRelationDefinition[];\n\tinvariants?: DeclarativeInvariant[];\n}\n\nexport interface ModuleManifestIdPrefix {\n\tprefix: string;\n\tname: string;\n}\n\nexport interface ModuleManifestEventType {\n\teventType: string;\n\tschemaVersion: number;\n\tdescription?: string;\n\tschema?: PortableJsonSchema;\n}\n\nexport interface ModuleManifestActionStateMachine {\n\tentityType: string;\n\t/** Present only when the binding declares a static target state. */\n\ttargetState?: string;\n}\n\nexport interface ModuleManifestAdapterStep {\n\tadapterType: string;\n\toperation: string;\n\tretryPolicy?: AdapterStepRetryPolicy;\n}\n\nexport interface ModuleManifestAction {\n\tactionId: string;\n\tversion: number;\n\tkind: \"atomic\" | \"saga\";\n\tidempotent: boolean;\n\tmutatesDomain: boolean;\n\temitsEvents: string[];\n\tpolicies?: string[];\n\trequiredRoles?: string[];\n\trequiredPermissions?: string[];\n\teventPhase?: \"before_adapters\" | \"after_adapters\";\n\texecution?: ActionExecutionContract;\n\t/**\n\t * JSON Schema for the action parameters, present only when the action's\n\t * `schema` validator implements {@link JsonSchemaExportableValidator}.\n\t */\n\tparameterSchema?: unknown;\n\tparameterSchemaFormat?: \"json-schema\";\n\tresultSchema?: unknown;\n\tresultSchemaFormat?: \"json-schema\";\n\tstateMachine?: ModuleManifestActionStateMachine;\n\tadapterSteps?: ModuleManifestAdapterStep[];\n}\n\nexport interface ModuleManifestCodePolicy {\n\ttype: \"code\";\n\tpolicyId: string;\n\tversion: number;\n\tpreviewSafe?: boolean;\n}\n\nexport interface ModuleManifestDataPolicy {\n\ttype: \"data\";\n\tpolicyId: string;\n\tpolicyVersion: number;\n\tkind: PolicyKind;\n\tdataDefinition?: DataPolicyDefinition;\n\tcodeEvaluatorPolicyId?: string;\n\tfallback?: PolicyFallbackDefinition;\n}\n\nexport type ModuleManifestPolicy = ModuleManifestCodePolicy | ModuleManifestDataPolicy;\n\nexport interface ModuleManifestStateMachineTransition {\n\tfrom: string;\n\tto: string;\n\tcausedByAction: string;\n\t/** `true` when the transition declares a guard function. The guard itself is never serialized. */\n\thasGuard: boolean;\n}\n\nexport interface ModuleManifestStateMachine {\n\tentityType: string;\n\t/** States in declaration order (`Object.values` order of the definition record). */\n\tstates: StateDefinition[];\n\ttransitions: ModuleManifestStateMachineTransition[];\n}\n\nexport interface ModuleManifestView {\n\tname: string;\n\tversion: string;\n\tshape: PortableJsonSchema;\n\tparameterSchema?: PortableJsonSchema;\n\tconsumes: Array<{ eventType: string; schemaVersions: number[] }>;\n\tscope: \"tenant-space\";\n\tsnapshotVersion: number;\n\tcompatibleSnapshotVersions?: number[];\n\tusage?: ViewContract[\"usage\"];\n}\n\n/**\n * Stable, JSON-serializable description of a {@link FabricModule}'s ontology:\n * object types, subject types, id prefixes, event types, actions, policies,\n * and state machines. Intended for downstream tooling (semantics exporters,\n * docs generators, tool generators) that cannot consume live module code.\n *\n * The manifest contains definitions only — never raw parameter values,\n * secrets, or runtime data. Function fields (`handler`, `evaluate`, `guard`,\n * dynamic `targetState`, adapter `getInput`) are never serialized.\n */\nexport interface ModuleManifest {\n\tmanifestVersion: typeof MODULE_MANIFEST_VERSION;\n\tnamespace: string;\n\tversion?: string;\n\tdisplayName?: string;\n\tdescription?: string;\n\tcapability?: CapabilityMetadata;\n\tdependencies: ModuleDependency[];\n\tobjectTypes: ModuleManifestObjectType[];\n\tsubjectTypes: string[];\n\tidPrefixes: ModuleManifestIdPrefix[];\n\teventTypes: ModuleManifestEventType[];\n\tactions: ModuleManifestAction[];\n\tpolicies: ModuleManifestPolicy[];\n\tstateMachines: ModuleManifestStateMachine[];\n\tviews: ModuleManifestView[];\n}\n\nexport interface ModuleManifestBundle {\n\tmanifestVersion: typeof MODULE_MANIFEST_VERSION;\n\t/** Manifests in the input module order. */\n\tmodules: ModuleManifest[];\n}\n\n/** Manifest v1 remains accepted by v2 readers; missing v2 fields normalize to absence. */\nexport type ModuleManifestObjectTypeV1 = Omit<\n\tModuleManifestObjectType,\n\t\"schema\" | \"semantics\" | \"relations\" | \"invariants\"\n>;\nexport type ModuleManifestActionV1 = Omit<\n\tModuleManifestAction,\n\t\"resultSchema\" | \"resultSchemaFormat\"\n>;\nexport type ModuleManifestV1 = Omit<\n\tModuleManifest,\n\t\"manifestVersion\" | \"objectTypes\" | \"actions\" | \"views\"\n> & {\n\tmanifestVersion: 1;\n\tobjectTypes: ModuleManifestObjectTypeV1[];\n\tactions: ModuleManifestActionV1[];\n};\nexport type ModuleManifestBundleV1 = Omit<ModuleManifestBundle, \"manifestVersion\" | \"modules\"> & {\n\tmanifestVersion: 1;\n\tmodules: ModuleManifestV1[];\n};\n\nexport function normalizeModuleManifest(\n\tmanifest: ModuleManifest | ModuleManifestV1,\n): ModuleManifest {\n\tconst version: number = manifest.manifestVersion;\n\tif (version !== 1 && version !== MODULE_MANIFEST_VERSION) {\n\t\tthrow new Error(`Unsupported module manifest version: ${String(version)}`);\n\t}\n\treturn {\n\t\t...manifest,\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tviews: \"views\" in manifest && Array.isArray(manifest.views) ? manifest.views : [],\n\t};\n}\n\nexport function normalizeModuleManifestBundle(\n\tbundle: ModuleManifestBundle | ModuleManifestBundleV1,\n): ModuleManifestBundle {\n\tconst version: number = bundle.manifestVersion;\n\tif (version !== 1 && version !== MODULE_MANIFEST_VERSION) {\n\t\tthrow new Error(`Unsupported module manifest bundle version: ${String(version)}`);\n\t}\n\treturn {\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tmodules: bundle.modules.map((manifest) => normalizeModuleManifest(manifest)),\n\t};\n}\n\n/**\n * A {@link SchemaValidator} that can also export its parameter schema as JSON\n * Schema (for example a Zod 4 schema via `z.toJSONSchema`). Keeps the platform\n * zero-dependency while letting schema-bearing actions flow into manifests.\n */\nexport interface JsonSchemaExportableValidator extends SchemaValidator {\n\ttoJSONSchema(): Record<string, unknown>;\n}\n\nexport function isJsonSchemaExportableValidator(\n\tschema: SchemaValidator,\n): schema is JsonSchemaExportableValidator {\n\treturn (\n\t\ttypeof (schema as Partial<JsonSchemaExportableValidator>).toJSONSchema === \"function\"\n\t);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction exportDependency(dependency: ModuleDependencyInput): ModuleDependency {\n\tconst namespace = getModuleDependencyNamespace(dependency);\n\tif (typeof dependency === \"string\") {\n\t\treturn { namespace };\n\t}\n\tconst normalized: ModuleDependency = { namespace };\n\tif (dependency.version !== undefined) normalized.version = dependency.version;\n\tif (dependency.optional !== undefined) normalized.optional = dependency.optional;\n\treturn normalized;\n}\n\nfunction exportObjectType(\n\tobjectType: NonNullable<FabricModule[\"objectTypes\"]>[number],\n): ModuleManifestObjectType {\n\tif (typeof objectType === \"string\") {\n\t\treturn { type: objectType };\n\t}\n\tconst normalized: ModuleManifestObjectType = { type: getObjectTypeName(objectType) };\n\tif (objectType.displayName !== undefined) normalized.displayName = objectType.displayName;\n\tif (objectType.idPrefix !== undefined) normalized.idPrefix = objectType.idPrefix;\n\tif (objectType.schema !== undefined) normalized.schema = cloneJson(objectType.schema);\n\tif (objectType.semantics !== undefined) normalized.semantics = cloneJson(objectType.semantics);\n\tif (objectType.relations !== undefined) {\n\t\tnormalized.relations = objectType.relations.map((relation) => ({ ...relation }));\n\t}\n\tif (objectType.invariants !== undefined) {\n\t\tnormalized.invariants = objectType.invariants.map((invariant) => ({ ...invariant }));\n\t}\n\treturn normalized;\n}\n\nfunction cloneJson<T>(value: T): T {\n\tif (Array.isArray(value)) return value.map((item) => cloneJson(item)) as T;\n\tif (value !== null && typeof value === \"object\") {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(value as Record<string, unknown>).map(([key, child]) => [key, cloneJson(child)]),\n\t\t) as T;\n\t}\n\treturn value;\n}\n\nfunction exportEventType(\n\teventType: NonNullable<FabricModule[\"eventTypes\"]>[number],\n): ModuleManifestEventType {\n\tif (typeof eventType === \"string\") {\n\t\t// String registrations carry no explicit schema version; the events\n\t\t// registry treats the bare name as the initial version of the type.\n\t\treturn { eventType, schemaVersion: 1 };\n\t}\n\tconst normalized: ModuleManifestEventType = {\n\t\teventType: getEventTypeName(eventType),\n\t\tschemaVersion: eventType.schemaVersion,\n\t};\n\tif (eventType.description !== undefined) normalized.description = eventType.description;\n\tif (eventType.schema !== undefined) normalized.schema = cloneJson(eventType.schema);\n\treturn normalized;\n}\n\nfunction exportAction(action: ActionDefinition): ModuleManifestAction {\n\tconst manifest: ModuleManifestAction = {\n\t\tactionId: action.actionId,\n\t\tversion: action.version,\n\t\tkind: action.kind ?? \"atomic\",\n\t\tidempotent: action.idempotent,\n\t\tmutatesDomain: action.mutatesDomain,\n\t\temitsEvents: [...action.emitsEvents],\n\t};\n\n\tif (action.policies !== undefined) manifest.policies = [...action.policies];\n\tif (action.requiredRoles !== undefined) manifest.requiredRoles = [...action.requiredRoles];\n\tif (action.requiredPermissions !== undefined) {\n\t\tmanifest.requiredPermissions = [...action.requiredPermissions];\n\t}\n\tif (action.eventPhase !== undefined) manifest.eventPhase = action.eventPhase;\n\tif (action.execution !== undefined) manifest.execution = cloneJson(action.execution);\n\n\tif (isJsonSchemaExportableValidator(action.schema)) {\n\t\ttry {\n\t\t\tmanifest.parameterSchema = action.schema.toJSONSchema();\n\t\t\tmanifest.parameterSchemaFormat = \"json-schema\";\n\t\t} catch {\n\t\t\t// Runtime-valid schemas that cannot be represented portably remain executable;\n\t\t\t// build-time consumers see the schema as unavailable rather than crashing export.\n\t\t}\n\t}\n\tif (action.resultSchema && isJsonSchemaExportableValidator(action.resultSchema)) {\n\t\ttry {\n\t\t\tmanifest.resultSchema = action.resultSchema.toJSONSchema();\n\t\t\tmanifest.resultSchemaFormat = \"json-schema\";\n\t\t} catch {\n\t\t\t// See parameter-schema behavior above.\n\t\t}\n\t}\n\n\tif (action.stateMachine !== undefined) {\n\t\tconst binding: ModuleManifestActionStateMachine = {\n\t\t\tentityType: action.stateMachine.entityType,\n\t\t};\n\t\tif (typeof action.stateMachine.targetState === \"string\") {\n\t\t\tbinding.targetState = action.stateMachine.targetState;\n\t\t}\n\t\tmanifest.stateMachine = binding;\n\t}\n\n\tif (action.adapterSteps !== undefined) {\n\t\tmanifest.adapterSteps = action.adapterSteps.map((step) => {\n\t\t\tconst exported: ModuleManifestAdapterStep = {\n\t\t\t\tadapterType: step.adapterType,\n\t\t\t\toperation: step.operation,\n\t\t\t};\n\t\t\tif (step.retryPolicy !== undefined) exported.retryPolicy = { ...step.retryPolicy };\n\t\t\treturn exported;\n\t\t});\n\t}\n\n\treturn manifest;\n}\n\nfunction exportPolicy(policy: unknown): ModuleManifestPolicy | undefined {\n\tif (!isRecord(policy) || typeof policy.policyId !== \"string\") {\n\t\treturn undefined;\n\t}\n\n\t// Code evaluator: identified by its `evaluate` function (never serialized).\n\tif (typeof policy.evaluate === \"function\") {\n\t\tconst exported: ModuleManifestCodePolicy = {\n\t\t\ttype: \"code\",\n\t\t\tpolicyId: policy.policyId,\n\t\t\tversion: typeof policy.version === \"number\" ? policy.version : 1,\n\t\t};\n\t\tif (typeof policy.previewSafe === \"boolean\") exported.previewSafe = policy.previewSafe;\n\t\treturn exported;\n\t}\n\n\t// Declarative runtime policy definition: pure data, serialized as-is.\n\tif (typeof policy.kind === \"string\" && typeof policy.policyVersion === \"number\") {\n\t\tconst exported: ModuleManifestDataPolicy = {\n\t\t\ttype: \"data\",\n\t\t\tpolicyId: policy.policyId,\n\t\t\tpolicyVersion: policy.policyVersion,\n\t\t\tkind: policy.kind as PolicyKind,\n\t\t};\n\t\tif (isRecord(policy.dataDefinition)) {\n\t\t\texported.dataDefinition = policy.dataDefinition as unknown as DataPolicyDefinition;\n\t\t}\n\t\tif (typeof policy.codeEvaluatorPolicyId === \"string\") {\n\t\t\texported.codeEvaluatorPolicyId = policy.codeEvaluatorPolicyId;\n\t\t}\n\t\tif (isRecord(policy.fallback)) {\n\t\t\texported.fallback = policy.fallback as unknown as PolicyFallbackDefinition;\n\t\t}\n\t\treturn exported;\n\t}\n\n\t// Unknown policy shape: omit rather than guess.\n\treturn undefined;\n}\n\nfunction exportStateMachine(machine: unknown): ModuleManifestStateMachine | undefined {\n\tif (\n\t\t!isRecord(machine) ||\n\t\ttypeof machine.entityType !== \"string\" ||\n\t\t!isRecord(machine.states) ||\n\t\t!Array.isArray(machine.transitions)\n\t) {\n\t\treturn undefined;\n\t}\n\n\tconst definition = machine as unknown as StateMachineDefinition;\n\treturn {\n\t\tentityType: definition.entityType,\n\t\tstates: Object.values(definition.states),\n\t\ttransitions: definition.transitions.map((transition) => ({\n\t\t\tfrom: transition.from,\n\t\t\tto: transition.to,\n\t\t\tcausedByAction: transition.causedByAction,\n\t\t\thasGuard: typeof transition.guard === \"function\",\n\t\t})),\n\t};\n}\n\nfunction exportView(view: ViewContract): ModuleManifestView {\n\tconst output: ModuleManifestView = {\n\t\tname: view.name,\n\t\tversion: view.version,\n\t\tshape: cloneJson(view.shape),\n\t\tconsumes: view.consumes.map((consumption) => ({\n\t\t\teventType: consumption.eventType,\n\t\t\tschemaVersions: [...consumption.schemaVersions],\n\t\t})),\n\t\tscope: view.scope,\n\t\tsnapshotVersion: view.snapshotVersion,\n\t};\n\tif (view.parameterSchema !== undefined) output.parameterSchema = cloneJson(view.parameterSchema);\n\tif (view.compatibleSnapshotVersions) output.compatibleSnapshotVersions = [...view.compatibleSnapshotVersions];\n\tif (view.usage) output.usage = cloneJson(view.usage);\n\treturn output;\n}\n\n/**\n * Export a stable, JSON-serializable manifest of a module's ontology.\n *\n * This is a pure function of the module object: it does not read or mutate the\n * global module/action/policy/state-machine registries, and the module does\n * not need to be registered first. Declaration order is preserved everywhere\n * (nothing is sorted), so the same module object always produces a\n * byte-identical `JSON.stringify` result.\n *\n * The manifest contains definitions only — never raw parameter values,\n * secrets, or runtime data. Function fields are elided (`handler`,\n * policy `evaluate`, transition `guard` → `hasGuard`, dynamic `targetState`,\n * adapter `getInput`).\n */\nexport function exportModuleManifest(module: FabricModule<unknown>): ModuleManifest {\n\tconst manifest: ModuleManifest = {\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tnamespace: module.namespace,\n\t\tdependencies: (module.dependencies ?? []).map(exportDependency),\n\t\tobjectTypes: (module.objectTypes ?? []).map(exportObjectType),\n\t\tsubjectTypes: [...(module.subjectTypes ?? [])],\n\t\tidPrefixes: (module.idPrefixes ?? []).map((registration) => ({\n\t\t\tprefix: registration.prefix,\n\t\t\tname: registration.name,\n\t\t})),\n\t\teventTypes: (module.eventTypes ?? []).map(exportEventType),\n\t\tactions: (module.actions ?? []).map(exportAction),\n\t\tpolicies: (module.policies ?? [])\n\t\t\t.map(exportPolicy)\n\t\t\t.filter((policy): policy is ModuleManifestPolicy => policy !== undefined),\n\t\tstateMachines: (module.stateMachines ?? [])\n\t\t\t.map(exportStateMachine)\n\t\t\t.filter((machine): machine is ModuleManifestStateMachine => machine !== undefined),\n\t\tviews: (module.views ?? []).map(exportView),\n\t};\n\n\tif (module.version !== undefined) manifest.version = module.version;\n\tif (module.displayName !== undefined) manifest.displayName = module.displayName;\n\tif (module.description !== undefined) manifest.description = module.description;\n\tif (module.capability !== undefined) manifest.capability = cloneJson(module.capability);\n\n\treturn manifest;\n}\n\n/**\n * Export manifests for a set of modules, preserving the input order.\n * Like {@link exportModuleManifest}, this is pure and registry-free.\n */\nexport function exportModuleManifestBundle(\n\tmodules: FabricModule<unknown>[],\n): ModuleManifestBundle {\n\treturn {\n\t\tmanifestVersion: MODULE_MANIFEST_VERSION,\n\t\tmodules: modules.map(exportModuleManifest),\n\t};\n}\n"]}
|
|
@@ -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
|