@opencrvs/toolkit 2.0.0-rc.fef9d21 → 2.0.0-rc.ff99998
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/create-countryconfig/index.js +103 -0
- package/create-countryconfig/package.json +21 -0
- package/dist/application-config/index.js +305 -129
- package/dist/cli.js +548 -178
- package/dist/commons/api/router.d.ts +3379 -239
- package/dist/commons/application-config/index.d.ts +17 -4
- package/dist/commons/conditionals/conditionals.d.ts +360 -10
- package/dist/commons/conditionals/validate.d.ts +52 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +114 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
- package/dist/commons/events/Draft.d.ts +4 -2
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/FieldConfig.d.ts +387 -50
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/locations.d.ts +38 -1
- package/dist/commons/events/mocks.test.utils.d.ts +19 -0
- package/dist/commons/events/scopes.d.ts +24 -1
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +12 -289
- package/dist/commons/events/utils.d.ts +13 -2
- package/dist/conditionals/index.js +92 -9
- package/dist/events/index.js +1084 -261
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +60 -35
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -2
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +9 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +66 -20
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
- package/dist/migrations/v2.0/index.d.ts +5 -3
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +546 -176
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +90 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +11 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +17 -16
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +54 -30
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +140 -59
- package/dist/notification/index.js +841 -160
- package/dist/scopes/index.d.ts +91 -16
- package/dist/scopes/index.js +55 -12
- package/opencrvs-toolkit-2.0.0-rc.ff99998.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.fef9d21.tgz +0 -0
|
@@ -58,6 +58,12 @@ export declare const CheckboxFieldValue: z.ZodBoolean;
|
|
|
58
58
|
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
|
59
59
|
export declare const NumberFieldValue: z.ZodNumber;
|
|
60
60
|
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
|
61
|
+
export declare const SignatureFieldValue: z.ZodObject<{
|
|
62
|
+
path: z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">;
|
|
63
|
+
originalFilename: z.ZodString;
|
|
64
|
+
type: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
|
|
61
67
|
export declare const ButtonFieldValue: z.ZodNumber;
|
|
62
68
|
export type ButtonFieldValue = z.infer<typeof ButtonFieldValue>;
|
|
63
69
|
export declare const VerificationStatusValue: z.ZodEnum<{
|
|
@@ -677,6 +677,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
677
677
|
}, z.core.$strip>;
|
|
678
678
|
}, z.core.$strip>>>;
|
|
679
679
|
icon: z.ZodEnum<{
|
|
680
|
+
File: "File";
|
|
680
681
|
Archived: "Archived";
|
|
681
682
|
Assigned: "Assigned";
|
|
682
683
|
Briefcase: "Briefcase";
|
|
@@ -722,7 +723,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
722
723
|
Eye: "Eye";
|
|
723
724
|
EyeSlash: "EyeSlash";
|
|
724
725
|
Envelope: "Envelope";
|
|
725
|
-
File: "File";
|
|
726
726
|
FileSearch: "FileSearch";
|
|
727
727
|
FileMinus: "FileMinus";
|
|
728
728
|
FilePlus: "FilePlus";
|
|
@@ -786,6 +786,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
|
|
|
786
786
|
export declare const WorkqueueConfigWithoutQuery: z.ZodObject<{
|
|
787
787
|
name: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
788
788
|
icon: z.ZodEnum<{
|
|
789
|
+
File: "File";
|
|
789
790
|
Archived: "Archived";
|
|
790
791
|
Assigned: "Assigned";
|
|
791
792
|
Briefcase: "Briefcase";
|
|
@@ -831,7 +832,6 @@ export declare const WorkqueueConfigWithoutQuery: z.ZodObject<{
|
|
|
831
832
|
Eye: "Eye";
|
|
832
833
|
EyeSlash: "EyeSlash";
|
|
833
834
|
Envelope: "Envelope";
|
|
834
|
-
File: "File";
|
|
835
835
|
FileSearch: "FileSearch";
|
|
836
836
|
FileMinus: "FileMinus";
|
|
837
837
|
FilePlus: "FilePlus";
|
|
@@ -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
|
+
File: "File";
|
|
955
|
+
Archived: "Archived";
|
|
956
|
+
Assigned: "Assigned";
|
|
957
|
+
Briefcase: "Briefcase";
|
|
958
|
+
Certified: "Certified";
|
|
959
|
+
Close: "Close";
|
|
960
|
+
Collapse: "Collapse";
|
|
961
|
+
Draft: "Draft";
|
|
962
|
+
DuplicateYellow: "DuplicateYellow";
|
|
963
|
+
Expand: "Expand";
|
|
964
|
+
ExternalValidate: "ExternalValidate";
|
|
965
|
+
FilledCheck: "FilledCheck";
|
|
966
|
+
InReview: "InReview";
|
|
967
|
+
Offline: "Offline";
|
|
968
|
+
Registered: "Registered";
|
|
969
|
+
RequiresUpdates: "RequiresUpdates";
|
|
970
|
+
Sent: "Sent";
|
|
971
|
+
Validated: "Validated";
|
|
972
|
+
WaitingApproval: "WaitingApproval";
|
|
973
|
+
ChartActivity: "ChartActivity";
|
|
974
|
+
Activity: "Activity";
|
|
975
|
+
Archive: "Archive";
|
|
976
|
+
ArchiveTray: "ArchiveTray";
|
|
977
|
+
ArrowLeft: "ArrowLeft";
|
|
978
|
+
ArrowRight: "ArrowRight";
|
|
979
|
+
Buildings: "Buildings";
|
|
980
|
+
Circle: "Circle";
|
|
981
|
+
CaretDown: "CaretDown";
|
|
982
|
+
CaretLeft: "CaretLeft";
|
|
983
|
+
CaretRight: "CaretRight";
|
|
984
|
+
ChartBar: "ChartBar";
|
|
985
|
+
ChartLine: "ChartLine";
|
|
986
|
+
ChatCircle: "ChatCircle";
|
|
987
|
+
CheckSquare: "CheckSquare";
|
|
988
|
+
Compass: "Compass";
|
|
989
|
+
Check: "Check";
|
|
990
|
+
Copy: "Copy";
|
|
991
|
+
Database: "Database";
|
|
992
|
+
DotsThreeVertical: "DotsThreeVertical";
|
|
993
|
+
ArrowCounterClockwise: "ArrowCounterClockwise";
|
|
994
|
+
MagnifyingGlassMinus: "MagnifyingGlassMinus";
|
|
995
|
+
MagnifyingGlassPlus: "MagnifyingGlassPlus";
|
|
996
|
+
Export: "Export";
|
|
997
|
+
Eye: "Eye";
|
|
998
|
+
EyeSlash: "EyeSlash";
|
|
999
|
+
Envelope: "Envelope";
|
|
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>;
|
|
@@ -2282,7 +2282,7 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
|
|
|
2282
2282
|
$event: "id" | "title" | "type" | "updatedAt" | "placeOfEvent" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "status" | "assignedTo" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
|
2283
2283
|
};
|
|
2284
2284
|
}[];
|
|
2285
|
-
icon: "Archived" | "Assigned" | "Briefcase" | "Certified" | "Close" | "Collapse" | "Draft" | "DuplicateYellow" | "Expand" | "ExternalValidate" | "FilledCheck" | "InReview" | "Offline" | "Registered" | "RequiresUpdates" | "Sent" | "Validated" | "WaitingApproval" | "ChartActivity" | "Activity" | "Archive" | "ArchiveTray" | "ArrowLeft" | "ArrowRight" | "Buildings" | "Circle" | "CaretDown" | "CaretLeft" | "CaretRight" | "ChartBar" | "ChartLine" | "ChatCircle" | "CheckSquare" | "Compass" | "Check" | "Copy" | "Database" | "DotsThreeVertical" | "ArrowCounterClockwise" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "Export" | "Eye" | "EyeSlash" | "Envelope" | "
|
|
2285
|
+
icon: "File" | "Archived" | "Assigned" | "Briefcase" | "Certified" | "Close" | "Collapse" | "Draft" | "DuplicateYellow" | "Expand" | "ExternalValidate" | "FilledCheck" | "InReview" | "Offline" | "Registered" | "RequiresUpdates" | "Sent" | "Validated" | "WaitingApproval" | "ChartActivity" | "Activity" | "Archive" | "ArchiveTray" | "ArrowLeft" | "ArrowRight" | "Buildings" | "Circle" | "CaretDown" | "CaretLeft" | "CaretRight" | "ChartBar" | "ChartLine" | "ChatCircle" | "CheckSquare" | "Compass" | "Check" | "Copy" | "Database" | "DotsThreeVertical" | "ArrowCounterClockwise" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "Export" | "Eye" | "EyeSlash" | "Envelope" | "FileSearch" | "FileMinus" | "FilePlus" | "FileText" | "FileX" | "Handshake" | "Gear" | "GitBranch" | "IdentificationCard" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MapPin" | "Medal" | "NotePencil" | "Paperclip" | "PaperPlaneTilt" | "Pen" | "PenNib" | "Pencil" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "SignOut" | "Stamp" | "Star" | "Target" | "TextT" | "Trash" | "UploadSimple" | "User" | "UserPlus" | "Users" | "WarningCircle" | "X" | "ChatText" | "CircleWavyCheck" | "CircleWavyQuestion" | "ArchiveBox" | "ArrowCircleDown" | "FileArrowUp" | "FileDotted" | "Files" | "PencilLine" | "PencilCircle" | "UserCircle" | "Clock" | "QrCode" | "Webcam" | "Sun" | "DeviceTabletCamera" | "Globe" | "Fingerprint" | "PushPin" | "Timer";
|
|
2286
2286
|
action?: {
|
|
2287
2287
|
type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ";
|
|
2288
2288
|
} | undefined;
|
|
@@ -2591,7 +2591,7 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInputWithV19
|
|
|
2591
2591
|
$event: "id" | "title" | "type" | "updatedAt" | "placeOfEvent" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "status" | "assignedTo" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags" | "outbox";
|
|
2592
2592
|
};
|
|
2593
2593
|
}[];
|
|
2594
|
-
icon: "Archived" | "Assigned" | "Briefcase" | "Certified" | "Close" | "Collapse" | "Draft" | "DuplicateYellow" | "Expand" | "ExternalValidate" | "FilledCheck" | "InReview" | "Offline" | "Registered" | "RequiresUpdates" | "Sent" | "Validated" | "WaitingApproval" | "ChartActivity" | "Activity" | "Archive" | "ArchiveTray" | "ArrowLeft" | "ArrowRight" | "Buildings" | "Circle" | "CaretDown" | "CaretLeft" | "CaretRight" | "ChartBar" | "ChartLine" | "ChatCircle" | "CheckSquare" | "Compass" | "Check" | "Copy" | "Database" | "DotsThreeVertical" | "ArrowCounterClockwise" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "Export" | "Eye" | "EyeSlash" | "Envelope" | "
|
|
2594
|
+
icon: "File" | "Archived" | "Assigned" | "Briefcase" | "Certified" | "Close" | "Collapse" | "Draft" | "DuplicateYellow" | "Expand" | "ExternalValidate" | "FilledCheck" | "InReview" | "Offline" | "Registered" | "RequiresUpdates" | "Sent" | "Validated" | "WaitingApproval" | "ChartActivity" | "Activity" | "Archive" | "ArchiveTray" | "ArrowLeft" | "ArrowRight" | "Buildings" | "Circle" | "CaretDown" | "CaretLeft" | "CaretRight" | "ChartBar" | "ChartLine" | "ChatCircle" | "CheckSquare" | "Compass" | "Check" | "Copy" | "Database" | "DotsThreeVertical" | "ArrowCounterClockwise" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "Export" | "Eye" | "EyeSlash" | "Envelope" | "FileSearch" | "FileMinus" | "FilePlus" | "FileText" | "FileX" | "Handshake" | "Gear" | "GitBranch" | "IdentificationCard" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MapPin" | "Medal" | "NotePencil" | "Paperclip" | "PaperPlaneTilt" | "Pen" | "PenNib" | "Pencil" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "SignOut" | "Stamp" | "Star" | "Target" | "TextT" | "Trash" | "UploadSimple" | "User" | "UserPlus" | "Users" | "WarningCircle" | "X" | "ChatText" | "CircleWavyCheck" | "CircleWavyQuestion" | "ArchiveBox" | "ArrowCircleDown" | "FileArrowUp" | "FileDotted" | "Files" | "PencilLine" | "PencilCircle" | "UserCircle" | "Clock" | "QrCode" | "Webcam" | "Sun" | "DeviceTabletCamera" | "Globe" | "Fingerprint" | "PushPin" | "Timer";
|
|
2595
2595
|
action?: {
|
|
2596
2596
|
type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ";
|
|
2597
2597
|
} | undefined;
|
|
@@ -1,6 +1,31 @@
|
|
|
1
|
+
import { FormConditionalParameters } from '../conditionals/conditionals';
|
|
1
2
|
import { FieldConditional } from './Conditional';
|
|
2
3
|
import { TranslationConfig } from './TranslationConfig';
|
|
3
|
-
import {
|
|
4
|
+
import { JurisdictionReference } from '../users/userReferences';
|
|
5
|
+
import { ComputedDefaultValue, SelectOption, ValidationConfig } from './FieldConfig';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a {@link ComputedDefaultValue} descriptor for use in a field's `defaultValue`.
|
|
8
|
+
*
|
|
9
|
+
* Unlike `field(id).customClientEvaluation(fn)`, this builder is **not tied to any
|
|
10
|
+
* specific field**. Use it when the initial value should be derived purely from
|
|
11
|
+
* context variables (`$now`, `$online`, system variables such as `$user`) rather
|
|
12
|
+
* than from another field's current value.
|
|
13
|
+
*
|
|
14
|
+
* The serialised function receives `(undefined, context)` at runtime, where
|
|
15
|
+
* `context` is a {@link FormConditionalParameters} object.
|
|
16
|
+
*
|
|
17
|
+
* External references (e.g. lodash) are **not** available inside the function body —
|
|
18
|
+
* all logic must be self-contained so the code survives serialisation.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Default a date field to today
|
|
22
|
+
* defaultValue: evaluate((_, ctx) => ctx.$now)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Default to the current user's role
|
|
26
|
+
* defaultValue: evaluate((_, ctx) => ctx.user.role)
|
|
27
|
+
*/
|
|
28
|
+
export declare function evaluate(computationFn: (fieldValue: undefined, context: FormConditionalParameters) => unknown): ComputedDefaultValue;
|
|
4
29
|
/**
|
|
5
30
|
* Entry point for defining conditional logic or configuration for a form field.
|
|
6
31
|
* @param fieldId - The ID of the field to define rules or config for.
|
|
@@ -11,12 +36,14 @@ export declare function field(fieldId: string, options?: {
|
|
|
11
36
|
conditionals?: FieldConditional[];
|
|
12
37
|
validations?: ValidationConfig[];
|
|
13
38
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
|
39
|
+
allowedLocations?: JurisdictionReference;
|
|
14
40
|
}): {
|
|
15
41
|
range: () => {
|
|
16
42
|
options?: SelectOption[];
|
|
17
43
|
conditionals?: FieldConditional[];
|
|
18
44
|
validations?: ValidationConfig[];
|
|
19
45
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
|
46
|
+
allowedLocations?: JurisdictionReference;
|
|
20
47
|
fieldId: string;
|
|
21
48
|
fieldType: "field";
|
|
22
49
|
} & {
|
|
@@ -29,6 +56,7 @@ export declare function field(fieldId: string, options?: {
|
|
|
29
56
|
conditionals?: FieldConditional[];
|
|
30
57
|
validations?: ValidationConfig[];
|
|
31
58
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
|
59
|
+
allowedLocations?: JurisdictionReference;
|
|
32
60
|
fieldId: string;
|
|
33
61
|
fieldType: "field";
|
|
34
62
|
} & {
|
|
@@ -41,6 +69,7 @@ export declare function field(fieldId: string, options?: {
|
|
|
41
69
|
conditionals?: FieldConditional[];
|
|
42
70
|
validations?: ValidationConfig[];
|
|
43
71
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
|
72
|
+
allowedLocations?: JurisdictionReference;
|
|
44
73
|
fieldId: string;
|
|
45
74
|
fieldType: "field";
|
|
46
75
|
} & {
|
|
@@ -53,6 +82,7 @@ export declare function field(fieldId: string, options?: {
|
|
|
53
82
|
conditionals?: FieldConditional[];
|
|
54
83
|
validations?: ValidationConfig[];
|
|
55
84
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
|
85
|
+
allowedLocations?: JurisdictionReference;
|
|
56
86
|
fieldId: string;
|
|
57
87
|
fieldType: "field";
|
|
58
88
|
} & {
|
|
@@ -107,6 +137,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
107
137
|
fieldId: string;
|
|
108
138
|
};
|
|
109
139
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
140
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
141
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
110
142
|
};
|
|
111
143
|
asDob(): any;
|
|
112
144
|
asAge(): any;
|
|
@@ -144,6 +176,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
144
176
|
fieldId: string;
|
|
145
177
|
};
|
|
146
178
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
179
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
180
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
147
181
|
};
|
|
148
182
|
getByPath(fieldPath: string[]): {
|
|
149
183
|
$$subfield: string[];
|
|
@@ -189,6 +223,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
189
223
|
fieldId: string;
|
|
190
224
|
};
|
|
191
225
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
226
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
227
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
192
228
|
};
|
|
193
229
|
getByPath(fieldPath: string[]): any;
|
|
194
230
|
asDob(): {
|
|
@@ -232,6 +268,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
232
268
|
fieldId: string;
|
|
233
269
|
};
|
|
234
270
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
271
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
272
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
235
273
|
};
|
|
236
274
|
asAge(): {
|
|
237
275
|
$$subfield: string[];
|
|
@@ -274,6 +312,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
274
312
|
fieldId: string;
|
|
275
313
|
};
|
|
276
314
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
315
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
316
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
277
317
|
};
|
|
278
318
|
isAfter(): {
|
|
279
319
|
days: (days: number) => {
|
|
@@ -309,6 +349,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
309
349
|
fieldId: string;
|
|
310
350
|
};
|
|
311
351
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
352
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
353
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
312
354
|
};
|
|
313
355
|
asDob(): {
|
|
314
356
|
$$subfield: string[];
|
|
@@ -355,6 +397,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
355
397
|
fieldId: string;
|
|
356
398
|
};
|
|
357
399
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
400
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
401
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
358
402
|
};
|
|
359
403
|
asDob(): any;
|
|
360
404
|
asAge(): any;
|
|
@@ -392,6 +436,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
392
436
|
fieldId: string;
|
|
393
437
|
};
|
|
394
438
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
439
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
440
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
395
441
|
};
|
|
396
442
|
asAge(): {
|
|
397
443
|
$$subfield: string[];
|
|
@@ -438,6 +484,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
438
484
|
fieldId: string;
|
|
439
485
|
};
|
|
440
486
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
487
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
488
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
441
489
|
};
|
|
442
490
|
asDob(): any;
|
|
443
491
|
asAge(): any;
|
|
@@ -475,6 +523,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
475
523
|
fieldId: string;
|
|
476
524
|
};
|
|
477
525
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
526
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
527
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
478
528
|
};
|
|
479
529
|
isAfter(): {
|
|
480
530
|
days: (days: number) => {
|
|
@@ -510,5 +560,7 @@ export declare function field(fieldId: string, options?: {
|
|
|
510
560
|
fieldId: string;
|
|
511
561
|
};
|
|
512
562
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
563
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
564
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import(".").ClientFunctionContext) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
513
565
|
};
|
|
514
566
|
//# sourceMappingURL=field.d.ts.map
|
|
@@ -22,6 +22,7 @@ export * from './FieldValue';
|
|
|
22
22
|
export * from './FormConfig';
|
|
23
23
|
export * from './CompositeFieldValue';
|
|
24
24
|
export * from './state';
|
|
25
|
+
export * from './state/flags';
|
|
25
26
|
export * from './utils';
|
|
26
27
|
export * from './defineConfig';
|
|
27
28
|
export * from './DeduplicationConfig';
|
|
@@ -37,6 +38,7 @@ export * from './scopes';
|
|
|
37
38
|
export * from './serializer';
|
|
38
39
|
export * from './state/availableActions';
|
|
39
40
|
export * from './FileUtils';
|
|
41
|
+
export * from './mocks.test.utils';
|
|
40
42
|
export * from '../conditionals/conditionals';
|
|
41
43
|
export * from '../conditionals/validate';
|
|
42
44
|
export * from './field';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { UUID } from '../uuid';
|
|
1
2
|
import * as z from 'zod/v4';
|
|
2
3
|
import { EventIndex } from './EventIndex';
|
|
3
4
|
import { ActionCreationMetadata, RegistrationCreationMetadata } from './EventMetadata';
|
|
4
|
-
import { RecordScopeV2 } from '../scopes';
|
|
5
|
+
import { RecordScopeV2, UserScopeV2 } from '../scopes';
|
|
5
6
|
import { SystemContext, UserContext } from '../users/User';
|
|
6
7
|
/** @deprecated Moving on, location types are arbitrary and defined by the country config. */
|
|
7
8
|
export declare const LocationTypeV1: z.ZodEnum<{
|
|
@@ -51,11 +52,47 @@ export type EventIndexWithAdministrativeHierarchy = Omit<ToArrayFields<EventInde
|
|
|
51
52
|
*
|
|
52
53
|
*/
|
|
53
54
|
export declare function canAccessEventWithScope(event: Partial<EventIndexWithAdministrativeHierarchy>, scope: RecordScopeV2, user: UserContext | SystemContext, customActionType?: string): boolean;
|
|
55
|
+
export type UserWithResolvedHierarchy = {
|
|
56
|
+
role: string;
|
|
57
|
+
administrativeHierarchy: UUID[];
|
|
58
|
+
primaryOfficeId: UUID;
|
|
59
|
+
};
|
|
60
|
+
export declare function canAccessUserWithScope({ userToAccess, scope, user }: {
|
|
61
|
+
userToAccess: UserWithResolvedHierarchy;
|
|
62
|
+
scope: UserScopeV2;
|
|
63
|
+
user: UserContext | SystemContext;
|
|
64
|
+
}): boolean;
|
|
65
|
+
export declare function canAccessOtherUserWithScopes({ scopes, userToAccess, user }: {
|
|
66
|
+
scopes: UserScopeV2[];
|
|
67
|
+
userToAccess: UserWithResolvedHierarchy;
|
|
68
|
+
user: UserContext | SystemContext;
|
|
69
|
+
}): boolean;
|
|
54
70
|
/**
|
|
55
71
|
* Given indexed event and list of resolved scopes, determine if any of the scopes allow access to the event.
|
|
56
72
|
*
|
|
57
73
|
* One of the scopes must allow access for the event to be accessible.
|
|
58
74
|
*/
|
|
59
75
|
export declare function userCanAccessEventWithScopes(event: Partial<EventIndexWithAdministrativeHierarchy>, scopes: RecordScopeV2[], user: UserContext | SystemContext, customActionType?: string): boolean;
|
|
76
|
+
export declare function getAdministrativeAreaHierarchy(administrativeAreaId: string | undefined | null, administrativeAreas: Map<UUID, AdministrativeArea>): {
|
|
77
|
+
id: string & z.core.$brand<"UUID">;
|
|
78
|
+
name: string;
|
|
79
|
+
parentId: (string & z.core.$brand<"UUID">) | null;
|
|
80
|
+
validUntil: string | null;
|
|
81
|
+
externalId?: string | null | undefined;
|
|
82
|
+
}[];
|
|
83
|
+
/**
|
|
84
|
+
* Resolves a location or administrative area UUID into a root-first hierarchy of UUIDs.
|
|
85
|
+
*
|
|
86
|
+
* If the ID refers to a `Location` (e.g. CRVS office), the hierarchy includes
|
|
87
|
+
* the administrative area ancestors followed by the location itself.
|
|
88
|
+
* If the ID refers to an `AdministrativeArea`, returns the area's ancestor chain (root-first).
|
|
89
|
+
*
|
|
90
|
+
* Uses `getAdministrativeAreaHierarchy` which returns leaf-first order,
|
|
91
|
+
* so the result is reversed to match the root-first convention used by the server.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getLocationHierarchy(selectedId: UUID, context: {
|
|
94
|
+
administrativeAreas: Map<UUID, AdministrativeArea>;
|
|
95
|
+
locations: Map<UUID, Location>;
|
|
96
|
+
}): UUID[];
|
|
60
97
|
export {};
|
|
61
98
|
//# sourceMappingURL=locations.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AdministrativeArea, Location } from './locations';
|
|
2
|
+
export declare const V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS: AdministrativeArea[];
|
|
3
|
+
export declare const V2_DEFAULT_MOCK_LOCATIONS: Location[];
|
|
4
|
+
export declare const V2_DEFAULT_MOCK_LOCATIONS_MAP: Map<string & import("zod").$brand<"UUID">, {
|
|
5
|
+
id: string & import("zod").$brand<"UUID">;
|
|
6
|
+
name: string;
|
|
7
|
+
administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
|
|
8
|
+
validUntil: string | null;
|
|
9
|
+
locationType: string | null;
|
|
10
|
+
externalId?: string | null | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: Map<string & import("zod").$brand<"UUID">, {
|
|
13
|
+
id: string & import("zod").$brand<"UUID">;
|
|
14
|
+
name: string;
|
|
15
|
+
parentId: (string & import("zod").$brand<"UUID">) | null;
|
|
16
|
+
validUntil: string | null;
|
|
17
|
+
externalId?: string | null | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=mocks.test.utils.d.ts.map
|