@opencrvs/toolkit 2.0.0-rc.977e771 → 2.0.0-rc.97a20cf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application-config/index.js +7 -36
- package/dist/cli.js +1390 -178
- package/dist/commons/api/router.d.ts +42 -50
- package/dist/commons/events/locations.d.ts +1 -17
- package/dist/conditionals/index.js +7 -36
- package/dist/events/index.js +7 -74
- 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 +3 -4
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +3 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.js +373 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +19 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +17 -13
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +4 -5
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +4 -5
- package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -1
- package/dist/migrations/v2.0/create-events-index.js +1 -2
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +3 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +77 -0
- package/dist/migrations/v2.0/index.d.ts +8 -4
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +1358 -175
- 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 +5 -6
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +3 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +221 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-application-config-url.js +342 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +6 -7
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +3 -4
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +3 -4
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +3 -4
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +2 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +3 -4
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +3 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.js +163 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +1 -2
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +3 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.js +356 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +3 -4
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +3 -4
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +3 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.js +186 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-api-paths.js +3 -4
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +3 -4
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -1
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +1 -2
- package/dist/migrations/v2.0/update-package-json.d.ts +3 -0
- package/dist/migrations/v2.0/update-package-json.d.ts.map +1 -0
- package/dist/migrations/v2.0/update-package-json.js +105 -0
- package/dist/notification/index.js +7 -36
- package/dist/scopes/index.d.ts +10 -80
- package/dist/scopes/index.js +8 -42
- package/opencrvs-toolkit-2.0.0-rc.97a20cf.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.977e771.tgz +0 -0
|
@@ -3975,10 +3975,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
3975
3975
|
output: {
|
|
3976
3976
|
id: string & import("zod").$brand<"UUID">;
|
|
3977
3977
|
name: {
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
}[];
|
|
3978
|
+
firstname: string;
|
|
3979
|
+
surname: string;
|
|
3980
|
+
};
|
|
3982
3981
|
role: string;
|
|
3983
3982
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
3984
3983
|
type: "user";
|
|
@@ -4008,10 +4007,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4008
4007
|
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
4009
4008
|
input: {
|
|
4010
4009
|
name: {
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
}[];
|
|
4010
|
+
firstname: string;
|
|
4011
|
+
surname: string;
|
|
4012
|
+
};
|
|
4015
4013
|
role: string;
|
|
4016
4014
|
primaryOfficeId: string;
|
|
4017
4015
|
data?: Record<string, unknown> | undefined;
|
|
@@ -4020,6 +4018,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4020
4018
|
email?: string | undefined;
|
|
4021
4019
|
mobile?: string | undefined;
|
|
4022
4020
|
username?: undefined;
|
|
4021
|
+
password?: undefined;
|
|
4023
4022
|
signature?: {
|
|
4024
4023
|
path: string;
|
|
4025
4024
|
originalFilename: string;
|
|
@@ -4029,10 +4028,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4029
4028
|
output: {
|
|
4030
4029
|
id: string & import("zod").$brand<"UUID">;
|
|
4031
4030
|
name: {
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
}[];
|
|
4031
|
+
firstname: string;
|
|
4032
|
+
surname: string;
|
|
4033
|
+
};
|
|
4036
4034
|
role: string;
|
|
4037
4035
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4038
4036
|
type: "user";
|
|
@@ -4053,10 +4051,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4053
4051
|
id: string;
|
|
4054
4052
|
data?: Record<string, unknown> | undefined;
|
|
4055
4053
|
name?: {
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
}[] | undefined;
|
|
4054
|
+
firstname: string;
|
|
4055
|
+
surname: string;
|
|
4056
|
+
} | undefined;
|
|
4060
4057
|
role?: string | undefined;
|
|
4061
4058
|
fullHonorificName?: string | undefined;
|
|
4062
4059
|
device?: string | undefined;
|
|
@@ -4069,16 +4066,13 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4069
4066
|
type: string;
|
|
4070
4067
|
} | undefined;
|
|
4071
4068
|
status?: "active" | "deactivated" | undefined;
|
|
4072
|
-
} & {
|
|
4073
|
-
id: string;
|
|
4074
4069
|
};
|
|
4075
4070
|
output: {
|
|
4076
4071
|
id: string & import("zod").$brand<"UUID">;
|
|
4077
4072
|
name: {
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
}[];
|
|
4073
|
+
firstname: string;
|
|
4074
|
+
surname: string;
|
|
4075
|
+
};
|
|
4082
4076
|
role: string;
|
|
4083
4077
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4084
4078
|
type: "user";
|
|
@@ -4099,10 +4093,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4099
4093
|
output: ({
|
|
4100
4094
|
id: string & import("zod").$brand<"UUID">;
|
|
4101
4095
|
name: {
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
}[];
|
|
4096
|
+
firstname: string;
|
|
4097
|
+
surname: string;
|
|
4098
|
+
};
|
|
4106
4099
|
role: string;
|
|
4107
4100
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4108
4101
|
type: "user";
|
|
@@ -4144,10 +4137,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4144
4137
|
output: ({
|
|
4145
4138
|
id: string & import("zod").$brand<"UUID">;
|
|
4146
4139
|
name: {
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
}[];
|
|
4140
|
+
firstname: string;
|
|
4141
|
+
surname: string;
|
|
4142
|
+
};
|
|
4151
4143
|
role: string;
|
|
4152
4144
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4153
4145
|
type: "user";
|
|
@@ -4773,7 +4765,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4773
4765
|
'legalStatuses.DECLARED.createdAtLocation'?: {
|
|
4774
4766
|
type: "within";
|
|
4775
4767
|
location: string | {
|
|
4776
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4768
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4777
4769
|
$location?: string | undefined;
|
|
4778
4770
|
};
|
|
4779
4771
|
} | undefined;
|
|
@@ -4795,7 +4787,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4795
4787
|
'legalStatuses.REGISTERED.createdAtLocation'?: {
|
|
4796
4788
|
type: "within";
|
|
4797
4789
|
location: string | {
|
|
4798
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4790
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4799
4791
|
$location?: string | undefined;
|
|
4800
4792
|
};
|
|
4801
4793
|
} | undefined;
|
|
@@ -4810,47 +4802,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4810
4802
|
createdAtLocation?: {
|
|
4811
4803
|
type: "within";
|
|
4812
4804
|
location: string | {
|
|
4813
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4805
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4814
4806
|
$location?: string | undefined;
|
|
4815
4807
|
};
|
|
4816
4808
|
} | {
|
|
4817
4809
|
type: "exact";
|
|
4818
4810
|
term: string | {
|
|
4819
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4811
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4820
4812
|
$location?: string | undefined;
|
|
4821
4813
|
};
|
|
4822
4814
|
} | undefined;
|
|
4823
4815
|
updatedAtLocation?: {
|
|
4824
4816
|
type: "within";
|
|
4825
4817
|
location: string | {
|
|
4826
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4818
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4827
4819
|
$location?: string | undefined;
|
|
4828
4820
|
};
|
|
4829
4821
|
} | {
|
|
4830
4822
|
type: "exact";
|
|
4831
4823
|
term: string | {
|
|
4832
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4824
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4833
4825
|
$location?: string | undefined;
|
|
4834
4826
|
};
|
|
4835
4827
|
} | undefined;
|
|
4836
4828
|
updatedByUserRole?: {
|
|
4837
4829
|
type: "exact";
|
|
4838
4830
|
term: string | {
|
|
4839
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4831
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4840
4832
|
$location?: string | undefined;
|
|
4841
4833
|
};
|
|
4842
4834
|
} | undefined;
|
|
4843
4835
|
assignedTo?: {
|
|
4844
4836
|
type: "exact";
|
|
4845
4837
|
term: string | {
|
|
4846
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4838
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4847
4839
|
$location?: string | undefined;
|
|
4848
4840
|
};
|
|
4849
4841
|
} | undefined;
|
|
4850
4842
|
createdBy?: {
|
|
4851
4843
|
type: "exact";
|
|
4852
4844
|
term: string | {
|
|
4853
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4845
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4854
4846
|
$location?: string | undefined;
|
|
4855
4847
|
};
|
|
4856
4848
|
} | undefined;
|
|
@@ -4861,7 +4853,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4861
4853
|
updatedBy?: {
|
|
4862
4854
|
type: "exact";
|
|
4863
4855
|
term: string | {
|
|
4864
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4856
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4865
4857
|
$location?: string | undefined;
|
|
4866
4858
|
};
|
|
4867
4859
|
} | undefined;
|
|
@@ -4911,7 +4903,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4911
4903
|
'legalStatuses.DECLARED.createdAtLocation'?: {
|
|
4912
4904
|
type: "within";
|
|
4913
4905
|
location: string | {
|
|
4914
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4906
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4915
4907
|
$location?: string | undefined;
|
|
4916
4908
|
};
|
|
4917
4909
|
} | undefined;
|
|
@@ -4933,7 +4925,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4933
4925
|
'legalStatuses.REGISTERED.createdAtLocation'?: {
|
|
4934
4926
|
type: "within";
|
|
4935
4927
|
location: string | {
|
|
4936
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4928
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4937
4929
|
$location?: string | undefined;
|
|
4938
4930
|
};
|
|
4939
4931
|
} | undefined;
|
|
@@ -4948,47 +4940,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4948
4940
|
createdAtLocation?: {
|
|
4949
4941
|
type: "within";
|
|
4950
4942
|
location: string | {
|
|
4951
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4943
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4952
4944
|
$location?: string | undefined;
|
|
4953
4945
|
};
|
|
4954
4946
|
} | {
|
|
4955
4947
|
type: "exact";
|
|
4956
4948
|
term: string | {
|
|
4957
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4949
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4958
4950
|
$location?: string | undefined;
|
|
4959
4951
|
};
|
|
4960
4952
|
} | undefined;
|
|
4961
4953
|
updatedAtLocation?: {
|
|
4962
4954
|
type: "within";
|
|
4963
4955
|
location: string | {
|
|
4964
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4956
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4965
4957
|
$location?: string | undefined;
|
|
4966
4958
|
};
|
|
4967
4959
|
} | {
|
|
4968
4960
|
type: "exact";
|
|
4969
4961
|
term: string | {
|
|
4970
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4962
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4971
4963
|
$location?: string | undefined;
|
|
4972
4964
|
};
|
|
4973
4965
|
} | undefined;
|
|
4974
4966
|
updatedByUserRole?: {
|
|
4975
4967
|
type: "exact";
|
|
4976
4968
|
term: string | {
|
|
4977
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4969
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4978
4970
|
$location?: string | undefined;
|
|
4979
4971
|
};
|
|
4980
4972
|
} | undefined;
|
|
4981
4973
|
assignedTo?: {
|
|
4982
4974
|
type: "exact";
|
|
4983
4975
|
term: string | {
|
|
4984
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4976
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4985
4977
|
$location?: string | undefined;
|
|
4986
4978
|
};
|
|
4987
4979
|
} | undefined;
|
|
4988
4980
|
createdBy?: {
|
|
4989
4981
|
type: "exact";
|
|
4990
4982
|
term: string | {
|
|
4991
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4983
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
4992
4984
|
$location?: string | undefined;
|
|
4993
4985
|
};
|
|
4994
4986
|
} | undefined;
|
|
@@ -4999,7 +4991,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4999
4991
|
updatedBy?: {
|
|
5000
4992
|
type: "exact";
|
|
5001
4993
|
term: string | {
|
|
5002
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4994
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "avatar" | "signature" | "primaryOfficeId" | "middlename";
|
|
5003
4995
|
$location?: string | undefined;
|
|
5004
4996
|
};
|
|
5005
4997
|
} | undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { UUID } from '../uuid';
|
|
2
1
|
import * as z from 'zod/v4';
|
|
3
2
|
import { EventIndex } from './EventIndex';
|
|
4
3
|
import { ActionCreationMetadata, RegistrationCreationMetadata } from './EventMetadata';
|
|
5
|
-
import { RecordScopeV2
|
|
4
|
+
import { RecordScopeV2 } from '../scopes';
|
|
6
5
|
import { SystemContext, UserContext } from '../users/User';
|
|
7
6
|
/** @deprecated Moving on, location types are arbitrary and defined by the country config. */
|
|
8
7
|
export declare const LocationTypeV1: z.ZodEnum<{
|
|
@@ -52,21 +51,6 @@ export type EventIndexWithAdministrativeHierarchy = Omit<ToArrayFields<EventInde
|
|
|
52
51
|
*
|
|
53
52
|
*/
|
|
54
53
|
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;
|
|
70
54
|
/**
|
|
71
55
|
* Given indexed event and list of resolved scopes, determine if any of the scopes allow access to the event.
|
|
72
56
|
*
|
|
@@ -182,10 +182,6 @@ var scopeByEvent = z6.preprocess(
|
|
|
182
182
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
183
183
|
z6.array(z6.string()).optional()
|
|
184
184
|
).describe("Event type, e.g. birth, death");
|
|
185
|
-
var userRole = z6.preprocess(
|
|
186
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
187
|
-
z6.array(z6.string()).optional()
|
|
188
|
-
).describe("User role, e.g. admin, field agent");
|
|
189
185
|
var scopeOptionsPlaceEvent = z6.object({
|
|
190
186
|
event: scopeByEvent,
|
|
191
187
|
placeOfEvent: JurisdictionFilter.optional()
|
|
@@ -290,33 +286,6 @@ var RecordScopeV2 = z6.discriminatedUnion("type", [
|
|
|
290
286
|
]).describe(
|
|
291
287
|
"Scopes used to check user's permission to perform actions on a record."
|
|
292
288
|
);
|
|
293
|
-
var SystemScopeType = z6.enum([
|
|
294
|
-
"organisation.read-locations",
|
|
295
|
-
"user.read",
|
|
296
|
-
"user.create",
|
|
297
|
-
"user.edit"
|
|
298
|
-
]);
|
|
299
|
-
var UserScopeType = SystemScopeType.extract([
|
|
300
|
-
"user.read",
|
|
301
|
-
"user.create",
|
|
302
|
-
"user.edit"
|
|
303
|
-
]);
|
|
304
|
-
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
305
|
-
var UserScopeV2 = z6.discriminatedUnion("type", [
|
|
306
|
-
z6.object({
|
|
307
|
-
type: ScopesWithRoleOption,
|
|
308
|
-
options: z6.object({
|
|
309
|
-
accessLevel: JurisdictionFilter.optional(),
|
|
310
|
-
role: userRole.optional()
|
|
311
|
-
}).optional()
|
|
312
|
-
}),
|
|
313
|
-
z6.object({
|
|
314
|
-
type: UserScopeType.extract(["user.read"]),
|
|
315
|
-
options: z6.object({
|
|
316
|
-
accessLevel: JurisdictionFilter.optional()
|
|
317
|
-
}).optional()
|
|
318
|
-
})
|
|
319
|
-
]);
|
|
320
289
|
var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
|
|
321
290
|
z6.object({
|
|
322
291
|
type: ScopesWithPlaceEventOptions,
|
|
@@ -337,14 +306,16 @@ var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
|
|
|
337
306
|
}).optional()
|
|
338
307
|
})
|
|
339
308
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
309
|
+
var SystemScopeType = z6.enum([
|
|
310
|
+
"organisation.read-locations",
|
|
311
|
+
"user.read",
|
|
312
|
+
"user.create",
|
|
313
|
+
"user.edit"
|
|
314
|
+
]);
|
|
340
315
|
var Scope2 = z6.discriminatedUnion("type", [
|
|
341
316
|
z6.object({ type: PlainScopeType }),
|
|
342
317
|
...RecordScopeV2.options,
|
|
343
|
-
|
|
344
|
-
z6.object({
|
|
345
|
-
type: z6.literal("organisation.read-locations"),
|
|
346
|
-
options: AccessLevelOptions.optional()
|
|
347
|
-
}),
|
|
318
|
+
z6.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
348
319
|
z6.object({
|
|
349
320
|
type: z6.literal("workqueue"),
|
|
350
321
|
options: WorkqueueOrDashboardOptions
|
package/dist/events/index.js
CHANGED
|
@@ -243,8 +243,6 @@ __export(events_exports, {
|
|
|
243
243
|
areConditionsMet: () => areConditionsMet,
|
|
244
244
|
buildFormState: () => buildFormState,
|
|
245
245
|
canAccessEventWithScope: () => canAccessEventWithScope,
|
|
246
|
-
canAccessOtherUserWithScopes: () => canAccessOtherUserWithScopes,
|
|
247
|
-
canAccessUserWithScope: () => canAccessUserWithScope,
|
|
248
246
|
compositeFieldTypes: () => compositeFieldTypes,
|
|
249
247
|
createEmptyDraft: () => createEmptyDraft,
|
|
250
248
|
createFieldConditionals: () => createFieldConditionals,
|
|
@@ -491,10 +489,6 @@ var scopeByEvent = z2.preprocess(
|
|
|
491
489
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
492
490
|
z2.array(z2.string()).optional()
|
|
493
491
|
).describe("Event type, e.g. birth, death");
|
|
494
|
-
var userRole = z2.preprocess(
|
|
495
|
-
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
496
|
-
z2.array(z2.string()).optional()
|
|
497
|
-
).describe("User role, e.g. admin, field agent");
|
|
498
492
|
var scopeOptionsPlaceEvent = z2.object({
|
|
499
493
|
event: scopeByEvent,
|
|
500
494
|
placeOfEvent: JurisdictionFilter.optional()
|
|
@@ -599,36 +593,6 @@ var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
599
593
|
]).describe(
|
|
600
594
|
"Scopes used to check user's permission to perform actions on a record."
|
|
601
595
|
);
|
|
602
|
-
var SystemScopeType = z2.enum([
|
|
603
|
-
"organisation.read-locations",
|
|
604
|
-
"user.read",
|
|
605
|
-
"user.create",
|
|
606
|
-
"user.edit"
|
|
607
|
-
]);
|
|
608
|
-
var UserScopeType = SystemScopeType.extract([
|
|
609
|
-
"user.read",
|
|
610
|
-
"user.create",
|
|
611
|
-
"user.edit"
|
|
612
|
-
]);
|
|
613
|
-
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
614
|
-
var UserScopeV2 = z2.discriminatedUnion("type", [
|
|
615
|
-
z2.object({
|
|
616
|
-
type: ScopesWithRoleOption,
|
|
617
|
-
options: z2.object({
|
|
618
|
-
accessLevel: JurisdictionFilter.optional(),
|
|
619
|
-
role: userRole.optional()
|
|
620
|
-
}).optional()
|
|
621
|
-
}),
|
|
622
|
-
z2.object({
|
|
623
|
-
type: UserScopeType.extract(["user.read"]),
|
|
624
|
-
options: z2.object({
|
|
625
|
-
accessLevel: JurisdictionFilter.optional()
|
|
626
|
-
}).optional()
|
|
627
|
-
})
|
|
628
|
-
]);
|
|
629
|
-
function scopeUsesRoleOptions(scope) {
|
|
630
|
-
return ScopesWithRoleOption?.options.some((opt) => opt === scope.type);
|
|
631
|
-
}
|
|
632
596
|
function scopeUsesDeclaredOptions(scope) {
|
|
633
597
|
return !ScopesWithPlaceEventOptions.options.some((opt) => opt === scope.type);
|
|
634
598
|
}
|
|
@@ -661,14 +625,16 @@ var ResolvedRecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
661
625
|
}).optional()
|
|
662
626
|
})
|
|
663
627
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
628
|
+
var SystemScopeType = z2.enum([
|
|
629
|
+
"organisation.read-locations",
|
|
630
|
+
"user.read",
|
|
631
|
+
"user.create",
|
|
632
|
+
"user.edit"
|
|
633
|
+
]);
|
|
664
634
|
var Scope = z2.discriminatedUnion("type", [
|
|
665
635
|
z2.object({ type: PlainScopeType }),
|
|
666
636
|
...RecordScopeV2.options,
|
|
667
|
-
|
|
668
|
-
z2.object({
|
|
669
|
-
type: z2.literal("organisation.read-locations"),
|
|
670
|
-
options: AccessLevelOptions.optional()
|
|
671
|
-
}),
|
|
637
|
+
z2.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
672
638
|
z2.object({
|
|
673
639
|
type: z2.literal("workqueue"),
|
|
674
640
|
options: WorkqueueOrDashboardOptions
|
|
@@ -9964,39 +9930,6 @@ function canAccessEventWithScope(event2, scope, user2, customActionType) {
|
|
|
9964
9930
|
}
|
|
9965
9931
|
return true;
|
|
9966
9932
|
}
|
|
9967
|
-
function canAccessUserWithScope({
|
|
9968
|
-
userToAccess,
|
|
9969
|
-
scope,
|
|
9970
|
-
user: user2
|
|
9971
|
-
}) {
|
|
9972
|
-
const opts = scope.options;
|
|
9973
|
-
const hasSameOffice = user2.primaryOfficeId === userToAccess.primaryOfficeId;
|
|
9974
|
-
if (opts?.accessLevel === JurisdictionFilter.enum.location && !hasSameOffice) {
|
|
9975
|
-
return false;
|
|
9976
|
-
}
|
|
9977
|
-
const hasAdministrativeAreaInHierarchy = userToAccess.administrativeHierarchy.some(
|
|
9978
|
-
(id) => user2.administrativeAreaId === id
|
|
9979
|
-
) || user2.administrativeAreaId === null;
|
|
9980
|
-
if (opts?.accessLevel === JurisdictionFilter.enum.administrativeArea && !hasAdministrativeAreaInHierarchy) {
|
|
9981
|
-
return false;
|
|
9982
|
-
}
|
|
9983
|
-
if (scopeUsesRoleOptions(scope)) {
|
|
9984
|
-
const { options } = scope;
|
|
9985
|
-
if (options?.role && !options.role.includes(userToAccess.role)) {
|
|
9986
|
-
return false;
|
|
9987
|
-
}
|
|
9988
|
-
}
|
|
9989
|
-
return true;
|
|
9990
|
-
}
|
|
9991
|
-
function canAccessOtherUserWithScopes({
|
|
9992
|
-
scopes,
|
|
9993
|
-
userToAccess,
|
|
9994
|
-
user: user2
|
|
9995
|
-
}) {
|
|
9996
|
-
return scopes.some(
|
|
9997
|
-
(scope) => canAccessUserWithScope({ userToAccess, scope, user: user2 })
|
|
9998
|
-
);
|
|
9999
|
-
}
|
|
10000
9933
|
function userCanAccessEventWithScopes(event2, scopes, user2, customActionType) {
|
|
10001
9934
|
return scopes.some(
|
|
10002
9935
|
(scope) => canAccessEventWithScope(event2, scope, user2, customActionType)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-birth-certificate-issuance-flag.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/add-birth-certificate-issuance-flag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-birth-certificate-issuance-flag.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/add-birth-certificate-issuance-flag.ts"],"names":[],"mappings":"AA2aA,iBAAe,IAAI,kBAiDlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -48,7 +48,6 @@ exports.main = main;
|
|
|
48
48
|
*/
|
|
49
49
|
const ts_morph_1 = require("ts-morph");
|
|
50
50
|
const path_1 = __importDefault(require("path"));
|
|
51
|
-
const _1 = require(".");
|
|
52
51
|
const DEFINE_CONFIG_NAME = 'defineConfig';
|
|
53
52
|
const DEFINE_WORKQUEUES_NAME = 'defineWorkqueues';
|
|
54
53
|
const ACTIONS_PROPERTY_NAME = 'actions';
|
|
@@ -318,7 +317,7 @@ function processFile(filePath, project) {
|
|
|
318
317
|
if (!sourceFile)
|
|
319
318
|
return 0;
|
|
320
319
|
let totalChanges = 0;
|
|
321
|
-
const relPath = path_1.default.relative(
|
|
320
|
+
const relPath = path_1.default.relative(process.cwd(), filePath);
|
|
322
321
|
const callExpressions = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.CallExpression);
|
|
323
322
|
for (const call of callExpressions) {
|
|
324
323
|
const expression = call.getExpression();
|
|
@@ -369,7 +368,7 @@ function processFile(filePath, project) {
|
|
|
369
368
|
// ─── Entry point ─────────────────────────────────────────────────────────────
|
|
370
369
|
function main() {
|
|
371
370
|
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
-
const srcDir = path_1.default.join(
|
|
371
|
+
const srcDir = path_1.default.join(process.cwd(), 'src');
|
|
373
372
|
console.log(`Scanning for birth defineConfig and PRINT_CERTIFICATE workqueues in: ${srcDir}\n`);
|
|
374
373
|
const project = new ts_morph_1.Project({
|
|
375
374
|
tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
|
|
@@ -398,7 +397,7 @@ function main() {
|
|
|
398
397
|
for (const filePath of modifiedFiles) {
|
|
399
398
|
const sourceFile = project.getSourceFileOrThrow(filePath);
|
|
400
399
|
yield sourceFile.save();
|
|
401
|
-
console.log(` Saved: ${path_1.default.relative(
|
|
400
|
+
console.log(` Saved: ${path_1.default.relative(process.cwd(), filePath)}`);
|
|
402
401
|
}
|
|
403
402
|
console.log(`\nDone. Applied ${totalChanges} change(s) across ${modifiedFiles.length} file(s).`);
|
|
404
403
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-resend-invite-notification.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/add-resend-invite-notification.ts"],"names":[],"mappings":"AA8ZA,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuCnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|