@defra/forms-model 3.0.551 → 3.0.552

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.
@@ -324,10 +324,6 @@ const outputSchema = Joi.object().description('Configuration for form submission
324
324
  audience: Joi.string().trim().valid('human', 'machine').required().description('Target audience for the output (human readable or machine processable)'),
325
325
  version: Joi.string().trim().required().description('Version identifier for the output format')
326
326
  });
327
- const versionMetadataSchema = Joi.object().description('Version metadata for the form definition').keys({
328
- version: Joi.number().integer().positive().required().description('Version number of the form'),
329
- createdAt: Joi.string().isoDate().required().description('ISO date when this version was created')
330
- });
331
327
 
332
328
  /**
333
329
  * Joi schema for `FormDefinition` interface
@@ -354,8 +350,7 @@ export const formDefinitionSchema = Joi.object().description('Complete form defi
354
350
  allow: ['uk']
355
351
  }
356
352
  }).optional().description('Email address where form submissions are sent'),
357
- output: outputSchema.optional().description('Configuration for submission output format'),
358
- versionMetadata: versionMetadataSchema.optional().description('Version metadata for the form definition')
353
+ output: outputSchema.optional().description('Configuration for submission output format')
359
354
  });
360
355
  export const formDefinitionV2Schema = formDefinitionSchema.keys({
361
356
  schema: Joi.number().integer().valid(SchemaVersion.V2).description('Form schema version to use (2)'),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["JoiDate","JoiBase","v4","uuidV4","ComponentType","ConditionType","OperatorName","SchemaVersion","checkErrors","FormDefinitionError","ControllerType","hasComponents","Joi","extend","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","id","componentIdRefSchema","pages","flatMap","page","components","filter","component","listIdRef","lists","list","listItemIdRef","items","item","sectionsSchema","object","description","keys","name","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","valid","error","RefConditionListId","itemId","RefConditionItemId","relativeDateValueDataSchemaV2","period","number","integer","positive","unit","direction","relativeDateValueDataSchema","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionRefDataSchemaV2","conditionId","RefConditionConditionId","conditionSchema","field","operator","alternatives","try","conditionDataSchemaV2","componentId","RefConditionComponentId","Object","values","any","switch","BooleanValue","StringValue","NumberValue","DateValue","date","format","raw","ListItemRef","RelativeDate","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","min","conditional","otherwise","max","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","allow","hint","options","rows","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","length","componentSchemaV2","RefPageComponentList","componentPayloadSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","ignoreUndefined","pageSchema","disallow","section","controller","repeat","strip","next","events","view","pageSchemaV2","append","FileUpload","UniquePageComponentId","UniquePageComponentName","RefPageCondition","pagePayloadSchemaV2","baseListItemSchema","text","stringListItemSchema","numberListItemSchema","listSchema","UniqueListItemId","UniqueListItemText","UniqueListItemValue","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","versionMetadataSchema","createdAt","isoDate","formDefinitionSchema","engine","V1","feedback","startPage","sections","UniqueSectionName","UniqueSectionTitle","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","versionMetadata","formDefinitionV2Schema","V2","UniquePageId","UniquePagePath","UniqueListId","UniqueListName","UniqueListTitle","UniqueConditionId","UniqueConditionDisplayName","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import JoiDate from '@joi/date'\nimport JoiBase, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.js'\nimport { ConditionType, OperatorName } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionGroupDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData,\n type RelativeDateValueDataV2\n} from '~/src/conditions/types.js'\nimport {\n SchemaVersion,\n type ConditionWrapper,\n type ConditionWrapperV2,\n type Event,\n type EventOptions,\n type Events,\n type FormDefinition,\n type Item,\n type Link,\n type List,\n type Page,\n type PhaseBanner,\n type Repeat,\n type RepeatOptions,\n type RepeatSchema,\n type Section\n} from '~/src/form/form-definition/types.js'\nimport { checkErrors } from '~/src/form/form-manager/errors.js'\nimport { FormDefinitionError } from '~/src/form/form-manager/types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst Joi = JoiBase.extend(JoiDate) as JoiBase.Root\n\nconst idSchemaOptional = Joi.string().uuid()\n\nconst idSchema = idSchemaOptional.default(() => uuidV4())\n\nconst conditionIdRef = Joi.ref('/conditions', {\n in: true,\n adjust: (conditions: ConditionWrapperV2[]) =>\n conditions.map((condition) => condition.id)\n})\n\nconst componentIdRefSchema = Joi.ref('/pages', {\n in: true,\n adjust: (pages: Page[]) =>\n pages.flatMap((page) =>\n hasComponents(page)\n ? page.components\n .filter((component) => component.id)\n .map((component) => component.id)\n : []\n )\n})\n\nconst listIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.filter((list) => list.id).map((list) => list.id)\n})\n\nconst listItemIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.flatMap((list) =>\n list.items.filter((item) => item.id).map((item) => item.id)\n )\n})\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable section title displayed to users'),\n hideTitle: Joi.boolean()\n .optional()\n .default(false)\n .description(\n 'When true, the section title will not be displayed in the UI'\n )\n })\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>()\n .description('Field reference used in a condition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the field for display purposes')\n })\n\nconst conditionValueSchema = Joi.object<ConditionValueData>()\n .description('Value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst conditionListItemRefDataSchemaV2 =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n listId: Joi.string()\n .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list')\n .error(checkErrors(FormDefinitionError.RefConditionListId)),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n .error(checkErrors(FormDefinitionError.RefConditionItemId))\n })\n\nconst relativeDateValueDataSchemaV2 = Joi.object<RelativeDateValueDataV2>()\n .description('Relative date specification for date-based conditions')\n .keys({\n period: Joi.number()\n .integer()\n .positive()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .trim()\n .valid('RelativeDate')\n .required()\n .description('Type of the condition value, should be \"RelativeDate\"'),\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n .error(checkErrors(FormDefinitionError.RefConditionConditionId))\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nexport const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n )\n .error(checkErrors(FormDefinitionError.RefConditionComponentId)),\n operator: Joi.string()\n .trim()\n .valid(...Object.values(OperatorName))\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n type: Joi.string()\n .trim()\n .valid(...Object.values(ConditionType))\n .required()\n .description('Type of the condition value'),\n value: Joi.any()\n .required()\n .description('The actual value to compare against')\n .when('type', {\n switch: [\n { is: ConditionType.BooleanValue, then: Joi.boolean() },\n { is: ConditionType.StringValue, then: Joi.string() },\n { is: ConditionType.NumberValue, then: Joi.number() },\n {\n is: ConditionType.DateValue,\n then: Joi.date().format('YYYY-MM-DD').raw()\n },\n {\n is: ConditionType.ListItemRef,\n then: conditionListItemRefDataSchemaV2\n },\n {\n is: ConditionType.RelativeDate,\n then: relativeDateValueDataSchemaV2\n }\n ]\n })\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .when('items', { is: Joi.array().min(2), then: Joi.required() })\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives().conditional('.componentId', {\n is: Joi.exist(),\n then: conditionDataSchemaV2,\n otherwise: conditionRefDataSchemaV2\n })\n )\n .min(1)\n .max(15)\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .required()\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n .error(checkErrors(FormDefinitionError.RefPageComponentList))\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('id')\n .unique('name', { ignoreUndefined: true })\n .min(1)\n .max(2)\n .description('Components allowed on Page Upload schema')\n\n/**\n * `/status` is a special route for providing a user's application status.\n * It should not be configured via the designer.\n */\nexport const pageSchema = Joi.object<Page>()\n .description('Form page definition specifying content and behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the page'),\n path: Joi.string()\n .trim()\n .required()\n .disallow('/status')\n .description(\n 'URL path for this page, must not be the reserved \"/status\" path'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().trim().description('Section this page belongs to'),\n controller: Joi.string()\n .trim()\n .optional()\n .description('Custom controller class name for special page behavior'),\n components: Joi.array<ComponentDef>()\n .items(componentSchema)\n .unique('name')\n .description('UI components displayed on this page'),\n repeat: Joi.when('controller', {\n is: Joi.string().trim().valid('RepeatPageController').required(),\n then: pageRepeatSchema\n .required()\n .description(\n 'Configuration for repeatable pages, required when using RepeatPageController'\n ),\n otherwise: Joi.any().strip()\n }),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional condition that determines if this page is shown'),\n next: Joi.array<Link>()\n .items(nextSchema)\n .default([])\n .description('Possible navigation paths after this page'),\n events: eventsSchema\n .optional()\n .description('Event handlers for page lifecycle events'),\n view: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional custom view template to use for rendering this page'\n )\n })\n\n/**\n * V2 engine schema - used with new editor\n */\nexport const pageSchemaV2 = pageSchema\n .append({\n id: idSchema.description('Unique identifier for the page'),\n title: Joi.string()\n .trim()\n .allow('')\n .required()\n .description(\n 'Page title displayed at the top of the page (with support for empty titles in V2)'\n ),\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('id')\n .unique('name', { ignoreUndefined: true })\n .description('Components schema for V2 forms')\n .error(\n checkErrors([\n FormDefinitionError.UniquePageComponentId,\n FormDefinitionError.UniquePageComponentName\n ])\n )\n }),\n condition: Joi.string()\n .trim()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n .error(checkErrors(FormDefinitionError.RefPageCondition))\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('id')\n .unique('name')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .description('Array of items with string values')\n .error(\n checkErrors([\n FormDefinitionError.UniqueListItemId,\n FormDefinitionError.UniqueListItemText,\n FormDefinitionError.UniqueListItemValue\n ])\n ),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .description('Array of items with numeric values')\n .error(\n checkErrors([\n FormDefinitionError.UniqueListItemId,\n FormDefinitionError.UniqueListItemText,\n FormDefinitionError.UniqueListItemValue\n ])\n )\n })\n })\n\n/**\n * V2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema\n .keys({\n id: idSchema.description('Unique identifier for the list')\n })\n .description('List schema for V2 forms')\n\nconst feedbackSchema = Joi.object<FormDefinition['feedback']>()\n .description('Feedback configuration for the form')\n .keys({\n feedbackForm: Joi.boolean()\n .default(false)\n .description('Whether to show the built-in feedback form'),\n url: Joi.when('feedbackForm', {\n is: Joi.boolean().valid(false),\n then: Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'URL to an external feedback form when not using built-in feedback'\n )\n }),\n emailAddress: Joi.string()\n .trim()\n .email({\n tlds: {\n allow: false\n }\n })\n .optional()\n .description('Email address where feedback is sent')\n })\n\nconst phaseBannerSchema = Joi.object<PhaseBanner>()\n .description('Phase banner configuration showing development status')\n .keys({\n phase: Joi.string()\n .trim()\n .valid('alpha', 'beta')\n .description('Development phase of the service (alpha or beta)')\n })\n\nconst outputSchema = Joi.object<FormDefinition['output']>()\n .description('Configuration for form submission output')\n .keys({\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier for the output format')\n })\n\nconst versionMetadataSchema = Joi.object<FormDefinition['versionMetadata']>()\n .description('Version metadata for the form definition')\n .keys({\n version: Joi.number()\n .integer()\n .positive()\n .required()\n .description('Version number of the form'),\n createdAt: Joi.string()\n .isoDate()\n .required()\n .description('ISO date when this version was created')\n })\n\n/**\n * Joi schema for `FormDefinition` interface\n * @see {@link FormDefinition}\n */\nexport const formDefinitionSchema = Joi.object<FormDefinition>()\n .description('Complete form definition describing all aspects of a form')\n .required()\n .keys({\n engine: Joi.string()\n .trim()\n .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V1)\n .default(SchemaVersion.V1)\n .description('Form schema version to use (1 or 2)'),\n name: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Unique name identifying the form'),\n feedback: feedbackSchema\n .optional()\n .description('Feedback mechanism configuration'),\n startPage: Joi.string()\n .trim()\n .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .items(pageSchema)\n .description('Pages schema for V1 forms')\n .unique('path'),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required()\n .description('Sections grouping related pages together')\n .error(\n checkErrors([\n FormDefinitionError.UniqueSectionName,\n FormDefinitionError.UniqueSectionTitle\n ])\n ),\n conditions: Joi.array<ConditionWrapper>()\n .items(conditionWrapperSchema)\n .unique('name')\n .unique('displayName')\n .description('Named conditions used for form logic'),\n lists: Joi.array<List>()\n .items(listSchema)\n .unique('name')\n .unique('title')\n .description('Reusable lists of options for select components'),\n metadata: Joi.object({ a: Joi.any() })\n .unknown()\n .optional()\n .description('Custom metadata for the form'),\n declaration: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Declaration text shown on the summary page'),\n skipSummary: Joi.any()\n .strip()\n .description('option to skip the summary page'),\n phaseBanner: phaseBannerSchema\n .optional()\n .description('Phase banner configuration'),\n outputEmail: Joi.string()\n .trim()\n .email({ tlds: { allow: ['uk'] } })\n .optional()\n .description('Email address where form submissions are sent'),\n output: outputSchema\n .optional()\n .description('Configuration for submission output format'),\n versionMetadata: versionMetadataSchema\n .optional()\n .description('Version metadata for the form definition')\n })\n\nexport const formDefinitionV2Schema = formDefinitionSchema\n .keys({\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V2)\n .description('Form schema version to use (2)'),\n pages: Joi.array<Page>()\n .items(pageSchemaV2)\n .required()\n .unique('id')\n .unique('path')\n .description('Pages schema for V2 forms')\n .error(\n checkErrors([\n FormDefinitionError.UniquePageId,\n FormDefinitionError.UniquePagePath\n ])\n ),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('id')\n .unique('name')\n .unique('title')\n .description('Lists schema for V2 forms')\n .error(\n checkErrors([\n FormDefinitionError.UniqueListId,\n FormDefinitionError.UniqueListName,\n FormDefinitionError.UniqueListTitle\n ])\n ),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('id')\n .unique('displayName')\n .description('Named conditions used for form logic')\n .error(\n checkErrors([\n FormDefinitionError.UniqueConditionId,\n FormDefinitionError.UniqueConditionDisplayName\n ])\n )\n })\n .description('Form definition schema for V2')\n\n// Maintain compatibility with legacy named export\n// E.g. `import { Schema } from '@defra/forms-model'`\nexport const Schema = formDefinitionSchema\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,WAAW;AAC/B,OAAOC,OAAO,MAAiC,KAAK;AACpD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAMtB,SAASC,aAAa,EAAEC,YAAY;AAepC,SACEC,aAAa;AAiBf,SAASC,WAAW;AACpB,SAASC,mBAAmB;AAC5B,SAASC,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C4F,KAAK,CAAqB,CAAC,CACxClE,KAAK,CAACuE,wBAAwB,CAAC,CAC/B+C,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrBlH,WAAW,CAAC,sCAAsC,CAAC,CACnDqB,KAAK,CACJvD,WAAW,CAAC,CACVC,mBAAmB,CAACkN,iBAAiB,EACrClN,mBAAmB,CAACmN,0BAA0B,CAC/C,CACH;AACJ,CAAC,CAAC,CACDlL,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAMmL,MAAM,GAAGzB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["JoiDate","JoiBase","v4","uuidV4","ComponentType","ConditionType","OperatorName","SchemaVersion","checkErrors","FormDefinitionError","ControllerType","hasComponents","Joi","extend","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","id","componentIdRefSchema","pages","flatMap","page","components","filter","component","listIdRef","lists","list","listItemIdRef","items","item","sectionsSchema","object","description","keys","name","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","valid","error","RefConditionListId","itemId","RefConditionItemId","relativeDateValueDataSchemaV2","period","number","integer","positive","unit","direction","relativeDateValueDataSchema","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionRefDataSchemaV2","conditionId","RefConditionConditionId","conditionSchema","field","operator","alternatives","try","conditionDataSchemaV2","componentId","RefConditionComponentId","Object","values","any","switch","BooleanValue","StringValue","NumberValue","DateValue","date","format","raw","ListItemRef","RelativeDate","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","min","conditional","otherwise","max","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","allow","hint","options","rows","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","length","componentSchemaV2","RefPageComponentList","componentPayloadSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","ignoreUndefined","pageSchema","disallow","section","controller","repeat","strip","next","events","view","pageSchemaV2","append","FileUpload","UniquePageComponentId","UniquePageComponentName","RefPageCondition","pagePayloadSchemaV2","baseListItemSchema","text","stringListItemSchema","numberListItemSchema","listSchema","UniqueListItemId","UniqueListItemText","UniqueListItemValue","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","V1","feedback","startPage","sections","UniqueSectionName","UniqueSectionTitle","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","formDefinitionV2Schema","V2","UniquePageId","UniquePagePath","UniqueListId","UniqueListName","UniqueListTitle","UniqueConditionId","UniqueConditionDisplayName","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import JoiDate from '@joi/date'\nimport JoiBase, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.js'\nimport { ConditionType, OperatorName } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionGroupDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData,\n type RelativeDateValueDataV2\n} from '~/src/conditions/types.js'\nimport {\n SchemaVersion,\n type ConditionWrapper,\n type ConditionWrapperV2,\n type Event,\n type EventOptions,\n type Events,\n type FormDefinition,\n type Item,\n type Link,\n type List,\n type Page,\n type PhaseBanner,\n type Repeat,\n type RepeatOptions,\n type RepeatSchema,\n type Section\n} from '~/src/form/form-definition/types.js'\nimport { checkErrors } from '~/src/form/form-manager/errors.js'\nimport { FormDefinitionError } from '~/src/form/form-manager/types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\n\nconst Joi = JoiBase.extend(JoiDate) as JoiBase.Root\n\nconst idSchemaOptional = Joi.string().uuid()\n\nconst idSchema = idSchemaOptional.default(() => uuidV4())\n\nconst conditionIdRef = Joi.ref('/conditions', {\n in: true,\n adjust: (conditions: ConditionWrapperV2[]) =>\n conditions.map((condition) => condition.id)\n})\n\nconst componentIdRefSchema = Joi.ref('/pages', {\n in: true,\n adjust: (pages: Page[]) =>\n pages.flatMap((page) =>\n hasComponents(page)\n ? page.components\n .filter((component) => component.id)\n .map((component) => component.id)\n : []\n )\n})\n\nconst listIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.filter((list) => list.id).map((list) => list.id)\n})\n\nconst listItemIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.flatMap((list) =>\n list.items.filter((item) => item.id).map((item) => item.id)\n )\n})\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable section title displayed to users'),\n hideTitle: Joi.boolean()\n .optional()\n .default(false)\n .description(\n 'When true, the section title will not be displayed in the UI'\n )\n })\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>()\n .description('Field reference used in a condition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the field for display purposes')\n })\n\nconst conditionValueSchema = Joi.object<ConditionValueData>()\n .description('Value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst conditionListItemRefDataSchemaV2 =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n listId: Joi.string()\n .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list')\n .error(checkErrors(FormDefinitionError.RefConditionListId)),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n .error(checkErrors(FormDefinitionError.RefConditionItemId))\n })\n\nconst relativeDateValueDataSchemaV2 = Joi.object<RelativeDateValueDataV2>()\n .description('Relative date specification for date-based conditions')\n .keys({\n period: Joi.number()\n .integer()\n .positive()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .trim()\n .valid('RelativeDate')\n .required()\n .description('Type of the condition value, should be \"RelativeDate\"'),\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n .error(checkErrors(FormDefinitionError.RefConditionConditionId))\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nexport const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n )\n .error(checkErrors(FormDefinitionError.RefConditionComponentId)),\n operator: Joi.string()\n .trim()\n .valid(...Object.values(OperatorName))\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n type: Joi.string()\n .trim()\n .valid(...Object.values(ConditionType))\n .required()\n .description('Type of the condition value'),\n value: Joi.any()\n .required()\n .description('The actual value to compare against')\n .when('type', {\n switch: [\n { is: ConditionType.BooleanValue, then: Joi.boolean() },\n { is: ConditionType.StringValue, then: Joi.string() },\n { is: ConditionType.NumberValue, then: Joi.number() },\n {\n is: ConditionType.DateValue,\n then: Joi.date().format('YYYY-MM-DD').raw()\n },\n {\n is: ConditionType.ListItemRef,\n then: conditionListItemRefDataSchemaV2\n },\n {\n is: ConditionType.RelativeDate,\n then: relativeDateValueDataSchemaV2\n }\n ]\n })\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .when('items', { is: Joi.array().min(2), then: Joi.required() })\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives().conditional('.componentId', {\n is: Joi.exist(),\n then: conditionDataSchemaV2,\n otherwise: conditionRefDataSchemaV2\n })\n )\n .min(1)\n .max(15)\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .required()\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n .error(checkErrors(FormDefinitionError.RefPageComponentList))\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('id')\n .unique('name', { ignoreUndefined: true })\n .min(1)\n .max(2)\n .description('Components allowed on Page Upload schema')\n\n/**\n * `/status` is a special route for providing a user's application status.\n * It should not be configured via the designer.\n */\nexport const pageSchema = Joi.object<Page>()\n .description('Form page definition specifying content and behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the page'),\n path: Joi.string()\n .trim()\n .required()\n .disallow('/status')\n .description(\n 'URL path for this page, must not be the reserved \"/status\" path'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().trim().description('Section this page belongs to'),\n controller: Joi.string()\n .trim()\n .optional()\n .description('Custom controller class name for special page behavior'),\n components: Joi.array<ComponentDef>()\n .items(componentSchema)\n .unique('name')\n .description('UI components displayed on this page'),\n repeat: Joi.when('controller', {\n is: Joi.string().trim().valid('RepeatPageController').required(),\n then: pageRepeatSchema\n .required()\n .description(\n 'Configuration for repeatable pages, required when using RepeatPageController'\n ),\n otherwise: Joi.any().strip()\n }),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional condition that determines if this page is shown'),\n next: Joi.array<Link>()\n .items(nextSchema)\n .default([])\n .description('Possible navigation paths after this page'),\n events: eventsSchema\n .optional()\n .description('Event handlers for page lifecycle events'),\n view: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional custom view template to use for rendering this page'\n )\n })\n\n/**\n * V2 engine schema - used with new editor\n */\nexport const pageSchemaV2 = pageSchema\n .append({\n id: idSchema.description('Unique identifier for the page'),\n title: Joi.string()\n .trim()\n .allow('')\n .required()\n .description(\n 'Page title displayed at the top of the page (with support for empty titles in V2)'\n ),\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('id')\n .unique('name', { ignoreUndefined: true })\n .description('Components schema for V2 forms')\n .error(\n checkErrors([\n FormDefinitionError.UniquePageComponentId,\n FormDefinitionError.UniquePageComponentName\n ])\n )\n }),\n condition: Joi.string()\n .trim()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n .error(checkErrors(FormDefinitionError.RefPageCondition))\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('id')\n .unique('name')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .description('Array of items with string values')\n .error(\n checkErrors([\n FormDefinitionError.UniqueListItemId,\n FormDefinitionError.UniqueListItemText,\n FormDefinitionError.UniqueListItemValue\n ])\n ),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('id')\n .unique('text')\n .unique('value')\n .description('Array of items with numeric values')\n .error(\n checkErrors([\n FormDefinitionError.UniqueListItemId,\n FormDefinitionError.UniqueListItemText,\n FormDefinitionError.UniqueListItemValue\n ])\n )\n })\n })\n\n/**\n * V2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema\n .keys({\n id: idSchema.description('Unique identifier for the list')\n })\n .description('List schema for V2 forms')\n\nconst feedbackSchema = Joi.object<FormDefinition['feedback']>()\n .description('Feedback configuration for the form')\n .keys({\n feedbackForm: Joi.boolean()\n .default(false)\n .description('Whether to show the built-in feedback form'),\n url: Joi.when('feedbackForm', {\n is: Joi.boolean().valid(false),\n then: Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'URL to an external feedback form when not using built-in feedback'\n )\n }),\n emailAddress: Joi.string()\n .trim()\n .email({\n tlds: {\n allow: false\n }\n })\n .optional()\n .description('Email address where feedback is sent')\n })\n\nconst phaseBannerSchema = Joi.object<PhaseBanner>()\n .description('Phase banner configuration showing development status')\n .keys({\n phase: Joi.string()\n .trim()\n .valid('alpha', 'beta')\n .description('Development phase of the service (alpha or beta)')\n })\n\nconst outputSchema = Joi.object<FormDefinition['output']>()\n .description('Configuration for form submission output')\n .keys({\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier for the output format')\n })\n\n/**\n * Joi schema for `FormDefinition` interface\n * @see {@link FormDefinition}\n */\nexport const formDefinitionSchema = Joi.object<FormDefinition>()\n .description('Complete form definition describing all aspects of a form')\n .required()\n .keys({\n engine: Joi.string()\n .trim()\n .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V1)\n .default(SchemaVersion.V1)\n .description('Form schema version to use (1 or 2)'),\n name: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Unique name identifying the form'),\n feedback: feedbackSchema\n .optional()\n .description('Feedback mechanism configuration'),\n startPage: Joi.string()\n .trim()\n .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .items(pageSchema)\n .description('Pages schema for V1 forms')\n .unique('path'),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required()\n .description('Sections grouping related pages together')\n .error(\n checkErrors([\n FormDefinitionError.UniqueSectionName,\n FormDefinitionError.UniqueSectionTitle\n ])\n ),\n conditions: Joi.array<ConditionWrapper>()\n .items(conditionWrapperSchema)\n .unique('name')\n .unique('displayName')\n .description('Named conditions used for form logic'),\n lists: Joi.array<List>()\n .items(listSchema)\n .unique('name')\n .unique('title')\n .description('Reusable lists of options for select components'),\n metadata: Joi.object({ a: Joi.any() })\n .unknown()\n .optional()\n .description('Custom metadata for the form'),\n declaration: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Declaration text shown on the summary page'),\n skipSummary: Joi.any()\n .strip()\n .description('option to skip the summary page'),\n phaseBanner: phaseBannerSchema\n .optional()\n .description('Phase banner configuration'),\n outputEmail: Joi.string()\n .trim()\n .email({ tlds: { allow: ['uk'] } })\n .optional()\n .description('Email address where form submissions are sent'),\n output: outputSchema\n .optional()\n .description('Configuration for submission output format')\n })\n\nexport const formDefinitionV2Schema = formDefinitionSchema\n .keys({\n schema: Joi.number()\n .integer()\n .valid(SchemaVersion.V2)\n .description('Form schema version to use (2)'),\n pages: Joi.array<Page>()\n .items(pageSchemaV2)\n .required()\n .unique('id')\n .unique('path')\n .description('Pages schema for V2 forms')\n .error(\n checkErrors([\n FormDefinitionError.UniquePageId,\n FormDefinitionError.UniquePagePath\n ])\n ),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('id')\n .unique('name')\n .unique('title')\n .description('Lists schema for V2 forms')\n .error(\n checkErrors([\n FormDefinitionError.UniqueListId,\n FormDefinitionError.UniqueListName,\n FormDefinitionError.UniqueListTitle\n ])\n ),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('id')\n .unique('displayName')\n .description('Named conditions used for form logic')\n .error(\n checkErrors([\n FormDefinitionError.UniqueConditionId,\n FormDefinitionError.UniqueConditionDisplayName\n ])\n )\n })\n .description('Form definition schema for V2')\n\n// Maintain compatibility with legacy named export\n// E.g. `import { Schema } from '@defra/forms-model'`\nexport const Schema = formDefinitionSchema\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,WAAW;AAC/B,OAAOC,OAAO,MAAiC,KAAK;AACpD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAMtB,SAASC,aAAa,EAAEC,YAAY;AAepC,SACEC,aAAa;AAiBf,SAASC,WAAW;AACpB,SAASC,mBAAmB;AAC5B,SAASC,cAAc;AACvB,SAASC,aAAa;AAEtB,MAAMC,GAAG,GAAGX,OAAO,CAACY,MAAM,CAACb,OAAO,CAAiB;AAEnD,MAAMc,gBAAgB,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC;AAE5C,MAAMC,QAAQ,GAAGH,gBAAgB,CAACI,OAAO,CAAC,MAAMf,MAAM,CAAC,CAAC,CAAC;AAEzD,MAAMgB,cAAc,GAAGP,GAAG,CAACQ,GAAG,CAAC,aAAa,EAAE;EAC5CC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAGC,UAAgC,IACvCA,UAAU,CAACC,GAAG,CAAEC,SAAS,IAAKA,SAAS,CAACC,EAAE;AAC9C,CAAC,CAAC;AAEF,MAAMC,oBAAoB,GAAGf,GAAG,CAACQ,GAAG,CAAC,QAAQ,EAAE;EAC7CC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAGM,KAAa,IACpBA,KAAK,CAACC,OAAO,CAAEC,IAAI,IACjBnB,aAAa,CAACmB,IAAI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AC6M,eAAe,CACpC,CACH,CAAC;EACH/L,UAAU,EAAEX,GAAG,CAAC4F,KAAK,CAAqB,CAAC,CACxClE,KAAK,CAACuE,wBAAwB,CAAC,CAC/B+C,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrBlH,WAAW,CAAC,sCAAsC,CAAC,CACnDqB,KAAK,CACJvD,WAAW,CAAC,CACVC,mBAAmB,CAAC8M,iBAAiB,EACrC9M,mBAAmB,CAAC+M,0BAA0B,CAC/C,CACH;AACJ,CAAC,CAAC,CACD9K,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM+K,MAAM,GAAGxB,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["Engine","SchemaVersion"],"sources":["../../../../src/form/form-definition/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Coordinator } from '~/src/conditions/enums.js'\nimport {\n type ConditionGroupDataV2,\n type ConditionsModelData\n} from '~/src/conditions/types.js'\nimport { type ControllerPath, type ControllerType } from '~/src/pages/enums.js'\n\nexport enum Engine {\n V1 = 'V1',\n V2 = 'V2'\n}\n\nexport enum SchemaVersion {\n V1 = 1,\n V2 = 2\n}\n\nexport interface Link {\n path: string\n condition?: string\n redirect?: string\n}\n\nexport interface EventOptions {\n method: string\n url: string\n}\n\nexport interface Event {\n type: string\n options: EventOptions\n}\n\nexport interface Events {\n onLoad?: Event\n onSave?: Event\n}\n\nexport interface PageBase {\n id?: string\n title: string\n path: string\n condition?: string\n events?: Events\n view?: string\n}\n\nexport interface RepeatOptions {\n name: string\n title: string\n}\n\nexport interface RepeatSchema {\n min: number\n max: number\n}\n\nexport interface Repeat {\n options: RepeatOptions\n schema: RepeatSchema\n}\n\nexport interface PageStart extends PageBase {\n path: ControllerPath.Start | string\n controller: ControllerType.Start\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageQuestion extends PageBase {\n controller?: ControllerType.Page\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageTerminal extends PageBase {\n controller?: ControllerType.Terminal\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageRepeat extends PageBase {\n controller: ControllerType.Repeat\n repeat: Repeat\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageFileUpload extends PageBase {\n controller: ControllerType.FileUpload\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageSummary extends PageBase {\n path: ControllerPath.Summary | string\n controller: ControllerType.Summary\n section?: undefined\n components?: ComponentDef[]\n}\n\nexport interface PageStatus extends PageBase {\n path: ControllerPath.Status | string\n controller: ControllerType.Status\n section?: undefined\n}\n\nexport type Page =\n | PageStart\n | PageQuestion\n | PageTerminal\n | PageFileUpload\n | PageRepeat\n | PageSummary\n | PageStatus\n\nexport interface Section {\n name: string\n title: string\n hideTitle?: boolean\n}\n\nexport interface Item {\n id?: string\n text: string\n value: string | number | boolean\n description?: string\n conditional?: { components: ComponentDef[] }\n condition?: string\n hint?: {\n id?: string\n text: string\n }\n}\n\nexport interface List {\n id?: string\n name: string\n title: string\n type: ListTypeContent\n items: Item[]\n}\n\nexport type ListTypeOption = 'bulleted' | 'numbered'\nexport type ListTypeContent = 'string' | 'number' | 'boolean'\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport interface PhaseBanner {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport interface ConditionWrapper {\n name: string\n displayName: string\n value: ConditionsModelData\n}\n\nexport interface ConditionWrapperV2 {\n id: string\n displayName: string\n coordinator?: Coordinator\n items: ConditionGroupDataV2\n}\n\nexport interface FormVersionMetadata {\n version: number\n createdAt: string\n}\n\n/**\n * Interface for `formDefinitionSchema` Joi schema\n */\nexport interface FormDefinition {\n engine?: Engine\n schema?: SchemaVersion\n pages: Page[]\n conditions: (ConditionWrapper | ConditionWrapperV2)[]\n lists: List[]\n sections: Section[]\n startPage?: string\n name?: string\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n declaration?: string // Deprecated in v2\n skipSummary?: never\n metadata?: Record<string, unknown>\n outputEmail?: string\n output?: {\n audience: 'human' | 'machine'\n version: string\n }\n versionMetadata?: FormVersionMetadata\n}\n"],"mappings":"AAQA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAKlB,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;;AAwKzB;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["Engine","SchemaVersion"],"sources":["../../../../src/form/form-definition/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Coordinator } from '~/src/conditions/enums.js'\nimport {\n type ConditionGroupDataV2,\n type ConditionsModelData\n} from '~/src/conditions/types.js'\nimport { type ControllerPath, type ControllerType } from '~/src/pages/enums.js'\n\nexport enum Engine {\n V1 = 'V1',\n V2 = 'V2'\n}\n\nexport enum SchemaVersion {\n V1 = 1,\n V2 = 2\n}\n\nexport interface Link {\n path: string\n condition?: string\n redirect?: string\n}\n\nexport interface EventOptions {\n method: string\n url: string\n}\n\nexport interface Event {\n type: string\n options: EventOptions\n}\n\nexport interface Events {\n onLoad?: Event\n onSave?: Event\n}\n\nexport interface PageBase {\n id?: string\n title: string\n path: string\n condition?: string\n events?: Events\n view?: string\n}\n\nexport interface RepeatOptions {\n name: string\n title: string\n}\n\nexport interface RepeatSchema {\n min: number\n max: number\n}\n\nexport interface Repeat {\n options: RepeatOptions\n schema: RepeatSchema\n}\n\nexport interface PageStart extends PageBase {\n path: ControllerPath.Start | string\n controller: ControllerType.Start\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageQuestion extends PageBase {\n controller?: ControllerType.Page\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageTerminal extends PageBase {\n controller?: ControllerType.Terminal\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageRepeat extends PageBase {\n controller: ControllerType.Repeat\n repeat: Repeat\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageFileUpload extends PageBase {\n controller: ControllerType.FileUpload\n section?: string | undefined\n next: Link[]\n components: ComponentDef[]\n}\n\nexport interface PageSummary extends PageBase {\n path: ControllerPath.Summary | string\n controller: ControllerType.Summary\n section?: undefined\n components?: ComponentDef[]\n}\n\nexport interface PageStatus extends PageBase {\n path: ControllerPath.Status | string\n controller: ControllerType.Status\n section?: undefined\n}\n\nexport type Page =\n | PageStart\n | PageQuestion\n | PageTerminal\n | PageFileUpload\n | PageRepeat\n | PageSummary\n | PageStatus\n\nexport interface Section {\n name: string\n title: string\n hideTitle?: boolean\n}\n\nexport interface Item {\n id?: string\n text: string\n value: string | number | boolean\n description?: string\n conditional?: { components: ComponentDef[] }\n condition?: string\n hint?: {\n id?: string\n text: string\n }\n}\n\nexport interface List {\n id?: string\n name: string\n title: string\n type: ListTypeContent\n items: Item[]\n}\n\nexport type ListTypeOption = 'bulleted' | 'numbered'\nexport type ListTypeContent = 'string' | 'number' | 'boolean'\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport interface PhaseBanner {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport interface ConditionWrapper {\n name: string\n displayName: string\n value: ConditionsModelData\n}\n\nexport interface ConditionWrapperV2 {\n id: string\n displayName: string\n coordinator?: Coordinator\n items: ConditionGroupDataV2\n}\n\n/**\n * Interface for `formDefinitionSchema` Joi schema\n */\nexport interface FormDefinition {\n engine?: Engine\n schema?: SchemaVersion\n pages: Page[]\n conditions: (ConditionWrapper | ConditionWrapperV2)[]\n lists: List[]\n sections: Section[]\n startPage?: string\n name?: string\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n declaration?: string // Deprecated in v2\n skipSummary?: never\n metadata?: Record<string, unknown>\n outputEmail?: string\n output?: {\n audience: 'human' | 'machine'\n version: string\n }\n}\n"],"mappings":"AAQA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAKlB,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;;AAmKzB;AACA;AACA","ignoreList":[]}
