@stndrds/schema 1.0.0-alpha.168 → 1.0.0-alpha.169
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/{helpers-D3nsZLoE.d.ts → helpers-64gmAyw0.d.ts} +1 -1
- package/dist/{helpers-BTuRte-r.d.mts → helpers-DOjqrfWE.d.mts} +1 -1
- package/dist/index.d.mts +1 -9
- package/dist/index.d.ts +1 -9
- package/dist/index.js +53 -50
- package/dist/index.mjs +50 -51
- package/dist/validation/all.d.mts +1 -1
- package/dist/validation/all.d.ts +1 -1
- package/dist/validation/all.js +4 -0
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/object/index.d.mts +1 -1
- package/dist/validation/object/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -58,4 +58,4 @@ declare function isRecordComplete(objectDef: ObjectDefinition, data: Record<stri
|
|
|
58
58
|
*/
|
|
59
59
|
declare function computeRecordStatus(objectDef: ObjectDefinition, data: Record<string, unknown>): CompletionStatus;
|
|
60
60
|
|
|
61
|
-
export { createFormAttributeValidator as a,
|
|
61
|
+
export { createFormAttributeValidator as a, validateDraftOrThrow as b, computeRecordStatus as c, validateObject as d, validateObjectOrThrow as e, createAttributeValidator as f, getMissingRequiredAttributes as g, validateAttribute as h, isRecordComplete as i, validateDraft as v };
|
|
@@ -58,4 +58,4 @@ declare function isRecordComplete(objectDef: ObjectDefinition, data: Record<stri
|
|
|
58
58
|
*/
|
|
59
59
|
declare function computeRecordStatus(objectDef: ObjectDefinition, data: Record<string, unknown>): CompletionStatus;
|
|
60
60
|
|
|
61
|
-
export { createFormAttributeValidator as a,
|
|
61
|
+
export { createFormAttributeValidator as a, validateDraftOrThrow as b, computeRecordStatus as c, validateObject as d, validateObjectOrThrow as e, createAttributeValidator as f, getMissingRequiredAttributes as g, validateAttribute as h, isRecordComplete as i, validateDraft as v };
|
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import z from 'zod';
|
|
|
9
9
|
export { V as ValidationMessages } from './types-DxEobsMy.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, v as
|
|
12
|
+
export { c as computeRecordStatus, a as createFormAttributeValidator, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from './helpers-DOjqrfWE.mjs';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Generic list options for pagination and sorting
|
|
@@ -5176,10 +5176,6 @@ declare class DetailViewBuilder {
|
|
|
5176
5176
|
* Build the final view definition
|
|
5177
5177
|
*/
|
|
5178
5178
|
build(): DetailViewDefinition;
|
|
5179
|
-
/**
|
|
5180
|
-
* Validate view name format (kebab-case)
|
|
5181
|
-
*/
|
|
5182
|
-
private validateName;
|
|
5183
5179
|
}
|
|
5184
5180
|
/**
|
|
5185
5181
|
* Create a new detail view builder
|
|
@@ -5341,10 +5337,6 @@ declare class ListViewBuilder {
|
|
|
5341
5337
|
* Build the final list view definition
|
|
5342
5338
|
*/
|
|
5343
5339
|
build(): ListViewDefinition;
|
|
5344
|
-
/**
|
|
5345
|
-
* Validate view name format (kebab-case)
|
|
5346
|
-
*/
|
|
5347
|
-
private validateName;
|
|
5348
5340
|
}
|
|
5349
5341
|
/**
|
|
5350
5342
|
* Builder for configuring tabs in list views.
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import z from 'zod';
|
|
|
9
9
|
export { V as ValidationMessages } from './types-Bemfgle3.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, v as
|
|
12
|
+
export { c as computeRecordStatus, a as createFormAttributeValidator, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from './helpers-64gmAyw0.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Generic list options for pagination and sorting
|
|
@@ -5176,10 +5176,6 @@ declare class DetailViewBuilder {
|
|
|
5176
5176
|
* Build the final view definition
|
|
5177
5177
|
*/
|
|
5178
5178
|
build(): DetailViewDefinition;
|
|
5179
|
-
/**
|
|
5180
|
-
* Validate view name format (kebab-case)
|
|
5181
|
-
*/
|
|
5182
|
-
private validateName;
|
|
5183
5179
|
}
|
|
5184
5180
|
/**
|
|
5185
5181
|
* Create a new detail view builder
|
|
@@ -5341,10 +5337,6 @@ declare class ListViewBuilder {
|
|
|
5341
5337
|
* Build the final list view definition
|
|
5342
5338
|
*/
|
|
5343
5339
|
build(): ListViewDefinition;
|
|
5344
|
-
/**
|
|
5345
|
-
* Validate view name format (kebab-case)
|
|
5346
|
-
*/
|
|
5347
|
-
private validateName;
|
|
5348
5340
|
}
|
|
5349
5341
|
/**
|
|
5350
5342
|
* Builder for configuring tabs in list views.
|
package/dist/index.js
CHANGED
|
@@ -3006,6 +3006,35 @@ var RelationGroupBuilder = class {
|
|
|
3006
3006
|
return this.data;
|
|
3007
3007
|
}
|
|
3008
3008
|
};
|
|
3009
|
+
function assertViewVersion(version) {
|
|
3010
|
+
if (version < 1) throw new Error("View version must be >= 1");
|
|
3011
|
+
}
|
|
3012
|
+
function assertUniqueBy(items, getKey, buildError) {
|
|
3013
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3014
|
+
for (const item of items) {
|
|
3015
|
+
const key = getKey(item);
|
|
3016
|
+
if (seen.has(key)) {
|
|
3017
|
+
throw new Error(buildError(key));
|
|
3018
|
+
}
|
|
3019
|
+
seen.add(key);
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
function validateViewName(name, builderName, examples) {
|
|
3023
|
+
const viewNameSchema = z3.z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
|
|
3024
|
+
message: `Invalid view name format.
|
|
3025
|
+
Name must be in kebab-case:
|
|
3026
|
+
\u2705 Valid: ${examples.valid}
|
|
3027
|
+
\u274C Invalid: ${examples.invalid}`
|
|
3028
|
+
});
|
|
3029
|
+
try {
|
|
3030
|
+
viewNameSchema.parse(name);
|
|
3031
|
+
} catch (error) {
|
|
3032
|
+
if (error instanceof z3.z.ZodError) {
|
|
3033
|
+
throw new Error(`[${builderName}] ${error.issues[0].message}`);
|
|
3034
|
+
}
|
|
3035
|
+
throw error;
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3009
3038
|
var TableTabConfig = class {
|
|
3010
3039
|
/** @internal */
|
|
3011
3040
|
constructor(view, tabData) {
|
|
@@ -3416,7 +3445,10 @@ var TabBuilder = class {
|
|
|
3416
3445
|
var DetailViewBuilder = class {
|
|
3417
3446
|
constructor(name, label) {
|
|
3418
3447
|
this._version = 1;
|
|
3419
|
-
|
|
3448
|
+
validateViewName(name, "DetailViewBuilder", {
|
|
3449
|
+
valid: "'detail', 'list-view', 'company-detail'",
|
|
3450
|
+
invalid: "'Detail', 'listView', 'list_view'"
|
|
3451
|
+
});
|
|
3420
3452
|
this.data = {
|
|
3421
3453
|
name,
|
|
3422
3454
|
label,
|
|
@@ -3484,7 +3516,7 @@ var DetailViewBuilder = class {
|
|
|
3484
3516
|
* @default 1
|
|
3485
3517
|
*/
|
|
3486
3518
|
version(v) {
|
|
3487
|
-
|
|
3519
|
+
assertViewVersion(v);
|
|
3488
3520
|
this._version = v;
|
|
3489
3521
|
return this;
|
|
3490
3522
|
}
|
|
@@ -3528,13 +3560,11 @@ var DetailViewBuilder = class {
|
|
|
3528
3560
|
if (this.data.tabs.length === 0) {
|
|
3529
3561
|
throw new Error("[DetailViewBuilder] At least one tab is required");
|
|
3530
3562
|
}
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
tabNames.add(tab.name);
|
|
3537
|
-
}
|
|
3563
|
+
assertUniqueBy(
|
|
3564
|
+
this.data.tabs,
|
|
3565
|
+
(tab) => tab.name,
|
|
3566
|
+
(name) => `[DetailViewBuilder] Duplicate tab name "${name}"`
|
|
3567
|
+
);
|
|
3538
3568
|
if (this.data.layout === "modal") {
|
|
3539
3569
|
if (this.data.tabs.length !== 1) {
|
|
3540
3570
|
throw new Error("[DetailViewBuilder] Modal views must have exactly one tab");
|
|
@@ -3564,22 +3594,6 @@ var DetailViewBuilder = class {
|
|
|
3564
3594
|
schema_version: this._version
|
|
3565
3595
|
};
|
|
3566
3596
|
}
|
|
3567
|
-
/**
|
|
3568
|
-
* Validate view name format (kebab-case)
|
|
3569
|
-
*/
|
|
3570
|
-
validateName(name) {
|
|
3571
|
-
const viewNameSchema = z3.z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
|
|
3572
|
-
message: "Invalid view name format.\nName must be in kebab-case:\n \u2705 Valid: 'detail', 'list-view', 'company-detail'\n \u274C Invalid: 'Detail', 'listView', 'list_view'"
|
|
3573
|
-
});
|
|
3574
|
-
try {
|
|
3575
|
-
viewNameSchema.parse(name);
|
|
3576
|
-
} catch (error) {
|
|
3577
|
-
if (error instanceof z3.z.ZodError) {
|
|
3578
|
-
throw new Error(`[DetailViewBuilder] ${error.issues[0].message}`);
|
|
3579
|
-
}
|
|
3580
|
-
throw error;
|
|
3581
|
-
}
|
|
3582
|
-
}
|
|
3583
3597
|
};
|
|
3584
3598
|
function detailView(name, label) {
|
|
3585
3599
|
return new DetailViewBuilder(name, label);
|
|
@@ -3587,7 +3601,10 @@ function detailView(name, label) {
|
|
|
3587
3601
|
var ListViewBuilder = class {
|
|
3588
3602
|
constructor(name, label) {
|
|
3589
3603
|
this._version = 1;
|
|
3590
|
-
|
|
3604
|
+
validateViewName(name, "ListViewBuilder", {
|
|
3605
|
+
valid: "'default', 'list-view', 'active-contacts'",
|
|
3606
|
+
invalid: "'Default', 'listView', 'list_view'"
|
|
3607
|
+
});
|
|
3591
3608
|
this.data = {
|
|
3592
3609
|
name,
|
|
3593
3610
|
label,
|
|
@@ -3637,7 +3654,7 @@ var ListViewBuilder = class {
|
|
|
3637
3654
|
* @default 1
|
|
3638
3655
|
*/
|
|
3639
3656
|
version(v) {
|
|
3640
|
-
|
|
3657
|
+
assertViewVersion(v);
|
|
3641
3658
|
this._version = v;
|
|
3642
3659
|
return this;
|
|
3643
3660
|
}
|
|
@@ -3679,13 +3696,11 @@ var ListViewBuilder = class {
|
|
|
3679
3696
|
if (this.data.tabs.length === 0) {
|
|
3680
3697
|
throw new Error("[ListViewBuilder] At least one tab is required");
|
|
3681
3698
|
}
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
tabIds.add(tab.id);
|
|
3688
|
-
}
|
|
3699
|
+
assertUniqueBy(
|
|
3700
|
+
this.data.tabs,
|
|
3701
|
+
(tab) => tab.id,
|
|
3702
|
+
(id) => `[ListViewBuilder] Duplicate tab id "${id}"`
|
|
3703
|
+
);
|
|
3689
3704
|
const defaultTabs = this.data.tabs.filter((t) => t.default);
|
|
3690
3705
|
if (defaultTabs.length > 1) {
|
|
3691
3706
|
throw new Error("[ListViewBuilder] Only one tab can be marked as default");
|
|
@@ -3740,22 +3755,6 @@ var ListViewBuilder = class {
|
|
|
3740
3755
|
schema_version: this._version
|
|
3741
3756
|
};
|
|
3742
3757
|
}
|
|
3743
|
-
/**
|
|
3744
|
-
* Validate view name format (kebab-case)
|
|
3745
|
-
*/
|
|
3746
|
-
validateName(name) {
|
|
3747
|
-
const viewNameSchema = z3.z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
|
|
3748
|
-
message: "Invalid view name format.\nName must be in kebab-case:\n \u2705 Valid: 'default', 'list-view', 'active-contacts'\n \u274C Invalid: 'Default', 'listView', 'list_view'"
|
|
3749
|
-
});
|
|
3750
|
-
try {
|
|
3751
|
-
viewNameSchema.parse(name);
|
|
3752
|
-
} catch (error) {
|
|
3753
|
-
if (error instanceof z3.z.ZodError) {
|
|
3754
|
-
throw new Error(`[ListViewBuilder] ${error.issues[0].message}`);
|
|
3755
|
-
}
|
|
3756
|
-
throw error;
|
|
3757
|
-
}
|
|
3758
|
-
}
|
|
3759
3758
|
};
|
|
3760
3759
|
var ListViewTabConfigBuilder = class _ListViewTabConfigBuilder {
|
|
3761
3760
|
/** @internal */
|
|
@@ -5575,6 +5574,10 @@ Object.defineProperty(exports, "createFormAttributeValidator", {
|
|
|
5575
5574
|
enumerable: true,
|
|
5576
5575
|
get: function () { return chunk64R5X3DF_js.createFormAttributeValidator; }
|
|
5577
5576
|
});
|
|
5577
|
+
Object.defineProperty(exports, "validateDraft", {
|
|
5578
|
+
enumerable: true,
|
|
5579
|
+
get: function () { return chunk64R5X3DF_js.validateDraft; }
|
|
5580
|
+
});
|
|
5578
5581
|
Object.defineProperty(exports, "validateDraftOrThrow", {
|
|
5579
5582
|
enumerable: true,
|
|
5580
5583
|
get: function () { return chunk64R5X3DF_js.validateDraftOrThrow; }
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ export { asTenantId, asUserId, deepEqual, generateId, indexBy } from './chunk-QY
|
|
|
3
3
|
import './chunk-SP3PNHYF.mjs';
|
|
4
4
|
export { parseAttributeConfig } from './chunk-SS2NR6DH.mjs';
|
|
5
5
|
import { createObjectValidator, createAttributeValidator } from './chunk-6JEQE4IP.mjs';
|
|
6
|
-
export { computeRecordStatus, createFormAttributeValidator, validateDraftOrThrow, validateObject, validateObjectOrThrow } from './chunk-6JEQE4IP.mjs';
|
|
6
|
+
export { computeRecordStatus, createFormAttributeValidator, validateDraft, validateDraftOrThrow, validateObject, validateObjectOrThrow } from './chunk-6JEQE4IP.mjs';
|
|
7
7
|
import './chunk-TMYBEXBT.mjs';
|
|
8
8
|
import './chunk-4KRLCWJM.mjs';
|
|
9
9
|
import './chunk-KNYZH2WD.mjs';
|
|
@@ -3002,6 +3002,35 @@ var RelationGroupBuilder = class {
|
|
|
3002
3002
|
return this.data;
|
|
3003
3003
|
}
|
|
3004
3004
|
};
|
|
3005
|
+
function assertViewVersion(version) {
|
|
3006
|
+
if (version < 1) throw new Error("View version must be >= 1");
|
|
3007
|
+
}
|
|
3008
|
+
function assertUniqueBy(items, getKey, buildError) {
|
|
3009
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3010
|
+
for (const item of items) {
|
|
3011
|
+
const key = getKey(item);
|
|
3012
|
+
if (seen.has(key)) {
|
|
3013
|
+
throw new Error(buildError(key));
|
|
3014
|
+
}
|
|
3015
|
+
seen.add(key);
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
function validateViewName(name, builderName, examples) {
|
|
3019
|
+
const viewNameSchema = z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
|
|
3020
|
+
message: `Invalid view name format.
|
|
3021
|
+
Name must be in kebab-case:
|
|
3022
|
+
\u2705 Valid: ${examples.valid}
|
|
3023
|
+
\u274C Invalid: ${examples.invalid}`
|
|
3024
|
+
});
|
|
3025
|
+
try {
|
|
3026
|
+
viewNameSchema.parse(name);
|
|
3027
|
+
} catch (error) {
|
|
3028
|
+
if (error instanceof z.ZodError) {
|
|
3029
|
+
throw new Error(`[${builderName}] ${error.issues[0].message}`);
|
|
3030
|
+
}
|
|
3031
|
+
throw error;
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3005
3034
|
var TableTabConfig = class {
|
|
3006
3035
|
/** @internal */
|
|
3007
3036
|
constructor(view, tabData) {
|
|
@@ -3412,7 +3441,10 @@ var TabBuilder = class {
|
|
|
3412
3441
|
var DetailViewBuilder = class {
|
|
3413
3442
|
constructor(name, label) {
|
|
3414
3443
|
this._version = 1;
|
|
3415
|
-
|
|
3444
|
+
validateViewName(name, "DetailViewBuilder", {
|
|
3445
|
+
valid: "'detail', 'list-view', 'company-detail'",
|
|
3446
|
+
invalid: "'Detail', 'listView', 'list_view'"
|
|
3447
|
+
});
|
|
3416
3448
|
this.data = {
|
|
3417
3449
|
name,
|
|
3418
3450
|
label,
|
|
@@ -3480,7 +3512,7 @@ var DetailViewBuilder = class {
|
|
|
3480
3512
|
* @default 1
|
|
3481
3513
|
*/
|
|
3482
3514
|
version(v) {
|
|
3483
|
-
|
|
3515
|
+
assertViewVersion(v);
|
|
3484
3516
|
this._version = v;
|
|
3485
3517
|
return this;
|
|
3486
3518
|
}
|
|
@@ -3524,13 +3556,11 @@ var DetailViewBuilder = class {
|
|
|
3524
3556
|
if (this.data.tabs.length === 0) {
|
|
3525
3557
|
throw new Error("[DetailViewBuilder] At least one tab is required");
|
|
3526
3558
|
}
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
tabNames.add(tab.name);
|
|
3533
|
-
}
|
|
3559
|
+
assertUniqueBy(
|
|
3560
|
+
this.data.tabs,
|
|
3561
|
+
(tab) => tab.name,
|
|
3562
|
+
(name) => `[DetailViewBuilder] Duplicate tab name "${name}"`
|
|
3563
|
+
);
|
|
3534
3564
|
if (this.data.layout === "modal") {
|
|
3535
3565
|
if (this.data.tabs.length !== 1) {
|
|
3536
3566
|
throw new Error("[DetailViewBuilder] Modal views must have exactly one tab");
|
|
@@ -3560,22 +3590,6 @@ var DetailViewBuilder = class {
|
|
|
3560
3590
|
schema_version: this._version
|
|
3561
3591
|
};
|
|
3562
3592
|
}
|
|
3563
|
-
/**
|
|
3564
|
-
* Validate view name format (kebab-case)
|
|
3565
|
-
*/
|
|
3566
|
-
validateName(name) {
|
|
3567
|
-
const viewNameSchema = z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
|
|
3568
|
-
message: "Invalid view name format.\nName must be in kebab-case:\n \u2705 Valid: 'detail', 'list-view', 'company-detail'\n \u274C Invalid: 'Detail', 'listView', 'list_view'"
|
|
3569
|
-
});
|
|
3570
|
-
try {
|
|
3571
|
-
viewNameSchema.parse(name);
|
|
3572
|
-
} catch (error) {
|
|
3573
|
-
if (error instanceof z.ZodError) {
|
|
3574
|
-
throw new Error(`[DetailViewBuilder] ${error.issues[0].message}`);
|
|
3575
|
-
}
|
|
3576
|
-
throw error;
|
|
3577
|
-
}
|
|
3578
|
-
}
|
|
3579
3593
|
};
|
|
3580
3594
|
function detailView(name, label) {
|
|
3581
3595
|
return new DetailViewBuilder(name, label);
|
|
@@ -3583,7 +3597,10 @@ function detailView(name, label) {
|
|
|
3583
3597
|
var ListViewBuilder = class {
|
|
3584
3598
|
constructor(name, label) {
|
|
3585
3599
|
this._version = 1;
|
|
3586
|
-
|
|
3600
|
+
validateViewName(name, "ListViewBuilder", {
|
|
3601
|
+
valid: "'default', 'list-view', 'active-contacts'",
|
|
3602
|
+
invalid: "'Default', 'listView', 'list_view'"
|
|
3603
|
+
});
|
|
3587
3604
|
this.data = {
|
|
3588
3605
|
name,
|
|
3589
3606
|
label,
|
|
@@ -3633,7 +3650,7 @@ var ListViewBuilder = class {
|
|
|
3633
3650
|
* @default 1
|
|
3634
3651
|
*/
|
|
3635
3652
|
version(v) {
|
|
3636
|
-
|
|
3653
|
+
assertViewVersion(v);
|
|
3637
3654
|
this._version = v;
|
|
3638
3655
|
return this;
|
|
3639
3656
|
}
|
|
@@ -3675,13 +3692,11 @@ var ListViewBuilder = class {
|
|
|
3675
3692
|
if (this.data.tabs.length === 0) {
|
|
3676
3693
|
throw new Error("[ListViewBuilder] At least one tab is required");
|
|
3677
3694
|
}
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
tabIds.add(tab.id);
|
|
3684
|
-
}
|
|
3695
|
+
assertUniqueBy(
|
|
3696
|
+
this.data.tabs,
|
|
3697
|
+
(tab) => tab.id,
|
|
3698
|
+
(id) => `[ListViewBuilder] Duplicate tab id "${id}"`
|
|
3699
|
+
);
|
|
3685
3700
|
const defaultTabs = this.data.tabs.filter((t) => t.default);
|
|
3686
3701
|
if (defaultTabs.length > 1) {
|
|
3687
3702
|
throw new Error("[ListViewBuilder] Only one tab can be marked as default");
|
|
@@ -3736,22 +3751,6 @@ var ListViewBuilder = class {
|
|
|
3736
3751
|
schema_version: this._version
|
|
3737
3752
|
};
|
|
3738
3753
|
}
|
|
3739
|
-
/**
|
|
3740
|
-
* Validate view name format (kebab-case)
|
|
3741
|
-
*/
|
|
3742
|
-
validateName(name) {
|
|
3743
|
-
const viewNameSchema = z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
|
|
3744
|
-
message: "Invalid view name format.\nName must be in kebab-case:\n \u2705 Valid: 'default', 'list-view', 'active-contacts'\n \u274C Invalid: 'Default', 'listView', 'list_view'"
|
|
3745
|
-
});
|
|
3746
|
-
try {
|
|
3747
|
-
viewNameSchema.parse(name);
|
|
3748
|
-
} catch (error) {
|
|
3749
|
-
if (error instanceof z.ZodError) {
|
|
3750
|
-
throw new Error(`[ListViewBuilder] ${error.issues[0].message}`);
|
|
3751
|
-
}
|
|
3752
|
-
throw error;
|
|
3753
|
-
}
|
|
3754
|
-
}
|
|
3755
3754
|
};
|
|
3756
3755
|
var ListViewTabConfigBuilder = class _ListViewTabConfigBuilder {
|
|
3757
3756
|
/** @internal */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { V as ValidationMessages } from '../types-DxEobsMy.mjs';
|
|
2
2
|
export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './core/index.mjs';
|
|
3
3
|
export { parseAttributeConfig } from './config/index.mjs';
|
|
4
|
-
export { c as computeRecordStatus, a as createFormAttributeValidator, v as
|
|
4
|
+
export { c as computeRecordStatus, a as createFormAttributeValidator, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from '../helpers-DOjqrfWE.mjs';
|
|
5
5
|
import '../filters-DRXk4dLI.mjs';
|
|
6
6
|
import '@stndrds/constants';
|
|
7
7
|
import '../utils.mjs';
|
package/dist/validation/all.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { V as ValidationMessages } from '../types-Bemfgle3.js';
|
|
2
2
|
export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './core/index.js';
|
|
3
3
|
export { parseAttributeConfig } from './config/index.js';
|
|
4
|
-
export { c as computeRecordStatus, a as createFormAttributeValidator, v as
|
|
4
|
+
export { c as computeRecordStatus, a as createFormAttributeValidator, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from '../helpers-64gmAyw0.js';
|
|
5
5
|
import '../filters-zzsF0GxK.js';
|
|
6
6
|
import '@stndrds/constants';
|
|
7
7
|
import '../utils.js';
|
package/dist/validation/all.js
CHANGED
|
@@ -34,6 +34,10 @@ Object.defineProperty(exports, "createFormAttributeValidator", {
|
|
|
34
34
|
enumerable: true,
|
|
35
35
|
get: function () { return chunk64R5X3DF_js.createFormAttributeValidator; }
|
|
36
36
|
});
|
|
37
|
+
Object.defineProperty(exports, "validateDraft", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return chunk64R5X3DF_js.validateDraft; }
|
|
40
|
+
});
|
|
37
41
|
Object.defineProperty(exports, "validateDraftOrThrow", {
|
|
38
42
|
enumerable: true,
|
|
39
43
|
get: function () { return chunk64R5X3DF_js.validateDraftOrThrow; }
|
package/dist/validation/all.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../chunk-SP3PNHYF.mjs';
|
|
2
2
|
export { parseAttributeConfig } from '../chunk-SS2NR6DH.mjs';
|
|
3
|
-
export { computeRecordStatus, createFormAttributeValidator, validateDraftOrThrow, validateObject, validateObjectOrThrow } from '../chunk-6JEQE4IP.mjs';
|
|
3
|
+
export { computeRecordStatus, createFormAttributeValidator, validateDraft, validateDraftOrThrow, validateObject, validateObjectOrThrow } from '../chunk-6JEQE4IP.mjs';
|
|
4
4
|
import '../chunk-TMYBEXBT.mjs';
|
|
5
5
|
import '../chunk-4KRLCWJM.mjs';
|
|
6
6
|
import '../chunk-KNYZH2WD.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as computeRecordStatus,
|
|
1
|
+
export { c as computeRecordStatus, f as createAttributeValidator, a as createFormAttributeValidator, g as getMissingRequiredAttributes, i as isRecordComplete, h as validateAttribute, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from '../../helpers-DOjqrfWE.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { O as ObjectDefinition } from '../../filters-DRXk4dLI.mjs';
|
|
4
4
|
import '../../types-DxEobsMy.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as computeRecordStatus,
|
|
1
|
+
export { c as computeRecordStatus, f as createAttributeValidator, a as createFormAttributeValidator, g as getMissingRequiredAttributes, i as isRecordComplete, h as validateAttribute, v as validateDraft, b as validateDraftOrThrow, d as validateObject, e as validateObjectOrThrow } from '../../helpers-64gmAyw0.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { O as ObjectDefinition } from '../../filters-zzsF0GxK.js';
|
|
4
4
|
import '../../types-Bemfgle3.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stndrds/schema",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.169",
|
|
4
4
|
"description": "Standard schema definitions and utilities",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"expr-eval": "^2.0.2",
|
|
132
132
|
"libphonenumber-js": "^1.12.31",
|
|
133
133
|
"zod": "^4.2.1",
|
|
134
|
-
"@stndrds/constants": "1.0.0-alpha.
|
|
134
|
+
"@stndrds/constants": "1.0.0-alpha.169"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@types/node": "^25.0.3",
|