@stndrds/schema 1.0.0-alpha.293 → 1.0.0-alpha.294
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-APRL56F4.mjs → chunk-2WWGHULM.mjs} +1 -1
- package/dist/{chunk-Y3UPKP2B.js → chunk-4KMUATDG.js} +5 -1
- package/dist/{chunk-Z5OPSBMQ.mjs → chunk-CLZORRMS.mjs} +5 -1
- package/dist/{chunk-P4VCAPJT.js → chunk-DVXGSTWJ.js} +3 -3
- package/dist/{chunk-C32UUQ6D.js → chunk-HURC6CW3.js} +4 -4
- package/dist/{chunk-ULM2BA5A.mjs → chunk-JZNR4HKQ.mjs} +2 -2
- package/dist/{chunk-5N7OSHVX.js → chunk-KAWYU7TE.js} +4 -4
- package/dist/{chunk-GRUSTQK3.mjs → chunk-QT35SI3K.mjs} +1 -1
- package/dist/{chunk-VGGGLTYJ.mjs → chunk-R2DAEDRF.mjs} +1 -1
- package/dist/{chunk-OASIPLEB.js → chunk-T5PM73EF.js} +39 -39
- package/dist/exceptions.d.mts +4 -0
- package/dist/exceptions.d.ts +4 -0
- package/dist/exceptions.js +39 -39
- package/dist/exceptions.mjs +1 -1
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +296 -295
- package/dist/index.mjs +11 -11
- package/dist/utils.js +8 -8
- package/dist/utils.mjs +2 -2
- package/dist/validation/all.js +29 -29
- package/dist/validation/all.mjs +4 -4
- package/dist/validation/config/index.js +12 -12
- 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 +2 -2
|
@@ -8,7 +8,7 @@ import { createCheckboxValidator } from './chunk-OSSGN43B.mjs';
|
|
|
8
8
|
import { createDateValidator } from './chunk-Q44QKLN4.mjs';
|
|
9
9
|
import { createNumberValidator } from './chunk-UANQJ2GH.mjs';
|
|
10
10
|
import { createTextValidator } from './chunk-O73ROMWQ.mjs';
|
|
11
|
-
import { ValidationError } from './chunk-
|
|
11
|
+
import { ValidationError } from './chunk-CLZORRMS.mjs';
|
|
12
12
|
import { createCurrencyValidator } from './chunk-AYVHMVKQ.mjs';
|
|
13
13
|
import { createLocationValidator } from './chunk-YUFTHPOE.mjs';
|
|
14
14
|
import { createPhoneValidator } from './chunk-R5LAJCBU.mjs';
|
|
@@ -184,7 +184,11 @@ var SchemaErrorCode = {
|
|
|
184
184
|
REFLEX_RUN_TIMEOUT: "REFLEX_RUN_TIMEOUT",
|
|
185
185
|
REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT",
|
|
186
186
|
REFLEX_NOT_READY: "REFLEX_NOT_READY",
|
|
187
|
-
REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION"
|
|
187
|
+
REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION",
|
|
188
|
+
/** The embeddings feature is enabled but no Gateway credential is configured. */
|
|
189
|
+
EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE",
|
|
190
|
+
/** The provider returned vectors whose length differs from the configured dimensions. */
|
|
191
|
+
EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH"
|
|
188
192
|
};
|
|
189
193
|
var SchemaError = class extends Error {
|
|
190
194
|
constructor(message, code = SchemaErrorCode.UNKNOWN, details) {
|
|
@@ -182,7 +182,11 @@ var SchemaErrorCode = {
|
|
|
182
182
|
REFLEX_RUN_TIMEOUT: "REFLEX_RUN_TIMEOUT",
|
|
183
183
|
REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT",
|
|
184
184
|
REFLEX_NOT_READY: "REFLEX_NOT_READY",
|
|
185
|
-
REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION"
|
|
185
|
+
REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION",
|
|
186
|
+
/** The embeddings feature is enabled but no Gateway credential is configured. */
|
|
187
|
+
EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE",
|
|
188
|
+
/** The provider returned vectors whose length differs from the configured dimensions. */
|
|
189
|
+
EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH"
|
|
186
190
|
};
|
|
187
191
|
var SchemaError = class extends Error {
|
|
188
192
|
constructor(message, code = SchemaErrorCode.UNKNOWN, details) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4KMUATDG_js = require('./chunk-4KMUATDG.js');
|
|
4
4
|
|
|
5
5
|
// src/utils/canonical-json.ts
|
|
6
6
|
function canonicalStringify(value) {
|
|
@@ -17,10 +17,10 @@ function canonicalStringify(value) {
|
|
|
17
17
|
case "object":
|
|
18
18
|
break;
|
|
19
19
|
default:
|
|
20
|
-
throw new
|
|
20
|
+
throw new chunk4KMUATDG_js.ValidationError(`Cannot canonicalize value of type ${typeof v}`, []);
|
|
21
21
|
}
|
|
22
22
|
const obj = v;
|
|
23
|
-
if (seen.has(obj)) throw new
|
|
23
|
+
if (seen.has(obj)) throw new chunk4KMUATDG_js.ValidationError("Cannot canonicalize circular structure", []);
|
|
24
24
|
seen.add(obj);
|
|
25
25
|
try {
|
|
26
26
|
if (Array.isArray(obj)) return `[${obj.map((e) => encode(e) ?? "null").join(",")}]`;
|
|
@@ -10,7 +10,7 @@ var chunk5WATIVCA_js = require('./chunk-5WATIVCA.js');
|
|
|
10
10
|
var chunkSI34M4IC_js = require('./chunk-SI34M4IC.js');
|
|
11
11
|
var chunkYIP5FJ5H_js = require('./chunk-YIP5FJ5H.js');
|
|
12
12
|
var chunkZPFOKBIN_js = require('./chunk-ZPFOKBIN.js');
|
|
13
|
-
var
|
|
13
|
+
var chunk4KMUATDG_js = require('./chunk-4KMUATDG.js');
|
|
14
14
|
var chunkACKMC6FL_js = require('./chunk-ACKMC6FL.js');
|
|
15
15
|
var chunkE6JUYGJX_js = require('./chunk-E6JUYGJX.js');
|
|
16
16
|
var chunkQ4SZAMJT_js = require('./chunk-Q4SZAMJT.js');
|
|
@@ -162,7 +162,7 @@ function validateObjectOrThrow(objectDef, data) {
|
|
|
162
162
|
if (!result.success) {
|
|
163
163
|
const errors = result.errors ?? [];
|
|
164
164
|
const detail = errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("\n") || "Unknown validation error";
|
|
165
|
-
throw new
|
|
165
|
+
throw new chunk4KMUATDG_js.ValidationError(
|
|
166
166
|
`Validation failed for ${objectDef.label}:
|
|
167
167
|
${detail}`,
|
|
168
168
|
errors.map((err) => ({ path: err.path, message: err.message }))
|
|
@@ -189,7 +189,7 @@ function validateDraftOrThrow(objectDef, data) {
|
|
|
189
189
|
if (!result.success) {
|
|
190
190
|
const errors = result.errors ?? [];
|
|
191
191
|
const detail = errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("\n") || "Unknown validation error";
|
|
192
|
-
throw new
|
|
192
|
+
throw new chunk4KMUATDG_js.ValidationError(
|
|
193
193
|
`Draft validation failed for ${objectDef.label}:
|
|
194
194
|
${detail}`,
|
|
195
195
|
errors.map((err) => ({ path: err.path, message: err.message }))
|
|
@@ -201,7 +201,7 @@ function rejectUnknownAttributesOrThrow(objectDef, data) {
|
|
|
201
201
|
const knownNames = new Set(objectDef.attributes.map((a) => a.name));
|
|
202
202
|
const unknownKeys = Object.keys(data).filter((key) => !knownNames.has(key));
|
|
203
203
|
if (unknownKeys.length > 0) {
|
|
204
|
-
throw new
|
|
204
|
+
throw new chunk4KMUATDG_js.ValidationError(
|
|
205
205
|
`Unknown attribute${unknownKeys.length > 1 ? "s" : ""} for ${objectDef.label}: ${unknownKeys.join(", ")}`,
|
|
206
206
|
unknownKeys.map((key) => ({ path: [key], message: "Unknown attribute" }))
|
|
207
207
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SCHEMA_LIMITS, iconNameSchema } from './chunk-
|
|
2
|
-
import { ValidationError } from './chunk-
|
|
1
|
+
import { SCHEMA_LIMITS, iconNameSchema } from './chunk-QT35SI3K.mjs';
|
|
2
|
+
import { ValidationError } from './chunk-CLZORRMS.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
// src/types/system-attributes.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4KMUATDG_js = require('./chunk-4KMUATDG.js');
|
|
4
4
|
var zod = require('zod');
|
|
5
5
|
var constants = require('@stndrds/constants');
|
|
6
6
|
|
|
@@ -551,7 +551,7 @@ var attributeConfigSchemas = {
|
|
|
551
551
|
function getAttributeConfigSchema(type) {
|
|
552
552
|
const schema = attributeConfigSchemas[type];
|
|
553
553
|
if (!schema) {
|
|
554
|
-
throw new
|
|
554
|
+
throw new chunk4KMUATDG_js.ValidationError(`Unsupported attribute type: ${type}`, []);
|
|
555
555
|
}
|
|
556
556
|
return schema;
|
|
557
557
|
}
|
|
@@ -575,7 +575,7 @@ function getAttributeConfigWriteSchema(type) {
|
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
function validationErrorFromIssues(issues) {
|
|
578
|
-
return
|
|
578
|
+
return chunk4KMUATDG_js.ValidationError.fromZodErrors(
|
|
579
579
|
issues.map((issue) => ({
|
|
580
580
|
path: issue.path.map((segment) => typeof segment === "symbol" ? String(segment) : segment),
|
|
581
581
|
message: issue.message
|
|
@@ -598,7 +598,7 @@ function validatePatchedIcon(patch) {
|
|
|
598
598
|
}
|
|
599
599
|
const result = iconNameSchema.optional().safeParse(patch.icon);
|
|
600
600
|
if (!result.success) {
|
|
601
|
-
throw
|
|
601
|
+
throw chunk4KMUATDG_js.ValidationError.fromZodErrors(
|
|
602
602
|
result.error.issues.map((issue) => ({
|
|
603
603
|
path: [
|
|
604
604
|
"icon",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkKAWYU7TE_js = require('./chunk-KAWYU7TE.js');
|
|
4
|
+
var chunk4KMUATDG_js = require('./chunk-4KMUATDG.js');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
// src/types/system-attributes.ts
|
|
@@ -507,7 +507,7 @@ function canonicalizeFilterValue(rule, effectiveType) {
|
|
|
507
507
|
const message = `Filter on a currency attribute expected a numeric amount, received ${JSON.stringify(
|
|
508
508
|
value
|
|
509
509
|
)}`;
|
|
510
|
-
throw new
|
|
510
|
+
throw new chunk4KMUATDG_js.ValidationError(message, [{ path: ["value"], message }]);
|
|
511
511
|
}
|
|
512
512
|
function hasCurrencyAmount(value) {
|
|
513
513
|
if (typeof value !== "object") return true;
|
|
@@ -670,13 +670,13 @@ function resolveCanonicalOperator(rawOperator, effectiveType) {
|
|
|
670
670
|
const replacement = REMOVED_OPERATOR_REPLACEMENTS[rawOperator];
|
|
671
671
|
if (replacement) {
|
|
672
672
|
const m = `Unknown filter operator "${rawOperator}" \u2014 use ${replacement}`;
|
|
673
|
-
throw new
|
|
673
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["operator"], message: m }]);
|
|
674
674
|
}
|
|
675
675
|
const normalized = normalizeOperator(rawOperator);
|
|
676
676
|
const membership = SUBSTRING_TO_MEMBERSHIP[normalized];
|
|
677
677
|
if (membership && SET_MEMBERSHIP_TYPES.has(effectiveType)) {
|
|
678
678
|
const m = `Operator "${normalized}" is not valid for type "${effectiveType}" \u2014 use "${membership}"`;
|
|
679
|
-
throw new
|
|
679
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["operator"], message: m }]);
|
|
680
680
|
}
|
|
681
681
|
return normalized;
|
|
682
682
|
}
|
|
@@ -686,7 +686,7 @@ function assertOperatorForType(operator, type, context) {
|
|
|
686
686
|
if (!ops?.includes(normalized)) {
|
|
687
687
|
const validList = ops?.length ? ops.join(", ") : "(no operators registered for this type)";
|
|
688
688
|
const summary = `Operator "${operator}" is not valid for ${context} type "${type}". Valid operators: ${validList}.`;
|
|
689
|
-
throw new
|
|
689
|
+
throw new chunk4KMUATDG_js.ValidationError(summary, [
|
|
690
690
|
{
|
|
691
691
|
path: ["operator"],
|
|
692
692
|
message: summary
|
|
@@ -699,7 +699,7 @@ function assertRelativeDateValue(rule) {
|
|
|
699
699
|
if (rule.operator !== "is_within") return;
|
|
700
700
|
if (!isRelativeDateValue(rule.value)) {
|
|
701
701
|
const m = `Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }`;
|
|
702
|
-
throw new
|
|
702
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
705
|
function applyCanonicalForm(rule, operator, effectiveType) {
|
|
@@ -712,11 +712,11 @@ function assertDynamicValueForAttribute(rule, attrType) {
|
|
|
712
712
|
const v = rule.value;
|
|
713
713
|
if (v.dynamic === "actor" && attrType !== "user") {
|
|
714
714
|
const m = `actor token (@me) is only valid on user attributes, not "${attrType}"`;
|
|
715
|
-
throw new
|
|
715
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
716
716
|
}
|
|
717
717
|
if (v.dynamic === "date" && attrType !== "date") {
|
|
718
718
|
const m = `date token (@today/@now) is only valid on date attributes, not "${attrType}"`;
|
|
719
|
-
throw new
|
|
719
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["value"], message: m }]);
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
var LOCATION_PARTS_LIST = LOCATION_FILTER_PROPERTIES.map((part) => `"${part}"`).join(", ");
|
|
@@ -728,7 +728,7 @@ function collectQualifiedRuleIssues(rule, context) {
|
|
|
728
728
|
validateQualifiedRule({ ...rule }, context);
|
|
729
729
|
return [];
|
|
730
730
|
} catch (error) {
|
|
731
|
-
if (!(error instanceof
|
|
731
|
+
if (!(error instanceof chunk4KMUATDG_js.ValidationError)) throw error;
|
|
732
732
|
return error.errors.map((issue) => ({ ...issue, path: [...issue.path] }));
|
|
733
733
|
}
|
|
734
734
|
}
|
|
@@ -740,15 +740,15 @@ function validateQualifiedRule(rule, context) {
|
|
|
740
740
|
const dottedRoot = tail.length > 0 ? context.attributes.find((a) => a.name === head) : void 0;
|
|
741
741
|
const dottedHint = dottedRoot?.type === "location" ? ` Dotted paths are not supported \u2014 set "attribute" to "${head}" and "property" to ${isLocationFilterProperty(tail[0] ?? "") ? `"${tail[0]}"` : `one of ${LOCATION_PARTS_LIST}`}.` : rule.attribute.includes(".") ? ' Dotted paths are not supported \u2014 filter on the attribute name alone, or use the full-text "query" parameter to match text inside a value.' : "";
|
|
742
742
|
const m = `Unknown attribute: ${rule.attribute}${dottedHint}`;
|
|
743
|
-
throw new
|
|
743
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["attribute"], message: m }]);
|
|
744
744
|
}
|
|
745
745
|
if (rule.quantifier !== void 0 && !rule.property) {
|
|
746
746
|
const m = `quantifier is only valid on qualified edge rules (set "property")`;
|
|
747
|
-
throw new
|
|
747
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["quantifier"], message: m }]);
|
|
748
748
|
}
|
|
749
749
|
if (!rootAttr) {
|
|
750
750
|
if (rule.property) {
|
|
751
|
-
throw new
|
|
751
|
+
throw new chunk4KMUATDG_js.ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
|
|
752
752
|
{ path: ["property"], message: `"${rule.attribute}" is a system column, not a reference` }
|
|
753
753
|
]);
|
|
754
754
|
}
|
|
@@ -756,7 +756,7 @@ function validateQualifiedRule(rule, context) {
|
|
|
756
756
|
const normalizedOperator2 = resolveCanonicalOperator(rule.operator, effectiveType);
|
|
757
757
|
if (!systemOps.includes(normalizedOperator2)) {
|
|
758
758
|
const summary = `Operator "${rule.operator}" is not valid for system attribute "${rule.attribute}". Valid operators: ${systemOps.join(", ")}.`;
|
|
759
|
-
throw new
|
|
759
|
+
throw new chunk4KMUATDG_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
|
|
760
760
|
}
|
|
761
761
|
applyCanonicalForm(rule, normalizedOperator2, effectiveType);
|
|
762
762
|
return;
|
|
@@ -768,7 +768,7 @@ function validateQualifiedRule(rule, context) {
|
|
|
768
768
|
if (!ops.includes(normalizedOperator2)) {
|
|
769
769
|
const validList = ops.length ? ops.join(", ") : "(not filterable)";
|
|
770
770
|
const summary = `Operator "${rule.operator}" is not valid for attribute "${rootAttr.name}". Valid operators: ${validList}.${locationPartsHint(rootAttr.type)}`;
|
|
771
|
-
throw new
|
|
771
|
+
throw new chunk4KMUATDG_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
|
|
772
772
|
}
|
|
773
773
|
applyCanonicalForm(rule, normalizedOperator2, resolveEffectiveFilterType(rootAttr));
|
|
774
774
|
return;
|
|
@@ -776,11 +776,11 @@ function validateQualifiedRule(rule, context) {
|
|
|
776
776
|
if (rootAttr.type === "location") {
|
|
777
777
|
if (rule.quantifier !== void 0) {
|
|
778
778
|
const m = "quantifier is not valid on a location part \u2014 a location is one value, not a set of edges";
|
|
779
|
-
throw new
|
|
779
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["quantifier"], message: m }]);
|
|
780
780
|
}
|
|
781
781
|
if (!isLocationFilterProperty(rule.property)) {
|
|
782
782
|
const m = `Property "${rule.property}" is not a part of location "${rule.attribute}". Valid parts: ${LOCATION_PARTS_LIST}.`;
|
|
783
|
-
throw new
|
|
783
|
+
throw new chunk4KMUATDG_js.ValidationError(m, [{ path: ["property"], message: m }]);
|
|
784
784
|
}
|
|
785
785
|
assertDynamicValueForAttribute(rule, "text");
|
|
786
786
|
const normalizedOperator2 = assertOperatorForType(rule.operator, "text", "property");
|
|
@@ -788,19 +788,19 @@ function validateQualifiedRule(rule, context) {
|
|
|
788
788
|
return;
|
|
789
789
|
}
|
|
790
790
|
if (!REFERENCE_TYPES.has(rootAttr.type)) {
|
|
791
|
-
throw new
|
|
791
|
+
throw new chunk4KMUATDG_js.ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
|
|
792
792
|
{ path: ["property"], message: `Attribute "${rule.attribute}" is not a reference type` }
|
|
793
793
|
]);
|
|
794
794
|
}
|
|
795
795
|
const propSchema = rootAttr.properties;
|
|
796
796
|
if (!propSchema) {
|
|
797
|
-
throw new
|
|
797
|
+
throw new chunk4KMUATDG_js.ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
|
|
798
798
|
{ path: ["property"], message: `"${rule.attribute}" has no qualifyWith` }
|
|
799
799
|
]);
|
|
800
800
|
}
|
|
801
801
|
const propDef = propSchema.definitions.find((p) => p.name === rule.property);
|
|
802
802
|
if (!propDef) {
|
|
803
|
-
throw new
|
|
803
|
+
throw new chunk4KMUATDG_js.ValidationError(
|
|
804
804
|
`Property "${rule.property}" not defined on "${rule.attribute}".qualifyWith()`,
|
|
805
805
|
[{ path: ["property"], message: `Unknown property: ${rule.property}` }]
|
|
806
806
|
);
|
|
@@ -816,7 +816,7 @@ function parseResourceVisibility(value) {
|
|
|
816
816
|
if (typeof value === "string" && RESOURCE_VISIBILITIES.includes(value)) {
|
|
817
817
|
return value;
|
|
818
818
|
}
|
|
819
|
-
throw new
|
|
819
|
+
throw new chunk4KMUATDG_js.ValidationError(
|
|
820
820
|
`visibility must be one of: ${RESOURCE_VISIBILITIES.join(", ")} (received: ${String(value)})`,
|
|
821
821
|
[]
|
|
822
822
|
);
|
|
@@ -850,15 +850,15 @@ var RESERVED_OBJECT_NAMES = ["skill"];
|
|
|
850
850
|
// src/validators/view-config.schema.ts
|
|
851
851
|
var createModeSchema = zod.z.enum(["redirect", "inline", "peek"]);
|
|
852
852
|
var nonEmptyStringArraySchema = zod.z.array(zod.z.string()).min(1);
|
|
853
|
-
var columnsSchema = zod.z.array(zod.z.string()).max(
|
|
854
|
-
var displayAttributesSchema = zod.z.array(zod.z.string().min(1)).max(
|
|
853
|
+
var columnsSchema = zod.z.array(zod.z.string()).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.columnsPerTab);
|
|
854
|
+
var displayAttributesSchema = zod.z.array(zod.z.string().min(1)).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.columnsPerTab).refine((names) => new Set(names).size === names.length, {
|
|
855
855
|
message: "Displayed attribute names must be unique"
|
|
856
856
|
});
|
|
857
857
|
var sortRuleSchema = zod.z.object({
|
|
858
858
|
attribute: zod.z.string(),
|
|
859
859
|
direction: zod.z.enum(["asc", "desc"])
|
|
860
860
|
}).strict();
|
|
861
|
-
var sortsSchema = zod.z.array(sortRuleSchema).max(
|
|
861
|
+
var sortsSchema = zod.z.array(sortRuleSchema).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.sortsPerTab);
|
|
862
862
|
var relativeDateValueSchema = zod.z.object({
|
|
863
863
|
amount: zod.z.number(),
|
|
864
864
|
unit: zod.z.enum(["days", "weeks", "months", "years"]),
|
|
@@ -932,7 +932,7 @@ var filterRuleSchema = zod.z.object({
|
|
|
932
932
|
operator: filterOperatorSchema,
|
|
933
933
|
value: filterValueSchema
|
|
934
934
|
}).strict();
|
|
935
|
-
var filterRulesSchema = zod.z.array(filterRuleSchema).max(
|
|
935
|
+
var filterRulesSchema = zod.z.array(filterRuleSchema).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.filterRulesPerTab);
|
|
936
936
|
var filterStateSchema = zod.z.object({
|
|
937
937
|
combinator: zod.z.enum(["and", "or"]),
|
|
938
938
|
rules: filterRulesSchema
|
|
@@ -1023,17 +1023,17 @@ var baseGroupShape = {
|
|
|
1023
1023
|
var fieldGroupWriteSchema = zod.z.object({
|
|
1024
1024
|
...baseGroupShape,
|
|
1025
1025
|
type: zod.z.literal("fields"),
|
|
1026
|
-
fields: zod.z.array(fieldSchema).max(
|
|
1026
|
+
fields: zod.z.array(fieldSchema).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.fieldsPerGroup)
|
|
1027
1027
|
}).strict();
|
|
1028
1028
|
var groupWriteSchema = fieldGroupWriteSchema;
|
|
1029
1029
|
var baseTabShape = {
|
|
1030
1030
|
id: zod.z.string(),
|
|
1031
1031
|
name: zod.z.string(),
|
|
1032
1032
|
label: zod.z.string(),
|
|
1033
|
-
icon:
|
|
1033
|
+
icon: chunkKAWYU7TE_js.iconNameSchema.optional(),
|
|
1034
1034
|
order: zod.z.number().optional()
|
|
1035
1035
|
};
|
|
1036
|
-
var formTabGroupsSchema = zod.z.array(groupWriteSchema).max(
|
|
1036
|
+
var formTabGroupsSchema = zod.z.array(groupWriteSchema).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.groupsPerFormTab);
|
|
1037
1037
|
var formTabShape = {
|
|
1038
1038
|
...baseTabShape,
|
|
1039
1039
|
type: zod.z.literal("form"),
|
|
@@ -1048,13 +1048,13 @@ function refineFormTab(tab, ctx) {
|
|
|
1048
1048
|
(count, group) => count + (group.type === "fields" ? group.fields.length : 0),
|
|
1049
1049
|
0
|
|
1050
1050
|
);
|
|
1051
|
-
if (totalFields >
|
|
1051
|
+
if (totalFields > chunkKAWYU7TE_js.SCHEMA_LIMITS.fieldsPerFormTab) {
|
|
1052
1052
|
ctx.addIssue({
|
|
1053
1053
|
code: "too_big",
|
|
1054
1054
|
origin: "array",
|
|
1055
|
-
maximum:
|
|
1055
|
+
maximum: chunkKAWYU7TE_js.SCHEMA_LIMITS.fieldsPerFormTab,
|
|
1056
1056
|
inclusive: true,
|
|
1057
|
-
message: `A form tab can contain at most ${
|
|
1057
|
+
message: `A form tab can contain at most ${chunkKAWYU7TE_js.SCHEMA_LIMITS.fieldsPerFormTab} fields`,
|
|
1058
1058
|
path: ["groups"]
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
@@ -1258,12 +1258,12 @@ var formsTabSchema = zod.z.object({
|
|
|
1258
1258
|
var emailsTabSchema = zod.z.object({
|
|
1259
1259
|
...baseTabShape,
|
|
1260
1260
|
type: zod.z.literal("emails"),
|
|
1261
|
-
emailAttributeIds: zod.z.array(zod.z.string()).max(
|
|
1261
|
+
emailAttributeIds: zod.z.array(zod.z.string()).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.emailAttributesPerTab)
|
|
1262
1262
|
}).strict();
|
|
1263
1263
|
var meetingsTabSchema = zod.z.object({
|
|
1264
1264
|
...baseTabShape,
|
|
1265
1265
|
type: zod.z.literal("meetings"),
|
|
1266
|
-
emailAttributeIds: zod.z.array(zod.z.string()).max(
|
|
1266
|
+
emailAttributeIds: zod.z.array(zod.z.string()).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.emailAttributesPerTab)
|
|
1267
1267
|
}).strict();
|
|
1268
1268
|
var nonFormDetailTabSchemas = [
|
|
1269
1269
|
tableTabSchema,
|
|
@@ -1286,7 +1286,7 @@ var detailTabDraftSchema = zod.z.discriminatedUnion("type", [
|
|
|
1286
1286
|
var listTabCommonShape = {
|
|
1287
1287
|
id: zod.z.string(),
|
|
1288
1288
|
label: zod.z.string(),
|
|
1289
|
-
icon:
|
|
1289
|
+
icon: chunkKAWYU7TE_js.iconNameSchema.optional(),
|
|
1290
1290
|
default: zod.z.boolean().optional(),
|
|
1291
1291
|
// Which records the tab scopes to. `"all"` is the default and means "impose
|
|
1292
1292
|
// no scope" — the mandatory viewer predicate alone decides, so the tab shows
|
|
@@ -1335,7 +1335,7 @@ var listViewTabSchema = zod.z.discriminatedUnion("layout", [
|
|
|
1335
1335
|
var _listViewConfigSchema = zod.z.object({
|
|
1336
1336
|
allowPresentationCustomization: zod.z.boolean().optional(),
|
|
1337
1337
|
defaultFilters: filterGroupSchema.optional(),
|
|
1338
|
-
tabs: zod.z.array(listViewTabSchema).min(1).max(
|
|
1338
|
+
tabs: zod.z.array(listViewTabSchema).min(1).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.tabsPerView)
|
|
1339
1339
|
}).strict().superRefine((config, ctx) => {
|
|
1340
1340
|
addDuplicateIdIssues(config.tabs, ctx, ["tabs"]);
|
|
1341
1341
|
let hasDefault = false;
|
|
@@ -1363,7 +1363,7 @@ var sidePanelPaneSchema = zod.z.discriminatedUnion("kind", [
|
|
|
1363
1363
|
kind: zod.z.literal("fields"),
|
|
1364
1364
|
id: zod.z.string().optional(),
|
|
1365
1365
|
label: zod.z.string().optional(),
|
|
1366
|
-
attributes: zod.z.array(zod.z.string()).max(
|
|
1366
|
+
attributes: zod.z.array(zod.z.string()).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.sidePanelAttributes)
|
|
1367
1367
|
}).strict(),
|
|
1368
1368
|
zod.z.object({
|
|
1369
1369
|
kind: zod.z.literal("activity"),
|
|
@@ -1382,10 +1382,10 @@ var sidePanelPaneSchema = zod.z.discriminatedUnion("kind", [
|
|
|
1382
1382
|
}).strict()
|
|
1383
1383
|
]);
|
|
1384
1384
|
var _detailViewConfigSchema = zod.z.object({
|
|
1385
|
-
tabs: zod.z.array(detailTabSchema).min(1).max(
|
|
1385
|
+
tabs: zod.z.array(detailTabSchema).min(1).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.tabsPerView),
|
|
1386
1386
|
sidePanel: zod.z.object({
|
|
1387
|
-
attributes: zod.z.array(zod.z.string()).max(
|
|
1388
|
-
panes: zod.z.array(sidePanelPaneSchema).max(
|
|
1387
|
+
attributes: zod.z.array(zod.z.string()).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.sidePanelAttributes).optional(),
|
|
1388
|
+
panes: zod.z.array(sidePanelPaneSchema).max(chunkKAWYU7TE_js.SCHEMA_LIMITS.sidePanelPanes).optional(),
|
|
1389
1389
|
width: zod.z.number().optional()
|
|
1390
1390
|
}).strict().refine((sidePanel) => sidePanel.attributes !== void 0 || sidePanel.panes !== void 0, {
|
|
1391
1391
|
message: "sidePanel requires attributes or panes"
|
package/dist/exceptions.d.mts
CHANGED
|
@@ -134,6 +134,10 @@ declare const SchemaErrorCode: {
|
|
|
134
134
|
readonly REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT";
|
|
135
135
|
readonly REFLEX_NOT_READY: "REFLEX_NOT_READY";
|
|
136
136
|
readonly REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION";
|
|
137
|
+
/** The embeddings feature is enabled but no Gateway credential is configured. */
|
|
138
|
+
readonly EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE";
|
|
139
|
+
/** The provider returned vectors whose length differs from the configured dimensions. */
|
|
140
|
+
readonly EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH";
|
|
137
141
|
};
|
|
138
142
|
type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
|
|
139
143
|
/**
|
package/dist/exceptions.d.ts
CHANGED
|
@@ -134,6 +134,10 @@ declare const SchemaErrorCode: {
|
|
|
134
134
|
readonly REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT";
|
|
135
135
|
readonly REFLEX_NOT_READY: "REFLEX_NOT_READY";
|
|
136
136
|
readonly REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION";
|
|
137
|
+
/** The embeddings feature is enabled but no Gateway credential is configured. */
|
|
138
|
+
readonly EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE";
|
|
139
|
+
/** The provider returned vectors whose length differs from the configured dimensions. */
|
|
140
|
+
readonly EMBEDDING_DIMENSION_MISMATCH: "EMBEDDING_DIMENSION_MISMATCH";
|
|
137
141
|
};
|
|
138
142
|
type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
|
|
139
143
|
/**
|