@@ -77,6 +77,15 @@ export const formMetadataStateSchema = Joi.object().keys({
77
77
  updatedBy: formMetadataAuthorSchema.description('Who last updated this version')
78
78
  }).description('Metadata about a specific version state (draft or live)');
79
79
 
80
+ /**
81
+ * Joi schema for `FormVersionMetadata` interface
82
+ * @see {@link FormVersionMetadata}
83
+ */
84
+ export const formVersionMetadataSchema = Joi.object().keys({
85
+ versionNumber: Joi.number().integer().min(1).required().description('The version number'),
86
+ createdAt: authoredAtSchema.description('When this version was created')
87
+ }).description('Metadata for a specific version of the form');
88
+
80
89
  /**
81
90
  * Joi schema for `FormMetadata` interface
82
91
  * @see {@link FormMetadata}
@@ -89,6 +98,7 @@ export const formMetadataSchema = formMetadataInputSchema.append({
89
98
  createdAt: authoredAtSchema.description('When the form was first created'),
90
99
  createdBy: formMetadataAuthorSchema.description('Who created the form'),
91
100
  updatedAt: authoredAtSchema.description('When the form was last updated'),
92
- updatedBy: formMetadataAuthorSchema.description('Who last updated the form')
101
+ updatedBy: formMetadataAuthorSchema.description('Who last updated the form'),
102
+ versions: Joi.array().items(formVersionMetadataSchema).optional().description('Version history for the form')
93
103
  }).description('Complete metadata for a form, including version information and authoring details');
94
104
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","description","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","phoneSchema","emailAddressSchema","emailResponseTimeSchema","emailSchema","object","keys","address","responseTime","onlineUrlSchema","uri","scheme","onlineTextSchema","onlineSchema","url","text","contactSchema","phone","online","submissionGuidanceSchema","privacyNoticeUrlSchema","notificationEmailAddressSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeUrl","notificationEmail","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formMetadataSchema","append","slug","draft","live"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string()\n .hex()\n .length(24)\n .required()\n .description(\n 'Unique identifier for the form, 24-character hexadecimal string'\n )\n\nexport const titleSchema = Joi.string()\n .max(250)\n .trim()\n .required()\n .description('Title of the form, displayed to users')\n\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n .description('URL-friendly identifier used in form paths')\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n .description('Defra organisation responsible for the form')\n\nexport const teamNameSchema = Joi.string()\n .max(100)\n .trim()\n .required()\n .description('Name of the team responsible for the form')\n\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n .description('Contact email for the team responsible for the form')\n\nexport const phoneSchema = Joi.string()\n .trim()\n .description('Phone number for form-related inquiries')\n\nexport const emailAddressSchema = Joi.string()\n .email()\n .trim()\n .required()\n .description('Email address for form-related inquiries')\n\nexport const emailResponseTimeSchema = Joi.string()\n .trim()\n .required()\n .description('Expected response time for email inquiries')\n\nexport const emailSchema = Joi.object<FormMetadataContactEmail>()\n .keys({\n address: emailAddressSchema,\n responseTime: emailResponseTimeSchema\n })\n .description('Email contact details including response expectations')\n\nexport const onlineUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .required()\n .description('URL for online contact method')\n\nexport const onlineTextSchema = Joi.string()\n .trim()\n .required()\n .description('Descriptive text for the online contact link')\n\nexport const onlineSchema = Joi.object<FormMetadataContactOnline>()\n .keys({\n url: onlineUrlSchema,\n text: onlineTextSchema\n })\n .description('Online contact details with URL and descriptive text')\n\nexport const contactSchema = Joi.object<FormMetadataContact>()\n .keys({\n phone: phoneSchema,\n email: emailSchema,\n online: onlineSchema\n })\n .description('Complete contact information for form-related inquiries')\n\nexport const submissionGuidanceSchema = Joi.string()\n .trim()\n .description('Guidance text shown to users when submitting the form')\n\nexport const privacyNoticeUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .description('URL to the privacy notice for this form')\n\nexport const notificationEmailAddressSchema = Joi.string()\n .email()\n .trim()\n .description('Email address to receive form submission notifications')\n\nexport const authoredAtSchema = Joi.date()\n .iso()\n .required()\n .description('ISO format timestamp of when an action occurred')\n\nexport const authorIdSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the author')\n\nexport const authorDisplayNameSchema = Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the author')\n\nexport const formMetadataInputKeys = {\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema,\n contact: contactSchema,\n submissionGuidance: submissionGuidanceSchema,\n privacyNoticeUrl: privacyNoticeUrlSchema,\n notificationEmail: notificationEmailAddressSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n .description('Input data for creating or updating form metadata')\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n .description('Information about the author of a form or form change')\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>()\n .keys({\n createdAt: authoredAtSchema.description(\n 'When this version was first created'\n ),\n createdBy: formMetadataAuthorSchema.description('Who created this version'),\n updatedAt: authoredAtSchema.description(\n 'When this version was last updated'\n ),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated this version'\n )\n })\n .description('Metadata about a specific version state (draft or live)')\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema\n .append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.description(\n 'Metadata for the draft version'\n ),\n live: formMetadataStateSchema.description(\n 'Metadata for the published version'\n ),\n createdAt: authoredAtSchema.description('When the form was first created'),\n createdBy: formMetadataAuthorSchema.description('Who created the form'),\n updatedAt: authoredAtSchema.description('When the form was last updated'),\n updatedBy: formMetadataAuthorSchema.description('Who last updated the form')\n })\n .description(\n 'Complete metadata for a form, including version information and authoring details'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAYrB,OAAO,MAAMC,aAAa,GAAG,CAC3B,uCAAuC,EACvC,mEAAmE,EACnE,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,iBAAiB,EACjB,6BAA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iCAAiC,CAAC;EAC1EuD,SAAS,EAAEL,wBAAwB,CAAClD,WAAW,CAAC,sBAAsB,CAAC;EACvEwD,SAAS,EAAErB,gBAAgB,CAACnC,WAAW,CAAC,gCAAgC,CAAC;EACzEyD,SAAS,EAAEP,wBAAwB,CAAClD,WAAW,CAAC,2BAA2B;AAC7E,CAAC,CAAC,CACDA,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","description","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","phoneSchema","emailAddressSchema","emailResponseTimeSchema","emailSchema","object","keys","address","responseTime","onlineUrlSchema","uri","scheme","onlineTextSchema","onlineSchema","url","text","contactSchema","phone","online","submissionGuidanceSchema","privacyNoticeUrlSchema","notificationEmailAddressSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeUrl","notificationEmail","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formVersionMetadataSchema","versionNumber","number","integer","min","formMetadataSchema","append","slug","draft","live","versions","array","items","optional"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState,\n type FormVersionMetadata\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string()\n .hex()\n .length(24)\n .required()\n .description(\n 'Unique identifier for the form, 24-character hexadecimal string'\n )\n\nexport const titleSchema = Joi.string()\n .max(250)\n .trim()\n .required()\n .description('Title of the form, displayed to users')\n\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n .description('URL-friendly identifier used in form paths')\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n .description('Defra organisation responsible for the form')\n\nexport const teamNameSchema = Joi.string()\n .max(100)\n .trim()\n .required()\n .description('Name of the team responsible for the form')\n\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n .description('Contact email for the team responsible for the form')\n\nexport const phoneSchema = Joi.string()\n .trim()\n .description('Phone number for form-related inquiries')\n\nexport const emailAddressSchema = Joi.string()\n .email()\n .trim()\n .required()\n .description('Email address for form-related inquiries')\n\nexport const emailResponseTimeSchema = Joi.string()\n .trim()\n .required()\n .description('Expected response time for email inquiries')\n\nexport const emailSchema = Joi.object<FormMetadataContactEmail>()\n .keys({\n address: emailAddressSchema,\n responseTime: emailResponseTimeSchema\n })\n .description('Email contact details including response expectations')\n\nexport const onlineUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .required()\n .description('URL for online contact method')\n\nexport const onlineTextSchema = Joi.string()\n .trim()\n .required()\n .description('Descriptive text for the online contact link')\n\nexport const onlineSchema = Joi.object<FormMetadataContactOnline>()\n .keys({\n url: onlineUrlSchema,\n text: onlineTextSchema\n })\n .description('Online contact details with URL and descriptive text')\n\nexport const contactSchema = Joi.object<FormMetadataContact>()\n .keys({\n phone: phoneSchema,\n email: emailSchema,\n online: onlineSchema\n })\n .description('Complete contact information for form-related inquiries')\n\nexport const submissionGuidanceSchema = Joi.string()\n .trim()\n .description('Guidance text shown to users when submitting the form')\n\nexport const privacyNoticeUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .description('URL to the privacy notice for this form')\n\nexport const notificationEmailAddressSchema = Joi.string()\n .email()\n .trim()\n .description('Email address to receive form submission notifications')\n\nexport const authoredAtSchema = Joi.date()\n .iso()\n .required()\n .description('ISO format timestamp of when an action occurred')\n\nexport const authorIdSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the author')\n\nexport const authorDisplayNameSchema = Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the author')\n\nexport const formMetadataInputKeys = {\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema,\n contact: contactSchema,\n submissionGuidance: submissionGuidanceSchema,\n privacyNoticeUrl: privacyNoticeUrlSchema,\n notificationEmail: notificationEmailAddressSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n .description('Input data for creating or updating form metadata')\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n .description('Information about the author of a form or form change')\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>()\n .keys({\n createdAt: authoredAtSchema.description(\n 'When this version was first created'\n ),\n createdBy: formMetadataAuthorSchema.description('Who created this version'),\n updatedAt: authoredAtSchema.description(\n 'When this version was last updated'\n ),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated this version'\n )\n })\n .description('Metadata about a specific version state (draft or live)')\n\n/**\n * Joi schema for `FormVersionMetadata` interface\n * @see {@link FormVersionMetadata}\n */\nexport const formVersionMetadataSchema = Joi.object<FormVersionMetadata>()\n .keys({\n versionNumber: Joi.number()\n .integer()\n .min(1)\n .required()\n .description('The version number'),\n createdAt: authoredAtSchema.description('When this version was created')\n })\n .description('Metadata for a specific version of the form')\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema\n .append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.description(\n 'Metadata for the draft version'\n ),\n live: formMetadataStateSchema.description(\n 'Metadata for the published version'\n ),\n createdAt: authoredAtSchema.description('When the form was first created'),\n createdBy: formMetadataAuthorSchema.description('Who created the form'),\n updatedAt: authoredAtSchema.description('When the form was last updated'),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated the form'\n ),\n versions: Joi.array()\n .items(formVersionMetadataSchema)\n .optional()\n .description('Version history for the form')\n })\n .description(\n 'Complete metadata for a form, including version information and authoring details'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAarB,OAAO,MAAMC,aAAa,GAAG,CAC3B,uCAAuC,EACvC,mEAAmE,EACnE,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,iBAAiB,EACjB,6BAA6B,EAC7B,wCAAwC,CACzC;AAED,OAAO,MAAMC,QAAQ,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CACjCC,GAAG,CAAC,CAAC,CACLC,MAAM,CAAC,EAAE,CAAC,CACVC,QAAQ,CAAC,CAAC,CACVC,WAAW,CACV,iEACF,CAAC;AAEH,OAAO,MAAMC,WAAW,GAAGR,GAAG,CAACG,MAAM,CAAC,CAAC,CACpCM,GAAG,CAAC,GAAG,CAAC,CACRC,IAAI,CAAC,CAAC,CACNJ,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,uCAAuC,CAAC;AAEvD,OAAO,MAAMI,UAAU,GAAGX,GAAG,CAACG,MAAM,CAAC,CAAC,CACnCS,OAAO,CAAC,cAAc,EAAE;EAAEC,IAAI,EAAE;AAAoC,CAAC,CAAC,CACtEP,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,4CAA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BAAwB,CAAClD,WAAW,CAC7C,2BACF,CAAC;EACDoE,QAAQ,EAAE3E,GAAG,CAAC4E,KAAK,CAAC,CAAC,CAClBC,KAAK,CAACZ,yBAAyB,CAAC,CAChCa,QAAQ,CAAC,CAAC,CACVvE,WAAW,CAAC,8BAA8B;AAC/C,CAAC,CAAC,CACDA,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for email contact details\n */\nexport interface FormMetadataContactEmail {\n /**\n * The email address details for support\n */\n address: string\n\n /**\n * How long it takes to receive a support response\n */\n responseTime: string\n}\n\n/**\n * Interface for online contact details\n */\nexport interface FormMetadataContactOnline {\n /**\n * The url of the online contact link\n */\n url: string\n\n /**\n * The text of the online contact link\n */\n text: string\n}\n\n/**\n * Interface for contact details (phone, email and online)\n */\nexport interface FormMetadataContact {\n /**\n * The phone details for support\n */\n phone?: string\n\n /**\n * The email details for support\n */\n email?: FormMetadataContactEmail\n\n /**\n * The online details for support\n */\n online?: FormMetadataContactOnline\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n /**\n * The contact details of the form\n */\n contact?: FormMetadataContact\n\n /**\n * The guidance text displayed on the form submitted page\n */\n submissionGuidance?: string\n\n /**\n * The url of the privacy notice\n */\n privacyNoticeUrl?: string\n\n /**\n * Email address where form responses are sent\n */\n notificationEmail?: string\n\n /**\n * The draft state of the form\n */\n draft?: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n\n /**\n * The author who created the form\n */\n createdBy: FormMetadataState['createdBy']\n\n /**\n * The date the form was created\n */\n createdAt: FormMetadataState['createdAt']\n\n /**\n * The author who last updated the form\n */\n updatedBy: FormMetadataState['updatedBy']\n\n /**\n * The date the form was last updated\n */\n updatedAt: FormMetadataState['updatedAt']\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {\n pageId: string\n}\nexport type FormByIDAndPageByIdAndComponentByIdInput = Pick<\n FormMetadata,\n 'id'\n> & {\n pageId: string\n componentId: string\n}\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Pick<\n FormMetadata,\n | 'title'\n | 'organisation'\n | 'teamName'\n | 'teamEmail'\n | 'contact'\n | 'submissionGuidance'\n | 'privacyNoticeUrl'\n | 'notificationEmail'\n>\n\nexport interface FormResponse {\n id: FormMetadata['id']\n slug: FormMetadata['slug']\n status: string\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for email contact details\n */\nexport interface FormMetadataContactEmail {\n /**\n * The email address details for support\n */\n address: string\n\n /**\n * How long it takes to receive a support response\n */\n responseTime: string\n}\n\n/**\n * Interface for online contact details\n */\nexport interface FormMetadataContactOnline {\n /**\n * The url of the online contact link\n */\n url: string\n\n /**\n * The text of the online contact link\n */\n text: string\n}\n\n/**\n * Interface for version metadata stored in form metadata\n */\nexport interface FormVersionMetadata {\n /**\n * The version number\n */\n versionNumber: number\n\n /**\n * When this version was created\n */\n createdAt: Date\n}\n\n/**\n * Interface for contact details (phone, email and online)\n */\nexport interface FormMetadataContact {\n /**\n * The phone details for support\n */\n phone?: string\n\n /**\n * The email details for support\n */\n email?: FormMetadataContactEmail\n\n /**\n * The online details for support\n */\n online?: FormMetadataContactOnline\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n /**\n * The contact details of the form\n */\n contact?: FormMetadataContact\n\n /**\n * The guidance text displayed on the form submitted page\n */\n submissionGuidance?: string\n\n /**\n * The url of the privacy notice\n */\n privacyNoticeUrl?: string\n\n /**\n * Email address where form responses are sent\n */\n notificationEmail?: string\n\n /**\n * The draft state of the form\n */\n draft?: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n\n /**\n * The author who created the form\n */\n createdBy: FormMetadataState['createdBy']\n\n /**\n * The date the form was created\n */\n createdAt: FormMetadataState['createdAt']\n\n /**\n * The author who last updated the form\n */\n updatedBy: FormMetadataState['updatedBy']\n\n /**\n * The date the form was last updated\n */\n updatedAt: FormMetadataState['updatedAt']\n\n /**\n * Version history for the form\n */\n versions?: FormVersionMetadata[]\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {\n pageId: string\n}\nexport type FormByIDAndPageByIdAndComponentByIdInput = Pick<\n FormMetadata,\n 'id'\n> & {\n pageId: string\n componentId: string\n}\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Pick<\n FormMetadata,\n | 'title'\n | 'organisation'\n | 'teamName'\n | 'teamEmail'\n | 'contact'\n | 'submissionGuidance'\n | 'privacyNoticeUrl'\n | 'notificationEmail'\n>\n\nexport interface FormResponse {\n id: FormMetadata['id']\n slug: FormMetadata['slug']\n status: string\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/index.ts"],"names":[],"mappings":"AACA,OAAO,OAAkC,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAEL,KAAK,eAAe,EAWrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAET,KAAK,MAAM,EAIZ,MAAM,qCAAqC,CAAA;AA4N5C,eAAO,MAAM,qBAAqB,uCAoD9B,CAAA;AAoDJ,eAAO,MAAM,wBAAwB,0CAyBU,CAAA;AAE/C,eAAO,MAAM,eAAe,oCAmGZ,CA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AAwB,oCASsB,CAAA;AAE3D,eAAO,MAAM,yBAAyB,oCAMpC,CAAA;AAEF,eAAO,MAAM,sBAAsB,oCAUjC,CAAA;AAoDF,eAAO,MAAM,gBAAgB,8BASzB,CAAA;AAyCJ,eAAO,MAAM,0BAA0B,sEAWmB,CAAA;AAE1D;;;GAGG;AACH,eAAO,MAAM,UAAU,4BAmDnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,4BAuCiB,CAAA;AAE1C,eAAO,MAAM,mBAAmB,4BAgBkB,CAAA;AAwDlD,eAAO,MAAM,UAAU,4BA8CnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,4BAIiB,CAAA;AAsD1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,sCA4E7B,CAAA;AAEJ,eAAO,MAAM,sBAAsB,sCA2CY,CAAA;AAI/C,eAAO,MAAM,MAAM,sCAAuB,CAAA"}
@@ -139,10 +139,6 @@ export interface ConditionWrapperV2 {
139
139
  coordinator?: Coordinator;
140
140
  items: ConditionGroupDataV2;
141
141
  }
