@opencrvs/toolkit 2.0.0-rc.754b1d1 → 2.0.0-rc.764c76e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/application-config/index.js +11 -39
  2. package/dist/cli.js +317 -1656
  3. package/dist/commons/api/router.d.ts +54 -55
  4. package/dist/commons/application-config/index.d.ts +4 -16
  5. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  6. package/dist/commons/events/FieldConfig.d.ts +0 -5
  7. package/dist/commons/events/locations.d.ts +1 -17
  8. package/dist/conditionals/index.js +7 -35
  9. package/dist/events/index.js +7 -73
  10. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
  11. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +39 -63
  12. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +0 -19
  13. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  14. package/dist/migrations/v2.0/checkout-upstream-files.js +13 -17
  15. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -1
  16. package/dist/migrations/v2.0/convert-config-files-to-ts.js +5 -4
  17. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -1
  18. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +5 -4
  19. package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -1
  20. package/dist/migrations/v2.0/create-events-index.js +2 -1
  21. package/dist/migrations/v2.0/index.d.ts +4 -8
  22. package/dist/migrations/v2.0/index.d.ts.map +1 -1
  23. package/dist/migrations/v2.0/index.js +314 -1624
  24. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
  25. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +7 -95
  26. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
  27. package/dist/migrations/v2.0/migrate-scopes.js +7 -6
  28. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -1
  29. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +4 -3
  30. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
  31. package/dist/migrations/v2.0/migrate-workqueue-configs.js +4 -3
  32. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -1
  33. package/dist/migrations/v2.0/remove-delete-actions.js +4 -3
  34. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -1
  35. package/dist/migrations/v2.0/remove-demo-scope.js +3 -2
  36. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -1
  37. package/dist/migrations/v2.0/remove-deprecated-imports.js +4 -3
  38. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -1
  39. package/dist/migrations/v2.0/remove-hearth-migrations.js +2 -1
  40. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -1
  41. package/dist/migrations/v2.0/remove-pending-certification-flag.js +4 -3
  42. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -1
  43. package/dist/migrations/v2.0/remove-review-from-register-action.js +4 -3
  44. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -1
  45. package/dist/migrations/v2.0/rename-api-paths.js +4 -3
  46. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -1
  47. package/dist/migrations/v2.0/rename-location-parent-id.js +4 -3
  48. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -1
  49. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +2 -1
  50. package/dist/notification/index.js +7 -35
  51. package/dist/scopes/index.d.ts +10 -82
  52. package/dist/scopes/index.js +8 -41
  53. package/opencrvs-toolkit-2.0.0-rc.764c76e.tgz +0 -0
  54. package/package.json +1 -1
  55. package/tsconfig.tsbuildinfo +1 -1
  56. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +0 -3
  57. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +0 -1
  58. package/dist/migrations/v2.0/add-resend-invite-notification.js +0 -373
  59. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +0 -3
  60. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +0 -1
  61. package/dist/migrations/v2.0/delete-infrastructure-directory.js +0 -77
  62. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +0 -3
  63. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +0 -1
  64. package/dist/migrations/v2.0/merge-infrastructure-directory.js +0 -221
  65. package/dist/migrations/v2.0/migrate-application-config-url.d.ts +0 -3
  66. package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +0 -1
  67. package/dist/migrations/v2.0/migrate-application-config-url.js +0 -342
  68. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +0 -3
  69. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +0 -1
  70. package/dist/migrations/v2.0/remove-fhir-url-helpers.js +0 -163
  71. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +0 -3
  72. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +0 -1
  73. package/dist/migrations/v2.0/remove-old-statistics-service.js +0 -356
  74. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +0 -3
  75. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +0 -1
  76. package/dist/migrations/v2.0/remove-unused-environment-variables.js +0 -186
  77. package/dist/migrations/v2.0/update-package-json.d.ts +0 -3
  78. package/dist/migrations/v2.0/update-package-json.d.ts.map +0 -1
  79. package/dist/migrations/v2.0/update-package-json.js +0 -105
  80. package/opencrvs-toolkit-2.0.0-rc.754b1d1.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
- firstname: string;
3979
- surname: string;
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
- firstname: string;
4011
- surname: string;
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;
@@ -4018,7 +4020,6 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4018
4020
  email?: string | undefined;
4019
4021
  mobile?: string | undefined;
4020
4022
  username?: undefined;
