@opencrvs/toolkit 2.0.0-rc.871fe69 → 2.0.0-rc.87ceb55

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.
@@ -910,6 +910,152 @@ export declare const WorkqueueConfigWithoutQuery: z.ZodObject<{
910
910
  export declare const WorkqueueConfigInput: z.ZodObject<{
911
911
  slug: z.ZodString;
912
912
  name: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
913
+ action: z.ZodOptional<z.ZodObject<{
914
+ type: z.ZodEnum<{
915
+ DELETE: "DELETE";
916
+ DECLARE: "DECLARE";
917
+ REGISTER: "REGISTER";
918
+ EDIT: "EDIT";
919
+ REJECT: "REJECT";
920
+ MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE";
921
+ ARCHIVE: "ARCHIVE";
922
+ PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
923
+ REQUEST_CORRECTION: "REQUEST_CORRECTION";
924
+ READ: "READ";
925
+ }>;
926
+ }, z.core.$strip>>;
927
+ columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
928
+ label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
929
+ value: z.ZodObject<{
930
+ $event: z.ZodEnum<{
931
+ id: "id";
932
+ title: "title";
933
+ type: "type";
934
+ updatedAt: "updatedAt";
935
+ placeOfEvent: "placeOfEvent";
936
+ createdByUserType: "createdByUserType";
937
+ createdAt: "createdAt";
938
+ createdBy: "createdBy";
939
+ createdAtLocation: "createdAtLocation";
940
+ status: "status";
941
+ assignedTo: "assignedTo";
942
+ trackingId: "trackingId";
943
+ legalStatuses: "legalStatuses";
944
+ dateOfEvent: "dateOfEvent";
945
+ updatedByUserRole: "updatedByUserRole";
946
+ updatedAtLocation: "updatedAtLocation";
947
+ updatedBy: "updatedBy";
948
+ flags: "flags";
949
+ outbox: "outbox";
950
+ }>;
951
+ }, z.core.$strip>;
952
+ }, z.core.$strip>>>;
953
+ icon: z.ZodEnum<{
954
+ Archived: "Archived";
955
+ Assigned: "Assigned";
956
+ Briefcase: "Briefcase";
957
+ Certified: "Certified";
958
+ Close: "Close";
959
+ Collapse: "Collapse";
960
+ Draft: "Draft";
961
+ DuplicateYellow: "DuplicateYellow";
962
+ Expand: "Expand";
963
+ ExternalValidate: "ExternalValidate";
964
+ FilledCheck: "FilledCheck";
965
+ InReview: "InReview";
966
+ Offline: "Offline";
967
+ Registered: "Registered";
968
+ RequiresUpdates: "RequiresUpdates";
969
+ Sent: "Sent";
970
+ Validated: "Validated";
971
+ WaitingApproval: "WaitingApproval";
972
+ ChartActivity: "ChartActivity";
973
+ Activity: "Activity";
974
+ Archive: "Archive";
975
+ ArchiveTray: "ArchiveTray";
976
+ ArrowLeft: "ArrowLeft";
977
+ ArrowRight: "ArrowRight";
978
+ Buildings: "Buildings";
979
+ Circle: "Circle";
980
+ CaretDown: "CaretDown";
981
+ CaretLeft: "CaretLeft";
982
+ CaretRight: "CaretRight";
983
+ ChartBar: "ChartBar";
984
+ ChartLine: "ChartLine";
985
+ ChatCircle: "ChatCircle";
986
+ CheckSquare: "CheckSquare";
987
+ Compass: "Compass";
988
+ Check: "Check";
989
+ Copy: "Copy";
990
+ Database: "Database";
991
+ DotsThreeVertical: "DotsThreeVertical";
992
+ ArrowCounterClockwise: "ArrowCounterClockwise";
993
+ MagnifyingGlassMinus: "MagnifyingGlassMinus";
994
+ MagnifyingGlassPlus: "MagnifyingGlassPlus";
995
+ Export: "Export";
996
+ Eye: "Eye";
997
+ EyeSlash: "EyeSlash";
998
+ Envelope: "Envelope";
999
+ File: "File";
1000
+ FileSearch: "FileSearch";
1001
+ FileMinus: "FileMinus";
1002
+ FilePlus: "FilePlus";
1003
+ FileText: "FileText";
1004
+ FileX: "FileX";
1005
+ Handshake: "Handshake";
1006
+ Gear: "Gear";
1007
+ GitBranch: "GitBranch";
1008
+ IdentificationCard: "IdentificationCard";
1009
+ List: "List";
1010
+ ListBullets: "ListBullets";
1011
+ Lock: "Lock";
1012
+ MagnifyingGlass: "MagnifyingGlass";
1013
+ MapPin: "MapPin";
1014
+ Medal: "Medal";
1015
+ NotePencil: "NotePencil";
1016
+ Paperclip: "Paperclip";
1017
+ PaperPlaneTilt: "PaperPlaneTilt";
1018
+ Pen: "Pen";
1019
+ PenNib: "PenNib";
1020
+ Pencil: "Pencil";
1021
+ PencilSimpleLine: "PencilSimpleLine";
1022
+ Phone: "Phone";
1023
+ Plus: "Plus";
1024
+ Printer: "Printer";
1025
+ SignOut: "SignOut";
1026
+ Stamp: "Stamp";
1027
+ Star: "Star";
1028
+ Target: "Target";
1029
+ TextT: "TextT";
1030
+ Trash: "Trash";
1031
+ UploadSimple: "UploadSimple";
1032
+ User: "User";
1033
+ UserPlus: "UserPlus";
1034
+ Users: "Users";
1035
+ WarningCircle: "WarningCircle";
1036
+ X: "X";
1037
+ ChatText: "ChatText";
1038
+ CircleWavyCheck: "CircleWavyCheck";
1039
+ CircleWavyQuestion: "CircleWavyQuestion";
1040
+ ArchiveBox: "ArchiveBox";
1041
+ ArrowCircleDown: "ArrowCircleDown";
1042
+ FileArrowUp: "FileArrowUp";
1043
+ FileDotted: "FileDotted";
1044
+ Files: "Files";
1045
+ PencilLine: "PencilLine";
1046
+ PencilCircle: "PencilCircle";
1047
+ UserCircle: "UserCircle";
1048
+ Clock: "Clock";
1049
+ QrCode: "QrCode";
1050
+ Webcam: "Webcam";
1051
+ Sun: "Sun";
1052
+ DeviceTabletCamera: "DeviceTabletCamera";
1053
+ Globe: "Globe";
1054
+ Fingerprint: "Fingerprint";
1055
+ PushPin: "PushPin";
1056
+ Timer: "Timer";
1057
+ }>;
1058
+ emptyMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
913
1059
  query: z.ZodUnion<readonly [z.ZodObject<{
914
1060
  eventType: z.ZodOptional<z.ZodString>;
915
1061
  status: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
@@ -1838,152 +1984,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1838
1984
  data: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
1839
1985
  }, z.core.$strip>>;
1840
1986
  }, z.core.$strip>]>;
