@inf-monkeys-tech/monkeys 1.1.34 → 1.1.36
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/README.md +13 -1
- package/lib/contracts/declarative-control-http.d.ts +1774 -208
- package/lib/contracts/declarative-control-http.d.ts.map +1 -1
- package/lib/contracts/declarative-control.d.ts +235 -13
- package/lib/contracts/declarative-control.d.ts.map +1 -1
- package/lib/contracts/declarative-control.js +18 -12
- package/lib/contracts/declarative-control.js.map +1 -1
- package/lib/contracts/declarative-publication-job.d.ts +472 -0
- package/lib/contracts/declarative-publication-job.d.ts.map +1 -1
- package/lib/contracts/design-board.d.ts +357 -0
- package/lib/contracts/design-board.d.ts.map +1 -0
- package/lib/contracts/design-board.js +75 -0
- package/lib/contracts/design-board.js.map +1 -0
- package/lib/contracts/index.d.ts +2 -0
- package/lib/contracts/index.d.ts.map +1 -1
- package/lib/contracts/index.js +2 -0
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/materialized-model.d.ts +42 -0
- package/lib/contracts/materialized-model.d.ts.map +1 -0
- package/lib/contracts/materialized-model.js +37 -0
- package/lib/contracts/materialized-model.js.map +1 -0
- package/lib/contracts/menu.d.ts +5 -5
- package/lib/contracts/tenant.d.ts +1 -1
- package/lib/esm/{chunk-DDEMQXTP.mjs → chunk-2YGFLKSP.mjs} +7 -3
- package/lib/esm/{chunk-DDEMQXTP.mjs.map → chunk-2YGFLKSP.mjs.map} +1 -1
- package/lib/esm/{chunk-ZN3TO3U7.mjs → chunk-AGT4MIWF.mjs} +209 -6
- package/lib/esm/chunk-AGT4MIWF.mjs.map +1 -0
- package/lib/esm/{chunk-L5CYU6K4.mjs → chunk-GT5OGNJE.mjs} +2250 -2090
- package/lib/esm/chunk-GT5OGNJE.mjs.map +1 -0
- package/lib/esm/{chunk-IJ2W77NR.mjs → chunk-HLW3X2NX.mjs} +2 -2
- package/lib/esm/{chunk-EKT45BA4.mjs → chunk-LYWJTAAM.mjs} +2 -2
- package/lib/esm/{chunk-UWGXMF6O.mjs → chunk-UF5TNIAZ.mjs} +2 -2
- package/lib/esm/contracts/index.mjs +28 -4
- package/lib/esm/index.mjs +40 -6
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +13 -3
- package/lib/esm/schemas/index.mjs +7 -3
- package/lib/json-schema/design-board-commit-command.schema.json +408 -0
- package/lib/json-schema/design-board-document.schema.json +380 -0
- package/lib/json-schema/index.json +2 -0
- package/lib/json-schema/page-runtime-bundle.schema.json +493 -100
- package/lib/json-schema/page.schema.json +261 -9
- package/lib/runtime/design-board.d.ts +4 -0
- package/lib/runtime/design-board.d.ts.map +1 -0
- package/lib/runtime/design-board.js +57 -0
- package/lib/runtime/design-board.js.map +1 -0
- package/lib/runtime/index.d.ts +2 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +2 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/materialized-model.d.ts +23 -0
- package/lib/runtime/materialized-model.d.ts.map +1 -0
- package/lib/runtime/materialized-model.js +187 -0
- package/lib/runtime/materialized-model.js.map +1 -0
- package/lib/runtime/runtime-definition-wire.d.ts +118 -0
- package/lib/runtime/runtime-definition-wire.d.ts.map +1 -1
- package/lib/schemas/index.d.ts +210 -4
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +7 -1
- package/lib/schemas/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/esm/chunk-L5CYU6K4.mjs.map +0 -1
- package/lib/esm/chunk-ZN3TO3U7.mjs.map +0 -1
- /package/lib/esm/{chunk-IJ2W77NR.mjs.map → chunk-HLW3X2NX.mjs.map} +0 -0
- /package/lib/esm/{chunk-EKT45BA4.mjs.map → chunk-LYWJTAAM.mjs.map} +0 -0
- /package/lib/esm/{chunk-UWGXMF6O.mjs.map → chunk-UF5TNIAZ.mjs.map} +0 -0
|
@@ -6219,16 +6219,268 @@
|
|
|
6219
6219
|
"maxLength": 256
|
|
6220
6220
|
},
|
|
6221
6221
|
"targetProjection": {
|
|
6222
|
-
"
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
"
|
|
6222
|
+
"anyOf": [
|
|
6223
|
+
{
|
|
6224
|
+
"type": "object",
|
|
6225
|
+
"properties": {
|
|
6226
|
+
"expression": {
|
|
6227
|
+
"$ref": "#/$defs/__schema2"
|
|
6228
|
+
}
|
|
6229
|
+
},
|
|
6230
|
+
"required": [
|
|
6231
|
+
"expression"
|
|
6232
|
+
],
|
|
6233
|
+
"additionalProperties": false
|
|
6234
|
+
},
|
|
6235
|
+
{
|
|
6236
|
+
"type": "object",
|
|
6237
|
+
"properties": {
|
|
6238
|
+
"materialized": {
|
|
6239
|
+
"anyOf": [
|
|
6240
|
+
{
|
|
6241
|
+
"type": "object",
|
|
6242
|
+
"properties": {
|
|
6243
|
+
"kind": {
|
|
6244
|
+
"type": "string",
|
|
6245
|
+
"const": "value"
|
|
6246
|
+
},
|
|
6247
|
+
"path": {
|
|
6248
|
+
"maxItems": 16,
|
|
6249
|
+
"type": "array",
|
|
6250
|
+
"items": {
|
|
6251
|
+
"type": "string",
|
|
6252
|
+
"minLength": 1,
|
|
6253
|
+
"maxLength": 256
|
|
6254
|
+
}
|
|
6255
|
+
},
|
|
6256
|
+
"budget": {
|
|
6257
|
+
"type": "object",
|
|
6258
|
+
"properties": {
|
|
6259
|
+
"maxRows": {
|
|
6260
|
+
"default": 1000,
|
|
6261
|
+
"type": "integer",
|
|
6262
|
+
"minimum": 1,
|
|
6263
|
+
"maximum": 10000
|
|
6264
|
+
},
|
|
6265
|
+
"maxItems": {
|
|
6266
|
+
"default": 10000,
|
|
6267
|
+
"type": "integer",
|
|
6268
|
+
"minimum": 1,
|
|
6269
|
+
"maximum": 50000
|
|
6270
|
+
},
|
|
6271
|
+
"maxNodes": {
|
|
6272
|
+
"default": 200000,
|
|
6273
|
+
"type": "integer",
|
|
6274
|
+
"minimum": 1,
|
|
6275
|
+
"maximum": 1000000
|
|
6276
|
+
},
|
|
6277
|
+
"maxBytes": {
|
|
6278
|
+
"default": 8388608,
|
|
6279
|
+
"type": "integer",
|
|
6280
|
+
"minimum": 1024,
|
|
6281
|
+
"maximum": 16777216
|
|
6282
|
+
}
|
|
6283
|
+
},
|
|
6284
|
+
"required": [
|
|
6285
|
+
"maxRows",
|
|
6286
|
+
"maxItems",
|
|
6287
|
+
"maxNodes",
|
|
6288
|
+
"maxBytes"
|
|
6289
|
+
],
|
|
6290
|
+
"additionalProperties": false
|
|
6291
|
+
}
|
|
6292
|
+
},
|
|
6293
|
+
"required": [
|
|
6294
|
+
"kind",
|
|
6295
|
+
"path",
|
|
6296
|
+
"budget"
|
|
6297
|
+
],
|
|
6298
|
+
"additionalProperties": false
|
|
6299
|
+
},
|
|
6300
|
+
{
|
|
6301
|
+
"type": "object",
|
|
6302
|
+
"properties": {
|
|
6303
|
+
"kind": {
|
|
6304
|
+
"type": "string",
|
|
6305
|
+
"const": "chunks"
|
|
6306
|
+
},
|
|
6307
|
+
"rowsPath": {
|
|
6308
|
+
"minItems": 1,
|
|
6309
|
+
"maxItems": 16,
|
|
6310
|
+
"type": "array",
|
|
6311
|
+
"items": {
|
|
6312
|
+
"type": "string",
|
|
6313
|
+
"minLength": 1,
|
|
6314
|
+
"maxLength": 256
|
|
6315
|
+
}
|
|
6316
|
+
},
|
|
6317
|
+
"valuePath": {
|
|
6318
|
+
"maxItems": 16,
|
|
6319
|
+
"type": "array",
|
|
6320
|
+
"items": {
|
|
6321
|
+
"type": "string",
|
|
6322
|
+
"minLength": 1,
|
|
6323
|
+
"maxLength": 256
|
|
6324
|
+
}
|
|
6325
|
+
},
|
|
6326
|
+
"modelPath": {
|
|
6327
|
+
"maxItems": 16,
|
|
6328
|
+
"type": "array",
|
|
6329
|
+
"items": {
|
|
6330
|
+
"type": "string",
|
|
6331
|
+
"minLength": 1,
|
|
6332
|
+
"maxLength": 256
|
|
6333
|
+
}
|
|
6334
|
+
},
|
|
6335
|
+
"batchPath": {
|
|
6336
|
+
"minItems": 1,
|
|
6337
|
+
"maxItems": 16,
|
|
6338
|
+
"type": "array",
|
|
6339
|
+
"items": {
|
|
6340
|
+
"type": "string",
|
|
6341
|
+
"minLength": 1,
|
|
6342
|
+
"maxLength": 256
|
|
6343
|
+
}
|
|
6344
|
+
},
|
|
6345
|
+
"indexPath": {
|
|
6346
|
+
"minItems": 1,
|
|
6347
|
+
"maxItems": 16,
|
|
6348
|
+
"type": "array",
|
|
6349
|
+
"items": {
|
|
6350
|
+
"type": "string",
|
|
6351
|
+
"minLength": 1,
|
|
6352
|
+
"maxLength": 256
|
|
6353
|
+
}
|
|
6354
|
+
},
|
|
6355
|
+
"countPath": {
|
|
6356
|
+
"minItems": 1,
|
|
6357
|
+
"maxItems": 16,
|
|
6358
|
+
"type": "array",
|
|
6359
|
+
"items": {
|
|
6360
|
+
"type": "string",
|
|
6361
|
+
"minLength": 1,
|
|
6362
|
+
"maxLength": 256
|
|
6363
|
+
}
|
|
6364
|
+
},
|
|
6365
|
+
"collections": {
|
|
6366
|
+
"minItems": 1,
|
|
6367
|
+
"maxItems": 16,
|
|
6368
|
+
"type": "array",
|
|
6369
|
+
"items": {
|
|
6370
|
+
"type": "object",
|
|
6371
|
+
"properties": {
|
|
6372
|
+
"path": {
|
|
6373
|
+
"minItems": 1,
|
|
6374
|
+
"maxItems": 16,
|
|
6375
|
+
"type": "array",
|
|
6376
|
+
"items": {
|
|
6377
|
+
"type": "string",
|
|
6378
|
+
"minLength": 1,
|
|
6379
|
+
"maxLength": 256
|
|
6380
|
+
}
|
|
6381
|
+
},
|
|
6382
|
+
"totalPath": {
|
|
6383
|
+
"minItems": 1,
|
|
6384
|
+
"maxItems": 16,
|
|
6385
|
+
"type": "array",
|
|
6386
|
+
"items": {
|
|
6387
|
+
"type": "string",
|
|
6388
|
+
"minLength": 1,
|
|
6389
|
+
"maxLength": 256
|
|
6390
|
+
}
|
|
6391
|
+
},
|
|
6392
|
+
"keyPath": {
|
|
6393
|
+
"minItems": 1,
|
|
6394
|
+
"maxItems": 16,
|
|
6395
|
+
"type": "array",
|
|
6396
|
+
"items": {
|
|
6397
|
+
"type": "string",
|
|
6398
|
+
"minLength": 1,
|
|
6399
|
+
"maxLength": 256
|
|
6400
|
+
}
|
|
6401
|
+
}
|
|
6402
|
+
},
|
|
6403
|
+
"required": [
|
|
6404
|
+
"path",
|
|
6405
|
+
"totalPath"
|
|
6406
|
+
],
|
|
6407
|
+
"additionalProperties": false
|
|
6408
|
+
}
|
|
6409
|
+
},
|
|
6410
|
+
"pagination": {
|
|
6411
|
+
"type": "object",
|
|
6412
|
+
"properties": {
|
|
6413
|
+
"maxPages": {
|
|
6414
|
+
"default": 32,
|
|
6415
|
+
"type": "integer",
|
|
6416
|
+
"minimum": 1,
|
|
6417
|
+
"maximum": 100
|
|
6418
|
+
}
|
|
6419
|
+
},
|
|
6420
|
+
"required": [
|
|
6421
|
+
"maxPages"
|
|
6422
|
+
],
|
|
6423
|
+
"additionalProperties": false
|
|
6424
|
+
},
|
|
6425
|
+
"budget": {
|
|
6426
|
+
"type": "object",
|
|
6427
|
+
"properties": {
|
|
6428
|
+
"maxRows": {
|
|
6429
|
+
"default": 1000,
|
|
6430
|
+
"type": "integer",
|
|
6431
|
+
"minimum": 1,
|
|
6432
|
+
"maximum": 10000
|
|
6433
|
+
},
|
|
6434
|
+
"maxItems": {
|
|
6435
|
+
"default": 10000,
|
|
6436
|
+
"type": "integer",
|
|
6437
|
+
"minimum": 1,
|
|
6438
|
+
"maximum": 50000
|
|
6439
|
+
},
|
|
6440
|
+
"maxNodes": {
|
|
6441
|
+
"default": 200000,
|
|
6442
|
+
"type": "integer",
|
|
6443
|
+
"minimum": 1,
|
|
6444
|
+
"maximum": 1000000
|
|
6445
|
+
},
|
|
6446
|
+
"maxBytes": {
|
|
6447
|
+
"default": 8388608,
|
|
6448
|
+
"type": "integer",
|
|
6449
|
+
"minimum": 1024,
|
|
6450
|
+
"maximum": 16777216
|
|
6451
|
+
}
|
|
6452
|
+
},
|
|
6453
|
+
"required": [
|
|
6454
|
+
"maxRows",
|
|
6455
|
+
"maxItems",
|
|
6456
|
+
"maxNodes",
|
|
6457
|
+
"maxBytes"
|
|
6458
|
+
],
|
|
6459
|
+
"additionalProperties": false
|
|
6460
|
+
}
|
|
6461
|
+
},
|
|
6462
|
+
"required": [
|
|
6463
|
+
"kind",
|
|
6464
|
+
"rowsPath",
|
|
6465
|
+
"valuePath",
|
|
6466
|
+
"modelPath",
|
|
6467
|
+
"batchPath",
|
|
6468
|
+
"indexPath",
|
|
6469
|
+
"countPath",
|
|
6470
|
+
"collections",
|
|
6471
|
+
"budget"
|
|
6472
|
+
],
|
|
6473
|
+
"additionalProperties": false
|
|
6474
|
+
}
|
|
6475
|
+
]
|
|
6476
|
+
}
|
|
6477
|
+
},
|
|
6478
|
+
"required": [
|
|
6479
|
+
"materialized"
|
|
6480
|
+
],
|
|
6481
|
+
"additionalProperties": false
|
|
6226
6482
|
}
|
|
6227
|
-
|
|
6228
|
-
"required": [
|
|
6229
|
-
"expression"
|
|
6230
|
-
],
|
|
6231
|
-
"additionalProperties": false
|
|
6483
|
+
]
|
|
6232
6484
|
},
|
|
6233
6485
|
"streamTargetProjection": {
|
|
6234
6486
|
"type": "object",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DesignBoardChanges, type DesignBoardDocument } from '../contracts/design-board';
|
|
2
|
+
export declare function diffDesignBoardDocuments(before: DesignBoardDocument, after: DesignBoardDocument): DesignBoardChanges;
|
|
3
|
+
export declare function applyDesignBoardChanges(document: DesignBoardDocument, changes: DesignBoardChanges): DesignBoardDocument;
|
|
4
|
+
//# sourceMappingURL=design-board.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-board.d.ts","sourceRoot":"","sources":["../../src/runtime/design-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAUnJ,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,GAAG,kBAAkB,CAmBpH;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,kBAAkB,GAAG,mBAAmB,CAuBvH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyDesignBoardChanges = exports.diffDesignBoardDocuments = void 0;
|
|
4
|
+
const design_board_1 = require("../contracts/design-board");
|
|
5
|
+
const stable = (value) => JSON.stringify(value, (_key, item) => item && typeof item === 'object' && !Array.isArray(item)
|
|
6
|
+
? Object.fromEntries(Object.keys(item).sort().map((key) => [key, item[key]])) : item);
|
|
7
|
+
const changed = (before, after, identity) => {
|
|
8
|
+
const previous = new Map(before.map((value) => [identity(value), stable(value)]));
|
|
9
|
+
return after.filter((value) => previous.get(identity(value)) !== stable(value));
|
|
10
|
+
};
|
|
11
|
+
function diffDesignBoardDocuments(before, after) {
|
|
12
|
+
const pageElements = (document, id) => document.document.elements.filter((element) => String(element.customData?.designBoard?.pageId || document.domain.pages[0]?.id) === id);
|
|
13
|
+
const removed = (left, right, identity) => {
|
|
14
|
+
const kept = new Set(right.map(identity));
|
|
15
|
+
return left.map(identity).filter((id) => !kept.has(id));
|
|
16
|
+
};
|
|
17
|
+
return design_board_1.DesignBoardChangesSchema.parse({
|
|
18
|
+
...(stable(before.document.appState) !== stable(after.document.appState) ? { appState: after.document.appState ?? {} } : {}),
|
|
19
|
+
...(stable(before.domain.pages) !== stable(after.domain.pages) ? { pages: after.domain.pages } : {}),
|
|
20
|
+
scenes: after.domain.pages.filter((page) => stable(pageElements(before, page.id)) !== stable(pageElements(after, page.id)))
|
|
21
|
+
.map((page) => ({ pageId: page.id, elements: pageElements(after, page.id) })),
|
|
22
|
+
nodes: changed(before.domain.nodes, after.domain.nodes, (node) => node.id),
|
|
23
|
+
removedNodeIds: removed(before.domain.nodes, after.domain.nodes, (node) => node.id),
|
|
24
|
+
connections: changed(before.domain.connections, after.domain.connections, (edge) => edge.id),
|
|
25
|
+
removedConnectionIds: removed(before.domain.connections, after.domain.connections, (edge) => edge.id),
|
|
26
|
+
files: changed(before.domain.files, after.domain.files, (file) => file.canonicalUri),
|
|
27
|
+
removedFileUris: removed(before.domain.files, after.domain.files, (file) => file.canonicalUri),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.diffDesignBoardDocuments = diffDesignBoardDocuments;
|
|
31
|
+
function applyDesignBoardChanges(document, changes) {
|
|
32
|
+
changes = design_board_1.DesignBoardChangesSchema.parse(changes);
|
|
33
|
+
const identities = [changes.scenes.map((scene) => scene.pageId), changes.nodes.map((node) => node.id), changes.connections.map((edge) => edge.id), changes.files.map((file) => file.canonicalUri)];
|
|
34
|
+
if (identities.some((ids) => new Set(ids).size !== ids.length))
|
|
35
|
+
throw new Error('DESIGN_BOARD_CHANGE_IDENTITIES_DUPLICATE');
|
|
36
|
+
const apply = (previous, updates, removed, identity) => {
|
|
37
|
+
const values = new Map(previous.map((item) => [identity(item), item]));
|
|
38
|
+
removed.forEach((id) => values.delete(id));
|
|
39
|
+
updates.forEach((item) => values.set(identity(item), item));
|
|
40
|
+
return [...values.values()];
|
|
41
|
+
};
|
|
42
|
+
const pages = changes.pages || document.domain.pages;
|
|
43
|
+
const pageIds = new Set(pages.map((page) => page.id));
|
|
44
|
+
if (changes.scenes.some((scene) => !pageIds.has(scene.pageId)))
|
|
45
|
+
throw new Error('DESIGN_BOARD_CHANGE_PAGE_MISSING');
|
|
46
|
+
const scenes = new Map(changes.scenes.map((scene) => [scene.pageId, scene.elements]));
|
|
47
|
+
const elements = pages.flatMap((page) => scenes.get(page.id) ?? document.document.elements.filter((element) => String(element.customData?.designBoard?.pageId || document.domain.pages[0]?.id) === page.id));
|
|
48
|
+
const result = { ...document, document: { ...document.document, elements, files: {}, ...(changes.appState === undefined ? {} : { appState: changes.appState }) }, domain: {
|
|
49
|
+
...document.domain, pages,
|
|
50
|
+
nodes: apply(document.domain.nodes, changes.nodes, changes.removedNodeIds, (node) => node.id).filter((node) => pageIds.has(node.pageId)),
|
|
51
|
+
connections: apply(document.domain.connections, changes.connections, changes.removedConnectionIds, (edge) => edge.id).filter((edge) => pageIds.has(edge.pageId)),
|
|
52
|
+
files: apply(document.domain.files, changes.files, changes.removedFileUris, (file) => file.canonicalUri),
|
|
53
|
+
} };
|
|
54
|
+
return design_board_1.DesignBoardDocumentSchema.parse(result);
|
|
55
|
+
}
|
|
56
|
+
exports.applyDesignBoardChanges = applyDesignBoardChanges;
|
|
57
|
+
//# sourceMappingURL=design-board.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-board.js","sourceRoot":"","sources":["../../src/runtime/design-board.ts"],"names":[],"mappings":";;;AAAA,4DAAmJ;AAEnJ,MAAM,MAAM,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;IACvI,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAExF,MAAM,OAAO,GAAG,CAAI,MAAoB,EAAE,KAAmB,EAAE,QAA8B,EAAE,EAAE;IAC/F,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC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AAE,CAAC,IAAI,CAAC,YAAY,CAAC;SACzG,EAAE,CAAC;IACJ,OAAO,wCAAyB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAvBD,0DAuBC"}
|
package/lib/runtime/index.d.ts
CHANGED
|
@@ -15,9 +15,11 @@ export * from './declarative-runtime-contract';
|
|
|
15
15
|
export * from './view-render-model';
|
|
16
16
|
export * from './workflow-compiler';
|
|
17
17
|
export * from './workflow-column';
|
|
18
|
+
export * from './design-board';
|
|
18
19
|
export * from './access-compiler';
|
|
19
20
|
export { compileComponentAssemblyValidator } from "./component-assembly";
|
|
20
21
|
export * from './page-expression';
|
|
22
|
+
export * from './materialized-model';
|
|
21
23
|
export * from './record-editor-draft';
|
|
22
24
|
export * from './target-render-model';
|
|
23
25
|
export * from './page-stream';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAEzE,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAEzE,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AAErC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,eAAe,CAAC;AAE9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
|
package/lib/runtime/index.js
CHANGED
|
@@ -32,10 +32,12 @@ __exportStar(require("./declarative-runtime-contract"), exports);
|
|
|
32
32
|
__exportStar(require("./view-render-model"), exports);
|
|
33
33
|
__exportStar(require("./workflow-compiler"), exports);
|
|
34
34
|
__exportStar(require("./workflow-column"), exports);
|
|
35
|
+
__exportStar(require("./design-board"), exports);
|
|
35
36
|
__exportStar(require("./access-compiler"), exports);
|
|
36
37
|
var component_assembly_1 = require("./component-assembly");
|
|
37
38
|
Object.defineProperty(exports, "compileComponentAssemblyValidator", { enumerable: true, get: function () { return component_assembly_1.compileComponentAssemblyValidator; } });
|
|
38
39
|
__exportStar(require("./page-expression"), exports);
|
|
40
|
+
__exportStar(require("./materialized-model"), exports);
|
|
39
41
|
__exportStar(require("./record-editor-draft"), exports);
|
|
40
42
|
__exportStar(require("./target-render-model"), exports);
|
|
41
43
|
__exportStar(require("./page-stream"), exports);
|
package/lib/runtime/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,4DAA0C;AAC1C,yDAAuC;AACvC,iEAA+C;AAC/C,4DAA0C;AAC1C,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,yDAAuC;AACvC,kDAAgC;AAChC,4DAA0C;AAC1C,iDAA+B;AAC/B,2DAAyC;AACzC,iEAA+C;AAC/C,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,oDAAkC;AAElC,2DAAyE;AAAhE,uIAAA,iCAAiC,OAAA;AAE1C,oDAAkC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,4DAA0C;AAC1C,yDAAuC;AACvC,iEAA+C;AAC/C,4DAA0C;AAC1C,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,yDAAuC;AACvC,kDAAgC;AAChC,4DAA0C;AAC1C,iDAA+B;AAC/B,2DAAyC;AACzC,iEAA+C;AAC/C,sDAAoC;AACpC,sDAAoC;AACpC,oDAAkC;AAClC,iDAA+B;AAC/B,oDAAkC;AAElC,2DAAyE;AAAhE,uIAAA,iCAAiC,OAAA;AAE1C,oDAAkC;AAClC,uDAAqC;AAErC,wDAAsC;AAEtC,wDAAsC;AAEtC,gDAA8B;AAE9B,0DAAwC;AACxC,4DAA0C;AAC1C,qDAAmC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JsonObject } from '../contracts/common';
|
|
2
|
+
import { type MaterializedModelProjection } from '../contracts/materialized-model';
|
|
3
|
+
export declare function assertMaterializedModelBudget(value: unknown, budget: MaterializedModelProjection['budget']): void;
|
|
4
|
+
/** No expressions, arbitrary functions, business calculations or network access. */
|
|
5
|
+
export declare function prepareMaterializedModelProjection(input: unknown): (raw: JsonObject) => JsonObject;
|
|
6
|
+
export type MaterializedModelPage = {
|
|
7
|
+
model: JsonObject;
|
|
8
|
+
pageInfo?: {
|
|
9
|
+
hasMore: boolean;
|
|
10
|
+
nextCursor?: string;
|
|
11
|
+
returned?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
total?: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/** Exhaust an explicitly configured bounded cursor query before exposing a model. */
|
|
17
|
+
export declare function collectMaterializedModelPages<T extends MaterializedModelPage>(input: {
|
|
18
|
+
first: T;
|
|
19
|
+
projection: MaterializedModelProjection;
|
|
20
|
+
signal: AbortSignal;
|
|
21
|
+
query: (cursor: string, signal: AbortSignal) => Promise<T>;
|
|
22
|
+
}): Promise<T>;
|
|
23
|
+
//# sourceMappingURL=materialized-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialized-model.d.ts","sourceRoot":"","sources":["../../src/runtime/materialized-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAqC,KAAK,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAgBtH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAAG,IAAI,CAuBjH;AAgBD,oFAAoF;AACpF,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK,UAAU,CA8DlG;AAED,MAAM,MAAM,qBAAqB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAEtK,qFAAqF;AACrF,wBAAsB,6BAA6B,CAAC,CAAC,SAAS,qBAAqB,EAAE,KAAK,EAAE;IAC1F,KAAK,EAAE,CAAC,CAAC;IACT,UAAU,EAAE,2BAA2B,CAAC;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC5D,GAAG,OAAO,CAAC,CAAC,CAAC,CA2Bb"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectMaterializedModelPages = exports.prepareMaterializedModelProjection = exports.assertMaterializedModelBudget = void 0;
|
|
4
|
+
const materialized_model_1 = require("../contracts/materialized-model");
|
|
5
|
+
const unsafe = new Set(['__proto__', 'prototype', 'constructor']);
|
|
6
|
+
function fail(code) { throw Object.assign(new Error(code), { code }); }
|
|
7
|
+
const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value) ? value : fail('MATERIALIZED_MODEL_INVALID');
|
|
8
|
+
const read = (value, path) => {
|
|
9
|
+
let current = value;
|
|
10
|
+
for (const key of path) {
|
|
11
|
+
if (unsafe.has(key))
|
|
12
|
+
fail('MATERIALIZED_MODEL_UNSAFE_PATH');
|
|
13
|
+
if (!current || typeof current !== 'object' || !Object.prototype.hasOwnProperty.call(current, key))
|
|
14
|
+
fail('MATERIALIZED_MODEL_PATH_MISSING');
|
|
15
|
+
current = current[key];
|
|
16
|
+
}
|
|
17
|
+
return current;
|
|
18
|
+
};
|
|
19
|
+
const integer = (value, min, max) => Number.isSafeInteger(value) && Number(value) >= min && Number(value) <= max ? Number(value) : fail('MATERIALIZED_MODEL_INCOMPLETE');
|
|
20
|
+
function assertMaterializedModelBudget(value, budget) {
|
|
21
|
+
const pending = [{ value, depth: 0 }];
|
|
22
|
+
let nodes = 0, bytes = 0;
|
|
23
|
+
while (pending.length) {
|
|
24
|
+
const item = pending.pop();
|
|
25
|
+
if (++nodes > budget.maxNodes || item.depth > 64)
|
|
26
|
+
fail('MATERIALIZED_MODEL_BUDGET');
|
|
27
|
+
bytes += 32; // Conservative JSON punctuation / scalar overhead, separate from string and key bytes.
|
|
28
|
+
const current = item.value;
|
|
29
|
+
if (typeof current === 'string')
|
|
30
|
+
bytes += current.length * 2;
|
|
31
|
+
else if (typeof current === 'number' && !Number.isFinite(current))
|
|
32
|
+
fail('MATERIALIZED_MODEL_INVALID');
|
|
33
|
+
else if (current !== null && typeof current === 'object') {
|
|
34
|
+
if (Array.isArray(current) && current.length > Math.max(budget.maxItems, budget.maxRows))
|
|
35
|
+
fail('MATERIALIZED_MODEL_BUDGET');
|
|
36
|
+
const prototype = Object.getPrototypeOf(current);
|
|
37
|
+
if (prototype !== Object.prototype && prototype !== Array.prototype && prototype !== null)
|
|
38
|
+
fail('MATERIALIZED_MODEL_INVALID');
|
|
39
|
+
for (const [key, child] of Object.entries(current)) {
|
|
40
|
+
if (unsafe.has(key))
|
|
41
|
+
fail('MATERIALIZED_MODEL_UNSAFE_PATH');
|
|
42
|
+
bytes += key.length * 2;
|
|
43
|
+
if (pending.length >= budget.maxNodes)
|
|
44
|
+
fail('MATERIALIZED_MODEL_BUDGET');
|
|
45
|
+
pending.push({ value: child, depth: item.depth + 1 });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (current !== null && !['string', 'number', 'boolean'].includes(typeof current))
|
|
49
|
+
fail('MATERIALIZED_MODEL_INVALID');
|
|
50
|
+
if (bytes > budget.maxBytes)
|
|
51
|
+
fail('MATERIALIZED_MODEL_BUDGET');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.assertMaterializedModelBudget = assertMaterializedModelBudget;
|
|
55
|
+
/** Assign into a private clone only. Array indexes must already exist. */
|
|
56
|
+
function assign(root, path, value) {
|
|
57
|
+
let target = root;
|
|
58
|
+
for (const key of path.slice(0, -1)) {
|
|
59
|
+
if (unsafe.has(key) || !target || typeof target !== 'object' || !Object.prototype.hasOwnProperty.call(target, key))
|
|
60
|
+
fail('MATERIALIZED_MODEL_PATH_MISSING');
|
|
61
|
+
target = target[key];
|
|
62
|
+
}
|
|
63
|
+
const last = path[path.length - 1];
|
|
64
|
+
if (unsafe.has(last) || !target || typeof target !== 'object' || !Object.prototype.hasOwnProperty.call(target, last))
|
|
65
|
+
fail('MATERIALIZED_MODEL_PATH_MISSING');
|
|
66
|
+
target[last] = value;
|
|
67
|
+
}
|
|
68
|
+
const overlaps = (a, b) => a.slice(0, Math.min(a.length, b.length)).every((key, index) => key === b[index]);
|
|
69
|
+
const canonical = (value) => value && typeof value === 'object' ? Array.isArray(value) ? '[' + value.map(canonical).join(',') + ']' : '{' + Object.keys(value).sort().map(key => JSON.stringify(key) + ':' + canonical(value[key])).join(',') + '}' : JSON.stringify(value);
|
|
70
|
+
/** No expressions, arbitrary functions, business calculations or network access. */
|
|
71
|
+
function prepareMaterializedModelProjection(input) {
|
|
72
|
+
const config = materialized_model_1.MaterializedModelProjectionSchema.parse(input);
|
|
73
|
+
if (config.kind === 'value')
|
|
74
|
+
return raw => {
|
|
75
|
+
const selected = object(read(raw, config.path));
|
|
76
|
+
assertMaterializedModelBudget(selected, config.budget);
|
|
77
|
+
return structuredClone(selected);
|
|
78
|
+
};
|
|
79
|
+
for (let i = 0; i < config.collections.length; i++)
|
|
80
|
+
if (config.collections.slice(i + 1).some(other => overlaps(config.collections[i].path, other.path)))
|
|
81
|
+
fail('MATERIALIZED_MODEL_COLLECTION_OVERLAP');
|
|
82
|
+
return raw => {
|
|
83
|
+
const rows = read(raw, config.rowsPath);
|
|
84
|
+
if (!Array.isArray(rows) || !rows.length || rows.length > config.budget.maxRows)
|
|
85
|
+
fail('MATERIALIZED_MODEL_INCOMPLETE');
|
|
86
|
+
const parts = rows.map(row => object(read(row, config.valuePath)));
|
|
87
|
+
assertMaterializedModelBudget(parts, config.budget);
|
|
88
|
+
const batch = read(parts[0], config.batchPath);
|
|
89
|
+
if (typeof batch !== 'string' || !batch.trim() || batch.length > 256)
|
|
90
|
+
fail('MATERIALIZED_MODEL_BATCH_MISMATCH');
|
|
91
|
+
const count = integer(read(parts[0], config.countPath), 1, config.budget.maxRows);
|
|
92
|
+
if (parts.length !== count)
|
|
93
|
+
fail('MATERIALIZED_MODEL_INCOMPLETE');
|
|
94
|
+
const ordered = new Array(count);
|
|
95
|
+
for (const part of parts) {
|
|
96
|
+
if (read(part, config.batchPath) !== batch || read(part, config.countPath) !== count)
|
|
97
|
+
fail('MATERIALIZED_MODEL_BATCH_MISMATCH');
|
|
98
|
+
const position = integer(read(part, config.indexPath), 0, count - 1);
|
|
99
|
+
if (ordered[position])
|
|
100
|
+
fail('MATERIALIZED_MODEL_DUPLICATE_CHUNK');
|
|
101
|
+
ordered[position] = part;
|
|
102
|
+
}
|
|
103
|
+
const collections = config.collections.map(collection => ({
|
|
104
|
+
config: collection,
|
|
105
|
+
expected: integer(read(ordered[0], collection.totalPath), 0, config.budget.maxItems),
|
|
106
|
+
items: [], keys: new Set(),
|
|
107
|
+
}));
|
|
108
|
+
let base, header;
|
|
109
|
+
for (const part of ordered) {
|
|
110
|
+
const model = structuredClone(object(read(part, config.modelPath)));
|
|
111
|
+
for (const collection of collections) {
|
|
112
|
+
if (read(part, collection.config.totalPath) !== collection.expected)
|
|
113
|
+
fail('MATERIALIZED_MODEL_COUNT_MISMATCH');
|
|
114
|
+
const items = read(model, collection.config.path);
|
|
115
|
+
if (!Array.isArray(items))
|
|
116
|
+
fail('MATERIALIZED_MODEL_INVALID');
|
|
117
|
+
if (collection.items.length + items.length > config.budget.maxItems)
|
|
118
|
+
fail('MATERIALIZED_MODEL_BUDGET');
|
|
119
|
+
for (const item of items) {
|
|
120
|
+
if (collection.config.keyPath) {
|
|
121
|
+
const key = read(item, collection.config.keyPath);
|
|
122
|
+
if (typeof key !== 'string' && !(typeof key === 'number' && Number.isFinite(key)))
|
|
123
|
+
fail('MATERIALIZED_MODEL_INVALID_KEY');
|
|
124
|
+
const identity = typeof key + ':' + key;
|
|
125
|
+
if (collection.keys.has(identity))
|
|
126
|
+
fail('MATERIALIZED_MODEL_DUPLICATE_ITEM');
|
|
127
|
+
collection.keys.add(identity);
|
|
128
|
+
}
|
|
129
|
+
collection.items.push(item);
|
|
130
|
+
}
|
|
131
|
+
assign(model, collection.config.path, []);
|
|
132
|
+
}
|
|
133
|
+
const currentHeader = canonical(model);
|
|
134
|
+
if (header !== undefined && header !== currentHeader)
|
|
135
|
+
fail('MATERIALIZED_MODEL_HEADER_MISMATCH');
|
|
136
|
+
header = currentHeader;
|
|
137
|
+
base ?? (base = model);
|
|
138
|
+
}
|
|
139
|
+
for (const collection of collections) {
|
|
140
|
+
if (collection.items.length !== collection.expected)
|
|
141
|
+
fail('MATERIALIZED_MODEL_COUNT_MISMATCH');
|
|
142
|
+
assign(base, collection.config.path, collection.items);
|
|
143
|
+
}
|
|
144
|
+
assertMaterializedModelBudget(base, config.budget);
|
|
145
|
+
return base;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
exports.prepareMaterializedModelProjection = prepareMaterializedModelProjection;
|
|
149
|
+
/** Exhaust an explicitly configured bounded cursor query before exposing a model. */
|
|
150
|
+
async function collectMaterializedModelPages(input) {
|
|
151
|
+
const config = materialized_model_1.MaterializedModelProjectionSchema.parse(input.projection);
|
|
152
|
+
if (config.kind !== 'chunks' || !config.pagination)
|
|
153
|
+
return input.first;
|
|
154
|
+
const rows = read(input.first.model, config.rowsPath);
|
|
155
|
+
if (!Array.isArray(rows))
|
|
156
|
+
fail('MATERIALIZED_MODEL_INVALID');
|
|
157
|
+
if (rows.length > config.budget.maxRows)
|
|
158
|
+
fail('MATERIALIZED_MODEL_BUDGET');
|
|
159
|
+
let all = [...rows], current = input.first, pages = 1;
|
|
160
|
+
const cursors = new Set();
|
|
161
|
+
assertMaterializedModelBudget(all, config.budget);
|
|
162
|
+
while (current.pageInfo?.hasMore) {
|
|
163
|
+
input.signal.throwIfAborted();
|
|
164
|
+
const cursor = current.pageInfo.nextCursor;
|
|
165
|
+
if (!cursor || cursors.has(cursor))
|
|
166
|
+
fail('MATERIALIZED_MODEL_CURSOR_INVALID');
|
|
167
|
+
if (pages >= config.pagination.maxPages)
|
|
168
|
+
fail('MATERIALIZED_MODEL_PAGE_LIMIT');
|
|
169
|
+
cursors.add(cursor);
|
|
170
|
+
current = await input.query(cursor, input.signal);
|
|
171
|
+
input.signal.throwIfAborted();
|
|
172
|
+
const nextRows = read(current.model, config.rowsPath);
|
|
173
|
+
if (!Array.isArray(nextRows) || !nextRows.length)
|
|
174
|
+
fail('MATERIALIZED_MODEL_CURSOR_INVALID');
|
|
175
|
+
if (all.length + nextRows.length > config.budget.maxRows)
|
|
176
|
+
fail('MATERIALIZED_MODEL_BUDGET');
|
|
177
|
+
all.push(...nextRows);
|
|
178
|
+
pages++;
|
|
179
|
+
assertMaterializedModelBudget(all, config.budget);
|
|
180
|
+
}
|
|
181
|
+
input.signal.throwIfAborted();
|
|
182
|
+
const model = structuredClone(input.first.model);
|
|
183
|
+
assign(model, config.rowsPath, all);
|
|
184
|
+
return { ...input.first, model, pageInfo: { ...current.pageInfo, hasMore: false, nextCursor: undefined, returned: all.length } };
|
|
185
|
+
}
|
|
186
|
+
exports.collectMaterializedModelPages = collectMaterializedModelPages;
|
|
187
|
+
//# sourceMappingURL=materialized-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialized-model.js","sourceRoot":"","sources":["../../src/runtime/materialized-model.ts"],"names":[],"mappings":";;;AACA,wEAAsH;AAEtH,MAAM,M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