@defra/forms-model 3.0.468 → 3.0.470

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.
@@ -64,7 +64,7 @@ function convertConditionRefDataFromV2(model, condition, coordinator) {
64
64
  throw Error('Component not found');
65
65
  }
66
66
  return {
67
- conditionName: refCondition.name,
67
+ conditionName: refCondition.id,
68
68
  conditionDisplayName: refCondition.displayName,
69
69
  coordinator
70
70
  };
@@ -83,10 +83,10 @@ export function convertConditionWrapperFromV2(conditionWrapper, model) {
83
83
  coordinator = conditionWrapper.coordinator;
84
84
  }
85
85
  const newConditionWrapper = {
86
- name: conditionWrapper.name,
86
+ name: conditionWrapper.id,
87
87
  displayName: conditionWrapper.displayName,
88
88
  value: {
89
- name: conditionWrapper.name,
89
+ name: conditionWrapper.id,
90
90
  conditions: conditionWrapper.conditions.map((condition, index) => {
91
91
  let newCondition;
92
92
  if (isConditionDataV2(condition)) {
@@ -1 +1 @@
1
- {"version":3,"file":"migration.js","names":["ConditionType","isConditionListItemRefValueDataV2","value","type","ListItemRef","isConditionStringValueDataV2","StringValue","getListItem","model","listId","itemId","foundList","getListById","Error","item","items","find","id","createConditionValueDataFromListItemRefV2","refValue","display","text","Value","toString","createConditionValueDataFromStringValueDataV2","isConditionDataV2","condition","convertConditionDataV2","coordinator","component","getComponentById","componentId","newValue","field","name","title","operator","convertConditionRefDataFromV2","refCondition","getConditionById","conditionId","conditionName","conditionDisplayName","displayName","isConditionWrapperV2","wrapper","Array","isArray","conditions","isConditionWrapper","convertConditionWrapperFromV2","conditionWrapper","length","newConditionWrapper","map","index","newCondition","undefined"],"sources":["../../../src/conditions/migration.ts"],"sourcesContent":["import {\n type ComponentDef,\n type ConditionalComponentType\n} from '~/src/components/types.js'\nimport { ConditionType, type Coordinator } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\n type ConditionWrapperV2,\n type List\n} from '~/src/form/form-definition/types.js'\n\nfunction isConditionListItemRefValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionListItemRefValueDataV2 {\n return value.type === ConditionType.ListItemRef\n}\n\nfunction isConditionStringValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionStringValueDataV2 {\n return value.type === ConditionType.StringValue\n}\n\nfunction getListItem(model: RuntimeFormModel, listId: string, itemId: string) {\n const foundList = model.getListById(listId)\n\n if (!foundList) {\n throw Error('List not found')\n }\n\n const item = foundList.items.find((item) => item.id === itemId)\n\n if (!item) {\n throw Error('List item not found')\n }\n\n return item\n}\n\nfunction createConditionValueDataFromListItemRefV2(\n value: ConditionListItemRefValueDataV2,\n model: RuntimeFormModel\n): ConditionValueData {\n const refValue = getListItem(model, value.listId, value.itemId)\n\n return {\n display: refValue.text,\n type: ConditionType.Value,\n value: refValue.value.toString()\n }\n}\n\nfunction createConditionValueDataFromStringValueDataV2(\n value: ConditionStringValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value,\n display: value.value\n }\n}\n\nfunction isConditionDataV2(\n condition: ConditionDataV2 | ConditionRefDataV2\n): condition is ConditionDataV2 {\n return 'componentId' in condition\n}\n\nfunction convertConditionDataV2(\n model: RuntimeFormModel,\n condition: ConditionDataV2,\n coordinator: Coordinator | undefined\n): ConditionData {\n const component = model.getComponentById(condition.componentId)\n\n if (!component) {\n throw Error('Component not found')\n }\n\n let newValue\n if (isConditionListItemRefValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromListItemRefV2(condition.value, model)\n } else if (isConditionStringValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromStringValueDataV2(condition.value)\n } else {\n newValue = condition.value\n }\n\n return {\n field: {\n name: component.name,\n type: component.type as ConditionalComponentType /** @todo fix this */,\n display: component.title\n },\n operator: condition.operator,\n value: newValue,\n coordinator\n }\n}\n\nfunction convertConditionRefDataFromV2(\n model: RuntimeFormModel,\n condition: ConditionRefDataV2,\n coordinator: Coordinator | undefined\n): ConditionRefData {\n const refCondition = model.getConditionById(condition.conditionId)\n\n if (!refCondition) {\n throw Error('Component not found')\n }\n\n return {\n conditionName: refCondition.name,\n conditionDisplayName: refCondition.displayName,\n coordinator\n }\n}\n\nexport function isConditionWrapperV2(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapperV2 {\n return Array.isArray((wrapper as ConditionWrapperV2).conditions)\n}\n\nexport function isConditionWrapper(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapper {\n return !isConditionWrapperV2(wrapper)\n}\n\nexport function convertConditionWrapperFromV2(\n conditionWrapper: ConditionWrapperV2,\n model: RuntimeFormModel\n): ConditionWrapper {\n let coordinator\n\n if (conditionWrapper.conditions.length > 1 && !conditionWrapper.coordinator) {\n throw new Error('Coordinator is required for multiple conditions')\n } else {\n coordinator = conditionWrapper.coordinator\n }\n\n const newConditionWrapper: ConditionWrapper = {\n name: conditionWrapper.name,\n displayName: conditionWrapper.displayName,\n value: {\n name: conditionWrapper.name,\n conditions: conditionWrapper.conditions.map((condition, index) => {\n let newCondition: ConditionData | ConditionRefData\n\n if (isConditionDataV2(condition)) {\n newCondition = convertConditionDataV2(model, condition, coordinator)\n } else {\n newCondition = convertConditionRefDataFromV2(\n model,\n condition,\n index > 0 ? coordinator : undefined\n )\n }\n\n return newCondition\n })\n }\n }\n\n return newConditionWrapper\n}\n\nexport interface RuntimeFormModel {\n getListById: (listId: string) => List | undefined\n getComponentById: (componentId: string) => ComponentDef | undefined\n getConditionById: (conditionId: string) => ConditionWrapperV2 | undefined\n}\n"],"mappings":"AAIA,SAASA,aAAa;AAiBtB,SAASC,iCAAiCA,CACxCC,K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AAK,CAACC,OAAO,CAAEF,OAAO,CAAwBG,UAAU,CAAC;AAClE;AAEA,OAAO,SAASC,kBAAkBA,CAChCJ,OAA8C,EACjB;EAC7B,OAAO,CAACD,oBAAoB,CAACC,OAAO,CAAC;AACvC;AAEA,OAAO,SAASK,6BAA6BA,CAC3CC,gBAAoC,EACpC3C,KAAuB,EACL;EAClB,IAAIoB,WAAW;EAEf,IAAIuB,gBAAgB,CAACH,UAAU,CAACI,MAAM,GAAG,CAAC,IAAI,CAACD,gBAAgB,CAACvB,WAAW,EAAE;IAC3E,MAAM,IAAIf,KAAK,CAAC,iDAAiD,CAAC;EACpE,CAAC,MAAM;IACLe,WAAW,GAAGuB,gBAAgB,CAACvB,WAAW;EAC5C;EAEA,MAAMyB,mBAAqC,GAAG;IAC5CnB,IAAI,EAAEiB,gBAAgB,CAACjB,IAAI;IAC3BS,WAAW,EAAEQ,gBAAgB,CAACR,WAAW;IACzCzC,KAAK,EAAE;MACLgC,IAAI,EAAEiB,gBAAgB,CAACjB,IAAI;MAC3Bc,UAAU,EAAEG,gBAAgB,CAACH,UAAU,CAACM,GAAG,CAAC,CAAC5B,SAAS,EAAE6B,KAAK,KAAK;QAChE,IAAIC,YAA8C;QAElD,IAAI/B,iBAAiB,CAACC,SAAS,CAAC,EAAE;UAChC8B,YAAY,GAAG7B,sBAAsB,CAACnB,KAAK,EAAEkB,SAAS,EAAEE,WAAW,CAAC;QACtE,CAAC,MAAM;UACL4B,YAAY,GAAGnB,6BAA6B,CAC1C7B,KAAK,EACLkB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH;QAEA,OAAOD,YAAY;MACrB,CAAC;IACH;EACF,CAAC;EAED,OAAOH,mBAAmB;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"migration.js","names":["ConditionType","isConditionListItemRefValueDataV2","value","type","ListItemRef","isConditionStringValueDataV2","StringValue","getListItem","model","listId","itemId","foundList","getListById","Error","item","items","find","id","createConditionValueDataFromListItemRefV2","refValue","display","text","Value","toString","createConditionValueDataFromStringValueDataV2","isConditionDataV2","condition","convertConditionDataV2","coordinator","component","getComponentById","componentId","newValue","field","name","title","operator","convertConditionRefDataFromV2","refCondition","getConditionById","conditionId","conditionName","conditionDisplayName","displayName","isConditionWrapperV2","wrapper","Array","isArray","conditions","isConditionWrapper","convertConditionWrapperFromV2","conditionWrapper","length","newConditionWrapper","map","index","newCondition","undefined"],"sources":["../../../src/conditions/migration.ts"],"sourcesContent":["import {\n type ComponentDef,\n type ConditionalComponentType\n} from '~/src/components/types.js'\nimport { ConditionType, type Coordinator } from '~/src/conditions/enums.js'\nimport {\n type ConditionData,\n type ConditionDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type RelativeDateValueData\n} from '~/src/conditions/types.js'\nimport {\n type ConditionWrapper,\n type ConditionWrapperV2,\n type List\n} from '~/src/form/form-definition/types.js'\n\nfunction isConditionListItemRefValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionListItemRefValueDataV2 {\n return value.type === ConditionType.ListItemRef\n}\n\nfunction isConditionStringValueDataV2(\n value:\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | RelativeDateValueData\n): value is ConditionStringValueDataV2 {\n return value.type === ConditionType.StringValue\n}\n\nfunction getListItem(model: RuntimeFormModel, listId: string, itemId: string) {\n const foundList = model.getListById(listId)\n\n if (!foundList) {\n throw Error('List not found')\n }\n\n const item = foundList.items.find((item) => item.id === itemId)\n\n if (!item) {\n throw Error('List item not found')\n }\n\n return item\n}\n\nfunction createConditionValueDataFromListItemRefV2(\n value: ConditionListItemRefValueDataV2,\n model: RuntimeFormModel\n): ConditionValueData {\n const refValue = getListItem(model, value.listId, value.itemId)\n\n return {\n display: refValue.text,\n type: ConditionType.Value,\n value: refValue.value.toString()\n }\n}\n\nfunction createConditionValueDataFromStringValueDataV2(\n value: ConditionStringValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value,\n display: value.value\n }\n}\n\nfunction isConditionDataV2(\n condition: ConditionDataV2 | ConditionRefDataV2\n): condition is ConditionDataV2 {\n return 'componentId' in condition\n}\n\nfunction convertConditionDataV2(\n model: RuntimeFormModel,\n condition: ConditionDataV2,\n coordinator: Coordinator | undefined\n): ConditionData {\n const component = model.getComponentById(condition.componentId)\n\n if (!component) {\n throw Error('Component not found')\n }\n\n let newValue\n if (isConditionListItemRefValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromListItemRefV2(condition.value, model)\n } else if (isConditionStringValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromStringValueDataV2(condition.value)\n } else {\n newValue = condition.value\n }\n\n return {\n field: {\n name: component.name,\n type: component.type as ConditionalComponentType /** @todo fix this */,\n display: component.title\n },\n operator: condition.operator,\n value: newValue,\n coordinator\n }\n}\n\nfunction convertConditionRefDataFromV2(\n model: RuntimeFormModel,\n condition: ConditionRefDataV2,\n coordinator: Coordinator | undefined\n): ConditionRefData {\n const refCondition = model.getConditionById(condition.conditionId)\n\n if (!refCondition) {\n throw Error('Component not found')\n }\n\n return {\n conditionName: refCondition.id,\n conditionDisplayName: refCondition.displayName,\n coordinator\n }\n}\n\nexport function isConditionWrapperV2(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapperV2 {\n return Array.isArray((wrapper as ConditionWrapperV2).conditions)\n}\n\nexport function isConditionWrapper(\n wrapper: ConditionWrapper | ConditionWrapperV2\n): wrapper is ConditionWrapper {\n return !isConditionWrapperV2(wrapper)\n}\n\nexport function convertConditionWrapperFromV2(\n conditionWrapper: ConditionWrapperV2,\n model: RuntimeFormModel\n): ConditionWrapper {\n let coordinator\n\n if (conditionWrapper.conditions.length > 1 && !conditionWrapper.coordinator) {\n throw new Error('Coordinator is required for multiple conditions')\n } else {\n coordinator = conditionWrapper.coordinator\n }\n\n const newConditionWrapper: ConditionWrapper = {\n name: conditionWrapper.id,\n displayName: conditionWrapper.displayName,\n value: {\n name: conditionWrapper.id,\n conditions: conditionWrapper.conditions.map((condition, index) => {\n let newCondition: ConditionData | ConditionRefData\n\n if (isConditionDataV2(condition)) {\n newCondition = convertConditionDataV2(model, condition, coordinator)\n } else {\n newCondition = convertConditionRefDataFromV2(\n model,\n condition,\n index > 0 ? coordinator : undefined\n )\n }\n\n return newCondition\n })\n }\n }\n\n return newConditionWrapper\n}\n\nexport interface RuntimeFormModel {\n getListById: (listId: string) => List | undefined\n getComponentById: (componentId: string) => ComponentDef | undefined\n getConditionById: (conditionId: string) => ConditionWrapperV2 | undefined\n}\n"],"mappings":"AAIA,SAASA,aAAa;AAiBtB,SAASC,iCAAiCA,CACxCC,KAGyB,EACiB;EAC1C,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACI,WAAW;AACjD;AAEA,SAASC,4BAA4BA,CACnCH,KAGyB,EACY;EACrC,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACM,WAAW;AACjD;AAEA,SAASC,WAAWA,CAACC,KAAuB,EAAEC,MAAc,EAAEC,MAAc,EAAE;EAC5E,MAAMC,SAAS,GAAGH,KAAK,CAACI,WAAW,CAACH,MAAM,CAAC;EAE3C,IAAI,CAACE,SAAS,EAAE;IACd,MAAME,KAAK,CAAC,gBAAgB,CAAC;EAC/B;EAEA,MAAMC,IAAI,GAAGH,SAAS,CAACI,KAAK,CAACC,IAAI,CAAEF,IAAI,IAAKA,IAAI,CAACG,EAAE,KAAKP,MAAM,CAAC;EAE/D,IAAI,CAACI,IAAI,EAAE;IACT,MAAMD,KAAK,CAAC,qBAAqB,CAAC;EACpC;EAEA,OAAOC,IAAI;AACb;AAEA,SAASI,yCAAyCA,CAChDhB,KAAsC,EACtCM,KAAuB,EACH;EACpB,MAAMW,QAAQ,GAAGZ,WAAW,CAACC,KAAK,EAAEN,KAAK,CAACO,MAAM,EAA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AK;QAChE,IAAIC,YAA8C;QAElD,IAAI/B,iBAAiB,CAACC,SAAS,CAAC,EAAE;UAChC8B,YAAY,GAAG7B,sBAAsB,CAACnB,KAAK,EAAEkB,SAAS,EAAEE,WAAW,CAAC;QACtE,CAAC,MAAM;UACL4B,YAAY,GAAGnB,6BAA6B,CAC1C7B,KAAK,EACLkB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH;QAEA,OAAOD,YAAY;MACrB,CAAC;IACH;EACF,CAAC;EAED,OAAOH,mBAAmB;AAC5B","ignoreList":[]}
@@ -8,7 +8,7 @@ const idSchemaOptional = Joi.string().uuid();
8
8
  const idSchema = idSchemaOptional.default(() => uuidV4());
9
9
  const conditionIdRef = Joi.ref('/conditions', {
10
10
  in: true,
11
- adjust: conditions => conditions.map(condition => condition.name)
11
+ adjust: conditions => conditions.map(condition => condition.id)
12
12
  });
13
13
  const componentIdRefSchema = Joi.ref('/pages', {
14
14
  in: true,
@@ -37,11 +37,11 @@ const conditionValueSchema = Joi.object().description('Value specification for a
37
37
  value: Joi.string().trim().required().description('The actual value to compare against'),
38
38
  display: Joi.string().trim().required().description('Human-readable version of the value for display purposes')
39
39
  });
40
- const condition2StringValueDataSchema = Joi.object().description('String value specification for a condition').keys({
40
+ const conditionStringValueDataSchemaV2 = Joi.object().description('String value specification for a condition').keys({
41
41
  type: Joi.string().trim().valid('StringValue').required().description('Type of the condition value, should be "StringValue"'),
42
42
  value: Joi.string().trim().required().description('The actual value to compare against')
43
43
  });
44
- const condition2ListItemRefDataSchema = Joi.object().description('List item ref specification for a condition').keys({
44
+ const conditionListItemRefDataSchemaV2 = Joi.object().description('List item ref specification for a condition').keys({
45
45
  type: Joi.string().trim().valid('ListItemRef').required().description('Type of the condition value, should be "ListItemRef"'),
46
46
  listId: Joi.string().valid(listIdRef).trim().required().description('The id of the list'),
47
47
  itemId: Joi.string().trim().valid(listItemIdRef).required().description('The id of the list item')
@@ -57,7 +57,7 @@ const conditionRefSchema = Joi.object().description('Reference to a named condit
57
57
  conditionDisplayName: Joi.string().trim().required().description('Human-readable name of the condition for display purposes'),
58
58
  coordinator: Joi.string().trim().optional().description('Logical operator connecting this condition with others (AND, OR)')
59
59
  });
60
- const condition2RefDataSchema = Joi.object().description('Reference to a named condition defined elsewhere').keys({
60
+ const conditionRefDataSchemaV2 = Joi.object().description('Reference to a named condition defined elsewhere').keys({
61
61
  id: idSchema.description('Unique identifier for the referenced condition'),
62
62
  conditionId: Joi.string().trim().required().valid(conditionIdRef).description('Name of the referenced condition')
63
63
  });
@@ -67,11 +67,11 @@ const conditionSchema = Joi.object().description('Condition definition specifyin
67
67
  value: Joi.alternatives().try(conditionValueSchema, relativeDateValueDataSchema).description('Value to compare the field against, either fixed or relative date'),
68
68
  coordinator: Joi.string().trim().optional().description('Logical operator connecting this condition with others (AND, OR)')
69
69
  });
70
- const condition2DataSchema = Joi.object().description('Condition definition').keys({
70
+ const conditionDataSchemaV2 = Joi.object().description('Condition definition').keys({
71
71
  id: idSchema.description('Unique identifier used to reference this condition'),
72
72
  componentId: Joi.string().trim().valid(componentIdRefSchema).required().description('Reference to the component id being evaluated in this condition'),
73
73
  operator: Joi.string().trim().required().description('Comparison operator (equals, greaterThan, contains, etc.)'),
74
- value: Joi.alternatives().try(condition2StringValueDataSchema, condition2ListItemRefDataSchema, relativeDateValueDataSchema).description('Value to compare the field against, either fixed or relative date')
74
+ value: Joi.alternatives().try(conditionStringValueDataSchemaV2, conditionListItemRefDataSchemaV2, relativeDateValueDataSchema).description('Value to compare the field against, either fixed or relative date')
75
75
  });
76
76
  const conditionGroupSchema = Joi.object().description('Group of conditions combined with logical operators').keys({
77
77
  conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, Joi.link('#conditionGroupSchema'))).description('Array of conditions or condition references in this group')
@@ -86,10 +86,10 @@ const conditionWrapperSchema = Joi.object().description('Container for a named c
86
86
  value: conditionsModelSchema.required().description('The complete condition definition')
87
87
  });
88
88
  export const conditionWrapperSchemaV2 = Joi.object().description('Container for a named condition with its definition').keys({
89
- name: Joi.string().trim().description('Unique identifier for the condition'),
89
+ id: idSchema.description('Unique identifier for the condition'),
90
90
  displayName: Joi.string().trim().description('Human-readable name for display in the UI'),
91
91
  coordinator: Joi.string().optional().description('Logical operator connecting this condition with others (AND, OR)'),
92
- conditions: Joi.array().items(Joi.alternatives().try(condition2DataSchema, condition2RefDataSchema)).description('Array of conditions or condition references')
92
+ conditions: Joi.array().items(Joi.alternatives().try(conditionDataSchemaV2, conditionRefDataSchemaV2)).description('Array of conditions or condition references')
93
93
  }).description('Condition schema for V2 forms');
94
94
  export const componentSchema = Joi.object().description('Form component definition specifying UI element behavior').keys({
95
95
  id: idSchemaOptional.description('Unique identifier for the component'),
@@ -290,7 +290,7 @@ export const formDefinitionV2Schema = formDefinitionSchema.keys({
290
290
  schema: Joi.number().integer().valid(SchemaVersion.V2).description('Form schema version to use (2)'),
291
291
  pages: Joi.array().items(pageSchemaV2).required().unique('path').unique('id').description('Pages schema for V2 forms'),
292
292
  lists: Joi.array().items(listSchemaV2).unique('name').unique('title').unique('id').description('Lists schema for V2 forms'),
293
- conditions: Joi.array().items(conditionWrapperSchemaV2).unique('name').unique('displayName').description('Named conditions used for form logic')
293
+ conditions: Joi.array().items(conditionWrapperSchemaV2).unique('id').unique('displayName').description('Named conditions used for form logic')
294
294
  }).description('Form definition schema for V2');
295
295
 
296
296
  // Maintain compatibility with legacy named export
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","SchemaVersion","ControllerType","hasComponents","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","name","componentIdRefSchema","pages","flatMap","page","components","filter","component","id","listIdRef","lists","list","listItemIdRef","items","item","sectionsSchema","object","description","keys","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","condition2StringValueDataSchema","valid","condition2ListItemRefDataSchema","listId","itemId","relativeDateValueDataSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","condition2RefDataSchema","conditionId","conditionSchema","field","operator","alternatives","try","condition2DataSchema","componentId","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","componentSchema","shortDescription","when","is","Details","Html","InsetText","Markdown","then","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","min","max","length","componentSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","pageSchema","disallow","section","controller","repeat","any","strip","next","events","view","pageSchemaV2","append","switch","FileUpload","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","messages","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","integer","V1","feedback","startPage","sections","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","formDefinitionV2Schema","V2","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 {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.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 ConditionStringValueDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\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 { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\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.name)\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 condition2StringValueDataSchema = Joi.object<ConditionStringValueDataV2>()\n .description('String value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('StringValue')\n .required()\n .description('Type of the condition value, should be \"StringValue\"'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against')\n })\n\nconst condition2ListItemRefDataSchema =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('ListItemRef')\n .required()\n .description('Type of the condition value, should be \"ListItemRef\"'),\n listId: Joi.string()\n .valid(listIdRef)\n .trim()\n .required()\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .valid(listItemIdRef)\n .required()\n .description('The id of the list item')\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 condition2RefDataSchema = 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 .valid(conditionIdRef)\n .description('Name of the referenced condition')\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\nconst condition2DataSchema = 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 .valid(componentIdRefSchema)\n .required()\n .description(\n 'Reference to the component id 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(\n condition2StringValueDataSchema,\n condition2ListItemRefDataSchema,\n relativeDateValueDataSchema\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 name: Joi.string()\n .trim()\n .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 .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n conditions: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives().try(condition2DataSchema, condition2RefDataSchema)\n )\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 .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 .valid(listIdRef)\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema 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('name')\n .unique('id')\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('name')\n .unique('id')\n .description('Components schema for V2 forms')\n }),\n condition: Joi.string()\n .trim()\n .valid(conditionIdRef)\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('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('text')\n .unique('value')\n .messages({\n 'array.unique':\n 'Each item must have a unique identifier - enter a different identifier for this item.'\n })\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: 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 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('path')\n .unique('id')\n .description('Pages schema for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id')\n .description('Lists schema for V2 forms'),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('name')\n .unique('displayName')\n .description('Named conditions used for form logic')\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,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAoBtB,SACEC,aAAa;AAiBf,SAASC,cAAc;AACvB,SAASC,aAAa;AAEtB,MAAMC,gBAAgB,GAAGP,GAAG,CAACQ,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,CAA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ZzF,WAAW,CAAC,2BAA2B,CAAC;EAC3CpB,UAAU,EAAEhB,GAAG,CAACwE,KAAK,CAAqB,CAAC,CACxCxC,KAAK,CAAC6C,wBAAwB,CAAC,CAC/BgD,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,aAAa,CAAC,CACrBzF,WAAW,CAAC,sCAAsC;AACvD,CAAC,CAAC,CACDA,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM0I,MAAM,GAAGhB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","v4","uuidV4","ComponentType","SchemaVersion","ControllerType","hasComponents","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","conditionStringValueDataSchemaV2","valid","conditionListItemRefDataSchemaV2","listId","itemId","relativeDateValueDataSchema","period","unit","direction","conditionRefSchema","conditionName","conditionDisplayName","coordinator","conditionRefDataSchemaV2","conditionId","conditionSchema","field","operator","alternatives","try","conditionDataSchemaV2","componentId","conditionGroupSchema","array","link","conditionsModelSchema","conditionWrapperSchema","displayName","conditionWrapperSchemaV2","componentSchema","shortDescription","when","is","Details","Html","InsetText","Markdown","then","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","min","max","length","componentSchemaV2","fileUploadComponentSchema","FileUploadField","contentComponentSchema","List","nextSchema","path","redirect","repeatOptions","repeatSchema","pageRepeatSchema","eventSchema","method","url","uri","scheme","eventsSchema","onLoad","onSave","pageUploadComponentsSchema","unique","pageSchema","disallow","section","controller","repeat","any","strip","next","events","view","pageSchemaV2","append","switch","FileUpload","baseListItemSchema","text","conditional","stringListItemSchema","numberListItemSchema","listSchema","messages","listSchemaV2","feedbackSchema","feedbackForm","emailAddress","email","tlds","phaseBannerSchema","phase","outputSchema","audience","version","formDefinitionSchema","engine","integer","V1","feedback","startPage","sections","metadata","a","declaration","skipSummary","phaseBanner","outputEmail","output","formDefinitionV2Schema","V2","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 {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.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 ConditionStringValueDataV2,\n type ConditionValueData,\n type ConditionsModelData,\n type RelativeDateValueData\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 { ControllerType } from '~/src/pages/enums.js'\nimport { hasComponents } from '~/src/pages/helpers.js'\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 conditionStringValueDataSchemaV2 =\n Joi.object<ConditionStringValueDataV2>()\n .description('String value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('StringValue')\n .required()\n .description('Type of the condition value, should be \"StringValue\"'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against')\n })\n\nconst conditionListItemRefDataSchemaV2 =\n Joi.object<ConditionListItemRefValueDataV2>()\n .description('List item ref specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('ListItemRef')\n .required()\n .description('Type of the condition value, should be \"ListItemRef\"'),\n listId: Joi.string()\n .valid(listIdRef)\n .trim()\n .required()\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .valid(listItemIdRef)\n .required()\n .description('The id of the list item')\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 .valid(conditionIdRef)\n .description('Name of the referenced condition')\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\nconst 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 .valid(componentIdRefSchema)\n .required()\n .description(\n 'Reference to the component id 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(\n conditionStringValueDataSchemaV2,\n conditionListItemRefDataSchemaV2,\n relativeDateValueDataSchema\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 .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n conditions: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives().try(conditionDataSchemaV2, conditionRefDataSchemaV2)\n )\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 .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 .valid(listIdRef)\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema 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('name')\n .unique('id')\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('name')\n .unique('id')\n .description('Components schema for V2 forms')\n }),\n condition: Joi.string()\n .trim()\n .valid(conditionIdRef)\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('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('text')\n .unique('value')\n .messages({\n 'array.unique':\n 'Each item must have a unique identifier - enter a different identifier for this item.'\n })\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: 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 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('path')\n .unique('id')\n .description('Pages schema for V2 forms'),\n lists: Joi.array<List>()\n .items(listSchemaV2)\n .unique('name')\n .unique('title')\n .unique('id')\n .description('Lists schema for V2 forms'),\n conditions: Joi.array<ConditionWrapperV2>()\n .items(conditionWrapperSchemaV2)\n .unique('id')\n .unique('displayName')\n .description('Named conditions used for form logic')\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,GAAG,MAAiC,KAAK;AAChD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAoBtB,SACEC,aAAa;AAiBf,SAASC,cAAc;AACvB,SAASC,aAAa;AAEtB,MAAMC,gBAAgB,GAAGP,GAAG,CAACQ,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC;AAE5C,MAAMC,QAAQ,GAAGH,gBAAgB,CAACI,OAAO,CAAC,MAAMT,MAAM,CAAC,CAAC,CAAC;AAEzD,MAAMU,cAAc,GAAGZ,GAAG,CAACa,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,GAAGpB,GAAG,CAACa,GAAG,CAAC,QAAQ,EAAE;EAC7CC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAGM,KAAa,IACpBA,KAAK,CAACC,OAAO,CAAEC,IAAI,IACjBjB,aAAa,CAACiB,IAAI,CAAC,GACfA,IAAI,CAACC,UAAU,CACZC,MAAM,CAAEC,SAAS,IAAKA,SAAS,CAACP,EAAE,CAAC,CACn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AC7D,CAAC,CAAC;AAEJ,OAAO,MAAMyI,sBAAsB,GAAGd,oBAAoB,CACvD1H,IAAI,CAAC;EACJiE,MAAM,EAAErG,GAAG,CAAC6F,MAAM,CAAC,CAAC,CACjBmE,OAAO,CAAC,CAAC,CACT9G,KAAK,CAAC9C,aAAa,CAACyK,EAAE,CAAC,CACvB1I,WAAW,CAAC,gCAAgC,CAAC;EAChDd,KAAK,EAAErB,GAAG,CAACwE,KAAK,CAAO,CAAC,CACrBzC,KAAK,CAACyG,YAAY,CAAC,CACnBjG,QAAQ,CAAC,CAAC,CACVsF,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,IAAI,CAAC,CACZ1F,WAAW,CAAC,2BAA2B,CAAC;EAC3CP,KAAK,EAAE5B,GAAG,CAACwE,KAAK,CAAO,CAAC,CACrBzC,KAAK,CAACoH,YAAY,CAAC,CACnBtB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,CAAC,CACZ1F,WAAW,CAAC,2BAA2B,CAAC;EAC3CnB,UAAU,EAAEhB,GAAG,CAACwE,KAAK,CAAqB,CAAC,CACxCzC,KAAK,CAAC8C,wBAAwB,CAAC,CAC/BgD,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrB1F,WAAW,CAAC,sCAAsC;AACvD,CAAC,CAAC,CACDA,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM2I,MAAM,GAAGhB,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 name: string\n displayName: string\n coordinator?: Coordinator\n conditions: 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":[]}
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 conditions: 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":[]}
@@ -79,8 +79,9 @@ export function controllerNameFromPath(nameOrPath) {
79
79
  function includesFileUploadField(components) {
80
80
  return components.some(component => component.type === ComponentType.FileUploadField);
81
81
  }
82
- export function canSetRepeater(page) {
83
- if (page.controller && page.controller !== ControllerType.Page) {
82
+ const SHOW_REPEATER_CONTROLLERS = [ControllerType.Page, ControllerType.Repeat];
83
+ export function showRepeaterSettings(page) {
84
+ if (page.controller && !SHOW_REPEATER_CONTROLLERS.includes(page.controller)) {
84
85
  return false;
85
86
  }
86
87
  if (hasComponents(page) && includesFileUploadField(page.components)) {
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["ComponentType","ControllerNames","ControllerTypes","ControllerType","PageTypes","getPageDefaults","page","nameOrPath","controller","Page","controllerNameFromPath","defaults","find","pageType","Error","structuredClone","hasComponents","hasNext","Array","isArray","components","hasComponentsEvenIfNoNext","undefined","hasFormComponents","Start","hasRepeater","Repeat","isControllerName","map","String","includes","Terminal","FileUpload","options","path","name","includesFileUploadField","some","component","type","FileUploadField","canSetRepeater","omitFileUploadComponent","length"],"sources":["../../../src/pages/helpers.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport {\n type Link,\n type Page,\n type PageFileUpload,\n type PageQuestion,\n type PageRepeat\n} from '~/src/form/form-definition/types.js'\nimport { ComponentType } from '~/src/index.js'\nimport {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { PageTypes } from '~/src/pages/page-types.js'\n\n/**\n * Return component defaults by type\n */\nexport function getPageDefaults<PageType extends Page>(\n page?: Pick<PageType, 'controller'>\n) {\n const nameOrPath = page?.controller ?? ControllerType.Page\n const controller = controllerNameFromPath(nameOrPath)\n\n const defaults = PageTypes.find(\n (pageType) => pageType.controller === controller\n )\n\n if (!defaults) {\n throw new Error(`Defaults not found for page type '${nameOrPath}'`)\n }\n\n return structuredClone(defaults) as PageType\n}\n\n/**\n * Check page has components\n */\nexport function hasComponents(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return hasNext(page) && Array.isArray(page.components)\n}\n\n/**\n * Check if the page has components (the page can be any page type e.g. SummaryPage)\n */\nexport function hasComponentsEvenIfNoNext(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return (\n page !== undefined && 'components' in page && Array.isArray(page.components)\n )\n}\n\n/**\n * Check page has form components\n */\nexport function hasFormComponents(\n page?: Partial<Page>\n): page is PageQuestion | PageFileUpload {\n const controller = controllerNameFromPath(page?.controller)\n return hasComponents(page) && controller !== ControllerType.Start\n}\n\n/**\n * Check page has repeater\n */\nexport function hasRepeater(page?: Partial<Page>): page is PageRepeat {\n return controllerNameFromPath(page?.controller) === ControllerType.Repeat\n}\n\n/**\n * Check for known page controller names\n */\nexport function isControllerName(\n nameOrPath?: ControllerType | string\n): nameOrPath is ControllerType {\n return !!nameOrPath && ControllerNames.map(String).includes(nameOrPath)\n}\n\n/**\n * Check page has next link\n */\nexport function hasNext(\n page?: Partial<Page>\n): page is Extract<Page, { next: Link[] }> {\n if (!page || !('next' in page)) {\n return false\n }\n\n const controller = controllerNameFromPath(page.controller)\n\n return (\n !controller ||\n controller === ControllerType.Start ||\n controller === ControllerType.Page ||\n controller === ControllerType.Terminal ||\n controller === ControllerType.FileUpload ||\n controller === ControllerType.Repeat\n )\n}\n\n/**\n * Check and optionally replace legacy path with controller name\n * @param {string} [nameOrPath] - Controller name or legacy controller path\n */\nexport function controllerNameFromPath(nameOrPath?: ControllerType | string) {\n if (isControllerName(nameOrPath)) {\n return nameOrPath\n }\n\n const options = ControllerTypes.find(({ path }) => path === nameOrPath)\n return options?.name\n}\n\nfunction includesFileUploadField(components: ComponentDef[]): boolean {\n return components.some(\n (component) => component.type === ComponentType.FileUploadField\n )\n}\n\nexport function canSetRepeater(page: Page): boolean {\n if (page.controller && page.controller !== ControllerType.Page) {\n return false\n }\n if (hasComponents(page) && includesFileUploadField(page.components)) {\n return false\n }\n return true\n}\n\n/**\n * High level check for whether file upload component should be omitted\n * @param { Page | undefined } page\n * @returns {boolean}\n */\nexport function omitFileUploadComponent(page: Page | undefined): boolean {\n if (page?.controller === ControllerType.Repeat) {\n return true\n }\n if (!hasComponents(page)) {\n return false\n }\n if (page.components.length > 1) {\n return true\n }\n if (includesFileUploadField(page.components)) {\n return true\n }\n return false\n}\n"],"mappings":"AAQA,SAASA,aAAa;AACtB,SACEC,eAAe,EACfC,eAAe;AAEjB,SAASC,cAAc;AACvB,SAASC,SAAS;;AAElB;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7B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AAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,uBAAuBA,CAACpC,IAAsB,EAAW;EACvE,IAAIA,IAAI,EAAEE,UAAU,KAAKL,cAAc,CAACuB,MAAM,EAAE;IAC9C,OAAO,IAAI;EACb;EACA,IAAI,CAACV,aAAa,CAACV,IAAI,CAAC,EAAE;IACxB,OAAO,KAAK;EACd;EACA,IAAIA,IAAI,CAACc,UAAU,CAACuB,MAAM,GAAG,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EACA,IAAIP,uBAAuB,CAAC9B,IAAI,CAACc,UAAU,CAAC,EAAE;IAC5C,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"file":"helpers.js","names":["ComponentType","ControllerNames","ControllerTypes","ControllerType","PageTypes","getPageDefaults","page","nameOrPath","controller","Page","controllerNameFromPath","defaults","find","pageType","Error","structuredClone","hasComponents","hasNext","Array","isArray","components","hasComponentsEvenIfNoNext","undefined","hasFormComponents","Start","hasRepeater","Repeat","isControllerName","map","String","includes","Terminal","FileUpload","options","path","name","includesFileUploadField","some","component","type","FileUploadField","SHOW_REPEATER_CONTROLLERS","showRepeaterSettings","omitFileUploadComponent","length"],"sources":["../../../src/pages/helpers.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport {\n type Link,\n type Page,\n type PageFileUpload,\n type PageQuestion,\n type PageRepeat\n} from '~/src/form/form-definition/types.js'\nimport { ComponentType } from '~/src/index.js'\nimport {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { PageTypes } from '~/src/pages/page-types.js'\n\n/**\n * Return component defaults by type\n */\nexport function getPageDefaults<PageType extends Page>(\n page?: Pick<PageType, 'controller'>\n) {\n const nameOrPath = page?.controller ?? ControllerType.Page\n const controller = controllerNameFromPath(nameOrPath)\n\n const defaults = PageTypes.find(\n (pageType) => pageType.controller === controller\n )\n\n if (!defaults) {\n throw new Error(`Defaults not found for page type '${nameOrPath}'`)\n }\n\n return structuredClone(defaults) as PageType\n}\n\n/**\n * Check page has components\n */\nexport function hasComponents(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return hasNext(page) && Array.isArray(page.components)\n}\n\n/**\n * Check if the page has components (the page can be any page type e.g. SummaryPage)\n */\nexport function hasComponentsEvenIfNoNext(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return (\n page !== undefined && 'components' in page && Array.isArray(page.components)\n )\n}\n\n/**\n * Check page has form components\n */\nexport function hasFormComponents(\n page?: Partial<Page>\n): page is PageQuestion | PageFileUpload {\n const controller = controllerNameFromPath(page?.controller)\n return hasComponents(page) && controller !== ControllerType.Start\n}\n\n/**\n * Check page has repeater\n */\nexport function hasRepeater(page?: Partial<Page>): page is PageRepeat {\n return controllerNameFromPath(page?.controller) === ControllerType.Repeat\n}\n\n/**\n * Check for known page controller names\n */\nexport function isControllerName(\n nameOrPath?: ControllerType | string\n): nameOrPath is ControllerType {\n return !!nameOrPath && ControllerNames.map(String).includes(nameOrPath)\n}\n\n/**\n * Check page has next link\n */\nexport function hasNext(\n page?: Partial<Page>\n): page is Extract<Page, { next: Link[] }> {\n if (!page || !('next' in page)) {\n return false\n }\n\n const controller = controllerNameFromPath(page.controller)\n\n return (\n !controller ||\n controller === ControllerType.Start ||\n controller === ControllerType.Page ||\n controller === ControllerType.Terminal ||\n controller === ControllerType.FileUpload ||\n controller === ControllerType.Repeat\n )\n}\n\n/**\n * Check and optionally replace legacy path with controller name\n * @param {string} [nameOrPath] - Controller name or legacy controller path\n */\nexport function controllerNameFromPath(nameOrPath?: ControllerType | string) {\n if (isControllerName(nameOrPath)) {\n return nameOrPath\n }\n\n const options = ControllerTypes.find(({ path }) => path === nameOrPath)\n return options?.name\n}\n\nfunction includesFileUploadField(components: ComponentDef[]): boolean {\n return components.some(\n (component) => component.type === ComponentType.FileUploadField\n )\n}\n\nconst SHOW_REPEATER_CONTROLLERS = [ControllerType.Page, ControllerType.Repeat]\n\nexport function showRepeaterSettings(page: Page): boolean {\n if (page.controller && !SHOW_REPEATER_CONTROLLERS.includes(page.controller)) {\n return false\n }\n if (hasComponents(page) && includesFileUploadField(page.components)) {\n return false\n }\n return true\n}\n\n/**\n * High level check for whether file upload component should be omitted\n * @param { Page | undefined } page\n * @returns {boolean}\n */\nexport function omitFileUploadComponent(page: Page | undefined): boolean {\n if (page?.controller === ControllerType.Repeat) {\n return true\n }\n if (!hasComponents(page)) {\n return false\n }\n if (page.components.length > 1) {\n return true\n }\n if (includesFileUploadField(page.components)) {\n return true\n }\n return false\n}\n"],"mappings":"AAQA,SAASA,aAAa;AACtB,SACEC,eAAe,EACfC,eAAe;AAEjB,SAASC,cAAc;AACvB,SAASC,SAAS;;AAElB;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,IAAmC,EACnC;EACA,MAAMC,UAAU,GAAGD,IAAI,EAAEE,UAAU,IAAIL,cAAc,CAACM,IAAI;EAC1D,MAAMD,UAAU,GAAGE,sBAAsB,CAACH,UAAU,CAAC;EAErD,MAAMI,QAAQ,GAAGP,SAAS,CAACQ,IAAI,CAC5BC,QAAQ,IAAKA,QAAQ,CAACL,UAAU,KAAKA,UACxC,CAAC;EAED,IAAI,CAACG,QAAQ,EAAE;IACb,MAAM,IAAIG,KAAK,CAAC,qCAAqCP,UAAU,GAAG,CAAC;EACrE;EAEA,OAAOQ,eAAe,CAACJ,QAAQ,CAAC;AAClC;;AAEA;AACA;AACA;AACA,OAAO,SAASK,aAAaA,CAC3BV,IAAoB,EACmC;EACvD,OAAOW,OAAO,CAACX,IAAI,CAAC,IAAIY,KAAK,CAACC,OAAO,CAACb,IAAI,CAACc,UAAU,CAAC;AACxD;;AAEA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACvCf,IAAoB,EACmC;EACvD,OACEA,IAAI,KAAKgB,SAAS,IAAI,YAAY,IAAIhB,IAAI,IA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AAe,CAACU,IAAI,CAAC,CAAC;IAAEsB;EAAK,CAAC,KAAKA,IAAI,KAAK3B,UAAU,CAAC;EACvE,OAAO0B,OAAO,EAAEE,IAAI;AACtB;AAEA,SAASC,uBAAuBA,CAAChB,UAA0B,EAAW;EACpE,OAAOA,UAAU,CAACiB,IAAI,CACnBC,SAAS,IAAKA,SAAS,CAACC,IAAI,KAAKvC,aAAa,CAACwC,eAClD,CAAC;AACH;AAEA,MAAMC,yBAAyB,GAAG,CAACtC,cAAc,CAACM,IAAI,EAAEN,cAAc,CAACuB,MAAM,CAAC;AAE9E,OAAO,SAASgB,oBAAoBA,CAACpC,IAAU,EAAW;EACxD,IAAIA,IAAI,CAACE,UAAU,IAAI,CAACiC,yBAAyB,CAACX,QAAQ,CAACxB,IAAI,CAACE,UAAU,CAAC,EAAE;IAC3E,OAAO,KAAK;EACd;EACA,IAAIQ,aAAa,CAACV,IAAI,CAAC,IAAI8B,uBAAuB,CAAC9B,IAAI,CAACc,UAAU,CAAC,EAAE;IACnE,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASuB,uBAAuBA,CAACrC,IAAsB,EAAW;EACvE,IAAIA,IAAI,EAAEE,UAAU,KAAKL,cAAc,CAACuB,MAAM,EAAE;IAC9C,OAAO,IAAI;EACb;EACA,IAAI,CAACV,aAAa,CAACV,IAAI,CAAC,EAAE;IACxB,OAAO,KAAK;EACd;EACA,IAAIA,IAAI,CAACc,UAAU,CAACwB,MAAM,GAAG,CAAC,EAAE;IAC9B,OAAO,IAAI;EACb;EACA,IAAIR,uBAAuB,CAAC9B,IAAI,CAACc,UAAU,CAAC,EAAE;IAC5C,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  export { ControllerNames, ControllerTypes } from "./controller-types.js";
2
2
  export { PageTypes } from "./page-types.js";
3
- export { canSetRepeater, controllerNameFromPath, getPageDefaults, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasRepeater, isControllerName, omitFileUploadComponent } from "./helpers.js";
3
+ export { controllerNameFromPath, getPageDefaults, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasRepeater, isControllerName, omitFileUploadComponent, showRepeaterSettings } from "./helpers.js";
4
4
  export { ControllerPath, ControllerType } from "./enums.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ControllerNames","ControllerTypes","PageTypes","canSetRepeater","controllerNameFromPath","getPageDefaults","hasComponents","hasComponentsEvenIfNoNext","hasFormComponents","hasNext","hasRepeater","isControllerName","omitFileUploadComponent","ControllerPath","ControllerType"],"sources":["../../../src/pages/index.ts"],"sourcesContent":["export {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\n\nexport { PageTypes } from '~/src/pages/page-types.js'\n\nexport {\n canSetRepeater,\n controllerNameFromPath,\n getPageDefaults,\n hasComponents,\n hasComponentsEvenIfNoNext,\n hasFormComponents,\n hasNext,\n hasRepeater,\n isControllerName,\n omitFileUploadComponent\n} from '~/src/pages/helpers.js'\n\nexport { ControllerPath, ControllerType } from '~/src/pages/enums.js'\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,eAAe;AAGjB,SAASC,SAAS;AAElB,SACEC,cAAc,EACdC,sBAAsB,EACtBC,eAAe,EACfC,aAAa,EACbC,yBAAyB,EACzBC,iBAAiB,EACjBC,OAAO,EACPC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB;AAGzB,SAASC,cAAc,EAAEC,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ControllerNames","ControllerTypes","PageTypes","controllerNameFromPath","getPageDefaults","hasComponents","hasComponentsEvenIfNoNext","hasFormComponents","hasNext","hasRepeater","isControllerName","omitFileUploadComponent","showRepeaterSettings","ControllerPath","ControllerType"],"sources":["../../../src/pages/index.ts"],"sourcesContent":["export {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\n\nexport { PageTypes } from '~/src/pages/page-types.js'\n\nexport {\n controllerNameFromPath,\n getPageDefaults,\n hasComponents,\n hasComponentsEvenIfNoNext,\n hasFormComponents,\n hasNext,\n hasRepeater,\n isControllerName,\n omitFileUploadComponent,\n showRepeaterSettings\n} from '~/src/pages/helpers.js'\n\nexport { ControllerPath, ControllerType } from '~/src/pages/enums.js'\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,eAAe;AAGjB,SAASC,SAAS;AAElB,SACEC,sBAAsB,EACtBC,eAAe,EACfC,aAAa,EACbC,yBAAyB,EACzBC,iBAAiB,EACjBC,OAAO,EACPC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB,EACvBC,oBAAoB;AAGtB,SAASC,cAAc,EAAEC,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAA8B,MAAM,KAAK,CAAA;AAIhD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAA;AAelC,OAAO,EAGL,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAET,KAAK,MAAM,EAIZ,MAAM,qCAAqC,CAAA;AA2R5C,eAAO,MAAM,wBAAwB,sCAoBU,CAAA;AAE/C,eAAO,MAAM,eAAe,gCAkGZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAUiB,CAAA;AAE/C,eAAO,MAAM,yBAAyB,gCAMpC,CAAA;AAEF,eAAO,MAAM,sBAAsB,gCAUjC,CAAA;AAoDF,eAAO,MAAM,gBAAgB,0BASzB,CAAA;AAyCJ,eAAO,MAAM,0BAA0B,kEAWmB,CAAA;AAE1D;;;GAGG;AACH,eAAO,MAAM,UAAU,wBAmDnB,CAAA;AAEJ;;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,MAAM,MAAM,kCAAuB,CAAA"}
@@ -134,7 +134,7 @@ export interface ConditionWrapper {
134
134
  value: ConditionsModelData;
135
135
  }
136
136
  export interface ConditionWrapperV2 {
137
- name: string;
137
+ id: string;
138
138
  displayName: string;
139
139
  coordinator?: Coordinator;
140
140
  conditions: ConditionGroupDataV2;
@@ -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,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE/E,oBAAY,MAAM;IAChB,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,oBAAY,aAAa;IACvB,EAAE,IAAI;IACN,EAAE,IAAI;CACP;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,YAAY,CAAA;CACtB;AAED,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,MAAM,CAAC,EAAE,KAAK,CAAA;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MA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,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,EAAE,CAAA;IACrD,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,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"}
@@ -40,7 +40,7 @@ export declare function hasNext(page?: Partial<Page>): page is Extract<Page, {
40
40
  * @param {string} [nameOrPath] - Controller name or legacy controller path
41
41
  */
42
42
  export declare function controllerNameFromPath(nameOrPath?: ControllerType | string): ControllerType | undefined;
43
- export declare function canSetRepeater(page: Page): boolean;
43
+ export declare function showRepeaterSettings(page: Page): boolean;
44
44
  /**
45
45
  * High level check for whether file upload component should be omitted
46
46
  * @param { Page | undefined } page
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/pages/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,qCAAqC,CAAA;AAM5C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGrD;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,IAAI,EACnD,IAAI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AE;IAAE,IAAI,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,CAezC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,CAAC,EAAE,cAAc,GAAG,MAAM,8BAO1E;AAUD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAQxD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAcvE"}
@@ -1,5 +1,5 @@
1
1
  export { ControllerNames, ControllerTypes } from '../pages/controller-types.js';
2
2
  export { PageTypes } from '../pages/page-types.js';
3
- export { canSetRepeater, controllerNameFromPath, getPageDefaults, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasRepeater, isControllerName, omitFileUploadComponent } from '../pages/helpers.js';
3
+ export { controllerNameFromPath, getPageDefaults, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasRepeater, isControllerName, omitFileUploadComponent, showRepeaterSettings } from '../pages/helpers.js';
4
4
  export { ControllerPath, ControllerType } from '../pages/enums.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,yBAAyB,EACzB,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,yBAAyB,EACzB,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.468",
3
+ "version": "3.0.470",
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",
@@ -34,9 +34,9 @@
34
34
  "test:watch": "jest --color --watch"
35
35
  },
36
36
  "dependencies": {
37
- "marked": "^15.0.11",
37
+ "marked": "^15.0.12",
38
38
  "nanoid": "^5.0.7",
39
- "slug": "^10.0.0",
39
+ "slug": "^11.0.0",
40
40
  "uuid": "^11.1.0"
41
41
  },
42
42
  "devDependencies": {
@@ -1514,10 +1514,11 @@
1514
1514
  "type": "object",
1515
1515
  "description": "Condition schema for V2 forms",
1516
1516
  "properties": {
1517
- "name": {
1517
+ "id": {
1518
1518
  "type": "string",
1519
1519
  "description": "Unique identifier for the condition",
1520
- "title": "Name"
1520
+ "format": "uuid",
1521
+ "title": "Id"
1521
1522
  },
1522
1523
  "displayName": {
1523
1524
  "type": "string",
@@ -126,7 +126,7 @@ function convertConditionRefDataFromV2(
126
126
  }
127
127
 
128
128
  return {
129
- conditionName: refCondition.name,
129
+ conditionName: refCondition.id,
130
130
  conditionDisplayName: refCondition.displayName,
131
131
  coordinator
132
132
  }
@@ -157,10 +157,10 @@ export function convertConditionWrapperFromV2(
157
157
  }
158
158
 
159
159
  const newConditionWrapper: ConditionWrapper = {
160
- name: conditionWrapper.name,
160
+ name: conditionWrapper.id,
161
161
  displayName: conditionWrapper.displayName,
162
162
  value: {
163
- name: conditionWrapper.name,
163
+ name: conditionWrapper.id,
164
164
  conditions: conditionWrapper.conditions.map((condition, index) => {
165
165
  let newCondition: ConditionData | ConditionRefData
166
166
 
@@ -49,7 +49,7 @@ const idSchema = idSchemaOptional.default(() => uuidV4())
49
49
  const conditionIdRef = Joi.ref('/conditions', {
50
50
  in: true,
51
51
  adjust: (conditions: ConditionWrapperV2[]) =>
52
- conditions.map((condition) => condition.name)
52
+ conditions.map((condition) => condition.id)
53
53
  })
54
54
 
55
55
  const componentIdRefSchema = Joi.ref('/pages', {
@@ -133,21 +133,22 @@ const conditionValueSchema = Joi.object<ConditionValueData>()
133
133
  .description('Human-readable version of the value for display purposes')
134
134
  })
135
135
 
136
- const condition2StringValueDataSchema = Joi.object<ConditionStringValueDataV2>()
137
- .description('String value specification for a condition')
138
- .keys({
139
- type: Joi.string()
140
- .trim()
141
- .valid('StringValue')
142
- .required()
143
- .description('Type of the condition value, should be "StringValue"'),
144
- value: Joi.string()
145
- .trim()
146
- .required()
147
- .description('The actual value to compare against')
148
- })
136
+ const conditionStringValueDataSchemaV2 =
137
+ Joi.object<ConditionStringValueDataV2>()
138
+ .description('String value specification for a condition')
139
+ .keys({
140
+ type: Joi.string()
141
+ .trim()
142
+ .valid('StringValue')
143
+ .required()
144
+ .description('Type of the condition value, should be "StringValue"'),
145
+ value: Joi.string()
146
+ .trim()
147
+ .required()
148
+ .description('The actual value to compare against')
149
+ })
149
150
 
150
- const condition2ListItemRefDataSchema =
151
+ const conditionListItemRefDataSchemaV2 =
151
152
  Joi.object<ConditionListItemRefValueDataV2>()
152
153
  .description('List item ref specification for a condition')
153
154
  .keys({
@@ -209,7 +210,7 @@ const conditionRefSchema = Joi.object<ConditionRefData>()
209
210
  )
210
211
  })
211
212
 
212
- const condition2RefDataSchema = Joi.object<ConditionRefDataV2>()
213
+ const conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()
213
214
  .description('Reference to a named condition defined elsewhere')
214
215
  .keys({
215
216
  id: idSchema.description('Unique identifier for the referenced condition'),
@@ -243,7 +244,7 @@ const conditionSchema = Joi.object<ConditionData>()
243
244
  )
244
245
  })
245
246
 
246
- const condition2DataSchema = Joi.object<ConditionDataV2>()
247
+ const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()
247
248
  .description('Condition definition')
248
249
  .keys({
249
250
  id: idSchema.description(
@@ -262,8 +263,8 @@ const condition2DataSchema = Joi.object<ConditionDataV2>()
262
263
  .description('Comparison operator (equals, greaterThan, contains, etc.)'),
263
264
  value: Joi.alternatives()
264
265
  .try(
265
- condition2StringValueDataSchema,
266
- condition2ListItemRefDataSchema,
266
+ conditionStringValueDataSchemaV2,
267
+ conditionListItemRefDataSchemaV2,
267
268
  relativeDateValueDataSchema
268
269
  )
269
270
  .description(
@@ -324,9 +325,7 @@ const conditionWrapperSchema = Joi.object<ConditionWrapper>()
324
325
  export const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()
325
326
  .description('Container for a named condition with its definition')
326
327
  .keys({
327
- name: Joi.string()
328
- .trim()
329
- .description('Unique identifier for the condition'),
328
+ id: idSchema.description('Unique identifier for the condition'),
330
329
  displayName: Joi.string()
331
330
  .trim()
332
331
  .description('Human-readable name for display in the UI'),
@@ -337,7 +336,7 @@ export const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()
337
336
  ),
338
337
  conditions: Joi.array<ConditionGroupDataV2>()
339
338
  .items(
340
- Joi.alternatives().try(condition2DataSchema, condition2RefDataSchema)
339
+ Joi.alternatives().try(conditionDataSchemaV2, conditionRefDataSchemaV2)
341
340
  )
342
341
  .description('Array of conditions or condition references')
343
342
  })
@@ -926,7 +925,7 @@ export const formDefinitionV2Schema = formDefinitionSchema
926
925
  .description('Lists schema for V2 forms'),
927
926
  conditions: Joi.array<ConditionWrapperV2>()
928
927
  .items(conditionWrapperSchemaV2)
929
- .unique('name')
928
+ .unique('id')
930
929
  .unique('displayName')
931
930
  .description('Named conditions used for form logic')
932
931
  })
@@ -168,7 +168,7 @@ export interface ConditionWrapper {
168
168
  }
169
169
 
170
170
  export interface ConditionWrapperV2 {
171
- name: string
171
+ id: string
172
172
  displayName: string
173
173
  coordinator?: Coordinator
174
174
  conditions: ConditionGroupDataV2
@@ -121,8 +121,10 @@ function includesFileUploadField(components: ComponentDef[]): boolean {
121
121
  )
122
122
  }
123
123
 
124
- export function canSetRepeater(page: Page): boolean {
125
- if (page.controller && page.controller !== ControllerType.Page) {
124
+ const SHOW_REPEATER_CONTROLLERS = [ControllerType.Page, ControllerType.Repeat]
125
+
126
+ export function showRepeaterSettings(page: Page): boolean {
127
+ if (page.controller && !SHOW_REPEATER_CONTROLLERS.includes(page.controller)) {
126
128
  return false
127
129
  }
128
130
  if (hasComponents(page) && includesFileUploadField(page.components)) {
@@ -6,7 +6,6 @@ export {
6
6
  export { PageTypes } from '~/src/pages/page-types.js'
7
7
 
8
8
  export {
9
- canSetRepeater,
10
9
  controllerNameFromPath,
11
10
  getPageDefaults,
12
11
  hasComponents,
@@ -15,7 +14,8 @@ export {
15
14
  hasNext,
16
15
  hasRepeater,
17
16
  isControllerName,
18
- omitFileUploadComponent
17
+ omitFileUploadComponent,
18
+ showRepeaterSettings
19
19
  } from '~/src/pages/helpers.js'
20
20
 
21
21
  export { ControllerPath, ControllerType } from '~/src/pages/enums.js'