@defra/forms-model 3.0.430 → 3.0.431

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.
Files changed (45) hide show
  1. package/README.md +163 -1
  2. package/dist/module/common/pagination/index.js +2 -2
  3. package/dist/module/common/pagination/index.js.map +1 -1
  4. package/dist/module/common/search/index.js +4 -4
  5. package/dist/module/common/search/index.js.map +1 -1
  6. package/dist/module/common/sorting/index.js +2 -2
  7. package/dist/module/common/sorting/index.js.map +1 -1
  8. package/dist/module/form/form-definition/index.js +156 -156
  9. package/dist/module/form/form-definition/index.js.map +1 -1
  10. package/dist/module/form/form-editor/index.js +42 -42
  11. package/dist/module/form/form-editor/index.js.map +1 -1
  12. package/dist/module/form/form-manager/index.js +3 -3
  13. package/dist/module/form/form-manager/index.js.map +1 -1
  14. package/dist/module/form/form-metadata/index.js +34 -34
  15. package/dist/module/form/form-metadata/index.js.map +1 -1
  16. package/dist/module/form/form-submission/index.js +13 -13
  17. package/dist/module/form/form-submission/index.js.map +1 -1
  18. package/dist/module/types/joi-to-json.d.js +2 -0
  19. package/dist/module/types/joi-to-json.d.js.map +1 -0
  20. package/dist/types/common/pagination/index.d.ts.map +1 -1
  21. package/dist/types/common/search/index.d.ts.map +1 -1
  22. package/dist/types/common/sorting/index.d.ts.map +1 -1
  23. package/dist/types/form/form-definition/index.d.ts.map +1 -1
  24. package/dist/types/form/form-editor/index.d.ts +12 -12
  25. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  26. package/dist/types/form/form-manager/index.d.ts.map +1 -1
  27. package/dist/types/form/form-metadata/index.d.ts.map +1 -1
  28. package/dist/types/form/form-submission/index.d.ts.map +1 -1
  29. package/package.json +6 -4
  30. package/scripts/generate-schemas.js +238 -0
  31. package/scripts/schema-modules/constants.js +39 -0
  32. package/scripts/schema-modules/schema-processors.js +109 -0
  33. package/scripts/schema-modules/schema-simplifiers.js +351 -0
  34. package/scripts/schema-modules/title-processors.js +327 -0
  35. package/scripts/schema-modules/types.js +21 -0
  36. package/scripts/schema-modules/utils.js +41 -0
  37. package/src/common/pagination/index.ts +8 -1
  38. package/src/common/search/index.ts +17 -3
  39. package/src/common/sorting/index.ts +8 -2
  40. package/src/form/form-definition/index.ts +567 -238
  41. package/src/form/form-editor/index.ts +202 -29
  42. package/src/form/form-manager/index.ts +11 -2
  43. package/src/form/form-metadata/index.ts +118 -40
  44. package/src/form/form-submission/index.ts +33 -10
  45. package/src/types/joi-to-json.d.ts +15 -0
@@ -1,171 +1,171 @@
1
1
  import Joi from 'joi';
2
2
  import { v4 as uuidV4 } from 'uuid';
3
3
  import { ComponentType } from "../../components/enums.js";