142
- export interface FormVersionMetadata {
143
- version: number;
144
- createdAt: string;
145
- }
146
142
  /**
147
143
  * Interface for `formDefinitionSchema` Joi schema
148
144
  */
@@ -165,6 +161,5 @@ export interface FormDefinition {
165
161
  audience: 'human' | 'machine';
166
162
  version: string;
167
163
  };
168
- versionMetadata?: FormVersionMetadata;
169
164
  }
170
165
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,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,CAAA;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE;QACP,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;QAC7B,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"}
@@ -1,5 +1,5 @@
1
1
  import Joi from 'joi';
2
- import { type FormMetadata, type FormMetadataAuthor, type FormMetadataContact, type FormMetadataContactEmail, type FormMetadataContactOnline, type FormMetadataInput, type FormMetadataState } from '../../form/form-metadata/types.js';
2
+ import { type FormMetadata, type FormMetadataAuthor, type FormMetadataContact, type FormMetadataContactEmail, type FormMetadataContactOnline, type FormMetadataInput, type FormMetadataState, type FormVersionMetadata } from '../../form/form-metadata/types.js';
3
3
  export declare const organisations: string[];
4
4
  export declare const idSchema: Joi.StringSchema<string>;
5
5
  export declare const titleSchema: Joi.StringSchema<string>;
