@stndrds/schema 0.1.0-alpha.14 → 0.1.0-alpha.15

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.
Files changed (52) hide show
  1. package/dist/chunk-2ASXJITY.mjs +5360 -0
  2. package/dist/chunk-5AWYVQKR.mjs +5310 -0
  3. package/dist/chunk-65HUQZHK.mjs +5374 -0
  4. package/dist/chunk-73P4F2OU.mjs +5809 -0
  5. package/dist/chunk-BHKKVBPP.mjs +5527 -0
  6. package/dist/chunk-BUWVNOSK.mjs +5457 -0
  7. package/dist/chunk-CCEHW4E7.mjs +6071 -0
  8. package/dist/chunk-CNR3BZLU.mjs +5163 -0
  9. package/dist/chunk-DLMVX6DN.mjs +6074 -0
  10. package/dist/chunk-DUUORFHI.mjs +5379 -0
  11. package/dist/chunk-DWTD7YPJ.mjs +74 -0
  12. package/dist/chunk-FAR5ENGR.mjs +78 -0
  13. package/dist/chunk-ITWOVZOW.mjs +5809 -0
  14. package/dist/chunk-KJLKY5X7.mjs +6314 -0
  15. package/dist/chunk-KTJXMGBR.mjs +5397 -0
  16. package/dist/chunk-NOVHQ7B2.mjs +6327 -0
  17. package/dist/chunk-PMFQ4ZL4.mjs +6230 -0
  18. package/dist/chunk-QC47SMCZ.mjs +5467 -0
  19. package/dist/chunk-Z6LIJ5PO.mjs +5362 -0
  20. package/dist/default-roles-G4TOWUVM.mjs +20 -0
  21. package/dist/default-roles-QEZPRSUL.mjs +20 -0
  22. package/dist/index.d.mts +193 -15
  23. package/dist/index.d.ts +193 -15
  24. package/dist/index.js +1657 -118
  25. package/dist/index.mjs +56 -163
  26. package/dist/runtime-B1_syHVj.d.mts +4787 -0
  27. package/dist/runtime-B1_syHVj.d.ts +4787 -0
  28. package/dist/runtime-B7N-oycb.d.mts +4854 -0
  29. package/dist/runtime-B7N-oycb.d.ts +4854 -0
  30. package/dist/runtime-BDoAIuTe.d.mts +4872 -0
  31. package/dist/runtime-BDoAIuTe.d.ts +4872 -0
  32. package/dist/runtime-BVRmzg3d.d.mts +4718 -0
  33. package/dist/runtime-BVRmzg3d.d.ts +4718 -0
  34. package/dist/runtime-BrXwIidf.d.mts +4794 -0
  35. package/dist/runtime-BrXwIidf.d.ts +4794 -0
  36. package/dist/runtime-CC_HZhVN.d.mts +5224 -0
  37. package/dist/runtime-CC_HZhVN.d.ts +5224 -0
  38. package/dist/runtime-CEx57sBZ.d.mts +4791 -0
  39. package/dist/runtime-CEx57sBZ.d.ts +4791 -0
  40. package/dist/runtime-COGvuXIq.d.mts +4790 -0
  41. package/dist/runtime-COGvuXIq.d.ts +4790 -0
  42. package/dist/runtime-CSGWjztI.d.mts +5166 -0
  43. package/dist/runtime-CSGWjztI.d.ts +5166 -0
  44. package/dist/runtime-DUxWyRcq.d.mts +5399 -0
  45. package/dist/runtime-DUxWyRcq.d.ts +5399 -0
  46. package/dist/runtime-LO17NDk1.d.mts +5292 -0
  47. package/dist/runtime-LO17NDk1.d.ts +5292 -0
  48. package/dist/runtime.d.mts +1 -1
  49. package/dist/runtime.d.ts +1 -1
  50. package/dist/runtime.js +1645 -97
  51. package/dist/runtime.mjs +7 -1
  52. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1,22 +1,44 @@