4
- const sectionsSchema = Joi.object().keys({
5
- name: Joi.string().required(),
6
- title: Joi.string().required(),
7
- hideTitle: Joi.boolean().optional().default(false)
8
- });
9
- const conditionFieldSchema = Joi.object().keys({
10
- name: Joi.string().required(),
11
- type: Joi.string().required(),
12
- display: Joi.string().required()
13
- });
14
- const conditionValueSchema = Joi.object().keys({
15
- type: Joi.string().required(),
16
- value: Joi.string().required(),
17
- display: Joi.string().required()
18
- });
19
- const relativeDateValueSchema = Joi.object().keys({
20
- type: Joi.string().required(),
21
- period: Joi.string().required(),
22
- unit: Joi.string().required(),
23
- direction: Joi.string().required()
24
- });
25
- const conditionRefSchema = Joi.object().keys({
26
- conditionName: Joi.string().required(),
27
- conditionDisplayName: Joi.string().required(),
28
- coordinator: Joi.string().optional()
29
- });
30
- const conditionSchema = Joi.object().keys({
31
- field: conditionFieldSchema,
32
- operator: Joi.string().required(),
33
- value: Joi.alternatives().try(conditionValueSchema, relativeDateValueSchema),
34
- coordinator: Joi.string().optional()
35
- });
36
- const conditionGroupSchema = Joi.object().keys({
37
- conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, Joi.link('#conditionGroupSchema')))
4
+ const sectionsSchema = Joi.object().description('A form section grouping related pages together').keys({
5
+ name: Joi.string().required().description('Unique identifier for the section, used in code and page references'),
6
+ title: Joi.string().required().description('Human-readable section title displayed to users'),
7
+ hideTitle: Joi.boolean().optional().default(false).description('When true, the section title will not be displayed in the UI')
8
+ });
9
+ const conditionFieldSchema = Joi.object().description('Field reference used in a condition').keys({
10
+ name: Joi.string().required().description('Component name referenced by this condition'),
11
+ type: Joi.string().required().description('Data type of the field (e.g., string, number, date)'),
12
+ display: Joi.string().required().description('Human-readable name of the field for display purposes')
13
+ });
14
+ const conditionValueSchema = Joi.object().description('Value specification for a condition').keys({
15
+ type: Joi.string().required().description('Data type of the value (e.g., string, number, date)'),
16
+ value: Joi.string().required().description('The actual value to compare against'),
17
+ display: Joi.string().required().description('Human-readable version of the value for display purposes')
18
+ });
19
+ const relativeDateValueSchema = Joi.object().description('Relative date specification for date-based conditions').keys({
20
+ type: Joi.string().required().description('Data type identifier, should be "RelativeDate"'),
21
+ period: Joi.string().required().description('Numeric amount of the time period, as a string'),
22
+ unit: Joi.string().required().description('Time unit (e.g., days, weeks, months, years)'),
23
+ direction: Joi.string().required().description('Temporal direction, either "past" or "future"')
24
+ });
25
+ const conditionRefSchema = Joi.object().description('Reference to a named condition defined elsewhere').keys({
26
+ conditionName: Joi.string().required().description('Name of the referenced condition'),
27
+ conditionDisplayName: Joi.string().required().description('Human-readable name of the condition for display purposes'),
28
+ coordinator: Joi.string().optional().description('Logical operator connecting this condition with others (AND, OR)')
29
+ });
30
+ const conditionSchema = Joi.object().description('Condition definition specifying a logical comparison').keys({
31
+ field: conditionFieldSchema.description('The form field being evaluated in this condition'),
32
+ operator: Joi.string().required().description('Comparison operator (equals, greaterThan, contains, etc.)'),
33
+ value: Joi.alternatives().try(conditionValueSchema, relativeDateValueSchema).description('Value to compare the field against, either fixed or relative date'),
34
+ coordinator: Joi.string().optional().description('Logical operator connecting this condition with others (AND, OR)')
35
+ });
36
+ const conditionGroupSchema = Joi.object().description('Group of conditions combined with logical operators').keys({
37
+ conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, Joi.link('#conditionGroupSchema'))).description('Array of conditions or condition references in this group')
38
38
  }).id('conditionGroupSchema');
39
- const conditionsModelSchema = Joi.object().keys({
40
- name: Joi.string().required(),
41
- conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, conditionGroupSchema))
42
- });
43
- const conditionWrapperSchema = Joi.object().keys({
44
- name: Joi.string().required(),
45
- displayName: Joi.string(),
46
- value: conditionsModelSchema.required()
47
- });
48
- export const componentSchema = Joi.object().keys({
49
- id: Joi.string().uuid().optional(),
50
- type: Joi.string().required(),
51
- shortDescription: Joi.string().optional(),
39
+ const conditionsModelSchema = Joi.object().description('Complete condition model with name and condition set').keys({
40
+ name: Joi.string().required().description('Unique identifier for the condition set'),
41
+ conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, conditionGroupSchema)).description('Array of conditions, condition references, or condition groups')
42
+ });
43
+ const conditionWrapperSchema = Joi.object().description('Container for a named condition with its definition').keys({
44
+ name: Joi.string().required().description('Unique identifier used to reference this condition'),
45
+ displayName: Joi.string().description('Human-readable name for display in the UI'),
46
+ value: conditionsModelSchema.required().description('The complete condition definition')
47
+ });
48
+ export const componentSchema = Joi.object().description('Form component definition specifying UI element behavior').keys({
49
+ id: Joi.string().uuid().optional().description('Unique identifier for the component'),
50
+ type: Joi.string().required().description('Component type (TextField, RadioButtons, DateField, etc.)'),
51
+ shortDescription: Joi.string().optional().description('Brief description of the component purpose'),
52
52
  name: Joi.when('type', {
53
53
  is: Joi.string().valid(ComponentType.Details, ComponentType.Html, ComponentType.InsetText, ComponentType.Markdown),
54
- then: Joi.string().pattern(/^[a-zA-Z]+$/).optional(),
55
- otherwise: Joi.string().pattern(/^[a-zA-Z]+$/)
54
+ then: Joi.string().pattern(/^[a-zA-Z]+$/).optional().description('Optional identifier for display-only components'),
55
+ otherwise: Joi.string().pattern(/^[a-zA-Z]+$/).description('Unique identifier for the component, used in form data')
56
56
  }),
57
57
  title: Joi.when('type', {
58
58
  is: Joi.string().valid(ComponentType.Details, ComponentType.Html, ComponentType.InsetText, ComponentType.Markdown),
59
- then: Joi.string().optional(),
60
- otherwise: Joi.string().allow('')
59
+ then: Joi.string().optional().description('Optional title for display-only components'),
60
+ otherwise: Joi.string().allow('').description('Label displayed above the component')
61
61
  }),
62
- hint: Joi.string().allow('').optional(),
62
+ hint: Joi.string().allow('').optional().description('Additional guidance text displayed below the component title'),
63
63
  options: Joi.object({
64
- rows: Joi.number().empty(''),
65
- maxWords: Joi.number().empty(''),
66
- maxDaysInPast: Joi.number().empty(''),
67
- maxDaysInFuture: Joi.number().empty(''),
68
- customValidationMessage: Joi.string().allow(''),
69
- customValidationMessages: Joi.object().unknown(true).optional()
70
- }).default({}).unknown(true),
64
+ rows: Joi.number().empty('').description('Number of rows for textarea components'),
65
+ maxWords: Joi.number().empty('').description('Maximum number of words allowed in text inputs'),
66
+ maxDaysInPast: Joi.number().empty('').description('Maximum days in the past allowed for date inputs'),
67
+ maxDaysInFuture: Joi.number().empty('').description('Maximum days in the future allowed for date inputs'),
68
+ customValidationMessage: Joi.string().allow('').description('Custom error message for validation failures'),
69
+ customValidationMessages: Joi.object().unknown(true).optional().description('Custom error messages keyed by validation rule name')
70
+ }).default({}).unknown(true).description('Component-specific configuration options'),
71
71
  schema: Joi.object({
72
- min: Joi.number().empty(''),
73
- max: Joi.number().empty(''),
74
- length: Joi.number().empty('')
75
- }).unknown(true).default({}),
76
- list: Joi.string().optional()
72
+ min: Joi.number().empty('').description('Minimum value or length for validation'),
73
+ max: Joi.number().empty('').description('Maximum value or length for validation'),
74
+ length: Joi.number().empty('').description('Exact length required for validation')
75
+ }).unknown(true).default({}).description('Validation rules for the component'),
76
+ list: Joi.string().optional().description('Reference to a predefined list of options for select components')
77
77
  }).unknown(true);