@@ -46,6 +46,11 @@ export declare const formMetadataAuthorSchema: Joi.ObjectSchema<FormMetadataAuth
46
46
  * @see {@link FormMetadataState}
47
47
  */
48
48
  export declare const formMetadataStateSchema: Joi.ObjectSchema<FormMetadataState>;
49
+ /**
50
+ * Joi schema for `FormVersionMetadata` interface
51
+ * @see {@link FormVersionMetadata}
52
+ */
53
+ export declare const formVersionMetadataSchema: Joi.ObjectSchema<FormVersionMetadata>;
49
54
  /**
50
55
  * Joi schema for `FormMetadata` interface
51
56
  * @see {@link FormMetadata}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,mCAAmC,CAAA;AAE1C,eAAO,MAAM,aAAa,UAUzB,CAAA;AAED,eAAO,MAAM,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,MAAM,yBAAyB,uCASuB,CAAA;AAE7D;;;GAGG;AACH,eAAO,MAAM,kBAAkB,gCAuB5B,CAAA"}
@@ -58,6 +58,19 @@ export interface FormMetadataContactOnline {
58
58
  */
59
59
  text: string;
60
60
  }
61
+ /**
62
+ * Interface for version metadata stored in form metadata
63
+ */
64
+ export interface FormVersionMetadata {
65
+ /**
66
+ * The version number
67
+ */
68
+ versionNumber: number;
69
+ /**
70
+ * When this version was created
71
+ */
72
+ createdAt: Date;
73
+ }
61
74
  /**
62
75
  * Interface for contact details (phone, email and online)
63
76
  */
