@stndrds/schema 0.1.0-alpha.57 → 0.1.0-alpha.58
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-DPRLHGPO.js → chunk-2OS63USQ.js} +270 -916
- package/dist/{chunk-YVUSATKC.mjs → chunk-JRY236AO.mjs} +76 -722
- package/dist/chunk-NEVERCM3.js +41 -0
- package/dist/chunk-SV4BCGQU.mjs +617 -0
- package/dist/chunk-U4AB53AM.js +617 -0
- package/dist/chunk-V2RPPE2Y.mjs +41 -0
- package/dist/index.d.mts +51 -29
- package/dist/index.d.ts +51 -29
- package/dist/index.js +10 -100
- package/dist/index.mjs +76 -166
- package/dist/{runtime-BqJdmg_4.d.mts → runtime-C4vB_EcQ.d.ts} +5 -1645
- package/dist/{runtime-BqJdmg_4.d.ts → runtime-SCsDOQi0.d.mts} +5 -1645
- package/dist/runtime.d.mts +3 -1
- package/dist/runtime.d.ts +3 -1
- package/dist/runtime.js +4 -2
- package/dist/runtime.mjs +3 -1
- package/dist/utils.d.mts +154 -0
- package/dist/utils.d.ts +154 -0
- package/dist/utils.js +19 -0
- package/dist/utils.mjs +19 -0
- package/dist/validation/validators.d.mts +4 -0
- package/dist/validation/validators.d.ts +4 -0
- package/dist/validation/validators.js +121 -0
- package/dist/validation/validators.mjs +121 -0
- package/dist/validators-BgmWgr-G.d.mts +1488 -0
- package/dist/validators-miARInAq.d.ts +1488 -0
- package/package.json +12 -2
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
CustomTabConfig,
|
|
18
18
|
DEFAULT_LABEL_FALLBACK,
|
|
19
19
|
DEFAULT_THEME,
|
|
20
|
-
DEFAULT_VALIDATION_MESSAGES,
|
|
21
20
|
DRIVING_LICENSE,
|
|
22
21
|
DetailViewBuilder,
|
|
23
22
|
DirectTableTabConfig,
|
|
@@ -151,9 +150,6 @@ import {
|
|
|
151
150
|
addSchemaToContext,
|
|
152
151
|
and,
|
|
153
152
|
applyDefaultValues,
|
|
154
|
-
asTenantId,
|
|
155
|
-
asUserId,
|
|
156
|
-
attributeConfigSchemas,
|
|
157
153
|
buildAuditChanges,
|
|
158
154
|
buildPolicyContext,
|
|
159
155
|
cacheKeys,
|
|
@@ -166,54 +162,25 @@ import {
|
|
|
166
162
|
checkRecordModifyOrThrow,
|
|
167
163
|
checkSharedObjectWriteAccess,
|
|
168
164
|
checkbox,
|
|
169
|
-
checkboxConfigSchema,
|
|
170
165
|
complete,
|
|
171
166
|
computeLabel,
|
|
172
167
|
computeLabelWithRelations,
|
|
173
|
-
computeRecordStatus,
|
|
174
|
-
createAttributeValidator,
|
|
175
|
-
createCheckboxValidator,
|
|
176
168
|
createContextForCreate,
|
|
177
169
|
createContextForDelete,
|
|
178
170
|
createContextForRestore,
|
|
179
171
|
createContextForUpdate,
|
|
180
|
-
createCurrencyValidator,
|
|
181
|
-
createDateValidator,
|
|
182
172
|
createDefaultExecutorRegistry,
|
|
183
173
|
createDefaultState,
|
|
184
|
-
createDraftValidator,
|
|
185
174
|
createEmptyContext,
|
|
186
|
-
createFileValidator,
|
|
187
|
-
createFormAttributeValidator,
|
|
188
|
-
createFormulaValidator,
|
|
189
|
-
createLocationValidator,
|
|
190
175
|
createMockAdapter,
|
|
191
|
-
createMultiRelationValidator,
|
|
192
|
-
createMultiselectValidator,
|
|
193
|
-
createNumberValidator,
|
|
194
|
-
createObjectValidator,
|
|
195
|
-
createPhoneValidator,
|
|
196
176
|
createQueryBuilder,
|
|
197
|
-
createRatingValidator,
|
|
198
|
-
createRelationValidator,
|
|
199
|
-
createRichtextValidator,
|
|
200
|
-
createRollupValidator,
|
|
201
|
-
createSelectValidator,
|
|
202
|
-
createSingleRelationValidator,
|
|
203
177
|
createStartTransition,
|
|
204
|
-
createStatusValidator,
|
|
205
|
-
createTextAreaValidator,
|
|
206
|
-
createTextValidator,
|
|
207
|
-
createUserValidator,
|
|
208
178
|
currency,
|
|
209
|
-
currencyConfigSchema,
|
|
210
179
|
date,
|
|
211
|
-
dateConfigSchema,
|
|
212
180
|
defaultPolicyRegistry,
|
|
213
181
|
defaultTtl,
|
|
214
182
|
detailView,
|
|
215
183
|
document,
|
|
216
|
-
documentConfigSchema,
|
|
217
184
|
enrichRecordsWithFormulas,
|
|
218
185
|
enrichValuesForDisplay,
|
|
219
186
|
enrichValuesWithSelectLabels,
|
|
@@ -234,30 +201,21 @@ import {
|
|
|
234
201
|
extractRelationNames,
|
|
235
202
|
extractRelationReferences,
|
|
236
203
|
file,
|
|
237
|
-
fileConfigSchema,
|
|
238
|
-
filterPropertiesByCategory,
|
|
239
204
|
flattenRelationsForEval,
|
|
240
205
|
formatAttributeValue,
|
|
241
206
|
formatFormulaResult,
|
|
242
207
|
formatRecord,
|
|
243
208
|
formatRecords,
|
|
244
209
|
formula,
|
|
245
|
-
formulaConfigSchema,
|
|
246
210
|
generateCssVariables,
|
|
247
|
-
generateId,
|
|
248
|
-
generatePrefixedId,
|
|
249
|
-
generateTemplateName,
|
|
250
|
-
getAttributeConfigSchema,
|
|
251
211
|
getContext,
|
|
252
212
|
getContextValue,
|
|
253
213
|
getDefaultExecutorRegistry,
|
|
254
214
|
getFeatureFlags,
|
|
255
215
|
getFeatureValue,
|
|
256
|
-
getMissingRequiredAttributes,
|
|
257
216
|
getNodeOutputs,
|
|
258
217
|
getPathDepth,
|
|
259
218
|
getPolicy,
|
|
260
|
-
getPropertyProtectionLevel,
|
|
261
219
|
getRelationPath,
|
|
262
220
|
getSchemaByNameFromContext,
|
|
263
221
|
getSchemaContext,
|
|
@@ -273,13 +231,13 @@ import {
|
|
|
273
231
|
group,
|
|
274
232
|
hasContext,
|
|
275
233
|
hasFeatureFlagsContext,
|
|
234
|
+
hasProperties,
|
|
276
235
|
hasRelationReferences,
|
|
277
236
|
hasSchemaContext,
|
|
278
237
|
hashOptions,
|
|
279
238
|
inValues,
|
|
280
239
|
isAdvancedFormNode,
|
|
281
240
|
isBehaviorProperty,
|
|
282
|
-
isConcurrentModificationError,
|
|
283
241
|
isConditionGroup,
|
|
284
242
|
isConditionNode,
|
|
285
243
|
isConditionRule,
|
|
@@ -306,7 +264,6 @@ import {
|
|
|
306
264
|
isNotFoundError,
|
|
307
265
|
isPresentationProperty,
|
|
308
266
|
isProtectedResourceError,
|
|
309
|
-
isRecordComplete,
|
|
310
267
|
isSchemaError,
|
|
311
268
|
isSimpleFormNode,
|
|
312
269
|
isStartNode,
|
|
@@ -321,66 +278,44 @@ import {
|
|
|
321
278
|
isWorkflowPublished,
|
|
322
279
|
listView,
|
|
323
280
|
location,
|
|
324
|
-
locationConfigSchema,
|
|
325
|
-
mergeFormToSlot,
|
|
326
281
|
mergeWithDefaults,
|
|
327
282
|
multiselect,
|
|
328
|
-
multiselectConfigSchema,
|
|
329
283
|
neq,
|
|
330
284
|
notesPolicy,
|
|
331
285
|
number,
|
|
332
|
-
numberConfigSchema,
|
|
333
286
|
object,
|
|
334
287
|
or,
|
|
335
|
-
parseAttributeConfig,
|
|
336
288
|
parsePath,
|
|
337
289
|
pathHasManyCardinality,
|
|
338
290
|
phone,
|
|
339
|
-
phoneConfigSchema,
|
|
340
291
|
rating,
|
|
341
|
-
ratingConfigSchema,
|
|
342
292
|
recalculateParentRollups,
|
|
343
293
|
registry,
|
|
344
294
|
relation,
|
|
345
|
-
relationConfigSchema,
|
|
346
295
|
renderLabelExpression,
|
|
347
296
|
resolveMultiplePaths,
|
|
348
297
|
resolveSingleValue,
|
|
349
298
|
richtext,
|
|
350
|
-
richtextConfigSchema,
|
|
351
299
|
rollup,
|
|
352
|
-
rollupConfigSchema,
|
|
353
300
|
runWithContext,
|
|
354
301
|
runWithFeatureFlags,
|
|
355
302
|
runWithMergedSchemaContext,
|
|
356
303
|
runWithSchemaContext,
|
|
357
|
-
safeParseAttributeConfig,
|
|
358
304
|
seedRegistryViews,
|
|
359
305
|
select,
|
|
360
|
-
selectConfigSchema,
|
|
361
306
|
setContextValue,
|
|
362
|
-
slugify,
|
|
363
307
|
status,
|
|
364
|
-
statusConfigSchema,
|
|
365
308
|
success,
|
|
366
309
|
syncAll,
|
|
367
310
|
syncNativeObjects,
|
|
368
311
|
syncNativeViews,
|
|
369
312
|
text,
|
|
370
|
-
textConfigSchema,
|
|
371
313
|
textarea,
|
|
372
|
-
|
|
314
|
+
toUndefinedIfEmpty,
|
|
373
315
|
traversePath,
|
|
374
316
|
tryGetFeatureValue,
|
|
375
317
|
user,
|
|
376
|
-
userConfigSchema,
|
|
377
|
-
validateAttribute,
|
|
378
|
-
validateAttributeConfig,
|
|
379
|
-
validateDraft,
|
|
380
|
-
validateDraftOrThrow,
|
|
381
318
|
validateFormulaExpression,
|
|
382
|
-
validateObject,
|
|
383
|
-
validateObjectOrThrow,
|
|
384
319
|
validatePath,
|
|
385
320
|
verifyNativeObjectsSync,
|
|
386
321
|
verifyNativeViewsSync,
|
|
@@ -390,7 +325,76 @@ import {
|
|
|
390
325
|
withFeatureFlags,
|
|
391
326
|
withTenantContext,
|
|
392
327
|
workflow
|
|
393
|
-
} from "./chunk-
|
|
328
|
+
} from "./chunk-JRY236AO.mjs";
|
|
329
|
+
import {
|
|
330
|
+
asTenantId,
|
|
331
|
+
asUserId,
|
|
332
|
+
generateId,
|
|
333
|
+
generatePrefixedId,
|
|
334
|
+
generateTemplateName,
|
|
335
|
+
indexBy,
|
|
336
|
+
slugify
|
|
337
|
+
} from "./chunk-V2RPPE2Y.mjs";
|
|
338
|
+
import {
|
|
339
|
+
DEFAULT_VALIDATION_MESSAGES,
|
|
340
|
+
attributeConfigSchemas,
|
|
341
|
+
checkboxConfigSchema,
|
|
342
|
+
computeRecordStatus,
|
|
343
|
+
createAttributeValidator,
|
|
344
|
+
createCheckboxValidator,
|
|
345
|
+
createCurrencyValidator,
|
|
346
|
+
createDateValidator,
|
|
347
|
+
createDraftValidator,
|
|
348
|
+
createFileValidator,
|
|
349
|
+
createFormAttributeValidator,
|
|
350
|
+
createFormulaValidator,
|
|
351
|
+
createLocationValidator,
|
|
352
|
+
createMultiRelationValidator,
|
|
353
|
+
createMultiselectValidator,
|
|
354
|
+
createNumberValidator,
|
|
355
|
+
createObjectValidator,
|
|
356
|
+
createPhoneValidator,
|
|
357
|
+
createRatingValidator,
|
|
358
|
+
createRelationValidator,
|
|
359
|
+
createRichtextValidator,
|
|
360
|
+
createRollupValidator,
|
|
361
|
+
createSelectValidator,
|
|
362
|
+
createSingleRelationValidator,
|
|
363
|
+
createStatusValidator,
|
|
364
|
+
createTextAreaValidator,
|
|
365
|
+
createTextValidator,
|
|
366
|
+
createUserValidator,
|
|
367
|
+
currencyConfigSchema,
|
|
368
|
+
dateConfigSchema,
|
|
369
|
+
documentConfigSchema,
|
|
370
|
+
fileConfigSchema,
|
|
371
|
+
formatZodErrors,
|
|
372
|
+
formulaConfigSchema,
|
|
373
|
+
getAttributeConfigSchema,
|
|
374
|
+
getMissingRequiredAttributes,
|
|
375
|
+
isRecordComplete,
|
|
376
|
+
locationConfigSchema,
|
|
377
|
+
multiselectConfigSchema,
|
|
378
|
+
numberConfigSchema,
|
|
379
|
+
parseAttributeConfig,
|
|
380
|
+
phoneConfigSchema,
|
|
381
|
+
ratingConfigSchema,
|
|
382
|
+
relationConfigSchema,
|
|
383
|
+
richtextConfigSchema,
|
|
384
|
+
rollupConfigSchema,
|
|
385
|
+
safeParseAttributeConfig,
|
|
386
|
+
selectConfigSchema,
|
|
387
|
+
statusConfigSchema,
|
|
388
|
+
textConfigSchema,
|
|
389
|
+
textareaConfigSchema,
|
|
390
|
+
userConfigSchema,
|
|
391
|
+
validateAttribute,
|
|
392
|
+
validateAttributeConfig,
|
|
393
|
+
validateDraft,
|
|
394
|
+
validateDraftOrThrow,
|
|
395
|
+
validateObject,
|
|
396
|
+
validateObjectOrThrow
|
|
397
|
+
} from "./chunk-SV4BCGQU.mjs";
|
|
394
398
|
import {
|
|
395
399
|
ALL_SYSTEM_RESOURCES,
|
|
396
400
|
DEFAULT_ROLES,
|
|
@@ -403,43 +407,7 @@ import {
|
|
|
403
407
|
} from "./chunk-V5QXU2OK.mjs";
|
|
404
408
|
import "./chunk-Y6FXYEAI.mjs";
|
|
405
409
|
|
|
406
|
-
// src/types/document-generation.ts
|
|
407
|
-
function isPdfTemplateSource(source) {
|
|
408
|
-
return source.type === "pdf";
|
|
409
|
-
}
|
|
410
|
-
function isDocxTemplateSource(source) {
|
|
411
|
-
return source.type === "docx";
|
|
412
|
-
}
|
|
413
|
-
|
|
414
410
|
// src/types/filters.ts
|
|
415
|
-
function isAdvancedFilterState(state) {
|
|
416
|
-
return "groups" in state;
|
|
417
|
-
}
|
|
418
|
-
function toAdvancedFilterState(state) {
|
|
419
|
-
if (state.rules.length === 0) {
|
|
420
|
-
return {
|
|
421
|
-
combinator: state.combinator,
|
|
422
|
-
groups: []
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
return {
|
|
426
|
-
combinator: "and",
|
|
427
|
-
groups: [
|
|
428
|
-
{
|
|
429
|
-
id: crypto.randomUUID(),
|
|
430
|
-
combinator: state.combinator,
|
|
431
|
-
rules: state.rules
|
|
432
|
-
}
|
|
433
|
-
]
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
function toSimpleFilterState(state) {
|
|
437
|
-
const allRules = state.groups.flatMap((group2) => group2.rules);
|
|
438
|
-
return {
|
|
439
|
-
combinator: state.combinator,
|
|
440
|
-
rules: allRules
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
411
|
var OPERATORS_BY_TYPE = {
|
|
444
412
|
text: [
|
|
445
413
|
"is",
|
|
@@ -1390,57 +1358,6 @@ function generateFallbackView(object2, type, options = {}) {
|
|
|
1390
1358
|
throw new Error(`Fallback generation not supported for view type: ${type}`);
|
|
1391
1359
|
}
|
|
1392
1360
|
}
|
|
1393
|
-
function generateModalDetailView(object2, attributeNames) {
|
|
1394
|
-
const excludeAttributes = attributeNames ? object2.attributes.filter((attr) => !attributeNames.includes(attr.name)).map((attr) => attr.name) : [];
|
|
1395
|
-
const visibleAttrs = getVisibleAttributes(object2.attributes, excludeAttributes);
|
|
1396
|
-
const sortedAttrs = sortAttributes(visibleAttrs);
|
|
1397
|
-
const formTab = {
|
|
1398
|
-
id: "form",
|
|
1399
|
-
name: "form",
|
|
1400
|
-
label: "Details",
|
|
1401
|
-
type: "form",
|
|
1402
|
-
groups: [
|
|
1403
|
-
{
|
|
1404
|
-
id: "general",
|
|
1405
|
-
label: "General",
|
|
1406
|
-
fields: sortedAttrs.map(attributeToField),
|
|
1407
|
-
order: 0
|
|
1408
|
-
}
|
|
1409
|
-
],
|
|
1410
|
-
order: 0
|
|
1411
|
-
};
|
|
1412
|
-
const config = {
|
|
1413
|
-
layout: "modal",
|
|
1414
|
-
tabs: [formTab]
|
|
1415
|
-
};
|
|
1416
|
-
return {
|
|
1417
|
-
name: "default-modal",
|
|
1418
|
-
label: "Default Modal View",
|
|
1419
|
-
object: object2.name,
|
|
1420
|
-
type: "detail",
|
|
1421
|
-
config,
|
|
1422
|
-
default: true
|
|
1423
|
-
};
|
|
1424
|
-
}
|
|
1425
|
-
function generateKanbanListView(object2, groupByAttribute, options = {}) {
|
|
1426
|
-
const { excludeAttributes = [], maxListColumns = 5 } = options;
|
|
1427
|
-
const visibleAttrs = getVisibleAttributes(object2.attributes, excludeAttributes);
|
|
1428
|
-
const sortedAttrs = sortAttributes(visibleAttrs);
|
|
1429
|
-
const columns = sortedAttrs.filter((attr) => attr.name !== groupByAttribute).slice(0, maxListColumns).map((attr) => attr.name);
|
|
1430
|
-
const config = {
|
|
1431
|
-
layout: "kanban",
|
|
1432
|
-
columns,
|
|
1433
|
-
groupByAttribute
|
|
1434
|
-
};
|
|
1435
|
-
return {
|
|
1436
|
-
name: "kanban",
|
|
1437
|
-
label: "Kanban View",
|
|
1438
|
-
object: object2.name,
|
|
1439
|
-
type: "list",
|
|
1440
|
-
config,
|
|
1441
|
-
default: false
|
|
1442
|
-
};
|
|
1443
|
-
}
|
|
1444
1361
|
|
|
1445
1362
|
// src/views/view-reset.ts
|
|
1446
1363
|
function getPreservedDetailTabs(view2, options) {
|
|
@@ -1827,13 +1744,13 @@ export {
|
|
|
1827
1744
|
extractRelationReferences,
|
|
1828
1745
|
file,
|
|
1829
1746
|
fileConfigSchema,
|
|
1830
|
-
filterPropertiesByCategory,
|
|
1831
1747
|
flagRegistry,
|
|
1832
1748
|
flattenRelationsForEval,
|
|
1833
1749
|
formatAttributeValue,
|
|
1834
1750
|
formatFormulaResult,
|
|
1835
1751
|
formatRecord,
|
|
1836
1752
|
formatRecords,
|
|
1753
|
+
formatZodErrors,
|
|
1837
1754
|
formula,
|
|
1838
1755
|
formulaConfigSchema,
|
|
1839
1756
|
generateCssVariables,
|
|
@@ -1841,8 +1758,6 @@ export {
|
|
|
1841
1758
|
generateDefaultListView,
|
|
1842
1759
|
generateFallbackView,
|
|
1843
1760
|
generateId,
|
|
1844
|
-
generateKanbanListView,
|
|
1845
|
-
generateModalDetailView,
|
|
1846
1761
|
generatePrefixedId,
|
|
1847
1762
|
generateTemplateName,
|
|
1848
1763
|
getAttributeConfigSchema,
|
|
@@ -1855,7 +1770,6 @@ export {
|
|
|
1855
1770
|
getNodeOutputs,
|
|
1856
1771
|
getPathDepth,
|
|
1857
1772
|
getPolicy,
|
|
1858
|
-
getPropertyProtectionLevel,
|
|
1859
1773
|
getRelationPath,
|
|
1860
1774
|
getSchemaByNameFromContext,
|
|
1861
1775
|
getSchemaContext,
|
|
@@ -1871,16 +1785,16 @@ export {
|
|
|
1871
1785
|
group,
|
|
1872
1786
|
hasContext,
|
|
1873
1787
|
hasFeatureFlagsContext,
|
|
1788
|
+
hasProperties,
|
|
1874
1789
|
hasRelationReferences,
|
|
1875
1790
|
hasSchemaContext,
|
|
1876
1791
|
hashOptions,
|
|
1877
1792
|
inValues,
|
|
1793
|
+
indexBy,
|
|
1878
1794
|
isActivityTab,
|
|
1879
|
-
isAdvancedFilterState,
|
|
1880
1795
|
isAdvancedFormNode,
|
|
1881
1796
|
isBehaviorProperty,
|
|
1882
1797
|
isCalendarView,
|
|
1883
|
-
isConcurrentModificationError,
|
|
1884
1798
|
isConditionGroup,
|
|
1885
1799
|
isConditionNode,
|
|
1886
1800
|
isConditionRule,
|
|
@@ -1890,7 +1804,6 @@ export {
|
|
|
1890
1804
|
isDirectTableTab,
|
|
1891
1805
|
isDocumentNode,
|
|
1892
1806
|
isDocumentsTab,
|
|
1893
|
-
isDocxTemplateSource,
|
|
1894
1807
|
isEmpty,
|
|
1895
1808
|
isEndNode,
|
|
1896
1809
|
isFeatureEnabled,
|
|
@@ -1920,7 +1833,6 @@ export {
|
|
|
1920
1833
|
isNotEmpty,
|
|
1921
1834
|
isNotFoundError,
|
|
1922
1835
|
isNotesTab,
|
|
1923
|
-
isPdfTemplateSource,
|
|
1924
1836
|
isPresentationProperty,
|
|
1925
1837
|
isProtectedResourceError,
|
|
1926
1838
|
isRecordComplete,
|
|
@@ -1944,7 +1856,6 @@ export {
|
|
|
1944
1856
|
listView,
|
|
1945
1857
|
location,
|
|
1946
1858
|
locationConfigSchema,
|
|
1947
|
-
mergeFormToSlot,
|
|
1948
1859
|
mergeWithDefaults,
|
|
1949
1860
|
multiselect,
|
|
1950
1861
|
multiselectConfigSchema,
|
|
@@ -1995,8 +1906,7 @@ export {
|
|
|
1995
1906
|
textConfigSchema,
|
|
1996
1907
|
textarea,
|
|
1997
1908
|
textareaConfigSchema,
|
|
1998
|
-
|
|
1999
|
-
toSimpleFilterState,
|
|
1909
|
+
toUndefinedIfEmpty,
|
|
2000
1910
|
traversePath,
|
|
2001
1911
|
tryGetFeatureValue,
|
|
2002
1912
|
user,
|