@defra/forms-model 3.0.679 → 3.0.681

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 (43) hide show
  1. package/dist/module/form/form-audit/enums.js +2 -0
  2. package/dist/module/form/form-audit/enums.js.map +1 -1
  3. package/dist/module/form/form-audit/types.js.map +1 -1
  4. package/dist/module/form/form-editor/__stubs__/preview.js +14 -0
  5. package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
  6. package/dist/module/form/form-editor/enums.js +7 -0
  7. package/dist/module/form/form-editor/enums.js.map +1 -0
  8. package/dist/module/form/form-editor/index.js +6 -3
  9. package/dist/module/form/form-editor/index.js.map +1 -1
  10. package/dist/module/form/form-editor/preview/component-elements.js +1 -0
  11. package/dist/module/form/form-editor/preview/component-elements.js.map +1 -1
  12. package/dist/module/form/form-editor/preview/types.js.map +1 -1
  13. package/dist/module/form/form-editor/types.js.map +1 -1
  14. package/dist/module/index.js +1 -0
  15. package/dist/module/index.js.map +1 -1
  16. package/dist/types/form/form-audit/enums.d.ts +2 -0
  17. package/dist/types/form/form-audit/enums.d.ts.map +1 -1
  18. package/dist/types/form/form-audit/types.d.ts +9 -1
  19. package/dist/types/form/form-audit/types.d.ts.map +1 -1
  20. package/dist/types/form/form-editor/__stubs__/preview.d.ts +10 -0
  21. package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
  22. package/dist/types/form/form-editor/enums.d.ts +6 -0
  23. package/dist/types/form/form-editor/enums.d.ts.map +1 -0
  24. package/dist/types/form/form-editor/index.d.ts +4 -1
  25. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  26. package/dist/types/form/form-editor/preview/component-elements.d.ts.map +1 -1
  27. package/dist/types/form/form-editor/preview/types.d.ts +1 -0
  28. package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
  29. package/dist/types/form/form-editor/types.d.ts +7 -2
  30. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  31. package/dist/types/index.d.ts +1 -0
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/schemas/form-editor-input-question-schema.json +5 -0
  35. package/src/form/form-audit/enums.ts +2 -0
  36. package/src/form/form-audit/types.ts +12 -0
  37. package/src/form/form-editor/__stubs__/preview.js +14 -0
  38. package/src/form/form-editor/enums.ts +5 -0
  39. package/src/form/form-editor/index.ts +11 -2
  40. package/src/form/form-editor/preview/component-elements.js +1 -0
  41. package/src/form/form-editor/preview/types.ts +1 -0
  42. package/src/form/form-editor/types.ts +8 -0
  43. package/src/index.ts +1 -0
@@ -38,6 +38,8 @@ export let AuditEventMessageType = /*#__PURE__*/function (AuditEventMessageType)
38
38
  AuditEventMessageType["FORM_DRAFT_CREATED_FROM_LIVE"] = "FORM_DRAFT_CREATED_FROM_LIVE";
39
39
  AuditEventMessageType["FORM_LIVE_CREATED_FROM_DRAFT"] = "FORM_LIVE_CREATED_FROM_DRAFT";
40
40
  AuditEventMessageType["FORM_DRAFT_DELETED"] = "FORM_DRAFT_DELETED";
41
+ AuditEventMessageType["FORM_TAKEN_OFFLINE"] = "FORM_TAKEN_OFFLINE";
42
+ AuditEventMessageType["FORM_MADE_ONLINE_AGAIN"] = "FORM_MADE_ONLINE_AGAIN";
41
43
  AuditEventMessageType["FORM_MIGRATED"] = "FORM_MIGRATED";
42
44
  AuditEventMessageType["FORM_UPDATED"] = "FORM_UPDATED";