@@ -144,6 +157,10 @@ export interface FormMetadata {
144
157
  * The date the form was last updated
145
158
  */
146
159
  updatedAt: FormMetadataState['updatedAt'];
160
+ /**
161
+ * Version history for the form
162
+ */
163
+ versions?: FormVersionMetadata[];
147
164
  }
148
165
  export type FormByIdInput = Pick<FormMetadata, 'id'>;
149
166
  export type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;IAE7B;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,GAAG,EAAE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C,YAAY,EAAE,IAAI,CAAC,GAAG;IAChE,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,wCAAwC,GAAG,IAAI,CACzD,YAAY,EACZ,IAAI,CACL,GAAG;IACF,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;AACxD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAC3D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,OAAO,GACP,cAAc,GACd,UAAU,GACV,WAAW,GACX,SAAS,GACT,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,CACtB,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;IACtB,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;IAE7B;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB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AAC,CAAA;IAEzC;;OAEG;IACH,SAAS,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAEzC;;OAEG;IACH,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAA;CACjC;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AACpD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG;IAChE,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,wCAAwC,GAAG,IAAI,CACzD,YAAY,EACZ,IAAI,CACL,GAAG;IACF,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;AACxD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAC3D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,OAAO,GACP,cAAc,GACd,UAAU,GACV,WAAW,GACX,SAAS,GACT,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,CACtB,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;IACtB,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.551",
