@opencrvs/toolkit 1.9.12-rc.ba08187 → 1.9.12-rc.ba2ea5c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/build.sh +8 -0
  2. package/dist/application-config/index.js +47 -36
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +3161 -0
  6. package/dist/commons/api/router.d.ts +320 -108
  7. package/dist/commons/application-config/index.d.ts +7 -12
  8. package/dist/commons/conditionals/conditionals.d.ts +8 -8
  9. package/dist/commons/events/ActionDocument.d.ts +196 -196
  10. package/dist/commons/events/ActionInput.d.ts +113 -113
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +16 -10
  12. package/dist/commons/events/AuditLog.d.ts +345 -163
  13. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  14. package/dist/commons/events/CountryConfigQueryInput.d.ts +331 -60
  15. package/dist/commons/events/Draft.d.ts +13 -13
  16. package/dist/commons/events/DynamicFieldValue.d.ts +37 -19
  17. package/dist/commons/events/EventConfig.d.ts +1 -1
  18. package/dist/commons/events/EventDocument.d.ts +80 -80
  19. package/dist/commons/events/EventIndex.d.ts +20 -12
  20. package/dist/commons/events/EventInput.d.ts +1 -1
  21. package/dist/commons/events/EventMetadata.d.ts +18 -18
  22. package/dist/commons/events/FieldConfig.d.ts +267 -51
  23. package/dist/commons/events/FieldType.d.ts +2 -1
  24. package/dist/commons/events/FieldTypeMapping.d.ts +96 -70
  25. package/dist/commons/events/FieldValue.d.ts +54 -26
  26. package/dist/commons/events/PlainDate.d.ts +1 -1
  27. package/dist/commons/events/WorkqueueColumnConfig.d.ts +16 -16
  28. package/dist/commons/events/WorkqueueConfig.d.ts +340 -96
  29. package/dist/commons/events/defineConfig.d.ts +0 -4
  30. package/dist/commons/events/locations.d.ts +4 -4
  31. package/dist/commons/events/scopes.d.ts +3 -2
  32. package/dist/commons/events/state/utils.d.ts +2 -2
  33. package/dist/commons/events/test.utils.d.ts +2 -2
  34. package/dist/commons/events/utils.d.ts +4 -176
  35. package/dist/commons/notification/UserNotifications.d.ts +6 -1
  36. package/dist/conditionals/index.js +74 -359
  37. package/dist/events/index.js +1194 -1261
  38. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
  39. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
  40. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
  41. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
  42. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
  43. package/dist/migrations/v2.0/convert-config-files-to-ts.js +753 -0
  44. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
  45. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
  46. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
  47. package/dist/migrations/v2.0/index.d.ts +7 -0
  48. package/dist/migrations/v2.0/index.d.ts.map +1 -0
  49. package/dist/migrations/v2.0/index.js +3100 -0
  50. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
  51. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
  52. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
  53. package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
  54. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
  55. package/dist/migrations/v2.0/migrate-scopes.js +282 -0
  56. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
  57. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
  58. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
  59. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
  60. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
  61. package/dist/migrations/v2.0/migrate-workqueue-configs.js +237 -0
  62. package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
  63. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
  64. package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
  65. package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
  66. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
  67. package/dist/migrations/v2.0/remove-demo-scope.js +75 -0
  68. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
  69. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
  70. package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
  71. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
  72. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
  73. package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
  74. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
  75. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
  76. package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
  77. package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
  78. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
  79. package/dist/migrations/v2.0/rename-api-paths.js +188 -0
  80. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
  81. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
  82. package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
  83. package/dist/notification/index.js +1002 -1133
  84. package/dist/scopes/index.d.ts +389 -152
  85. package/dist/scopes/index.js +128 -322
  86. package/opencrvs-toolkit-1.9.12-rc.ba2ea5c.tgz +0 -0
  87. package/package.json +11 -7
  88. package/tsconfig.json +3 -0
  89. package/tsconfig.tsbuildinfo +1 -1
  90. package/opencrvs-toolkit-1.9.12-rc.ba08187.tgz +0 -0