43
45
  AuditEventMessageType["FORM_SECRET_DELETED"] = "FORM_SECRET_DELETED";
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["AuditEventMessageSchemaVersion","AuditEventMessageCategory","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType"],"sources":["../../../../src/form/form-audit/enums.ts"],"sourcesContent":["export enum AuditEventMessageSchemaVersion {\n V1 = 1\n}\n\nexport enum AuditEventMessageCategory {\n FORM = 'FORM',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION',\n OPERATIONS = 'OPERATIONS'\n}\n\nexport enum AuditEventMessageSource {\n FORMS_MANAGER = 'FORMS_MANAGER',\n FORMS_DESIGNER = 'FORMS_DESIGNER',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION'\n}\n\nexport enum AuditEventMessageType {\n // FORM message types\n FORM_CREATED = 'FORM_CREATED',\n FORM_TITLE_UPDATED = 'FORM_TITLE_UPDATED',\n FORM_ORGANISATION_UPDATED = 'FORM_ORGANISATION_UPDATED',\n FORM_TEAM_NAME_UPDATED = 'FORM_TEAM_NAME_UPDATED',\n FORM_TEAM_EMAIL_UPDATED = 'FORM_TEAM_EMAIL_UPDATED',\n FORM_SUPPORT_CONTACT_UPDATED = 'FORM_SUPPORT_CONTACT_UPDATED',\n FORM_SUPPORT_PHONE_UPDATED = 'FORM_SUPPORT_PHONE_UPDATED',\n FORM_SUPPORT_EMAIL_UPDATED = 'FORM_SUPPORT_EMAIL_UPDATED',\n FORM_SUPPORT_ONLINE_UPDATED = 'FORM_SUPPORT_ONLINE_UPDATED',\n FORM_PRIVACY_NOTICE_UPDATED = 'FORM_PRIVACY_NOTICE_UPDATED',\n FORM_TERMS_AND_CONDITIONS_AGREED = 'FORM_TERMS_AND_CONDITIONS_AGREED',\n FORM_NOTIFICATION_EMAIL_UPDATED = 'FORM_NOTIFICATION_EMAIL_UPDATED',\n FORM_SUBMISSION_GUIDANCE_UPDATED = 'FORM_SUBMISSION_GUIDANCE_UPDATED',\n FORM_JSON_UPLOADED = 'FORM_JSON_UPLOADED',\n FORM_JSON_DOWNLOADED = 'FORM_JSON_DOWNLOADED',\n FORM_FILE_DOWNLOAD_SUCCESS = 'FORM_FILE_DOWNLOAD_SUCCESS',\n FORM_FILE_DOWNLOAD_FAILURE = 'FORM_FILE_DOWNLOAD_FAILURE',\n FORM_DRAFT_CREATED_FROM_LIVE = 'FORM_DRAFT_CREATED_FROM_LIVE',\n FORM_LIVE_CREATED_FROM_DRAFT = 'FORM_LIVE_CREATED_FROM_DRAFT',\n FORM_DRAFT_DELETED = 'FORM_DRAFT_DELETED',\n FORM_MIGRATED = 'FORM_MIGRATED',\n FORM_UPDATED = 'FORM_UPDATED',\n FORM_SECRET_DELETED = 'FORM_SECRET_DELETED',\n FORM_SECRET_SAVED = 'FORM_SECRET_SAVED',\n FORM_SUBMISSION_EXCEL_REQUESTED = 'FORM_SUBMISSION_EXCEL_REQUESTED',\n FORM_CSAT_EXCEL_REQUESTED = 'FORM_CSAT_EXCEL_REQUESTED',\n FORMS_BACKUP_REQUESTED = 'FORMS_BACKUP_REQUESTED',\n PLATFORM_CSAT_EXCEL_REQUESTED = 'PLATFORM_CSAT_EXCEL_REQUESTED',\n PLATFORM_METRICS_DOWNLOAD_REQUESTED = 'PLATFORM_METRICS_DOWNLOAD_REQUESTED',\n\n // ENTITLEMENT message types\n ENTITLEMENT_CREATED = 'ENTITLEMENT_CREATED',\n ENTITLEMENT_UPDATED = 'ENTITLEMENT_UPDATED',\n ENTITLEMENT_DELETED = 'ENTITLEMENT_DELETED',\n\n // AUTHENTICATION message types\n AUTHENTICATION_LOGIN = 'AUTHENTICATION_LOGIN',\n AUTHENTICATION_LOGOUT_MANUAL = 'AUTHENTICATION_LOGOUT_MANUAL',\n AUTHENTICATION_LOGOUT_AUTO = 'AUTHENTICATION_LOGOUT_AUTO',\n AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE = 'AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE',\n\n // Dead-letter queue types\n DLQ_ACTION = 'DLQ_ACTION'\n}\n\nexport enum FormDefinitionRequestType {\n REPLACE_DRAFT = 'REPLACE_DRAFT',\n CREATE_COMPONENT = 'CREATE_COMPONENT',\n UPDATE_COMPONENT = 'UPDATE_COMPONENT',\n DELETE_COMPONENT = 'DELETE_COMPONENT',\n CREATE_CONDITION = 'CREATE_CONDITION',\n UPDATE_CONDITION = 'UPDATE_CONDITION',\n DELETE_CONDITION = 'DELETE_CONDITION',\n REORDER_PAGES = 'REORDER_PAGES',\n REORDER_COMPONENTS = 'REORDER_COMPONENTS',\n REORDER_SECTIONS = 'REORDER_SECTIONS',\n CREATE_LIST = 'CREATE_LIST',\n UPDATE_LIST = 'UPDATE_LIST',\n DELETE_LIST = 'DELETE_LIST',\n CREATE_PAGE = 'CREATE_PAGE',\n UPDATE_PAGE_FIELDS = 'UPDATE_PAGE_FIELDS',\n DELETE_PAGE = 'DELETE_PAGE',\n REPOSITION_SUMMARY = 'REPOSITION_SUMMARY',\n CREATE_SECTION = 'CREATE_SECTION',\n DELETE_SECTION = 'DELETE_SECTION',\n RENAME_SECTION = 'RENAME_SECTION',\n ASSIGN_SECTIONS = 'ASSIGN_SECTIONS',\n UNASSIGN_SECTIONS = 'UNASSIGN_SECTIONS',\n UPDATE_OPTION = 'UPDATE_OPTION'\n}\n"],"mappings":"AAAA,WAAYA,8BAA8B,0BAA9BA,8BAA8B;EAA9BA,8BAA8B,CAA9BA,8BAA8B;EAAA,OAA9BA,8BAA8B;AAAA;AAI1C,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAOrC,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AAOnC,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAC/B;EADUA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAgC/B;EAhCUA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAqC/B;EArCUA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EA2C/B;EA3CUA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AA+CjC,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["AuditEventMessageSchemaVersion","AuditEventMessageCategory","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType"],"sources":["../../../../src/form/form-audit/enums.ts"],"sourcesContent":["export enum AuditEventMessageSchemaVersion {\n V1 = 1\n}\n\nexport enum AuditEventMessageCategory {\n FORM = 'FORM',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION',\n OPERATIONS = 'OPERATIONS'\n}\n\nexport enum AuditEventMessageSource {\n FORMS_MANAGER = 'FORMS_MANAGER',\n FORMS_DESIGNER = 'FORMS_DESIGNER',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION'\n}\n\nexport enum AuditEventMessageType {\n // FORM message types\n FORM_CREATED = 'FORM_CREATED',\n FORM_TITLE_UPDATED = 'FORM_TITLE_UPDATED',\n FORM_ORGANISATION_UPDATED = 'FORM_ORGANISATION_UPDATED',\n FORM_TEAM_NAME_UPDATED = 'FORM_TEAM_NAME_UPDATED',\n FORM_TEAM_EMAIL_UPDATED = 'FORM_TEAM_EMAIL_UPDATED',\n FORM_SUPPORT_CONTACT_UPDATED = 'FORM_SUPPORT_CONTACT_UPDATED',\n FORM_SUPPORT_PHONE_UPDATED = 'FORM_SUPPORT_PHONE_UPDATED',\n FORM_SUPPORT_EMAIL_UPDATED = 'FORM_SUPPORT_EMAIL_UPDATED',\n FORM_SUPPORT_ONLINE_UPDATED = 'FORM_SUPPORT_ONLINE_UPDATED',\n FORM_PRIVACY_NOTICE_UPDATED = 'FORM_PRIVACY_NOTICE_UPDATED',\n FORM_TERMS_AND_CONDITIONS_AGREED = 'FORM_TERMS_AND_CONDITIONS_AGREED',\n FORM_NOTIFICATION_EMAIL_UPDATED = 'FORM_NOTIFICATION_EMAIL_UPDATED',\n FORM_SUBMISSION_GUIDANCE_UPDATED = 'FORM_SUBMISSION_GUIDANCE_UPDATED',\n FORM_JSON_UPLOADED = 'FORM_JSON_UPLOADED',\n FORM_JSON_DOWNLOADED = 'FORM_JSON_DOWNLOADED',\n FORM_FILE_DOWNLOAD_SUCCESS = 'FORM_FILE_DOWNLOAD_SUCCESS',\n FORM_FILE_DOWNLOAD_FAILURE = 'FORM_FILE_DOWNLOAD_FAILURE',\n FORM_DRAFT_CREATED_FROM_LIVE = 'FORM_DRAFT_CREATED_FROM_LIVE',\n FORM_LIVE_CREATED_FROM_DRAFT = 'FORM_LIVE_CREATED_FROM_DRAFT',\n FORM_DRAFT_DELETED = 'FORM_DRAFT_DELETED',\n FORM_TAKEN_OFFLINE = 'FORM_TAKEN_OFFLINE',\n FORM_MADE_ONLINE_AGAIN = 'FORM_MADE_ONLINE_AGAIN',\n FORM_MIGRATED = 'FORM_MIGRATED',\n FORM_UPDATED = 'FORM_UPDATED',\n FORM_SECRET_DELETED = 'FORM_SECRET_DELETED',\n FORM_SECRET_SAVED = 'FORM_SECRET_SAVED',\n FORM_SUBMISSION_EXCEL_REQUESTED = 'FORM_SUBMISSION_EXCEL_REQUESTED',\n FORM_CSAT_EXCEL_REQUESTED = 'FORM_CSAT_EXCEL_REQUESTED',\n FORMS_BACKUP_REQUESTED = 'FORMS_BACKUP_REQUESTED',\n PLATFORM_CSAT_EXCEL_REQUESTED = 'PLATFORM_CSAT_EXCEL_REQUESTED',\n PLATFORM_METRICS_DOWNLOAD_REQUESTED = 'PLATFORM_METRICS_DOWNLOAD_REQUESTED',\n\n // ENTITLEMENT message types\n ENTITLEMENT_CREATED = 'ENTITLEMENT_CREATED',\n ENTITLEMENT_UPDATED = 'ENTITLEMENT_UPDATED',\n ENTITLEMENT_DELETED = 'ENTITLEMENT_DELETED',\n\n // AUTHENTICATION message types\n AUTHENTICATION_LOGIN = 'AUTHENTICATION_LOGIN',\n AUTHENTICATION_LOGOUT_MANUAL = 'AUTHENTICATION_LOGOUT_MANUAL',\n AUTHENTICATION_LOGOUT_AUTO = 'AUTHENTICATION_LOGOUT_AUTO',\n AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE = 'AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE',\n\n // Dead-letter queue types\n DLQ_ACTION = 'DLQ_ACTION'\n}\n\nexport enum FormDefinitionRequestType {\n REPLACE_DRAFT = 'REPLACE_DRAFT',\n CREATE_COMPONENT = 'CREATE_COMPONENT',\n UPDATE_COMPONENT = 'UPDATE_COMPONENT',\n DELETE_COMPONENT = 'DELETE_COMPONENT',\n CREATE_CONDITION = 'CREATE_CONDITION',\n UPDATE_CONDITION = 'UPDATE_CONDITION',\n DELETE_CONDITION = 'DELETE_CONDITION',\n REORDER_PAGES = 'REORDER_PAGES',\n REORDER_COMPONENTS = 'REORDER_COMPONENTS',\n REORDER_SECTIONS = 'REORDER_SECTIONS',\n CREATE_LIST = 'CREATE_LIST',\n UPDATE_LIST = 'UPDATE_LIST',\n DELETE_LIST = 'DELETE_LIST',\n CREATE_PAGE = 'CREATE_PAGE',\n UPDATE_PAGE_FIELDS = 'UPDATE_PAGE_FIELDS',\n DELETE_PAGE = 'DELETE_PAGE',\n REPOSITION_SUMMARY = 'REPOSITION_SUMMARY',\n CREATE_SECTION = 'CREATE_SECTION',\n DELETE_SECTION = 'DELETE_SECTION',\n RENAME_SECTION = 'RENAME_SECTION',\n ASSIGN_SECTIONS = 'ASSIGN_SECTIONS',\n UNASSIGN_SECTIONS = 'UNASSIGN_SECTIONS',\n UPDATE_OPTION = 'UPDATE_OPTION'\n}\n"],"mappings":"AAAA,WAAYA,8BAA8B,0BAA9BA,8BAA8B;EAA9BA,8BAA8B,CAA9BA,8BAA8B;EAAA,OAA9BA,8BAA8B;AAAA;AAI1C,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAOrC,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AAOnC,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAC/B;EADUA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAkC/B;EAlCUA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAuC/B;EAvCUA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EA6C/B;EA7CUA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAiDjC,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-audit/types.ts"],"sourcesContent":["import {\n type AuditEventMessageCategory,\n type AuditEventMessageSchemaVersion,\n type AuditEventMessageSource,\n type AuditEventMessageType,\n type FormDefinitionRequestType\n} from '~/src/form/form-audit/enums.js'\nimport { type FormMetadataContact } from '~/src/form/form-metadata/types.js'\n\nexport interface FormMessageDataBase {\n formId: string\n slug: string\n payload?: unknown\n}\n\nexport interface ChangesMessageData<T> {\n previous: T\n new: T\n}\n\nexport interface FormCreatedMessageData extends FormMessageDataBase {\n title: string\n organisation: string\n teamName: string\n teamEmail: string\n}\n\nexport interface FormTitleChanges {\n title: string\n}\n\nexport interface FormOrganisationChanges {\n organisation: string\n}\n\nexport interface FormTeamNameChanges {\n teamName: string\n}\n\nexport interface FormTeamEmailChanges {\n teamEmail: string\n}\n\nexport interface FormSupportContactChanges {\n contact?: FormMetadataContact\n}\n\nexport interface FormSupportPhoneChanges {\n phone?: string\n}\n\nexport interface FormSupportEmailChanges {\n address?: string\n responseTime?: string\n}\n\nexport interface FormSupportOnlineChanges {\n url?: string\n text?: string\n}\n\nexport interface FormPrivacyNoticeChanges {\n privacyNoticeType?: string\n privacyNoticeText?: string\n privacyNoticeUrl?: string\n}\n\nexport interface FormTermsAndConditionsChanges {\n termsAndConditionsAgreed?: boolean\n}\n\nexport interface FormNotificationEmailChanges {\n notificationEmail?: string\n}\n\nexport interface FormSubmissionGuidanceChanges {\n submissionGuidance?: string\n}\n\nexport interface FormUploadedChanges {\n value: string\n}\n\nexport interface FormTitleUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTitleChanges>\n}\n\nexport interface FormOrganisationUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormOrganisationChanges>\n}\n\nexport interface FormTeamNameUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTeamNameChanges>\n}\n\nexport interface FormTeamEmailUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTeamEmailChanges>\n}\n\nexport interface FormSupportContactUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportContactChanges>\n}\n\nexport interface FormSupportPhoneUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportPhoneChanges>\n}\n\nexport interface FormSupportEmailUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportEmailChanges>\n}\n\nexport interface FormSupportOnlineUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportOnlineChanges>\n}\n\nexport interface FormPrivacyNoticeUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormPrivacyNoticeChanges>\n}\n\nexport interface FormTermsAndConditionsAgreedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTermsAndConditionsChanges>\n}\n\nexport interface FormNotificationEmailUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormNotificationEmailChanges>\n}\n\nexport interface FormSubmissionGuidanceUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSubmissionGuidanceChanges>\n}\n\nexport interface FormUploadedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormUploadedChanges>\n}\n\nexport interface FormFileDownloadedMessageData {\n fileId: string\n filename: string\n fileLink: string\n}\n\nexport interface ExcelGenerationMessageData {\n formId: string\n formName: string\n notificationEmail: string\n}\n\nexport interface FormSecretBaseMessageData extends FormMessageDataBase {\n formId: string\n slug: string\n secretName: string\n}\n\nexport interface FormDefinitionS3Meta {\n fileId: string\n filename: string\n s3Key: string\n}\n\nexport interface FormUpdatedMessageData extends FormMessageDataBase {\n requestType: FormDefinitionRequestType\n s3Meta?: FormDefinitionS3Meta\n}\n\nexport type FormMessageChangesData =\n | FormTitleUpdatedMessageData\n | FormOrganisationUpdatedMessageData\n | FormTeamNameUpdatedMessageData\n | FormTeamEmailUpdatedMessageData\n | FormSupportContactUpdatedMessageData\n | FormSupportPhoneUpdatedMessageData\n | FormSupportEmailUpdatedMessageData\n | FormSupportOnlineUpdatedMessageData\n | FormPrivacyNoticeUpdatedMessageData\n | FormTermsAndConditionsAgreedMessageData\n | FormNotificationEmailUpdatedMessageData\n | FormSubmissionGuidanceUpdatedMessageData\n | FormUploadedMessageData\n\nexport type FormMessageActivitiesData =\n | FormCreatedMessageData\n | FormMessageDataBase\n | FormFileDownloadedMessageData\n\nexport interface EntitlementMessageData {\n userId: string\n displayName: string\n email: string\n roles: string[]\n}\n\nexport interface AuthenticationMessageData {\n userId: string\n displayName: string\n}\n\nexport interface AuditUser {\n id: string\n displayName: string\n}\n\nexport interface FormsBackupRequestedMessageData {\n totalForms: number\n durationMs: number\n}\n\nexport interface DlqActionMessageData {\n action: string\n messageId?: string\n beforeJson?: string\n afterJson?: string\n}\n\nexport type MessageData =\n | FormMessageChangesData\n | FormMessageActivitiesData\n | FormUpdatedMessageData\n | EntitlementMessageData\n | AuthenticationMessageData\n | ExcelGenerationMessageData\n | FormFileDownloadedMessageData\n | FormsBackupRequestedMessageData\n | FormSecretBaseMessageData\n | DlqActionMessageData\n\nexport interface MessageBase {\n schemaVersion: AuditEventMessageSchemaVersion\n category: AuditEventMessageCategory\n source: AuditEventMessageSource\n type: AuditEventMessageType\n entityId: string\n traceId?: string\n createdAt: Date\n createdBy: AuditUser\n data?: MessageData\n messageCreatedAt: Date\n}\n\nexport interface ManagerMessageBase extends MessageBase {\n source: AuditEventMessageSource.FORMS_MANAGER\n}\nexport interface DesignerMessageBase extends MessageBase {\n source: AuditEventMessageSource.FORMS_DESIGNER\n}\n\nexport interface EntitlementMessageBase extends MessageBase {\n source: AuditEventMessageSource.ENTITLEMENT\n}\n\nexport interface AuthenticationMessageBase extends MessageBase {\n source: AuditEventMessageSource.AUTHENTICATION\n}\n\nexport interface FormCreatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_CREATED\n data: FormCreatedMessageData\n}\n\nexport interface FormTitleUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TITLE_UPDATED\n data: FormTitleUpdatedMessageData\n}\n\nexport interface FormOrganisationUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_ORGANISATION_UPDATED\n data: FormOrganisationUpdatedMessageData\n}\n\nexport interface FormTeamNameUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TEAM_NAME_UPDATED\n data: FormTeamNameUpdatedMessageData\n}\n\nexport interface FormTeamEmailUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED\n data: FormTeamEmailUpdatedMessageData\n}\n\nexport interface FormSupportContactUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_CONTACT_UPDATED\n data: FormSupportContactUpdatedMessageData\n}\n\nexport interface FormSupportPhoneUpdatedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED\n data: FormSupportPhoneUpdatedMessageData\n}\n\nexport interface FormSupportEmailUpdatedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED\n data: FormSupportEmailUpdatedMessageData\n}\n\nexport interface FormSupportOnlineUpdatedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED\n data: FormSupportOnlineUpdatedMessageData\n}\n\nexport interface FormPrivacyNoticeUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormPrivacyNoticeUpdatedMessageData\n}\n\nexport interface FormTermsAndConditionsAgreedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TERMS_AND_CONDITIONS_AGREED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormTermsAndConditionsAgreedMessageData\n}\n\nexport interface FormNotificationEmailUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormNotificationEmailUpdatedMessageData\n}\n\nexport interface FormSubmissionGuidanceUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormSubmissionGuidanceUpdatedMessageData\n}\n\nexport interface FormUploadedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_JSON_UPLOADED\n data: FormUploadedMessageData\n}\n\nexport interface FormDownloadedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_JSON_DOWNLOADED\n data: FormMessageDataBase\n}\n\nexport interface FormFileDownloadSuccessMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_FILE_DOWNLOAD_SUCCESS\n data: FormFileDownloadedMessageData\n}\n\nexport interface FormFileDownloadFailureMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_FILE_DOWNLOAD_FAILURE\n data: FormFileDownloadedMessageData\n}\n\nexport interface FormDraftCreatedFromLiveMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE\n}\n\nexport interface FormLiveCreatedFromDraftMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT\n}\n\nexport interface FormDraftDeletedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_DELETED\n}\n\nexport interface FormMigratedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_MIGRATED\n}\n\nexport interface FormUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_UPDATED\n data: FormUpdatedMessageData\n}\n\nexport interface EntitlementCreatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_CREATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementUpdatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_UPDATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementDeletedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_DELETED\n data: EntitlementMessageData\n}\n\nexport interface AuthenticationLoginMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGIN\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutManualMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_MANUAL\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutAutoMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_AUTO\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutDifferentDeviceMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE\n data: AuthenticationMessageData\n}\n\nexport interface FormSubmissionExcelRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED\n data: ExcelGenerationMessageData\n}\n\nexport interface FormCsatExcelRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED\n data: ExcelGenerationMessageData\n}\n\nexport interface PlatformCsatExcelRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.PLATFORM_CSAT_EXCEL_REQUESTED\n data: ExcelGenerationMessageData\n}\n\nexport interface PlatformMetricsDownloadRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.PLATFORM_METRICS_DOWNLOAD_REQUESTED\n}\n\nexport interface FormsBackupRequestedMessage extends DesignerMessageBase {\n type: AuditEventMessageType.FORMS_BACKUP_REQUESTED\n data: FormsBackupRequestedMessageData\n}\n\nexport interface DlqActionMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.OPERATIONS\n type: AuditEventMessageType.DLQ_ACTION\n data: DlqActionMessageData\n}\n\nexport interface FormSecretDeletedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SECRET_DELETED\n data: FormSecretBaseMessageData\n}\n\nexport interface FormSecretSavedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SECRET_SAVED\n data: FormSecretBaseMessageData\n}\n\nexport type AuditMessage =\n | FormCreatedMessage\n | FormTitleUpdatedMessage\n | FormOrganisationUpdatedMessage\n | FormTeamNameUpdatedMessage\n | FormTeamEmailUpdatedMessage\n | FormSupportContactUpdatedMessage\n | FormSupportPhoneUpdatedMessage\n | FormSupportEmailUpdatedMessage\n | FormSupportOnlineUpdatedMessage\n | FormPrivacyNoticeUpdatedMessage\n | FormTermsAndConditionsAgreedMessage\n | FormNotificationEmailUpdatedMessage\n | FormSubmissionGuidanceUpdatedMessage\n | FormUploadedMessage\n | FormDownloadedMessage\n | FormFileDownloadSuccessMessage\n | FormFileDownloadFailureMessage\n | FormDraftCreatedFromLiveMessage\n | FormLiveCreatedFromDraftMessage\n | FormDraftDeletedMessage\n | FormMigratedMessage\n | FormUpdatedMessage\n | EntitlementCreatedMessage\n | EntitlementUpdatedMessage\n | EntitlementDeletedMessage\n | AuthenticationLoginMessage\n | AuthenticationLogoutManualMessage\n | AuthenticationLogoutAutoMessage\n | AuthenticationLogoutDifferentDeviceMessage\n | FormSubmissionExcelRequestedMessage\n | FormCsatExcelRequestedMessage\n | PlatformCsatExcelRequestedMessage\n | PlatformMetricsDownloadRequestedMessage\n | FormsBackupRequestedMessage\n | FormSecretDeletedMessage\n | FormSecretSavedMessage\n | DlqActionMessage\n\nexport interface AuditEvent {\n message: AuditMessage\n}\n\nexport interface AuditMetaBase {\n messageId: string\n recordCreatedAt: Date\n}\n\nexport interface AuditInputMeta extends AuditMetaBase {\n id: string\n}\n\nexport type AuditRecordInput = AuditMessage & AuditMetaBase\n\nexport type AuditRecord = AuditMessage & AuditInputMeta\n\nexport interface MessageBody {\n Message: string\n}\n\n/**\n * Consolidated audit record that represents multiple grouped events.\n * Combines AuditRecord with consolidation metadata.\n */\nexport type ConsolidatedAuditRecord = AuditRecord & {\n /** Number of events consolidated into this record */\n consolidatedCount: number\n /** Timestamp of the earliest event in the group */\n consolidatedFrom: Date\n /** Timestamp of the latest event in the group */\n consolidatedTo: Date\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-audit/types.ts"],"sourcesContent":["import {\n type AuditEventMessageCategory,\n type AuditEventMessageSchemaVersion,\n type AuditEventMessageSource,\n type AuditEventMessageType,\n type FormDefinitionRequestType\n} from '~/src/form/form-audit/enums.js'\nimport { type FormMetadataContact } from '~/src/form/form-metadata/types.js'\n\nexport interface FormMessageDataBase {\n formId: string\n slug: string\n payload?: unknown\n}\n\nexport interface ChangesMessageData<T> {\n previous: T\n new: T\n}\n\nexport interface FormCreatedMessageData extends FormMessageDataBase {\n title: string\n organisation: string\n teamName: string\n teamEmail: string\n}\n\nexport interface FormTitleChanges {\n title: string\n}\n\nexport interface FormOrganisationChanges {\n organisation: string\n}\n\nexport interface FormTeamNameChanges {\n teamName: string\n}\n\nexport interface FormTeamEmailChanges {\n teamEmail: string\n}\n\nexport interface FormSupportContactChanges {\n contact?: FormMetadataContact\n}\n\nexport interface FormSupportPhoneChanges {\n phone?: string\n}\n\nexport interface FormSupportEmailChanges {\n address?: string\n responseTime?: string\n}\n\nexport interface FormSupportOnlineChanges {\n url?: string\n text?: string\n}\n\nexport interface FormPrivacyNoticeChanges {\n privacyNoticeType?: string\n privacyNoticeText?: string\n privacyNoticeUrl?: string\n}\n\nexport interface FormTermsAndConditionsChanges {\n termsAndConditionsAgreed?: boolean\n}\n\nexport interface FormNotificationEmailChanges {\n notificationEmail?: string\n}\n\nexport interface FormSubmissionGuidanceChanges {\n submissionGuidance?: string\n}\n\nexport interface FormUploadedChanges {\n value: string\n}\n\nexport interface FormTitleUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTitleChanges>\n}\n\nexport interface FormOrganisationUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormOrganisationChanges>\n}\n\nexport interface FormTeamNameUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTeamNameChanges>\n}\n\nexport interface FormTeamEmailUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTeamEmailChanges>\n}\n\nexport interface FormSupportContactUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportContactChanges>\n}\n\nexport interface FormSupportPhoneUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportPhoneChanges>\n}\n\nexport interface FormSupportEmailUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportEmailChanges>\n}\n\nexport interface FormSupportOnlineUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportOnlineChanges>\n}\n\nexport interface FormPrivacyNoticeUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormPrivacyNoticeChanges>\n}\n\nexport interface FormTermsAndConditionsAgreedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTermsAndConditionsChanges>\n}\n\nexport interface FormNotificationEmailUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormNotificationEmailChanges>\n}\n\nexport interface FormSubmissionGuidanceUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormSubmissionGuidanceChanges>\n}\n\nexport interface FormUploadedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormUploadedChanges>\n}\n\nexport interface FormFileDownloadedMessageData {\n fileId: string\n filename: string\n fileLink: string\n}\n\nexport interface ExcelGenerationMessageData {\n formId: string\n formName: string\n notificationEmail: string\n}\n\nexport interface FormSecretBaseMessageData extends FormMessageDataBase {\n formId: string\n slug: string\n secretName: string\n}\n\nexport interface FormDefinitionS3Meta {\n fileId: string\n filename: string\n s3Key: string\n}\n\nexport interface FormUpdatedMessageData extends FormMessageDataBase {\n requestType: FormDefinitionRequestType\n s3Meta?: FormDefinitionS3Meta\n}\n\nexport type FormMessageChangesData =\n | FormTitleUpdatedMessageData\n | FormOrganisationUpdatedMessageData\n | FormTeamNameUpdatedMessageData\n | FormTeamEmailUpdatedMessageData\n | FormSupportContactUpdatedMessageData\n | FormSupportPhoneUpdatedMessageData\n | FormSupportEmailUpdatedMessageData\n | FormSupportOnlineUpdatedMessageData\n | FormPrivacyNoticeUpdatedMessageData\n | FormTermsAndConditionsAgreedMessageData\n | FormNotificationEmailUpdatedMessageData\n | FormSubmissionGuidanceUpdatedMessageData\n | FormUploadedMessageData\n\nexport type FormMessageActivitiesData =\n | FormCreatedMessageData\n | FormMessageDataBase\n | FormFileDownloadedMessageData\n\nexport interface EntitlementMessageData {\n userId: string\n displayName: string\n email: string\n roles: string[]\n}\n\nexport interface AuthenticationMessageData {\n userId: string\n displayName: string\n}\n\nexport interface AuditUser {\n id: string\n displayName: string\n}\n\nexport interface FormsBackupRequestedMessageData {\n totalForms: number\n durationMs: number\n}\n\nexport interface DlqActionMessageData {\n action: string\n messageId?: string\n beforeJson?: string\n afterJson?: string\n}\n\nexport type MessageData =\n | FormMessageChangesData\n | FormMessageActivitiesData\n | FormUpdatedMessageData\n | EntitlementMessageData\n | AuthenticationMessageData\n | ExcelGenerationMessageData\n | FormFileDownloadedMessageData\n | FormsBackupRequestedMessageData\n | FormSecretBaseMessageData\n | DlqActionMessageData\n\nexport interface MessageBase {\n schemaVersion: AuditEventMessageSchemaVersion\n category: AuditEventMessageCategory\n source: AuditEventMessageSource\n type: AuditEventMessageType\n entityId: string\n traceId?: string\n createdAt: Date\n createdBy: AuditUser\n data?: MessageData\n messageCreatedAt: Date\n}\n\nexport interface ManagerMessageBase extends MessageBase {\n source: AuditEventMessageSource.FORMS_MANAGER\n}\nexport interface DesignerMessageBase extends MessageBase {\n source: AuditEventMessageSource.FORMS_DESIGNER\n}\n\nexport interface EntitlementMessageBase extends MessageBase {\n source: AuditEventMessageSource.ENTITLEMENT\n}\n\nexport interface AuthenticationMessageBase extends MessageBase {\n source: AuditEventMessageSource.AUTHENTICATION\n}\n\nexport interface FormCreatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_CREATED\n data: FormCreatedMessageData\n}\n\nexport interface FormTitleUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TITLE_UPDATED\n data: FormTitleUpdatedMessageData\n}\n\nexport interface FormOrganisationUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_ORGANISATION_UPDATED\n data: FormOrganisationUpdatedMessageData\n}\n\nexport interface FormTeamNameUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TEAM_NAME_UPDATED\n data: FormTeamNameUpdatedMessageData\n}\n\nexport interface FormTeamEmailUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED\n data: FormTeamEmailUpdatedMessageData\n}\n\nexport interface FormSupportContactUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_CONTACT_UPDATED\n data: FormSupportContactUpdatedMessageData\n}\n\nexport interface FormSupportPhoneUpdatedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED\n data: FormSupportPhoneUpdatedMessageData\n}\n\nexport interface FormSupportEmailUpdatedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED\n data: FormSupportEmailUpdatedMessageData\n}\n\nexport interface FormSupportOnlineUpdatedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED\n data: FormSupportOnlineUpdatedMessageData\n}\n\nexport interface FormPrivacyNoticeUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormPrivacyNoticeUpdatedMessageData\n}\n\nexport interface FormTermsAndConditionsAgreedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TERMS_AND_CONDITIONS_AGREED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormTermsAndConditionsAgreedMessageData\n}\n\nexport interface FormNotificationEmailUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormNotificationEmailUpdatedMessageData\n}\n\nexport interface FormSubmissionGuidanceUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormSubmissionGuidanceUpdatedMessageData\n}\n\nexport interface FormUploadedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_JSON_UPLOADED\n data: FormUploadedMessageData\n}\n\nexport interface FormDownloadedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_JSON_DOWNLOADED\n data: FormMessageDataBase\n}\n\nexport interface FormFileDownloadSuccessMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_FILE_DOWNLOAD_SUCCESS\n data: FormFileDownloadedMessageData\n}\n\nexport interface FormFileDownloadFailureMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_FILE_DOWNLOAD_FAILURE\n data: FormFileDownloadedMessageData\n}\n\nexport interface FormDraftCreatedFromLiveMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE\n}\n\nexport interface FormLiveCreatedFromDraftMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT\n}\n\nexport interface FormDraftDeletedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_DELETED\n}\n\nexport interface FormMigratedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_MIGRATED\n}\n\nexport interface FormUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_UPDATED\n data: FormUpdatedMessageData\n}\n\nexport interface FormTakenOfflineMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_TAKEN_OFFLINE\n}\n\nexport interface FormMadeOnlineAgainMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_MADE_ONLINE_AGAIN\n}\n\nexport interface EntitlementCreatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_CREATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementUpdatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_UPDATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementDeletedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_DELETED\n data: EntitlementMessageData\n}\n\nexport interface AuthenticationLoginMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGIN\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutManualMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_MANUAL\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutAutoMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_AUTO\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutDifferentDeviceMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE\n data: AuthenticationMessageData\n}\n\nexport interface FormSubmissionExcelRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED\n data: ExcelGenerationMessageData\n}\n\nexport interface FormCsatExcelRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED\n data: ExcelGenerationMessageData\n}\n\nexport interface PlatformCsatExcelRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.PLATFORM_CSAT_EXCEL_REQUESTED\n data: ExcelGenerationMessageData\n}\n\nexport interface PlatformMetricsDownloadRequestedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.PLATFORM_METRICS_DOWNLOAD_REQUESTED\n}\n\nexport interface FormsBackupRequestedMessage extends DesignerMessageBase {\n type: AuditEventMessageType.FORMS_BACKUP_REQUESTED\n data: FormsBackupRequestedMessageData\n}\n\nexport interface DlqActionMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.OPERATIONS\n type: AuditEventMessageType.DLQ_ACTION\n data: DlqActionMessageData\n}\n\nexport interface FormSecretDeletedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SECRET_DELETED\n data: FormSecretBaseMessageData\n}\n\nexport interface FormSecretSavedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SECRET_SAVED\n data: FormSecretBaseMessageData\n}\n\nexport type AuditMessage =\n | FormCreatedMessage\n | FormTitleUpdatedMessage\n | FormOrganisationUpdatedMessage\n | FormTeamNameUpdatedMessage\n | FormTeamEmailUpdatedMessage\n | FormSupportContactUpdatedMessage\n | FormSupportPhoneUpdatedMessage\n | FormSupportEmailUpdatedMessage\n | FormSupportOnlineUpdatedMessage\n | FormPrivacyNoticeUpdatedMessage\n | FormTermsAndConditionsAgreedMessage\n | FormNotificationEmailUpdatedMessage\n | FormSubmissionGuidanceUpdatedMessage\n | FormUploadedMessage\n | FormDownloadedMessage\n | FormFileDownloadSuccessMessage\n | FormFileDownloadFailureMessage\n | FormDraftCreatedFromLiveMessage\n | FormLiveCreatedFromDraftMessage\n | FormDraftDeletedMessage\n | FormMigratedMessage\n | FormUpdatedMessage\n | FormTakenOfflineMessage\n | FormMadeOnlineAgainMessage\n | EntitlementCreatedMessage\n | EntitlementUpdatedMessage\n | EntitlementDeletedMessage\n | AuthenticationLoginMessage\n | AuthenticationLogoutManualMessage\n | AuthenticationLogoutAutoMessage\n | AuthenticationLogoutDifferentDeviceMessage\n | FormSubmissionExcelRequestedMessage\n | FormCsatExcelRequestedMessage\n | PlatformCsatExcelRequestedMessage\n | PlatformMetricsDownloadRequestedMessage\n | FormsBackupRequestedMessage\n | FormSecretDeletedMessage\n | FormSecretSavedMessage\n | DlqActionMessage\n\nexport interface AuditEvent {\n message: AuditMessage\n}\n\nexport interface AuditMetaBase {\n messageId: string\n recordCreatedAt: Date\n}\n\nexport interface AuditInputMeta extends AuditMetaBase {\n id: string\n}\n\nexport type AuditRecordInput = AuditMessage & AuditMetaBase\n\nexport type AuditRecord = AuditMessage & AuditInputMeta\n\nexport interface MessageBody {\n Message: string\n}\n\n/**\n * Consolidated audit record that represents multiple grouped events.\n * Combines AuditRecord with consolidation metadata.\n */\nexport type ConsolidatedAuditRecord = AuditRecord & {\n /** Number of events consolidated into this record */\n consolidatedCount: number\n /** Timestamp of the earliest event in the group */\n consolidatedFrom: Date\n /** Timestamp of the latest event in the group */\n consolidatedTo: Date\n}\n"],"mappings":"","ignoreList":[]}
@@ -85,6 +85,11 @@ export class QuestionPreviewElements {
85
85
  * @protected
86
86
  */
87
87
  _shortDesc = '';
88
+ /**
89
+ * @type {string}
90
+ * @protected
91
+ */
92
+ _errorDesc = '';
88
93
  /**
89
94
  * @type {string}
90
95
  * @protected
@@ -133,6 +138,7 @@ export class QuestionPreviewElements {
133
138
  hintText: this._hintText,
134
139
  optional: this._optional,
135
140
  shortDesc: this._shortDesc,
141
+ errorDesc: this._errorDesc,
136
142
  userClasses: this._userClasses,
137
143
  items: this._items,
138
144
  content: this._content
@@ -312,6 +318,7 @@ export const baseElements = /** @type {BaseSettings} */{
312
318
  hintText: 'Choose one adventure that best suits you.',
313
319
  userClasses: '',
314
320
  shortDesc: '',
321
+ errorDesc: '',
315
322
  content: '',
316
323
  largeTitle: true
317
324
  };
@@ -322,6 +329,7 @@ export const numberElements = /** @type {NumberSettings} */{
322
329
  hintText: 'Choose one adventure that best suits you.',
323
330
  userClasses: '',
324
331
  shortDesc: '',
332
+ errorDesc: '',
325
333
  content: '',
326
334
  largeTitle: true,
327
335
  prefix: '',
@@ -396,6 +404,11 @@ export class NumberPreviewElements {
396
404
  * @protected
397
405
  */
398
406
  _shortDesc = '';
407
+ /**
408
+ * @type {string}
409
+ * @protected
410
+ */
411
+ _errorDesc = '';
399
412
  /**
400
413
  * @type {string}
401
414
  * @protected
@@ -458,6 +471,7 @@ export class NumberPreviewElements {
458
471
  hintText: this._hintText,
459
472
  optional: this._optional,
460
473
  shortDesc: this._shortDesc,
474
+ errorDesc: this._errorDesc,
461
475
  userClasses: this._userClasses,
462
476
  prefix: this._prefix,
463
477
  suffix: this._suffix,
@@ -1 +1 @@
1
- {"version":3,"file":"preview.js","names":["Question","QuestionRendererStub","renderMock","constructor","render","questionTemplate","questionBaseModel","buildHTML","_questionTemplate","_renderContext","PageRendererStub","pageTemplate","pagePreviewPanelMacro","QuestionPreviewElements","_question","_hintText","_optional","_shortDesc","_userClasses","_content","_items","afterInputsHTML","question","hintText","optional","shortDesc","userClasses","items","content","values","setPreviewHTML","_value","setPreviewDOM","AutocompletePreviewElements","autocompleteOptions","elements","UkAddressPreviewElements","usePostcodeLookup","_usePostcodeLookup","DeclarationPreviewElements","declarationText","_declarationText","LocationPreviewElements","instructionText","_instructionText","PaymentPreviewElements","paymentAmount","paymentDescription","paymentConditionalAmounts","_paymentAmount","_paymentDescription","_paymentConditionalAmounts","PagePreviewElements","guidance","heading","addHeading","repeatQuestion","hasRepeater","length","baseElements","largeTitle","numberElements","prefix","suffix","list1Id","list2Id","list3Id","list4Id","listElementsBase","label","text","value","id","listElementsStub","buildPreviewShortAnswer","partialBaseElements","NumberPreviewElements","_prefix","_suffix"],"sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionRenderer}\n */\nexport class QuestionRendererStub {\n /**\n * @type {jest.Mock<void, [string, QuestionBaseModel]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} questionTemplate\n * @param {QuestionBaseModel} questionBaseModel\n */\n render(questionTemplate, questionBaseModel) {\n this.renderMock(questionTemplate, questionBaseModel)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {PageRenderer}\n */\nexport class PageRendererStub {\n /**\n * @type {jest.Mock<void, [string, PagePreviewPanelMacro]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, PagePreviewPanelMacro]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} pageTemplate\n * @param {PagePreviewPanelMacro} pagePreviewPanelMacro\n */\n render(pageTemplate, pagePreviewPanelMacro) {\n this.renderMock(pageTemplate, pagePreviewPanelMacro)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {ListElements}\n */\nexport class QuestionPreviewElements {\n /**\n * @protected\n */\n _question = ''\n /** @protected */\n _hintText = ''\n /** @protected */\n _optional = false\n /**\n * @type {string}\n * @protected\n */\n _shortDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _userClasses = ''\n /**\n * @type {string}\n * @protected\n */\n _content = ''\n /**\n *\n * @type {ListElement[]}\n * @private\n */\n _items = []\n afterInputsHTML = '<div class=\"govuk-inset-text\">No items added yet.</div>'\n\n /**\n * @param {BaseSettings} baseSettings\n */\n constructor({\n question,\n hintText,\n optional,\n shortDesc,\n userClasses,\n items,\n content\n }) {\n this._question = question\n this._hintText = hintText\n this._optional = optional\n this._shortDesc = shortDesc\n this._userClasses = userClasses\n this._items = items\n this._content = content\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n return {\n question: this._question,\n hintText: this._hintText,\n optional: this._optional,\n shortDesc: this._shortDesc,\n userClasses: this._userClasses,\n items: this._items,\n content: this._content\n }\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n // Not implemented for server side render\n }\n\n /**\n * @param {HTMLElement} _value\n */\n setPreviewDOM(_value) {\n // Not implemented for server side render\n }\n}\n\n/**\n * @implements {AutocompleteElements}\n */\nexport class AutocompletePreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {autocompleteOptions: string}} elements\n */\n constructor({ autocompleteOptions, ...elements }) {\n super(elements)\n this.autocompleteOptions = autocompleteOptions\n }\n}\n\n/**\n * @implements {UkAddressElements}\n */\nexport class UkAddressPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {usePostcodeLookup?: boolean}} elements\n */\n constructor({ usePostcodeLookup, ...elements }) {\n super(elements)\n this._usePostcodeLookup = usePostcodeLookup ?? false\n }\n\n /**\n * @returns {UkAddressSettings}\n */\n get values() {\n return {\n ...super.values,\n usePostcodeLookup: this._usePostcodeLookup\n }\n }\n}\n\n/**\n * @implements {DeclarationElements}\n */\nexport class DeclarationPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {declarationText: string}} elements\n */\n constructor({ declarationText, ...elements }) {\n super(elements)\n this._declarationText = declarationText\n }\n\n /**\n * @returns {DeclarationSettings}\n */\n get values() {\n return {\n ...super.values,\n declarationText: this._declarationText\n }\n }\n}\n\n/**\n * @implements {LocationElements}\n */\nexport class LocationPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {instructionText?: string}} elements\n */\n constructor({ instructionText, ...elements }) {\n super(elements)\n this._instructionText = instructionText ?? ''\n }\n\n /**\n * @returns {LocationSettings}\n */\n get values() {\n return {\n ...super.values,\n instructionText: this._instructionText\n }\n }\n}\n\n/**\n * @implements {PaymentElements}\n */\nexport class PaymentPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {paymentAmount: number, paymentDescription: string, paymentConditionalAmounts?: Array<{ amount: number, condition: string }>}} elements\n */\n constructor({\n paymentAmount,\n paymentDescription,\n paymentConditionalAmounts,\n ...elements\n }) {\n super(elements)\n this._paymentAmount = paymentAmount\n this._paymentDescription = paymentDescription\n this._paymentConditionalAmounts = paymentConditionalAmounts ?? []\n }\n\n /**\n * @returns {PaymentSettings}\n */\n get values() {\n return {\n ...super.values,\n paymentAmount: this._paymentAmount,\n paymentDescription: this._paymentDescription,\n paymentConditionalAmounts: this._paymentConditionalAmounts\n }\n }\n}\n\n/**\n * @implements {PageOverviewElements}\n */\nexport class PagePreviewElements {\n guidance\n heading\n addHeading\n repeatQuestion\n hasRepeater\n\n /**\n * @param {string} heading\n * @param {string} guidance\n * @param {boolean} [addHeading]\n * @param {string} repeatQuestion\n * @param {boolean} hasRepeater\n */\n constructor(\n heading,\n guidance = '',\n addHeading,\n repeatQuestion = '',\n hasRepeater = false\n ) {\n this.heading = heading\n this.guidance = guidance\n this.addHeading = addHeading ?? heading.length > 0\n this.repeatQuestion = repeatQuestion\n this.hasRepeater = hasRepeater\n }\n}\n\nexport const baseElements = /** @type {BaseSettings} */ ({\n items: [],\n optional: false,\n question: 'Which quest would you like to pick?',\n hintText: 'Choose one adventure that best suits you.',\n userClasses: '',\n shortDesc: '',\n content: '',\n largeTitle: true\n})\n\nexport const numberElements = /** @type {NumberSettings} */ ({\n items: [],\n optional: false,\n question: 'Which quest would you like to pick?',\n hintText: 'Choose one adventure that best suits you.',\n userClasses: '',\n shortDesc: '',\n content: '',\n largeTitle: true,\n prefix: '',\n suffix: ''\n})\n\nconst list1Id = '414d82a3-4cab-416a-bd54-6b86fbd51120'\nconst list2Id = '801385a4-81e6-4171-96c3-6c6727d97f22'\nconst list3Id = 'e6e3f621-b875-4ca3-a054-cca9149149dd'\nconst list4Id = 'd71b3909-582f-4e90-b6f5-490b89a6eb8f'\n\nconst listElementsBase = /** @type {BaseSettings} */ ({\n ...baseElements,\n items: [\n {\n label: { text: 'Treasure Hunting' },\n text: 'Treasure Hunting',\n value: 'Treasure Hunting',\n id: list1Id\n },\n {\n label: { text: 'Rescuing the princess' },\n text: 'Rescuing the princess',\n value: 'Rescuing the princess',\n id: list2Id\n },\n {\n label: { text: 'Saving a city' },\n text: 'Saving a city',\n value: 'Saving a city',\n id: list3Id\n },\n {\n label: { text: 'Defeating the baron' },\n text: 'Defeating the baron',\n value: 'Defeating the baron',\n id: list4Id\n }\n ]\n})\n\nexport const listElementsStub = {\n list1Id,\n list2Id,\n list3Id,\n list4Id,\n baseElements: listElementsBase\n}\n\n/**\n * @param {Partial<BaseSettings>} partialBaseElements\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n * @returns {Question}\n */\nexport function buildPreviewShortAnswer(partialBaseElements, renderMock) {\n return new Question(\n new QuestionPreviewElements({\n ...baseElements,\n ...partialBaseElements\n }),\n new QuestionRendererStub(renderMock)\n )\n}\n\nexport class NumberPreviewElements {\n /**\n * @protected\n */\n _question = ''\n /** @protected */\n _hintText = ''\n /** @protected */\n _optional = false\n /**\n * @type {string}\n * @protected\n */\n _shortDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _userClasses = ''\n /**\n * @type {string}\n * @protected\n */\n _prefix = ''\n /**\n * @type {string}\n * @protected\n */\n _suffix = ''\n /**\n * @type {string}\n * @protected\n */\n _content = ''\n /**\n *\n * @type {ListElement[]}\n * @private\n */\n _items = []\n afterInputsHTML = '<div class=\"govuk-inset-text\">No items added yet.</div>'\n\n /**\n * @param {NumberSettings} baseSettings\n */\n constructor({\n question,\n hintText,\n optional,\n shortDesc,\n userClasses,\n prefix,\n suffix,\n items,\n content\n }) {\n this._question = question\n this._hintText = hintText\n this._optional = optional\n this._shortDesc = shortDesc\n this._userClasses = userClasses\n this._prefix = prefix\n this._suffix = suffix\n this._items = items\n this._content = content\n }\n\n /**\n * @returns {NumberSettings}\n */\n get values() {\n return {\n question: this._question,\n hintText: this._hintText,\n optional: this._optional,\n shortDesc: this._shortDesc,\n userClasses: this._userClasses,\n prefix: this._prefix,\n suffix: this._suffix,\n items: this._items,\n content: this._content\n }\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n // Not implemented for server side render\n }\n\n /**\n * @param {HTMLElement} _value\n */\n setPreviewDOM(_value) {\n // Not implemented for server side render\n }\n}\n\n/**\n * @import { ListElement } from '~/src/form/form-editor/types.js'\n * @import { PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'\n * @import { BaseSettings, ListElements, NumberSettings, RenderContext, QuestionBaseModel, QuestionRenderer, AutocompleteElements, PageOverviewElements, PageRenderer, UkAddressElements, UkAddressSettings, DeclarationElements, DeclarationSettings, LocationElements, LocationSettings, PaymentElements, PaymentSettings } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,QAAQ;;AAEjB;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,CAAC;EAChC;AACF;AACA;EACEC,UAAU;;EAEV;AACF;AACA;EACEC,WAAWA,CAACD,UAAU,EAAE;IACtB,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;;EAEA;AACF;AACA;AACA;EACEE,MAAMA,CAACC,gBAAgB,EAAEC,iBAAiB,EAAE;IAC1C,IAAI,CAACJ,UAAU,CAACG,gBAAgB,EAAEC,iBAAiB,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,SAASA,CAACC,iBAAiB,EAAEC,cAAc,EAAE;IAClD,OAAO,sBAAsB;EAC/B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC5B;AACF;AACA;EACER,UAAU;;EAEV;AACF;AACA;EACEC,WAAWA,CAACD,UAAU,EAAE;IACtB,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;;EAEA;AACF;AACA;AACA;EACEE,MAAMA,CAACO,YAAY,EAAEC,qBAAqB,EAAE;IAC1C,IAAI,CAACV,UAAU,CAACS,YAAY,EAAEC,qBAAqB,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AAC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;IACzB,IAAI,CAACP,UAAU,GAAGQ,SAAS;IAC3B,IAAI,CAACP,YAAY,GAAGQ,WAAW;IAC/B,IAAI,CAACmD,OAAO,GAAGf,MAAM;IACrB,IAAI,CAACgB,OAAO,GAAGf,MAAM;IACrB,IAAI,CAAC3C,MAAM,GAAGO,KAAK;IACnB,IAAI,CAACR,QAAQ,GAAGS,OAAO;EACzB;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAG;IACX,OAAO;MACLP,QAAQ,EAAE,IAAI,CAACR,SAAS;MACxBS,QAAQ,EAAE,IAAI,CAACR,SAAS;MACxBS,QAAQ,EAAE,IAAI,CAACR,SAAS;MACxBS,SAAS,EAAE,IAAI,CAACR,UAAU;MAC1BS,WAAW,EAAE,IAAI,CAACR,YAAY;MAC9B4C,MAAM,EAAE,IAAI,CAACe,OAAO;MACpBd,MAAM,EAAE,IAAI,CAACe,OAAO;MACpBnD,KAAK,EAAE,IAAI,CAACP,MAAM;MAClBQ,OAAO,EAAE,IAAI,CAACT;IAChB,CAAC;EACH;;EAEA;AACF;AACA;EACEW,cAAcA,CAACC,MAAM,EAAE;IACrB;EAAA;;EAGF;AACF;AACA;EACEC,aAAaA,CAACD,MAAM,EAAE;IACpB;EAAA;AAEJ;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"preview.js","names":["Question","QuestionRendererStub","renderMock","constructor","render","questionTemplate","questionBaseModel","buildHTML","_questionTemplate","_renderContext","PageRendererStub","pageTemplate","pagePreviewPanelMacro","QuestionPreviewElements","_question","_hintText","_optional","_shortDesc","_errorDesc","_userClasses","_content","_items","afterInputsHTML","question","hintText","optional","shortDesc","userClasses","items","content","values","errorDesc","setPreviewHTML","_value","setPreviewDOM","AutocompletePreviewElements","autocompleteOptions","elements","UkAddressPreviewElements","usePostcodeLookup","_usePostcodeLookup","DeclarationPreviewElements","declarationText","_declarationText","LocationPreviewElements","instructionText","_instructionText","PaymentPreviewElements","paymentAmount","paymentDescription","paymentConditionalAmounts","_paymentAmount","_paymentDescription","_paymentConditionalAmounts","PagePreviewElements","guidance","heading","addHeading","repeatQuestion","hasRepeater","length","baseElements","largeTitle","numberElements","prefix","suffix","list1Id","list2Id","list3Id","list4Id","listElementsBase","label","text","value","id","listElementsStub","buildPreviewShortAnswer","partialBaseElements","NumberPreviewElements","_prefix","_suffix"],"sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\n/**\n * @implements {QuestionRenderer}\n */\nexport class QuestionRendererStub {\n /**\n * @type {jest.Mock<void, [string, QuestionBaseModel]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} questionTemplate\n * @param {QuestionBaseModel} questionBaseModel\n */\n render(questionTemplate, questionBaseModel) {\n this.renderMock(questionTemplate, questionBaseModel)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {PageRenderer}\n */\nexport class PageRendererStub {\n /**\n * @type {jest.Mock<void, [string, PagePreviewPanelMacro]>}\n */\n renderMock\n\n /**\n * @param {jest.Mock<void, [string, PagePreviewPanelMacro]>} renderMock\n */\n constructor(renderMock) {\n this.renderMock = renderMock\n }\n\n /**\n * @param {string} pageTemplate\n * @param {PagePreviewPanelMacro} pagePreviewPanelMacro\n */\n render(pageTemplate, pagePreviewPanelMacro) {\n this.renderMock(pageTemplate, pagePreviewPanelMacro)\n }\n\n /**\n * @returns {string}\n * @param {string} _questionTemplate\n * @param {RenderContext} _renderContext\n */\n static buildHTML(_questionTemplate, _renderContext) {\n return '**** BUILT HTML ****'\n }\n}\n\n/**\n * @implements {ListElements}\n */\nexport class QuestionPreviewElements {\n /**\n * @protected\n */\n _question = ''\n /** @protected */\n _hintText = ''\n /** @protected */\n _optional = false\n /**\n * @type {string}\n * @protected\n */\n _shortDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _errorDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _userClasses = ''\n /**\n * @type {string}\n * @protected\n */\n _content = ''\n /**\n *\n * @type {ListElement[]}\n * @private\n */\n _items = []\n afterInputsHTML = '<div class=\"govuk-inset-text\">No items added yet.</div>'\n\n /**\n * @param {BaseSettings} baseSettings\n */\n constructor({\n question,\n hintText,\n optional,\n shortDesc,\n userClasses,\n items,\n content\n }) {\n this._question = question\n this._hintText = hintText\n this._optional = optional\n this._shortDesc = shortDesc\n this._userClasses = userClasses\n this._items = items\n this._content = content\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n return {\n question: this._question,\n hintText: this._hintText,\n optional: this._optional,\n shortDesc: this._shortDesc,\n errorDesc: this._errorDesc,\n userClasses: this._userClasses,\n items: this._items,\n content: this._content\n }\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n // Not implemented for server side render\n }\n\n /**\n * @param {HTMLElement} _value\n */\n setPreviewDOM(_value) {\n // Not implemented for server side render\n }\n}\n\n/**\n * @implements {AutocompleteElements}\n */\nexport class AutocompletePreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {autocompleteOptions: string}} elements\n */\n constructor({ autocompleteOptions, ...elements }) {\n super(elements)\n this.autocompleteOptions = autocompleteOptions\n }\n}\n\n/**\n * @implements {UkAddressElements}\n */\nexport class UkAddressPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {usePostcodeLookup?: boolean}} elements\n */\n constructor({ usePostcodeLookup, ...elements }) {\n super(elements)\n this._usePostcodeLookup = usePostcodeLookup ?? false\n }\n\n /**\n * @returns {UkAddressSettings}\n */\n get values() {\n return {\n ...super.values,\n usePostcodeLookup: this._usePostcodeLookup\n }\n }\n}\n\n/**\n * @implements {DeclarationElements}\n */\nexport class DeclarationPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {declarationText: string}} elements\n */\n constructor({ declarationText, ...elements }) {\n super(elements)\n this._declarationText = declarationText\n }\n\n /**\n * @returns {DeclarationSettings}\n */\n get values() {\n return {\n ...super.values,\n declarationText: this._declarationText\n }\n }\n}\n\n/**\n * @implements {LocationElements}\n */\nexport class LocationPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {instructionText?: string}} elements\n */\n constructor({ instructionText, ...elements }) {\n super(elements)\n this._instructionText = instructionText ?? ''\n }\n\n /**\n * @returns {LocationSettings}\n */\n get values() {\n return {\n ...super.values,\n instructionText: this._instructionText\n }\n }\n}\n\n/**\n * @implements {PaymentElements}\n */\nexport class PaymentPreviewElements extends QuestionPreviewElements {\n /**\n * @param {BaseSettings & {paymentAmount: number, paymentDescription: string, paymentConditionalAmounts?: Array<{ amount: number, condition: string }>}} elements\n */\n constructor({\n paymentAmount,\n paymentDescription,\n paymentConditionalAmounts,\n ...elements\n }) {\n super(elements)\n this._paymentAmount = paymentAmount\n this._paymentDescription = paymentDescription\n this._paymentConditionalAmounts = paymentConditionalAmounts ?? []\n }\n\n /**\n * @returns {PaymentSettings}\n */\n get values() {\n return {\n ...super.values,\n paymentAmount: this._paymentAmount,\n paymentDescription: this._paymentDescription,\n paymentConditionalAmounts: this._paymentConditionalAmounts\n }\n }\n}\n\n/**\n * @implements {PageOverviewElements}\n */\nexport class PagePreviewElements {\n guidance\n heading\n addHeading\n repeatQuestion\n hasRepeater\n\n /**\n * @param {string} heading\n * @param {string} guidance\n * @param {boolean} [addHeading]\n * @param {string} repeatQuestion\n * @param {boolean} hasRepeater\n */\n constructor(\n heading,\n guidance = '',\n addHeading,\n repeatQuestion = '',\n hasRepeater = false\n ) {\n this.heading = heading\n this.guidance = guidance\n this.addHeading = addHeading ?? heading.length > 0\n this.repeatQuestion = repeatQuestion\n this.hasRepeater = hasRepeater\n }\n}\n\nexport const baseElements = /** @type {BaseSettings} */ ({\n items: [],\n optional: false,\n question: 'Which quest would you like to pick?',\n hintText: 'Choose one adventure that best suits you.',\n userClasses: '',\n shortDesc: '',\n errorDesc: '',\n content: '',\n largeTitle: true\n})\n\nexport const numberElements = /** @type {NumberSettings} */ ({\n items: [],\n optional: false,\n question: 'Which quest would you like to pick?',\n hintText: 'Choose one adventure that best suits you.',\n userClasses: '',\n shortDesc: '',\n errorDesc: '',\n content: '',\n largeTitle: true,\n prefix: '',\n suffix: ''\n})\n\nconst list1Id = '414d82a3-4cab-416a-bd54-6b86fbd51120'\nconst list2Id = '801385a4-81e6-4171-96c3-6c6727d97f22'\nconst list3Id = 'e6e3f621-b875-4ca3-a054-cca9149149dd'\nconst list4Id = 'd71b3909-582f-4e90-b6f5-490b89a6eb8f'\n\nconst listElementsBase = /** @type {BaseSettings} */ ({\n ...baseElements,\n items: [\n {\n label: { text: 'Treasure Hunting' },\n text: 'Treasure Hunting',\n value: 'Treasure Hunting',\n id: list1Id\n },\n {\n label: { text: 'Rescuing the princess' },\n text: 'Rescuing the princess',\n value: 'Rescuing the princess',\n id: list2Id\n },\n {\n label: { text: 'Saving a city' },\n text: 'Saving a city',\n value: 'Saving a city',\n id: list3Id\n },\n {\n label: { text: 'Defeating the baron' },\n text: 'Defeating the baron',\n value: 'Defeating the baron',\n id: list4Id\n }\n ]\n})\n\nexport const listElementsStub = {\n list1Id,\n list2Id,\n list3Id,\n list4Id,\n baseElements: listElementsBase\n}\n\n/**\n * @param {Partial<BaseSettings>} partialBaseElements\n * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock\n * @returns {Question}\n */\nexport function buildPreviewShortAnswer(partialBaseElements, renderMock) {\n return new Question(\n new QuestionPreviewElements({\n ...baseElements,\n ...partialBaseElements\n }),\n new QuestionRendererStub(renderMock)\n )\n}\n\nexport class NumberPreviewElements {\n /**\n * @protected\n */\n _question = ''\n /** @protected */\n _hintText = ''\n /** @protected */\n _optional = false\n /**\n * @type {string}\n * @protected\n */\n _shortDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _errorDesc = ''\n /**\n * @type {string}\n * @protected\n */\n _userClasses = ''\n /**\n * @type {string}\n * @protected\n */\n _prefix = ''\n /**\n * @type {string}\n * @protected\n */\n _suffix = ''\n /**\n * @type {string}\n * @protected\n */\n _content = ''\n /**\n *\n * @type {ListElement[]}\n * @private\n */\n _items = []\n afterInputsHTML = '<div class=\"govuk-inset-text\">No items added yet.</div>'\n\n /**\n * @param {NumberSettings} baseSettings\n */\n constructor({\n question,\n hintText,\n optional,\n shortDesc,\n userClasses,\n prefix,\n suffix,\n items,\n content\n }) {\n this._question = question\n this._hintText = hintText\n this._optional = optional\n this._shortDesc = shortDesc\n this._userClasses = userClasses\n this._prefix = prefix\n this._suffix = suffix\n this._items = items\n this._content = content\n }\n\n /**\n * @returns {NumberSettings}\n */\n get values() {\n return {\n question: this._question,\n hintText: this._hintText,\n optional: this._optional,\n shortDesc: this._shortDesc,\n errorDesc: this._errorDesc,\n userClasses: this._userClasses,\n prefix: this._prefix,\n suffix: this._suffix,\n items: this._items,\n content: this._content\n }\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n // Not implemented for server side render\n }\n\n /**\n * @param {HTMLElement} _value\n */\n setPreviewDOM(_value) {\n // Not implemented for server side render\n }\n}\n\n/**\n * @import { ListElement } from '~/src/form/form-editor/types.js'\n * @import { PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'\n * @import { BaseSettings, ListElements, NumberSettings, RenderContext, QuestionBaseModel, QuestionRenderer, AutocompleteElements, PageOverviewElements, PageRenderer, UkAddressElements, UkAddressSettings, DeclarationElements, DeclarationSettings, LocationElements, LocationSettings, PaymentElements, PaymentSettings } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,QAAQ;;AAEjB;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,CAAC;EAChC;AACF;AACA;EACEC,UAAU;;EAEV;AACF;AACA;EACEC,WAAWA,CAACD,UAAU,EAAE;IACtB,IAA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;MAC1Bc,SAAS,EAAE,IAAI,CAACb,UAAU;MAC1BS,WAAW,EAAE,IAAI,CAACR,YAAY;MAC9B6C,MAAM,EAAE,IAAI,CAACe,OAAO;MACpBd,MAAM,EAAE,IAAI,CAACe,OAAO;MACpBpD,KAAK,EAAE,IAAI,CAACP,MAAM;MAClBQ,OAAO,EAAE,IAAI,CAACT;IAChB,CAAC;EACH;;EAEA;AACF;AACA;EACEY,cAAcA,CAACC,MAAM,EAAE;IACrB;EAAA;;EAGF;AACF;AACA;EACEC,aAAaA,CAACD,MAAM,EAAE;IACpB;EAAA;AAEJ;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ export let FormLibraryActions = /*#__PURE__*/function (FormLibraryActions) {
2
+ FormLibraryActions["CREATE_DRAFT_FROM_LIVE"] = "create-draft-from-live";
3
+ FormLibraryActions["TAKE_FORM_OFFLINE"] = "take-form-offline";
4
+ FormLibraryActions["MAKE_ONLINE_AGAIN"] = "make-online-again";
5
+ return FormLibraryActions;
6
+ }({});
7
+ //# sourceMappingURL=enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","names":["FormLibraryActions"],"sources":["../../../../src/form/form-editor/enums.ts"],"sourcesContent":["export enum FormLibraryActions {\n CREATE_DRAFT_FROM_LIVE = 'create-draft-from-live',\n TAKE_FORM_OFFLINE = 'take-form-offline',\n MAKE_ONLINE_AGAIN = 'make-online-again'\n}\n"],"mappings":"AAAA,WAAYA,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA","ignoreList":[]}
@@ -46,6 +46,7 @@ export const radioTextSchema = Joi.string().trim().required().description('The v
46
46
  export const radioHintSchema = Joi.string().trim().optional().allow('').description('Optional hint text displayed with radio buttons to provide additional guidance');
47
47
  export const radioValueSchema = Joi.string().trim().optional().allow('').description('Array of allowed tabular data types. Can be provided as a single value or an array.');
48
48
  export const shortDescriptionSchema = Joi.string().custom(rtrimOnly).required().description('Brief description of the question for internal use');
49
+ export const errorDescriptionSchema = Joi.string().custom(rtrimOnly).allow('').optional().description('Description that will be displayed in error messages');
49
50
  export const pageHeadingAndGuidanceSchema = Joi.string().trim().optional().description('Combined heading and guidance for the page');
50
51
  export const pageHeadingSchema = Joi.string().trim().required().description('Main heading displayed at the top of the page');
51
52
  export const guidanceTextSchema = Joi.string().trim().description('Guidance text to assist users in completing the page');
@@ -232,6 +233,7 @@ export const questionDetailsFullSchema = {
232
233
  regexSchema,
233
234
  rowsSchema,
234
235
  shortDescriptionSchema,
236
+ errorDescriptionSchema,
235
237
  suffixSchema,
236
238
  tabularDataTypesSchema,
237
239
  usePostcodeLookupSchema,
@@ -255,7 +257,7 @@ export const formEditorInputPageKeys = {
255
257
  * @see {@link FormEditorInputPage}
256
258
  */
257
259
  export const formEditorInputPageSchema = Joi.object().keys(formEditorInputPageKeys).required().description('Input schema for creating a new page in the form editor');
258
- export const formEditorInputheckAnswersSettingsKeys = {
260
+ export const formEditorInputCheckAnswersSettingsKeys = {
259
261
  declarationText: shortDescriptionSchema
260
262
  };
261
263
 
@@ -263,10 +265,11 @@ export const formEditorInputheckAnswersSettingsKeys = {
263
265
  * Joi schema for `FormEditorInputCheckAnswersSettings` interface
264
266
  * @see {@link FormEditorInputCheckAnswersSettings}
265
267
  */
266
- export const formEditorInputCheckAnswersSettingSchema = Joi.object().keys(formEditorInputheckAnswersSettingsKeys).required().description('Configuration for the check-answers page');
268
+ export const formEditorInputCheckAnswersSettingSchema = Joi.object().keys(formEditorInputCheckAnswersSettingsKeys).required().description('Configuration for the check-answers page');
267
269
  export const formEditorInputQuestionKeys = {
268
270
  question: questionSchema,
269
271
  shortDescription: shortDescriptionSchema,
272
+ errorDescription: errorDescriptionSchema,
270
273
  hintText: hintTextSchema,
271
274
  questionOptional: questionOptionalSchema
272
275
  };
@@ -288,7 +291,7 @@ export const formEditorInputPageSettingsKeys = {
288
291
  */
289
292
  export const formEditorInputPageSettingsSchema = Joi.object().keys(formEditorInputPageSettingsKeys).required().description('Settings for page content and display in the form editor');
290
293
  export function govukFieldValueIsString(govukField) {
291
- return ['question', 'hintText', 'shortDescription', 'autoCompleteOptions', 'classes', 'prefix', 'suffix', 'paymentAmount', 'paymentDescription'].includes(`${govukField.name}`);
294
+ return ['question', 'hintText', 'shortDescription', 'errorDescription', 'autoCompleteOptions', 'classes', 'prefix', 'suffix', 'paymentAmount', 'paymentDescription'].includes(`${govukField.name}`);
292
295
  }
293
296
  export function govukFieldIsChecked(govukField) {
294
297
  if (govukField.name !== 'questionOptional' && govukField.name !== 'usePostcodeLookup') {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["JoiDate","JoiBase","rtrimOnly","ComponentType","GeospatialFieldGeometryTypesEnum","GeospatialFieldOptionsCountryEnum","TelephoneNumberFieldOptionsFormatEnum","MAX_NUMBER_OF_REPEAT_ITEMS","MIN_NUMBER_OF_REPEAT_ITEMS","preventUnicodeInEmail","Joi","extend","emailAddressNoUnicodeSchema","string","trim","email","tlds","allow","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","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","exactFeaturesSchema","minFeaturesSchema","maxFeaturesSchema","geometryTypesSchema","telephoneNumberFormatSchema","customValidator","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 JoiDate from '@joi/date'\nimport JoiBase, { type ArraySchema, type GetRuleOptions } from 'joi'\n\nimport { rtrimOnly } from '~/src/common/rtrim-only.js'\nimport {\n ComponentType,\n GeospatialFieldGeometryTypesEnum,\n GeospatialFieldOptionsCountryEnum,\n TelephoneNumberFieldOptionsFormatEnum\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\nconst Joi = JoiBase.extend(JoiDate) as JoiBase.Root\n\nexport const emailAddressNoUnicodeSchema = Joi.string()\n .trim()\n .email({ tlds: { allow: false } })\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\nexport const exactFeaturesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Specifies the exact number of features required to be defined.')\n\nexport const minFeaturesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Minimum number of features required to be defined.')\n\nexport const maxFeaturesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum number of features allowed to be defined.')\n\nexport const geometryTypesSchema = Joi.array()\n .items(Joi.string().valid(...Object.values(GeospatialFieldGeometryTypesEnum)))\n .single()\n .description('The geometry types allowed in a geospatial field')\n\nexport const telephoneNumberFormatSchema = Joi.string()\n .valid(...Object.values(TelephoneNumberFieldOptionsFormatEnum), 'any')\n .description('The format for the telephone number field')\n\ntype GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {\n args: Record<K, T>\n}\n\ninterface DSLSchema<\n 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 JoiBase.Root {\n dsv<TSchema>(): DSLSchema<TSchema>\n}\n\nexport const customValidator = Joi.extend((joi: JoiBase.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 minFeaturesSchema,\n maxFeaturesSchema,\n exactFeaturesSchema,\n geometryTypesSchema,\n telephoneNumberFormatSchema\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,OAAO,MAAM,WAAW;AAC/B,OAAOC,OAAO,MAAiD,KAA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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,CAAChI,KAAK,GAAG,CAAC,CAAC,CAACoI,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":["JoiDate","JoiBase","rtrimOnly","ComponentType","GeospatialFieldGeometryTypesEnum","GeospatialFieldOptionsCountryEnum","TelephoneNumberFieldOptionsFormatEnum","MAX_NUMBER_OF_REPEAT_ITEMS","MIN_NUMBER_OF_REPEAT_ITEMS","preventUnicodeInEmail","Joi","extend","emailAddressNoUnicodeSchema","string","trim","email","tlds","allow","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","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","errorDescriptionSchema","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","exactFeaturesSchema","minFeaturesSchema","maxFeaturesSchema","geometryTypesSchema","telephoneNumberFormatSchema","customValidator","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","formEditorInputCheckAnswersSettingsKeys","declarationText","formEditorInputCheckAnswersSettingSchema","formEditorInputQuestionKeys","question","shortDescription","errorDescription","hintText","questionOptional","formEditorInputQuestionSchema","formEditorInputPageSettingsKeys","pageHeadingAndGuidance","pageHeading","guidanceText","formEditorInputPageSettingsSchema","govukFieldValueIsString","govukField","includes","govukFieldIsChecked","checkedValue","checked","allowedErrorTemplateFunctions"],"sources":["../../../../src/form/form-editor/index.ts"],"sourcesContent":["import JoiDate from '@joi/date'\nimport JoiBase, { type ArraySchema, type GetRuleOptions } from 'joi'\n\nimport { rtrimOnly } from '~/src/common/rtrim-only.js'\nimport {\n ComponentType,\n GeospatialFieldGeometryTypesEnum,\n GeospatialFieldOptionsCountryEnum,\n TelephoneNumberFieldOptionsFormatEnum\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\nconst Joi = JoiBase.extend(JoiDate) as JoiBase.Root\n\nexport const emailAddressNoUnicodeSchema = Joi.string()\n .trim()\n .email({ tlds: { allow: false } })\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 errorDescriptionSchema = Joi.string()\n .custom(rtrimOnly)\n .allow('')\n .optional()\n .description('Description that will be displayed in error messages')\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\nexport const exactFeaturesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Specifies the exact number of features required to be defined.')\n\nexport const minFeaturesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Minimum number of features required to be defined.')\n\nexport const maxFeaturesSchema = Joi.number()\n .empty('')\n .integer()\n .min(1)\n .description('Maximum number of features allowed to be defined.')\n\nexport const geometryTypesSchema = Joi.array()\n .items(Joi.string().valid(...Object.values(GeospatialFieldGeometryTypesEnum)))\n .single()\n .description('The geometry types allowed in a geospatial field')\n\nexport const telephoneNumberFormatSchema = Joi.string()\n .valid(...Object.values(TelephoneNumberFieldOptionsFormatEnum), 'any')\n .description('The format for the telephone number field')\n\ntype GenericRuleOptions<K extends string, T> = Omit<GetRuleOptions, 'args'> & {\n args: Record<K, T>\n}\n\ninterface DSLSchema<\n 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 JoiBase.Root {\n dsv<TSchema>(): DSLSchema<TSchema>\n}\n\nexport const customValidator = Joi.extend((joi: JoiBase.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 errorDescriptionSchema,\n suffixSchema,\n tabularDataTypesSchema,\n usePostcodeLookupSchema,\n minChecksSchema,\n maxChecksSchema,\n exactChecksSchema,\n countriesSchema,\n minFeaturesSchema,\n maxFeaturesSchema,\n exactFeaturesSchema,\n geometryTypesSchema,\n telephoneNumberFormatSchema\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 formEditorInputCheckAnswersSettingsKeys = {\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(formEditorInputCheckAnswersSettingsKeys)\n .required()\n .description('Configuration for the check-answers page')\n\nexport const formEditorInputQuestionKeys = {\n question: questionSchema,\n shortDescription: shortDescriptionSchema,\n errorDescription: errorDescriptionSchema,\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 'errorDescription',\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,OAAO,MAAM,WAAW;AAC/B,OAAOC,OAAO,MAAiD,KAAK;AAEpE,SAASC,SAAS;AAClB,SACEC,aAAa,EACbC,gCAAgC,EAChCC,iCAAiC,EACjCC,qCAAqC;AAEvC,SACEC,0BAA0B,EAC1BC,0BAA0B;AAY5B,SAASC,qBAAqB;AAE9B,MAAMC,GAAG,GAAGT,OAAO,CAACU,MAAM,CAACX,OAAO,CAAiB;AAEnD,OAAO,MAAMY,2BAA2B,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CACpDC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC;EAAEC,IAAI,EAAE;IAAEC,KAAK,EAAE;EAAM;AAAE,CAAC,CAAC,CACjCC,MAAM,CAAC,CAACC,KAAK,EAAEC,OAAO,KAAKX,qBAAqB,CAACU,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,MAAMC,cAAc,GAAGd,GAAG,CAACG,MAAM,CAAC,CAAC,CACvCY,QAAQ,CAAC,CAAC,CACVC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC7BL,WAAW,CAAC,wDAAwD,CAAC;AAExE,OAAO,MAAMM,kBAAkB,GAAGjB,GAAG,CAACG,MAAM,CAAC,CAAC,CAC3CY,QAAQ,CAAC,CAAC,CACVC,KAAK,CACJH,oBAAoB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CAAC,CAClC1B,IAAI,CAACwC,2BAA2B,CAAC,CACjCzK,QAAQ,CAAC,CAAC,CACVJ,WAAW,CACV,qEACF,CAAC;AAEL,OAAO,MAAMoL,+BAA+B,GAAG;EAC7CC,sBAAsB,EAAEhH,4BAA4B;EACpDiH,WAAW,EAAEhH,iBAAiB;EAC9BiH,YAAY,EAAEhH;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMiH,iCAAiC,GAC5CnM,GAAG,CAAC0K,MAAM,CAA8B,CAAC,CACtC1B,IAAI,CAAC+C,+BAA+B,CAAC,CACrChL,QAAQ,CAAC,CAAC,CACVJ,WAAW,CAAC,0DAA0D,CAAC;AAE5E,OAAO,SAASyL,uBAAuBA,CACrCC,UAAsB,EACU;EAChC,OAAO,CACL,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,oBAAoB,CACrB,CAACC,QAAQ,CAAC,GAAGD,UAAU,CAACtC,IAAI,EAAE,CAAC;AAClC;AAEA,OAAO,SAASwC,mBAAmBA,CACjCF,UAAsB,EACkD;EACxE,IACEA,UAAU,CAACtC,IAAI,KAAK,kBAAkB,IACtCsC,UAAU,CAACtC,IAAI,KAAK,mBAAmB,EACvC;IACA,OAAO,KAAK;EACd;EACA,MAAMyC,YAAY,GAAGH,UAAU,CAAClI,KAAK,GAAG,CAAC,CAAC,CAACsI,OAAO;EAClD,OAAO,OAAOD,YAAY,KAAK,SAAS;AAC1C;;AAEA;AACA,OAAO,MAAME,6BAA6B,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC","ignoreList":[]}
@@ -25,6 +25,7 @@ export class ComponentElements {
25
25
  hintText: '',
26
26
  optional: !required,
27
27
  shortDesc: '',
28
+ errorDesc: '',
28
29
  userClasses: this._component.options && 'classes' in this._component.options ? this._component.options.classes ?? '' : '',
29
30
  items: [],
30
31
  content: ''
@@ -1 +1 @@
1
- {"version":3,"file":"component-elements.js","names":["ComponentElements","_component","constructor","component","_getValues","required","options","question","title","hintText","optional","shortDesc","userClasses","classes","items","content","values","setPreviewDOM","_element","Error","setPreviewHTML","_value"],"sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"sourcesContent":["/**\n * @implements {QuestionElements}\n */\nexport class ComponentElements {\n /**\n * @type {ComponentDef}\n * @protected\n */\n _component\n /**\n * @param {ComponentDef} component\n */\n constructor(component) {\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n const required = this._component.options?.required ?? true\n\n return {\n question: this._component.title,\n hintText: '',\n optional: !required,\n shortDesc: '',\n userClasses:\n this._component.options && 'classes' in this._component.options\n ? (this._component.options.classes ?? '')\n : '',\n items: [],\n content: ''\n }\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n const values = this._getValues()\n return values\n }\n\n /**\n * @param {HTMLElement} _element\n */\n setPreviewDOM(_element) {\n throw new Error('Not implemented')\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n throw new Error('Not implemented')\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,CAAC;EAC7B;AACF;AACA;AACA;EACEC,UAAU;EACV;AACF;AACA;EACEC,WAAWA,CAACC,SAAS,EAAE;IACrB,IAAI,CAACF,UAAU,GAAGE,SAAS;EAC7B;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,MAAMC,QAAQ,GAAG,IAAI,CAACJ,UAAU,CAACK,OAAO,EAAED,QAAQ,IAAI,IAAI;IAE1D,OAAO;MACLE,QAAQ,EAAE,IAAI,CAACN,UAAU,CAACO,KAAK;MAC/BC,QAAQ,EAAE,EAAE;MACZC,QAAQ,EAAE,CAACL,QAAQ;MACnBM,SAAS,EAAE,EAAE;MACbC,WAAW,EACT,IAAI,CAACX,UAAU,CAACK,OAAO,IAAI,SAAS,IAAI,IAAI,CAACL,UAAU,CAACK,OAAO,GAC1D,IAAI,CAACL,UAAU,CAACK,OAAO,CAACO,OAAO,IAAI,EAAE,GACtC,EAAE;MACRC,KAAK,EAAE,EAAE;MACTC,OAAO,EAAE;IACX,CAAC;EACH;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAG;IACX,MAAMA,MAAM,GAAG,IAAI,CAACZ,UAAU,CAAC,CAAC;IAChC,OAAOY,MAAM;EACf;;EAEA;AACF;AACA;EACEC,aAAaA,CAACC,QAAQ,EAAE;IACtB,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EACpC;;EAEA;AACF;AACA;EACEC,cAAcA,CAACC,MAAM,EAAE;IACrB,MAAM,IAAIF,KAAK,CAAC,iBAAiB,CAAC;EACpC;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"component-elements.js","names":["ComponentElements","_component","constructor","component","_getValues","required","options","question","title","hintText","optional","shortDesc","errorDesc","userClasses","classes","items","content","values","setPreviewDOM","_element","Error","setPreviewHTML","_value"],"sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"sourcesContent":["/**\n * @implements {QuestionElements}\n */\nexport class ComponentElements {\n /**\n * @type {ComponentDef}\n * @protected\n */\n _component\n /**\n * @param {ComponentDef} component\n */\n constructor(component) {\n this._component = component\n }\n\n /**\n * @protected\n * @returns {BaseSettings}\n */\n _getValues() {\n const required = this._component.options?.required ?? true\n\n return {\n question: this._component.title,\n hintText: '',\n optional: !required,\n shortDesc: '',\n errorDesc: '',\n userClasses:\n this._component.options && 'classes' in this._component.options\n ? (this._component.options.classes ?? '')\n : '',\n items: [],\n content: ''\n }\n }\n\n /**\n * @returns {BaseSettings}\n */\n get values() {\n const values = this._getValues()\n return values\n }\n\n /**\n * @param {HTMLElement} _element\n */\n setPreviewDOM(_element) {\n throw new Error('Not implemented')\n }\n\n /**\n * @param {string} _value\n */\n setPreviewHTML(_value) {\n throw new Error('Not implemented')\n }\n}\n\n/**\n * @import { ListenerRow, BaseSettings, QuestionElements, QuestionBaseModel, GovukFieldset, DefaultComponent, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'\n * @import { FormComponentsDef, ContentComponentsDef, ComponentDef } from '~/src/components/types.js'\n * @import { ListElement, ListItemReadonly } from '~/src/form/form-editor/types.js'\n */\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,CAAC;EAC7B;AACF;AACA;AACA;EACEC,UAAU;EACV;AACF;AACA;EACEC,WAAWA,CAACC,SAAS,EAAE;IACrB,IAAI,CAACF,UAAU,GAAGE,SAAS;EAC7B;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,MAAMC,QAAQ,GAAG,IAAI,CAACJ,UAAU,CAACK,OAAO,EAAED,QAAQ,IAAI,IAAI;IAE1D,OAAO;MACLE,QAAQ,EAAE,IAAI,CAACN,UAAU,CAACO,KAAK;MAC/BC,QAAQ,EAAE,EAAE;MACZC,QAAQ,EAAE,CAACL,QAAQ;MACnBM,SAAS,EAAE,EAAE;MACbC,SAAS,EAAE,EAAE;MACbC,WAAW,EACT,IAAI,CAACZ,UAAU,CAACK,OAAO,IAAI,SAAS,IAAI,IAAI,CAACL,UAAU,CAACK,OAAO,GAC1D,IAAI,CAACL,UAAU,CAACK,OAAO,CAACQ,OAAO,IAAI,EAAE,GACtC,EAAE;MACRC,KAAK,EAAE,EAAE;MACTC,OAAO,EAAE;IACX,CAAC;EACH;;EAEA;AACF;AACA;EACE,IAAIC,MAAMA,CAAA,EAAG;IACX,MAAMA,MAAM,GAAG,IAAI,CAACb,UAAU,CAAC,CAAC;IAChC,OAAOa,MAAM;EACf;;EAEA;AACF;AACA;EACEC,aAAaA,CAACC,QAAQ,EAAE;IACtB,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EACpC;;EAEA;AACF;AACA;EACEC,cAAcA,CAACC,MAAM,EAAE;IACrB,MAAM,IAAIF,KAAK,CAAC,iBAAiB,CAAC;EACpC;AACF;;AAEA;AACA;AACA;AACA;AACA","ignoreList":[]}