@defra/forms-model 3.0.429 → 3.0.431

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +163 -1
  2. package/dist/module/common/pagination/index.js +2 -2
  3. package/dist/module/common/pagination/index.js.map +1 -1
  4. package/dist/module/common/search/index.js +4 -4
  5. package/dist/module/common/search/index.js.map +1 -1
  6. package/dist/module/common/sorting/index.js +2 -2
  7. package/dist/module/common/sorting/index.js.map +1 -1
  8. package/dist/module/form/form-definition/index.js +156 -156
  9. package/dist/module/form/form-definition/index.js.map +1 -1
  10. package/dist/module/form/form-editor/index.js +47 -37
  11. package/dist/module/form/form-editor/index.js.map +1 -1
  12. package/dist/module/form/form-editor/types.js.map +1 -1
  13. package/dist/module/form/form-manager/index.js +3 -3
  14. package/dist/module/form/form-manager/index.js.map +1 -1
  15. package/dist/module/form/form-metadata/index.js +34 -34
  16. package/dist/module/form/form-metadata/index.js.map +1 -1
  17. package/dist/module/form/form-submission/index.js +13 -13
  18. package/dist/module/form/form-submission/index.js.map +1 -1
  19. package/dist/module/types/joi-to-json.d.js +2 -0
  20. package/dist/module/types/joi-to-json.d.js.map +1 -0
  21. package/dist/types/common/pagination/index.d.ts.map +1 -1
  22. package/dist/types/common/search/index.d.ts.map +1 -1
  23. package/dist/types/common/sorting/index.d.ts.map +1 -1
  24. package/dist/types/form/form-definition/index.d.ts.map +1 -1
  25. package/dist/types/form/form-editor/index.d.ts +17 -7
  26. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  27. package/dist/types/form/form-editor/types.d.ts +45 -1
  28. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  29. package/dist/types/form/form-manager/index.d.ts.map +1 -1
  30. package/dist/types/form/form-metadata/index.d.ts.map +1 -1
  31. package/dist/types/form/form-submission/index.d.ts.map +1 -1
  32. package/package.json +6 -4
  33. package/scripts/generate-schemas.js +238 -0
  34. package/scripts/schema-modules/constants.js +39 -0
  35. package/scripts/schema-modules/schema-processors.js +109 -0
  36. package/scripts/schema-modules/schema-simplifiers.js +351 -0
  37. package/scripts/schema-modules/title-processors.js +327 -0
  38. package/scripts/schema-modules/types.js +21 -0
  39. package/scripts/schema-modules/utils.js +41 -0
  40. package/src/common/pagination/index.ts +8 -1
  41. package/src/common/search/index.ts +17 -3
  42. package/src/common/sorting/index.ts +8 -2
  43. package/src/form/form-definition/index.ts +567 -238
  44. package/src/form/form-editor/index.ts +207 -24
  45. package/src/form/form-editor/types.ts +69 -0
  46. package/src/form/form-manager/index.ts +11 -2
  47. package/src/form/form-metadata/index.ts +118 -40
  48. package/src/form/form-submission/index.ts +33 -10
  49. package/src/types/joi-to-json.d.ts +15 -0
@@ -6,44 +6,50 @@ export let QuestionTypeSubGroup = /*#__PURE__*/function (QuestionTypeSubGroup) {
6
6
  QuestionTypeSubGroup["ListSubGroup"] = "listSub";
7
7
  return QuestionTypeSubGroup;
8
8
  }({});
9
- export const pageTypeSchema = Joi.string().required().valid('question', 'guidance');
10
- export const questionTypeSchema = Joi.string().required().valid(QuestionTypeSubGroup.WrittenAnswerSubGroup, QuestionTypeSubGroup.DateSubGroup, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, QuestionTypeSubGroup.ListSubGroup, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField);
11
- export const questionTypeFullSchema = Joi.string().required().valid(ComponentType.TextField, ComponentType.MultilineTextField, ComponentType.NumberField, ComponentType.DatePartsField, ComponentType.MonthYearField, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField);
12
- export const writtenAnswerSubSchema = Joi.string().required().valid(ComponentType.TextField, ComponentType.MultilineTextField, ComponentType.NumberField);
9
+ export const pageTypeSchema = Joi.string().required().valid('question', 'guidance').description('Type of page - either a question page or guidance page');
10
+ export const questionTypeSchema = Joi.string().required().valid(QuestionTypeSubGroup.WrittenAnswerSubGroup, QuestionTypeSubGroup.DateSubGroup, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, QuestionTypeSubGroup.ListSubGroup, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField).description('The high-level type of question, including grouped types');
11
+ export const questionTypeFullSchema = Joi.string().required().valid(ComponentType.TextField, ComponentType.MultilineTextField, ComponentType.NumberField, ComponentType.DatePartsField, ComponentType.MonthYearField, ComponentType.UkAddressField, ComponentType.TelephoneNumberField, ComponentType.FileUploadField, ComponentType.EmailAddressField, ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField).description('The specific component type to use for this question');
12
+ export const writtenAnswerSubSchema = Joi.string().required().valid(ComponentType.TextField, ComponentType.MultilineTextField, ComponentType.NumberField).description('Subtype for written answer questions');
13
13
  export const dateSubSchema = Joi.string().required().valid(ComponentType.DatePartsField, ComponentType.MonthYearField);
14
- export const listSubSchema = Joi.string().required().valid(ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField);
15
- export const nameSchema = Joi.string().trim().required();
16
- export const questionSchema = Joi.string().trim().required();
17
- export const hintTextSchema = Joi.string().trim().optional().allow('');
18
- export const questionOptionalSchema = Joi.string().trim().optional().valid('', 'true');
19
- export const shortDescriptionSchema = Joi.string().trim().required();
20
- export const pageHeadingAndGuidanceSchema = Joi.string().trim().optional();
21
- export const pageHeadingSchema = Joi.string().trim().required();
22
- export const guidanceTextSchema = Joi.string().trim();
23
- export const needDeclarationSchema = Joi.string().trim().required();
24
- export const declarationTextSchema = Joi.string().trim().required();
25
- export const exactFilesSchema = Joi.number().empty('').integer().min(1).max(25);
26
- export const minFilesSchema = Joi.number().empty('').integer().min(0).max(25);
27
- export const maxFilesSchema = Joi.number().empty('').integer().min(1).max(25);
28
- export const minSchema = Joi.number().empty('').integer();
29
- export const maxSchema = Joi.number().empty('').integer();
30
- export const minLengthSchema = Joi.number().empty('').integer().min(1);
31
- export const maxLengthSchema = Joi.number().empty('').integer().min(1);
32
- export const maxFutureSchema = Joi.number().empty('').integer().min(0);
33
- export const maxPastSchema = Joi.number().empty('').integer().min(0);
34
- export const precisionSchema = Joi.number().empty('').integer().min(0).max(5);
35
- export const prefixSchema = Joi.string().trim().optional().allow('');
36
- export const regexSchema = Joi.string().optional().allow('');
37
- export const rowsSchema = Joi.number().empty('').integer().min(1);
38
- export const suffixSchema = Joi.string().trim().optional().allow('');
39
- export const classesSchema = Joi.string().trim().optional().allow('');
40
- export const fileTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
41
- export const documentTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
42
- export const imageTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
14
+ export const listSubSchema = Joi.string().required().valid(ComponentType.YesNoField, ComponentType.CheckboxesField, ComponentType.RadiosField, ComponentType.AutocompleteField).description('Subtype for date-related questions');
15
+ export const nameSchema = Joi.string().trim().required().description('Unique identifier for the field');
16
+ export const questionSchema = Joi.string().trim().required().description('The question text displayed to the user');
17
+ export const hintTextSchema = Joi.string().trim().optional().allow('').description('Optional guidance text displayed below the question');
18
+ export const questionOptionalSchema = Joi.string().trim().optional().valid('', 'true').description('Indicates whether a question is optional. Empty string or "true" values are accepted.');
19
+ export const exactFilesSchema = Joi.number().empty('').integer().min(1).max(25).description('Specifies the exact number of files required for upload. Must be between 1 and 25.');
20
+ export const minFilesSchema = Joi.number().empty('').integer().min(0).max(25).description('Minimum number of files required for upload. Must be between 0 and 25.');
21
+ export const maxFilesSchema = Joi.number().empty('').integer().min(1).max(25).description('Maximum number of files allowed for upload. Must be between 1 and 25.');
22
+ export const fileTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]).description('Array of allowed file types. Can be provided as a single value or an array.');
23
+ export const documentTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]).description('Array of allowed document types. Can be provided as a single value or an array.');
24
+ export const imageTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]).description('Array of allowed image types. Can be provided as a single value or an array.');
43
25
  export const tabularDataTypesSchema = Joi.array().items(Joi.string()).single().empty(null).default([]);