@@ -50,6 +50,7 @@ export declare const FieldConfigSchema: z.ZodObject<{
50
50
  readonly SIGNATURE: "SIGNATURE";
51
51
  readonly DATA: "DATA";
52
52
  readonly BUTTON: "BUTTON";
53
+ readonly AUTOCOMPLETE: "AUTOCOMPLETE";
53
54
  readonly SEARCH: "SEARCH";
54
55
  readonly ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON";
55
56
  readonly HTTP: "HTTP";
@@ -98,9 +99,9 @@ export declare const FieldConfigSchema: z.ZodObject<{
98
99
  * that can be passed to the `event` function to create a field config.
99
100
  */
100
101
  export declare const EventFieldIdInput: z.ZodEnum<{
101
- updatedAt: "updatedAt";
102
- status: "status";
103
102
  trackingId: "trackingId";
103
+ status: "status";
104
+ updatedAt: "updatedAt";
104
105
  "legalStatuses.REGISTERED.acceptedAt": "legalStatuses.REGISTERED.acceptedAt";
105
106
  "legalStatuses.REGISTERED.createdAtLocation": "legalStatuses.REGISTERED.createdAtLocation";
106
107
  "legalStatuses.REGISTERED.registrationNumber": "legalStatuses.REGISTERED.registrationNumber";
@@ -115,9 +116,9 @@ export declare const METADATA_FIELD_PREFIX = "event.";
115
116
  * function prefixes the `EventFieldIdInput` values with METADATA_FIELD_PREFIX.
116
117
  */
117
118
  export declare const EventFieldId: z.ZodEnum<{
118
- "event.updatedAt": "event.updatedAt";
119
- "event.status": "event.status";
120
119
  "event.trackingId": "event.trackingId";
120
+ "event.status": "event.status";
121
+ "event.updatedAt": "event.updatedAt";
121
122
  "event.legalStatuses.REGISTERED.acceptedAt": "event.legalStatuses.REGISTERED.acceptedAt";
122
123
  "event.legalStatuses.REGISTERED.createdAtLocation": "event.legalStatuses.REGISTERED.createdAtLocation";
123
124
  "event.legalStatuses.REGISTERED.registrationNumber": "event.legalStatuses.REGISTERED.registrationNumber";
@@ -169,6 +170,7 @@ export declare const EventFieldConfigSchema: z.ZodObject<{
169
170
  readonly SIGNATURE: "SIGNATURE";
170
171
  readonly DATA: "DATA";
171
172
  readonly BUTTON: "BUTTON";
173
+ readonly AUTOCOMPLETE: "AUTOCOMPLETE";
172
174
  readonly SEARCH: "SEARCH";
173
175
  readonly ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON";
174
176
  readonly HTTP: "HTTP";
@@ -210,9 +212,9 @@ export declare const EventFieldConfigSchema: z.ZodObject<{
210
212
  message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
211
213
  }, z.core.$strip>>>;
212
214
  fieldId: z.ZodEnum<{
213
- "event.updatedAt": "event.updatedAt";
214
- "event.status": "event.status";
215
215
  "event.trackingId": "event.trackingId";
216
+ "event.status": "event.status";
217
+ "event.updatedAt": "event.updatedAt";
216
218
  "event.legalStatuses.REGISTERED.acceptedAt": "event.legalStatuses.REGISTERED.acceptedAt";
217
219
  "event.legalStatuses.REGISTERED.createdAtLocation": "event.legalStatuses.REGISTERED.createdAtLocation";
218
220
  "event.legalStatuses.REGISTERED.registrationNumber": "event.legalStatuses.REGISTERED.registrationNumber";
@@ -264,6 +266,7 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
264
266
  readonly SIGNATURE: "SIGNATURE";
265
267
  readonly DATA: "DATA";
266
268
  readonly BUTTON: "BUTTON";
269
+ readonly AUTOCOMPLETE: "AUTOCOMPLETE";
267
270
  readonly SEARCH: "SEARCH";
268
271
  readonly ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON";
269
272
  readonly HTTP: "HTTP";
@@ -351,6 +354,7 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
351
354
  readonly SIGNATURE: "SIGNATURE";
352
355
  readonly DATA: "DATA";
353
356
  readonly BUTTON: "BUTTON";
357
+ readonly AUTOCOMPLETE: "AUTOCOMPLETE";
354
358
  readonly SEARCH: "SEARCH";
355
359
  readonly ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON";
356
360
  readonly HTTP: "HTTP";
@@ -392,9 +396,9 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
392
396
  message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
393
397
  }, z.core.$strip>>>;
394
398
  fieldId: z.ZodEnum<{
395
- "event.updatedAt": "event.updatedAt";
396
- "event.status": "event.status";
397
399
  "event.trackingId": "event.trackingId";
400
+ "event.status": "event.status";
401
+ "event.updatedAt": "event.updatedAt";
398
402
  "event.legalStatuses.REGISTERED.acceptedAt": "event.legalStatuses.REGISTERED.acceptedAt";
399
403
  "event.legalStatuses.REGISTERED.createdAtLocation": "event.legalStatuses.REGISTERED.createdAtLocation";
400
404
  "event.legalStatuses.REGISTERED.registrationNumber": "event.legalStatuses.REGISTERED.registrationNumber";
@@ -449,6 +453,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
449
453
  readonly SIGNATURE: "SIGNATURE";
450
454
  readonly DATA: "DATA";
451
455
  readonly BUTTON: "BUTTON";
456
+ readonly AUTOCOMPLETE: "AUTOCOMPLETE";
452
457
  readonly SEARCH: "SEARCH";
453
458
  readonly ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON";
454
459
  readonly HTTP: "HTTP";
@@ -536,6 +541,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
536
541
  readonly SIGNATURE: "SIGNATURE";
537
542
  readonly DATA: "DATA";
538
543
  readonly BUTTON: "BUTTON";
544
+ readonly AUTOCOMPLETE: "AUTOCOMPLETE";
539
545
  readonly SEARCH: "SEARCH";
540
546
  readonly ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON";
541
547
  readonly HTTP: "HTTP";
@@ -577,9 +583,9 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
577
583
  message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
578
584
  }, z.core.$strip>>>;
579
585
  fieldId: z.ZodEnum<{
580
- "event.updatedAt": "event.updatedAt";
581
- "event.status": "event.status";
582
586
  "event.trackingId": "event.trackingId";
587
+ "event.status": "event.status";
588
+ "event.updatedAt": "event.updatedAt";
583
589
  "event.legalStatuses.REGISTERED.acceptedAt": "event.legalStatuses.REGISTERED.acceptedAt";
584
590
  "event.legalStatuses.REGISTERED.createdAtLocation": "event.legalStatuses.REGISTERED.createdAtLocation";
585
591
  "event.legalStatuses.REGISTERED.registrationNumber": "event.legalStatuses.REGISTERED.registrationNumber";
@@ -1,119 +1,40 @@
1
1
  import * as z from 'zod/v4';
2
- import { TokenUserType } from '../authentication';
3
- /**
4
- * Shared response summary shape for operations that return an event document.
5
- */
6
- type EventResponseSummary = {
7
- eventId: string;
8
- eventType: string;
9
- trackingId: string;
10
- };
11
- export type EventCreateAuditLog = {
12
- operation: 'event.create';
13
- requestData: {
14
- transactionId: string;
15
- type: string;
16
- createdAtLocation: string | null;
17
- };
18
- responseSummary: EventResponseSummary;
19
- };
20
- export type EventGetAuditLog = {
21
- operation: 'event.get';
22
- requestData: {
23
- eventId: string;
24
- };
25
- responseSummary: EventResponseSummary;
26
- };
27
- export type EventSearchAuditLog = {
28
- operation: 'event.search';
29
- requestData: {
30
- query: Record<string, unknown> | null;
31
- limit: number | null;
32
- offset: number | null;
33
- };
34
- responseSummary: {
35
- total: number;
36
- eventIds: string[];
37
- };
38
- };
39
- type ActionAuditLogRequestData = {
40
- eventId: string;
41
- actionType: string;
42
- transactionId: string;
43
- };
44
- export type EventActionAuditLog = {
45
- operation: 'event.actions.notify.request' | 'event.actions.declare.request' | 'event.actions.register.request' | 'event.actions.reject.request' | 'event.actions.validate.request' | 'event.actions.edit.request' | 'event.actions.assign.request' | 'event.actions.unassign.request' | 'event.actions.read.request' | 'event.actions.archive.request' | 'event.actions.reinstate.request' | 'event.actions.print_certificate.request' | 'event.actions.correction.request.request' | 'event.actions.correction.approve.request' | 'event.actions.correction.reject.request' | 'event.actions.mark_as_duplicate.request' | 'event.actions.mark_as_not_duplicate.request';
46
- requestData: ActionAuditLogRequestData;
47
- responseSummary: EventResponseSummary;
48
- };
49
- export type IntegrationCreateAuditLog = {
50
- operation: 'integrations.create';
51
- requestData: {
52
- name: string;
53
- scopes: string[];
54
- };
55
- responseSummary: {
56
- clientId: string;
57
- };
58
- };
59
- export type IntegrationRefreshTokenAuditLog = {
60
- operation: 'integrations.refreshToken';
61
- requestData: {
62
- clientId: string;
63
- };
64
- responseSummary: {
65
- clientId: string;
66
- };
67
- };
68
- export type IntegrationDeactivateAuditLog = {
69
- operation: 'integrations.deactivate';
70
- requestData: {
71
- id: string;
72
- };
73
- responseSummary: {
74
- id: string;
75
- status: string;
76
- };
77
- };
78
- export type IntegrationActivateAuditLog = {
79
- operation: 'integrations.activate';
80
- requestData: {
81
- id: string;
82
- };
83
- responseSummary: {
84
- id: string;
85
- status: string;
86
- };
87
- };
88
- export type IntegrationDeleteAuditLog = {
89
- operation: 'integrations.delete';
90
- requestData: {
91
- id: string;
92
- };
93
- responseSummary: {
94
- id: string;
95
- name: string;
96
- };
97
- };
98
- export type IntegrationRefreshSecretAuditLog = {
99
- operation: 'integrations.refreshSecret';
100
- requestData: {
101
- id: string;
102
- };
103
- responseSummary: {
104
- clientId: string;
105
- };
106
- };
107
- export type AttachmentUploadAuditLog = {
108
- operation: 'attachments.upload';
109
- requestData: {
110
- transactionId: string;
111
- path: string | null;
112
- };
113
- responseSummary: {
114
- fileUrl: string;
115
- };
116
- };
2
+ declare const EventActionEntrySchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ clientId: z.ZodString;
5
+ clientType: z.ZodEnum<{
6
+ user: "user";
7
+ system: "system";
8
+ }>;
9
+ createdAt: z.ZodString;
10
+ operation: z.ZodEnum<{
11
+ "event.actions.notify.request": "event.actions.notify.request";
12
+ "event.actions.declare.request": "event.actions.declare.request";
13
+ "event.actions.register.request": "event.actions.register.request";
14
+ "event.actions.reject.request": "event.actions.reject.request";
15
+ "event.actions.validate.request": "event.actions.validate.request";
16
+ "event.actions.edit.request": "event.actions.edit.request";
17
+ "event.actions.assign.request": "event.actions.assign.request";
18
+ "event.actions.unassign.request": "event.actions.unassign.request";
19
+ "event.actions.read.request": "event.actions.read.request";
20
+ "event.actions.archive.request": "event.actions.archive.request";
21
+ "event.actions.reinstate.request": "event.actions.reinstate.request";
22
+ "event.actions.print_certificate.request": "event.actions.print_certificate.request";
23
+ "event.actions.correction.request.request": "event.actions.correction.request.request";
24
+ "event.actions.correction.approve.request": "event.actions.correction.approve.request";
25
+ "event.actions.correction.reject.request": "event.actions.correction.reject.request";
26
+ "event.actions.mark_as_duplicate.request": "event.actions.mark_as_duplicate.request";
27
+ "event.actions.mark_as_not_duplicate.request": "event.actions.mark_as_not_duplicate.request";
28
+ }>;
29
+ requestData: z.ZodObject<{
30
+ eventId: z.ZodString;
31
+ actionType: z.ZodString;
32
+ eventType: z.ZodString;
33
+ trackingId: z.ZodString;
34
+ transactionId: z.ZodString;
35
+ }, z.core.$strip>;
36
+ }, z.core.$strip>;
37
+ /** Write-side schema for the user audit record mutation (no DB-generated fields). */
117
38
  export declare const UserAuditRecordInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
118
39
  operation: z.ZodLiteral<"user.create_user">;
119
40
  requestData: z.ZodObject<{
@@ -121,103 +42,364 @@ export declare const UserAuditRecordInput: z.ZodDiscriminatedUnion<[z.ZodObject<
121
42
  role: z.ZodString;
122
43
  primaryOfficeId: z.ZodString;
123
44
  }, z.core.$strip>;
124
- responseSummary: z.ZodObject<{}, z.core.$strip>;
125
45
  }, z.core.$strip>, z.ZodObject<{
126
- operation: z.ZodLiteral<"user.deactivate">;
46
+ operation: z.ZodEnum<{
47
+ "user.deactivate": "user.deactivate";
48
+ "user.reactivate": "user.reactivate";
49
+ }>;
127
50
  requestData: z.ZodObject<{
128
51
  subjectId: z.ZodString;
129
52
  reason: z.ZodString;
130
53
  comment: z.ZodOptional<z.ZodString>;
131
54
  }, z.core.$strip>;
132
- responseSummary: z.ZodObject<{}, z.core.$strip>;
133
55
  }, z.core.$strip>, z.ZodObject<{
134
- operation: z.ZodLiteral<"user.reactivate">;
56
+ operation: z.ZodEnum<{
57
+ "user.edit_user": "user.edit_user";
58
+ "user.logged_in": "user.logged_in";
59
+ "user.logged_out": "user.logged_out";
60
+ "user.password_changed": "user.password_changed";
61
+ "user.password_reset": "user.password_reset";
62
+ "user.password_reset_by_admin": "user.password_reset_by_admin";
63
+ "user.username_reminder": "user.username_reminder";
64
+ "user.username_reminder_by_admin": "user.username_reminder_by_admin";
65
+ }>;
135
66
  requestData: z.ZodObject<{
136
67
  subjectId: z.ZodString;
137
- reason: z.ZodString;
138
- comment: z.ZodOptional<z.ZodString>;
139
68
  }, z.core.$strip>;
140
- responseSummary: z.ZodObject<{}, z.core.$strip>;
141
69
  }, z.core.$strip>, z.ZodObject<{
142
- operation: z.ZodLiteral<"user.edit_user">;
70
+ operation: z.ZodLiteral<"user.email_address_changed">;
143
71
  requestData: z.ZodObject<{
144
72
  subjectId: z.ZodString;
145
73
  }, z.core.$strip>;
146
- responseSummary: z.ZodObject<{}, z.core.$strip>;
74
+ responseSummary: z.ZodObject<{
75
+ email: z.ZodString;
76
+ }, z.core.$strip>;
147
77
  }, z.core.$strip>, z.ZodObject<{
148
- operation: z.ZodLiteral<"user.email_address_changed">;
78
+ operation: z.ZodLiteral<"user.phone_number_changed">;
149
79
  requestData: z.ZodObject<{
150
80
  subjectId: z.ZodString;
151
81
  }, z.core.$strip>;
152
82
  responseSummary: z.ZodObject<{
153
- email: z.ZodString;
83
+ phoneNumber: z.ZodString;
84
+ }, z.core.$strip>;
85
+ }, z.core.$strip>], "operation">;
86
+ export type UserAuditLog = z.infer<typeof UserAuditRecordInput>;
87
+ export declare const AuditLogEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
88
+ id: z.ZodString;
89
+ clientId: z.ZodString;
90
+ clientType: z.ZodEnum<{
91
+ user: "user";
92
+ system: "system";
93
+ }>;
94
+ createdAt: z.ZodString;
95
+ operation: z.ZodLiteral<"event.create">;
96
+ requestData: z.ZodObject<{
97
+ transactionId: z.ZodString;
98
+ type: z.ZodString;
99
+ createdAtLocation: z.ZodNullable<z.ZodString>;
100
+ }, z.core.$strip>;
101
+ responseSummary: z.ZodObject<{
102
+ eventId: z.ZodString;
103
+ trackingId: z.ZodString;
154
104
  }, z.core.$strip>;
155
105
  }, z.core.$strip>, z.ZodObject<{
156
- operation: z.ZodLiteral<"user.logged_in">;
106
+ id: z.ZodString;
107
+ clientId: z.ZodString;
108
+ clientType: z.ZodEnum<{
109
+ user: "user";
110
+ system: "system";
111
+ }>;
112
+ createdAt: z.ZodString;
113
+ operation: z.ZodLiteral<"event.get">;
157
114
  requestData: z.ZodObject<{
158
- subjectId: z.ZodString;
115
+ eventId: z.ZodString;
116
+ }, z.core.$strip>;
117
+ responseSummary: z.ZodObject<{
118
+ eventType: z.ZodString;
119
+ trackingId: z.ZodString;
159
120
  }, z.core.$strip>;
160
- responseSummary: z.ZodObject<{}, z.core.$strip>;
161
121
  }, z.core.$strip>, z.ZodObject<{
162
- operation: z.ZodLiteral<"user.logged_out">;
122
+ id: z.ZodString;
123
+ clientId: z.ZodString;
124
+ createdAt: z.ZodString;
125
+ operation: z.ZodLiteral<"event.search">;
126
+ clientType: z.ZodLiteral<"system">;
163
127
  requestData: z.ZodObject<{
164
- subjectId: z.ZodString;
128
+ query: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
+ limit: z.ZodNullable<z.ZodNumber>;
130
+ offset: z.ZodNullable<z.ZodNumber>;
131
+ }, z.core.$strip>;
132
+ responseSummary: z.ZodObject<{
133
+ total: z.ZodNumber;
134
+ eventIds: z.ZodArray<z.ZodString>;
165
135
  }, z.core.$strip>;
166
- responseSummary: z.ZodObject<{}, z.core.$strip>;
167
136
  }, z.core.$strip>, z.ZodObject<{
168
- operation: z.ZodLiteral<"user.password_changed">;
137
+ id: z.ZodString;
138
+ clientId: z.ZodString;
139
+ clientType: z.ZodEnum<{
140
+ user: "user";
141
+ system: "system";
142
+ }>;
143
+ createdAt: z.ZodString;
144
+ operation: z.ZodEnum<{
145
+ "event.actions.notify.request": "event.actions.notify.request";
146
+ "event.actions.declare.request": "event.actions.declare.request";
147
+ "event.actions.register.request": "event.actions.register.request";
148
+ "event.actions.reject.request": "event.actions.reject.request";
149
+ "event.actions.validate.request": "event.actions.validate.request";
150
+ "event.actions.edit.request": "event.actions.edit.request";
151
+ "event.actions.assign.request": "event.actions.assign.request";
152
+ "event.actions.unassign.request": "event.actions.unassign.request";
153
+ "event.actions.read.request": "event.actions.read.request";
154
+ "event.actions.archive.request": "event.actions.archive.request";
155
+ "event.actions.reinstate.request": "event.actions.reinstate.request";
156
+ "event.actions.print_certificate.request": "event.actions.print_certificate.request";
157
+ "event.actions.correction.request.request": "event.actions.correction.request.request";
158
+ "event.actions.correction.approve.request": "event.actions.correction.approve.request";
159
+ "event.actions.correction.reject.request": "event.actions.correction.reject.request";
160
+ "event.actions.mark_as_duplicate.request": "event.actions.mark_as_duplicate.request";
161
+ "event.actions.mark_as_not_duplicate.request": "event.actions.mark_as_not_duplicate.request";
162
+ }>;
169
163
  requestData: z.ZodObject<{
170
- subjectId: z.ZodString;
164
+ eventId: z.ZodString;
165
+ actionType: z.ZodString;
166
+ eventType: z.ZodString;
167
+ trackingId: z.ZodString;
168
+ transactionId: z.ZodString;
171
169
  }, z.core.$strip>;
172
- responseSummary: z.ZodObject<{}, z.core.$strip>;
173
170
  }, z.core.$strip>, z.ZodObject<{
174
- operation: z.ZodLiteral<"user.password_reset">;
171
+ id: z.ZodString;
172
+ clientId: z.ZodString;
173
+ clientType: z.ZodEnum<{
174
+ user: "user";
175
+ system: "system";
176
+ }>;
177
+ createdAt: z.ZodString;
178
+ operation: z.ZodLiteral<"event.actions.custom.request">;
175
179
  requestData: z.ZodObject<{
176
- subjectId: z.ZodString;
180
+ eventId: z.ZodString;
181
+ actionType: z.ZodLiteral<"CUSTOM">;
182
+ customAction: z.ZodString;
183
+ eventType: z.ZodString;
184
+ trackingId: z.ZodString;
185
+ transactionId: z.ZodString;
186
+ }, z.core.$strip>;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ id: z.ZodString;
189
+ clientId: z.ZodString;
190
+ clientType: z.ZodEnum<{
191
+ user: "user";
192
+ system: "system";
193
+ }>;
194
+ createdAt: z.ZodString;
195
+ operation: z.ZodLiteral<"integrations.create">;
196
+ requestData: z.ZodObject<{
197
+ name: z.ZodString;
198
+ scopes: z.ZodArray<z.ZodString>;
199
+ }, z.core.$strip>;
200
+ responseSummary: z.ZodObject<{
201
+ clientId: z.ZodString;
202
+ }, z.core.$strip>;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ id: z.ZodString;
205
+ clientId: z.ZodString;
206
+ clientType: z.ZodEnum<{
207
+ user: "user";
208
+ system: "system";
209
+ }>;
210
+ createdAt: z.ZodString;
211
+ operation: z.ZodLiteral<"integrations.refreshToken">;
212
+ requestData: z.ZodObject<{
213
+ clientId: z.ZodString;
214
+ }, z.core.$strip>;
215
+ responseSummary: z.ZodObject<{
216
+ clientId: z.ZodString;
217
+ }, z.core.$strip>;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ id: z.ZodString;
220
+ clientId: z.ZodString;
221
+ clientType: z.ZodEnum<{
222
+ user: "user";
223
+ system: "system";
224
+ }>;
225
+ createdAt: z.ZodString;
226
+ operation: z.ZodLiteral<"integrations.deactivate">;
227
+ requestData: z.ZodObject<{
228
+ id: z.ZodString;
229
+ }, z.core.$strip>;
230
+ responseSummary: z.ZodObject<{
231
+ id: z.ZodString;
232
+ status: z.ZodString;
177
233
  }, z.core.$strip>;
178
- responseSummary: z.ZodObject<{}, z.core.$strip>;
179
234
  }, z.core.$strip>, z.ZodObject<{
180
- operation: z.ZodLiteral<"user.password_reset_by_admin">;
235
+ id: z.ZodString;
236
+ clientId: z.ZodString;
237
+ clientType: z.ZodEnum<{
238
+ user: "user";
239
+ system: "system";
240
+ }>;
241
+ createdAt: z.ZodString;
242
+ operation: z.ZodLiteral<"integrations.activate">;
243
+ requestData: z.ZodObject<{
244
+ id: z.ZodString;
245
+ }, z.core.$strip>;
246
+ responseSummary: z.ZodObject<{
247
+ id: z.ZodString;
248
+ status: z.ZodString;
249
+ }, z.core.$strip>;
250
+ }, z.core.$strip>, z.ZodObject<{
251
+ id: z.ZodString;
252
+ clientId: z.ZodString;
253
+ clientType: z.ZodEnum<{
254
+ user: "user";
255
+ system: "system";
256
+ }>;
257
+ createdAt: z.ZodString;
258
+ operation: z.ZodLiteral<"integrations.delete">;
259
+ requestData: z.ZodObject<{
260
+ id: z.ZodString;
261
+ }, z.core.$strip>;
262
+ responseSummary: z.ZodObject<{
263
+ id: z.ZodString;
264
+ name: z.ZodString;
265
+ }, z.core.$strip>;
266
+ }, z.core.$strip>, z.ZodObject<{
267
+ id: z.ZodString;
268
+ clientId: z.ZodString;
269
+ clientType: z.ZodEnum<{
270
+ user: "user";
271
+ system: "system";
272
+ }>;
273
+ createdAt: z.ZodString;
274
+ operation: z.ZodLiteral<"integrations.refreshSecret">;
275
+ requestData: z.ZodObject<{
276
+ id: z.ZodString;
277
+ }, z.core.$strip>;
278
+ responseSummary: z.ZodObject<{
279
+ clientId: z.ZodString;
280
+ }, z.core.$strip>;
281
+ }, z.core.$strip>, z.ZodObject<{
282
+ id: z.ZodString;
283
+ clientId: z.ZodString;
284
+ clientType: z.ZodEnum<{
285
+ user: "user";
286
+ system: "system";
287
+ }>;
288
+ createdAt: z.ZodString;
289
+ operation: z.ZodLiteral<"attachments.upload">;
290
+ requestData: z.ZodObject<{
291
+ transactionId: z.ZodString;
292
+ path: z.ZodNullable<z.ZodString>;
293
+ }, z.core.$strip>;
294
+ responseSummary: z.ZodObject<{
295
+ fileUrl: z.ZodString;
296
+ }, z.core.$strip>;
297
+ }, z.core.$strip>, z.ZodObject<{
298
+ id: z.ZodString;
299
+ clientId: z.ZodString;
300
+ clientType: z.ZodEnum<{
301
+ user: "user";
302
+ system: "system";
303
+ }>;
304
+ createdAt: z.ZodString;
305
+ operation: z.ZodLiteral<"user.create_user">;
181
306
  requestData: z.ZodObject<{
182
307
  subjectId: z.ZodString;
308
+ role: z.ZodString;
309
+ primaryOfficeId: z.ZodString;
183
310
  }, z.core.$strip>;
184
- responseSummary: z.ZodObject<{}, z.core.$strip>;
185
311
  }, z.core.$strip>, z.ZodObject<{
186
- operation: z.ZodLiteral<"user.phone_number_changed">;
312
+ id: z.ZodString;
313
+ clientId: z.ZodString;
314
+ clientType: z.ZodEnum<{
315
+ user: "user";
316
+ system: "system";
317
+ }>;
318
+ createdAt: z.ZodString;
319
+ operation: z.ZodEnum<{
320
+ "user.deactivate": "user.deactivate";
321
+ "user.reactivate": "user.reactivate";
322
+ }>;
187
323
  requestData: z.ZodObject<{
188
324
  subjectId: z.ZodString;
325
+ reason: z.ZodString;
326
+ comment: z.ZodOptional<z.ZodString>;
189
327
  }, z.core.$strip>;
190
- responseSummary: z.ZodObject<{
191
- phoneNumber: z.ZodString;
328
+ }, z.core.$strip>, z.ZodObject<{
329
+ id: z.ZodString;
330
+ clientId: z.ZodString;
331
+ clientType: z.ZodEnum<{
332
+ user: "user";
333
+ system: "system";
334
+ }>;
335
+ createdAt: z.ZodString;
336
+ operation: z.ZodEnum<{
337
+ "user.edit_user": "user.edit_user";
338
+ "user.logged_in": "user.logged_in";
339
+ "user.logged_out": "user.logged_out";
340
+ "user.password_changed": "user.password_changed";
341
+ "user.password_reset": "user.password_reset";
342
+ "user.password_reset_by_admin": "user.password_reset_by_admin";
343
+ "user.username_reminder": "user.username_reminder";
344
+ "user.username_reminder_by_admin": "user.username_reminder_by_admin";
345
+ }>;
346
+ requestData: z.ZodObject<{
347
+ subjectId: z.ZodString;
192
348
  }, z.core.$strip>;
193
349
  }, z.core.$strip>, z.ZodObject<{
194
- operation: z.ZodLiteral<"user.username_reminder">;
350
+ id: z.ZodString;
351
+ clientId: z.ZodString;
352
+ clientType: z.ZodEnum<{
353
+ user: "user";
354
+ system: "system";
355
+ }>;
356
+ createdAt: z.ZodString;
357
+ operation: z.ZodLiteral<"user.email_address_changed">;
195
358
  requestData: z.ZodObject<{
196
359
  subjectId: z.ZodString;
197
360
  }, z.core.$strip>;
198
- responseSummary: z.ZodObject<{}, z.core.$strip>;
361
+ responseSummary: z.ZodObject<{
362
+ email: z.ZodString;
363
+ }, z.core.$strip>;
199
364
  }, z.core.$strip>, z.ZodObject<{
200
- operation: z.ZodLiteral<"user.username_reminder_by_admin">;
365
+ id: z.ZodString;
366
+ clientId: z.ZodString;
367
+ clientType: z.ZodEnum<{
368
+ user: "user";
369
+ system: "system";
370
+ }>;
371
+ createdAt: z.ZodString;
372
+ operation: z.ZodLiteral<"user.phone_number_changed">;
201
373
  requestData: z.ZodObject<{
202
374
  subjectId: z.ZodString;
203
375
  }, z.core.$strip>;
204
- responseSummary: z.ZodObject<{}, z.core.$strip>;
376
+ responseSummary: z.ZodObject<{
377
+ phoneNumber: z.ZodString;
378
+ }, z.core.$strip>;
205
379
  }, z.core.$strip>], "operation">;
206
- export type UserAuditLog = z.infer<typeof UserAuditRecordInput>;
207
- /**
208
- * Union of all audit log entry variants.
209
- * Each variant narrows the `operation`, `requestData`, and `responseSummary` fields together.
210
- * Event action operations are grouped into a single `EventActionAuditLog` type since they
211
- * share identical requestData and responseSummary shapes.
212
- */
213
- export type AuditLogOperation = EventCreateAuditLog | EventGetAuditLog | EventSearchAuditLog | EventActionAuditLog | IntegrationCreateAuditLog | IntegrationDeactivateAuditLog | IntegrationActivateAuditLog | IntegrationDeleteAuditLog | IntegrationRefreshSecretAuditLog | AttachmentUploadAuditLog | UserAuditLog | IntegrationCreateAuditLog | IntegrationRefreshTokenAuditLog | IntegrationDeactivateAuditLog | IntegrationActivateAuditLog | IntegrationDeleteAuditLog;
214
- /**
215
- * Parameters for writing an audit log entry.
216
- * All fields must be supplied explicitly by the caller — do not pass JWT or context objects.
217
- */
218
- export type AuditLogParams = AuditLogOperation & {
219
- clientId: string;
220
- clientType: TokenUserType;
221
- };
380
+ /** A persisted audit log entry as returned from the database. */
381
+ export type AuditLogEntry = z.infer<typeof AuditLogEntrySchema>;
382
+ /** Distributes Omit over a union so each variant is narrowed correctly. */
383
+ type DistributiveOmit<T, K extends string> = T extends unknown ? Omit<T, K> : never;
384
+ /** Parameters for writing an audit log entry. All fields must be supplied
385
+ * explicitly by the caller — do not pass JWT or context objects. */
386
+ export type AuditLogParams = DistributiveOmit<AuditLogEntry, 'id' | 'createdAt'>;
387
+ /** Union of all operation shapes (without auth or meta fields). */
388
+ export type AuditLogOperation = DistributiveOmit<AuditLogParams, 'clientId' | 'clientType'>;
389
+ /** Event action entries that carry a full event response summary. */
390
+ export type EventActionAuditLog = z.infer<typeof EventActionEntrySchema>;
391
+ /** Custom action entry — operation carries a `customAction` identifier. */
392
+ export type EventCustomActionAuditLog = Extract<AuditLogEntry, {
393
+ operation: 'event.actions.custom.request';
394
+ }>;
395
+ export type EventCreateAuditLog = Extract<AuditLogEntry, {
396
+ operation: 'event.create';
397
+ }>;
398
+ export type EventGetAuditLog = Extract<AuditLogEntry, {
399
+ operation: 'event.get';
400
+ }>;
401
+ export type EventSearchAuditLog = Extract<AuditLogEntry, {
402
+ operation: 'event.search';
403
+ }>;
222
404
  export {};
223
405
  //# sourceMappingURL=AuditLog.d.ts.map