@inf-monkeys-tech/monkeys 1.1.33 → 1.1.34
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 +19 -0
- package/lib/contracts/page-expression.d.ts +7 -0
- package/lib/contracts/page-expression.d.ts.map +1 -1
- package/lib/contracts/page-expression.js +13 -6
- package/lib/contracts/page-expression.js.map +1 -1
- package/lib/contracts/tenant.d.ts +3 -0
- package/lib/contracts/tenant.d.ts.map +1 -1
- package/lib/contracts/tenant.js +1 -0
- package/lib/contracts/tenant.js.map +1 -1
- package/lib/esm/{chunk-DDTXYQDI.mjs → chunk-DDEMQXTP.mjs} +3 -3
- package/lib/esm/{chunk-KZDXFORL.mjs → chunk-EKT45BA4.mjs} +2 -2
- package/lib/esm/{chunk-TYFYPXUR.mjs → chunk-IJ2W77NR.mjs} +2 -2
- package/lib/esm/{chunk-YNZODMGG.mjs → chunk-L5CYU6K4.mjs} +13 -6
- package/lib/esm/chunk-L5CYU6K4.mjs.map +1 -0
- package/lib/esm/{chunk-J6LASFTW.mjs → chunk-UWGXMF6O.mjs} +2 -2
- package/lib/esm/{chunk-AYAQRJZB.mjs → chunk-ZN3TO3U7.mjs} +17 -10
- package/lib/esm/{chunk-AYAQRJZB.mjs.map → chunk-ZN3TO3U7.mjs.map} +1 -1
- package/lib/esm/contracts/index.mjs +8 -4
- package/lib/esm/index.mjs +10 -6
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +3 -3
- package/lib/esm/schemas/index.mjs +3 -3
- package/lib/json-schema/tenant-product-config.schema.json +4 -0
- package/lib/json-schema/tenant-runtime-config.schema.json +4 -0
- package/lib/runtime/action-program-author.d.ts +7 -1
- package/lib/runtime/action-program-author.d.ts.map +1 -1
- package/lib/runtime/action-program-author.js.map +1 -1
- package/lib/runtime/page-expression.d.ts.map +1 -1
- package/lib/runtime/page-expression.js +16 -7
- package/lib/runtime/page-expression.js.map +1 -1
- package/lib/schemas/index.d.ts +2 -0
- package/lib/schemas/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/esm/chunk-YNZODMGG.mjs.map +0 -1
- /package/lib/esm/{chunk-DDTXYQDI.mjs.map → chunk-DDEMQXTP.mjs.map} +0 -0
- /package/lib/esm/{chunk-KZDXFORL.mjs.map → chunk-EKT45BA4.mjs.map} +0 -0
- /package/lib/esm/{chunk-TYFYPXUR.mjs.map → chunk-IJ2W77NR.mjs.map} +0 -0
- /package/lib/esm/{chunk-J6LASFTW.mjs.map → chunk-UWGXMF6O.mjs.map} +0 -0
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
RevisionRefSchema,
|
|
14
14
|
Sha256Schema,
|
|
15
15
|
TenantScopeSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-L5CYU6K4.mjs";
|
|
17
17
|
|
|
18
18
|
// src/contracts/artifact.ts
|
|
19
19
|
import { z } from "zod";
|
|
@@ -1006,4 +1006,4 @@ export {
|
|
|
1006
1006
|
WorkflowCompletionCommitSchema,
|
|
1007
1007
|
WorkflowCompletionReceiptSchema
|
|
1008
1008
|
};
|
|
1009
|
-
//# sourceMappingURL=chunk-
|
|
1009
|
+
//# sourceMappingURL=chunk-UWGXMF6O.mjs.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
PAGE_STREAM_MAX_FRAME_BYTES,
|
|
5
5
|
PageStreamDescriptorSchema,
|
|
6
6
|
PageStreamEventSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IJ2W77NR.mjs";
|
|
8
8
|
import {
|
|
9
9
|
AccessPolicySchema,
|
|
10
10
|
ActionProgramDefinitionSchema,
|
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
NavigationSchema,
|
|
53
53
|
OntologyBindingSchema,
|
|
54
54
|
PAGE_EXPRESSION_LIMITS,
|
|
55
|
+
PAGE_EXPRESSION_VALUE_LIMITS,
|
|
55
56
|
PageDefinitionSchema,
|
|
56
57
|
PageExpressionSchema,
|
|
57
58
|
PageNodeSchema,
|
|
@@ -88,6 +89,7 @@ import {
|
|
|
88
89
|
WorkflowDefinitionSchema,
|
|
89
90
|
WorkflowOutputBindingSchema,
|
|
90
91
|
WorkflowParameterSchema,
|
|
92
|
+
assertPageExpressionValueBudget,
|
|
91
93
|
assertPageValueBudget,
|
|
92
94
|
collectPageExpressionReads,
|
|
93
95
|
require_ajv,
|
|
@@ -108,7 +110,7 @@ import {
|
|
|
108
110
|
require_validation,
|
|
109
111
|
require_validation_error,
|
|
110
112
|
resolveThemeTokens
|
|
111
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-L5CYU6K4.mjs";
|
|
112
114
|
import {
|
|
113
115
|
__commonJS,
|
|
114
116
|
__toESM
|
|
@@ -6396,6 +6398,11 @@ var same = (a, b) => {
|
|
|
6396
6398
|
const keys = Object.keys(a);
|
|
6397
6399
|
return keys.length === Object.keys(b).length && keys.every((key) => Object.prototype.hasOwnProperty.call(b, key) && same(a[key], b[key]));
|
|
6398
6400
|
};
|
|
6401
|
+
var assertRuntimeValue = (value, budget) => {
|
|
6402
|
+
if (value !== null && typeof value === "object" && budget.validated?.has(value)) return;
|
|
6403
|
+
assertPageExpressionValueBudget(value);
|
|
6404
|
+
if (value !== null && typeof value === "object") (budget.validated ?? (budget.validated = /* @__PURE__ */ new WeakSet())).add(value);
|
|
6405
|
+
};
|
|
6399
6406
|
var evaluateCompiled = (expression, context, budget) => {
|
|
6400
6407
|
const run = (node, current) => {
|
|
6401
6408
|
if (++budget.operations > PAGE_EXPRESSION_LIMITS.operations) fail("PAGE_EXPRESSION_BUDGET");
|
|
@@ -6406,7 +6413,7 @@ var evaluateCompiled = (expression, context, budget) => {
|
|
|
6406
6413
|
}
|
|
6407
6414
|
if (node.kind === "read") {
|
|
6408
6415
|
const value = readPageValue(current[node.root], node.path) ?? null;
|
|
6409
|
-
|
|
6416
|
+
assertRuntimeValue(value, budget);
|
|
6410
6417
|
return value;
|
|
6411
6418
|
}
|
|
6412
6419
|
if (node.kind === "conditional") return run(boolean(run(node.condition, current)) ? node.then : node.else, current);
|
|
@@ -6415,7 +6422,7 @@ var evaluateCompiled = (expression, context, budget) => {
|
|
|
6415
6422
|
if (node.kind === "map" || node.kind === "filter" || node.kind === "sum") {
|
|
6416
6423
|
const source = run(node.source, current);
|
|
6417
6424
|
if (!Array.isArray(source)) return fail("PAGE_EXPRESSION_TYPE_ARRAY");
|
|
6418
|
-
if (source.length >
|
|
6425
|
+
if (source.length > PAGE_EXPRESSION_VALUE_LIMITS.collection) fail("PAGE_EXPRESSION_BUDGET");
|
|
6419
6426
|
const values2 = source.map((item, index) => run(node.value, { ...current, scope: { item, index, parent: current.scope ?? null } }));
|
|
6420
6427
|
if (node.kind === "map") return values2;
|
|
6421
6428
|
if (node.kind === "filter") return source.filter((_, index) => boolean(values2[index]));
|
|
@@ -6472,7 +6479,7 @@ var evaluateCompiled = (expression, context, budget) => {
|
|
|
6472
6479
|
return typeof first === "number" ? first : typeof first === "string" && first.trim() && Number.isFinite(Number(first)) ? Number(first) : null;
|
|
6473
6480
|
case "concat": {
|
|
6474
6481
|
const strings = values.map((value) => typeof value === "string" ? value : fail("PAGE_EXPRESSION_TYPE_STRING"));
|
|
6475
|
-
if (strings.reduce((bytes2, value) => bytes2 + value.length * 2, 0) >
|
|
6482
|
+
if (strings.reduce((bytes2, value) => bytes2 + value.length * 2, 0) > PAGE_EXPRESSION_VALUE_LIMITS.bytes) fail("PAGE_EXPRESSION_BUDGET");
|
|
6476
6483
|
return strings.join("");
|
|
6477
6484
|
}
|
|
6478
6485
|
case "length":
|
|
@@ -6488,14 +6495,14 @@ var evaluateCompiled = (expression, context, budget) => {
|
|
|
6488
6495
|
case "merge": {
|
|
6489
6496
|
const objects = values.map(object);
|
|
6490
6497
|
const merged = Object.assign({}, ...objects);
|
|
6491
|
-
|
|
6498
|
+
assertRuntimeValue(merged, budget);
|
|
6492
6499
|
return merged;
|
|
6493
6500
|
}
|
|
6494
6501
|
case "entries":
|
|
6495
6502
|
return Object.entries(object(first));
|
|
6496
6503
|
case "from-entries": {
|
|
6497
6504
|
const result2 = {};
|
|
6498
|
-
if (!Array.isArray(first) || first.length >
|
|
6505
|
+
if (!Array.isArray(first) || first.length > PAGE_EXPRESSION_VALUE_LIMITS.collection) return fail("PAGE_EXPRESSION_TYPE_ARRAY");
|
|
6499
6506
|
for (const pair of first) {
|
|
6500
6507
|
if (!Array.isArray(pair) || pair.length !== 2 || typeof pair[0] !== "string" || unsafe.has(pair[0])) return fail("PAGE_EXPRESSION_ENTRY");
|
|
6501
6508
|
if (Object.prototype.hasOwnProperty.call(result2, pair[0])) return fail("PAGE_EXPRESSION_DUPLICATE_KEY");
|
|
@@ -6507,7 +6514,7 @@ var evaluateCompiled = (expression, context, budget) => {
|
|
|
6507
6514
|
const result2 = [];
|
|
6508
6515
|
for (const value of values) {
|
|
6509
6516
|
if (!Array.isArray(value)) return fail("PAGE_EXPRESSION_TYPE_ARRAY");
|
|
6510
|
-
if (result2.length + value.length >
|
|
6517
|
+
if (result2.length + value.length > PAGE_EXPRESSION_VALUE_LIMITS.collection) return fail("PAGE_EXPRESSION_BUDGET");
|
|
6511
6518
|
result2.push(...value);
|
|
6512
6519
|
}
|
|
6513
6520
|
return result2;
|
|
@@ -6543,7 +6550,7 @@ var evaluateCompiled = (expression, context, budget) => {
|
|
|
6543
6550
|
}
|
|
6544
6551
|
};
|
|
6545
6552
|
const result = run(expression, context);
|
|
6546
|
-
|
|
6553
|
+
assertRuntimeValue(result, budget);
|
|
6547
6554
|
return result;
|
|
6548
6555
|
};
|
|
6549
6556
|
var evaluatePageExpression = (expression, context) => evaluateCompiled(compilePageExpression(expression), context, { operations: 0 });
|
|
@@ -7249,4 +7256,4 @@ export {
|
|
|
7249
7256
|
PageCompositionSchema,
|
|
7250
7257
|
compilePageComposition
|
|
7251
7258
|
};
|
|
7252
|
-
//# sourceMappingURL=chunk-
|
|
7259
|
+
//# sourceMappingURL=chunk-ZN3TO3U7.mjs.map
|