@defra/forms-model 3.0.656 → 3.0.664

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 (34) hide show
  1. package/dist/module/form/form-editor/index.js +4 -2
  2. package/dist/module/form/form-editor/index.js.map +1 -1
  3. package/dist/module/form/form-editor/types.js.map +1 -1
  4. package/dist/module/form/form-metadata/index.js +3 -1
  5. package/dist/module/form/form-metadata/index.js.map +1 -1
  6. package/dist/module/form/form-metadata/types.js.map +1 -1
  7. package/dist/module/index.js +2 -0
  8. package/dist/module/index.js.map +1 -1
  9. package/dist/module/pages/helpers.js +18 -2
  10. package/dist/module/pages/helpers.js.map +1 -1
  11. package/dist/module/pages/index.js +1 -1
  12. package/dist/module/pages/index.js.map +1 -1
  13. package/dist/types/form/form-editor/index.d.ts +2 -0
  14. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  15. package/dist/types/form/form-editor/types.d.ts +6 -2
  16. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  17. package/dist/types/form/form-metadata/index.d.ts +2 -0
  18. package/dist/types/form/form-metadata/index.d.ts.map +1 -1
  19. package/dist/types/form/form-metadata/types.d.ts +6 -1
  20. package/dist/types/form/form-metadata/types.d.ts.map +1 -1
  21. package/dist/types/pages/helpers.d.ts +4 -0
  22. package/dist/types/pages/helpers.d.ts.map +1 -1
  23. package/dist/types/pages/index.d.ts +1 -1
  24. package/dist/types/pages/index.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/schemas/form-metadata-input-schema.json +5 -0
  27. package/schemas/form-metadata-schema.json +5 -0
  28. package/src/form/form-editor/index.ts +16 -2
  29. package/src/form/form-editor/types.ts +10 -1
  30. package/src/form/form-metadata/index.ts +6 -1
  31. package/src/form/form-metadata/types.ts +7 -0
  32. package/src/index.ts +2 -0
  33. package/src/pages/helpers.ts +23 -2
  34. package/src/pages/index.ts +1 -0
@@ -1,6 +1,6 @@
1
1
  import Joi from 'joi';
2
2
  import { rtrimOnly } from "../../common/rtrim-only.js";
3
- import { ComponentType } from "../../components/enums.js";
3
+ import { ComponentType, GeospatialFieldOptionsCountryEnum } from "../../components/enums.js";
4
4
  import { MAX_NUMBER_OF_REPEAT_ITEMS, MIN_NUMBER_OF_REPEAT_ITEMS } from "../form-definition/constants.js";
5
5
  import { preventUnicodeInEmail } from "../utils/prevent-unicode.js";
6
6
  export const emailAddressNoUnicodeSchema = Joi.string().trim().email().custom((value, helpers) => preventUnicodeInEmail(value, helpers)).description('Email address preventing unicode characters');
