@defra/forms-model 3.0.554 → 3.0.556

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,6 +30,8 @@ export let AuditEventMessageType = /*#__PURE__*/function (AuditEventMessageType)
30
30
  AuditEventMessageType["FORM_SUBMISSION_GUIDANCE_UPDATED"] = "FORM_SUBMISSION_GUIDANCE_UPDATED";
31
31
  AuditEventMessageType["FORM_JSON_UPLOADED"] = "FORM_JSON_UPLOADED";
32
32
  AuditEventMessageType["FORM_JSON_DOWNLOADED"] = "FORM_JSON_DOWNLOADED";
33
+ AuditEventMessageType["FORM_FILE_DOWNLOAD_SUCCESS"] = "FORM_FILE_DOWNLOAD_SUCCESS";
34
+ AuditEventMessageType["FORM_FILE_DOWNLOAD_FAILURE"] = "FORM_FILE_DOWNLOAD_FAILURE";
33
35
  AuditEventMessageType["FORM_DRAFT_CREATED_FROM_LIVE"] = "FORM_DRAFT_CREATED_FROM_LIVE";
34
36
  AuditEventMessageType["FORM_LIVE_CREATED_FROM_DRAFT"] = "FORM_LIVE_CREATED_FROM_DRAFT";
35
37
  AuditEventMessageType["FORM_DRAFT_DELETED"] = "FORM_DRAFT_DELETED";
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["AuditEventMessageSchemaVersion","AuditEventMessageCategory","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType"],"sources":["../../../../src/form/form-audit/enums.ts"],"sourcesContent":["export enum AuditEventMessageSchemaVersion {\n V1 = 1\n}\n\nexport enum AuditEventMessageCategory {\n FORM = 'FORM',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION'\n}\n\nexport enum AuditEventMessageSource {\n FORMS_MANAGER = 'FORMS_MANAGER',\n FORMS_DESIGNER = 'FORMS_DESIGNER',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION'\n}\n\nexport enum AuditEventMessageType {\n // FORM message types\n FORM_CREATED = 'FORM_CREATED',\n FORM_TITLE_UPDATED = 'FORM_TITLE_UPDATED',\n FORM_ORGANISATION_UPDATED = 'FORM_ORGANISATION_UPDATED',\n FORM_TEAM_NAME_UPDATED = 'FORM_TEAM_NAME_UPDATED',\n FORM_TEAM_EMAIL_UPDATED = 'FORM_TEAM_EMAIL_UPDATED',\n FORM_SUPPORT_CONTACT_UPDATED = 'FORM_SUPPORT_CONTACT_UPDATED',\n FORM_SUPPORT_PHONE_UPDATED = 'FORM_SUPPORT_PHONE_UPDATED',\n FORM_SUPPORT_EMAIL_UPDATED = 'FORM_SUPPORT_EMAIL_UPDATED',\n FORM_SUPPORT_ONLINE_UPDATED = 'FORM_SUPPORT_ONLINE_UPDATED',\n FORM_PRIVACY_NOTICE_UPDATED = 'FORM_PRIVACY_NOTICE_UPDATED',\n FORM_NOTIFICATION_EMAIL_UPDATED = 'FORM_NOTIFICATION_EMAIL_UPDATED',\n FORM_SUBMISSION_GUIDANCE_UPDATED = 'FORM_SUBMISSION_GUIDANCE_UPDATED',\n FORM_JSON_UPLOADED = 'FORM_JSON_UPLOADED',\n FORM_JSON_DOWNLOADED = 'FORM_JSON_DOWNLOADED',\n FORM_DRAFT_CREATED_FROM_LIVE = 'FORM_DRAFT_CREATED_FROM_LIVE',\n FORM_LIVE_CREATED_FROM_DRAFT = 'FORM_LIVE_CREATED_FROM_DRAFT',\n FORM_DRAFT_DELETED = 'FORM_DRAFT_DELETED',\n FORM_MIGRATED = 'FORM_MIGRATED',\n FORM_UPDATED = 'FORM_UPDATED',\n\n // ENTITLEMENT message types\n ENTITLEMENT_CREATED = 'ENTITLEMENT_CREATED',\n ENTITLEMENT_UPDATED = 'ENTITLEMENT_UPDATED',\n ENTITLEMENT_DELETED = 'ENTITLEMENT_DELETED',\n\n // AUTHENTICATION message types\n AUTHENTICATION_LOGIN = 'AUTHENTICATION_LOGIN',\n AUTHENTICATION_LOGOUT_MANUAL = 'AUTHENTICATION_LOGOUT_MANUAL',\n AUTHENTICATION_LOGOUT_AUTO = 'AUTHENTICATION_LOGOUT_AUTO',\n AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE = 'AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE'\n}\n\nexport enum FormDefinitionRequestType {\n REPLACE_DRAFT = 'REPLACE_DRAFT',\n CREATE_COMPONENT = 'CREATE_COMPONENT',\n UPDATE_COMPONENT = 'UPDATE_COMPONENT',\n DELETE_COMPONENT = 'DELETE_COMPONENT',\n CREATE_CONDITION = 'CREATE_CONDITION',\n UPDATE_CONDITION = 'UPDATE_CONDITION',\n DELETE_CONDITION = 'DELETE_CONDITION',\n REORDER_PAGES = 'REORDER_PAGES',\n REORDER_COMPONENTS = 'REORDER_COMPONENTS',\n CREATE_LIST = 'CREATE_LIST',\n UPDATE_LIST = 'UPDATE_LIST',\n DELETE_LIST = 'DELETE_LIST',\n CREATE_PAGE = 'CREATE_PAGE',\n UPDATE_PAGE_FIELDS = 'UPDATE_PAGE_FIELDS',\n DELETE_PAGE = 'DELETE_PAGE',\n REPOSITION_SUMMARY = 'REPOSITION_SUMMARY'\n}\n"],"mappings":"AAAA,WAAYA,8BAA8B,0BAA9BA,8BAA8B;EAA9BA,8BAA8B,CAA9BA,8BAA8B;EAAA,OAA9BA,8BAA8B;AAAA;AAI1C,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAMrC,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AAOnC,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAkCjC,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["AuditEventMessageSchemaVersion","AuditEventMessageCategory","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType"],"sources":["../../../../src/form/form-audit/enums.ts"],"sourcesContent":["export enum AuditEventMessageSchemaVersion {\n V1 = 1\n}\n\nexport enum AuditEventMessageCategory {\n FORM = 'FORM',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION'\n}\n\nexport enum AuditEventMessageSource {\n FORMS_MANAGER = 'FORMS_MANAGER',\n FORMS_DESIGNER = 'FORMS_DESIGNER',\n ENTITLEMENT = 'ENTITLEMENT',\n AUTHENTICATION = 'AUTHENTICATION'\n}\n\nexport enum AuditEventMessageType {\n // FORM message types\n FORM_CREATED = 'FORM_CREATED',\n FORM_TITLE_UPDATED = 'FORM_TITLE_UPDATED',\n FORM_ORGANISATION_UPDATED = 'FORM_ORGANISATION_UPDATED',\n FORM_TEAM_NAME_UPDATED = 'FORM_TEAM_NAME_UPDATED',\n FORM_TEAM_EMAIL_UPDATED = 'FORM_TEAM_EMAIL_UPDATED',\n FORM_SUPPORT_CONTACT_UPDATED = 'FORM_SUPPORT_CONTACT_UPDATED',\n FORM_SUPPORT_PHONE_UPDATED = 'FORM_SUPPORT_PHONE_UPDATED',\n FORM_SUPPORT_EMAIL_UPDATED = 'FORM_SUPPORT_EMAIL_UPDATED',\n FORM_SUPPORT_ONLINE_UPDATED = 'FORM_SUPPORT_ONLINE_UPDATED',\n FORM_PRIVACY_NOTICE_UPDATED = 'FORM_PRIVACY_NOTICE_UPDATED',\n FORM_NOTIFICATION_EMAIL_UPDATED = 'FORM_NOTIFICATION_EMAIL_UPDATED',\n FORM_SUBMISSION_GUIDANCE_UPDATED = 'FORM_SUBMISSION_GUIDANCE_UPDATED',\n FORM_JSON_UPLOADED = 'FORM_JSON_UPLOADED',\n FORM_JSON_DOWNLOADED = 'FORM_JSON_DOWNLOADED',\n FORM_FILE_DOWNLOAD_SUCCESS = 'FORM_FILE_DOWNLOAD_SUCCESS',\n FORM_FILE_DOWNLOAD_FAILURE = 'FORM_FILE_DOWNLOAD_FAILURE',\n FORM_DRAFT_CREATED_FROM_LIVE = 'FORM_DRAFT_CREATED_FROM_LIVE',\n FORM_LIVE_CREATED_FROM_DRAFT = 'FORM_LIVE_CREATED_FROM_DRAFT',\n FORM_DRAFT_DELETED = 'FORM_DRAFT_DELETED',\n FORM_MIGRATED = 'FORM_MIGRATED',\n FORM_UPDATED = 'FORM_UPDATED',\n\n // ENTITLEMENT message types\n ENTITLEMENT_CREATED = 'ENTITLEMENT_CREATED',\n ENTITLEMENT_UPDATED = 'ENTITLEMENT_UPDATED',\n ENTITLEMENT_DELETED = 'ENTITLEMENT_DELETED',\n\n // AUTHENTICATION message types\n AUTHENTICATION_LOGIN = 'AUTHENTICATION_LOGIN',\n AUTHENTICATION_LOGOUT_MANUAL = 'AUTHENTICATION_LOGOUT_MANUAL',\n AUTHENTICATION_LOGOUT_AUTO = 'AUTHENTICATION_LOGOUT_AUTO',\n AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE = 'AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE'\n}\n\nexport enum FormDefinitionRequestType {\n REPLACE_DRAFT = 'REPLACE_DRAFT',\n CREATE_COMPONENT = 'CREATE_COMPONENT',\n UPDATE_COMPONENT = 'UPDATE_COMPONENT',\n DELETE_COMPONENT = 'DELETE_COMPONENT',\n CREATE_CONDITION = 'CREATE_CONDITION',\n UPDATE_CONDITION = 'UPDATE_CONDITION',\n DELETE_CONDITION = 'DELETE_CONDITION',\n REORDER_PAGES = 'REORDER_PAGES',\n REORDER_COMPONENTS = 'REORDER_COMPONENTS',\n CREATE_LIST = 'CREATE_LIST',\n UPDATE_LIST = 'UPDATE_LIST',\n DELETE_LIST = 'DELETE_LIST',\n CREATE_PAGE = 'CREATE_PAGE',\n UPDATE_PAGE_FIELDS = 'UPDATE_PAGE_FIELDS',\n DELETE_PAGE = 'DELETE_PAGE',\n REPOSITION_SUMMARY = 'REPOSITION_SUMMARY'\n}\n"],"mappings":"AAAA,WAAYA,8BAA8B,0BAA9BA,8BAA8B;EAA9BA,8BAA8B,CAA9BA,8BAA8B;EAAA,OAA9BA,8BAA8B;AAAA;AAI1C,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAMrC,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AAOnC,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAoCjC,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
@@ -65,6 +65,11 @@ export const entitlementMessageData = Joi.object().keys({
65
65
  email: Joi.string().email().required(),
66
66
  roles: Joi.array().items(Joi.string())
67
67
  });
68
+ export const formFileDownloadedMessageData = Joi.object().keys({
69
+ fileId: Joi.string().required(),
70
+ filename: Joi.string().required(),
71
+ fileLink: Joi.string().required()
72
+ }).required().description('Schema for FORM_FILE_DOWNLOAD_SUCCESS and FORM_FILE_DOWNLOAD_FAILURE events');
68
73
  export const authenticationMessageData = Joi.object().keys({
69
74
  userId: Joi.string().required(),
70
75
  displayName: Joi.string().required()
@@ -145,6 +150,9 @@ export const messageSchema = Joi.object().keys({
145
150
  }, {
146
151
  is: Joi.string().trim().valid(AuditEventMessageType.AUTHENTICATION_LOGIN, AuditEventMessageType.AUTHENTICATION_LOGOUT_MANUAL, AuditEventMessageType.AUTHENTICATION_LOGOUT_AUTO, AuditEventMessageType.AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE),
147
152
  then: authenticationMessageData
153
+ }, {
154
+ is: Joi.string().trim().valid(AuditEventMessageType.FORM_FILE_DOWNLOAD_SUCCESS, AuditEventMessageType.FORM_FILE_DOWNLOAD_FAILURE),
155
+ then: formFileDownloadedMessageData
148
156
  }],
149
157
  otherwise: Joi.forbidden()
150
158
  }).description('The data/payload of the audit message'),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","AuditEventMessageCategory","AuditEventMessageSchemaVersion","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType","contactSchema","emailAddressSchema","emailResponseTimeSchema","idSchema","notificationEmailAddressSchema","onlineTextSchema","onlineUrlSchema","organisationSchema","phoneSchema","privacyNoticeUrlSchema","slugSchema","submissionGuidanceSchema","teamEmailSchema","teamNameSchema","titleSchema","formMessageDataBase","object","formId","slug","payload","optional","required","description","formCreatedMessageData","append","title","organisation","teamName","teamEmail","formDefinitionS3Meta","keys","fileId","string","filename","s3Key","formUpdatedMessageData","requestType","valid","Object","values","s3Meta","formTitleChanges","formOrganisationChanges","formTeamNameChanges","formTeamEmailChanges","formSupportContactChanges","contact","formSupportPhoneChanges","phone","formSupportOnlineChanges","url","text","formSupportEmailChanges","address","responseTime","formPrivacyNoticeChanges","privacyNoticeUrl","formNotificationEmailChanges","notificationEmail","formSubmissionGuidanceChanges","submissionGuidance","formUploadedChanges","value","entitlementMessageData","userId","displayName","email","roles","array","items","authenticationMessageData","auditUserSchema","id","formChangesMessageData","schema","changes","previous","new","messageSchema","schemaVersion","category","source","type","entityId","traceId","createdAt","date","createdBy","data","when","switch","is","trim","FORM_CREATED","then","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_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","otherwise","forbidden","messageCreatedAt","auditEvent","message","auditRecord","messageId","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 EntitlementMessageData,\n type FormCreatedMessageData,\n type FormDefinitionS3Meta,\n type FormMessageChangesData,\n type FormMessageDataBase,\n type FormNotificationEmailChanges,\n type FormNotificationEmailUpdatedMessageData,\n type FormOrganisationChanges,\n type FormOrganisationUpdatedMessageData,\n type FormPrivacyNoticeChanges,\n type FormPrivacyNoticeUpdatedMessageData,\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 FormTitleChanges,\n type FormTitleUpdatedMessageData,\n type FormUpdatedMessageData,\n type FormUploadedChanges,\n type FormUploadedMessageData\n} from '~/src/form/form-audit/types.js'\nimport {\n contactSchema,\n emailAddressSchema,\n emailResponseTimeSchema,\n idSchema,\n notificationEmailAddressSchema,\n onlineTextSchema,\n onlineUrlSchema,\n organisationSchema,\n phoneSchema,\n privacyNoticeUrlSchema,\n slugSchema,\n submissionGuidanceSchema,\n teamEmailSchema,\n teamNameSchema,\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\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 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: emailAddressSchema.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 privacyNoticeUrl: privacyNoticeUrlSchema\n })\n .required()\n .description('Changes schema for FORM_PRIVACY_NOTICE_UPDATED 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 entitlementMessageData = Joi.object<EntitlementMessageData>().keys(\n {\n userId: Joi.string().required(),\n displayName: Joi.string().required(),\n email: Joi.string().email().required(),\n roles: Joi.array().items(Joi.string())\n }\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_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 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,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D,KAAK,CACJvC,qBAAqB,CAACmH,oBAAoB,EAC1CnH,qBAAqB,CAACoH,4BAA4B,EAClDpH,qBAAqB,CAACqH,0BAA0B,EAChDrH,qBAAqB,CAACsH,sCACxB,CAAC;MACHtB,IAAI,EAAExB;IACR,CAAC,CACF;IACD+C,SAAS,EAAE3H,GAAG,CAAC4H,SAAS,CAAC;EAC3B,CAAC,CAAC,CAAChG,WAAW,CAAC,uCAAuC,CAAC;EACvDiG,gBAAgB,EAAE7H,GAAG,CAAC4F,IAAI,CAAC,CAAC,CACzBjE,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,8CAA8C;AAC/D,CAAC,CAAC,CACDD,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,oDAAoD,CAAC;AAEpE,OAAO,MAAMkG,UAAU,GAAG9H,GAAG,CAACsB,MAAM,CAAa,CAAC,CAC/Cc,IAAI,CAAC;EACJ2F,OAAO,EAAE3C;AACX,CAAC,CAAC,CACDxD,WAAW,CAAC,6BAA6B,CAAC;AAE7C,OAAO,MAAMoG,WAAW,GAAG5C,aAAa,CACrCtD,MAAM,CAAc;EACnBgD,EAAE,EAAErE,QAAQ;EACZwH,SAAS,EAAEjI,GAAG,CAACsC,MAAM,CAAC,CAAC,CAAC4F,IAAI,CAAC,CAAC,CAACvG,QAAQ,CAAC,CAAC;EACzC8D,QAAQ,EAAEzF,GAAG,CAACsC,MAAM,CAAC,CAAC,CAACX,QAAQ,CAAC,CAAC;EACjCwG,eAAe,EAAEnI,GAAG,CAAC4F,IAAI,CAAC,CAAC,CAACjE,QAAQ,CAAC;AACvC,CAAC,CAAC,CACDC,WAAW,CAAC,wCAAwC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","AuditEventMessageCategory","AuditEventMessageSchemaVersion","AuditEventMessageSource","AuditEventMessageType","FormDefinitionRequestType","contactSchema","emailAddressSchema","emailResponseTimeSchema","idSchema","notificationEmailAddressSchema","onlineTextSchema","onlineUrlSchema","organisationSchema","phoneSchema","privacyNoticeUrlSchema","slugSchema","submissionGuidanceSchema","teamEmailSchema","teamNameSchema","titleSchema","formMessageDataBase","object","formId","slug","payload","optional","required","description","formCreatedMessageData","append","title","organisation","teamName","teamEmail","formDefinitionS3Meta","keys","fileId","string","filename","s3Key","formUpdatedMessageData","requestType","valid","Object","values","s3Meta","formTitleChanges","formOrganisationChanges","formTeamNameChanges","formTeamEmailChanges","formSupportContactChanges","contact","formSupportPhoneChanges","phone","formSupportOnlineChanges","url","text","formSupportEmailChanges","address","responseTime","formPrivacyNoticeChanges","privacyNoticeUrl","formNotificationEmailChanges","notificationEmail","formSubmissionGuidanceChanges","submissionGuidance","formUploadedChanges","value","entitlementMessageData","userId","displayName","email","roles","array","items","formFileDownloadedMessageData","fileLink","authenticationMessageData","auditUserSchema","id","formChangesMessageData","schema","changes","previous","new","messageSchema","schemaVersion","category","source","type","entityId","traceId","createdAt","date","createdBy","data","when","switch","is","trim","FORM_CREATED","then","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_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","otherwise","forbidden","messageCreatedAt","auditEvent","message","auditRecord","messageId","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 EntitlementMessageData,\n type FormCreatedMessageData,\n type FormDefinitionS3Meta,\n type FormFileDownloadedMessageData,\n type FormMessageChangesData,\n type FormMessageDataBase,\n type FormNotificationEmailChanges,\n type FormNotificationEmailUpdatedMessageData,\n type FormOrganisationChanges,\n type FormOrganisationUpdatedMessageData,\n type FormPrivacyNoticeChanges,\n type FormPrivacyNoticeUpdatedMessageData,\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 FormTitleChanges,\n type FormTitleUpdatedMessageData,\n type FormUpdatedMessageData,\n type FormUploadedChanges,\n type FormUploadedMessageData\n} from '~/src/form/form-audit/types.js'\nimport {\n contactSchema,\n emailAddressSchema,\n emailResponseTimeSchema,\n idSchema,\n notificationEmailAddressSchema,\n onlineTextSchema,\n onlineUrlSchema,\n organisationSchema,\n phoneSchema,\n privacyNoticeUrlSchema,\n slugSchema,\n submissionGuidanceSchema,\n teamEmailSchema,\n teamNameSchema,\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\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 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: emailAddressSchema.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 privacyNoticeUrl: privacyNoticeUrlSchema\n })\n .required()\n .description('Changes schema for FORM_PRIVACY_NOTICE_UPDATED 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 entitlementMessageData = Joi.object<EntitlementMessageData>().keys(\n {\n userId: Joi.string().required(),\n displayName: Joi.string().required(),\n email: Joi.string().email().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 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_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 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,uB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C,aAAa,CACrCxD,MAAM,CAAc;EACnBkD,EAAE,EAAEvE,QAAQ;EACZ4H,SAAS,EAAErI,GAAG,CAACsC,MAAM,CAAC,CAAC,CAACgG,IAAI,CAAC,CAAC,CAAC3G,QAAQ,CAAC,CAAC;EACzCgE,QAAQ,EAAE3F,GAAG,CAACsC,MAAM,CAAC,CAAC,CAACX,QAAQ,CAAC,CAAC;EACjC4G,eAAe,EAAEvI,GAAG,CAAC8F,IAAI,CAAC,CAAC,CAACnE,QAAQ,CAAC;AACvC,CAAC,CAAC,CACDC,WAAW,CAAC,wCAAwC,CAAC","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 privacyNoticeUrl?: string\n}\n\nexport interface FormNotificationEmailChanges {\n notificationEmail?: string\n}\n\nexport interface FormSubmissionGuidanceChanges {\n submissionGuidance?: string\n}\n\nexport interface FormUploadedChanges {\n value: string\n}\n\nexport interface FormTitleUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTitleChanges>\n}\n\nexport interface FormOrganisationUpdatedMessageData\n 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\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportContactChanges>\n}\n\nexport interface FormSupportPhoneUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportPhoneChanges>\n}\n\nexport interface FormSupportEmailUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportEmailChanges>\n}\n\nexport interface FormSupportOnlineUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportOnlineChanges>\n}\n\nexport interface FormPrivacyNoticeUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormPrivacyNoticeChanges>\n}\n\nexport interface FormNotificationEmailUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormNotificationEmailChanges>\n}\n\nexport interface FormSubmissionGuidanceUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSubmissionGuidanceChanges>\n}\n\nexport interface FormUploadedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormUploadedChanges>\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 | FormNotificationEmailUpdatedMessageData\n | FormSubmissionGuidanceUpdatedMessageData\n | FormUploadedMessageData\n\nexport type FormMessageActivitiesData =\n | FormCreatedMessageData\n | FormMessageDataBase\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 type MessageData =\n | FormMessageChangesData\n | FormMessageActivitiesData\n | FormUpdatedMessageData\n | EntitlementMessageData\n | AuthenticationMessageData\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 FormNotificationEmailUpdatedMessage\n 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\n 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 FormDraftCreatedFromLiveMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE\n}\n\nexport interface FormLiveCreatedFromDraftMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT\n}\n\nexport interface FormDraftDeletedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_DELETED\n}\n\nexport interface FormMigratedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_MIGRATED\n}\n\nexport interface FormUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_UPDATED\n data: FormUpdatedMessageData\n}\n\nexport interface EntitlementCreatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_CREATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementUpdatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_UPDATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementDeletedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_DELETED\n data: EntitlementMessageData\n}\n\nexport interface AuthenticationLoginMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGIN\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutManualMessage\n extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_MANUAL\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutAutoMessage\n extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_AUTO\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutDifferentDeviceMessage\n extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE\n data: AuthenticationMessageData\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 | FormNotificationEmailUpdatedMessage\n | FormSubmissionGuidanceUpdatedMessage\n | FormUploadedMessage\n | FormDownloadedMessage\n | FormDraftCreatedFromLiveMessage\n | FormLiveCreatedFromDraftMessage\n | FormDraftDeletedMessage\n | FormMigratedMessage\n | FormUpdatedMessage\n | EntitlementCreatedMessage\n | EntitlementUpdatedMessage\n | EntitlementDeletedMessage\n | AuthenticationLoginMessage\n | AuthenticationLogoutManualMessage\n | AuthenticationLogoutAutoMessage\n | AuthenticationLogoutDifferentDeviceMessage\n\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"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-audit/types.ts"],"sourcesContent":["import {\n type AuditEventMessageCategory,\n type AuditEventMessageSchemaVersion,\n type AuditEventMessageSource,\n type AuditEventMessageType,\n type FormDefinitionRequestType\n} from '~/src/form/form-audit/enums.js'\nimport { type FormMetadataContact } from '~/src/form/form-metadata/types.js'\n\nexport interface FormMessageDataBase {\n formId: string\n slug: string\n payload?: unknown\n}\n\nexport interface ChangesMessageData<T> {\n previous: T\n new: T\n}\n\nexport interface FormCreatedMessageData extends FormMessageDataBase {\n title: string\n organisation: string\n teamName: string\n teamEmail: string\n}\n\nexport interface FormTitleChanges {\n title: string\n}\n\nexport interface FormOrganisationChanges {\n organisation: string\n}\n\nexport interface FormTeamNameChanges {\n teamName: string\n}\n\nexport interface FormTeamEmailChanges {\n teamEmail: string\n}\n\nexport interface FormSupportContactChanges {\n contact?: FormMetadataContact\n}\n\nexport interface FormSupportPhoneChanges {\n phone?: string\n}\n\nexport interface FormSupportEmailChanges {\n address?: string\n responseTime?: string\n}\n\nexport interface FormSupportOnlineChanges {\n url?: string\n text?: string\n}\n\nexport interface FormPrivacyNoticeChanges {\n privacyNoticeUrl?: string\n}\n\nexport interface FormNotificationEmailChanges {\n notificationEmail?: string\n}\n\nexport interface FormSubmissionGuidanceChanges {\n submissionGuidance?: string\n}\n\nexport interface FormUploadedChanges {\n value: string\n}\n\nexport interface FormTitleUpdatedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormTitleChanges>\n}\n\nexport interface FormOrganisationUpdatedMessageData\n 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\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportContactChanges>\n}\n\nexport interface FormSupportPhoneUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportPhoneChanges>\n}\n\nexport interface FormSupportEmailUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportEmailChanges>\n}\n\nexport interface FormSupportOnlineUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSupportOnlineChanges>\n}\n\nexport interface FormPrivacyNoticeUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormPrivacyNoticeChanges>\n}\n\nexport interface FormNotificationEmailUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormNotificationEmailChanges>\n}\n\nexport interface FormSubmissionGuidanceUpdatedMessageData\n extends FormMessageDataBase {\n changes: ChangesMessageData<FormSubmissionGuidanceChanges>\n}\n\nexport interface FormUploadedMessageData extends FormMessageDataBase {\n changes: ChangesMessageData<FormUploadedChanges>\n}\n\nexport interface FormFileDownloadedMessageData {\n fileId: string\n filename: string\n fileLink: string\n}\n\nexport interface 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 | FormNotificationEmailUpdatedMessageData\n | FormSubmissionGuidanceUpdatedMessageData\n | FormUploadedMessageData\n\nexport type FormMessageActivitiesData =\n | FormCreatedMessageData\n | FormMessageDataBase\n | FormFileDownloadedMessageData\n\nexport interface EntitlementMessageData {\n userId: string\n displayName: string\n email: string\n roles: string[]\n}\n\nexport interface AuthenticationMessageData {\n userId: string\n displayName: string\n}\n\nexport interface AuditUser {\n id: string\n displayName: string\n}\n\nexport type MessageData =\n | FormMessageChangesData\n | FormMessageActivitiesData\n | FormUpdatedMessageData\n | EntitlementMessageData\n | AuthenticationMessageData\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 FormNotificationEmailUpdatedMessage\n 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\n extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED\n source: AuditEventMessageSource.FORMS_MANAGER\n data: FormSubmissionGuidanceUpdatedMessageData\n}\n\nexport interface FormUploadedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_JSON_UPLOADED\n data: FormUploadedMessageData\n}\n\nexport interface FormDownloadedMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_JSON_DOWNLOADED\n data: FormMessageDataBase\n}\n\nexport interface FormFileDownloadSuccessMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_FILE_DOWNLOAD_SUCCESS\n data: FormFileDownloadedMessageData\n}\n\nexport interface FormFileDownloadFailureMessage extends DesignerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_FILE_DOWNLOAD_FAILURE\n data: FormFileDownloadedMessageData\n}\n\nexport interface FormDraftCreatedFromLiveMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE\n}\n\nexport interface FormLiveCreatedFromDraftMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT\n}\n\nexport interface FormDraftDeletedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_DRAFT_DELETED\n}\n\nexport interface FormMigratedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_MIGRATED\n}\n\nexport interface FormUpdatedMessage extends ManagerMessageBase {\n category: AuditEventMessageCategory.FORM\n type: AuditEventMessageType.FORM_UPDATED\n data: FormUpdatedMessageData\n}\n\nexport interface EntitlementCreatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_CREATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementUpdatedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_UPDATED\n data: EntitlementMessageData\n}\n\nexport interface EntitlementDeletedMessage extends EntitlementMessageBase {\n category: AuditEventMessageCategory.ENTITLEMENT\n type: AuditEventMessageType.ENTITLEMENT_DELETED\n data: EntitlementMessageData\n}\n\nexport interface AuthenticationLoginMessage extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGIN\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutManualMessage\n extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_MANUAL\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutAutoMessage\n extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_AUTO\n data: AuthenticationMessageData\n}\n\nexport interface AuthenticationLogoutDifferentDeviceMessage\n extends AuthenticationMessageBase {\n category: AuditEventMessageCategory.AUTHENTICATION\n type: AuditEventMessageType.AUTHENTICATION_LOGOUT_DIFFERENT_DEVICE\n data: AuthenticationMessageData\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 | FormNotificationEmailUpdatedMessage\n | FormSubmissionGuidanceUpdatedMessage\n | FormUploadedMessage\n | FormDownloadedMessage\n | FormFileDownloadSuccessMessage\n | FormFileDownloadFailureMessage\n | FormDraftCreatedFromLiveMessage\n | FormLiveCreatedFromDraftMessage\n | FormDraftDeletedMessage\n | FormMigratedMessage\n | FormUpdatedMessage\n | EntitlementCreatedMessage\n | EntitlementUpdatedMessage\n | EntitlementDeletedMessage\n | AuthenticationLoginMessage\n | AuthenticationLogoutManualMessage\n | AuthenticationLogoutAutoMessage\n | AuthenticationLogoutDifferentDeviceMessage\n\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"],"mappings":"","ignoreList":[]}
