@defra/forms-model 3.0.600 → 3.0.602
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.
- package/dist/module/common/pagination/index.js +55 -0
- package/dist/module/common/pagination/index.js.map +1 -1
- package/dist/module/common/pagination/types.js.map +1 -1
- package/dist/module/form/form-audit/consolidation.js +72 -0
- package/dist/module/form/form-audit/consolidation.js.map +1 -0
- package/dist/module/form/form-audit/types.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/types/common/pagination/index.d.ts +10 -1
- package/dist/types/common/pagination/index.d.ts.map +1 -1
- package/dist/types/common/pagination/types.d.ts +35 -0
- package/dist/types/common/pagination/types.d.ts.map +1 -1
- package/dist/types/form/form-audit/consolidation.d.ts +41 -0
- package/dist/types/form/form-audit/consolidation.d.ts.map +1 -0
- package/dist/types/form/form-audit/types.d.ts +12 -0
- package/dist/types/form/form-audit/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/pagination/index.ts +64 -1
- package/src/common/pagination/types.ts +41 -0
- package/src/form/form-audit/consolidation.ts +150 -0
- package/src/form/form-audit/types.ts +13 -0
- package/src/index.ts +1 -0
|
@@ -12,4 +12,59 @@ export const paginationOptionFields = {
|
|
|
12
12
|
* @see {@link PaginationOptions}
|
|
13
13
|
*/
|
|
14
14
|
export const paginationOptionsSchema = Joi.object(paginationOptionFields);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Builds the pages array for the GOV.UK Design System pagination component.
|
|
18
|
+
* Shows first page, last page, current page, and adjacent pages with ellipsis for gaps.
|
|
19
|
+
* @param currentPage - The current page number
|
|
20
|
+
* @param totalPages - The total number of pages
|
|
21
|
+
* @param createHref - Function to generate href for each page number
|
|
22
|
+
* @returns Array of pagination page items
|
|
23
|
+
*/
|
|
24
|
+
export function buildPaginationPages(currentPage, totalPages, createHref) {
|
|
25
|
+
const pages = [];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates a pagination page item
|
|
29
|
+
*/
|
|
30
|
+
function createPageItem(pageNumber, isCurrent = false) {
|
|
31
|
+
return {
|
|
32
|
+
number: String(pageNumber),
|
|
33
|
+
href: createHref(pageNumber),
|
|
34
|
+
current: isCurrent
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Always show the first page
|
|
39
|
+
pages.push(createPageItem(1, currentPage === 1));
|
|
40
|
+
|
|
41
|
+
// Calculate adjacent page range (one before and one after current)
|
|
42
|
+
const adjacentStartPage = Math.max(currentPage - 1, 2);
|
|
43
|
+
const adjacentEndPage = Math.min(currentPage + 1, totalPages - 1);
|
|
44
|
+
|
|
45
|
+
// Add ellipsis after first page if needed
|
|
46
|
+
if (adjacentStartPage > 2) {
|
|
47
|
+
pages.push({
|
|
48
|
+
ellipsis: true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Add pages between adjacentStartPage and adjacentEndPage
|
|
53
|
+
for (let i = adjacentStartPage; i <= adjacentEndPage; i++) {
|
|
54
|
+
pages.push(createPageItem(i, i === currentPage));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Add ellipsis before last page if needed
|
|
58
|
+
if (adjacentEndPage < totalPages - 1) {
|
|
59
|
+
pages.push({
|
|
60
|
+
ellipsis: true
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Always show the last page if totalPages > 1
|
|
65
|
+
if (totalPages > 1) {
|
|
66
|
+
pages.push(createPageItem(totalPages, currentPage === totalPages));
|
|
67
|
+
}
|
|
68
|
+
return pages;
|
|
69
|
+
}
|
|
15
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Joi","paginationOptionFields","page","number","positive","integer","default","min","optional","description","perPage","max","paginationOptionsSchema","object"],"sources":["../../../../src/common/pagination/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { type PaginationOptions } from '~/src/common/pagination/types.js'\n\n/**\n * Field definitions for pagination options.\n */\nexport const paginationOptionFields = {\n page: Joi.number()\n .positive()\n .integer()\n .default(1)\n .min(1)\n .optional()\n .description('Current page number, starting from 1'),\n perPage: Joi.number()\n .positive()\n .integer()\n .default(24)\n .min(1)\n .max(200)\n .optional()\n .description('Number of items to display per page, between 1 and 200')\n}\n\n/**\n * Joi schema for `PaginationOptions` interface\n * @see {@link PaginationOptions}\n */\nexport const paginationOptionsSchema: Joi.ObjectSchema<PaginationOptions> =\n Joi.object(paginationOptionFields)\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;
|
|
1
|
+
{"version":3,"file":"index.js","names":["Joi","paginationOptionFields","page","number","positive","integer","default","min","optional","description","perPage","max","paginationOptionsSchema","object","buildPaginationPages","currentPage","totalPages","createHref","pages","createPageItem","pageNumber","isCurrent","String","href","current","push","adjacentStartPage","Math","adjacentEndPage","ellipsis","i"],"sources":["../../../../src/common/pagination/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type CreatePageHrefFn,\n type PaginationOptions,\n type PaginationPage\n} from '~/src/common/pagination/types.js'\n\n/**\n * Field definitions for pagination options.\n */\nexport const paginationOptionFields = {\n page: Joi.number()\n .positive()\n .integer()\n .default(1)\n .min(1)\n .optional()\n .description('Current page number, starting from 1'),\n perPage: Joi.number()\n .positive()\n .integer()\n .default(24)\n .min(1)\n .max(200)\n .optional()\n .description('Number of items to display per page, between 1 and 200')\n}\n\n/**\n * Joi schema for `PaginationOptions` interface\n * @see {@link PaginationOptions}\n */\nexport const paginationOptionsSchema: Joi.ObjectSchema<PaginationOptions> =\n Joi.object(paginationOptionFields)\n\n/**\n * Builds the pages array for the GOV.UK Design System pagination component.\n * Shows first page, last page, current page, and adjacent pages with ellipsis for gaps.\n * @param currentPage - The current page number\n * @param totalPages - The total number of pages\n * @param createHref - Function to generate href for each page number\n * @returns Array of pagination page items\n */\nexport function buildPaginationPages(\n currentPage: number,\n totalPages: number,\n createHref: CreatePageHrefFn\n): PaginationPage[] {\n const pages: PaginationPage[] = []\n\n /**\n * Creates a pagination page item\n */\n function createPageItem(\n pageNumber: number,\n isCurrent = false\n ): PaginationPage {\n return {\n number: String(pageNumber),\n href: createHref(pageNumber),\n current: isCurrent\n }\n }\n\n // Always show the first page\n pages.push(createPageItem(1, currentPage === 1))\n\n // Calculate adjacent page range (one before and one after current)\n const adjacentStartPage = Math.max(currentPage - 1, 2)\n const adjacentEndPage = Math.min(currentPage + 1, totalPages - 1)\n\n // Add ellipsis after first page if needed\n if (adjacentStartPage > 2) {\n pages.push({ ellipsis: true })\n }\n\n // Add pages between adjacentStartPage and adjacentEndPage\n for (let i = adjacentStartPage; i <= adjacentEndPage; i++) {\n pages.push(createPageItem(i, i === currentPage))\n }\n\n // Add ellipsis before last page if needed\n if (adjacentEndPage < totalPages - 1) {\n pages.push({ ellipsis: true })\n }\n\n // Always show the last page if totalPages > 1\n if (totalPages > 1) {\n pages.push(createPageItem(totalPages, currentPage === totalPages))\n }\n\n return pages\n}\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAQrB;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,IAAI,EAAEF,GAAG,CAACG,MAAM,CAAC,CAAC,CACfC,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,CAAC,CACTC,OAAO,CAAC,CAAC,CAAC,CACVC,GAAG,CAAC,CAAC,CAAC,CACNC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,sCAAsC,CAAC;EACtDC,OAAO,EAAEV,GAAG,CAACG,MAAM,CAAC,CAAC,CAClBC,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,CAAC,CACTC,OAAO,CAAC,EAAE,CAAC,CACXC,GAAG,CAAC,CAAC,CAAC,CACNI,GAAG,CAAC,GAAG,CAAC,CACRH,QAAQ,CAAC,CAAC,C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C,CAAC;EAChC;;EAEA;EACA,IAAIb,UAAU,GAAG,CAAC,EAAE;IAClBE,KAAK,CAACO,IAAI,CAACN,cAAc,CAACH,UAAU,EAAED,WAAW,KAAKC,UAAU,CAAC,CAAC;EACpE;EAEA,OAAOE,KAAK;AACd","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/common/pagination/types.ts"],"sourcesContent":["/**\n * Result of pagination containing page information\n */\nexport interface PaginationResult {\n /**\n * The current page number.\n */\n page: number\n\n /**\n * The number of items per page.\n */\n perPage: number\n\n /**\n * The total number of items available.\n */\n totalItems: number\n\n /**\n * The total number of pages available.\n */\n totalPages: number\n}\n\n/**\n * Options for paginating results\n * Allows partial specification of page and perPage from PaginationResult\n */\nexport type PaginationOptions = Required<\n Pick<PaginationResult, 'page' | 'perPage'>\n>\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/common/pagination/types.ts"],"sourcesContent":["/**\n * Result of pagination containing page information\n */\nexport interface PaginationResult {\n /**\n * The current page number.\n */\n page: number\n\n /**\n * The number of items per page.\n */\n perPage: number\n\n /**\n * The total number of items available.\n */\n totalItems: number\n\n /**\n * The total number of pages available.\n */\n totalPages: number\n}\n\n/**\n * Options for paginating results\n * Allows partial specification of page and perPage from PaginationResult\n */\nexport type PaginationOptions = Required<\n Pick<PaginationResult, 'page' | 'perPage'>\n>\n\n/**\n * A single page item for the pagination component\n */\nexport interface PaginationPage {\n /**\n * The page number (if it's a page, not an ellipsis)\n */\n number?: string\n\n /**\n * The URL for the page\n */\n href?: string\n\n /**\n * Whether this page is the current page\n */\n current?: boolean\n\n /**\n * Whether this entry is an ellipsis (gap indicator)\n */\n ellipsis?: boolean\n}\n\n/**\n * Callback function to generate href for a given page number\n */\nexport type CreatePageHrefFn = (pageNumber: number) => string\n\n/**\n * Pagination result with page items for the pagination component\n * Extends PaginationResult with the pages array needed for rendering\n */\nexport interface PaginationResultWithPages extends PaginationResult {\n /**\n * Page items for the pagination component\n */\n pages: PaginationPage[]\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { AuditEventMessageType } from "./enums.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Field configuration for audit events with change tracking.
|
|
5
|
+
* Used by change detection logic to compare previous and new values.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Support contact field configuration for change detection.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates a field configuration for audit events.
|
|
14
|
+
*/
|
|
15
|
+
function createFieldConfig(label, verb, fieldName) {
|
|
16
|
+
return {
|
|
17
|
+
label,
|
|
18
|
+
verb,
|
|
19
|
+
prevPath: `changes.previous.${fieldName}`,
|
|
20
|
+
newPath: `changes.new.${fieldName}`
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates a support contact field configuration.
|
|
26
|
+
*/
|
|
27
|
+
function createSupportContactField(label, contactPath) {
|
|
28
|
+
return {
|
|
29
|
+
label,
|
|
30
|
+
prevPath: `changes.previous.contact.${contactPath}`,
|
|
31
|
+
newPath: `changes.new.contact.${contactPath}`
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Field configurations for audit events with change tracking.
|
|
37
|
+
* Maps event types to their data paths and display labels.
|
|
38
|
+
*/
|
|
39
|
+
export const fieldConfigs = {
|
|
40
|
+
[AuditEventMessageType.FORM_TITLE_UPDATED]: createFieldConfig('the form name', 'Updated', 'title'),
|
|
41
|
+
[AuditEventMessageType.FORM_ORGANISATION_UPDATED]: createFieldConfig('the lead organisation', 'Changed', 'organisation'),
|
|
42
|
+
[AuditEventMessageType.FORM_TEAM_NAME_UPDATED]: createFieldConfig('the team name', 'Changed', 'teamName'),
|
|
43
|
+
[AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED]: createFieldConfig('the shared team address', 'Updated', 'teamEmail'),
|
|
44
|
+
[AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED]: createFieldConfig('where submitted forms are sent', 'Updated', 'notificationEmail'),
|
|
45
|
+
[AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED]: createFieldConfig('the privacy notice link', 'Updated', 'privacyNoticeUrl'),
|
|
46
|
+
[AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED]: createFieldConfig('the next steps guidance', 'Updated', 'submissionGuidance'),
|
|
47
|
+
[AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED]: createFieldConfig('the support phone number', 'Updated', 'phone'),
|
|
48
|
+
[AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED]: createFieldConfig('the support email address', 'Updated', 'address'),
|
|
49
|
+
[AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED]: createFieldConfig('the support contact link', 'Updated', 'url')
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Support contact field configurations for change detection.
|
|
54
|
+
* Used when checking FORM_SUPPORT_CONTACT_UPDATED events.
|
|
55
|
+
*/
|
|
56
|
+
export const supportContactFields = [createSupportContactField('phone number', 'phone'), createSupportContactField('email address', 'email.address'), createSupportContactField('online contact link', 'online.url')];
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Event types that are always considered valid (don't need change comparison).
|
|
60
|
+
* These events represent actions rather than field updates.
|
|
61
|
+
*/
|
|
62
|
+
export const alwaysValidEvents = new Set([AuditEventMessageType.FORM_CREATED, AuditEventMessageType.FORM_UPDATED, AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT, AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE, AuditEventMessageType.FORM_DRAFT_DELETED, AuditEventMessageType.FORM_MIGRATED, AuditEventMessageType.FORM_JSON_UPLOADED, AuditEventMessageType.FORM_JSON_DOWNLOADED, AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED, AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED]);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Type guard to check if an audit record is consolidated.
|
|
66
|
+
* @param record - The audit record to check
|
|
67
|
+
* @returns True if the record has consolidation metadata
|
|
68
|
+
*/
|
|
69
|
+
export function isConsolidatedRecord(record) {
|
|
70
|
+
return 'consolidatedCount' in record && record.consolidatedCount > 1;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=consolidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consolidation.js","names":["AuditEventMessageType","createFieldConfig","label","verb","fieldName","prevPath","newPath","createSupportContactField","contactPath","fieldConfigs","FORM_TITLE_UPDATED","FORM_ORGANISATION_UPDATED","FORM_TEAM_NAME_UPDATED","FORM_TEAM_EMAIL_UPDATED","FORM_NOTIFICATION_EMAIL_UPDATED","FORM_PRIVACY_NOTICE_UPDATED","FORM_SUBMISSION_GUIDANCE_UPDATED","FORM_SUPPORT_PHONE_UPDATED","FORM_SUPPORT_EMAIL_UPDATED","FORM_SUPPORT_ONLINE_UPDATED","supportContactFields","alwaysValidEvents","Set","FORM_CREATED","FORM_UPDATED","FORM_LIVE_CREATED_FROM_DRAFT","FORM_DRAFT_CREATED_FROM_LIVE","FORM_DRAFT_DELETED","FORM_MIGRATED","FORM_JSON_UPLOADED","FORM_JSON_DOWNLOADED","FORM_SUBMISSION_EXCEL_REQUESTED","FORM_CSAT_EXCEL_REQUESTED","isConsolidatedRecord","record","consolidatedCount"],"sources":["../../../../src/form/form-audit/consolidation.ts"],"sourcesContent":["import { AuditEventMessageType } from '~/src/form/form-audit/enums.js'\nimport {\n type AuditRecord,\n type ConsolidatedAuditRecord\n} from '~/src/form/form-audit/types.js'\n\n/**\n * Field configuration for audit events with change tracking.\n * Used by change detection logic to compare previous and new values.\n */\nexport interface FieldConfig {\n label: string\n verb: 'Updated' | 'Changed'\n prevPath: string\n newPath: string\n}\n\n/**\n * Support contact field configuration for change detection.\n */\nexport interface SupportContactFieldConfig {\n label: string\n prevPath: string\n newPath: string\n}\n\n/**\n * Creates a field configuration for audit events.\n */\nfunction createFieldConfig(\n label: string,\n verb: 'Updated' | 'Changed',\n fieldName: string\n): FieldConfig {\n return {\n label,\n verb,\n prevPath: `changes.previous.${fieldName}`,\n newPath: `changes.new.${fieldName}`\n }\n}\n\n/**\n * Creates a support contact field configuration.\n */\nfunction createSupportContactField(\n label: string,\n contactPath: string\n): SupportContactFieldConfig {\n return {\n label,\n prevPath: `changes.previous.contact.${contactPath}`,\n newPath: `changes.new.contact.${contactPath}`\n }\n}\n\n/**\n * Field configurations for audit events with change tracking.\n * Maps event types to their data paths and display labels.\n */\nexport const fieldConfigs: Record<string, FieldConfig> = {\n [AuditEventMessageType.FORM_TITLE_UPDATED]: createFieldConfig(\n 'the form name',\n 'Updated',\n 'title'\n ),\n [AuditEventMessageType.FORM_ORGANISATION_UPDATED]: createFieldConfig(\n 'the lead organisation',\n 'Changed',\n 'organisation'\n ),\n [AuditEventMessageType.FORM_TEAM_NAME_UPDATED]: createFieldConfig(\n 'the team name',\n 'Changed',\n 'teamName'\n ),\n [AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED]: createFieldConfig(\n 'the shared team address',\n 'Updated',\n 'teamEmail'\n ),\n [AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED]: createFieldConfig(\n 'where submitted forms are sent',\n 'Updated',\n 'notificationEmail'\n ),\n [AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED]: createFieldConfig(\n 'the privacy notice link',\n 'Updated',\n 'privacyNoticeUrl'\n ),\n [AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED]: createFieldConfig(\n 'the next steps guidance',\n 'Updated',\n 'submissionGuidance'\n ),\n [AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED]: createFieldConfig(\n 'the support phone number',\n 'Updated',\n 'phone'\n ),\n [AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED]: createFieldConfig(\n 'the support email address',\n 'Updated',\n 'address'\n ),\n [AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED]: createFieldConfig(\n 'the support contact link',\n 'Updated',\n 'url'\n )\n}\n\n/**\n * Support contact field configurations for change detection.\n * Used when checking FORM_SUPPORT_CONTACT_UPDATED events.\n */\nexport const supportContactFields: SupportContactFieldConfig[] = [\n createSupportContactField('phone number', 'phone'),\n createSupportContactField('email address', 'email.address'),\n createSupportContactField('online contact link', 'online.url')\n]\n\n/**\n * Event types that are always considered valid (don't need change comparison).\n * These events represent actions rather than field updates.\n */\nexport const alwaysValidEvents = new Set<string>([\n AuditEventMessageType.FORM_CREATED,\n AuditEventMessageType.FORM_UPDATED,\n AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT,\n AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE,\n AuditEventMessageType.FORM_DRAFT_DELETED,\n AuditEventMessageType.FORM_MIGRATED,\n AuditEventMessageType.FORM_JSON_UPLOADED,\n AuditEventMessageType.FORM_JSON_DOWNLOADED,\n AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED,\n AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED\n])\n\n/**\n * Type guard to check if an audit record is consolidated.\n * @param record - The audit record to check\n * @returns True if the record has consolidation metadata\n */\nexport function isConsolidatedRecord(\n record: AuditRecord | ConsolidatedAuditRecord\n): record is ConsolidatedAuditRecord {\n return 'consolidatedCount' in record && record.consolidatedCount > 1\n}\n"],"mappings":"AAAA,SAASA,qBAAqB;;AAM9B;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAOA;AACA;AACA;AACA,SAASC,iBAAiBA,CACxBC,KAAa,EACbC,IAA2B,EAC3BC,SAAiB,EACJ;EACb,OAAO;IACLF,KAAK;IACLC,IAAI;IACJE,QAAQ,EAAE,oBAAoBD,SAAS,EAAE;IACzCE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;AACA;AACA,OAAO,MAAMmB,oBAAiD,GAAG,CAC/Db,yBAAyB,CAAC,cAAc,EAAE,OAAO,CAAC,EAClDA,yBAAyB,CAAC,eAAe,EAAE,eAAe,CAAC,EAC3DA,yBAAyB,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAC/D;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMc,iBAAiB,GAAG,IAAIC,GAAG,CAAS,CAC/CtB,qBAAqB,CAACuB,YAAY,EAClCvB,qBAAqB,CAACwB,YAAY,EAClCxB,qBAAqB,CAACyB,4BAA4B,EAClDzB,qBAAqB,CAAC0B,4BAA4B,EAClD1B,qBAAqB,CAAC2B,kBAAkB,EACxC3B,qBAAqB,CAAC4B,aAAa,EACnC5B,qBAAqB,CAAC6B,kBAAkB,EACxC7B,qBAAqB,CAAC8B,oBAAoB,EAC1C9B,qBAAqB,CAAC+B,+BAA+B,EACrD/B,qBAAqB,CAACgC,yBAAyB,CAChD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClCC,MAA6C,EACV;EACnC,OAAO,mBAAmB,IAAIA,MAAM,IAAIA,MAAM,CAACC,iBAAiB,GAAG,CAAC;AACtE","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 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 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 | ExcelGenerationMessageData\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 interface FormSubmissionExcelRequestedMessage\n 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 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 | FormSubmissionExcelRequestedMessage\n | FormCsatExcelRequestedMessage\n | PlatformCsatExcelRequestedMessage\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 ExcelGenerationMessageData {\n formId: string\n formName: string\n notificationEmail: 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 | ExcelGenerationMessageData\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 interface FormSubmissionExcelRequestedMessage\n 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 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 | FormSubmissionExcelRequestedMessage\n | FormCsatExcelRequestedMessage\n | PlatformCsatExcelRequestedMessage\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":[]}
|
package/dist/module/index.js
CHANGED
package/dist/module/index.js.map
CHANGED
|
@@ -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-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","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-submission/index.js'\nexport * from '~/src/form/form-submission/enums.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/form/form-manager/errors.js'\nexport * from '~/src/manage/roles.js'\nexport * from '~/src/manage/users.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\nexport * from '~/src/form/form-audit/index.js'\nexport * from '~/src/form/form-audit/enums.js'\nexport * from '~/src/form/form-audit/consolidation.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\nexport type * from '~/src/form/form-audit/types.js'\nexport type * from '~/src/manage/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import { type PaginationOptions } from '../../common/pagination/types.js';
|
|
2
|
+
import { type CreatePageHrefFn, type PaginationOptions, type PaginationPage } from '../../common/pagination/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Field definitions for pagination options.
|
|
5
5
|
*/
|
|
@@ -12,4 +12,13 @@ export declare const paginationOptionFields: {
|
|
|
12
12
|
* @see {@link PaginationOptions}
|
|
13
13
|
*/
|
|
14
14
|
export declare const paginationOptionsSchema: Joi.ObjectSchema<PaginationOptions>;
|
|
15
|
+
/**
|
|
16
|
+
* Builds the pages array for the GOV.UK Design System pagination component.
|
|
17
|
+
* Shows first page, last page, current page, and adjacent pages with ellipsis for gaps.
|
|
18
|
+
* @param currentPage - The current page number
|
|
19
|
+
* @param totalPages - The total number of pages
|
|
20
|
+
* @param createHref - Function to generate href for each page number
|
|
21
|
+
* @returns Array of pagination page items
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildPaginationPages(currentPage: number, totalPages: number, createHref: CreatePageHrefFn): PaginationPage[];
|
|
15
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,kCAAkC,CAAA;AAEzC;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;CAgBlC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,GAAG,CAAC,YAAY,CAAC,iBAAiB,CACpC,CAAA;AAEpC;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,gBAAgB,GAC3B,cAAc,EAAE,CA6ClB"}
|
|
@@ -24,4 +24,39 @@ export interface PaginationResult {
|
|
|
24
24
|
* Allows partial specification of page and perPage from PaginationResult
|
|
25
25
|
*/
|
|
26
26
|
export type PaginationOptions = Required<Pick<PaginationResult, 'page' | 'perPage'>>;
|
|
27
|
+
/**
|
|
28
|
+
* A single page item for the pagination component
|
|
29
|
+
*/
|
|
30
|
+
export interface PaginationPage {
|
|
31
|
+
/**
|
|
32
|
+
* The page number (if it's a page, not an ellipsis)
|
|
33
|
+
*/
|
|
34
|
+
number?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The URL for the page
|
|
37
|
+
*/
|
|
38
|
+
href?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether this page is the current page
|
|
41
|
+
*/
|
|
42
|
+
current?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether this entry is an ellipsis (gap indicator)
|
|
45
|
+
*/
|
|
46
|
+
ellipsis?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Callback function to generate href for a given page number
|
|
50
|
+
*/
|
|
51
|
+
export type CreatePageHrefFn = (pageNumber: number) => string;
|
|
52
|
+
/**
|
|
53
|
+
* Pagination result with page items for the pagination component
|
|
54
|
+
* Extends PaginationResult with the pages array needed for rendering
|
|
55
|
+
*/
|
|
56
|
+
export interface PaginationResultWithPages extends PaginationResult {
|
|
57
|
+
/**
|
|
58
|
+
* Page items for the pagination component
|
|
59
|
+
*/
|
|
60
|
+
pages: PaginationPage[];
|
|
61
|
+
}
|
|
27
62
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/pagination/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CACtC,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC,CAC3C,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/pagination/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CACtC,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC,CAC3C,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;AAE7D;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IACjE;;OAEG;IACH,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type AuditRecord, type ConsolidatedAuditRecord } from '../../form/form-audit/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Field configuration for audit events with change tracking.
|
|
4
|
+
* Used by change detection logic to compare previous and new values.
|
|
5
|
+
*/
|
|
6
|
+
export interface FieldConfig {
|
|
7
|
+
label: string;
|
|
8
|
+
verb: 'Updated' | 'Changed';
|
|
9
|
+
prevPath: string;
|
|
10
|
+
newPath: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Support contact field configuration for change detection.
|
|
14
|
+
*/
|
|
15
|
+
export interface SupportContactFieldConfig {
|
|
16
|
+
label: string;
|
|
17
|
+
prevPath: string;
|
|
18
|
+
newPath: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Field configurations for audit events with change tracking.
|
|
22
|
+
* Maps event types to their data paths and display labels.
|
|
23
|
+
*/
|
|
24
|
+
export declare const fieldConfigs: Record<string, FieldConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* Support contact field configurations for change detection.
|
|
27
|
+
* Used when checking FORM_SUPPORT_CONTACT_UPDATED events.
|
|
28
|
+
*/
|
|
29
|
+
export declare const supportContactFields: SupportContactFieldConfig[];
|
|
30
|
+
/**
|
|
31
|
+
* Event types that are always considered valid (don't need change comparison).
|
|
32
|
+
* These events represent actions rather than field updates.
|
|
33
|
+
*/
|
|
34
|
+
export declare const alwaysValidEvents: Set<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Type guard to check if an audit record is consolidated.
|
|
37
|
+
* @param record - The audit record to check
|
|
38
|
+
* @returns True if the record has consolidation metadata
|
|
39
|
+
*/
|
|
40
|
+
export declare function isConsolidatedRecord(record: AuditRecord | ConsolidatedAuditRecord): record is ConsolidatedAuditRecord;
|
|
41
|
+
//# sourceMappingURL=consolidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consolidation.d.ts","sourceRoot":"","sources":["../../../../src/form/form-audit/consolidation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC7B,MAAM,gCAAgC,CAAA;AAEvC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,GAAG,SAAS,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAgCD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAmDpD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,EAI3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,aAW5B,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,GAAG,uBAAuB,GAC5C,MAAM,IAAI,uBAAuB,CAEnC"}
|
|
@@ -319,4 +319,16 @@ export type AuditRecord = AuditMessage & AuditInputMeta;
|
|
|
319
319
|
export interface MessageBody {
|
|
320
320
|
Message: string;
|
|
321
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Consolidated audit record that represents multiple grouped events.
|
|
324
|
+
* Combines AuditRecord with consolidation metadata.
|
|
325
|
+
*/
|
|
326
|
+
export type ConsolidatedAuditRecord = AuditRecord & {
|
|
327
|
+
/** Number of events consolidated into this record */
|
|
328
|
+
consolidatedCount: number;
|
|
329
|
+
/** Timestamp of the earliest event in the group */
|
|
330
|
+
consolidatedFrom: Date;
|
|
331
|
+
/** Timestamp of the latest event in the group */
|
|
332
|
+
consolidatedTo: Date;
|
|
333
|
+
};
|
|
322
334
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY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AA;CACrB,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from './utils/helpers.js';
|
|
|
24
24
|
export * from './utils/markdown.js';
|
|
25
25
|
export * from './form/form-audit/index.js';
|
|
26
26
|
export * from './form/form-audit/enums.js';
|
|
27
|
+
export * from './form/form-audit/consolidation.js';
|
|
27
28
|
export type * from './common/types.js';
|
|
28
29
|
export type * from './common/pagination/types.js';
|
|
29
30
|
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,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,qCAAqC,CAAA;AACnD,cAAc,uCAAuC,CAAA;AACrD,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2BAA2B,CAAA;AACzC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yCAAyC,CAAA;AACvD,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA;AACjD,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAA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
|
+
type PaginationPage
|
|
7
|
+
} from '~/src/common/pagination/types.js'
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
* Field definitions for pagination options.
|
|
@@ -29,3 +33,62 @@ export const paginationOptionFields = {
|
|
|
29
33
|
*/
|
|
30
34
|
export const paginationOptionsSchema: Joi.ObjectSchema<PaginationOptions> =
|
|
31
35
|
Joi.object(paginationOptionFields)
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Builds the pages array for the GOV.UK Design System pagination component.
|
|
39
|
+
* Shows first page, last page, current page, and adjacent pages with ellipsis for gaps.
|
|
40
|
+
* @param currentPage - The current page number
|
|
41
|
+
* @param totalPages - The total number of pages
|
|
42
|
+
* @param createHref - Function to generate href for each page number
|
|
43
|
+
* @returns Array of pagination page items
|
|
44
|
+
*/
|
|
45
|
+
export function buildPaginationPages(
|
|
46
|
+
currentPage: number,
|
|
47
|
+
totalPages: number,
|
|
48
|
+
createHref: CreatePageHrefFn
|
|
49
|
+
): PaginationPage[] {
|
|
50
|
+
const pages: PaginationPage[] = []
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Creates a pagination page item
|
|
54
|
+
*/
|
|
55
|
+
function createPageItem(
|
|
56
|
+
pageNumber: number,
|
|
57
|
+
isCurrent = false
|
|
58
|
+
): PaginationPage {
|
|
59
|
+
return {
|
|
60
|
+
number: String(pageNumber),
|
|
61
|
+
href: createHref(pageNumber),
|
|
62
|
+
current: isCurrent
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Always show the first page
|
|
67
|
+
pages.push(createPageItem(1, currentPage === 1))
|
|
68
|
+
|
|
69
|
+
// Calculate adjacent page range (one before and one after current)
|
|
70
|
+
const adjacentStartPage = Math.max(currentPage - 1, 2)
|
|
71
|
+
const adjacentEndPage = Math.min(currentPage + 1, totalPages - 1)
|
|
72
|
+
|
|
73
|
+
// Add ellipsis after first page if needed
|
|
74
|
+
if (adjacentStartPage > 2) {
|
|
75
|
+
pages.push({ ellipsis: true })
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Add pages between adjacentStartPage and adjacentEndPage
|
|
79
|
+
for (let i = adjacentStartPage; i <= adjacentEndPage; i++) {
|
|
80
|
+
pages.push(createPageItem(i, i === currentPage))
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Add ellipsis before last page if needed
|
|
84
|
+
if (adjacentEndPage < totalPages - 1) {
|
|
85
|
+
pages.push({ ellipsis: true })
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Always show the last page if totalPages > 1
|
|
89
|
+
if (totalPages > 1) {
|
|
90
|
+
pages.push(createPageItem(totalPages, currentPage === totalPages))
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return pages
|
|
94
|
+
}
|
|
@@ -30,3 +30,44 @@ export interface PaginationResult {
|
|
|
30
30
|
export type PaginationOptions = Required<
|
|
31
31
|
Pick<PaginationResult, 'page' | 'perPage'>
|
|
32
32
|
>
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A single page item for the pagination component
|
|
36
|
+
*/
|
|
37
|
+
export interface PaginationPage {
|
|
38
|
+
/**
|
|
39
|
+
* The page number (if it's a page, not an ellipsis)
|
|
40
|
+
*/
|
|
41
|
+
number?: string
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The URL for the page
|
|
45
|
+
*/
|
|
46
|
+
href?: string
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Whether this page is the current page
|
|
50
|
+
*/
|
|
51
|
+
current?: boolean
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Whether this entry is an ellipsis (gap indicator)
|
|
55
|
+
*/
|
|
56
|
+
ellipsis?: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Callback function to generate href for a given page number
|
|
61
|
+
*/
|
|
62
|
+
export type CreatePageHrefFn = (pageNumber: number) => string
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Pagination result with page items for the pagination component
|
|
66
|
+
* Extends PaginationResult with the pages array needed for rendering
|
|
67
|
+
*/
|
|
68
|
+
export interface PaginationResultWithPages extends PaginationResult {
|
|
69
|
+
/**
|
|
70
|
+
* Page items for the pagination component
|
|
71
|
+
*/
|
|
72
|
+
pages: PaginationPage[]
|
|
73
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { AuditEventMessageType } from '~/src/form/form-audit/enums.js'
|
|
2
|
+
import {
|
|
3
|
+
type AuditRecord,
|
|
4
|
+
type ConsolidatedAuditRecord
|
|
5
|
+
} from '~/src/form/form-audit/types.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Field configuration for audit events with change tracking.
|
|
9
|
+
* Used by change detection logic to compare previous and new values.
|
|
10
|
+
*/
|
|
11
|
+
export interface FieldConfig {
|
|
12
|
+
label: string
|
|
13
|
+
verb: 'Updated' | 'Changed'
|
|
14
|
+
prevPath: string
|
|
15
|
+
newPath: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Support contact field configuration for change detection.
|
|
20
|
+
*/
|
|
21
|
+
export interface SupportContactFieldConfig {
|
|
22
|
+
label: string
|
|
23
|
+
prevPath: string
|
|
24
|
+
newPath: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates a field configuration for audit events.
|
|
29
|
+
*/
|
|
30
|
+
function createFieldConfig(
|
|
31
|
+
label: string,
|
|
32
|
+
verb: 'Updated' | 'Changed',
|
|
33
|
+
fieldName: string
|
|
34
|
+
): FieldConfig {
|
|
35
|
+
return {
|
|
36
|
+
label,
|
|
37
|
+
verb,
|
|
38
|
+
prevPath: `changes.previous.${fieldName}`,
|
|
39
|
+
newPath: `changes.new.${fieldName}`
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Creates a support contact field configuration.
|
|
45
|
+
*/
|
|
46
|
+
function createSupportContactField(
|
|
47
|
+
label: string,
|
|
48
|
+
contactPath: string
|
|
49
|
+
): SupportContactFieldConfig {
|
|
50
|
+
return {
|
|
51
|
+
label,
|
|
52
|
+
prevPath: `changes.previous.contact.${contactPath}`,
|
|
53
|
+
newPath: `changes.new.contact.${contactPath}`
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Field configurations for audit events with change tracking.
|
|
59
|
+
* Maps event types to their data paths and display labels.
|
|
60
|
+
*/
|
|
61
|
+
export const fieldConfigs: Record<string, FieldConfig> = {
|
|
62
|
+
[AuditEventMessageType.FORM_TITLE_UPDATED]: createFieldConfig(
|
|
63
|
+
'the form name',
|
|
64
|
+
'Updated',
|
|
65
|
+
'title'
|
|
66
|
+
),
|
|
67
|
+
[AuditEventMessageType.FORM_ORGANISATION_UPDATED]: createFieldConfig(
|
|
68
|
+
'the lead organisation',
|
|
69
|
+
'Changed',
|
|
70
|
+
'organisation'
|
|
71
|
+
),
|
|
72
|
+
[AuditEventMessageType.FORM_TEAM_NAME_UPDATED]: createFieldConfig(
|
|
73
|
+
'the team name',
|
|
74
|
+
'Changed',
|
|
75
|
+
'teamName'
|
|
76
|
+
),
|
|
77
|
+
[AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED]: createFieldConfig(
|
|
78
|
+
'the shared team address',
|
|
79
|
+
'Updated',
|
|
80
|
+
'teamEmail'
|
|
81
|
+
),
|
|
82
|
+
[AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED]: createFieldConfig(
|
|
83
|
+
'where submitted forms are sent',
|
|
84
|
+
'Updated',
|
|
85
|
+
'notificationEmail'
|
|
86
|
+
),
|
|
87
|
+
[AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED]: createFieldConfig(
|
|
88
|
+
'the privacy notice link',
|
|
89
|
+
'Updated',
|
|
90
|
+
'privacyNoticeUrl'
|
|
91
|
+
),
|
|
92
|
+
[AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED]: createFieldConfig(
|
|
93
|
+
'the next steps guidance',
|
|
94
|
+
'Updated',
|
|
95
|
+
'submissionGuidance'
|
|
96
|
+
),
|
|
97
|
+
[AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED]: createFieldConfig(
|
|
98
|
+
'the support phone number',
|
|
99
|
+
'Updated',
|
|
100
|
+
'phone'
|
|
101
|
+
),
|
|
102
|
+
[AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED]: createFieldConfig(
|
|
103
|
+
'the support email address',
|
|
104
|
+
'Updated',
|
|
105
|
+
'address'
|
|
106
|
+
),
|
|
107
|
+
[AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED]: createFieldConfig(
|
|
108
|
+
'the support contact link',
|
|
109
|
+
'Updated',
|
|
110
|
+
'url'
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Support contact field configurations for change detection.
|
|
116
|
+
* Used when checking FORM_SUPPORT_CONTACT_UPDATED events.
|
|
117
|
+
*/
|
|
118
|
+
export const supportContactFields: SupportContactFieldConfig[] = [
|
|
119
|
+
createSupportContactField('phone number', 'phone'),
|
|
120
|
+
createSupportContactField('email address', 'email.address'),
|
|
121
|
+
createSupportContactField('online contact link', 'online.url')
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Event types that are always considered valid (don't need change comparison).
|
|
126
|
+
* These events represent actions rather than field updates.
|
|
127
|
+
*/
|
|
128
|
+
export const alwaysValidEvents = new Set<string>([
|
|
129
|
+
AuditEventMessageType.FORM_CREATED,
|
|
130
|
+
AuditEventMessageType.FORM_UPDATED,
|
|
131
|
+
AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT,
|
|
132
|
+
AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE,
|
|
133
|
+
AuditEventMessageType.FORM_DRAFT_DELETED,
|
|
134
|
+
AuditEventMessageType.FORM_MIGRATED,
|
|
135
|
+
AuditEventMessageType.FORM_JSON_UPLOADED,
|
|
136
|
+
AuditEventMessageType.FORM_JSON_DOWNLOADED,
|
|
137
|
+
AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED,
|
|
138
|
+
AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED
|
|
139
|
+
])
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Type guard to check if an audit record is consolidated.
|
|
143
|
+
* @param record - The audit record to check
|
|
144
|
+
* @returns True if the record has consolidation metadata
|
|
145
|
+
*/
|
|
146
|
+
export function isConsolidatedRecord(
|
|
147
|
+
record: AuditRecord | ConsolidatedAuditRecord
|
|
148
|
+
): record is ConsolidatedAuditRecord {
|
|
149
|
+
return 'consolidatedCount' in record && record.consolidatedCount > 1
|
|
150
|
+
}
|
|
@@ -470,3 +470,16 @@ export type AuditRecord = AuditMessage & AuditInputMeta
|
|
|
470
470
|
export interface MessageBody {
|
|
471
471
|
Message: string
|
|
472
472
|
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Consolidated audit record that represents multiple grouped events.
|
|
476
|
+
* Combines AuditRecord with consolidation metadata.
|
|
477
|
+
*/
|
|
478
|
+
export type ConsolidatedAuditRecord = AuditRecord & {
|
|
479
|
+
/** Number of events consolidated into this record */
|
|
480
|
+
consolidatedCount: number
|
|
481
|
+
/** Timestamp of the earliest event in the group */
|
|
482
|
+
consolidatedFrom: Date
|
|
483
|
+
/** Timestamp of the latest event in the group */
|
|
484
|
+
consolidatedTo: Date
|
|
485
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from '~/src/utils/helpers.js'
|
|
|
24
24
|
export * from '~/src/utils/markdown.js'
|
|
25
25
|
export * from '~/src/form/form-audit/index.js'
|
|
26
26
|
export * from '~/src/form/form-audit/enums.js'
|
|
27
|
+
export * from '~/src/form/form-audit/consolidation.js'
|
|
27
28
|
|
|
28
29
|
export type * from '~/src/common/types.js'
|
|
29
30
|
export type * from '~/src/common/pagination/types.js'
|