@contentful/experiences-validators 1.32.0-prerelease-20250220T1615-2f40399.0 → 1.32.0
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/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +45 -61
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +33 -46
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -87,14 +87,14 @@ const ComponentValueSchema = zod.z
|
|
|
87
87
|
.strict();
|
|
88
88
|
// TODO: finalize schema structure before release
|
|
89
89
|
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
90
|
-
const
|
|
90
|
+
const EmptyObjectSchema = zod.z.object({ type: zod.z.undefined() });
|
|
91
91
|
const ComponentPropertyValueSchema = zod.z.discriminatedUnion('type', [
|
|
92
92
|
DesignValueSchema,
|
|
93
93
|
BoundValueSchema,
|
|
94
94
|
UnboundValueSchema,
|
|
95
95
|
HyperlinkValueSchema,
|
|
96
96
|
ComponentValueSchema,
|
|
97
|
-
|
|
97
|
+
EmptyObjectSchema,
|
|
98
98
|
]);
|
|
99
99
|
// TODO: finalize schema structure before release
|
|
100
100
|
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
@@ -107,12 +107,13 @@ const VariableMappingsSchema = zod.z.record(propertyKeySchema, VariableMappingSc
|
|
|
107
107
|
// TODO: finalize schema structure before release
|
|
108
108
|
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
109
109
|
const PatternPropertyDefinitionSchema = zod.z.object({
|
|
110
|
-
defaultValue: zod.z
|
|
111
|
-
.object({
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.
|
|
110
|
+
defaultValue: zod.z.union([
|
|
111
|
+
zod.z.object({
|
|
112
|
+
path: zod.z.string(),
|
|
113
|
+
type: zod.z.literal('BoundValue'),
|
|
114
|
+
}),
|
|
115
|
+
zod.z.null(),
|
|
116
|
+
]),
|
|
116
117
|
contentTypes: zod.z.record(zod.z.string(), zod.z.any()),
|
|
117
118
|
});
|
|
118
119
|
const PatternPropertyDefinitionsSchema = zod.z.record(propertyKeySchema, PatternPropertyDefinitionSchema);
|
|
@@ -121,7 +122,6 @@ const PatternPropertyDefinitionsSchema = zod.z.record(propertyKeySchema, Pattern
|
|
|
121
122
|
const PatternPropertySchema = zod.z.object({
|
|
122
123
|
type: zod.z.literal('BoundValue'),
|
|
123
124
|
path: zod.z.string(),
|
|
124
|
-
contenType: zod.z.string(),
|
|
125
125
|
});
|
|
126
126
|
const PatternPropertysSchema = zod.z.record(propertyKeySchema, PatternPropertySchema);
|
|
127
127
|
const BreakpointSchema = zod.z
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/schemas/schemaVersions.ts","../src/schemas/v2023_09_28/experience.ts","../src/schemas/componentDefinition.ts","../src/utils/zodToContentfulError.ts","../src/validators/validateBreakpointDefinitions.ts","../src/validators/validateComponentDefinition.ts","../src/validators/validateExperienceFields.ts"],"sourcesContent":["import { z } from 'zod';\n// If more than one version is supported, use z.union\nexport const SchemaVersions = z.literal('2023-09-28');\n\nexport type SchemaVersions = z.infer<typeof SchemaVersions>;\n\n// Keep deprecated versions here just for reference\nexport const UnsupportedSchemaVersions = z.union([\n z.literal('2023-08-23'),\n z.literal('2023-07-26'),\n z.literal('2023-06-27'),\n]);\n","import { z } from 'zod';\nimport { SchemaVersions } from '../schemaVersions';\n\nexport const DefinitionPropertyTypeSchema = z.enum([\n 'Text',\n 'RichText',\n 'Number',\n 'Date',\n 'Boolean',\n 'Location',\n 'Media',\n 'Object',\n 'Hyperlink',\n 'Array',\n 'Link',\n]);\n\nexport const DefinitionPropertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,32}$/, { message: 'Property needs to match: /^[a-zA-Z0-9-_]{1,32}$/' });\n\nexport const PrimitiveValueSchema = z.union([\n z.string(),\n z.boolean(),\n z.number(),\n z.record(z.any(), z.any()),\n z.undefined(),\n]);\n\nconst uuidKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,21}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,21}$/' });\n\n/**\n * Property keys for imported components have a limit of 32 characters (to be implemented) while\n * property keys for patterns have a limit of 54 characters (<32-char-variabl-name>_<21-char-nanoid-id>).\n * Because we cannot distinguish between the two in the componentTree, we will use the larger limit for both.\n */\nconst propertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,54}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,54}$/' });\n\nconst DataSourceSchema = z.record(\n uuidKeySchema,\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.enum(['Entry', 'Asset']),\n }),\n }),\n);\n\nconst ValuesByBreakpointSchema = z.record(z.lazy(() => PrimitiveValueSchema));\n\nconst DesignValueSchema = z\n .object({\n type: z.literal('DesignValue'),\n valuesByBreakpoint: ValuesByBreakpointSchema,\n })\n .strict();\nconst BoundValueSchema = z\n .object({\n type: z.literal('BoundValue'),\n path: z.string(),\n })\n .strict();\nconst HyperlinkValueSchema = z\n .object({\n type: z.literal('HyperlinkValue'),\n linkTargetKey: z.string(),\n /** Allows to override parts of the URL, e.g. the locale */\n overrides: z.object({}).optional(),\n })\n .strict();\nconst UnboundValueSchema = z\n .object({\n type: z.literal('UnboundValue'),\n key: z.string(),\n })\n .strict();\nconst ComponentValueSchema = z\n .object({\n type: z.literal('ComponentValue'),\n key: z.string(),\n })\n .strict();\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst NoValueSchema = z.object({ type: z.literal('NoValue') }).strict();\n\nconst ComponentPropertyValueSchema = z.discriminatedUnion('type', [\n DesignValueSchema,\n BoundValueSchema,\n UnboundValueSchema,\n HyperlinkValueSchema,\n ComponentValueSchema,\n NoValueSchema,\n]);\n\nexport type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst VariableMappingSchema = z.object({\n patternPropertyDefinitionId: propertyKeySchema,\n type: z.literal('ContentTypeMapping'),\n pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),\n});\n\nconst VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertyDefinitionSchema = z.object({\n defaultValue: z\n .object({\n path: z.string(),\n type: z.literal('BoundValue'),\n })\n .optional(),\n contentTypes: z.record(z.string(), z.any()),\n});\n\nconst PatternPropertyDefinitionsSchema = z.record(\n propertyKeySchema,\n PatternPropertyDefinitionSchema,\n);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertySchema = z.object({\n type: z.literal('BoundValue'),\n path: z.string(),\n contenType: z.string(),\n});\n\nconst PatternPropertysSchema = z.record(propertyKeySchema, PatternPropertySchema);\n\nexport const BreakpointSchema = z\n .object({\n id: propertyKeySchema,\n query: z.string().regex(/^\\*$|^<[0-9*]+px$/),\n previewSize: z.string(),\n displayName: z.string(),\n displayIcon: z.enum(['desktop', 'tablet', 'mobile']).optional(),\n })\n .strict();\n\nconst UnboundValuesSchema = z.record(\n uuidKeySchema,\n z.object({\n value: PrimitiveValueSchema,\n }),\n);\n\nexport const ComponentTreeNodeIdSchema = z\n .string()\n .regex(/^[a-zA-Z0-9]{1,8}$/, { message: 'Does not match /^[a-zA-Z0-9]{1,8}$/' });\n\n// Use helper schema to define a recursive schema with its type correctly below\nconst BaseComponentTreeNodeSchema = z.object({\n id: ComponentTreeNodeIdSchema.optional(),\n definitionId: DefinitionPropertyKeySchema,\n displayName: z.string().optional(),\n slotId: z.string().optional(),\n variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),\n patternProperties: PatternPropertysSchema.optional(),\n});\nexport type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {\n children: ComponentTreeNode[];\n};\nconst ComponentTreeNodeSchema: z.ZodType<ComponentTreeNode> = BaseComponentTreeNodeSchema.extend({\n children: z.lazy(() => ComponentTreeNodeSchema.array()),\n});\n\nconst BindingSourceTypeEnumSchema = z\n .array(z.enum(['entry', 'asset', 'manual', 'experience']))\n .nonempty();\n\nexport const ComponentVariableSchema = z.object({\n displayName: z.string().optional(),\n type: DefinitionPropertyTypeSchema,\n description: z.string().optional(),\n group: z.string().optional(),\n defaultValue: PrimitiveValueSchema.or(ComponentPropertyValueSchema).optional(),\n validations: z\n .object({\n bindingSourceType: BindingSourceTypeEnumSchema.optional(),\n required: z.boolean().optional(),\n format: z.literal('URL').optional(),\n in: z\n .array(\n z.object({\n value: z.union([z.string(), z.number()]),\n displayName: z.string().optional(),\n }),\n )\n .optional(),\n })\n .optional(),\n});\n\nexport const ComponentVariablesSchema = z.record(\n z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length\n ComponentVariableSchema,\n);\n\nconst THUMBNAIL_IDS = [\n 'columns',\n 'columnsPlusRight',\n 'imagesSquare',\n 'subtitles',\n 'rowsPlusBottom',\n 'userRectangle',\n 'textbox',\n 'monitorPlay',\n 'article',\n 'table',\n 'star',\n 'heartStraight',\n 'frameCorners',\n 'rows',\n 'dotsThreeOutline',\n 'listDashes',\n 'checkerBoard',\n 'gridFour',\n 'slideshow',\n 'diamondsFour',\n 'cards',\n 'textColumns',\n] as const;\n\nconst ComponentSettingsSchema = z.object({\n variableDefinitions: ComponentVariablesSchema,\n thumbnailId: z.enum(THUMBNAIL_IDS).optional(),\n variableMappings: VariableMappingsSchema.optional(),\n patternPropertyDefinitions: PatternPropertyDefinitionsSchema.optional(),\n});\n\nconst UsedComponentsSchema = z.array(\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.literal('Entry'),\n }),\n }),\n);\n\nexport const breakpointsRefinement = (value: Breakpoint[], ctx: z.RefinementCtx) => {\n if (!value.length || value[0].query !== '*') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `The first breakpoint should include the following attributes: { \"query\": \"*\" }`,\n });\n }\n\n const hasDuplicateIds = value.some((currentBreakpoint, currentBreakpointIndex) => {\n // check if the current breakpoint id is found in the rest of the array\n const breakpointIndex = value.findIndex((breakpoint) => breakpoint.id === currentBreakpoint.id);\n return breakpointIndex !== currentBreakpointIndex;\n });\n\n if (hasDuplicateIds) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoint IDs must be unique`,\n });\n }\n // Extract the queries boundary by removing the special characters around it\n const queries = value.map((bp) =>\n bp.query === '*' ? bp.query : parseInt(bp.query.replace(/px|<|>/, '')),\n );\n // sort updates queries array in place so we need to create a copy\n const originalQueries = [...queries];\n queries.sort((q1, q2) => {\n if (q1 === '*') {\n return -1;\n }\n if (q2 === '*') {\n return 1;\n }\n return q1 > q2 ? -1 : 1;\n });\n\n if (originalQueries.join('') !== queries.join('')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoints should be ordered from largest to smallest pixel value`,\n });\n }\n};\n\nconst ComponentTreeSchema = z\n .object({\n breakpoints: z.array(BreakpointSchema).superRefine(breakpointsRefinement),\n children: z.array(ComponentTreeNodeSchema),\n schemaVersion: SchemaVersions,\n })\n .strict();\n\nconst localeWrapper = (fieldSchema: any) => z.record(z.string(), fieldSchema);\n\nexport const ExperienceFieldsCMAShapeSchema = z.object({\n componentTree: localeWrapper(ComponentTreeSchema),\n dataSource: localeWrapper(DataSourceSchema),\n unboundValues: localeWrapper(UnboundValuesSchema),\n usedComponents: localeWrapper(UsedComponentsSchema).optional(),\n componentSettings: localeWrapper(ComponentSettingsSchema).optional(),\n});\n\nexport type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;\nexport type ExperienceDataSource = z.infer<typeof DataSourceSchema>;\nexport type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;\nexport type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;\nexport type ExperienceComponentSettings = z.infer<typeof ComponentSettingsSchema>;\nexport type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;\nexport type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;\nexport type Breakpoint = z.infer<typeof BreakpointSchema>;\nexport type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;\nexport type DesignValue = z.infer<typeof DesignValueSchema>;\nexport type BoundValue = z.infer<typeof BoundValueSchema>;\nexport type NoValue = z.infer<typeof NoValueSchema>;\nexport type UnboundValue = z.infer<typeof UnboundValueSchema>;\nexport type HyperlinkValue = z.infer<typeof HyperlinkValueSchema>;\nexport type ComponentValue = z.infer<typeof ComponentValueSchema>;\nexport type BindingSourceTypeEnum = z.infer<typeof BindingSourceTypeEnumSchema>;\nexport type PatternPropertyDefinition = z.infer<typeof PatternPropertyDefinitionSchema>;\nexport type PatternProperty = z.infer<typeof PatternPropertySchema>;\nexport type VariableMapping = z.infer<typeof VariableMappingSchema>;\n","import { z } from 'zod';\nimport {\n ComponentVariableSchema,\n DefinitionPropertyKeySchema,\n DefinitionPropertyTypeSchema,\n PrimitiveValueSchema,\n} from './v2023_09_28/experience';\n\nexport const ComponentDefinitionSchema = z.object({\n id: DefinitionPropertyKeySchema,\n variables: z.record(\n DefinitionPropertyKeySchema,\n ComponentVariableSchema.extend({\n defaultValue: PrimitiveValueSchema.optional(),\n }).superRefine((val, ctx) => {\n switch (val.type) {\n case 'Array':\n if (typeof val.defaultValue !== 'undefined') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Array\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Boolean':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'boolean') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a boolean when type is \"Boolean\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Date':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Date\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Hyperlink':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Hyperlink\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Link':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Link\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Location':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Location\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Media':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Media\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Number':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'number') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a number when type is \"Number\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Object':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Object\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'RichText':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"RichText\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Text':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Text\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n }\n }),\n ),\n});\n\nexport type ComponentDefinitionPropertyType = z.infer<typeof DefinitionPropertyTypeSchema>;\nexport type ComponentDefinitionType = z.infer<typeof ComponentDefinitionSchema>;\n","import { ZodIssueCode, ZodIssue, z } from 'zod';\n\nexport enum CodeNames {\n Type = 'type',\n Required = 'required',\n Unexpected = 'unexpected',\n Regex = 'regex',\n In = 'in',\n Size = 'size',\n Custom = 'custom',\n}\n\nexport type ContentfulErrorDetails = {\n details: string;\n min?: number | bigint;\n max?: number | bigint;\n name: (typeof CodeNames)[keyof typeof CodeNames];\n path: (string | number)[];\n value?: string;\n expected?: (string | number)[];\n};\n\nconst convertInvalidType = (issue: z.ZodInvalidTypeIssue): ContentfulErrorDetails => {\n const name = issue.received === 'undefined' ? CodeNames.Required : CodeNames.Type;\n const details =\n issue.received === 'undefined'\n ? `The property \"${issue.path.slice(-1)}\" is required here`\n : `The type of \"${issue.path.slice(-1)}\" is incorrect, expected type: ${issue.expected}`;\n\n return {\n details: details,\n name: name,\n path: issue.path,\n value: issue.received.toString(),\n };\n};\n\nconst convertUnrecognizedKeys = (issue: z.ZodUnrecognizedKeysIssue): ContentfulErrorDetails => {\n const missingProperties = issue.keys.map((k) => `\"${k}\"`).join(', ');\n return {\n details:\n issue.keys.length > 1\n ? `The properties ${missingProperties} are not expected`\n : `The property ${missingProperties} is not expected`,\n name: CodeNames.Unexpected,\n path: issue.path,\n };\n};\n\nconst convertInvalidString = (issue: z.ZodInvalidStringIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Invalid string',\n name: issue.validation === 'regex' ? CodeNames.Regex : CodeNames.Unexpected,\n path: issue.path,\n };\n};\nconst convertInvalidEnumValue = (issue: z.ZodInvalidEnumValueIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received.toString(),\n expected: issue.options,\n };\n};\nconst convertInvalidLiteral = (issue: z.ZodInvalidLiteralIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received as string,\n expected: [issue.expected as string],\n };\n};\n\nconst convertTooBig = (issue: z.ZodTooBigIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at most ${issue.maximum}`,\n name: CodeNames.Size,\n path: issue.path,\n max: issue.maximum,\n };\n};\n\nconst convertTooSmall = (issue: z.ZodTooSmallIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at least ${issue.minimum}`,\n name: CodeNames.Size,\n path: issue.path,\n min: issue.minimum,\n };\n};\nconst defaultConversion = (issue: ZodIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'An unexpected error occurred',\n name: CodeNames.Custom,\n path: issue.path.map(String),\n };\n};\n\nexport const zodToContentfulError = (issue: ZodIssue): ContentfulErrorDetails => {\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n return convertInvalidType(issue);\n case ZodIssueCode.unrecognized_keys:\n return convertUnrecognizedKeys(issue);\n case ZodIssueCode.invalid_enum_value:\n return convertInvalidEnumValue(issue);\n case ZodIssueCode.invalid_string:\n return convertInvalidString(issue);\n case ZodIssueCode.too_small:\n return convertTooSmall(issue);\n case ZodIssueCode.too_big:\n return convertTooBig(issue);\n case ZodIssueCode.invalid_literal:\n return convertInvalidLiteral(issue);\n default:\n return defaultConversion(issue);\n }\n};\n","import { z } from 'zod';\nimport { BreakpointSchema, breakpointsRefinement } from '../schemas/latest';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateBreakpointsDefinition = (breakpoints): ValidatorReturnValue => {\n const result = z\n .array(BreakpointSchema)\n .superRefine(breakpointsRefinement)\n .safeParse(breakpoints);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { ComponentDefinitionSchema } from '../schemas';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateComponentDefinition = (definition): ValidatorReturnValue => {\n const result = ComponentDefinitionSchema.safeParse(definition);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { type SchemaVersions } from '../types';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { Schema_2023_09_28 } from '../schemas';\nimport { zodToContentfulError, CodeNames } from '../utils/zodToContentfulError';\n\nconst VERSION_SCHEMAS = {\n '2023-09-28': Schema_2023_09_28,\n};\n\n/**\n *\n * @param experience The experience entry to validate\n * @param schemaVersionOverride Optional override for the schema version to validate against. By default the schema version is read from the experience entry\n * @returns object with success property and optional errors array\n */\nexport const validateExperienceFields = (\n experience: any,\n schemaVersionOverride?: SchemaVersions,\n): ValidatorReturnValue => {\n let schemaVersion;\n if (experience.fields.componentTree) {\n const locale = Object.keys(experience.fields.componentTree)[0];\n schemaVersion = experience.fields.componentTree[locale].schemaVersion;\n }\n const schema = VERSION_SCHEMAS[schemaVersionOverride || schemaVersion];\n\n if (!schema) {\n return {\n success: false,\n errors: [\n {\n name: schemaVersion ? CodeNames.In : CodeNames.Required,\n expected: ['2023-09-28'],\n value: schemaVersion,\n path: ['fields', 'componentTree', 'schemaVersion'],\n details: schemaVersion\n ? 'Unsupported schema version'\n : 'The property \"schemaVersion\" is required here',\n },\n ],\n };\n }\n\n const fieldsToValidate = {\n componentTree: experience.fields.componentTree,\n dataSource: experience.fields.dataSource,\n unboundValues: experience.fields.unboundValues,\n usedComponents: experience.fields.usedComponents,\n componentSettings: experience.fields.componentSettings,\n };\n\n const result = schema.safeParse(fieldsToValidate);\n if (!result.success) {\n return {\n success: result.success,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n"],"names":["z","ZodIssueCode","Schema_2023_09_28"],"mappings":";;;;AACA;AACO,MAAM,cAAc,GAAGA,KAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAItD;AACyCA,KAAC,CAAC,KAAK,CAAC;AAC/C,IAAAA,KAAC,CAAC,OAAO,CAAC,YAAY,CAAC;AACvB,IAAAA,KAAC,CAAC,OAAO,CAAC,YAAY,CAAC;AACvB,IAAAA,KAAC,CAAC,OAAO,CAAC,YAAY,CAAC;AACxB,CAAA;;ACRM,MAAM,4BAA4B,GAAGA,KAAC,CAAC,IAAI,CAAC;IACjD,MAAM;IACN,UAAU;IACV,QAAQ;IACR,MAAM;IACN,SAAS;IACT,UAAU;IACV,OAAO;IACP,QAAQ;IACR,WAAW;IACX,OAAO;IACP,MAAM;AACP,CAAA,CAAC,CAAC;AAEI,MAAM,2BAA2B,GAAGA,KAAC;AACzC,KAAA,MAAM,EAAE;KACR,KAAK,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,CAAC,CAAC;AAE5F,MAAM,oBAAoB,GAAGA,KAAC,CAAC,KAAK,CAAC;IAC1CA,KAAC,CAAC,MAAM,EAAE;IACVA,KAAC,CAAC,OAAO,EAAE;IACXA,KAAC,CAAC,MAAM,EAAE;AACV,IAAAA,KAAC,CAAC,MAAM,CAACA,KAAC,CAAC,GAAG,EAAE,EAAEA,KAAC,CAAC,GAAG,EAAE,CAAC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EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;SACtD,CAAC;KACH;AACD,IAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/schemas/schemaVersions.ts","../src/schemas/v2023_09_28/experience.ts","../src/schemas/componentDefinition.ts","../src/utils/zodToContentfulError.ts","../src/validators/validateBreakpointDefinitions.ts","../src/validators/validateComponentDefinition.ts","../src/validators/validateExperienceFields.ts"],"sourcesContent":["import { z } from 'zod';\n// If more than one version is supported, use z.union\nexport const SchemaVersions = z.literal('2023-09-28');\n\nexport type SchemaVersions = z.infer<typeof SchemaVersions>;\n\n// Keep deprecated versions here just for reference\nexport const UnsupportedSchemaVersions = z.union([\n z.literal('2023-08-23'),\n z.literal('2023-07-26'),\n z.literal('2023-06-27'),\n]);\n","import { z } from 'zod';\nimport { SchemaVersions } from '../schemaVersions';\n\nexport const DefinitionPropertyTypeSchema = z.enum([\n 'Text',\n 'RichText',\n 'Number',\n 'Date',\n 'Boolean',\n 'Location',\n 'Media',\n 'Object',\n 'Hyperlink',\n 'Array',\n 'Link',\n]);\n\nexport const DefinitionPropertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,32}$/, { message: 'Property needs to match: /^[a-zA-Z0-9-_]{1,32}$/' });\n\nexport const PrimitiveValueSchema = z.union([\n z.string(),\n z.boolean(),\n z.number(),\n z.record(z.any(), z.any()),\n z.undefined(),\n]);\n\nconst uuidKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,21}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,21}$/' });\n\n/**\n * Property keys for imported components have a limit of 32 characters (to be implemented) while\n * property keys for patterns have a limit of 54 characters (<32-char-variabl-name>_<21-char-nanoid-id>).\n * Because we cannot distinguish between the two in the componentTree, we will use the larger limit for both.\n */\nconst propertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,54}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,54}$/' });\n\nconst DataSourceSchema = z.record(\n uuidKeySchema,\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.enum(['Entry', 'Asset']),\n }),\n }),\n);\n\nconst ValuesByBreakpointSchema = z.record(z.lazy(() => PrimitiveValueSchema));\n\nconst DesignValueSchema = z\n .object({\n type: z.literal('DesignValue'),\n valuesByBreakpoint: ValuesByBreakpointSchema,\n })\n .strict();\nconst BoundValueSchema = z\n .object({\n type: z.literal('BoundValue'),\n path: z.string(),\n })\n .strict();\nconst HyperlinkValueSchema = z\n .object({\n type: z.literal('HyperlinkValue'),\n linkTargetKey: z.string(),\n /** Allows to override parts of the URL, e.g. the locale */\n overrides: z.object({}).optional(),\n })\n .strict();\nconst UnboundValueSchema = z\n .object({\n type: z.literal('UnboundValue'),\n key: z.string(),\n })\n .strict();\nconst ComponentValueSchema = z\n .object({\n type: z.literal('ComponentValue'),\n key: z.string(),\n })\n .strict();\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst EmptyObjectSchema = z.object({ type: z.undefined() });\n\nconst ComponentPropertyValueSchema = z.discriminatedUnion('type', [\n DesignValueSchema,\n BoundValueSchema,\n UnboundValueSchema,\n HyperlinkValueSchema,\n ComponentValueSchema,\n EmptyObjectSchema,\n]);\n\nexport type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst VariableMappingSchema = z.object({\n patternPropertyDefinitionId: propertyKeySchema,\n type: z.literal('ContentTypeMapping'),\n pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),\n});\n\nconst VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertyDefinitionSchema = z.object({\n defaultValue: z.union([\n z.object({\n path: z.string(),\n type: z.literal('BoundValue'),\n }),\n z.null(),\n ]),\n contentTypes: z.record(z.string(), z.any()),\n});\n\nconst PatternPropertyDefinitionsSchema = z.record(\n propertyKeySchema,\n PatternPropertyDefinitionSchema,\n);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertySchema = z.object({\n type: z.literal('BoundValue'),\n path: z.string(),\n});\n\nconst PatternPropertysSchema = z.record(propertyKeySchema, PatternPropertySchema);\n\nexport const BreakpointSchema = z\n .object({\n id: propertyKeySchema,\n query: z.string().regex(/^\\*$|^<[0-9*]+px$/),\n previewSize: z.string(),\n displayName: z.string(),\n displayIcon: z.enum(['desktop', 'tablet', 'mobile']).optional(),\n })\n .strict();\n\nconst UnboundValuesSchema = z.record(\n uuidKeySchema,\n z.object({\n value: PrimitiveValueSchema,\n }),\n);\n\nexport const ComponentTreeNodeIdSchema = z\n .string()\n .regex(/^[a-zA-Z0-9]{1,8}$/, { message: 'Does not match /^[a-zA-Z0-9]{1,8}$/' });\n\n// Use helper schema to define a recursive schema with its type correctly below\nconst BaseComponentTreeNodeSchema = z.object({\n id: ComponentTreeNodeIdSchema.optional(),\n definitionId: DefinitionPropertyKeySchema,\n displayName: z.string().optional(),\n slotId: z.string().optional(),\n variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),\n patternProperties: PatternPropertysSchema.optional(),\n});\nexport type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {\n children: ComponentTreeNode[];\n};\nconst ComponentTreeNodeSchema: z.ZodType<ComponentTreeNode> = BaseComponentTreeNodeSchema.extend({\n children: z.lazy(() => ComponentTreeNodeSchema.array()),\n});\n\nconst BindingSourceTypeEnumSchema = z\n .array(z.enum(['entry', 'asset', 'manual', 'experience']))\n .nonempty();\n\nexport const ComponentVariableSchema = z.object({\n displayName: z.string().optional(),\n type: DefinitionPropertyTypeSchema,\n description: z.string().optional(),\n group: z.string().optional(),\n defaultValue: PrimitiveValueSchema.or(ComponentPropertyValueSchema).optional(),\n validations: z\n .object({\n bindingSourceType: BindingSourceTypeEnumSchema.optional(),\n required: z.boolean().optional(),\n format: z.literal('URL').optional(),\n in: z\n .array(\n z.object({\n value: z.union([z.string(), z.number()]),\n displayName: z.string().optional(),\n }),\n )\n .optional(),\n })\n .optional(),\n});\n\nexport const ComponentVariablesSchema = z.record(\n z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length\n ComponentVariableSchema,\n);\n\nconst THUMBNAIL_IDS = [\n 'columns',\n 'columnsPlusRight',\n 'imagesSquare',\n 'subtitles',\n 'rowsPlusBottom',\n 'userRectangle',\n 'textbox',\n 'monitorPlay',\n 'article',\n 'table',\n 'star',\n 'heartStraight',\n 'frameCorners',\n 'rows',\n 'dotsThreeOutline',\n 'listDashes',\n 'checkerBoard',\n 'gridFour',\n 'slideshow',\n 'diamondsFour',\n 'cards',\n 'textColumns',\n] as const;\n\nconst ComponentSettingsSchema = z.object({\n variableDefinitions: ComponentVariablesSchema,\n thumbnailId: z.enum(THUMBNAIL_IDS).optional(),\n variableMappings: VariableMappingsSchema.optional(),\n patternPropertyDefinitions: PatternPropertyDefinitionsSchema.optional(),\n});\n\nconst UsedComponentsSchema = z.array(\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.literal('Entry'),\n }),\n }),\n);\n\nexport const breakpointsRefinement = (value: Breakpoint[], ctx: z.RefinementCtx) => {\n if (!value.length || value[0].query !== '*') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `The first breakpoint should include the following attributes: { \"query\": \"*\" }`,\n });\n }\n\n const hasDuplicateIds = value.some((currentBreakpoint, currentBreakpointIndex) => {\n // check if the current breakpoint id is found in the rest of the array\n const breakpointIndex = value.findIndex((breakpoint) => breakpoint.id === currentBreakpoint.id);\n return breakpointIndex !== currentBreakpointIndex;\n });\n\n if (hasDuplicateIds) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoint IDs must be unique`,\n });\n }\n // Extract the queries boundary by removing the special characters around it\n const queries = value.map((bp) =>\n bp.query === '*' ? bp.query : parseInt(bp.query.replace(/px|<|>/, '')),\n );\n // sort updates queries array in place so we need to create a copy\n const originalQueries = [...queries];\n queries.sort((q1, q2) => {\n if (q1 === '*') {\n return -1;\n }\n if (q2 === '*') {\n return 1;\n }\n return q1 > q2 ? -1 : 1;\n });\n\n if (originalQueries.join('') !== queries.join('')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoints should be ordered from largest to smallest pixel value`,\n });\n }\n};\n\nconst ComponentTreeSchema = z\n .object({\n breakpoints: z.array(BreakpointSchema).superRefine(breakpointsRefinement),\n children: z.array(ComponentTreeNodeSchema),\n schemaVersion: SchemaVersions,\n })\n .strict();\n\nconst localeWrapper = (fieldSchema: any) => z.record(z.string(), fieldSchema);\n\nexport const ExperienceFieldsCMAShapeSchema = z.object({\n componentTree: localeWrapper(ComponentTreeSchema),\n dataSource: localeWrapper(DataSourceSchema),\n unboundValues: localeWrapper(UnboundValuesSchema),\n usedComponents: localeWrapper(UsedComponentsSchema).optional(),\n componentSettings: localeWrapper(ComponentSettingsSchema).optional(),\n});\n\nexport type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;\nexport type ExperienceDataSource = z.infer<typeof DataSourceSchema>;\nexport type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;\nexport type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;\nexport type ExperienceComponentSettings = z.infer<typeof ComponentSettingsSchema>;\nexport type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;\nexport type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;\nexport type Breakpoint = z.infer<typeof BreakpointSchema>;\nexport type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;\nexport type DesignValue = z.infer<typeof DesignValueSchema>;\nexport type BoundValue = z.infer<typeof BoundValueSchema>;\nexport type UnboundValue = z.infer<typeof UnboundValueSchema>;\nexport type HyperlinkValue = z.infer<typeof HyperlinkValueSchema>;\nexport type ComponentValue = z.infer<typeof ComponentValueSchema>;\nexport type BindingSourceTypeEnum = z.infer<typeof BindingSourceTypeEnumSchema>;\nexport type PatternPropertyDefinition = z.infer<typeof PatternPropertyDefinitionSchema>;\nexport type PatternProperty = z.infer<typeof PatternPropertySchema>;\nexport type VariableMapping = z.infer<typeof VariableMappingSchema>;\n","import { z } from 'zod';\nimport {\n ComponentVariableSchema,\n DefinitionPropertyKeySchema,\n DefinitionPropertyTypeSchema,\n PrimitiveValueSchema,\n} from './v2023_09_28/experience';\n\nexport const ComponentDefinitionSchema = z.object({\n id: DefinitionPropertyKeySchema,\n variables: z.record(\n DefinitionPropertyKeySchema,\n ComponentVariableSchema.extend({\n defaultValue: PrimitiveValueSchema.optional(),\n }).superRefine((val, ctx) => {\n switch (val.type) {\n case 'Array':\n if (typeof val.defaultValue !== 'undefined') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Array\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Boolean':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'boolean') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a boolean when type is \"Boolean\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Date':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Date\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Hyperlink':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Hyperlink\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Link':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Link\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Location':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Location\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Media':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Media\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Number':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'number') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a number when type is \"Number\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Object':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Object\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'RichText':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"RichText\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Text':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Text\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n }\n }),\n ),\n});\n\nexport type ComponentDefinitionPropertyType = z.infer<typeof DefinitionPropertyTypeSchema>;\nexport type ComponentDefinitionType = z.infer<typeof ComponentDefinitionSchema>;\n","import { ZodIssueCode, ZodIssue, z } from 'zod';\n\nexport enum CodeNames {\n Type = 'type',\n Required = 'required',\n Unexpected = 'unexpected',\n Regex = 'regex',\n In = 'in',\n Size = 'size',\n Custom = 'custom',\n}\n\nexport type ContentfulErrorDetails = {\n details: string;\n min?: number | bigint;\n max?: number | bigint;\n name: (typeof CodeNames)[keyof typeof CodeNames];\n path: (string | number)[];\n value?: string;\n expected?: (string | number)[];\n};\n\nconst convertInvalidType = (issue: z.ZodInvalidTypeIssue): ContentfulErrorDetails => {\n const name = issue.received === 'undefined' ? CodeNames.Required : CodeNames.Type;\n const details =\n issue.received === 'undefined'\n ? `The property \"${issue.path.slice(-1)}\" is required here`\n : `The type of \"${issue.path.slice(-1)}\" is incorrect, expected type: ${issue.expected}`;\n\n return {\n details: details,\n name: name,\n path: issue.path,\n value: issue.received.toString(),\n };\n};\n\nconst convertUnrecognizedKeys = (issue: z.ZodUnrecognizedKeysIssue): ContentfulErrorDetails => {\n const missingProperties = issue.keys.map((k) => `\"${k}\"`).join(', ');\n return {\n details:\n issue.keys.length > 1\n ? `The properties ${missingProperties} are not expected`\n : `The property ${missingProperties} is not expected`,\n name: CodeNames.Unexpected,\n path: issue.path,\n };\n};\n\nconst convertInvalidString = (issue: z.ZodInvalidStringIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Invalid string',\n name: issue.validation === 'regex' ? CodeNames.Regex : CodeNames.Unexpected,\n path: issue.path,\n };\n};\nconst convertInvalidEnumValue = (issue: z.ZodInvalidEnumValueIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received.toString(),\n expected: issue.options,\n };\n};\nconst convertInvalidLiteral = (issue: z.ZodInvalidLiteralIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received as string,\n expected: [issue.expected as string],\n };\n};\n\nconst convertTooBig = (issue: z.ZodTooBigIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at most ${issue.maximum}`,\n name: CodeNames.Size,\n path: issue.path,\n max: issue.maximum,\n };\n};\n\nconst convertTooSmall = (issue: z.ZodTooSmallIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at least ${issue.minimum}`,\n name: CodeNames.Size,\n path: issue.path,\n min: issue.minimum,\n };\n};\nconst defaultConversion = (issue: ZodIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'An unexpected error occurred',\n name: CodeNames.Custom,\n path: issue.path.map(String),\n };\n};\n\nexport const zodToContentfulError = (issue: ZodIssue): ContentfulErrorDetails => {\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n return convertInvalidType(issue);\n case ZodIssueCode.unrecognized_keys:\n return convertUnrecognizedKeys(issue);\n case ZodIssueCode.invalid_enum_value:\n return convertInvalidEnumValue(issue);\n case ZodIssueCode.invalid_string:\n return convertInvalidString(issue);\n case ZodIssueCode.too_small:\n return convertTooSmall(issue);\n case ZodIssueCode.too_big:\n return convertTooBig(issue);\n case ZodIssueCode.invalid_literal:\n return convertInvalidLiteral(issue);\n default:\n return defaultConversion(issue);\n }\n};\n","import { z } from 'zod';\nimport { BreakpointSchema, breakpointsRefinement } from '../schemas/latest';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateBreakpointsDefinition = (breakpoints): ValidatorReturnValue => {\n const result = z\n .array(BreakpointSchema)\n .superRefine(breakpointsRefinement)\n .safeParse(breakpoints);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { ComponentDefinitionSchema } from '../schemas';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateComponentDefinition = (definition): ValidatorReturnValue => {\n const result = ComponentDefinitionSchema.safeParse(definition);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { type SchemaVersions } from '../types';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { Schema_2023_09_28 } from '../schemas';\nimport { zodToContentfulError, CodeNames } from '../utils/zodToContentfulError';\n\nconst VERSION_SCHEMAS = {\n '2023-09-28': Schema_2023_09_28,\n};\n\n/**\n *\n * @param experience The experience entry to validate\n * @param schemaVersionOverride Optional override for the schema version to validate against. By default the schema version is read from the experience entry\n * @returns object with success property and optional errors array\n */\nexport const validateExperienceFields = (\n experience: any,\n schemaVersionOverride?: SchemaVersions,\n): ValidatorReturnValue => {\n let schemaVersion;\n if (experience.fields.componentTree) {\n const locale = Object.keys(experience.fields.componentTree)[0];\n schemaVersion = experience.fields.componentTree[locale].schemaVersion;\n }\n const schema = VERSION_SCHEMAS[schemaVersionOverride || schemaVersion];\n\n if (!schema) {\n return {\n success: false,\n errors: [\n {\n name: schemaVersion ? CodeNames.In : CodeNames.Required,\n expected: ['2023-09-28'],\n value: schemaVersion,\n path: ['fields', 'componentTree', 'schemaVersion'],\n details: schemaVersion\n ? 'Unsupported schema version'\n : 'The property \"schemaVersion\" is required here',\n },\n ],\n };\n }\n\n const fieldsToValidate = {\n componentTree: experience.fields.componentTree,\n dataSource: experience.fields.dataSource,\n unboundValues: experience.fields.unboundValues,\n usedComponents: experience.fields.usedComponents,\n componentSettings: experience.fields.componentSettings,\n };\n\n const result = schema.safeParse(fieldsToValidate);\n if (!result.success) {\n return {\n success: result.success,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n"],"names":["z","ZodIssueCode","Schema_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AA;AACE,oBAAA,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,QAAQ;oBACvD,QAAQ,EAAE,CAAC,YAAY,CAAC;AACxB,oBAAA,KAAK,EAAE,aAAa;AACpB,oBAAA,IAAI,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,eAAe,CAAC;AAClD,oBAAA,OAAO,EAAE,aAAa;AACpB,0BAAE,4BAA4B;AAC9B,0BAAE,+CAA+C;AACpD,iBAAA;AACF,aAAA;SACF,CAAC;KACH;AAED,IAAA,MAAM,gBAAgB,GAAG;AACvB,QAAA,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,aAAa;AAC9C,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU;AACxC,QAAA,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,aAAa;AAC9C,QAAA,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,cAAc;AAChD,QAAA,iBAAiB,EAAE,UAAU,CAAC,MAAM,CAAC,iBAAiB;KACvD,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAClD,IAAA,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACnB,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;SACtD,CAAC;KACH;AACD,IAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -70,13 +70,6 @@ declare const ComponentValueSchema: z.ZodObject<{
|
|
|
70
70
|
type: "ComponentValue";
|
|
71
71
|
key: string;
|
|
72
72
|
}>;
|
|
73
|
-
declare const NoValueSchema: z.ZodObject<{
|
|
74
|
-
type: z.ZodLiteral<"NoValue">;
|
|
75
|
-
}, "strict", z.ZodTypeAny, {
|
|
76
|
-
type: "NoValue";
|
|
77
|
-
}, {
|
|
78
|
-
type: "NoValue";
|
|
79
|
-
}>;
|
|
80
73
|
declare const ComponentPropertyValueSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
81
74
|
type: z.ZodLiteral<"DesignValue">;
|
|
82
75
|
valuesByBreakpoint: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>>>;
|
|
@@ -127,11 +120,11 @@ declare const ComponentPropertyValueSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
127
120
|
type: "ComponentValue";
|
|
128
121
|
key: string;
|
|
129
122
|
}>, z.ZodObject<{
|
|
130
|
-
type: z.
|
|
131
|
-
}, "
|
|
132
|
-
type
|
|
123
|
+
type: z.ZodUndefined;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
type?: undefined;
|
|
133
126
|
}, {
|
|
134
|
-
type
|
|
127
|
+
type?: undefined;
|
|
135
128
|
}>]>;
|
|
136
129
|
type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;
|
|
137
130
|
declare const VariableMappingSchema: z.ZodObject<{
|
|
@@ -158,7 +151,7 @@ declare const VariableMappingSchema: z.ZodObject<{
|
|
|
158
151
|
}>;
|
|
159
152
|
}>;
|
|
160
153
|
declare const PatternPropertyDefinitionSchema: z.ZodObject<{
|
|
161
|
-
defaultValue: z.
|
|
154
|
+
defaultValue: z.ZodUnion<[z.ZodObject<{
|
|
162
155
|
path: z.ZodString;
|
|
163
156
|
type: z.ZodLiteral<"BoundValue">;
|
|
164
157
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -167,33 +160,30 @@ declare const PatternPropertyDefinitionSchema: z.ZodObject<{
|
|
|
167
160
|
}, {
|
|
168
161
|
path: string;
|
|
169
162
|
type: "BoundValue";
|
|
170
|
-
}
|
|
163
|
+
}>, z.ZodNull]>;
|
|
171
164
|
contentTypes: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
172
165
|
}, "strip", z.ZodTypeAny, {
|
|
173
|
-
|
|
174
|
-
defaultValue?: {
|
|
166
|
+
defaultValue: {
|
|
175
167
|
path: string;
|
|
176
168
|
type: "BoundValue";
|
|
177
|
-
} |
|
|
178
|
-
}, {
|
|
169
|
+
} | null;
|
|
179
170
|
contentTypes: Record<string, any>;
|
|
180
|
-
|
|
171
|
+
}, {
|
|
172
|
+
defaultValue: {
|
|
181
173
|
path: string;
|
|
182
174
|
type: "BoundValue";
|
|
183
|
-
} |
|
|
175
|
+
} | null;
|
|
176
|
+
contentTypes: Record<string, any>;
|
|
184
177
|
}>;
|
|
185
178
|
declare const PatternPropertySchema: z.ZodObject<{
|
|
186
179
|
type: z.ZodLiteral<"BoundValue">;
|
|
187
180
|
path: z.ZodString;
|
|
188
|
-
contenType: z.ZodString;
|
|
189
181
|
}, "strip", z.ZodTypeAny, {
|
|
190
182
|
path: string;
|
|
191
183
|
type: "BoundValue";
|
|
192
|
-
contenType: string;
|
|
193
184
|
}, {
|
|
194
185
|
path: string;
|
|
195
186
|
type: "BoundValue";
|
|
196
|
-
contenType: string;
|
|
197
187
|
}>;
|
|
198
188
|
declare const BreakpointSchema: z.ZodObject<{
|
|
199
189
|
id: z.ZodString;
|
|
@@ -276,24 +266,21 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
276
266
|
type: "ComponentValue";
|
|
277
267
|
key: string;
|
|
278
268
|
}>, z.ZodObject<{
|
|
279
|
-
type: z.
|
|
280
|
-
}, "
|
|
281
|
-
type
|
|
269
|
+
type: z.ZodUndefined;
|
|
270
|
+
}, "strip", z.ZodTypeAny, {
|
|
271
|
+
type?: undefined;
|
|
282
272
|
}, {
|
|
283
|
-
type
|
|
273
|
+
type?: undefined;
|
|
284
274
|
}>]>>;
|
|
285
275
|
patternProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
286
276
|
type: z.ZodLiteral<"BoundValue">;
|
|
287
277
|
path: z.ZodString;
|
|
288
|
-
contenType: z.ZodString;
|
|
289
278
|
}, "strip", z.ZodTypeAny, {
|
|
290
279
|
path: string;
|
|
291
280
|
type: "BoundValue";
|
|
292
|
-
contenType: string;
|
|
293
281
|
}, {
|
|
294
282
|
path: string;
|
|
295
283
|
type: "BoundValue";
|
|
296
|
-
contenType: string;
|
|
297
284
|
}>>>;
|
|
298
285
|
}, "strip", z.ZodTypeAny, {
|
|
299
286
|
definitionId: string;
|
|
@@ -314,7 +301,7 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
314
301
|
type: "ComponentValue";
|
|
315
302
|
key: string;
|
|
316
303
|
} | {
|
|
317
|
-
type
|
|
304
|
+
type?: undefined;
|
|
318
305
|
}>;
|
|
319
306
|
id?: string | undefined;
|
|
320
307
|
displayName?: string | undefined;
|
|
@@ -322,7 +309,6 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
322
309
|
patternProperties?: Record<string, {
|
|
323
310
|
path: string;
|
|
324
311
|
type: "BoundValue";
|
|
325
|
-
contenType: string;
|
|
326
312
|
}> | undefined;
|
|
327
313
|
}, {
|
|
328
314
|
definitionId: string;
|
|
@@ -343,7 +329,7 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
343
329
|
type: "ComponentValue";
|
|
344
330
|
key: string;
|
|
345
331
|
} | {
|
|
346
|
-
type
|
|
332
|
+
type?: undefined;
|
|
347
333
|
}>;
|
|
348
334
|
id?: string | undefined;
|
|
349
335
|
displayName?: string | undefined;
|
|
@@ -351,7 +337,6 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
351
337
|
patternProperties?: Record<string, {
|
|
352
338
|
path: string;
|
|
353
339
|
type: "BoundValue";
|
|
354
|
-
contenType: string;
|
|
355
340
|
}> | undefined;
|
|
356
341
|
}>;
|
|
357
342
|
type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {
|
|
@@ -414,11 +399,11 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
414
399
|
type: "ComponentValue";
|
|
415
400
|
key: string;
|
|
416
401
|
}>, z.ZodObject<{
|
|
417
|
-
type: z.
|
|
418
|
-
}, "
|
|
419
|
-
type
|
|
402
|
+
type: z.ZodUndefined;
|
|
403
|
+
}, "strip", z.ZodTypeAny, {
|
|
404
|
+
type?: undefined;
|
|
420
405
|
}, {
|
|
421
|
-
type
|
|
406
|
+
type?: undefined;
|
|
422
407
|
}>]>]>>;
|
|
423
408
|
validations: z.ZodOptional<z.ZodObject<{
|
|
424
409
|
bindingSourceType: z.ZodOptional<z.ZodArray<z.ZodEnum<["entry", "asset", "manual", "experience"]>, "atleastone">>;
|
|
@@ -470,7 +455,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
470
455
|
type: "ComponentValue";
|
|
471
456
|
key: string;
|
|
472
457
|
} | {
|
|
473
|
-
type
|
|
458
|
+
type?: undefined;
|
|
474
459
|
} | undefined;
|
|
475
460
|
displayName?: string | undefined;
|
|
476
461
|
description?: string | undefined;
|
|
@@ -503,7 +488,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
503
488
|
type: "ComponentValue";
|
|
504
489
|
key: string;
|
|
505
490
|
} | {
|
|
506
|
-
type
|
|
491
|
+
type?: undefined;
|
|
507
492
|
} | undefined;
|
|
508
493
|
displayName?: string | undefined;
|
|
509
494
|
description?: string | undefined;
|
|
@@ -543,7 +528,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
543
528
|
}>;
|
|
544
529
|
}>>>;
|
|
545
530
|
patternPropertyDefinitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
546
|
-
defaultValue: z.
|
|
531
|
+
defaultValue: z.ZodUnion<[z.ZodObject<{
|
|
547
532
|
path: z.ZodString;
|
|
548
533
|
type: z.ZodLiteral<"BoundValue">;
|
|
549
534
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -552,20 +537,20 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
552
537
|
}, {
|
|
553
538
|
path: string;
|
|
554
539
|
type: "BoundValue";
|
|
555
|
-
}
|
|
540
|
+
}>, z.ZodNull]>;
|
|
556
541
|
contentTypes: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
557
542
|
}, "strip", z.ZodTypeAny, {
|
|
558
|
-
|
|
559
|
-
defaultValue?: {
|
|
543
|
+
defaultValue: {
|
|
560
544
|
path: string;
|
|
561
545
|
type: "BoundValue";
|
|
562
|
-
} |
|
|
563
|
-
}, {
|
|
546
|
+
} | null;
|
|
564
547
|
contentTypes: Record<string, any>;
|
|
565
|
-
|
|
548
|
+
}, {
|
|
549
|
+
defaultValue: {
|
|
566
550
|
path: string;
|
|
567
551
|
type: "BoundValue";
|
|
568
|
-
} |
|
|
552
|
+
} | null;
|
|
553
|
+
contentTypes: Record<string, any>;
|
|
569
554
|
}>>>;
|
|
570
555
|
}, "strip", z.ZodTypeAny, {
|
|
571
556
|
variableDefinitions: Record<string, {
|
|
@@ -587,7 +572,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
587
572
|
type: "ComponentValue";
|
|
588
573
|
key: string;
|
|
589
574
|
} | {
|
|
590
|
-
type
|
|
575
|
+
type?: undefined;
|
|
591
576
|
} | undefined;
|
|
592
577
|
displayName?: string | undefined;
|
|
593
578
|
description?: string | undefined;
|
|
@@ -611,11 +596,11 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
611
596
|
}>;
|
|
612
597
|
}> | undefined;
|
|
613
598
|
patternPropertyDefinitions?: Record<string, {
|
|
614
|
-
|
|
615
|
-
defaultValue?: {
|
|
599
|
+
defaultValue: {
|
|
616
600
|
path: string;
|
|
617
601
|
type: "BoundValue";
|
|
618
|
-
} |
|
|
602
|
+
} | null;
|
|
603
|
+
contentTypes: Record<string, any>;
|
|
619
604
|
}> | undefined;
|
|
620
605
|
}, {
|
|
621
606
|
variableDefinitions: Record<string, {
|
|
@@ -637,7 +622,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
637
622
|
type: "ComponentValue";
|
|
638
623
|
key: string;
|
|
639
624
|
} | {
|
|
640
|
-
type
|
|
625
|
+
type?: undefined;
|
|
641
626
|
} | undefined;
|
|
642
627
|
displayName?: string | undefined;
|
|
643
628
|
description?: string | undefined;
|
|
@@ -661,11 +646,11 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
661
646
|
}>;
|
|
662
647
|
}> | undefined;
|
|
663
648
|
patternPropertyDefinitions?: Record<string, {
|
|
664
|
-
|
|
665
|
-
defaultValue?: {
|
|
649
|
+
defaultValue: {
|
|
666
650
|
path: string;
|
|
667
651
|
type: "BoundValue";
|
|
668
|
-
} |
|
|
652
|
+
} | null;
|
|
653
|
+
contentTypes: Record<string, any>;
|
|
669
654
|
}> | undefined;
|
|
670
655
|
}>;
|
|
671
656
|
declare const UsedComponentsSchema: z.ZodArray<z.ZodObject<{
|
|
@@ -780,7 +765,6 @@ type Breakpoint = z.infer<typeof BreakpointSchema>;
|
|
|
780
765
|
type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;
|
|
781
766
|
type DesignValue = z.infer<typeof DesignValueSchema>;
|
|
782
767
|
type BoundValue = z.infer<typeof BoundValueSchema>;
|
|
783
|
-
type NoValue = z.infer<typeof NoValueSchema>;
|
|
784
768
|
type UnboundValue = z.infer<typeof UnboundValueSchema>;
|
|
785
769
|
type ComponentValue = z.infer<typeof ComponentValueSchema>;
|
|
786
770
|
type BindingSourceTypeEnum = z.infer<typeof BindingSourceTypeEnumSchema>;
|
|
@@ -844,11 +828,11 @@ declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
|
844
828
|
type: "ComponentValue";
|
|
845
829
|
key: string;
|
|
846
830
|
}>, z.ZodObject<{
|
|
847
|
-
type: z.
|
|
848
|
-
}, "
|
|
849
|
-
type
|
|
831
|
+
type: z.ZodUndefined;
|
|
832
|
+
}, "strip", z.ZodTypeAny, {
|
|
833
|
+
type?: undefined;
|
|
850
834
|
}, {
|
|
851
|
-
type
|
|
835
|
+
type?: undefined;
|
|
852
836
|
}>]>]>>;
|
|
853
837
|
validations: z.ZodOptional<z.ZodObject<{
|
|
854
838
|
bindingSourceType: z.ZodOptional<z.ZodArray<z.ZodEnum<["entry", "asset", "manual", "experience"]>, "atleastone">>;
|
|
@@ -1022,4 +1006,4 @@ declare const validateComponentDefinition: (definition: any) => ValidatorReturnV
|
|
|
1022
1006
|
*/
|
|
1023
1007
|
declare const validateExperienceFields: (experience: any, schemaVersionOverride?: SchemaVersions) => ValidatorReturnValue;
|
|
1024
1008
|
|
|
1025
|
-
export { type BindingSourceTypeEnum, type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, ComponentDefinitionSchema, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, type ExperienceUnboundValues, type ExperienceUsedComponents, type
|
|
1009
|
+
export { type BindingSourceTypeEnum, type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, ComponentDefinitionSchema, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, type ExperienceUnboundValues, type ExperienceUsedComponents, type PatternProperty, type PatternPropertyDefinition, type PrimitiveValue, SchemaVersions, ExperienceFieldsCMAShapeSchema as Schema_2023_09_28, type UnboundValue, type ValuesByBreakpoint, type VariableMapping, validateBreakpointsDefinition, validateComponentDefinition, validateExperienceFields };
|
package/dist/index.js
CHANGED
|
@@ -85,14 +85,14 @@ const ComponentValueSchema = z
|
|
|
85
85
|
.strict();
|
|
86
86
|
// TODO: finalize schema structure before release
|
|
87
87
|
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
88
|
-
const
|
|
88
|
+
const EmptyObjectSchema = z.object({ type: z.undefined() });
|
|
89
89
|
const ComponentPropertyValueSchema = z.discriminatedUnion('type', [
|
|
90
90
|
DesignValueSchema,
|
|
91
91
|
BoundValueSchema,
|
|
92
92
|
UnboundValueSchema,
|
|
93
93
|
HyperlinkValueSchema,
|
|
94
94
|
ComponentValueSchema,
|
|
95
|
-
|
|
95
|
+
EmptyObjectSchema,
|
|
96
96
|
]);
|
|
97
97
|
// TODO: finalize schema structure before release
|
|
98
98
|
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
@@ -105,12 +105,13 @@ const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema
|
|
|
105
105
|
// TODO: finalize schema structure before release
|
|
106
106
|
// https://contentful.atlassian.net/browse/LUMOS-523
|
|
107
107
|
const PatternPropertyDefinitionSchema = z.object({
|
|
108
|
-
defaultValue: z
|
|
109
|
-
.object({
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.
|
|
108
|
+
defaultValue: z.union([
|
|
109
|
+
z.object({
|
|
110
|
+
path: z.string(),
|
|
111
|
+
type: z.literal('BoundValue'),
|
|
112
|
+
}),
|
|
113
|
+
z.null(),
|
|
114
|
+
]),
|
|
114
115
|
contentTypes: z.record(z.string(), z.any()),
|
|
115
116
|
});
|
|
116
117
|
const PatternPropertyDefinitionsSchema = z.record(propertyKeySchema, PatternPropertyDefinitionSchema);
|
|
@@ -119,7 +120,6 @@ const PatternPropertyDefinitionsSchema = z.record(propertyKeySchema, PatternProp
|
|
|
119
120
|
const PatternPropertySchema = z.object({
|
|
120
121
|
type: z.literal('BoundValue'),
|
|
121
122
|
path: z.string(),
|
|
122
|
-
contenType: z.string(),
|
|
123
123
|
});
|
|
124
124
|
const PatternPropertysSchema = z.record(propertyKeySchema, PatternPropertySchema);
|
|
125
125
|
const BreakpointSchema = z
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/schemas/schemaVersions.ts","../src/schemas/v2023_09_28/experience.ts","../src/schemas/componentDefinition.ts","../src/utils/zodToContentfulError.ts","../src/validators/validateBreakpointDefinitions.ts","../src/validators/validateComponentDefinition.ts","../src/validators/validateExperienceFields.ts"],"sourcesContent":["import { z } from 'zod';\n// If more than one version is supported, use z.union\nexport const SchemaVersions = z.literal('2023-09-28');\n\nexport type SchemaVersions = z.infer<typeof SchemaVersions>;\n\n// Keep deprecated versions here just for reference\nexport const UnsupportedSchemaVersions = z.union([\n z.literal('2023-08-23'),\n z.literal('2023-07-26'),\n z.literal('2023-06-27'),\n]);\n","import { z } from 'zod';\nimport { SchemaVersions } from '../schemaVersions';\n\nexport const DefinitionPropertyTypeSchema = z.enum([\n 'Text',\n 'RichText',\n 'Number',\n 'Date',\n 'Boolean',\n 'Location',\n 'Media',\n 'Object',\n 'Hyperlink',\n 'Array',\n 'Link',\n]);\n\nexport const DefinitionPropertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,32}$/, { message: 'Property needs to match: /^[a-zA-Z0-9-_]{1,32}$/' });\n\nexport const PrimitiveValueSchema = z.union([\n z.string(),\n z.boolean(),\n z.number(),\n z.record(z.any(), z.any()),\n z.undefined(),\n]);\n\nconst uuidKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,21}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,21}$/' });\n\n/**\n * Property keys for imported components have a limit of 32 characters (to be implemented) while\n * property keys for patterns have a limit of 54 characters (<32-char-variabl-name>_<21-char-nanoid-id>).\n * Because we cannot distinguish between the two in the componentTree, we will use the larger limit for both.\n */\nconst propertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,54}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,54}$/' });\n\nconst DataSourceSchema = z.record(\n uuidKeySchema,\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.enum(['Entry', 'Asset']),\n }),\n }),\n);\n\nconst ValuesByBreakpointSchema = z.record(z.lazy(() => PrimitiveValueSchema));\n\nconst DesignValueSchema = z\n .object({\n type: z.literal('DesignValue'),\n valuesByBreakpoint: ValuesByBreakpointSchema,\n })\n .strict();\nconst BoundValueSchema = z\n .object({\n type: z.literal('BoundValue'),\n path: z.string(),\n })\n .strict();\nconst HyperlinkValueSchema = z\n .object({\n type: z.literal('HyperlinkValue'),\n linkTargetKey: z.string(),\n /** Allows to override parts of the URL, e.g. the locale */\n overrides: z.object({}).optional(),\n })\n .strict();\nconst UnboundValueSchema = z\n .object({\n type: z.literal('UnboundValue'),\n key: z.string(),\n })\n .strict();\nconst ComponentValueSchema = z\n .object({\n type: z.literal('ComponentValue'),\n key: z.string(),\n })\n .strict();\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst NoValueSchema = z.object({ type: z.literal('NoValue') }).strict();\n\nconst ComponentPropertyValueSchema = z.discriminatedUnion('type', [\n DesignValueSchema,\n BoundValueSchema,\n UnboundValueSchema,\n HyperlinkValueSchema,\n ComponentValueSchema,\n NoValueSchema,\n]);\n\nexport type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst VariableMappingSchema = z.object({\n patternPropertyDefinitionId: propertyKeySchema,\n type: z.literal('ContentTypeMapping'),\n pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),\n});\n\nconst VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertyDefinitionSchema = z.object({\n defaultValue: z\n .object({\n path: z.string(),\n type: z.literal('BoundValue'),\n })\n .optional(),\n contentTypes: z.record(z.string(), z.any()),\n});\n\nconst PatternPropertyDefinitionsSchema = z.record(\n propertyKeySchema,\n PatternPropertyDefinitionSchema,\n);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertySchema = z.object({\n type: z.literal('BoundValue'),\n path: z.string(),\n contenType: z.string(),\n});\n\nconst PatternPropertysSchema = z.record(propertyKeySchema, PatternPropertySchema);\n\nexport const BreakpointSchema = z\n .object({\n id: propertyKeySchema,\n query: z.string().regex(/^\\*$|^<[0-9*]+px$/),\n previewSize: z.string(),\n displayName: z.string(),\n displayIcon: z.enum(['desktop', 'tablet', 'mobile']).optional(),\n })\n .strict();\n\nconst UnboundValuesSchema = z.record(\n uuidKeySchema,\n z.object({\n value: PrimitiveValueSchema,\n }),\n);\n\nexport const ComponentTreeNodeIdSchema = z\n .string()\n .regex(/^[a-zA-Z0-9]{1,8}$/, { message: 'Does not match /^[a-zA-Z0-9]{1,8}$/' });\n\n// Use helper schema to define a recursive schema with its type correctly below\nconst BaseComponentTreeNodeSchema = z.object({\n id: ComponentTreeNodeIdSchema.optional(),\n definitionId: DefinitionPropertyKeySchema,\n displayName: z.string().optional(),\n slotId: z.string().optional(),\n variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),\n patternProperties: PatternPropertysSchema.optional(),\n});\nexport type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {\n children: ComponentTreeNode[];\n};\nconst ComponentTreeNodeSchema: z.ZodType<ComponentTreeNode> = BaseComponentTreeNodeSchema.extend({\n children: z.lazy(() => ComponentTreeNodeSchema.array()),\n});\n\nconst BindingSourceTypeEnumSchema = z\n .array(z.enum(['entry', 'asset', 'manual', 'experience']))\n .nonempty();\n\nexport const ComponentVariableSchema = z.object({\n displayName: z.string().optional(),\n type: DefinitionPropertyTypeSchema,\n description: z.string().optional(),\n group: z.string().optional(),\n defaultValue: PrimitiveValueSchema.or(ComponentPropertyValueSchema).optional(),\n validations: z\n .object({\n bindingSourceType: BindingSourceTypeEnumSchema.optional(),\n required: z.boolean().optional(),\n format: z.literal('URL').optional(),\n in: z\n .array(\n z.object({\n value: z.union([z.string(), z.number()]),\n displayName: z.string().optional(),\n }),\n )\n .optional(),\n })\n .optional(),\n});\n\nexport const ComponentVariablesSchema = z.record(\n z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length\n ComponentVariableSchema,\n);\n\nconst THUMBNAIL_IDS = [\n 'columns',\n 'columnsPlusRight',\n 'imagesSquare',\n 'subtitles',\n 'rowsPlusBottom',\n 'userRectangle',\n 'textbox',\n 'monitorPlay',\n 'article',\n 'table',\n 'star',\n 'heartStraight',\n 'frameCorners',\n 'rows',\n 'dotsThreeOutline',\n 'listDashes',\n 'checkerBoard',\n 'gridFour',\n 'slideshow',\n 'diamondsFour',\n 'cards',\n 'textColumns',\n] as const;\n\nconst ComponentSettingsSchema = z.object({\n variableDefinitions: ComponentVariablesSchema,\n thumbnailId: z.enum(THUMBNAIL_IDS).optional(),\n variableMappings: VariableMappingsSchema.optional(),\n patternPropertyDefinitions: PatternPropertyDefinitionsSchema.optional(),\n});\n\nconst UsedComponentsSchema = z.array(\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.literal('Entry'),\n }),\n }),\n);\n\nexport const breakpointsRefinement = (value: Breakpoint[], ctx: z.RefinementCtx) => {\n if (!value.length || value[0].query !== '*') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `The first breakpoint should include the following attributes: { \"query\": \"*\" }`,\n });\n }\n\n const hasDuplicateIds = value.some((currentBreakpoint, currentBreakpointIndex) => {\n // check if the current breakpoint id is found in the rest of the array\n const breakpointIndex = value.findIndex((breakpoint) => breakpoint.id === currentBreakpoint.id);\n return breakpointIndex !== currentBreakpointIndex;\n });\n\n if (hasDuplicateIds) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoint IDs must be unique`,\n });\n }\n // Extract the queries boundary by removing the special characters around it\n const queries = value.map((bp) =>\n bp.query === '*' ? bp.query : parseInt(bp.query.replace(/px|<|>/, '')),\n );\n // sort updates queries array in place so we need to create a copy\n const originalQueries = [...queries];\n queries.sort((q1, q2) => {\n if (q1 === '*') {\n return -1;\n }\n if (q2 === '*') {\n return 1;\n }\n return q1 > q2 ? -1 : 1;\n });\n\n if (originalQueries.join('') !== queries.join('')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoints should be ordered from largest to smallest pixel value`,\n });\n }\n};\n\nconst ComponentTreeSchema = z\n .object({\n breakpoints: z.array(BreakpointSchema).superRefine(breakpointsRefinement),\n children: z.array(ComponentTreeNodeSchema),\n schemaVersion: SchemaVersions,\n })\n .strict();\n\nconst localeWrapper = (fieldSchema: any) => z.record(z.string(), fieldSchema);\n\nexport const ExperienceFieldsCMAShapeSchema = z.object({\n componentTree: localeWrapper(ComponentTreeSchema),\n dataSource: localeWrapper(DataSourceSchema),\n unboundValues: localeWrapper(UnboundValuesSchema),\n usedComponents: localeWrapper(UsedComponentsSchema).optional(),\n componentSettings: localeWrapper(ComponentSettingsSchema).optional(),\n});\n\nexport type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;\nexport type ExperienceDataSource = z.infer<typeof DataSourceSchema>;\nexport type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;\nexport type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;\nexport type ExperienceComponentSettings = z.infer<typeof ComponentSettingsSchema>;\nexport type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;\nexport type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;\nexport type Breakpoint = z.infer<typeof BreakpointSchema>;\nexport type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;\nexport type DesignValue = z.infer<typeof DesignValueSchema>;\nexport type BoundValue = z.infer<typeof BoundValueSchema>;\nexport type NoValue = z.infer<typeof NoValueSchema>;\nexport type UnboundValue = z.infer<typeof UnboundValueSchema>;\nexport type HyperlinkValue = z.infer<typeof HyperlinkValueSchema>;\nexport type ComponentValue = z.infer<typeof ComponentValueSchema>;\nexport type BindingSourceTypeEnum = z.infer<typeof BindingSourceTypeEnumSchema>;\nexport type PatternPropertyDefinition = z.infer<typeof PatternPropertyDefinitionSchema>;\nexport type PatternProperty = z.infer<typeof PatternPropertySchema>;\nexport type VariableMapping = z.infer<typeof VariableMappingSchema>;\n","import { z } from 'zod';\nimport {\n ComponentVariableSchema,\n DefinitionPropertyKeySchema,\n DefinitionPropertyTypeSchema,\n PrimitiveValueSchema,\n} from './v2023_09_28/experience';\n\nexport const ComponentDefinitionSchema = z.object({\n id: DefinitionPropertyKeySchema,\n variables: z.record(\n DefinitionPropertyKeySchema,\n ComponentVariableSchema.extend({\n defaultValue: PrimitiveValueSchema.optional(),\n }).superRefine((val, ctx) => {\n switch (val.type) {\n case 'Array':\n if (typeof val.defaultValue !== 'undefined') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Array\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Boolean':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'boolean') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a boolean when type is \"Boolean\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Date':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Date\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Hyperlink':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Hyperlink\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Link':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Link\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Location':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Location\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Media':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Media\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Number':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'number') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a number when type is \"Number\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Object':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Object\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'RichText':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"RichText\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Text':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Text\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n }\n }),\n ),\n});\n\nexport type ComponentDefinitionPropertyType = z.infer<typeof DefinitionPropertyTypeSchema>;\nexport type ComponentDefinitionType = z.infer<typeof ComponentDefinitionSchema>;\n","import { ZodIssueCode, ZodIssue, z } from 'zod';\n\nexport enum CodeNames {\n Type = 'type',\n Required = 'required',\n Unexpected = 'unexpected',\n Regex = 'regex',\n In = 'in',\n Size = 'size',\n Custom = 'custom',\n}\n\nexport type ContentfulErrorDetails = {\n details: string;\n min?: number | bigint;\n max?: number | bigint;\n name: (typeof CodeNames)[keyof typeof CodeNames];\n path: (string | number)[];\n value?: string;\n expected?: (string | number)[];\n};\n\nconst convertInvalidType = (issue: z.ZodInvalidTypeIssue): ContentfulErrorDetails => {\n const name = issue.received === 'undefined' ? CodeNames.Required : CodeNames.Type;\n const details =\n issue.received === 'undefined'\n ? `The property \"${issue.path.slice(-1)}\" is required here`\n : `The type of \"${issue.path.slice(-1)}\" is incorrect, expected type: ${issue.expected}`;\n\n return {\n details: details,\n name: name,\n path: issue.path,\n value: issue.received.toString(),\n };\n};\n\nconst convertUnrecognizedKeys = (issue: z.ZodUnrecognizedKeysIssue): ContentfulErrorDetails => {\n const missingProperties = issue.keys.map((k) => `\"${k}\"`).join(', ');\n return {\n details:\n issue.keys.length > 1\n ? `The properties ${missingProperties} are not expected`\n : `The property ${missingProperties} is not expected`,\n name: CodeNames.Unexpected,\n path: issue.path,\n };\n};\n\nconst convertInvalidString = (issue: z.ZodInvalidStringIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Invalid string',\n name: issue.validation === 'regex' ? CodeNames.Regex : CodeNames.Unexpected,\n path: issue.path,\n };\n};\nconst convertInvalidEnumValue = (issue: z.ZodInvalidEnumValueIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received.toString(),\n expected: issue.options,\n };\n};\nconst convertInvalidLiteral = (issue: z.ZodInvalidLiteralIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received as string,\n expected: [issue.expected as string],\n };\n};\n\nconst convertTooBig = (issue: z.ZodTooBigIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at most ${issue.maximum}`,\n name: CodeNames.Size,\n path: issue.path,\n max: issue.maximum,\n };\n};\n\nconst convertTooSmall = (issue: z.ZodTooSmallIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at least ${issue.minimum}`,\n name: CodeNames.Size,\n path: issue.path,\n min: issue.minimum,\n };\n};\nconst defaultConversion = (issue: ZodIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'An unexpected error occurred',\n name: CodeNames.Custom,\n path: issue.path.map(String),\n };\n};\n\nexport const zodToContentfulError = (issue: ZodIssue): ContentfulErrorDetails => {\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n return convertInvalidType(issue);\n case ZodIssueCode.unrecognized_keys:\n return convertUnrecognizedKeys(issue);\n case ZodIssueCode.invalid_enum_value:\n return convertInvalidEnumValue(issue);\n case ZodIssueCode.invalid_string:\n return convertInvalidString(issue);\n case ZodIssueCode.too_small:\n return convertTooSmall(issue);\n case ZodIssueCode.too_big:\n return convertTooBig(issue);\n case ZodIssueCode.invalid_literal:\n return convertInvalidLiteral(issue);\n default:\n return defaultConversion(issue);\n }\n};\n","import { z } from 'zod';\nimport { BreakpointSchema, breakpointsRefinement } from '../schemas/latest';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateBreakpointsDefinition = (breakpoints): ValidatorReturnValue => {\n const result = z\n .array(BreakpointSchema)\n .superRefine(breakpointsRefinement)\n .safeParse(breakpoints);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { ComponentDefinitionSchema } from '../schemas';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateComponentDefinition = (definition): ValidatorReturnValue => {\n const result = ComponentDefinitionSchema.safeParse(definition);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { type SchemaVersions } from '../types';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { Schema_2023_09_28 } from '../schemas';\nimport { zodToContentfulError, CodeNames } from '../utils/zodToContentfulError';\n\nconst VERSION_SCHEMAS = {\n '2023-09-28': Schema_2023_09_28,\n};\n\n/**\n *\n * @param experience The experience entry to validate\n * @param schemaVersionOverride Optional override for the schema version to validate against. By default the schema version is read from the experience entry\n * @returns object with success property and optional errors array\n */\nexport const validateExperienceFields = (\n experience: any,\n schemaVersionOverride?: SchemaVersions,\n): ValidatorReturnValue => {\n let schemaVersion;\n if (experience.fields.componentTree) {\n const locale = Object.keys(experience.fields.componentTree)[0];\n schemaVersion = experience.fields.componentTree[locale].schemaVersion;\n }\n const schema = VERSION_SCHEMAS[schemaVersionOverride || schemaVersion];\n\n if (!schema) {\n return {\n success: false,\n errors: [\n {\n name: schemaVersion ? CodeNames.In : CodeNames.Required,\n expected: ['2023-09-28'],\n value: schemaVersion,\n path: ['fields', 'componentTree', 'schemaVersion'],\n details: schemaVersion\n ? 'Unsupported schema version'\n : 'The property \"schemaVersion\" is required here',\n },\n ],\n };\n }\n\n const fieldsToValidate = {\n componentTree: experience.fields.componentTree,\n dataSource: experience.fields.dataSource,\n unboundValues: experience.fields.unboundValues,\n usedComponents: experience.fields.usedComponents,\n componentSettings: experience.fields.componentSettings,\n };\n\n const result = schema.safeParse(fieldsToValidate);\n if (!result.success) {\n return {\n success: result.success,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n"],"names":["Schema_2023_09_28"],"mappings":";;AACA;AACO,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAItD;AACyC,CAAC,CAAC,KAAK,CAAC;AAC/C,IAAA,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;AACvB,IAAA,CAAC,CAAC,OAAO,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KACH;AAED,IAAA,MAAM,gBAAgB,GAAG;AACvB,QAAA,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,aAAa;AAC9C,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU;AACxC,QAAA,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,aAAa;AAC9C,QAAA,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,cAAc;AAChD,QAAA,iBAAiB,EAAE,UAAU,CAAC,MAAM,CAAC,iBAAiB;KACvD,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAClD,IAAA,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACnB,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;SACtD,CAAC;KACH;AACD,IAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/schemas/schemaVersions.ts","../src/schemas/v2023_09_28/experience.ts","../src/schemas/componentDefinition.ts","../src/utils/zodToContentfulError.ts","../src/validators/validateBreakpointDefinitions.ts","../src/validators/validateComponentDefinition.ts","../src/validators/validateExperienceFields.ts"],"sourcesContent":["import { z } from 'zod';\n// If more than one version is supported, use z.union\nexport const SchemaVersions = z.literal('2023-09-28');\n\nexport type SchemaVersions = z.infer<typeof SchemaVersions>;\n\n// Keep deprecated versions here just for reference\nexport const UnsupportedSchemaVersions = z.union([\n z.literal('2023-08-23'),\n z.literal('2023-07-26'),\n z.literal('2023-06-27'),\n]);\n","import { z } from 'zod';\nimport { SchemaVersions } from '../schemaVersions';\n\nexport const DefinitionPropertyTypeSchema = z.enum([\n 'Text',\n 'RichText',\n 'Number',\n 'Date',\n 'Boolean',\n 'Location',\n 'Media',\n 'Object',\n 'Hyperlink',\n 'Array',\n 'Link',\n]);\n\nexport const DefinitionPropertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,32}$/, { message: 'Property needs to match: /^[a-zA-Z0-9-_]{1,32}$/' });\n\nexport const PrimitiveValueSchema = z.union([\n z.string(),\n z.boolean(),\n z.number(),\n z.record(z.any(), z.any()),\n z.undefined(),\n]);\n\nconst uuidKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,21}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,21}$/' });\n\n/**\n * Property keys for imported components have a limit of 32 characters (to be implemented) while\n * property keys for patterns have a limit of 54 characters (<32-char-variabl-name>_<21-char-nanoid-id>).\n * Because we cannot distinguish between the two in the componentTree, we will use the larger limit for both.\n */\nconst propertyKeySchema = z\n .string()\n .regex(/^[a-zA-Z0-9-_]{1,54}$/, { message: 'Does not match /^[a-zA-Z0-9-_]{1,54}$/' });\n\nconst DataSourceSchema = z.record(\n uuidKeySchema,\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.enum(['Entry', 'Asset']),\n }),\n }),\n);\n\nconst ValuesByBreakpointSchema = z.record(z.lazy(() => PrimitiveValueSchema));\n\nconst DesignValueSchema = z\n .object({\n type: z.literal('DesignValue'),\n valuesByBreakpoint: ValuesByBreakpointSchema,\n })\n .strict();\nconst BoundValueSchema = z\n .object({\n type: z.literal('BoundValue'),\n path: z.string(),\n })\n .strict();\nconst HyperlinkValueSchema = z\n .object({\n type: z.literal('HyperlinkValue'),\n linkTargetKey: z.string(),\n /** Allows to override parts of the URL, e.g. the locale */\n overrides: z.object({}).optional(),\n })\n .strict();\nconst UnboundValueSchema = z\n .object({\n type: z.literal('UnboundValue'),\n key: z.string(),\n })\n .strict();\nconst ComponentValueSchema = z\n .object({\n type: z.literal('ComponentValue'),\n key: z.string(),\n })\n .strict();\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst EmptyObjectSchema = z.object({ type: z.undefined() });\n\nconst ComponentPropertyValueSchema = z.discriminatedUnion('type', [\n DesignValueSchema,\n BoundValueSchema,\n UnboundValueSchema,\n HyperlinkValueSchema,\n ComponentValueSchema,\n EmptyObjectSchema,\n]);\n\nexport type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst VariableMappingSchema = z.object({\n patternPropertyDefinitionId: propertyKeySchema,\n type: z.literal('ContentTypeMapping'),\n pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),\n});\n\nconst VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertyDefinitionSchema = z.object({\n defaultValue: z.union([\n z.object({\n path: z.string(),\n type: z.literal('BoundValue'),\n }),\n z.null(),\n ]),\n contentTypes: z.record(z.string(), z.any()),\n});\n\nconst PatternPropertyDefinitionsSchema = z.record(\n propertyKeySchema,\n PatternPropertyDefinitionSchema,\n);\n\n// TODO: finalize schema structure before release\n// https://contentful.atlassian.net/browse/LUMOS-523\nconst PatternPropertySchema = z.object({\n type: z.literal('BoundValue'),\n path: z.string(),\n});\n\nconst PatternPropertysSchema = z.record(propertyKeySchema, PatternPropertySchema);\n\nexport const BreakpointSchema = z\n .object({\n id: propertyKeySchema,\n query: z.string().regex(/^\\*$|^<[0-9*]+px$/),\n previewSize: z.string(),\n displayName: z.string(),\n displayIcon: z.enum(['desktop', 'tablet', 'mobile']).optional(),\n })\n .strict();\n\nconst UnboundValuesSchema = z.record(\n uuidKeySchema,\n z.object({\n value: PrimitiveValueSchema,\n }),\n);\n\nexport const ComponentTreeNodeIdSchema = z\n .string()\n .regex(/^[a-zA-Z0-9]{1,8}$/, { message: 'Does not match /^[a-zA-Z0-9]{1,8}$/' });\n\n// Use helper schema to define a recursive schema with its type correctly below\nconst BaseComponentTreeNodeSchema = z.object({\n id: ComponentTreeNodeIdSchema.optional(),\n definitionId: DefinitionPropertyKeySchema,\n displayName: z.string().optional(),\n slotId: z.string().optional(),\n variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),\n patternProperties: PatternPropertysSchema.optional(),\n});\nexport type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {\n children: ComponentTreeNode[];\n};\nconst ComponentTreeNodeSchema: z.ZodType<ComponentTreeNode> = BaseComponentTreeNodeSchema.extend({\n children: z.lazy(() => ComponentTreeNodeSchema.array()),\n});\n\nconst BindingSourceTypeEnumSchema = z\n .array(z.enum(['entry', 'asset', 'manual', 'experience']))\n .nonempty();\n\nexport const ComponentVariableSchema = z.object({\n displayName: z.string().optional(),\n type: DefinitionPropertyTypeSchema,\n description: z.string().optional(),\n group: z.string().optional(),\n defaultValue: PrimitiveValueSchema.or(ComponentPropertyValueSchema).optional(),\n validations: z\n .object({\n bindingSourceType: BindingSourceTypeEnumSchema.optional(),\n required: z.boolean().optional(),\n format: z.literal('URL').optional(),\n in: z\n .array(\n z.object({\n value: z.union([z.string(), z.number()]),\n displayName: z.string().optional(),\n }),\n )\n .optional(),\n })\n .optional(),\n});\n\nexport const ComponentVariablesSchema = z.record(\n z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length\n ComponentVariableSchema,\n);\n\nconst THUMBNAIL_IDS = [\n 'columns',\n 'columnsPlusRight',\n 'imagesSquare',\n 'subtitles',\n 'rowsPlusBottom',\n 'userRectangle',\n 'textbox',\n 'monitorPlay',\n 'article',\n 'table',\n 'star',\n 'heartStraight',\n 'frameCorners',\n 'rows',\n 'dotsThreeOutline',\n 'listDashes',\n 'checkerBoard',\n 'gridFour',\n 'slideshow',\n 'diamondsFour',\n 'cards',\n 'textColumns',\n] as const;\n\nconst ComponentSettingsSchema = z.object({\n variableDefinitions: ComponentVariablesSchema,\n thumbnailId: z.enum(THUMBNAIL_IDS).optional(),\n variableMappings: VariableMappingsSchema.optional(),\n patternPropertyDefinitions: PatternPropertyDefinitionsSchema.optional(),\n});\n\nconst UsedComponentsSchema = z.array(\n z.object({\n sys: z.object({\n type: z.literal('Link'),\n id: z.string(),\n linkType: z.literal('Entry'),\n }),\n }),\n);\n\nexport const breakpointsRefinement = (value: Breakpoint[], ctx: z.RefinementCtx) => {\n if (!value.length || value[0].query !== '*') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `The first breakpoint should include the following attributes: { \"query\": \"*\" }`,\n });\n }\n\n const hasDuplicateIds = value.some((currentBreakpoint, currentBreakpointIndex) => {\n // check if the current breakpoint id is found in the rest of the array\n const breakpointIndex = value.findIndex((breakpoint) => breakpoint.id === currentBreakpoint.id);\n return breakpointIndex !== currentBreakpointIndex;\n });\n\n if (hasDuplicateIds) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoint IDs must be unique`,\n });\n }\n // Extract the queries boundary by removing the special characters around it\n const queries = value.map((bp) =>\n bp.query === '*' ? bp.query : parseInt(bp.query.replace(/px|<|>/, '')),\n );\n // sort updates queries array in place so we need to create a copy\n const originalQueries = [...queries];\n queries.sort((q1, q2) => {\n if (q1 === '*') {\n return -1;\n }\n if (q2 === '*') {\n return 1;\n }\n return q1 > q2 ? -1 : 1;\n });\n\n if (originalQueries.join('') !== queries.join('')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `Breakpoints should be ordered from largest to smallest pixel value`,\n });\n }\n};\n\nconst ComponentTreeSchema = z\n .object({\n breakpoints: z.array(BreakpointSchema).superRefine(breakpointsRefinement),\n children: z.array(ComponentTreeNodeSchema),\n schemaVersion: SchemaVersions,\n })\n .strict();\n\nconst localeWrapper = (fieldSchema: any) => z.record(z.string(), fieldSchema);\n\nexport const ExperienceFieldsCMAShapeSchema = z.object({\n componentTree: localeWrapper(ComponentTreeSchema),\n dataSource: localeWrapper(DataSourceSchema),\n unboundValues: localeWrapper(UnboundValuesSchema),\n usedComponents: localeWrapper(UsedComponentsSchema).optional(),\n componentSettings: localeWrapper(ComponentSettingsSchema).optional(),\n});\n\nexport type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;\nexport type ExperienceDataSource = z.infer<typeof DataSourceSchema>;\nexport type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;\nexport type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;\nexport type ExperienceComponentSettings = z.infer<typeof ComponentSettingsSchema>;\nexport type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;\nexport type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;\nexport type Breakpoint = z.infer<typeof BreakpointSchema>;\nexport type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;\nexport type DesignValue = z.infer<typeof DesignValueSchema>;\nexport type BoundValue = z.infer<typeof BoundValueSchema>;\nexport type UnboundValue = z.infer<typeof UnboundValueSchema>;\nexport type HyperlinkValue = z.infer<typeof HyperlinkValueSchema>;\nexport type ComponentValue = z.infer<typeof ComponentValueSchema>;\nexport type BindingSourceTypeEnum = z.infer<typeof BindingSourceTypeEnumSchema>;\nexport type PatternPropertyDefinition = z.infer<typeof PatternPropertyDefinitionSchema>;\nexport type PatternProperty = z.infer<typeof PatternPropertySchema>;\nexport type VariableMapping = z.infer<typeof VariableMappingSchema>;\n","import { z } from 'zod';\nimport {\n ComponentVariableSchema,\n DefinitionPropertyKeySchema,\n DefinitionPropertyTypeSchema,\n PrimitiveValueSchema,\n} from './v2023_09_28/experience';\n\nexport const ComponentDefinitionSchema = z.object({\n id: DefinitionPropertyKeySchema,\n variables: z.record(\n DefinitionPropertyKeySchema,\n ComponentVariableSchema.extend({\n defaultValue: PrimitiveValueSchema.optional(),\n }).superRefine((val, ctx) => {\n switch (val.type) {\n case 'Array':\n if (typeof val.defaultValue !== 'undefined') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Array\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Boolean':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'boolean') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a boolean when type is \"Boolean\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Date':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Date\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Hyperlink':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Hyperlink\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Link':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue is not supported for \"Link\" type for ${ctx.path.join('.')}`,\n fatal: false,\n });\n }\n break;\n case 'Location':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Location\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Media':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Media\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Number':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'number') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a number when type is \"Number\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Object':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"Object\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'RichText':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'object') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be an object when type is \"RichText\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n case 'Text':\n if (typeof val.defaultValue !== 'undefined' && typeof val.defaultValue !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `defaultValue must be a string when type is \"Text\" for ${ctx.path.join('.')}, got ${typeof val.defaultValue} instead`,\n fatal: false,\n });\n }\n break;\n }\n }),\n ),\n});\n\nexport type ComponentDefinitionPropertyType = z.infer<typeof DefinitionPropertyTypeSchema>;\nexport type ComponentDefinitionType = z.infer<typeof ComponentDefinitionSchema>;\n","import { ZodIssueCode, ZodIssue, z } from 'zod';\n\nexport enum CodeNames {\n Type = 'type',\n Required = 'required',\n Unexpected = 'unexpected',\n Regex = 'regex',\n In = 'in',\n Size = 'size',\n Custom = 'custom',\n}\n\nexport type ContentfulErrorDetails = {\n details: string;\n min?: number | bigint;\n max?: number | bigint;\n name: (typeof CodeNames)[keyof typeof CodeNames];\n path: (string | number)[];\n value?: string;\n expected?: (string | number)[];\n};\n\nconst convertInvalidType = (issue: z.ZodInvalidTypeIssue): ContentfulErrorDetails => {\n const name = issue.received === 'undefined' ? CodeNames.Required : CodeNames.Type;\n const details =\n issue.received === 'undefined'\n ? `The property \"${issue.path.slice(-1)}\" is required here`\n : `The type of \"${issue.path.slice(-1)}\" is incorrect, expected type: ${issue.expected}`;\n\n return {\n details: details,\n name: name,\n path: issue.path,\n value: issue.received.toString(),\n };\n};\n\nconst convertUnrecognizedKeys = (issue: z.ZodUnrecognizedKeysIssue): ContentfulErrorDetails => {\n const missingProperties = issue.keys.map((k) => `\"${k}\"`).join(', ');\n return {\n details:\n issue.keys.length > 1\n ? `The properties ${missingProperties} are not expected`\n : `The property ${missingProperties} is not expected`,\n name: CodeNames.Unexpected,\n path: issue.path,\n };\n};\n\nconst convertInvalidString = (issue: z.ZodInvalidStringIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Invalid string',\n name: issue.validation === 'regex' ? CodeNames.Regex : CodeNames.Unexpected,\n path: issue.path,\n };\n};\nconst convertInvalidEnumValue = (issue: z.ZodInvalidEnumValueIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received.toString(),\n expected: issue.options,\n };\n};\nconst convertInvalidLiteral = (issue: z.ZodInvalidLiteralIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'Value must be one of expected values',\n name: CodeNames.In,\n path: issue.path,\n value: issue.received as string,\n expected: [issue.expected as string],\n };\n};\n\nconst convertTooBig = (issue: z.ZodTooBigIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at most ${issue.maximum}`,\n name: CodeNames.Size,\n path: issue.path,\n max: issue.maximum,\n };\n};\n\nconst convertTooSmall = (issue: z.ZodTooSmallIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || `Size should be at least ${issue.minimum}`,\n name: CodeNames.Size,\n path: issue.path,\n min: issue.minimum,\n };\n};\nconst defaultConversion = (issue: ZodIssue): ContentfulErrorDetails => {\n return {\n details: issue.message || 'An unexpected error occurred',\n name: CodeNames.Custom,\n path: issue.path.map(String),\n };\n};\n\nexport const zodToContentfulError = (issue: ZodIssue): ContentfulErrorDetails => {\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n return convertInvalidType(issue);\n case ZodIssueCode.unrecognized_keys:\n return convertUnrecognizedKeys(issue);\n case ZodIssueCode.invalid_enum_value:\n return convertInvalidEnumValue(issue);\n case ZodIssueCode.invalid_string:\n return convertInvalidString(issue);\n case ZodIssueCode.too_small:\n return convertTooSmall(issue);\n case ZodIssueCode.too_big:\n return convertTooBig(issue);\n case ZodIssueCode.invalid_literal:\n return convertInvalidLiteral(issue);\n default:\n return defaultConversion(issue);\n }\n};\n","import { z } from 'zod';\nimport { BreakpointSchema, breakpointsRefinement } from '../schemas/latest';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateBreakpointsDefinition = (breakpoints): ValidatorReturnValue => {\n const result = z\n .array(BreakpointSchema)\n .superRefine(breakpointsRefinement)\n .safeParse(breakpoints);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { ComponentDefinitionSchema } from '../schemas';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { zodToContentfulError } from '../utils/zodToContentfulError';\n\nexport const validateComponentDefinition = (definition): ValidatorReturnValue => {\n const result = ComponentDefinitionSchema.safeParse(definition);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n","import { type SchemaVersions } from '../types';\nimport { ValidatorReturnValue } from './ValidatorReturnValue';\nimport { Schema_2023_09_28 } from '../schemas';\nimport { zodToContentfulError, CodeNames } from '../utils/zodToContentfulError';\n\nconst VERSION_SCHEMAS = {\n '2023-09-28': Schema_2023_09_28,\n};\n\n/**\n *\n * @param experience The experience entry to validate\n * @param schemaVersionOverride Optional override for the schema version to validate against. By default the schema version is read from the experience entry\n * @returns object with success property and optional errors array\n */\nexport const validateExperienceFields = (\n experience: any,\n schemaVersionOverride?: SchemaVersions,\n): ValidatorReturnValue => {\n let schemaVersion;\n if (experience.fields.componentTree) {\n const locale = Object.keys(experience.fields.componentTree)[0];\n schemaVersion = experience.fields.componentTree[locale].schemaVersion;\n }\n const schema = VERSION_SCHEMAS[schemaVersionOverride || schemaVersion];\n\n if (!schema) {\n return {\n success: false,\n errors: [\n {\n name: schemaVersion ? CodeNames.In : CodeNames.Required,\n expected: ['2023-09-28'],\n value: schemaVersion,\n path: ['fields', 'componentTree', 'schemaVersion'],\n details: schemaVersion\n ? 'Unsupported schema version'\n : 'The property \"schemaVersion\" is required here',\n },\n ],\n };\n }\n\n const fieldsToValidate = {\n componentTree: experience.fields.componentTree,\n dataSource: experience.fields.dataSource,\n unboundValues: experience.fields.unboundValues,\n usedComponents: experience.fields.usedComponents,\n componentSettings: experience.fields.componentSettings,\n };\n\n const result = schema.safeParse(fieldsToValidate);\n if (!result.success) {\n return {\n success: result.success,\n errors: result.error.issues.map(zodToContentfulError),\n };\n }\n return { success: true };\n};\n"],"names":["Schema_2023_09_28"],"mappings":";;AACA;AACO,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAItD;AACyC,CAAC,CAAC,KAAK,CAAC;AAC/C,IAAA,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;AACvB,IAAA,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;AACvB,IAAA,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;AACxB,CAAA;;ACRM,MAAM,4BAA4B,GAAG,CAAC,CAAC,IAAI,CAAC;IACjD,MAAM;IACN,UAAU;IACV,QAAQ;IACR,MAAM;IACN,SAAS;IACT,UAAU;IACV,OAAO;IACP,QAAQ;IACR,WAAW;IACX,OAAO;IACP,MAAM;AACP,CAAA,CAAC,CAAC;AAEI,MAAM,2BAA2B,GAAG,CAAC;AACzC,KAAA,MAAM,EAAE;KACR,KAAK,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,CAAC,CAAC;AAE5F,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,OAAO,EAAE;IACX,CAAC,CAAC,MAAM,EAAE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AC;KACH;AACD,IAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -70,13 +70,6 @@ declare const ComponentValueSchema: z.ZodObject<{
|
|
|
70
70
|
type: "ComponentValue";
|
|
71
71
|
key: string;
|
|
72
72
|
}>;
|
|
73
|
-
declare const NoValueSchema: z.ZodObject<{
|
|
74
|
-
type: z.ZodLiteral<"NoValue">;
|
|
75
|
-
}, "strict", z.ZodTypeAny, {
|
|
76
|
-
type: "NoValue";
|
|
77
|
-
}, {
|
|
78
|
-
type: "NoValue";
|
|
79
|
-
}>;
|
|
80
73
|
declare const ComponentPropertyValueSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
81
74
|
type: z.ZodLiteral<"DesignValue">;
|
|
82
75
|
valuesByBreakpoint: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>>>;
|
|
@@ -127,11 +120,11 @@ declare const ComponentPropertyValueSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
127
120
|
type: "ComponentValue";
|
|
128
121
|
key: string;
|
|
129
122
|
}>, z.ZodObject<{
|
|
130
|
-
type: z.
|
|
131
|
-
}, "
|
|
132
|
-
type
|
|
123
|
+
type: z.ZodUndefined;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
type?: undefined;
|
|
133
126
|
}, {
|
|
134
|
-
type
|
|
127
|
+
type?: undefined;
|
|
135
128
|
}>]>;
|
|
136
129
|
type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;
|
|
137
130
|
declare const BreakpointSchema: z.ZodObject<{
|
|
@@ -215,24 +208,21 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
215
208
|
type: "ComponentValue";
|
|
216
209
|
key: string;
|
|
217
210
|
}>, z.ZodObject<{
|
|
218
|
-
type: z.
|
|
219
|
-
}, "
|
|
220
|
-
type
|
|
211
|
+
type: z.ZodUndefined;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
type?: undefined;
|
|
221
214
|
}, {
|
|
222
|
-
type
|
|
215
|
+
type?: undefined;
|
|
223
216
|
}>]>>;
|
|
224
217
|
patternProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
225
218
|
type: z.ZodLiteral<"BoundValue">;
|
|
226
219
|
path: z.ZodString;
|
|
227
|
-
contenType: z.ZodString;
|
|
228
220
|
}, "strip", z.ZodTypeAny, {
|
|
229
221
|
path: string;
|
|
230
222
|
type: "BoundValue";
|
|
231
|
-
contenType: string;
|
|
232
223
|
}, {
|
|
233
224
|
path: string;
|
|
234
225
|
type: "BoundValue";
|
|
235
|
-
contenType: string;
|
|
236
226
|
}>>>;
|
|
237
227
|
}, "strip", z.ZodTypeAny, {
|
|
238
228
|
definitionId: string;
|
|
@@ -253,7 +243,7 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
253
243
|
type: "ComponentValue";
|
|
254
244
|
key: string;
|
|
255
245
|
} | {
|
|
256
|
-
type
|
|
246
|
+
type?: undefined;
|
|
257
247
|
}>;
|
|
258
248
|
id?: string | undefined;
|
|
259
249
|
displayName?: string | undefined;
|
|
@@ -261,7 +251,6 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
261
251
|
patternProperties?: Record<string, {
|
|
262
252
|
path: string;
|
|
263
253
|
type: "BoundValue";
|
|
264
|
-
contenType: string;
|
|
265
254
|
}> | undefined;
|
|
266
255
|
}, {
|
|
267
256
|
definitionId: string;
|
|
@@ -282,7 +271,7 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
282
271
|
type: "ComponentValue";
|
|
283
272
|
key: string;
|
|
284
273
|
} | {
|
|
285
|
-
type
|
|
274
|
+
type?: undefined;
|
|
286
275
|
}>;
|
|
287
276
|
id?: string | undefined;
|
|
288
277
|
displayName?: string | undefined;
|
|
@@ -290,7 +279,6 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
290
279
|
patternProperties?: Record<string, {
|
|
291
280
|
path: string;
|
|
292
281
|
type: "BoundValue";
|
|
293
|
-
contenType: string;
|
|
294
282
|
}> | undefined;
|
|
295
283
|
}>;
|
|
296
284
|
type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {
|
|
@@ -352,11 +340,11 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
352
340
|
type: "ComponentValue";
|
|
353
341
|
key: string;
|
|
354
342
|
}>, z.ZodObject<{
|
|
355
|
-
type: z.
|
|
356
|
-
}, "
|
|
357
|
-
type
|
|
343
|
+
type: z.ZodUndefined;
|
|
344
|
+
}, "strip", z.ZodTypeAny, {
|
|
345
|
+
type?: undefined;
|
|
358
346
|
}, {
|
|
359
|
-
type
|
|
347
|
+
type?: undefined;
|
|
360
348
|
}>]>]>>;
|
|
361
349
|
validations: z.ZodOptional<z.ZodObject<{
|
|
362
350
|
bindingSourceType: z.ZodOptional<z.ZodArray<z.ZodEnum<["entry", "asset", "manual", "experience"]>, "atleastone">>;
|
|
@@ -408,7 +396,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
408
396
|
type: "ComponentValue";
|
|
409
397
|
key: string;
|
|
410
398
|
} | {
|
|
411
|
-
type
|
|
399
|
+
type?: undefined;
|
|
412
400
|
} | undefined;
|
|
413
401
|
displayName?: string | undefined;
|
|
414
402
|
description?: string | undefined;
|
|
@@ -441,7 +429,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
441
429
|
type: "ComponentValue";
|
|
442
430
|
key: string;
|
|
443
431
|
} | {
|
|
444
|
-
type
|
|
432
|
+
type?: undefined;
|
|
445
433
|
} | undefined;
|
|
446
434
|
displayName?: string | undefined;
|
|
447
435
|
description?: string | undefined;
|
|
@@ -481,7 +469,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
481
469
|
}>;
|
|
482
470
|
}>>>;
|
|
483
471
|
patternPropertyDefinitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
484
|
-
defaultValue: z.
|
|
472
|
+
defaultValue: z.ZodUnion<[z.ZodObject<{
|
|
485
473
|
path: z.ZodString;
|
|
486
474
|
type: z.ZodLiteral<"BoundValue">;
|
|
487
475
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -490,20 +478,20 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
490
478
|
}, {
|
|
491
479
|
path: string;
|
|
492
480
|
type: "BoundValue";
|
|
493
|
-
}
|
|
481
|
+
}>, z.ZodNull]>;
|
|
494
482
|
contentTypes: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
495
483
|
}, "strip", z.ZodTypeAny, {
|
|
496
|
-
|
|
497
|
-
defaultValue?: {
|
|
484
|
+
defaultValue: {
|
|
498
485
|
path: string;
|
|
499
486
|
type: "BoundValue";
|
|
500
|
-
} |
|
|
501
|
-
}, {
|
|
487
|
+
} | null;
|
|
502
488
|
contentTypes: Record<string, any>;
|
|
503
|
-
|
|
489
|
+
}, {
|
|
490
|
+
defaultValue: {
|
|
504
491
|
path: string;
|
|
505
492
|
type: "BoundValue";
|
|
506
|
-
} |
|
|
493
|
+
} | null;
|
|
494
|
+
contentTypes: Record<string, any>;
|
|
507
495
|
}>>>;
|
|
508
496
|
}, "strip", z.ZodTypeAny, {
|
|
509
497
|
variableDefinitions: Record<string, {
|
|
@@ -525,7 +513,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
525
513
|
type: "ComponentValue";
|
|
526
514
|
key: string;
|
|
527
515
|
} | {
|
|
528
|
-
type
|
|
516
|
+
type?: undefined;
|
|
529
517
|
} | undefined;
|
|
530
518
|
displayName?: string | undefined;
|
|
531
519
|
description?: string | undefined;
|
|
@@ -549,11 +537,11 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
549
537
|
}>;
|
|
550
538
|
}> | undefined;
|
|
551
539
|
patternPropertyDefinitions?: Record<string, {
|
|
552
|
-
|
|
553
|
-
defaultValue?: {
|
|
540
|
+
defaultValue: {
|
|
554
541
|
path: string;
|
|
555
542
|
type: "BoundValue";
|
|
556
|
-
} |
|
|
543
|
+
} | null;
|
|
544
|
+
contentTypes: Record<string, any>;
|
|
557
545
|
}> | undefined;
|
|
558
546
|
}, {
|
|
559
547
|
variableDefinitions: Record<string, {
|
|
@@ -575,7 +563,7 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
575
563
|
type: "ComponentValue";
|
|
576
564
|
key: string;
|
|
577
565
|
} | {
|
|
578
|
-
type
|
|
566
|
+
type?: undefined;
|
|
579
567
|
} | undefined;
|
|
580
568
|
displayName?: string | undefined;
|
|
581
569
|
description?: string | undefined;
|
|
@@ -599,11 +587,11 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
599
587
|
}>;
|
|
600
588
|
}> | undefined;
|
|
601
589
|
patternPropertyDefinitions?: Record<string, {
|
|
602
|
-
|
|
603
|
-
defaultValue?: {
|
|
590
|
+
defaultValue: {
|
|
604
591
|
path: string;
|
|
605
592
|
type: "BoundValue";
|
|
606
|
-
} |
|
|
593
|
+
} | null;
|
|
594
|
+
contentTypes: Record<string, any>;
|
|
607
595
|
}> | undefined;
|
|
608
596
|
}>;
|
|
609
597
|
declare const UsedComponentsSchema: z.ZodArray<z.ZodObject<{
|
|
@@ -718,7 +706,6 @@ type Breakpoint = z.infer<typeof BreakpointSchema>;
|
|
|
718
706
|
type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;
|
|
719
707
|
type DesignValue = z.infer<typeof DesignValueSchema>;
|
|
720
708
|
type BoundValue = z.infer<typeof BoundValueSchema>;
|
|
721
|
-
type NoValue = z.infer<typeof NoValueSchema>;
|
|
722
709
|
type UnboundValue = z.infer<typeof UnboundValueSchema>;
|
|
723
710
|
type ComponentValue = z.infer<typeof ComponentValueSchema>;
|
|
724
711
|
|
|
@@ -727,4 +714,4 @@ type ComponentDefinitionPropertyType = z.infer<typeof DefinitionPropertyTypeSche
|
|
|
727
714
|
declare const SchemaVersions: z.ZodLiteral<"2023-09-28">;
|
|
728
715
|
type SchemaVersions = z.infer<typeof SchemaVersions>;
|
|
729
716
|
|
|
730
|
-
export { type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, type ExperienceUnboundValues, type ExperienceUsedComponents, type
|
|
717
|
+
export { type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, type ExperienceUnboundValues, type ExperienceUsedComponents, type PrimitiveValue, SchemaVersions, type UnboundValue, type ValuesByBreakpoint };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-validators",
|
|
3
|
-
"version": "1.32.0
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"registry": "https://npm.pkg.github.com/"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "36a479f782ec0bf0ede6cc7d587594c9e1e0656a"
|
|
54
54
|
}
|