4021
- password?: undefined;
4022
4023
  signature?: {
4023
4024
  path: string;
4024
4025
  originalFilename: string;
@@ -4028,9 +4029,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4028
4029
  output: {
4029
4030
  id: string & import("zod").$brand<"UUID">;
4030
4031
  name: {
4031
- firstname: string;
4032
- surname: string;
4033
- };
4032
+ use: string;
4033
+ given: string[];
4034
+ family: string;
4035
+ }[];
4034
4036
  role: string;
4035
4037
  primaryOfficeId: string & import("zod").$brand<"UUID">;
4036
4038
  type: "user";
@@ -4051,9 +4053,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4051
4053
  id: string;
4052
4054
  data?: Record<string, unknown> | undefined;
4053
4055
  name?: {
4054
- firstname: string;
4055
- surname: string;
4056
- } | undefined;
4056
+ use: string;
4057
+ given: string[];
4058
+ family: string;
4059
+ }[] | undefined;
4057
4060
  role?: string | undefined;
4058
4061
  fullHonorificName?: string | undefined;
4059
4062
  device?: string | undefined;
@@ -4066,13 +4069,16 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4066
4069
  type: string;
4067
4070
  } | undefined;
4068
4071
  status?: "active" | "deactivated" | undefined;
4072
+ } & {
4073
+ id: string;
4069
4074
  };
4070
4075
  output: {
4071
4076
  id: string & import("zod").$brand<"UUID">;
4072
4077
  name: {
4073
- firstname: string;
4074
- surname: string;
4075
- };
4078
+ use: string;
4079
+ given: string[];
4080
+ family: string;
4081
+ }[];
4076
4082
  role: string;
4077
4083
  primaryOfficeId: string & import("zod").$brand<"UUID">;
4078
4084
  type: "user";
