@defra/forms-model 3.0.477 → 3.0.479

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.
@@ -3,6 +3,8 @@ export let ConditionType = /*#__PURE__*/function (ConditionType) {
3
3
  ConditionType["RelativeDate"] = "RelativeDate";
4
4
  ConditionType["StringValue"] = "StringValue";
5
5
  ConditionType["BooleanValue"] = "BooleanValue";
6
+ ConditionType["NumberValue"] = "NumberValue";
7
+ ConditionType["DateValue"] = "DateValue";
6
8
  ConditionType["ListItemRef"] = "ListItemRef";
7
9
  return ConditionType;
8
10
  }({});
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["ConditionType","Coordinator","Operator","OperatorName","DateDirections","DateUnits"],"sources":["../../../src/conditions/enums.ts"],"sourcesContent":["export enum ConditionType {\n Value = 'Value',\n RelativeDate = 'RelativeDate',\n StringValue = 'StringValue',\n BooleanValue = 'BooleanValue',\n ListItemRef = 'ListItemRef'\n}\n\nexport enum Coordinator {\n AND = 'and',\n OR = 'or'\n}\n\nexport enum Operator {\n Is = '==',\n IsNot = '!=',\n Contains = 'in',\n IsAtLeast = '>=',\n IsAtMost = '<=',\n IsLessThan = '<',\n IsMoreThan = '>'\n}\n\nexport enum OperatorName {\n Is = 'is',\n IsNot = 'is not',\n IsLongerThan = 'is longer than',\n IsShorterThan = 'is shorter than',\n HasLength = 'has length',\n Contains = 'contains',\n DoesNotContain = 'does not contain',\n IsAtLeast = 'is at least',\n IsAtMost = 'is at most',\n IsLessThan = 'is less than',\n IsMoreThan = 'is more than',\n IsBefore = 'is before',\n IsAfter = 'is after'\n}\n\nexport enum DateDirections {\n FUTURE = 'in the future',\n PAST = 'in the past'\n}\n\nexport enum DateUnits {\n YEARS = 'years',\n MONTHS = 'months',\n DAYS = 'days'\n}\n"],"mappings":"AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAQzB,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAKvB,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAUpB,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAgBxB,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAK1B,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["ConditionType","Coordinator","Operator","OperatorName","DateDirections","DateUnits"],"sources":["../../../src/conditions/enums.ts"],"sourcesContent":["export enum ConditionType {\n Value = 'Value',\n RelativeDate = 'RelativeDate',\n StringValue = 'StringValue',\n BooleanValue = 'BooleanValue',\n NumberValue = 'NumberValue',\n DateValue = 'DateValue',\n ListItemRef = 'ListItemRef'\n}\n\nexport enum Coordinator {\n AND = 'and',\n OR = 'or'\n}\n\nexport enum Operator {\n Is = '==',\n IsNot = '!=',\n Contains = 'in',\n IsAtLeast = '>=',\n IsAtMost = '<=',\n IsLessThan = '<',\n IsMoreThan = '>'\n}\n\nexport enum OperatorName {\n Is = 'is',\n IsNot = 'is not',\n IsLongerThan = 'is longer than',\n IsShorterThan = 'is shorter than',\n HasLength = 'has length',\n Contains = 'contains',\n DoesNotContain = 'does not contain',\n IsAtLeast = 'is at least',\n IsAtMost = 'is at most',\n IsLessThan = 'is less than',\n IsMoreThan = 'is more than',\n IsBefore = 'is before',\n IsAfter = 'is after'\n}\n\nexport enum DateDirections {\n FUTURE = 'in the future',\n PAST = 'in the past'\n}\n\nexport enum DateUnits {\n YEARS = 'years',\n MONTHS = 'months',\n DAYS = 'days'\n}\n"],"mappings":"AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAUzB,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAKvB,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAUpB,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAgBxB,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAK1B,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA","ignoreList":[]}
@@ -7,6 +7,6 @@ export { ConditionGroup } from "./condition-group.js";
7
7
  export { ConditionsModel } from "./condition-model.js";
8
8
  export { ConditionGroupDef } from "./condition-group-def.js";
9
9
  export { getConditionV2, hasConditionField, hasConditionGroup, hasConditionName, hasNestedCondition, isDuplicateCondition, toExpression, toPresentationString } from "./helpers.js";