1841
- action: z.ZodOptional<z.ZodObject<{
1842
- type: z.ZodEnum<{
1843
- DELETE: "DELETE";
1844
- DECLARE: "DECLARE";
1845
- REGISTER: "REGISTER";
1846
- EDIT: "EDIT";
1847
- REJECT: "REJECT";
1848
- MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE";
1849
- ARCHIVE: "ARCHIVE";
1850
- PRINT_CERTIFICATE: "PRINT_CERTIFICATE";
1851
- REQUEST_CORRECTION: "REQUEST_CORRECTION";
1852
- READ: "READ";
1853
- }>;
1854
- }, z.core.$strip>>;
1855
- columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
1856
- label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
1857
- value: z.ZodObject<{
1858
- $event: z.ZodEnum<{
1859
- id: "id";
1860
- title: "title";
1861
- type: "type";
1862
- updatedAt: "updatedAt";
1863
- placeOfEvent: "placeOfEvent";
1864
- createdByUserType: "createdByUserType";
1865
- createdAt: "createdAt";
1866
- createdBy: "createdBy";
1867
- createdAtLocation: "createdAtLocation";
1868
- status: "status";
1869
- assignedTo: "assignedTo";
1870
- trackingId: "trackingId";
1871
- legalStatuses: "legalStatuses";
1872
- dateOfEvent: "dateOfEvent";
1873
- updatedByUserRole: "updatedByUserRole";
1874
- updatedAtLocation: "updatedAtLocation";
1875
- updatedBy: "updatedBy";
1876
- flags: "flags";
1877
- outbox: "outbox";
1878
- }>;
1879
- }, z.core.$strip>;
1880
- }, z.core.$strip>>>;
1881
- icon: z.ZodEnum<{
1882
- Archived: "Archived";
1883
- Assigned: "Assigned";
1884
- Briefcase: "Briefcase";
1885
- Certified: "Certified";
1886
- Close: "Close";
1887
- Collapse: "Collapse";
1888
- Draft: "Draft";
1889
- DuplicateYellow: "DuplicateYellow";
1890
- Expand: "Expand";
1891
- ExternalValidate: "ExternalValidate";
1892
- FilledCheck: "FilledCheck";
1893
- InReview: "InReview";
1894
- Offline: "Offline";
1895
- Registered: "Registered";
1896
- RequiresUpdates: "RequiresUpdates";
1897
- Sent: "Sent";
1898
- Validated: "Validated";
1899
- WaitingApproval: "WaitingApproval";
1900
- ChartActivity: "ChartActivity";
1901
- Activity: "Activity";
1902
- Archive: "Archive";
1903
- ArchiveTray: "ArchiveTray";
1904
- ArrowLeft: "ArrowLeft";
1905
- ArrowRight: "ArrowRight";
1906
- Buildings: "Buildings";
1907
- Circle: "Circle";
1908
- CaretDown: "CaretDown";
1909
- CaretLeft: "CaretLeft";
1910
- CaretRight: "CaretRight";
1911
- ChartBar: "ChartBar";
1912
- ChartLine: "ChartLine";
1913
- ChatCircle: "ChatCircle";
1914
- CheckSquare: "CheckSquare";
1915
- Compass: "Compass";
1916
- Check: "Check";
1917
- Copy: "Copy";
1918
- Database: "Database";
1919
- DotsThreeVertical: "DotsThreeVertical";
1920
- ArrowCounterClockwise: "ArrowCounterClockwise";
1921
- MagnifyingGlassMinus: "MagnifyingGlassMinus";
1922
- MagnifyingGlassPlus: "MagnifyingGlassPlus";
1923
- Export: "Export";
1924
- Eye: "Eye";
1925
- EyeSlash: "EyeSlash";
1926
- Envelope: "Envelope";
1927
- File: "File";
1928
- FileSearch: "FileSearch";
1929
- FileMinus: "FileMinus";
1930
- FilePlus: "FilePlus";
1931
- FileText: "FileText";
1932
- FileX: "FileX";
1933
- Handshake: "Handshake";
1934
- Gear: "Gear";
1935
- GitBranch: "GitBranch";
1936
- IdentificationCard: "IdentificationCard";
1937
- List: "List";
1938
- ListBullets: "ListBullets";
1939
- Lock: "Lock";
1940
- MagnifyingGlass: "MagnifyingGlass";
1941
- MapPin: "MapPin";
1942
- Medal: "Medal";
1943
- NotePencil: "NotePencil";
1944
- Paperclip: "Paperclip";
1945
- PaperPlaneTilt: "PaperPlaneTilt";
1946
- Pen: "Pen";
1947
- PenNib: "PenNib";
1948
- Pencil: "Pencil";
1949
- PencilSimpleLine: "PencilSimpleLine";
1950
- Phone: "Phone";
1951
- Plus: "Plus";
1952
- Printer: "Printer";
1953
- SignOut: "SignOut";
1954
- Stamp: "Stamp";
1955
- Star: "Star";
1956
- Target: "Target";
1957
- TextT: "TextT";
1958
- Trash: "Trash";
1959
- UploadSimple: "UploadSimple";
1960
- User: "User";
1961
- UserPlus: "UserPlus";
1962
- Users: "Users";
1963
- WarningCircle: "WarningCircle";
1964
- X: "X";
1965
- ChatText: "ChatText";
1966
- CircleWavyCheck: "CircleWavyCheck";
1967
- CircleWavyQuestion: "CircleWavyQuestion";
1968
- ArchiveBox: "ArchiveBox";
1969
- ArrowCircleDown: "ArrowCircleDown";
1970
- FileArrowUp: "FileArrowUp";
1971
- FileDotted: "FileDotted";
1972
- Files: "Files";
1973
- PencilLine: "PencilLine";
1974
- PencilCircle: "PencilCircle";
1975
- UserCircle: "UserCircle";
1976
- Clock: "Clock";
1977
- QrCode: "QrCode";
1978
- Webcam: "Webcam";
1979
- Sun: "Sun";
1980
- DeviceTabletCamera: "DeviceTabletCamera";
1981
- Globe: "Globe";
1982
- Fingerprint: "Fingerprint";
1983
- PushPin: "PushPin";
1984
- Timer: "Timer";
1985
- }>;
1986
- emptyMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
1987
1987
  }, z.core.$strip>;