78
78
  export const componentSchemaV2 = componentSchema.keys({
79
- id: Joi.string().uuid().default(() => uuidV4())
80
- });
81
- const nextSchema = Joi.object().keys({
82
- path: Joi.string().required(),
83
- condition: Joi.string().allow('').optional(),
84
- redirect: Joi.string().optional()
85
- });
86
- const repeatOptions = Joi.object().keys({
87
- name: Joi.string().required(),
88
- title: Joi.string().required()
89
- });
90
- const repeatSchema = Joi.object().keys({
91
- min: Joi.number().empty('').required(),
92
- max: Joi.number().empty('').required()
93
- });
94
- const pageRepeatSchema = Joi.object().keys({
95
- options: repeatOptions.required(),
96
- schema: repeatSchema.required()
97
- });
98
- const eventSchema = Joi.object().keys({
99
- type: Joi.string().allow('http').required(),
100
- options: Joi.object().keys({
101
- method: Joi.string().allow('POST').required(),
79
+ id: Joi.string().uuid().default(() => uuidV4()).description('Auto-generated unique identifier for the component')
80
+ }).description('Enhanced component schema for V2 forms with auto-generated IDs');
81
+ const nextSchema = Joi.object().description('Navigation link defining where to go after completing a page').keys({
82
+ path: Joi.string().required().description('The target page path to navigate to'),
83
+ condition: Joi.string().allow('').optional().description('Optional condition that determines if this path should be taken'),
84
+ redirect: Joi.string().optional().description('Optional external URL to redirect to instead of an internal page')
85
+ });
86
+ const repeatOptions = Joi.object().description('Configuration options for a repeatable page section').keys({
87
+ name: Joi.string().required().description('Identifier for the repeatable section, used in data structure'),
88
+ title: Joi.string().required().description('Title displayed for each repeatable item')
89
+ });
90
+ const repeatSchema = Joi.object().description('Validation rules for a repeatable section').keys({
91
+ min: Joi.number().empty('').required().description('Minimum number of repetitions required'),
92
+ max: Joi.number().empty('').required().description('Maximum number of repetitions allowed')
93
+ });
94
+ const pageRepeatSchema = Joi.object().description('Complete configuration for a repeatable page').keys({
95
+ options: repeatOptions.required().description('Display and identification options for the repetition'),
96
+ schema: repeatSchema.required().description('Validation constraints for the number of repetitions')
97
+ });
98
+ const eventSchema = Joi.object().description('Event handler configuration for page lifecycle events').keys({
99
+ type: Joi.string().allow('http').required().description('Type of the event handler (currently only "http" supported)'),
100
+ options: Joi.object().description('Options specific to the event handler type').keys({
101
+ method: Joi.string().allow('POST').required().description('HTTP method to use for the request'),
102
102
  url: Joi.string().uri({
103
103
  scheme: ['http', 'https']
104
- }).required()
104
+ }).required().description('URL endpoint to call when the event fires')
105
105
  })
106
106
  });
