@stndrds/schema 1.0.0-alpha.204 → 1.0.0-alpha.206
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/{attributes-C1WwLpp9.d.mts → attributes-CiTjeDGq.d.mts} +1 -7
- package/dist/{attributes--APpo6Vp.d.ts → attributes-Cz3tNPJA.d.ts} +1 -7
- package/dist/{chunk-PMKCDRRO.mjs → chunk-NWB6IKLM.mjs} +47 -8
- package/dist/{chunk-MZOEL7FN.js → chunk-PLUTE7FU.js} +47 -8
- package/dist/{helpers-DgZYyORn.d.mts → helpers-ElxN0li2.d.mts} +2 -2
- package/dist/{helpers-DLrvi7WO.d.ts → helpers-Vyq-QKxr.d.ts} +2 -2
- package/dist/index.d.mts +362 -311
- package/dist/index.d.ts +362 -311
- package/dist/index.js +196 -93
- package/dist/index.mjs +126 -35
- package/dist/{types-D7_-64EG.d.ts → types-Bks5XpQW.d.ts} +1 -1
- package/dist/{types-DUmDvKBW.d.mts → types-D3Kg3X94.d.mts} +1 -1
- package/dist/validation/all.d.mts +3 -3
- package/dist/validation/all.d.ts +3 -3
- package/dist/validation/all.js +8 -8
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/file.d.mts +2 -2
- package/dist/validation/complex/file.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +1 -1
- package/dist/validation/config/index.d.ts +1 -1
- package/dist/validation/core/index.d.mts +3 -3
- package/dist/validation/core/index.d.ts +3 -3
- package/dist/validation/object/index.d.mts +3 -3
- package/dist/validation/object/index.d.ts +3 -3
- package/dist/validation/object/index.js +14 -14
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +2 -2
- package/dist/validation/primitives/checkbox.d.ts +2 -2
- package/dist/validation/primitives/date.d.mts +2 -2
- package/dist/validation/primitives/date.d.ts +2 -2
- package/dist/validation/primitives/number.d.mts +2 -2
- package/dist/validation/primitives/number.d.ts +2 -2
- package/dist/validation/primitives/text.d.mts +2 -2
- package/dist/validation/primitives/text.d.ts +2 -2
- package/package.json +2 -2
|
@@ -398,12 +398,6 @@ interface CreateDocumentLink {
|
|
|
398
398
|
objectName: string;
|
|
399
399
|
sourceRecordId: string;
|
|
400
400
|
attributeName: string;
|
|
401
|
-
/**
|
|
402
|
-
* Optional qualifyWith properties on the record→Document edge. Currently
|
|
403
|
-
* accepted by the controller DTO but silently ignored by the service (see
|
|
404
|
-
* `DocumentService.createDocument` — there's a TODO to support this).
|
|
405
|
-
*/
|
|
406
|
-
properties?: Record<string, unknown>;
|
|
407
401
|
}
|
|
408
402
|
interface UpdateDocument {
|
|
409
403
|
title?: string;
|
|
@@ -917,4 +911,4 @@ declare function isAttributeSortable(attr: {
|
|
|
917
911
|
type: AttributeType;
|
|
918
912
|
}): boolean;
|
|
919
913
|
|
|
920
|
-
export { type ComputedFormulaLiteralNode as $, type Attribute as A, type FormulaReturnType as B, type CurrencyAttribute as C, type DateAttribute as D, type BilateralConfig as E, type FileAttribute as F, type RelationTarget as G, type RollupFunction as H, type UserReferenceType as I, type MigrationDefinition as J, type AttributeGroup as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type BaseAttribute as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type BuiltInTransform as V, type ComputedAttributeState as W, type ComputedFieldKind as X, type ComputedFormulaBinaryNode as Y, type ComputedFormulaBinaryOperator as Z, type ComputedFormulaCallNode as _, type RichtextAttribute as a, ComputedFormulaParseError as a0, type ComputedFormulaPathNode as a1, type ComputedStateStatus as a2, type CreateDocument as a3, type CreateDocumentLink as a4, type CreateDocumentSlot as a5, DEFAULT_DOCUMENT_SLOT as a6, type DateFormat as a7, type DateValue as a8, type Document as a9, hasOptions as aA, inferInverseCardinality as aB, isAttributeSortable as aC, isBilateralRelation as aD, isUniversalRelation as aE, parseComputedFormula as aF, type DocumentKind as aa, type DocumentLayoutVariant as ab, type DocumentListOptions as ac, type DocumentSlot as ad, type DocumentWithSlots as ae, type DocumentWithSubCount as af, type FolderPreset as ag, MAX_PRESET_DEPTH as ah, type NumberUnit as ai, type ObjectAttribute as aj, type ObjectRecord as ak, type OptionPropertyAttribute as al, type PresetNode as am, type PropertyAttribute as an, type PropertyType as ao, RELATION_TARGET_ANY as ap, RESERVED_ATTRIBUTE_NAMES as aq, type RecordDocuments as ar, type ReservedAttributeName as as, type RichTextAttribute as at, SYSTEM_FIELD_NAMES as au, type SlotStatus as av, type StatusGroup as aw, type SystemFieldName as ax, type UpdateDocument as ay, type UpdateDocumentSlot as az, type MultiselectAttribute as b, type SelectAttribute as c, type StatusAttribute as d, type FormulaAttribute as e, type RollupAttribute as f, type CheckboxAttribute as g, type CompletionStatus as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type
|
|
914
|
+
export { type ComputedFormulaLiteralNode as $, type Attribute as A, type FormulaReturnType as B, type CurrencyAttribute as C, type DateAttribute as D, type BilateralConfig as E, type FileAttribute as F, type RelationTarget as G, type RollupFunction as H, type UserReferenceType as I, type MigrationDefinition as J, type AttributeGroup as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type BaseAttribute as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type BuiltInTransform as V, type ComputedAttributeState as W, type ComputedFieldKind as X, type ComputedFormulaBinaryNode as Y, type ComputedFormulaBinaryOperator as Z, type ComputedFormulaCallNode as _, type RichtextAttribute as a, ComputedFormulaParseError as a0, type ComputedFormulaPathNode as a1, type ComputedStateStatus as a2, type CreateDocument as a3, type CreateDocumentLink as a4, type CreateDocumentSlot as a5, DEFAULT_DOCUMENT_SLOT as a6, type DateFormat as a7, type DateValue as a8, type Document as a9, hasOptions as aA, inferInverseCardinality as aB, isAttributeSortable as aC, isBilateralRelation as aD, isUniversalRelation as aE, parseComputedFormula as aF, type DocumentKind as aa, type DocumentLayoutVariant as ab, type DocumentListOptions as ac, type DocumentSlot as ad, type DocumentWithSlots as ae, type DocumentWithSubCount as af, type FolderPreset as ag, MAX_PRESET_DEPTH as ah, type NumberUnit as ai, type ObjectAttribute as aj, type ObjectRecord as ak, type OptionPropertyAttribute as al, type PresetNode as am, type PropertyAttribute as an, type PropertyType as ao, RELATION_TARGET_ANY as ap, RESERVED_ATTRIBUTE_NAMES as aq, type RecordDocuments as ar, type ReservedAttributeName as as, type RichTextAttribute as at, SYSTEM_FIELD_NAMES as au, type SlotStatus as av, type StatusGroup as aw, type SystemFieldName as ax, type UpdateDocument as ay, type UpdateDocumentSlot as az, type MultiselectAttribute as b, type SelectAttribute as c, type StatusAttribute as d, type FormulaAttribute as e, type RollupAttribute as f, type CheckboxAttribute as g, type CompletionStatus as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type DocumentLayout as p, type Timestamps as q, type SchemaOperation as r, type LocationGranularity as s, type Location as t, type DocumentAttribute as u, type Phone as v, type Currency as w, type DocumentSlotConfig as x, type PropertySchema as y, type Option as z };
|
|
@@ -398,12 +398,6 @@ interface CreateDocumentLink {
|
|
|
398
398
|
objectName: string;
|
|
399
399
|
sourceRecordId: string;
|
|
400
400
|
attributeName: string;
|
|
401
|
-
/**
|
|
402
|
-
* Optional qualifyWith properties on the record→Document edge. Currently
|
|
403
|
-
* accepted by the controller DTO but silently ignored by the service (see
|
|
404
|
-
* `DocumentService.createDocument` — there's a TODO to support this).
|
|
405
|
-
*/
|
|
406
|
-
properties?: Record<string, unknown>;
|
|
407
401
|
}
|
|
408
402
|
interface UpdateDocument {
|
|
409
403
|
title?: string;
|
|
@@ -917,4 +911,4 @@ declare function isAttributeSortable(attr: {
|
|
|
917
911
|
type: AttributeType;
|
|
918
912
|
}): boolean;
|
|
919
913
|
|
|
920
|
-
export { type ComputedFormulaLiteralNode as $, type Attribute as A, type FormulaReturnType as B, type CurrencyAttribute as C, type DateAttribute as D, type BilateralConfig as E, type FileAttribute as F, type RelationTarget as G, type RollupFunction as H, type UserReferenceType as I, type MigrationDefinition as J, type AttributeGroup as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type BaseAttribute as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type BuiltInTransform as V, type ComputedAttributeState as W, type ComputedFieldKind as X, type ComputedFormulaBinaryNode as Y, type ComputedFormulaBinaryOperator as Z, type ComputedFormulaCallNode as _, type RichtextAttribute as a, ComputedFormulaParseError as a0, type ComputedFormulaPathNode as a1, type ComputedStateStatus as a2, type CreateDocument as a3, type CreateDocumentLink as a4, type CreateDocumentSlot as a5, DEFAULT_DOCUMENT_SLOT as a6, type DateFormat as a7, type DateValue as a8, type Document as a9, hasOptions as aA, inferInverseCardinality as aB, isAttributeSortable as aC, isBilateralRelation as aD, isUniversalRelation as aE, parseComputedFormula as aF, type DocumentKind as aa, type DocumentLayoutVariant as ab, type DocumentListOptions as ac, type DocumentSlot as ad, type DocumentWithSlots as ae, type DocumentWithSubCount as af, type FolderPreset as ag, MAX_PRESET_DEPTH as ah, type NumberUnit as ai, type ObjectAttribute as aj, type ObjectRecord as ak, type OptionPropertyAttribute as al, type PresetNode as am, type PropertyAttribute as an, type PropertyType as ao, RELATION_TARGET_ANY as ap, RESERVED_ATTRIBUTE_NAMES as aq, type RecordDocuments as ar, type ReservedAttributeName as as, type RichTextAttribute as at, SYSTEM_FIELD_NAMES as au, type SlotStatus as av, type StatusGroup as aw, type SystemFieldName as ax, type UpdateDocument as ay, type UpdateDocumentSlot as az, type MultiselectAttribute as b, type SelectAttribute as c, type StatusAttribute as d, type FormulaAttribute as e, type RollupAttribute as f, type CheckboxAttribute as g, type CompletionStatus as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type
|
|
914
|
+
export { type ComputedFormulaLiteralNode as $, type Attribute as A, type FormulaReturnType as B, type CurrencyAttribute as C, type DateAttribute as D, type BilateralConfig as E, type FileAttribute as F, type RelationTarget as G, type RollupFunction as H, type UserReferenceType as I, type MigrationDefinition as J, type AttributeGroup as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type BaseAttribute as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type BuiltInTransform as V, type ComputedAttributeState as W, type ComputedFieldKind as X, type ComputedFormulaBinaryNode as Y, type ComputedFormulaBinaryOperator as Z, type ComputedFormulaCallNode as _, type RichtextAttribute as a, ComputedFormulaParseError as a0, type ComputedFormulaPathNode as a1, type ComputedStateStatus as a2, type CreateDocument as a3, type CreateDocumentLink as a4, type CreateDocumentSlot as a5, DEFAULT_DOCUMENT_SLOT as a6, type DateFormat as a7, type DateValue as a8, type Document as a9, hasOptions as aA, inferInverseCardinality as aB, isAttributeSortable as aC, isBilateralRelation as aD, isUniversalRelation as aE, parseComputedFormula as aF, type DocumentKind as aa, type DocumentLayoutVariant as ab, type DocumentListOptions as ac, type DocumentSlot as ad, type DocumentWithSlots as ae, type DocumentWithSubCount as af, type FolderPreset as ag, MAX_PRESET_DEPTH as ah, type NumberUnit as ai, type ObjectAttribute as aj, type ObjectRecord as ak, type OptionPropertyAttribute as al, type PresetNode as am, type PropertyAttribute as an, type PropertyType as ao, RELATION_TARGET_ANY as ap, RESERVED_ATTRIBUTE_NAMES as aq, type RecordDocuments as ar, type ReservedAttributeName as as, type RichTextAttribute as at, SYSTEM_FIELD_NAMES as au, type SlotStatus as av, type StatusGroup as aw, type SystemFieldName as ax, type UpdateDocument as ay, type UpdateDocumentSlot as az, type MultiselectAttribute as b, type SelectAttribute as c, type StatusAttribute as d, type FormulaAttribute as e, type RollupAttribute as f, type CheckboxAttribute as g, type CompletionStatus as h, type ComputedValueType as i, type ComputedReturnType as j, type AttributeType as k, type ComputedOptionsSource as l, type ComputedDependency as m, type ComputedPlan as n, type ComputedFormulaAstNode as o, type DocumentLayout as p, type Timestamps as q, type SchemaOperation as r, type LocationGranularity as s, type Location as t, type DocumentAttribute as u, type Phone as v, type Currency as w, type DocumentSlotConfig as x, type PropertySchema as y, type Option as z };
|
|
@@ -137,6 +137,7 @@ var SchemaErrorCode = {
|
|
|
137
137
|
MIGRATION_TIMEOUT: "SCHEMA_MIGRATION_TIMEOUT",
|
|
138
138
|
CHANGE_TYPE_NOT_SUPPORTED: "SCHEMA_CHANGE_TYPE_NOT_SUPPORTED",
|
|
139
139
|
// Duplicates
|
|
140
|
+
DUPLICATE: "SCHEMA_DUPLICATE",
|
|
140
141
|
DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT",
|
|
141
142
|
DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE",
|
|
142
143
|
// Concurrency
|
|
@@ -158,7 +159,48 @@ var SchemaErrorCode = {
|
|
|
158
159
|
// Schema Integrity
|
|
159
160
|
RECORD_REFERENCED: "SCHEMA_RECORD_REFERENCED",
|
|
160
161
|
ATTRIBUTE_IN_USE: "SCHEMA_ATTRIBUTE_IN_USE",
|
|
161
|
-
OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED"
|
|
162
|
+
OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED",
|
|
163
|
+
// --------------------------------------------------------------------------
|
|
164
|
+
// Platform-wide codes (runtime). This enum is the single registry of every
|
|
165
|
+
// error type across the stack; domain error classes live in their module but
|
|
166
|
+
// draw their `code` from here. Never throw a raw `Error` — pick a code below.
|
|
167
|
+
// --------------------------------------------------------------------------
|
|
168
|
+
// Configuration / wiring — a required runtime dependency is not configured
|
|
169
|
+
CONFIGURATION_REQUIRED: "CONFIGURATION_REQUIRED",
|
|
170
|
+
SEARCH_ADAPTER_REQUIRED: "SEARCH_ADAPTER_REQUIRED",
|
|
171
|
+
// Invariants — internal "should never happen" assertions (programmer error)
|
|
172
|
+
INVARIANT_VIOLATION: "INVARIANT_VIOLATION",
|
|
173
|
+
// Tenant / context
|
|
174
|
+
TENANT_CONTEXT_MISSING: "TENANT_CONTEXT_MISSING",
|
|
175
|
+
FEATURE_FLAGS_CONTEXT: "FEATURE_FLAGS_CONTEXT",
|
|
176
|
+
// Agents
|
|
177
|
+
AGENT_UNKNOWN: "AGENT_UNKNOWN",
|
|
178
|
+
AGENT_DEPTH_EXCEEDED: "AGENT_DEPTH_EXCEEDED",
|
|
179
|
+
AGENT_COST_LIMIT_EXCEEDED: "AGENT_COST_LIMIT_EXCEEDED",
|
|
180
|
+
AGENT_TREE_COST_LIMIT_EXCEEDED: "AGENT_TREE_COST_LIMIT_EXCEEDED",
|
|
181
|
+
AGENT_SESSION_NOT_FOUND: "AGENT_SESSION_NOT_FOUND",
|
|
182
|
+
AGENT_DEFINITION_NOT_FOUND: "AGENT_DEFINITION_NOT_FOUND",
|
|
183
|
+
AGENT_RUN_CONFIG: "AGENT_RUN_CONFIG",
|
|
184
|
+
AGENT_STREAMING: "AGENT_STREAMING",
|
|
185
|
+
AGENT_MISSING_ACTOR: "AGENT_MISSING_ACTOR",
|
|
186
|
+
AGENT_INVALID_STATE: "AGENT_INVALID_STATE",
|
|
187
|
+
AGENT_COMPACTION_IMPOSSIBLE: "AGENT_COMPACTION_IMPOSSIBLE",
|
|
188
|
+
AGENT_LEASE_HELD: "AGENT_LEASE_HELD",
|
|
189
|
+
// AI / LLM
|
|
190
|
+
AI_UNKNOWN: "AI_UNKNOWN",
|
|
191
|
+
AI_USAGE_LIMIT_EXCEEDED: "AI_USAGE_LIMIT_EXCEEDED",
|
|
192
|
+
AI_INVALID_USAGE: "AI_INVALID_USAGE",
|
|
193
|
+
AI_INVALID_MODEL: "AI_INVALID_MODEL",
|
|
194
|
+
AI_REPOSITORY_ERROR: "AI_REPOSITORY_ERROR",
|
|
195
|
+
AI_GENERATION_FAILED: "AI_GENERATION_FAILED",
|
|
196
|
+
// Documents — slot attach/detach operations
|
|
197
|
+
DOCUMENT_SLOT_NOT_DECLARED: "DOCUMENT_SLOT_NOT_DECLARED",
|
|
198
|
+
DOCUMENT_MIME_NOT_ACCEPTED: "DOCUMENT_MIME_NOT_ACCEPTED",
|
|
199
|
+
DOCUMENT_SLOT_ALREADY_FILLED: "DOCUMENT_SLOT_ALREADY_FILLED",
|
|
200
|
+
DOCUMENT_MULTIPLE_NOT_ALLOWED: "DOCUMENT_MULTIPLE_NOT_ALLOWED",
|
|
201
|
+
DOCUMENT_NOT_FOUND_FOR_OPERATION: "DOCUMENT_NOT_FOUND_FOR_OPERATION",
|
|
202
|
+
DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED",
|
|
203
|
+
DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED"
|
|
162
204
|
};
|
|
163
205
|
var SchemaError = class extends Error {
|
|
164
206
|
constructor(message, code = SchemaErrorCode.UNKNOWN, details) {
|
|
@@ -359,13 +401,10 @@ var ChangeTypeNotSupportedError = class extends SchemaError {
|
|
|
359
401
|
}
|
|
360
402
|
};
|
|
361
403
|
var DuplicateError = class extends SchemaError {
|
|
362
|
-
constructor(resourceType, resourceName) {
|
|
363
|
-
const code = resourceType === "object" ? SchemaErrorCode.DUPLICATE_OBJECT : SchemaErrorCode.DUPLICATE_ATTRIBUTE;
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
code,
|
|
367
|
-
{ resourceType, resourceName }
|
|
368
|
-
);
|
|
404
|
+
constructor(resourceType, resourceName, message) {
|
|
405
|
+
const code = resourceType === "object" ? SchemaErrorCode.DUPLICATE_OBJECT : resourceType === "attribute" ? SchemaErrorCode.DUPLICATE_ATTRIBUTE : SchemaErrorCode.DUPLICATE;
|
|
406
|
+
const autoMessage = `${resourceType.charAt(0).toUpperCase()}${resourceType.slice(1)} "${resourceName}" already exists`;
|
|
407
|
+
super(message ?? autoMessage, code, { resourceType, resourceName });
|
|
369
408
|
this.name = "DuplicateError";
|
|
370
409
|
this.resourceType = resourceType;
|
|
371
410
|
this.resourceName = resourceName;
|
|
@@ -139,6 +139,7 @@ var SchemaErrorCode = {
|
|
|
139
139
|
MIGRATION_TIMEOUT: "SCHEMA_MIGRATION_TIMEOUT",
|
|
140
140
|
CHANGE_TYPE_NOT_SUPPORTED: "SCHEMA_CHANGE_TYPE_NOT_SUPPORTED",
|
|
141
141
|
// Duplicates
|
|
142
|
+
DUPLICATE: "SCHEMA_DUPLICATE",
|
|
142
143
|
DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT",
|
|
143
144
|
DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE",
|
|
144
145
|
// Concurrency
|
|
@@ -160,7 +161,48 @@ var SchemaErrorCode = {
|
|
|
160
161
|
// Schema Integrity
|
|
161
162
|
RECORD_REFERENCED: "SCHEMA_RECORD_REFERENCED",
|
|
162
163
|
ATTRIBUTE_IN_USE: "SCHEMA_ATTRIBUTE_IN_USE",
|
|
163
|
-
OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED"
|
|
164
|
+
OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED",
|
|
165
|
+
// --------------------------------------------------------------------------
|
|
166
|
+
// Platform-wide codes (runtime). This enum is the single registry of every
|
|
167
|
+
// error type across the stack; domain error classes live in their module but
|
|
168
|
+
// draw their `code` from here. Never throw a raw `Error` — pick a code below.
|
|
169
|
+
// --------------------------------------------------------------------------
|
|
170
|
+
// Configuration / wiring — a required runtime dependency is not configured
|
|
171
|
+
CONFIGURATION_REQUIRED: "CONFIGURATION_REQUIRED",
|
|
172
|
+
SEARCH_ADAPTER_REQUIRED: "SEARCH_ADAPTER_REQUIRED",
|
|
173
|
+
// Invariants — internal "should never happen" assertions (programmer error)
|
|
174
|
+
INVARIANT_VIOLATION: "INVARIANT_VIOLATION",
|
|
175
|
+
// Tenant / context
|
|
176
|
+
TENANT_CONTEXT_MISSING: "TENANT_CONTEXT_MISSING",
|
|
177
|
+
FEATURE_FLAGS_CONTEXT: "FEATURE_FLAGS_CONTEXT",
|
|
178
|
+
// Agents
|
|
179
|
+
AGENT_UNKNOWN: "AGENT_UNKNOWN",
|
|
180
|
+
AGENT_DEPTH_EXCEEDED: "AGENT_DEPTH_EXCEEDED",
|
|
181
|
+
AGENT_COST_LIMIT_EXCEEDED: "AGENT_COST_LIMIT_EXCEEDED",
|
|
182
|
+
AGENT_TREE_COST_LIMIT_EXCEEDED: "AGENT_TREE_COST_LIMIT_EXCEEDED",
|
|
183
|
+
AGENT_SESSION_NOT_FOUND: "AGENT_SESSION_NOT_FOUND",
|
|
184
|
+
AGENT_DEFINITION_NOT_FOUND: "AGENT_DEFINITION_NOT_FOUND",
|
|
185
|
+
AGENT_RUN_CONFIG: "AGENT_RUN_CONFIG",
|
|
186
|
+
AGENT_STREAMING: "AGENT_STREAMING",
|
|
187
|
+
AGENT_MISSING_ACTOR: "AGENT_MISSING_ACTOR",
|
|
188
|
+
AGENT_INVALID_STATE: "AGENT_INVALID_STATE",
|
|
189
|
+
AGENT_COMPACTION_IMPOSSIBLE: "AGENT_COMPACTION_IMPOSSIBLE",
|
|
190
|
+
AGENT_LEASE_HELD: "AGENT_LEASE_HELD",
|
|
191
|
+
// AI / LLM
|
|
192
|
+
AI_UNKNOWN: "AI_UNKNOWN",
|
|
193
|
+
AI_USAGE_LIMIT_EXCEEDED: "AI_USAGE_LIMIT_EXCEEDED",
|
|
194
|
+
AI_INVALID_USAGE: "AI_INVALID_USAGE",
|
|
195
|
+
AI_INVALID_MODEL: "AI_INVALID_MODEL",
|
|
196
|
+
AI_REPOSITORY_ERROR: "AI_REPOSITORY_ERROR",
|
|
197
|
+
AI_GENERATION_FAILED: "AI_GENERATION_FAILED",
|
|
198
|
+
// Documents — slot attach/detach operations
|
|
199
|
+
DOCUMENT_SLOT_NOT_DECLARED: "DOCUMENT_SLOT_NOT_DECLARED",
|
|
200
|
+
DOCUMENT_MIME_NOT_ACCEPTED: "DOCUMENT_MIME_NOT_ACCEPTED",
|
|
201
|
+
DOCUMENT_SLOT_ALREADY_FILLED: "DOCUMENT_SLOT_ALREADY_FILLED",
|
|
202
|
+
DOCUMENT_MULTIPLE_NOT_ALLOWED: "DOCUMENT_MULTIPLE_NOT_ALLOWED",
|
|
203
|
+
DOCUMENT_NOT_FOUND_FOR_OPERATION: "DOCUMENT_NOT_FOUND_FOR_OPERATION",
|
|
204
|
+
DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED",
|
|
205
|
+
DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED"
|
|
164
206
|
};
|
|
165
207
|
var SchemaError = class extends Error {
|
|
166
208
|
constructor(message, code = SchemaErrorCode.UNKNOWN, details) {
|
|
@@ -361,13 +403,10 @@ var ChangeTypeNotSupportedError = class extends SchemaError {
|
|
|
361
403
|
}
|
|
362
404
|
};
|
|
363
405
|
var DuplicateError = class extends SchemaError {
|
|
364
|
-
constructor(resourceType, resourceName) {
|
|
365
|
-
const code = resourceType === "object" ? SchemaErrorCode.DUPLICATE_OBJECT : SchemaErrorCode.DUPLICATE_ATTRIBUTE;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
code,
|
|
369
|
-
{ resourceType, resourceName }
|
|
370
|
-
);
|
|
406
|
+
constructor(resourceType, resourceName, message) {
|
|
407
|
+
const code = resourceType === "object" ? SchemaErrorCode.DUPLICATE_OBJECT : resourceType === "attribute" ? SchemaErrorCode.DUPLICATE_ATTRIBUTE : SchemaErrorCode.DUPLICATE;
|
|
408
|
+
const autoMessage = `${resourceType.charAt(0).toUpperCase()}${resourceType.slice(1)} "${resourceName}" already exists`;
|
|
409
|
+
super(message ?? autoMessage, code, { resourceType, resourceName });
|
|
371
410
|
this.name = "DuplicateError";
|
|
372
411
|
this.resourceType = resourceType;
|
|
373
412
|
this.resourceName = resourceName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { A as Attribute, O as ObjectDefinition, h as CompletionStatus } from './attributes-
|
|
3
|
-
import { V as ValidationMessages, a as ValidationResult } from './types-
|
|
2
|
+
import { A as Attribute, O as ObjectDefinition, h as CompletionStatus } from './attributes-CiTjeDGq.mjs';
|
|
3
|
+
import { V as ValidationMessages, a as ValidationResult } from './types-D3Kg3X94.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create a Zod schema for any attribute type.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { A as Attribute, O as ObjectDefinition, h as CompletionStatus } from './attributes
|
|
3
|
-
import { V as ValidationMessages, a as ValidationResult } from './types-
|
|
2
|
+
import { A as Attribute, O as ObjectDefinition, h as CompletionStatus } from './attributes-Cz3tNPJA.js';
|
|
3
|
+
import { V as ValidationMessages, a as ValidationResult } from './types-Bks5XpQW.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create a Zod schema for any attribute type.
|