1
1
  import {
2
+ AttributeInUseError,
3
+ AttributeNotFoundError,
4
+ AuditService,
2
5
  CustomTabConfig,
3
6
  DEFAULT_LABEL_FALLBACK,
7
+ DuplicateError,
8
+ FileNotFoundError,
4
9
  FileService,
10
+ ForbiddenError,
5
11
  GeocodingService,
6
12
  GlobalSearchService,
7
13
  GroupBuilder,
8
14
  NoopGeocodingAdapter,
9
15
  NoopHookRegistry,
16
+ NotFoundError,
17
+ NotSystemObjectError,
10
18
  ObjectBuilder,
19
+ ObjectNotFoundError,
20
+ ObjectReferencedError,
11
21
  ObjectSchemaService,
22
+ PermissionService,
23
+ ProtectedResourceError,
24
+ ProtectedRoleError,
25
+ RecordNotFoundError,
26
+ RecordReferencedError,
12
27
  RecordService,
13
28
  RelationService,
29
+ RoleNotFoundError,
30
+ SchemaError,
31
+ SchemaErrorCode,
32
+ SyncError,
14
33
  TabBuilder,
15
34
  TableTabConfig,
35
+ UserProfileNotFoundError,
16
36
  UserProfileService,
37
+ ValidationError,
17
38
  ViewBuilder,
18
39
  ViewService,
19
40
  attributeConfigSchemas,
41
+ buildAuditChanges,
20
42
  checkbox,
21
43
  checkboxConfigSchema,
22
44
  computeRecordStatus,
@@ -55,8 +77,13 @@ import {
55
77
  getSyncPreview,
56
78
  getViewSyncPreview,
57
79
  group,
80
+ isForbiddenError,
58
81
  isLabelExpression,
82
+ isNotFoundError,
83
+ isProtectedResourceError,
59
84
  isRecordComplete,
85
+ isSchemaError,
86
+ isValidationError,
60
87
  location,
61
88
  locationConfigSchema,
62
89
  multiselect,
@@ -98,7 +125,17 @@ import {
98
125
  verifyNativeObjectsSync,
99
126
  verifyNativeViewsSync,
100
127
  view
101
- } from "./chunk-GO5NPP2X.mjs";
128
+ } from "./chunk-NOVHQ7B2.mjs";
129
+ import {
130
+ ALL_SYSTEM_RESOURCES,
131
+ DEFAULT_ROLES,
132
+ DEFAULT_ROLE_DESCRIPTIONS,
133
+ DEFAULT_ROLE_LABELS,
134
+ DEFAULT_ROLE_PERMISSIONS,
135
+ SYSTEM_RESOURCES,
136
+ SYSTEM_RESOURCE_LABELS,
137
+ isDefaultRole
138
+ } from "./chunk-FAR5ENGR.mjs";
102
139
 
103
140
  // src/types/filters.ts
104
141
  function isAdvancedFilterState(state) {
@@ -206,168 +243,6 @@ function isCustomTab(tab) {
206
243
  return tab.type === "custom";
207
244
  }
208
245
 
209
- // src/exceptions.ts
210
- var SchemaErrorCode = {
211
- // Generic
212
- UNKNOWN: "SCHEMA_UNKNOWN_ERROR",
213
- // Not Found
214
- OBJECT_NOT_FOUND: "SCHEMA_OBJECT_NOT_FOUND",
215
- ATTRIBUTE_NOT_FOUND: "SCHEMA_ATTRIBUTE_NOT_FOUND",
216
- RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND",
217
- USER_PROFILE_NOT_FOUND: "SCHEMA_USER_PROFILE_NOT_FOUND",
218
- FILE_NOT_FOUND: "SCHEMA_FILE_NOT_FOUND",
219
- // Validation
220
- VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED",
221
- INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME",
222
- INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME",
223
- // Protected Resources
224
- PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT",
225
- PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE",
226
- // Sync
227
- SYNC_FAILED: "SCHEMA_SYNC_FAILED",
228
- NOT_SYSTEM_OBJECT: "SCHEMA_NOT_SYSTEM_OBJECT",
229
- // Duplicates
230
- DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT",
231
- DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE"
232
- };
233
- var SchemaError = class extends Error {
234
- constructor(message, code = SchemaErrorCode.UNKNOWN, details) {
235
- super(message);
236
- this.name = "SchemaError";
237
- this.code = code;
238
- this.details = details;
239
- Object.setPrototypeOf(this, new.target.prototype);
240
- }
241
- toJSON() {
242
- return {
243
- name: this.name,
244
- code: this.code,
245
- message: this.message,
246
- details: this.details
247
- };
248
- }
249
- };
250
- var NotFoundError = class extends SchemaError {
251
- constructor(resourceType, resourceId, code = SchemaErrorCode.RECORD_NOT_FOUND) {
252
- super(`${resourceType} with id "${resourceId}" not found`, code, {
253
- resourceType,
254
- resourceId
255
- });
256
- this.name = "NotFoundError";
257
- this.resourceType = resourceType;
258
- this.resourceId = resourceId;
259
- }
260
- };
261
- var ObjectNotFoundError = class extends NotFoundError {
262
- constructor(objectId) {
263
- super("Object", objectId, SchemaErrorCode.OBJECT_NOT_FOUND);
264
- this.name = "ObjectNotFoundError";
265
- }
266
- };
267
- var AttributeNotFoundError = class extends NotFoundError {
268
- constructor(attributeId) {
269
- super("Attribute", attributeId, SchemaErrorCode.ATTRIBUTE_NOT_FOUND);
270
- this.name = "AttributeNotFoundError";
271
- }
272
- };
273
- var RecordNotFoundError = class extends NotFoundError {
274
- constructor(recordId) {
275
- super("Record", recordId, SchemaErrorCode.RECORD_NOT_FOUND);
276
- this.name = "RecordNotFoundError";
277
- }
278
- };
279
- var UserProfileNotFoundError = class extends NotFoundError {
280
- constructor(identifier) {
281
- super("UserProfile", identifier, SchemaErrorCode.USER_PROFILE_NOT_FOUND);
282
- this.name = "UserProfileNotFoundError";
283
- }
284
- };
285
- var FileNotFoundError = class extends NotFoundError {
286
- constructor(fileId) {
287
- super("File", fileId, SchemaErrorCode.FILE_NOT_FOUND);
288
- this.name = "FileNotFoundError";
289
- }
290
- };
291
- var ValidationError = class _ValidationError extends SchemaError {
292
- constructor(message, errors) {
293
- super(message, SchemaErrorCode.VALIDATION_FAILED, { errors });
294
- this.name = "ValidationError";
295
- this.errors = errors;
296
- }
297
- /**
298
- * Create a validation error from Zod-style errors
299
- */
300
- static fromZodErrors(errors) {
301
- const details = errors.map((err) => ({
302
- path: err.path.map(String),
303
- message: err.message
304
- }));
305
- const message = `Validation failed: ${details.map((d) => `${d.path.join(".")}: ${d.message}`).join(", ")}`;
306
- return new _ValidationError(message, details);
307
- }
308
- };
309
- var ProtectedResourceError = class extends SchemaError {
310
- constructor(resourceType, resourceName, operation) {
311
- const code = resourceType === "object" ? SchemaErrorCode.PROTECTED_OBJECT : SchemaErrorCode.PROTECTED_ATTRIBUTE;
312
- super(`Cannot ${operation} system ${resourceType} "${resourceName}"`, code, {
313
- resourceType,
314
- resourceName,
315
- operation
316
- });
317
- this.name = "ProtectedResourceError";
318
- this.resourceType = resourceType;
319
- this.resourceName = resourceName;
320
- this.operation = operation;
321
- }
322
- };
323
- var SyncError = class extends SchemaError {
324
- constructor(objectName, message, cause) {
325
- super(`Failed to sync object "${objectName}": ${message}`, SchemaErrorCode.SYNC_FAILED, {
326
- objectName,
327
- cause: cause?.message
328
- });
329
- this.name = "SyncError";
330
- this.objectName = objectName;
331
- this.cause = cause;
332
- }
333
- };
334
- var NotSystemObjectError = class extends SchemaError {
335
- constructor(objectName) {
336
- super(
337
- `Object "${objectName}" is not marked as system. Native objects must have system=true.`,
338
- SchemaErrorCode.NOT_SYSTEM_OBJECT,
339
- { objectName }
340
- );
341
- this.name = "NotSystemObjectError";
342
- this.objectName = objectName;
343
- }
344
- };
345
- var DuplicateError = class extends SchemaError {
346
- constructor(resourceType, resourceName) {
347
- const code = resourceType === "object" ? SchemaErrorCode.DUPLICATE_OBJECT : SchemaErrorCode.DUPLICATE_ATTRIBUTE;
348
- super(
349
- `${resourceType === "object" ? "Object" : "Attribute"} "${resourceName}" already exists`,
350
- code,
351
- { resourceType, resourceName }
352
- );
353
- this.name = "DuplicateError";
354
- this.resourceType = resourceType;
355
- this.resourceName = resourceName;
356
- }
357
- };
358
- function isSchemaError(error) {
359
- return error instanceof SchemaError;
360
- }
361
- function isNotFoundError(error) {
362
- return error instanceof NotFoundError;
363
- }
364
- function isValidationError(error) {
365
- return error instanceof ValidationError;
366
- }
367
- function isProtectedResourceError(error) {
368
- return error instanceof ProtectedResourceError;
369
- }
370
-
371
246
  // src/views/registry.ts
372
247
  var ViewRegistry = class {
373
248
  constructor() {
@@ -506,12 +381,20 @@ Available views: ${availableNames}`
506
381
  };
507
382
  var viewRegistry = new ViewRegistry();
508
383
  export {
384
+ ALL_SYSTEM_RESOURCES,
385
+ AttributeInUseError,
509
386
  AttributeNotFoundError,
387
+ AuditService,
510
388
  CustomTabConfig,
511
389
  DEFAULT_LABEL_FALLBACK,
390
+ DEFAULT_ROLES,
391
+ DEFAULT_ROLE_DESCRIPTIONS,
392
+ DEFAULT_ROLE_LABELS,
393
+ DEFAULT_ROLE_PERMISSIONS,
512
394
  DuplicateError,
513
395
  FileNotFoundError,
514
396
  FileService,
397
+ ForbiddenError,
515
398
  GeocodingService,
516
399
  GlobalSearchService,
517
400
  GroupBuilder,
@@ -523,11 +406,18 @@ export {
523
406
  OPERATORS_BY_TYPE,
524
407
  ObjectBuilder,
525
408
  ObjectNotFoundError,
409
+ ObjectReferencedError,
526
410
  ObjectSchemaService,
411
+ PermissionService,
527
412
  ProtectedResourceError,
413
+ ProtectedRoleError,
528
414
  RecordNotFoundError,
415
+ RecordReferencedError,
529
416
  RecordService,
530
417
  RelationService,
418
+ RoleNotFoundError,
419
+ SYSTEM_RESOURCES,
420
+ SYSTEM_RESOURCE_LABELS,
531
421
  SchemaError,
532
422
  SchemaErrorCode,
533
423
  SyncError,
@@ -539,6 +429,7 @@ export {
539
429
  ViewBuilder,
540
430
  ViewService,
541
431
  attributeConfigSchemas,
432
+ buildAuditChanges,
542
433
  checkbox,
543
434
  checkboxConfigSchema,
544
435
  computeRecordStatus,
@@ -579,6 +470,8 @@ export {
579
470
  group,
580
471
  isAdvancedFilterState,
581
472
  isCustomTab,
473
+ isDefaultRole,
474
+ isForbiddenError,
582
475
  isFormTab,
583
476
  isLabelExpression,
584
477
  isNoValueOperator,