107
- const eventsSchema = Joi.object().keys({
108
- onLoad: eventSchema.optional(),
109
- onSave: eventSchema.optional()
107
+ const eventsSchema = Joi.object().description('Collection of event handlers for different page lifecycle events').keys({
108
+ onLoad: eventSchema.optional().description('Event handler triggered when the page is loaded'),
109
+ onSave: eventSchema.optional().description('Event handler triggered when the page data is saved')
110
110
  });
111
111
 
112
112
  /**
113
113
  * `/status` is a special route for providing a user's application status.
114
114
  * It should not be configured via the designer.
115
115
  */
116
- export const pageSchema = Joi.object().keys({
117
- id: Joi.string().uuid().optional(),
118
- path: Joi.string().required().disallow('/status'),
119
- title: Joi.string().required(),
120
- section: Joi.string(),
121
- controller: Joi.string().optional(),
122
- components: Joi.array().items(componentSchema).unique('name'),
116
+ export const pageSchema = Joi.object().description('Form page definition specifying content and behavior').keys({
117
+ id: Joi.string().uuid().optional().description('Unique identifier for the page'),
118
+ path: Joi.string().required().disallow('/status').description('URL path for this page, must not be the reserved "/status" path'),
119
+ title: Joi.string().required().description('Page title displayed at the top of the page'),
120
+ section: Joi.string().description('Section this page belongs to'),
121
+ controller: Joi.string().optional().description('Custom controller class name for special page behavior'),
122
+ components: Joi.array().items(componentSchema).unique('name').description('UI components displayed on this page'),
123
123
  repeat: Joi.when('controller', {
124
124
  is: Joi.string().valid('RepeatPageController').required(),
125
- then: pageRepeatSchema.required(),
125
+ then: pageRepeatSchema.required().description('Configuration for repeatable pages, required when using RepeatPageController'),
126
126
  otherwise: Joi.any().strip()
127
127
  }),
128
- condition: Joi.string().allow('').optional(),
129
- next: Joi.array().items(nextSchema).default([]),
130
- events: eventsSchema.optional(),
131
- view: Joi.string().optional()
128
+ condition: Joi.string().allow('').optional().description('Optional condition that determines if this page is shown'),
129
+ next: Joi.array().items(nextSchema).default([]).description('Possible navigation paths after this page'),
130
+ events: eventsSchema.optional().description('Event handlers for page lifecycle events'),
131
+ view: Joi.string().optional().description('Optional custom view template to use for rendering this page')
132
132
  });
133
133
 
134
134
  /**
135
135
  * V2 engine schema - used with new editor
136
136
  */
137
137
  export const pageSchemaV2 = pageSchema.append({
138
- title: Joi.string().allow('').required()
139
- });
138
+ title: Joi.string().allow('').required().description('Page title with enhanced support for empty titles in V2')
139
+ }).description('Enhanced page schema for V2 forms with support for empty titles');
140
140
  export const pageSchemaPayloadV2 = pageSchemaV2.keys({
141
- id: Joi.string().uuid().default(() => uuidV4()),
141
+ id: Joi.string().uuid().default(() => uuidV4()).description('Auto-generated unique identifier for the page'),
142
142
  components: Joi.array().items(componentSchemaV2).unique('name').unique('id', {
143
143
  ignoreUndefined: true
144
- })
145
- });
146
- const baseListItemSchema = Joi.object().keys({
147
- text: Joi.string().allow(''),
148
- description: Joi.string().allow('').optional(),
149
- conditional: Joi.object().keys({
150
- components: Joi.array().required().items(componentSchema.unknown(true)).unique('name')
144
+ }).description('Components with auto-generated IDs')
145
+ }).description('Page schema for payload data with auto-generated IDs for pages and components');
146
+ const baseListItemSchema = Joi.object().description('Base schema for list items with common properties').keys({
147
+ text: Joi.string().allow('').description('Display text shown to the user'),
148
+ description: Joi.string().allow('').optional().description('Optional additional descriptive text for the item'),
149
+ conditional: Joi.object().description('Optional components to show when this item is selected').keys({
150
+ components: Joi.array().required().items(componentSchema.unknown(true)).unique('name').description('Components to display conditionally')
151
151
  }).optional(),
152
- condition: Joi.string().allow('').optional()
152
+ condition: Joi.string().allow('').optional().description('Condition that determines if this item is shown')
153
153
  });
154
154
  const stringListItemSchema = baseListItemSchema.append({
155
- value: Joi.string().required()
156
- });
155
+ value: Joi.string().required().description('String value stored when this item is selected')
156
+ }).description('List item with string value');
157
157
  const numberListItemSchema = baseListItemSchema.append({
158
- value: Joi.number().required()
159
- });
160
- export const listSchema = Joi.object().keys({
161
- id: Joi.string().uuid().optional(),
162
- name: Joi.string().required(),
163
- title: Joi.string().required(),
164
- type: Joi.string().required().valid('string', 'number'),
158
+ value: Joi.number().required().description('Numeric value stored when this item is selected')
159
+ }).description('List item with numeric value');
160
+ export const listSchema = Joi.object().description('Reusable list of options for select components').keys({
161
+ id: Joi.string().uuid().optional().description('Unique identifier for the list'),
162
+ name: Joi.string().required().description('Name used to reference this list from components'),
163
+ title: Joi.string().required().description('Human-readable title for the list'),
164
+ type: Joi.string().required().valid('string', 'number').description('Data type for list values (string or number)'),
165
165
  items: Joi.when('type', {
166
166
  is: 'string',
167
- then: Joi.array().items(stringListItemSchema).unique('text').unique('value'),
168
- otherwise: Joi.array().items(numberListItemSchema).unique('text').unique('value')
167
+ then: Joi.array().items(stringListItemSchema).unique('text').unique('value').description('Array of items with string values'),
168
+ otherwise: Joi.array().items(numberListItemSchema).unique('text').unique('value').description('Array of items with numeric values')
169
169
  })
170
170
  });
171
171
 
