@stndrds/schema 1.0.0-alpha.265 → 1.0.0-alpha.267

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 (47) hide show
  1. package/dist/all--B2_3ksI.d.ts +465 -0
  2. package/dist/all-D5zeUllO.d.mts +465 -0
  3. package/dist/chunk-63WWFZFY.js +1262 -0
  4. package/dist/{chunk-ZBQEMIAV.js → chunk-FDIAOFHS.js} +11 -8
  5. package/dist/chunk-ITGE3PBX.mjs +1215 -0
  6. package/dist/{chunk-UXCJ3NI4.mjs → chunk-KDHDC7E6.mjs} +150 -9
  7. package/dist/{chunk-U36ZIBEM.mjs → chunk-O73ROMWQ.mjs} +15 -6
  8. package/dist/{chunk-QIWADKYA.mjs → chunk-POULKEJM.mjs} +11 -9
  9. package/dist/{chunk-EBGRZUIH.js → chunk-Q4SZAMJT.js} +5 -0
  10. package/dist/{chunk-NGGU6BSN.mjs → chunk-QMLO7V5E.mjs} +6 -6
  11. package/dist/{chunk-L4U5QEQL.js → chunk-QN2N3IJZ.js} +158 -8
  12. package/dist/{chunk-JUKLL5RJ.mjs → chunk-R5LAJCBU.mjs} +5 -2
  13. package/dist/{chunk-NI3HCSYH.js → chunk-V6Q7HCA7.js} +11 -11
  14. package/dist/{chunk-QAF3HNKQ.js → chunk-ZPFOKBIN.js} +16 -5
  15. package/dist/exceptions.d.mts +21 -8
  16. package/dist/exceptions.d.ts +21 -8
  17. package/dist/exceptions.js +42 -38
  18. package/dist/exceptions.mjs +1 -1
  19. package/dist/helpers-C1VVEAOO.d.mts +76 -0
  20. package/dist/helpers-vQ6kp8ET.d.ts +76 -0
  21. package/dist/index-Bq1KrQkR.d.ts +2413 -0
  22. package/dist/index-DtxtOBYT.d.mts +2413 -0
  23. package/dist/index.d.mts +1516 -2212
  24. package/dist/index.d.ts +1516 -2212
  25. package/dist/index.js +1294 -1038
  26. package/dist/index.mjs +911 -905
  27. package/dist/{helpers-eyrnPJEF.d.ts → objects-A1ED9af-.d.ts} +32 -77
  28. package/dist/{helpers-uKLet0kF.d.mts → objects-BCaBw2ef.d.mts} +32 -77
  29. package/dist/validation/all.d.mts +4 -2
  30. package/dist/validation/all.d.ts +4 -2
  31. package/dist/validation/all.js +88 -16
  32. package/dist/validation/all.mjs +9 -9
  33. package/dist/validation/complex/phone.js +2 -2
  34. package/dist/validation/complex/phone.mjs +1 -1
  35. package/dist/validation/config/index.d.mts +5 -18
  36. package/dist/validation/config/index.d.ts +5 -18
  37. package/dist/validation/config/index.js +34 -4
  38. package/dist/validation/config/index.mjs +7 -1
  39. package/dist/validation/object/index.d.mts +2 -2
  40. package/dist/validation/object/index.d.ts +2 -2
  41. package/dist/validation/object/index.js +19 -19
  42. package/dist/validation/object/index.mjs +7 -7
  43. package/dist/validation/primitives/text.js +2 -2
  44. package/dist/validation/primitives/text.mjs +1 -1
  45. package/package.json +2 -2
  46. package/dist/chunk-PGERPYDR.js +0 -2
  47. package/dist/chunk-SP3PNHYF.mjs +0 -1
@@ -10,6 +10,7 @@ var SchemaErrorCode = {
10
10
  RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND",
11
11
  ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND",
12
12
  MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND",
13
+ SCHEMA_PLAN_NOT_FOUND: "SCHEMA_PLAN_NOT_FOUND",
13
14
  // Validation
14
15
  VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED",
15
16
  INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME",
@@ -180,6 +181,12 @@ var RecordNotFoundError = class extends NotFoundError {
180
181
  this.name = "RecordNotFoundError";
181
182
  }
182
183
  };
184
+ var SchemaPlanNotFoundError = class extends NotFoundError {
185
+ constructor(planId) {
186
+ super("Schema plan", planId, SchemaErrorCode.SCHEMA_PLAN_NOT_FOUND);
187
+ this.name = "SchemaPlanNotFoundError";
188
+ }
189
+ };
183
190
  var ValidationError = class _ValidationError extends SchemaError {
184
191
  constructor(message, errors) {
185
192
  super(message, SchemaErrorCode.VALIDATION_FAILED, { errors });
@@ -280,19 +287,14 @@ var OrphanSystemAttributeError = class extends SchemaError {
280
287
  var DestructiveSyncNotAllowedError = class extends SchemaError {
281
288
  constructor(operations) {
282
289
  const summary = operations.map((op) => {
283
- if (op.type === "remove_attribute") {
284
- return `- remove_attribute "${op.objectName ?? "?"}.${op.name}"`;
285
- }
286
- if (op.type === "remove_object") {
287
- return "- remove_object";
288
- }
289
- return `- ${op.type}`;
290
+ const named = op;
291
+ return named.name ? `- ${op.type} "${named.name}"` : `- ${op.type}`;
290
292
  }).join("\n");
291
293
  super(
292
294
  `Destructive schema operations detected (data will be lost):
293
295
  ${summary}
294
296
 
295
- To allow Standards to apply these automatically, set the environment variable:
297
+ These are applied only under an explicit opt-in; without it boot demotes the object to runtime and keeps its rows. To let Standards apply them automatically, set the environment variable:
296
298
  STANDARDS_ALLOW_DESTRUCTIVE_SYNC=1
297
299
 
298
300
  Otherwise, revert your code changes or back up the data first.`,
@@ -531,6 +533,7 @@ exports.RepositoryError = RepositoryError;
531
533
  exports.RoleNotFoundError = RoleNotFoundError;
532
534
  exports.SchemaError = SchemaError;
533
535
  exports.SchemaErrorCode = SchemaErrorCode;
536
+ exports.SchemaPlanNotFoundError = SchemaPlanNotFoundError;
534
537
  exports.SearchBackendError = SearchBackendError;
535
538
  exports.StorageError = StorageError;
536
539
  exports.SyncCascadeError = SyncCascadeError;