@stndrds/schema 1.0.0-alpha.302 → 1.0.0-alpha.304

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 (65) hide show
  1. package/dist/{all-CarWsKlE.d.ts → all-CeFWLwRo.d.ts} +25 -25
  2. package/dist/{all-CNJlNEG2.d.mts → all-DCP_3Gfp.d.mts} +25 -25
  3. package/dist/attributes-CJNqalP0.d.mts +1350 -0
  4. package/dist/attributes-CJNqalP0.d.ts +1350 -0
  5. package/dist/chunk-CCB4E55H.mjs +2 -0
  6. package/dist/chunk-JKGRSRRX.js +2 -0
  7. package/dist/exceptions.d.mts +1 -536
  8. package/dist/exceptions.d.ts +1 -536
  9. package/dist/{helpers-MEZ69ERH.d.mts → helpers-BnyKRb4x.d.mts} +3 -3
  10. package/dist/{helpers-BQ524PQe.d.ts → helpers-DIWzq1cf.d.ts} +3 -3
  11. package/dist/{index-DL0rfjzZ.d.ts → index-B36J5GDI.d.ts} +2 -2
  12. package/dist/{index-Kd4QZ13G.d.mts → index-DcXCAPHR.d.mts} +2 -2
  13. package/dist/index.d.mts +101 -23
  14. package/dist/index.d.ts +101 -23
  15. package/dist/index.js +17 -17
  16. package/dist/index.mjs +17 -17
  17. package/dist/{objects-D8tojUPV.d.ts → objects-CfJvQbZc.d.ts} +1 -3
  18. package/dist/{objects-DvZ79fW2.d.mts → objects-DglxOigU.d.mts} +1 -3
  19. package/dist/{types-R2f1GdCB.d.ts → types-CEwRsyh0.d.ts} +1 -1
  20. package/dist/{types-M5L07ItN.d.mts → types-Co8cq3dM.d.mts} +1 -1
  21. package/dist/utils.d.mts +2 -134
  22. package/dist/utils.d.ts +2 -134
  23. package/dist/utils.js +1 -1
  24. package/dist/utils.mjs +1 -1
  25. package/dist/validation/all.d.mts +6 -8
  26. package/dist/validation/all.d.ts +6 -8
  27. package/dist/validation/complex/currency.d.mts +2 -3
  28. package/dist/validation/complex/currency.d.ts +2 -3
  29. package/dist/validation/complex/location.d.mts +2 -3
  30. package/dist/validation/complex/location.d.ts +2 -3
  31. package/dist/validation/complex/phone.d.mts +2 -3
  32. package/dist/validation/complex/phone.d.ts +2 -3
  33. package/dist/validation/complex/relation.d.mts +2 -3
  34. package/dist/validation/complex/relation.d.ts +2 -3
  35. package/dist/validation/complex/richtext.d.mts +2 -3
  36. package/dist/validation/complex/richtext.d.ts +2 -3
  37. package/dist/validation/complex/select.d.mts +2 -3
  38. package/dist/validation/complex/select.d.ts +2 -3
  39. package/dist/validation/complex/user.d.mts +2 -3
  40. package/dist/validation/complex/user.d.ts +2 -3
  41. package/dist/validation/computed/formula.d.mts +2 -3
  42. package/dist/validation/computed/formula.d.ts +2 -3
  43. package/dist/validation/computed/rollup.d.mts +2 -3
  44. package/dist/validation/computed/rollup.d.ts +2 -3
  45. package/dist/validation/config/index.d.mts +3 -5
  46. package/dist/validation/config/index.d.ts +3 -5
  47. package/dist/validation/core/index.d.mts +3 -4
  48. package/dist/validation/core/index.d.ts +3 -4
  49. package/dist/validation/object/index.d.mts +4 -6
  50. package/dist/validation/object/index.d.ts +4 -6
  51. package/dist/validation/primitives/checkbox.d.mts +2 -3
  52. package/dist/validation/primitives/checkbox.d.ts +2 -3
  53. package/dist/validation/primitives/date.d.mts +2 -3
  54. package/dist/validation/primitives/date.d.ts +2 -3
  55. package/dist/validation/primitives/number.d.mts +2 -3
  56. package/dist/validation/primitives/number.d.ts +2 -3
  57. package/dist/validation/primitives/text.d.mts +2 -3
  58. package/dist/validation/primitives/text.d.ts +2 -3
  59. package/package.json +2 -2
  60. package/dist/attributes-DfhBu4HT.d.ts +0 -590
  61. package/dist/attributes-Zw-DDGE7.d.mts +0 -590
  62. package/dist/chunk-64F3CCLD.mjs +0 -2
  63. package/dist/chunk-ZMDMQAV5.js +0 -2
  64. package/dist/migrations-B1Wl_3RY.d.ts +0 -39
  65. package/dist/migrations-BG2mNaJn.d.mts +0 -39
