@stndrds/schema 1.0.0-alpha.274 → 1.0.0-alpha.276
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/{chunk-ITGE3PBX.mjs → chunk-4USPA67J.mjs} +2 -2
- package/dist/{chunk-63WWFZFY.js → chunk-EDOEX3O7.js} +32 -32
- package/dist/{chunk-FDIAOFHS.js → chunk-F3YPU2N6.js} +2 -0
- package/dist/{chunk-POULKEJM.mjs → chunk-QLU5QR7M.mjs} +2 -0
- package/dist/{chunk-V6Q7HCA7.js → chunk-RAF6K6VG.js} +4 -4
- package/dist/{chunk-QMLO7V5E.mjs → chunk-RBG2YMF2.mjs} +1 -1
- package/dist/{chunk-QN2N3IJZ.js → chunk-T7BST4JS.js} +3 -3
- package/dist/{chunk-KDHDC7E6.mjs → chunk-U7QUIEFF.mjs} +1 -1
- package/dist/exceptions.d.mts +2 -0
- package/dist/exceptions.d.ts +2 -0
- package/dist/exceptions.js +39 -39
- package/dist/exceptions.mjs +1 -1
- package/dist/index.js +159 -159
- package/dist/index.mjs +8 -8
- package/dist/validation/all.js +29 -29
- package/dist/validation/all.mjs +4 -4
- package/dist/validation/config/index.js +11 -11
- package/dist/validation/config/index.mjs +2 -2
- package/dist/validation/object/index.js +14 -14
- package/dist/validation/object/index.mjs +2 -2
- package/package.json +4 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SCHEMA_LIMITS, iconNameSchema } from './chunk-
|
|
2
|
-
import { ValidationError } from './chunk-
|
|
1
|
+
import { SCHEMA_LIMITS, iconNameSchema } from './chunk-U7QUIEFF.mjs';
|
|
2
|
+
import { ValidationError } from './chunk-QLU5QR7M.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
// src/types/system-attributes.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkT7BST4JS_js = require('./chunk-T7BST4JS.js');
|
|
4
|
+
var chunkF3YPU2N6_js = require('./chunk-F3YPU2N6.js');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
// src/types/system-attributes.ts
|
|
@@ -571,13 +571,13 @@ function resolveCanonicalOperator(rawOperator, effectiveType) {
|
|
|
571
571
|
const replacement = REMOVED_OPERATOR_REPLACEMENTS[rawOperator];
|
|
572
572
|
if (replacement) {
|
|
573
573
|
const m = `Unknown filter operator "${rawOperator}" \u2014 use ${replacement}`;
|
|
574
|
-
throw new
|
|
574
|
+
throw new chunkF3YPU2N6_js.ValidationError(m, [{ path: ["operator"], message: m }]);
|
|
575
575
|
}
|
|
576
576
|
const normalized = normalizeOperator(rawOperator);
|
|
577
577
|
const membership = SUBSTRING_TO_MEMBERSHIP[normalized];
|
|
578
578
|
if (membership && SET_MEMBERSHIP_TYPES.has(effectiveType)) {
|
|
579
579
|
const m = `Operator "${normalized}" is not valid for type "${effectiveType}" \u2014 use "${membership}"`;
|
|
580
|
-
throw new
|
|
580
|
+
throw new chunkF3YPU2N6_js.ValidationError(m, [{ path: ["operator"], message: m }]);
|
|
581
581
|
}
|
|
582
582
|
return normalized;
|
|
583
583
|
}
|
|
@@ -587,7 +587,7 @@ function assertOperatorForType(operator, type, context) {
|
|
|
587
587
|
if (!ops?.includes(normalized)) {
|
|
588
588
|
const validList = ops?.length ? ops.join(", ") : "(no operators registered for this type)";
|
|
589
589
|
const summary = `Operator "${operator}" is not valid for ${context} type "${type}". Valid operators: ${validList}.`;
|
|
590
|
-
throw new
|
|
590
|
+
throw new chunkF3YPU2N6_js.ValidationError(summary, [
|
|
591
591
|
{
|
|
592
592
|
path: ["operator"],
|
|
593
593
|
message: summary
|
|
@@ -600,7 +600,7 @@ function assertRelativeDateValue(rule) {
|
|
|
600
600
|
if (rule.operator !== "is_within") return;
|
|
601
601
|
if (!isRelativeDateValue(rule.value)) {
|
|
602
602
|
const m = `Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }`;
|
|
603
|
-
throw new
|
|
603
|
+
throw new chunkF3YPU2N6_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
function assertDynamicValueForAttribute(rule, attrType) {
|
|
@@ -608,11 +608,11 @@ function assertDynamicValueForAttribute(rule, attrType) {
|
|
|
608
608
|
const v = rule.value;
|
|
609
609
|
if (v.dynamic === "actor" && attrType !== "user") {
|
|
610
610
|
const m = `actor token (@me) is only valid on user attributes, not "${attrType}"`;
|
|
611
|
-
throw new
|
|
611
|
+
throw new chunkF3YPU2N6_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
612
612
|
}
|
|
613
613
|
if (v.dynamic === "date" && attrType !== "date") {
|
|
614
614
|
const m = `date token (@today/@now) is only valid on date attributes, not "${attrType}"`;
|
|
615
|
-
throw new
|
|
615
|
+
throw new chunkF3YPU2N6_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
function collectQualifiedRuleIssues(rule, context) {
|
|
@@ -620,7 +620,7 @@ function collectQualifiedRuleIssues(rule, context) {
|
|
|
620
620
|
validateQualifiedRule({ ...rule }, context);
|
|
621
621
|
return [];
|
|
622
622
|
} catch (error) {
|
|
623
|
-
if (!(error instanceof
|
|
623
|
+
if (!(error instanceof chunkF3YPU2N6_js.ValidationError)) throw error;
|
|
624
624
|
return error.errors.map((issue) => ({ ...issue, path: [...issue.path] }));
|
|
625
625
|
}
|
|
626
626
|
}
|
|
@@ -628,17 +628,17 @@ function validateQualifiedRule(rule, context) {
|
|
|
628
628
|
const rootAttr = context.attributes.find((a) => a.name === rule.attribute);
|
|
629
629
|
const systemOps = SYSTEM_FILTER_OPERATORS[rule.attribute];
|
|
630
630
|
if (!(rootAttr || systemOps)) {
|
|
631
|
-
throw new
|
|
631
|
+
throw new chunkF3YPU2N6_js.ValidationError(`Unknown attribute: ${rule.attribute}`, [
|
|
632
632
|
{ path: ["attribute"], message: `Unknown attribute: ${rule.attribute}` }
|
|
633
633
|
]);
|
|
634
634
|
}
|
|
635
635
|
if (rule.quantifier !== void 0 && !rule.property) {
|
|
636
636
|
const m = `quantifier is only valid on qualified edge rules (set "property")`;
|
|
637
|
-
throw new
|
|
637
|
+
throw new chunkF3YPU2N6_js.ValidationError(m, [{ path: ["quantifier"], message: m }]);
|
|
638
638
|
}
|
|
639
639
|
if (!rootAttr) {
|
|
640
640
|
if (rule.property) {
|
|
641
|
-
throw new
|
|
641
|
+
throw new chunkF3YPU2N6_js.ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
|
|
642
642
|
{ path: ["property"], message: `"${rule.attribute}" is a system column, not a reference` }
|
|
643
643
|
]);
|
|
644
644
|
}
|
|
@@ -646,7 +646,7 @@ function validateQualifiedRule(rule, context) {
|
|
|
646
646
|
const normalizedOperator = resolveCanonicalOperator(rule.operator, effectiveType);
|
|
647
647
|
if (!systemOps.includes(normalizedOperator)) {
|
|
648
648
|
const summary = `Operator "${rule.operator}" is not valid for system attribute "${rule.attribute}". Valid operators: ${systemOps.join(", ")}.`;
|
|
649
|
-
throw new
|
|
649
|
+
throw new chunkF3YPU2N6_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
|
|
650
650
|
}
|
|
651
651
|
rule.operator = normalizedOperator;
|
|
652
652
|
assertRelativeDateValue(rule);
|
|
@@ -659,26 +659,26 @@ function validateQualifiedRule(rule, context) {
|
|
|
659
659
|
if (!ops.includes(normalizedOperator)) {
|
|
660
660
|
const validList = ops.length ? ops.join(", ") : "(not filterable)";
|
|
661
661
|
const summary = `Operator "${rule.operator}" is not valid for attribute "${rootAttr.name}". Valid operators: ${validList}.`;
|
|
662
|
-
throw new
|
|
662
|
+
throw new chunkF3YPU2N6_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
|
|
663
663
|
}
|
|
664
664
|
rule.operator = normalizedOperator;
|
|
665
665
|
assertRelativeDateValue(rule);
|
|
666
666
|
return;
|
|
667
667
|
}
|
|
668
668
|
if (!REFERENCE_TYPES.has(rootAttr.type)) {
|
|
669
|
-
throw new
|
|
669
|
+
throw new chunkF3YPU2N6_js.ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
|
|
670
670
|
{ path: ["property"], message: `Attribute "${rule.attribute}" is not a reference type` }
|
|
671
671
|
]);
|
|
672
672
|
}
|
|
673
673
|
const propSchema = rootAttr.properties;
|
|
674
674
|
if (!propSchema) {
|
|
675
|
-
throw new
|
|
675
|
+
throw new chunkF3YPU2N6_js.ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
|
|
676
676
|
{ path: ["property"], message: `"${rule.attribute}" has no qualifyWith` }
|
|
677
677
|
]);
|
|
678
678
|
}
|
|
679
679
|
const propDef = propSchema.definitions.find((p) => p.name === rule.property);
|
|
680
680
|
if (!propDef) {
|
|
681
|
-
throw new
|
|
681
|
+
throw new chunkF3YPU2N6_js.ValidationError(
|
|
682
682
|
`Property "${rule.property}" not defined on "${rule.attribute}".qualifyWith()`,
|
|
683
683
|
[{ path: ["property"], message: `Unknown property: ${rule.property}` }]
|
|
684
684
|
);
|
|
@@ -719,12 +719,12 @@ var RESERVED_OBJECT_NAMES = ["skill"];
|
|
|
719
719
|
// src/validators/view-config.schema.ts
|
|
720
720
|
var createModeSchema = zod.z.enum(["redirect", "inline", "peek"]);
|
|
721
721
|
var nonEmptyStringArraySchema = zod.z.array(zod.z.string()).min(1);
|
|
722
|
-
var columnsSchema = zod.z.array(zod.z.string()).max(
|
|
722
|
+
var columnsSchema = zod.z.array(zod.z.string()).max(chunkT7BST4JS_js.SCHEMA_LIMITS.columnsPerTab);
|
|
723
723
|
var sortRuleSchema = zod.z.object({
|
|
724
724
|
attribute: zod.z.string(),
|
|
725
725
|
direction: zod.z.enum(["asc", "desc"])
|
|
726
726
|
}).strict();
|
|
727
|
-
var sortsSchema = zod.z.array(sortRuleSchema).max(
|
|
727
|
+
var sortsSchema = zod.z.array(sortRuleSchema).max(chunkT7BST4JS_js.SCHEMA_LIMITS.sortsPerTab);
|
|
728
728
|
var relativeDateValueSchema = zod.z.object({
|
|
729
729
|
amount: zod.z.number(),
|
|
730
730
|
unit: zod.z.enum(["days", "weeks", "months", "years"]),
|
|
@@ -793,7 +793,7 @@ var filterRuleSchema = zod.z.object({
|
|
|
793
793
|
operator: filterOperatorSchema,
|
|
794
794
|
value: filterValueSchema
|
|
795
795
|
}).strict();
|
|
796
|
-
var filterRulesSchema = zod.z.array(filterRuleSchema).max(
|
|
796
|
+
var filterRulesSchema = zod.z.array(filterRuleSchema).max(chunkT7BST4JS_js.SCHEMA_LIMITS.filterRulesPerTab);
|
|
797
797
|
var filterStateSchema = zod.z.object({
|
|
798
798
|
combinator: zod.z.enum(["and", "or"]),
|
|
799
799
|
rules: filterRulesSchema
|
|
@@ -877,13 +877,13 @@ var baseGroupShape = {
|
|
|
877
877
|
var fieldGroupWriteSchema = zod.z.object({
|
|
878
878
|
...baseGroupShape,
|
|
879
879
|
type: zod.z.literal("fields"),
|
|
880
|
-
fields: zod.z.array(fieldSchema).max(
|
|
880
|
+
fields: zod.z.array(fieldSchema).max(chunkT7BST4JS_js.SCHEMA_LIMITS.fieldsPerGroup)
|
|
881
881
|
}).strict();
|
|
882
882
|
var relationGroupSchema = zod.z.object({
|
|
883
883
|
...baseGroupShape,
|
|
884
884
|
type: zod.z.literal("relation"),
|
|
885
885
|
attribute: zod.z.string(),
|
|
886
|
-
columns: zod.z.array(zod.z.string()).max(
|
|
886
|
+
columns: zod.z.array(zod.z.string()).max(chunkT7BST4JS_js.SCHEMA_LIMITS.columnsPerTab).optional(),
|
|
887
887
|
readOnly: zod.z.boolean().optional(),
|
|
888
888
|
allowCreate: zod.z.boolean().optional()
|
|
889
889
|
}).strict();
|
|
@@ -892,13 +892,13 @@ var baseTabShape = {
|
|
|
892
892
|
id: zod.z.string(),
|
|
893
893
|
name: zod.z.string(),
|
|
894
894
|
label: zod.z.string(),
|
|
895
|
-
icon:
|
|
895
|
+
icon: chunkT7BST4JS_js.iconNameSchema.optional(),
|
|
896
896
|
order: zod.z.number().optional()
|
|
897
897
|
};
|
|
898
898
|
var formTabWriteSchema = zod.z.object({
|
|
899
899
|
...baseTabShape,
|
|
900
900
|
type: zod.z.literal("form"),
|
|
901
|
-
groups: zod.z.array(groupWriteSchema).min(1).max(
|
|
901
|
+
groups: zod.z.array(groupWriteSchema).min(1).max(chunkT7BST4JS_js.SCHEMA_LIMITS.groupsPerFormTab),
|
|
902
902
|
formColumns: zod.z.union([zod.z.literal(1), zod.z.literal(2), zod.z.literal(3)]).optional(),
|
|
903
903
|
density: zod.z.enum(["compact", "comfortable", "spacious"]).optional()
|
|
904
904
|
}).strict().superRefine((tab, ctx) => {
|
|
@@ -907,13 +907,13 @@ var formTabWriteSchema = zod.z.object({
|
|
|
907
907
|
(count, group) => count + (group.type === "fields" ? group.fields.length : 0),
|
|
908
908
|
0
|
|
909
909
|
);
|
|
910
|
-
if (totalFields >
|
|
910
|
+
if (totalFields > chunkT7BST4JS_js.SCHEMA_LIMITS.fieldsPerFormTab) {
|
|
911
911
|
ctx.addIssue({
|
|
912
912
|
code: "too_big",
|
|
913
913
|
origin: "array",
|
|
914
|
-
maximum:
|
|
914
|
+
maximum: chunkT7BST4JS_js.SCHEMA_LIMITS.fieldsPerFormTab,
|
|
915
915
|
inclusive: true,
|
|
916
|
-
message: `A form tab can contain at most ${
|
|
916
|
+
message: `A form tab can contain at most ${chunkT7BST4JS_js.SCHEMA_LIMITS.fieldsPerFormTab} fields`,
|
|
917
917
|
path: ["groups"]
|
|
918
918
|
});
|
|
919
919
|
}
|
|
@@ -1115,7 +1115,7 @@ var formsTabSchema = zod.z.object({
|
|
|
1115
1115
|
var emailsTabSchema = zod.z.object({
|
|
1116
1116
|
...baseTabShape,
|
|
1117
1117
|
type: zod.z.literal("emails"),
|
|
1118
|
-
emailAttributeIds: zod.z.array(zod.z.string()).max(
|
|
1118
|
+
emailAttributeIds: zod.z.array(zod.z.string()).max(chunkT7BST4JS_js.SCHEMA_LIMITS.emailAttributesPerTab)
|
|
1119
1119
|
}).strict();
|
|
1120
1120
|
var detailTabSchema = zod.z.discriminatedUnion("type", [
|
|
1121
1121
|
formTabWriteSchema,
|
|
@@ -1130,7 +1130,7 @@ var detailTabSchema = zod.z.discriminatedUnion("type", [
|
|
|
1130
1130
|
var listTabCommonShape = {
|
|
1131
1131
|
id: zod.z.string(),
|
|
1132
1132
|
label: zod.z.string(),
|
|
1133
|
-
icon:
|
|
1133
|
+
icon: chunkT7BST4JS_js.iconNameSchema.optional(),
|
|
1134
1134
|
default: zod.z.boolean().optional(),
|
|
1135
1135
|
// Which records the tab scopes to. `"all"` is the default and means "impose
|
|
1136
1136
|
// no scope" — the mandatory viewer predicate alone decides, so the tab shows
|
|
@@ -1164,7 +1164,7 @@ var listViewTabSchema = zod.z.discriminatedUnion("layout", [
|
|
|
1164
1164
|
]);
|
|
1165
1165
|
var _listViewConfigSchema = zod.z.object({
|
|
1166
1166
|
defaultFilters: filterGroupSchema.optional(),
|
|
1167
|
-
tabs: zod.z.array(listViewTabSchema).min(1).max(
|
|
1167
|
+
tabs: zod.z.array(listViewTabSchema).min(1).max(chunkT7BST4JS_js.SCHEMA_LIMITS.tabsPerView)
|
|
1168
1168
|
}).strict().superRefine((config, ctx) => {
|
|
1169
1169
|
addDuplicateIdIssues(config.tabs, ctx, ["tabs"]);
|
|
1170
1170
|
let hasDefault = false;
|
|
@@ -1181,9 +1181,9 @@ var _listViewConfigSchema = zod.z.object({
|
|
|
1181
1181
|
});
|
|
1182
1182
|
});
|
|
1183
1183
|
var _detailViewConfigSchema = zod.z.object({
|
|
1184
|
-
tabs: zod.z.array(detailTabSchema).min(1).max(
|
|
1184
|
+
tabs: zod.z.array(detailTabSchema).min(1).max(chunkT7BST4JS_js.SCHEMA_LIMITS.tabsPerView),
|
|
1185
1185
|
sidePanel: zod.z.object({
|
|
1186
|
-
attributes: zod.z.array(zod.z.string()).max(
|
|
1186
|
+
attributes: zod.z.array(zod.z.string()).max(chunkT7BST4JS_js.SCHEMA_LIMITS.sidePanelAttributes),
|
|
1187
1187
|
width: zod.z.number().optional()
|
|
1188
1188
|
}).strict().optional()
|
|
1189
1189
|
}).strict().superRefine((config, ctx) => {
|
|
@@ -107,8 +107,10 @@ var SchemaErrorCode = {
|
|
|
107
107
|
DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED",
|
|
108
108
|
DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED",
|
|
109
109
|
DOCUMENT_OCR_FAILED: "DOCUMENT_OCR_FAILED",
|
|
110
|
+
DOCUMENT_BLOB_EMPTY: "DOCUMENT_BLOB_EMPTY",
|
|
110
111
|
DOCUMENT_FILE_TOO_LARGE: "DOCUMENT_FILE_TOO_LARGE",
|
|
111
112
|
DOCUMENT_FILE_NOT_FOUND: "DOCUMENT_FILE_NOT_FOUND",
|
|
113
|
+
DOCUMENT_FILE_ALREADY_PACKED: "DOCUMENT_FILE_ALREADY_PACKED",
|
|
112
114
|
// Documents — agent placement guards (record/drive targeting from tools)
|
|
113
115
|
DOCUMENT_RECORD_NOT_FOUND: "DOCUMENT_RECORD_NOT_FOUND",
|
|
114
116
|
DOCUMENT_RECORD_OBJECT_MISMATCH: "DOCUMENT_RECORD_OBJECT_MISMATCH",
|
|
@@ -105,8 +105,10 @@ var SchemaErrorCode = {
|
|
|
105
105
|
DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED",
|
|
106
106
|
DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED",
|
|
107
107
|
DOCUMENT_OCR_FAILED: "DOCUMENT_OCR_FAILED",
|
|
108
|
+
DOCUMENT_BLOB_EMPTY: "DOCUMENT_BLOB_EMPTY",
|
|
108
109
|
DOCUMENT_FILE_TOO_LARGE: "DOCUMENT_FILE_TOO_LARGE",
|
|
109
110
|
DOCUMENT_FILE_NOT_FOUND: "DOCUMENT_FILE_NOT_FOUND",
|
|
111
|
+
DOCUMENT_FILE_ALREADY_PACKED: "DOCUMENT_FILE_ALREADY_PACKED",
|
|
110
112
|
// Documents — agent placement guards (record/drive targeting from tools)
|
|
111
113
|
DOCUMENT_RECORD_NOT_FOUND: "DOCUMENT_RECORD_NOT_FOUND",
|
|
112
114
|
DOCUMENT_RECORD_OBJECT_MISMATCH: "DOCUMENT_RECORD_OBJECT_MISMATCH",
|
|
@@ -9,7 +9,7 @@ var chunk5WATIVCA_js = require('./chunk-5WATIVCA.js');
|
|
|
9
9
|
var chunkSI34M4IC_js = require('./chunk-SI34M4IC.js');
|
|
10
10
|
var chunkYIP5FJ5H_js = require('./chunk-YIP5FJ5H.js');
|
|
11
11
|
var chunkZPFOKBIN_js = require('./chunk-ZPFOKBIN.js');
|
|
12
|
-
var
|
|
12
|
+
var chunkF3YPU2N6_js = require('./chunk-F3YPU2N6.js');
|
|
13
13
|
var chunkACKMC6FL_js = require('./chunk-ACKMC6FL.js');
|
|
14
14
|
var chunkE6JUYGJX_js = require('./chunk-E6JUYGJX.js');
|
|
15
15
|
var chunkQ4SZAMJT_js = require('./chunk-Q4SZAMJT.js');
|
|
@@ -143,7 +143,7 @@ function validateObjectOrThrow(objectDef, data) {
|
|
|
143
143
|
if (!result.success) {
|
|
144
144
|
const errors = result.errors ?? [];
|
|
145
145
|
const detail = errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("\n") || "Unknown validation error";
|
|
146
|
-
throw new
|
|
146
|
+
throw new chunkF3YPU2N6_js.ValidationError(
|
|
147
147
|
`Validation failed for ${objectDef.label}:
|
|
148
148
|
${detail}`,
|
|
149
149
|
errors.map((err) => ({ path: err.path, message: err.message }))
|
|
@@ -170,7 +170,7 @@ function validateDraftOrThrow(objectDef, data) {
|
|
|
170
170
|
if (!result.success) {
|
|
171
171
|
const errors = result.errors ?? [];
|
|
172
172
|
const detail = errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("\n") || "Unknown validation error";
|
|
173
|
-
throw new
|
|
173
|
+
throw new chunkF3YPU2N6_js.ValidationError(
|
|
174
174
|
`Draft validation failed for ${objectDef.label}:
|
|
175
175
|
${detail}`,
|
|
176
176
|
errors.map((err) => ({ path: err.path, message: err.message }))
|
|
@@ -182,7 +182,7 @@ function rejectUnknownAttributesOrThrow(objectDef, data) {
|
|
|
182
182
|
const knownNames = new Set(objectDef.attributes.map((a) => a.name));
|
|
183
183
|
const unknownKeys = Object.keys(data).filter((key) => !knownNames.has(key));
|
|
184
184
|
if (unknownKeys.length > 0) {
|
|
185
|
-
throw new
|
|
185
|
+
throw new chunkF3YPU2N6_js.ValidationError(
|
|
186
186
|
`Unknown attribute${unknownKeys.length > 1 ? "s" : ""} for ${objectDef.label}: ${unknownKeys.join(", ")}`,
|
|
187
187
|
unknownKeys.map((key) => ({ path: [key], message: "Unknown attribute" }))
|
|
188
188
|
);
|
|
@@ -7,7 +7,7 @@ import { createCheckboxValidator } from './chunk-OSSGN43B.mjs';
|
|
|
7
7
|
import { createDateValidator } from './chunk-Q44QKLN4.mjs';
|
|
8
8
|
import { createNumberValidator } from './chunk-UANQJ2GH.mjs';
|
|
9
9
|
import { createTextValidator } from './chunk-O73ROMWQ.mjs';
|
|
10
|
-
import { ValidationError } from './chunk-
|
|
10
|
+
import { ValidationError } from './chunk-QLU5QR7M.mjs';
|
|
11
11
|
import { createCurrencyValidator } from './chunk-AYVHMVKQ.mjs';
|
|
12
12
|
import { createLocationValidator } from './chunk-YUFTHPOE.mjs';
|
|
13
13
|
import { createPhoneValidator } from './chunk-R5LAJCBU.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkF3YPU2N6_js = require('./chunk-F3YPU2N6.js');
|
|
4
4
|
var zod = require('zod');
|
|
5
5
|
var constants = require('@stndrds/constants');
|
|
6
6
|
|
|
@@ -571,7 +571,7 @@ function getAttributeConfigWriteSchema(type) {
|
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
function validationErrorFromIssues(issues) {
|
|
574
|
-
return
|
|
574
|
+
return chunkF3YPU2N6_js.ValidationError.fromZodErrors(
|
|
575
575
|
issues.map((issue) => ({
|
|
576
576
|
path: issue.path.map((segment) => typeof segment === "symbol" ? String(segment) : segment),
|
|
577
577
|
message: issue.message
|
|
@@ -594,7 +594,7 @@ function validatePatchedIcon(patch) {
|
|
|
594
594
|
}
|
|
595
595
|
const result = iconNameSchema.optional().safeParse(patch.icon);
|
|
596
596
|
if (!result.success) {
|
|
597
|
-
throw
|
|
597
|
+
throw chunkF3YPU2N6_js.ValidationError.fromZodErrors(
|
|
598
598
|
result.error.issues.map((issue) => ({
|
|
599
599
|
path: [
|
|
600
600
|
"icon",
|
package/dist/exceptions.d.mts
CHANGED
|
@@ -83,8 +83,10 @@ declare const SchemaErrorCode: {
|
|
|
83
83
|
readonly DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED";
|
|
84
84
|
readonly DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED";
|
|
85
85
|
readonly DOCUMENT_OCR_FAILED: "DOCUMENT_OCR_FAILED";
|
|
86
|
+
readonly DOCUMENT_BLOB_EMPTY: "DOCUMENT_BLOB_EMPTY";
|
|
86
87
|
readonly DOCUMENT_FILE_TOO_LARGE: "DOCUMENT_FILE_TOO_LARGE";
|
|
87
88
|
readonly DOCUMENT_FILE_NOT_FOUND: "DOCUMENT_FILE_NOT_FOUND";
|
|
89
|
+
readonly DOCUMENT_FILE_ALREADY_PACKED: "DOCUMENT_FILE_ALREADY_PACKED";
|
|
88
90
|
readonly DOCUMENT_RECORD_NOT_FOUND: "DOCUMENT_RECORD_NOT_FOUND";
|
|
89
91
|
readonly DOCUMENT_RECORD_OBJECT_MISMATCH: "DOCUMENT_RECORD_OBJECT_MISMATCH";
|
|
90
92
|
readonly DOCUMENT_FOLDER_SERVICE_UNAVAILABLE: "DOCUMENT_FOLDER_SERVICE_UNAVAILABLE";
|
package/dist/exceptions.d.ts
CHANGED
|
@@ -83,8 +83,10 @@ declare const SchemaErrorCode: {
|
|
|
83
83
|
readonly DOCUMENT_STORAGE_FAILED: "DOCUMENT_STORAGE_FAILED";
|
|
84
84
|
readonly DOCUMENT_SIZE_EXCEEDED: "DOCUMENT_SIZE_EXCEEDED";
|
|
85
85
|
readonly DOCUMENT_OCR_FAILED: "DOCUMENT_OCR_FAILED";
|
|
86
|
+
readonly DOCUMENT_BLOB_EMPTY: "DOCUMENT_BLOB_EMPTY";
|
|
86
87
|
readonly DOCUMENT_FILE_TOO_LARGE: "DOCUMENT_FILE_TOO_LARGE";
|
|
87
88
|
readonly DOCUMENT_FILE_NOT_FOUND: "DOCUMENT_FILE_NOT_FOUND";
|
|
89
|
+
readonly DOCUMENT_FILE_ALREADY_PACKED: "DOCUMENT_FILE_ALREADY_PACKED";
|
|
88
90
|
readonly DOCUMENT_RECORD_NOT_FOUND: "DOCUMENT_RECORD_NOT_FOUND";
|
|
89
91
|
readonly DOCUMENT_RECORD_OBJECT_MISMATCH: "DOCUMENT_RECORD_OBJECT_MISMATCH";
|
|
90
92
|
readonly DOCUMENT_FOLDER_SERVICE_UNAVAILABLE: "DOCUMENT_FOLDER_SERVICE_UNAVAILABLE";
|
package/dist/exceptions.js
CHANGED
|
@@ -1,158 +1,158 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkF3YPU2N6_js = require('./chunk-F3YPU2N6.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "AccessDeniedError", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkF3YPU2N6_js.AccessDeniedError; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "AttributeInUseError", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkF3YPU2N6_js.AttributeInUseError; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "AttributeNotFoundError", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkF3YPU2N6_js.AttributeNotFoundError; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "ChangeTypeNotSupportedError", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkF3YPU2N6_js.ChangeTypeNotSupportedError; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "ConcurrentModificationError", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkF3YPU2N6_js.ConcurrentModificationError; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "DestructiveSyncNotAllowedError", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkF3YPU2N6_js.DestructiveSyncNotAllowedError; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "DuplicateError", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkF3YPU2N6_js.DuplicateError; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "ForbiddenError", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkF3YPU2N6_js.ForbiddenError; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "MemoryNotFoundError", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkF3YPU2N6_js.MemoryNotFoundError; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "MigrationTimeoutError", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkF3YPU2N6_js.MigrationTimeoutError; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "NotFoundError", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkF3YPU2N6_js.NotFoundError; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "NotImplementedError", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkF3YPU2N6_js.NotImplementedError; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "ObjectNotFoundError", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkF3YPU2N6_js.ObjectNotFoundError; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "ObjectReferencedError", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkF3YPU2N6_js.ObjectReferencedError; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "OrphanSystemAttributeError", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkF3YPU2N6_js.OrphanSystemAttributeError; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "ProtectedResourceError", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkF3YPU2N6_js.ProtectedResourceError; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "ProtectedRoleError", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkF3YPU2N6_js.ProtectedRoleError; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "RecordNotFoundError", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkF3YPU2N6_js.RecordNotFoundError; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "RecordReferencedError", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkF3YPU2N6_js.RecordReferencedError; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "RepositoryError", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkF3YPU2N6_js.RepositoryError; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "RoleNotFoundError", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkF3YPU2N6_js.RoleNotFoundError; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "SchemaError", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkF3YPU2N6_js.SchemaError; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "SchemaErrorCode", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkF3YPU2N6_js.SchemaErrorCode; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "SchemaPlanNotFoundError", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkF3YPU2N6_js.SchemaPlanNotFoundError; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "SearchBackendError", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkF3YPU2N6_js.SearchBackendError; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "StorageError", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkF3YPU2N6_js.StorageError; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "SyncCascadeError", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkF3YPU2N6_js.SyncCascadeError; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "SyncConflictError", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkF3YPU2N6_js.SyncConflictError; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "SyncError", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkF3YPU2N6_js.SyncError; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "SystemEntityImmutableError", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkF3YPU2N6_js.SystemEntityImmutableError; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "ValidationError", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkF3YPU2N6_js.ValidationError; }
|
|
130
130
|
});
|
|
131
131
|
Object.defineProperty(exports, "isAttributeInUseError", {
|
|
132
132
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkF3YPU2N6_js.isAttributeInUseError; }
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "isNotFoundError", {
|
|
136
136
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkF3YPU2N6_js.isNotFoundError; }
|
|
138
138
|
});
|
|
139
139
|
Object.defineProperty(exports, "isObjectReferencedError", {
|
|
140
140
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkF3YPU2N6_js.isObjectReferencedError; }
|
|
142
142
|
});
|
|
143
143
|
Object.defineProperty(exports, "isProtectedResourceError", {
|
|
144
144
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunkF3YPU2N6_js.isProtectedResourceError; }
|
|
146
146
|
});
|
|
147
147
|
Object.defineProperty(exports, "isRecordReferencedError", {
|
|
148
148
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunkF3YPU2N6_js.isRecordReferencedError; }
|
|
150
150
|
});
|
|
151
151
|
Object.defineProperty(exports, "isSchemaError", {
|
|
152
152
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkF3YPU2N6_js.isSchemaError; }
|
|
154
154
|
});
|
|
155
155
|
Object.defineProperty(exports, "isValidationError", {
|
|
156
156
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunkF3YPU2N6_js.isValidationError; }
|
|
158
158
|
});
|
package/dist/exceptions.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AccessDeniedError, AttributeInUseError, AttributeNotFoundError, ChangeTypeNotSupportedError, ConcurrentModificationError, DestructiveSyncNotAllowedError, DuplicateError, ForbiddenError, MemoryNotFoundError, MigrationTimeoutError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RecordNotFoundError, RecordReferencedError, RepositoryError, RoleNotFoundError, SchemaError, SchemaErrorCode, SchemaPlanNotFoundError, SearchBackendError, StorageError, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError } from './chunk-
|
|
1
|
+
export { AccessDeniedError, AttributeInUseError, AttributeNotFoundError, ChangeTypeNotSupportedError, ConcurrentModificationError, DestructiveSyncNotAllowedError, DuplicateError, ForbiddenError, MemoryNotFoundError, MigrationTimeoutError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RecordNotFoundError, RecordReferencedError, RepositoryError, RoleNotFoundError, SchemaError, SchemaErrorCode, SchemaPlanNotFoundError, SearchBackendError, StorageError, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError } from './chunk-QLU5QR7M.mjs';
|