10
- export { convertConditionWrapperFromV2, isConditionBooleanValueDataV2, isConditionListItemRefValueDataV2, isConditionStringValueDataV2, isConditionWrapper, isConditionWrapperV2 } from "./migration.js";
10
+ export { convertConditionWrapperFromV2, isConditionBooleanValueDataV2, isConditionDateValueDataV2, isConditionListItemRefValueDataV2, isConditionNumberValueDataV2, isConditionStringValueDataV2, isConditionWrapper, isConditionWrapperV2 } from "./migration.js";
11
11
  export { ConditionType, Coordinator, DateDirections, DateUnits, Operator, OperatorName } from "./enums.js";
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["absoluteDateOperatorNames","getExpression","getOperatorNames","relativeDateOperatorNames","ConditionValue","RelativeDateValue","conditionValueFrom","ConditionField","Condition","ConditionRef","ConditionGroup","ConditionsModel","ConditionGroupDef","getConditionV2","hasConditionField","hasConditionGroup","hasConditionName","hasNestedCondition","isDuplicateCondition","toExpression","toPresentationString","convertConditionWrapperFromV2","isConditionBooleanValueDataV2","isConditionListItemRefValueDataV2","isConditionStringValueDataV2","isConditionWrapper","isConditionWrapperV2","ConditionType","Coordinator","DateDirections","DateUnits","Operator","OperatorName"],"sources":["../../../src/conditions/index.ts"],"sourcesContent":["export {\n absoluteDateOperatorNames,\n getExpression,\n getOperatorNames,\n relativeDateOperatorNames\n} from '~/src/conditions/condition-operators.js'\n\nexport {\n ConditionValue,\n RelativeDateValue,\n conditionValueFrom\n} from '~/src/conditions/condition-values.js'\n\nexport { ConditionField } from '~/src/conditions/condition-field.js'\nexport { Condition } from '~/src/conditions/condition.js'\nexport { ConditionRef } from '~/src/conditions/condition-ref.js'\nexport { ConditionGroup } from '~/src/conditions/condition-group.js'\nexport { ConditionsModel } from '~/src/conditions/condition-model.js'\nexport { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'\nexport {\n getConditionV2,\n hasConditionField,\n hasConditionGroup,\n hasConditionName,\n hasNestedCondition,\n isDuplicateCondition,\n toExpression,\n toPresentationString\n} from '~/src/conditions/helpers.js'\n\nexport {\n convertConditionWrapperFromV2,\n isConditionBooleanValueDataV2,\n isConditionListItemRefValueDataV2,\n isConditionStringValueDataV2,\n isConditionWrapper,\n isConditionWrapperV2,\n type RuntimeFormModel\n} from '~/src/conditions/migration.js'\n\nexport {\n ConditionType,\n Coordinator,\n DateDirections,\n DateUnits,\n Operator,\n OperatorName\n} from '~/src/conditions/enums.js'\n"],"mappings":"AAAA,SACEA,yBAAyB,EACzBC,aAAa,EACbC,gBAAgB,EAChBC,yBAAyB;AAG3B,SACEC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB;AAGpB,SAASC,cAAc;AACvB,SAASC,SAAS;AAClB,SAASC,YAAY;AACrB,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SACEC,cAAc,EACdC,iBAAiB,EACjBC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,oBAAoB,EACpBC,YAAY,EACZC,oBAAoB;AAGtB,SACEC,6BAA6B,EAC7BC,6BAA6B,EAC7BC,iCAAiC,EACjCC,4BAA4B,EAC5BC,kBAAkB,EAClBC,oBAAoB;AAItB,SACEC,aAAa,EACbC,WAAW,EACXC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["absoluteDateOperatorNames","getExpression","getOperatorNames","relativeDateOperatorNames","ConditionValue","RelativeDateValue","conditionValueFrom","ConditionField","Condition","ConditionRef","ConditionGroup","ConditionsModel","ConditionGroupDef","getConditionV2","hasConditionField","hasConditionGroup","hasConditionName","hasNestedCondition","isDuplicateCondition","toExpression","toPresentationString","convertConditionWrapperFromV2","isConditionBooleanValueDataV2","isConditionDateValueDataV2","isConditionListItemRefValueDataV2","isConditionNumberValueDataV2","isConditionStringValueDataV2","isConditionWrapper","isConditionWrapperV2","ConditionType","Coordinator","DateDirections","DateUnits","Operator","OperatorName"],"sources":["../../../src/conditions/index.ts"],"sourcesContent":["export {\n absoluteDateOperatorNames,\n getExpression,\n getOperatorNames,\n relativeDateOperatorNames\n} from '~/src/conditions/condition-operators.js'\n\nexport {\n ConditionValue,\n RelativeDateValue,\n conditionValueFrom\n} from '~/src/conditions/condition-values.js'\n\nexport { ConditionField } from '~/src/conditions/condition-field.js'\nexport { Condition } from '~/src/conditions/condition.js'\nexport { ConditionRef } from '~/src/conditions/condition-ref.js'\nexport { ConditionGroup } from '~/src/conditions/condition-group.js'\nexport { ConditionsModel } from '~/src/conditions/condition-model.js'\nexport { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'\nexport {\n getConditionV2,\n hasConditionField,\n hasConditionGroup,\n hasConditionName,\n hasNestedCondition,\n isDuplicateCondition,\n toExpression,\n toPresentationString\n} from '~/src/conditions/helpers.js'\n\nexport {\n convertConditionWrapperFromV2,\n isConditionBooleanValueDataV2,\n isConditionDateValueDataV2,\n isConditionListItemRefValueDataV2,\n isConditionNumberValueDataV2,\n isConditionStringValueDataV2,\n isConditionWrapper,\n isConditionWrapperV2,\n type RuntimeFormModel\n} from '~/src/conditions/migration.js'\n\nexport {\n ConditionType,\n Coordinator,\n DateDirections,\n DateUnits,\n Operator,\n OperatorName\n} from '~/src/conditions/enums.js'\n"],"mappings":"AAAA,SACEA,yBAAyB,EACzBC,aAAa,EACbC,gBAAgB,EAChBC,yBAAyB;AAG3B,SACEC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB;AAGpB,SAASC,cAAc;AACvB,SAASC,SAAS;AAClB,SAASC,YAAY;AACrB,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,iBAAiB;AAC1B,SACEC,cAAc,EACdC,iBAAiB,EACjBC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,oBAAoB,EACpBC,YAAY,EACZC,oBAAoB;AAGtB,SACEC,6BAA6B,EAC7BC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,iCAAiC,EACjCC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,kBAAkB,EAClBC,oBAAoB;AAItB,SACEC,aAAa,EACbC,WAAW,EACXC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,YAAY","ignoreList":[]}
@@ -8,6 +8,12 @@ export function isConditionStringValueDataV2(value) {
8
8
  export function isConditionBooleanValueDataV2(value) {
9
9
  return value.type === ConditionType.BooleanValue;
10
10
  }
11
+ export function isConditionNumberValueDataV2(value) {
12
+ return value.type === ConditionType.NumberValue;
13
+ }
14
+ export function isConditionDateValueDataV2(value) {
15
+ return value.type === ConditionType.DateValue;
16
+ }
11
17
  function getListItem(model, listId, itemId) {
12
18
  const foundList = model.getListById(listId);
13
19
  if (!foundList) {
@@ -27,13 +33,26 @@ function createConditionValueDataFromListItemRefV2(value, model) {
27
33
  value: refValue.value.toString()
28
34
  };
29
35
  }
30
- function createConditionValueDataFromStringValueDataV2(value) {
36
+ function createConditionValueDataFromStringOrDateValueDataV2(value) {
31
37
  return {
32
38
  type: ConditionType.Value,
33
39
  value: value.value,
34
40
  display: value.value
35
41
  };
36
42
  }
43
+ function createConditionValueDataFromStringValueDataV2(value) {
44
+ return createConditionValueDataFromStringOrDateValueDataV2(value);
45
+ }
46
+ function createConditionValueDataFromDateValueDataV2(value) {
47
+ return createConditionValueDataFromStringOrDateValueDataV2(value);
48
+ }
49
+ function createConditionValueDataFromNumberValueDataV2(value) {
50
+ return {
51
+ type: ConditionType.Value,
52
+ value: value.value.toString(),
53
+ display: value.value.toString()
54
+ };
55
+ }
37
56
  function createConditionValueDataFromBooleanValueDataV2(value) {
38
57
  return {
39
58
  type: ConditionType.Value,
@@ -56,6 +75,10 @@ function convertConditionDataV2(model, condition, coordinator) {
56
75
  newValue = createConditionValueDataFromStringValueDataV2(condition.value);
57
76
  } else if (isConditionBooleanValueDataV2(condition.value)) {
58
77
  newValue = createConditionValueDataFromBooleanValueDataV2(condition.value);
78
+ } else if (isConditionNumberValueDataV2(condition.value)) {
79
+ newValue = createConditionValueDataFromNumberValueDataV2(condition.value);
80
+ } else if (isConditionDateValueDataV2(condition.value)) {
81
+ newValue = createConditionValueDataFromDateValueDataV2(condition.value);
59
82
  } else {
60
83
  newValue = condition.value;
61
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"migration.js","names":["ConditionType","isConditionListItemRefValueDataV2","value","type","ListItemRef","isConditionStringValueDataV2","StringValue","isConditionBooleanValueDataV2","BooleanValue","getListItem","model","listId","itemId","foundList","getListById","Error","item","items","find","id","createConditionValueDataFromListItemRefV2","refValue","display","text","Value","toString","createConditionValueDataFromStringValueDataV2","createConditionValueDataFromBooleanValueDataV2","isConditionDataV2","condition","convertConditionDataV2","coordinator","component","getComponentById","componentId","newValue","field","name","title","operator","convertConditionRefDataFromV2","refCondition","getConditionById","conditionId","conditionName","displayName","conditionDisplayName","isConditionWrapperV2","wrapper","Array","isArray","isConditionWrapper","convertConditionWrapperFromV2","conditionWrapper","length","newConditionWrapper","conditions","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 ConditionBooleanValueDataV2,\n type ConditionData,\n type ConditionDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type ConditionValueDataV2\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\nexport function isConditionListItemRefValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionListItemRefValueDataV2 {\n return value.type === ConditionType.ListItemRef\n}\n\nexport function isConditionStringValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionStringValueDataV2 {\n return value.type === ConditionType.StringValue\n}\n\nexport function isConditionBooleanValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionBooleanValueDataV2 {\n return value.type === ConditionType.BooleanValue\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 createConditionValueDataFromBooleanValueDataV2(\n value: ConditionBooleanValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value.toString(),\n display: value.value ? 'Yes' : 'No'\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 if (isConditionBooleanValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromBooleanValueDataV2(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.displayName,\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).items)\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.items.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.items.map((condition, index) => {\n let newCondition: ConditionData | ConditionRefData\n\n if (isConditionDataV2(condition)) {\n newCondition = convertConditionDataV2(\n model,\n condition,\n index > 0 ? coordinator : undefined\n )\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;AAkBtB,OAAO,SAASC,iCAAiCA,CAC/CC,KAA2B,EACe;EAC1C,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACI,WAAW;AACjD;AAEA,OAAO,SAASC,4BAA4BA,CAC1CH,KAA2B,EACU;EACrC,OAAOA,KA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B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH,CAAC,MAAM;UACLD,YAAY,GAAGnB,6BAA6B,CAC1C9B,KAAK,EACLmB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH;QAEA,OAAOD,YAAY;MACrB,CAAC;IACH;EACF,CAAC;EAED,OAAOJ,mBAAmB;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"migration.js","names":["ConditionType","isConditionListItemRefValueDataV2","value","type","ListItemRef","isConditionStringValueDataV2","StringValue","isConditionBooleanValueDataV2","BooleanValue","isConditionNumberValueDataV2","NumberValue","isConditionDateValueDataV2","DateValue","getListItem","model","listId","itemId","foundList","getListById","Error","item","items","find","id","createConditionValueDataFromListItemRefV2","refValue","display","text","Value","toString","createConditionValueDataFromStringOrDateValueDataV2","createConditionValueDataFromStringValueDataV2","createConditionValueDataFromDateValueDataV2","createConditionValueDataFromNumberValueDataV2","createConditionValueDataFromBooleanValueDataV2","isConditionDataV2","condition","convertConditionDataV2","coordinator","component","getComponentById","componentId","newValue","field","name","title","operator","convertConditionRefDataFromV2","refCondition","getConditionById","conditionId","conditionName","displayName","conditionDisplayName","isConditionWrapperV2","wrapper","Array","isArray","isConditionWrapper","convertConditionWrapperFromV2","conditionWrapper","length","newConditionWrapper","conditions","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 ConditionBooleanValueDataV2,\n type ConditionData,\n type ConditionDataV2,\n type ConditionDateValueDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionNumberValueDataV2,\n type ConditionRefData,\n type ConditionRefDataV2,\n type ConditionStringValueDataV2,\n type ConditionValueData,\n type ConditionValueDataV2\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\nexport function isConditionListItemRefValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionListItemRefValueDataV2 {\n return value.type === ConditionType.ListItemRef\n}\n\nexport function isConditionStringValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionStringValueDataV2 {\n return value.type === ConditionType.StringValue\n}\n\nexport function isConditionBooleanValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionBooleanValueDataV2 {\n return value.type === ConditionType.BooleanValue\n}\n\nexport function isConditionNumberValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionNumberValueDataV2 {\n return value.type === ConditionType.NumberValue\n}\n\nexport function isConditionDateValueDataV2(\n value: ConditionValueDataV2\n): value is ConditionDateValueDataV2 {\n return value.type === ConditionType.DateValue\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 createConditionValueDataFromStringOrDateValueDataV2(\n value: ConditionStringValueDataV2 | ConditionDateValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value,\n display: value.value\n }\n}\n\nfunction createConditionValueDataFromStringValueDataV2(\n value: ConditionStringValueDataV2\n): ConditionValueData {\n return createConditionValueDataFromStringOrDateValueDataV2(value)\n}\n\nfunction createConditionValueDataFromDateValueDataV2(\n value: ConditionDateValueDataV2\n): ConditionValueData {\n return createConditionValueDataFromStringOrDateValueDataV2(value)\n}\n\nfunction createConditionValueDataFromNumberValueDataV2(\n value: ConditionNumberValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value.toString(),\n display: value.value.toString()\n }\n}\n\nfunction createConditionValueDataFromBooleanValueDataV2(\n value: ConditionBooleanValueDataV2\n): ConditionValueData {\n return {\n type: ConditionType.Value,\n value: value.value.toString(),\n display: value.value ? 'Yes' : 'No'\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 if (isConditionBooleanValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromBooleanValueDataV2(condition.value)\n } else if (isConditionNumberValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromNumberValueDataV2(condition.value)\n } else if (isConditionDateValueDataV2(condition.value)) {\n newValue = createConditionValueDataFromDateValueDataV2(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.displayName,\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).items)\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.items.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.items.map((condition, index) => {\n let newCondition: ConditionData | ConditionRefData\n\n if (isConditionDataV2(condition)) {\n newCondition = convertConditionDataV2(\n model,\n condition,\n index > 0 ? coordinator : undefined\n )\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;AAoBtB,OAAO,SAASC,iCAAiCA,CAC/CC,KAA2B,EACe;EAC1C,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACI,WAAW;AACjD;AAEA,OAAO,SAASC,4BAA4BA,CAC1CH,KAA2B,EACU;EACrC,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACM,WAAW;AACjD;AAEA,OAAO,SAASC,6BAA6BA,CAC3CL,KAA2B,EACW;EACtC,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACQ,YAAY;AAClD;AAEA,OAAO,SAASC,4BAA4BA,CAC1CP,KAA2B,EACU;EACrC,OAAOA,KAAK,CAACC,IAAI,KAAKH,aAAa,CAACU,WAAW;AACjD;AAEA,O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ClB,IAAIwB,WAAW;EAEf,IAAIsB,gBAAgB,CAACvC,KAAK,CAACwC,MAAM,GAAG,CAAC,IAAI,CAACD,gBAAgB,CAACtB,WAAW,EAAE;IACtE,MAAM,IAAInB,KAAK,CAAC,iDAAiD,CAAC;EACpE,CAAC,MAAM;IACLmB,WAAW,GAAGsB,gBAAgB,CAACtB,WAAW;EAC5C;EAEA,MAAMwB,mBAAqC,GAAG;IAC5ClB,IAAI,EAAEgB,gBAAgB,CAACrC,EAAE;IACzB6B,WAAW,EAAEQ,gBAAgB,CAACR,WAAW;IACzClD,KAAK,EAAE;MACL0C,IAAI,EAAEgB,gBAAgB,CAACrC,EAAE;MACzBwC,UAAU,EAAEH,gBAAgB,CAACvC,KAAK,CAAC2C,GAAG,CAAC,CAAC5B,SAAS,EAAE6B,KAAK,KAAK;QAC3D,IAAIC,YAA8C;QAElD,IAAI/B,iBAAiB,CAACC,SAAS,CAAC,EAAE;UAChC8B,YAAY,GAAG7B,sBAAsB,CACnCvB,KAAK,EACLsB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH,CAAC,MAAM;UACLD,YAAY,GAAGnB,6BAA6B,CAC1CjC,KAAK,EACLsB,SAAS,EACT6B,KAAK,GAAG,CAAC,GAAG3B,WAAW,GAAG6B,SAC5B,CAAC;QACH;QAEA,OAAOD,YAAY;MACrB,CAAC;IACH;EACF,CAAC;EAED,OAAOJ,mBAAmB;AAC5B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/conditions/types.ts"],"sourcesContent":["import {\n type ComponentDef,\n type ConditionalComponentType\n} from '~/src/components/types.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport {\n type ConditionType,\n type Coordinator,\n type DateDirections,\n type DateUnits,\n type OperatorName\n} from '~/src/conditions/enums.js'\n\nexport interface ConditionValueData {\n type: ConditionType.Value\n value: string\n display: string\n}\n\nexport interface ConditionStringValueDataV2 {\n type: ConditionType.StringValue\n value: string\n}\n\nexport interface ConditionBooleanValueDataV2 {\n type: ConditionType.BooleanValue\n value: boolean\n}\n\nexport interface ConditionListItemRefValueDataV2 {\n type: ConditionType.ListItemRef\n listId: string\n itemId: string\n}\n\nexport interface RelativeDateValueData {\n type: ConditionType.RelativeDate\n period: string\n unit: DateUnits\n direction: DateDirections\n}\n\nexport interface ConditionFieldData {\n name: string\n type: ConditionalComponentType\n display: string\n}\n\nexport interface ConditionData {\n field: ConditionFieldData\n operator: OperatorName\n value: ConditionValueData | RelativeDateValueData\n coordinator?: Coordinator\n}\n\nexport type ConditionValueDataV2 =\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | ConditionBooleanValueDataV2\n | RelativeDateValueData\n\nexport interface ConditionDataV2 {\n id: string\n componentId: string\n operator: OperatorName\n value: ConditionValueDataV2\n}\n\nexport interface ConditionRefData {\n conditionName: string\n conditionDisplayName: string\n coordinator?: Coordinator\n}\n\nexport interface ConditionRefDataV2 {\n id: string\n conditionId: string\n}\n\nexport interface ConditionGroupData {\n conditions: (ConditionData | ConditionRefData | ConditionGroupData)[]\n}\n\nexport type ConditionGroupDataV2 = (ConditionDataV2 | ConditionRefDataV2)[]\n\nexport interface ConditionsModelData extends ConditionGroupData {\n name: string\n}\n\nexport interface OperatorDefinition {\n expression: (\n component: Pick<ComponentDef, 'type' | 'name'>,\n conditionValue: Condition['value']\n ) => string\n}\n\nexport type Conditionals = Record<OperatorName, OperatorDefinition>\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/conditions/types.ts"],"sourcesContent":["import {\n type ComponentDef,\n type ConditionalComponentType\n} from '~/src/components/types.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport {\n type ConditionType,\n type Coordinator,\n type DateDirections,\n type DateUnits,\n type OperatorName\n} from '~/src/conditions/enums.js'\n\nexport interface ConditionValueData {\n type: ConditionType.Value\n value: string\n display: string\n}\n\nexport interface ConditionStringValueDataV2 {\n type: ConditionType.StringValue\n value: string\n}\n\nexport interface ConditionBooleanValueDataV2 {\n type: ConditionType.BooleanValue\n value: boolean\n}\n\nexport interface ConditionNumberValueDataV2 {\n type: ConditionType.NumberValue\n value: number\n}\n\nexport interface ConditionDateValueDataV2 {\n type: ConditionType.DateValue\n value: string\n}\n\nexport interface ConditionListItemRefValueDataV2 {\n type: ConditionType.ListItemRef\n listId: string\n itemId: string\n}\n\nexport interface RelativeDateValueData {\n type: ConditionType.RelativeDate\n period: string\n unit: DateUnits\n direction: DateDirections\n}\n\nexport interface ConditionFieldData {\n name: string\n type: ConditionalComponentType\n display: string\n}\n\nexport interface ConditionData {\n field: ConditionFieldData\n operator: OperatorName\n value: ConditionValueData | RelativeDateValueData\n coordinator?: Coordinator\n}\n\nexport type ConditionValueDataV2 =\n | ConditionListItemRefValueDataV2\n | ConditionStringValueDataV2\n | ConditionBooleanValueDataV2\n | ConditionNumberValueDataV2\n | ConditionDateValueDataV2\n | RelativeDateValueData\n\nexport interface ConditionDataV2 {\n id: string\n componentId: string\n operator: OperatorName\n value: ConditionValueDataV2\n}\n\nexport interface ConditionRefData {\n conditionName: string\n conditionDisplayName: string\n coordinator?: Coordinator\n}\n\nexport interface ConditionRefDataV2 {\n id: string\n conditionId: string\n}\n\nexport interface ConditionGroupData {\n conditions: (ConditionData | ConditionRefData | ConditionGroupData)[]\n}\n\nexport type ConditionGroupDataV2 = (ConditionDataV2 | ConditionRefDataV2)[]\n\nexport interface ConditionsModelData extends ConditionGroupData {\n name: string\n}\n\nexport interface OperatorDefinition {\n expression: (\n component: Pick<ComponentDef, 'type' | 'name'>,\n conditionValue: Condition['value']\n ) => string\n}\n\nexport type Conditionals = Record<OperatorName, OperatorDefinition>\n"],"mappings":"","ignoreList":[]}
@@ -1,9 +1,11 @@
1
- import Joi from 'joi';
1
+ import JoiDate from '@joi/date';
2
+ import JoiBase from 'joi';
2
3
  import { v4 as uuidV4 } from 'uuid';
3
4
  import { ComponentType } from "../../components/enums.js";
4
5
  import { SchemaVersion } from "./types.js";
5
6
  import { ControllerType } from "../../pages/enums.js";
6
7
  import { hasComponents } from "../../pages/helpers.js";
8
+ const Joi = JoiBase.extend(JoiDate);
7
9
  const idSchemaOptional = Joi.string().uuid();
8
10
  const idSchema = idSchemaOptional.default(() => uuidV4());
9
11
  const conditionIdRef = Joi.ref('/conditions', {
@@ -45,6 +47,14 @@ const conditionBooleanValueDataSchemaV2 = Joi.object().description('Boolean valu
45
47
  type: Joi.string().trim().valid('BooleanValue').required().description('Type of the condition value, should be "BooleanValue"'),
46
48
  value: Joi.boolean().required().description('The actual value to compare against')
47
49
  });
50
+ const conditionNumberValueDataSchemaV2 = Joi.object().description('Number value specification for a condition').keys({
51
+ type: Joi.string().trim().valid('NumberValue').required().description('Type of the condition value, should be "NumberValue"'),
52
+ value: Joi.number().required().description('The actual value to compare against')
53
+ });
54
+ const conditionDateValueDataSchemaV2 = Joi.object().description('Date value specification for a condition').keys({
55
+ type: Joi.string().trim().valid('DateValue').required().description('Type of the condition value, should be "DateValue"'),
56
+ value: Joi.date().format('YYYY-MM-DD').raw().required().description('The actual value to compare against')
57
+ });
48
58
  const conditionListItemRefDataSchemaV2 = Joi.object().description('List item ref specification for a condition').keys({
49
59
  type: Joi.string().trim().valid('ListItemRef').required().description('Type of the condition value, should be "ListItemRef"'),
50
60
  listId: Joi.string().trim().required().when('/lists', {
@@ -87,7 +97,7 @@ export const conditionDataSchemaV2 = Joi.object().description('Condition definit
87
97
  then: Joi.valid(componentIdRefSchema)
88
98
  }).description('Reference to the component id being evaluated in this condition'),
89
99
  operator: Joi.string().trim().required().description('Comparison operator (equals, greaterThan, contains, etc.)'),
90
- value: Joi.alternatives().try(conditionStringValueDataSchemaV2, conditionBooleanValueDataSchemaV2, conditionListItemRefDataSchemaV2, relativeDateValueDataSchema).required().description('Value to compare the field against, either fixed or relative date')
100
+ value: Joi.alternatives().try(conditionStringValueDataSchemaV2, conditionBooleanValueDataSchemaV2, conditionNumberValueDataSchemaV2, conditionDateValueDataSchemaV2, conditionListItemRefDataSchemaV2, relativeDateValueDataSchema).required().description('Value to compare the field against, either fixed or relative date')
91
101
  });
92
102
  const conditionGroupSchema = Joi.object().description('Group of conditions combined with logical operators').keys({
93
103
  conditions: Joi.array().items(Joi.alternatives().try(conditionSchema, conditionRefSchema, Joi.link('#conditionGroupSchema'))).description('Array of conditions or condition references in this group')
@@ -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","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","conditionBooleanValueDataSchemaV2","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","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","min","max","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","otherwise","allow","hint","options","rows","number","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","length","componentSchemaV2","componentPayloadSchemaV2","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","pagePayloadSchemaV2","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 ConditionBooleanValueDataV2,\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 conditionBooleanValueDataSchemaV2 =\n Joi.object<ConditionBooleanValueDataV2>()\n .description('Boolean value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('BooleanValue')\n .required()\n .description('Type of the condition value, should be \"BooleanValue\"'),\n value: Joi.boolean()\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 .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .trim()\n .valid('RelativeDate')\n .required()\n .description('Type of the condition value, should be \"RelativeDate\"'),\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nexport const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(\n conditionStringValueDataSchemaV2,\n conditionBooleanValueDataSchemaV2,\n conditionListItemRefDataSchemaV2,\n relativeDateValueDataSchema\n )\n .required()\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .when('items', { is: Joi.array().min(2), then: Joi.required() })\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives()\n .try(conditionDataSchemaV2, conditionRefDataSchemaV2)\n .required()\n )\n .min(1)\n .max(15)\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('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 .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('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;AAqBtB,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,CACnCF,GAAG,CAAES,SAAS,IAAKA,SAAS,CAACP,EAAE,CAAC,GACnC,EACN;AACJ,CAAC,CAAC;AAEF,MAAMQ,SAAS,GAAG3B,GAAG,CAACa,GAAG,CAAC,QAAQ,EAAE;EAClCC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAGa,KAAa,IACpBA,KAAK,CAACH,MAAM,CAAEI,IAAI,IAAKA,IAAI,CAACV,EAAE,CAAC,CAACF,GAAG,CAAEY,IAAI,IAAKA,IAAI,CAAC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F,WAAW,CAAC,2BAA2B,CAAC;EAC3CP,KAAK,EAAE5B,GAAG,CAAC6E,KAAK,CAAO,CAAC,CACrB9C,KAAK,CAACwH,YAAY,CAAC,CACnBvB,MAAM,CAAC,MAAM,CAAC,CACdA,MAAM,CAAC,OAAO,CAAC,CACfA,MAAM,CAAC,IAAI,CAAC,CACZ7F,WAAW,CAAC,2BAA2B,CAAC;EAC3CnB,UAAU,EAAEhB,GAAG,CAAC6E,KAAK,CAAqB,CAAC,CACxC9C,KAAK,CAACmD,wBAAwB,CAAC,CAC/B8C,MAAM,CAAC,IAAI,CAAC,CACZA,MAAM,CAAC,aAAa,CAAC,CACrB7F,WAAW,CAAC,sCAAsC;AACvD,CAAC,CAAC,CACDA,WAAW,CAAC,+BAA+B,CAAC;;AAE/C;AACA;AACA,OAAO,MAAM+I,MAAM,GAAGhB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["JoiDate","JoiBase","v4","uuidV4","ComponentType","SchemaVersion","ControllerType","hasComponents","Joi","extend","idSchemaOptional","string","uuid","idSchema","default","conditionIdRef","ref","in","adjust","conditions","map","condition","id","componentIdRefSchema","pages","flatMap","page","components","filter","component","listIdRef","lists","list","listItemIdRef","items","item","sectionsSchema","object","description","keys","name","trim","required","title","hideTitle","boolean","optional","conditionFieldSchema","type","display","conditionValueSchema","value","conditionStringValueDataSchemaV2","valid","conditionBooleanValueDataSchemaV2","conditionNumberValueDataSchemaV2","number","conditionDateValueDataSchemaV2","date","format","raw","conditionListItemRefDataSchemaV2","listId","when","is","exist","then","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","min","max","componentSchema","shortDescription","Details","Html","InsetText","Markdown","pattern","otherwise","allow","hint","options","rows","empty","maxWords","maxDaysInPast","maxDaysInFuture","customValidationMessage","customValidationMessages","unknown","schema","length","componentSchemaV2","componentPayloadSchemaV2","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","pagePayloadSchemaV2","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 JoiDate from '@joi/date'\nimport JoiBase, { type LanguageMessages } from 'joi'\nimport { v4 as uuidV4 } from 'uuid'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type ContentComponentsDef,\n type FileUploadFieldComponent\n} from '~/src/components/types.js'\nimport {\n type ConditionBooleanValueDataV2,\n type ConditionData,\n type ConditionDataV2,\n type ConditionDateValueDataV2,\n type ConditionFieldData,\n type ConditionGroupData,\n type ConditionGroupDataV2,\n type ConditionListItemRefValueDataV2,\n type ConditionNumberValueDataV2,\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 Joi = JoiBase.extend(JoiDate) as JoiBase.Root\n\nconst idSchemaOptional = Joi.string().uuid()\n\nconst idSchema = idSchemaOptional.default(() => uuidV4())\n\nconst conditionIdRef = Joi.ref('/conditions', {\n in: true,\n adjust: (conditions: ConditionWrapperV2[]) =>\n conditions.map((condition) => condition.id)\n})\n\nconst componentIdRefSchema = Joi.ref('/pages', {\n in: true,\n adjust: (pages: Page[]) =>\n pages.flatMap((page) =>\n hasComponents(page)\n ? page.components\n .filter((component) => component.id)\n .map((component) => component.id)\n : []\n )\n})\n\nconst listIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.filter((list) => list.id).map((list) => list.id)\n})\n\nconst listItemIdRef = Joi.ref('/lists', {\n in: true,\n adjust: (lists: List[]) =>\n lists.flatMap((list) =>\n list.items.filter((item) => item.id).map((item) => item.id)\n )\n})\n\nconst sectionsSchema = Joi.object<Section>()\n .description('A form section grouping related pages together')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Unique identifier for the section, used in code and page references'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable section title displayed to users'),\n hideTitle: Joi.boolean()\n .optional()\n .default(false)\n .description(\n 'When true, the section title will not be displayed in the UI'\n )\n })\n\nconst conditionFieldSchema = Joi.object<ConditionFieldData>()\n .description('Field reference used in a condition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Component name referenced by this condition'),\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the field (e.g., string, number, date)'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the field for display purposes')\n })\n\nconst conditionValueSchema = Joi.object<ConditionValueData>()\n .description('Value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .required()\n .description('Data type of the value (e.g., string, number, date)'),\n value: Joi.string()\n .trim()\n .required()\n .description('The actual value to compare against'),\n display: Joi.string()\n .trim()\n .required()\n .description('Human-readable version of the value for display purposes')\n })\n\nconst 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 conditionBooleanValueDataSchemaV2 =\n Joi.object<ConditionBooleanValueDataV2>()\n .description('Boolean value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('BooleanValue')\n .required()\n .description('Type of the condition value, should be \"BooleanValue\"'),\n value: Joi.boolean()\n .required()\n .description('The actual value to compare against')\n })\n\nconst conditionNumberValueDataSchemaV2 =\n Joi.object<ConditionNumberValueDataV2>()\n .description('Number value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('NumberValue')\n .required()\n .description('Type of the condition value, should be \"NumberValue\"'),\n value: Joi.number()\n .required()\n .description('The actual value to compare against')\n })\n\nconst conditionDateValueDataSchemaV2 = Joi.object<ConditionDateValueDataV2>()\n .description('Date value specification for a condition')\n .keys({\n type: Joi.string()\n .trim()\n .valid('DateValue')\n .required()\n .description('Type of the condition value, should be \"DateValue\"'),\n value: Joi.date()\n .format('YYYY-MM-DD')\n .raw()\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 .trim()\n .required()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .description('The id of the list'),\n itemId: Joi.string()\n .trim()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listItemIdRef)\n })\n .required()\n .description('The id of the list item')\n })\n\nconst relativeDateValueDataSchema = Joi.object<RelativeDateValueData>()\n .description('Relative date specification for date-based conditions')\n .keys({\n type: Joi.string()\n .trim()\n .valid('RelativeDate')\n .required()\n .description('Type of the condition value, should be \"RelativeDate\"'),\n period: Joi.string()\n .trim()\n .required()\n .description('Numeric amount of the time period, as a string'),\n unit: Joi.string()\n .trim()\n .required()\n .description('Time unit (e.g. days, weeks, months, years)'),\n direction: Joi.string()\n .trim()\n .required()\n .description('Temporal direction, either \"past\" or \"future\"')\n })\n\nconst conditionRefSchema = Joi.object<ConditionRefData>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n conditionName: Joi.string()\n .trim()\n .required()\n .description('Name of the referenced condition'),\n conditionDisplayName: Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the condition for display purposes'),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nconst conditionRefDataSchemaV2 = Joi.object<ConditionRefDataV2>()\n .description('Reference to a named condition defined elsewhere')\n .keys({\n id: idSchema.description('Unique identifier for the referenced condition'),\n conditionId: Joi.string()\n .trim()\n .required()\n .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .description('Name of the referenced condition')\n })\n\nconst conditionSchema = Joi.object<ConditionData>()\n .description('Condition definition specifying a logical comparison')\n .keys({\n field: conditionFieldSchema.description(\n 'The form field being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(conditionValueSchema, relativeDateValueDataSchema)\n .description(\n 'Value to compare the field against, either fixed or relative date'\n ),\n coordinator: Joi.string()\n .trim()\n .optional()\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n )\n })\n\nexport const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()\n .description('Condition definition')\n .keys({\n id: idSchema.description(\n 'Unique identifier used to reference this condition'\n ),\n componentId: Joi.string()\n .trim()\n .required()\n .when('/pages', {\n is: Joi.exist(),\n then: Joi.valid(componentIdRefSchema)\n })\n .description(\n 'Reference to the component id being evaluated in this condition'\n ),\n operator: Joi.string()\n .trim()\n .required()\n .description('Comparison operator (equals, greaterThan, contains, etc.)'),\n value: Joi.alternatives()\n .try(\n conditionStringValueDataSchemaV2,\n conditionBooleanValueDataSchemaV2,\n conditionNumberValueDataSchemaV2,\n conditionDateValueDataSchemaV2,\n conditionListItemRefDataSchemaV2,\n relativeDateValueDataSchema\n )\n .required()\n .description(\n 'Value to compare the field against, either fixed or relative date'\n )\n })\n\nconst conditionGroupSchema = Joi.object<ConditionGroupData>()\n .description('Group of conditions combined with logical operators')\n .keys({\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n Joi.link('#conditionGroupSchema')\n )\n )\n .description('Array of conditions or condition references in this group')\n })\n .id('conditionGroupSchema')\n\nconst conditionsModelSchema = Joi.object<ConditionsModelData>()\n .description('Complete condition model with name and condition set')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the condition set'),\n conditions: Joi.array()\n .items(\n Joi.alternatives().try(\n conditionSchema,\n conditionRefSchema,\n conditionGroupSchema\n )\n )\n .description(\n 'Array of conditions, condition references, or condition groups'\n )\n })\n\nconst conditionWrapperSchema = Joi.object<ConditionWrapper>()\n .description('Container for a named condition with its definition')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description('Unique identifier used to reference this condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n value: conditionsModelSchema\n .required()\n .description('The complete condition definition')\n })\n\nexport const conditionWrapperSchemaV2 = Joi.object<ConditionWrapperV2>()\n .description('Container for a named condition with its definition')\n .keys({\n id: idSchema.description('Unique identifier for the condition'),\n displayName: Joi.string()\n .trim()\n .description('Human-readable name for display in the UI'),\n coordinator: Joi.string()\n .optional()\n .when('items', { is: Joi.array().min(2), then: Joi.required() })\n .description(\n 'Logical operator connecting this condition with others (AND, OR)'\n ),\n items: Joi.array<ConditionGroupDataV2>()\n .items(\n Joi.alternatives()\n .try(conditionDataSchemaV2, conditionRefDataSchemaV2)\n .required()\n )\n .min(1)\n .max(15)\n .description('Array of conditions or condition references')\n })\n .description('Condition schema for V2 forms')\n\nexport const componentSchema = Joi.object<ComponentDef>()\n .description('Form component definition specifying UI element behavior')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the component'),\n type: Joi.string<ComponentType>()\n .trim()\n .required()\n .description('Component type (TextField, RadioButtons, DateField, etc.)'),\n shortDescription: Joi.string()\n .trim()\n .optional()\n .description('Brief description of the component purpose'),\n name: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .optional()\n .description('Optional identifier for display-only components'),\n otherwise: Joi.string()\n .trim()\n .pattern(/^[a-zA-Z]+$/)\n .description('Unique identifier for the component, used in form data')\n }),\n title: Joi.when('type', {\n is: Joi.string().valid(\n ComponentType.Details,\n ComponentType.Html,\n ComponentType.InsetText,\n ComponentType.Markdown\n ),\n then: Joi.string()\n .trim()\n .optional()\n .description('Optional title for display-only components'),\n otherwise: Joi.string()\n .trim()\n .allow('')\n .description('Label displayed above the component')\n }),\n hint: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Additional guidance text displayed below the component title'\n ),\n options: Joi.object({\n rows: Joi.number()\n .empty('')\n .description('Number of rows for textarea components'),\n maxWords: Joi.number()\n .empty('')\n .description('Maximum number of words allowed in text inputs'),\n maxDaysInPast: Joi.number()\n .empty('')\n .description('Maximum days in the past allowed for date inputs'),\n maxDaysInFuture: Joi.number()\n .empty('')\n .description('Maximum days in the future allowed for date inputs'),\n customValidationMessage: Joi.string()\n .trim()\n .allow('')\n .description('Custom error message for validation failures'),\n customValidationMessages: Joi.object<LanguageMessages>()\n .unknown(true)\n .optional()\n .description('Custom error messages keyed by validation rule name')\n })\n .default({})\n .unknown(true)\n .description('Component-specific configuration options'),\n schema: Joi.object({\n min: Joi.number()\n .empty('')\n .description('Minimum value or length for validation'),\n max: Joi.number()\n .empty('')\n .description('Maximum value or length for validation'),\n length: Joi.number()\n .empty('')\n .description('Exact length required for validation')\n })\n .unknown(true)\n .default({})\n .description('Validation rules for the component'),\n list: Joi.string()\n .trim()\n .optional()\n .description(\n 'Reference to a predefined list of options for select components'\n )\n })\n .unknown(true)\n\nexport const componentSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .when('/lists', {\n is: Joi.exist(),\n then: Joi.valid(listIdRef)\n })\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Component schema for V2 forms')\n\nexport const componentPayloadSchemaV2 = componentSchema\n .keys({\n id: idSchema.description('Unique identifier for the component'),\n list: Joi.string()\n .optional()\n .description(\n 'List id reference to a predefined list of options for select components'\n )\n })\n .description('Payload schema for component for V2 forms')\n\nexport const fileUploadComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType.FileUploadField>()\n .trim()\n .valid(ComponentType.FileUploadField)\n .required()\n .description('Component that can only be a FileUploadField')\n})\n\nexport const contentComponentSchema = componentSchemaV2.keys({\n type: Joi.string<ComponentType>()\n .trim()\n .valid(ComponentType.Details)\n .valid(ComponentType.Html)\n .valid(ComponentType.Markdown)\n .valid(ComponentType.InsetText)\n .valid(ComponentType.List)\n .required()\n .description('Content only component type (Details, Html, Markdown, etc.)')\n})\n\nconst nextSchema = Joi.object<Link>()\n .description('Navigation link defining where to go after completing a page')\n .keys({\n path: Joi.string()\n .trim()\n .required()\n .description('The target page path to navigate to'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Optional condition that determines if this path should be taken'\n ),\n redirect: Joi.string()\n .trim()\n .optional()\n .description(\n 'Optional external URL to redirect to instead of an internal page'\n )\n })\n\nconst repeatOptions = Joi.object<RepeatOptions>()\n .description('Configuration options for a repeatable page section')\n .keys({\n name: Joi.string()\n .trim()\n .required()\n .description(\n 'Identifier for the repeatable section, used in data structure'\n ),\n title: Joi.string()\n .trim()\n .required()\n .description('Title displayed for each repeatable item')\n })\n\nconst repeatSchema = Joi.object<RepeatSchema>()\n .description('Validation rules for a repeatable section')\n .keys({\n min: Joi.number()\n .empty('')\n .required()\n .description('Minimum number of repetitions required'),\n max: Joi.number()\n .empty('')\n .required()\n .description('Maximum number of repetitions allowed')\n })\n\nexport const pageRepeatSchema = Joi.object<Repeat>()\n .description('Complete configuration for a repeatable page')\n .keys({\n options: repeatOptions\n .required()\n .description('Display and identification options for the repetition'),\n schema: repeatSchema\n .required()\n .description('Validation constraints for the number of repetitions')\n })\n\nconst eventSchema = Joi.object<Event>()\n .description('Event handler configuration for page lifecycle events')\n .keys({\n type: Joi.string()\n .trim()\n .allow('http')\n .required()\n .description(\n 'Type of the event handler (currently only \"http\" supported)'\n ),\n options: Joi.object<EventOptions>()\n .description('Options specific to the event handler type')\n .keys({\n method: Joi.string()\n .trim()\n .allow('POST')\n .required()\n .description('HTTP method to use for the request'),\n url: Joi.string()\n .trim()\n .uri({ scheme: ['http', 'https'] })\n .required()\n .description('URL endpoint to call when the event fires')\n })\n })\n\nconst eventsSchema = Joi.object<Events>()\n .description(\n 'Collection of event handlers for different page lifecycle events'\n )\n .keys({\n onLoad: eventSchema\n .optional()\n .description('Event handler triggered when the page is loaded'),\n onSave: eventSchema\n .optional()\n .description('Event handler triggered when the page data is saved')\n })\n\nexport const pageUploadComponentsSchema = Joi.array<\n FileUploadFieldComponent | ContentComponentsDef\n>()\n .items(\n fileUploadComponentSchema.required(),\n contentComponentSchema.optional()\n )\n .unique('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 .when('/conditions', {\n is: Joi.exist(),\n then: Joi.valid(conditionIdRef)\n })\n .optional()\n .description('Optional condition that determines if this page is shown')\n })\n .description('Page schema for V2 forms')\n\nexport const pagePayloadSchemaV2 = pageSchemaV2\n .append({\n components: Joi.when('controller', {\n switch: [\n {\n is: Joi.string().trim().valid(ControllerType.FileUpload).required(),\n then: pageUploadComponentsSchema\n }\n ],\n otherwise: Joi.array<ComponentDef>()\n .items(componentPayloadSchemaV2)\n .unique('name')\n .unique('id')\n .description('Components schema for V2 forms')\n })\n })\n .description('Payload Page schema for V2 forms')\n\nconst baseListItemSchema = Joi.object<Item>()\n .description('Base schema for list items with common properties')\n .keys({\n id: idSchema.description('Unique identifier for the list item'),\n text: Joi.string()\n .trim()\n .allow('')\n .description('Display text shown to the user'),\n description: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Optional additional descriptive text for the item'),\n conditional: Joi.object<Item['conditional']>()\n .description('Optional components to show when this item is selected')\n .keys({\n components: Joi.array<ComponentDef>()\n .required()\n .items(componentSchema.unknown(true))\n .unique('name')\n .description('Components to display conditionally')\n })\n .optional(),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description('Condition that determines if this item is shown'),\n hint: Joi.object<Item['hint']>()\n .optional()\n .keys({\n id: idSchema,\n text: Joi.string().trim()\n })\n .description('Optional hint text to be shown on list item')\n })\n\nconst stringListItemSchema = baseListItemSchema\n .append({\n value: Joi.string()\n .trim()\n .required()\n .description('String value stored when this item is selected')\n })\n .description('List item with string value')\n\nconst numberListItemSchema = baseListItemSchema\n .append({\n value: Joi.number()\n .required()\n .description('Numeric value stored when this item is selected')\n })\n .description('List item with numeric value')\n\nexport const listSchema = Joi.object<List>()\n .description('Reusable list of options for select components')\n .keys({\n id: idSchemaOptional.description('Unique identifier for the list'),\n name: Joi.string()\n .trim()\n .required()\n .description('Name used to reference this list from components'),\n title: Joi.string()\n .trim()\n .required()\n .description('Human-readable title for the list'),\n type: Joi.string()\n .trim()\n .required()\n .valid('string', 'number')\n .description('Data type for list values (string or number)'),\n items: Joi.when('type', {\n is: 'string',\n then: Joi.array()\n .items(stringListItemSchema)\n .unique('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,OAAO,MAAM,WAAW;AAC/B,OAAOC,OAAO,MAAiC,KAAK;AACpD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,SAASC,aAAa;AAuBtB,SACEC,aAAa;AAiBf,SAASC,cAAc;AACvB,SAASC,aAAa;AAEtB,MAAMC,GAAG,GAAGP,OAAO,CA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5
5
  BooleanValue = "BooleanValue",
6
+ NumberValue = "NumberValue",
7
+ DateValue = "DateValue",
6
8
  ListItemRef = "ListItemRef"
7
9
  }
8
10
  export declare enum Coordinator {
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/conditions/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;CAC5B;AAED,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,EAAE,OAAO;CACV;AAED,oBAAY,QAAQ;IAClB,EAAE,OAAO;IACT,KAAK,OAAO;IACZ,QAAQ,OAAO;IACf,SAAS,OAAO;IAChB,QAAQ,OAAO;IACf,UAAU,MAAM;IAChB,UAAU,MAAM;CACjB;AAED,oBAAY,YAAY;IACtB,EAAE,OAAO;IACT,KAAK,WAAW;IAChB,YAAY,mBAAmB;IAC/B,aAAa,oBAAoB;IACjC,SAAS,eAAe;IACxB,QAAQ,aAAa;IACrB,cAAc,qBAAqB;IACnC,SAAS,gBAAgB;IACzB,QAAQ,eAAe;IACvB,UAAU,iBAAiB;IAC3B,UAAU,iBAAiB;IAC3B,QAAQ,cAAc;IACtB,OAAO,aAAa;CACrB;AAED,oBAAY,cAAc;IACxB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/conditions/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,EAAE,OAAO;CACV;AAED,oBAAY,QAAQ;IAClB,EAAE,OAAO;IACT,KAAK,OAAO;IACZ,QAAQ,OAAO;IACf,SAAS,OAAO;IAChB,QAAQ,OAAO;IACf,UAAU,MAAM;IAChB,UAAU,MAAM;CACjB;AAED,oBAAY,YAAY;IACtB,EAAE,OAAO;IACT,KAAK,WAAW;IAChB,YAAY,mBAAmB;IAC/B,aAAa,oBAAoB;IACjC,SAAS,eAAe;IACxB,QAAQ,aAAa;IACrB,cAAc,qBAAqB;IACnC,SAAS,gBAAgB;IACzB,QAAQ,eAAe;IACvB,UAAU,iBAAiB;IAC3B,UAAU,iBAAiB;IAC3B,QAAQ,cAAc;IACtB,OAAO,aAAa;CACrB;AAED,oBAAY,cAAc;IACxB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
@@ -7,6 +7,6 @@ export { ConditionGroup } from '../conditions/condition-group.js';
7
7
  export { ConditionsModel } from '../conditions/condition-model.js';
8
8
  export { ConditionGroupDef } from '../conditions/condition-group-def.js';
9
9
  export { getConditionV2, hasConditionField, hasConditionGroup, hasConditionName, hasNestedCondition, isDuplicateCondition, toExpression, toPresentationString } from '../conditions/helpers.js';
10
- export { convertConditionWrapperFromV2, isConditionBooleanValueDataV2, isConditionListItemRefValueDataV2, isConditionStringValueDataV2, isConditionWrapper, isConditionWrapperV2, type RuntimeFormModel } from '../conditions/migration.js';
10
+ export { convertConditionWrapperFromV2, isConditionBooleanValueDataV2, isConditionDateValueDataV2, isConditionListItemRefValueDataV2, isConditionNumberValueDataV2, isConditionStringValueDataV2, isConditionWrapper, isConditionWrapperV2, type RuntimeFormModel } from '../conditions/migration.js';
11
11
  export { ConditionType, Coordinator, DateDirections, DateUnits, Operator, OperatorName } from '../conditions/enums.js';
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/conditions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACrB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,iCAAiC,EACjC,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,aAAa,EACb,WAAW,EACX,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACb,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/conditions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACrB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,0BAA0B,EAC1B,iCAAiC,EACjC,4BAA4B,EAC5B,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,aAAa,EACb,WAAW,EACX,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACb,MAAM,2BAA2B,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import { type ComponentDef } from '../components/types.js';
2
- import { type ConditionBooleanValueDataV2, type ConditionListItemRefValueDataV2, type ConditionStringValueDataV2, type ConditionValueDataV2 } from '../conditions/types.js';
2
+ import { type ConditionBooleanValueDataV2, type ConditionDateValueDataV2, type ConditionListItemRefValueDataV2, type ConditionNumberValueDataV2, type ConditionStringValueDataV2, type ConditionValueDataV2 } from '../conditions/types.js';
3
3
  import { type ConditionWrapper, type ConditionWrapperV2, type List } from '../form/form-definition/types.js';
4
4
  export declare function isConditionListItemRefValueDataV2(value: ConditionValueDataV2): value is ConditionListItemRefValueDataV2;
5
5
  export declare function isConditionStringValueDataV2(value: ConditionValueDataV2): value is ConditionStringValueDataV2;
6
6
  export declare function isConditionBooleanValueDataV2(value: ConditionValueDataV2): value is ConditionBooleanValueDataV2;
7
+ export declare function isConditionNumberValueDataV2(value: ConditionValueDataV2): value is ConditionNumberValueDataV2;
8
+ export declare function isConditionDateValueDataV2(value: ConditionValueDataV2): value is ConditionDateValueDataV2;
7
9
  export declare function isConditionWrapperV2(wrapper: ConditionWrapper | ConditionWrapperV2): wrapper is ConditionWrapperV2;
8
10
  export declare function isConditionWrapper(wrapper: ConditionWrapper | ConditionWrapperV2): wrapper is ConditionWrapper;
9
11
  export declare function convertConditionWrapperFromV2(conditionWrapper: ConditionWrapperV2, model: RuntimeFormModel): ConditionWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/conditions/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,KAAK,2BAA2B,EAGhC,KAAK,+BAA+B,EAGpC,KAAK,0BAA0B,EAE/B,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACV,MAAM,qCAAqC,CAAA;AAE5C,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,oBAAoB,GAC1B,KAAK,IAAI,+BAA+B,CAE1C;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,oBAAoB,GAC1B,KAAK,IAAI,0BAA0B,CAErC;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,oBAAoB,GAC1B,KAAK,IAAI,2BAA2B,CAEtC;AA6GD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,kBAAkB,CAE/B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,gBAAgB,CAE7B;AAED,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,kBAAkB,EACpC,KAAK,EAAE,gB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AAE,gBAAgB,GAAG,kBAAkB,GAC7C,OAAO,IAAI,gBAAgB,CAE7B;AAED,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,kBAAkB,EACpC,KAAK,EAAE,gBAAgB,GACtB,gBAAgB,CAqClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CAAA;IACjD,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAA;IACnE,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAA;CAC1E"}
@@ -14,6 +14,14 @@ export interface ConditionBooleanValueDataV2 {
14
14
  type: ConditionType.BooleanValue;
15
15
  value: boolean;
16
16
  }
17
+ export interface ConditionNumberValueDataV2 {
18
+ type: ConditionType.NumberValue;
19
+ value: number;
20
+ }
21
+ export interface ConditionDateValueDataV2 {
22
+ type: ConditionType.DateValue;
23
+ value: string;
24
+ }
17
25
  export interface ConditionListItemRefValueDataV2 {
18
26
  type: ConditionType.ListItemRef;
19
27
  listId: string;
@@ -36,7 +44,7 @@ export interface ConditionData {
36
44
  value: ConditionValueData | RelativeDateValueData;
37
45
  coordinator?: Coordinator;
38
46
  }
39
- export type ConditionValueDataV2 = ConditionListItemRefValueDataV2 | ConditionStringValueDataV2 | ConditionBooleanValueDataV2 | RelativeDateValueData;
47
+ export type ConditionValueDataV2 = ConditionListItemRefValueDataV2 | ConditionStringValueDataV2 | ConditionBooleanValueDataV2 | ConditionNumberValueDataV2 | ConditionDateValueDataV2 | RelativeDateValueData;
40
48
  export interface ConditionDataV2 {
41
49
  id: string;
42
50
  componentId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/conditions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B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wBAAwB,GACxB,qBAAqB,CAAA;AAEzB,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,YAAY,CAAA;IACtB,KAAK,EAAE,oBAAoB,CAAA;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,CAAC,aAAa,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,EAAE,CAAA;CACtE;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,eAAe,GAAG,kBAAkB,CAAC,EAAE,CAAA;AAE3E,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,CACV,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,EAC9C,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC,KAC/B,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAA"}
@@ -1,36 +1,36 @@
1
- import Joi from 'joi';
1
+ import JoiBase from 'joi';
2
2
  import { type ComponentDef, type ContentComponentsDef, type FileUploadFieldComponent } from '../../components/types.js';
3
3
  import { type ConditionDataV2 } from '../../conditions/types.js';
4
4
  import { type ConditionWrapperV2, type FormDefinition, type List, type Page, type Repeat } from '../../form/form-definition/types.js';
5
- export declare const conditionDataSchemaV2: Joi.ObjectSchema<ConditionDataV2>;
6
- export declare const conditionWrapperSchemaV2: Joi.ObjectSchema<ConditionWrapperV2>;
7
- export declare const componentSchema: Joi.ObjectSchema<ComponentDef>;
8
- export declare const componentSchemaV2: Joi.ObjectSchema<ComponentDef>;
9
- export declare const componentPayloadSchemaV2: Joi.ObjectSchema<ComponentDef>;
10
- export declare const fileUploadComponentSchema: Joi.ObjectSchema<ComponentDef>;
11
- export declare const contentComponentSchema: Joi.ObjectSchema<ComponentDef>;
12
- export declare const pageRepeatSchema: Joi.ObjectSchema<Repeat>;
13
- export declare const pageUploadComponentsSchema: Joi.ArraySchema<FileUploadFieldComponent | ContentComponentsDef>;
5
+ export declare const conditionDataSchemaV2: JoiBase.ObjectSchema<ConditionDataV2>;
6
+ export declare const conditionWrapperSchemaV2: JoiBase.ObjectSchema<ConditionWrapperV2>;
7
+ export declare const componentSchema: JoiBase.ObjectSchema<ComponentDef>;
8
+ export declare const componentSchemaV2: JoiBase.ObjectSchema<ComponentDef>;
9
+ export declare const componentPayloadSchemaV2: JoiBase.ObjectSchema<ComponentDef>;
10
+ export declare const fileUploadComponentSchema: JoiBase.ObjectSchema<ComponentDef>;
11
+ export declare const contentComponentSchema: JoiBase.ObjectSchema<ComponentDef>;
12
+ export declare const pageRepeatSchema: JoiBase.ObjectSchema<Repeat>;
13
+ export declare const pageUploadComponentsSchema: JoiBase.ArraySchema<FileUploadFieldComponent | ContentComponentsDef>;
14
14
  /**
15
15
  * `/status` is a special route for providing a user's application status.
16
16
  * It should not be configured via the designer.
17
17
  */
18
- export declare const pageSchema: Joi.ObjectSchema<Page>;
18
+ export declare const pageSchema: JoiBase.ObjectSchema<Page>;
19
19
  /**
20
20
  * V2 engine schema - used with new editor
21
21
  */
22
- export declare const pageSchemaV2: Joi.ObjectSchema<Page>;
23
- export declare const pagePayloadSchemaV2: Joi.ObjectSchema<Page>;
24
- export declare const listSchema: Joi.ObjectSchema<List>;
22
+ export declare const pageSchemaV2: JoiBase.ObjectSchema<Page>;
23
+ export declare const pagePayloadSchemaV2: JoiBase.ObjectSchema<Page>;
24
+ export declare const listSchema: JoiBase.ObjectSchema<List>;
25
25
  /**
26
26
  * V2 Joi schema for Lists
27
27
  */
28
- export declare const listSchemaV2: Joi.ObjectSchema<List>;
28
+ export declare const listSchemaV2: JoiBase.ObjectSchema<List>;
29
29
  /**
30
30
  * Joi schema for `FormDefinition` interface
31
31
  * @see {@link FormDefinition}
32
32
  */
33
- export declare const formDefinitionSchema: Joi.ObjectSchema<FormDefinition>;
34
- export declare const formDefinitionV2Schema: Joi.ObjectSchema<FormDefinition>;
35
- export declare const Schema: Joi.ObjectSchema<FormDefinition>;
33
+ export declare const formDefinitionSchema: JoiBase.ObjectSchema<FormDefinition>;
34
+ export declare const formDefinitionV2Schema: JoiBase.ObjectSchema<FormDefinition>;
35
+ export declare const Schema: JoiBase.ObjectSchema<FormDefinition>;
36
36
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAClC,OAAO,EAGL,KAAK,eAAe,EAWrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAET,KAAK,MAAM,EAIZ,MAAM,qCAAqC,CAAA;AAqO5C,eAAO,MAAM,qBAAqB,mCA+B9B,CAAA;AAoDJ,eAAO,MAAM,wBAAwB,sCAuBU,CAAA;AAE/C,eAAO,MAAM,eAAe,gCAkGZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAaiB,CAAA;AAE/C,eAAO,MAAM,wBAAwB,gCASsB,CAAA;AAE3D,eAAO,MAAM,yBAAyB,gCAMpC,CAAA;AAEF,eAAO,MAAM,sBAAsB,gCAUjC,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M,0BAA0B,sEAWmB,CAAA;AAE1D;;;GAGG;AACH,eAAO,MAAM,UAAU,4BAmDnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,4BAgCiB,CAAA;AAE1C,eAAO,MAAM,mBAAmB,4BAgBkB,CAAA;AAwDlD,eAAO,MAAM,UAAU,4BAkCnB,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,4BAIiB,CAAA;AAsD1C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,sCAsE7B,CAAA;AAEJ,eAAO,MAAM,sBAAsB,sCAwBY,CAAA;AAI/C,eAAO,MAAM,MAAM,sCAAuB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.477",
3
+ "version": "3.0.479",
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,6 +34,7 @@
34
34
  "test:watch": "jest --color --watch"
35
35
  },
36
36
  "dependencies": {
37
+ "@joi/date": "^2.1.1",
37
38
  "marked": "^15.0.12",
38
39
  "nanoid": "^5.0.7",
39
40
  "slug": "^11.0.0",
@@ -1566,9 +1566,11 @@
1566
1566
  "title": "Operator"
1567
1567
  },
1568
1568
  "value": {
1569
- "description": "Value to compare the field against, either fixed or relative date\n\nValue can be of various types (object, object, object, object).",
1569
+ "description": "Value to compare the field against, either fixed or relative date\n\nValue can be of various types (object, object, object, object, object, object).",
1570
1570
  "title": "Value",
1571
1571
  "anyOfTitles": [
1572
+ "Value (object)",
1573
+ "Value (object)",
1572
1574
  "Value (object)",
1573
1575
  "Value (object)",
1574
1576
  "Value (object)",
@@ -3,6 +3,8 @@ export enum ConditionType {
3
3
  RelativeDate = 'RelativeDate',
4
4
  StringValue = 'StringValue',
5
5
  BooleanValue = 'BooleanValue',
6
+ NumberValue = 'NumberValue',
7
+ DateValue = 'DateValue',
6
8
  ListItemRef = 'ListItemRef'
7
9
  }
8
10
 
@@ -31,7 +31,9 @@ export {
31
31
  export {
32
32
  convertConditionWrapperFromV2,
33
33
  isConditionBooleanValueDataV2,
34
+ isConditionDateValueDataV2,
34
35
  isConditionListItemRefValueDataV2,
36
+ isConditionNumberValueDataV2,
35
37
  isConditionStringValueDataV2,
36
38
  isConditionWrapper,
37
39
  isConditionWrapperV2,
@@ -7,7 +7,9 @@ import {
7
7
  type ConditionBooleanValueDataV2,
8
8
  type ConditionData,
9
9
  type ConditionDataV2,
10
+ type ConditionDateValueDataV2,
10
11
  type ConditionListItemRefValueDataV2,
12
+ type ConditionNumberValueDataV2,
11
13
  type ConditionRefData,
12
14
  type ConditionRefDataV2,
13
15
  type ConditionStringValueDataV2,
@@ -38,6 +40,18 @@ export function isConditionBooleanValueDataV2(
38
40
  return value.type === ConditionType.BooleanValue
39
41
  }
40
42
 
43
+ export function isConditionNumberValueDataV2(
44
+ value: ConditionValueDataV2
45
+ ): value is ConditionNumberValueDataV2 {
46
+ return value.type === ConditionType.NumberValue
47
+ }
48
+
49
+ export function isConditionDateValueDataV2(
50
+ value: ConditionValueDataV2
51
+ ): value is ConditionDateValueDataV2 {
52
+ return value.type === ConditionType.DateValue
53
+ }
54
+
41
55
  function getListItem(model: RuntimeFormModel, listId: string, itemId: string) {
42
56
  const foundList = model.getListById(listId)
43
57
 
@@ -67,8 +81,8 @@ function createConditionValueDataFromListItemRefV2(
67
81
  }
68
82
  }
69
83
 
70
- function createConditionValueDataFromStringValueDataV2(
71
- value: ConditionStringValueDataV2
84
+ function createConditionValueDataFromStringOrDateValueDataV2(
85
+ value: ConditionStringValueDataV2 | ConditionDateValueDataV2
72
86
  ): ConditionValueData {
73
87
  return {
74
88
  type: ConditionType.Value,
@@ -77,6 +91,28 @@ function createConditionValueDataFromStringValueDataV2(
77
91
  }
78
92
  }
79
93
 
94
+ function createConditionValueDataFromStringValueDataV2(
95
+ value: ConditionStringValueDataV2
96
+ ): ConditionValueData {
97
+ return createConditionValueDataFromStringOrDateValueDataV2(value)
98
+ }
99
+
100
+ function createConditionValueDataFromDateValueDataV2(
101
+ value: ConditionDateValueDataV2
102
+ ): ConditionValueData {
103
+ return createConditionValueDataFromStringOrDateValueDataV2(value)
104
+ }
105
+
106
+ function createConditionValueDataFromNumberValueDataV2(
107
+ value: ConditionNumberValueDataV2
108
+ ): ConditionValueData {
109
+ return {
110
+ type: ConditionType.Value,
111
+ value: value.value.toString(),
112
+ display: value.value.toString()
113
+ }
114
+ }
115
+
80
116
  function createConditionValueDataFromBooleanValueDataV2(
81
117
  value: ConditionBooleanValueDataV2
82
118
  ): ConditionValueData {
@@ -111,6 +147,10 @@ function convertConditionDataV2(
111
147
  newValue = createConditionValueDataFromStringValueDataV2(condition.value)
112
148
  } else if (isConditionBooleanValueDataV2(condition.value)) {
113
149
  newValue = createConditionValueDataFromBooleanValueDataV2(condition.value)
150
+ } else if (isConditionNumberValueDataV2(condition.value)) {
151
+ newValue = createConditionValueDataFromNumberValueDataV2(condition.value)
152
+ } else if (isConditionDateValueDataV2(condition.value)) {
153
+ newValue = createConditionValueDataFromDateValueDataV2(condition.value)
114
154
  } else {
115
155
  newValue = condition.value
116
156
  }
@@ -27,6 +27,16 @@ export interface ConditionBooleanValueDataV2 {
27
27
  value: boolean
28
28
  }
29
29
 
30
+ export interface ConditionNumberValueDataV2 {
31
+ type: ConditionType.NumberValue
32
+ value: number
33
+ }
34
+
35
+ export interface ConditionDateValueDataV2 {
36
+ type: ConditionType.DateValue
37
+ value: string
38
+ }
39
+
30
40
  export interface ConditionListItemRefValueDataV2 {
31
41
  type: ConditionType.ListItemRef
32
42
  listId: string
@@ -57,6 +67,8 @@ export type ConditionValueDataV2 =
57
67
  | ConditionListItemRefValueDataV2
58
68
  | ConditionStringValueDataV2
59
69
  | ConditionBooleanValueDataV2
70
+ | ConditionNumberValueDataV2
71
+ | ConditionDateValueDataV2
60
72
  | RelativeDateValueData
61
73
 
62
74
  export interface ConditionDataV2 {
@@ -1,4 +1,5 @@
1
- import Joi, { type LanguageMessages } from 'joi'
1
+ import JoiDate from '@joi/date'
2
+ import JoiBase, { type LanguageMessages } from 'joi'
2
3
  import { v4 as uuidV4 } from 'uuid'
3
4
 
4
5
  import { ComponentType } from '~/src/components/enums.js'
@@ -11,10 +12,12 @@ import {
11
12
  type ConditionBooleanValueDataV2,
12
13
  type ConditionData,
13
14
  type ConditionDataV2,
15
+ type ConditionDateValueDataV2,
14
16
  type ConditionFieldData,
15
17
  type ConditionGroupData,
16
18
  type ConditionGroupDataV2,
17
19
  type ConditionListItemRefValueDataV2,
20
+ type ConditionNumberValueDataV2,
18
21
  type ConditionRefData,
19
22
  type ConditionRefDataV2,
20
23
  type ConditionStringValueDataV2,
@@ -43,6 +46,8 @@ import {
43
46
  import { ControllerType } from '~/src/pages/enums.js'
44
47
  import { hasComponents } from '~/src/pages/helpers.js'
45
48
 
49
+ const Joi = JoiBase.extend(JoiDate) as JoiBase.Root
50
+
46
51
  const idSchemaOptional = Joi.string().uuid()
47
52
 
48
53
  const idSchema = idSchemaOptional.default(() => uuidV4())
@@ -163,6 +168,35 @@ const conditionBooleanValueDataSchemaV2 =
163
168
  .description('The actual value to compare against')
164
169
  })
165
170
 
171
+ const conditionNumberValueDataSchemaV2 =
172
+ Joi.object<ConditionNumberValueDataV2>()
173
+ .description('Number value specification for a condition')
174
+ .keys({
175
+ type: Joi.string()
176
+ .trim()
177
+ .valid('NumberValue')
178
+ .required()
179
+ .description('Type of the condition value, should be "NumberValue"'),
180
+ value: Joi.number()
181
+ .required()
182
+ .description('The actual value to compare against')
183
+ })
184
+
185
+ const conditionDateValueDataSchemaV2 = Joi.object<ConditionDateValueDataV2>()
186
+ .description('Date value specification for a condition')
187
+ .keys({
188
+ type: Joi.string()
189
+ .trim()
190
+ .valid('DateValue')
191
+ .required()
192
+ .description('Type of the condition value, should be "DateValue"'),
193
+ value: Joi.date()
194
+ .format('YYYY-MM-DD')
195
+ .raw()
196
+ .required()
197
+ .description('The actual value to compare against')
198
+ })
199
+
166
200
  const conditionListItemRefDataSchemaV2 =
167
201
  Joi.object<ConditionListItemRefValueDataV2>()
168
202
  .description('List item ref specification for a condition')
@@ -292,6 +326,8 @@ export const conditionDataSchemaV2 = Joi.object<ConditionDataV2>()
292
326
  .try(
293
327
  conditionStringValueDataSchemaV2,
294
328
  conditionBooleanValueDataSchemaV2,
329
+ conditionNumberValueDataSchemaV2,
330
+ conditionDateValueDataSchemaV2,
295
331
  conditionListItemRefDataSchemaV2,
296
332
  relativeDateValueDataSchema
297
333
  )