3
+ "version": "3.0.552",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "types": "dist/types/index.d.ts",
@@ -1324,30 +1324,6 @@
1324
1324
  ],
1325
1325
  "additionalProperties": false,
1326
1326
  "title": "Output"
1327
- },
1328
- "versionMetadata": {
1329
- "type": "object",
1330
- "description": "Version metadata for the form definition",
1331
- "properties": {
1332
- "version": {
1333
- "type": "integer",
1334
- "description": "Version number of the form",
1335
- "exclusiveMinimum": 0,
1336
- "title": "Version"
1337
- },
1338
- "createdAt": {
1339
- "type": "string",
1340
- "description": "ISO date when this version was created",
1341
- "format": "date-time",
1342
- "title": "Created At"
1343
- }
1344
- },
1345
- "required": [
1346
- "version",
1347
- "createdAt"
1348
- ],
1349
- "additionalProperties": false,
1350
- "title": "Version Metadata"
1351
1327
  }
1352
1328
  },
1353
1329
  "required": [
@@ -163,30 +163,6 @@
163
163
  "additionalProperties": false,
164
164
  "title": "Output"
165
165
  },
166
- "versionMetadata": {
167
- "type": "object",
168
- "description": "Version metadata for the form definition",
169
- "properties": {
170
- "version": {
171
- "type": "integer",
172
- "description": "Version number of the form",
173
- "exclusiveMinimum": 0,
174
- "title": "Version"
175
- },
176
- "createdAt": {
177
- "type": "string",
178
- "description": "ISO date when this version was created",
179
- "format": "date-time",
180
- "title": "Created At"
181
- }
182
- },
183
- "required": [
184
- "version",
185
- "createdAt"
186
- ],
187
- "additionalProperties": false,
188
- "title": "Version Metadata"
189
- },
190
166
  "schema": {
191
167
  "description": "Form schema version to use (2)",
192
168
  "const": 2,
@@ -318,6 +318,35 @@
318
318
  ],