26
+ export const enhancedActionSchema = Joi.string().trim().optional().allow('').description('Action field that can include enhanced functionality');
27
+ export const radioIdSchema = Joi.string().trim().optional().allow('').description('Unique identifier for radio options');
28
+ export const radioLabelSchema = Joi.string().trim().required().description('The visible text shown next to radio options');
29
+ export const radioHintSchema = Joi.string().trim().optional().allow('').description('Optional hint text displayed with radio buttons to provide additional guidance');
30
+ export const radioValueSchema = Joi.string().trim().optional().allow('').description('Array of allowed tabular data types. Can be provided as a single value or an array.');
31
+ export const shortDescriptionSchema = Joi.string().trim().required().description('Brief description of the question for internal use');
32
+ export const pageHeadingAndGuidanceSchema = Joi.string().trim().optional().description('Combined heading and guidance for the page');
33
+ export const pageHeadingSchema = Joi.string().trim().required().description('Main heading displayed at the top of the page');
34
+ export const guidanceTextSchema = Joi.string().trim().description('Guidance text to assist users in completing the page');
35
+ export const needDeclarationSchema = Joi.string().trim().required().description('Whether a declaration is needed');
36
+ export const declarationTextSchema = Joi.string().trim().required().description('Text of the declaration that users must agree to');
37
+ export const minSchema = Joi.number().empty('').integer().description('Minimum value for numeric inputs');
38
+ export const maxSchema = Joi.number().empty('').integer().description('Maximum value for numeric inputs');
39
+ export const minLengthSchema = Joi.number().empty('').integer().min(1).description('Minimum character length for text inputs');
40
+ export const maxLengthSchema = Joi.number().empty('').integer().min(1).description('Maximum character length for text inputs');
41
+ export const maxFutureSchema = Joi.number().empty('').integer().min(1).description('Maximum days in the future allowed for date inputs');
42
+ export const maxPastSchema = Joi.number().empty('').integer().min(1).description('Maximum days in the past allowed for date inputs');
43
+ export const precisionSchema = Joi.number().empty('').integer().min(1).description('Decimal precision for numeric inputs');
44
+ export const prefixSchema = Joi.string().trim().optional().allow('').description('Text to display before the input (e.g., £)');
45
+ export const regexSchema = Joi.string().optional().allow('').description('Regular expression pattern for validation');
46
+ export const rowsSchema = Joi.number().empty('').integer().min(1).description('Number of rows for multiline text fields');
47
+ export const suffixSchema = Joi.string().trim().optional().allow('').description('Text to display after the input (e.g., kg)');
48
+ export const classesSchema = Joi.string().trim().optional().allow('').description('Custom CSS classes to apply to the component');
44
49
  export const questionDetailsFullSchema = {
45
50
  classesSchema,
46
51
  documentTypesSchema,
52
+ enhancedActionSchema,
47
53
  exactFilesSchema,
48
54
  fileTypesSchema,
49
55
  hintTextSchema,
@@ -62,6 +68,10 @@ export const questionDetailsFullSchema = {
62
68
  questionOptionalSchema,
63
69
  questionSchema,
64
70
  questionTypeFullSchema,
71
+ radioHintSchema,
72
+ radioIdSchema,
73
+ radioLabelSchema,
74
+ radioValueSchema,
65
75
  regexSchema,
66
76
  rowsSchema,
67
77
  shortDescriptionSchema,
@@ -77,7 +87,7 @@ export const formEditorInputPageKeys = {
77
87
  * Joi schema for `FormEditorInputPage` interface
78
88
  * @see {@link FormEditorInputPage}
79
89
  */
80
- export const formEditorInputPageSchema = Joi.object().keys(formEditorInputPageKeys).required();
90
+ export const formEditorInputPageSchema = Joi.object().keys(formEditorInputPageKeys).required().description('Input schema for creating a new page in the form editor');
81
91
  export const formEditorInputheckAnswersSettingsKeys = {
82
92
  declarationText: shortDescriptionSchema
83
93
  };
@@ -86,7 +96,7 @@ export const formEditorInputheckAnswersSettingsKeys = {
86
96
  * Joi schema for `FormEditorInputCheckAnswersSettings` interface
87
97
  * @see {@link FormEditorInputCheckAnswersSettings}
88
98
  */
89
- export const formEditorInputCheckAnswersSettingSchema = Joi.object().keys(formEditorInputheckAnswersSettingsKeys).required();
99
+ export const formEditorInputCheckAnswersSettingSchema = Joi.object().keys(formEditorInputheckAnswersSettingsKeys).required().description('Configuration for the check-answers page');
90
100
  export const formEditorInputQuestionKeys = {
91
101
  question: questionSchema,
92
102
  shortDescription: shortDescriptionSchema,
@@ -98,7 +108,7 @@ export const formEditorInputQuestionKeys = {
98
108
  * Joi schema for `FormEditorInputQuestion` interface
99
109
  * @see {@link FormEditorInputQuestion}
100
110
  */
101
- export const formEditorInputQuestionSchema = Joi.object().keys(formEditorInputQuestionKeys).required();
111
+ export const formEditorInputQuestionSchema = Joi.object().keys(formEditorInputQuestionKeys).required().description('Input schema for creating or updating a question in the form editor');
102
112
  export const formEditorInputPageSettingsKeys = {
103
113
  pageHeadingAndGuidance: pageHeadingAndGuidanceSchema,
104
114
  pageHeading: pageHeadingSchema,
@@ -109,5 +119,5 @@ export const formEditorInputPageSettingsKeys = {
109
119
  * Joi schema for `FormEditorInputPageSettings` interface
110
120
  * @see {@link FormEditorInputPageSettings}
111
121
  */
112
- export const formEditorInputPageSettingsSchema = Joi.object().keys(formEditorInputPageSettingsKeys).required();
122
+ export const formEditorInputPageSettingsSchema = Joi.object().keys(formEditorInputPageSettingsKeys).required().description('Settings for page content and display in the form editor');
113
123
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","ComponentType","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","questionOptionalSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","needDeclarationSchema","declarationTextSchema","exactFilesSchema","number","empty","integer","min","max","minFilesSchema","maxFilesSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","object","keys","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const questionTypeFullSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.DatePartsField,\n ComponentType.MonthYearField,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n\nexport const nameSchema = Joi.string().trim().required()\nexport const questionSchema = Joi.string().trim().required()\nexport const hintTextSchema = Joi.string().trim().optional().allow('')\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\nexport const shortDescriptionSchema = Joi.string().trim().required()\nexport const pageHeadingAndGuidanceSchema = Joi.string().trim().optional()\nexport const pageHeadingSchema = Joi.string().trim().required()\nexport const guidanceTextSchema = Joi.string().trim()\nexport const needDeclarationSchema = Joi.string().trim().required()\nexport const declarationTextSchema = Joi.string().trim().required()\nexport const exactFilesSchema = Joi.number().empty('').integer().min(1).max(25)\nexport const minFilesSchema = Joi.number().empty('').integer().min(0).max(25)\nexport const maxFilesSchema = Joi.number().empty('').integer().min(1).max(25)\nexport const minSchema = Joi.number().empty('').integer()\nexport const maxSchema = Joi.number().empty('').integer()\nexport const minLengthSchema = Joi.number().empty('').integer().min(1)\nexport const maxLengthSchema = Joi.number().empty('').integer().min(1)\nexport const maxFutureSchema = Joi.number().empty('').integer().min(0)\nexport const maxPastSchema = Joi.number().empty('').integer().min(0)\nexport const precisionSchema = Joi.number().empty('').integer().min(0).max(5)\nexport const prefixSchema = Joi.string().trim().optional().allow('')\nexport const regexSchema = Joi.string().optional().allow('')\nexport const rowsSchema = Joi.number().empty('').integer().min(1)\nexport const suffixSchema = Joi.string().trim().optional().allow('')\nexport const classesSchema = Joi.string().trim().optional().allow('')\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n\nexport const questionDetailsFullSchema = {\n classesSchema,\n documentTypesSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema\n}\n\nexport const formEditorInputPageKeys = {\n pageType: pageTypeSchema,\n questionType: questionTypeSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPage` interface\n * @see {@link FormEditorInputPage}\n */\nexport const formEditorInputPageSchema = Joi.object<FormEditorInputPage>()\n .keys(formEditorInputPageKeys)\n .required()\n\nexport const formEditorInputheckAnswersSettingsKeys = {\n declarationText: shortDescriptionSchema\n}\n\n/**\n * Joi schema for `FormEditorInputCheckAnswersSettings` interface\n * @see {@link FormEditorInputCheckAnswersSettings}\n */\nexport const formEditorInputCheckAnswersSettingSchema =\n Joi.object<FormEditorInputCheckAnswersSettings>()\n .keys(formEditorInputheckAnswersSettingsKeys)\n .required()\n\nexport const formEditorInputQuestionKeys = {\n question: questionSchema,\n shortDescription: shortDescriptionSchema,\n hintText: hintTextSchema,\n questionOptional: questionOptionalSchema\n}\n\n/**\n * Joi schema for `FormEditorInputQuestion` interface\n * @see {@link FormEditorInputQuestion}\n */\nexport const formEditorInputQuestionSchema =\n Joi.object<FormEditorInputQuestion>()\n .keys(formEditorInputQuestionKeys)\n .required()\n\nexport const formEditorInputPageSettingsKeys = {\n pageHeadingAndGuidance: pageHeadingAndGuidanceSchema,\n pageHeading: pageHeadingSchema,\n guidanceText: guidanceTextSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPageSettings` interface\n * @see {@link FormEditorInputPageSettings}\n */\nexport const formEditorInputPageSettingsSchema =\n Joi.object<FormEditorInputPageSettings>()\n .keys(formEditorInputPageSettingsKeys)\n .required()\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,aAAa;AAQtB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,OAAO,MAAMC,cAAc,GAAGH,GAAG,CAACI,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC;AAChC,OAAO,MAAMC,kBAAkB,GAAGP,GAAG,CAACI,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,oBAAoB,CAACM,qBAAqB,EAC1CN,oBAAoB,CAACO,YAAY,EACjCR,aAAa,CAACS,cAAc,EAC5BT,aAAa,CAACU,oBAAoB,EAClCV,aAAa,CAACW,eAAe,EAC7BX,aAAa,CAACY,iBAAiB,EAC/BX,oBAAoB,CAACY,YAAY,EACjCb,aAAa,CAACc,UAAU,EACxBd,aAAa,CAACe,eAAe,EAC7Bf,aAAa,CAACgB,WAAW,EACzBhB,aAAa,CAACiB,iBAChB,CAAC;AAEH,OAAO,MAAMC,sBAAsB,GAAGnB,GAAG,CAACI,MAAM,CAAC,CAAC,CAC/CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJL,aAAa,CAACmB,SAAS,EACvBnB,aAAa,CAACoB,kBAAkB,EAChCpB,aAAa,CAACqB,WAAW,EACzBrB,aAAa,CAACsB,cAAc,EAC5BtB,aAAa,CAACuB,cAAc,EAC5BvB,aAAa,CAACS,cAAc,EAC5BT,aAAa,CAACU,oBAAoB,EAClCV,aAAa,CAACW,eAAe,EAC7BX,aAAa,CAACY,iBAAiB,EAC/BZ,aA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AACI,2BAA2B,CAAC,CACjC1E,QAAQ,CAAC,CAAC;AAEf,OAAO,MAAMgF,+BAA+B,GAAG;EAC7CC,sBAAsB,EAAElD,4BAA4B;EACpDmD,WAAW,EAAElD,iBAAiB;EAC9BmD,YAAY,EAAElD;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMmD,iCAAiC,GAC5CzF,GAAG,CAAC0E,MAAM,CAA8B,CAAC,CACtCC,IAAI,CAACU,+BAA+B,CAAC,CACrChF,QAAQ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","ComponentType","QuestionTypeSubGroup","pageTypeSchema","string","required","valid","description","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","nameSchema","trim","questionSchema","hintTextSchema","optional","allow","questionOptionalSchema","exactFilesSchema","number","empty","integer","min","max","minFilesSchema","maxFilesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioLabelSchema","radioHintSchema","radioValueSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","needDeclarationSchema","declarationTextSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","object","keys","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion\n} from '~/src/form/form-editor/types.js'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub'\n}\n\nexport const pageTypeSchema = Joi.string()\n .required()\n .valid('question', 'guidance')\n .description('Type of page - either a question page or guidance page')\n\nexport const questionTypeSchema = Joi.string()\n .required()\n .valid(\n QuestionTypeSubGroup.WrittenAnswerSubGroup,\n QuestionTypeSubGroup.DateSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('The high-level type of question, including grouped types')\n\nexport const questionTypeFullSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField,\n ComponentType.DatePartsField,\n ComponentType.MonthYearField,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('The specific component type to use for this question')\n\nexport const writtenAnswerSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.TextField,\n ComponentType.MultilineTextField,\n ComponentType.NumberField\n )\n .description('Subtype for written answer questions')\n\nexport const dateSubSchema = Joi.string()\n .required()\n .valid(ComponentType.DatePartsField, ComponentType.MonthYearField)\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField\n )\n .description('Subtype for date-related questions')\n\nexport const nameSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the field')\n\nexport const questionSchema = Joi.string()\n .trim()\n .required()\n .description('The question text displayed to the user')\n\nexport const hintTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Optional guidance text displayed below the question')\n\nexport const questionOptionalSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a question is optional. Empty string or \"true\" values are accepted.'\n )\n\nexport const exactFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Specifies the exact number of files required for upload. Must be between 1 and 25.'\n )\n\nexport const minFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .max(25)\n .description(\n 'Minimum number of files required for upload. Must be between 0 and 25.'\n )\n\nexport const maxFilesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .max(25)\n .description(\n 'Maximum number of files allowed for upload. Must be between 1 and 25.'\n )\n\nexport const fileTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed file types. Can be provided as a single value or an array.'\n )\n\nexport const documentTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed document types. Can be provided as a single value or an array.'\n )\n\nexport const imageTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\n .description(\n 'Array of allowed image types. Can be provided as a single value or an array.'\n )\n\nexport const tabularDataTypesSchema = Joi.array()\n .items(Joi.string())\n .single()\n .empty(null)\n .default([])\nexport const enhancedActionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Action field that can include enhanced functionality')\n\nexport const radioIdSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for radio options')\n\nexport const radioLabelSchema = Joi.string()\n .trim()\n .required()\n .description('The visible text shown next to radio options')\n\nexport const radioHintSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional hint text displayed with radio buttons to provide additional guidance'\n )\n\nexport const radioValueSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Array of allowed tabular data types. Can be provided as a single value or an array.'\n )\n\nexport const shortDescriptionSchema = Joi.string()\n .trim()\n .required()\n .description('Brief description of the question for internal use')\n\nexport const pageHeadingAndGuidanceSchema = Joi.string()\n .trim()\n .optional()\n .description('Combined heading and guidance for the page')\n\nexport const pageHeadingSchema = Joi.string()\n .trim()\n .required()\n .description('Main heading displayed at the top of the page')\n\nexport const guidanceTextSchema = Joi.string()\n .trim()\n .description('Guidance text to assist users in completing the page')\n\nexport const needDeclarationSchema = Joi.string()\n .trim()\n .required()\n .description('Whether a declaration is needed')\n\nexport const declarationTextSchema = Joi.string()\n .trim()\n .required()\n .description('Text of the declaration that users must agree to')\n\nexport const minSchema = Joi.number()\n .empty('')\n .integer()\n .description('Minimum value for numeric inputs')\n\nexport const maxSchema = Joi.number()\n .empty('')\n .integer()\n .description('Maximum value for numeric inputs')\n\nexport const minLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Minimum character length for text inputs')\n\nexport const maxLengthSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum character length for text inputs')\n\nexport const maxFutureSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum days in the future allowed for date inputs')\n\nexport const maxPastSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum days in the past allowed for date inputs')\n\nexport const precisionSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Decimal precision for numeric inputs')\n\nexport const prefixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display before the input (e.g., £)')\n\nexport const regexSchema = Joi.string()\n .optional()\n .allow('')\n .description('Regular expression pattern for validation')\n\nexport const rowsSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Number of rows for multiline text fields')\n\nexport const suffixSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Text to display after the input (e.g., kg)')\n\nexport const classesSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Custom CSS classes to apply to the component')\n\nexport const questionDetailsFullSchema = {\n classesSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioLabelSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema\n}\n\nexport const formEditorInputPageKeys = {\n pageType: pageTypeSchema,\n questionType: questionTypeSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPage` interface\n * @see {@link FormEditorInputPage}\n */\nexport const formEditorInputPageSchema = Joi.object<FormEditorInputPage>()\n .keys(formEditorInputPageKeys)\n .required()\n .description('Input schema for creating a new page in the form editor')\n\nexport const formEditorInputheckAnswersSettingsKeys = {\n declarationText: shortDescriptionSchema\n}\n\n/**\n * Joi schema for `FormEditorInputCheckAnswersSettings` interface\n * @see {@link FormEditorInputCheckAnswersSettings}\n */\nexport const formEditorInputCheckAnswersSettingSchema =\n Joi.object<FormEditorInputCheckAnswersSettings>()\n .keys(formEditorInputheckAnswersSettingsKeys)\n .required()\n .description('Configuration for the check-answers page')\n\nexport const formEditorInputQuestionKeys = {\n question: questionSchema,\n shortDescription: shortDescriptionSchema,\n hintText: hintTextSchema,\n questionOptional: questionOptionalSchema\n}\n\n/**\n * Joi schema for `FormEditorInputQuestion` interface\n * @see {@link FormEditorInputQuestion}\n */\nexport const formEditorInputQuestionSchema =\n Joi.object<FormEditorInputQuestion>()\n .keys(formEditorInputQuestionKeys)\n .required()\n .description(\n 'Input schema for creating or updating a question in the form editor'\n )\n\nexport const formEditorInputPageSettingsKeys = {\n pageHeadingAndGuidance: pageHeadingAndGuidanceSchema,\n pageHeading: pageHeadingSchema,\n guidanceText: guidanceTextSchema\n}\n\n/**\n * Joi schema for `FormEditorInputPageSettings` interface\n * @see {@link FormEditorInputPageSettings}\n */\nexport const formEditorInputPageSettingsSchema =\n Joi.object<FormEditorInputPageSettings>()\n .keys(formEditorInputPageSettingsKeys)\n .required()\n .description('Settings for page content and display in the form editor')\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,aAAa;AAQtB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,OAAO,MAAMC,cAAc,GAAGH,GAAG,CAACI,MAAM,CAAC,CAAC,CACvCC,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC7BC,WAAW,CAAC,wDAAwD,CAAC;AAExE,OAAO,MAAMC,kBAAkB,GAAGR,GAAG,CAACI,MAAM,CAAC,CAAC,CAC3CC,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJJ,oBAAoB,CAACO,qBAAqB,EAC1CP,oBAAoB,CAACQ,YAAY,EACjCT,aAAa,CAACU,cAAc,EAC5BV,aAAa,CAACW,oBAAoB,EAClCX,aAAa,CAACY,eAAe,EAC7BZ,aAAa,CAACa,iBAAiB,EAC/BZ,oBAAoB,CAACa,YAAY,EACjCd,aAAa,CAACe,UAAU,EACxBf,aAAa,CAACgB,eAAe,EAC7BhB,aAAa,CAACiB,WAAW,EACzBjB,aAAa,CAACkB,iBAChB,CAAC,CACAZ,WAAW,CAAC,0DAA0D,CAAC;AAE1E,OAAO,MAAMa,sBAAsB,GAAGpB,GAAG,CAACI,MAAM,CAAC,CAAC,CAC/C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sBAAsB,EAAElC,4BAA4B;EACpDmC,WAAW,EAAElC,iBAAiB;EAC9BmC,YAAY,EAAElC;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMmC,iCAAiC,GAC5C/F,GAAG,CAACgF,MAAM,CAA8B,CAAC,CACtCC,IAAI,CAACU,+BAA+B,CAAC,CACrCtF,QAAQ,CAAC,CAAC,CACVE,WAAW,CAAC,0DAA0D,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[]\n classes?: string\n label?: { text?: string; html?: string; classes?: string }\n hint?: { text?: string; html?: string; classes?: string }\n items?: { text?: string; value?: string; checked?: boolean }[]\n rows?: number\n type?: string\n}\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n errorMessage?: { text: string }\n}\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioLabel: string\n\n /**\n * The hint of the radio item\n */\n radioHint: string\n\n /**\n * The value of the radio item\n */\n radioValue: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'enhancedAction'\n | 'radioId'\n | 'radioLabel'\n | 'radioHint'\n | 'radioValue'\n>\n\nexport interface EnhancedActionState {\n questionDetails: Partial<ComponentDef>\n state: {\n radioId?: string\n radioLabel?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems: { label?: string; hint?: string; value?: string; id?: string }[]\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[]\n classes?: string\n label?: { text?: string; html?: string; classes?: string }\n hint?: { text?: string; html?: string; classes?: string }\n items?: { text?: string; value?: string; checked?: boolean }[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n errorMessage?: { text: string }\n}\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import Joi from 'joi';
2
2
  import { pageSchema } from "../../index.js";
3
3
  export const patchPageSchema = Joi.object().keys({
4
- title: pageSchema.extract('title').optional(),
5
- path: pageSchema.extract('path').optional()
6
- }).required().min(1);
4
+ title: pageSchema.extract('title').optional().description('New title to set for the page'),
5
+ path: pageSchema.extract('path').optional().description('New URL path to set for the page')
6
+ }).required().min(1).description('Schema for partially updating a page, requiring at least one field to be provided');
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","pageSchema","patchPageSchema","object","keys","title","extract","optional","path","required","min"],"sources":["../../../../src/form/form-manager/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { type PatchPageFields } from '~/src/form/form-manager/types.js'\nimport { pageSchema } from '~/src/index.js'\n\nexport const patchPageSchema = Joi.object<PatchPageFields>()\n .keys({\n title: pageSchema.extract('title').optional(),\n path: pageSchema.extract('path').optional()\n })\n .required()\n .min(1)\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAGrB,SAASC,UAAU;AAEnB,OAAO,MAAMC,eAAe,GAAGF,GAAG,CAACG,MAAM,CAAkB,CAAC,CACzDC,IAAI,CAAC;EACJC,KAAK,EAAEJ,UAAU,CAACK,OAAO,CAAC,OAAO,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC7CC,IAAI,EAAEP,UAAU,CAACK,OAAO,CAAC,MAAM,CAAC,CAACC,QAAQ,CAAC;AAC5C,CAAC,CAAC,CACDE,QAAQ,CAAC,CAAC,CACVC,GAAG,CAAC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","pageSchema","patchPageSchema","object","keys","title","extract","optional","description","path","required","min"],"sources":["../../../../src/form/form-manager/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { type PatchPageFields } from '~/src/form/form-manager/types.js'\nimport { pageSchema } from '~/src/index.js'\n\nexport const patchPageSchema = Joi.object<PatchPageFields>()\n .keys({\n title: pageSchema\n .extract('title')\n .optional()\n .description('New title to set for the page'),\n path: pageSchema\n .extract('path')\n .optional()\n .description('New URL path to set for the page')\n })\n .required()\n .min(1)\n .description(\n 'Schema for partially updating a page, requiring at least one field to be provided'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAGrB,SAASC,UAAU;AAEnB,OAAO,MAAMC,eAAe,GAAGF,GAAG,CAACG,MAAM,CAAkB,CAAC,CACzDC,IAAI,CAAC;EACJC,KAAK,EAAEJ,UAAU,CACdK,OAAO,CAAC,OAAO,CAAC,CAChBC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,+BAA+B,CAAC;EAC/CC,IAAI,EAAER,UAAU,CACbK,OAAO,CAAC,MAAM,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,kCAAkC;AACnD,CAAC,CAAC,CACDE,QAAQ,CAAC,CAAC,CACVC,GAAG,CAAC,CAAC,CAAC,CACNH,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
@@ -1,49 +1,49 @@
1
1
  import Joi from 'joi';
2
2
  export const organisations = ['Animal and Plant Health Agency – APHA', 'Centre for Environment, Fisheries and Aquaculture Science – Cefas', 'Defra', 'Environment Agency', 'Forestry Commission', 'Marine Management Organisation – MMO', 'Natural England', 'Rural Payments Agency – RPA', 'Veterinary Medicines Directorate – VMD'];
3
- export const idSchema = Joi.string().hex().length(24).required();
4
- export const titleSchema = Joi.string().max(250).trim().required();
3
+ export const idSchema = Joi.string().hex().length(24).required().description('Unique identifier for the form, 24-character hexadecimal string');
4
+ export const titleSchema = Joi.string().max(250).trim().required().description('Title of the form, displayed to users');
5
5
  export const slugSchema = Joi.string().pattern(/^[a-z0-9-]+$/, {
6
6
  name: 'letters, numbers and hyphens only'
7
- }).required();
8
- export const organisationSchema = Joi.string().valid(...organisations).required();
9
- export const teamNameSchema = Joi.string().max(100).trim().required();
7
+ }).required().description('URL-friendly identifier used in form paths');
8
+ export const organisationSchema = Joi.string().valid(...organisations).required().description('Defra organisation responsible for the form');
9
+ export const teamNameSchema = Joi.string().max(100).trim().required().description('Name of the team responsible for the form');
10
10
  export const teamEmailSchema = Joi.string().email({
11
11
  tlds: {
12
12
  allow: ['uk']
13
13
  }
14
- }).trim().required();
15
- export const phoneSchema = Joi.string().trim();
16
- export const emailAddressSchema = Joi.string().email().trim().required();
17
- export const emailResponseTimeSchema = Joi.string().trim().required();
14
+ }).trim().required().description('Contact email for the team responsible for the form');
15
+ export const phoneSchema = Joi.string().trim().description('Phone number for form-related inquiries');
16
+ export const emailAddressSchema = Joi.string().email().trim().required().description('Email address for form-related inquiries');
17
+ export const emailResponseTimeSchema = Joi.string().trim().required().description('Expected response time for email inquiries');
18
18
  export const emailSchema = Joi.object().keys({
19
19
  address: emailAddressSchema,
20
20
  responseTime: emailResponseTimeSchema
21
- });
21
+ }).description('Email contact details including response expectations');
22
22
  export const onlineUrlSchema = Joi.string().uri({
23
23
  scheme: ['http', 'https']
24
- }).trim().required();
25
- export const onlineTextSchema = Joi.string().trim().required();
24
+ }).trim().required().description('URL for online contact method');
25
+ export const onlineTextSchema = Joi.string().trim().required().description('Descriptive text for the online contact link');
26
26
  export const onlineSchema = Joi.object().keys({
27
27
  url: onlineUrlSchema,
28
28
  text: onlineTextSchema
29
- });
29
+ }).description('Online contact details with URL and descriptive text');
30
30
  export const contactSchema = Joi.object().keys({
31
31
  phone: phoneSchema,
32
32
  email: emailSchema,
33
33
  online: onlineSchema
34
- });
35
- export const submissionGuidanceSchema = Joi.string().trim();
34
+ }).description('Complete contact information for form-related inquiries');
35
+ export const submissionGuidanceSchema = Joi.string().trim().description('Guidance text shown to users when submitting the form');
36
36
  export const privacyNoticeUrlSchema = Joi.string().uri({
37
37
  scheme: ['http', 'https']
38
- }).trim();
38
+ }).trim().description('URL to the privacy notice for this form');
39
39
  export const notificationEmailAddressSchema = Joi.string().email({
40
40
  tlds: {
41
41
  allow: ['uk']
42
42
  }
43
- }).trim().pattern(/\.gov\.uk$|\.org\.uk$/);
44
- export const authoredAtSchema = Joi.date().iso().required();
45
- export const authorIdSchema = Joi.string().trim().required();
46
- export const authorDisplayNameSchema = Joi.string().trim().required();
43
+ }).trim().pattern(/\.gov\.uk$|\.org\.uk$/).description('Email address to receive form submission notifications, must be a .gov.uk or .org.uk address');
44
+ export const authoredAtSchema = Joi.date().iso().required().description('ISO format timestamp of when an action occurred');
45
+ export const authorIdSchema = Joi.string().trim().required().description('Unique identifier for the author');
46
+ export const authorDisplayNameSchema = Joi.string().trim().required().description('Human-readable name of the author');
47
47
  export const formMetadataInputKeys = {
48
48
  title: titleSchema,
49
49
  organisation: organisationSchema,
@@ -59,7 +59,7 @@ export const formMetadataInputKeys = {
59
59
  * Joi schema for `FormMetadataInput` interface
60
60
  * @see {@link FormMetadataInput}
61
61
  */
62
- export const formMetadataInputSchema = Joi.object().keys(formMetadataInputKeys).required();
62
+ export const formMetadataInputSchema = Joi.object().keys(formMetadataInputKeys).required().description('Input data for creating or updating form metadata');
63
63
 
64
64
  /**
65
65
  * Joi schema for `FormMetadataAuthor` interface
@@ -68,18 +68,18 @@ export const formMetadataInputSchema = Joi.object().keys(formMetadataInputKeys).
68
68
  export const formMetadataAuthorSchema = Joi.object().keys({
69
69
  id: authorIdSchema,
70
70
  displayName: authorDisplayNameSchema
71
- }).required();
71
+ }).required().description('Information about the author of a form or form change');
72
72
 
73
73
  /**
74
74
  * Joi schema for `FormMetadataState` interface
75
75
  * @see {@link FormMetadataState}
76
76
  */
77
77
  export const formMetadataStateSchema = Joi.object().keys({
78
- createdAt: authoredAtSchema,
79
- createdBy: formMetadataAuthorSchema,
80
- updatedAt: authoredAtSchema,
81
- updatedBy: formMetadataAuthorSchema
82
- });
78
+ createdAt: authoredAtSchema.description('When this version was first created'),
79
+ createdBy: formMetadataAuthorSchema.description('Who created this version'),
80
+ updatedAt: authoredAtSchema.description('When this version was last updated'),
81
+ updatedBy: formMetadataAuthorSchema.description('Who last updated this version')
82
+ }).description('Metadata about a specific version state (draft or live)');
83
83
 
84
84
  /**
85
85
  * Joi schema for `FormMetadata` interface
@@ -88,11 +88,11 @@ export const formMetadataStateSchema = Joi.object().keys({
88
88
  export const formMetadataSchema = formMetadataInputSchema.append({
89
89
  id: idSchema,
90
90
  slug: slugSchema,
91
- draft: formMetadataStateSchema,
92
- live: formMetadataStateSchema,
93
- createdAt: authoredAtSchema,
94
- createdBy: formMetadataAuthorSchema,
95
- updatedAt: authoredAtSchema,
96
- updatedBy: formMetadataAuthorSchema
97
- });
91
+ draft: formMetadataStateSchema.description('Metadata for the draft version'),
92
+ live: formMetadataStateSchema.description('Metadata for the published version'),
93
+ createdAt: authoredAtSchema.description('When the form was first created'),
94
+ createdBy: formMetadataAuthorSchema.description('Who created the form'),
95
+ updatedAt: authoredAtSchema.description('When the form was last updated'),
96
+ updatedBy: formMetadataAuthorSchema.description('Who last updated the form')
97
+ }).description('Complete metadata for a form, including version information and authoring details');
98
98
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","phoneSchema","emailAddressSchema","emailResponseTimeSchema","emailSchema","object","keys","address","responseTime","onlineUrlSchema","uri","scheme","onlineTextSchema","onlineSchema","url","text","contactSchema","phone","online","submissionGuidanceSchema","privacyNoticeUrlSchema","notificationEmailAddressSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeUrl","notificationEmail","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formMetadataSchema","append","slug","draft","live"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string().hex().length(24).required()\nexport const titleSchema = Joi.string().max(250).trim().required()\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n\nexport const teamNameSchema = Joi.string().max(100).trim().required()\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n\nexport const phoneSchema = Joi.string().trim()\n\nexport const emailAddressSchema = Joi.string().email().trim().required()\nexport const emailResponseTimeSchema = Joi.string().trim().required()\nexport const emailSchema = Joi.object<FormMetadataContactEmail>().keys({\n address: emailAddressSchema,\n responseTime: emailResponseTimeSchema\n})\n\nexport const onlineUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .required()\nexport const onlineTextSchema = Joi.string().trim().required()\nexport const onlineSchema = Joi.object<FormMetadataContactOnline>().keys({\n url: onlineUrlSchema,\n text: onlineTextSchema\n})\n\nexport const contactSchema = Joi.object<FormMetadataContact>().keys({\n phone: phoneSchema,\n email: emailSchema,\n online: onlineSchema\n})\n\nexport const submissionGuidanceSchema = Joi.string().trim()\n\nexport const privacyNoticeUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n\nexport const notificationEmailAddressSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .pattern(/\\.gov\\.uk$|\\.org\\.uk$/)\n\nexport const authoredAtSchema = Joi.date().iso().required()\nexport const authorIdSchema = Joi.string().trim().required()\nexport const authorDisplayNameSchema = Joi.string().trim().required()\n\nexport const formMetadataInputKeys = {\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema,\n contact: contactSchema,\n submissionGuidance: submissionGuidanceSchema,\n privacyNoticeUrl: privacyNoticeUrlSchema,\n notificationEmail: notificationEmailAddressSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>().keys({\n createdAt: authoredAtSchema,\n createdBy: formMetadataAuthorSchema,\n updatedAt: authoredAtSchema,\n updatedBy: formMetadataAuthorSchema\n})\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema.append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema,\n live: formMetadataStateSchema,\n createdAt: authoredAtSchema,\n createdBy: formMetadataAuthorSchema,\n updatedAt: authoredAtSchema,\n updatedBy: formMetadataAuthorSchema\n})\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAYrB,OAAO,MAAMC,aAAa,GAAG,CAC3B,uCAAuC,EACvC,mEAAmE,EACnE,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,iBAAiB,EACjB,6BAA6B,EAC7B,wCAAwC,CACzC;AAED,OAAO,MAAMC,QAAQ,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC;AAChE,OAAO,MAAMC,WAAW,GAAGP,GAAG,CAACG,MAAM,CAAC,CAAC,CAACK,GAAG,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,C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IAAI,EAAET,uBAAuB;EAC7BC,SAAS,EAAEnB,gBAAgB;EAC3BoB,SAAS,EAAEL,wBAAwB;EACnCM,SAAS,EAAErB,gBAAgB;EAC3BsB,SAAS,EAAEP;AACb,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","description","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","phoneSchema","emailAddressSchema","emailResponseTimeSchema","emailSchema","object","keys","address","responseTime","onlineUrlSchema","uri","scheme","onlineTextSchema","onlineSchema","url","text","contactSchema","phone","online","submissionGuidanceSchema","privacyNoticeUrlSchema","notificationEmailAddressSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeUrl","notificationEmail","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formMetadataSchema","append","slug","draft","live"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string()\n .hex()\n .length(24)\n .required()\n .description(\n 'Unique identifier for the form, 24-character hexadecimal string'\n )\n\nexport const titleSchema = Joi.string()\n .max(250)\n .trim()\n .required()\n .description('Title of the form, displayed to users')\n\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n .description('URL-friendly identifier used in form paths')\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n .description('Defra organisation responsible for the form')\n\nexport const teamNameSchema = Joi.string()\n .max(100)\n .trim()\n .required()\n .description('Name of the team responsible for the form')\n\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n .description('Contact email for the team responsible for the form')\n\nexport const phoneSchema = Joi.string()\n .trim()\n .description('Phone number for form-related inquiries')\n\nexport const emailAddressSchema = Joi.string()\n .email()\n .trim()\n .required()\n .description('Email address for form-related inquiries')\n\nexport const emailResponseTimeSchema = Joi.string()\n .trim()\n .required()\n .description('Expected response time for email inquiries')\n\nexport const emailSchema = Joi.object<FormMetadataContactEmail>()\n .keys({\n address: emailAddressSchema,\n responseTime: emailResponseTimeSchema\n })\n .description('Email contact details including response expectations')\n\nexport const onlineUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .required()\n .description('URL for online contact method')\n\nexport const onlineTextSchema = Joi.string()\n .trim()\n .required()\n .description('Descriptive text for the online contact link')\n\nexport const onlineSchema = Joi.object<FormMetadataContactOnline>()\n .keys({\n url: onlineUrlSchema,\n text: onlineTextSchema\n })\n .description('Online contact details with URL and descriptive text')\n\nexport const contactSchema = Joi.object<FormMetadataContact>()\n .keys({\n phone: phoneSchema,\n email: emailSchema,\n online: onlineSchema\n })\n .description('Complete contact information for form-related inquiries')\n\nexport const submissionGuidanceSchema = Joi.string()\n .trim()\n .description('Guidance text shown to users when submitting the form')\n\nexport const privacyNoticeUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .description('URL to the privacy notice for this form')\n\nexport const notificationEmailAddressSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .pattern(/\\.gov\\.uk$|\\.org\\.uk$/)\n .description(\n 'Email address to receive form submission notifications, must be a .gov.uk or .org.uk address'\n )\n\nexport const authoredAtSchema = Joi.date()\n .iso()\n .required()\n .description('ISO format timestamp of when an action occurred')\n\nexport const authorIdSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the author')\n\nexport const authorDisplayNameSchema = Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the author')\n\nexport const formMetadataInputKeys = {\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema,\n contact: contactSchema,\n submissionGuidance: submissionGuidanceSchema,\n privacyNoticeUrl: privacyNoticeUrlSchema,\n notificationEmail: notificationEmailAddressSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n .description('Input data for creating or updating form metadata')\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n .description('Information about the author of a form or form change')\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>()\n .keys({\n createdAt: authoredAtSchema.description(\n 'When this version was first created'\n ),\n createdBy: formMetadataAuthorSchema.description('Who created this version'),\n updatedAt: authoredAtSchema.description(\n 'When this version was last updated'\n ),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated this version'\n )\n })\n .description('Metadata about a specific version state (draft or live)')\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema\n .append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.description(\n 'Metadata for the draft version'\n ),\n live: formMetadataStateSchema.description(\n 'Metadata for the published version'\n ),\n createdAt: authoredAtSchema.description('When the form was first created'),\n createdBy: formMetadataAuthorSchema.description('Who created the form'),\n updatedAt: authoredAtSchema.description('When the form was last updated'),\n updatedBy: formMetadataAuthorSchema.description('Who last updated the form')\n })\n .description(\n 'Complete metadata for a form, including version information and authoring details'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAYrB,OAAO,MAAMC,aAAa,GAAG,CAC3B,uCAAuC,EACvC,mEAAmE,EACnE,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,iBAAiB,EACjB,6BAA6B,EAC7B,wCAAwC,CACzC;AAED,OAAO,MAAMC,QAAQ,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CACjCC,GAAG,CAAC,CAAC,CACLC,MAAM,CAAC,EAAE,CAAC,CACVC,QAAQ,CAAC,CAAC,CACVC,WAAW,CACV,iEACF,CAAC;AAEH,OAAO,MAAMC,WAAW,GAAGR,GAAG,CAACG,MAAM,CAAC,CAAC,CACpCM,GAAG,CAAC,GAAG,CAAC,CACRC,IAAI,CAAC,CAAC,CACNJ,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,uCAAuC,CAAC;AAEvD,OAAO,MAAMI,UAAU,GAAGX,GAAG,CAACG,MAAM,CAAC,CAAC,CACnCS,OAAO,CAAC,cAAc,EAAE;EAAEC,IAAI,EAAE;AAAoC,CAAC,CAAC,CACtEP,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,4CAA4C,CAAC;AAE5D,OAAO,MAAMO,kBAAkB,GAAGd,GAAG,CAACG,MAAM,CAAC,CAAC,CAC3CY,KAAK,CAAC,GAAGd,aAAa,CAAC,CACvBK,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,6CAA6C,CAAC;AAE7D,OAAO,MAAMS,cAAc,GAAGhB,GAAG,CAACG,MAAM,CAAC,CAAC,CACvCM,GAAG,CAAC,GAAG,CAAC,CACRC,IAAI,CAAC,CAAC,CACNJ,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,2CA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W,CACrC,oCACF,CAAC;EACDyD,SAAS,EAAEP,wBAAwB,CAAClD,WAAW,CAC7C,+BACF;AACF,CAAC,CAAC,CACDA,WAAW,CAAC,yDAAyD,CAAC;;AAEzE;AACA;AACA;AACA;AACA,OAAO,MAAM0D,kBAAkB,GAAGT,uBAAuB,CACtDU,MAAM,CAAe;EACpBR,EAAE,EAAExD,QAAQ;EACZiE,IAAI,EAAExD,UAAU;EAChByD,KAAK,EAAER,uBAAuB,CAACrD,WAAW,CACxC,gCACF,CAAC;EACD8D,IAAI,EAAET,uBAAuB,CAACrD,WAAW,CACvC,oCACF,CAAC;EACDsD,SAAS,EAAEnB,gBAAgB,CAACnC,WAAW,CAAC,iCAAiC,CAAC;EAC1EuD,SAAS,EAAEL,wBAAwB,CAAClD,WAAW,CAAC,sBAAsB,CAAC;EACvEwD,SAAS,EAAErB,gBAAgB,CAACnC,WAAW,CAAC,gCAAgC,CAAC;EACzEyD,SAAS,EAAEP,wBAAwB,CAAClD,WAAW,CAAC,2BAA2B;AAC7E,CAAC,CAAC,CACDA,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
@@ -4,29 +4,29 @@ import Joi from 'joi';
4
4
  * @see {@link SubmitRecord}
5
5
  */
6
6
  export const formSubmitRecordSchema = Joi.object({
7
- name: Joi.string().required(),
8
- title: Joi.string().required(),
9
- value: Joi.string().required().allow('')
10
- });
7
+ name: Joi.string().required().description('Field identifier matching the component name'),
8
+ title: Joi.string().required().description('Human-readable label for the field'),
9
+ value: Joi.string().required().allow('').description('User-submitted value for the field, may be empty')
10
+ }).description('Individual field value in a form submission');
11
11
 
12
12
  /**
13
13
  * Joi schema for `SubmitRecordset` interface
14
14
  * @see {@link SubmitRecordset}
15
15
  */
16
16
  export const formSubmitRecordsetSchema = Joi.object({
17
- name: Joi.string().required(),
18
- title: Joi.string().required(),
19
- value: Joi.array().items(Joi.array().items(formSubmitRecordSchema).required()).required()
20
- });
17
+ name: Joi.string().required().description('Identifier for the repeatable section'),
18
+ title: Joi.string().required().description('Human-readable title for the repeatable section'),
19
+ value: Joi.array().items(Joi.array().items(formSubmitRecordSchema).required()).required().description('Array of record arrays, each representing a repeated instance')
20
+ }).description('Collection of repeated field values from a repeatable section');
21
21
 
22
22
  /**
23
23
  * Joi schema for `SubmitPayload` interface
24
24
  * @see {@link SubmitPayload}
25
25
  */
26
26
  export const formSubmitPayloadSchema = Joi.object().keys({
27
- retrievalKey: Joi.string().required(),
28
- sessionId: Joi.string().required(),
29
- main: Joi.array().items(formSubmitRecordSchema).required(),
30
- repeaters: Joi.array().items(formSubmitRecordsetSchema).required()
31
- }).required();
27
+ retrievalKey: Joi.string().required().description('Unique key to retrieve this submission later'),
28
+ sessionId: Joi.string().required().description('User session identifier for tracking and security'),
29
+ main: Joi.array().items(formSubmitRecordSchema).required().description('Main (non-repeating) field values from the form'),
30
+ repeaters: Joi.array().items(formSubmitRecordsetSchema).required().description('Repeatable section values from the form')
31
+ }).required().description('Complete form submission payload structure with all form data');
32
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","formSubmitRecordSchema","object","name","string","required","title","value","allow","formSubmitRecordsetSchema","array","items","formSubmitPayloadSchema","keys","retrievalKey","sessionId","main","repeaters"],"sources":["../../../../src/form/form-submission/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type SubmitPayload,\n type SubmitRecord,\n type SubmitRecordset\n} from '~/src/form/form-submission/types.js'\n\n/**\n * Joi schema for `SubmitRecord` interface\n * @see {@link SubmitRecord}\n */\nexport const formSubmitRecordSchema = Joi.object<SubmitRecord>({\n name: Joi.string().required(),\n title: Joi.string().required(),\n value: Joi.string().required().allow('')\n})\n\n/**\n * Joi schema for `SubmitRecordset` interface\n * @see {@link SubmitRecordset}\n */\nexport const formSubmitRecordsetSchema = Joi.object<SubmitRecordset>({\n name: Joi.string().required(),\n title: Joi.string().required(),\n value: Joi.array<SubmitRecord[]>()\n .items(Joi.array<SubmitRecord>().items(formSubmitRecordSchema).required())\n .required()\n})\n\n/**\n * Joi schema for `SubmitPayload` interface\n * @see {@link SubmitPayload}\n */\nexport const formSubmitPayloadSchema = Joi.object<SubmitPayload>()\n .keys({\n retrievalKey: Joi.string().required(),\n sessionId: Joi.string().required(),\n main: Joi.array<SubmitRecord>().items(formSubmitRecordSchema).required(),\n repeaters: Joi.array<SubmitRecordset>()\n .items(formSubmitRecordsetSchema)\n .required()\n })\n .required()\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAQrB;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGD,GAAG,CAACE,MAAM,CAAe;EAC7DC,IAAI,EAAEH,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC7BC,KAAK,EAAEN,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC9BE,KAAK,EAAEP,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACG,KAAK,CAAC,EAAE;AACzC,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAGT,GAAG,CAACE,MAAM,CAAkB;EACnEC,IAAI,EAAEH,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC7BC,KAAK,EAAEN,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC9BE,KAAK,EAAEP,GAAG,CAACU,KAAK,CAAiB,CAAC,CAC/BC,KAAK,CAACX,GAAG,CAACU,KAAK,CAAe,CAAC,CAACC,KAAK,CAACV,sBAAsB,CAAC,CAACI,QAAQ,CAAC,CAAC,CAAC,CACzEA,QAAQ,CAAC;AACd,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,OAAO,MAAMO,uBAAuB,GAAGZ,GAAG,CAACE,MAAM,CAAgB,CAAC,CAC/DW,IAAI,CAAC;EACJC,YAAY,EAAEd,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACrCU,SAAS,EAAEf,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAClCW,IAAI,EAAEhB,GAAG,CAACU,KAAK,CAAe,CAAC,CAACC,KAAK,CAACV,sBAAsB,CAAC,CAACI,QAAQ,CAAC,CAAC;EACxEY,SAAS,EAAEjB,GAAG,CAACU,KAAK,CAAkB,CAAC,CACpCC,KAAK,CAACF,yBAAyB,CAAC,CAChCJ,QAAQ,CAAC;AACd,CAAC,CAAC,CACDA,QAAQ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","formSubmitRecordSchema","object","name","string","required","description","title","value","allow","formSubmitRecordsetSchema","array","items","formSubmitPayloadSchema","keys","retrievalKey","sessionId","main","repeaters"],"sources":["../../../../src/form/form-submission/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type SubmitPayload,\n type SubmitRecord,\n type SubmitRecordset\n} from '~/src/form/form-submission/types.js'\n\n/**\n * Joi schema for `SubmitRecord` interface\n * @see {@link SubmitRecord}\n */\nexport const formSubmitRecordSchema = Joi.object<SubmitRecord>({\n name: Joi.string()\n .required()\n .description('Field identifier matching the component name'),\n title: Joi.string()\n .required()\n .description('Human-readable label for the field'),\n value: Joi.string()\n .required()\n .allow('')\n .description('User-submitted value for the field, may be empty')\n}).description('Individual field value in a form submission')\n\n/**\n * Joi schema for `SubmitRecordset` interface\n * @see {@link SubmitRecordset}\n */\nexport const formSubmitRecordsetSchema = Joi.object<SubmitRecordset>({\n name: Joi.string()\n .required()\n .description('Identifier for the repeatable section'),\n title: Joi.string()\n .required()\n .description('Human-readable title for the repeatable section'),\n value: Joi.array<SubmitRecord[]>()\n .items(Joi.array<SubmitRecord>().items(formSubmitRecordSchema).required())\n .required()\n .description(\n 'Array of record arrays, each representing a repeated instance'\n )\n}).description('Collection of repeated field values from a repeatable section')\n\n/**\n * Joi schema for `SubmitPayload` interface\n * @see {@link SubmitPayload}\n */\nexport const formSubmitPayloadSchema = Joi.object<SubmitPayload>()\n .keys({\n retrievalKey: Joi.string()\n .required()\n .description('Unique key to retrieve this submission later'),\n sessionId: Joi.string()\n .required()\n .description('User session identifier for tracking and security'),\n main: Joi.array<SubmitRecord>()\n .items(formSubmitRecordSchema)\n .required()\n .description('Main (non-repeating) field values from the form'),\n repeaters: Joi.array<SubmitRecordset>()\n .items(formSubmitRecordsetSchema)\n .required()\n .description('Repeatable section values from the form')\n })\n .required()\n .description('Complete form submission payload structure with all form data')\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAQrB;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGD,GAAG,CAACE,MAAM,CAAe;EAC7DC,IAAI,EAAEH,GAAG,CAACI,MAAM,CAAC,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,8CAA8C,CAAC;EAC9DC,KAAK,EAAEP,GAAG,CAACI,MAAM,CAAC,CAAC,CAChBC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,oCAAoC,CAAC;EACpDE,KAAK,EAAER,GAAG,CAACI,MAAM,CAAC,CAAC,CAChBC,QAAQ,CAAC,CAAC,CACVI,KAAK,CAAC,EAAE,CAAC,CACTH,WAAW,CAAC,kDAAkD;AACnE,CAAC,CAAC,CAACA,WAAW,CAAC,6CAA6C,CAAC;;AAE7D;AACA;AACA;AACA;AACA,OAAO,MAAMI,yBAAyB,GAAGV,GAAG,CAACE,MAAM,CAAkB;EACnEC,IAAI,EAAEH,GAAG,CAACI,MAAM,CAAC,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,uCAAuC,CAAC;EACvDC,KAAK,EAAEP,GAAG,CAACI,MAAM,CAAC,CAAC,CAChBC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,iDAAiD,CAAC;EACjEE,KAAK,EAAER,GAAG,CAACW,KAAK,CAAiB,CAAC,CAC/BC,KAAK,CAACZ,GAAG,CAACW,KAAK,CAAe,CAAC,CAACC,KAAK,CAACX,sBAAsB,CAAC,CAACI,QAAQ,CAAC,CAAC,CAAC,CACzEA,QAAQ,CAAC,CAAC,CACVC,WAAW,CACV,+DACF;AACJ,CAAC,CAAC,CAACA,WAAW,CAAC,+DAA+D,CAAC;;AAE/E;AACA;AACA;AACA;AACA,OAAO,MAAMO,uBAAuB,GAAGb,GAAG,CAACE,MAAM,CAAgB,CAAC,CAC/DY,IAAI,CAAC;EACJC,YAAY,EAAEf,GAAG,CAACI,MAAM,CAAC,CAAC,CACvBC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,8CAA8C,CAAC;EAC9DU,SAAS,EAAEhB,GAAG,CAACI,MAAM,CAAC,CAAC,CACpBC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,mDAAmD,CAAC;EACnEW,IAAI,EAAEjB,GAAG,CAACW,KAAK,CAAe,CAAC,CAC5BC,KAAK,CAACX,sBAAsB,CAAC,CAC7BI,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,iDAAiD,CAAC;EACjEY,SAAS,EAAElB,GAAG,CAACW,KAAK,CAAkB,CAAC,CACpCC,KAAK,CAACF,yBAAyB,CAAC,CAChCL,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,yCAAyC;AAC1D,CAAC,CAAC,CACDD,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,+DAA+D,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=joi-to-json.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joi-to-json.d.js","names":[],"sources":["../../../src/types/joi-to-json.d.ts"],"sourcesContent":["declare module 'joi-to-json' {\n import { type Schema } from 'joi'\n\n /**\n * Converts a Joi schema to a JSON Schema\n */\n function parse(\n joiSchema: Schema,\n type?: string,\n definitions?: object,\n parserOptions?: object\n ): object\n\n export = parse\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;CASlC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,GAAG,CAAC,YAAY,CAAC,iBAAiB,CACpC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;CAgBlC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,GAAG,CAAC,YAAY,CAAC,iBAAiB,CACpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAGjE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;CAa9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAChC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAGjE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;CA2B9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAChC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/sorting/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;CAG/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,GAAG,CAAC,YAAY,CAAC,cAAc,CACjC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/sorting/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;CAS/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,GAAG,CAAC,YAAY,CAAC,cAAc,CACjC,CAAA"}
@@ -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,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAU7D,OAAO,EAKL,KAAK,cAAc,EAGnB,KAAK,IAAI,EACT,KAAK,IAAI,EAMV,MAAM,qCAAqC,CAAA;AAqE5C,eAAO,MAAM,eAAe,gCAiDZ,CAAA;AAEhB,eAAO,MAAM,iBAAiB,gCAI5B,CAAA;AAsCF;;;GAGG;AACH,eAAO,MAAM,UAAU,wBAgBrB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,wBAEvB,CAAA;AAEF,eAAO,MAAM,mBAAmB,wBAQ9B,CAAA;AAwBF,eAAO,MAA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