@@ -173,68 +173,68 @@ export const listSchema = Joi.object().keys({
173
173
  * v2 Joi schema for Lists
174
174
  */
175
175
  export const listSchemaV2 = listSchema.keys({
176
- id: Joi.string().uuid().default(() => uuidV4())
177
- });
178
- const feedbackSchema = Joi.object().keys({
179
- feedbackForm: Joi.boolean().default(false),
176
+ id: Joi.string().uuid().default(() => uuidV4()).description('Auto-generated unique identifier for the list')
177
+ }).description('Enhanced list schema for V2 forms with auto-generated IDs');
178
+ const feedbackSchema = Joi.object().description('Feedback configuration for the form').keys({
179
+ feedbackForm: Joi.boolean().default(false).description('Whether to show the built-in feedback form'),
180
180
  url: Joi.when('feedbackForm', {
181
181
  is: Joi.boolean().valid(false),
182
- then: Joi.string().optional().allow('')
182
+ then: Joi.string().optional().allow('').description('URL to an external feedback form when not using built-in feedback')
183
183
  }),
184
184
  emailAddress: Joi.string().email({
185
185
  tlds: {
186
186
  allow: false
187
187
  }
188
- }).optional()
188
+ }).optional().description('Email address where feedback is sent')
189
189
  });
190
- const phaseBannerSchema = Joi.object().keys({
191
- phase: Joi.string().valid('alpha', 'beta')
190
+ const phaseBannerSchema = Joi.object().description('Phase banner configuration showing development status').keys({
191
+ phase: Joi.string().valid('alpha', 'beta').description('Development phase of the service (alpha or beta)')
192
192
  });
193
- const outputSchema = Joi.object().keys({
194
- audience: Joi.string().valid('human', 'machine').required(),
195
- version: Joi.string().required()
193
+ const outputSchema = Joi.object().description('Configuration for form submission output').keys({
194
+ audience: Joi.string().valid('human', 'machine').required().description('Target audience for the output (human readable or machine processable)'),
195
+ version: Joi.string().required().description('Version identifier for the output format')
196
196
  });
197
197
 
198
198
  /**
199
199
  * Joi schema for `FormDefinition` interface
200
200
  * @see {@link FormDefinition}
201
201
  */
202
- export const formDefinitionSchema = Joi.object().required().keys({
203
- engine: Joi.string().allow('V1', 'V2').default('V1'),
204
- name: Joi.string().allow('').optional(),
205
- feedback: feedbackSchema.optional(),
206
- startPage: Joi.string().optional(),
202
+ export const formDefinitionSchema = Joi.object().description('Complete form definition describing all aspects of a form').required().keys({
203
+ engine: Joi.string().allow('V1', 'V2').default('V1').description('Form engine version to use (V1 or V2)'),
204
+ name: Joi.string().allow('').optional().description('Unique name identifying the form'),
205
+ feedback: feedbackSchema.optional().description('Feedback mechanism configuration'),
206
+ startPage: Joi.string().optional().description('Path of the first page to show when starting the form'),
207
207
  pages: Joi.array().required().when('engine', {
208
208
  is: 'V2',
209
- then: Joi.array().items(pageSchemaV2),
210
- otherwise: Joi.array().items(pageSchema)
209
+ then: Joi.array().items(pageSchemaV2).description('Pages using V2 schema with enhanced features'),
210
+ otherwise: Joi.array().items(pageSchema).description('Pages using standard V1 schema')
211
211
  }).unique('path').unique('id', {
212
212
  ignoreUndefined: true
213
- }),
214
- sections: Joi.array().items(sectionsSchema).unique('name').unique('title').required(),
215
- conditions: Joi.array().items(conditionWrapperSchema).unique('name').unique('displayName'),
216
- lists: Joi.array().items(listSchema).unique('name').unique('title'),
213
+ }).description('All pages within the form'),
214
+ sections: Joi.array().items(sectionsSchema).unique('name').unique('title').required().description('Sections grouping related pages together'),
215
+ conditions: Joi.array().items(conditionWrapperSchema).unique('name').unique('displayName').description('Named conditions used for form logic'),
216
+ lists: Joi.array().items(listSchema).unique('name').unique('title').description('Reusable lists of options for select components'),
217
217
  metadata: Joi.object({
218
218
  a: Joi.any()
219
- }).unknown().optional(),
220
- declaration: Joi.string().allow('').optional(),
221
- skipSummary: Joi.any().strip(),
222
- phaseBanner: phaseBannerSchema.optional(),
219
+ }).unknown().optional().description('Custom metadata for the form'),
220
+ declaration: Joi.string().allow('').optional().description('Declaration text shown on the summary page'),
221
+ skipSummary: Joi.any().strip().description('option to skip the summary page'),
222
+ phaseBanner: phaseBannerSchema.optional().description('Phase banner configuration'),
223
223
  outputEmail: Joi.string().email({
224
224
  tlds: {
225
225
  allow: ['uk']
226
226
  }
227
- }).trim().optional(),
228
- output: outputSchema.optional()
227
+ }).trim().optional().description('Email address where form submissions are sent'),
228
+ output: outputSchema.optional().description('Configuration for submission output format')
229
229
  });