319
319
  "additionalProperties": false,
320
320
  "title": "Updated By"
321
+ },
322
+ "versions": {
323
+ "type": "array",
324
+ "description": "Version history for the form",
325
+ "items": {
326
+ "type": "object",
327
+ "description": "Metadata for a specific version of the form",
328
+ "properties": {
329
+ "versionNumber": {
330
+ "type": "integer",
331
+ "description": "The version number",
332
+ "minimum": 1,
333
+ "title": "Version Number"
334
+ },
335
+ "createdAt": {
336
+ "type": "string",
337
+ "description": "When this version was created",
338
+ "format": "date-time",
339
+ "title": "Created At"
340
+ }
341
+ },
342
+ "required": [
343
+ "versionNumber",
344
+ "createdAt"
345
+ ],
346
+ "additionalProperties": false,
347
+ "title": "Versions Item"
348
+ },
349
+ "title": "Versions"
321
350
  }
322
351
  },
323
352
  "required": [
@@ -934,20 +934,6 @@ const outputSchema = Joi.object<FormDefinition['output']>()
934
934
  .description('Version identifier for the output format')
935
935
  })
936
936
 
937
- const versionMetadataSchema = Joi.object<FormDefinition['versionMetadata']>()
938
- .description('Version metadata for the form definition')
939
- .keys({
940
- version: Joi.number()
941
- .integer()
942
- .positive()
943
- .required()
944
- .description('Version number of the form'),
945
- createdAt: Joi.string()
946
- .isoDate()
947
- .required()
948
- .description('ISO date when this version was created')
949
- })
950
-
951
937
  /**
952
938
  * Joi schema for `FormDefinition` interface
953
939
  * @see {@link FormDefinition}
@@ -1027,10 +1013,7 @@ export const formDefinitionSchema = Joi.object<FormDefinition>()
1027
1013
  .description('Email address where form submissions are sent'),
1028
1014
  output: outputSchema
1029
1015
  .optional()
1030
- .description('Configuration for submission output format'),
1031
- versionMetadata: versionMetadataSchema
1032
- .optional()
1033
- .description('Version metadata for the form definition')
1016
+ .description('Configuration for submission output format')
1034
1017
  })
1035
1018
 
1036
1019
  export const formDefinitionV2Schema = formDefinitionSchema
@@ -174,11 +174,6 @@ export interface ConditionWrapperV2 {
174
174
  items: ConditionGroupDataV2
175
175
  }
176
176
 
177
- export interface FormVersionMetadata {
178
- version: number
179
- createdAt: string
180
- }
181
-
182
177
  /**
183
178
  * Interface for `formDefinitionSchema` Joi schema
184
179
  */
