@stndrds/schema 0.1.0-alpha.39 → 0.1.0-alpha.41
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/dist/{chunk-RYBKW22L.mjs → chunk-4ZUAND4E.mjs} +244 -40
- package/dist/{chunk-OGBGOFRX.js → chunk-6ID63D4M.js} +425 -221
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +24 -6
- package/dist/index.mjs +19 -1
- package/dist/{runtime-B3RCubTj.d.mts → runtime-Vg_IW6IO.d.mts} +218 -44
- package/dist/{runtime-B3RCubTj.d.ts → runtime-Vg_IW6IO.d.ts} +218 -44
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +20 -2
- package/dist/runtime.mjs +19 -1
- package/package.json +2 -2
|
@@ -482,7 +482,7 @@ var TenantContextError = class _TenantContextError extends Error {
|
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
484
|
|
|
485
|
-
// src/runtime/context/
|
|
485
|
+
// src/runtime/context/schema-context.ts
|
|
486
486
|
var browserStub = {
|
|
487
487
|
getStore: () => void 0,
|
|
488
488
|
run: (_store, callback) => callback()
|
|
@@ -520,8 +520,102 @@ function getStorage() {
|
|
|
520
520
|
storageInstance = browserStub;
|
|
521
521
|
return storageInstance;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function getSchemaFromContext(objectId) {
|
|
524
|
+
const ctx = getStorage().getStore();
|
|
525
|
+
return _optionalChain([ctx, 'optionalAccess', _5 => _5.objectsById, 'access', _6 => _6.get, 'call', _7 => _7(objectId)]);
|
|
526
|
+
}
|
|
527
|
+
function getSchemaByNameFromContext(objectName) {
|
|
528
|
+
const ctx = getStorage().getStore();
|
|
529
|
+
return _optionalChain([ctx, 'optionalAccess', _8 => _8.objectsByName, 'access', _9 => _9.get, 'call', _10 => _10(objectName)]);
|
|
530
|
+
}
|
|
531
|
+
function hasSchemaContext() {
|
|
532
|
+
return getStorage().getStore() !== void 0;
|
|
533
|
+
}
|
|
534
|
+
function getSchemaContext() {
|
|
535
|
+
return getStorage().getStore();
|
|
536
|
+
}
|
|
537
|
+
function addSchemaToContext(schema) {
|
|
524
538
|
const ctx = getStorage().getStore();
|
|
539
|
+
if (!ctx) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
if (schema.id) {
|
|
543
|
+
ctx.objectsById.set(schema.id, schema);
|
|
544
|
+
}
|
|
545
|
+
ctx.objectsByName.set(schema.name, schema);
|
|
546
|
+
}
|
|
547
|
+
function buildSchemaContext(schemas) {
|
|
548
|
+
const objectsById = /* @__PURE__ */ new Map();
|
|
549
|
+
const objectsByName = /* @__PURE__ */ new Map();
|
|
550
|
+
for (const schema of schemas) {
|
|
551
|
+
if (schema.id) {
|
|
552
|
+
objectsById.set(schema.id, schema);
|
|
553
|
+
}
|
|
554
|
+
objectsByName.set(schema.name, schema);
|
|
555
|
+
}
|
|
556
|
+
return { objectsById, objectsByName };
|
|
557
|
+
}
|
|
558
|
+
function runWithSchemaContext(schemas, fn) {
|
|
559
|
+
const context = buildSchemaContext(schemas);
|
|
560
|
+
return getStorage().run(context, fn);
|
|
561
|
+
}
|
|
562
|
+
function runWithMergedSchemaContext(schemas, fn) {
|
|
563
|
+
const existing = getStorage().getStore();
|
|
564
|
+
const objectsById = new Map(_optionalChain([existing, 'optionalAccess', _11 => _11.objectsById]));
|
|
565
|
+
const objectsByName = new Map(_optionalChain([existing, 'optionalAccess', _12 => _12.objectsByName]));
|
|
566
|
+
for (const schema of schemas) {
|
|
567
|
+
if (schema.id) {
|
|
568
|
+
objectsById.set(schema.id, schema);
|
|
569
|
+
}
|
|
570
|
+
objectsByName.set(schema.name, schema);
|
|
571
|
+
}
|
|
572
|
+
const context = {
|
|
573
|
+
objectsById,
|
|
574
|
+
objectsByName
|
|
575
|
+
};
|
|
576
|
+
return getStorage().run(context, fn);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// src/runtime/context/tenant-context.ts
|
|
580
|
+
var browserStub2 = {
|
|
581
|
+
getStore: () => void 0,
|
|
582
|
+
run: (_store, callback) => callback()
|
|
583
|
+
};
|
|
584
|
+
var AsyncLocalStorageClass2 = null;
|
|
585
|
+
if (typeof process !== "undefined" && _optionalChain([process, 'access', _13 => _13.versions, 'optionalAccess', _14 => _14.node])) {
|
|
586
|
+
try {
|
|
587
|
+
if (typeof _chunk3RG5ZIWIjs.__require !== "undefined") {
|
|
588
|
+
const asyncHooks = _chunk3RG5ZIWIjs.__require.call(void 0, "async_hooks");
|
|
589
|
+
AsyncLocalStorageClass2 = asyncHooks.AsyncLocalStorage;
|
|
590
|
+
}
|
|
591
|
+
} catch (e6) {
|
|
592
|
+
try {
|
|
593
|
+
const dynamicRequire = new Function(
|
|
594
|
+
"m",
|
|
595
|
+
'return typeof require!=="undefined"?require(m):null'
|
|
596
|
+
);
|
|
597
|
+
const asyncHooks = dynamicRequire("node:async_hooks");
|
|
598
|
+
if (asyncHooks) {
|
|
599
|
+
AsyncLocalStorageClass2 = asyncHooks.AsyncLocalStorage;
|
|
600
|
+
}
|
|
601
|
+
} catch (e7) {
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
var storageInstance2 = null;
|
|
606
|
+
function getStorage2() {
|
|
607
|
+
if (storageInstance2 !== null) {
|
|
608
|
+
return storageInstance2;
|
|
609
|
+
}
|
|
610
|
+
if (AsyncLocalStorageClass2) {
|
|
611
|
+
storageInstance2 = new AsyncLocalStorageClass2();
|
|
612
|
+
return storageInstance2;
|
|
613
|
+
}
|
|
614
|
+
storageInstance2 = browserStub2;
|
|
615
|
+
return storageInstance2;
|
|
616
|
+
}
|
|
617
|
+
function getContext() {
|
|
618
|
+
const ctx = getStorage2().getStore();
|
|
525
619
|
if (!ctx) {
|
|
526
620
|
throw new TenantContextError();
|
|
527
621
|
}
|
|
@@ -534,11 +628,11 @@ function getUserId() {
|
|
|
534
628
|
return getContext().userId;
|
|
535
629
|
}
|
|
536
630
|
function hasContext() {
|
|
537
|
-
return
|
|
631
|
+
return getStorage2().getStore() !== void 0;
|
|
538
632
|
}
|
|
539
633
|
function runWithContext(context, fn) {
|
|
540
634
|
const frozenContext = Object.freeze({ ...context });
|
|
541
|
-
return
|
|
635
|
+
return getStorage2().run(frozenContext, fn);
|
|
542
636
|
}
|
|
543
637
|
function withTenantContext(tenantId, fn, userId) {
|
|
544
638
|
return runWithContext({ tenantId, userId }, fn);
|
|
@@ -919,9 +1013,9 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
919
1013
|
objectId,
|
|
920
1014
|
data,
|
|
921
1015
|
{
|
|
922
|
-
allowDraft: _optionalChain([options, 'optionalAccess',
|
|
923
|
-
validate: _optionalChain([options, 'optionalAccess',
|
|
924
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
1016
|
+
allowDraft: _optionalChain([options, 'optionalAccess', _15 => _15.allowDraft]),
|
|
1017
|
+
validate: _optionalChain([options, 'optionalAccess', _16 => _16.validate]),
|
|
1018
|
+
metadata: _optionalChain([options, 'optionalAccess', _17 => _17.metadata])
|
|
925
1019
|
}
|
|
926
1020
|
);
|
|
927
1021
|
if (this.state.raw) {
|
|
@@ -956,7 +1050,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
956
1050
|
data,
|
|
957
1051
|
{
|
|
958
1052
|
partial: true,
|
|
959
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
1053
|
+
metadata: _optionalChain([options, 'optionalAccess', _18 => _18.metadata])
|
|
960
1054
|
}
|
|
961
1055
|
);
|
|
962
1056
|
if (this.state.raw) {
|
|
@@ -1004,7 +1098,7 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
1004
1098
|
const existing = await this.findById(id);
|
|
1005
1099
|
if (existing) {
|
|
1006
1100
|
return this.eq("id", id).update(writeData, {
|
|
1007
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
1101
|
+
metadata: _optionalChain([options, 'optionalAccess', _19 => _19.metadata])
|
|
1008
1102
|
});
|
|
1009
1103
|
}
|
|
1010
1104
|
}
|
|
@@ -1013,10 +1107,10 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
1013
1107
|
};
|
|
1014
1108
|
function createQueryBuilder(recordService, adapter, objectName, options) {
|
|
1015
1109
|
const initialState = {};
|
|
1016
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1110
|
+
if (_optionalChain([options, 'optionalAccess', _20 => _20.tenantId])) {
|
|
1017
1111
|
initialState.tenantId = asTenantId(options.tenantId);
|
|
1018
1112
|
}
|
|
1019
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1113
|
+
if (_optionalChain([options, 'optionalAccess', _21 => _21.userId])) {
|
|
1020
1114
|
initialState.userId = asUserId(options.userId);
|
|
1021
1115
|
}
|
|
1022
1116
|
return new QueryBuilder(recordService, adapter, objectName, initialState);
|
|
@@ -1425,7 +1519,7 @@ var WorkflowDefinitionSchema = _zod.z.object({
|
|
|
1425
1519
|
).refine(
|
|
1426
1520
|
(def) => {
|
|
1427
1521
|
const startNode = def.nodes[def.startNodeId];
|
|
1428
|
-
return _optionalChain([startNode, 'optionalAccess',
|
|
1522
|
+
return _optionalChain([startNode, 'optionalAccess', _22 => _22.type]) === "start";
|
|
1429
1523
|
},
|
|
1430
1524
|
{
|
|
1431
1525
|
message: "startNodeId must reference a node of type 'start'"
|
|
@@ -1657,8 +1751,8 @@ function wait(reason, options) {
|
|
|
1657
1751
|
return {
|
|
1658
1752
|
status: "wait",
|
|
1659
1753
|
reason,
|
|
1660
|
-
requiredParticipationId: _optionalChain([options, 'optionalAccess',
|
|
1661
|
-
expiresAt: _optionalChain([options, 'optionalAccess',
|
|
1754
|
+
requiredParticipationId: _optionalChain([options, 'optionalAccess', _23 => _23.requiredParticipationId]),
|
|
1755
|
+
expiresAt: _optionalChain([options, 'optionalAccess', _24 => _24.expiresAt])
|
|
1662
1756
|
};
|
|
1663
1757
|
}
|
|
1664
1758
|
function complete(finalStatus) {
|
|
@@ -1843,9 +1937,9 @@ var FormExecutor = class {
|
|
|
1843
1937
|
const object2 = objects.find((o) => o.name === slot.objectName);
|
|
1844
1938
|
if (!object2) continue;
|
|
1845
1939
|
const attribute = object2.attributes.find((a) => a.name === fieldRef.attribute);
|
|
1846
|
-
if (!_optionalChain([attribute, 'optionalAccess',
|
|
1940
|
+
if (!_optionalChain([attribute, 'optionalAccess', _25 => _25.required])) continue;
|
|
1847
1941
|
const slotInput = input[fieldRef.slotId];
|
|
1848
|
-
const value = _optionalChain([slotInput, 'optionalAccess',
|
|
1942
|
+
const value = _optionalChain([slotInput, 'optionalAccess', _26 => _26[fieldRef.attribute]]);
|
|
1849
1943
|
if (value === void 0 || value === null || value === "") {
|
|
1850
1944
|
errors.push(
|
|
1851
1945
|
`Field "${_nullishCoalesce(attribute.label, () => ( fieldRef.attribute))}" is required for ${slot.label}`
|
|
@@ -2019,7 +2113,7 @@ function evaluateFormula(expression, values) {
|
|
|
2019
2113
|
try {
|
|
2020
2114
|
const parsed = formulaParser.parse(expression);
|
|
2021
2115
|
return parsed.evaluate(values);
|
|
2022
|
-
} catch (
|
|
2116
|
+
} catch (e8) {
|
|
2023
2117
|
return null;
|
|
2024
2118
|
}
|
|
2025
2119
|
}
|
|
@@ -2079,7 +2173,7 @@ function extractFormulaVariables(expression) {
|
|
|
2079
2173
|
try {
|
|
2080
2174
|
const parsed = formulaParser.parse(expression);
|
|
2081
2175
|
return parsed.variables();
|
|
2082
|
-
} catch (
|
|
2176
|
+
} catch (e9) {
|
|
2083
2177
|
return [];
|
|
2084
2178
|
}
|
|
2085
2179
|
}
|
|
@@ -2166,7 +2260,7 @@ async function parsePath(path, startSchema, getSchema, maxDepth = 5) {
|
|
|
2166
2260
|
}
|
|
2167
2261
|
if (attr.type === "relation") {
|
|
2168
2262
|
const relationAttr = attr;
|
|
2169
|
-
const targetObject = _optionalChain([relationAttr, 'access',
|
|
2263
|
+
const targetObject = _optionalChain([relationAttr, 'access', _27 => _27.targets, 'access', _28 => _28[0], 'optionalAccess', _29 => _29.object]);
|
|
2170
2264
|
if (!targetObject) {
|
|
2171
2265
|
throw new InvalidPathError(path, segmentName, "Relation has no target object");
|
|
2172
2266
|
}
|
|
@@ -2207,7 +2301,7 @@ async function validatePath(path, startSchema, getSchema, maxDepth = 5) {
|
|
|
2207
2301
|
try {
|
|
2208
2302
|
await parsePath(path, startSchema, getSchema, maxDepth);
|
|
2209
2303
|
return true;
|
|
2210
|
-
} catch (
|
|
2304
|
+
} catch (e10) {
|
|
2211
2305
|
return false;
|
|
2212
2306
|
}
|
|
2213
2307
|
}
|
|
@@ -2229,7 +2323,7 @@ function getRelationPath(path) {
|
|
|
2229
2323
|
|
|
2230
2324
|
// src/runtime/formula/path-traversal.ts
|
|
2231
2325
|
async function traversePath(record, path, startSchemaName, adapter, getSchema, options) {
|
|
2232
|
-
const maxDepth = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2326
|
+
const maxDepth = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _30 => _30.maxDepth]), () => ( 5));
|
|
2233
2327
|
const startSchema = await getSchema(startSchemaName);
|
|
2234
2328
|
if (!startSchema) {
|
|
2235
2329
|
return { values: [], recordCounts: [0] };
|
|
@@ -2315,8 +2409,14 @@ function formatCheckbox(value) {
|
|
|
2315
2409
|
function formatNumber(value, attribute) {
|
|
2316
2410
|
if (typeof value !== "number") return String(value);
|
|
2317
2411
|
const decimals = attribute.decimals;
|
|
2318
|
-
if (attribute.unit === "
|
|
2412
|
+
if (attribute.unit === "integer") {
|
|
2319
2413
|
return value.toLocaleString(void 0, {
|
|
2414
|
+
minimumFractionDigits: 0,
|
|
2415
|
+
maximumFractionDigits: 0
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
if (attribute.unit === "percentage") {
|
|
2419
|
+
return (value / 100).toLocaleString(void 0, {
|
|
2320
2420
|
style: "percent",
|
|
2321
2421
|
minimumFractionDigits: decimals,
|
|
2322
2422
|
maximumFractionDigits: decimals
|
|
@@ -2355,7 +2455,7 @@ function formatPhone(value) {
|
|
|
2355
2455
|
if (!("phoneNumber" in phone2)) return String(value);
|
|
2356
2456
|
if (phone2.countryCode) {
|
|
2357
2457
|
const country = _constants.getCountryByIso3.call(void 0, phone2.countryCode);
|
|
2358
|
-
const dial = _nullishCoalesce(_optionalChain([country, 'optionalAccess',
|
|
2458
|
+
const dial = _nullishCoalesce(_optionalChain([country, 'optionalAccess', _31 => _31.phoneCode]), () => ( ""));
|
|
2359
2459
|
return `${dial} ${phone2.phoneNumber}`.trim();
|
|
2360
2460
|
}
|
|
2361
2461
|
return phone2.phoneNumber;
|
|
@@ -2401,13 +2501,13 @@ function formatLocation(value, attribute) {
|
|
|
2401
2501
|
}
|
|
2402
2502
|
function formatSelect(value, attribute) {
|
|
2403
2503
|
if (typeof value !== "string") return String(value);
|
|
2404
|
-
const option = _optionalChain([attribute, 'access',
|
|
2405
|
-
return _nullishCoalesce(_optionalChain([option, 'optionalAccess',
|
|
2504
|
+
const option = _optionalChain([attribute, 'access', _32 => _32.options, 'optionalAccess', _33 => _33.find, 'call', _34 => _34((o) => o.value === value)]);
|
|
2505
|
+
return _nullishCoalesce(_optionalChain([option, 'optionalAccess', _35 => _35.label]), () => ( String(value)));
|
|
2406
2506
|
}
|
|
2407
2507
|
function formatMultiselect(value, attribute) {
|
|
2408
2508
|
if (!Array.isArray(value)) return String(value);
|
|
2409
2509
|
if (attribute.options) {
|
|
2410
|
-
const labels = value.map((v) => _optionalChain([attribute, 'access',
|
|
2510
|
+
const labels = value.map((v) => _optionalChain([attribute, 'access', _36 => _36.options, 'access', _37 => _37.find, 'call', _38 => _38((o) => o.value === v), 'optionalAccess', _39 => _39.label])).filter(Boolean);
|
|
2411
2511
|
return labels.join(", ");
|
|
2412
2512
|
}
|
|
2413
2513
|
return value.join(", ");
|
|
@@ -2462,7 +2562,7 @@ function formatAttributeValue(value, attribute) {
|
|
|
2462
2562
|
}
|
|
2463
2563
|
|
|
2464
2564
|
// src/runtime/template.ts
|
|
2465
|
-
var
|
|
2565
|
+
var simplePipes = {
|
|
2466
2566
|
/** Convert to uppercase */
|
|
2467
2567
|
UPPER: (v) => String(v).toUpperCase(),
|
|
2468
2568
|
/** Convert to lowercase */
|
|
@@ -2472,6 +2572,16 @@ var pipes = {
|
|
|
2472
2572
|
/** Trim whitespace from both ends */
|
|
2473
2573
|
trim: (v) => String(v).trim()
|
|
2474
2574
|
};
|
|
2575
|
+
var pipesWithArgs = {
|
|
2576
|
+
/** Add prefix only if value is non-empty */
|
|
2577
|
+
prefix: (v, pre = "") => v ? `${pre}${v}` : "",
|
|
2578
|
+
/** Add suffix only if value is non-empty */
|
|
2579
|
+
suffix: (v, suf = "") => v ? `${v}${suf}` : "",
|
|
2580
|
+
/** Wrap value with prefix and suffix only if non-empty */
|
|
2581
|
+
wrap: (v, pre = "", suf = "") => v ? `${pre}${v}${suf}` : "",
|
|
2582
|
+
/** Show default value if empty */
|
|
2583
|
+
default: (v, def = "") => v || def
|
|
2584
|
+
};
|
|
2475
2585
|
function getValue(obj, path) {
|
|
2476
2586
|
return path.split(".").reduce((acc, key) => {
|
|
2477
2587
|
if (acc == null || typeof acc !== "object") return void 0;
|
|
@@ -2479,20 +2589,42 @@ function getValue(obj, path) {
|
|
|
2479
2589
|
}, obj);
|
|
2480
2590
|
}
|
|
2481
2591
|
var DEFAULT_LABEL_FALLBACK = "(Untitled)";
|
|
2592
|
+
function parsePipeExpression(pipeExpr) {
|
|
2593
|
+
const match = pipeExpr.match(/^(\w+)(?::(.*))?$/);
|
|
2594
|
+
if (!match) return { name: pipeExpr, args: [] };
|
|
2595
|
+
const name = match[1];
|
|
2596
|
+
const argsStr = match[2];
|
|
2597
|
+
if (!argsStr) return { name, args: [] };
|
|
2598
|
+
const args = [];
|
|
2599
|
+
const argRegex = /["']([^"']*?)["']/g;
|
|
2600
|
+
let argMatch;
|
|
2601
|
+
while ((argMatch = argRegex.exec(argsStr)) !== null) {
|
|
2602
|
+
args.push(argMatch[1]);
|
|
2603
|
+
}
|
|
2604
|
+
return { name, args };
|
|
2605
|
+
}
|
|
2482
2606
|
function renderLabelExpression(template, values, fallback = DEFAULT_LABEL_FALLBACK) {
|
|
2483
2607
|
const result = template.replace(/\{\{\s*([^}]+)\s*\}\}/g, (_, expr) => {
|
|
2484
2608
|
const parts = expr.split("|").map((s) => s.trim());
|
|
2485
2609
|
const path = parts[0];
|
|
2486
2610
|
let value = getValue(values, path);
|
|
2487
|
-
|
|
2611
|
+
const isEmpty3 = value == null || value === "";
|
|
2612
|
+
if (isEmpty3 && parts.length === 1) return "";
|
|
2488
2613
|
for (let i = 1; i < parts.length; i++) {
|
|
2489
|
-
const pipeName = parts[i]
|
|
2490
|
-
const
|
|
2491
|
-
if (
|
|
2492
|
-
value
|
|
2614
|
+
const { name: pipeName, args } = parsePipeExpression(parts[i]);
|
|
2615
|
+
const simpleFn = simplePipes[pipeName];
|
|
2616
|
+
if (simpleFn) {
|
|
2617
|
+
if (value != null && value !== "") {
|
|
2618
|
+
value = simpleFn(String(value));
|
|
2619
|
+
}
|
|
2620
|
+
} else {
|
|
2621
|
+
const argFn = pipesWithArgs[pipeName];
|
|
2622
|
+
if (argFn) {
|
|
2623
|
+
value = argFn(String(_nullishCoalesce(value, () => ( ""))), ...args);
|
|
2624
|
+
}
|
|
2493
2625
|
}
|
|
2494
2626
|
}
|
|
2495
|
-
return String(value);
|
|
2627
|
+
return String(_nullishCoalesce(value, () => ( "")));
|
|
2496
2628
|
}).trim();
|
|
2497
2629
|
return result || fallback;
|
|
2498
2630
|
}
|
|
@@ -2515,13 +2647,25 @@ function extractAttributeNames(template) {
|
|
|
2515
2647
|
function hasOptions(attr) {
|
|
2516
2648
|
return "options" in attr && Array.isArray(attr.options) && attr.options.length > 0;
|
|
2517
2649
|
}
|
|
2518
|
-
|
|
2650
|
+
var FORMATTABLE_TYPES = /* @__PURE__ */ new Set([
|
|
2651
|
+
"currency",
|
|
2652
|
+
"location",
|
|
2653
|
+
"phone",
|
|
2654
|
+
"date",
|
|
2655
|
+
"rating",
|
|
2656
|
+
"select",
|
|
2657
|
+
"status",
|
|
2658
|
+
"multiselect",
|
|
2659
|
+
"number"
|
|
2660
|
+
]);
|
|
2661
|
+
function enrichValuesForDisplay(values, attributes) {
|
|
2519
2662
|
const enriched = { ...values };
|
|
2520
2663
|
for (const attr of attributes) {
|
|
2521
2664
|
const value = values[attr.name];
|
|
2522
2665
|
if (value == null) continue;
|
|
2666
|
+
if (!FORMATTABLE_TYPES.has(attr.type)) continue;
|
|
2523
2667
|
const isSelectLike = attr.type === "select" || attr.type === "status" || attr.type === "multiselect";
|
|
2524
|
-
if (
|
|
2668
|
+
if (isSelectLike && !hasOptions(attr)) continue;
|
|
2525
2669
|
if (attr.type === "multiselect" && Array.isArray(value) && value.length === 0) continue;
|
|
2526
2670
|
const formatted = formatAttributeValue(value, attr);
|
|
2527
2671
|
if (formatted && formatted !== EMPTY_VALUE_PLACEHOLDER) {
|
|
@@ -2530,13 +2674,14 @@ function enrichValuesWithSelectLabels(values, attributes) {
|
|
|
2530
2674
|
}
|
|
2531
2675
|
return enriched;
|
|
2532
2676
|
}
|
|
2677
|
+
var enrichValuesWithSelectLabels = enrichValuesForDisplay;
|
|
2533
2678
|
function extractRelationIds(val) {
|
|
2534
2679
|
if (typeof val === "string") return [val];
|
|
2535
2680
|
if (Array.isArray(val) && typeof val[0] === "string") return [val[0]];
|
|
2536
2681
|
return [];
|
|
2537
2682
|
}
|
|
2538
2683
|
async function computeLabelWithRelations(template, values, attributes, resolveRelationIds) {
|
|
2539
|
-
let enrichedValues =
|
|
2684
|
+
let enrichedValues = enrichValuesForDisplay(values, attributes);
|
|
2540
2685
|
const attrNames = extractAttributeNames(template);
|
|
2541
2686
|
const relationAttrs = attributes.filter(
|
|
2542
2687
|
(attr) => attr.type === "relation" && attrNames.includes(attr.name)
|
|
@@ -2808,7 +2953,7 @@ function createMockUserProfilesRepository(stores) {
|
|
|
2808
2953
|
list(options) {
|
|
2809
2954
|
const tenantId = getTenantId();
|
|
2810
2955
|
let results = Array.from(stores.userProfiles.values()).filter((p) => p.tenantId === tenantId);
|
|
2811
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2956
|
+
if (_optionalChain([options, 'optionalAccess', _40 => _40.limit])) {
|
|
2812
2957
|
results = results.slice(_nullishCoalesce(options.offset, () => ( 0)), (_nullishCoalesce(options.offset, () => ( 0))) + options.limit);
|
|
2813
2958
|
}
|
|
2814
2959
|
return Promise.resolve(results);
|
|
@@ -2851,7 +2996,7 @@ function createMockFilesRepository(stores) {
|
|
|
2851
2996
|
return {
|
|
2852
2997
|
findById(id) {
|
|
2853
2998
|
const file2 = stores.files.get(id);
|
|
2854
|
-
if (_optionalChain([file2, 'optionalAccess',
|
|
2999
|
+
if (_optionalChain([file2, 'optionalAccess', _41 => _41.deletedAt])) return Promise.resolve(null);
|
|
2855
3000
|
return Promise.resolve(_nullishCoalesce(file2, () => ( null)));
|
|
2856
3001
|
},
|
|
2857
3002
|
create(data) {
|
|
@@ -2908,10 +3053,10 @@ function createMockFilesRepository(stores) {
|
|
|
2908
3053
|
let results = Array.from(stores.files.values()).filter(
|
|
2909
3054
|
(f) => f.tenantId === tenantId && !f.deletedAt
|
|
2910
3055
|
);
|
|
2911
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3056
|
+
if (_optionalChain([options, 'optionalAccess', _42 => _42.mimeType])) {
|
|
2912
3057
|
results = results.filter((f) => f.mimeType === options.mimeType);
|
|
2913
3058
|
}
|
|
2914
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3059
|
+
if (_optionalChain([options, 'optionalAccess', _43 => _43.limit])) {
|
|
2915
3060
|
results = results.slice(_nullishCoalesce(options.offset, () => ( 0)), (_nullishCoalesce(options.offset, () => ( 0))) + options.limit);
|
|
2916
3061
|
}
|
|
2917
3062
|
return Promise.resolve(results);
|
|
@@ -3013,7 +3158,7 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
3013
3158
|
(r) => r.tenantId === tenantId && r.objectId === objectId
|
|
3014
3159
|
);
|
|
3015
3160
|
const total = results.length;
|
|
3016
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3161
|
+
if (_optionalChain([options, 'optionalAccess', _44 => _44.limit])) {
|
|
3017
3162
|
results = results.slice(_nullishCoalesce(options.offset, () => ( 0)), (_nullishCoalesce(options.offset, () => ( 0))) + options.limit);
|
|
3018
3163
|
}
|
|
3019
3164
|
const records = results.map(({ tenantId: _t, ...r }) => r);
|
|
@@ -3029,7 +3174,7 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
3029
3174
|
);
|
|
3030
3175
|
});
|
|
3031
3176
|
const total = results.length;
|
|
3032
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3177
|
+
if (_optionalChain([options, 'optionalAccess', _45 => _45.limit])) {
|
|
3033
3178
|
results = results.slice(_nullishCoalesce(options.offset, () => ( 0)), (_nullishCoalesce(options.offset, () => ( 0))) + options.limit);
|
|
3034
3179
|
}
|
|
3035
3180
|
const records = results.map(({ tenantId: _t, ...r }) => r);
|
|
@@ -3045,7 +3190,7 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
3045
3190
|
}
|
|
3046
3191
|
}
|
|
3047
3192
|
const allowedObjectIds = /* @__PURE__ */ new Set();
|
|
3048
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3193
|
+
if (_optionalChain([options, 'optionalAccess', _46 => _46.objectNames]) && options.objectNames.length > 0) {
|
|
3049
3194
|
for (const obj of objectsMap.values()) {
|
|
3050
3195
|
if (options.objectNames.includes(obj.name)) {
|
|
3051
3196
|
allowedObjectIds.add(obj.id);
|
|
@@ -3064,7 +3209,7 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
3064
3209
|
);
|
|
3065
3210
|
});
|
|
3066
3211
|
const total = matchingRecords.length;
|
|
3067
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3212
|
+
if (_optionalChain([options, 'optionalAccess', _47 => _47.limit])) {
|
|
3068
3213
|
matchingRecords = matchingRecords.slice(
|
|
3069
3214
|
_nullishCoalesce(options.offset, () => ( 0)),
|
|
3070
3215
|
(_nullishCoalesce(options.offset, () => ( 0))) + options.limit
|
|
@@ -3075,11 +3220,11 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
3075
3220
|
if (!attributesByObjectId.has(attr.objectId)) {
|
|
3076
3221
|
attributesByObjectId.set(attr.objectId, []);
|
|
3077
3222
|
}
|
|
3078
|
-
_optionalChain([attributesByObjectId, 'access',
|
|
3223
|
+
_optionalChain([attributesByObjectId, 'access', _48 => _48.get, 'call', _49 => _49(attr.objectId), 'optionalAccess', _50 => _50.push, 'call', _51 => _51(attr)]);
|
|
3079
3224
|
}
|
|
3080
3225
|
const results = matchingRecords.map((r) => {
|
|
3081
3226
|
const obj = objectsMap.get(r.objectId);
|
|
3082
|
-
const labelExpression = _nullishCoalesce(_optionalChain([obj, 'optionalAccess',
|
|
3227
|
+
const labelExpression = _nullishCoalesce(_optionalChain([obj, 'optionalAccess', _52 => _52.labelExpression]), () => ( "{{ name }}"));
|
|
3083
3228
|
const dbAttrs = _nullishCoalesce(attributesByObjectId.get(r.objectId), () => ( []));
|
|
3084
3229
|
const attrs = dbAttrs.map((a) => ({
|
|
3085
3230
|
...a.config,
|
|
@@ -3089,11 +3234,11 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
3089
3234
|
label: _nullishCoalesce(a.config.label, () => ( a.name)),
|
|
3090
3235
|
required: _nullishCoalesce(a.config.required, () => ( false))
|
|
3091
3236
|
}));
|
|
3092
|
-
const enrichedValues =
|
|
3237
|
+
const enrichedValues = enrichValuesForDisplay(r.values, attrs);
|
|
3093
3238
|
return {
|
|
3094
3239
|
objectId: r.objectId,
|
|
3095
|
-
objectName: _nullishCoalesce(_optionalChain([obj, 'optionalAccess',
|
|
3096
|
-
objectLabel: _nullishCoalesce(_optionalChain([obj, 'optionalAccess',
|
|
3240
|
+
objectName: _nullishCoalesce(_optionalChain([obj, 'optionalAccess', _53 => _53.name]), () => ( "unknown")),
|
|
3241
|
+
objectLabel: _nullishCoalesce(_optionalChain([obj, 'optionalAccess', _54 => _54.label]), () => ( "Unknown")),
|
|
3097
3242
|
label: renderLabelExpression(labelExpression, enrichedValues),
|
|
3098
3243
|
recordId: r.id,
|
|
3099
3244
|
values: r.values,
|
|
@@ -3358,7 +3503,7 @@ function createMockPermissionsRepository(stores) {
|
|
|
3358
3503
|
},
|
|
3359
3504
|
deleteRole(roleId) {
|
|
3360
3505
|
const role = stores.roles.get(roleId);
|
|
3361
|
-
if (_optionalChain([role, 'optionalAccess',
|
|
3506
|
+
if (_optionalChain([role, 'optionalAccess', _55 => _55.system])) {
|
|
3362
3507
|
return Promise.reject(new Error(`Cannot delete system role ${roleId}`));
|
|
3363
3508
|
}
|
|
3364
3509
|
stores.roles.delete(roleId);
|
|
@@ -3600,7 +3745,7 @@ function createMockWorkflowInstancesRepository(stores) {
|
|
|
3600
3745
|
(i) => i.tenant_id === tenantId
|
|
3601
3746
|
);
|
|
3602
3747
|
const total = results.length;
|
|
3603
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3748
|
+
if (_optionalChain([options, 'optionalAccess', _56 => _56.limit])) {
|
|
3604
3749
|
results = results.slice(_nullishCoalesce(options.offset, () => ( 0)), (_nullishCoalesce(options.offset, () => ( 0))) + options.limit);
|
|
3605
3750
|
}
|
|
3606
3751
|
return Promise.resolve({ instances: results, total });
|
|
@@ -3628,7 +3773,7 @@ function createMockWorkflowInstancesRepository(stores) {
|
|
|
3628
3773
|
pending_action: _nullishCoalesce(data.pendingAction, () => ( null)),
|
|
3629
3774
|
error: null,
|
|
3630
3775
|
started_by: data.startedBy,
|
|
3631
|
-
expires_at: _nullishCoalesce(_optionalChain([data, 'access',
|
|
3776
|
+
expires_at: _nullishCoalesce(_optionalChain([data, 'access', _57 => _57.expiresAt, 'optionalAccess', _58 => _58.toISOString, 'call', _59 => _59()]), () => ( null)),
|
|
3632
3777
|
created_at: now,
|
|
3633
3778
|
updated_at: now,
|
|
3634
3779
|
completed_at: null
|
|
@@ -3649,8 +3794,8 @@ function createMockWorkflowInstancesRepository(stores) {
|
|
|
3649
3794
|
history: _nullishCoalesce(data.history, () => ( existing.history)),
|
|
3650
3795
|
pending_action: data.pendingAction !== void 0 ? data.pendingAction : existing.pending_action,
|
|
3651
3796
|
error: data.error !== void 0 ? data.error : existing.error,
|
|
3652
|
-
expires_at: data.expiresAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access',
|
|
3653
|
-
completed_at: data.completedAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access',
|
|
3797
|
+
expires_at: data.expiresAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access', _60 => _60.expiresAt, 'optionalAccess', _61 => _61.toISOString, 'call', _62 => _62()]), () => ( null)) : existing.expires_at,
|
|
3798
|
+
completed_at: data.completedAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access', _63 => _63.completedAt, 'optionalAccess', _64 => _64.toISOString, 'call', _65 => _65()]), () => ( null)) : existing.completed_at,
|
|
3654
3799
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3655
3800
|
};
|
|
3656
3801
|
stores.workflowInstances.set(id, updated);
|
|
@@ -3683,7 +3828,7 @@ function createMockWorkflowInstancesRepository(stores) {
|
|
|
3683
3828
|
pending_action: _nullishCoalesce(data.pendingAction, () => ( null)),
|
|
3684
3829
|
error: null,
|
|
3685
3830
|
started_by: data.startedBy,
|
|
3686
|
-
expires_at: _nullishCoalesce(_optionalChain([data, 'access',
|
|
3831
|
+
expires_at: _nullishCoalesce(_optionalChain([data, 'access', _66 => _66.expiresAt, 'optionalAccess', _67 => _67.toISOString, 'call', _68 => _68()]), () => ( null)),
|
|
3687
3832
|
created_at: now,
|
|
3688
3833
|
updated_at: now,
|
|
3689
3834
|
completed_at: null
|
|
@@ -3706,13 +3851,13 @@ function createMockWorkflowInstancesRepository(stores) {
|
|
|
3706
3851
|
return slotData.id === recordId;
|
|
3707
3852
|
});
|
|
3708
3853
|
});
|
|
3709
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3854
|
+
if (_optionalChain([options, 'optionalAccess', _69 => _69.status])) {
|
|
3710
3855
|
results = results.filter((i) => i.status === options.status);
|
|
3711
3856
|
}
|
|
3712
3857
|
const total = results.length;
|
|
3713
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3714
|
-
const start = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3715
|
-
const end = _optionalChain([options, 'optionalAccess',
|
|
3858
|
+
if (_optionalChain([options, 'optionalAccess', _70 => _70.offset]) !== void 0 || _optionalChain([options, 'optionalAccess', _71 => _71.limit]) !== void 0) {
|
|
3859
|
+
const start = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _72 => _72.offset]), () => ( 0));
|
|
3860
|
+
const end = _optionalChain([options, 'optionalAccess', _73 => _73.limit]) ? start + options.limit : void 0;
|
|
3716
3861
|
results = results.slice(start, end);
|
|
3717
3862
|
}
|
|
3718
3863
|
return Promise.resolve({ instances: results, total });
|
|
@@ -3775,8 +3920,8 @@ function createMockWorkflowParticipationsRepository(stores) {
|
|
|
3775
3920
|
...existing,
|
|
3776
3921
|
status: _nullishCoalesce(data.status, () => ( existing.status)),
|
|
3777
3922
|
auth: _nullishCoalesce(data.auth, () => ( existing.auth)),
|
|
3778
|
-
authenticated_at: data.authenticatedAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access',
|
|
3779
|
-
last_activity_at: data.lastActivityAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access',
|
|
3923
|
+
authenticated_at: data.authenticatedAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access', _74 => _74.authenticatedAt, 'optionalAccess', _75 => _75.toISOString, 'call', _76 => _76()]), () => ( null)) : existing.authenticated_at,
|
|
3924
|
+
last_activity_at: data.lastActivityAt !== void 0 ? _nullishCoalesce(_optionalChain([data, 'access', _77 => _77.lastActivityAt, 'optionalAccess', _78 => _78.toISOString, 'call', _79 => _79()]), () => ( null)) : existing.last_activity_at,
|
|
3780
3925
|
completed_node_ids: _nullishCoalesce(data.completedNodeIds, () => ( existing.completed_node_ids)),
|
|
3781
3926
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3782
3927
|
};
|
|
@@ -3963,7 +4108,7 @@ var notesPolicy = {
|
|
|
3963
4108
|
{ attribute: "visibility", operator: "is", value: "shared" },
|
|
3964
4109
|
{ attribute: "createdBy", operator: "is", value: ctx.userId }
|
|
3965
4110
|
];
|
|
3966
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
4111
|
+
if (!_optionalChain([options, 'optionalAccess', _80 => _80.filters]) || options.filters.rules.length === 0) {
|
|
3967
4112
|
return {
|
|
3968
4113
|
...options,
|
|
3969
4114
|
filters: { combinator: "or", rules: visibilityRules }
|
|
@@ -4077,6 +4222,20 @@ var TenantAwareRepository = class {
|
|
|
4077
4222
|
return getUserId();
|
|
4078
4223
|
}
|
|
4079
4224
|
};
|
|
4225
|
+
var SchemaContextAwareRepository = class extends TenantAwareRepository {
|
|
4226
|
+
/**
|
|
4227
|
+
* Get an ObjectDefinition from context by its ID.
|
|
4228
|
+
*/
|
|
4229
|
+
getSchemaFromContext(objectId) {
|
|
4230
|
+
return getSchemaFromContext(objectId);
|
|
4231
|
+
}
|
|
4232
|
+
/**
|
|
4233
|
+
* Get an ObjectDefinition from context by its name.
|
|
4234
|
+
*/
|
|
4235
|
+
getSchemaByNameFromContext(objectName) {
|
|
4236
|
+
return getSchemaByNameFromContext(objectName);
|
|
4237
|
+
}
|
|
4238
|
+
};
|
|
4080
4239
|
|
|
4081
4240
|
// src/runtime/services/audit.service.ts
|
|
4082
4241
|
var SENSITIVE_PATTERNS = [
|
|
@@ -4101,7 +4260,7 @@ var AuditService = class extends TenantAwareService {
|
|
|
4101
4260
|
this.isFlushing = false;
|
|
4102
4261
|
/** Pending flush promise to allow waiting on concurrent flush */
|
|
4103
4262
|
this.flushPromise = null;
|
|
4104
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4263
|
+
if (_optionalChain([options, 'optionalAccess', _81 => _81.async]) && options.flushIntervalMs) {
|
|
4105
4264
|
this.startFlushTimer();
|
|
4106
4265
|
}
|
|
4107
4266
|
}
|
|
@@ -4298,7 +4457,7 @@ var AuditService = class extends TenantAwareService {
|
|
|
4298
4457
|
if (!this.adapter.audit) {
|
|
4299
4458
|
return;
|
|
4300
4459
|
}
|
|
4301
|
-
if (_optionalChain([this, 'access',
|
|
4460
|
+
if (_optionalChain([this, 'access', _82 => _82.options, 'optionalAccess', _83 => _83.async])) {
|
|
4302
4461
|
this.buffer.push(entry);
|
|
4303
4462
|
const batchSize = _nullishCoalesce(this.options.batchSize, () => ( 10));
|
|
4304
4463
|
if (this.buffer.length >= batchSize) {
|
|
@@ -4312,7 +4471,7 @@ var AuditService = class extends TenantAwareService {
|
|
|
4312
4471
|
* Start the flush timer for async mode
|
|
4313
4472
|
*/
|
|
4314
4473
|
startFlushTimer() {
|
|
4315
|
-
const intervalMs = _nullishCoalesce(_optionalChain([this, 'access',
|
|
4474
|
+
const intervalMs = _nullishCoalesce(_optionalChain([this, 'access', _84 => _84.options, 'optionalAccess', _85 => _85.flushIntervalMs]), () => ( 1e3));
|
|
4316
4475
|
this.flushTimer = setInterval(() => {
|
|
4317
4476
|
this.flush().catch(console.error);
|
|
4318
4477
|
}, intervalMs);
|
|
@@ -4340,7 +4499,7 @@ var FileService = class extends TenantAwareService {
|
|
|
4340
4499
|
constructor(adapter, options) {
|
|
4341
4500
|
super();
|
|
4342
4501
|
this.adapter = adapter;
|
|
4343
|
-
this.auditService = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4502
|
+
this.auditService = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _86 => _86.auditService]), () => ( (adapter.audit ? new AuditService(adapter) : void 0)));
|
|
4344
4503
|
}
|
|
4345
4504
|
// ============================================================================
|
|
4346
4505
|
// UPLOAD (requires StorageAdapter)
|
|
@@ -4472,7 +4631,7 @@ var FileService = class extends TenantAwareService {
|
|
|
4472
4631
|
*/
|
|
4473
4632
|
async getFile(fileId) {
|
|
4474
4633
|
const file2 = await this.adapter.files.findById(fileId);
|
|
4475
|
-
if (_optionalChain([file2, 'optionalAccess',
|
|
4634
|
+
if (_optionalChain([file2, 'optionalAccess', _87 => _87.deletedAt])) {
|
|
4476
4635
|
return null;
|
|
4477
4636
|
}
|
|
4478
4637
|
return file2;
|
|
@@ -4534,12 +4693,12 @@ var FileService = class extends TenantAwareService {
|
|
|
4534
4693
|
*/
|
|
4535
4694
|
async deleteFile(fileId, options) {
|
|
4536
4695
|
const file2 = await this.getFileOrThrow(fileId);
|
|
4537
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4696
|
+
if (_optionalChain([options, 'optionalAccess', _88 => _88.checkOwnership]) && options.userId) {
|
|
4538
4697
|
if (file2.uploadedBy !== options.userId) {
|
|
4539
4698
|
throw new Error("You can only delete files you uploaded");
|
|
4540
4699
|
}
|
|
4541
4700
|
}
|
|
4542
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4701
|
+
if (_optionalChain([options, 'optionalAccess', _89 => _89.hard])) {
|
|
4543
4702
|
await this.adapter.files.hardDelete(fileId);
|
|
4544
4703
|
} else {
|
|
4545
4704
|
await this.adapter.files.delete(fileId);
|
|
@@ -4570,7 +4729,7 @@ var FileService = class extends TenantAwareService {
|
|
|
4570
4729
|
}
|
|
4571
4730
|
const file2 = await this.getFileOrThrow(fileId);
|
|
4572
4731
|
await this.adapter.storage.delete(file2.storagePath);
|
|
4573
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4732
|
+
if (_optionalChain([options, 'optionalAccess', _90 => _90.hard])) {
|
|
4574
4733
|
await this.adapter.files.hardDelete(fileId);
|
|
4575
4734
|
} else {
|
|
4576
4735
|
await this.adapter.files.delete(fileId);
|
|
@@ -4597,10 +4756,10 @@ var FileService = class extends TenantAwareService {
|
|
|
4597
4756
|
if (!file2) {
|
|
4598
4757
|
continue;
|
|
4599
4758
|
}
|
|
4600
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4759
|
+
if (_optionalChain([options, 'optionalAccess', _91 => _91.deleteFromStorage]) && this.adapter.storage) {
|
|
4601
4760
|
await this.adapter.storage.delete(file2.storagePath);
|
|
4602
4761
|
}
|
|
4603
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
4762
|
+
if (_optionalChain([options, 'optionalAccess', _92 => _92.hard])) {
|
|
4604
4763
|
await this.adapter.files.hardDelete(fileId);
|
|
4605
4764
|
} else {
|
|
4606
4765
|
await this.adapter.files.delete(fileId);
|
|
@@ -4611,7 +4770,7 @@ var FileService = class extends TenantAwareService {
|
|
|
4611
4770
|
actorId: this.userId,
|
|
4612
4771
|
fileId,
|
|
4613
4772
|
fileName: file2.name,
|
|
4614
|
-
metadata: { deletedFromStorage: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4773
|
+
metadata: { deletedFromStorage: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _93 => _93.deleteFromStorage]), () => ( false)) }
|
|
4615
4774
|
});
|
|
4616
4775
|
}
|
|
4617
4776
|
}
|
|
@@ -4695,7 +4854,7 @@ var FileService = class extends TenantAwareService {
|
|
|
4695
4854
|
return true;
|
|
4696
4855
|
}
|
|
4697
4856
|
if (file2.visibility === "restricted") {
|
|
4698
|
-
return _nullishCoalesce(_optionalChain([file2, 'access',
|
|
4857
|
+
return _nullishCoalesce(_optionalChain([file2, 'access', _94 => _94.allowedUsers, 'optionalAccess', _95 => _95.includes, 'call', _96 => _96(userId)]), () => ( false));
|
|
4699
4858
|
}
|
|
4700
4859
|
return false;
|
|
4701
4860
|
}
|
|
@@ -4850,10 +5009,10 @@ var GlobalSearchService = class extends TenantAwareService {
|
|
|
4850
5009
|
return { results: [], total: 0 };
|
|
4851
5010
|
}
|
|
4852
5011
|
return await this.adapter.objectRecords.globalSearch(query.trim(), {
|
|
4853
|
-
limit: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4854
|
-
offset: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4855
|
-
objectNames: _optionalChain([options, 'optionalAccess',
|
|
4856
|
-
includeObjectInfo: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
5012
|
+
limit: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _97 => _97.limit]), () => ( 20)),
|
|
5013
|
+
offset: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _98 => _98.offset]), () => ( 0)),
|
|
5014
|
+
objectNames: _optionalChain([options, 'optionalAccess', _99 => _99.objectNames]),
|
|
5015
|
+
includeObjectInfo: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _100 => _100.includeObjectInfo]), () => ( true))
|
|
4857
5016
|
});
|
|
4858
5017
|
}
|
|
4859
5018
|
/**
|
|
@@ -4970,17 +5129,17 @@ function validateOptions(options, attributeName) {
|
|
|
4970
5129
|
const ids = /* @__PURE__ */ new Set();
|
|
4971
5130
|
const values = /* @__PURE__ */ new Set();
|
|
4972
5131
|
for (const option of options) {
|
|
4973
|
-
if (!_optionalChain([option, 'access',
|
|
5132
|
+
if (!_optionalChain([option, 'access', _101 => _101.id, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103()])) {
|
|
4974
5133
|
throw new Error(
|
|
4975
5134
|
`[AttributeBuilder] Option in "${attributeName}" has an empty or missing id.`
|
|
4976
5135
|
);
|
|
4977
5136
|
}
|
|
4978
|
-
if (!_optionalChain([option, 'access',
|
|
5137
|
+
if (!_optionalChain([option, 'access', _104 => _104.value, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()])) {
|
|
4979
5138
|
throw new Error(
|
|
4980
5139
|
`[AttributeBuilder] Option "${option.id}" in "${attributeName}" has an empty or missing value.`
|
|
4981
5140
|
);
|
|
4982
5141
|
}
|
|
4983
|
-
if (!_optionalChain([option, 'access',
|
|
5142
|
+
if (!_optionalChain([option, 'access', _107 => _107.label, 'optionalAccess', _108 => _108.trim, 'call', _109 => _109()])) {
|
|
4984
5143
|
throw new Error(
|
|
4985
5144
|
`[AttributeBuilder] Option "${option.id}" in "${attributeName}" has an empty or missing label.`
|
|
4986
5145
|
);
|
|
@@ -5501,7 +5660,7 @@ var SingleRelationAttributeBuilder = class extends BaseAttributeBuilder {
|
|
|
5501
5660
|
object: objectName,
|
|
5502
5661
|
...options
|
|
5503
5662
|
};
|
|
5504
|
-
_optionalChain([this, 'access',
|
|
5663
|
+
_optionalChain([this, 'access', _110 => _110.attr, 'access', _111 => _111.targets, 'optionalAccess', _112 => _112.push, 'call', _113 => _113(target)]);
|
|
5505
5664
|
return this;
|
|
5506
5665
|
}
|
|
5507
5666
|
/**
|
|
@@ -5546,9 +5705,9 @@ var MultiRelationAttributeBuilder = class extends BaseAttributeBuilder {
|
|
|
5546
5705
|
constructor(name, label, initOptions) {
|
|
5547
5706
|
super("relation", name, label);
|
|
5548
5707
|
this.attr.cardinality = "many";
|
|
5549
|
-
this.attr.targets = _nullishCoalesce(_optionalChain([initOptions, 'optionalAccess',
|
|
5708
|
+
this.attr.targets = _nullishCoalesce(_optionalChain([initOptions, 'optionalAccess', _114 => _114.targets]), () => ( []));
|
|
5550
5709
|
this.attr.defaultValue = [];
|
|
5551
|
-
if (_optionalChain([initOptions, 'optionalAccess',
|
|
5710
|
+
if (_optionalChain([initOptions, 'optionalAccess', _115 => _115.isRequired])) {
|
|
5552
5711
|
this.setRequired(true);
|
|
5553
5712
|
}
|
|
5554
5713
|
}
|
|
@@ -5562,7 +5721,7 @@ var MultiRelationAttributeBuilder = class extends BaseAttributeBuilder {
|
|
|
5562
5721
|
object: objectName,
|
|
5563
5722
|
...options
|
|
5564
5723
|
};
|
|
5565
|
-
_optionalChain([this, 'access',
|
|
5724
|
+
_optionalChain([this, 'access', _116 => _116.attr, 'access', _117 => _117.targets, 'optionalAccess', _118 => _118.push, 'call', _119 => _119(target)]);
|
|
5566
5725
|
return this;
|
|
5567
5726
|
}
|
|
5568
5727
|
/**
|
|
@@ -5936,7 +6095,7 @@ var GroupBuilder = class {
|
|
|
5936
6095
|
*/
|
|
5937
6096
|
fields(...names) {
|
|
5938
6097
|
for (const name of names) {
|
|
5939
|
-
_optionalChain([this, 'access',
|
|
6098
|
+
_optionalChain([this, 'access', _120 => _120.data, 'access', _121 => _121.fields, 'optionalAccess', _122 => _122.push, 'call', _123 => _123({ attribute: name })]);
|
|
5940
6099
|
}
|
|
5941
6100
|
return this;
|
|
5942
6101
|
}
|
|
@@ -5945,7 +6104,7 @@ var GroupBuilder = class {
|
|
|
5945
6104
|
* @example .field("name", { span: 8, readOnly: true })
|
|
5946
6105
|
*/
|
|
5947
6106
|
field(attribute, options) {
|
|
5948
|
-
_optionalChain([this, 'access',
|
|
6107
|
+
_optionalChain([this, 'access', _124 => _124.data, 'access', _125 => _125.fields, 'optionalAccess', _126 => _126.push, 'call', _127 => _127({ attribute, ...options })]);
|
|
5949
6108
|
return this;
|
|
5950
6109
|
}
|
|
5951
6110
|
/**
|
|
@@ -5954,7 +6113,7 @@ var GroupBuilder = class {
|
|
|
5954
6113
|
* @example .attributeGroup({ id: "address", label: "Address", attributes: ["street", "city", "postal_code"], displayTemplate: "{street}, {city}" })
|
|
5955
6114
|
*/
|
|
5956
6115
|
attributeGroup(config, options) {
|
|
5957
|
-
_optionalChain([this, 'access',
|
|
6116
|
+
_optionalChain([this, 'access', _128 => _128.data, 'access', _129 => _129.fields, 'optionalAccess', _130 => _130.push, 'call', _131 => _131({ attributeGroup: config, ...options })]);
|
|
5958
6117
|
return this;
|
|
5959
6118
|
}
|
|
5960
6119
|
/**
|
|
@@ -6446,14 +6605,14 @@ var ViewBuilder = class {
|
|
|
6446
6605
|
* Add a pre-built tab
|
|
6447
6606
|
*/
|
|
6448
6607
|
addTab(tab) {
|
|
6449
|
-
_optionalChain([this, 'access',
|
|
6608
|
+
_optionalChain([this, 'access', _132 => _132.data, 'access', _133 => _133.tabs, 'optionalAccess', _134 => _134.push, 'call', _135 => _135(tab)]);
|
|
6450
6609
|
return this;
|
|
6451
6610
|
}
|
|
6452
6611
|
/**
|
|
6453
6612
|
* @internal Used by TabBuilder to add tabs
|
|
6454
6613
|
*/
|
|
6455
6614
|
_addTab(tab) {
|
|
6456
|
-
_optionalChain([this, 'access',
|
|
6615
|
+
_optionalChain([this, 'access', _136 => _136.data, 'access', _137 => _137.tabs, 'optionalAccess', _138 => _138.push, 'call', _139 => _139(tab)]);
|
|
6457
6616
|
return this;
|
|
6458
6617
|
}
|
|
6459
6618
|
/**
|
|
@@ -6531,8 +6690,8 @@ var WorkflowFormRowBuilder = class {
|
|
|
6531
6690
|
id: `${this.rowData.id}-${slotId}-${attribute}`,
|
|
6532
6691
|
slotId,
|
|
6533
6692
|
attribute,
|
|
6534
|
-
label: _optionalChain([options, 'optionalAccess',
|
|
6535
|
-
required: _optionalChain([options, 'optionalAccess',
|
|
6693
|
+
label: _optionalChain([options, 'optionalAccess', _140 => _140.label]),
|
|
6694
|
+
required: _optionalChain([options, 'optionalAccess', _141 => _141.required])
|
|
6536
6695
|
};
|
|
6537
6696
|
this.rowData.fields.push(field);
|
|
6538
6697
|
return this;
|
|
@@ -6897,7 +7056,7 @@ var WorkflowBuilder = class {
|
|
|
6897
7056
|
* @param options - Slot configuration
|
|
6898
7057
|
*/
|
|
6899
7058
|
slot(id, objectName, options) {
|
|
6900
|
-
if (_optionalChain([this, 'access',
|
|
7059
|
+
if (_optionalChain([this, 'access', _142 => _142.data, 'access', _143 => _143.slots, 'optionalAccess', _144 => _144.some, 'call', _145 => _145((s) => s.id === id)])) {
|
|
6901
7060
|
throw new Error(`[WorkflowBuilder] Duplicate slot id: "${id}"`);
|
|
6902
7061
|
}
|
|
6903
7062
|
const slot = {
|
|
@@ -6908,7 +7067,7 @@ var WorkflowBuilder = class {
|
|
|
6908
7067
|
color: options.color,
|
|
6909
7068
|
icon: options.icon
|
|
6910
7069
|
};
|
|
6911
|
-
_optionalChain([this, 'access',
|
|
7070
|
+
_optionalChain([this, 'access', _146 => _146.data, 'access', _147 => _147.slots, 'optionalAccess', _148 => _148.push, 'call', _149 => _149(slot)]);
|
|
6912
7071
|
return this;
|
|
6913
7072
|
}
|
|
6914
7073
|
// ============================================================================
|
|
@@ -6922,7 +7081,7 @@ var WorkflowBuilder = class {
|
|
|
6922
7081
|
}
|
|
6923
7082
|
/** @internal */
|
|
6924
7083
|
_addParticipant(template) {
|
|
6925
|
-
_optionalChain([this, 'access',
|
|
7084
|
+
_optionalChain([this, 'access', _150 => _150.data, 'access', _151 => _151.participants, 'optionalAccess', _152 => _152.push, 'call', _153 => _153(template)]);
|
|
6926
7085
|
return this;
|
|
6927
7086
|
}
|
|
6928
7087
|
// ============================================================================
|
|
@@ -7055,7 +7214,7 @@ var WorkflowBuilder = class {
|
|
|
7055
7214
|
}
|
|
7056
7215
|
}
|
|
7057
7216
|
validateSlotReferences() {
|
|
7058
|
-
const slotIds = new Set(_nullishCoalesce(_optionalChain([this, 'access',
|
|
7217
|
+
const slotIds = new Set(_nullishCoalesce(_optionalChain([this, 'access', _154 => _154.data, 'access', _155 => _155.slots, 'optionalAccess', _156 => _156.map, 'call', _157 => _157((s) => s.id)]), () => ( [])));
|
|
7059
7218
|
for (const node of Object.values(_nullishCoalesce(this.data.nodes, () => ( {})))) {
|
|
7060
7219
|
if (node.type === "form") {
|
|
7061
7220
|
const referencedSlots = /* @__PURE__ */ new Set();
|
|
@@ -7082,7 +7241,7 @@ var WorkflowBuilder = class {
|
|
|
7082
7241
|
}
|
|
7083
7242
|
}
|
|
7084
7243
|
validateParticipantReferences() {
|
|
7085
|
-
const participantIds = new Set(_nullishCoalesce(_optionalChain([this, 'access',
|
|
7244
|
+
const participantIds = new Set(_nullishCoalesce(_optionalChain([this, 'access', _158 => _158.data, 'access', _159 => _159.participants, 'optionalAccess', _160 => _160.map, 'call', _161 => _161((p) => p.id)]), () => ( [])));
|
|
7086
7245
|
for (const node of Object.values(_nullishCoalesce(this.data.nodes, () => ( {})))) {
|
|
7087
7246
|
if (node.type === "form" && node.participantId) {
|
|
7088
7247
|
if (!participantIds.has(node.participantId)) {
|
|
@@ -7659,21 +7818,32 @@ function createAttributeValidator(attr, messages = DEFAULT_VALIDATION_MESSAGES)
|
|
|
7659
7818
|
return _zod.z.unknown();
|
|
7660
7819
|
}
|
|
7661
7820
|
}
|
|
7821
|
+
function isEmptyValue(value) {
|
|
7822
|
+
if (value === null || value === void 0) return true;
|
|
7823
|
+
if (typeof value === "string" && value.trim() === "") return true;
|
|
7824
|
+
if (value instanceof Date) return false;
|
|
7825
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
7826
|
+
return Object.values(value).every(
|
|
7827
|
+
(v) => v === null || v === void 0 || typeof v === "string" && v.trim() === ""
|
|
7828
|
+
);
|
|
7829
|
+
}
|
|
7830
|
+
return false;
|
|
7831
|
+
}
|
|
7832
|
+
function withEmptyToNull(validator) {
|
|
7833
|
+
return _zod.z.preprocess((val) => isEmptyValue(val) ? null : val, validator.nullish());
|
|
7834
|
+
}
|
|
7662
7835
|
function createFormAttributeValidator(attr, messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7663
7836
|
const validator = createAttributeValidator(attr, messages);
|
|
7664
7837
|
if (!attr.required) {
|
|
7665
|
-
return validator
|
|
7838
|
+
return withEmptyToNull(validator);
|
|
7666
7839
|
}
|
|
7667
7840
|
return validator;
|
|
7668
7841
|
}
|
|
7669
7842
|
function createObjectValidator(objectDef) {
|
|
7670
7843
|
const shape = {};
|
|
7671
7844
|
for (const attr of objectDef.attributes) {
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
validator = validator.optional();
|
|
7675
|
-
}
|
|
7676
|
-
shape[attr.name] = validator;
|
|
7845
|
+
const validator = createAttributeValidator(attr);
|
|
7846
|
+
shape[attr.name] = attr.required ? validator : withEmptyToNull(validator);
|
|
7677
7847
|
}
|
|
7678
7848
|
return _zod.z.object(shape).strict();
|
|
7679
7849
|
}
|
|
@@ -7717,7 +7887,7 @@ function validateObject(objectDef, data) {
|
|
|
7717
7887
|
function validateObjectOrThrow(objectDef, data) {
|
|
7718
7888
|
const result = validateObject(objectDef, data);
|
|
7719
7889
|
if (!result.success) {
|
|
7720
|
-
const errorMessages = _optionalChain([result, 'access',
|
|
7890
|
+
const errorMessages = _optionalChain([result, 'access', _162 => _162.errors, 'optionalAccess', _163 => _163.map, 'call', _164 => _164((err) => `${err.path.join(".")}: ${err.message}`), 'access', _165 => _165.join, 'call', _166 => _166("\n")]) || "Unknown validation error";
|
|
7721
7891
|
throw new Error(`Validation failed for ${objectDef.label}:
|
|
7722
7892
|
${errorMessages}`);
|
|
7723
7893
|
}
|
|
@@ -7726,8 +7896,8 @@ ${errorMessages}`);
|
|
|
7726
7896
|
function createDraftValidator(objectDef) {
|
|
7727
7897
|
const shape = {};
|
|
7728
7898
|
for (const attr of objectDef.attributes) {
|
|
7729
|
-
const validator = createAttributeValidator(attr)
|
|
7730
|
-
shape[attr.name] = validator;
|
|
7899
|
+
const validator = createAttributeValidator(attr);
|
|
7900
|
+
shape[attr.name] = withEmptyToNull(validator);
|
|
7731
7901
|
}
|
|
7732
7902
|
return _zod.z.object(shape).strict();
|
|
7733
7903
|
}
|
|
@@ -7751,7 +7921,7 @@ function validateDraft(objectDef, data) {
|
|
|
7751
7921
|
function validateDraftOrThrow(objectDef, data) {
|
|
7752
7922
|
const result = validateDraft(objectDef, data);
|
|
7753
7923
|
if (!result.success) {
|
|
7754
|
-
const errorMessages = _optionalChain([result, 'access',
|
|
7924
|
+
const errorMessages = _optionalChain([result, 'access', _167 => _167.errors, 'optionalAccess', _168 => _168.map, 'call', _169 => _169((err) => `${err.path.join(".")}: ${err.message}`), 'access', _170 => _170.join, 'call', _171 => _171("\n")]) || "Unknown validation error";
|
|
7755
7925
|
throw new Error(`Draft validation failed for ${objectDef.label}:
|
|
7756
7926
|
${errorMessages}`);
|
|
7757
7927
|
}
|
|
@@ -7793,8 +7963,8 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
7793
7963
|
super();
|
|
7794
7964
|
this.adapter = adapter;
|
|
7795
7965
|
this.nativeRegistry = nativeRegistry;
|
|
7796
|
-
this.auditService = _optionalChain([options, 'optionalAccess',
|
|
7797
|
-
this.cache = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7966
|
+
this.auditService = _optionalChain([options, 'optionalAccess', _172 => _172.auditService]);
|
|
7967
|
+
this.cache = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _173 => _173.cache]), () => ( adapter.cache));
|
|
7798
7968
|
}
|
|
7799
7969
|
/**
|
|
7800
7970
|
* Create a new custom object.
|
|
@@ -7992,7 +8162,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
7992
8162
|
resourceType: "attribute",
|
|
7993
8163
|
resourceId: attributeId,
|
|
7994
8164
|
resourceLabel: updatedDbAttr.label,
|
|
7995
|
-
objectName: _optionalChain([dbObject, 'optionalAccess',
|
|
8165
|
+
objectName: _optionalChain([dbObject, 'optionalAccess', _174 => _174.name]),
|
|
7996
8166
|
objectId: dbAttr.objectId,
|
|
7997
8167
|
changes
|
|
7998
8168
|
});
|
|
@@ -8025,7 +8195,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
8025
8195
|
);
|
|
8026
8196
|
}
|
|
8027
8197
|
const dbObject = await this.adapter.objects.findById(dbAttr.objectId);
|
|
8028
|
-
if (_optionalChain([dbObject, 'optionalAccess',
|
|
8198
|
+
if (_optionalChain([dbObject, 'optionalAccess', _175 => _175.labelExpression])) {
|
|
8029
8199
|
const usedAttributes = extractAttributeNames(dbObject.labelExpression);
|
|
8030
8200
|
if (usedAttributes.includes(dbAttr.name)) {
|
|
8031
8201
|
throw new AttributeInUseError(dbAttr.name, "labelExpression");
|
|
@@ -8041,7 +8211,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
8041
8211
|
resourceType: "attribute",
|
|
8042
8212
|
resourceId: attributeId,
|
|
8043
8213
|
resourceLabel: dbAttr.label,
|
|
8044
|
-
objectName: _optionalChain([dbObject, 'optionalAccess',
|
|
8214
|
+
objectName: _optionalChain([dbObject, 'optionalAccess', _176 => _176.name]),
|
|
8045
8215
|
objectId: dbAttr.objectId
|
|
8046
8216
|
});
|
|
8047
8217
|
}
|
|
@@ -8056,9 +8226,9 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
8056
8226
|
async listAttributes(objectId, options) {
|
|
8057
8227
|
const dbAttributes = await this.adapter.attributes.findByObjectId(objectId);
|
|
8058
8228
|
let filtered = dbAttributes;
|
|
8059
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
8229
|
+
if (_optionalChain([options, 'optionalAccess', _177 => _177.systemOnly])) {
|
|
8060
8230
|
filtered = dbAttributes.filter((attr) => attr.system);
|
|
8061
|
-
} else if (_optionalChain([options, 'optionalAccess',
|
|
8231
|
+
} else if (_optionalChain([options, 'optionalAccess', _178 => _178.customOnly])) {
|
|
8062
8232
|
filtered = dbAttributes.filter((attr) => !attr.system);
|
|
8063
8233
|
}
|
|
8064
8234
|
return filtered.map((attr) => this.convertDBAttributeToAttribute(attr));
|
|
@@ -8094,14 +8264,14 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
8094
8264
|
pluralLabel: dbObject.pluralLabel,
|
|
8095
8265
|
description: dbObject.description,
|
|
8096
8266
|
labelExpression: dbObject.labelExpression,
|
|
8097
|
-
icon: _optionalChain([dbObject, 'access',
|
|
8267
|
+
icon: _optionalChain([dbObject, 'access', _179 => _179.metadata, 'optionalAccess', _180 => _180.icon])
|
|
8098
8268
|
};
|
|
8099
8269
|
let metadata = dbObject.metadata;
|
|
8100
8270
|
if (updates.icon !== void 0 || updates.metadata !== void 0) {
|
|
8101
8271
|
metadata = {
|
|
8102
8272
|
...dbObject.metadata,
|
|
8103
8273
|
...updates.metadata,
|
|
8104
|
-
icon: _nullishCoalesce(updates.icon, () => ( _optionalChain([dbObject, 'access',
|
|
8274
|
+
icon: _nullishCoalesce(updates.icon, () => ( _optionalChain([dbObject, 'access', _181 => _181.metadata, 'optionalAccess', _182 => _182.icon])))
|
|
8105
8275
|
};
|
|
8106
8276
|
}
|
|
8107
8277
|
const updatedDbObject = await this.adapter.objects.update(objectId, {
|
|
@@ -8391,7 +8561,7 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
8391
8561
|
label: dbObject.label,
|
|
8392
8562
|
pluralLabel: dbObject.pluralLabel,
|
|
8393
8563
|
description: dbObject.description,
|
|
8394
|
-
icon: _optionalChain([dbObject, 'access',
|
|
8564
|
+
icon: _optionalChain([dbObject, 'access', _183 => _183.metadata, 'optionalAccess', _184 => _184.icon]),
|
|
8395
8565
|
labelExpression: dbObject.labelExpression,
|
|
8396
8566
|
attributes,
|
|
8397
8567
|
system: dbObject.system,
|
|
@@ -8491,7 +8661,7 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
8491
8661
|
const hasRelationToTarget = attrs.some((attr) => {
|
|
8492
8662
|
if (attr.type !== "relation") return false;
|
|
8493
8663
|
const config = attr.config;
|
|
8494
|
-
return _nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
8664
|
+
return _nullishCoalesce(_optionalChain([config, 'optionalAccess', _185 => _185.targets, 'optionalAccess', _186 => _186.some, 'call', _187 => _187((t) => t.object === targetObjectName)]), () => ( false));
|
|
8495
8665
|
});
|
|
8496
8666
|
if (hasRelationToTarget) {
|
|
8497
8667
|
referencing.push(obj.name);
|
|
@@ -8641,7 +8811,7 @@ var SyncError = class extends SchemaError {
|
|
|
8641
8811
|
constructor(objectName, message, cause) {
|
|
8642
8812
|
super(`Failed to sync object "${objectName}": ${message}`, SchemaErrorCode.SYNC_FAILED, {
|
|
8643
8813
|
objectName,
|
|
8644
|
-
cause: _optionalChain([cause, 'optionalAccess',
|
|
8814
|
+
cause: _optionalChain([cause, 'optionalAccess', _188 => _188.message])
|
|
8645
8815
|
});
|
|
8646
8816
|
this.name = "SyncError";
|
|
8647
8817
|
this.objectName = objectName;
|
|
@@ -8729,8 +8899,8 @@ var PermissionService = class extends TenantAwareService {
|
|
|
8729
8899
|
);
|
|
8730
8900
|
}
|
|
8731
8901
|
this.permissionsRepo = adapter.permissions;
|
|
8732
|
-
this.cache = _nullishCoalesce(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
8733
|
-
this.auditService = _optionalChain([options, 'optionalAccess',
|
|
8902
|
+
this.cache = _nullishCoalesce(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _189 => _189.cache]), () => ( adapter.cache)), () => ( new NoopCacheAdapter()));
|
|
8903
|
+
this.auditService = _optionalChain([options, 'optionalAccess', _190 => _190.auditService]);
|
|
8734
8904
|
}
|
|
8735
8905
|
// ============================================================================
|
|
8736
8906
|
// PERMISSION CHECKS
|
|
@@ -8749,11 +8919,11 @@ var PermissionService = class extends TenantAwareService {
|
|
|
8749
8919
|
return true;
|
|
8750
8920
|
}
|
|
8751
8921
|
const wildcardPerms = permissions.objectPermissions["*"];
|
|
8752
|
-
if (_optionalChain([wildcardPerms, 'optionalAccess',
|
|
8922
|
+
if (_optionalChain([wildcardPerms, 'optionalAccess', _191 => _191.includes, 'call', _192 => _192(action)])) {
|
|
8753
8923
|
return true;
|
|
8754
8924
|
}
|
|
8755
8925
|
const objectPerms = permissions.objectPermissions[objectName];
|
|
8756
|
-
return _nullishCoalesce(_optionalChain([objectPerms, 'optionalAccess',
|
|
8926
|
+
return _nullishCoalesce(_optionalChain([objectPerms, 'optionalAccess', _193 => _193.includes, 'call', _194 => _194(action)]), () => ( false));
|
|
8757
8927
|
}
|
|
8758
8928
|
/**
|
|
8759
8929
|
* Check if user can access an object, throw ForbiddenError if not.
|
|
@@ -8808,12 +8978,12 @@ var PermissionService = class extends TenantAwareService {
|
|
|
8808
8978
|
if (permissions.isAdmin) {
|
|
8809
8979
|
return true;
|
|
8810
8980
|
}
|
|
8811
|
-
const wildcardPerms = _optionalChain([permissions, 'access',
|
|
8812
|
-
if (_optionalChain([wildcardPerms, 'optionalAccess',
|
|
8981
|
+
const wildcardPerms = _optionalChain([permissions, 'access', _195 => _195.systemPermissions, 'optionalAccess', _196 => _196["*"]]);
|
|
8982
|
+
if (_optionalChain([wildcardPerms, 'optionalAccess', _197 => _197.includes, 'call', _198 => _198(action)])) {
|
|
8813
8983
|
return true;
|
|
8814
8984
|
}
|
|
8815
|
-
const resourcePerms = _optionalChain([permissions, 'access',
|
|
8816
|
-
return _nullishCoalesce(_optionalChain([resourcePerms, 'optionalAccess',
|
|
8985
|
+
const resourcePerms = _optionalChain([permissions, 'access', _199 => _199.systemPermissions, 'optionalAccess', _200 => _200[resource]]);
|
|
8986
|
+
return _nullishCoalesce(_optionalChain([resourcePerms, 'optionalAccess', _201 => _201.includes, 'call', _202 => _202(action)]), () => ( false));
|
|
8817
8987
|
}
|
|
8818
8988
|
/**
|
|
8819
8989
|
* Check if user can access a system resource, throw ForbiddenError if not.
|
|
@@ -8842,8 +9012,8 @@ var PermissionService = class extends TenantAwareService {
|
|
|
8842
9012
|
if (permissions.isAdmin) {
|
|
8843
9013
|
return { canRead: true, canCreate: true, canUpdate: true, canDelete: true };
|
|
8844
9014
|
}
|
|
8845
|
-
const wildcardPerms = _nullishCoalesce(_optionalChain([permissions, 'access',
|
|
8846
|
-
const resourcePerms = _nullishCoalesce(_optionalChain([permissions, 'access',
|
|
9015
|
+
const wildcardPerms = _nullishCoalesce(_optionalChain([permissions, 'access', _203 => _203.systemPermissions, 'optionalAccess', _204 => _204["*"]]), () => ( []));
|
|
9016
|
+
const resourcePerms = _nullishCoalesce(_optionalChain([permissions, 'access', _205 => _205.systemPermissions, 'optionalAccess', _206 => _206[resource]]), () => ( []));
|
|
8847
9017
|
const allPerms = /* @__PURE__ */ new Set([...wildcardPerms, ...resourcePerms]);
|
|
8848
9018
|
return {
|
|
8849
9019
|
canRead: allPerms.has("read"),
|
|
@@ -8985,7 +9155,7 @@ var PermissionService = class extends TenantAwareService {
|
|
|
8985
9155
|
action: "role.updated",
|
|
8986
9156
|
actorId: this.userId,
|
|
8987
9157
|
roleId,
|
|
8988
|
-
roleLabel: _nullishCoalesce(_optionalChain([role, 'optionalAccess',
|
|
9158
|
+
roleLabel: _nullishCoalesce(_optionalChain([role, 'optionalAccess', _207 => _207.label]), () => ( roleId)),
|
|
8989
9159
|
metadata: { permissionsUpdated: true, permissionCount: permissions.length }
|
|
8990
9160
|
});
|
|
8991
9161
|
}
|
|
@@ -9015,7 +9185,7 @@ var PermissionService = class extends TenantAwareService {
|
|
|
9015
9185
|
action: "role.assigned",
|
|
9016
9186
|
actorId: this.userId,
|
|
9017
9187
|
roleId,
|
|
9018
|
-
roleLabel: _nullishCoalesce(_optionalChain([role, 'optionalAccess',
|
|
9188
|
+
roleLabel: _nullishCoalesce(_optionalChain([role, 'optionalAccess', _208 => _208.label]), () => ( roleId)),
|
|
9019
9189
|
targetUserId: userProfileId
|
|
9020
9190
|
});
|
|
9021
9191
|
}
|
|
@@ -9033,7 +9203,7 @@ var PermissionService = class extends TenantAwareService {
|
|
|
9033
9203
|
action: "role.revoked",
|
|
9034
9204
|
actorId: this.userId,
|
|
9035
9205
|
roleId,
|
|
9036
|
-
roleLabel: _nullishCoalesce(_optionalChain([role, 'optionalAccess',
|
|
9206
|
+
roleLabel: _nullishCoalesce(_optionalChain([role, 'optionalAccess', _209 => _209.label]), () => ( roleId)),
|
|
9037
9207
|
targetUserId: userProfileId
|
|
9038
9208
|
});
|
|
9039
9209
|
}
|
|
@@ -9150,7 +9320,7 @@ Native objects must have system=true. Did you forget to call .system() in your b
|
|
|
9150
9320
|
const existing = this.objects.get(object2.name);
|
|
9151
9321
|
throw new Error(
|
|
9152
9322
|
`[NativeObjectRegistry] Duplicate object name "${object2.name}":
|
|
9153
|
-
- Existing: "${_optionalChain([existing, 'optionalAccess',
|
|
9323
|
+
- Existing: "${_optionalChain([existing, 'optionalAccess', _210 => _210.label])}" (id: ${_optionalChain([existing, 'optionalAccess', _211 => _211.id])})
|
|
9154
9324
|
- New: "${object2.label}" (id: ${object2.id})
|
|
9155
9325
|
Please use unique names for each native object.`
|
|
9156
9326
|
);
|
|
@@ -9250,7 +9420,7 @@ var RelationService = class extends TenantAwareService {
|
|
|
9250
9420
|
constructor(adapter, nativeRegistry, options) {
|
|
9251
9421
|
super();
|
|
9252
9422
|
this.adapter = adapter;
|
|
9253
|
-
this.cache = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
9423
|
+
this.cache = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _212 => _212.cache]), () => ( adapter.cache));
|
|
9254
9424
|
this.schemaService = new ObjectSchemaService(adapter, nativeRegistry, { cache: this.cache });
|
|
9255
9425
|
}
|
|
9256
9426
|
/**
|
|
@@ -9293,6 +9463,8 @@ var RelationService = class extends TenantAwareService {
|
|
|
9293
9463
|
}
|
|
9294
9464
|
/**
|
|
9295
9465
|
* Validate a single relation attribute value
|
|
9466
|
+
*
|
|
9467
|
+
* Uses batch fetching (findByIds) to avoid N+1 query pattern.
|
|
9296
9468
|
*/
|
|
9297
9469
|
async validateRelationAttribute(attr, value) {
|
|
9298
9470
|
const errors = [];
|
|
@@ -9302,16 +9474,18 @@ var RelationService = class extends TenantAwareService {
|
|
|
9302
9474
|
}
|
|
9303
9475
|
const isUniversal = attr.targets.length === 1 && attr.targets[0].object === RELATION_TARGET_ANY;
|
|
9304
9476
|
const validObjectIds = isUniversal ? null : await this.getValidObjectIds(attr.targets);
|
|
9305
|
-
if (!isUniversal && _optionalChain([validObjectIds, 'optionalAccess',
|
|
9477
|
+
if (!isUniversal && _optionalChain([validObjectIds, 'optionalAccess', _213 => _213.size]) === 0) {
|
|
9306
9478
|
errors.push({
|
|
9307
9479
|
attribute: attr.name,
|
|
9308
9480
|
message: `No valid target objects found for ${attr.label}`
|
|
9309
9481
|
});
|
|
9310
9482
|
return errors;
|
|
9311
9483
|
}
|
|
9484
|
+
const records = await this.adapter.objectRecords.findByIds(ids);
|
|
9485
|
+
const recordMap = new Map(records.map((r) => [r.id, r]));
|
|
9312
9486
|
const invalidIds = [];
|
|
9313
9487
|
for (const id of ids) {
|
|
9314
|
-
const record =
|
|
9488
|
+
const record = recordMap.get(id);
|
|
9315
9489
|
if (!record) {
|
|
9316
9490
|
invalidIds.push(id);
|
|
9317
9491
|
continue;
|
|
@@ -9353,10 +9527,10 @@ var RelationService = class extends TenantAwareService {
|
|
|
9353
9527
|
for (const target of targets) {
|
|
9354
9528
|
try {
|
|
9355
9529
|
const objectSchema = await this.schemaService.getObjectSchemaByName(target.object);
|
|
9356
|
-
if (_optionalChain([objectSchema, 'optionalAccess',
|
|
9530
|
+
if (_optionalChain([objectSchema, 'optionalAccess', _214 => _214.id])) {
|
|
9357
9531
|
objectIds.add(objectSchema.id);
|
|
9358
9532
|
}
|
|
9359
|
-
} catch (
|
|
9533
|
+
} catch (e11) {
|
|
9360
9534
|
}
|
|
9361
9535
|
}
|
|
9362
9536
|
return objectIds;
|
|
@@ -9406,7 +9580,7 @@ var RelationService = class extends TenantAwareService {
|
|
|
9406
9580
|
const recordService = new RecordService(this.adapter);
|
|
9407
9581
|
for (const target of filteredTargets) {
|
|
9408
9582
|
const objectSchema = await this.schemaService.getObjectSchemaByName(target.object);
|
|
9409
|
-
if (!_optionalChain([objectSchema, 'optionalAccess',
|
|
9583
|
+
if (!_optionalChain([objectSchema, 'optionalAccess', _215 => _215.id])) {
|
|
9410
9584
|
continue;
|
|
9411
9585
|
}
|
|
9412
9586
|
const queryOptions = {
|
|
@@ -9485,8 +9659,8 @@ var RelationService = class extends TenantAwareService {
|
|
|
9485
9659
|
if (!objectSchema) {
|
|
9486
9660
|
continue;
|
|
9487
9661
|
}
|
|
9488
|
-
const targetConfig = _optionalChain([attribute, 'optionalAccess',
|
|
9489
|
-
const customTemplate = _optionalChain([targetConfig, 'optionalAccess',
|
|
9662
|
+
const targetConfig = _optionalChain([attribute, 'optionalAccess', _216 => _216.targets, 'optionalAccess', _217 => _217.find, 'call', _218 => _218((t) => t.object === objectSchema.name)]);
|
|
9663
|
+
const customTemplate = _optionalChain([targetConfig, 'optionalAccess', _219 => _219.displayTemplate]);
|
|
9490
9664
|
for (const record of objectRecords) {
|
|
9491
9665
|
let label;
|
|
9492
9666
|
if (customTemplate) {
|
|
@@ -9537,7 +9711,7 @@ var RelationService = class extends TenantAwareService {
|
|
|
9537
9711
|
var RollupService = class {
|
|
9538
9712
|
constructor(adapter, options) {
|
|
9539
9713
|
this.adapter = adapter;
|
|
9540
|
-
this.cache = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
9714
|
+
this.cache = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _220 => _220.cache]), () => ( adapter.cache));
|
|
9541
9715
|
}
|
|
9542
9716
|
/**
|
|
9543
9717
|
* Calculate a rollup value for a record
|
|
@@ -9625,22 +9799,37 @@ var RollupService = class {
|
|
|
9625
9799
|
return { value: null, recordCount: 0 };
|
|
9626
9800
|
}
|
|
9627
9801
|
const sourceObjectName = rollupAttr.relationAttribute;
|
|
9628
|
-
const
|
|
9629
|
-
|
|
9630
|
-
|
|
9802
|
+
const sourceSchema = getSchemaByNameFromContext(sourceObjectName);
|
|
9803
|
+
let sourceObjectId;
|
|
9804
|
+
let reverseRelationAttrName;
|
|
9805
|
+
if (_optionalChain([sourceSchema, 'optionalAccess', _221 => _221.id])) {
|
|
9806
|
+
sourceObjectId = sourceSchema.id;
|
|
9807
|
+
const reverseRelationAttr = sourceSchema.attributes.find((attr) => {
|
|
9808
|
+
if (attr.type !== "relation") return false;
|
|
9809
|
+
const relationConfig = attr;
|
|
9810
|
+
return _optionalChain([relationConfig, 'optionalAccess', _222 => _222.targets, 'optionalAccess', _223 => _223.some, 'call', _224 => _224((t) => t.object === schema.name)]);
|
|
9811
|
+
});
|
|
9812
|
+
reverseRelationAttrName = _optionalChain([reverseRelationAttr, 'optionalAccess', _225 => _225.name]);
|
|
9813
|
+
} else {
|
|
9814
|
+
const sourceObject = await this.adapter.objects.findByName(sourceObjectName);
|
|
9815
|
+
if (!sourceObject) {
|
|
9816
|
+
return { value: null, recordCount: 0 };
|
|
9817
|
+
}
|
|
9818
|
+
sourceObjectId = sourceObject.id;
|
|
9819
|
+
const sourceAttributes = await this.adapter.attributes.findByObjectId(sourceObject.id);
|
|
9820
|
+
const reverseRelationAttr = sourceAttributes.find((attr) => {
|
|
9821
|
+
if (attr.type !== "relation") return false;
|
|
9822
|
+
const relationConfig = attr.config;
|
|
9823
|
+
return _optionalChain([relationConfig, 'optionalAccess', _226 => _226.targets, 'optionalAccess', _227 => _227.some, 'call', _228 => _228((t) => t.object === schema.name)]);
|
|
9824
|
+
});
|
|
9825
|
+
reverseRelationAttrName = _optionalChain([reverseRelationAttr, 'optionalAccess', _229 => _229.name]);
|
|
9631
9826
|
}
|
|
9632
|
-
|
|
9633
|
-
const reverseRelationAttr = sourceAttributes.find((attr) => {
|
|
9634
|
-
if (attr.type !== "relation") return false;
|
|
9635
|
-
const relationConfig = attr.config;
|
|
9636
|
-
return _optionalChain([relationConfig, 'optionalAccess', _211 => _211.targets, 'optionalAccess', _212 => _212.some, 'call', _213 => _213((t) => t.object === schema.name)]);
|
|
9637
|
-
});
|
|
9638
|
-
if (!reverseRelationAttr) {
|
|
9827
|
+
if (!reverseRelationAttrName) {
|
|
9639
9828
|
return { value: null, recordCount: 0 };
|
|
9640
9829
|
}
|
|
9641
9830
|
const relatedRecords = await this.adapter.objectRecords.findByRelation(
|
|
9642
|
-
|
|
9643
|
-
|
|
9831
|
+
sourceObjectId,
|
|
9832
|
+
reverseRelationAttrName,
|
|
9644
9833
|
recordId
|
|
9645
9834
|
);
|
|
9646
9835
|
if (relatedRecords.length === 0) {
|
|
@@ -9874,7 +10063,7 @@ var RollupService = class {
|
|
|
9874
10063
|
}
|
|
9875
10064
|
for (const rollupDbAttr of rollupAttrs) {
|
|
9876
10065
|
const rollupConfig = rollupDbAttr.config;
|
|
9877
|
-
if (!_optionalChain([rollupConfig, 'optionalAccess',
|
|
10066
|
+
if (!_optionalChain([rollupConfig, 'optionalAccess', _230 => _230.relationAttribute])) {
|
|
9878
10067
|
continue;
|
|
9879
10068
|
}
|
|
9880
10069
|
const relationAttr = attributes.find(
|
|
@@ -9884,7 +10073,7 @@ var RollupService = class {
|
|
|
9884
10073
|
continue;
|
|
9885
10074
|
}
|
|
9886
10075
|
const relationConfig = relationAttr.config;
|
|
9887
|
-
const targetsChangedObject = _optionalChain([relationConfig, 'optionalAccess',
|
|
10076
|
+
const targetsChangedObject = _optionalChain([relationConfig, 'optionalAccess', _231 => _231.targets, 'optionalAccess', _232 => _232.some, 'call', _233 => _233(
|
|
9888
10077
|
(t) => t.object === changedSchema.name
|
|
9889
10078
|
)]);
|
|
9890
10079
|
if (!targetsChangedObject) {
|
|
@@ -9987,7 +10176,7 @@ var UserService = class extends TenantAwareService {
|
|
|
9987
10176
|
if (roleErrors.length > 0) {
|
|
9988
10177
|
errors.push({
|
|
9989
10178
|
attribute: attr.name,
|
|
9990
|
-
message: `Users do not have required role for ${attr.label}. Allowed roles: ${_optionalChain([attr, 'access',
|
|
10179
|
+
message: `Users do not have required role for ${attr.label}. Allowed roles: ${_optionalChain([attr, 'access', _234 => _234.allowedRoles, 'optionalAccess', _235 => _235.join, 'call', _236 => _236(", ")])}`,
|
|
9991
10180
|
invalidIds: roleErrors
|
|
9992
10181
|
});
|
|
9993
10182
|
}
|
|
@@ -10041,15 +10230,15 @@ var RecordService = class extends TenantAwareService {
|
|
|
10041
10230
|
super();
|
|
10042
10231
|
this.adapter = adapter;
|
|
10043
10232
|
this.schemaService = new ObjectSchemaService(adapter, registry, {
|
|
10044
|
-
auditService: _optionalChain([options, 'optionalAccess',
|
|
10233
|
+
auditService: _optionalChain([options, 'optionalAccess', _237 => _237.auditService])
|
|
10045
10234
|
});
|
|
10046
10235
|
this.relationService = new RelationService(adapter, registry);
|
|
10047
10236
|
this.userService = new UserService(adapter);
|
|
10048
10237
|
this.rollupService = new RollupService(adapter);
|
|
10049
|
-
this.hookRegistry = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
10050
|
-
this.permissionService = _optionalChain([options, 'optionalAccess',
|
|
10051
|
-
this.auditService = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
10052
|
-
this.policyRegistry = _optionalChain([options, 'optionalAccess',
|
|
10238
|
+
this.hookRegistry = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _238 => _238.hookRegistry]), () => ( new NoopHookRegistry()));
|
|
10239
|
+
this.permissionService = _optionalChain([options, 'optionalAccess', _239 => _239.permissionService]);
|
|
10240
|
+
this.auditService = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _240 => _240.auditService]), () => ( (adapter.audit ? new AuditService(adapter) : void 0)));
|
|
10241
|
+
this.policyRegistry = _optionalChain([options, 'optionalAccess', _241 => _241.policyRegistry]) === null ? null : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _242 => _242.policyRegistry]), () => ( defaultPolicyRegistry));
|
|
10053
10242
|
}
|
|
10054
10243
|
/**
|
|
10055
10244
|
* Check permission for an action on an object.
|
|
@@ -10179,7 +10368,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10179
10368
|
*/
|
|
10180
10369
|
async computeLabel(schema, values) {
|
|
10181
10370
|
const attrNames = extractAttributeNames(schema.labelExpression);
|
|
10182
|
-
let enrichedValues =
|
|
10371
|
+
let enrichedValues = enrichValuesForDisplay(values, schema.attributes);
|
|
10183
10372
|
const relationAttrs = schema.attributes.filter(
|
|
10184
10373
|
(attr) => attr.type === "relation" && attrNames.includes(attr.name)
|
|
10185
10374
|
);
|
|
@@ -10233,20 +10422,20 @@ var RecordService = class extends TenantAwareService {
|
|
|
10233
10422
|
const schema = await this.schemaService.getObjectSchema(objectId);
|
|
10234
10423
|
const dataWithDefaults = applyDefaultValues(schema, data);
|
|
10235
10424
|
await this.checkPermission(schema.name, "create");
|
|
10236
|
-
const hookCtx = this.buildCreateHookContext(schema, dataWithDefaults, _optionalChain([options, 'optionalAccess',
|
|
10237
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10425
|
+
const hookCtx = this.buildCreateHookContext(schema, dataWithDefaults, _optionalChain([options, 'optionalAccess', _243 => _243.hookMetadata]));
|
|
10426
|
+
if (!_optionalChain([options, 'optionalAccess', _244 => _244.skipHooks])) {
|
|
10238
10427
|
await this.hookRegistry.execute("beforeCreate", schema.name, hookCtx);
|
|
10239
10428
|
}
|
|
10240
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10241
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10429
|
+
if (_optionalChain([options, 'optionalAccess', _245 => _245.validate]) !== false) {
|
|
10430
|
+
if (_optionalChain([options, 'optionalAccess', _246 => _246.allowDraft])) {
|
|
10242
10431
|
validateDraftOrThrow(schema, dataWithDefaults);
|
|
10243
10432
|
} else {
|
|
10244
10433
|
validateObjectOrThrow(schema, dataWithDefaults);
|
|
10245
10434
|
}
|
|
10246
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10435
|
+
if (!_optionalChain([options, 'optionalAccess', _247 => _247.skipRelationValidation])) {
|
|
10247
10436
|
await this.relationService.validateRelationsOrThrow(schema, dataWithDefaults);
|
|
10248
10437
|
}
|
|
10249
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10438
|
+
if (!_optionalChain([options, 'optionalAccess', _248 => _248.skipUserValidation])) {
|
|
10250
10439
|
await this.userService.validateUsersOrThrow(schema, dataWithDefaults);
|
|
10251
10440
|
}
|
|
10252
10441
|
}
|
|
@@ -10257,10 +10446,10 @@ var RecordService = class extends TenantAwareService {
|
|
|
10257
10446
|
data: dataWithDefaults,
|
|
10258
10447
|
label,
|
|
10259
10448
|
completionStatus,
|
|
10260
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
10449
|
+
metadata: _optionalChain([options, 'optionalAccess', _249 => _249.metadata]),
|
|
10261
10450
|
createdBy: this.userId
|
|
10262
10451
|
});
|
|
10263
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10452
|
+
if (!_optionalChain([options, 'optionalAccess', _250 => _250.skipHooks])) {
|
|
10264
10453
|
const afterCtx = {
|
|
10265
10454
|
...hookCtx,
|
|
10266
10455
|
recordId: record.id,
|
|
@@ -10277,7 +10466,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10277
10466
|
objectId: schema.id,
|
|
10278
10467
|
recordId: record.id,
|
|
10279
10468
|
recordLabel: record.label,
|
|
10280
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
10469
|
+
metadata: _optionalChain([options, 'optionalAccess', _251 => _251.hookMetadata])
|
|
10281
10470
|
});
|
|
10282
10471
|
}
|
|
10283
10472
|
return record;
|
|
@@ -10295,17 +10484,17 @@ var RecordService = class extends TenantAwareService {
|
|
|
10295
10484
|
return null;
|
|
10296
10485
|
}
|
|
10297
10486
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10298
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10487
|
+
if (!_optionalChain([options, 'optionalAccess', _252 => _252.skipPolicyCheck])) {
|
|
10299
10488
|
const policy = this.getPolicy(schema.name);
|
|
10300
10489
|
if (policy && !this.checkRecordAccess(policy, record)) {
|
|
10301
10490
|
return null;
|
|
10302
10491
|
}
|
|
10303
10492
|
}
|
|
10304
10493
|
let enrichedRecord = record;
|
|
10305
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10494
|
+
if (!_optionalChain([options, 'optionalAccess', _253 => _253.skipFormulas])) {
|
|
10306
10495
|
enrichedRecord = this.enrichWithFormulas(record, schema);
|
|
10307
10496
|
}
|
|
10308
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10497
|
+
if (_optionalChain([options, 'optionalAccess', _254 => _254.includeSchema])) {
|
|
10309
10498
|
const recordWithSchema = enrichedRecord;
|
|
10310
10499
|
recordWithSchema.schema = schema;
|
|
10311
10500
|
return recordWithSchema;
|
|
@@ -10364,9 +10553,9 @@ var RecordService = class extends TenantAwareService {
|
|
|
10364
10553
|
data,
|
|
10365
10554
|
mergedData,
|
|
10366
10555
|
changedAttributes,
|
|
10367
|
-
_optionalChain([options, 'optionalAccess',
|
|
10556
|
+
_optionalChain([options, 'optionalAccess', _255 => _255.hookMetadata])
|
|
10368
10557
|
);
|
|
10369
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10558
|
+
if (!_optionalChain([options, 'optionalAccess', _256 => _256.skipHooks])) {
|
|
10370
10559
|
await this.hookRegistry.execute("beforeUpdate", schema.name, hookCtx);
|
|
10371
10560
|
}
|
|
10372
10561
|
const hookModifiedValues = {};
|
|
@@ -10375,19 +10564,19 @@ var RecordService = class extends TenantAwareService {
|
|
|
10375
10564
|
hookModifiedValues[key] = hookCtx.newValues[key];
|
|
10376
10565
|
}
|
|
10377
10566
|
}
|
|
10378
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10379
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10567
|
+
if (_optionalChain([options, 'optionalAccess', _257 => _257.validate]) !== false) {
|
|
10568
|
+
if (_optionalChain([options, 'optionalAccess', _258 => _258.partial])) {
|
|
10380
10569
|
validateDraftOrThrow(schema, mergedData);
|
|
10381
10570
|
} else {
|
|
10382
10571
|
validateObjectOrThrow(schema, mergedData);
|
|
10383
10572
|
}
|
|
10384
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10573
|
+
if (!_optionalChain([options, 'optionalAccess', _259 => _259.skipRelationValidation])) {
|
|
10385
10574
|
await this.relationService.validateRelationsOrThrow(schema, {
|
|
10386
10575
|
...data,
|
|
10387
10576
|
...hookModifiedValues
|
|
10388
10577
|
});
|
|
10389
10578
|
}
|
|
10390
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10579
|
+
if (!_optionalChain([options, 'optionalAccess', _260 => _260.skipUserValidation])) {
|
|
10391
10580
|
await this.userService.validateUsersOrThrow(schema, {
|
|
10392
10581
|
...data,
|
|
10393
10582
|
...hookModifiedValues
|
|
@@ -10403,7 +10592,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10403
10592
|
__label: label,
|
|
10404
10593
|
__lastUpdatedBy: this.userId
|
|
10405
10594
|
};
|
|
10406
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10595
|
+
if (_optionalChain([options, 'optionalAccess', _261 => _261.metadata]) !== void 0) {
|
|
10407
10596
|
const existingMetadata = _nullishCoalesce(existing.metadata, () => ( {}));
|
|
10408
10597
|
const mergedMetadata = { ...existingMetadata, ...options.metadata };
|
|
10409
10598
|
const cleanedMetadata = Object.fromEntries(
|
|
@@ -10412,7 +10601,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10412
10601
|
updatePayload.__metadata = cleanedMetadata;
|
|
10413
10602
|
}
|
|
10414
10603
|
const updated = await this.adapter.objectRecords.update(recordId, updatePayload);
|
|
10415
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10604
|
+
if (!_optionalChain([options, 'optionalAccess', _262 => _262.skipHooks])) {
|
|
10416
10605
|
const afterCtx = {
|
|
10417
10606
|
...hookCtx,
|
|
10418
10607
|
record: updated
|
|
@@ -10427,7 +10616,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10427
10616
|
if (this.auditService && this.userId && allChangedAttributes.length > 0) {
|
|
10428
10617
|
const changes = allChangedAttributes.map((attr) => ({
|
|
10429
10618
|
field: attr,
|
|
10430
|
-
oldValue: _optionalChain([hookCtx, 'access',
|
|
10619
|
+
oldValue: _optionalChain([hookCtx, 'access', _263 => _263.oldValues, 'optionalAccess', _264 => _264[attr]]),
|
|
10431
10620
|
newValue: hookCtx.newValues[attr]
|
|
10432
10621
|
}));
|
|
10433
10622
|
await this.auditService.logRecordAction({
|
|
@@ -10438,7 +10627,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10438
10627
|
recordId: updated.id,
|
|
10439
10628
|
recordLabel: updated.label,
|
|
10440
10629
|
changes,
|
|
10441
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
10630
|
+
metadata: _optionalChain([options, 'optionalAccess', _265 => _265.hookMetadata])
|
|
10442
10631
|
});
|
|
10443
10632
|
}
|
|
10444
10633
|
return updated;
|
|
@@ -10538,23 +10727,23 @@ var RecordService = class extends TenantAwareService {
|
|
|
10538
10727
|
if (policy) {
|
|
10539
10728
|
this.checkRecordDelete(policy, record);
|
|
10540
10729
|
}
|
|
10541
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10730
|
+
if (_optionalChain([options, 'optionalAccess', _266 => _266.checkSystem])) {
|
|
10542
10731
|
if (schema.system) {
|
|
10543
10732
|
throw new ProtectedResourceError("object", schema.name, "delete");
|
|
10544
10733
|
}
|
|
10545
10734
|
}
|
|
10546
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10735
|
+
if (!_optionalChain([options, 'optionalAccess', _267 => _267.skipReferenceCheck])) {
|
|
10547
10736
|
const references = await this.adapter.objectRecords.countRecordsReferencingId(recordId);
|
|
10548
10737
|
if (references.length > 0) {
|
|
10549
10738
|
throw new RecordReferencedError(recordId, references);
|
|
10550
10739
|
}
|
|
10551
10740
|
}
|
|
10552
|
-
const hookCtx = this.buildDeleteHookContext(schema, record, _optionalChain([options, 'optionalAccess',
|
|
10553
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10741
|
+
const hookCtx = this.buildDeleteHookContext(schema, record, _optionalChain([options, 'optionalAccess', _268 => _268.hookMetadata]));
|
|
10742
|
+
if (!_optionalChain([options, 'optionalAccess', _269 => _269.skipHooks])) {
|
|
10554
10743
|
await this.hookRegistry.execute("beforeDelete", schema.name, hookCtx);
|
|
10555
10744
|
}
|
|
10556
10745
|
await this.adapter.objectRecords.delete(recordId);
|
|
10557
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10746
|
+
if (!_optionalChain([options, 'optionalAccess', _270 => _270.skipHooks])) {
|
|
10558
10747
|
await this.hookRegistry.execute("afterDelete", schema.name, hookCtx);
|
|
10559
10748
|
}
|
|
10560
10749
|
await this.recalculateParentRollups(record, schema);
|
|
@@ -10566,7 +10755,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10566
10755
|
objectId: schema.id,
|
|
10567
10756
|
recordId: record.id,
|
|
10568
10757
|
recordLabel: record.label,
|
|
10569
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
10758
|
+
metadata: _optionalChain([options, 'optionalAccess', _271 => _271.hookMetadata])
|
|
10570
10759
|
});
|
|
10571
10760
|
}
|
|
10572
10761
|
}
|
|
@@ -10597,12 +10786,12 @@ var RecordService = class extends TenantAwareService {
|
|
|
10597
10786
|
}
|
|
10598
10787
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10599
10788
|
await this.checkPermission(schema.name, "update");
|
|
10600
|
-
const hookCtx = this.buildRestoreHookContext(schema, record, _optionalChain([options, 'optionalAccess',
|
|
10601
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10789
|
+
const hookCtx = this.buildRestoreHookContext(schema, record, _optionalChain([options, 'optionalAccess', _272 => _272.hookMetadata]));
|
|
10790
|
+
if (!_optionalChain([options, 'optionalAccess', _273 => _273.skipHooks])) {
|
|
10602
10791
|
await this.hookRegistry.execute("beforeRestore", schema.name, hookCtx);
|
|
10603
10792
|
}
|
|
10604
10793
|
const restored = await this.adapter.objectRecords.restore(recordId);
|
|
10605
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10794
|
+
if (!_optionalChain([options, 'optionalAccess', _274 => _274.skipHooks])) {
|
|
10606
10795
|
const afterCtx = {
|
|
10607
10796
|
...hookCtx,
|
|
10608
10797
|
record: restored
|
|
@@ -10617,7 +10806,7 @@ var RecordService = class extends TenantAwareService {
|
|
|
10617
10806
|
objectId: schema.id,
|
|
10618
10807
|
recordId: restored.id,
|
|
10619
10808
|
recordLabel: restored.label,
|
|
10620
|
-
metadata: _optionalChain([options, 'optionalAccess',
|
|
10809
|
+
metadata: _optionalChain([options, 'optionalAccess', _275 => _275.hookMetadata])
|
|
10621
10810
|
});
|
|
10622
10811
|
}
|
|
10623
10812
|
return restored;
|
|
@@ -10762,20 +10951,23 @@ var RecordService = class extends TenantAwareService {
|
|
|
10762
10951
|
if (this.permissionService && this.userId) {
|
|
10763
10952
|
await this.checkPermission(schema.name, "read");
|
|
10764
10953
|
}
|
|
10765
|
-
const policy = _optionalChain([options, 'optionalAccess',
|
|
10954
|
+
const policy = _optionalChain([options, 'optionalAccess', _276 => _276.skipPolicyFilter]) ? void 0 : this.getPolicy(schema.name);
|
|
10766
10955
|
let effectiveOptions = options;
|
|
10767
|
-
if (_optionalChain([policy, 'optionalAccess',
|
|
10956
|
+
if (_optionalChain([policy, 'optionalAccess', _277 => _277.applyListFilter])) {
|
|
10768
10957
|
effectiveOptions = policy.applyListFilter(this.buildPolicyContext(schema.name), options);
|
|
10769
10958
|
}
|
|
10770
|
-
const result = await
|
|
10959
|
+
const result = await runWithSchemaContext(
|
|
10960
|
+
[schema],
|
|
10961
|
+
() => this.adapter.objectRecords.list(objectId, effectiveOptions)
|
|
10962
|
+
);
|
|
10771
10963
|
let filteredRecords = result.records;
|
|
10772
10964
|
let effectiveTotal = result.total;
|
|
10773
|
-
if (_optionalChain([policy, 'optionalAccess',
|
|
10965
|
+
if (_optionalChain([policy, 'optionalAccess', _278 => _278.canAccessRecord])) {
|
|
10774
10966
|
const ctx = this.buildPolicyContext(schema.name);
|
|
10775
|
-
filteredRecords = result.records.filter((record) => _optionalChain([policy, 'access',
|
|
10967
|
+
filteredRecords = result.records.filter((record) => _optionalChain([policy, 'access', _279 => _279.canAccessRecord, 'optionalCall', _280 => _280(ctx, record)]));
|
|
10776
10968
|
effectiveTotal = filteredRecords.length;
|
|
10777
10969
|
}
|
|
10778
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
10970
|
+
if (!_optionalChain([options, 'optionalAccess', _281 => _281.skipFormulas])) {
|
|
10779
10971
|
return {
|
|
10780
10972
|
records: this.enrichRecordsWithFormulas(filteredRecords, schema),
|
|
10781
10973
|
total: effectiveTotal
|
|
@@ -10799,8 +10991,11 @@ var RecordService = class extends TenantAwareService {
|
|
|
10799
10991
|
if (this.permissionService && this.userId) {
|
|
10800
10992
|
await this.checkPermission(schema.name, "read");
|
|
10801
10993
|
}
|
|
10802
|
-
const result = await
|
|
10803
|
-
|
|
10994
|
+
const result = await runWithSchemaContext(
|
|
10995
|
+
[schema],
|
|
10996
|
+
() => this.adapter.objectRecords.search(objectId, query, options)
|
|
10997
|
+
);
|
|
10998
|
+
if (!_optionalChain([options, 'optionalAccess', _282 => _282.skipFormulas])) {
|
|
10804
10999
|
return {
|
|
10805
11000
|
records: this.enrichRecordsWithFormulas(result.records, schema),
|
|
10806
11001
|
total: result.total
|
|
@@ -10999,8 +11194,8 @@ var RollupScheduler = class {
|
|
|
10999
11194
|
this.getSchemaById = getSchemaById;
|
|
11000
11195
|
this.pending = /* @__PURE__ */ new Map();
|
|
11001
11196
|
this.rollupService = new RollupService(adapter);
|
|
11002
|
-
this.debounceMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
11003
|
-
this.maxPending = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
11197
|
+
this.debounceMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _283 => _283.debounceMs]), () => ( 100));
|
|
11198
|
+
this.maxPending = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _284 => _284.maxPending]), () => ( 100));
|
|
11004
11199
|
}
|
|
11005
11200
|
/**
|
|
11006
11201
|
* Schedule a rollup recalculation for a parent record.
|
|
@@ -11076,7 +11271,7 @@ var UserProfileService = class extends TenantAwareService {
|
|
|
11076
11271
|
constructor(adapter, options) {
|
|
11077
11272
|
super();
|
|
11078
11273
|
this.adapter = adapter;
|
|
11079
|
-
this.auditService = _optionalChain([options, 'optionalAccess',
|
|
11274
|
+
this.auditService = _optionalChain([options, 'optionalAccess', _285 => _285.auditService]);
|
|
11080
11275
|
}
|
|
11081
11276
|
/**
|
|
11082
11277
|
* Create a new user profile (typically after first auth).
|
|
@@ -11209,7 +11404,7 @@ var UserProfileService = class extends TenantAwareService {
|
|
|
11209
11404
|
*/
|
|
11210
11405
|
async deleteProfile(profileId, options) {
|
|
11211
11406
|
const profile = await this.getProfileOrThrow(profileId);
|
|
11212
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
11407
|
+
if (_optionalChain([options, 'optionalAccess', _286 => _286.checkAdmin])) {
|
|
11213
11408
|
if (profile.role === "admin") {
|
|
11214
11409
|
const adminCount = await this.adapter.userProfiles.countByRole("admin");
|
|
11215
11410
|
if (adminCount <= 1) {
|
|
@@ -11278,7 +11473,7 @@ var UserProfileService = class extends TenantAwareService {
|
|
|
11278
11473
|
*/
|
|
11279
11474
|
async hasRole(profileId, role) {
|
|
11280
11475
|
const profile = await this.getProfile(profileId);
|
|
11281
|
-
return _optionalChain([profile, 'optionalAccess',
|
|
11476
|
+
return _optionalChain([profile, 'optionalAccess', _287 => _287.role]) === role;
|
|
11282
11477
|
}
|
|
11283
11478
|
/**
|
|
11284
11479
|
* Check if user is admin
|
|
@@ -11573,9 +11768,9 @@ var WorkflowInstanceService = class extends TenantAwareService {
|
|
|
11573
11768
|
super();
|
|
11574
11769
|
this.adapter = adapter;
|
|
11575
11770
|
this.workflowService = workflowService;
|
|
11576
|
-
this.executorRegistry = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
11577
|
-
this.schemaService = _optionalChain([options, 'optionalAccess',
|
|
11578
|
-
this.recordService = _optionalChain([options, 'optionalAccess',
|
|
11771
|
+
this.executorRegistry = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _288 => _288.executorRegistry]), () => ( getDefaultExecutorRegistry()));
|
|
11772
|
+
this.schemaService = _optionalChain([options, 'optionalAccess', _289 => _289.schemaService]);
|
|
11773
|
+
this.recordService = _optionalChain([options, 'optionalAccess', _290 => _290.recordService]);
|
|
11579
11774
|
}
|
|
11580
11775
|
/**
|
|
11581
11776
|
* Start a new workflow instance
|
|
@@ -11701,7 +11896,7 @@ var WorkflowInstanceService = class extends TenantAwareService {
|
|
|
11701
11896
|
if (!this.adapter.workflowInstances) {
|
|
11702
11897
|
return { instances: [], total: 0 };
|
|
11703
11898
|
}
|
|
11704
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
11899
|
+
if (_optionalChain([options, 'optionalAccess', _291 => _291.workflowName])) {
|
|
11705
11900
|
const instances2 = await this.getInstancesByWorkflow(options.workflowName);
|
|
11706
11901
|
let filtered = instances2;
|
|
11707
11902
|
if (options.status) {
|
|
@@ -11715,11 +11910,11 @@ var WorkflowInstanceService = class extends TenantAwareService {
|
|
|
11715
11910
|
return { instances: paginated, total: total2 };
|
|
11716
11911
|
}
|
|
11717
11912
|
const { instances: dbInstances, total } = await this.adapter.workflowInstances.list({
|
|
11718
|
-
limit: _optionalChain([options, 'optionalAccess',
|
|
11719
|
-
offset: _optionalChain([options, 'optionalAccess',
|
|
11913
|
+
limit: _optionalChain([options, 'optionalAccess', _292 => _292.limit]),
|
|
11914
|
+
offset: _optionalChain([options, 'optionalAccess', _293 => _293.offset])
|
|
11720
11915
|
});
|
|
11721
11916
|
let instances = dbInstances.map((db) => this.convertDBInstanceToInstance(db));
|
|
11722
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
11917
|
+
if (_optionalChain([options, 'optionalAccess', _294 => _294.status])) {
|
|
11723
11918
|
instances = instances.filter((i) => i.status === options.status);
|
|
11724
11919
|
}
|
|
11725
11920
|
return { instances, total };
|
|
@@ -11739,9 +11934,9 @@ var WorkflowInstanceService = class extends TenantAwareService {
|
|
|
11739
11934
|
return { instances: [], total: 0 };
|
|
11740
11935
|
}
|
|
11741
11936
|
const { instances: dbInstances, total } = await this.adapter.workflowInstances.findByRecordInSlots(objectName, recordId, {
|
|
11742
|
-
status: _optionalChain([options, 'optionalAccess',
|
|
11743
|
-
limit: _optionalChain([options, 'optionalAccess',
|
|
11744
|
-
offset: _optionalChain([options, 'optionalAccess',
|
|
11937
|
+
status: _optionalChain([options, 'optionalAccess', _295 => _295.status]),
|
|
11938
|
+
limit: _optionalChain([options, 'optionalAccess', _296 => _296.limit]),
|
|
11939
|
+
offset: _optionalChain([options, 'optionalAccess', _297 => _297.offset])
|
|
11745
11940
|
});
|
|
11746
11941
|
const instances = dbInstances.map((db) => this.convertDBInstanceToInstance(db));
|
|
11747
11942
|
return { instances, total };
|
|
@@ -12120,7 +12315,7 @@ var WorkflowParticipationService = class extends TenantAwareService {
|
|
|
12120
12315
|
SchemaErrorCode.RECORD_NOT_FOUND
|
|
12121
12316
|
);
|
|
12122
12317
|
}
|
|
12123
|
-
const template = _optionalChain([instance, 'access',
|
|
12318
|
+
const template = _optionalChain([instance, 'access', _298 => _298.workflowSnapshot, 'access', _299 => _299.participants, 'optionalAccess', _300 => _300.find, 'call', _301 => _301(
|
|
12124
12319
|
(p) => p.id === input.participantTemplateId
|
|
12125
12320
|
)]);
|
|
12126
12321
|
if (!template) {
|
|
@@ -12423,7 +12618,7 @@ var WorkflowRelationService = class extends TenantAwareService {
|
|
|
12423
12618
|
if (attr.type !== "relation") continue;
|
|
12424
12619
|
for (const slot of slots) {
|
|
12425
12620
|
const slotData = context.slots[slot.id];
|
|
12426
|
-
const slotRecordId = _optionalChain([slotData, 'optionalAccess',
|
|
12621
|
+
const slotRecordId = _optionalChain([slotData, 'optionalAccess', _302 => _302.id]);
|
|
12427
12622
|
if (!slotRecordId) continue;
|
|
12428
12623
|
const targetsSlotObject = attr.targets.some(
|
|
12429
12624
|
(t) => t.object === slot.objectName
|
|
@@ -13391,4 +13586,13 @@ var NoopGeocodingAdapter = class {
|
|
|
13391
13586
|
|
|
13392
13587
|
|
|
13393
13588
|
|
|
13394
|
-
exports.RELATION_TARGET_ANY = RELATION_TARGET_ANY; exports.isUniversalRelation = isUniversalRelation; exports.RecordReferencedError = RecordReferencedError; exports.AttributeInUseError = AttributeInUseError; exports.ObjectReferencedError = ObjectReferencedError; exports.NoopGeocodingAdapter = NoopGeocodingAdapter; exports.SYSTEM_FIELD_NAMES = SYSTEM_FIELD_NAMES; exports.RESERVED_ATTRIBUTE_NAMES = RESERVED_ATTRIBUTE_NAMES; exports.PolicyViolationError = PolicyViolationError; exports.SYSTEM_ATTRIBUTES = SYSTEM_ATTRIBUTES; exports.getSystemAttributeList = getSystemAttributeList; exports.isSystemAttribute = isSystemAttribute; exports.isSystemAttributeObject = isSystemAttributeObject; exports.isSimpleFormNode = isSimpleFormNode; exports.isAdvancedFormNode = isAdvancedFormNode; exports.isStartNode = isStartNode; exports.isFormNode = isFormNode; exports.isConditionNode = isConditionNode; exports.isEndNode = isEndNode; exports.getNodeOutputs = getNodeOutputs; exports.isConditionRule = isConditionRule; exports.isConditionGroup = isConditionGroup; exports.eq = eq; exports.neq = neq; exports.and = and; exports.or = or; exports.inValues = inValues; exports.isEmpty = isEmpty; exports.isNotEmpty = isNotEmpty; exports.isWorkflowDefinition = isWorkflowDefinition; exports.isWorkflowPublished = isWorkflowPublished; exports.isSystemWorkflow = isSystemWorkflow; exports.isInstanceTerminal = isInstanceTerminal; exports.isInstanceWaiting = isInstanceWaiting; exports.canResumeInstance = canResumeInstance; exports.createStartTransition = createStartTransition; exports.isSignedLinkAuth = isSignedLinkAuth; exports.isPinCodeAuth = isPinCodeAuth; exports.canParticipate = canParticipate; exports.canAuthenticate = canAuthenticate; exports.canExecuteNode = canExecuteNode; exports.createEmptyContext = createEmptyContext; exports.getContextValue = getContextValue; exports.setContextValue = setContextValue; exports.mergeFormToSlot = mergeFormToSlot; exports.DEFAULT_THEME = DEFAULT_THEME; exports.mergeWithDefaults = mergeWithDefaults; exports.generateCssVariables = generateCssVariables; exports.isInstanceEvent = isInstanceEvent; exports.isNodeEvent = isNodeEvent; exports.isParticipationEvent = isParticipationEvent; exports.ConditionOperatorSchema = ConditionOperatorSchema; exports.ConditionRuleSchema = ConditionRuleSchema; exports.ConditionGroupSchema = ConditionGroupSchema; exports.StartNodeSchema = StartNodeSchema; exports.FormFieldRefSchema = FormFieldRefSchema; exports.FlowRowFieldSchema = FlowRowFieldSchema; exports.FlowRowSchema = FlowRowSchema; exports.FormNodeSchema = FormNodeSchema; exports.ConditionNodeSchema = ConditionNodeSchema; exports.EndNodeSchema = EndNodeSchema; exports.WorkflowNodeSchema = WorkflowNodeSchema; exports.SlotModeSchema = SlotModeSchema; exports.WorkflowSlotSchema = WorkflowSlotSchema; exports.ParticipantAuthConfigSchema = ParticipantAuthConfigSchema; exports.ParticipantTemplateSchema = ParticipantTemplateSchema; exports.NodePositionSchema = NodePositionSchema; exports.ViewportSchema = ViewportSchema; exports.WorkflowLayoutSchema = WorkflowLayoutSchema; exports.ThemeColorsSchema = ThemeColorsSchema; exports.ThemeLogoSchema = ThemeLogoSchema; exports.WorkflowThemeSchema = WorkflowThemeSchema; exports.WorkflowConfigSchema = WorkflowConfigSchema; exports.WorkflowStatusSchema = WorkflowStatusSchema; exports.WorkflowDefinitionSchema = WorkflowDefinitionSchema; exports.asTenantId = asTenantId; exports.asUserId = asUserId; exports.generateId = generateId; exports.generatePrefixedId = generatePrefixedId; exports.EMPTY_VALUE_PLACEHOLDER = EMPTY_VALUE_PLACEHOLDER; exports.formatAttributeValue = formatAttributeValue; exports.SchemaErrorCode = SchemaErrorCode; exports.SchemaError = SchemaError; exports.NotFoundError = NotFoundError; exports.ObjectNotFoundError = ObjectNotFoundError; exports.AttributeNotFoundError = AttributeNotFoundError; exports.RecordNotFoundError = RecordNotFoundError; exports.UserProfileNotFoundError = UserProfileNotFoundError; exports.FileNotFoundError = FileNotFoundError; exports.ValidationError = ValidationError; exports.ProtectedResourceError = ProtectedResourceError; exports.SyncError = SyncError; exports.NotSystemObjectError = NotSystemObjectError; exports.DuplicateError = DuplicateError; exports.isSchemaError = isSchemaError; exports.isNotFoundError = isNotFoundError; exports.isValidationError = isValidationError; exports.isProtectedResourceError = isProtectedResourceError; exports.ForbiddenError = ForbiddenError; exports.ProtectedRoleError = ProtectedRoleError; exports.RoleNotFoundError = RoleNotFoundError; exports.isForbiddenError = isForbiddenError; exports.text = text; exports.textarea = textarea; exports.richtext = richtext; exports.number = number; exports.checkbox = checkbox; exports.date = date; exports.phone = phone; exports.currency = currency; exports.status = status; exports.select = select; exports.multiselect = multiselect; exports.location = location; exports.file = file; exports.user = user; exports.relation = relation; exports.rating = rating; exports.formula = formula; exports.rollup = rollup; exports.ObjectBuilder = ObjectBuilder; exports.object = object; exports.GroupBuilder = GroupBuilder; exports.DirectTableTabConfig = DirectTableTabConfig; exports.InverseTableTabConfig = InverseTableTabConfig; exports.CustomTabConfig = CustomTabConfig; exports.NotesTabConfig = NotesTabConfig; exports.ActivityTabConfig = ActivityTabConfig; exports.FlowsTabConfig = FlowsTabConfig; exports.TabBuilder = TabBuilder; exports.ViewBuilder = ViewBuilder; exports.view = view; exports.group = group; exports.WorkflowFormRowBuilder = WorkflowFormRowBuilder; exports.WorkflowFormBuilder = WorkflowFormBuilder; exports.WorkflowSimpleFormBuilder = WorkflowSimpleFormBuilder; exports.WorkflowConditionBuilder = WorkflowConditionBuilder; exports.WorkflowEndBuilder = WorkflowEndBuilder; exports.WorkflowStartBuilder = WorkflowStartBuilder; exports.WorkflowParticipantBuilder = WorkflowParticipantBuilder; exports.WorkflowBuilder = WorkflowBuilder; exports.workflow = workflow; exports.registry = registry; exports.DEFAULT_VALIDATION_MESSAGES = DEFAULT_VALIDATION_MESSAGES; exports.textConfigSchema = textConfigSchema; exports.textareaConfigSchema = textareaConfigSchema; exports.richtextConfigSchema = richtextConfigSchema; exports.numberConfigSchema = numberConfigSchema; exports.checkboxConfigSchema = checkboxConfigSchema; exports.dateConfigSchema = dateConfigSchema; exports.phoneConfigSchema = phoneConfigSchema; exports.currencyConfigSchema = currencyConfigSchema; exports.statusConfigSchema = statusConfigSchema; exports.locationConfigSchema = locationConfigSchema; exports.selectConfigSchema = selectConfigSchema; exports.multiselectConfigSchema = multiselectConfigSchema; exports.fileConfigSchema = fileConfigSchema; exports.userConfigSchema = userConfigSchema; exports.relationConfigSchema = relationConfigSchema; exports.ratingConfigSchema = ratingConfigSchema; exports.formulaConfigSchema = formulaConfigSchema; exports.rollupConfigSchema = rollupConfigSchema; exports.attributeConfigSchemas = attributeConfigSchemas; exports.getAttributeConfigSchema = getAttributeConfigSchema; exports.validateAttributeConfig = validateAttributeConfig; exports.parseAttributeConfig = parseAttributeConfig; exports.safeParseAttributeConfig = safeParseAttributeConfig; exports.createTextValidator = createTextValidator; exports.createNumberValidator = createNumberValidator; exports.createCheckboxValidator = createCheckboxValidator; exports.createDateValidator = createDateValidator; exports.createPhoneValidator = createPhoneValidator; exports.createCurrencyValidator = createCurrencyValidator; exports.createStatusValidator = createStatusValidator; exports.createSelectValidator = createSelectValidator; exports.createMultiselectValidator = createMultiselectValidator; exports.createLocationValidator = createLocationValidator; exports.createFileValidator = createFileValidator; exports.createUserValidator = createUserValidator; exports.createSingleRelationValidator = createSingleRelationValidator; exports.createMultiRelationValidator = createMultiRelationValidator; exports.createRelationValidator = createRelationValidator; exports.createRatingValidator = createRatingValidator; exports.createFormulaValidator = createFormulaValidator; exports.createRollupValidator = createRollupValidator; exports.createTextAreaValidator = createTextAreaValidator; exports.createRichtextValidator = createRichtextValidator; exports.createAttributeValidator = createAttributeValidator; exports.createFormAttributeValidator = createFormAttributeValidator; exports.createObjectValidator = createObjectValidator; exports.validateAttribute = validateAttribute; exports.validateObject = validateObject; exports.validateObjectOrThrow = validateObjectOrThrow; exports.createDraftValidator = createDraftValidator; exports.validateDraft = validateDraft; exports.validateDraftOrThrow = validateDraftOrThrow; exports.getMissingRequiredAttributes = getMissingRequiredAttributes; exports.isRecordComplete = isRecordComplete; exports.computeRecordStatus = computeRecordStatus; exports.ParticipationTokenService = ParticipationTokenService; exports.getDefaultTokenService = getDefaultTokenService; exports.initializeTokenService = initializeTokenService; exports.PinCodeService = PinCodeService; exports.getDefaultPinCodeService = getDefaultPinCodeService; exports.initializePinCodeService = initializePinCodeService; exports.cacheKeys = cacheKeys; exports.cacheTtl = cacheTtl; exports.NoopCacheAdapter = NoopCacheAdapter; exports.formatRecord = formatRecord; exports.formatRecords = formatRecords; exports.createDefaultState = createDefaultState; exports.SHORTCUT_TO_FILTER_OPERATOR = SHORTCUT_TO_FILTER_OPERATOR; exports.QueryNoResultError = QueryNoResultError; exports.QueryMultipleResultsError = QueryMultipleResultsError; exports.TenantContextError = TenantContextError; exports.getContext = getContext; exports.getTenantId = getTenantId; exports.getUserId = getUserId; exports.hasContext = hasContext; exports.runWithContext = runWithContext; exports.withTenantContext = withTenantContext; exports.QueryBuilder = QueryBuilder; exports.createQueryBuilder = createQueryBuilder; exports.evaluateCondition = evaluateCondition; exports.evaluate = evaluate; exports.evaluateWithTrace = evaluateWithTrace; exports.ExecutorRegistry = ExecutorRegistry; exports.success = success; exports.wait = wait; exports.complete = complete; exports.error = error; exports.ConditionExecutor = ConditionExecutor; exports.EndExecutor = EndExecutor; exports.FormExecutor = FormExecutor; exports.StartExecutor = StartExecutor; exports.createDefaultExecutorRegistry = createDefaultExecutorRegistry; exports.getDefaultExecutorRegistry = getDefaultExecutorRegistry; exports.evaluateFormula = evaluateFormula; exports.evaluateFormulaWithResult = evaluateFormulaWithResult; exports.formatFormulaResult = formatFormulaResult; exports.evaluateFormulaAttribute = evaluateFormulaAttribute; exports.validateFormulaExpression = validateFormulaExpression; exports.extractFormulaVariables = extractFormulaVariables; exports.extractRelationReferences = extractRelationReferences; exports.extractRelationNames = extractRelationNames; exports.hasRelationReferences = hasRelationReferences; exports.flattenRelationsForEval = flattenRelationsForEval; exports.evaluateFormulaWithRelations = evaluateFormulaWithRelations; exports.evaluateFormulaAttributeWithRelations = evaluateFormulaAttributeWithRelations; exports.InvalidPathError = InvalidPathError; exports.MaxDepthExceededError = MaxDepthExceededError; exports.parsePath = parsePath; exports.validatePath = validatePath; exports.pathHasManyCardinality = pathHasManyCardinality; exports.getPathDepth = getPathDepth; exports.getTargetAttributeName = getTargetAttributeName; exports.getRelationPath = getRelationPath; exports.traversePath = traversePath; exports.resolveSingleValue = resolveSingleValue; exports.resolveMultiplePaths = resolveMultiplePaths; exports.NoopHookRegistry = NoopHookRegistry; exports.DEFAULT_LABEL_FALLBACK = DEFAULT_LABEL_FALLBACK; exports.renderLabelExpression = renderLabelExpression; exports.isLabelExpression = isLabelExpression; exports.extractAttributeNames = extractAttributeNames; exports.enrichValuesWithSelectLabels = enrichValuesWithSelectLabels; exports.extractRelationIds = extractRelationIds; exports.computeLabelWithRelations = computeLabelWithRelations; exports.createMockAdapter = createMockAdapter; exports.PolicyRegistry = PolicyRegistry; exports.defaultPolicyRegistry = defaultPolicyRegistry; exports.notesPolicy = notesPolicy; exports.buildAuditChanges = buildAuditChanges; exports.TenantAwareService = TenantAwareService; exports.TenantAwareRepository = TenantAwareRepository; exports.AuditService = AuditService; exports.FileService = FileService; exports.GeocodingService = GeocodingService; exports.GlobalSearchService = GlobalSearchService; exports.ObjectSchemaService = ObjectSchemaService; exports.PermissionService = PermissionService; exports.RelationService = RelationService; exports.RollupService = RollupService; exports.UserService = UserService; exports.RecordService = RecordService; exports.RelationResolverService = RelationResolverService; exports.RollupScheduler = RollupScheduler; exports.UserProfileService = UserProfileService; exports.ViewService = ViewService; exports.WorkflowInstanceService = WorkflowInstanceService; exports.WorkflowParticipationService = WorkflowParticipationService; exports.WorkflowRelationService = WorkflowRelationService; exports.WorkflowService = WorkflowService; exports.syncNativeViews = syncNativeViews; exports.verifyNativeViewsSync = verifyNativeViewsSync; exports.getViewSyncPreview = getViewSyncPreview; exports.syncNativeObjects = syncNativeObjects; exports.verifyNativeObjectsSync = verifyNativeObjectsSync; exports.getSyncPreview = getSyncPreview; exports.syncAll = syncAll;
|
|
13589
|
+
|
|
13590
|
+
|
|
13591
|
+
|
|
13592
|
+
|
|
13593
|
+
|
|
13594
|
+
|
|
13595
|
+
|
|
13596
|
+
|
|
13597
|
+
|
|
13598
|
+
exports.RELATION_TARGET_ANY = RELATION_TARGET_ANY; exports.isUniversalRelation = isUniversalRelation; exports.RecordReferencedError = RecordReferencedError; exports.AttributeInUseError = AttributeInUseError; exports.ObjectReferencedError = ObjectReferencedError; exports.NoopGeocodingAdapter = NoopGeocodingAdapter; exports.SYSTEM_FIELD_NAMES = SYSTEM_FIELD_NAMES; exports.RESERVED_ATTRIBUTE_NAMES = RESERVED_ATTRIBUTE_NAMES; exports.PolicyViolationError = PolicyViolationError; exports.SYSTEM_ATTRIBUTES = SYSTEM_ATTRIBUTES; exports.getSystemAttributeList = getSystemAttributeList; exports.isSystemAttribute = isSystemAttribute; exports.isSystemAttributeObject = isSystemAttributeObject; exports.isSimpleFormNode = isSimpleFormNode; exports.isAdvancedFormNode = isAdvancedFormNode; exports.isStartNode = isStartNode; exports.isFormNode = isFormNode; exports.isConditionNode = isConditionNode; exports.isEndNode = isEndNode; exports.getNodeOutputs = getNodeOutputs; exports.isConditionRule = isConditionRule; exports.isConditionGroup = isConditionGroup; exports.eq = eq; exports.neq = neq; exports.and = and; exports.or = or; exports.inValues = inValues; exports.isEmpty = isEmpty; exports.isNotEmpty = isNotEmpty; exports.isWorkflowDefinition = isWorkflowDefinition; exports.isWorkflowPublished = isWorkflowPublished; exports.isSystemWorkflow = isSystemWorkflow; exports.isInstanceTerminal = isInstanceTerminal; exports.isInstanceWaiting = isInstanceWaiting; exports.canResumeInstance = canResumeInstance; exports.createStartTransition = createStartTransition; exports.isSignedLinkAuth = isSignedLinkAuth; exports.isPinCodeAuth = isPinCodeAuth; exports.canParticipate = canParticipate; exports.canAuthenticate = canAuthenticate; exports.canExecuteNode = canExecuteNode; exports.createEmptyContext = createEmptyContext; exports.getContextValue = getContextValue; exports.setContextValue = setContextValue; exports.mergeFormToSlot = mergeFormToSlot; exports.DEFAULT_THEME = DEFAULT_THEME; exports.mergeWithDefaults = mergeWithDefaults; exports.generateCssVariables = generateCssVariables; exports.isInstanceEvent = isInstanceEvent; exports.isNodeEvent = isNodeEvent; exports.isParticipationEvent = isParticipationEvent; exports.ConditionOperatorSchema = ConditionOperatorSchema; exports.ConditionRuleSchema = ConditionRuleSchema; exports.ConditionGroupSchema = ConditionGroupSchema; exports.StartNodeSchema = StartNodeSchema; exports.FormFieldRefSchema = FormFieldRefSchema; exports.FlowRowFieldSchema = FlowRowFieldSchema; exports.FlowRowSchema = FlowRowSchema; exports.FormNodeSchema = FormNodeSchema; exports.ConditionNodeSchema = ConditionNodeSchema; exports.EndNodeSchema = EndNodeSchema; exports.WorkflowNodeSchema = WorkflowNodeSchema; exports.SlotModeSchema = SlotModeSchema; exports.WorkflowSlotSchema = WorkflowSlotSchema; exports.ParticipantAuthConfigSchema = ParticipantAuthConfigSchema; exports.ParticipantTemplateSchema = ParticipantTemplateSchema; exports.NodePositionSchema = NodePositionSchema; exports.ViewportSchema = ViewportSchema; exports.WorkflowLayoutSchema = WorkflowLayoutSchema; exports.ThemeColorsSchema = ThemeColorsSchema; exports.ThemeLogoSchema = ThemeLogoSchema; exports.WorkflowThemeSchema = WorkflowThemeSchema; exports.WorkflowConfigSchema = WorkflowConfigSchema; exports.WorkflowStatusSchema = WorkflowStatusSchema; exports.WorkflowDefinitionSchema = WorkflowDefinitionSchema; exports.asTenantId = asTenantId; exports.asUserId = asUserId; exports.generateId = generateId; exports.generatePrefixedId = generatePrefixedId; exports.EMPTY_VALUE_PLACEHOLDER = EMPTY_VALUE_PLACEHOLDER; exports.formatAttributeValue = formatAttributeValue; exports.SchemaErrorCode = SchemaErrorCode; exports.SchemaError = SchemaError; exports.NotFoundError = NotFoundError; exports.ObjectNotFoundError = ObjectNotFoundError; exports.AttributeNotFoundError = AttributeNotFoundError; exports.RecordNotFoundError = RecordNotFoundError; exports.UserProfileNotFoundError = UserProfileNotFoundError; exports.FileNotFoundError = FileNotFoundError; exports.ValidationError = ValidationError; exports.ProtectedResourceError = ProtectedResourceError; exports.SyncError = SyncError; exports.NotSystemObjectError = NotSystemObjectError; exports.DuplicateError = DuplicateError; exports.isSchemaError = isSchemaError; exports.isNotFoundError = isNotFoundError; exports.isValidationError = isValidationError; exports.isProtectedResourceError = isProtectedResourceError; exports.ForbiddenError = ForbiddenError; exports.ProtectedRoleError = ProtectedRoleError; exports.RoleNotFoundError = RoleNotFoundError; exports.isForbiddenError = isForbiddenError; exports.text = text; exports.textarea = textarea; exports.richtext = richtext; exports.number = number; exports.checkbox = checkbox; exports.date = date; exports.phone = phone; exports.currency = currency; exports.status = status; exports.select = select; exports.multiselect = multiselect; exports.location = location; exports.file = file; exports.user = user; exports.relation = relation; exports.rating = rating; exports.formula = formula; exports.rollup = rollup; exports.ObjectBuilder = ObjectBuilder; exports.object = object; exports.GroupBuilder = GroupBuilder; exports.DirectTableTabConfig = DirectTableTabConfig; exports.InverseTableTabConfig = InverseTableTabConfig; exports.CustomTabConfig = CustomTabConfig; exports.NotesTabConfig = NotesTabConfig; exports.ActivityTabConfig = ActivityTabConfig; exports.FlowsTabConfig = FlowsTabConfig; exports.TabBuilder = TabBuilder; exports.ViewBuilder = ViewBuilder; exports.view = view; exports.group = group; exports.WorkflowFormRowBuilder = WorkflowFormRowBuilder; exports.WorkflowFormBuilder = WorkflowFormBuilder; exports.WorkflowSimpleFormBuilder = WorkflowSimpleFormBuilder; exports.WorkflowConditionBuilder = WorkflowConditionBuilder; exports.WorkflowEndBuilder = WorkflowEndBuilder; exports.WorkflowStartBuilder = WorkflowStartBuilder; exports.WorkflowParticipantBuilder = WorkflowParticipantBuilder; exports.WorkflowBuilder = WorkflowBuilder; exports.workflow = workflow; exports.registry = registry; exports.DEFAULT_VALIDATION_MESSAGES = DEFAULT_VALIDATION_MESSAGES; exports.textConfigSchema = textConfigSchema; exports.textareaConfigSchema = textareaConfigSchema; exports.richtextConfigSchema = richtextConfigSchema; exports.numberConfigSchema = numberConfigSchema; exports.checkboxConfigSchema = checkboxConfigSchema; exports.dateConfigSchema = dateConfigSchema; exports.phoneConfigSchema = phoneConfigSchema; exports.currencyConfigSchema = currencyConfigSchema; exports.statusConfigSchema = statusConfigSchema; exports.locationConfigSchema = locationConfigSchema; exports.selectConfigSchema = selectConfigSchema; exports.multiselectConfigSchema = multiselectConfigSchema; exports.fileConfigSchema = fileConfigSchema; exports.userConfigSchema = userConfigSchema; exports.relationConfigSchema = relationConfigSchema; exports.ratingConfigSchema = ratingConfigSchema; exports.formulaConfigSchema = formulaConfigSchema; exports.rollupConfigSchema = rollupConfigSchema; exports.attributeConfigSchemas = attributeConfigSchemas; exports.getAttributeConfigSchema = getAttributeConfigSchema; exports.validateAttributeConfig = validateAttributeConfig; exports.parseAttributeConfig = parseAttributeConfig; exports.safeParseAttributeConfig = safeParseAttributeConfig; exports.createTextValidator = createTextValidator; exports.createNumberValidator = createNumberValidator; exports.createCheckboxValidator = createCheckboxValidator; exports.createDateValidator = createDateValidator; exports.createPhoneValidator = createPhoneValidator; exports.createCurrencyValidator = createCurrencyValidator; exports.createStatusValidator = createStatusValidator; exports.createSelectValidator = createSelectValidator; exports.createMultiselectValidator = createMultiselectValidator; exports.createLocationValidator = createLocationValidator; exports.createFileValidator = createFileValidator; exports.createUserValidator = createUserValidator; exports.createSingleRelationValidator = createSingleRelationValidator; exports.createMultiRelationValidator = createMultiRelationValidator; exports.createRelationValidator = createRelationValidator; exports.createRatingValidator = createRatingValidator; exports.createFormulaValidator = createFormulaValidator; exports.createRollupValidator = createRollupValidator; exports.createTextAreaValidator = createTextAreaValidator; exports.createRichtextValidator = createRichtextValidator; exports.createAttributeValidator = createAttributeValidator; exports.createFormAttributeValidator = createFormAttributeValidator; exports.createObjectValidator = createObjectValidator; exports.validateAttribute = validateAttribute; exports.validateObject = validateObject; exports.validateObjectOrThrow = validateObjectOrThrow; exports.createDraftValidator = createDraftValidator; exports.validateDraft = validateDraft; exports.validateDraftOrThrow = validateDraftOrThrow; exports.getMissingRequiredAttributes = getMissingRequiredAttributes; exports.isRecordComplete = isRecordComplete; exports.computeRecordStatus = computeRecordStatus; exports.ParticipationTokenService = ParticipationTokenService; exports.getDefaultTokenService = getDefaultTokenService; exports.initializeTokenService = initializeTokenService; exports.PinCodeService = PinCodeService; exports.getDefaultPinCodeService = getDefaultPinCodeService; exports.initializePinCodeService = initializePinCodeService; exports.cacheKeys = cacheKeys; exports.cacheTtl = cacheTtl; exports.NoopCacheAdapter = NoopCacheAdapter; exports.formatRecord = formatRecord; exports.formatRecords = formatRecords; exports.createDefaultState = createDefaultState; exports.SHORTCUT_TO_FILTER_OPERATOR = SHORTCUT_TO_FILTER_OPERATOR; exports.QueryNoResultError = QueryNoResultError; exports.QueryMultipleResultsError = QueryMultipleResultsError; exports.TenantContextError = TenantContextError; exports.getSchemaFromContext = getSchemaFromContext; exports.getSchemaByNameFromContext = getSchemaByNameFromContext; exports.hasSchemaContext = hasSchemaContext; exports.getSchemaContext = getSchemaContext; exports.addSchemaToContext = addSchemaToContext; exports.runWithSchemaContext = runWithSchemaContext; exports.runWithMergedSchemaContext = runWithMergedSchemaContext; exports.getContext = getContext; exports.getTenantId = getTenantId; exports.getUserId = getUserId; exports.hasContext = hasContext; exports.runWithContext = runWithContext; exports.withTenantContext = withTenantContext; exports.QueryBuilder = QueryBuilder; exports.createQueryBuilder = createQueryBuilder; exports.evaluateCondition = evaluateCondition; exports.evaluate = evaluate; exports.evaluateWithTrace = evaluateWithTrace; exports.ExecutorRegistry = ExecutorRegistry; exports.success = success; exports.wait = wait; exports.complete = complete; exports.error = error; exports.ConditionExecutor = ConditionExecutor; exports.EndExecutor = EndExecutor; exports.FormExecutor = FormExecutor; exports.StartExecutor = StartExecutor; exports.createDefaultExecutorRegistry = createDefaultExecutorRegistry; exports.getDefaultExecutorRegistry = getDefaultExecutorRegistry; exports.evaluateFormula = evaluateFormula; exports.evaluateFormulaWithResult = evaluateFormulaWithResult; exports.formatFormulaResult = formatFormulaResult; exports.evaluateFormulaAttribute = evaluateFormulaAttribute; exports.validateFormulaExpression = validateFormulaExpression; exports.extractFormulaVariables = extractFormulaVariables; exports.extractRelationReferences = extractRelationReferences; exports.extractRelationNames = extractRelationNames; exports.hasRelationReferences = hasRelationReferences; exports.flattenRelationsForEval = flattenRelationsForEval; exports.evaluateFormulaWithRelations = evaluateFormulaWithRelations; exports.evaluateFormulaAttributeWithRelations = evaluateFormulaAttributeWithRelations; exports.InvalidPathError = InvalidPathError; exports.MaxDepthExceededError = MaxDepthExceededError; exports.parsePath = parsePath; exports.validatePath = validatePath; exports.pathHasManyCardinality = pathHasManyCardinality; exports.getPathDepth = getPathDepth; exports.getTargetAttributeName = getTargetAttributeName; exports.getRelationPath = getRelationPath; exports.traversePath = traversePath; exports.resolveSingleValue = resolveSingleValue; exports.resolveMultiplePaths = resolveMultiplePaths; exports.NoopHookRegistry = NoopHookRegistry; exports.DEFAULT_LABEL_FALLBACK = DEFAULT_LABEL_FALLBACK; exports.renderLabelExpression = renderLabelExpression; exports.isLabelExpression = isLabelExpression; exports.extractAttributeNames = extractAttributeNames; exports.enrichValuesForDisplay = enrichValuesForDisplay; exports.enrichValuesWithSelectLabels = enrichValuesWithSelectLabels; exports.extractRelationIds = extractRelationIds; exports.computeLabelWithRelations = computeLabelWithRelations; exports.createMockAdapter = createMockAdapter; exports.PolicyRegistry = PolicyRegistry; exports.defaultPolicyRegistry = defaultPolicyRegistry; exports.notesPolicy = notesPolicy; exports.buildAuditChanges = buildAuditChanges; exports.TenantAwareService = TenantAwareService; exports.TenantAwareRepository = TenantAwareRepository; exports.SchemaContextAwareRepository = SchemaContextAwareRepository; exports.AuditService = AuditService; exports.FileService = FileService; exports.GeocodingService = GeocodingService; exports.GlobalSearchService = GlobalSearchService; exports.ObjectSchemaService = ObjectSchemaService; exports.PermissionService = PermissionService; exports.RelationService = RelationService; exports.RollupService = RollupService; exports.UserService = UserService; exports.RecordService = RecordService; exports.RelationResolverService = RelationResolverService; exports.RollupScheduler = RollupScheduler; exports.UserProfileService = UserProfileService; exports.ViewService = ViewService; exports.WorkflowInstanceService = WorkflowInstanceService; exports.WorkflowParticipationService = WorkflowParticipationService; exports.WorkflowRelationService = WorkflowRelationService; exports.WorkflowService = WorkflowService; exports.syncNativeViews = syncNativeViews; exports.verifyNativeViewsSync = verifyNativeViewsSync; exports.getViewSyncPreview = getViewSyncPreview; exports.syncNativeObjects = syncNativeObjects; exports.verifyNativeObjectsSync = verifyNativeObjectsSync; exports.getSyncPreview = getSyncPreview; exports.syncAll = syncAll;
|