@stndrds/schema 1.0.0-alpha.188 → 1.0.0-alpha.190

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var chunkFRCDMQER_js = require('./chunk-FRCDMQER.js');
4
4
  require('./chunk-PGERPYDR.js');
5
5
  var chunkYQROI4IE_js = require('./chunk-YQROI4IE.js');
6
- var chunk64R5X3DF_js = require('./chunk-64R5X3DF.js');
6
+ var chunkFQ2ZYOVS_js = require('./chunk-FQ2ZYOVS.js');
7
7
  require('./chunk-MAKSIK3P.js');
8
8
  require('./chunk-J5HRK3WD.js');
9
9
  require('./chunk-TKN73433.js');
@@ -73,429 +73,6 @@ var MAX_PRESET_DEPTH = 5;
73
73
  // src/types/documents.ts
74
74
  var DEFAULT_DOCUMENT_SLOT = { name: "file" };
75
75
 
76
- // src/exceptions.ts
77
- var SchemaErrorCode = {
78
- // Generic
79
- UNKNOWN: "SCHEMA_UNKNOWN_ERROR",
80
- // Not Found
81
- OBJECT_NOT_FOUND: "SCHEMA_OBJECT_NOT_FOUND",
82
- ATTRIBUTE_NOT_FOUND: "SCHEMA_ATTRIBUTE_NOT_FOUND",
83
- RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND",
84
- ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND",
85
- MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND",
86
- // Validation
87
- VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED",
88
- INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME",
89
- INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME",
90
- // Protected Resources
91
- PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT",
92
- PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE",
93
- PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW",
94
- PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE",
95
- // Permissions
96
- FORBIDDEN: "SCHEMA_FORBIDDEN",
97
- ACCESS_DENIED: "SCHEMA_ACCESS_DENIED",
98
- // Sync
99
- SYNC_FAILED: "SCHEMA_SYNC_FAILED",
100
- SYNC_CONFLICT: "SCHEMA_SYNC_CONFLICT",
101
- SYNC_CASCADE: "SCHEMA_SYNC_CASCADE",
102
- ORPHAN_SYSTEM_ATTRIBUTE: "SCHEMA_ORPHAN_SYSTEM_ATTRIBUTE",
103
- // System Entity Immutability
104
- SYSTEM_ENTITY_IMMUTABLE: "SCHEMA_SYSTEM_ENTITY_IMMUTABLE",
105
- // L2 — migration system simplification (2026-05-17)
106
- DESTRUCTIVE_NOT_ALLOWED: "SCHEMA_DESTRUCTIVE_NOT_ALLOWED",
107
- MIGRATION_TIMEOUT: "SCHEMA_MIGRATION_TIMEOUT",
108
- CHANGE_TYPE_NOT_SUPPORTED: "SCHEMA_CHANGE_TYPE_NOT_SUPPORTED",
109
- // Duplicates
110
- DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT",
111
- DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE",
112
- // Concurrency
113
- CONFLICT: "SCHEMA_CONFLICT",
114
- // Storage
115
- STORAGE_UPLOAD_FAILED: "SCHEMA_STORAGE_UPLOAD_FAILED",
116
- STORAGE_DOWNLOAD_FAILED: "SCHEMA_STORAGE_DOWNLOAD_FAILED",
117
- STORAGE_DELETE_FAILED: "SCHEMA_STORAGE_DELETE_FAILED",
118
- STORAGE_URL_FAILED: "SCHEMA_STORAGE_URL_FAILED",
119
- // Repository Operations
120
- REPOSITORY_CREATE_FAILED: "SCHEMA_REPOSITORY_CREATE_FAILED",
121
- REPOSITORY_UPDATE_FAILED: "SCHEMA_REPOSITORY_UPDATE_FAILED",
122
- REPOSITORY_DELETE_FAILED: "SCHEMA_REPOSITORY_DELETE_FAILED",
123
- REPOSITORY_QUERY_FAILED: "SCHEMA_REPOSITORY_QUERY_FAILED",
124
- // Not Implemented
125
- NOT_IMPLEMENTED: "SCHEMA_NOT_IMPLEMENTED",
126
- // Timeout
127
- TIMEOUT: "SCHEMA_TIMEOUT",
128
- // Schema Integrity
129
- RECORD_REFERENCED: "SCHEMA_RECORD_REFERENCED",
130
- ATTRIBUTE_IN_USE: "SCHEMA_ATTRIBUTE_IN_USE",
131
- OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED"
132
- };
133
- var SchemaError = class extends Error {
134
- constructor(message, code = SchemaErrorCode.UNKNOWN, details) {
135
- super(message);
136
- this.name = "SchemaError";
137
- this.code = code;
138
- this.details = details;
139
- Object.setPrototypeOf(this, new.target.prototype);
140
- }
141
- toJSON() {
142
- return {
143
- name: this.name,
144
- code: this.code,
145
- message: this.message,
146
- details: this.details
147
- };
148
- }
149
- };
150
- var NotFoundError = class extends SchemaError {
151
- constructor(resourceType, resourceId, code = SchemaErrorCode.RECORD_NOT_FOUND) {
152
- super(`${resourceType} with id "${resourceId}" not found`, code, {
153
- resourceType,
154
- resourceId
155
- });
156
- this.name = "NotFoundError";
157
- this.resourceType = resourceType;
158
- this.resourceId = resourceId;
159
- }
160
- };
161
- var ObjectNotFoundError = class extends NotFoundError {
162
- constructor(objectId) {
163
- super("Object", objectId, SchemaErrorCode.OBJECT_NOT_FOUND);
164
- this.name = "ObjectNotFoundError";
165
- }
166
- };
167
- var AttributeNotFoundError = class extends NotFoundError {
168
- constructor(attributeId) {
169
- super("Attribute", attributeId, SchemaErrorCode.ATTRIBUTE_NOT_FOUND);
170
- this.name = "AttributeNotFoundError";
171
- }
172
- };
173
- var RecordNotFoundError = class extends NotFoundError {
174
- constructor(recordId) {
175
- super("Record", recordId, SchemaErrorCode.RECORD_NOT_FOUND);
176
- this.name = "RecordNotFoundError";
177
- }
178
- };
179
- var ValidationError = class _ValidationError extends SchemaError {
180
- constructor(message, errors) {
181
- super(message, SchemaErrorCode.VALIDATION_FAILED, { errors });
182
- this.name = "ValidationError";
183
- this.errors = errors;
184
- }
185
- /**
186
- * Create a validation error from Zod-style errors
187
- */
188
- static fromZodErrors(errors) {
189
- const details = errors.map((err) => ({
190
- path: err.path.map(String),
191
- message: err.message
192
- }));
193
- const message = `Validation failed: ${details.map((d) => `${d.path.join(".")}: ${d.message}`).join(", ")}`;
194
- return new _ValidationError(message, details);
195
- }
196
- };
197
- var ProtectedResourceError = class extends SchemaError {
198
- constructor(resourceType, resourceName, operation) {
199
- const code = resourceType === "object" ? SchemaErrorCode.PROTECTED_OBJECT : resourceType === "view" ? SchemaErrorCode.PROTECTED_VIEW : SchemaErrorCode.PROTECTED_ATTRIBUTE;
200
- super(`Cannot ${operation} system ${resourceType} "${resourceName}"`, code, {
201
- resourceType,
202
- resourceName,
203
- operation
204
- });
205
- this.name = "ProtectedResourceError";
206
- this.resourceType = resourceType;
207
- this.resourceName = resourceName;
208
- this.operation = operation;
209
- }
210
- };
211
- var SyncError = class extends SchemaError {
212
- constructor(objectName, message, cause) {
213
- super(`Failed to sync object "${objectName}": ${message}`, SchemaErrorCode.SYNC_FAILED, {
214
- objectName,
215
- cause: cause?.message
216
- });
217
- this.name = "SyncError";
218
- this.objectName = objectName;
219
- this.cause = cause;
220
- }
221
- };
222
- var SystemEntityImmutableError = class extends SchemaError {
223
- constructor(entityType, entityName) {
224
- super(
225
- `Cannot mutate system ${entityType} "${entityName}". System entities are declared in code and immutable at runtime.`,
226
- SchemaErrorCode.SYSTEM_ENTITY_IMMUTABLE,
227
- { entityType, entityName }
228
- );
229
- this.name = "SystemEntityImmutableError";
230
- this.entityType = entityType;
231
- this.entityName = entityName;
232
- }
233
- };
234
- var SyncConflictError = class extends SchemaError {
235
- constructor(params) {
236
- const target = params.attributeName ? `"${params.objectName}.${params.attributeName}"` : `"${params.objectName}"`;
237
- super(
238
- `Cannot promote runtime entity ${target}: ${params.reason}. Resolve via: (1) relax the code constraint, (2) migrate runtime values manually, or (3) rename the code declaration.`,
239
- SchemaErrorCode.SYNC_CONFLICT,
240
- {
241
- objectName: params.objectName,
242
- attributeName: params.attributeName,
243
- reason: params.reason
244
- }
245
- );
246
- this.name = "SyncConflictError";
247
- this.objectName = params.objectName;
248
- this.attributeName = params.attributeName;
249
- this.reason = params.reason;
250
- }
251
- };
252
- var SyncCascadeError = class extends SchemaError {
253
- constructor(objectName, conflictingAttributes) {
254
- super(
255
- `Cannot demote object "${objectName}": attributes ${conflictingAttributes.join(", ")} are still declared in code. Remove them from code first, or restore the object.`,
256
- SchemaErrorCode.SYNC_CASCADE,
257
- { objectName, conflictingAttributes }
258
- );
259
- this.name = "SyncCascadeError";
260
- this.objectName = objectName;
261
- this.conflictingAttributes = conflictingAttributes;
262
- }
263
- };
264
- var OrphanSystemAttributeError = class extends SchemaError {
265
- constructor(objectName, attributeName) {
266
- super(
267
- `Attribute "${objectName}.${attributeName}" is system:true but its object parent is system:false. This is an invariant violation.`,
268
- SchemaErrorCode.ORPHAN_SYSTEM_ATTRIBUTE,
269
- { objectName, attributeName }
270
- );
271
- this.name = "OrphanSystemAttributeError";
272
- this.objectName = objectName;
273
- this.attributeName = attributeName;
274
- }
275
- };
276
- var DestructiveSyncNotAllowedError = class extends SchemaError {
277
- constructor(operations) {
278
- const summary = operations.map((op) => {
279
- if (op.type === "remove_attribute") {
280
- return `- remove_attribute "${op.objectName ?? "?"}.${op.name}"`;
281
- }
282
- if (op.type === "remove_object") {
283
- return "- remove_object";
284
- }
285
- return `- ${op.type}`;
286
- }).join("\n");
287
- super(
288
- `Destructive schema operations detected (data will be lost):
289
- ${summary}
290
-
291
- To allow Standards to apply these automatically, set the environment variable:
292
- STANDARDS_ALLOW_DESTRUCTIVE_SYNC=1
293
-
294
- Otherwise, revert your code changes or back up the data first.`,
295
- SchemaErrorCode.DESTRUCTIVE_NOT_ALLOWED,
296
- { operations }
297
- );
298
- this.name = "DestructiveSyncNotAllowedError";
299
- this.operations = operations;
300
- }
301
- };
302
- var MigrationTimeoutError = class extends SchemaError {
303
- constructor(objectName, migrated, total, maxDurationMs) {
304
- super(
305
- `Migration for "${objectName}" exceeded the maximum duration (${maxDurationMs}ms). Migrated ${migrated}/${total} records before timeout. Increase STANDARDS_MIGRATION_MAX_DURATION_MS or split the migration into smaller batches.`,
306
- SchemaErrorCode.MIGRATION_TIMEOUT,
307
- { objectName, migrated, total, maxDurationMs }
308
- );
309
- this.name = "MigrationTimeoutError";
310
- this.objectName = objectName;
311
- this.migrated = migrated;
312
- this.total = total;
313
- this.maxDurationMs = maxDurationMs;
314
- }
315
- };
316
- var ChangeTypeNotSupportedError = class extends SchemaError {
317
- constructor(objectName, attributeName) {
318
- super(
319
- `Cannot change type of attribute "${objectName}.${attributeName}" via runtime API. Declare a migration in your schema code:
320
- object("${objectName}").migration(N, (m) =>
321
- m.changeType("${attributeName}", from, to, { transform: (v) => ... })
322
- )`,
323
- SchemaErrorCode.CHANGE_TYPE_NOT_SUPPORTED,
324
- { objectName, attributeName }
325
- );
326
- this.name = "ChangeTypeNotSupportedError";
327
- this.objectName = objectName;
328
- this.attributeName = attributeName;
329
- }
330
- };
331
- var DuplicateError = class extends SchemaError {
332
- constructor(resourceType, resourceName) {
333
- const code = resourceType === "object" ? SchemaErrorCode.DUPLICATE_OBJECT : SchemaErrorCode.DUPLICATE_ATTRIBUTE;
334
- super(
335
- `${resourceType === "object" ? "Object" : "Attribute"} "${resourceName}" already exists`,
336
- code,
337
- { resourceType, resourceName }
338
- );
339
- this.name = "DuplicateError";
340
- this.resourceType = resourceType;
341
- this.resourceName = resourceName;
342
- }
343
- };
344
- function isSchemaError(error) {
345
- return error instanceof SchemaError;
346
- }
347
- function isNotFoundError(error) {
348
- return error instanceof NotFoundError;
349
- }
350
- function isValidationError(error) {
351
- return error instanceof ValidationError;
352
- }
353
- function isProtectedResourceError(error) {
354
- return error instanceof ProtectedResourceError;
355
- }
356
- var ForbiddenError = class extends SchemaError {
357
- constructor(objectName, action, userId) {
358
- super(`No ${action} permission on object "${objectName}"`, SchemaErrorCode.FORBIDDEN, {
359
- objectName,
360
- action,
361
- userId
362
- });
363
- this.name = "ForbiddenError";
364
- this.objectName = objectName;
365
- this.action = action;
366
- this.userId = userId;
367
- }
368
- };
369
- var ProtectedRoleError = class extends SchemaError {
370
- constructor(roleName, operation) {
371
- super(`Cannot ${operation} system role "${roleName}"`, SchemaErrorCode.PROTECTED_ROLE, {
372
- roleName,
373
- operation
374
- });
375
- this.name = "ProtectedRoleError";
376
- this.roleName = roleName;
377
- this.operation = operation;
378
- }
379
- };
380
- var RoleNotFoundError = class extends NotFoundError {
381
- constructor(roleId) {
382
- super("Role", roleId, SchemaErrorCode.ROLE_NOT_FOUND);
383
- this.name = "RoleNotFoundError";
384
- }
385
- };
386
- var ConcurrentModificationError = class extends SchemaError {
387
- constructor(recordId) {
388
- super(
389
- `Record ${recordId} was modified by another request. Please refresh and try again.`,
390
- SchemaErrorCode.CONFLICT,
391
- { recordId }
392
- );
393
- }
394
- };
395
- var StorageError = class extends SchemaError {
396
- constructor(operation, message, path, cause) {
397
- const code = operation === "upload" ? SchemaErrorCode.STORAGE_UPLOAD_FAILED : operation === "download" ? SchemaErrorCode.STORAGE_DOWNLOAD_FAILED : operation === "delete" ? SchemaErrorCode.STORAGE_DELETE_FAILED : SchemaErrorCode.STORAGE_URL_FAILED;
398
- super(`Storage ${operation} failed: ${message}`, code, {
399
- operation,
400
- path,
401
- cause
402
- });
403
- this.name = "StorageError";
404
- this.operation = operation;
405
- this.path = path;
406
- this.cause = cause;
407
- }
408
- };
409
- var AccessDeniedError = class extends SchemaError {
410
- constructor(resource, reason) {
411
- super(reason ?? `Access denied to resource: ${resource}`, SchemaErrorCode.ACCESS_DENIED, {
412
- resource,
413
- reason
414
- });
415
- this.name = "AccessDeniedError";
416
- this.resource = resource;
417
- this.reason = reason;
418
- }
419
- };
420
- var RepositoryError = class extends SchemaError {
421
- constructor(operation, entity, message, cause) {
422
- const code = operation === "create" ? SchemaErrorCode.REPOSITORY_CREATE_FAILED : operation === "update" ? SchemaErrorCode.REPOSITORY_UPDATE_FAILED : operation === "delete" ? SchemaErrorCode.REPOSITORY_DELETE_FAILED : SchemaErrorCode.REPOSITORY_QUERY_FAILED;
423
- super(`Failed to ${operation} ${entity}: ${message}`, code, {
424
- operation,
425
- entity,
426
- cause
427
- });
428
- this.name = "RepositoryError";
429
- this.operation = operation;
430
- this.entity = entity;
431
- this.cause = cause;
432
- }
433
- };
434
- var NotImplementedError = class extends SchemaError {
435
- constructor(feature, milestone) {
436
- const message = milestone ? `${feature}: not implemented (${milestone})` : `${feature}: not implemented`;
437
- super(message, SchemaErrorCode.NOT_IMPLEMENTED, {
438
- feature,
439
- milestone
440
- });
441
- this.name = "NotImplementedError";
442
- this.feature = feature;
443
- this.milestone = milestone;
444
- }
445
- };
446
- var MemoryNotFoundError = class extends NotFoundError {
447
- constructor(memoryId) {
448
- super("Memory", memoryId, SchemaErrorCode.MEMORY_NOT_FOUND);
449
- this.name = "MemoryNotFoundError";
450
- }
451
- };
452
- var RecordReferencedError = class extends SchemaError {
453
- constructor(recordId, references) {
454
- const total = references.reduce((sum, r) => sum + r.count, 0);
455
- super(
456
- `Cannot delete record: referenced by ${total} record${total > 1 ? "s" : ""}`,
457
- SchemaErrorCode.RECORD_REFERENCED,
458
- { recordId, references }
459
- );
460
- this.name = "RecordReferencedError";
461
- this.recordId = recordId;
462
- this.references = references;
463
- }
464
- };
465
- var AttributeInUseError = class extends SchemaError {
466
- constructor(attributeName, usage) {
467
- super(
468
- `Cannot delete attribute "${attributeName}": used in ${usage}`,
469
- SchemaErrorCode.ATTRIBUTE_IN_USE,
470
- { attributeName, usage }
471
- );
472
- this.name = "AttributeInUseError";
473
- this.attributeName = attributeName;
474
- this.usage = usage;
475
- }
476
- };
477
- var ObjectReferencedError = class extends SchemaError {
478
- constructor(objectName, referencingObjects) {
479
- super(
480
- `Cannot delete object "${objectName}": target of relations in ${referencingObjects.join(", ")}`,
481
- SchemaErrorCode.OBJECT_REFERENCED,
482
- { objectName, referencingObjects }
483
- );
484
- this.name = "ObjectReferencedError";
485
- this.objectName = objectName;
486
- this.referencingObjects = referencingObjects;
487
- }
488
- };
489
- function isRecordReferencedError(error) {
490
- return error instanceof RecordReferencedError;
491
- }
492
- function isAttributeInUseError(error) {
493
- return error instanceof AttributeInUseError;
494
- }
495
- function isObjectReferencedError(error) {
496
- return error instanceof ObjectReferencedError;
497
- }
498
-
499
76
  // src/types/errors.ts