@@ -4093,9 +4099,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4093
4099
  output: ({
4094
4100
  id: string & import("zod").$brand<"UUID">;
4095
4101
  name: {
4096
- firstname: string;
4097
- surname: string;
4098
- };
4102
+ use: string;
4103
+ given: string[];
4104
+ family: string;
4105
+ }[];
4099
4106
  role: string;
4100
4107
  primaryOfficeId: string & import("zod").$brand<"UUID">;
4101
4108
  type: "user";
@@ -4137,9 +4144,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4137
4144
  output: ({
4138
4145
  id: string & import("zod").$brand<"UUID">;
4139
4146
  name: {
4140
- firstname: string;
4141
- surname: string;
4142
- };
4147
+ use: string;
4148
+ given: string[];
4149
+ family: string;
4150
+ }[];
4143
4151
  role: string;
4144
4152
  primaryOfficeId: string & import("zod").$brand<"UUID">;
4145
4153
  type: "user";
@@ -4275,7 +4283,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4275
4283
  changeAvatar: import("@trpc/server").TRPCMutationProcedure<{
4276
4284
  input: {
4277
4285
  userId: string;
4278
- avatar: string;
4286
+ avatar: {
4287
+ type: string;
4288
+ data: string;
4289
+ };
4279
4290
  };
4280
4291
  output: void;
4281
4292
  meta: import("trpc-to-openapi").OpenApiMeta;
@@ -4307,18 +4318,6 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4307
4318
  output: void;
4308
4319
  meta: import("trpc-to-openapi").OpenApiMeta;
4309
4320
  }>;
4310
- verifyLoggedInUserPassword: import("@trpc/server").TRPCMutationProcedure<{
4311
- input: {
4312
- password: string;
4313
- };
4314
- output: {
4315
- status: string;
4316
- username: string;
4317
- id: string;
4318
- mobile?: string | undefined;
4319
- };
4320
- meta: import("trpc-to-openapi").OpenApiMeta;
4321
- }>;
4322
4321
  audit: import("@trpc/server").TRPCBuiltRouter<{
4323
4322
  ctx: Partial<{
4324
4323
  token: `Bearer ${string}`;
@@ -4774,7 +4773,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4774
4773
  'legalStatuses.DECLARED.createdAtLocation'?: {
4775
4774
  type: "within";
4776
4775
  location: string | {
4777
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4776
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4778
4777
  $location?: string | undefined;
4779
4778
  };
4780
4779
  } | undefined;
@@ -4796,7 +4795,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4796
4795
  'legalStatuses.REGISTERED.createdAtLocation'?: {
4797
4796
  type: "within";
4798
4797
  location: string | {
4799
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4798
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4800
4799
  $location?: string | undefined;
4801
4800
  };
4802
4801
  } | undefined;
@@ -4811,47 +4810,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4811
4810
  createdAtLocation?: {
4812
4811
  type: "within";
4813
4812
  location: string | {
4814
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4813
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4815
4814
  $location?: string | undefined;
4816
4815
  };
4817
4816
  } | {
4818
4817
  type: "exact";
4819
4818
  term: string | {
4820
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4819
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4821
4820
  $location?: string | undefined;
4822
4821
  };
4823
4822
  } | undefined;
4824
4823
  updatedAtLocation?: {
4825
4824
  type: "within";
4826
4825
  location: string | {
4827
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4826
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4828
4827
  $location?: string | undefined;
4829
4828
  };
4830
4829
  } | {
4831
4830
  type: "exact";
4832
4831
  term: string | {
4833
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4832
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4834
4833
  $location?: string | undefined;
4835
4834
  };
4836
4835
  } | undefined;
4837
4836
  updatedByUserRole?: {
4838
4837
  type: "exact";
4839
4838
  term: string | {
4840
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4839
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4841
4840
  $location?: string | undefined;
4842
4841
  };
4843
4842
  } | undefined;
4844
4843
  assignedTo?: {
4845
4844
  type: "exact";
4846
4845
  term: string | {
4847
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4846
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4848
4847
  $location?: string | undefined;
4849
4848
  };
4850
4849
  } | undefined;
4851
4850
  createdBy?: {
4852
4851
  type: "exact";
4853
4852
  term: string | {
4854
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4853
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4855
4854
  $location?: string | undefined;
4856
4855
  };
4857
4856
  } | undefined;
@@ -4862,7 +4861,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4862
4861
  updatedBy?: {
4863
4862
  type: "exact";
4864
4863
  term: string | {
4865
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4864
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4866
4865
  $location?: string | undefined;
4867
4866
  };
4868
4867
  } | undefined;
@@ -4912,7 +4911,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4912
4911
  'legalStatuses.DECLARED.createdAtLocation'?: {
4913
4912
  type: "within";
4914
4913
  location: string | {
4915
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4914
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4916
4915
  $location?: string | undefined;
4917
4916
  };
4918
4917
  } | undefined;
@@ -4934,7 +4933,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4934
4933
  'legalStatuses.REGISTERED.createdAtLocation'?: {
4935
4934
  type: "within";
4936
4935
  location: string | {
4937
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4936
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4938
4937
  $location?: string | undefined;
4939
4938
  };
4940
4939
  } | undefined;
@@ -4949,47 +4948,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4949
4948
  createdAtLocation?: {
4950
4949
  type: "within";
4951
4950
  location: string | {
4952
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4951
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4953
4952
  $location?: string | undefined;
4954
4953
  };
4955
4954
  } | {
4956
4955
  type: "exact";
4957
4956
  term: string | {
4958
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4957
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4959
4958
  $location?: string | undefined;
4960
4959
  };
4961
4960
  } | undefined;
4962
4961
  updatedAtLocation?: {
4963
4962
  type: "within";
4964
4963
  location: string | {
4965
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4964
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4966
4965
  $location?: string | undefined;
4967
4966
  };
4968
4967
  } | {
4969
4968
  type: "exact";
4970
4969
  term: string | {
4971
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4970
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4972
4971
  $location?: string | undefined;
4973
4972
  };
4974
4973
  } | undefined;
4975
4974
  updatedByUserRole?: {
4976
4975
  type: "exact";
4977
4976
  term: string | {
4978
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4977
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4979
4978
  $location?: string | undefined;
4980
4979
  };
4981
4980
  } | undefined;
4982
4981
  assignedTo?: {
4983
4982
  type: "exact";
4984
4983
  term: string | {
4985
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4984
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4986
4985
  $location?: string | undefined;
4987
4986
  };
4988
4987
  } | undefined;
4989
4988
  createdBy?: {
4990
4989
  type: "exact";
4991
4990
  term: string | {
4992
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
4991
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
4993
4992
  $location?: string | undefined;
4994
4993
  };
4995
4994
  } | undefined;
@@ -5000,7 +4999,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
5000
4999
  updatedBy?: {
5001
5000
  type: "exact";
5002
5001
  term: string | {
5003
- $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
5002
+ $userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "avatar" | "signature" | "primaryOfficeId";
5004
5003
  $location?: string | undefined;
5005
5004
  };
5006
5005
  } | undefined;
@@ -24,14 +24,8 @@ export declare const ApplicationConfig: z.ZodObject<{
24
24
  label: z.ZodObject<import("./events/TranslationConfig").MessageDescriptorZod, z.core.$strip>;
25
25
  }, z.core.$strip>>;
26
26
  PHONE_NUMBER_PATTERN: z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
27
- USER_NOTIFICATION_DELIVERY_METHOD: z.ZodEnum<{
28
- email: "email";
29
- sms: "sms";
30
- }>;
31
- INFORMANT_NOTIFICATION_DELIVERY_METHOD: z.ZodEnum<{
32
- email: "email";
33
- sms: "sms";
34
- }>;
27
+ USER_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
28
+ INFORMANT_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
35
29
  SEARCH_DEFAULT_CRITERIA: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
36
30
  NAME: "NAME";
37
31
  EMAIL: "EMAIL";
@@ -52,14 +46,8 @@ export declare const BackgroundConfig: z.ZodObject<{
52
46
  export declare const LoginConfig: z.ZodObject<{
53
47
  COUNTRY: z.ZodString;
54
48
  LANGUAGES: z.ZodArray<z.ZodString>;
55
- USER_NOTIFICATION_DELIVERY_METHOD: z.ZodEnum<{
56
- email: "email";
57
- sms: "sms";
58
- }>;
59
- INFORMANT_NOTIFICATION_DELIVERY_METHOD: z.ZodEnum<{
60
- email: "email";
61
- sms: "sms";
62
- }>;
49
+ USER_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
50
+ INFORMANT_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
63
51
  PHONE_NUMBER_PATTERN: z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
64
52
  LOGIN_BACKGROUND: z.ZodObject<{
65
53
  backgroundColor: z.ZodOptional<z.ZodString>;
@@ -87,16 +87,16 @@ export declare const user: typeof userSerializer & {
87
87
  scope: (scope: import("../scopes").ScopeType) => {
88
88
  attribute: (option: import("../scopes").ScopeOptionKey) => {
89
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: "role" | "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
90
+ $option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
91
91
  };
92
92
  };
93
93
  jurisdiction: (jurisdiction: import("../scopes").JurisdictionFilter | {
94
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: "role" | "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
95
+ $option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
96
96
  }) => {
97
97
  $jurisdiction: "administrativeArea" | "location" | "all" | {
98
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: "role" | "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
99
+ $option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
100
100
  };
101
101
  };
102
102
  };
@@ -1727,7 +1727,6 @@ declare const AdministrativeAreaField: z.ZodObject<{
1727
1727
  "dashboard.view": "dashboard.view";
1728
1728
  }>;
1729
1729
  $option: z.ZodEnum<{
1730
- role: "role";
1731
1730
  event: "event";
1732
1731
  placeOfEvent: "placeOfEvent";
1733
1732
  declaredIn: "declaredIn";
@@ -1846,7 +1845,6 @@ declare const LocationInput: z.ZodObject<{
1846
1845
  "dashboard.view": "dashboard.view";
1847
1846
  }>;
1848
1847
  $option: z.ZodEnum<{
1849
- role: "role";
1850
1848
  event: "event";
1851
1849
  placeOfEvent: "placeOfEvent";
1852
1850
  declaredIn: "declaredIn";
@@ -2030,7 +2028,6 @@ declare const Facility: z.ZodObject<{
2030
2028
  "dashboard.view": "dashboard.view";
2031
2029
  }>;
2032
2030
  $option: z.ZodEnum<{
2033
- role: "role";
2034
2031
  event: "event";
2035
2032
  placeOfEvent: "placeOfEvent";
2036
2033
  declaredIn: "declaredIn";
@@ -2135,7 +2132,6 @@ declare const Office: z.ZodObject<{
2135
2132
  "dashboard.view": "dashboard.view";
2136
2133
  }>;
2137
2134
  $option: z.ZodEnum<{
2138
- role: "role";
2139
2135
  event: "event";
2140
2136
  placeOfEvent: "placeOfEvent";
2141
2137
  declaredIn: "declaredIn";
@@ -2327,7 +2323,6 @@ declare const Address: z.ZodObject<{
2327
2323
  "dashboard.view": "dashboard.view";
2328
2324
  }>;
2329
2325
  $option: z.ZodEnum<{
2330
- role: "role";
2331
2326
  event: "event";
2332
2327
  placeOfEvent: "placeOfEvent";
2333
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, UserScopeV2 } from '../scopes';
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,28 +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
- ]);
303
- var UserScopeType = SystemScopeType.extract([
304
- "user.read",
305
- "user.create",
306
- "user.edit"
307
- ]);
308
- var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
309
- var UserScopeV2 = z6.discriminatedUnion("type", [
310
- z6.object({
311
- type: ScopesWithRoleOption,
312
- options: AllUserScopeOptions.optional()
313
- }),
314
- z6.object({
315
- type: UserScopeType.extract(["user.read"]),
316
- options: AccessLevelOptions.optional()
317
- })
318
- ]);
319
289
  var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
320
290
  z6.object({
321
291
  type: ScopesWithPlaceEventOptions,
@@ -336,14 +306,16 @@ var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
336
306
  }).optional()
337
307
  })
338
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
+ ]);
339
315
  var Scope2 = z6.discriminatedUnion("type", [
340
316
  z6.object({ type: PlainScopeType }),
341
317
  ...RecordScopeV2.options,
342
- ...UserScopeV2.options,
343
- z6.object({
344
- type: z6.literal("organisation.read-locations"),
345
- options: AccessLevelOptions.optional()
346
- }),
318
+ z6.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
347
319
  z6.object({
348
320
  type: z6.literal("workqueue"),
349
321
  options: WorkqueueOrDashboardOptions