@@ -201,5 +196,4 @@ export interface FormDefinition {
201
196
  audience: 'human' | 'machine'
202
197
  version: string
203
198
  }
204
- versionMetadata?: FormVersionMetadata
205
199
  }
@@ -7,7 +7,8 @@ import {
7
7
  type FormMetadataContactEmail,
8
8
  type FormMetadataContactOnline,
9
9
  type FormMetadataInput,
10
- type FormMetadataState
10
+ type FormMetadataState,
11
+ type FormVersionMetadata
11
12
  } from '~/src/form/form-metadata/types.js'
12
13
 
13
14
  export const organisations = [
@@ -190,6 +191,21 @@ export const formMetadataStateSchema = Joi.object<FormMetadataState>()
190
191
  })
191
192
  .description('Metadata about a specific version state (draft or live)')
192
193
 
194
+ /**
195
+ * Joi schema for `FormVersionMetadata` interface
196
+ * @see {@link FormVersionMetadata}
197
+ */
198
+ export const formVersionMetadataSchema = Joi.object<FormVersionMetadata>()
199
+ .keys({
200
+ versionNumber: Joi.number()
201
+ .integer()
202
+ .min(1)
203
+ .required()
204
+ .description('The version number'),
205
+ createdAt: authoredAtSchema.description('When this version was created')
206
+ })
207
+ .description('Metadata for a specific version of the form')
208
+
193
209
  /**
194
210
  * Joi schema for `FormMetadata` interface
195
211
  * @see {@link FormMetadata}
@@ -207,7 +223,13 @@ export const formMetadataSchema = formMetadataInputSchema
207
223
  createdAt: authoredAtSchema.description('When the form was first created'),
208
224
  createdBy: formMetadataAuthorSchema.description('Who created the form'),
209
225
  updatedAt: authoredAtSchema.description('When the form was last updated'),
210
- updatedBy: formMetadataAuthorSchema.description('Who last updated the form')
226
+ updatedBy: formMetadataAuthorSchema.description(
227
+ 'Who last updated the form'
228
+ ),
229
+ versions: Joi.array()
230
+ .items(formVersionMetadataSchema)
231
+ .optional()
232
+ .description('Version history for the form')
211
233
  })
212
234
  .description(
213
235
  'Complete metadata for a form, including version information and authoring details'
@@ -70,6 +70,21 @@ export interface FormMetadataContactOnline {
70
70
  text: string
71
71
  }
72
72
 
73
+ /**
74
+ * Interface for version metadata stored in form metadata
75
+ */
76
+ export interface FormVersionMetadata {
77
+ /**
78
+ * The version number
79
+ */
80
+ versionNumber: number
81
+
82
+ /**
83
+ * When this version was created
84
+ */
85
+ createdAt: Date
86
+ }
87
+
73
88
  /**
74
89
  * Interface for contact details (phone, email and online)
75
90
  */
@@ -173,6 +188,11 @@ export interface FormMetadata {
173
188
  * The date the form was last updated
174
189
  */
175
190
  updatedAt: FormMetadataState['updatedAt']
191
+
192
+ /**
193
+ * Version history for the form
194
+ */
195
+ versions?: FormVersionMetadata[]
176
196
  }
177
197
 
178
198
  export type FormByIdInput = Pick<FormMetadata, 'id'>