@@ -1,537 +1,2 @@
1
- import { S as SchemaOperation } from './migrations-B1Wl_3RY.js';
2
- import './attributes-DfhBu4HT.js';
1
+ export { J as AccessDeniedError, Q as AttributeInUseError, W as AttributeNotFoundError, X as AttributeUsage, _ as ChangeTypeNotSupportedError, a6 as ConcurrentModificationError, a9 as DestructiveSyncNotAllowedError, aa as DuplicateError, ab as ForbiddenError, ac as MemoryNotFoundError, ad as MigrationTimeoutError, af as NotFoundError, ag as NotImplementedError, ai as ObjectNotFoundError, aj as ObjectReferencedError, al as OrphanSystemAttributeError, an as ProtectedResourceError, ao as ProtectedRoleError, aq as RecordNotFoundError, ar as RecordReference, as as RecordReferencedError, at as RepositoryError, au as RepositoryOperation, av as ReservedObjectNameError, ax as RoleNotFoundError, ay as SchemaError, az as SchemaErrorCode, aB as SchemaPlanNotFoundError, aC as SearchBackendError, aE as StorageError, aF as StorageOperation, aG as SyncCascadeError, aH as SyncConflictError, aI as SyncError, aJ as SystemEntityImmutableError, V as ValidationError, aL as ValidationErrorDetail, aU as isAttributeInUseError, aX as isNotFoundError, aY as isObjectReferencedError, aZ as isProtectedResourceError, a_ as isRecordReferencedError, a$ as isSchemaError, b1 as isValidationError } from './attributes-CJNqalP0.js';
3
2
  import '@stndrds/constants';