500
77
  function getErrorMessage(error) {
501
78
  if (error instanceof Error) return error.message;
@@ -1471,7 +1048,7 @@ var BaseAttributeBuilder = class {
1471
1048
  * @see https://standardschema.dev/
1472
1049
  */
1473
1050
  get "~standard"() {
1474
- const zodSchema = chunk64R5X3DF_js.createAttributeValidator(this.build());
1051
+ const zodSchema = chunkFQ2ZYOVS_js.createAttributeValidator(this.build());
1475
1052
  return createStandardSchemaProps(zodSchema);
1476
1053
  }
1477
1054
  constructor(type, name, label) {
@@ -2849,7 +2426,7 @@ var ObjectBuilder = class {
2849
2426
  * @see https://standardschema.dev/
2850
2427
  */
2851
2428
  get "~standard"() {
2852
- const zodSchema = chunk64R5X3DF_js.createObjectValidator(this.build());
2429
+ const zodSchema = chunkFQ2ZYOVS_js.createObjectValidator(this.build());
2853
2430
  return createStandardSchemaProps(zodSchema);
2854
2431
  }
2855
2432
  /**
@@ -5817,7 +5394,7 @@ function assertOperatorForType(operator, type, context) {
5817
5394
  if (!ops?.includes(operator)) {
5818
5395
  const validList = ops?.length ? ops.join(", ") : "(no operators registered for this type)";
5819
5396
  const summary = `Operator "${operator}" is not valid for ${context} type "${type}". Valid operators: ${validList}.`;
5820
- throw new ValidationError(summary, [
5397
+ throw new chunkFQ2ZYOVS_js.ValidationError(summary, [
5821
5398
  {
5822
5399
  path: ["operator"],
5823
5400
  message: summary
@@ -5829,19 +5406,19 @@ function validateQualifiedRule(rule, context) {
5829
5406
  const rootAttr = context.attributes.find((a) => a.name === rule.attribute);
5830
5407
  const systemOps = SYSTEM_FILTER_OPERATORS[rule.attribute];
5831
5408
  if (!(rootAttr || systemOps)) {
5832
- throw new ValidationError(`Unknown attribute: ${rule.attribute}`, [
5409
+ throw new chunkFQ2ZYOVS_js.ValidationError(`Unknown attribute: ${rule.attribute}`, [
5833
5410
  { path: ["attribute"], message: `Unknown attribute: ${rule.attribute}` }
5834
5411
  ]);
5835
5412
  }
5836
5413
  if (!rootAttr) {
5837
5414
  if (rule.property) {
5838
- throw new ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
5415
+ throw new chunkFQ2ZYOVS_js.ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
5839
5416
  { path: ["property"], message: `"${rule.attribute}" is a system column, not a reference` }
5840
5417
  ]);
5841
5418
  }
5842
5419
  if (!systemOps.includes(rule.operator)) {
5843
5420
  const summary = `Operator "${rule.operator}" is not valid for system attribute "${rule.attribute}". Valid operators: ${systemOps.join(", ")}.`;
5844
- throw new ValidationError(summary, [{ path: ["operator"], message: summary }]);
5421
+ throw new chunkFQ2ZYOVS_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
5845
5422
  }
5846
5423
  return;
5847
5424
  }
@@ -5853,19 +5430,19 @@ function validateQualifiedRule(rule, context) {
5853
5430
  return;
5854
5431
  }
5855
5432
  if (!REFERENCE_TYPES.has(rootAttr.type)) {
5856
- throw new ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
5433
+ throw new chunkFQ2ZYOVS_js.ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
5857
5434
  { path: ["property"], message: `Attribute "${rule.attribute}" is not a reference type` }
5858
5435
  ]);
5859
5436
  }
5860
5437
  const propSchema = rootAttr.properties;
5861
5438
  if (!propSchema) {
5862
- throw new ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
5439
+ throw new chunkFQ2ZYOVS_js.ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
5863
5440
  { path: ["property"], message: `"${rule.attribute}" has no qualifyWith` }
5864
5441
  ]);
5865
5442
  }
5866
5443
  const propDef = propSchema.definitions.find((p) => p.name === rule.property);
5867
5444
  if (!propDef) {
5868
- throw new ValidationError(
5445
+ throw new chunkFQ2ZYOVS_js.ValidationError(
5869
5446
  `Property "${rule.property}" not defined on "${rule.attribute}".qualifyWith()`,
5870
5447
  [{ path: ["property"], message: `Unknown property: ${rule.property}` }]
5871
5448
  );
@@ -5897,29 +5474,173 @@ Object.defineProperty(exports, "parseAttributeConfig", {
5897
5474
  enumerable: true,
5898
5475
  get: function () { return chunkYQROI4IE_js.parseAttributeConfig; }
5899
5476
  });
5477
+ Object.defineProperty(exports, "AccessDeniedError", {
5478
+ enumerable: true,
5479
+ get: function () { return chunkFQ2ZYOVS_js.AccessDeniedError; }
5480
+ });
5481
+ Object.defineProperty(exports, "AttributeInUseError", {
5482
+ enumerable: true,
5483
+ get: function () { return chunkFQ2ZYOVS_js.AttributeInUseError; }
5484
+ });
5485
+ Object.defineProperty(exports, "AttributeNotFoundError", {
5486
+ enumerable: true,
5487
+ get: function () { return chunkFQ2ZYOVS_js.AttributeNotFoundError; }
5488
+ });
5489
+ Object.defineProperty(exports, "ChangeTypeNotSupportedError", {
5490
+ enumerable: true,
5491
+ get: function () { return chunkFQ2ZYOVS_js.ChangeTypeNotSupportedError; }
5492
+ });
5493
+ Object.defineProperty(exports, "ConcurrentModificationError", {
5494
+ enumerable: true,
5495
+ get: function () { return chunkFQ2ZYOVS_js.ConcurrentModificationError; }
5496
+ });
5497
+ Object.defineProperty(exports, "DestructiveSyncNotAllowedError", {
5498
+ enumerable: true,
5499
+ get: function () { return chunkFQ2ZYOVS_js.DestructiveSyncNotAllowedError; }
5500
+ });
5501
+ Object.defineProperty(exports, "DuplicateError", {
5502
+ enumerable: true,
5503
+ get: function () { return chunkFQ2ZYOVS_js.DuplicateError; }
5504
+ });
5505
+ Object.defineProperty(exports, "ForbiddenError", {
5506
+ enumerable: true,
5507
+ get: function () { return chunkFQ2ZYOVS_js.ForbiddenError; }
5508
+ });
5509
+ Object.defineProperty(exports, "MemoryNotFoundError", {
5510
+ enumerable: true,
5511
+ get: function () { return chunkFQ2ZYOVS_js.MemoryNotFoundError; }
5512
+ });
5513
+ Object.defineProperty(exports, "MigrationTimeoutError", {
5514
+ enumerable: true,
5515
+ get: function () { return chunkFQ2ZYOVS_js.MigrationTimeoutError; }
5516
+ });
5517
+ Object.defineProperty(exports, "NotFoundError", {
5518
+ enumerable: true,
5519
+ get: function () { return chunkFQ2ZYOVS_js.NotFoundError; }
5520
+ });
5521
+ Object.defineProperty(exports, "NotImplementedError", {
5522
+ enumerable: true,
5523
+ get: function () { return chunkFQ2ZYOVS_js.NotImplementedError; }
5524
+ });
5525
+ Object.defineProperty(exports, "ObjectNotFoundError", {
5526
+ enumerable: true,
5527
+ get: function () { return chunkFQ2ZYOVS_js.ObjectNotFoundError; }
5528
+ });
5529
+ Object.defineProperty(exports, "ObjectReferencedError", {
5530
+ enumerable: true,
5531
+ get: function () { return chunkFQ2ZYOVS_js.ObjectReferencedError; }
5532
+ });
5533
+ Object.defineProperty(exports, "OrphanSystemAttributeError", {
5534
+ enumerable: true,
5535
+ get: function () { return chunkFQ2ZYOVS_js.OrphanSystemAttributeError; }
5536
+ });
5537
+ Object.defineProperty(exports, "ProtectedResourceError", {
5538
+ enumerable: true,
5539
+ get: function () { return chunkFQ2ZYOVS_js.ProtectedResourceError; }
5540
+ });
5541
+ Object.defineProperty(exports, "ProtectedRoleError", {
5542
+ enumerable: true,
5543
+ get: function () { return chunkFQ2ZYOVS_js.ProtectedRoleError; }
5544
+ });
5545
+ Object.defineProperty(exports, "RecordNotFoundError", {
5546
+ enumerable: true,
5547
+ get: function () { return chunkFQ2ZYOVS_js.RecordNotFoundError; }
5548
+ });
5549
+ Object.defineProperty(exports, "RecordReferencedError", {
5550
+ enumerable: true,
5551
+ get: function () { return chunkFQ2ZYOVS_js.RecordReferencedError; }
5552
+ });
5553
+ Object.defineProperty(exports, "RepositoryError", {
5554
+ enumerable: true,
5555
+ get: function () { return chunkFQ2ZYOVS_js.RepositoryError; }
5556
+ });
5557
+ Object.defineProperty(exports, "RoleNotFoundError", {
5558
+ enumerable: true,
5559
+ get: function () { return chunkFQ2ZYOVS_js.RoleNotFoundError; }
5560
+ });
5561
+ Object.defineProperty(exports, "SchemaError", {
5562
+ enumerable: true,
5563
+ get: function () { return chunkFQ2ZYOVS_js.SchemaError; }
5564
+ });
5565
+ Object.defineProperty(exports, "SchemaErrorCode", {
5566
+ enumerable: true,
5567
+ get: function () { return chunkFQ2ZYOVS_js.SchemaErrorCode; }
5568
+ });
5569
+ Object.defineProperty(exports, "StorageError", {
5570
+ enumerable: true,
5571
+ get: function () { return chunkFQ2ZYOVS_js.StorageError; }
5572
+ });
5573
+ Object.defineProperty(exports, "SyncCascadeError", {
5574
+ enumerable: true,
5575
+ get: function () { return chunkFQ2ZYOVS_js.SyncCascadeError; }
5576
+ });
5577
+ Object.defineProperty(exports, "SyncConflictError", {
5578
+ enumerable: true,
5579
+ get: function () { return chunkFQ2ZYOVS_js.SyncConflictError; }
5580
+ });
5581
+ Object.defineProperty(exports, "SyncError", {
5582
+ enumerable: true,
5583
+ get: function () { return chunkFQ2ZYOVS_js.SyncError; }
5584
+ });
5585
+ Object.defineProperty(exports, "SystemEntityImmutableError", {
5586
+ enumerable: true,
5587
+ get: function () { return chunkFQ2ZYOVS_js.SystemEntityImmutableError; }
5588
+ });
5589
+ Object.defineProperty(exports, "ValidationError", {
5590
+ enumerable: true,
5591
+ get: function () { return chunkFQ2ZYOVS_js.ValidationError; }
5592
+ });
5900
5593
  Object.defineProperty(exports, "computeRecordStatus", {
5901
5594
  enumerable: true,
5902
- get: function () { return chunk64R5X3DF_js.computeRecordStatus; }
5595
+ get: function () { return chunkFQ2ZYOVS_js.computeRecordStatus; }
5903
5596
  });
5904
5597
  Object.defineProperty(exports, "createFormAttributeValidator", {
5905
5598
  enumerable: true,
5906
- get: function () { return chunk64R5X3DF_js.createFormAttributeValidator; }
5599
+ get: function () { return chunkFQ2ZYOVS_js.createFormAttributeValidator; }
5600
+ });
5601
+ Object.defineProperty(exports, "isAttributeInUseError", {
5602
+ enumerable: true,
5603
+ get: function () { return chunkFQ2ZYOVS_js.isAttributeInUseError; }
5604
+ });
5605
+ Object.defineProperty(exports, "isNotFoundError", {
5606
+ enumerable: true,
5607
+ get: function () { return chunkFQ2ZYOVS_js.isNotFoundError; }
5608
+ });
5609
+ Object.defineProperty(exports, "isObjectReferencedError", {
5610
+ enumerable: true,
5611
+ get: function () { return chunkFQ2ZYOVS_js.isObjectReferencedError; }
5612
+ });
5613
+ Object.defineProperty(exports, "isProtectedResourceError", {
5614
+ enumerable: true,
5615
+ get: function () { return chunkFQ2ZYOVS_js.isProtectedResourceError; }
5616
+ });
5617
+ Object.defineProperty(exports, "isRecordReferencedError", {
5618
+ enumerable: true,
5619
+ get: function () { return chunkFQ2ZYOVS_js.isRecordReferencedError; }
5620
+ });
5621
+ Object.defineProperty(exports, "isSchemaError", {
5622
+ enumerable: true,
5623
+ get: function () { return chunkFQ2ZYOVS_js.isSchemaError; }
5624
+ });
5625
+ Object.defineProperty(exports, "isValidationError", {
5626
+ enumerable: true,
5627
+ get: function () { return chunkFQ2ZYOVS_js.isValidationError; }
5907
5628
  });
5908
5629
  Object.defineProperty(exports, "validateDraft", {
5909
5630
  enumerable: true,
5910
- get: function () { return chunk64R5X3DF_js.validateDraft; }
5631
+ get: function () { return chunkFQ2ZYOVS_js.validateDraft; }
5911
5632
  });
5912
5633
  Object.defineProperty(exports, "validateDraftOrThrow", {
5913
5634
  enumerable: true,
5914
- get: function () { return chunk64R5X3DF_js.validateDraftOrThrow; }
5635
+ get: function () { return chunkFQ2ZYOVS_js.validateDraftOrThrow; }
5915
5636
  });
5916
5637
  Object.defineProperty(exports, "validateObject", {
5917
5638
  enumerable: true,
5918
- get: function () { return chunk64R5X3DF_js.validateObject; }
5639
+ get: function () { return chunkFQ2ZYOVS_js.validateObject; }
5919
5640
  });
5920
5641
  Object.defineProperty(exports, "validateObjectOrThrow", {
5921
5642
  enumerable: true,
5922
- get: function () { return chunk64R5X3DF_js.validateObjectOrThrow; }
5643
+ get: function () { return chunkFQ2ZYOVS_js.validateObjectOrThrow; }
5923
5644
  });
5924
5645
  Object.defineProperty(exports, "DEFAULT_VALIDATION_MESSAGES", {
5925
5646
  enumerable: true,
@@ -5932,13 +5653,8 @@ Object.defineProperty(exports, "formatZodErrors", {
5932
5653
  exports.ALLOWED_PROPERTY_TYPES = ALLOWED_PROPERTY_TYPES;
5933
5654
  exports.ALL_ACTIONS = ALL_ACTIONS;
5934
5655
  exports.ALL_SYSTEM_RESOURCES = ALL_SYSTEM_RESOURCES;
5935
- exports.AccessDeniedError = AccessDeniedError;
5936
5656
  exports.ActivityTabConfig = ActivityTabConfig;
5937
- exports.AttributeInUseError = AttributeInUseError;
5938
- exports.AttributeNotFoundError = AttributeNotFoundError;
5939
5657
  exports.BEHAVIOR_PROPERTIES = BEHAVIOR_PROPERTIES;
5940
- exports.ChangeTypeNotSupportedError = ChangeTypeNotSupportedError;
5941
- exports.ConcurrentModificationError = ConcurrentModificationError;
5942
5658
  exports.CustomTabConfig = CustomTabConfig;
5943
5659
  exports.DB_COLUMN_FIELDS = DB_COLUMN_FIELDS;
5944
5660
  exports.DEFAULT_DOCUMENT_SLOT = DEFAULT_DOCUMENT_SLOT;
@@ -5947,16 +5663,13 @@ exports.DEFAULT_ROLE_DESCRIPTIONS = DEFAULT_ROLE_DESCRIPTIONS;
5947
5663
  exports.DEFAULT_ROLE_LABELS = DEFAULT_ROLE_LABELS;
5948
5664
  exports.DEFAULT_ROLE_PERMISSIONS = DEFAULT_ROLE_PERMISSIONS;
5949
5665
  exports.DOCUMENT_SYSTEM_ATTRIBUTES = DOCUMENT_SYSTEM_ATTRIBUTES;
5950
- exports.DestructiveSyncNotAllowedError = DestructiveSyncNotAllowedError;
5951
5666
  exports.DetailViewBuilder = DetailViewBuilder;
5952
5667
  exports.DocumentSlotValidationError = DocumentSlotValidationError;
5953
5668
  exports.DocumentsTabConfig = DocumentsTabConfig;
5954
- exports.DuplicateError = DuplicateError;
5955
5669
  exports.EMPTY_VALUE_PLACEHOLDER = EMPTY_VALUE_PLACEHOLDER;
5956
5670
  exports.FORM_FORBIDDEN_ATTRIBUTE_TYPES = FORM_FORBIDDEN_ATTRIBUTE_TYPES;
5957
5671
  exports.FlagRegistry = FlagRegistry;
5958
5672
  exports.FlagService = FlagService;
5959
- exports.ForbiddenError = ForbiddenError;
5960
5673
  exports.FormBuilder = FormBuilder;
5961
5674
  exports.FormRegistry = FormRegistry;
5962
5675
  exports.FormRowBuilder = FormRowBuilder;
@@ -5968,47 +5681,26 @@ exports.ListViewBuilder = ListViewBuilder;
5968
5681
  exports.ListViewTabConfigBuilder = ListViewTabConfigBuilder;
5969
5682
  exports.MAX_PRESET_DEPTH = MAX_PRESET_DEPTH;
5970
5683
  exports.MaxDepthExceededError = MaxDepthExceededError;
5971
- exports.MemoryNotFoundError = MemoryNotFoundError;
5972
- exports.MigrationTimeoutError = MigrationTimeoutError;
5973
5684
  exports.NO_VALUE_OPERATORS = NO_VALUE_OPERATORS;
5974
5685
  exports.NoopGeocodingAdapter = NoopGeocodingAdapter;
5975
- exports.NotFoundError = NotFoundError;
5976
- exports.NotImplementedError = NotImplementedError;
5977
5686
  exports.OPERATORS_BY_TYPE = OPERATORS_BY_TYPE;
5978
5687
  exports.OPERATOR_SPECS = OPERATOR_SPECS;
5979
5688
  exports.ObjectBuilder = ObjectBuilder;
5980
- exports.ObjectNotFoundError = ObjectNotFoundError;
5981
- exports.ObjectReferencedError = ObjectReferencedError;
5982
- exports.OrphanSystemAttributeError = OrphanSystemAttributeError;
5983
5689
  exports.PRESENTATION_PROPERTIES = PRESENTATION_PROPERTIES;
5984
- exports.ProtectedResourceError = ProtectedResourceError;
5985
- exports.ProtectedRoleError = ProtectedRoleError;
5986
5690
  exports.QUALIFIED_SEPARATOR = QUALIFIED_SEPARATOR;
5987
5691
  exports.RELATION_TARGET_ANY = RELATION_TARGET_ANY;
5988
5692
  exports.RESERVED_ATTRIBUTE_NAMES = RESERVED_ATTRIBUTE_NAMES;
5989
- exports.RecordNotFoundError = RecordNotFoundError;
5990
- exports.RecordReferencedError = RecordReferencedError;
5991
5693
  exports.RelationGroupBuilder = RelationGroupBuilder;
5992
- exports.RepositoryError = RepositoryError;
5993
5694
  exports.RichtextTabConfig = RichtextTabConfig;
5994
- exports.RoleNotFoundError = RoleNotFoundError;
5995
5695
  exports.STANDARD_SCHEMA_VENDOR = STANDARD_SCHEMA_VENDOR;
5996
5696
  exports.SYSTEM_ATTRIBUTES = SYSTEM_ATTRIBUTES;
5997
5697
  exports.SYSTEM_ATTRIBUTE_I18N_KEYS = SYSTEM_ATTRIBUTE_I18N_KEYS;
5998
5698
  exports.SYSTEM_FIELD_NAMES = SYSTEM_FIELD_NAMES;
5999
5699
  exports.SYSTEM_RESOURCES = SYSTEM_RESOURCES;
6000
5700
  exports.SYSTEM_RESOURCE_LABELS = SYSTEM_RESOURCE_LABELS;
6001
- exports.SchemaError = SchemaError;
6002
- exports.SchemaErrorCode = SchemaErrorCode;
6003
- exports.StorageError = StorageError;
6004
- exports.SyncCascadeError = SyncCascadeError;
6005
- exports.SyncConflictError = SyncConflictError;
6006
- exports.SyncError = SyncError;
6007
- exports.SystemEntityImmutableError = SystemEntityImmutableError;
6008
5701
  exports.TabBuilder = TabBuilder;
6009
5702
  exports.TableTabConfig = TableTabConfig;
6010
5703
  exports.USER_STATUSES = USER_STATUSES;
6011
- exports.ValidationError = ValidationError;
6012
5704
  exports.accessLevelToActions = accessLevelToActions;
6013
5705
  exports.actionsToAccessLevel = actionsToAccessLevel;
6014
5706
  exports.applyPipes = applyPipes;
@@ -6054,7 +5746,6 @@ exports.group = group;
6054
5746
  exports.hasOptions = hasOptions;
6055
5747
  exports.hasRelationReferences = hasRelationReferences;
6056
5748
  exports.inferInverseCardinality = inferInverseCardinality;
6057
- exports.isAttributeInUseError = isAttributeInUseError;
6058
5749
  exports.isAttributeSortable = isAttributeSortable;
6059
5750
  exports.isBilateralRelation = isBilateralRelation;
6060
5751
  exports.isDefaultRole = isDefaultRole;
@@ -6073,15 +5764,9 @@ exports.isLabelExpression = isLabelExpression;
6073
5764
  exports.isListView = isListView;
6074
5765
  exports.isNoValueOperator = isNoValueOperator;
6075
5766
  exports.isNotEmpty = isNotEmpty;
6076
- exports.isNotFoundError = isNotFoundError;
6077
- exports.isObjectReferencedError = isObjectReferencedError;
6078
- exports.isProtectedResourceError = isProtectedResourceError;
6079
- exports.isRecordReferencedError = isRecordReferencedError;
6080
5767
  exports.isRelationGroup = isRelationGroup;
6081
- exports.isSchemaError = isSchemaError;
6082
5768
  exports.isStandardSchema = isStandardSchema;
6083
5769
  exports.isUniversalRelation = isUniversalRelation;
6084
- exports.isValidationError = isValidationError;
6085
5770
  exports.jsonFlag = jsonFlag;
6086
5771
  exports.listView = listView;
6087
5772
  exports.location = location;