@defra/forms-model 3.0.708 → 3.0.710

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.
@@ -30,9 +30,18 @@ export const formOutputMessageData = Joi.object().keys({
30
30
  version: Joi.string().trim().required().description('Version identifier of the output format'),
31
31
  condition: Joi.string().trim().allow('').optional().description('Id of the condition determining whether the submission is sent to this address')
32
32
  }).description('A submission email target as recorded on an audit event');
33
+ export const formOutputChangesMessageData = Joi.object().keys({
34
+ added: Joi.array().items(formOutputMessageData).optional(),
35
+ updated: Joi.array().items(Joi.object().keys({
36
+ previous: formOutputMessageData.required(),
37
+ new: formOutputMessageData.required()
38
+ })).optional(),
39
+ removed: Joi.array().items(formOutputMessageData).optional()
40
+ }).or('added', 'updated', 'removed').description("Changes an update made to the form's submission email targets (outputs)");
33
41
  export const formUpdatedMessageData = formMessageDataBase.append({
34
42
  requestType: Joi.string().valid(...Object.values(FormDefinitionRequestType)).required(),
35
- s3Meta: formDefinitionS3Meta.optional()
43
+ s3Meta: formDefinitionS3Meta.optional(),
44
+ outputChanges: formOutputChangesMessageData.optional()
36
45
  }).required();
