@stndrds/schema 1.0.0-alpha.234 → 1.0.0-alpha.235
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-C8AjT2x0.d.ts → attributes-B4847Nul.d.ts} +1 -1
- package/dist/{attributes-ej1MUv6H.d.mts → attributes-BpMes5H_.d.mts} +1 -1
- package/dist/{chunk-SSKDQQHI.mjs → chunk-NAS2HJ3Y.mjs} +7 -7
- package/dist/{chunk-5YVX5E7Q.js → chunk-PZJN5IJW.js} +8 -8
- package/dist/{chunk-SGSGREPG.js → chunk-QAF3HNKQ.js} +9 -8
- package/dist/{chunk-NOMHDOVE.mjs → chunk-U36ZIBEM.mjs} +9 -8
- package/dist/{helpers-ChTf56gW.d.ts → helpers-DsJff5r-.d.ts} +2 -2
- package/dist/{helpers-CihXtV0s.d.mts → helpers-ow7sORSi.d.mts} +2 -2
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +216 -167
- package/dist/index.mjs +138 -89
- package/dist/{types-DzZex_aX.d.ts → types-C8nztuFF.d.ts} +1 -1
- package/dist/{types-DrT3ZBoK.d.mts → types-CyxVuV_d.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 +18 -18
- package/dist/validation/all.mjs +7 -7
- 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 +19 -19
- package/dist/validation/object/index.mjs +6 -6
- 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/dist/validation/primitives/text.js +2 -2
- package/dist/validation/primitives/text.mjs +1 -1
- package/package.json +2 -2
|
@@ -975,4 +975,4 @@ declare function isAttributeSortable(attr: {
|
|
|
975
975
|
type: AttributeType;
|
|
976
976
|
}): boolean;
|
|
977
977
|
|
|
978
|
-
export { type ComputedAttributeState as $, type Attribute as A, type AutofillConfig as B, type CurrencyAttribute as C, type DateAttribute as D, type TimeFormat as E, type
|
|
978
|
+
export { type ComputedAttributeState as $, type Attribute as A, type AutofillConfig as B, type CurrencyAttribute as C, type DateAttribute as D, type TimeFormat as E, type FileAttribute as F, type Option as G, type FormulaReturnType as H, type BilateralConfig as I, type RelationTarget as J, type RollupFunction as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type UserReferenceType as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type MigrationDefinition as V, AUTOFILL_ELIGIBLE_TYPES as W, type AttributeGroup as X, type AutofillEligibleType as Y, type BaseAttribute as Z, type BuiltInTransform as _, type RichtextAttribute as a, type ComputedFieldKind as a0, type ComputedFormulaBinaryNode as a1, type ComputedFormulaBinaryOperator as a2, type ComputedFormulaCallNode as a3, type ComputedFormulaLiteralNode as a4, ComputedFormulaParseError as a5, type ComputedFormulaPathNode as a6, type ComputedStateStatus as a7, type CreateDocument as a8, type CreateDocumentLink as a9, type RichTextAttribute as aA, SYSTEM_FIELD_NAMES as aB, type SlotStatus as aC, type StatusGroup as aD, type SystemFieldName as aE, type UpdateDocument as aF, type UpdateDocumentSlot as aG, hasOptions as aH, inferInverseCardinality as aI, isAttributeSortable as aJ, isBilateralRelation as aK, isUniversalRelation as aL, parseComputedFormula as aM, resolvePropertyDefinitions as aN, type CreateDocumentSlot as aa, DEFAULT_DOCUMENT_SLOT as ab, type DateFormat as ac, type DateValue as ad, type Document as ae, type DocumentKind as af, type DocumentLayoutVariant as ag, type DocumentListOptions as ah, type DocumentSlot as ai, type DocumentWithSlots as aj, type DocumentWithSubCount as ak, type FolderPreset as al, MAX_PRESET_DEPTH as am, type NumberUnit as an, type ObjectAttribute as ao, type ObjectRecord as ap, type OptionPropertyAttribute as aq, type PresetNode as ar, type PropertyAttribute as as, type PropertyType as at, RELATION_TARGET_ANY as au, RESERVED_ATTRIBUTE_NAMES as av, RESERVED_OBJECT_NAMES as aw, type RecordDocuments as ax, type ReservedAttributeName as ay, type ReservedObjectName 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 DateRangeValue as u, type DocumentAttribute as v, type Phone as w, type Currency as x, type DocumentSlotConfig as y, type PropertySchema as z };
|
|
@@ -975,4 +975,4 @@ declare function isAttributeSortable(attr: {
|
|
|
975
975
|
type: AttributeType;
|
|
976
976
|
}): boolean;
|
|
977
977
|
|
|
978
|
-
export { type ComputedAttributeState as $, type Attribute as A, type AutofillConfig as B, type CurrencyAttribute as C, type DateAttribute as D, type TimeFormat as E, type
|
|
978
|
+
export { type ComputedAttributeState as $, type Attribute as A, type AutofillConfig as B, type CurrencyAttribute as C, type DateAttribute as D, type TimeFormat as E, type FileAttribute as F, type Option as G, type FormulaReturnType as H, type BilateralConfig as I, type RelationTarget as J, type RollupFunction as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type UserReferenceType as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAttribute as T, type UserAttribute as U, type MigrationDefinition as V, AUTOFILL_ELIGIBLE_TYPES as W, type AttributeGroup as X, type AutofillEligibleType as Y, type BaseAttribute as Z, type BuiltInTransform as _, type RichtextAttribute as a, type ComputedFieldKind as a0, type ComputedFormulaBinaryNode as a1, type ComputedFormulaBinaryOperator as a2, type ComputedFormulaCallNode as a3, type ComputedFormulaLiteralNode as a4, ComputedFormulaParseError as a5, type ComputedFormulaPathNode as a6, type ComputedStateStatus as a7, type CreateDocument as a8, type CreateDocumentLink as a9, type RichTextAttribute as aA, SYSTEM_FIELD_NAMES as aB, type SlotStatus as aC, type StatusGroup as aD, type SystemFieldName as aE, type UpdateDocument as aF, type UpdateDocumentSlot as aG, hasOptions as aH, inferInverseCardinality as aI, isAttributeSortable as aJ, isBilateralRelation as aK, isUniversalRelation as aL, parseComputedFormula as aM, resolvePropertyDefinitions as aN, type CreateDocumentSlot as aa, DEFAULT_DOCUMENT_SLOT as ab, type DateFormat as ac, type DateValue as ad, type Document as ae, type DocumentKind as af, type DocumentLayoutVariant as ag, type DocumentListOptions as ah, type DocumentSlot as ai, type DocumentWithSlots as aj, type DocumentWithSubCount as ak, type FolderPreset as al, MAX_PRESET_DEPTH as am, type NumberUnit as an, type ObjectAttribute as ao, type ObjectRecord as ap, type OptionPropertyAttribute as aq, type PresetNode as ar, type PropertyAttribute as as, type PropertyType as at, RELATION_TARGET_ANY as au, RESERVED_ATTRIBUTE_NAMES as av, RESERVED_OBJECT_NAMES as aw, type RecordDocuments as ax, type ReservedAttributeName as ay, type ReservedObjectName 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 DateRangeValue as u, type DocumentAttribute as v, type Phone as w, type Currency as x, type DocumentSlotConfig as y, type PropertySchema as z };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createCheckboxValidator } from './chunk-OSSGN43B.mjs';
|
|
2
2
|
import { createDateValidator } from './chunk-Q44QKLN4.mjs';
|
|
3
3
|
import { createNumberValidator } from './chunk-UANQJ2GH.mjs';
|
|
4
|
-
import { createTextValidator } from './chunk-
|
|
5
|
-
import { createFileValidator } from './chunk-CI6EGLL6.mjs';
|
|
6
|
-
import { createLocationValidator } from './chunk-YUFTHPOE.mjs';
|
|
7
|
-
import { createPhoneValidator } from './chunk-JUKLL5RJ.mjs';
|
|
8
|
-
import { createRelationValidator } from './chunk-GO6LQADH.mjs';
|
|
4
|
+
import { createTextValidator } from './chunk-U36ZIBEM.mjs';
|
|
9
5
|
import { createRichtextValidator } from './chunk-QVLQPW3O.mjs';
|
|
10
6
|
import { createMultiselectValidator, createSelectValidator, createStatusValidator } from './chunk-ZDQ5AP26.mjs';
|
|
11
7
|
import { createUserValidator } from './chunk-LV3FEUKU.mjs';
|
|
12
8
|
import { createFormulaValidator } from './chunk-UXAHLSWC.mjs';
|
|
13
9
|
import { createRollupValidator } from './chunk-NS63SPNN.mjs';
|
|
14
10
|
import { createCurrencyValidator } from './chunk-AYVHMVKQ.mjs';
|
|
11
|
+
import { createFileValidator } from './chunk-CI6EGLL6.mjs';
|
|
12
|
+
import { createLocationValidator } from './chunk-YUFTHPOE.mjs';
|
|
13
|
+
import { createPhoneValidator } from './chunk-JUKLL5RJ.mjs';
|
|
14
|
+
import { createRelationValidator } from './chunk-GO6LQADH.mjs';
|
|
15
15
|
import { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './chunk-HRQEZUAA.mjs';
|
|
16
16
|
import { z } from 'zod';
|
|
17
17
|
|
|
@@ -243,8 +243,8 @@ var SchemaError = class extends Error {
|
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
245
|
var NotFoundError = class extends SchemaError {
|
|
246
|
-
constructor(resourceType, resourceId, code = SchemaErrorCode.RECORD_NOT_FOUND) {
|
|
247
|
-
super(
|
|
246
|
+
constructor(resourceType, resourceId, code = SchemaErrorCode.RECORD_NOT_FOUND, message = `${resourceType} with id "${resourceId}" not found`) {
|
|
247
|
+
super(message, code, {
|
|
248
248
|
resourceType,
|
|
249
249
|
resourceId
|
|
250
250
|
});
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
var chunk5WATIVCA_js = require('./chunk-5WATIVCA.js');
|
|
4
4
|
var chunkSI34M4IC_js = require('./chunk-SI34M4IC.js');
|
|
5
5
|
var chunkYIP5FJ5H_js = require('./chunk-YIP5FJ5H.js');
|
|
6
|
-
var
|
|
7
|
-
var chunkQ5DIOYUE_js = require('./chunk-Q5DIOYUE.js');
|
|
8
|
-
var chunkE6JUYGJX_js = require('./chunk-E6JUYGJX.js');
|
|
9
|
-
var chunkEBGRZUIH_js = require('./chunk-EBGRZUIH.js');
|
|
10
|
-
var chunkEEH4XQ7W_js = require('./chunk-EEH4XQ7W.js');
|
|
6
|
+
var chunkQAF3HNKQ_js = require('./chunk-QAF3HNKQ.js');
|
|
11
7
|
var chunkEW5XR2X3_js = require('./chunk-EW5XR2X3.js');
|
|
12
8
|
var chunkQWKLQRBX_js = require('./chunk-QWKLQRBX.js');
|
|
13
9
|
var chunkKNGWHQLR_js = require('./chunk-KNGWHQLR.js');
|
|
14
10
|
var chunkHTSTPTNZ_js = require('./chunk-HTSTPTNZ.js');
|
|
15
11
|
var chunkV2UA2D4E_js = require('./chunk-V2UA2D4E.js');
|
|
16
12
|
var chunkACKMC6FL_js = require('./chunk-ACKMC6FL.js');
|
|
13
|
+
var chunkQ5DIOYUE_js = require('./chunk-Q5DIOYUE.js');
|
|
14
|
+
var chunkE6JUYGJX_js = require('./chunk-E6JUYGJX.js');
|
|
15
|
+
var chunkEBGRZUIH_js = require('./chunk-EBGRZUIH.js');
|
|
16
|
+
var chunkEEH4XQ7W_js = require('./chunk-EEH4XQ7W.js');
|
|
17
17
|
var chunkYKWSHBT5_js = require('./chunk-YKWSHBT5.js');
|
|
18
18
|
var zod = require('zod');
|
|
19
19
|
|
|
@@ -36,7 +36,7 @@ function withEmptyToNull(validator) {
|
|
|
36
36
|
function createAttributeValidator(attr, messages = chunkYKWSHBT5_js.DEFAULT_VALIDATION_MESSAGES) {
|
|
37
37
|
switch (attr.type) {
|
|
38
38
|
case "text":
|
|
39
|
-
return
|
|
39
|
+
return chunkQAF3HNKQ_js.createTextValidator(attr, messages);
|
|
40
40
|
case "richtext":
|
|
41
41
|
return chunkEW5XR2X3_js.createRichtextValidator(attr, messages);
|
|
42
42
|
case "number":
|
|
@@ -245,8 +245,8 @@ var SchemaError = class extends Error {
|
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
var NotFoundError = class extends SchemaError {
|
|
248
|
-
constructor(resourceType, resourceId, code = SchemaErrorCode.RECORD_NOT_FOUND) {
|
|
249
|
-
super(
|
|
248
|
+
constructor(resourceType, resourceId, code = SchemaErrorCode.RECORD_NOT_FOUND, message = `${resourceType} with id "${resourceId}" not found`) {
|
|
249
|
+
super(message, code, {
|
|
250
250
|
resourceType,
|
|
251
251
|
resourceId
|
|
252
252
|
});
|
|
@@ -6,27 +6,28 @@ var zod = require('zod');
|
|
|
6
6
|
// src/lib/lru-cache.ts
|
|
7
7
|
var LRUCache = class {
|
|
8
8
|
constructor(capacity) {
|
|
9
|
-
if (capacity <= 0) {
|
|
9
|
+
if (!Number.isInteger(capacity) || capacity <= 0) {
|
|
10
10
|
throw new Error("LRU cache capacity must be greater than 0");
|
|
11
11
|
}
|
|
12
12
|
this.capacity = capacity;
|
|
13
13
|
this.cache = /* @__PURE__ */ new Map();
|
|
14
14
|
}
|
|
15
15
|
get(key) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.cache.delete(key);
|
|
19
|
-
this.cache.set(key, value);
|
|
16
|
+
if (!this.cache.has(key)) {
|
|
17
|
+
return void 0;
|
|
20
18
|
}
|
|
19
|
+
const value = this.cache.get(key);
|
|
20
|
+
this.cache.delete(key);
|
|
21
|
+
this.cache.set(key, value);
|
|
21
22
|
return value;
|
|
22
23
|
}
|
|
23
24
|
set(key, value) {
|
|
24
25
|
if (this.cache.has(key)) {
|
|
25
26
|
this.cache.delete(key);
|
|
26
27
|
} else if (this.cache.size >= this.capacity) {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
this.cache.delete(
|
|
28
|
+
const first = this.cache.keys().next();
|
|
29
|
+
if (!first.done) {
|
|
30
|
+
this.cache.delete(first.value);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
this.cache.set(key, value);
|
|
@@ -4,27 +4,28 @@ import { z } from 'zod';
|
|
|
4
4
|
// src/lib/lru-cache.ts
|
|
5
5
|
var LRUCache = class {
|
|
6
6
|
constructor(capacity) {
|
|
7
|
-
if (capacity <= 0) {
|
|
7
|
+
if (!Number.isInteger(capacity) || capacity <= 0) {
|
|
8
8
|
throw new Error("LRU cache capacity must be greater than 0");
|
|
9
9
|
}
|
|
10
10
|
this.capacity = capacity;
|
|
11
11
|
this.cache = /* @__PURE__ */ new Map();
|
|
12
12
|
}
|
|
13
13
|
get(key) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.cache.delete(key);
|
|
17
|
-
this.cache.set(key, value);
|
|
14
|
+
if (!this.cache.has(key)) {
|
|
15
|
+
return void 0;
|
|
18
16
|
}
|
|
17
|
+
const value = this.cache.get(key);
|
|
18
|
+
this.cache.delete(key);
|
|
19
|
+
this.cache.set(key, value);
|
|
19
20
|
return value;
|
|
20
21
|
}
|
|
21
22
|
set(key, value) {
|
|
22
23
|
if (this.cache.has(key)) {
|
|
23
24
|
this.cache.delete(key);
|
|
24
25
|
} else if (this.cache.size >= this.capacity) {
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
this.cache.delete(
|
|
26
|
+
const first = this.cache.keys().next();
|
|
27
|
+
if (!first.done) {
|
|
28
|
+
this.cache.delete(first.value);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
this.cache.set(key, value);
|
|
@@ -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-B4847Nul.js';
|
|
3
|
+
import { V as ValidationMessages, a as ValidationResult } from './types-C8nztuFF.js';
|
|
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-BpMes5H_.mjs';
|
|
3
|
+
import { V as ValidationMessages, a as ValidationResult } from './types-CyxVuV_d.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create a Zod schema for any attribute type.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { i as ComputedValueType, j as ComputedReturnType, k as AttributeType, l as ComputedOptionsSource, m as ComputedDependency, n as ComputedPlan,
|
|
2
|
-
export { W as AUTOFILL_ELIGIBLE_TYPES, X as AttributeGroup, Y as AutofillEligibleType, Z as BaseAttribute, _ as BuiltInTransform, $ as ComputedAttributeState, a0 as ComputedFieldKind, a1 as ComputedFormulaBinaryNode, a2 as ComputedFormulaBinaryOperator, a3 as ComputedFormulaCallNode, a4 as ComputedFormulaLiteralNode, a5 as ComputedFormulaParseError, a6 as ComputedFormulaPathNode, a7 as ComputedStateStatus, a8 as CreateDocument, a9 as CreateDocumentLink, aa as CreateDocumentSlot, ab as DEFAULT_DOCUMENT_SLOT, ac as DateFormat, ad as DateValue, ae as Document, af as DocumentKind, ag as DocumentLayoutVariant, ah as DocumentListOptions, ai as DocumentSlot, aj as DocumentWithSlots, ak as DocumentWithSubCount, al as FolderPreset, am as MAX_PRESET_DEPTH, an as NumberUnit, ao as ObjectAttribute, ap as ObjectRecord, aq as OptionPropertyAttribute, ar as PresetNode, as as PropertyAttribute, at as PropertyType, au as RELATION_TARGET_ANY, av as RESERVED_ATTRIBUTE_NAMES, aw as RESERVED_OBJECT_NAMES, ax as RecordDocuments, ay as ReservedAttributeName, az as ReservedObjectName, aA as RichTextAttribute, aB as SYSTEM_FIELD_NAMES, aC as SlotStatus, aD as StatusGroup, aE as SystemFieldName, aF as UpdateDocument, aG as UpdateDocumentSlot, aH as hasOptions, aI as inferInverseCardinality, aJ as isAttributeSortable, aK as isBilateralRelation, aL as isUniversalRelation, aM as parseComputedFormula, aN as resolvePropertyDefinitions } from './attributes-
|
|
1
|
+
import { i as ComputedValueType, j as ComputedReturnType, k as AttributeType, l as ComputedOptionsSource, m as ComputedDependency, n as ComputedPlan, f as RollupAttribute, o as ComputedFormulaAstNode, A as Attribute, p as DocumentLayout, h as CompletionStatus, q as Timestamps, r as SchemaOperation, s as LocationGranularity, t as Location, e as FormulaAttribute, D as DateAttribute, u as DateRangeValue, v as DocumentAttribute, d as StatusAttribute, c as SelectAttribute, b as MultiselectAttribute, w as Phone, x as Currency, U as UserAttribute, y as DocumentSlotConfig, z as PropertySchema, B as AutofillConfig, g as CheckboxAttribute, C as CurrencyAttribute, E as TimeFormat, T as TextAttribute, N as NumberAttribute, P as PhoneAttribute, G as Option, L as LocationAttribute, F as FileAttribute, H as FormulaReturnType, R as RelationAttribute, I as BilateralConfig, S as SingleRelationAttribute, M as MultiRelationAttribute, J as RelationTarget, a as RichtextAttribute, K as RollupFunction, Q as UserReferenceType, V as MigrationDefinition, O as ObjectDefinition } from './attributes-BpMes5H_.mjs';
|
|
2
|
+
export { W as AUTOFILL_ELIGIBLE_TYPES, X as AttributeGroup, Y as AutofillEligibleType, Z as BaseAttribute, _ as BuiltInTransform, $ as ComputedAttributeState, a0 as ComputedFieldKind, a1 as ComputedFormulaBinaryNode, a2 as ComputedFormulaBinaryOperator, a3 as ComputedFormulaCallNode, a4 as ComputedFormulaLiteralNode, a5 as ComputedFormulaParseError, a6 as ComputedFormulaPathNode, a7 as ComputedStateStatus, a8 as CreateDocument, a9 as CreateDocumentLink, aa as CreateDocumentSlot, ab as DEFAULT_DOCUMENT_SLOT, ac as DateFormat, ad as DateValue, ae as Document, af as DocumentKind, ag as DocumentLayoutVariant, ah as DocumentListOptions, ai as DocumentSlot, aj as DocumentWithSlots, ak as DocumentWithSubCount, al as FolderPreset, am as MAX_PRESET_DEPTH, an as NumberUnit, ao as ObjectAttribute, ap as ObjectRecord, aq as OptionPropertyAttribute, ar as PresetNode, as as PropertyAttribute, at as PropertyType, au as RELATION_TARGET_ANY, av as RESERVED_ATTRIBUTE_NAMES, aw as RESERVED_OBJECT_NAMES, ax as RecordDocuments, ay as ReservedAttributeName, az as ReservedObjectName, aA as RichTextAttribute, aB as SYSTEM_FIELD_NAMES, aC as SlotStatus, aD as StatusGroup, aE as SystemFieldName, aF as UpdateDocument, aG as UpdateDocumentSlot, aH as hasOptions, aI as inferInverseCardinality, aJ as isAttributeSortable, aK as isBilateralRelation, aL as isUniversalRelation, aM as parseComputedFormula, aN as resolvePropertyDefinitions } from './attributes-BpMes5H_.mjs';
|
|
3
3
|
import { IconName, MimeType, ColorId, CountryIso3, CurrencyCode } from '@stndrds/constants';
|
|
4
4
|
import { Uuid, TenantId } from './utils.mjs';
|
|
5
5
|
export { UserId, asTenantId, asUserId, deepEqual, generateId, indexBy } from './utils.mjs';
|
|
6
6
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
7
7
|
export { StandardSchemaV1 } from '@standard-schema/spec';
|
|
8
8
|
import z from 'zod';
|
|
9
|
-
export { V as ValidationMessages } from './types-
|
|
9
|
+
export { V as ValidationMessages } from './types-CyxVuV_d.mjs';
|
|
10
10
|
export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './validation/core/index.mjs';
|
|
11
11
|
export { parseAttributeConfig } from './validation/config/index.mjs';
|
|
12
|
-
export { c as computeRecordStatus, a as createFormAttributeValidator, r as rejectUnknownAttributesOrThrow, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from './helpers-
|
|
12
|
+
export { c as computeRecordStatus, a as createFormAttributeValidator, r as rejectUnknownAttributesOrThrow, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from './helpers-ow7sORSi.mjs';
|
|
13
13
|
|
|
14
14
|
declare const COMPUTED_FUNCTION_NAMES: readonly ["if", "concat", "sum", "avg", "count", "min", "max", "earliest", "latest", "unique", "first", "percent_empty", "percent_not_empty", "count_empty", "count_not_empty", "count_unique"];
|
|
15
15
|
type ComputedFunctionName = (typeof COMPUTED_FUNCTION_NAMES)[number];
|
|
@@ -2773,7 +2773,7 @@ declare class SchemaError extends Error {
|
|
|
2773
2773
|
declare class NotFoundError extends SchemaError {
|
|
2774
2774
|
readonly resourceType: string;
|
|
2775
2775
|
readonly resourceId: string;
|
|
2776
|
-
constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode);
|
|
2776
|
+
constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode, message?: string);
|
|
2777
2777
|
}
|
|
2778
2778
|
/**
|
|
2779
2779
|
* Object not found error
|
|
@@ -7075,7 +7075,7 @@ declare class FlagRegistry {
|
|
|
7075
7075
|
* Register a feature flag definition.
|
|
7076
7076
|
*
|
|
7077
7077
|
* @param flag - The flag definition to register
|
|
7078
|
-
* @throws
|
|
7078
|
+
* @throws DuplicateError If a flag with the same name is already registered
|
|
7079
7079
|
*
|
|
7080
7080
|
* @example
|
|
7081
7081
|
* ```typescript
|
|
@@ -7091,7 +7091,7 @@ declare class FlagRegistry {
|
|
|
7091
7091
|
* This operation is atomic - either all flags are registered or none are.
|
|
7092
7092
|
*
|
|
7093
7093
|
* @param flags - Array of flag definitions to register
|
|
7094
|
-
* @throws
|
|
7094
|
+
* @throws DuplicateError If any flag name conflicts with existing or duplicate within batch
|
|
7095
7095
|
*/
|
|
7096
7096
|
registerAll(flags: FeatureFlagDefinition[]): void;
|
|
7097
7097
|
/**
|
|
@@ -7106,7 +7106,7 @@ declare class FlagRegistry {
|
|
|
7106
7106
|
*
|
|
7107
7107
|
* @param name - The flag name
|
|
7108
7108
|
* @returns The flag definition
|
|
7109
|
-
* @throws
|
|
7109
|
+
* @throws NotFoundError If the flag is not registered
|
|
7110
7110
|
*/
|
|
7111
7111
|
getOrThrow<T = unknown>(name: string): FeatureFlagDefinition<T>;
|
|
7112
7112
|
/**
|
|
@@ -7314,7 +7314,7 @@ declare class NativeObjectRegistryClass {
|
|
|
7314
7314
|
* Auto-builds if ObjectBuilder is passed instead of ObjectDefinition
|
|
7315
7315
|
* @param objects - Single object/builder or array of objects/builders to register
|
|
7316
7316
|
* @returns this (for chaining)
|
|
7317
|
-
* @throws
|
|
7317
|
+
* @throws SchemaError if object is invalid or already registered
|
|
7318
7318
|
*
|
|
7319
7319
|
* @example
|
|
7320
7320
|
* ```typescript
|
|
@@ -7360,7 +7360,7 @@ declare class NativeObjectRegistryClass {
|
|
|
7360
7360
|
* Get a native object or throw if not found
|
|
7361
7361
|
* @param name - The object name
|
|
7362
7362
|
* @returns The object definition
|
|
7363
|
-
* @throws
|
|
7363
|
+
* @throws NotFoundError if not found
|
|
7364
7364
|
*/
|
|
7365
7365
|
getByNameOrThrow(name: string): ObjectDefinition;
|
|
7366
7366
|
/**
|
|
@@ -7393,9 +7393,9 @@ declare class NativeObjectRegistryClass {
|
|
|
7393
7393
|
*/
|
|
7394
7394
|
summary(): string;
|
|
7395
7395
|
/**
|
|
7396
|
-
*
|
|
7396
|
+
* Return registry summary and optionally pass it to a debug writer.
|
|
7397
7397
|
*/
|
|
7398
|
-
debug():
|
|
7398
|
+
debug(write?: (message: string) => void): string;
|
|
7399
7399
|
}
|
|
7400
7400
|
/**
|
|
7401
7401
|
* Singleton instance of the registry
|
|
@@ -7415,7 +7415,7 @@ declare class NativeObjectRegistryClass {
|
|
|
7415
7415
|
* console.log(registry.listNames()); // ["products", "orders", ...]
|
|
7416
7416
|
*
|
|
7417
7417
|
* // Debug
|
|
7418
|
-
* registry.debug();
|
|
7418
|
+
* registry.debug((summary) => logger.info(summary));
|
|
7419
7419
|
* ```
|
|
7420
7420
|
*/
|
|
7421
7421
|
declare const registry: NativeObjectRegistryClass;
|
|
@@ -7510,9 +7510,9 @@ declare class ViewRegistry {
|
|
|
7510
7510
|
*/
|
|
7511
7511
|
summary(): string;
|
|
7512
7512
|
/**
|
|
7513
|
-
*
|
|
7513
|
+
* Return summary and optionally pass it to a debug writer.
|
|
7514
7514
|
*/
|
|
7515
|
-
debug():
|
|
7515
|
+
debug(write?: (message: string) => void): string;
|
|
7516
7516
|
private makeKey;
|
|
7517
7517
|
}
|
|
7518
7518
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { i as ComputedValueType, j as ComputedReturnType, k as AttributeType, l as ComputedOptionsSource, m as ComputedDependency, n as ComputedPlan,
|
|
2
|
-
export { W as AUTOFILL_ELIGIBLE_TYPES, X as AttributeGroup, Y as AutofillEligibleType, Z as BaseAttribute, _ as BuiltInTransform, $ as ComputedAttributeState, a0 as ComputedFieldKind, a1 as ComputedFormulaBinaryNode, a2 as ComputedFormulaBinaryOperator, a3 as ComputedFormulaCallNode, a4 as ComputedFormulaLiteralNode, a5 as ComputedFormulaParseError, a6 as ComputedFormulaPathNode, a7 as ComputedStateStatus, a8 as CreateDocument, a9 as CreateDocumentLink, aa as CreateDocumentSlot, ab as DEFAULT_DOCUMENT_SLOT, ac as DateFormat, ad as DateValue, ae as Document, af as DocumentKind, ag as DocumentLayoutVariant, ah as DocumentListOptions, ai as DocumentSlot, aj as DocumentWithSlots, ak as DocumentWithSubCount, al as FolderPreset, am as MAX_PRESET_DEPTH, an as NumberUnit, ao as ObjectAttribute, ap as ObjectRecord, aq as OptionPropertyAttribute, ar as PresetNode, as as PropertyAttribute, at as PropertyType, au as RELATION_TARGET_ANY, av as RESERVED_ATTRIBUTE_NAMES, aw as RESERVED_OBJECT_NAMES, ax as RecordDocuments, ay as ReservedAttributeName, az as ReservedObjectName, aA as RichTextAttribute, aB as SYSTEM_FIELD_NAMES, aC as SlotStatus, aD as StatusGroup, aE as SystemFieldName, aF as UpdateDocument, aG as UpdateDocumentSlot, aH as hasOptions, aI as inferInverseCardinality, aJ as isAttributeSortable, aK as isBilateralRelation, aL as isUniversalRelation, aM as parseComputedFormula, aN as resolvePropertyDefinitions } from './attributes-
|
|
1
|
+
import { i as ComputedValueType, j as ComputedReturnType, k as AttributeType, l as ComputedOptionsSource, m as ComputedDependency, n as ComputedPlan, f as RollupAttribute, o as ComputedFormulaAstNode, A as Attribute, p as DocumentLayout, h as CompletionStatus, q as Timestamps, r as SchemaOperation, s as LocationGranularity, t as Location, e as FormulaAttribute, D as DateAttribute, u as DateRangeValue, v as DocumentAttribute, d as StatusAttribute, c as SelectAttribute, b as MultiselectAttribute, w as Phone, x as Currency, U as UserAttribute, y as DocumentSlotConfig, z as PropertySchema, B as AutofillConfig, g as CheckboxAttribute, C as CurrencyAttribute, E as TimeFormat, T as TextAttribute, N as NumberAttribute, P as PhoneAttribute, G as Option, L as LocationAttribute, F as FileAttribute, H as FormulaReturnType, R as RelationAttribute, I as BilateralConfig, S as SingleRelationAttribute, M as MultiRelationAttribute, J as RelationTarget, a as RichtextAttribute, K as RollupFunction, Q as UserReferenceType, V as MigrationDefinition, O as ObjectDefinition } from './attributes-B4847Nul.js';
|
|
2
|
+
export { W as AUTOFILL_ELIGIBLE_TYPES, X as AttributeGroup, Y as AutofillEligibleType, Z as BaseAttribute, _ as BuiltInTransform, $ as ComputedAttributeState, a0 as ComputedFieldKind, a1 as ComputedFormulaBinaryNode, a2 as ComputedFormulaBinaryOperator, a3 as ComputedFormulaCallNode, a4 as ComputedFormulaLiteralNode, a5 as ComputedFormulaParseError, a6 as ComputedFormulaPathNode, a7 as ComputedStateStatus, a8 as CreateDocument, a9 as CreateDocumentLink, aa as CreateDocumentSlot, ab as DEFAULT_DOCUMENT_SLOT, ac as DateFormat, ad as DateValue, ae as Document, af as DocumentKind, ag as DocumentLayoutVariant, ah as DocumentListOptions, ai as DocumentSlot, aj as DocumentWithSlots, ak as DocumentWithSubCount, al as FolderPreset, am as MAX_PRESET_DEPTH, an as NumberUnit, ao as ObjectAttribute, ap as ObjectRecord, aq as OptionPropertyAttribute, ar as PresetNode, as as PropertyAttribute, at as PropertyType, au as RELATION_TARGET_ANY, av as RESERVED_ATTRIBUTE_NAMES, aw as RESERVED_OBJECT_NAMES, ax as RecordDocuments, ay as ReservedAttributeName, az as ReservedObjectName, aA as RichTextAttribute, aB as SYSTEM_FIELD_NAMES, aC as SlotStatus, aD as StatusGroup, aE as SystemFieldName, aF as UpdateDocument, aG as UpdateDocumentSlot, aH as hasOptions, aI as inferInverseCardinality, aJ as isAttributeSortable, aK as isBilateralRelation, aL as isUniversalRelation, aM as parseComputedFormula, aN as resolvePropertyDefinitions } from './attributes-B4847Nul.js';
|
|
3
3
|
import { IconName, MimeType, ColorId, CountryIso3, CurrencyCode } from '@stndrds/constants';
|
|
4
4
|
import { Uuid, TenantId } from './utils.js';
|
|
5
5
|
export { UserId, asTenantId, asUserId, deepEqual, generateId, indexBy } from './utils.js';
|
|
6
6
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
7
7
|
export { StandardSchemaV1 } from '@standard-schema/spec';
|
|
8
8
|
import z from 'zod';
|
|
9
|
-
export { V as ValidationMessages } from './types-
|
|
9
|
+
export { V as ValidationMessages } from './types-C8nztuFF.js';
|
|
10
10
|
export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './validation/core/index.js';
|
|
11
11
|
export { parseAttributeConfig } from './validation/config/index.js';
|
|
12
|
-
export { c as computeRecordStatus, a as createFormAttributeValidator, r as rejectUnknownAttributesOrThrow, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from './helpers-
|
|
12
|
+
export { c as computeRecordStatus, a as createFormAttributeValidator, r as rejectUnknownAttributesOrThrow, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from './helpers-DsJff5r-.js';
|
|
13
13
|
|
|
14
14
|
declare const COMPUTED_FUNCTION_NAMES: readonly ["if", "concat", "sum", "avg", "count", "min", "max", "earliest", "latest", "unique", "first", "percent_empty", "percent_not_empty", "count_empty", "count_not_empty", "count_unique"];
|
|
15
15
|
type ComputedFunctionName = (typeof COMPUTED_FUNCTION_NAMES)[number];
|
|
@@ -2773,7 +2773,7 @@ declare class SchemaError extends Error {
|
|
|
2773
2773
|
declare class NotFoundError extends SchemaError {
|
|
2774
2774
|
readonly resourceType: string;
|
|
2775
2775
|
readonly resourceId: string;
|
|
2776
|
-
constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode);
|
|
2776
|
+
constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode, message?: string);
|
|
2777
2777
|
}
|
|
2778
2778
|
/**
|
|
2779
2779
|
* Object not found error
|
|
@@ -7075,7 +7075,7 @@ declare class FlagRegistry {
|
|
|
7075
7075
|
* Register a feature flag definition.
|
|
7076
7076
|
*
|
|
7077
7077
|
* @param flag - The flag definition to register
|
|
7078
|
-
* @throws
|
|
7078
|
+
* @throws DuplicateError If a flag with the same name is already registered
|
|
7079
7079
|
*
|
|
7080
7080
|
* @example
|
|
7081
7081
|
* ```typescript
|
|
@@ -7091,7 +7091,7 @@ declare class FlagRegistry {
|
|
|
7091
7091
|
* This operation is atomic - either all flags are registered or none are.
|
|
7092
7092
|
*
|
|
7093
7093
|
* @param flags - Array of flag definitions to register
|
|
7094
|
-
* @throws
|
|
7094
|
+
* @throws DuplicateError If any flag name conflicts with existing or duplicate within batch
|
|
7095
7095
|
*/
|
|
7096
7096
|
registerAll(flags: FeatureFlagDefinition[]): void;
|
|
7097
7097
|
/**
|
|
@@ -7106,7 +7106,7 @@ declare class FlagRegistry {
|
|
|
7106
7106
|
*
|
|
7107
7107
|
* @param name - The flag name
|
|
7108
7108
|
* @returns The flag definition
|
|
7109
|
-
* @throws
|
|
7109
|
+
* @throws NotFoundError If the flag is not registered
|
|
7110
7110
|
*/
|
|
7111
7111
|
getOrThrow<T = unknown>(name: string): FeatureFlagDefinition<T>;
|
|
7112
7112
|
/**
|
|
@@ -7314,7 +7314,7 @@ declare class NativeObjectRegistryClass {
|
|
|
7314
7314
|
* Auto-builds if ObjectBuilder is passed instead of ObjectDefinition
|
|
7315
7315
|
* @param objects - Single object/builder or array of objects/builders to register
|
|
7316
7316
|
* @returns this (for chaining)
|
|
7317
|
-
* @throws
|
|
7317
|
+
* @throws SchemaError if object is invalid or already registered
|
|
7318
7318
|
*
|
|
7319
7319
|
* @example
|
|
7320
7320
|
* ```typescript
|
|
@@ -7360,7 +7360,7 @@ declare class NativeObjectRegistryClass {
|
|
|
7360
7360
|
* Get a native object or throw if not found
|
|
7361
7361
|
* @param name - The object name
|
|
7362
7362
|
* @returns The object definition
|
|
7363
|
-
* @throws
|
|
7363
|
+
* @throws NotFoundError if not found
|
|
7364
7364
|
*/
|
|
7365
7365
|
getByNameOrThrow(name: string): ObjectDefinition;
|
|
7366
7366
|
/**
|
|
@@ -7393,9 +7393,9 @@ declare class NativeObjectRegistryClass {
|
|
|
7393
7393
|
*/
|
|
7394
7394
|
summary(): string;
|
|
7395
7395
|
/**
|
|
7396
|
-
*
|
|
7396
|
+
* Return registry summary and optionally pass it to a debug writer.
|
|
7397
7397
|
*/
|
|
7398
|
-
debug():
|
|
7398
|
+
debug(write?: (message: string) => void): string;
|
|
7399
7399
|
}
|
|
7400
7400
|
/**
|
|
7401
7401
|
* Singleton instance of the registry
|
|
@@ -7415,7 +7415,7 @@ declare class NativeObjectRegistryClass {
|
|
|
7415
7415
|
* console.log(registry.listNames()); // ["products", "orders", ...]
|
|
7416
7416
|
*
|
|
7417
7417
|
* // Debug
|
|
7418
|
-
* registry.debug();
|
|
7418
|
+
* registry.debug((summary) => logger.info(summary));
|
|
7419
7419
|
* ```
|
|
7420
7420
|
*/
|
|
7421
7421
|
declare const registry: NativeObjectRegistryClass;
|
|
@@ -7510,9 +7510,9 @@ declare class ViewRegistry {
|
|
|
7510
7510
|
*/
|
|
7511
7511
|
summary(): string;
|
|
7512
7512
|
/**
|
|
7513
|
-
*
|
|
7513
|
+
* Return summary and optionally pass it to a debug writer.
|
|
7514
7514
|
*/
|
|
7515
|
-
debug():
|
|
7515
|
+
debug(write?: (message: string) => void): string;
|
|
7516
7516
|
private makeKey;
|
|
7517
7517
|
}
|
|
7518
7518
|
/**
|