4
- import './utils.js';
5
-
6
- /**
7
- * Error codes for schema exceptions
8
- */
9
- declare const SchemaErrorCode: {
10
- readonly UNKNOWN: "SCHEMA_UNKNOWN_ERROR";
11
- readonly OBJECT_NOT_FOUND: "SCHEMA_OBJECT_NOT_FOUND";
12
- readonly ATTRIBUTE_NOT_FOUND: "SCHEMA_ATTRIBUTE_NOT_FOUND";
13
- readonly RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND";
14
- readonly SOURCE_NOT_FOUND: "SCHEMA_SOURCE_NOT_FOUND";
15
- readonly ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND";
16
- readonly MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND";
17
- readonly SCHEMA_PLAN_NOT_FOUND: "SCHEMA_PLAN_NOT_FOUND";
18
- readonly VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
19
- readonly INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME";
20
- readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
21
- /** A consumer declared, registered, bundled or sourced an object under a framework-native name (#3450). */
22
- readonly RESERVED_OBJECT_NAME: "SCHEMA_RESERVED_OBJECT_NAME";
23
- readonly PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT";
24
- readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
25
- readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
26
- readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
27
- readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
28
- readonly ACCESS_DENIED: "SCHEMA_ACCESS_DENIED";
29
- /**
30
- * A workspace RULE refuses the write — the last owner cannot be removed.
31
- *
32
- * Not `INVARIANT_VIOLATION`, despite the name: that one is an internal
33
- * "should never happen" assertion, a bug signal nobody outside the codebase
34
- * can act on. This is the opposite — a rule the caller can act on, reached
35
- * by a request that was entirely well-formed, whose message tells them how.
36
- */
37
- readonly WORKSPACE_INVARIANT: "SCHEMA_WORKSPACE_INVARIANT";
38
- /** The resource's own state refuses the operation — a disarmed reflex run. */
39
- readonly STATE_GATE: "SCHEMA_STATE_GATE";
40
- /** The operation needs an actor and the request carried none. */
41
- readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
42
- readonly CONNECTOR_AUTH_FAILED: "SCHEMA_CONNECTOR_AUTH_FAILED";
43
- readonly CONNECTOR_INVALID_STATE: "SCHEMA_CONNECTOR_INVALID_STATE";
44
- /**
45
- * The provider issued tokens and the flow failed AFTER that — resolving the
46
- * connected address. Distinct from CONNECTOR_AUTH_FAILED because the user is
47
- * left holding a real grant: consent happened, and it may still be live on the
48
- * provider side even though no connection row exists here.
49
- */
50
- readonly CONNECTOR_GRANT_ORPHANED: "SCHEMA_CONNECTOR_GRANT_ORPHANED";
51
- readonly SYNC_FAILED: "SCHEMA_SYNC_FAILED";
52
- readonly SYNC_CONFLICT: "SCHEMA_SYNC_CONFLICT";
53
- readonly SYNC_CASCADE: "SCHEMA_SYNC_CASCADE";
54
- readonly ORPHAN_SYSTEM_ATTRIBUTE: "SCHEMA_ORPHAN_SYSTEM_ATTRIBUTE";
55
- readonly SYSTEM_ENTITY_IMMUTABLE: "SCHEMA_SYSTEM_ENTITY_IMMUTABLE";
56
- readonly DESTRUCTIVE_NOT_ALLOWED: "SCHEMA_DESTRUCTIVE_NOT_ALLOWED";
57
- readonly MIGRATION_TIMEOUT: "SCHEMA_MIGRATION_TIMEOUT";
58
- readonly CHANGE_TYPE_NOT_SUPPORTED: "SCHEMA_CHANGE_TYPE_NOT_SUPPORTED";
59
- readonly DUPLICATE: "SCHEMA_DUPLICATE";
60
- readonly DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT";
61
- readonly DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE";
62
- readonly CONFLICT: "SCHEMA_CONFLICT";
63
- readonly STORAGE_UPLOAD_FAILED: "SCHEMA_STORAGE_UPLOAD_FAILED";
64
- readonly STORAGE_DOWNLOAD_FAILED: "SCHEMA_STORAGE_DOWNLOAD_FAILED";
65
- readonly STORAGE_DELETE_FAILED: "SCHEMA_STORAGE_DELETE_FAILED";
66
- readonly STORAGE_URL_FAILED: "SCHEMA_STORAGE_URL_FAILED";
67
- readonly REPOSITORY_CREATE_FAILED: "SCHEMA_REPOSITORY_CREATE_FAILED";
68
- readonly REPOSITORY_UPDATE_FAILED: "SCHEMA_REPOSITORY_UPDATE_FAILED";
69
- readonly REPOSITORY_DELETE_FAILED: "SCHEMA_REPOSITORY_DELETE_FAILED";
70
- readonly REPOSITORY_QUERY_FAILED: "SCHEMA_REPOSITORY_QUERY_FAILED";
71
- readonly NOT_IMPLEMENTED: "SCHEMA_NOT_IMPLEMENTED";
72
- readonly TIMEOUT: "SCHEMA_TIMEOUT";
73
- readonly RECORD_REFERENCED: "SCHEMA_RECORD_REFERENCED";
74
- readonly ATTRIBUTE_IN_USE: "SCHEMA_ATTRIBUTE_IN_USE";
75
- readonly OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED";
76
- readonly CONFIGURATION_REQUIRED: "CONFIGURATION_REQUIRED";
77
- readonly SEARCH_ADAPTER_REQUIRED: "SEARCH_ADAPTER_REQUIRED";
78
- readonly CRON_REGISTRATION_FAILED: "CRON_REGISTRATION_FAILED";
79
- readonly SEARCH_BACKEND_FAILED: "SEARCH_BACKEND_FAILED";
80
- readonly INVARIANT_VIOLATION: "INVARIANT_VIOLATION";
81
- readonly TENANT_CONTEXT_MISSING: "TENANT_CONTEXT_MISSING";
82
- readonly FEATURE_FLAGS_CONTEXT: "FEATURE_FLAGS_CONTEXT";
83
- readonly REALTIME_RATE_LIMITED: "REALTIME_RATE_LIMITED";
84
- readonly REALTIME_DELIVERY_FAILED: "REALTIME_DELIVERY_FAILED";
85
- readonly REALTIME_SUBSCRIPTION_FAILED: "REALTIME_SUBSCRIPTION_FAILED";
86
- readonly AGENT_UNKNOWN: "AGENT_UNKNOWN";
87
- readonly AGENT_DEPTH_EXCEEDED: "AGENT_DEPTH_EXCEEDED";
88
- readonly AGENT_COST_LIMIT_EXCEEDED: "AGENT_COST_LIMIT_EXCEEDED";
89
- readonly AGENT_TREE_COST_LIMIT_EXCEEDED: "AGENT_TREE_COST_LIMIT_EXCEEDED";
90
- readonly CREDITS_EXHAUSTED: "CREDITS_EXHAUSTED";
91
- readonly QUOTA_EXCEEDED: "QUOTA_EXCEEDED";
92
- readonly AGENT_SESSION_NOT_FOUND: "AGENT_SESSION_NOT_FOUND";
93
- readonly AGENT_DEFINITION_NOT_FOUND: "AGENT_DEFINITION_NOT_FOUND";
94
- readonly AGENT_RUN_CONFIG: "AGENT_RUN_CONFIG";
95
- readonly AGENT_STREAMING: "AGENT_STREAMING";
96
- readonly AGENT_MISSING_ACTOR: "AGENT_MISSING_ACTOR";
97
- readonly AGENT_INVALID_STATE: "AGENT_INVALID_STATE";
98
- readonly AGENT_COMPACTION_IMPOSSIBLE: "AGENT_COMPACTION_IMPOSSIBLE";
99
- readonly AGENT_COMPACTION_TIMEOUT: "AGENT_COMPACTION_TIMEOUT";
100
- readonly AGENT_LEASE_HELD: "AGENT_LEASE_HELD";
101
- readonly AGENT_WORK_MODE_REQUIRED: "AGENT_WORK_MODE_REQUIRED";
102
- readonly AGENT_MESSAGE_NOT_FOUND: "AGENT_MESSAGE_NOT_FOUND";
103
- readonly AGENT_MESSAGE_NOT_EDITABLE: "AGENT_MESSAGE_NOT_EDITABLE";
104
- readonly DEVICE_NOT_FOUND: "DEVICE_NOT_FOUND";
105
- readonly DEVICE_OFFLINE: "DEVICE_OFFLINE";
106
- readonly AI_UNKNOWN: "AI_UNKNOWN";
107
- readonly AI_USAGE_LIMIT_EXCEEDED: "AI_USAGE_LIMIT_EXCEEDED";
108
- readonly AI_INVALID_USAGE: "AI_INVALID_USAGE";
109
- readonly AI_INVALID_MODEL: "AI_INVALID_MODEL";
110
- readonly AI_INVALID_MODEL_INPUT: "AI_INVALID_MODEL_INPUT";
111
- readonly AI_REPOSITORY_ERROR: "AI_REPOSITORY_ERROR";
112
- readonly AI_GENERATION_FAILED: "AI_GENERATION_FAILED";
113
- readonly AI_IMAGE_USAGE_PENDING: "AI_IMAGE_USAGE_PENDING";
114
- readonly AI_IMAGE_GENERATION_INDETERMINATE: "AI_IMAGE_GENERATION_INDETERMINATE";
115
- readonly AI_IMAGE_PUBLICATION_FAILED: "AI_IMAGE_PUBLICATION_FAILED";
116
- readonly DOCUMENT_MIME_NOT_ACCEPTED: "DOCUMENT_MIME_NOT_ACCEPTED";
117
- readonly DOCUMENT_MULTIPLE_NOT_ALLOWED: "DOCUMENT_MULTIPLE_NOT_ALLOWED";
118
- readonly DOCUMENT_NOT_FOUND_FOR_OPERATION: "DOCUMENT_NOT_FOUND_FOR_OPERATION";
119
- readonly DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED";
120
- readonly DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED";
121
- readonly DOCUMENT_OCR_FAILED: "DOCUMENT_OCR_FAILED";
122
- readonly DOCUMENT_BLOB_EMPTY: "DOCUMENT_BLOB_EMPTY";
123
- readonly DOCUMENT_FILE_TOO_LARGE: "DOCUMENT_FILE_TOO_LARGE";
124
- readonly DOCUMENT_FILE_NOT_FOUND: "DOCUMENT_FILE_NOT_FOUND";
125
- readonly DOCUMENT_FILE_ALREADY_PACKED: "DOCUMENT_FILE_ALREADY_PACKED";
126
- readonly DOCUMENT_RECORD_NOT_FOUND: "DOCUMENT_RECORD_NOT_FOUND";
127
- readonly DOCUMENT_RECORD_OBJECT_MISMATCH: "DOCUMENT_RECORD_OBJECT_MISMATCH";
128
- readonly DOCUMENT_FOLDER_SERVICE_UNAVAILABLE: "DOCUMENT_FOLDER_SERVICE_UNAVAILABLE";
129
- readonly DOCUMENT_FOLDER_PATH_NOT_FOUND: "DOCUMENT_FOLDER_PATH_NOT_FOUND";
130
- readonly EMAIL_PROVIDER_API_FAILED: "EMAIL_PROVIDER_API_FAILED";
131
- readonly EMAIL_BATCH_ITEM_FAILED: "EMAIL_BATCH_ITEM_FAILED";
132
- readonly CALENDAR_PROVIDER_API_FAILED: "CALENDAR_PROVIDER_API_FAILED";
133
- readonly REFLEX_INVALID_TRANSITION: "REFLEX_INVALID_TRANSITION";
134
- readonly REFLEX_INVALID_TOKEN: "REFLEX_INVALID_TOKEN";
135
- readonly REFLEX_CAPABILITY_DENIED: "REFLEX_CAPABILITY_DENIED";
136
- readonly REFLEX_GATEWAY_UNAVAILABLE: "REFLEX_GATEWAY_UNAVAILABLE";
137
- readonly REFLEX_BUNDLE_FAILED: "REFLEX_BUNDLE_FAILED";
138
- readonly REFLEX_EGRESS_DENIED: "REFLEX_EGRESS_DENIED";
139
- readonly REFLEX_PROTOCOL_VIOLATION: "REFLEX_PROTOCOL_VIOLATION";
140
- readonly REFLEX_RUN_FAILED: "REFLEX_RUN_FAILED";
141
- readonly REFLEX_RUN_TIMEOUT: "REFLEX_RUN_TIMEOUT";
142
- readonly REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT";
143
- readonly REFLEX_NOT_READY: "REFLEX_NOT_READY";
144
- readonly REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION";
145
- /** The embeddings feature is enabled but no Gateway credential is configured. */
146
- readonly EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE";
147
- /** The provider returned vectors whose length differs from the configured dimensions. */
148
- readonly EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH";
149
- };
150
- type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
151
- /**
152
- * Base error class for all schema-related errors
153
- */
154
- declare class SchemaError extends Error {
155
- readonly code: SchemaErrorCode;
156
- readonly details?: Record<string, unknown>;
157
- constructor(message: string, code?: SchemaErrorCode, details?: Record<string, unknown>);
158
- toJSON(): {
159
- name: string;
160
- code: SchemaErrorCode;
161
- message: string;
162
- details: Record<string, unknown> | undefined;
163
- };
164
- }
165
- /**
166
- * Base class for "not found" errors
167
- */
168
- declare class NotFoundError extends SchemaError {
169
- /** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
170
- readonly _tag = "NotFoundError";
171
- readonly resourceType: string;
172
- readonly resourceId: string;
173
- constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode, message?: string);
174
- }
175
- /**
176
- * Object not found error
177
- */
178
- declare class ObjectNotFoundError extends NotFoundError {
179
- constructor(objectId: string);
180
- }
181
- /**
182
- * Attribute not found error
183
- */
184
- declare class AttributeNotFoundError extends NotFoundError {
185
- constructor(attributeId: string);
186
- }
187
- /**
188
- * Record not found error
189
- */
190
- declare class RecordNotFoundError extends NotFoundError {
191
- constructor(recordId: string);
192
- }
193
- /**
194
- * Schema plan not found error — raised when a `planId` sent by an approver
195
- * (who never receives the plan payload itself, only its id) does not match
196
- * any stored plan.
197
- */
198
- declare class SchemaPlanNotFoundError extends NotFoundError {
199
- constructor(planId: string);
200
- }
201
- /**
202
- * Validation error with field-level details
203
- */
204
- interface ValidationErrorDetail {
205
- path: string[];
206
- message: string;
207
- code?: string;
208
- }
209
- /**
210
- * Validation error thrown when data fails schema validation
211
- */
212
- declare class ValidationError extends SchemaError {
213
- /** Literal discriminator for `Effect.catchTag`; a widened `string` breaks narrowing. */
214
- readonly _tag = "ValidationError";
215
- readonly errors: ValidationErrorDetail[];
216
- constructor(message: string, errors: ValidationErrorDetail[]);
217
- /**
218
- * Create a validation error from Zod-style errors
219
- */
220
- static fromZodErrors(errors: Array<{
221
- path: (string | number)[];
222
- message: string;
223
- }>): ValidationError;
224
- }
225
- /**
226
- * Error thrown when attempting to modify a protected (system) resource
227
- */
228
- declare class ProtectedResourceError extends SchemaError {
229
- readonly resourceType: "object" | "attribute" | "view";
230
- readonly resourceName: string;
231
- readonly operation: "delete" | "modify";
232
- constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
233
- }
234
- /**
235
- * Error thrown during native object synchronization
236
- */
237
- declare class SyncError extends SchemaError {
238
- readonly objectName: string;
239
- readonly cause?: Error;
240
- constructor(objectName: string, message: string, cause?: Error);
241
- }
242
- /**
243
- * Thrown when code tries to mutate a system entity at runtime.
244
- * System entities are declared in code and immutable at runtime.
245
- * HTTP status: 403 Forbidden.
246
- */
247
- declare class SystemEntityImmutableError extends SchemaError {
248
- readonly entityType: string;
249
- readonly entityName: string;
250
- constructor(entityType: string, entityName: string);
251
- }
252
- interface SyncConflictParams {
253
- objectName: string;
254
- attributeName?: string;
255
- reason: string;
256
- }
257
- /**
258
- * Thrown at boot when an auto-promote cannot proceed due to incompatible types
259
- * or constraints. The dev must resolve manually (relax constraints, migrate
260
- * values, or rename).
261
- */
262
- declare class SyncConflictError extends SchemaError {
263
- readonly objectName: string;
264
- readonly attributeName?: string;
265
- readonly reason: string;
266
- constructor(params: SyncConflictParams);
267
- }
268
- /**
269
- * Thrown at boot when an object is being demoted but still has system attributes
270
- * declared in code. The dev forgot to remove those attributes too, or kept the
271
- * object inconsistently.
272
- */
273
- declare class SyncCascadeError extends SchemaError {
274
- readonly objectName: string;
275
- readonly conflictingAttributes: string[];
276
- constructor(objectName: string, conflictingAttributes: string[]);
277
- }
278
- /**
279
- * Thrown at boot when an attribute is system:true but its object parent is
280
- * system:false. This invariant should never be violated — if seen, it's a bug
281
- * in the boot reconciliation logic or in a manual DB mutation.
282
- */
283
- declare class OrphanSystemAttributeError extends SchemaError {
284
- readonly objectName: string;
285
- readonly attributeName: string;
286
- constructor(objectName: string, attributeName: string);
287
- }
288
- /**
289
- * Thrown when a destructive operation is detected without the explicit
290
- * STANDARDS_ALLOW_DESTRUCTIVE_SYNC=1 opt-in.
291
- * HTTP status: 500 (boot fail, should never surface to HTTP).
292
- *
293
- * Which operations the opt-in governs is decided in one place —
294
- * `requiresDestructiveSyncOptIn` in the runtime's sync classifier. Today that
295
- * is object removal only: attribute removal is unconditional at boot, because a
296
- * system attribute is code-controlled and its disappearance from the builder is
297
- * an unambiguous drop.
298
- *
299
- * NOTE — Wiring status: defined but not thrown by the current sync.ts, which
300
- * demotes instead. Reserved for the `standards diff` CLI gate, which will throw
301
- * it when CI detects an unauthorized destructive deployment.
302
- */
303
- declare class DestructiveSyncNotAllowedError extends SchemaError {
304
- readonly operations: SchemaOperation[];
305
- constructor(operations: SchemaOperation[]);
306
- }
307
- /**
308
- * Thrown at boot when applying a migration in batches exceeds the maximum
309
- * allowed duration (default 5 min, configurable via STANDARDS_MIGRATION_MAX_DURATION_MS).
310
- * HTTP status: 500 (boot fail).
311
- */
312
- declare class MigrationTimeoutError extends SchemaError {
313
- readonly objectName: string;
314
- readonly migrated: number;
315
- readonly total: number;
316
- readonly maxDurationMs: number;
317
- constructor(objectName: string, migrated: number, total: number, maxDurationMs: number);
318
- }
319
- /**
320
- * Thrown when the runtime admin API is called to change an attribute's type.
321
- * Type changes must be declared in code via `.migration(N, m => m.changeType(...))`.
322
- * HTTP status: 400 Bad Request.
323
- */
324
- declare class ChangeTypeNotSupportedError extends SchemaError {
325
- readonly objectName: string;
326
- readonly attributeName: string;
327
- constructor(objectName: string, attributeName: string);
328
- }
329
- /**
330
- * Error thrown when attempting to create a duplicate resource.
331
- *
332
- * `resourceType` is free-form: pass `"object"`/`"attribute"` for schema
333
- * resources (a specific code is selected automatically), or any domain label
334
- * (`"tool"`, `"background job handler"`, …) for runtime registries, which fall
335
- * back to the generic `DUPLICATE` code. The default message is
336
- * `'<ResourceType> "<name>" already exists'`; pass a custom message when the
337
- * domain reads better with different wording (e.g. "already registered for
338
- * type X").
339
- */
340
- declare class DuplicateError extends SchemaError {
341
- readonly resourceType: string;
342
- readonly resourceName: string;
343
- constructor(resourceType: string, resourceName: string, message?: string);
344
- }
345
- /**
346
- * A consumer tried to build, register, bundle or source an object under a name
347
- * the framework owns (`skill`, `memory`, `drives`, `artifact`, `meeting`).
348
- * Raised at declaration time so the collision fails in the consumer's own
349
- * tests, never at boot: the platform's `wealth-manager` bundle once shipped
350
- * `meeting` and hid the native calendar object from every tenant for three
351
- * days (#3450).
352
- */
353
- declare const RESERVED_NAME_CONTEXTS: {
354
- readonly builder: "cannot be built by a consumer";
355
- readonly registry: "cannot be registered by a consumer";
356
- readonly bundle: "cannot be claimed by a bundle";
357
- readonly source: "cannot be declared by a schema source";
358
- };
359
- declare class ReservedObjectNameError extends SchemaError {
360
- readonly objectName: string;
361
- constructor(objectName: string, context: keyof typeof RESERVED_NAME_CONTEXTS);
362
- }
363
- /**
364
- * Check if an error is a SchemaError
365
- */
366
- declare function isSchemaError(error: unknown): error is SchemaError;
367
- /**
368
- * Check if an error is a NotFoundError
369
- */
370
- declare function isNotFoundError(error: unknown): error is NotFoundError;
371
- /**
372
- * Check if an error is a ValidationError
373
- */
374
- declare function isValidationError(error: unknown): error is ValidationError;
375
- /**
376
- * Check if an error is a ProtectedResourceError
377
- */
378
- declare function isProtectedResourceError(error: unknown): error is ProtectedResourceError;
379
- /**
380
- * Error thrown when a user lacks permission to perform an action.
381
- *
382
- * That, and nothing else (#2681) — its message is redacted, so it must not
383
- * carry a refusal a permission grant would not lift: use `WORKSPACE_INVARIANT`,
384
- * `STATE_GATE`, `ACTOR_CONTEXT_REQUIRED` or `SYSTEM_ENTITY_IMMUTABLE` instead.
385
- */
386
- declare class ForbiddenError extends SchemaError {
387
- readonly objectName: string;
388
- readonly action: string;
389
- readonly userId?: string;
390
- constructor(objectName: string, action: string, userId?: string);
391
- }
392
- /**
393
- * Error thrown when trying to modify a protected role
394
- */
395
- declare class ProtectedRoleError extends SchemaError {
396
- readonly roleName: string;
397
- readonly operation: "delete" | "modify";
398
- constructor(roleName: string, operation: "delete" | "modify");
399
- }
400
- /**
401
- * Role not found error
402
- */
403
- declare class RoleNotFoundError extends NotFoundError {
404
- constructor(roleId: string);
405
- }
406
- /**
407
- * Thrown when a record has been modified by another request between read and write.
408
- * Clients should retry the operation with fresh data.
409
- * Maps to HTTP 409 Conflict.
410
- */
411
- declare class ConcurrentModificationError extends SchemaError {
412
- constructor(recordId: string);
413
- }
414
- /**
415
- * Storage operation type for error context
416
- */
417
- type StorageOperation = "upload" | "download" | "delete" | "signedUrl";
418
- /**
419
- * Error thrown when a storage operation fails
420
- */
421
- declare class StorageError extends SchemaError {
422
- readonly operation: StorageOperation;
423
- readonly path?: string;
424
- readonly cause?: string;
425
- constructor(operation: StorageOperation, message: string, path?: string, cause?: string);
426
- }
427
- /**
428
- * Error thrown when access to a resource is denied (e.g., tenant path mismatch)
429
- */
430
- declare class AccessDeniedError extends SchemaError {
431
- readonly resource: string;
432
- readonly reason?: string;
433
- constructor(resource: string, reason?: string);
434
- }
435
- /**
436
- * Repository operation type for error context
437
- */
438
- type RepositoryOperation = "create" | "update" | "delete" | "query";
439
- /**
440
- * Error thrown when a repository operation fails
441
- */
442
- declare class RepositoryError extends SchemaError {
443
- readonly operation: RepositoryOperation;
444
- readonly entity: string;
445
- readonly cause?: string;
446
- constructor(operation: RepositoryOperation, entity: string, message: string, cause?: string);
447
- }
448
- /**
449
- * Error thrown when a search read call fails at the transport level — e.g. the
450
- * Meili client received a non-JSON body (`JSON.parse` SyntaxError) or a network
451
- * failure. Translates an otherwise un-fingerprintable bare exception into a
452
- * typed error with a stable `code` and a user-safe message. The original
453
- * failure text is preserved in `cause`/`details`, never in the message.
454
- */
455
- declare class SearchBackendError extends SchemaError {
456
- readonly scope: string;
457
- readonly cause?: string;
458
- constructor(scope: string, cause?: string);
459
- }
460
- /**
461
- * Error thrown when a feature or method is not yet implemented
462
- */
463
- declare class NotImplementedError extends SchemaError {
464
- readonly feature: string;
465
- readonly milestone?: string;
466
- constructor(feature: string, milestone?: string);
467
- }
468
- /**
469
- * Memory entry not found error
470
- */
471
- declare class MemoryNotFoundError extends NotFoundError {
472
- constructor(memoryId: string);
473
- }
474
- /**
475
- * Reference information for a record that is blocking deletion.
476
- */
477
- interface RecordReference {
478
- /** Technical name of the object (e.g., "contacts") */
479
- objectName: string;
480
- /** Display label of the object (e.g., "Contacts") */
481
- objectLabel: string;
482
- /** Number of records referencing the target */
483
- count: number;
484
- }
485
- /**
486
- * Thrown when attempting to delete a record that is referenced by other records.
487
- *
488
- * This implements the "Restrict" behavior: deletion is blocked and the user
489
- * must first remove or update the referencing records.
490
- */
491
- declare class RecordReferencedError extends SchemaError {
492
- readonly recordId: string;
493
- readonly references: RecordReference[];
494
- constructor(recordId: string, references: RecordReference[]);
495
- }
496
- /**
497
- * Usage context where an attribute is being used.
498
- */
499
- type AttributeUsage = "labelExpression" | "embeddingExpression" | "view" | "filter";
500
- /**
501
- * Thrown when attempting to delete an attribute that is in use.
502
- *
503
- * Attributes cannot be deleted if they are referenced in:
504
- * - The object's labelExpression template
505
- * - A saved view's column configuration
506
- * - A saved filter condition
507
- */
508
- declare class AttributeInUseError extends SchemaError {
509
- readonly attributeName: string;
510
- readonly usage: AttributeUsage;
511
- constructor(attributeName: string, usage: AttributeUsage);
512
- }
513
- /**
514
- * Thrown when attempting to delete an object that is a relation target.
515
- *
516
- * Objects cannot be deleted if other objects have relation attributes
517
- * pointing to them as a target.
518
- */
519
- declare class ObjectReferencedError extends SchemaError {
520
- readonly objectName: string;
521
- readonly referencingObjects: string[];
522
- constructor(objectName: string, referencingObjects: string[]);
523
- }
524
- /**
525
- * Check if an error is a RecordReferencedError
526
- */
527
- declare function isRecordReferencedError(error: unknown): error is RecordReferencedError;
528
- /**
529
- * Check if an error is an AttributeInUseError
530
- */
531
- declare function isAttributeInUseError(error: unknown): error is AttributeInUseError;
532
- /**
533
- * Check if an error is an ObjectReferencedError
534
- */
535
- declare function isObjectReferencedError(error: unknown): error is ObjectReferencedError;
536
-
537
- export { AccessDeniedError, AttributeInUseError, AttributeNotFoundError, type AttributeUsage, ChangeTypeNotSupportedError, ConcurrentModificationError, DestructiveSyncNotAllowedError, DuplicateError, ForbiddenError, MemoryNotFoundError, MigrationTimeoutError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RecordNotFoundError, type RecordReference, RecordReferencedError, RepositoryError, type RepositoryOperation, ReservedObjectNameError, RoleNotFoundError, SchemaError, SchemaErrorCode, SchemaPlanNotFoundError, SearchBackendError, StorageError, type StorageOperation, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, type ValidationErrorDetail, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError };
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { A as Attribute } from './attributes-Zw-DDGE7.mjs';
3
- import { V as ValidationMessages, a as ValidationResult } from './types-M5L07ItN.mjs';
4
- import { O as ObjectDefinition } from './objects-DvZ79fW2.mjs';
2
+ import { A as Attribute } from './attributes-CJNqalP0.mjs';
3
+ import { V as ValidationMessages, a as ValidationResult } from './types-Co8cq3dM.mjs';
4
+ import { O as ObjectDefinition } from './objects-DglxOigU.mjs';
5
5
 
6
6
  /**
7
7
  * Create a Zod schema for any attribute type.
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { A as Attribute } from './attributes-DfhBu4HT.js';
3
- import { V as ValidationMessages, a as ValidationResult } from './types-R2f1GdCB.js';
4
- import { O as ObjectDefinition } from './objects-D8tojUPV.js';
2
+ import { A as Attribute } from './attributes-CJNqalP0.js';
3
+ import { V as ValidationMessages, a as ValidationResult } from './types-CEwRsyh0.js';
4
+ import { O as ObjectDefinition } from './objects-CfJvQbZc.js';
5
5
 
6
6
  /**
7
7
  * Create a Zod schema for any attribute type.
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { A as Attribute, g as AttributeType, f as RollupAttribute } from './attributes-DfhBu4HT.js';
2
+ import { A as Attribute, k as AttributeType, f as RollupAttribute } from './attributes-CJNqalP0.js';
3
3
  import { IconName } from '@stndrds/constants';
4
- import { L as ListViewTabVisibility } from './objects-D8tojUPV.js';
4
+ import { L as ListViewTabVisibility } from './objects-CfJvQbZc.js';
5
5
 
6
6
  /** Operators for text-based attributes */
7
7
  type TextFilterOperator = "is" | "is_not" | "contains" | "not_contains" | "starts_with" | "ends_with" | "is_empty" | "is_not_empty";
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { A as Attribute, g as AttributeType, f as RollupAttribute } from './attributes-Zw-DDGE7.mjs';
2
+ import { A as Attribute, k as AttributeType, f as RollupAttribute } from './attributes-CJNqalP0.mjs';
3
3
  import { IconName } from '@stndrds/constants';
4
- import { L as ListViewTabVisibility } from './objects-DvZ79fW2.mjs';
4
+ import { L as ListViewTabVisibility } from './objects-DglxOigU.mjs';
5
5
 
6
6
  /** Operators for text-based attributes */
7
7
  type TextFilterOperator = "is" | "is_not" | "contains" | "not_contains" | "starts_with" | "ends_with" | "is_empty" | "is_not_empty";