1988
1988
  export type WorkqueueConfig = z.infer<typeof WorkqueueConfig>;
1989
1989
  export type WorkqueueConfigWithoutQuery = z.infer<typeof WorkqueueConfigWithoutQuery>;
@@ -9,7 +9,6 @@ import { UUID } from '../../uuid';
9
9
  import { DocumentPath } from '../../documents';
10
10
  export declare function getStatusFromActions(actions: Array<Action>): "CREATED" | "NOTIFIED" | "DECLARED" | "REGISTERED" | "ARCHIVED";
11
11
  export declare function getAssignedUserFromActions(actions: Array<ActionDocument>): string | null;
12
- export declare function getAssignedUserSignatureFromActions(actions: Array<ActionDocument>): (string & import("zod").$brand<"DocumentPath">) | null;
13
12
  type NonNullableDeep<T> = T extends [unknown, ...unknown[]] ? {
14
13
  [K in keyof T]: NonNullableDeep<NonNullable<T[K]>>;
15
14
  } : T extends UUID ? T : T extends DocumentPath ? T : T extends string ? NonNullable<T> : T extends (infer U)[] ? NonNullableDeep<U>[] : T extends object ? {
@@ -73,7 +72,6 @@ export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Dr
73
72
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
74
73
  createdByUserType?: "user" | "system" | null | undefined;
75
74
  createdByRole?: string | undefined;
76
- createdBySignature?: string | null | undefined;
77
75
  } | null | undefined;