@@ -81,6 +81,8 @@ const conditionSchema = Joi.object().description('Condition definition specifyin
81
81
  value: Joi.alternatives().try(conditionValueSchema, relativeDateValueDataSchema).description('Value to compare the field against, either fixed or relative date'),
82
82
  coordinator: Joi.string().trim().optional().description('Logical operator connecting this condition with others (AND, OR)')
83
83
  });
84
+ export const MIN_NUMBER_OF_REPEAT_ITEMS = 1;
85
+ export const MAX_NUMBER_OF_REPEAT_ITEMS = 200;
84
86
  export const conditionDataSchemaV2 = Joi.object().description('Condition definition').keys({
85
87
  id: idSchema.description('Unique identifier used to reference this condition'),
86
88
  componentId: Joi.string().trim().required().when('/pages', {
@@ -193,8 +195,8 @@ const repeatOptions = Joi.object().description('Configuration options for a repe
193
195
  title: Joi.string().trim().required().description('Title displayed for each repeatable item')
194
196
  });
195
197
  const repeatSchema = Joi.object().description('Validation rules for a repeatable section').keys({
196
- min: Joi.number().empty('').required().description('Minimum number of repetitions required'),
197
- max: Joi.number().empty('').required().description('Maximum number of repetitions allowed')
198
+ min: Joi.number().empty('').min(MIN_NUMBER_OF_REPEAT_ITEMS).required().description('Minimum number of repetitions required'),
199
+ max: Joi.number().empty('').min(Joi.ref('min')).max(MAX_NUMBER_OF_REPEAT_ITEMS).required().description('Maximum number of repetitions allowed')
198
200
  });
199
201
  export const pageRepeatSchema = Joi.object().description('Complete configuration for a repeatable page').keys({
200
202
  options: repeatOptions.required().description('Display and identification options for the repetition'),