@opencrvs/toolkit 2.0.0-rc.3c7efd6 → 2.0.0-rc.43258ca
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 -37
- package/dist/cli.js +149 -1420
- package/dist/commons/api/router.d.ts +66 -44
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/events/FieldConfig.d.ts +0 -10
- package/dist/commons/events/locations.d.ts +1 -17
- package/dist/conditionals/index.js +7 -37
- package/dist/events/index.js +7 -75
- 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 +4 -3
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +0 -19
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +13 -17
- 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 +5 -4
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +5 -4
- package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -1
- package/dist/migrations/v2.0/create-events-index.js +2 -1
- package/dist/migrations/v2.0/index.d.ts +4 -8
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +146 -1388
- 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 +6 -5
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +7 -6
- 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 +4 -3
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +4 -3
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +4 -3
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +3 -2
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +4 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +2 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +4 -3
- 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 +4 -3
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-api-paths.js +4 -3
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +4 -3
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -1
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +2 -1
- package/dist/notification/index.js +7 -37
- package/dist/scopes/index.d.ts +10 -87
- package/dist/scopes/index.js +8 -43
- package/opencrvs-toolkit-2.0.0-rc.43258ca.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +0 -3
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-resend-invite-notification.js +0 -373
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +0 -3
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +0 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +0 -77
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +0 -3
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +0 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +0 -221
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-application-config-url.js +0 -342
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +0 -3
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-fhir-url-helpers.js +0 -163
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +0 -3
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-old-statistics-service.js +0 -356
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +0 -3
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-unused-environment-variables.js +0 -186
- package/dist/migrations/v2.0/update-package-json.d.ts +0 -3
- package/dist/migrations/v2.0/update-package-json.d.ts.map +0 -1
- package/dist/migrations/v2.0/update-package-json.js +0 -105
- package/opencrvs-toolkit-2.0.0-rc.3c7efd6.tgz +0 -0
|
@@ -3975,9 +3975,10 @@ 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
|
-
|
|
3978
|
+
use: string;
|
|
3979
|
+
given: string[];
|
|
3980
|
+
family: string;
|
|
3981
|
+
}[];
|
|
3981
3982
|
role: string;
|
|
3982
3983
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
3983
3984
|
type: "user";
|
|
@@ -4007,9 +4008,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4007
4008
|
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
4008
4009
|
input: {
|
|
4009
4010
|
name: {
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4011
|
+
use: string;
|
|
4012
|
+
given: string[];
|
|
4013
|
+
family: string;
|
|
4014
|
+
}[];
|
|
4013
4015
|
role: string;
|
|
4014
4016
|
primaryOfficeId: string;
|
|
4015
4017
|
data?: Record<string, unknown> | undefined;
|
|
@@ -4028,9 +4030,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4028
4030
|
output: {
|
|
4029
4031
|
id: string & import("zod").$brand<"UUID">;
|
|
4030
4032
|
name: {
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4033
|
+
use: string;
|
|
4034
|
+
given: string[];
|
|
4035
|
+
family: string;
|
|
4036
|
+
}[];
|
|
4034
4037
|
role: string;
|
|
4035
4038
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4036
4039
|
type: "user";
|
|
@@ -4051,9 +4054,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4051
4054
|
id: string;
|
|
4052
4055
|
data?: Record<string, unknown> | undefined;
|
|
4053
4056
|
name?: {
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
+
use: string;
|
|
4058
|
+
given: string[];
|
|
4059
|
+
family: string;
|
|
4060
|
+
}[] | undefined;
|
|
4057
4061
|
role?: string | undefined;
|
|
4058
4062
|
fullHonorificName?: string | undefined;
|
|
4059
4063
|
device?: string | undefined;
|
|
@@ -4070,9 +4074,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4070
4074
|
output: {
|
|
4071
4075
|
id: string & import("zod").$brand<"UUID">;
|
|
4072
4076
|
name: {
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4077
|
+
use: string;
|
|
4078
|
+
given: string[];
|
|
4079
|
+
family: string;
|
|
4080
|
+
}[];
|
|
4076
4081
|
role: string;
|
|
4077
4082
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4078
4083
|
type: "user";
|
|
@@ -4092,18 +4097,34 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4092
4097
|
input: string[];
|
|
4093
4098
|
output: ({
|
|
4094
4099
|
id: string & import("zod").$brand<"UUID">;
|
|
4095
|
-
type: "user";
|
|
4096
4100
|
name: {
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4101
|
+
use: string;
|
|
4102
|
+
given: string[];
|
|
4103
|
+
family: string;
|
|
4104
|
+
}[];
|
|
4100
4105
|
role: string;
|
|
4101
|
-
|
|
4106
|
+
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4107
|
+
type: "user";
|
|
4108
|
+
status: "active" | "pending" | "deactivated";
|
|
4109
|
+
avatar?: (string & import("zod").$brand<"DocumentPath">) | undefined;
|
|
4102
4110
|
signature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
|
|
4111
|
+
administrativeAreaId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
4112
|
+
device?: string | undefined;
|
|
4113
|
+
fullHonorificName?: string | undefined;
|
|
4114
|
+
mobile?: string | undefined;
|
|
4115
|
+
email?: string | undefined;
|
|
4116
|
+
data?: Record<string, import("../commons").FieldValue> | undefined;
|
|
4103
4117
|
} | {
|
|
4104
4118
|
id: string & import("zod").$brand<"UUID">;
|
|
4105
|
-
type: "system";
|
|
4106
4119
|
name: string;
|
|
4120
|
+
type: "system";
|
|
4121
|
+
primaryOfficeId?: (string & import("zod").$brand<"UUID">) | undefined;
|
|
4122
|
+
administrativeAreaId?: (string & import("zod").$brand<"UUID">) | undefined;
|
|
4123
|
+
signature?: undefined;
|
|
4124
|
+
avatar?: undefined;
|
|
4125
|
+
fullHonorificName?: string | undefined;
|
|
4126
|
+
legacyId?: string | undefined;
|
|
4127
|
+
status?: undefined;
|
|
4107
4128
|
})[];
|
|
4108
4129
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
4109
4130
|
}>;
|
|
@@ -4122,9 +4143,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4122
4143
|
output: ({
|
|
4123
4144
|
id: string & import("zod").$brand<"UUID">;
|
|
4124
4145
|
name: {
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4146
|
+
use: string;
|
|
4147
|
+
given: string[];
|
|
4148
|
+
family: string;
|
|
4149
|
+
}[];
|
|
4128
4150
|
role: string;
|
|
4129
4151
|
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4130
4152
|
type: "user";
|
|
@@ -4750,7 +4772,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4750
4772
|
'legalStatuses.DECLARED.createdAtLocation'?: {
|
|
4751
4773
|
type: "within";
|
|
4752
4774
|
location: string | {
|
|
4753
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4775
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4754
4776
|
$location?: string | undefined;
|
|
4755
4777
|
};
|
|
4756
4778
|
} | undefined;
|
|
@@ -4772,7 +4794,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4772
4794
|
'legalStatuses.REGISTERED.createdAtLocation'?: {
|
|
4773
4795
|
type: "within";
|
|
4774
4796
|
location: string | {
|
|
4775
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4797
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4776
4798
|
$location?: string | undefined;
|
|
4777
4799
|
};
|
|
4778
4800
|
} | undefined;
|
|
@@ -4787,47 +4809,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4787
4809
|
createdAtLocation?: {
|
|
4788
4810
|
type: "within";
|
|
4789
4811
|
location: string | {
|
|
4790
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4812
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4791
4813
|
$location?: string | undefined;
|
|
4792
4814
|
};
|
|
4793
4815
|
} | {
|
|
4794
4816
|
type: "exact";
|
|
4795
4817
|
term: string | {
|
|
4796
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4818
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4797
4819
|
$location?: string | undefined;
|
|
4798
4820
|
};
|
|
4799
4821
|
} | undefined;
|
|
4800
4822
|
updatedAtLocation?: {
|
|
4801
4823
|
type: "within";
|
|
4802
4824
|
location: string | {
|
|
4803
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4825
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4804
4826
|
$location?: string | undefined;
|
|
4805
4827
|
};
|
|
4806
4828
|
} | {
|
|
4807
4829
|
type: "exact";
|
|
4808
4830
|
term: string | {
|
|
4809
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4831
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4810
4832
|
$location?: string | undefined;
|
|
4811
4833
|
};
|
|
4812
4834
|
} | undefined;
|
|
4813
4835
|
updatedByUserRole?: {
|
|
4814
4836
|
type: "exact";
|
|
4815
4837
|
term: string | {
|
|
4816
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4838
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4817
4839
|
$location?: string | undefined;
|
|
4818
4840
|
};
|
|
4819
4841
|
} | undefined;
|
|
4820
4842
|
assignedTo?: {
|
|
4821
4843
|
type: "exact";
|
|
4822
4844
|
term: string | {
|
|
4823
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4845
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4824
4846
|
$location?: string | undefined;
|
|
4825
4847
|
};
|
|
4826
4848
|
} | undefined;
|
|
4827
4849
|
createdBy?: {
|
|
4828
4850
|
type: "exact";
|
|
4829
4851
|
term: string | {
|
|
4830
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4852
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4831
4853
|
$location?: string | undefined;
|
|
4832
4854
|
};
|
|
4833
4855
|
} | undefined;
|
|
@@ -4838,7 +4860,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4838
4860
|
updatedBy?: {
|
|
4839
4861
|
type: "exact";
|
|
4840
4862
|
term: string | {
|
|
4841
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4863
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4842
4864
|
$location?: string | undefined;
|
|
4843
4865
|
};
|
|
4844
4866
|
} | undefined;
|
|
@@ -4888,7 +4910,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4888
4910
|
'legalStatuses.DECLARED.createdAtLocation'?: {
|
|
4889
4911
|
type: "within";
|
|
4890
4912
|
location: string | {
|
|
4891
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4913
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4892
4914
|
$location?: string | undefined;
|
|
4893
4915
|
};
|
|
4894
4916
|
} | undefined;
|
|
@@ -4910,7 +4932,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4910
4932
|
'legalStatuses.REGISTERED.createdAtLocation'?: {
|
|
4911
4933
|
type: "within";
|
|
4912
4934
|
location: string | {
|
|
4913
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4935
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4914
4936
|
$location?: string | undefined;
|
|
4915
4937
|
};
|
|
4916
4938
|
} | undefined;
|
|
@@ -4925,47 +4947,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4925
4947
|
createdAtLocation?: {
|
|
4926
4948
|
type: "within";
|
|
4927
4949
|
location: string | {
|
|
4928
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4950
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4929
4951
|
$location?: string | undefined;
|
|
4930
4952
|
};
|
|
4931
4953
|
} | {
|
|
4932
4954
|
type: "exact";
|
|
4933
4955
|
term: string | {
|
|
4934
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4956
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4935
4957
|
$location?: string | undefined;
|
|
4936
4958
|
};
|
|
4937
4959
|
} | undefined;
|
|
4938
4960
|
updatedAtLocation?: {
|
|
4939
4961
|
type: "within";
|
|
4940
4962
|
location: string | {
|
|
4941
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4963
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4942
4964
|
$location?: string | undefined;
|
|
4943
4965
|
};
|
|
4944
4966
|
} | {
|
|
4945
4967
|
type: "exact";
|
|
4946
4968
|
term: string | {
|
|
4947
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4969
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4948
4970
|
$location?: string | undefined;
|
|
4949
4971
|
};
|
|
4950
4972
|
} | undefined;
|
|
4951
4973
|
updatedByUserRole?: {
|
|
4952
4974
|
type: "exact";
|
|
4953
4975
|
term: string | {
|
|
4954
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4976
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4955
4977
|
$location?: string | undefined;
|
|
4956
4978
|
};
|
|
4957
4979
|
} | undefined;
|
|
4958
4980
|
assignedTo?: {
|
|
4959
4981
|
type: "exact";
|
|
4960
4982
|
term: string | {
|
|
4961
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4983
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4962
4984
|
$location?: string | undefined;
|
|
4963
4985
|
};
|
|
4964
4986
|
} | undefined;
|
|
4965
4987
|
createdBy?: {
|
|
4966
4988
|
type: "exact";
|
|
4967
4989
|
term: string | {
|
|
4968
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4990
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4969
4991
|
$location?: string | undefined;
|
|
4970
4992
|
};
|
|
4971
4993
|
} | undefined;
|
|
@@ -4976,7 +4998,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4976
4998
|
updatedBy?: {
|
|
4977
4999
|
type: "exact";
|
|
4978
5000
|
term: string | {
|
|
4979
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
5001
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
|
|
4980
5002
|
$location?: string | undefined;
|
|
4981
5003
|
};
|
|
4982
5004
|
} | undefined;
|
|
@@ -86,17 +86,17 @@ export declare const user: typeof userSerializer & {
|
|
|
86
86
|
};
|
|
87
87
|
scope: (scope: import("../scopes").ScopeType) => {
|
|
88
88
|
attribute: (option: import("../scopes").ScopeOptionKey) => {
|
|
89
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "
|
|
90
|
-
$option: "
|
|
89
|
+
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
90
|
+
$option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
jurisdiction: (jurisdiction: import("../scopes").JurisdictionFilter | {
|
|
94
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "
|
|
95
|
-
$option: "
|
|
94
|
+
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
95
|
+
$option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
96
96
|
}) => {
|
|
97
97
|
$jurisdiction: "administrativeArea" | "location" | "all" | {
|
|
98
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "
|
|
99
|
-
$option: "
|
|
98
|
+
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
99
|
+
$option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
102
|
};
|
|
@@ -1723,12 +1723,10 @@ declare const AdministrativeAreaField: z.ZodObject<{
|
|
|
1723
1723
|
"user.read": "user.read";
|
|
1724
1724
|
"user.create": "user.create";
|
|
1725
1725
|
"user.edit": "user.edit";
|
|
1726
|
-
"user.search": "user.search";
|
|
1727
1726
|
workqueue: "workqueue";
|
|
1728
1727
|
"dashboard.view": "dashboard.view";
|
|
1729
1728
|
}>;
|
|
1730
1729
|
$option: z.ZodEnum<{
|
|
1731
|
-
role: "role";
|
|
1732
1730
|
event: "event";
|
|
1733
1731
|
placeOfEvent: "placeOfEvent";
|
|
1734
1732
|
declaredIn: "declaredIn";
|
|
@@ -1843,12 +1841,10 @@ declare const LocationInput: z.ZodObject<{
|
|
|
1843
1841
|
"user.read": "user.read";
|
|
1844
1842
|
"user.create": "user.create";
|
|
1845
1843
|
"user.edit": "user.edit";
|
|
1846
|
-
"user.search": "user.search";
|
|
1847
1844
|
workqueue: "workqueue";
|
|
1848
1845
|
"dashboard.view": "dashboard.view";
|
|
1849
1846
|
}>;
|
|
1850
1847
|
$option: z.ZodEnum<{
|
|
1851
|
-
role: "role";
|
|
1852
1848
|
event: "event";
|
|
1853
1849
|
placeOfEvent: "placeOfEvent";
|
|
1854
1850
|
declaredIn: "declaredIn";
|
|
@@ -2028,12 +2024,10 @@ declare const Facility: z.ZodObject<{
|
|
|
2028
2024
|
"user.read": "user.read";
|
|
2029
2025
|
"user.create": "user.create";
|
|
2030
2026
|
"user.edit": "user.edit";
|
|
2031
|
-
"user.search": "user.search";
|
|
2032
2027
|
workqueue: "workqueue";
|
|
2033
2028
|
"dashboard.view": "dashboard.view";
|
|
2034
2029
|
}>;
|
|
2035
2030
|
$option: z.ZodEnum<{
|
|
2036
|
-
role: "role";
|
|
2037
2031
|
event: "event";
|
|
2038
2032
|
placeOfEvent: "placeOfEvent";
|
|
2039
2033
|
declaredIn: "declaredIn";
|
|
@@ -2134,12 +2128,10 @@ declare const Office: z.ZodObject<{
|
|
|
2134
2128
|
"user.read": "user.read";
|
|
2135
2129
|
"user.create": "user.create";
|
|
2136
2130
|
"user.edit": "user.edit";
|
|
2137
|
-
"user.search": "user.search";
|
|
2138
2131
|
workqueue: "workqueue";
|
|
2139
2132
|
"dashboard.view": "dashboard.view";
|
|
2140
2133
|
}>;
|
|
2141
2134
|
$option: z.ZodEnum<{
|
|
2142
|
-
role: "role";
|
|
2143
2135
|
event: "event";
|
|
2144
2136
|
placeOfEvent: "placeOfEvent";
|
|
2145
2137
|
declaredIn: "declaredIn";
|
|
@@ -2327,12 +2319,10 @@ declare const Address: z.ZodObject<{
|
|
|
2327
2319
|
"user.read": "user.read";
|
|
2328
2320
|
"user.create": "user.create";
|
|
2329
2321
|
"user.edit": "user.edit";
|
|
2330
|
-
"user.search": "user.search";
|
|
2331
2322
|
workqueue: "workqueue";
|
|
2332
2323
|
"dashboard.view": "dashboard.view";
|
|
2333
2324
|
}>;
|
|
2334
2325
|
$option: z.ZodEnum<{
|
|
2335
|
-
role: "role";
|
|
2336
2326
|
event: "event";
|
|
2337
2327
|
placeOfEvent: "placeOfEvent";
|
|
2338
2328
|
declaredIn: "declaredIn";
|
|
@@ -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()
|
|
@@ -209,9 +205,6 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
|
209
205
|
var AccessLevelOptions = z6.object({
|
|
210
206
|
accessLevel: JurisdictionFilter.optional()
|
|
211
207
|
});
|
|
212
|
-
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
213
|
-
role: userRole.optional()
|
|
214
|
-
});
|
|
215
208
|
var WorkqueueOrDashboardOptions = z6.object({
|
|
216
209
|
ids: z6.preprocess(
|
|
217
210
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -221,7 +214,6 @@ var WorkqueueOrDashboardOptions = z6.object({
|
|
|
221
214
|
var AllScopeOptions = z6.object({
|
|
222
215
|
...AllRecordScopeOptions.shape,
|
|
223
216
|
...AccessLevelOptions.shape,
|
|
224
|
-
...AllUserScopeOptions.shape,
|
|
225
217
|
...WorkqueueOrDashboardOptions.shape
|
|
226
218
|
});
|
|
227
219
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
@@ -294,30 +286,6 @@ var RecordScopeV2 = z6.discriminatedUnion("type", [
|
|
|
294
286
|
]).describe(
|
|
295
287
|
"Scopes used to check user's permission to perform actions on a record."
|
|
296
288
|
);
|
|
297
|
-
var SystemScopeType = z6.enum([
|
|
298
|
-
"organisation.read-locations",
|
|
299
|
-
"user.read",
|
|
300
|
-
"user.create",
|
|
301
|
-
"user.edit",
|
|
302
|
-
"user.search"
|
|
303
|
-
]);
|
|
304
|
-
var UserScopeType = SystemScopeType.extract([
|
|
305
|
-
"user.read",
|
|
306
|
-
"user.create",
|
|
307
|
-
"user.edit",
|
|
308
|
-
"user.search"
|
|
309
|
-
]);
|
|
310
|
-
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
311
|
-
var UserScopeV2 = z6.discriminatedUnion("type", [
|
|
312
|
-
z6.object({
|
|
313
|
-
type: ScopesWithRoleOption,
|
|
314
|
-
options: AllUserScopeOptions.optional()
|
|
315
|
-
}),
|
|
316
|
-
z6.object({
|
|
317
|
-
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
318
|
-
options: AccessLevelOptions.optional()
|
|
319
|
-
})
|
|
320
|
-
]);
|
|
321
289
|
var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
|
|
322
290
|
z6.object({
|
|
323
291
|
type: ScopesWithPlaceEventOptions,
|
|
@@ -338,14 +306,16 @@ var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
|
|
|
338
306
|
}).optional()
|
|
339
307
|
})
|
|
340
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
|
+
]);
|
|
341
315
|
var Scope2 = z6.discriminatedUnion("type", [
|
|
342
316
|
z6.object({ type: PlainScopeType }),
|
|
343
317
|
...RecordScopeV2.options,
|
|
344
|
-
|
|
345
|
-
z6.object({
|
|
346
|
-
type: z6.literal("organisation.read-locations"),
|
|
347
|
-
options: AccessLevelOptions.optional()
|
|
348
|
-
}),
|
|
318
|
+
z6.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
349
319
|
z6.object({
|
|
350
320
|
type: z6.literal("workqueue"),
|
|
351
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()
|
|
@@ -518,9 +512,6 @@ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
|
518
512
|
var AccessLevelOptions = z2.object({
|
|
519
513
|
accessLevel: JurisdictionFilter.optional()
|
|
520
514
|
});
|
|
521
|
-
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
522
|
-
role: userRole.optional()
|
|
523
|
-
});
|
|
524
515
|
var WorkqueueOrDashboardOptions = z2.object({
|
|
525
516
|
ids: z2.preprocess(
|
|
526
517
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -530,7 +521,6 @@ var WorkqueueOrDashboardOptions = z2.object({
|
|
|
530
521
|
var AllScopeOptions = z2.object({
|
|
531
522
|
...AllRecordScopeOptions.shape,
|
|
532
523
|
...AccessLevelOptions.shape,
|
|
533
|
-
...AllUserScopeOptions.shape,
|
|
534
524
|
...WorkqueueOrDashboardOptions.shape
|
|
535
525
|
});
|
|
536
526
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
@@ -603,33 +593,6 @@ var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
603
593
|
]).describe(
|
|
604
594
|
"Scopes used to check user's permission to perform actions on a record."
|
|
605
595
|
);
|
|
606
|
-
var SystemScopeType = z2.enum([
|
|
607
|
-
"organisation.read-locations",
|
|
608
|
-
"user.read",
|
|
609
|
-
"user.create",
|
|
610
|
-
"user.edit",
|
|
611
|
-
"user.search"
|
|
612
|
-
]);
|
|
613
|
-
var UserScopeType = SystemScopeType.extract([
|
|
614
|
-
"user.read",
|
|
615
|
-
"user.create",
|
|
616
|
-
"user.edit",
|
|
617
|
-
"user.search"
|
|
618
|
-
]);
|
|
619
|
-
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
620
|
-
var UserScopeV2 = z2.discriminatedUnion("type", [
|
|
621
|
-
z2.object({
|
|
622
|
-
type: ScopesWithRoleOption,
|
|
623
|
-
options: AllUserScopeOptions.optional()
|
|
624
|
-
}),
|
|
625
|
-
z2.object({
|
|
626
|
-
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
627
|
-
options: AccessLevelOptions.optional()
|
|
628
|
-
})
|
|
629
|
-
]);
|
|
630
|
-
function scopeUsesRoleOptions(scope) {
|
|
631
|
-
return ScopesWithRoleOption?.options.some((opt) => opt === scope.type);
|
|
632
|
-
}
|
|
633
596
|
function scopeUsesDeclaredOptions(scope) {
|
|
634
597
|
return !ScopesWithPlaceEventOptions.options.some((opt) => opt === scope.type);
|
|
635
598
|
}
|
|
@@ -662,14 +625,16 @@ var ResolvedRecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
662
625
|
}).optional()
|
|
663
626
|
})
|
|
664
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
|
+
]);
|
|
665
634
|
var Scope = z2.discriminatedUnion("type", [
|
|
666
635
|
z2.object({ type: PlainScopeType }),
|
|
667
636
|
...RecordScopeV2.options,
|
|
668
|
-
|
|
669
|
-
z2.object({
|
|
670
|
-
type: z2.literal("organisation.read-locations"),
|
|
671
|
-
options: AccessLevelOptions.optional()
|
|
672
|
-
}),
|
|
637
|
+
z2.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
673
638
|
z2.object({
|
|
674
639
|
type: z2.literal("workqueue"),
|
|
675
640
|
options: WorkqueueOrDashboardOptions
|
|
@@ -9965,39 +9930,6 @@ function canAccessEventWithScope(event2, scope, user2, customActionType) {
|
|
|
9965
9930
|
}
|
|
9966
9931
|
return true;
|
|
9967
9932
|
}
|
|
9968
|
-
function canAccessUserWithScope({
|
|
9969
|
-
userToAccess,
|
|
9970
|
-
scope,
|
|
9971
|
-
user: user2
|
|
9972
|
-
}) {
|
|
9973
|
-
const opts = scope.options;
|
|
9974
|
-
const hasSameOffice = user2.primaryOfficeId === userToAccess.primaryOfficeId;
|
|
9975
|
-
if (opts?.accessLevel === JurisdictionFilter.enum.location && !hasSameOffice) {
|
|
9976
|
-
return false;
|
|
9977
|
-
}
|
|
9978
|
-
const hasAdministrativeAreaInHierarchy = userToAccess.administrativeHierarchy.some(
|
|
9979
|
-
(id) => user2.administrativeAreaId === id
|
|
9980
|
-
) || user2.administrativeAreaId === null;
|
|
9981
|
-
if (opts?.accessLevel === JurisdictionFilter.enum.administrativeArea && !hasAdministrativeAreaInHierarchy) {
|
|
9982
|
-
return false;
|
|
9983
|
-
}
|
|
9984
|
-
if (scopeUsesRoleOptions(scope)) {
|
|
9985
|
-
const { options } = scope;
|
|
9986
|
-
if (options?.role && !options.role.includes(userToAccess.role)) {
|
|
9987
|
-
return false;
|
|
9988
|
-
}
|
|
9989
|
-
}
|
|
9990
|
-
return true;
|
|
9991
|
-
}
|
|
9992
|
-
function canAccessOtherUserWithScopes({
|
|
9993
|
-
scopes,
|
|
9994
|
-
userToAccess,
|
|
9995
|
-
user: user2
|
|
9996
|
-
}) {
|
|
9997
|
-
return scopes.some(
|
|
9998
|
-
(scope) => canAccessUserWithScope({ userToAccess, scope, user: user2 })
|
|
9999
|
-
);
|
|
10000
|
-
}
|
|
10001
9933
|
function userCanAccessEventWithScopes(event2, scopes, user2, customActionType) {
|
|
10002
9934
|
return scopes.some(
|
|
10003
9935
|
(scope) => canAccessEventWithScope(event2, scope, user2, customActionType)
|