78
76
  REGISTERED?: {
79
77
  createdAt: string;
@@ -83,7 +81,6 @@ export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Dr
83
81
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
84
82
  createdByUserType?: "user" | "system" | null | undefined;
85
83
  createdByRole?: string | undefined;
86
- createdBySignature?: string | null | undefined;
87
84
  } | null | undefined;
88
85
  };
89
86
  createdAt: string;
@@ -101,10 +98,8 @@ export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Dr
101
98
  createdByUserType?: "user" | "system" | null | undefined;
102
99
  updatedByUserRole?: string | null | undefined;
103
100
  createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
104
- createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
105
101
  updatedAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
106
102
  assignedTo?: string | null | undefined;
107
- assignedToSignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
108
103
  updatedBy?: string | null | undefined;
109
104
  };
110
105
  /**
@@ -312,7 +312,6 @@ export declare function getLegalStatuses(actions: Action[]): {
312
312
  createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
313
313
  acceptedAt: string;
314
314
  createdByRole: string | undefined;
315
- createdBySignature: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
316
315
  registrationNumber: string | null | undefined;
317
316
  } | null;
318
317
  REGISTERED: {
@@ -322,7 +321,6 @@ export declare function getLegalStatuses(actions: Action[]): {
322
321
  createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
323
322
  acceptedAt: string;
324
323
  createdByRole: string | undefined;
325
- createdBySignature: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
326
324
  registrationNumber: string | null | undefined;
327
325
  } | null;
328
326
  };
@@ -131,7 +131,7 @@ export declare function isPageVisible(page: PageConfig, formValues: ActionUpdate
131
131
  * * @param validatorContext - custom validation context
132
132
  * @returns {Partial<T>} A new object containing only the values for visible fields
133
133
  */