@@ -73,6 +73,7 @@ export const paymentApiKeySchema = Joi.string().trim().description('API key for
73
73
  export const exactChecksSchema = Joi.number().empty('').integer().min(2).description('Specifies the exact number of items required to be selected.');
74
74
  export const minChecksSchema = Joi.number().empty('').integer().min(2).description('Minimum number of items required to be selected.');
75
75
  export const maxChecksSchema = Joi.number().empty('').integer().min(2).description('Maximum number of items allowed to be selected.');
76
+ export const countriesSchema = Joi.array().items(Joi.string().valid(...Object.values(GeospatialFieldOptionsCountryEnum), 'any')).single().description('The country to be included in a geospatial field');
76
77
  export const customValidator = Joi.extend(joi => {
77
78
  return {
78
79
  type: 'dsv',
@@ -225,7 +226,8 @@ export const questionDetailsFullSchema = {
225
226
  usePostcodeLookupSchema,
226
227
  minChecksSchema,
227
228
  maxChecksSchema,
228
- exactChecksSchema
229
+ exactChecksSchema,
230
+ countriesSchema
229
231
  };
230
232
  export const formEditorInputPageKeys = {
231
233
  pageType: pageTypeSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","rtrimOnly","ComponentType","MAX_NUMBER_OF_REPEAT_ITEMS","MIN_NUMBER_OF_REPEAT_ITEMS","preventUnicodeInEmail","emailAddressNoUnicodeSchema","string","trim","email","custom","value","helpers","description","UNICODE_EMAIL_ERROR_MESSAGE","QuestionTypeSubGroup","pageTypeSchema","required","valid","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","LocationSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","DeclarationField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","PaymentField","GeospatialField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","SelectField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","locationSubSchema","nameSchema","questionSchema","hintTextSchema","optional","allow","instructionTextSchema","questionOptionalSchema","listForQuestionSchema","listItemCountSchema","number","listItemsDataSchema","exactFilesSchema","empty","integer","min","max","minFilesSchema","maxFilesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioTextSchema","radioHintSchema","radioValueSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","exitPageSchema","boolean","repeaterSchema","minItemsSchema","maxItemsSchema","questionSetNameSchema","needDeclarationSchema","declarationTextSchema","disableConfirmationEmailSchema","enableReferenceNumberSchema","disableUserFeedbackSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","jsEnabledSchema","usePostcodeLookupSchema","paymentDescriptionSchema","paymentAmountSchema","paymentApiKeySchema","exactChecksSchema","minChecksSchema","maxChecksSchema","customValidator","extend","joi","type","base","messages","coerce","from","method","rowSeparatorRule","schema","$_getRule","colSeparatorRule","keysRule","rowSeparator","args","rows","split","map","v","filter","Boolean","colSeparator","keys","coercedValue","row","reduce","acc","col","idx","_err","console","error","errors","rules","convert","alias","$_addRule","name","ref","assert","RegExp","message","Array","isArray","every","k","autoCompleteOptionsSchema","dsv","object","text","disallow","parent","unique","ignoreUndefined","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema","govukFieldValueIsString","govukField","includes","govukFieldIsChecked","checkedValue","checked","allowedErrorTemplateFunctions"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi, { type ArraySchema, type GetRuleOptions } from 'joi'\n\nimport { rtrimOnly } from '~/src/common/rtrim-only.js'\nimport { ComponentType } from '~/src/components/enums.js'\nimport {\n MAX_NUMBER_OF_REPEAT_ITEMS,\n MIN_NUMBER_OF_REPEAT_ITEMS\n} from '~/src/form/form-definition/constants.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion,\n type GovukField,\n type GovukFieldQuestionOptional,\n type GovukFieldUsePostcodeLookup,\n type GovukStringField\n} from '~/src/form/form-editor/types.js'\nimport { preventUnicodeInEmail } from '~/src/form/utils/prevent-unicode.js'\n\nexport const emailAddressNoUnicodeSchema = Joi.string()\n .trim()\n .email()\n .custom((value, helpers) => preventUnicodeInEmail(value, helpers))\n .description('Email address preventing unicode characters')\n\nexport const UNICODE_EMAIL_ERROR_MESSAGE =\n 'The email address you entered includes invalid characters, for example, long dashes'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub',\n LocationSubGroup = 'locationSub'\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 QuestionTypeSubGroup.LocationSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.DeclarationField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.PaymentField,\n ComponentType.GeospatialField\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.DeclarationField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField,\n ComponentType.PaymentField,\n ComponentType.GeospatialField\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)\n .description('Subtype for date-related questions')\n\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField\n )\n .description('Subtype for list-related questions')\n\nexport const locationSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.UkAddressField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField,\n ComponentType.GeospatialField\n )\n .description('Subtype for location-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 instructionTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional instruction text with markdown support to help users answer the question'\n )\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 listForQuestionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for the list used by the field')\n\nexport const listItemCountSchema = Joi.number()\n .optional()\n .description('Number of list items in the list used by the field')\n\nexport const listItemsDataSchema = Joi.string()\n .allow('')\n .description('List items in JSON format, such as for radios or checkboxes.')\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(1)\n .max(25)\n .description(\n 'Minimum number of files required for upload. Must be between 1 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([])\n\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 radioTextSchema = 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 .custom(rtrimOnly)\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 exitPageSchema = Joi.boolean()\n .default(false)\n .optional()\n .description('Determines if page is set as an Exit Page')\n\nexport const repeaterSchema = Joi.string()\n .trim()\n .optional()\n .description(\n 'Combined min/max items and question set name for the repeater page'\n )\n\nexport const minItemsSchema = Joi.number()\n .empty('')\n .min(MIN_NUMBER_OF_REPEAT_ITEMS)\n .description('The minimum number of repeater items')\n\nexport const maxItemsSchema = Joi.number()\n .empty('')\n .max(MAX_NUMBER_OF_REPEAT_ITEMS)\n .description('The maximum number of repeater items')\n\nexport const questionSetNameSchema = Joi.string()\n .trim()\n .description('The repeater question set name')\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 disableConfirmationEmailSchema = Joi.boolean()\n .valid(true)\n .description('Whether confirmation emails should be disabled')\n\nexport const enableReferenceNumberSchema = Joi.boolean()\n .valid(true)\n .description('Whether reference number should be enabled')\n\nexport const disableUserFeedbackSchema = Joi.boolean()\n .valid(true)\n .description('Whether user feedback should be disabled')\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(0)\n .description('Maximum days in the future allowed for date inputs')\n\nexport const maxPastSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Maximum days in the past allowed for date inputs')\n\nexport const precisionSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\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 jsEnabledSchema = Joi.string()\n .trim()\n .optional()\n .allow('false', 'true')\n .description('Flag to show if Javascript is enabled or not')\n\nexport const usePostcodeLookupSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a UK address component supports postcode lookup. Empty string or \"true\" values are accepted.'\n )\n\nexport const paymentDescriptionSchema = Joi.string()\n .trim()\n .max(230)\n .required()\n .description('Description of payment - appears in payment providers pages')\n\nexport const paymentAmountSchema = Joi.number()\n .empty('')\n .min(0)\n .max(100000)\n .description('Amount of payment in pounds')\n\nexport const paymentApiKeySchema = Joi.string()\n .trim()\n .description('API key for payment configuration')\n\nexport const exactChecksSchema = Joi.number()\n .empty('')\n .integer()\n .min(2)\n .description('Specifies the exact number of items required to be selected.')\n\nexport const minChecksSchema = Joi.number()\n .empty('')\n .integer()\n .min(2)\n .description('Minimum number of items required to be selected.')\n\nexport const maxChecksSchema = Joi.number()\n .empty('')\n .integer()\n .min(2)\n .description('Maximum number of items allowed to be selected.')\n\ntype GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {\n args: Record<K, T>\n}\n\ninterface DSLSchema<TSchema = Record<string, unknown>[]>\n extends ArraySchema<TSchema> {\n rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>\n row: (rowSep: string | RegExp) => DSLSchema<TSchema>\n colSeparator: (colSep: string | RegExp) => DSLSchema<TSchema>\n col: (colSep: string | RegExp) => DSLSchema<TSchema>\n keys: (keys: string[]) => DSLSchema<TSchema>\n}\n\ninterface CustomValidator extends Joi.Root {\n dsv<TSchema>(): DSLSchema<TSchema>\n}\n\nexport const customValidator = Joi.extend((joi: Joi.Root) => {\n return {\n type: 'dsv',\n base: joi.array(),\n messages: {\n 'dsv.invalid': 'Invalid parse string'\n },\n coerce: {\n from: 'string',\n method(value: string, helpers) {\n try {\n // Only called when prefs.convert is true\n // Rules\n const rowSeparatorRule = helpers.schema.$_getRule('rowSeparator') as\n | undefined\n | GenericRuleOptions<'rowSeparator', string | RegExp>\n const colSeparatorRule = helpers.schema.$_getRule('colSeparator') as\n | undefined\n | GenericRuleOptions<'colSeparator', string | RegExp>\n const keysRule = helpers.schema.$_getRule('keys') as\n | undefined\n | GenericRuleOptions<'keys', string[]>\n\n // Rows\n const rowSeparator = rowSeparatorRule?.args.rowSeparator ?? /\\r?\\n/\n const rows = value\n .split(rowSeparator)\n .map((v) => v.trim())\n .filter(Boolean)\n\n // Columns\n const colSeparator = colSeparatorRule?.args.colSeparator ?? ','\n const keys = keysRule?.args.keys ?? ['key', 'value']\n\n const coercedValue = rows.map((row) => {\n return row\n .split(colSeparator)\n .reduce<Record<string, string>>((acc, col, idx) => {\n return {\n ...acc,\n [keys[idx]]: col.trim()\n }\n }, {})\n })\n return { value: coercedValue }\n } catch (_err) {\n // eslint-disable-next-line no-console\n console.error(_err)\n return { value, errors: [helpers.error('dsv.invalid')] }\n }\n }\n },\n rules: {\n rowSeparator: {\n convert: true,\n alias: 'row',\n method(rowSeparator: string) {\n return this.$_addRule({\n name: 'rowSeparator',\n args: { rowSeparator }\n })\n },\n args: [\n {\n name: 'rowSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n colSeparator: {\n convert: true,\n alias: 'col',\n method(colSeparator: string) {\n return this.$_addRule({\n name: 'colSeparator',\n args: { colSeparator }\n })\n },\n args: [\n {\n name: 'colSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n keys: {\n convert: true,\n method(keys: string[]) {\n return this.$_addRule({ name: 'keys', args: { keys } })\n },\n args: [\n {\n name: 'keys',\n ref: true,\n assert: (value) =>\n Array.isArray(value) && value.every((k) => typeof k === 'string'),\n message: 'must be an array of strings'\n }\n ]\n }\n }\n }\n}) as CustomValidator\n\nexport const autoCompleteOptionsSchema = customValidator\n .dsv<{ text: string; value: string }[]>()\n .row(/\\r?\\n/)\n .col(':')\n .keys(['text', 'value'])\n .items(\n customValidator.object({\n text: customValidator.string().min(1).disallow('').required(),\n value: customValidator\n .string()\n .default((parent: { text: string; value?: string }) => parent.text)\n .min(1)\n .disallow('')\n })\n )\n .min(1)\n .unique('text')\n .unique('value', { ignoreUndefined: true })\n .required()\n\nexport const questionDetailsFullSchema = {\n autoCompleteOptionsSchema,\n classesSchema,\n declarationTextSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n instructionTextSchema,\n jsEnabledSchema,\n listForQuestionSchema,\n listItemCountSchema,\n listItemsDataSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n paymentAmountSchema,\n paymentApiKeySchema,\n paymentDescriptionSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioTextSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema,\n usePostcodeLookupSchema,\n minChecksSchema,\n maxChecksSchema,\n exactChecksSchema\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\nexport function govukFieldValueIsString(\n govukField: GovukField\n): govukField is GovukStringField {\n return [\n 'question',\n 'hintText',\n 'shortDescription',\n 'autoCompleteOptions',\n 'classes',\n 'prefix',\n 'suffix',\n 'paymentAmount',\n 'paymentDescription'\n ].includes(`${govukField.name}`)\n}\n\nexport function govukFieldIsChecked(\n govukField: GovukField\n): govukField is GovukFieldQuestionOptional | GovukFieldUsePostcodeLookup {\n if (\n govukField.name !== 'questionOptional' &&\n govukField.name !== 'usePostcodeLookup'\n ) {\n return false\n }\n const checkedValue = govukField.items?.[0].checked\n return typeof checkedValue === 'boolean'\n}\n\n// A list of allowed template funtions for use within error message templates\nexport const allowedErrorTemplateFunctions = ['lowerFirst', 'capitalise']\n"],"mappings":"AAAA,OAAOA,GAAG,MAAiD,KAAK;AAEhE,SAASC,SAAS;AAClB,SAASC,aAAa;AACtB,SACEC,0BAA0B,EAC1BC,0BAA0B;AAY5B,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,2BAA2B,GAAGN,GAAG,CAACO,MAAM,CAAC,CAAC,CACpDC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,CAAC,CACPC,MAAM,CAAC,CAACC,KAAK,EAAEC,OAAO,KAAKP,qBAAqB,CAACM,KAAK,EAAEC,OAAO,CAAC,CAAC,CACjEC,WAAW,CAAC,6CAA6C,CAAC;AAE7D,OAAO,MAAMC,2BAA2B,GACtC,qFAAqF;AAEvF,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAOhC,OAAO,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ACF,CAAC;AAEL,OAAO,MAAM4K,+BAA+B,GAAG;EAC7CC,sBAAsB,EAAExG,4BAA4B;EACpDyG,WAAW,EAAExG,iBAAiB;EAC9ByG,YAAY,EAAExG;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMyG,iCAAiC,GAC5C7L,GAAG,CAACqK,MAAM,CAA8B,CAAC,CACtC1B,IAAI,CAAC8C,+BAA+B,CAAC,CACrCxK,QAAQ,CAAC,CAAC,CACVJ,WAAW,CAAC,0DAA0D,CAAC;AAE5E,OAAO,SAASiL,uBAAuBA,CACrCC,UAAsB,EACU;EAChC,OAAO,CACL,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,oBAAoB,CACrB,CAACC,QAAQ,CAAC,GAAGD,UAAU,CAACrC,IAAI,EAAE,CAAC;AAClC;AAEA,OAAO,SAASuC,mBAAmBA,CACjCF,UAAsB,EACkD;EACxE,IACEA,UAAU,CAACrC,IAAI,KAAK,kBAAkB,IACtCqC,UAAU,CAACrC,IAAI,KAAK,mBAAmB,EACvC;IACA,OAAO,KAAK;EACd;EACA,MAAMwC,YAAY,GAAGH,UAAU,CAACzH,KAAK,GAAG,CAAC,CAAC,CAAC6H,OAAO;EAClD,OAAO,OAAOD,YAAY,KAAK,SAAS;AAC1C;;AAEA;AACA,OAAO,MAAME,6BAA6B,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","rtrimOnly","ComponentType","GeospatialFieldOptionsCountryEnum","MAX_NUMBER_OF_REPEAT_ITEMS","MIN_NUMBER_OF_REPEAT_ITEMS","preventUnicodeInEmail","emailAddressNoUnicodeSchema","string","trim","email","custom","value","helpers","description","UNICODE_EMAIL_ERROR_MESSAGE","QuestionTypeSubGroup","pageTypeSchema","required","valid","questionTypeSchema","WrittenAnswerSubGroup","DateSubGroup","LocationSubGroup","UkAddressField","TelephoneNumberField","FileUploadField","EmailAddressField","DeclarationField","ListSubGroup","YesNoField","CheckboxesField","RadiosField","AutocompleteField","PaymentField","GeospatialField","questionTypeFullSchema","TextField","MultilineTextField","NumberField","DatePartsField","MonthYearField","SelectField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","writtenAnswerSubSchema","dateSubSchema","listSubSchema","locationSubSchema","nameSchema","questionSchema","hintTextSchema","optional","allow","instructionTextSchema","questionOptionalSchema","listForQuestionSchema","listItemCountSchema","number","listItemsDataSchema","exactFilesSchema","empty","integer","min","max","minFilesSchema","maxFilesSchema","fileTypesSchema","array","items","single","default","documentTypesSchema","imageTypesSchema","tabularDataTypesSchema","enhancedActionSchema","radioIdSchema","radioTextSchema","radioHintSchema","radioValueSchema","shortDescriptionSchema","pageHeadingAndGuidanceSchema","pageHeadingSchema","guidanceTextSchema","exitPageSchema","boolean","repeaterSchema","minItemsSchema","maxItemsSchema","questionSetNameSchema","needDeclarationSchema","declarationTextSchema","disableConfirmationEmailSchema","enableReferenceNumberSchema","disableUserFeedbackSchema","minSchema","maxSchema","minLengthSchema","maxLengthSchema","maxFutureSchema","maxPastSchema","precisionSchema","prefixSchema","regexSchema","rowsSchema","suffixSchema","classesSchema","jsEnabledSchema","usePostcodeLookupSchema","paymentDescriptionSchema","paymentAmountSchema","paymentApiKeySchema","exactChecksSchema","minChecksSchema","maxChecksSchema","countriesSchema","Object","values","customValidator","extend","joi","type","base","messages","coerce","from","method","rowSeparatorRule","schema","$_getRule","colSeparatorRule","keysRule","rowSeparator","args","rows","split","map","v","filter","Boolean","colSeparator","keys","coercedValue","row","reduce","acc","col","idx","_err","console","error","errors","rules","convert","alias","$_addRule","name","ref","assert","RegExp","message","Array","isArray","every","k","autoCompleteOptionsSchema","dsv","object","text","disallow","parent","unique","ignoreUndefined","questionDetailsFullSchema","formEditorInputPageKeys","pageType","questionType","formEditorInputPageSchema","formEditorInputheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema","govukFieldValueIsString","govukField","includes","govukFieldIsChecked","checkedValue","checked","allowedErrorTemplateFunctions"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import Joi, { type ArraySchema, type GetRuleOptions } from 'joi'\n\nimport { rtrimOnly } from '~/src/common/rtrim-only.js'\nimport {\n ComponentType,\n GeospatialFieldOptionsCountryEnum\n} from '~/src/components/enums.js'\nimport {\n MAX_NUMBER_OF_REPEAT_ITEMS,\n MIN_NUMBER_OF_REPEAT_ITEMS\n} from '~/src/form/form-definition/constants.js'\nimport {\n type FormEditorInputCheckAnswersSettings,\n type FormEditorInputPage,\n type FormEditorInputPageSettings,\n type FormEditorInputQuestion,\n type GovukField,\n type GovukFieldQuestionOptional,\n type GovukFieldUsePostcodeLookup,\n type GovukStringField\n} from '~/src/form/form-editor/types.js'\nimport { preventUnicodeInEmail } from '~/src/form/utils/prevent-unicode.js'\n\nexport const emailAddressNoUnicodeSchema = Joi.string()\n .trim()\n .email()\n .custom((value, helpers) => preventUnicodeInEmail(value, helpers))\n .description('Email address preventing unicode characters')\n\nexport const UNICODE_EMAIL_ERROR_MESSAGE =\n 'The email address you entered includes invalid characters, for example, long dashes'\n\nexport enum QuestionTypeSubGroup {\n WrittenAnswerSubGroup = 'writtenAnswerSub',\n DateSubGroup = 'dateSub',\n ListSubGroup = 'listSub',\n LocationSubGroup = 'locationSub'\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 QuestionTypeSubGroup.LocationSubGroup,\n ComponentType.UkAddressField,\n ComponentType.TelephoneNumberField,\n ComponentType.FileUploadField,\n ComponentType.EmailAddressField,\n ComponentType.DeclarationField,\n QuestionTypeSubGroup.ListSubGroup,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.PaymentField,\n ComponentType.GeospatialField\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.DeclarationField,\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField,\n ComponentType.PaymentField,\n ComponentType.GeospatialField\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)\n .description('Subtype for date-related questions')\n\nexport const listSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.YesNoField,\n ComponentType.CheckboxesField,\n ComponentType.RadiosField,\n ComponentType.AutocompleteField,\n ComponentType.SelectField\n )\n .description('Subtype for list-related questions')\n\nexport const locationSubSchema = Joi.string()\n .required()\n .valid(\n ComponentType.UkAddressField,\n ComponentType.EastingNorthingField,\n ComponentType.OsGridRefField,\n ComponentType.NationalGridFieldNumberField,\n ComponentType.LatLongField,\n ComponentType.GeospatialField\n )\n .description('Subtype for location-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 instructionTextSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description(\n 'Optional instruction text with markdown support to help users answer the question'\n )\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 listForQuestionSchema = Joi.string()\n .trim()\n .optional()\n .allow('')\n .description('Unique identifier for the list used by the field')\n\nexport const listItemCountSchema = Joi.number()\n .optional()\n .description('Number of list items in the list used by the field')\n\nexport const listItemsDataSchema = Joi.string()\n .allow('')\n .description('List items in JSON format, such as for radios or checkboxes.')\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(1)\n .max(25)\n .description(\n 'Minimum number of files required for upload. Must be between 1 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([])\n\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 radioTextSchema = 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 .custom(rtrimOnly)\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 exitPageSchema = Joi.boolean()\n .default(false)\n .optional()\n .description('Determines if page is set as an Exit Page')\n\nexport const repeaterSchema = Joi.string()\n .trim()\n .optional()\n .description(\n 'Combined min/max items and question set name for the repeater page'\n )\n\nexport const minItemsSchema = Joi.number()\n .empty('')\n .min(MIN_NUMBER_OF_REPEAT_ITEMS)\n .description('The minimum number of repeater items')\n\nexport const maxItemsSchema = Joi.number()\n .empty('')\n .max(MAX_NUMBER_OF_REPEAT_ITEMS)\n .description('The maximum number of repeater items')\n\nexport const questionSetNameSchema = Joi.string()\n .trim()\n .description('The repeater question set name')\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 disableConfirmationEmailSchema = Joi.boolean()\n .valid(true)\n .description('Whether confirmation emails should be disabled')\n\nexport const enableReferenceNumberSchema = Joi.boolean()\n .valid(true)\n .description('Whether reference number should be enabled')\n\nexport const disableUserFeedbackSchema = Joi.boolean()\n .valid(true)\n .description('Whether user feedback should be disabled')\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(0)\n .description('Maximum days in the future allowed for date inputs')\n\nexport const maxPastSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\n .description('Maximum days in the past allowed for date inputs')\n\nexport const precisionSchema = Joi.number()\n .empty('')\n .integer()\n .min(0)\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 jsEnabledSchema = Joi.string()\n .trim()\n .optional()\n .allow('false', 'true')\n .description('Flag to show if Javascript is enabled or not')\n\nexport const usePostcodeLookupSchema = Joi.string()\n .trim()\n .optional()\n .valid('', 'true')\n .description(\n 'Indicates whether a UK address component supports postcode lookup. Empty string or \"true\" values are accepted.'\n )\n\nexport const paymentDescriptionSchema = Joi.string()\n .trim()\n .max(230)\n .required()\n .description('Description of payment - appears in payment providers pages')\n\nexport const paymentAmountSchema = Joi.number()\n .empty('')\n .min(0)\n .max(100000)\n .description('Amount of payment in pounds')\n\nexport const paymentApiKeySchema = Joi.string()\n .trim()\n .description('API key for payment configuration')\n\nexport const exactChecksSchema = Joi.number()\n .empty('')\n .integer()\n .min(2)\n .description('Specifies the exact number of items required to be selected.')\n\nexport const minChecksSchema = Joi.number()\n .empty('')\n .integer()\n .min(2)\n .description('Minimum number of items required to be selected.')\n\nexport const maxChecksSchema = Joi.number()\n .empty('')\n .integer()\n .min(2)\n .description('Maximum number of items allowed to be selected.')\n\nexport const countriesSchema = Joi.array()\n .items(\n Joi.string().valid(\n ...Object.values(GeospatialFieldOptionsCountryEnum),\n 'any'\n )\n )\n .single()\n .description('The country to be included in a geospatial field')\n\ntype GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {\n args: Record<K, T>\n}\n\ninterface DSLSchema<TSchema = Record<string, unknown>[]>\n extends ArraySchema<TSchema> {\n rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>\n row: (rowSep: string | RegExp) => DSLSchema<TSchema>\n colSeparator: (colSep: string | RegExp) => DSLSchema<TSchema>\n col: (colSep: string | RegExp) => DSLSchema<TSchema>\n keys: (keys: string[]) => DSLSchema<TSchema>\n}\n\ninterface CustomValidator extends Joi.Root {\n dsv<TSchema>(): DSLSchema<TSchema>\n}\n\nexport const customValidator = Joi.extend((joi: Joi.Root) => {\n return {\n type: 'dsv',\n base: joi.array(),\n messages: {\n 'dsv.invalid': 'Invalid parse string'\n },\n coerce: {\n from: 'string',\n method(value: string, helpers) {\n try {\n // Only called when prefs.convert is true\n // Rules\n const rowSeparatorRule = helpers.schema.$_getRule('rowSeparator') as\n | undefined\n | GenericRuleOptions<'rowSeparator', string | RegExp>\n const colSeparatorRule = helpers.schema.$_getRule('colSeparator') as\n | undefined\n | GenericRuleOptions<'colSeparator', string | RegExp>\n const keysRule = helpers.schema.$_getRule('keys') as\n | undefined\n | GenericRuleOptions<'keys', string[]>\n\n // Rows\n const rowSeparator = rowSeparatorRule?.args.rowSeparator ?? /\\r?\\n/\n const rows = value\n .split(rowSeparator)\n .map((v) => v.trim())\n .filter(Boolean)\n\n // Columns\n const colSeparator = colSeparatorRule?.args.colSeparator ?? ','\n const keys = keysRule?.args.keys ?? ['key', 'value']\n\n const coercedValue = rows.map((row) => {\n return row\n .split(colSeparator)\n .reduce<Record<string, string>>((acc, col, idx) => {\n return {\n ...acc,\n [keys[idx]]: col.trim()\n }\n }, {})\n })\n return { value: coercedValue }\n } catch (_err) {\n // eslint-disable-next-line no-console\n console.error(_err)\n return { value, errors: [helpers.error('dsv.invalid')] }\n }\n }\n },\n rules: {\n rowSeparator: {\n convert: true,\n alias: 'row',\n method(rowSeparator: string) {\n return this.$_addRule({\n name: 'rowSeparator',\n args: { rowSeparator }\n })\n },\n args: [\n {\n name: 'rowSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n colSeparator: {\n convert: true,\n alias: 'col',\n method(colSeparator: string) {\n return this.$_addRule({\n name: 'colSeparator',\n args: { colSeparator }\n })\n },\n args: [\n {\n name: 'colSeparator',\n ref: true,\n assert: (value) =>\n typeof value === 'string' || value instanceof RegExp,\n message: 'must be a string or regex'\n }\n ]\n },\n keys: {\n convert: true,\n method(keys: string[]) {\n return this.$_addRule({ name: 'keys', args: { keys } })\n },\n args: [\n {\n name: 'keys',\n ref: true,\n assert: (value) =>\n Array.isArray(value) && value.every((k) => typeof k === 'string'),\n message: 'must be an array of strings'\n }\n ]\n }\n }\n }\n}) as CustomValidator\n\nexport const autoCompleteOptionsSchema = customValidator\n .dsv<{ text: string; value: string }[]>()\n .row(/\\r?\\n/)\n .col(':')\n .keys(['text', 'value'])\n .items(\n customValidator.object({\n text: customValidator.string().min(1).disallow('').required(),\n value: customValidator\n .string()\n .default((parent: { text: string; value?: string }) => parent.text)\n .min(1)\n .disallow('')\n })\n )\n .min(1)\n .unique('text')\n .unique('value', { ignoreUndefined: true })\n .required()\n\nexport const questionDetailsFullSchema = {\n autoCompleteOptionsSchema,\n classesSchema,\n declarationTextSchema,\n documentTypesSchema,\n enhancedActionSchema,\n exactFilesSchema,\n fileTypesSchema,\n hintTextSchema,\n imageTypesSchema,\n instructionTextSchema,\n jsEnabledSchema,\n listForQuestionSchema,\n listItemCountSchema,\n listItemsDataSchema,\n maxFilesSchema,\n maxFutureSchema,\n maxLengthSchema,\n maxPastSchema,\n maxSchema,\n minFilesSchema,\n minLengthSchema,\n minSchema,\n nameSchema,\n paymentAmountSchema,\n paymentApiKeySchema,\n paymentDescriptionSchema,\n precisionSchema,\n prefixSchema,\n questionOptionalSchema,\n questionSchema,\n questionTypeFullSchema,\n radioHintSchema,\n radioIdSchema,\n radioTextSchema,\n radioValueSchema,\n regexSchema,\n rowsSchema,\n shortDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema,\n usePostcodeLookupSchema,\n minChecksSchema,\n maxChecksSchema,\n exactChecksSchema,\n countriesSchema\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\nexport function govukFieldValueIsString(\n govukField: GovukField\n): govukField is GovukStringField {\n return [\n 'question',\n 'hintText',\n 'shortDescription',\n 'autoCompleteOptions',\n 'classes',\n 'prefix',\n 'suffix',\n 'paymentAmount',\n 'paymentDescription'\n ].includes(`${govukField.name}`)\n}\n\nexport function govukFieldIsChecked(\n govukField: GovukField\n): govukField is GovukFieldQuestionOptional | GovukFieldUsePostcodeLookup {\n if (\n govukField.name !== 'questionOptional' &&\n govukField.name !== 'usePostcodeLookup'\n ) {\n return false\n }\n const checkedValue = govukField.items?.[0].checked\n return typeof checkedValue === 'boolean'\n}\n\n// A list of allowed template funtions for use within error message templates\nexport const allowedErrorTemplateFunctions = ['lowerFirst', 'capitalise']\n"],"mappings":"AAAA,OAAOA,GAAG,MAAiD,KAAK;AAEhE,SAASC,SAAS;AAClB,SACEC,aAAa,EACbC,iCAAiC;AAEnC,SACEC,0BAA0B,EAC1BC,0BAA0B;AAY5B,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,2BAA2B,GAAGP,GAAG,CAACQ,MAAM,CAAC,CAAC,CACpDC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,CAAC,CACPC,MAAM,CAAC,CAACC,KAAK,EAAEC,OAAO,KAAKP,qBAAqB,CAACM,KAAK,EAAEC,OAAO,CA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IACtCqC,UAAU,CAACrC,IAAI,KAAK,mBAAmB,EACvC;IACA,OAAO,KAAK;EACd;EACA,MAAMwC,YAAY,GAAGH,UAAU,CAAC5H,KAAK,GAAG,CAAC,CAAC,CAACgI,OAAO;EAClD,OAAO,OAAOD,YAAY,KAAK,SAAS;AAC1C;;AAEA;AACA,OAAO,MAAME,6BAA6B,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type DateDirections, type DateUnits } from '~/src/conditions/enums.js'\nimport {\n type ConditionWrapperV2,\n type Item\n} from '~/src/form/form-definition/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 location\n */\n locationSub: 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 instruction text field\n */\n giveInstructions: string\n\n /**\n * The instruction text for location components (optional)\n */\n instructionText: 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 checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: 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 * Whether confirmation e-mails should be disabled\n */\n disableConfirmationEmail: boolean\n\n /**\n * Whether reference numbers should be enabled\n */\n enableReferenceNumber: boolean\n\n /**\n * Whether user feedback should be disabled\n */\n disableUserFeedback: boolean\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 radioText?: 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 /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * The exact number of items to select\n */\n exactChecks: string\n\n /**\n * The minimum number of items to select\n */\n minChecks: string\n\n /**\n * The maximum number of items to select\n */\n maxChecks: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n\n /**\n * List item id for conditions\n */\n itemId: string\n\n /**\n * Relative date period for conditions\n */\n period: string\n\n /**\n * Relative date unit for conditions\n */\n unit: DateUnits\n\n /**\n * Relative date direction for conditions\n */\n direction: DateDirections\n\n /**\n * Denotes if page is an Exit Page\n */\n exitPage: boolean\n\n /**\n * Denotes if the UK address question supports postcode lookup\n */\n usePostcodeLookup: string\n\n /**\n * Amount of payment in pounds\n */\n paymentAmount: string\n\n /**\n * Virtual marker for the conditional payment amounts editor section.\n * Carries no own value; rendered via a custom template.\n */\n paymentConditionalAmounts: string\n\n /**\n * Description of the payment (will appear in the payment provider's pages)\n */\n paymentDescription: string\n\n /**\n * Test API key used for test payments\n */\n paymentTestApiKey: string\n\n /**\n * Live API key used for live payments\n */\n paymentLiveApiKey: string\n\n /**\n * Inline conditional-amount editor: amount input value\n */\n conditionalAmount: string\n\n /**\n * Inline conditional-amount editor: selected condition id\n */\n conditionalAmountCondition: string\n\n /**\n * Title that user supplies a section\n */\n sectionTitle: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n | 'pageType'\n | 'questionType'\n | 'writtenAnswerSub'\n | 'dateSub'\n | 'locationSub'\n | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputConfirmationEmailSettings = Pick<\n FormEditor,\n 'disableConfirmationEmail'\n>\n\nexport type FormEditorInputReferenceNumberSettings = Pick<\n FormEditor,\n 'enableReferenceNumber'\n>\n\nexport type FormEditorInputUserFeedbackSettings = Pick<\n FormEditor,\n 'disableUserFeedback'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'declarationText'\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 | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'exactChecks'\n | 'minChecks'\n | 'maxChecks'\n | 'jsEnabled'\n | 'usePostcodeLookup'\n | 'giveInstructions'\n | 'instructionText'\n | 'paymentAmount'\n | 'paymentDescription'\n | 'paymentTestApiKey'\n | 'paymentLiveApiKey'\n | 'conditionalAmount'\n | 'conditionalAmountCondition'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n | 'exitPage'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText' | 'exitPage'\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 | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n | 'paymentAmount'\n | 'paymentDescription'\n | 'paymentTestApiKey'\n | 'paymentLiveApiKey'\n | 'conditionalAmount'\n | 'conditionalAmountCondition'\n>\n\ntype ListValue = string | boolean | number\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: ListValue\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: ListValue\n label?: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: ListValue\n readonly label?: ListLabel\n}\n\nexport interface DateItem {\n name: string\n classes: string\n}\n\nexport interface ListConflict {\n conflictItem: {\n id: string\n text: string\n }\n originalItem?: {\n id: string\n text: string\n }\n conditionNames: string[]\n linkableItems: {\n id?: string\n text: string\n value: string | number | boolean\n }[]\n closestMatch?: string | number | boolean\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: ListValue\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n listConflicts?: ListConflict[]\n conditionalAmounts?: ConditionalAmountState[]\n conditionalAmountEditRow?: ConditionalAmountEditRow\n}\n\nexport interface ConditionalAmountState {\n id: string\n amount: number\n condition: string\n}\n\nexport interface ConditionalAmountEditRow {\n expanded: boolean\n id?: string\n amount?: number | string\n condition?: string\n}\n\nexport interface ConditionSessionState {\n id?: string\n stateId?: string\n conditionWrapper?: ConditionWrapperV2\n}\n\nexport interface ConditionDetails {\n pageCondition: string | undefined\n pageConditionDetails: ConditionWrapperV2 | undefined\n pageConditionPresentationString: string | null\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n hint?: { text?: string; html?: string; classes?: string }\n}\n\nexport interface GovukSummaryListRow {\n key?: {\n text?: string\n classes?: string\n }\n value?: {\n text?: string\n html?: string\n classes?: string\n }\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[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: GovukFieldItem[]\n rows?: number\n type?: string\n customTemplate?: string\n formGroup?: {\n classes?: string\n }\n prefix?: {\n text?: string\n }\n preContent?: {\n path?: string\n }\n postContent?: {\n path?: string\n }\n disabled?: boolean\n customMeta?: object\n}\n\nexport type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {\n name: 'questionOptional'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukFieldUsePostcodeLookup = Omit<GovukField, 'name' | 'items'> & {\n name: 'usePostcodeLookup'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukStringField = Omit<GovukField, 'value'> & { value: string }\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n instructionText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n usePostcodeLookup?: GovukField\n declarationText?: GovukField\n paymentAmount?: GovukField\n paymentConditionalAmounts?: GovukField\n paymentDescription?: GovukField\n paymentTestApiKey?: GovukField\n paymentLiveApiKey?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\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\nexport type AdvancedFieldMappingsType = Record<\n ComponentType,\n Record<string, string>\n>\n\nexport type HTMLElementOrNull = HTMLElement | null\n\nexport type HTMLInputElementOrNull = HTMLInputElement | null\n\nexport interface ErrorPreviewFieldMappingDef {\n min?: { fieldName: string; placeholder: string }\n max?: { fieldName: string; placeholder: string }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport {\n type ComponentDef,\n type GeospatialFieldOptionsCountry\n} from '~/src/components/types.js'\nimport { type DateDirections, type DateUnits } from '~/src/conditions/enums.js'\nimport {\n type ConditionWrapperV2,\n type Item\n} from '~/src/form/form-definition/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 location\n */\n locationSub: 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 instruction text field\n */\n giveInstructions: string\n\n /**\n * The instruction text for location components (optional)\n */\n instructionText: 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 checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: 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 * Whether confirmation e-mails should be disabled\n */\n disableConfirmationEmail: boolean\n\n /**\n * Whether reference numbers should be enabled\n */\n enableReferenceNumber: boolean\n\n /**\n * Whether user feedback should be disabled\n */\n disableUserFeedback: boolean\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 radioText?: 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 /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * The exact number of items to select\n */\n exactChecks: string\n\n /**\n * The minimum number of items to select\n */\n minChecks: string\n\n /**\n * The maximum number of items to select\n */\n maxChecks: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n\n /**\n * List item id for conditions\n */\n itemId: string\n\n /**\n * Relative date period for conditions\n */\n period: string\n\n /**\n * Relative date unit for conditions\n */\n unit: DateUnits\n\n /**\n * Relative date direction for conditions\n */\n direction: DateDirections\n\n /**\n * Denotes if page is an Exit Page\n */\n exitPage: boolean\n\n /**\n * Denotes if the UK address question supports postcode lookup\n */\n usePostcodeLookup: string\n\n /**\n * Amount of payment in pounds\n */\n paymentAmount: string\n\n /**\n * Virtual marker for the conditional payment amounts editor section.\n * Carries no own value; rendered via a custom template.\n */\n paymentConditionalAmounts: string\n\n /**\n * Description of the payment (will appear in the payment provider's pages)\n */\n paymentDescription: string\n\n /**\n * Test API key used for test payments\n */\n paymentTestApiKey: string\n\n /**\n * Live API key used for live payments\n */\n paymentLiveApiKey: string\n\n /**\n * Inline conditional-amount editor: amount input value\n */\n conditionalAmount: string\n\n /**\n * Inline conditional-amount editor: selected condition id\n */\n conditionalAmountCondition: string\n\n /**\n * Title that user supplies a section\n */\n sectionTitle: string\n\n /**\n * The country restriction for geospatial questions\n */\n countries?: (GeospatialFieldOptionsCountry | 'any')[]\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n | 'pageType'\n | 'questionType'\n | 'writtenAnswerSub'\n | 'dateSub'\n | 'locationSub'\n | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputConfirmationEmailSettings = Pick<\n FormEditor,\n 'disableConfirmationEmail'\n>\n\nexport type FormEditorInputReferenceNumberSettings = Pick<\n FormEditor,\n 'enableReferenceNumber'\n>\n\nexport type FormEditorInputUserFeedbackSettings = Pick<\n FormEditor,\n 'disableUserFeedback'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'declarationText'\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 | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'exactChecks'\n | 'minChecks'\n | 'maxChecks'\n | 'jsEnabled'\n | 'usePostcodeLookup'\n | 'giveInstructions'\n | 'instructionText'\n | 'paymentAmount'\n | 'paymentDescription'\n | 'paymentTestApiKey'\n | 'paymentLiveApiKey'\n | 'conditionalAmount'\n | 'conditionalAmountCondition'\n | 'countries'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n | 'exitPage'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText' | 'exitPage'\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 | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n | 'paymentAmount'\n | 'paymentDescription'\n | 'paymentTestApiKey'\n | 'paymentLiveApiKey'\n | 'conditionalAmount'\n | 'conditionalAmountCondition'\n>\n\ntype ListValue = string | boolean | number\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: ListValue\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: ListValue\n label?: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: ListValue\n readonly label?: ListLabel\n}\n\nexport interface DateItem {\n name: string\n classes: string\n}\n\nexport interface ListConflict {\n conflictItem: {\n id: string\n text: string\n }\n originalItem?: {\n id: string\n text: string\n }\n conditionNames: string[]\n linkableItems: {\n id?: string\n text: string\n value: string | number | boolean\n }[]\n closestMatch?: string | number | boolean\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: ListValue\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n listConflicts?: ListConflict[]\n conditionalAmounts?: ConditionalAmountState[]\n conditionalAmountEditRow?: ConditionalAmountEditRow\n}\n\nexport interface ConditionalAmountState {\n id: string\n amount: number\n condition: string\n}\n\nexport interface ConditionalAmountEditRow {\n expanded: boolean\n id?: string\n amount?: number | string\n condition?: string\n}\n\nexport interface ConditionSessionState {\n id?: string\n stateId?: string\n conditionWrapper?: ConditionWrapperV2\n}\n\nexport interface ConditionDetails {\n pageCondition: string | undefined\n pageConditionDetails: ConditionWrapperV2 | undefined\n pageConditionPresentationString: string | null\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n hint?: { text?: string; html?: string; classes?: string }\n}\n\nexport interface GovukSummaryListRow {\n key?: {\n text?: string\n classes?: string\n }\n value?: {\n text?: string\n html?: string\n classes?: string\n }\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[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: GovukFieldItem[]\n rows?: number\n type?: string\n customTemplate?: string\n formGroup?: {\n classes?: string\n }\n prefix?: {\n text?: string\n }\n preContent?: {\n path?: string\n }\n postContent?: {\n path?: string\n }\n disabled?: boolean\n customMeta?: object\n}\n\nexport type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {\n name: 'questionOptional'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukFieldUsePostcodeLookup = Omit<GovukField, 'name' | 'items'> & {\n name: 'usePostcodeLookup'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukStringField = Omit<GovukField, 'value'> & { value: string }\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n instructionText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n usePostcodeLookup?: GovukField\n declarationText?: GovukField\n paymentAmount?: GovukField\n paymentConditionalAmounts?: GovukField\n paymentDescription?: GovukField\n paymentTestApiKey?: GovukField\n paymentLiveApiKey?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\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\nexport type AdvancedFieldMappingsType = Record<\n ComponentType,\n Record<string, string>\n>\n\nexport type HTMLElementOrNull = HTMLElement | null\n\nexport type HTMLInputElementOrNull = HTMLInputElement | null\n\nexport interface ErrorPreviewFieldMappingDef {\n min?: { fieldName: string; placeholder: string }\n max?: { fieldName: string; placeholder: string }\n}\n"],"mappings":"","ignoreList":[]}
@@ -41,6 +41,7 @@ export const privacyNoticeUrlSchema = Joi.string().uri({
41
41
  }).trim().description('URL to the privacy notice for this form');
42
42
  export const termsAndConditionsAgreedSchema = Joi.boolean().description('Whether the data protection terms and conditions have been agreed to');
43
43
  export const notificationEmailAddressSchema = emailAddressNoUnicodeSchema.description('Email address to receive form submission notifications');
44
+ export const offlineSchema = Joi.boolean().description('Whether the form has been taken offline; runtime renders an unavailable page when true');
44
45
  export const authoredAtSchema = Joi.date().iso().required().description('ISO format timestamp of when an action occurred');
45
46
  export const authorIdSchema = Joi.string().trim().required().description('Unique identifier for the author');
46
47
  export const authorDisplayNameSchema = Joi.string().trim().required().description('Human-readable name of the author');
@@ -63,7 +64,8 @@ export const formMetadataInputKeys = {
63
64
  otherwise: privacyNoticeUrlSchema.allow('')
64
65
  }),
65
66
  termsAndConditionsAgreed: termsAndConditionsAgreedSchema,
66
- notificationEmail: notificationEmailAddressSchema
67
+ notificationEmail: notificationEmailAddressSchema,
68
+ offline: offlineSchema
67
69
  };
68
70
 
69
71
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","emailAddressNoUnicodeSchema","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","privacyNoticeTypeSchema","privacyNoticeTextSchema","privacyNoticeUrlSchema","termsAndConditionsAgreedSchema","boolean","notificationEmailAddressSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeType","privacyNoticeText","when","is","then","otherwise","privacyNoticeUrl","termsAndConditionsAgreed","notificationEmail","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formVersionMetadataSchema","versionNumber","number","integer","min","formMetadataSchema","append","slug","draft","live","versions","array","items","optional"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { emailAddressNoUnicodeSchema } from '~/src/form/form-editor/index.js'\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState,\n type FormVersionMetadata\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string()\n .hex()\n .length(24)\n .required()\n .description(\n 'Unique identifier for the form, 24-character hexadecimal string'\n )\n\nexport const titleSchema = Joi.string()\n .max(250)\n .trim()\n .required()\n .description('Title of the form, displayed to users')\n\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n .description('URL-friendly identifier used in form paths')\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n .description('Defra organisation responsible for the form')\n\nexport const teamNameSchema = Joi.string()\n .max(100)\n .trim()\n .required()\n .description('Name of the team responsible for the form')\n\nexport const teamEmailSchema = emailAddressNoUnicodeSchema\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 = emailAddressNoUnicodeSchema\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 privacyNoticeTypeSchema = Joi.string()\n .valid('text', 'link')\n .description('Type of privacy notice content')\n\nexport const privacyNoticeTextSchema = Joi.string()\n .trim()\n .description('URL to the privacy notice for this 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 termsAndConditionsAgreedSchema = Joi.boolean().description(\n 'Whether the data protection terms and conditions have been agreed to'\n)\n\nexport const notificationEmailAddressSchema =\n emailAddressNoUnicodeSchema.description(\n 'Email address to receive form submission notifications'\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 privacyNoticeType: privacyNoticeTypeSchema,\n privacyNoticeText: Joi.when('privacyNoticeType', {\n is: 'text',\n then: privacyNoticeTextSchema,\n otherwise: privacyNoticeTextSchema.allow('')\n }),\n privacyNoticeUrl: Joi.when('privacyNoticeType', {\n is: 'link',\n then: privacyNoticeUrlSchema,\n otherwise: privacyNoticeUrlSchema.allow('')\n }),\n termsAndConditionsAgreed: termsAndConditionsAgreedSchema,\n notificationEmail: notificationEmailAddressSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n .description('Input data for creating or updating form metadata')\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n .description('Information about the author of a form or form change')\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>()\n .keys({\n createdAt: authoredAtSchema.description(\n 'When this version was first created'\n ),\n createdBy: formMetadataAuthorSchema.description('Who created this version'),\n updatedAt: authoredAtSchema.description(\n 'When this version was last updated'\n ),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated this version'\n )\n })\n .description('Metadata about a specific version state (draft or live)')\n\n/**\n * Joi schema for `FormVersionMetadata` interface\n * @see {@link FormVersionMetadata}\n */\nexport const formVersionMetadataSchema = Joi.object<FormVersionMetadata>()\n .keys({\n versionNumber: Joi.number()\n .integer()\n .min(1)\n .required()\n .description('The version number'),\n createdAt: authoredAtSchema.description('When this version was created')\n })\n .description('Metadata for a specific version of the form')\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema\n .append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.description(\n 'Metadata for the draft version'\n ),\n live: formMetadataStateSchema.description(\n 'Metadata for the published version'\n ),\n createdAt: authoredAtSchema.description('When the form was first created'),\n createdBy: formMetadataAuthorSchema.description('Who created the form'),\n updatedAt: authoredAtSchema.description('When the form was last updated'),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated the form'\n ),\n versions: Joi.array()\n .items(formVersionMetadataSchema)\n .optional()\n .description('Version history for the form')\n })\n .description(\n 'Complete metadata for a form, including version information and authoring details'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,2BAA2B;AAYpC,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,GAAGH,GAAG,CAACI,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,GAAGT,GAAG,CAACI,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,GAAGZ,GAAG,CAACI,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,GAAGf,GAAG,CAACI,MAAM,CAAC,CAAC,CAC3CY,KAAK,CAAC,GAAGd,a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AACvC,WAAW,CAAC,+BAA+B;AACzE,CAAC,CAAC,CACDA,WAAW,CAAC,6CAA6C,CAAC;;AAE7D;AACA;AACA;AACA;AACA,OAAO,MAAM0E,kBAAkB,GAAGd,uBAAuB,CACtDe,MAAM,CAAe;EACpBb,EAAE,EAAEnE,QAAQ;EACZiF,IAAI,EAAExE,UAAU;EAChByE,KAAK,EAAEb,uBAAuB,CAAChE,WAAW,CACxC,gCACF,CAAC;EACD8E,IAAI,EAAEd,uBAAuB,CAAChE,WAAW,CACvC,oCACF,CAAC;EACDiE,SAAS,EAAE1B,gBAAgB,CAACvC,WAAW,CAAC,iCAAiC,CAAC;EAC1EkE,SAAS,EAAEL,wBAAwB,CAAC7D,WAAW,CAAC,sBAAsB,CAAC;EACvEmE,SAAS,EAAE5B,gBAAgB,CAACvC,WAAW,CAAC,gCAAgC,CAAC;EACzEoE,SAAS,EAAEP,wBAAwB,CAAC7D,WAAW,CAC7C,2BACF,CAAC;EACD+E,QAAQ,EAAEvF,GAAG,CAACwF,KAAK,CAAC,CAAC,CAClBC,KAAK,CAACZ,yBAAyB,CAAC,CAChCa,QAAQ,CAAC,CAAC,CACVlF,WAAW,CAAC,8BAA8B;AAC/C,CAAC,CAAC,CACDA,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","emailAddressNoUnicodeSchema","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","privacyNoticeTypeSchema","privacyNoticeTextSchema","privacyNoticeUrlSchema","termsAndConditionsAgreedSchema","boolean","notificationEmailAddressSchema","offlineSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeType","privacyNoticeText","when","is","then","otherwise","privacyNoticeUrl","termsAndConditionsAgreed","notificationEmail","offline","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formVersionMetadataSchema","versionNumber","number","integer","min","formMetadataSchema","append","slug","draft","live","versions","array","items","optional"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { emailAddressNoUnicodeSchema } from '~/src/form/form-editor/index.js'\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState,\n type FormVersionMetadata\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string()\n .hex()\n .length(24)\n .required()\n .description(\n 'Unique identifier for the form, 24-character hexadecimal string'\n )\n\nexport const titleSchema = Joi.string()\n .max(250)\n .trim()\n .required()\n .description('Title of the form, displayed to users')\n\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n .description('URL-friendly identifier used in form paths')\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n .description('Defra organisation responsible for the form')\n\nexport const teamNameSchema = Joi.string()\n .max(100)\n .trim()\n .required()\n .description('Name of the team responsible for the form')\n\nexport const teamEmailSchema = emailAddressNoUnicodeSchema\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 = emailAddressNoUnicodeSchema\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 privacyNoticeTypeSchema = Joi.string()\n .valid('text', 'link')\n .description('Type of privacy notice content')\n\nexport const privacyNoticeTextSchema = Joi.string()\n .trim()\n .description('URL to the privacy notice for this 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 termsAndConditionsAgreedSchema = Joi.boolean().description(\n 'Whether the data protection terms and conditions have been agreed to'\n)\n\nexport const notificationEmailAddressSchema =\n emailAddressNoUnicodeSchema.description(\n 'Email address to receive form submission notifications'\n )\n\nexport const offlineSchema = Joi.boolean().description(\n 'Whether the form has been taken offline; runtime renders an unavailable page when true'\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 privacyNoticeType: privacyNoticeTypeSchema,\n privacyNoticeText: Joi.when('privacyNoticeType', {\n is: 'text',\n then: privacyNoticeTextSchema,\n otherwise: privacyNoticeTextSchema.allow('')\n }),\n privacyNoticeUrl: Joi.when('privacyNoticeType', {\n is: 'link',\n then: privacyNoticeUrlSchema,\n otherwise: privacyNoticeUrlSchema.allow('')\n }),\n termsAndConditionsAgreed: termsAndConditionsAgreedSchema,\n notificationEmail: notificationEmailAddressSchema,\n offline: offlineSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n .description('Input data for creating or updating form metadata')\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n .description('Information about the author of a form or form change')\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>()\n .keys({\n createdAt: authoredAtSchema.description(\n 'When this version was first created'\n ),\n createdBy: formMetadataAuthorSchema.description('Who created this version'),\n updatedAt: authoredAtSchema.description(\n 'When this version was last updated'\n ),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated this version'\n )\n })\n .description('Metadata about a specific version state (draft or live)')\n\n/**\n * Joi schema for `FormVersionMetadata` interface\n * @see {@link FormVersionMetadata}\n */\nexport const formVersionMetadataSchema = Joi.object<FormVersionMetadata>()\n .keys({\n versionNumber: Joi.number()\n .integer()\n .min(1)\n .required()\n .description('The version number'),\n createdAt: authoredAtSchema.description('When this version was created')\n })\n .description('Metadata for a specific version of the form')\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema\n .append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.description(\n 'Metadata for the draft version'\n ),\n live: formMetadataStateSchema.description(\n 'Metadata for the published version'\n ),\n createdAt: authoredAtSchema.description('When the form was first created'),\n createdBy: formMetadataAuthorSchema.description('Who created the form'),\n updatedAt: authoredAtSchema.description('When the form was last updated'),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated the form'\n ),\n versions: Joi.array()\n .items(formVersionMetadataSchema)\n .optional()\n .description('Version history for the form')\n })\n .description(\n 'Complete metadata for a form, including version information and authoring details'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,2BAA2B;AAYpC,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,GAAGH,GAAG,CAACI,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,GAAGT,GAAG,CAACI,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,GAAGZ,GAAG,CAACI,MAAM,CAAC,CAAC,CACnCS,OAAO,CAAC,cAAc,EAAE;EAAEC,IAAI,EAAE;AAAoC,CAAC,CAAC,CACtEP,Q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,yBAAyB,GAAG/E,GAAG,CAAC0B,MAAM,CAAsB,CAAC,CACvEC,IAAI,CAAC;EACJqD,aAAa,EAAEhF,GAAG,CAACiF,MAAM,CAAC,CAAC,CACxBC,OAAO,CAAC,CAAC,CACTC,GAAG,CAAC,CAAC,CAAC,CACN5E,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,oBAAoB,CAAC;EACpCmE,SAAS,EAAE3B,gBAAgB,CAACxC,WAAW,CAAC,+BAA+B;AACzE,CAAC,CAAC,CACDA,WAAW,CAAC,6CAA6C,CAAC;;AAE7D;AACA;AACA;AACA;AACA,OAAO,MAAM4E,kBAAkB,GAAGd,uBAAuB,CACtDe,MAAM,CAAe;EACpBb,EAAE,EAAErE,QAAQ;EACZmF,IAAI,EAAE1E,UAAU;EAChB2E,KAAK,EAAEb,uBAAuB,CAAClE,WAAW,CACxC,gCACF,CAAC;EACDgF,IAAI,EAAEd,uBAAuB,CAAClE,WAAW,CACvC,oCACF,CAAC;EACDmE,SAAS,EAAE3B,gBAAgB,CAACxC,WAAW,CAAC,iCAAiC,CAAC;EAC1EoE,SAAS,EAAEL,wBAAwB,CAAC/D,WAAW,CAAC,sBAAsB,CAAC;EACvEqE,SAAS,EAAE7B,gBAAgB,CAACxC,WAAW,CAAC,gCAAgC,CAAC;EACzEsE,SAAS,EAAEP,wBAAwB,CAAC/D,WAAW,CAC7C,2BACF,CAAC;EACDiF,QAAQ,EAAEzF,GAAG,CAAC0F,KAAK,CAAC,CAAC,CAClBC,KAAK,CAACZ,yBAAyB,CAAC,CAChCa,QAAQ,CAAC,CAAC,CACVpF,WAAW,CAAC,8BAA8B;AAC/C,CAAC,CAAC,CACDA,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for email contact details\n */\nexport interface FormMetadataContactEmail {\n /**\n * The email address details for support\n */\n address: string\n\n /**\n * How long it takes to receive a support response\n */\n responseTime: string\n}\n\n/**\n * Interface for online contact details\n */\nexport interface FormMetadataContactOnline {\n /**\n * The url of the online contact link\n */\n url: string\n\n /**\n * The text of the online contact link\n */\n text: string\n}\n\n/**\n * Interface for version metadata stored in form metadata\n */\nexport interface FormVersionMetadata {\n /**\n * The version number\n */\n versionNumber: number\n\n /**\n * When this version was created\n */\n createdAt: Date\n}\n\n/**\n * Interface for contact details (phone, email and online)\n */\nexport interface FormMetadataContact {\n /**\n * The phone details for support\n */\n phone?: string\n\n /**\n * The email details for support\n */\n email?: FormMetadataContactEmail\n\n /**\n * The online details for support\n */\n online?: FormMetadataContactOnline\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n /**\n * The contact details of the form\n */\n contact?: FormMetadataContact\n\n /**\n * The guidance text displayed on the form submitted page\n */\n submissionGuidance?: string\n\n /**\n * The url of the privacy notice\n */\n privacyNoticeUrl?: string\n\n /**\n * The text of the privacy notice\n */\n privacyNoticeText?: string\n\n /**\n * The type of the privacy notice (text or link)\n */\n privacyNoticeType?: string\n\n /**\n * Whether the data protection terms and conditions have been agreed to\n */\n termsAndConditionsAgreed?: boolean\n\n /**\n * Email address where form responses are sent\n */\n notificationEmail?: string\n\n /**\n * The draft state of the form\n */\n draft?: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n\n /**\n * The author who created the form\n */\n createdBy: FormMetadataState['createdBy']\n\n /**\n * The date the form was created\n */\n createdAt: FormMetadataState['createdAt']\n\n /**\n * The author who last updated the form\n */\n updatedBy: FormMetadataState['updatedBy']\n\n /**\n * The date the form was last updated\n */\n updatedAt: FormMetadataState['updatedAt']\n\n /**\n * Version history for the form\n */\n versions?: FormVersionMetadata[]\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {\n pageId: string\n}\nexport type FormByIDAndPageByIdAndComponentByIdInput = Pick<\n FormMetadata,\n 'id'\n> & {\n pageId: string\n componentId: string\n}\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Pick<\n FormMetadata,\n | 'title'\n | 'organisation'\n | 'teamName'\n | 'teamEmail'\n | 'contact'\n | 'submissionGuidance'\n | 'privacyNoticeType'\n | 'privacyNoticeText'\n | 'privacyNoticeUrl'\n | 'termsAndConditionsAgreed'\n | 'notificationEmail'\n>\n\nexport interface FormResponse {\n id: FormMetadata['id']\n slug: FormMetadata['slug']\n status: string\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for email contact details\n */\nexport interface FormMetadataContactEmail {\n /**\n * The email address details for support\n */\n address: string\n\n /**\n * How long it takes to receive a support response\n */\n responseTime: string\n}\n\n/**\n * Interface for online contact details\n */\nexport interface FormMetadataContactOnline {\n /**\n * The url of the online contact link\n */\n url: string\n\n /**\n * The text of the online contact link\n */\n text: string\n}\n\n/**\n * Interface for version metadata stored in form metadata\n */\nexport interface FormVersionMetadata {\n /**\n * The version number\n */\n versionNumber: number\n\n /**\n * When this version was created\n */\n createdAt: Date\n}\n\n/**\n * Interface for contact details (phone, email and online)\n */\nexport interface FormMetadataContact {\n /**\n * The phone details for support\n */\n phone?: string\n\n /**\n * The email details for support\n */\n email?: FormMetadataContactEmail\n\n /**\n * The online details for support\n */\n online?: FormMetadataContactOnline\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n /**\n * The contact details of the form\n */\n contact?: FormMetadataContact\n\n /**\n * The guidance text displayed on the form submitted page\n */\n submissionGuidance?: string\n\n /**\n * The url of the privacy notice\n */\n privacyNoticeUrl?: string\n\n /**\n * The text of the privacy notice\n */\n privacyNoticeText?: string\n\n /**\n * The type of the privacy notice (text or link)\n */\n privacyNoticeType?: string\n\n /**\n * Whether the data protection terms and conditions have been agreed to\n */\n termsAndConditionsAgreed?: boolean\n\n /**\n * Email address where form responses are sent\n */\n notificationEmail?: string\n\n /**\n * Whether the form has been taken offline. When true, the runtime renders\n * an unavailable page instead of the form.\n */\n offline?: boolean\n\n /**\n * The draft state of the form\n */\n draft?: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n\n /**\n * The author who created the form\n */\n createdBy: FormMetadataState['createdBy']\n\n /**\n * The date the form was created\n */\n createdAt: FormMetadataState['createdAt']\n\n /**\n * The author who last updated the form\n */\n updatedBy: FormMetadataState['updatedBy']\n\n /**\n * The date the form was last updated\n */\n updatedAt: FormMetadataState['updatedAt']\n\n /**\n * Version history for the form\n */\n versions?: FormVersionMetadata[]\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormByIDAndPageByIdInput = Pick<FormMetadata, 'id'> & {\n pageId: string\n}\nexport type FormByIDAndPageByIdAndComponentByIdInput = Pick<\n FormMetadata,\n 'id'\n> & {\n pageId: string\n componentId: string\n}\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Pick<\n FormMetadata,\n | 'title'\n | 'organisation'\n | 'teamName'\n | 'teamEmail'\n | 'contact'\n | 'submissionGuidance'\n | 'privacyNoticeType'\n | 'privacyNoticeText'\n | 'privacyNoticeUrl'\n | 'termsAndConditionsAgreed'\n | 'notificationEmail'\n | 'offline'\n>\n\nexport interface FormResponse {\n id: FormMetadata['id']\n slug: FormMetadata['slug']\n status: string\n}\n"],"mappings":"","ignoreList":[]}
@@ -29,4 +29,6 @@ export * from "./utils/markdown.js";
29
29
  export * from "./form/form-audit/index.js";
30
30
  export * from "./form/form-audit/enums.js";
31
31
  export * from "./form/form-audit/consolidation.js";
32
+
33
+ // test
32
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-definition/helpers.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-metrics/enums.js'\nexport * from '~/src/form/form-metrics/types.js'\nexport * from '~/src/form/form-metrics/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/dead-letter-queues.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\nexport * from '~/src/form/form-audit/consolidation.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-definition/helpers.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-metrics/enums.js'\nexport * from '~/src/form/form-metrics/types.js'\nexport * from '~/src/form/form-metrics/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/dead-letter-queues.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\nexport * from '~/src/form/form-audit/consolidation.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n\n// test\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA","ignoreList":[]}
@@ -103,6 +103,22 @@ export function hasPaymentQuestionInForm(definition) {
103
103
  return false;
104
104
  }
105
105
 
106
+ /**
107
+ * Helper function to determine if the form uses postcode lookup
108
+ */
109
+ export function hasPostcodeLookupInForm(definition) {
110
+ if (definition.pages.length === 0) {
111
+ return false;
112
+ }
113
+ for (const page of definition.pages) {
114
+ const addressField = hasComponents(page) ? page.components.find(component => component.type === ComponentType.UkAddressField) : undefined;
115
+ if (addressField?.options.usePostcodeLookup) {
116
+ return true;
117
+ }
118
+ }
119
+ return false;
120
+ }
121
+
106
122
  /**
107
123
  * Helper function to determine if a specific question type exists in the form
108
124
  */
@@ -111,8 +127,8 @@ export function hasSpecificQuestionTypeInForm(definition, componentType) {
111
127
  return false;
112
128
  }
113
129
  for (const page of definition.pages) {
114
- const hasPayment = hasComponents(page) ? page.components.some(component => component.type === componentType) : false;
115
- if (hasPayment) {
130
+ const hasSpecificComponent = hasComponents(page) ? page.components.some(component => component.type === componentType) : false;
131
+ if (hasSpecificComponent) {
116
132
  return true;
117
133
  }
118
134
  }
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["ComponentType","hasFormField","isFormType","ControllerNames","ControllerTypes","ControllerType","PageTypes","getPageDefaults","page","nameOrPath","controller","Page","controllerNameFromPath","defaults","find","pageType","Error","structuredClone","hasComponents","hasNext","Array","isArray","components","hasComponentsEvenIfNoNext","undefined","hasFormComponents","Start","hasRepeater","Repeat","isControllerName","map","String","includes","Terminal","FileUpload","options","path","name","includesFileUploadField","some","component","type","FileUploadField","onlyDeclarationComponents","filter","comp","every","DeclarationField","includesPaymentField","PaymentField","hasPaymentQuestionInForm","definition","pages","length","hasPayment","hasSpecificQuestionTypeInForm","componentType","SHOW_REPEATER_CONTROLLERS","showRepeaterSettings","getPageTitle","title","firstComp","getPageFromDefinition","pageId","x","id","summaryPageControllers","Summary","SummaryWithConfirmationEmail","isSummaryPage","replaceCustomControllers","standardControllers","Set","Object","values","toString","has","isPaymentPage","isEndPage"],"sources":["../../../src/pages/helpers.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { hasFormField, isFormType } from '~/src/components/helpers.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n type Link,\n type Page,\n type PageFileUpload,\n type PageQuestion,\n type PageRepeat\n} from '~/src/form/form-definition/types.js'\nimport { type FormDefinition } from '~/src/index.js'\nimport {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { PageTypes } from '~/src/pages/page-types.js'\n\n/**\n * Return component defaults by type\n */\nexport function getPageDefaults<PageType extends Page>(\n page?: Pick<PageType, 'controller'>\n) {\n const nameOrPath = page?.controller ?? ControllerType.Page\n const controller = controllerNameFromPath(nameOrPath)\n\n const defaults = PageTypes.find(\n (pageType) => pageType.controller === controller\n )\n\n if (!defaults) {\n throw new Error(`Defaults not found for page type '${nameOrPath}'`)\n }\n\n return structuredClone(defaults) as PageType\n}\n\n/**\n * Check page has components\n */\nexport function hasComponents(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return hasNext(page) && Array.isArray(page.components)\n}\n\n/**\n * Check if the page has components (the page can be any page type e.g. SummaryPage)\n */\nexport function hasComponentsEvenIfNoNext(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return (\n page !== undefined && 'components' in page && Array.isArray(page.components)\n )\n}\n\n/**\n * Check page has form components\n */\nexport function hasFormComponents(\n page?: Partial<Page>\n): page is PageQuestion | PageFileUpload {\n const controller = controllerNameFromPath(page?.controller)\n return hasComponents(page) && controller !== ControllerType.Start\n}\n\n/**\n * Check page has repeater\n */\nexport function hasRepeater(page?: Partial<Page>): page is PageRepeat {\n return controllerNameFromPath(page?.controller) === ControllerType.Repeat\n}\n\n/**\n * Check for known page controller names\n */\nexport function isControllerName(\n nameOrPath?: ControllerType | string\n): nameOrPath is ControllerType {\n return !!nameOrPath && ControllerNames.map(String).includes(nameOrPath)\n}\n\n/**\n * Check page has next link\n */\nexport function hasNext(\n page?: Partial<Page>\n): page is Extract<Page, { next: Link[] }> {\n if (!page || !('next' in page)) {\n return false\n }\n\n const controller = controllerNameFromPath(page.controller)\n\n return (\n !controller ||\n controller === ControllerType.Start ||\n controller === ControllerType.Page ||\n controller === ControllerType.Terminal ||\n controller === ControllerType.FileUpload ||\n controller === ControllerType.Repeat\n )\n}\n\n/**\n * Check and optionally replace legacy path with controller name\n * @param {string} [nameOrPath] - Controller name or legacy controller path\n */\nexport function controllerNameFromPath(nameOrPath?: ControllerType | string) {\n if (isControllerName(nameOrPath)) {\n return nameOrPath\n }\n\n const options = ControllerTypes.find(({ path }) => path === nameOrPath)\n return options?.name\n}\n\nexport function includesFileUploadField(components: ComponentDef[]): boolean {\n return components.some(\n (component) => component.type === ComponentType.FileUploadField\n )\n}\n\nexport function onlyDeclarationComponents(components: ComponentDef[]): boolean {\n return components\n .filter((comp) => isFormType(comp.type))\n .every((component) => component.type === ComponentType.DeclarationField)\n}\n\nexport function includesPaymentField(components: ComponentDef[]): boolean {\n return components.some(\n (component) => component.type === ComponentType.PaymentField\n )\n}\n\n/**\n * Helper function to determine if a payment question already exists in the form\n */\nexport function hasPaymentQuestionInForm(definition: FormDefinition) {\n if (definition.pages.length === 0) {\n return false\n }\n\n for (const page of definition.pages) {\n const hasPayment = hasComponents(page)\n ? includesPaymentField(page.components)\n : false\n if (hasPayment) {\n return true\n }\n }\n return false\n}\n\n/**\n * Helper function to determine if a specific question type exists in the form\n */\nexport function hasSpecificQuestionTypeInForm(\n definition: FormDefinition,\n componentType: ComponentType\n) {\n if (definition.pages.length === 0) {\n return false\n }\n\n for (const page of definition.pages) {\n const hasPayment = hasComponents(page)\n ? page.components.some((component) => component.type === componentType)\n : false\n if (hasPayment) {\n return true\n }\n }\n return false\n}\n\nconst SHOW_REPEATER_CONTROLLERS = [ControllerType.Page, ControllerType.Repeat]\n\nexport function showRepeaterSettings(page: Page): boolean {\n if (page.controller && !SHOW_REPEATER_CONTROLLERS.includes(page.controller)) {\n return false\n }\n if (hasComponents(page)) {\n if (includesFileUploadField(page.components)) {\n return false\n }\n if (onlyDeclarationComponents(page.components)) {\n return false\n }\n if (includesPaymentField(page.components)) {\n return false\n }\n }\n return true\n}\n\n/**\n * Gets page title, or title of first question (if no page title set)\n * @param {Page} page\n * @returns {string}\n */\nexport function getPageTitle(page: Page) {\n if (page.title !== '') {\n return page.title\n }\n\n if (hasComponentsEvenIfNoNext(page)) {\n const firstComp = page.components.find(hasFormField)\n if (firstComp) {\n return firstComp.title\n }\n }\n return 'Page title unknown'\n}\n\n/**\n *\n * @param {FormDefinition} definition\n * @param {string} pageId\n * @returns { Page | undefined }\n */\nexport function getPageFromDefinition(\n definition: FormDefinition,\n pageId: string\n): Page | undefined {\n return definition.pages.find((x) => x.id === pageId)\n}\n\nexport const summaryPageControllers = [\n ControllerType.Summary,\n ControllerType.SummaryWithConfirmationEmail\n]\n\nexport function isSummaryPage(page: Page | undefined) {\n return summaryPageControllers.includes(\n page?.controller ?? ControllerType.Page\n )\n}\n\n/**\n * Revert any custom controllers to their parent/base class since engine-plugin has no knowledge of them\n * @param {FormDefinition} definition\n * @returns {FormDefinition}\n */\nexport function replaceCustomControllers(definition: FormDefinition) {\n const standardControllers = new Set(\n Object.values(ControllerType)\n .filter((x) => x !== ControllerType.SummaryWithConfirmationEmail)\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n .map((x) => x.toString())\n )\n\n return {\n ...definition,\n pages: definition.pages.map((page) => {\n if (\n !standardControllers.has(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n (page.controller ?? ControllerType.Page).toString()\n )\n ) {\n return /** @type {Page} */ {\n ...page,\n controller: ControllerType.Page\n }\n }\n return page\n })\n } as FormDefinition\n}\n\n/**\n * Helper function to determine if the current page contains a payment question\n * @param page - the page of the form\n * @returns {boolean}\n */\nexport function isPaymentPage(page: Page | undefined) {\n if (hasComponentsEvenIfNoNext(page)) {\n return page.components.some(\n (comp) => comp.type === ComponentType.PaymentField\n )\n }\n return false\n}\n\n/**\n * Helper function to determine if the current page is an end page i.e. summary page or payment page\n * @param page - the page of the form\n * @returns {boolean}\n */\nexport function isEndPage(page: Page | undefined) {\n return isSummaryPage(page) || isPaymentPage(page)\n}\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,YAAY,EAAEC,UAAU;AAUjC,SACEC,eAAe,EACfC,eAAe;AAEjB,SAASC,cAAc;AACvB,SAASC,SAAS;;AAElB;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,IAAmC,EACnC;EACA,MAAMC,UAAU,GAAGD,IAAI,EAAEE,UAAU,IAAIL,cAAc,CAACM,IAAI;EAC1D,MAAMD,UAAU,GAAGE,sBAAsB,CAACH,UAAU,CAAC;EAErD,MAAMI,QAAQ,GAAGP,SAAS,CAACQ,IAAI,CAC5BC,QAAQ,IAAKA,QAAQ,CAACL,UAAU,KAAKA,UACxC,CAAC;EAED,IAAI,CAACG,QAAQ,EAAE;IACb,MAAM,IAAIG,KAAK,CAAC,qCAAqCP,UAAU,GAAG,CAAC;EACrE;EAEA,OAAOQ,eAAe,CAACJ,QAAQ,CAAC;AAClC;;AAEA;AACA;AACA;AACA,OAAO,SAASK,aAAaA,CAC3BV,IAAoB,EACmC;EACvD,OAAOW,OAAO,CAACX,IAAI,CAAC,IAAIY,KAAK,CAACC,OAAO,CAACb,IAAI,CAACc,UAAU,CAAC;AACxD;;AAEA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACvCf,IAAoB,EACmC;EACvD,OACEA,IAAI,KAAKgB,SAAS,IAAI,YAAY,IAAIh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,SAASqE,aAAaA,CAACrE,IAAsB,EAAE;EACpD,IAAIe,yBAAyB,CAACf,IAAI,CAAC,EAAE;IACnC,OAAOA,IAAI,CAACc,UAAU,CAACiB,IAAI,CACxBM,IAAI,IAAKA,IAAI,CAACJ,IAAI,KAAKzC,aAAa,CAACiD,YACxC,CAAC;EACH;EACA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS6B,SAASA,CAACtE,IAAsB,EAAE;EAChD,OAAO6D,aAAa,CAAC7D,IAAI,CAAC,IAAIqE,aAAa,CAACrE,IAAI,CAAC;AACnD","ignoreList":[]}
1
+ {"version":3,"file":"helpers.js","names":["ComponentType","hasFormField","isFormType","ControllerNames","ControllerTypes","ControllerType","PageTypes","getPageDefaults","page","nameOrPath","controller","Page","controllerNameFromPath","defaults","find","pageType","Error","structuredClone","hasComponents","hasNext","Array","isArray","components","hasComponentsEvenIfNoNext","undefined","hasFormComponents","Start","hasRepeater","Repeat","isControllerName","map","String","includes","Terminal","FileUpload","options","path","name","includesFileUploadField","some","component","type","FileUploadField","onlyDeclarationComponents","filter","comp","every","DeclarationField","includesPaymentField","PaymentField","hasPaymentQuestionInForm","definition","pages","length","hasPayment","hasPostcodeLookupInForm","addressField","UkAddressField","usePostcodeLookup","hasSpecificQuestionTypeInForm","componentType","hasSpecificComponent","SHOW_REPEATER_CONTROLLERS","showRepeaterSettings","getPageTitle","title","firstComp","getPageFromDefinition","pageId","x","id","summaryPageControllers","Summary","SummaryWithConfirmationEmail","isSummaryPage","replaceCustomControllers","standardControllers","Set","Object","values","toString","has","isPaymentPage","isEndPage"],"sources":["../../../src/pages/helpers.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { hasFormField, isFormType } from '~/src/components/helpers.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport {\n type Link,\n type Page,\n type PageFileUpload,\n type PageQuestion,\n type PageRepeat\n} from '~/src/form/form-definition/types.js'\nimport { type FormDefinition } from '~/src/index.js'\nimport {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { PageTypes } from '~/src/pages/page-types.js'\n\n/**\n * Return component defaults by type\n */\nexport function getPageDefaults<PageType extends Page>(\n page?: Pick<PageType, 'controller'>\n) {\n const nameOrPath = page?.controller ?? ControllerType.Page\n const controller = controllerNameFromPath(nameOrPath)\n\n const defaults = PageTypes.find(\n (pageType) => pageType.controller === controller\n )\n\n if (!defaults) {\n throw new Error(`Defaults not found for page type '${nameOrPath}'`)\n }\n\n return structuredClone(defaults) as PageType\n}\n\n/**\n * Check page has components\n */\nexport function hasComponents(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return hasNext(page) && Array.isArray(page.components)\n}\n\n/**\n * Check if the page has components (the page can be any page type e.g. SummaryPage)\n */\nexport function hasComponentsEvenIfNoNext(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return (\n page !== undefined && 'components' in page && Array.isArray(page.components)\n )\n}\n\n/**\n * Check page has form components\n */\nexport function hasFormComponents(\n page?: Partial<Page>\n): page is PageQuestion | PageFileUpload {\n const controller = controllerNameFromPath(page?.controller)\n return hasComponents(page) && controller !== ControllerType.Start\n}\n\n/**\n * Check page has repeater\n */\nexport function hasRepeater(page?: Partial<Page>): page is PageRepeat {\n return controllerNameFromPath(page?.controller) === ControllerType.Repeat\n}\n\n/**\n * Check for known page controller names\n */\nexport function isControllerName(\n nameOrPath?: ControllerType | string\n): nameOrPath is ControllerType {\n return !!nameOrPath && ControllerNames.map(String).includes(nameOrPath)\n}\n\n/**\n * Check page has next link\n */\nexport function hasNext(\n page?: Partial<Page>\n): page is Extract<Page, { next: Link[] }> {\n if (!page || !('next' in page)) {\n return false\n }\n\n const controller = controllerNameFromPath(page.controller)\n\n return (\n !controller ||\n controller === ControllerType.Start ||\n controller === ControllerType.Page ||\n controller === ControllerType.Terminal ||\n controller === ControllerType.FileUpload ||\n controller === ControllerType.Repeat\n )\n}\n\n/**\n * Check and optionally replace legacy path with controller name\n * @param {string} [nameOrPath] - Controller name or legacy controller path\n */\nexport function controllerNameFromPath(nameOrPath?: ControllerType | string) {\n if (isControllerName(nameOrPath)) {\n return nameOrPath\n }\n\n const options = ControllerTypes.find(({ path }) => path === nameOrPath)\n return options?.name\n}\n\nexport function includesFileUploadField(components: ComponentDef[]): boolean {\n return components.some(\n (component) => component.type === ComponentType.FileUploadField\n )\n}\n\nexport function onlyDeclarationComponents(components: ComponentDef[]): boolean {\n return components\n .filter((comp) => isFormType(comp.type))\n .every((component) => component.type === ComponentType.DeclarationField)\n}\n\nexport function includesPaymentField(components: ComponentDef[]): boolean {\n return components.some(\n (component) => component.type === ComponentType.PaymentField\n )\n}\n\n/**\n * Helper function to determine if a payment question already exists in the form\n */\nexport function hasPaymentQuestionInForm(definition: FormDefinition) {\n if (definition.pages.length === 0) {\n return false\n }\n\n for (const page of definition.pages) {\n const hasPayment = hasComponents(page)\n ? includesPaymentField(page.components)\n : false\n if (hasPayment) {\n return true\n }\n }\n return false\n}\n\n/**\n * Helper function to determine if the form uses postcode lookup\n */\nexport function hasPostcodeLookupInForm(definition: FormDefinition) {\n if (definition.pages.length === 0) {\n return false\n }\n\n for (const page of definition.pages) {\n const addressField = hasComponents(page)\n ? page.components.find(\n (component) => component.type === ComponentType.UkAddressField\n )\n : undefined\n if (addressField?.options.usePostcodeLookup) {\n return true\n }\n }\n return false\n}\n\n/**\n * Helper function to determine if a specific question type exists in the form\n */\nexport function hasSpecificQuestionTypeInForm(\n definition: FormDefinition,\n componentType: ComponentType\n) {\n if (definition.pages.length === 0) {\n return false\n }\n\n for (const page of definition.pages) {\n const hasSpecificComponent = hasComponents(page)\n ? page.components.some((component) => component.type === componentType)\n : false\n if (hasSpecificComponent) {\n return true\n }\n }\n return false\n}\n\nconst SHOW_REPEATER_CONTROLLERS = [ControllerType.Page, ControllerType.Repeat]\n\nexport function showRepeaterSettings(page: Page): boolean {\n if (page.controller && !SHOW_REPEATER_CONTROLLERS.includes(page.controller)) {\n return false\n }\n if (hasComponents(page)) {\n if (includesFileUploadField(page.components)) {\n return false\n }\n if (onlyDeclarationComponents(page.components)) {\n return false\n }\n if (includesPaymentField(page.components)) {\n return false\n }\n }\n return true\n}\n\n/**\n * Gets page title, or title of first question (if no page title set)\n * @param {Page} page\n * @returns {string}\n */\nexport function getPageTitle(page: Page) {\n if (page.title !== '') {\n return page.title\n }\n\n if (hasComponentsEvenIfNoNext(page)) {\n const firstComp = page.components.find(hasFormField)\n if (firstComp) {\n return firstComp.title\n }\n }\n return 'Page title unknown'\n}\n\n/**\n *\n * @param {FormDefinition} definition\n * @param {string} pageId\n * @returns { Page | undefined }\n */\nexport function getPageFromDefinition(\n definition: FormDefinition,\n pageId: string\n): Page | undefined {\n return definition.pages.find((x) => x.id === pageId)\n}\n\nexport const summaryPageControllers = [\n ControllerType.Summary,\n ControllerType.SummaryWithConfirmationEmail\n]\n\nexport function isSummaryPage(page: Page | undefined) {\n return summaryPageControllers.includes(\n page?.controller ?? ControllerType.Page\n )\n}\n\n/**\n * Revert any custom controllers to their parent/base class since engine-plugin has no knowledge of them\n * @param {FormDefinition} definition\n * @returns {FormDefinition}\n */\nexport function replaceCustomControllers(definition: FormDefinition) {\n const standardControllers = new Set(\n Object.values(ControllerType)\n .filter((x) => x !== ControllerType.SummaryWithConfirmationEmail)\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n .map((x) => x.toString())\n )\n\n return {\n ...definition,\n pages: definition.pages.map((page) => {\n if (\n !standardControllers.has(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n (page.controller ?? ControllerType.Page).toString()\n )\n ) {\n return /** @type {Page} */ {\n ...page,\n controller: ControllerType.Page\n }\n }\n return page\n })\n } as FormDefinition\n}\n\n/**\n * Helper function to determine if the current page contains a payment question\n * @param page - the page of the form\n * @returns {boolean}\n */\nexport function isPaymentPage(page: Page | undefined) {\n if (hasComponentsEvenIfNoNext(page)) {\n return page.components.some(\n (comp) => comp.type === ComponentType.PaymentField\n )\n }\n return false\n}\n\n/**\n * Helper function to determine if the current page is an end page i.e. summary page or payment page\n * @param page - the page of the form\n * @returns {boolean}\n */\nexport function isEndPage(page: Page | undefined) {\n return isSummaryPage(page) || isPaymentPage(page)\n}\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,YAAY,EAAEC,UAAU;AAUjC,SACEC,eAAe,EACfC,eAAe;AAEjB,SAASC,cAAc;AACvB,SAASC,SAAS;;AAElB;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,IAAmC,EACnC;EACA,MAAMC,UAAU,GAAGD,IAAI,EAAEE,UAAU,IAAIL,cAAc,CAACM,IAAI;EAC1D,MAAMD,UAAU,GAAGE,sBAAsB,CAACH,UAAU,CAAC;EAErD,MAAMI,QAAQ,GAAGP,SAAS,CAACQ,IAAI,CAC5BC,QAAQ,IAAKA,QAAQ,CAACL,UAAU,KAAKA,UACxC,CAAC;EAED,IAAI,CAACG,QAAQ,EAAE;IACb,MAAM,IAAIG,KAAK,CAAC,qCAAqCP,UAAU,GAAG,CAAC;EACrE;EAEA,OAAOQ,eAAe,CAACJ,QAAQ,CAAC;AAClC;;AAEA;AACA;AACA;AACA,OAAO,SAASK,aAAaA,CAC3BV,IAAoB,EACmC;EACvD,OAAOW,OAAO,CAACX,IAAI,CAAC,IAAIY,KAAK,CAACC,OAAO,CAACb,IAAI,CAACc,UAAU,CAAC;AACxD;;AAEA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACvCf,IAAoB,EACmC;EACvD,OACEA,IAAI,KAAKgB,SAAS,IAAI,YAAY,IAAIhB,IAAI,IAAIY,KAAK,CAACC,OAAO,CAACb,IAAI,CAACc,UAAU,CAAC;AAEhF;;AAEA;AACA;AACA;AACA,OAAO,SAASG,iBAAiBA,CAC/BjB,IAAoB,EACmB;EACvC,MAAME,UAAU,GAAGE,sBAAsB,CAACJ,IAAI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ACpC,IACE,CAACoE,mBAAmB,CAACK,GAAG;MACtB;MACA,CAACzE,IAAI,CAACE,UAAU,IAAIL,cAAc,CAACM,IAAI,EAAEqE,QAAQ,CAAC,CACpD,CAAC,EACD;QACA,OAAO,mBAAoB;UACzB,GAAGxE,IAAI;UACPE,UAAU,EAAEL,cAAc,CAACM;QAC7B,CAAC;MACH;MACA,OAAOH,IAAI;IACb,CAAC;EACH,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS0E,aAAaA,CAAC1E,IAAsB,EAAE;EACpD,IAAIe,yBAAyB,CAACf,IAAI,CAAC,EAAE;IACnC,OAAOA,IAAI,CAACc,UAAU,CAACiB,IAAI,CACxBM,IAAI,IAAKA,IAAI,CAACJ,IAAI,KAAKzC,aAAa,CAACiD,YACxC,CAAC;EACH;EACA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkC,SAASA,CAAC3E,IAAsB,EAAE;EAChD,OAAOkE,aAAa,CAAClE,IAAI,CAAC,IAAI0E,aAAa,CAAC1E,IAAI,CAAC;AACnD","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  export { ControllerNames, ControllerTypes } from "./controller-types.js";
2
2
  export { PageTypes } from "./page-types.js";
3
- export { controllerNameFromPath, getPageDefaults, getPageFromDefinition, getPageTitle, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasPaymentQuestionInForm, hasRepeater, hasSpecificQuestionTypeInForm, includesFileUploadField, includesPaymentField, isControllerName, isEndPage, isPaymentPage, isSummaryPage, replaceCustomControllers, showRepeaterSettings, summaryPageControllers } from "./helpers.js";
3
+ export { controllerNameFromPath, getPageDefaults, getPageFromDefinition, getPageTitle, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasPaymentQuestionInForm, hasPostcodeLookupInForm, hasRepeater, hasSpecificQuestionTypeInForm, includesFileUploadField, includesPaymentField, isControllerName, isEndPage, isPaymentPage, isSummaryPage, replaceCustomControllers, showRepeaterSettings, summaryPageControllers } from "./helpers.js";
4
4
  export { ControllerPath, ControllerType } from "./enums.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ControllerNames","ControllerTypes","PageTypes","controllerNameFromPath","getPageDefaults","getPageFromDefinition","getPageTitle","hasComponents","hasComponentsEvenIfNoNext","hasFormComponents","hasNext","hasPaymentQuestionInForm","hasRepeater","hasSpecificQuestionTypeInForm","includesFileUploadField","includesPaymentField","isControllerName","isEndPage","isPaymentPage","isSummaryPage","replaceCustomControllers","showRepeaterSettings","summaryPageControllers","ControllerPath","ControllerType"],"sources":["../../../src/pages/index.ts"],"sourcesContent":["export {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\n\nexport { PageTypes } from '~/src/pages/page-types.js'\n\nexport {\n controllerNameFromPath,\n getPageDefaults,\n getPageFromDefinition,\n getPageTitle,\n hasComponents,\n hasComponentsEvenIfNoNext,\n hasFormComponents,\n hasNext,\n hasPaymentQuestionInForm,\n hasRepeater,\n hasSpecificQuestionTypeInForm,\n includesFileUploadField,\n includesPaymentField,\n isControllerName,\n isEndPage,\n isPaymentPage,\n isSummaryPage,\n replaceCustomControllers,\n showRepeaterSettings,\n summaryPageControllers\n} from '~/src/pages/helpers.js'\n\nexport { ControllerPath, ControllerType } from '~/src/pages/enums.js'\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,eAAe;AAGjB,SAASC,SAAS;AAElB,SACEC,sBAAsB,EACtBC,eAAe,EACfC,qBAAqB,EACrBC,YAAY,EACZC,aAAa,EACbC,yBAAyB,EACzBC,iBAAiB,EACjBC,OAAO,EACPC,wBAAwB,EACxBC,WAAW,EACXC,6BAA6B,EAC7BC,uBAAuB,EACvBC,oBAAoB,EACpBC,gBAAgB,EAChBC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,wBAAwB,EACxBC,oBAAoB,EACpBC,sBAAsB;AAGxB,SAASC,cAAc,EAAEC,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ControllerNames","ControllerTypes","PageTypes","controllerNameFromPath","getPageDefaults","getPageFromDefinition","getPageTitle","hasComponents","hasComponentsEvenIfNoNext","hasFormComponents","hasNext","hasPaymentQuestionInForm","hasPostcodeLookupInForm","hasRepeater","hasSpecificQuestionTypeInForm","includesFileUploadField","includesPaymentField","isControllerName","isEndPage","isPaymentPage","isSummaryPage","replaceCustomControllers","showRepeaterSettings","summaryPageControllers","ControllerPath","ControllerType"],"sources":["../../../src/pages/index.ts"],"sourcesContent":["export {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\n\nexport { PageTypes } from '~/src/pages/page-types.js'\n\nexport {\n controllerNameFromPath,\n getPageDefaults,\n getPageFromDefinition,\n getPageTitle,\n hasComponents,\n hasComponentsEvenIfNoNext,\n hasFormComponents,\n hasNext,\n hasPaymentQuestionInForm,\n hasPostcodeLookupInForm,\n hasRepeater,\n hasSpecificQuestionTypeInForm,\n includesFileUploadField,\n includesPaymentField,\n isControllerName,\n isEndPage,\n isPaymentPage,\n isSummaryPage,\n replaceCustomControllers,\n showRepeaterSettings,\n summaryPageControllers\n} from '~/src/pages/helpers.js'\n\nexport { ControllerPath, ControllerType } from '~/src/pages/enums.js'\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,eAAe;AAGjB,SAASC,SAAS;AAElB,SACEC,sBAAsB,EACtBC,eAAe,EACfC,qBAAqB,EACrBC,YAAY,EACZC,aAAa,EACbC,yBAAyB,EACzBC,iBAAiB,EACjBC,OAAO,EACPC,wBAAwB,EACxBC,uBAAuB,EACvBC,WAAW,EACXC,6BAA6B,EAC7BC,uBAAuB,EACvBC,oBAAoB,EACpBC,gBAAgB,EAChBC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,wBAAwB,EACxBC,oBAAoB,EACpBC,sBAAsB;AAGxB,SAASC,cAAc,EAAEC,cAAc","ignoreList":[]}
@@ -69,6 +69,7 @@ export declare const paymentApiKeySchema: Joi.StringSchema<string>;
69
69
  export declare const exactChecksSchema: Joi.NumberSchema<number>;
70
70
  export declare const minChecksSchema: Joi.NumberSchema<number>;
71
71
  export declare const maxChecksSchema: Joi.NumberSchema<number>;
72
+ export declare const countriesSchema: Joi.ArraySchema<any[]>;
72
73
  interface DSLSchema<TSchema = Record<string, unknown>[]> extends ArraySchema<TSchema> {
73
74
  rowSeparator: (rowSep: string | RegExp) => DSLSchema<TSchema>;
74
75
  row: (rowSep: string | RegExp) => DSLSchema<TSchema>;
@@ -132,6 +133,7 @@ export declare const questionDetailsFullSchema: {
132
133
  minChecksSchema: Joi.NumberSchema<number>;
133
134
  maxChecksSchema: Joi.NumberSchema<number>;
134
135
  exactChecksSchema: Joi.NumberSchema<number>;
136
+ countriesSchema: Joi.ArraySchema<any[]>;
135
137
  };
136
138
  export declare const formEditorInputPageKeys: {
137
139
  pageType: Joi.StringSchema<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,KAAK,WAAW,EAAuB,MAAM,KAAK,CAAA;AAQhE,OAAO,EACL,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AAGxC,eAAO,MAAM,2BAA2B,0BAIqB,CAAA;AAE7D,eAAO,MAAM,2BAA2B,wFAC+C,CAAA;AAEvF,oBAAY,oBAAoB;IAC9B,qBAAqB,qBAAqB;IAC1C,YAAY,YAAY;IACxB,YAAY,YAAY;IACxB,gBAAgB,gBAAgB;CACjC;AAED,eAAO,MAAM,cAAc,0BAG6C,CAAA;AAExE,eAAO,MAAM,kBAAkB,0BAmB2C,CAAA;AAE1E,eAAO,MAAM,sB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ACpD,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAS,CAAC,OAAO,CAAC,CAAA;CAC7C;AAED,UAAU,eAAgB,SAAQ,GAAG,CAAC,IAAI;IACxC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO,CAAC,CAAA;CACnC;AAED,eAAO,MAAM,eAAe,EA4GtB,eAAe,CAAA;AAErB,eAAO,MAAM,yBAAyB;UACvB,MAAM;WAAS,MAAM;IAiBvB,CAAA;AAEb,eAAO,MAAM,yBAAyB;;cAnBvB,MAAM;eAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEnC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;CAGnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uCAGmC,CAAA;AAEzE,eAAO,MAAM,sCAAsC;;CAElD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wCAAwC,uDAIO,CAAA;AAE5D,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,2CAMrC,CAAA;AAEL,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAI8B,CAAA;AAE5E,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,gBAAgB,CAYhC;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,0BAA0B,GAAG,2BAA2B,CASxE;AAGD,eAAO,MAAM,6BAA6B,UAA+B,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { type ComponentType } from '../../components/enums.js';
2
- import { type ComponentDef } from '../../components/types.js';
2
+ import { type ComponentDef, type GeospatialFieldOptionsCountry } from '../../components/types.js';
3
3
  import { type DateDirections, type DateUnits } from '../../conditions/enums.js';
4
4
  import { type ConditionWrapperV2, type Item } from '../../form/form-definition/types.js';
5
5
  /**
@@ -291,13 +291,17 @@ export interface FormEditor {
291
291
  * Title that user supplies a section
292
292
  */
293
293
  sectionTitle: string;
294
+ /**
295
+ * The country restriction for geospatial questions
296
+ */
297
+ countries?: (GeospatialFieldOptionsCountry | 'any')[];
294
298
  }
295
299
  export type FormEditorInputPage = Pick<FormEditor, 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'locationSub' | 'listSub'>;
296
300
  export type FormEditorInputCheckAnswersSettings = Pick<FormEditor, 'needDeclaration' | 'declarationText'>;
297
301
  export type FormEditorInputConfirmationEmailSettings = Pick<FormEditor, 'disableConfirmationEmail'>;
298
302
  export type FormEditorInputReferenceNumberSettings = Pick<FormEditor, 'enableReferenceNumber'>;
299
303
  export type FormEditorInputUserFeedbackSettings = Pick<FormEditor, 'disableUserFeedback'>;
300
- export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'declarationText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast' | 'exactFiles' | 'minFiles' | 'maxFiles' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'autoCompleteOptions' | 'enhancedAction' | 'radioId' | 'radioText' | 'radioHint' | 'radioValue' | 'list' | 'listItemsData' | 'exactChecks' | 'minChecks' | 'maxChecks' | 'jsEnabled' | 'usePostcodeLookup' | 'giveInstructions' | 'instructionText' | 'paymentAmount' | 'paymentDescription' | 'paymentTestApiKey' | 'paymentLiveApiKey' | 'conditionalAmount' | 'conditionalAmountCondition'>;
304
+ export type FormEditorInputQuestion = Pick<FormEditor, 'questionType' | 'name' | 'question' | 'shortDescription' | 'hintText' | 'declarationText' | 'questionOptional' | 'minLength' | 'maxLength' | 'regex' | 'rows' | 'classes' | 'prefix' | 'suffix' | 'precision' | 'min' | 'max' | 'maxFuture' | 'maxPast' | 'exactFiles' | 'minFiles' | 'maxFiles' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'autoCompleteOptions' | 'enhancedAction' | 'radioId' | 'radioText' | 'radioHint' | 'radioValue' | 'list' | 'listItemsData' | 'exactChecks' | 'minChecks' | 'maxChecks' | 'jsEnabled' | 'usePostcodeLookup' | 'giveInstructions' | 'instructionText' | 'paymentAmount' | 'paymentDescription' | 'paymentTestApiKey' | 'paymentLiveApiKey' | 'conditionalAmount' | 'conditionalAmountCondition' | 'countries'>;
301
305
  export type FormEditorInputPageSettings = Pick<FormEditor, 'pageHeadingAndGuidance' | 'pageHeading' | 'guidanceText' | 'repeater' | 'minItems' | 'maxItems' | 'questionSetName' | 'exitPage'>;
302
306
  export type FormEditorInputGuidancePage = Pick<FormEditor, 'pageHeading' | 'guidanceText' | 'exitPage'>;
303
307
  export type FormEditorInputQuestionDetails = Pick<FormEditorInputQuestion, 'question' | 'hintText' | 'shortDescription' | 'questionOptional' | 'questionType' | 'fileTypes' | 'documentTypes' | 'imageTypes' | 'tabularDataTypes' | 'autoCompleteOptions' | 'enhancedAction' | 'radioId' | 'radioText' | 'radioHint' | 'radioValue' | 'listItemsData' | 'jsEnabled' | 'paymentAmount' | 'paymentDescription' | 'paymentTestApiKey' | 'paymentLiveApiKey' | 'conditionalAmount' | 'conditionalAmountCondition'>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACV,MAAM,qCAAqC,CAAA;AAE5C;;GAEG;AACH,MAAM,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,MAAM,iBAAiB,GAAG,WAAW,GAAG,IAAI,CAAA;AAElD,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,IAAI,CAAA;AAE5D,MAAM,WAAW,2BAA2B;IAC1C,GAAG,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD,GAAG,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;CACjD"}
@@ -21,6 +21,7 @@ export declare const privacyNoticeTextSchema: Joi.StringSchema<string>;
21
21
  export declare const privacyNoticeUrlSchema: Joi.StringSchema<string>;
22
22
  export declare const termsAndConditionsAgreedSchema: Joi.BooleanSchema<boolean>;
23
23
  export declare const notificationEmailAddressSchema: Joi.StringSchema<string>;
24
+ export declare const offlineSchema: Joi.BooleanSchema<boolean>;
24
25
  export declare const authoredAtSchema: Joi.DateSchema<Date>;
25
26
  export declare const authorIdSchema: Joi.StringSchema<string>;
26
27
  export declare const authorDisplayNameSchema: Joi.StringSchema<string>;
@@ -36,6 +37,7 @@ export declare const formMetadataInputKeys: {
36
37
  privacyNoticeUrl: Joi.AlternativesSchema<any>;
37
38
  termsAndConditionsAgreed: Joi.BooleanSchema<boolean>;
38
39
  notificationEmail: Joi.StringSchema<string>;
40
+ offline: Joi.BooleanSchema<boolean>;
39
41
  };
40
42
  /**
41
43
  * Joi schema for `FormMetadataInput` interface
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,M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8BAA8B,0BAGxC,CAAA;AAEH,eAAO,MAAM,aAAa,4BAEzB,CAAA;AAED,eAAO,MAAM,gBAAgB,sBAGoC,CAAA;AAEjE,eAAO,MAAM,cAAc,0BAGuB,CAAA;AAElD,eAAO,MAAM,uBAAuB,0BAGe,CAAA;AAEnD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;CAqBjC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,qCAG+B,CAAA;AAEnE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,sCAMkC,CAAA;AAEvE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,qCAaqC,CAAA;AAEzE;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uCASuB,CAAA;AAE7D;;;GAGG;AACH,eAAO,MAAM,kBAAkB,gCAuB5B,CAAA"}
@@ -145,6 +145,11 @@ export interface FormMetadata {
145
145
  * Email address where form responses are sent
146
146
  */
147
147
  notificationEmail?: string;
148
+ /**
149
+ * Whether the form has been taken offline. When true, the runtime renders
150
+ * an unavailable page instead of the form.
151
+ */
152
+ offline?: boolean;
148
153
  /**
149
154
  * The draft state of the form
150
155
  */
@@ -184,7 +189,7 @@ export type FormByIDAndPageByIdAndComponentByIdInput = Pick<FormMetadata, 'id'>
184
189
  };
185
190
  export type FormBySlugInput = Pick<FormMetadata, 'slug'>;
186
191
  export type FormMetadataDocument = Omit<FormMetadata, 'id'>;
187
- export type FormMetadataInput = Pick<FormMetadata, 'title' | 'organisation' | 'teamName' | 'teamEmail' | 'contact' | 'submissionGuidance' | 'privacyNoticeType' | 'privacyNoticeText' | 'privacyNoticeUrl' | 'termsAndConditionsAgreed' | 'notificationEmail'>;
192
+ export type FormMetadataInput = Pick<FormMetadata, 'title' | 'organisation' | 'teamName' | 'teamEmail' | 'contact' | 'submissionGuidance' | 'privacyNoticeType' | 'privacyNoticeText' | 'privacyNoticeUrl' | 'termsAndConditionsAgreed' | 'notificationEmail' | 'offline'>;
188
193
  export interface FormResponse {
189
194
  id: FormMetadata['id'];
190
195
  slug: FormMetadata['slug'];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;IAE7B;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAA;IAEhC;;OAEG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAA;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;O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AACD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;AACxD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAC3D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,OAAO,GACP,cAAc,GACd,UAAU,GACV,WAAW,GACX,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,0BAA0B,GAC1B,mBAAmB,CACtB,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;IACtB,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;IAE7B;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;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SAAS,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAEzC;;OAEG;IACH,SAAS,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAEzC;;OAEG;IACH,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAA;CACjC;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AACpD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG;IAChE,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,wCAAwC,GAAG,IAAI,CACzD,YAAY,EACZ,IAAI,CACL,GAAG;IACF,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;AACxD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAC3D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,OAAO,GACP,cAAc,GACd,UAAU,GACV,WAAW,GACX,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,0BAA0B,GAC1B,mBAAmB,GACnB,SAAS,CACZ,CAAA;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;IACtB,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf"}
@@ -49,6 +49,10 @@ export declare function includesPaymentField(components: ComponentDef[]): boolea
49
49
  * Helper function to determine if a payment question already exists in the form
50
50
  */
51
51
  export declare function hasPaymentQuestionInForm(definition: FormDefinition): boolean;
52
+ /**
53
+ * Helper function to determine if the form uses postcode lookup
54
+ */
55
+ export declare function hasPostcodeLookupInForm(definition: FormDefinition): boolean;
52
56
  /**
53
57
  * Helper function to determine if a specific question type exists in the form
54
58
  */
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/pages/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAKpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGrD;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,IAAI,EACnD,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,GAaC,QAAQ,CAC7C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GACnB,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAEvD;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GACnB,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAIvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GACnB,IAAI,IAAI,YAAY,GAAG,cAAc,CAGvC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,UAAU,CAEpE;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,cAAc,CACpB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,WAOnD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,WAE/C"}
@@ -1,5 +1,5 @@
1
1
  export { ControllerNames, ControllerTypes } from '../pages/controller-types.js';
2
2
  export { PageTypes } from '../pages/page-types.js';
3
- export { controllerNameFromPath, getPageDefaults, getPageFromDefinition, getPageTitle, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasPaymentQuestionInForm, hasRepeater, hasSpecificQuestionTypeInForm, includesFileUploadField, includesPaymentField, isControllerName, isEndPage, isPaymentPage, isSummaryPage, replaceCustomControllers, showRepeaterSettings, summaryPageControllers } from '../pages/helpers.js';
3
+ export { controllerNameFromPath, getPageDefaults, getPageFromDefinition, getPageTitle, hasComponents, hasComponentsEvenIfNoNext, hasFormComponents, hasNext, hasPaymentQuestionInForm, hasPostcodeLookupInForm, hasRepeater, hasSpecificQuestionTypeInForm, includesFileUploadField, includesPaymentField, isControllerName, isEndPage, isPaymentPage, isSummaryPage, replaceCustomControllers, showRepeaterSettings, summaryPageControllers } from '../pages/helpers.js';
4
4
  export { ControllerPath, ControllerType } from '../pages/enums.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,yBAAyB,EACzB,iBAAiB,EACjB,OAAO,EACP,wBAAwB,EACxB,WAAW,EACX,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,yBAAyB,EACzB,iBAAiB,EACjB,OAAO,EACP,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.656",
3
+ "version": "3.0.664",
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",
@@ -177,6 +177,11 @@
177
177
  "description": "Email address to receive form submission notifications",
178
178
  "format": "email",
179
179
  "title": "Notification Email"
180
+ },
181
+ "offline": {
182
+ "type": "boolean",
183
+ "description": "Whether the form has been taken offline; runtime renders an unavailable page when true",
184
+ "title": "Offline"
180
185
  }
181
186
  },
182
187
  "required": [
@@ -178,6 +178,11 @@
178
178
  "format": "email",
179
179
  "title": "Notification Email"
180
180
  },
181
+ "offline": {
182
+ "type": "boolean",
183
+ "description": "Whether the form has been taken offline; runtime renders an unavailable page when true",
184
+ "title": "Offline"
185
+ },
181
186
  "id": {
182
187
  "type": "string",
183
188
  "description": "Unique identifier for the form, 24-character hexadecimal string",
@@ -1,7 +1,10 @@
1
1
  import Joi, { type ArraySchema, type GetRuleOptions } from 'joi'
2
2
 
3
3
  import { rtrimOnly } from '~/src/common/rtrim-only.js'
4
- import { ComponentType } from '~/src/components/enums.js'
4
+ import {
5
+ ComponentType,
6
+ GeospatialFieldOptionsCountryEnum
7
+ } from '~/src/components/enums.js'
5
8
  import {
6
9
  MAX_NUMBER_OF_REPEAT_ITEMS,
7
10
  MIN_NUMBER_OF_REPEAT_ITEMS
@@ -447,6 +450,16 @@ export const maxChecksSchema = Joi.number()
447
450
  .min(2)
448
451
  .description('Maximum number of items allowed to be selected.')
449
452
 
453
+ export const countriesSchema = Joi.array()
454
+ .items(
455
+ Joi.string().valid(
456
+ ...Object.values(GeospatialFieldOptionsCountryEnum),
457
+ 'any'
458
+ )
459
+ )
460
+ .single()
461
+ .description('The country to be included in a geospatial field')
462
+
450
463
  type GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {
451
464
  args: Record<K, T>
452
465
  }
@@ -638,7 +651,8 @@ export const questionDetailsFullSchema = {
638
651
  usePostcodeLookupSchema,
639
652
  minChecksSchema,
640
653
  maxChecksSchema,
641
- exactChecksSchema
654
+ exactChecksSchema,
655
+ countriesSchema
642
656
  }
643
657
 
644
658
  export const formEditorInputPageKeys = {
@@ -1,5 +1,8 @@
1
1
  import { type ComponentType } from '~/src/components/enums.js'
2
- import { type ComponentDef } from '~/src/components/types.js'
2
+ import {
3
+ type ComponentDef,
4
+ type GeospatialFieldOptionsCountry
5
+ } from '~/src/components/types.js'
3
6
  import { type DateDirections, type DateUnits } from '~/src/conditions/enums.js'
4
7
  import {
5
8
  type ConditionWrapperV2,
@@ -365,6 +368,11 @@ export interface FormEditor {
365
368
  * Title that user supplies a section
366
369
  */
367
370
  sectionTitle: string
371
+
372
+ /**
373
+ * The country restriction for geospatial questions
374
+ */
375
+ countries?: (GeospatialFieldOptionsCountry | 'any')[]
368
376
  }
369
377
 
370
378
  export type FormEditorInputPage = Pick<
@@ -446,6 +454,7 @@ export type FormEditorInputQuestion = Pick<
446
454
  | 'paymentLiveApiKey'
447
455
  | 'conditionalAmount'
448
456
  | 'conditionalAmountCondition'
457
+ | 'countries'
449
458
  >
450
459
 
451
460
  export type FormEditorInputPageSettings = Pick<
@@ -136,6 +136,10 @@ export const notificationEmailAddressSchema =
136
136
  'Email address to receive form submission notifications'
137
137
  )
138
138
 
139
+ export const offlineSchema = Joi.boolean().description(
140
+ 'Whether the form has been taken offline; runtime renders an unavailable page when true'
141
+ )
142
+
139
143
  export const authoredAtSchema = Joi.date()
140
144
  .iso()
141
145
  .required()
@@ -170,7 +174,8 @@ export const formMetadataInputKeys = {
170
174
  otherwise: privacyNoticeUrlSchema.allow('')
171
175
  }),
172
176
  termsAndConditionsAgreed: termsAndConditionsAgreedSchema,
173
- notificationEmail: notificationEmailAddressSchema
177
+ notificationEmail: notificationEmailAddressSchema,
178
+ offline: offlineSchema
174
179
  }
175
180
 
176
181
  /**
@@ -174,6 +174,12 @@ export interface FormMetadata {
174
174
  */
175
175
  notificationEmail?: string
176
176
 
177
+ /**
178
+ * Whether the form has been taken offline. When true, the runtime renders
179
+ * an unavailable page instead of the form.
180
+ */
181
+ offline?: boolean
182
+
177
183
  /**
178
184
  * The draft state of the form
179
185
  */
@@ -236,6 +242,7 @@ export type FormMetadataInput = Pick<
236
242
  | 'privacyNoticeUrl'
237
243
  | 'termsAndConditionsAgreed'
238
244
  | 'notificationEmail'
245
+ | 'offline'
239
246
  >
240
247
 
241
248
  export interface FormResponse {
package/src/index.ts CHANGED
@@ -44,3 +44,5 @@ export type * from '~/src/form/form-editor/types.js'
44
44
  export type * from '~/src/form/form-editor/macros/types.js'
45
45
  export type * from '~/src/form/form-audit/types.js'
46
46
  export type * from '~/src/manage/types.js'
47
+
48
+ // test
@@ -154,6 +154,27 @@ export function hasPaymentQuestionInForm(definition: FormDefinition) {
154
154
  return false
155
155
  }
156
156
 
157
+ /**
158
+ * Helper function to determine if the form uses postcode lookup
159
+ */
160
+ export function hasPostcodeLookupInForm(definition: FormDefinition) {
161
+ if (definition.pages.length === 0) {
162
+ return false
163
+ }
164
+
165
+ for (const page of definition.pages) {
166
+ const addressField = hasComponents(page)
167
+ ? page.components.find(
168
+ (component) => component.type === ComponentType.UkAddressField
169
+ )
170
+ : undefined
171
+ if (addressField?.options.usePostcodeLookup) {
172
+ return true
173
+ }
174
+ }
175
+ return false
176
+ }
177
+
157
178
  /**
158
179
  * Helper function to determine if a specific question type exists in the form
159
180
  */
@@ -166,10 +187,10 @@ export function hasSpecificQuestionTypeInForm(
166
187
  }
167
188
 
168
189
  for (const page of definition.pages) {
169
- const hasPayment = hasComponents(page)
190
+ const hasSpecificComponent = hasComponents(page)
170
191
  ? page.components.some((component) => component.type === componentType)
171
192
  : false
172
- if (hasPayment) {
193
+ if (hasSpecificComponent) {
173
194
  return true
174
195
  }
175
196
  }
@@ -15,6 +15,7 @@ export {
15
15
  hasFormComponents,
16
16
  hasNext,
17
17
  hasPaymentQuestionInForm,
18
+ hasPostcodeLookupInForm,
18
19
  hasRepeater,
19
20
  hasSpecificQuestionTypeInForm,
20
21
  includesFileUploadField,