37
46
  export const formsBackupRequestedMessageData = Joi.object().keys({
38
47
  totalForms: Joi.number().integer().min(0).required(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","AuditEventMessageCategory","AuditEventMessageSchemaVersion","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType","emailAddressNoUnicodeSchema","contactSchema","emailResponseTimeSchema","idSchema","notificationEmailAddressSchema","offlineSchema","onlineTextSchema","onlineUrlSchema","organisationSchema","phoneSchema","privacyNoticeTextSchema","privacyNoticeTypeSchema","privacyNoticeUrlSchema","slugSchema","submissionGuidanceSchema","teamEmailSchema","teamNameSchema","termsAndConditionsAgreedSchema","titleSchema","formMessageDataBase","object","formId","slug","payload","optional","required","description","formCreatedMessageData","append","title","organisation","teamName","teamEmail","formDefinitionS3Meta","keys","fileId","string","filename","s3Key","formOutputMessageData","emailAddress","audience","trim","valid","version","condition","allow","formUpdatedMessageData","requestType","Object","values","s3Meta","formsBackupRequestedMessageData","totalForms","number","integer","min","durationMs","formsSecretDeletedMessageData","secretName","formsSecretSavedMessageData","dlqActionMessageData","action","messageId","beforeJson","afterJson","formTitleChanges","formOrganisationChanges","formTeamNameChanges","formTeamEmailChanges","formSupportContactChanges","contact","formSupportPhoneChanges","phone","formSupportOnlineChanges","url","text","formSupportEmailChanges","address","responseTime","formPrivacyNoticeChanges","privacyNoticeType","privacyNoticeText","when","is","then","otherwise","privacyNoticeUrl","formTermsAndConditionsChanges","termsAndConditionsAgreed","formNotificationEmailChanges","notificationEmail","formSubmissionGuidanceChanges","submissionGuidance","formUploadedChanges","value","formOfflineChanges","offline","entitlementMessageData","userId","displayName","email","roles","array","items","formFileDownloadedMessageData","fileLink","excelGenerationMessageData","formName","authenticationMessageData","auditUserSchema","id","formChangesMessageData","schema","changes","previous","new","messageSchema","schemaVersion","category","source","type","entityId","traceId","createdAt","date","createdBy","data","switch","FORM_CREATED","FORM_TITLE_UPDATED","FORM_ORGANISATION_UPDATED","FORM_TEAM_NAME_UPDATED","FORM_TEAM_EMAIL_UPDATED","FORM_SUPPORT_CONTACT_UPDATED","FORM_SUPPORT_PHONE_UPDATED","FORM_SUPPORT_EMAIL_UPDATED","FORM_SUPPORT_ONLINE_UPDATED","FORM_PRIVACY_NOTICE_UPDATED","FORM_TERMS_AND_CONDITIONS_AGREED","FORM_NOTIFICATION_EMAIL_UPDATED","FORM_SUBMISSION_GUIDANCE_UPDATED","FORM_JSON_UPLOADED","FORM_UPDATED","ENTITLEMENT_CREATED","ENTITLEMENT_UPDATED","ENTITLEMENT_DELETED","FORM_DRAFT_DELETED","FORM_JSON_DOWNLOADED","AUTHENTICATION_LOGIN","AUTHENTICATION_LOGOUT_MANUAL","AUTHENTICATION_LOGOUT_AUTO","AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE","FORM_FILE_DOWNLOAD_SUCCESS","FORM_FILE_DOWNLOAD_FAILURE","FORM_SUBMISSION_EXCEL_REQUESTED","FORM_CSAT_EXCEL_REQUESTED","PLATFORM_CSAT_EXCEL_REQUESTED","FORMS_BACKUP_REQUESTED","FORM_SECRET_DELETED","FORM_SECRET_SAVED","DLQ_ACTION","FORM_OFFLINE_UPDATED","forbidden","messageCreatedAt","auditEvent","message","auditRecord","uuid","recordCreatedAt"],"sources":["../../../../src/form/form-audit/index.ts"],"sourcesContent":["import Joi, { type ObjectSchema } from 'joi'\n\nimport {\n AuditEventMessageCategory,\n AuditEventMessageSchemaVersion,\n AuditEventMessageSource,\n AuditEventMessageType,\n FormDefinitionRequestType\n} from '~/src/form/form-audit/enums.js'\nimport {\n type AuditEvent,\n type AuditMessage,\n type AuditRecord,\n type AuditUser,\n type AuthenticationMessageData,\n type ChangesMessageData,\n type DlqActionMessageData,\n type EntitlementMessageData,\n type ExcelGenerationMessageData,\n type FormCreatedMessageData,\n type FormDefinitionS3Meta,\n type FormFileDownloadedMessageData,\n type FormMessageChangesData,\n type FormMessageDataBase,\n type FormNotificationEmailChanges,\n type FormNotificationEmailUpdatedMessageData,\n type FormOfflineChanges,\n type FormOfflineUpdatedMessageData,\n type FormOrganisationChanges,\n type FormOrganisationUpdatedMessageData,\n type FormPrivacyNoticeChanges,\n type FormPrivacyNoticeUpdatedMessageData,\n type FormSecretBaseMessageData,\n type FormSubmissionGuidanceChanges,\n type FormSubmissionGuidanceUpdatedMessageData,\n type FormSupportContactChanges,\n type FormSupportContactUpdatedMessageData,\n type FormSupportEmailChanges,\n type FormSupportEmailUpdatedMessageData,\n type FormSupportOnlineChanges,\n type FormSupportOnlineUpdatedMessageData,\n type FormSupportPhoneChanges,\n type FormSupportPhoneUpdatedMessageData,\n type FormTeamEmailChanges,\n type FormTeamEmailUpdatedMessageData,\n type FormTeamNameChanges,\n type FormTeamNameUpdatedMessageData,\n type FormTermsAndConditionsAgreedMessageData,\n type FormTermsAndConditionsChanges,\n type FormTitleChanges,\n type FormTitleUpdatedMessageData,\n type FormUpdatedMessageData,\n type FormUploadedChanges,\n type FormUploadedMessageData,\n type FormsBackupRequestedMessageData\n} from '~/src/form/form-audit/types.js'\nimport { type Output } from '~/src/form/form-definition/types.js'\nimport { emailAddressNoUnicodeSchema } from '~/src/form/form-editor/index.js'\nimport {\n contactSchema,\n emailResponseTimeSchema,\n idSchema,\n notificationEmailAddressSchema,\n offlineSchema,\n onlineTextSchema,\n onlineUrlSchema,\n organisationSchema,\n phoneSchema,\n privacyNoticeTextSchema,\n privacyNoticeTypeSchema,\n privacyNoticeUrlSchema,\n slugSchema,\n submissionGuidanceSchema,\n teamEmailSchema,\n teamNameSchema,\n termsAndConditionsAgreedSchema,\n titleSchema\n} from '~/src/form/form-metadata/index.js'\n\nexport const formMessageDataBase = Joi.object<FormMessageDataBase>({\n formId: idSchema,\n slug: slugSchema,\n payload: Joi.object().optional()\n})\n .required()\n .description('The base data object for Form Messages')\n\nexport const formCreatedMessageData = formMessageDataBase\n .append<FormCreatedMessageData>({\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema\n })\n .required()\n .description('Message data schema for when a form is created')\n\nexport const formDefinitionS3Meta = Joi.object<FormDefinitionS3Meta>()\n .keys({\n fileId: Joi.string().required(),\n filename: Joi.string().required(),\n s3Key: Joi.string().required()\n })\n .description('Schema for form data S3 object in message')\n\n/**\n * Stands apart from the definition's own output schema, which resolves a\n * condition against the sibling `conditions` array - a lookup that has no\n * meaning on an audit message carrying the output on its own.\n */\nexport const formOutputMessageData = Joi.object<Output>()\n .keys({\n emailAddress: emailAddressNoUnicodeSchema\n .required()\n .description('Email address the submission is sent to'),\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Whether the submission is sent human readable or machine processable'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier of the output format'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Id of the condition determining whether the submission is sent to this address'\n )\n })\n .description('A submission email target as recorded on an audit event')\n\nexport const formUpdatedMessageData = formMessageDataBase\n .append<FormUpdatedMessageData>({\n requestType: Joi.string()\n .valid(...Object.values(FormDefinitionRequestType))\n .required(),\n s3Meta: formDefinitionS3Meta.optional()\n })\n .required()\n\nexport const formsBackupRequestedMessageData =\n Joi.object<FormsBackupRequestedMessageData>().keys({\n totalForms: Joi.number().integer().min(0).required(),\n durationMs: Joi.number().min(0).required()\n })\n\nexport const formsSecretDeletedMessageData =\n formMessageDataBase.append<FormSecretBaseMessageData>({\n secretName: Joi.string().required()\n })\n\nexport const formsSecretSavedMessageData =\n formMessageDataBase.append<FormSecretBaseMessageData>({\n secretName: Joi.string().required()\n })\n\nexport const dlqActionMessageData = Joi.object<DlqActionMessageData>().keys({\n action: Joi.string()\n .valid('redrive', 'delete', 'modify-and-resubmit')\n .required(),\n messageId: Joi.string().optional(),\n beforeJson: Joi.string().optional(),\n afterJson: Joi.string().optional()\n})\n\nexport const formTitleChanges = Joi.object<FormTitleChanges>()\n .keys({\n title: titleSchema\n })\n .required()\n .description('Changes schema for FORM_TITLE_UPDATED event')\n\nexport const formOrganisationChanges = Joi.object<FormOrganisationChanges>()\n .keys({\n organisation: organisationSchema\n })\n .required()\n .description('Changes schema for FORM_ORGANISATION_UPDATED event')\n\nexport const formTeamNameChanges = Joi.object<FormTeamNameChanges>()\n .keys({\n teamName: teamNameSchema\n })\n .required()\n .description('Changes schema for FORM_TEAM_NAME_UPDATED event')\n\nexport const formTeamEmailChanges = Joi.object<FormTeamEmailChanges>()\n .keys({\n teamEmail: teamEmailSchema\n })\n .required()\n .description('Changes schema for FORM_TEAM_EMAIL_UPDATED event')\n\nexport const formSupportContactChanges = Joi.object<FormSupportContactChanges>()\n .keys({\n contact: contactSchema\n })\n .required()\n .description('Changes schema for FORM_SUPPORT_CONTACT_UPDATED event')\n\nexport const formSupportPhoneChanges = Joi.object<FormSupportPhoneChanges>()\n .keys({\n phone: phoneSchema\n })\n .required()\n .description('Changes schema for FORM_SUPPORT_PHONE_UPDATED event')\n\nexport const formSupportOnlineChanges = Joi.object<FormSupportOnlineChanges>()\n .keys({\n url: onlineUrlSchema.optional(),\n text: onlineTextSchema.optional()\n })\n .required()\n .description('Changes schema for FORM_SUPPORT_ONLINE_UPDATED event')\n\nexport const formSupportEmailChanges = Joi.object<FormSupportEmailChanges>()\n .keys({\n address: emailAddressNoUnicodeSchema.optional(),\n responseTime: emailResponseTimeSchema.optional()\n })\n .description('Changes schema for FORM_SUPPORT_EMAIL_UPDATED event')\n\nexport const formPrivacyNoticeChanges = Joi.object<FormPrivacyNoticeChanges>()\n .keys({\n privacyNoticeType: privacyNoticeTypeSchema,\n privacyNoticeText: Joi.when('privacyNoticeType', {\n is: 'text',\n then: privacyNoticeTextSchema,\n otherwise: privacyNoticeTextSchema.allow('')\n }),\n privacyNoticeUrl: Joi.when('privacyNoticeType', {\n is: 'link',\n then: privacyNoticeUrlSchema,\n otherwise: privacyNoticeUrlSchema.allow('')\n })\n })\n .required()\n .description('Changes schema for FORM_PRIVACY_NOTICE_UPDATED event')\n\nexport const formTermsAndConditionsChanges =\n Joi.object<FormTermsAndConditionsChanges>()\n .keys({\n termsAndConditionsAgreed: termsAndConditionsAgreedSchema\n })\n .required()\n .description('Changes schema for FORM_TERMS_AND_CONDITIONS_AGREED event')\n\nexport const formNotificationEmailChanges =\n Joi.object<FormNotificationEmailChanges>()\n .keys({\n notificationEmail: notificationEmailAddressSchema\n })\n .required()\n .description('Changes schema for FORM_NOTIFICATION_EMAIL_UPDATED event')\n\nexport const formSubmissionGuidanceChanges =\n Joi.object<FormSubmissionGuidanceChanges>()\n .keys({\n submissionGuidance: submissionGuidanceSchema\n })\n .required()\n .description('Changes schema for FORM_SUBMISSION_GUIDANCE_UPDATED event')\n\nexport const formUploadedChanges = Joi.object<FormUploadedChanges>()\n .keys({\n value: Joi.string().required()\n })\n .required()\n .description('Changes schema for FORM_JSON_UPLOADED event')\n\nexport const formOfflineChanges = Joi.object<FormOfflineChanges>()\n .keys({\n offline: offlineSchema\n })\n .required()\n .description('Changes schema for FORM_OFFLINE_UPDATED event')\n\nexport const entitlementMessageData = Joi.object<EntitlementMessageData>().keys(\n {\n userId: Joi.string().required(),\n displayName: Joi.string().required(),\n email: emailAddressNoUnicodeSchema.required(),\n roles: Joi.array().items(Joi.string())\n }\n)\n\nexport const formFileDownloadedMessageData =\n Joi.object<FormFileDownloadedMessageData>()\n .keys({\n fileId: Joi.string().required(),\n filename: Joi.string().required(),\n fileLink: Joi.string().required()\n })\n .required()\n .description(\n 'Schema for FORM_FILE_DOWNLOAD_SUCCESS and FORM_FILE_DOWNLOAD_FAILURE events'\n )\n\nexport const excelGenerationMessageData =\n Joi.object<ExcelGenerationMessageData>()\n .keys({\n formId: Joi.string().required(),\n formName: Joi.string().required(),\n notificationEmail: emailAddressNoUnicodeSchema.required()\n })\n .required()\n .description(\n 'Schema for Excel generation audit events (submissions and CSAT)'\n )\n\nexport const authenticationMessageData =\n Joi.object<AuthenticationMessageData>().keys({\n userId: Joi.string().required(),\n displayName: Joi.string().required()\n })\n\nexport const auditUserSchema = Joi.object<AuditUser>()\n .keys({\n id: Joi.string().required(),\n displayName: Joi.string().required()\n })\n .description('Schema for CREATED_BY audit event')\n\nexport function formChangesMessageData<T, U extends FormMessageChangesData>(\n schema: ObjectSchema<T>\n): ObjectSchema<U> {\n return formMessageDataBase.append<U>({\n changes: Joi.object<ChangesMessageData<T>>()\n .keys({\n previous: schema,\n new: schema\n })\n .description('Changes schema')\n })\n}\n\nexport const messageSchema = Joi.object<AuditMessage>()\n .keys({\n schemaVersion: Joi.string()\n .valid(...Object.values(AuditEventMessageSchemaVersion))\n .required()\n .description(\n 'The version of the AuditMessage - bumped with breaking changes'\n ),\n category: Joi.string()\n .valid(...Object.values(AuditEventMessageCategory))\n .required()\n .description('The message category - what does the entityId represent?'),\n source: Joi.string()\n .valid(...Object.values(AuditEventMessageSource))\n .required()\n .description('Source of the message - which service?'),\n type: Joi.string()\n .valid(...Object.values(AuditEventMessageType))\n .description('Event type'),\n entityId: Joi.string()\n .required()\n .description('The id of the entity the category relates to'),\n traceId: Joi.string()\n .optional()\n .description(\n 'Trace id of the event - to link events across multiple services'\n ),\n createdAt: Joi.date()\n .required()\n .description(\n 'The ISO timestamp where the action took place - should be the same as updated_at field in DB'\n ),\n createdBy: auditUserSchema\n .required()\n .description('The user who performed the action being audited'),\n data: Joi.when('type', {\n switch: [\n {\n is: Joi.string().trim().valid(AuditEventMessageType.FORM_CREATED),\n then: formCreatedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TITLE_UPDATED),\n then: formChangesMessageData<\n FormTitleChanges,\n FormTitleUpdatedMessageData\n >(formTitleChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_ORGANISATION_UPDATED),\n then: formChangesMessageData<\n FormOrganisationChanges,\n FormOrganisationUpdatedMessageData\n >(formOrganisationChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TEAM_NAME_UPDATED),\n then: formChangesMessageData<\n FormTeamNameChanges,\n FormTeamNameUpdatedMessageData\n >(formTeamNameChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED),\n then: formChangesMessageData<\n FormTeamEmailChanges,\n FormTeamEmailUpdatedMessageData\n >(formTeamEmailChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_CONTACT_UPDATED),\n then: formChangesMessageData<\n FormSupportContactChanges,\n FormSupportContactUpdatedMessageData\n >(formSupportContactChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED),\n then: formChangesMessageData<\n FormSupportPhoneChanges,\n FormSupportPhoneUpdatedMessageData\n >(formSupportPhoneChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED),\n then: formChangesMessageData<\n FormSupportEmailChanges,\n FormSupportEmailUpdatedMessageData\n >(formSupportEmailChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED),\n then: formChangesMessageData<\n FormSupportOnlineChanges,\n FormSupportOnlineUpdatedMessageData\n >(formSupportOnlineChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED),\n then: formChangesMessageData<\n FormPrivacyNoticeChanges,\n FormPrivacyNoticeUpdatedMessageData\n >(formPrivacyNoticeChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TERMS_AND_CONDITIONS_AGREED),\n then: formChangesMessageData<\n FormTermsAndConditionsChanges,\n FormTermsAndConditionsAgreedMessageData\n >(formTermsAndConditionsChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED),\n then: formChangesMessageData<\n FormNotificationEmailChanges,\n FormNotificationEmailUpdatedMessageData\n >(formNotificationEmailChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED),\n then: formChangesMessageData<\n FormSubmissionGuidanceChanges,\n FormSubmissionGuidanceUpdatedMessageData\n >(formSubmissionGuidanceChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_JSON_UPLOADED),\n then: formChangesMessageData<\n FormUploadedChanges,\n FormUploadedMessageData\n >(formUploadedChanges)\n },\n {\n is: Joi.string().trim().valid(AuditEventMessageType.FORM_UPDATED),\n then: formUpdatedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.ENTITLEMENT_CREATED,\n AuditEventMessageType.ENTITLEMENT_UPDATED,\n AuditEventMessageType.ENTITLEMENT_DELETED\n ),\n then: entitlementMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_DRAFT_DELETED),\n then: formMessageDataBase\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_JSON_DOWNLOADED),\n then: formMessageDataBase\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.AUTHENTICATION_LOGIN,\n AuditEventMessageType.AUTHENTICATION_LOGOUT_MANUAL,\n AuditEventMessageType.AUTHENTICATION_LOGOUT_AUTO,\n AuditEventMessageType.AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE\n ),\n then: authenticationMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.FORM_FILE_DOWNLOAD_SUCCESS,\n AuditEventMessageType.FORM_FILE_DOWNLOAD_FAILURE\n ),\n then: formFileDownloadedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED,\n AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED,\n AuditEventMessageType.PLATFORM_CSAT_EXCEL_REQUESTED\n ),\n then: excelGenerationMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORMS_BACKUP_REQUESTED),\n then: formsBackupRequestedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SECRET_DELETED),\n then: formsSecretDeletedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SECRET_SAVED),\n then: formsSecretSavedMessageData\n },\n {\n is: Joi.string().trim().valid(AuditEventMessageType.DLQ_ACTION),\n then: dlqActionMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_OFFLINE_UPDATED),\n then: formChangesMessageData<\n FormOfflineChanges,\n FormOfflineUpdatedMessageData\n >(formOfflineChanges)\n }\n ],\n otherwise: Joi.forbidden()\n }).description('The data/payload of the audit message'),\n messageCreatedAt: Joi.date()\n .required()\n .description('ISO timestamp when the message was published')\n })\n .required()\n .description('The audit message issued by the publishing service')\n\nexport const auditEvent = Joi.object<AuditEvent>()\n .keys({\n message: messageSchema\n })\n .description('The Body of the audit event')\n\nexport const auditRecord = messageSchema\n .append<AuditRecord>({\n id: idSchema,\n messageId: Joi.string().uuid().required(),\n entityId: Joi.string().required(),\n recordCreatedAt: Joi.date().required()\n })\n .description('The audit record persisted into the DB')\n"],"mappings":"AAAA,OAAOA,GAAG,MAA6B,KAAK;AAE5C,SACEC,yBAAyB,EACzBC,8BAA8B,EAC9BC,uBAAuB,EACvBC,qBAAqB,EACrBC,yBAAyB;AAkD3B,SAASC,2BAA2B;AACpC,SACEC,aAAa,EACbC,uBAAuB,EACvBC,QAAQ,EACRC,8BAA8B,EAC9BC,aAAa,EACbC,gBAAgB,EAChBC,eAAe,EACfC,kBAAkB,EAClBC,WAAW,EACXC,uBAAuB,EACvBC,uBAAuB,EACvBC,sBAAsB,EACtBC,UAAU,EACVC,wBAAwB,EACxBC,eAAe,EACfC,cAAc,EACdC,8BAA8B,EAC9BC,WAAW;AAGb,OAAO,MAAMC,mBAAmB,GAAGzB,GAAG,CAAC0B,MAAM,CAAsB;EACjEC,MAAM,EAAElB,QAAQ;EAChBmB,IAAI,EAAET,UAAU;EAChBU,OAAO,EAAE7B,GAAG,CAAC0B,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC;AACjC,CAAC,CAAC,CACCC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,wCAAwC,CAAC;AAExD,OAAO,MAAMC,sBAAsB,GAAGR,mBAAmB,CACtDS,MAAM,CAAyB;EAC9BC,KAAK,EAAEX,WAAW;EAClBY,YAAY,EAAEtB,kBAAkB;EAChCuB,QAAQ,EAAEf,cAAc;EACxBgB,SAAS,EAAEjB;AACb,CAAC,CAAC,CACDU,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,gDAAgD,CAAC;AAEhE,OAAO,MAAMO,oBAAoB,GAAGvC,GAAG,CAAC0B,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/I,QAAQ,CAAC,CAAC;EACzCiG,QAAQ,EAAEhI,GAAG,CAAC0C,MAAM,CAAC,CAAC,CAACX,QAAQ,CAAC,CAAC;EACjCgJ,eAAe,EAAE/K,GAAG,CAACmI,IAAI,CAAC,CAAC,CAACpG,QAAQ,CAAC;AACvC,CAAC,CAAC,CACDC,WAAW,CAAC,wCAAwC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","AuditEventMessageCategory","AuditEventMessageSchemaVersion","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType","emailAddressNoUnicodeSchema","contactSchema","emailResponseTimeSchema","idSchema","notificationEmailAddressSchema","offlineSchema","onlineTextSchema","onlineUrlSchema","organisationSchema","phoneSchema","privacyNoticeTextSchema","privacyNoticeTypeSchema","privacyNoticeUrlSchema","slugSchema","submissionGuidanceSchema","teamEmailSchema","teamNameSchema","termsAndConditionsAgreedSchema","titleSchema","formMessageDataBase","object","formId","slug","payload","optional","required","description","formCreatedMessageData","append","title","organisation","teamName","teamEmail","formDefinitionS3Meta","keys","fileId","string","filename","s3Key","formOutputMessageData","emailAddress","audience","trim","valid","version","condition","allow","formOutputChangesMessageData","added","array","items","updated","previous","new","removed","or","formUpdatedMessageData","requestType","Object","values","s3Meta","outputChanges","formsBackupRequestedMessageData","totalForms","number","integer","min","durationMs","formsSecretDeletedMessageData","secretName","formsSecretSavedMessageData","dlqActionMessageData","action","messageId","beforeJson","afterJson","formTitleChanges","formOrganisationChanges","formTeamNameChanges","formTeamEmailChanges","formSupportContactChanges","contact","formSupportPhoneChanges","phone","formSupportOnlineChanges","url","text","formSupportEmailChanges","address","responseTime","formPrivacyNoticeChanges","privacyNoticeType","privacyNoticeText","when","is","then","otherwise","privacyNoticeUrl","formTermsAndConditionsChanges","termsAndConditionsAgreed","formNotificationEmailChanges","notificationEmail","formSubmissionGuidanceChanges","submissionGuidance","formUploadedChanges","value","formOfflineChanges","offline","entitlementMessageData","userId","displayName","email","roles","formFileDownloadedMessageData","fileLink","excelGenerationMessageData","formName","authenticationMessageData","auditUserSchema","id","formChangesMessageData","schema","changes","messageSchema","schemaVersion","category","source","type","entityId","traceId","createdAt","date","createdBy","data","switch","FORM_CREATED","FORM_TITLE_UPDATED","FORM_ORGANISATION_UPDATED","FORM_TEAM_NAME_UPDATED","FORM_TEAM_EMAIL_UPDATED","FORM_SUPPORT_CONTACT_UPDATED","FORM_SUPPORT_PHONE_UPDATED","FORM_SUPPORT_EMAIL_UPDATED","FORM_SUPPORT_ONLINE_UPDATED","FORM_PRIVACY_NOTICE_UPDATED","FORM_TERMS_AND_CONDITIONS_AGREED","FORM_NOTIFICATION_EMAIL_UPDATED","FORM_SUBMISSION_GUIDANCE_UPDATED","FORM_JSON_UPLOADED","FORM_UPDATED","ENTITLEMENT_CREATED","ENTITLEMENT_UPDATED","ENTITLEMENT_DELETED","FORM_DRAFT_DELETED","FORM_JSON_DOWNLOADED","AUTHENTICATION_LOGIN","AUTHENTICATION_LOGOUT_MANUAL","AUTHENTICATION_LOGOUT_AUTO","AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE","FORM_FILE_DOWNLOAD_SUCCESS","FORM_FILE_DOWNLOAD_FAILURE","FORM_SUBMISSION_EXCEL_REQUESTED","FORM_CSAT_EXCEL_REQUESTED","PLATFORM_CSAT_EXCEL_REQUESTED","FORMS_BACKUP_REQUESTED","FORM_SECRET_DELETED","FORM_SECRET_SAVED","DLQ_ACTION","FORM_OFFLINE_UPDATED","forbidden","messageCreatedAt","auditEvent","message","auditRecord","uuid","recordCreatedAt"],"sources":["../../../../src/form/form-audit/index.ts"],"sourcesContent":["import Joi, { type ObjectSchema } from 'joi'\n\nimport {\n AuditEventMessageCategory,\n AuditEventMessageSchemaVersion,\n AuditEventMessageSource,\n AuditEventMessageType,\n FormDefinitionRequestType\n} from '~/src/form/form-audit/enums.js'\nimport {\n type AuditEvent,\n type AuditMessage,\n type AuditRecord,\n type AuditUser,\n type AuthenticationMessageData,\n type ChangesMessageData,\n type DlqActionMessageData,\n type EntitlementMessageData,\n type ExcelGenerationMessageData,\n type FormCreatedMessageData,\n type FormDefinitionS3Meta,\n type FormFileDownloadedMessageData,\n type FormMessageChangesData,\n type FormMessageDataBase,\n type FormNotificationEmailChanges,\n type FormNotificationEmailUpdatedMessageData,\n type FormOfflineChanges,\n type FormOfflineUpdatedMessageData,\n type FormOrganisationChanges,\n type FormOrganisationUpdatedMessageData,\n type FormOutputChanges,\n type FormPrivacyNoticeChanges,\n type FormPrivacyNoticeUpdatedMessageData,\n type FormSecretBaseMessageData,\n type FormSubmissionGuidanceChanges,\n type FormSubmissionGuidanceUpdatedMessageData,\n type FormSupportContactChanges,\n type FormSupportContactUpdatedMessageData,\n type FormSupportEmailChanges,\n type FormSupportEmailUpdatedMessageData,\n type FormSupportOnlineChanges,\n type FormSupportOnlineUpdatedMessageData,\n type FormSupportPhoneChanges,\n type FormSupportPhoneUpdatedMessageData,\n type FormTeamEmailChanges,\n type FormTeamEmailUpdatedMessageData,\n type FormTeamNameChanges,\n type FormTeamNameUpdatedMessageData,\n type FormTermsAndConditionsAgreedMessageData,\n type FormTermsAndConditionsChanges,\n type FormTitleChanges,\n type FormTitleUpdatedMessageData,\n type FormUpdatedMessageData,\n type FormUploadedChanges,\n type FormUploadedMessageData,\n type FormsBackupRequestedMessageData\n} from '~/src/form/form-audit/types.js'\nimport { type Output } from '~/src/form/form-definition/types.js'\nimport { emailAddressNoUnicodeSchema } from '~/src/form/form-editor/index.js'\nimport {\n contactSchema,\n emailResponseTimeSchema,\n idSchema,\n notificationEmailAddressSchema,\n offlineSchema,\n onlineTextSchema,\n onlineUrlSchema,\n organisationSchema,\n phoneSchema,\n privacyNoticeTextSchema,\n privacyNoticeTypeSchema,\n privacyNoticeUrlSchema,\n slugSchema,\n submissionGuidanceSchema,\n teamEmailSchema,\n teamNameSchema,\n termsAndConditionsAgreedSchema,\n titleSchema\n} from '~/src/form/form-metadata/index.js'\n\nexport const formMessageDataBase = Joi.object<FormMessageDataBase>({\n formId: idSchema,\n slug: slugSchema,\n payload: Joi.object().optional()\n})\n .required()\n .description('The base data object for Form Messages')\n\nexport const formCreatedMessageData = formMessageDataBase\n .append<FormCreatedMessageData>({\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema\n })\n .required()\n .description('Message data schema for when a form is created')\n\nexport const formDefinitionS3Meta = Joi.object<FormDefinitionS3Meta>()\n .keys({\n fileId: Joi.string().required(),\n filename: Joi.string().required(),\n s3Key: Joi.string().required()\n })\n .description('Schema for form data S3 object in message')\n\n/**\n * Stands apart from the definition's own output schema, which resolves a\n * condition against the sibling `conditions` array - a lookup that has no\n * meaning on an audit message carrying the output on its own.\n */\nexport const formOutputMessageData = Joi.object<Output>()\n .keys({\n emailAddress: emailAddressNoUnicodeSchema\n .required()\n .description('Email address the submission is sent to'),\n audience: Joi.string()\n .trim()\n .valid('human', 'machine')\n .required()\n .description(\n 'Whether the submission is sent human readable or machine processable'\n ),\n version: Joi.string()\n .trim()\n .required()\n .description('Version identifier of the output format'),\n condition: Joi.string()\n .trim()\n .allow('')\n .optional()\n .description(\n 'Id of the condition determining whether the submission is sent to this address'\n )\n })\n .description('A submission email target as recorded on an audit event')\n\nexport const formOutputChangesMessageData = Joi.object<FormOutputChanges>()\n .keys({\n added: Joi.array().items(formOutputMessageData).optional(),\n updated: Joi.array()\n .items(\n Joi.object<ChangesMessageData<Output>>().keys({\n previous: formOutputMessageData.required(),\n new: formOutputMessageData.required()\n })\n )\n .optional(),\n removed: Joi.array().items(formOutputMessageData).optional()\n })\n .or('added', 'updated', 'removed')\n .description(\n \"Changes an update made to the form's submission email targets (outputs)\"\n )\n\nexport const formUpdatedMessageData = formMessageDataBase\n .append<FormUpdatedMessageData>({\n requestType: Joi.string()\n .valid(...Object.values(FormDefinitionRequestType))\n .required(),\n s3Meta: formDefinitionS3Meta.optional(),\n outputChanges: formOutputChangesMessageData.optional()\n })\n .required()\n\nexport const formsBackupRequestedMessageData =\n Joi.object<FormsBackupRequestedMessageData>().keys({\n totalForms: Joi.number().integer().min(0).required(),\n durationMs: Joi.number().min(0).required()\n })\n\nexport const formsSecretDeletedMessageData =\n formMessageDataBase.append<FormSecretBaseMessageData>({\n secretName: Joi.string().required()\n })\n\nexport const formsSecretSavedMessageData =\n formMessageDataBase.append<FormSecretBaseMessageData>({\n secretName: Joi.string().required()\n })\n\nexport const dlqActionMessageData = Joi.object<DlqActionMessageData>().keys({\n action: Joi.string()\n .valid('redrive', 'delete', 'modify-and-resubmit')\n .required(),\n messageId: Joi.string().optional(),\n beforeJson: Joi.string().optional(),\n afterJson: Joi.string().optional()\n})\n\nexport const formTitleChanges = Joi.object<FormTitleChanges>()\n .keys({\n title: titleSchema\n })\n .required()\n .description('Changes schema for FORM_TITLE_UPDATED event')\n\nexport const formOrganisationChanges = Joi.object<FormOrganisationChanges>()\n .keys({\n organisation: organisationSchema\n })\n .required()\n .description('Changes schema for FORM_ORGANISATION_UPDATED event')\n\nexport const formTeamNameChanges = Joi.object<FormTeamNameChanges>()\n .keys({\n teamName: teamNameSchema\n })\n .required()\n .description('Changes schema for FORM_TEAM_NAME_UPDATED event')\n\nexport const formTeamEmailChanges = Joi.object<FormTeamEmailChanges>()\n .keys({\n teamEmail: teamEmailSchema\n })\n .required()\n .description('Changes schema for FORM_TEAM_EMAIL_UPDATED event')\n\nexport const formSupportContactChanges = Joi.object<FormSupportContactChanges>()\n .keys({\n contact: contactSchema\n })\n .required()\n .description('Changes schema for FORM_SUPPORT_CONTACT_UPDATED event')\n\nexport const formSupportPhoneChanges = Joi.object<FormSupportPhoneChanges>()\n .keys({\n phone: phoneSchema\n })\n .required()\n .description('Changes schema for FORM_SUPPORT_PHONE_UPDATED event')\n\nexport const formSupportOnlineChanges = Joi.object<FormSupportOnlineChanges>()\n .keys({\n url: onlineUrlSchema.optional(),\n text: onlineTextSchema.optional()\n })\n .required()\n .description('Changes schema for FORM_SUPPORT_ONLINE_UPDATED event')\n\nexport const formSupportEmailChanges = Joi.object<FormSupportEmailChanges>()\n .keys({\n address: emailAddressNoUnicodeSchema.optional(),\n responseTime: emailResponseTimeSchema.optional()\n })\n .description('Changes schema for FORM_SUPPORT_EMAIL_UPDATED event')\n\nexport const formPrivacyNoticeChanges = Joi.object<FormPrivacyNoticeChanges>()\n .keys({\n privacyNoticeType: privacyNoticeTypeSchema,\n privacyNoticeText: Joi.when('privacyNoticeType', {\n is: 'text',\n then: privacyNoticeTextSchema,\n otherwise: privacyNoticeTextSchema.allow('')\n }),\n privacyNoticeUrl: Joi.when('privacyNoticeType', {\n is: 'link',\n then: privacyNoticeUrlSchema,\n otherwise: privacyNoticeUrlSchema.allow('')\n })\n })\n .required()\n .description('Changes schema for FORM_PRIVACY_NOTICE_UPDATED event')\n\nexport const formTermsAndConditionsChanges =\n Joi.object<FormTermsAndConditionsChanges>()\n .keys({\n termsAndConditionsAgreed: termsAndConditionsAgreedSchema\n })\n .required()\n .description('Changes schema for FORM_TERMS_AND_CONDITIONS_AGREED event')\n\nexport const formNotificationEmailChanges =\n Joi.object<FormNotificationEmailChanges>()\n .keys({\n notificationEmail: notificationEmailAddressSchema\n })\n .required()\n .description('Changes schema for FORM_NOTIFICATION_EMAIL_UPDATED event')\n\nexport const formSubmissionGuidanceChanges =\n Joi.object<FormSubmissionGuidanceChanges>()\n .keys({\n submissionGuidance: submissionGuidanceSchema\n })\n .required()\n .description('Changes schema for FORM_SUBMISSION_GUIDANCE_UPDATED event')\n\nexport const formUploadedChanges = Joi.object<FormUploadedChanges>()\n .keys({\n value: Joi.string().required()\n })\n .required()\n .description('Changes schema for FORM_JSON_UPLOADED event')\n\nexport const formOfflineChanges = Joi.object<FormOfflineChanges>()\n .keys({\n offline: offlineSchema\n })\n .required()\n .description('Changes schema for FORM_OFFLINE_UPDATED event')\n\nexport const entitlementMessageData = Joi.object<EntitlementMessageData>().keys(\n {\n userId: Joi.string().required(),\n displayName: Joi.string().required(),\n email: emailAddressNoUnicodeSchema.required(),\n roles: Joi.array().items(Joi.string())\n }\n)\n\nexport const formFileDownloadedMessageData =\n Joi.object<FormFileDownloadedMessageData>()\n .keys({\n fileId: Joi.string().required(),\n filename: Joi.string().required(),\n fileLink: Joi.string().required()\n })\n .required()\n .description(\n 'Schema for FORM_FILE_DOWNLOAD_SUCCESS and FORM_FILE_DOWNLOAD_FAILURE events'\n )\n\nexport const excelGenerationMessageData =\n Joi.object<ExcelGenerationMessageData>()\n .keys({\n formId: Joi.string().required(),\n formName: Joi.string().required(),\n notificationEmail: emailAddressNoUnicodeSchema.required()\n })\n .required()\n .description(\n 'Schema for Excel generation audit events (submissions and CSAT)'\n )\n\nexport const authenticationMessageData =\n Joi.object<AuthenticationMessageData>().keys({\n userId: Joi.string().required(),\n displayName: Joi.string().required()\n })\n\nexport const auditUserSchema = Joi.object<AuditUser>()\n .keys({\n id: Joi.string().required(),\n displayName: Joi.string().required()\n })\n .description('Schema for CREATED_BY audit event')\n\nexport function formChangesMessageData<T, U extends FormMessageChangesData>(\n schema: ObjectSchema<T>\n): ObjectSchema<U> {\n return formMessageDataBase.append<U>({\n changes: Joi.object<ChangesMessageData<T>>()\n .keys({\n previous: schema,\n new: schema\n })\n .description('Changes schema')\n })\n}\n\nexport const messageSchema = Joi.object<AuditMessage>()\n .keys({\n schemaVersion: Joi.string()\n .valid(...Object.values(AuditEventMessageSchemaVersion))\n .required()\n .description(\n 'The version of the AuditMessage - bumped with breaking changes'\n ),\n category: Joi.string()\n .valid(...Object.values(AuditEventMessageCategory))\n .required()\n .description('The message category - what does the entityId represent?'),\n source: Joi.string()\n .valid(...Object.values(AuditEventMessageSource))\n .required()\n .description('Source of the message - which service?'),\n type: Joi.string()\n .valid(...Object.values(AuditEventMessageType))\n .description('Event type'),\n entityId: Joi.string()\n .required()\n .description('The id of the entity the category relates to'),\n traceId: Joi.string()\n .optional()\n .description(\n 'Trace id of the event - to link events across multiple services'\n ),\n createdAt: Joi.date()\n .required()\n .description(\n 'The ISO timestamp where the action took place - should be the same as updated_at field in DB'\n ),\n createdBy: auditUserSchema\n .required()\n .description('The user who performed the action being audited'),\n data: Joi.when('type', {\n switch: [\n {\n is: Joi.string().trim().valid(AuditEventMessageType.FORM_CREATED),\n then: formCreatedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TITLE_UPDATED),\n then: formChangesMessageData<\n FormTitleChanges,\n FormTitleUpdatedMessageData\n >(formTitleChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_ORGANISATION_UPDATED),\n then: formChangesMessageData<\n FormOrganisationChanges,\n FormOrganisationUpdatedMessageData\n >(formOrganisationChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TEAM_NAME_UPDATED),\n then: formChangesMessageData<\n FormTeamNameChanges,\n FormTeamNameUpdatedMessageData\n >(formTeamNameChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED),\n then: formChangesMessageData<\n FormTeamEmailChanges,\n FormTeamEmailUpdatedMessageData\n >(formTeamEmailChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_CONTACT_UPDATED),\n then: formChangesMessageData<\n FormSupportContactChanges,\n FormSupportContactUpdatedMessageData\n >(formSupportContactChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED),\n then: formChangesMessageData<\n FormSupportPhoneChanges,\n FormSupportPhoneUpdatedMessageData\n >(formSupportPhoneChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED),\n then: formChangesMessageData<\n FormSupportEmailChanges,\n FormSupportEmailUpdatedMessageData\n >(formSupportEmailChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED),\n then: formChangesMessageData<\n FormSupportOnlineChanges,\n FormSupportOnlineUpdatedMessageData\n >(formSupportOnlineChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED),\n then: formChangesMessageData<\n FormPrivacyNoticeChanges,\n FormPrivacyNoticeUpdatedMessageData\n >(formPrivacyNoticeChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_TERMS_AND_CONDITIONS_AGREED),\n then: formChangesMessageData<\n FormTermsAndConditionsChanges,\n FormTermsAndConditionsAgreedMessageData\n >(formTermsAndConditionsChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED),\n then: formChangesMessageData<\n FormNotificationEmailChanges,\n FormNotificationEmailUpdatedMessageData\n >(formNotificationEmailChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED),\n then: formChangesMessageData<\n FormSubmissionGuidanceChanges,\n FormSubmissionGuidanceUpdatedMessageData\n >(formSubmissionGuidanceChanges)\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_JSON_UPLOADED),\n then: formChangesMessageData<\n FormUploadedChanges,\n FormUploadedMessageData\n >(formUploadedChanges)\n },\n {\n is: Joi.string().trim().valid(AuditEventMessageType.FORM_UPDATED),\n then: formUpdatedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.ENTITLEMENT_CREATED,\n AuditEventMessageType.ENTITLEMENT_UPDATED,\n AuditEventMessageType.ENTITLEMENT_DELETED\n ),\n then: entitlementMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_DRAFT_DELETED),\n then: formMessageDataBase\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_JSON_DOWNLOADED),\n then: formMessageDataBase\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.AUTHENTICATION_LOGIN,\n AuditEventMessageType.AUTHENTICATION_LOGOUT_MANUAL,\n AuditEventMessageType.AUTHENTICATION_LOGOUT_AUTO,\n AuditEventMessageType.AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE\n ),\n then: authenticationMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.FORM_FILE_DOWNLOAD_SUCCESS,\n AuditEventMessageType.FORM_FILE_DOWNLOAD_FAILURE\n ),\n then: formFileDownloadedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(\n AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED,\n AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED,\n AuditEventMessageType.PLATFORM_CSAT_EXCEL_REQUESTED\n ),\n then: excelGenerationMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORMS_BACKUP_REQUESTED),\n then: formsBackupRequestedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SECRET_DELETED),\n then: formsSecretDeletedMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_SECRET_SAVED),\n then: formsSecretSavedMessageData\n },\n {\n is: Joi.string().trim().valid(AuditEventMessageType.DLQ_ACTION),\n then: dlqActionMessageData\n },\n {\n is: Joi.string()\n .trim()\n .valid(AuditEventMessageType.FORM_OFFLINE_UPDATED),\n then: formChangesMessageData<\n FormOfflineChanges,\n FormOfflineUpdatedMessageData\n >(formOfflineChanges)\n }\n ],\n otherwise: Joi.forbidden()\n }).description('The data/payload of the audit message'),\n messageCreatedAt: Joi.date()\n .required()\n .description('ISO timestamp when the message was published')\n })\n .required()\n .description('The audit message issued by the publishing service')\n\nexport const auditEvent = Joi.object<AuditEvent>()\n .keys({\n message: messageSchema\n })\n .description('The Body of the audit event')\n\nexport const auditRecord = messageSchema\n .append<AuditRecord>({\n id: idSchema,\n messageId: Joi.string().uuid().required(),\n entityId: Joi.string().required(),\n recordCreatedAt: Joi.date().required()\n })\n .description('The audit record persisted into the DB')\n"],"mappings":"AAAA,OAAOA,GAAG,MAA6B,KAAK;AAE5C,SACEC,yBAAyB,EACzBC,8BAA8B,EAC9BC,uBAAuB,EACvBC,qBAAqB,EACrBC,yBAAyB;AAmD3B,SAASC,2BAA2B;AACpC,SACEC,aAAa,EACbC,uBAAuB,EACvBC,QAAQ,EACRC,8BAA8B,EAC9BC,aAAa,EACbC,gBAAgB,EAChBC,eAAe,EACfC,kBAAkB,EAClBC,WAAW,EACXC,uBAAuB,EACvBC,uBAAuB,EACvBC,sBAAsB,EACtBC,UAAU,EACVC,wBAAwB,EACxBC,eAAe,EACfC,cAAc,EACdC,8BAA8B,EAC9BC,WAAW;AAGb,OAAO,MAAMC,mBAAmB,GAAGzB,GAAG,CAAC0B,MAAM,CAAsB;EACjEC,MAAM,EAAElB,QAAQ;EAChBmB,IAAI,EAAET,UAAU;EAChBU,OAAO,EAAE7B,GAAG,CAAC0B,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC;AACjC,CAAC,CAAC,CACCC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,wCAAwC,CAAC;AAExD,OAAO,MAAMC,sBAAsB,GAAGR,mBAAmB,CACtDS,MAAM,CAAyB;EAC9BC,KAAK,EAAEX,WAAW;EAClBY,YAAY,EAAEtB,kBAAkB;EAChCuB,QAAQ,EAAEf,cAAc;EACxBgB,SAAS,EAAEjB;AACb,CAAC,CAAC,CACDU,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,gDAAgD,CAAC;AAEhE,OAAO,MAAMO,oBAAoB,GAAGvC,GAAG,CAAC0B,MAAM,CAAuB,CAAC,CACnEc,IAAI,CAAC;EACJC,MAAM,EAAEzC,GAAG,CAAC0C,MAAM,CAAC,CAAC,CAACX,QAAQ,CAAC,CAAC;EAC/BY,QAAQ,EAAE3C,GAAG,CAAC0C,MAAM,CAAC,CAAC,CAACX,QAAQ,CAAC,CAAC;E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AW,CAAC,uCAAuC,CAAC;EACvDgJ,gBAAgB,EAAEhL,GAAG,CAACyI,IAAI,CAAC,CAAC,CACzB1G,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,8CAA8C;AAC/D,CAAC,CAAC,CACDD,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,oDAAoD,CAAC;AAEpE,OAAO,MAAMiJ,UAAU,GAAGjL,GAAG,CAAC0B,MAAM,CAAa,CAAC,CAC/Cc,IAAI,CAAC;EACJ0I,OAAO,EAAEjD;AACX,CAAC,CAAC,CACDjG,WAAW,CAAC,6BAA6B,CAAC;AAE7C,OAAO,MAAMmJ,WAAW,GAAGlD,aAAa,CACrC/F,MAAM,CAAc;EACnB2F,EAAE,EAAEpH,QAAQ;EACZsE,SAAS,EAAE/E,GAAG,CAAC0C,MAAM,CAAC,CAAC,CAAC0I,IAAI,CAAC,CAAC,CAACrJ,QAAQ,CAAC,CAAC;EACzCuG,QAAQ,EAAEtI,GAAG,CAAC0C,MAAM,CAAC,CAAC,CAACX,QAAQ,CAAC,CAAC;EACjCsJ,eAAe,EAAErL,GAAG,CAACyI,IAAI,CAAC,CAAC,CAAC1G,QAAQ,CAAC;AACvC,CAAC,CAAC,CACDC,WAAW,CAAC,wCAAwC,CAAC","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Identifies a submission email target by its stored values. Unlike
3
+ * `getOutputKey`, which decides whether two outputs are duplicates of one
4
+ * another, this comparison is exact - changing only the case of an address is
5
+ * still a change worth recording against the form.
6
+ * @param output - submission email target
7
+ */
8
+ function getComparisonKey(output) {
9
+ return JSON.stringify([output.emailAddress, output.audience, output.version, output.condition ?? '']);
10
+ }
11
+ /**
12
+ * Works out what changed between two sets of submission email targets, in the
13
+ * shape the audit record expects.
14
+ *
15
+ * Outputs carry no id of their own, so an amendment cannot be spotted directly.
16
+ * An entry that disappears from a position while another appears at that same
17
+ * position is treated as an amendment rather than as an unrelated removal and
18
+ * addition - which is what the editor does when an author changes an existing
19
+ * email action. Anything left over is reported as a plain addition or removal,
20
+ * so a wholesale replacement (a JSON upload, say) still records honestly.
21
+ * @param previous - outputs before the update
22
+ * @param next - outputs after the update
23
+ * @returns the changes, or undefined when the outputs are untouched
24
+ */
25
+ export function getFormOutputChanges(previous, next) {
26
+ const previousOutputs = previous ?? [];
27
+ const nextOutputs = next ?? [];
28
+ const previousKeys = new Set(previousOutputs.map(getComparisonKey));
29
+ const nextKeys = new Set(nextOutputs.map(getComparisonKey));
30
+ const position = (output, index) => ({
31
+ output,
32
+ index
33
+ });
34
+ const removed = previousOutputs.map((o, i) => position(o, i)).filter(({
35
+ output
36
+ }) => !nextKeys.has(getComparisonKey(output)));
37
+ const added = nextOutputs.map((o, i) => position(o, i)).filter(({
38
+ output
39
+ }) => !previousKeys.has(getComparisonKey(output)));
40
+ const updated = removed.flatMap(before => {
41
+ const after = added.find(({
42
+ index
43
+ }) => index === before.index);
44
+ if (!after) {
45
+ return [];
46
+ }
47
+ return [{
48
+ previous: before.output,
49
+ new: after.output
50
+ }];
51
+ });
52
+ const pureAdditions = added.filter(({
53
+ index
54
+ }) => !removed.some(before => before.index === index)).map(({
55
+ output
56
+ }) => output);
57
+ const pureRemovals = removed.filter(({
58
+ index
59
+ }) => !added.some(after => after.index === index)).map(({
60
+ output
61
+ }) => output);
62
+ const changes = {};
63
+ if (pureAdditions.length) {
64
+ changes.added = pureAdditions;
65
+ }
66
+ if (updated.length) {
67
+ changes.updated = updated;
68
+ }
69
+ if (pureRemovals.length) {
70
+ changes.removed = pureRemovals;
71
+ }
72
+ return Object.keys(changes).length ? changes : undefined;
73
+ }
74
+ //# sourceMappingURL=output-changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-changes.js","names":["getComparisonKey","output","JSON","stringify","emailAddress","audience","version","condition","getFormOutputChanges","previous","next","previousOutputs","nextOutputs","previousKeys","Set","map","nextKeys","position","index","removed","o","i","filter","has","added","updated","flatMap","before","after","find","new","pureAdditions","some","pureRemovals","changes","length","Object","keys","undefined"],"sources":["../../../../src/form/form-audit/output-changes.ts"],"sourcesContent":["import { type FormOutputChanges } from '~/src/form/form-audit/types.js'\nimport { type Output } from '~/src/form/form-definition/types.js'\n\n/**\n * Identifies a submission email target by its stored values. Unlike\n * `getOutputKey`, which decides whether two outputs are duplicates of one\n * another, this comparison is exact - changing only the case of an address is\n * still a change worth recording against the form.\n * @param output - submission email target\n */\nfunction getComparisonKey(output: Output): string {\n return JSON.stringify([\n output.emailAddress,\n output.audience,\n output.version,\n output.condition ?? ''\n ])\n}\n\ninterface PositionedOutput {\n output: Output\n index: number\n}\n\n/**\n * Works out what changed between two sets of submission email targets, in the\n * shape the audit record expects.\n *\n * Outputs carry no id of their own, so an amendment cannot be spotted directly.\n * An entry that disappears from a position while another appears at that same\n * position is treated as an amendment rather than as an unrelated removal and\n * addition - which is what the editor does when an author changes an existing\n * email action. Anything left over is reported as a plain addition or removal,\n * so a wholesale replacement (a JSON upload, say) still records honestly.\n * @param previous - outputs before the update\n * @param next - outputs after the update\n * @returns the changes, or undefined when the outputs are untouched\n */\nexport function getFormOutputChanges(\n previous: Output[] | undefined,\n next: Output[] | undefined\n): FormOutputChanges | undefined {\n const previousOutputs = previous ?? []\n const nextOutputs = next ?? []\n\n const previousKeys = new Set(previousOutputs.map(getComparisonKey))\n const nextKeys = new Set(nextOutputs.map(getComparisonKey))\n\n const position = (output: Output, index: number): PositionedOutput => ({\n output,\n index\n })\n\n const removed: PositionedOutput[] = previousOutputs\n .map((o, i) => position(o, i))\n .filter(({ output }) => !nextKeys.has(getComparisonKey(output)))\n\n const added: PositionedOutput[] = nextOutputs\n .map((o, i) => position(o, i))\n .filter(({ output }) => !previousKeys.has(getComparisonKey(output)))\n\n const updated = removed.flatMap((before) => {\n const after = added.find(({ index }) => index === before.index)\n\n if (!after) {\n return []\n }\n\n return [{ previous: before.output, new: after.output }]\n })\n\n const pureAdditions = added\n .filter(({ index }) => !removed.some((before) => before.index === index))\n .map(({ output }) => output)\n\n const pureRemovals = removed\n .filter(({ index }) => !added.some((after) => after.index === index))\n .map(({ output }) => output)\n\n const changes: FormOutputChanges = {}\n\n if (pureAdditions.length) {\n changes.added = pureAdditions\n }\n\n if (updated.length) {\n changes.updated = updated\n }\n\n if (pureRemovals.length) {\n changes.removed = pureRemovals\n }\n\n return Object.keys(changes).length ? changes : undefined\n}\n"],"mappings":"AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgBA,CAACC,MAAc,EAAU;EAChD,OAAOC,IAAI,CAACC,SAAS,CAAC,CACpBF,MAAM,CAACG,YAAY,EACnBH,MAAM,CAACI,QAAQ,EACfJ,MAAM,CAACK,OAAO,EACdL,MAAM,CAACM,SAAS,IAAI,EAAE,CACvB,CAAC;AACJ;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClCC,QAA8B,EAC9BC,IAA0B,EACK;EAC/B,MAAMC,eAAe,GAAGF,QAAQ,IAAI,EAAE;EACtC,MAAMG,WAAW,GAAGF,IAAI,IAAI,EAAE;EAE9B,MAAMG,YAAY,GAAG,IAAIC,GAAG,CAACH,eAAe,CAACI,GAAG,CAACf,gBAAgB,CAAC,CAAC;EACnE,MAAMgB,QAAQ,GAAG,IAAIF,GAAG,CAACF,WAAW,CAACG,GAAG,CAACf,gBAAgB,CAAC,CAAC;EAE3D,MAAMiB,QAAQ,GAAGA,CAAChB,MAAc,EAAEiB,KAAa,MAAwB;IACrEjB,MAAM;IACNiB;EACF,CAAC,CAAC;EAEF,MAAMC,OAA2B,GAAGR,eAAe,CAChDI,GAAG,CAAC,CAACK,CAAC,EAAEC,CAAC,KAAKJ,QAAQ,CAACG,CAAC,EAAEC,CAAC,CAAC,CAAC,CAC7BC,MAAM,CAAC,CAAC;IAAErB;EAAO,CAAC,KAAK,CAACe,QAAQ,CAACO,GAAG,CAACvB,gBAAgB,CAACC,MAAM,CAAC,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,aAAa;EAC/B;EAEA,IAAIN,OAAO,CAACU,MAAM,EAAE;IAClBD,OAAO,CAACT,OAAO,GAAGA,OAAO;EAC3B;EAEA,IAAIQ,YAAY,CAACE,MAAM,EAAE;IACvBD,OAAO,CAACf,OAAO,GAAGc,YAAY;EAChC;EAEA,OAAOG,MAAM,CAACC,IAAI,CAACH,OAAO,CAAC,CAACC,MAAM,GAAGD,OAAO,GAAGI,SAAS;AAC1D","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 FormOfflineChanges {\n offline: boolean\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 FormOfflineUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormOfflineChanges>\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 | FormOfflineUpdatedMessageData\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 FormOfflineUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_OFFLINE_UPDATED\n data: FormOfflineUpdatedMessageData\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 | FormOfflineUpdatedMessage\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 Output } from '~/src/form/form-definition/types.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 FormOfflineChanges {\n offline: boolean\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 FormOfflineUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormOfflineChanges>\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\n/**\n * What a single form update did to the form's submission email targets (the\n * `outputs` on the definition, surfaced to authors as \"email actions\").\n *\n * A `REPLACE_DRAFT` update carries the whole definition, so the audit message\n * would otherwise say nothing about which email address was added, amended or\n * removed. Collections that are empty are omitted, and the object as a whole is\n * absent from an update that left the outputs untouched.\n *\n * Validated by `formOutputChangesMessageData`.\n */\nexport interface FormOutputChanges {\n /**\n * Email targets the update introduced\n */\n added?: Output[]\n\n /**\n * Email targets the update amended, with the values either side of the change\n */\n updated?: ChangesMessageData<Output>[]\n\n /**\n * Email targets the update took away - either deleted directly by the author,\n * or removed as a consequence of deleting the condition they depended on\n */\n removed?: Output[]\n}\n\nexport interface FormUpdatedMessageData extends FormMessageDataBase {\n requestType: FormDefinitionRequestType\n s3Meta?: FormDefinitionS3Meta\n\n /**\n * What this update did to the form's submission email targets. Absent when\n * the update did not touch them.\n *\n * A `DELETE_CONDITION` update reports the outputs that went with the\n * condition, so the removal is recorded against the action that caused it\n * rather than being left to be inferred from a neighbouring event.\n */\n outputChanges?: FormOutputChanges\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 | FormOfflineUpdatedMessageData\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 FormOfflineUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_OFFLINE_UPDATED\n data: FormOfflineUpdatedMessageData\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 | FormOfflineUpdatedMessage\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 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-submission/types.ts"],"sourcesContent":["import { type FormStatus } from '~/src/common/enums.js'\nimport {\n type ConditionEvaluationOutcome,\n type SecurityQuestionsEnum,\n type SubmissionEventMessageCategory,\n type SubmissionEventMessageSchemaVersion,\n type SubmissionEventMessageSource,\n type SubmissionEventMessageType\n} from '~/src/form/form-submission/enums.js'\nimport {\n formSubmitConditionEvaluationSchema,\n formSubmitConditionReferenceSchema,\n formSubmitPayloadSchema,\n formSubmitRecordSchema,\n formSubmitRecordsetSchema\n} from '~/src/form/form-submission/index.js'\n\n/**\n * Interface for an individual submit record\n * @see {@link formSubmitRecordSchema}\n */\nexport interface SubmitRecord {\n /**\n * The field name\n */\n name: string\n\n /**\n * The field title\n */\n title: string\n\n /**\n * The field display value\n */\n value: string\n}\n\n/**\n * Interface for an individual submit recordset (e.g. a repeater question set)\n * @see {@link formSubmitRecordsetSchema}\n */\nexport interface SubmitRecordset {\n /**\n * The name of the recordset\n */\n name: string\n\n /**\n * The title of the recordset\n */\n title: string\n\n /**\n * The record items\n */\n value: SubmitRecord[][]\n}\n\n/**\n * A component referenced by a condition, and whether the user had answered it\n * when the condition was evaluated.\n *\n * An unanswered question is not absent from the runner's evaluation context -\n * it is present as `null` - so conditions still return a boolean for questions\n * that were skipped or never reached. Negative operators (\"is not\", \"is shorter\n * than\") return `true` in that case. Without knowing which referenced questions\n * were answered, a consumer cannot tell a real match from a vacuous one.\n * @see {@link formSubmitConditionReferenceSchema}\n */\nexport interface SubmitConditionReference {\n /**\n * The id of the referenced component\n */\n componentId: string\n\n /**\n * The name of the referenced component, as used in the submitted records\n */\n componentName: string\n\n /**\n * Whether the referenced component held an answer at the point of evaluation\n */\n answered: boolean\n}\n\n/**\n * The recorded outcome of a single condition at the point of submission.\n * V2 forms only - V1 conditions are not captured.\n * @see {@link formSubmitConditionEvaluationSchema}\n */\nexport interface SubmitConditionEvaluation {\n /**\n * The id of the condition, as authored in the V2 form definition\n */\n conditionId: string\n\n /**\n * The result of evaluating the condition\n */\n outcome: ConditionEvaluationOutcome\n\n /**\n * Every component the condition depends on, including those reached through\n * nested condition references, and whether each was answered\n */\n references: SubmitConditionReference[]\n}\n\n/**\n * Interface for the submission-api `/submit` payload\n * @see {@link formSubmitPayloadSchema}\n */\nexport interface SubmitPayload {\n /**\n * The retrieval key for files created in the submission\n */\n retrievalKey: string\n\n /**\n * The id of the user session\n */\n sessionId: string\n\n /**\n * The reference number of the user session\n */\n referenceNumber?: string\n\n /**\n * The currently-selected language at the point of submission\n */\n language?: string\n\n /**\n * The main form anwsers\n */\n main: SubmitRecord[]\n\n /**\n * The repeaters form answers\n */\n repeaters: SubmitRecordset[]\n}\n\n/**\n * Interface for the submission-api `/submit` response payload\n */\nexport interface SubmitResponsePayload {\n message: string\n result: {\n files: {\n main: string\n repeaters: Record<string, string>\n }\n }\n}\n\nexport interface SaveAndExitMessageData {\n magicLinkGroupId?: string\n form: {\n id: string\n title: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n security: {\n question: SecurityQuestionsEnum\n answer: string\n }\n state: object\n}\n\nexport interface SaveAndExitV2MessageData {\n magicLinkGroupId?: string\n form: {\n id: string\n title: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n auth: {\n sub: string\n issuer: string\n }\n state: object\n}\n\nexport interface SaveAndExitMessage {\n schemaVersion: SubmissionEventMessageSchemaVersion\n source: SubmissionEventMessageSource\n createdAt: Date\n messageCreatedAt: Date\n category: SubmissionEventMessageCategory.RUNNER\n type:\n | SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT\n | SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT_V2\n data: SaveAndExitMessageData\n}\n\nexport interface SaveAndExitV2Message {\n schemaVersion: SubmissionEventMessageSchemaVersion\n source: SubmissionEventMessageSource\n createdAt: Date\n messageCreatedAt: Date\n category: SubmissionEventMessageCategory.RUNNER\n type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT_V2\n data: SaveAndExitV2MessageData\n}\n\nexport interface SaveAndExitRecord {\n magicLinkId: string\n magicLinkGroupId?: string\n form: {\n id: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n security: {\n question: SecurityQuestionsEnum\n answer: string\n }\n state: object\n invalidPasswordAttempts: number\n createdAt: Date\n}\n\nexport interface SaveAndExitV2Record {\n magicLinkId: string\n magicLinkGroupId?: string\n form: {\n id: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n auth: {\n sub: string\n issuer: string\n }\n state: object\n createdAt: Date\n}\n\nexport type RunnerMessage = SaveAndExitMessage\n\nexport interface RunnerRecordBase {\n messageId: string\n recordCreatedAt: Date\n}\n\nexport interface RunnerRecordInputMeta extends RunnerRecordBase {\n id: string\n}\n\nexport type RunnerRecordInput = RunnerMessage & RunnerRecordBase\n\nexport type RunnerRecord = RunnerMessage & RunnerRecordInputMeta\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-submission/types.ts"],"sourcesContent":["import { type FormStatus } from '~/src/common/enums.js'\nimport {\n type ConditionEvaluationOutcome,\n type SecurityQuestionsEnum,\n type SubmissionEventMessageCategory,\n type SubmissionEventMessageSchemaVersion,\n type SubmissionEventMessageSource,\n type SubmissionEventMessageType\n} from '~/src/form/form-submission/enums.js'\nimport {\n formSubmitConditionEvaluationSchema,\n formSubmitConditionReferenceSchema,\n formSubmitPayloadSchema,\n formSubmitRecordSchema,\n formSubmitRecordsetSchema\n} from '~/src/form/form-submission/index.js'\n\n/**\n * Interface for an individual submit record\n * @see {@link formSubmitRecordSchema}\n */\nexport interface SubmitRecord {\n /**\n * The field name\n */\n name: string\n\n /**\n * The field title\n */\n title: string\n\n /**\n * The field display value\n */\n value: string\n}\n\n/**\n * Interface for an individual submit recordset (e.g. a repeater question set)\n * @see {@link formSubmitRecordsetSchema}\n */\nexport interface SubmitRecordset {\n /**\n * The name of the recordset\n */\n name: string\n\n /**\n * The title of the recordset\n */\n title: string\n\n /**\n * The record items\n */\n value: SubmitRecord[][]\n}\n\n/**\n * A component referenced by a condition, and whether the user had answered it\n * when the condition was evaluated.\n *\n * An unanswered question is not absent from the runner's evaluation context -\n * it is present as `null` - so conditions still return a boolean for questions\n * that were skipped or never reached. Negative operators (\"is not\", \"is shorter\n * than\") return `true` in that case. Without knowing which referenced questions\n * were answered, a consumer cannot tell a real match from a vacuous one.\n * @see {@link formSubmitConditionReferenceSchema}\n */\nexport interface SubmitConditionReference {\n /**\n * The id of the referenced component\n */\n componentId: string\n\n /**\n * The name of the referenced component, as used in the submitted records\n */\n componentName: string\n\n /**\n * Whether the referenced component held an answer at the point of evaluation\n */\n answered: boolean\n}\n\n/**\n * The recorded outcome of a single condition at the point of submission.\n * V2 forms only - V1 conditions are not captured.\n * @see {@link formSubmitConditionEvaluationSchema}\n */\nexport interface SubmitConditionEvaluation {\n /**\n * The id of the condition, as authored in the V2 form definition\n */\n conditionId: string\n\n /**\n * The result of evaluating the condition\n */\n outcome: ConditionEvaluationOutcome\n\n /**\n * Every component the condition depends on, including those reached through\n * nested condition references, and whether each was answered\n */\n references: SubmitConditionReference[]\n}\n\n/**\n * Interface for the submission-api `/submit` payload\n * @see {@link formSubmitPayloadSchema}\n */\nexport interface SubmitPayload {\n /**\n * The retrieval key for files created in the submission\n */\n retrievalKey: string\n\n /**\n * The id of the user session\n */\n sessionId: string\n\n /**\n * The reference number of the user session\n */\n referenceNumber?: string\n\n /**\n * The currently-selected language at the point of submission\n */\n language?: string\n\n /**\n * The main form anwsers\n */\n main: SubmitRecord[]\n\n /**\n * The repeaters form answers\n */\n repeaters: SubmitRecordset[]\n}\n\n/**\n * Interface for the submission-api `/submit` response payload\n */\nexport interface SubmitResponsePayload {\n message: string\n result: {\n files: {\n main: string\n repeaters: Record<string, string>\n }\n }\n}\n\nexport interface SaveAndExitMessageData {\n magicLinkGroupId?: string\n form: {\n id: string\n title: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n security: {\n question: SecurityQuestionsEnum\n answer: string\n }\n state: object\n}\n\nexport interface SaveAndExitV2MessageData {\n magicLinkGroupId?: string\n form: {\n id: string\n title: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n auth: {\n sub: string\n issuer: string\n }\n state: object\n}\n\nexport interface SaveAndExitMessage {\n schemaVersion: SubmissionEventMessageSchemaVersion\n source: SubmissionEventMessageSource\n createdAt: Date\n messageCreatedAt: Date\n category: SubmissionEventMessageCategory.RUNNER\n type:\n | SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT\n | SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT_V2\n data: SaveAndExitMessageData\n}\n\nexport interface SaveAndExitV2Message {\n schemaVersion: SubmissionEventMessageSchemaVersion\n source: SubmissionEventMessageSource\n createdAt: Date\n messageCreatedAt: Date\n category: SubmissionEventMessageCategory.RUNNER\n type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT_V2\n data: SaveAndExitV2MessageData\n}\n\nexport interface SavedState {\n $$__referenceNumber: string\n [key: string]: any\n}\n\nexport interface SaveAndExitRecord {\n magicLinkId: string\n magicLinkGroupId?: string\n form: {\n id: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n security: {\n question: SecurityQuestionsEnum\n answer: string\n }\n state: object\n invalidPasswordAttempts: number\n createdAt: Date\n}\n\nexport interface SaveAndExitV2Record {\n magicLinkId: string\n magicLinkGroupId?: string\n form: {\n id: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n auth: {\n sub: string\n issuer: string\n }\n state: SavedState\n createdAt: Date\n}\n\nexport type RunnerMessage = SaveAndExitMessage\n\nexport interface RunnerRecordBase {\n messageId: string\n recordCreatedAt: Date\n}\n\nexport interface RunnerRecordInputMeta extends RunnerRecordBase {\n id: string\n}\n\nexport type RunnerRecordInput = RunnerMessage & RunnerRecordBase\n\nexport type RunnerRecord = RunnerMessage & RunnerRecordInputMeta\n"],"mappings":"","ignoreList":[]}
@@ -33,6 +33,7 @@ export * from "./utils/set-property.js";
33
33
  export * from "./form/form-audit/index.js";
34
34
  export * from "./form/form-audit/enums.js";
35
35
  export * from "./form/form-audit/consolidation.js";
36
+ export * from "./form/form-audit/output-changes.js";
36
37
 
37
38
  // test
38
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-definition/helpers.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-metrics/enums.js'\nexport * from '~/src/form/form-metrics/types.js'\nexport * from '~/src/form/form-metrics/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/enums.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-editor/translations/translations-config.js'\nexport * from '~/src/form/form-editor/translations/translations.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/dead-letter-queues.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/utils/set-property.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\nexport * from '~/src/form/form-audit/consolidation.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n\n// test\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-definition/helpers.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-metrics/enums.js'\nexport * from '~/src/form/form-metrics/types.js'\nexport * from '~/src/form/form-metrics/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/enums.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-editor/translations/translations-config.js'\nexport * from '~/src/form/form-editor/translations/translations.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/dead-letter-queues.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/utils/set-property.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\nexport * from '~/src/form/form-audit/consolidation.js'\nexport * from '~/src/form/form-audit/output-changes.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n\n// test\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import Joi, { type ObjectSchema } from 'joi';
2
- import { type AuditEvent, type AuditMessage, type AuditRecord, type AuditUser, type AuthenticationMessageData, type DlqActionMessageData, type EntitlementMessageData, type ExcelGenerationMessageData, type FormCreatedMessageData, type FormDefinitionS3Meta, type FormFileDownloadedMessageData, type FormMessageChangesData, type FormMessageDataBase, type FormNotificationEmailChanges, type FormOfflineChanges, type FormOrganisationChanges, type FormPrivacyNoticeChanges, type FormSecretBaseMessageData, type FormSubmissionGuidanceChanges, type FormSupportContactChanges, type FormSupportEmailChanges, type FormSupportOnlineChanges, type FormSupportPhoneChanges, type FormTeamEmailChanges, type FormTeamNameChanges, type FormTermsAndConditionsChanges, type FormTitleChanges, type FormUpdatedMessageData, type FormUploadedChanges, type FormsBackupRequestedMessageData } from '../../form/form-audit/types.js';
2
+ import { type AuditEvent, type AuditMessage, type AuditRecord, type AuditUser, type AuthenticationMessageData, type DlqActionMessageData, type EntitlementMessageData, type ExcelGenerationMessageData, type FormCreatedMessageData, type FormDefinitionS3Meta, type FormFileDownloadedMessageData, type FormMessageChangesData, type FormMessageDataBase, type FormNotificationEmailChanges, type FormOfflineChanges, type FormOrganisationChanges, type FormOutputChanges, type FormPrivacyNoticeChanges, type FormSecretBaseMessageData, type FormSubmissionGuidanceChanges, type FormSupportContactChanges, type FormSupportEmailChanges, type FormSupportOnlineChanges, type FormSupportPhoneChanges, type FormTeamEmailChanges, type FormTeamNameChanges, type FormTermsAndConditionsChanges, type FormTitleChanges, type FormUpdatedMessageData, type FormUploadedChanges, type FormsBackupRequestedMessageData } from '../../form/form-audit/types.js';
3
3
  import { type Output } from '../../form/form-definition/types.js';
4
4
  export declare const formMessageDataBase: Joi.ObjectSchema<FormMessageDataBase>;
5
5
  export declare const formCreatedMessageData: Joi.ObjectSchema<FormCreatedMessageData>;
@@ -10,6 +10,7 @@ export declare const formDefinitionS3Meta: Joi.ObjectSchema<FormDefinitionS3Meta
10
10
  * meaning on an audit message carrying the output on its own.
11
11
  */
12
12
  export declare const formOutputMessageData: Joi.ObjectSchema<Output>;
13
+ export declare const formOutputChangesMessageData: Joi.ObjectSchema<FormOutputChanges>;
13
14
  export declare const formUpdatedMessageData: Joi.ObjectSchema<FormUpdatedMessageData>;
14
15
  export declare const formsBackupRequestedMessageData: Joi.ObjectSchema<FormsBackupRequestedMessageData>;
15
16
  export declare const formsSecretDeletedMessageData: Joi.ObjectSchema<FormSecretBaseMessageData>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-audit/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,KAAK,YAAY,EAAE,MAAM,KAAK,CAAA;AAS5C,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAE9B,KAAK,oBAAoB,EACzB,KAAK,s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AwB,4CAeiC,CAAA;AAEtE,eAAO,MAAM,6BAA6B,iDAMmC,CAAA;AAE7E,eAAO,MAAM,4BAA4B,gDAMmC,CAAA;AAE5E,eAAO,MAAM,6BAA6B,iDAMmC,CAAA;AAE7E,eAAO,MAAM,mBAAmB,uCAK6B,CAAA;AAE7D,eAAO,MAAM,kBAAkB,sCAKgC,CAAA;AAE/D,eAAO,MAAM,sBAAsB,0CAOlC,CAAA;AAED,eAAO,MAAM,6BAA6B,iDAUrC,CAAA;AAEL,eAAO,MAAM,0BAA0B,8CAUlC,CAAA;AAEL,eAAO,MAAM,yBAAyB,6CAIlC,CAAA;AAEJ,eAAO,MAAM,eAAe,6BAKuB,CAAA;AAEnD,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,SAAS,sBAAsB,EACxE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,YAAY,CAAC,CAAC,CAAC,CASjB;AAED,eAAO,MAAM,aAAa,gCA6P0C,CAAA;AAEpE,eAAO,MAAM,UAAU,8BAIsB,CAAA;AAE7C,eAAO,MAAM,WAAW,+BAOgC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { type FormOutputChanges } from '../../form/form-audit/types.js';
2
+ import { type Output } from '../../form/form-definition/types.js';
3
+ /**
4
+ * Works out what changed between two sets of submission email targets, in the
5
+ * shape the audit record expects.
6
+ *
7
+ * Outputs carry no id of their own, so an amendment cannot be spotted directly.
8
+ * An entry that disappears from a position while another appears at that same
9
+ * position is treated as an amendment rather than as an unrelated removal and
10
+ * addition - which is what the editor does when an author changes an existing
11
+ * email action. Anything left over is reported as a plain addition or removal,
12
+ * so a wholesale replacement (a JSON upload, say) still records honestly.
13
+ * @param previous - outputs before the update
14
+ * @param next - outputs after the update
15
+ * @returns the changes, or undefined when the outputs are untouched
16
+ */
17
+ export declare function getFormOutputChanges(previous: Output[] | undefined, next: Output[] | undefined): FormOutputChanges | undefined;
18
+ //# sourceMappingURL=output-changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-changes.d.ts","sourceRoot":"","sources":["../../../../src/form/form-audit/output-changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qCAAqC,CAAA;AAuBjE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAC9B,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,GACzB,iBAAiB,GAAG,SAAS,CAqD/B"}
@@ -1,4 +1,5 @@
1
1
  import { type AuditEventMessageCategory, type AuditEventMessageSchemaVersion, type AuditEventMessageSource, type AuditEventMessageType, type FormDefinitionRequestType } from '../../form/form-audit/enums.js';
2
+ import { type Output } from '../../form/form-definition/types.js';
2
3
  import { type FormMetadataContact } from '../../form/form-metadata/types.js';
3
4
  export interface FormMessageDataBase {
4
5
  formId: string;
@@ -123,9 +124,44 @@ export interface FormDefinitionS3Meta {
123
124
  filename: string;
124
125
  s3Key: string;
125
126
  }
127
+ /**
128
+ * What a single form update did to the form's submission email targets (the
129
+ * `outputs` on the definition, surfaced to authors as "email actions").
130
+ *
131
+ * A `REPLACE_DRAFT` update carries the whole definition, so the audit message
132
+ * would otherwise say nothing about which email address was added, amended or
133
+ * removed. Collections that are empty are omitted, and the object as a whole is
134
+ * absent from an update that left the outputs untouched.
135
+ *
136
+ * Validated by `formOutputChangesMessageData`.
137
+ */
138
+ export interface FormOutputChanges {
139
+ /**
140
+ * Email targets the update introduced
141
+ */
142
+ added?: Output[];
143
+ /**
144
+ * Email targets the update amended, with the values either side of the change
145
+ */
146
+ updated?: ChangesMessageData<Output>[];
147
+ /**
148
+ * Email targets the update took away - either deleted directly by the author,
149
+ * or removed as a consequence of deleting the condition they depended on
150
+ */
151
+ removed?: Output[];
152
+ }
126
153
  export interface FormUpdatedMessageData extends FormMessageDataBase {
127
154
  requestType: FormDefinitionRequestType;
128
155
  s3Meta?: FormDefinitionS3Meta;
156
+ /**
157
+ * What this update did to the form's submission email targets. Absent when
158
+ * the update did not touch them.
159
+ *
160
+ * A `DELETE_CONDITION` update reports the outputs that went with the
161
+ * condition, so the removal is recorded against the action that caused it
162
+ * rather than being left to be inferred from a neighbouring event.
163
+ */
164
+ outputChanges?: FormOutputChanges;
129
165
  }
130
166
  export type FormMessageChangesData = FormTitleUpdatedMessageData | FormOrganisationUpdatedMessageData | FormTeamNameUpdatedMessageData | FormTeamEmailUpdatedMessageData | FormSupportContactUpdatedMessageData | FormSupportPhoneUpdatedMessageData | FormSupportEmailUpdatedMessageData | FormSupportOnlineUpdatedMessageData | FormPrivacyNoticeUpdatedMessageData | FormTermsAndConditionsAgreedMessageData | FormNotificationEmailUpdatedMessageData | FormSubmissionGuidanceUpdatedMessageData | FormUploadedMessageData | FormOfflineUpdatedMessageData;
131
167
  export type FormMessageActivitiesData = FormCreatedMessageData | FormMessageDataBase | FormFileDownloadedMessageData;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-audit/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AAE5E,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAA;IACX,GAAG,EAAE,CAAC,CAAA;CACP;AAED,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,KAAK,EAAE,MAAM,CAAA;IAC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gBAAgB,CAAA;AAEpB,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,YAAY,CAAA;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAA;AAE3D,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,cAAc,CAAA;AAEvD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,qDAAqD;IACrD,iBAAiB,EAAE,MAAM,CAAA;IACzB,mDAAmD;IACnD,gBAAgB,EAAE,IAAI,CAAA;IACtB,iDAAiD;IACjD,cAAc,EAAE,IAAI,CAAA;CACrB,CAAA"}
@@ -173,6 +173,10 @@ export interface SaveAndExitV2Message {
173
173
  type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT_V2;
174
174
  data: SaveAndExitV2MessageData;
175
175
  }
176
+ export interface SavedState {
177
+ $$__referenceNumber: string;
178
+ [key: string]: any;
179
+ }
176
180
  export interface SaveAndExitRecord {
177
181
  magicLinkId: string;
178
182
  magicLinkGroupId?: string;
@@ -205,7 +209,7 @@ export interface SaveAndExitV2Record {
205
209
  sub: string;
206
210
  issuer: string;
207
211
  };
208
- state: object;
212
+ state: SavedState;
209
213
  createdAt: Date;
210
214
  }
211
215
  export type RunnerMessage = SaveAndExitMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-submission/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,K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,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,qBAAqB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-submission/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAChC,MAAM,qCAAqC,CAAA;AAS5C;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,EAAE,YAAY,EAAE,EAAE,CAAA;CACxB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,OAAO,EAAE,0BAA0B,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f,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;IACb,uBAAuB,EAAE,MAAM,CAAA;IAC/B,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,UAAU,CAAA;QAClB,SAAS,EAAE,OAAO,CAAA;QAClB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAA;QACX,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAA;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,qBAAqB,CAAA"}
@@ -33,6 +33,7 @@ export * from './utils/set-property.js';
33
33
  export * from './form/form-audit/index.js';
34
34
  export * from './form/form-audit/enums.js';
35
35
  export * from './form/form-audit/consolidation.js';
36
+ export * from './form/form-audit/output-changes.js';
36
37
  export type * from './common/types.js';
37
38
  export type * from './common/pagination/types.js';
38
39
  export type * from './common/search/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAA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2BAA2B,CAAA;AAC9C,mBAAmB,qCAAqC,CAAA;AACxD,mBAAmB,mCAAmC,CAAA;AACtD,mBAAmB,qCAAqC,CAAA;AACxD,mBAAmB,yCAAyC,CAAA;AAC5D,mBAAmB,iCAAiC,CAAA;AACpD,mBAAmB,wCAAwC,CAAA;AAC3D,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,uBAAuB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.708",
3
+ "version": "3.0.710",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "types": "dist/types/index.d.ts",
@@ -28,6 +28,7 @@ import {
28
28
  type FormOfflineUpdatedMessageData,
29
29
  type FormOrganisationChanges,
30
30
  type FormOrganisationUpdatedMessageData,
31
+ type FormOutputChanges,
31
32
  type FormPrivacyNoticeChanges,
32
33
  type FormPrivacyNoticeUpdatedMessageData,
33
34
  type FormSecretBaseMessageData,
@@ -134,12 +135,31 @@ export const formOutputMessageData = Joi.object<Output>()
134
135
  })
135
136
  .description('A submission email target as recorded on an audit event')
136
137
 
138
+ export const formOutputChangesMessageData = Joi.object<FormOutputChanges>()
139
+ .keys({
140
+ added: Joi.array().items(formOutputMessageData).optional(),
141
+ updated: Joi.array()
142
+ .items(
143
+ Joi.object<ChangesMessageData<Output>>().keys({
144
+ previous: formOutputMessageData.required(),
145
+ new: formOutputMessageData.required()
146
+ })
147
+ )
148
+ .optional(),
149
+ removed: Joi.array().items(formOutputMessageData).optional()
150
+ })
151
+ .or('added', 'updated', 'removed')
152
+ .description(
153
+ "Changes an update made to the form's submission email targets (outputs)"
154
+ )
155
+
137
156
  export const formUpdatedMessageData = formMessageDataBase
138
157
  .append<FormUpdatedMessageData>({
139
158
  requestType: Joi.string()
140
159
  .valid(...Object.values(FormDefinitionRequestType))
141
160
  .required(),
142
- s3Meta: formDefinitionS3Meta.optional()
161
+ s3Meta: formDefinitionS3Meta.optional(),
162
+ outputChanges: formOutputChangesMessageData.optional()
143
163
  })
144
164
  .required()
145
165
 
@@ -0,0 +1,95 @@
1
+ import { type FormOutputChanges } from '~/src/form/form-audit/types.js'
2
+ import { type Output } from '~/src/form/form-definition/types.js'
3
+
4
+ /**
5
+ * Identifies a submission email target by its stored values. Unlike
6
+ * `getOutputKey`, which decides whether two outputs are duplicates of one
7
+ * another, this comparison is exact - changing only the case of an address is
8
+ * still a change worth recording against the form.
9
+ * @param output - submission email target
10
+ */
11
+ function getComparisonKey(output: Output): string {
12
+ return JSON.stringify([
13
+ output.emailAddress,
14
+ output.audience,
15
+ output.version,
16
+ output.condition ?? ''
17
+ ])
18
+ }
19
+
20
+ interface PositionedOutput {
21
+ output: Output
22
+ index: number
23
+ }
24
+
25
+ /**
26
+ * Works out what changed between two sets of submission email targets, in the
27
+ * shape the audit record expects.
28
+ *
29
+ * Outputs carry no id of their own, so an amendment cannot be spotted directly.
30
+ * An entry that disappears from a position while another appears at that same
31
+ * position is treated as an amendment rather than as an unrelated removal and
32
+ * addition - which is what the editor does when an author changes an existing
33
+ * email action. Anything left over is reported as a plain addition or removal,
34
+ * so a wholesale replacement (a JSON upload, say) still records honestly.
35
+ * @param previous - outputs before the update
36
+ * @param next - outputs after the update
37
+ * @returns the changes, or undefined when the outputs are untouched
38
+ */
39
+ export function getFormOutputChanges(
40
+ previous: Output[] | undefined,
41
+ next: Output[] | undefined
42
+ ): FormOutputChanges | undefined {
43
+ const previousOutputs = previous ?? []
44
+ const nextOutputs = next ?? []
45
+
46
+ const previousKeys = new Set(previousOutputs.map(getComparisonKey))
47
+ const nextKeys = new Set(nextOutputs.map(getComparisonKey))
48
+
49
+ const position = (output: Output, index: number): PositionedOutput => ({
50
+ output,
51
+ index
52
+ })
53
+
54
+ const removed: PositionedOutput[] = previousOutputs
55
+ .map((o, i) => position(o, i))
56
+ .filter(({ output }) => !nextKeys.has(getComparisonKey(output)))
57
+
58
+ const added: PositionedOutput[] = nextOutputs
59
+ .map((o, i) => position(o, i))
60
+ .filter(({ output }) => !previousKeys.has(getComparisonKey(output)))
61
+
62
+ const updated = removed.flatMap((before) => {
63
+ const after = added.find(({ index }) => index === before.index)
64
+
65
+ if (!after) {
66
+ return []
67
+ }
68
+
69
+ return [{ previous: before.output, new: after.output }]
70
+ })
71
+
72
+ const pureAdditions = added
73
+ .filter(({ index }) => !removed.some((before) => before.index === index))
74
+ .map(({ output }) => output)
75
+
76
+ const pureRemovals = removed
77
+ .filter(({ index }) => !added.some((after) => after.index === index))
78
+ .map(({ output }) => output)
79
+
80
+ const changes: FormOutputChanges = {}
81
+
82
+ if (pureAdditions.length) {
83
+ changes.added = pureAdditions
84
+ }
85
+
86
+ if (updated.length) {
87
+ changes.updated = updated
88
+ }
89
+
90
+ if (pureRemovals.length) {
91
+ changes.removed = pureRemovals
92
+ }
93
+
94
+ return Object.keys(changes).length ? changes : undefined
95
+ }
@@ -5,6 +5,7 @@ import {
5
5
  type AuditEventMessageType,
6
6
  type FormDefinitionRequestType
7
7
  } from '~/src/form/form-audit/enums.js'
8
+ import { type Output } from '~/src/form/form-definition/types.js'
8
9
  import { type FormMetadataContact } from '~/src/form/form-metadata/types.js'
9
10
 
10
11
  export interface FormMessageDataBase {
@@ -165,9 +166,48 @@ export interface FormDefinitionS3Meta {
165
166
  s3Key: string
166
167
  }
167
168
 
169
+ /**
170
+ * What a single form update did to the form's submission email targets (the
171
+ * `outputs` on the definition, surfaced to authors as "email actions").
172
+ *
173
+ * A `REPLACE_DRAFT` update carries the whole definition, so the audit message
174
+ * would otherwise say nothing about which email address was added, amended or
175
+ * removed. Collections that are empty are omitted, and the object as a whole is
176
+ * absent from an update that left the outputs untouched.
177
+ *
178
+ * Validated by `formOutputChangesMessageData`.
179
+ */
180
+ export interface FormOutputChanges {
181
+ /**
182
+ * Email targets the update introduced
183
+ */
184
+ added?: Output[]
185
+
186
+ /**
187
+ * Email targets the update amended, with the values either side of the change
188
+ */
189
+ updated?: ChangesMessageData<Output>[]
190
+
191
+ /**
192
+ * Email targets the update took away - either deleted directly by the author,
193
+ * or removed as a consequence of deleting the condition they depended on
194
+ */
195
+ removed?: Output[]
196
+ }
197
+
168
198
  export interface FormUpdatedMessageData extends FormMessageDataBase {
169
199
  requestType: FormDefinitionRequestType
170
200
  s3Meta?: FormDefinitionS3Meta
201
+
202
+ /**
203
+ * What this update did to the form's submission email targets. Absent when
204
+ * the update did not touch them.
205
+ *
206
+ * A `DELETE_CONDITION` update reports the outputs that went with the
207
+ * condition, so the removal is recorded against the action that caused it
208
+ * rather than being left to be inferred from a neighbouring event.
209
+ */
210
+ outputChanges?: FormOutputChanges
171
211
  }
172
212
 
173
213
  export type FormMessageChangesData =
@@ -213,6 +213,11 @@ export interface SaveAndExitV2Message {
213
213
  data: SaveAndExitV2MessageData
214
214
  }
215
215
 
216
+ export interface SavedState {
217
+ $$__referenceNumber: string
218
+ [key: string]: any
219
+ }
220
+
216
221
  export interface SaveAndExitRecord {
217
222
  magicLinkId: string
218
223
  magicLinkGroupId?: string
@@ -246,7 +251,7 @@ export interface SaveAndExitV2Record {
246
251
  sub: string
247
252
  issuer: string
248
253
  }
249
- state: object
254
+ state: SavedState
250
255
  createdAt: Date
251
256
  }
252
257
 
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export * from '~/src/utils/set-property.js'
33
33
  export * from '~/src/form/form-audit/index.js'
34
34
  export * from '~/src/form/form-audit/enums.js'
35
35
  export * from '~/src/form/form-audit/consolidation.js'
36
+ export * from '~/src/form/form-audit/output-changes.js'
36
37
 
37
38
  export type * from '~/src/common/types.js'
38
39
  export type * from '~/src/common/pagination/types.js'