134
- export declare function omitHiddenFields<T extends EventState | ActionUpdate>(fields: FieldConfig[], formValues: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean, declarationContext?: EventState): Partial<T>;
134
+ export declare function omitHiddenFields<T extends EventState | ActionUpdate>(fields: FieldConfig[], formValues: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean): Partial<T>;
135
135
  export declare function omitHiddenPaginatedFields<T extends EventState | ActionUpdate>(formConfig: FormConfig, values: T, validatorContext: ValidatorContext, includeHiddenFieldsWithNullValues?: boolean): Partial<Partial<T>>;
136
136
  /**
137
137
  *
@@ -365,7 +365,9 @@ var ScopeType2 = z6.enum([
365
365
  var EncodedScope2 = z6.string().brand("EncodedScope");
366
366
  var DEFAULT_SCOPE_OPTIONS = {
367
367
  placeOfEvent: JurisdictionFilter.enum.all,
368
- accessLevel: JurisdictionFilter.enum.all
368
+ accessLevel: JurisdictionFilter.enum.all,
369
+ registeredIn: JurisdictionFilter.enum.all,
370
+ declaredIn: JurisdictionFilter.enum.all
369
371
  };
370
372
 
371
373
  // ../commons/src/users/userReferences.ts
@@ -306,7 +306,6 @@ __export(events_exports, {
306
306
  getAllUniqueFields: () => getAllUniqueFields,
307
307
  getAnnotationFromDrafts: () => getAnnotationFromDrafts,
308
308
  getAssignedUserFromActions: () => getAssignedUserFromActions,
309
- getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
310
309
  getAssignmentStatus: () => getAssignmentStatus,
311
310
  getAvailableActionsForEvent: () => getAvailableActionsForEvent,
312
311
  getAvailableRolesForUserUpdatePayload: () => getAvailableRolesForUserUpdatePayload,
@@ -705,7 +704,9 @@ var decodeScope = (query) => {
705
704
  };
706
705
  var DEFAULT_SCOPE_OPTIONS = {
707
706
  placeOfEvent: JurisdictionFilter.enum.all,
708
- accessLevel: JurisdictionFilter.enum.all
707
+ accessLevel: JurisdictionFilter.enum.all,
708
+ registeredIn: JurisdictionFilter.enum.all,
709
+ declaredIn: JurisdictionFilter.enum.all
709
710
  };
710
711
  function getAcceptedScopesByType({
711
712
  acceptedScopes,
@@ -1078,7 +1079,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
1078
1079
  ShowConditional,
1079
1080
  // Action can be shown to the user in the list but as disabled
1080
1081
  EnableConditional
1081
- ]);
1082
+ ]).meta({
1083
+ description: "Action conditional configuration",
1084
+ id: "ActionConditional"
1085
+ });
1082
1086
  var DisplayOnReviewConditional = z7.object({
1083
1087
  type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
1084
1088
  conditional: Conditional
@@ -1737,6 +1741,9 @@ var FlagConfig = z15.object({
1737
1741
  "Indicates if this flag expects an action to be performed to be cleared."
1738
1742
  ),
1739
1743
  label: TranslationConfig.describe("Human readable label of the flag.")
1744
+ }).meta({
1745
+ description: "Flag configuration",
1746
+ id: "FlagConfig"
1740
1747
  });
1741
1748
  var ActionFlagConfig = z15.object({
1742
1749
  id: Flag,
@@ -1744,6 +1751,9 @@ var ActionFlagConfig = z15.object({
1744
1751
  conditional: Conditional.optional().describe(
1745
1752
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1746
1753
  )
1754
+ }).meta({
1755
+ description: "Action flag configuration",
1756
+ id: "ActionFlagConfig"
1747
1757
  });
1748
1758
 
1749
1759
  // ../commons/src/events/EventMetadata.ts
@@ -1765,8 +1775,7 @@ var ActionCreationMetadata = z16.object({
1765
1775
  ),
1766
1776
  createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1767
1777
  acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
1768
- createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation."),
1769
- createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
1778
+ createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
1770
1779
  });
1771
1780
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1772
1781
  registrationNumber: z16.string().describe(
@@ -1794,9 +1803,6 @@ var EventMetadata = z16.object({
1794
1803
  createdAtLocation: UUID.nullish().describe(
1795
1804
  "Location of the user who created the event."
1796
1805
  ),
1797
- createdBySignature: DocumentPath.nullish().describe(
1798
- "Signature of the user who created the event."
1799
- ),
1800
1806
  updatedAtLocation: UUID.nullish().describe(
1801
1807
  "Location of the user who last changed the status."
1802
1808
  ),
@@ -1804,9 +1810,6 @@ var EventMetadata = z16.object({
1804
1810
  "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
1805
1811
  ),
1806
1812
  assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
1807
- assignedToSignature: DocumentPath.nullish().describe(
1808
- "Signature of the user who is currently assigned to the event."
1809
- ),
1810
1813
  updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
1811
1814
  trackingId: z16.string().describe(
1812
1815
  "System-generated tracking ID used by informants or registrars to look up the event."
@@ -2174,7 +2177,7 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
2174
2177
  }
2175
2178
  }).describe("Unique identifier for the field");
2176
2179
  var FieldReference = import_v43.default.object({
2177
- $$field: FieldId,
2180
+ $$field: FieldId.describe("Id of the field to reference"),
2178
2181
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
2179
2182
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
2180
2183
  )
@@ -2887,10 +2890,10 @@ var VerificationPageConfig = FormPageConfig.extend({
2887
2890
  type: z21.literal(PageTypes.enum.VERIFICATION),
2888
2891
  actions: VerificationActionConfig
2889
2892
  });
2890
- var PageConfig = z21.discriminatedUnion("type", [
2891
- FormPageConfig,
2892
- VerificationPageConfig
2893
- ]);
2893
+ var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
2894
+ description: "Page configuration",
2895
+ id: "PageConfig"
2896
+ });
2894
2897
 
2895
2898
  // ../commons/src/events/FormConfig.ts
2896
2899
  var DeclarationFormConfig = z22.object({
@@ -3799,6 +3802,9 @@ function precompileActionSchemas(eventConfigurations) {
3799
3802
  function isAgeValue(value) {
3800
3803
  return typeof value === "object" && value !== null && "age" in value && typeof value.age === "number";
3801
3804
  }
3805
+ function mergeWithBaseFormState(values, context) {
3806
+ return { ...context.baseFormState, ...values };
3807
+ }
3802
3808
  function validate(schema, data) {
3803
3809
  const validator = ajv.getSchema(schema.$id) || ajv.compile(schema);
3804
3810
  if ("$form" in data) {
@@ -3837,7 +3843,7 @@ function isOnline() {
3837
3843
  }
3838
3844
  function isConditionMet(conditional, values, context, eventIndex) {
3839
3845
  return validate(conditional, {
3840
- $form: values,
3846
+ $form: mergeWithBaseFormState(values, context),
3841
3847
  $now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
3842
3848
  $online: isOnline(),
3843
3849
  $user: context.user,
@@ -3866,7 +3872,7 @@ function isFieldConditionMet(field3, form, conditionalType, context) {
3866
3872
  return true;
3867
3873
  }
3868
3874
  const validConditionals = getConditionalActionsForField(field3, {
3869
- $form: form,
3875
+ $form: mergeWithBaseFormState(form, context),
3870
3876
  $now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
3871
3877
  $online: isOnline(),
3872
3878
  $user: context.user,
@@ -4058,7 +4064,7 @@ function runFieldValidations({
4058
4064
  return [];
4059
4065
  }
4060
4066
  const conditionalParameters = {
4061
- $form: form,
4067
+ $form: mergeWithBaseFormState(form, context),
4062
4068
  $now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
4063
4069
  /**
4064
4070
  * In real use cases, there can be hundreds of thousands of locations.
@@ -4302,17 +4308,16 @@ function isPageVisible(page, formValues, context) {
4302
4308
  }
4303
4309
  return isConditionMet(page.conditional, formValues, context);
4304
4310
  }
4305
- function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false, declarationContext) {
4311
+ function omitHiddenFields(fields, formValues, validatorContext, includeHiddenFieldsWithNullValues = false) {
4306
4312
  const base = (0, import_lodash.cloneDeep)(formValues);
4307
4313
  function fn(prevVisibilityContext) {
4308
- const visibilityForm = declarationContext ? { ...declarationContext, ...prevVisibilityContext } : prevVisibilityContext;
4309
4314
  const cleaned = (0, import_lodash.omitBy)(base, (value, fieldId) => {
4310
4315
  const fieldConfig = fields.filter((f) => f.id === fieldId);
4311
4316
  if (!fieldConfig.length) {
4312
4317
  return false;
4313
4318
  }
4314
4319
  const isHidden = fieldConfig.every(
4315
- (f) => !isFieldVisible(f, visibilityForm, validatorContext)
4320
+ (f) => !isFieldVisible(f, prevVisibilityContext, validatorContext)
4316
4321
  );
4317
4322
  if (!isHidden) {
4318
4323
  return false;
@@ -4330,7 +4335,7 @@ function omitHiddenPaginatedFields(formConfig, values, validatorContext, include
4330
4335
  const visibleFields = formConfig.pages.filter((p) => isPageVisible(p, values, validatorContext)).flatMap((p) => p.fields);
4331
4336
  const hiddenFields = formConfig.pages.filter((p) => !isPageVisible(p, values, validatorContext)).flatMap((p) => p.fields);
4332
4337
  const valuesExceptHiddenPage = (0, import_lodash.omitBy)(values, (_2, fieldId) => {
4333
- return hiddenFields.some((f) => f.id === fieldId);
4338
+ return hiddenFields.some((f) => f.id === fieldId) && !visibleFields.some((f) => f.id === fieldId);
4334
4339
  });
4335
4340
  return omitHiddenFields(
4336
4341
  visibleFields,
@@ -4377,13 +4382,10 @@ function getVisibleVerificationPageIds(pages, annotation, context) {
4377
4382
  }
4378
4383
  function omitHiddenAnnotationFields(actionConfig, declaration, annotation, context) {
4379
4384
  const annotationFields = getActionAnnotationFields(actionConfig);
4380
- return omitHiddenFields(
4381
- annotationFields,
4382
- annotation,
4383
- context,
4384
- false,
4385
- declaration
4386
- );
4385
+ return omitHiddenFields(annotationFields, annotation, {
4386
+ ...context,
4387
+ baseFormState: declaration
4388
+ });
4387
4389
  }
4388
4390
  function deepMerge(currentDocument, actionDocument) {
4389
4391
  const currentDocumentClone = (0, import_lodash.cloneDeep)(currentDocument);
@@ -5372,7 +5374,7 @@ var _EventConfigBase = z33.object({
5372
5374
  ),
5373
5375
  label: TranslationConfig.describe("Human-readable label for the event type."),
5374
5376
  actions: z33.array(ActionConfig).describe(
5375
- "Configuration of system-defined actions associated with the event."
5377
+ "Configuration of core and custom actions associated with the event."
5376
5378
  ),
5377
5379
  actionOrder: z33.array(z33.string()).optional().describe(
5378
5380
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
@@ -5384,7 +5386,7 @@ var _EventConfigBase = z33.object({
5384
5386
  "Configuration of fields available in the advanced search feature."
5385
5387
  ),
5386
5388
  flags: z33.array(FlagConfig).optional().default([]).describe(
5387
- "Configuration of flags associated with the actions of this event type."
5389
+ "Configuration of custom flags associated with the actions of this event type."
5388
5390
  ),
5389
5391
  analytics: z33.boolean().optional().default(true).describe(
5390
5392
  "Indicates whether the records of this event type are included in analytics"
@@ -5823,18 +5825,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
5823
5825
  query: true,
5824
5826
  columns: true
5825
5827
  });
5826
- var WorkqueueConfigInput = z37.object({
5827
- slug: z37.string().describe("Determines the url of the workqueue."),
5828
- name: TranslationConfig.describe(
5829
- "Title of the workflow (both in navigation and on the page)"
5830
- ),
5831
- query: CountryConfigQueryInputType,
5832
- action: z37.object({ type: WorkqueueActionType }).optional().describe(
5833
- "Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
5834
- ),
5835
- columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
5836
- icon: AvailableIcons,
5837
- emptyMessage: TranslationConfig.optional()
5828
+ var WorkqueueConfigInput = WorkqueueConfig.extend({
5829
+ query: CountryConfigQueryInputType
5830
+ }).meta({
5831
+ description: "Workqueue configuration",
5832
+ id: "WorkqueueConfig"
5838
5833
  });
5839
5834
  function defineWorkqueue(workqueueInput) {
5840
5835
  const queryInput = workqueueInput.query;
@@ -5895,6 +5890,8 @@ var BaseActionInput = z38.object({
5895
5890
  originalActionId: UUID.optional(),
5896
5891
  // should not be part of base action.
5897
5892
  keepAssignment: z38.boolean().optional(),
5893
+ keepAssignmentIfAccepted: z38.boolean().optional(),
5894
+ keepAssignmentIfRejected: z38.boolean().optional(),
5898
5895
  waitFor: z38.boolean().optional(),
5899
5896
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
5900
5897
  // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
@@ -6149,7 +6146,6 @@ function getDeclarationActionCreationMetadata(actionType, actions) {
6149
6146
  createdAtLocation: requestAction?.createdAtLocation ?? acceptAction.createdAtLocation,
6150
6147
  acceptedAt: acceptAction.createdAt,
6151
6148
  createdByRole: requestAction?.createdByRole ?? acceptAction.createdByRole,
6152
- createdBySignature: requestAction?.createdBySignature ?? acceptAction.createdBySignature,
6153
6149
  registrationNumber
6154
6150
  };
6155
6151
  }
@@ -6363,17 +6359,6 @@ function getAssignedUserFromActions(actions) {
6363
6359
  return user2;
6364
6360
  }, null);
6365
6361
  }
6366
- function getAssignedUserSignatureFromActions(actions) {
6367
- return actions.reduce((signature, action) => {
6368
- if (action.type === ActionType.ASSIGN) {
6369
- return action.createdBySignature || null;
6370
- }
6371
- if (action.type === ActionType.UNASSIGN) {
6372
- return null;
6373
- }
6374
- return signature;
6375
- }, null);
6376
- }
6377
6362
  function deepDropNulls(obj) {
6378
6363
  if (Array.isArray(obj)) {
6379
6364
  return obj.map(deepDropNulls);
@@ -6469,10 +6454,8 @@ function getCurrentEventState(event2, config) {
6469
6454
  createdBy: creationAction.createdBy,
6470
6455
  createdByUserType: creationAction.createdByUserType,
6471
6456
  createdAtLocation: creationAction.createdAtLocation,
6472
- createdBySignature: creationAction.createdBySignature,
6473
6457
  updatedAt: acceptedActionMetadata.createdAt,
6474
6458
  assignedTo: getAssignedUserFromActions(acceptedActions),
6475
- assignedToSignature: getAssignedUserSignatureFromActions(acceptedActions),
6476
6459
  updatedBy: requestActionMetadata.createdBy,
6477
6460
  updatedAtLocation: requestActionMetadata.createdAtLocation,
6478
6461
  declaration,
@@ -9731,7 +9714,6 @@ var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
9731
9714
  createdBy: overrides.createdBy ?? generateUuid(rng),
9732
9715
  createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
9733
9716
  updatedAtLocation: overrides.updatedAtLocation ?? generateUuid(rng),
9734
- createdBySignature: overrides.createdBySignature ?? generateRandomSignature(rng),
9735
9717
  updatedAt: overrides.updatedAt ?? (0, import_date_fns4.addDays)(new Date(createdAt), 1).toISOString(),
9736
9718
  assignedTo: overrides.assignedTo ?? null,
9737
9719
  updatedBy: overrides.updatedBy ?? generateUuid(rng),
@@ -0,0 +1,3 @@
1
+ declare function main(): Promise<void>;
2
+ export { main };
3
+ //# sourceMappingURL=fix-accept-requested-registration-function-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-accept-requested-registration-function-type.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/fix-accept-requested-registration-function-type.ts"],"names":[],"mappings":"AAuFA,iBAAe,IAAI,kBA6ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}