230
230
  export const formDefinitionV2PayloadSchema = formDefinitionSchema.keys({
231
231
  pages: Joi.array().items(pageSchemaPayloadV2).required().unique('path').unique('id', {
232
232
  ignoreUndefined: true
233
- }),
233
+ }).description('Pages with auto-generated IDs for V2 forms'),
234
234
  lists: Joi.array().items(listSchemaV2).unique('name').unique('title').unique('id', {
235
235
  ignoreUndefined: true
236
- })
237
- });
236
+ }).description('Lists with auto-generated IDs for V2 forms')
237
+ }).description('Enhanced form definition schema for V2 payloads with auto-generated IDs');
238
238
 
239
239
  // Maintain compatibility with legacy named export
240
240
  // E.g. `import { Schema } from '@defra/forms-model'`
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","sectionsSchema","object","keys","name","string","required","title","hideTitle","boolean","optional","default","conditionFieldSchema","type","display","conditionValueSchema","value","relativeDateValueSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionSchema","field","operator","alternatives","try","conditionGroupSchema","conditions","array","items","link","id","conditionsModelSchema","conditionWrapperSchema","displayName","componentSchema","uuid","shortDescription","when","is","valid","Details","Html","InsetText","Markdown","then","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","min","max","length","list","componentSchemaV2","nextSchema","path","condition","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageSchema","disallow","section","controller","components","unique","repeat","any","strip","next","events","view","pageSchemaV2","append","pageSchemaPayloadV2","ignoreUndefined","baseListItemSchema","text","description","conditional","stringListItemSchema","numberListItemSchema","listSchema","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","feedback","startPage","pages","sections","lists","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","trim","output","formDefinitionV2PayloadSchema","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import Joi, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n type ConditionData,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionRefData,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\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'\n\nconst sectionsSchema = Joi.object<Section>().keys({\n name: Joi.string().required(),\n title: Joi.string().required(),\n hideTitle: Joi.boolean().optional().default(false)\n})\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>().keys({\n name: Joi.string().required(),\n type: Joi.string().required(),\n display: Joi.string().required()\n})\n\nconst conditionValueSchema = Joi.object<ConditionValueData>().keys({\n type: Joi.string().required(),\n value: Joi.string().required(),\n display: Joi.string().required()\n})\n\nconst relativeDateValueSchema = Joi.object<RelativeDateValueData>().keys({\n type: Joi.string().required(),\n period: Joi.string().required(),\n unit: Joi.string().required(),\n direction: Joi.string().required()\n})\n\nconst conditionRefSchema = Joi.object<ConditionRefData>().keys({\n conditionName: Joi.string().required(),\n conditionDisplayName: Joi.string().required(),\n coordinator: Joi.string().optional()\n})\n\nconst conditionSchema = Joi.object<ConditionData>().keys({\n field: conditionFieldSchema,\n operator: Joi.string().required(),\n value: Joi.alternatives().try(conditionValueSchema, relativeDateValueSchema),\n coordinator: Joi.string().optional()\n})\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .keys({\n conditions: Joi.array().items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>().keys({\n name: Joi.string().required(),\n conditions: Joi.array().items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n})\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>().keys({\n name: Joi.string().required(),\n displayName: Joi.string(),\n value: conditionsModelSchema.required()\n})\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .keys({\n id: Joi.string().uuid().optional(),\n type: Joi.string<ComponentType>().required(),\n shortDescription: Joi.string().optional(),\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 .pattern(/^[a-zA-Z]+$/)\n .optional(),\n otherwise: Joi.string().pattern(/^[a-zA-Z]+$/)\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().optional(),\n otherwise: Joi.string().allow('')\n }),\n hint: Joi.string().allow('').optional(),\n options: Joi.object({\n rows: Joi.number().empty(''),\n maxWords: Joi.number().empty(''),\n maxDaysInPast: Joi.number().empty(''),\n maxDaysInFuture: Joi.number().empty(''),\n customValidationMessage: Joi.string().allow(''),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n })\n .default({})\n .unknown(true),\n schema: Joi.object({\n min: Joi.number().empty(''),\n max: Joi.number().empty(''),\n length: Joi.number().empty('')\n })\n .unknown(true)\n .default({}),\n list: Joi.string().optional()\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema.keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4())\n})\n\nconst nextSchema = Joi.object<Link>().keys({\n path: Joi.string().required(),\n condition: Joi.string().allow('').optional(),\n redirect: Joi.string().optional()\n})\n\nconst repeatOptions = Joi.object<RepeatOptions>().keys({\n name: Joi.string().required(),\n title: Joi.string().required()\n})\n\nconst repeatSchema = Joi.object<RepeatSchema>().keys({\n min: Joi.number().empty('').required(),\n max: Joi.number().empty('').required()\n})\n\nconst pageRepeatSchema = Joi.object<Repeat>().keys({\n options: repeatOptions.required(),\n schema: repeatSchema.required()\n})\n\nconst eventSchema = Joi.object<Event>().keys({\n type: Joi.string().allow('http').required(),\n options: Joi.object<EventOptions>().keys({\n method: Joi.string().allow('POST').required(),\n url: Joi.string()\n .uri({ scheme: ['http', 'https'] })\n .required()\n })\n})\n\nconst eventsSchema = Joi.object<Events>().keys({\n onLoad: eventSchema.optional(),\n onSave: eventSchema.optional()\n})\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>().keys({\n id: Joi.string().uuid().optional(),\n path: Joi.string().required().disallow('/status'),\n title: Joi.string().required(),\n section: Joi.string(),\n controller: Joi.string().optional(),\n components: Joi.array<ComponentDef>().items(componentSchema).unique('name'),\n repeat: Joi.when('controller', {\n is: Joi.string().valid('RepeatPageController').required(),\n then: pageRepeatSchema.required(),\n otherwise: Joi.any().strip()\n }),\n condition: Joi.string().allow('').optional(),\n next: Joi.array<Link>().items(nextSchema).default([]),\n events: eventsSchema.optional(),\n view: Joi.string().optional()\n})\n\n/**\n * V2 engine schema - used with new editor\n */\nexport const pageSchemaV2 = pageSchema.append({\n title: Joi.string().allow('').required()\n})\n\nexport const pageSchemaPayloadV2 = pageSchemaV2.keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4()),\n components: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id', { ignoreUndefined: true })\n})\n\nconst baseListItemSchema = Joi.object<Item>().keys({\n text: Joi.string().allow(''),\n description: Joi.string().allow('').optional(),\n conditional: Joi.object<Item['conditional']>()\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n })\n .optional(),\n condition: Joi.string().allow('').optional()\n})\n\nconst stringListItemSchema = baseListItemSchema.append({\n value: Joi.string().required()\n})\n\nconst numberListItemSchema = baseListItemSchema.append({\n value: Joi.number().required()\n})\n\nexport const listSchema = Joi.object<List>().keys({\n id: Joi.string().uuid().optional(),\n name: Joi.string().required(),\n title: Joi.string().required(),\n type: Joi.string().required().valid('string', 'number'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('text')\n .unique('value'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('text')\n .unique('value')\n })\n})\n\n/**\n * v2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema.keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4())\n})\n\nconst feedbackSchema = Joi.object<FormDefinition['feedback']>().keys({\n feedbackForm: Joi.boolean().default(false),\n url: Joi.when('feedbackForm', {\n is: Joi.boolean().valid(false),\n then: Joi.string().optional().allow('')\n }),\n emailAddress: Joi.string()\n .email({\n tlds: {\n allow: false\n }\n })\n .optional()\n})\n\nconst phaseBannerSchema = Joi.object<PhaseBanner>().keys({\n phase: Joi.string().valid('alpha', 'beta')\n})\n\nconst outputSchema = Joi.object<FormDefinition['output']>().keys({\n audience: Joi.string().valid('human', 'machine').required(),\n version: Joi.string().required()\n})\n\n/**\n * Joi schema for `FormDefinition` interface\n * @see {@link FormDefinition}\n */\nexport const formDefinitionSchema = Joi.object<FormDefinition>()\n .required()\n .keys({\n engine: Joi.string().allow('V1', 'V2').default('V1'),\n name: Joi.string().allow('').optional(),\n feedback: feedbackSchema.optional(),\n startPage: Joi.string().optional(),\n pages: Joi.array<Page>()\n .required()\n .when('engine', {\n is: 'V2',\n then: Joi.array<Page>().items(pageSchemaV2),\n otherwise: Joi.array<Page>().items(pageSchema)\n })\n .unique('path')\n .unique('id', { ignoreUndefined: true }),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required(),\n conditions: Joi.array<ConditionWrapper>()\n .items(conditionWrapperSchema)\n .unique('name')\n .unique('displayName'),\n lists: Joi.array<List>().items(listSchema).unique('name').unique('title'),\n metadata: Joi.object({ a: Joi.any() }).unknown().optional(),\n declaration: Joi.string().allow('').optional(),\n skipSummary: Joi.any().strip(),\n phaseBanner: phaseBannerSchema.optional(),\n outputEmail: Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .optional(),\n output: outputSchema.optional()\n })\n\nexport const formDefinitionV2PayloadSchema = formDefinitionSchema.keys({\n pages: Joi.array<Page>()\n .items(pageSchemaPayloadV2)\n .required()\n .unique('path')\n .unique('id', { ignoreUndefined: true }),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id', { ignoreUndefined: true })\n})\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,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AA4BtB,MAAMC,cAAc,GAAGJ,GAAG,CAACK,MAAM,CAAU,CAAC,CAACC,IAAI,CAAC;EAChDC,IAAI,EAAEP,GAAG,CAACQ,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC7BC,KAAK,EAAEV,GAA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,6BAA6B,GAAGf,oBAAoB,CAACpH,IAAI,CAAC;EACrEwH,KAAK,EAAE9H,GAAG,CAACmC,KAAK,CAAO,CAAC,CACrBC,KAAK,CAACkE,mBAAmB,CAAC,CAC1B7F,QAAQ,CAAC,CAAC,CACVoF,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,IAAI,EAAE;IAAEU,eAAe,EAAE;EAAK,CAAC,CAAC;EAC1CyB,KAAK,EAAEhI,GAAG,CAACmC,KAAK,CAAO,CAAC,CACrBC,KAAK,CAAC2E,YAAY,CAAC,CACnBlB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,EAAE;IAAEU,eAAe,EAAE;EAAK,CAAC;AAC3C,CAAC,CAAC;;AAEF;AACA;AACA,OAAO,MAAMmC,MAAM,GAAGhB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","sectionsSchema","object","description","keys","name","string","required","title","hideTitle","boolean","optional","default","conditionFieldSchema","type","display","conditionValueSchema","value","relativeDateValueSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionSchema","field","operator","alternatives","try","conditionGroupSchema","conditions","array","items","link","id","conditionsModelSchema","conditionWrapperSchema","displayName","componentSchema","uuid","shortDescription","when","is","valid","Details","Html","InsetText","Markdown","then","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","min","max","length","list","componentSchemaV2","nextSchema","path","condition","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageSchema","disallow","section","controller","components","unique","repeat","any","strip","next","events","view","pageSchemaV2","append","pageSchemaPayloadV2","ignoreUndefined","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","feedback","startPage","pages","sections","lists","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","trim","output","formDefinitionV2PayloadSchema","Schema"],"sources":["../../../../src/form/form-definition/index.ts"],"sourcesContent":["import Joi, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n type ConditionData,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionRefData,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\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'\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\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 .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\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 .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst relativeDateValueSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .required()\n .description('Data type identifier, should be \"RelativeDate\"'),\n period: Joi.string()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .required()\n .description('Time unit (e.g., days, weeks, months, years)'),\n direction: Joi.string()\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 .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\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 .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\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 .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 .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string().description(\n 'Human-readable name for display in the UI'\n ),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\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 .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .pattern(/^[a-zA-Z]+$/)\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 .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\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 .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 .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: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the component')\n })\n .description('Enhanced component schema for V2 forms with auto-generated IDs')\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 .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\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 .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\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\nconst 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 .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 .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\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\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: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the page'),\n path: Joi.string()\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 .required()\n .description('Page title displayed at the top of the page'),\n section: Joi.string().description('Section this page belongs to'),\n controller: Joi.string()\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().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 .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 .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 title: Joi.string()\n .allow('')\n .required()\n .description('Page title with enhanced support for empty titles in V2')\n })\n .description(\n 'Enhanced page schema for V2 forms with support for empty titles'\n )\n\nexport const pageSchemaPayloadV2 = pageSchemaV2\n .keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the page'),\n components: Joi.array<ComponentDef>()\n .items(componentSchemaV2)\n .unique('name')\n .unique('id', { ignoreUndefined: true })\n .description('Components with auto-generated IDs')\n })\n .description(\n 'Page schema for payload data with auto-generated IDs for pages and components'\n )\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n text: Joi.string().allow('').description('Display text shown to the user'),\n description: Joi.string()\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 .allow('')\n .optional()\n .description('Condition that determines if this item is shown')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\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: Joi.string()\n .uuid()\n .optional()\n .description('Unique identifier for the list'),\n name: Joi.string()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\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('text')\n .unique('value')\n .description('Array of items with string values'),\n otherwise: Joi.array()\n .items(numberListItemSchema)\n .unique('text')\n .unique('value')\n .description('Array of items with numeric values')\n })\n })\n\n/**\n * v2 Joi schema for Lists\n */\nexport const listSchemaV2 = listSchema\n .keys({\n id: Joi.string()\n .uuid()\n .default(() => uuidV4())\n .description('Auto-generated unique identifier for the list')\n })\n .description('Enhanced list schema for V2 forms with auto-generated IDs')\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 .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 .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 .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 .valid('human', 'machine')\n .required()\n .description(\n 'Target audience for the output (human readable or machine processable)'\n ),\n version: Joi.string()\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 .allow('V1', 'V2')\n .default('V1')\n .description('Form engine version to use (V1 or V2)'),\n name: Joi.string()\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 .optional()\n .description('Path of the first page to show when starting the form'),\n pages: Joi.array<Page>()\n .required()\n .when('engine', {\n is: 'V2',\n then: Joi.array<Page>()\n .items(pageSchemaV2)\n .description('Pages using V2 schema with enhanced features'),\n otherwise: Joi.array<Page>()\n .items(pageSchema)\n .description('Pages using standard V1 schema')\n })\n .unique('path')\n .unique('id', { ignoreUndefined: true })\n .description('All pages within the form'),\n sections: Joi.array<Section>()\n .items(sectionsSchema)\n .unique('name')\n .unique('title')\n .required()\n .description('Sections grouping related pages together'),\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 .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 .email({ tlds: { allow: ['uk'] } })\n .trim()\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 formDefinitionV2PayloadSchema = formDefinitionSchema\n .keys({\n pages: Joi.array<Page>()\n .items(pageSchemaPayloadV2)\n .required()\n .unique('path')\n .unique('id', { ignoreUndefined: true })\n .description('Pages with auto-generated IDs for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id', { ignoreUndefined: true })\n .description('Lists with auto-generated IDs for V2 forms')\n })\n .description(\n 'Enhanced form definition schema for V2 payloads with auto-generated IDs'\n )\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,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AA4BtB,MAAMC,cAAc,GAAGJ,GAAG,CAACK,MAAM,CAAU,CAAC,CACzCC,WAAW,CAAC,gDAAgD,CAAC,CAC7DC,IAAI,CAAC;EACJC,IAAI,EAAER,GAAG,CAACS,MAAM,CAAC,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVJ,WAAW,CACV,qEACF,CAAC;EACHK,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