@opencrvs/toolkit 2.1.0-rc.d7bd264 → 2.1.0-rc.d876831

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 (52) hide show
  1. package/README.md +1 -0
  2. package/dist/application-config/index.js +30 -9
  3. package/dist/cli.js +174 -58
  4. package/dist/commons/api/router.d.ts +269 -11
  5. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  6. package/dist/commons/conditionals/validate.d.ts +9 -3
  7. package/dist/commons/events/ActionConfig.d.ts +0 -21
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
  9. package/dist/commons/events/AuditLog.d.ts +147 -0
  10. package/dist/commons/events/CountryConfigQueryInput.d.ts +0 -18
  11. package/dist/commons/events/EventConfig.d.ts +3 -0
  12. package/dist/commons/events/EventIndex.d.ts +2 -6
  13. package/dist/commons/events/EventMetadata.d.ts +0 -1
  14. package/dist/commons/events/FieldConfig.d.ts +65 -53
  15. package/dist/commons/events/FieldValue.d.ts +2 -2
  16. package/dist/commons/events/Flag.d.ts +0 -6
  17. package/dist/commons/events/PlainDate.d.ts +8 -0
  18. package/dist/commons/events/SummaryConfig.d.ts +249 -0
  19. package/dist/commons/events/WorkqueueConfig.d.ts +5 -17
  20. package/dist/commons/events/event.d.ts +12 -0
  21. package/dist/commons/events/index.d.ts +1 -0
  22. package/dist/commons/events/locationPayloads.d.ts +95 -0
  23. package/dist/commons/events/locations.d.ts +106 -16
  24. package/dist/commons/events/mocks.test.utils.d.ts +30 -0
  25. package/dist/conditionals/index.js +2 -2
  26. package/dist/environment/index.d.ts +1 -0
  27. package/dist/environment/index.d.ts.map +1 -1
  28. package/dist/environment/index.js +10 -0
  29. package/dist/environment/logger.d.ts +12 -3
  30. package/dist/environment/logger.d.ts.map +1 -1
  31. package/dist/environment/paths.d.ts +7 -0
  32. package/dist/environment/paths.d.ts.map +1 -0
  33. package/dist/environment/paths.js +72 -0
  34. package/dist/environment/setup-environment.js +2 -1
  35. package/dist/environment/templates.d.ts.map +1 -1
  36. package/dist/environment/templates.js +2 -1
  37. package/dist/environment/update-workflows.d.ts.map +1 -1
  38. package/dist/environment/update-workflows.js +17 -5
  39. package/dist/environment/upgrade.d.ts +2 -0
  40. package/dist/environment/upgrade.d.ts.map +1 -0
  41. package/dist/environment/upgrade.js +82 -0
  42. package/dist/environment/users.js +11 -13
  43. package/dist/events/index.js +502 -211
  44. package/dist/notification/index.js +529 -262
  45. package/dist/scopes/index.d.ts +28 -53
  46. package/dist/scopes/index.js +2 -2
  47. package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
  48. package/dist/templates/charts-values/opentelemetry/values.yaml +73 -0
  49. package/opencrvs-toolkit-2.1.0-rc.d876831.tgz +0 -0
  50. package/package.json +5 -4
  51. package/tsconfig.tsbuildinfo +1 -1
  52. package/opencrvs-toolkit-2.1.0-rc.d7bd264.tgz +0 -0
@@ -8242,6 +8242,135 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8242
8242
  responseSummary: {
8243
8243
  clientId: string;
8244
8244
  };
8245
+ } | {
8246
+ id: string;
8247
+ clientId: string;
8248
+ clientType: "system" | "user";
8249
+ createdAt: string;
8250
+ operation: "locations.create";
8251
+ requestData: {
8252
+ id: string;
8253
+ versionId: string;
8254
+ name: string;
8255
+ externalId?: string | null | undefined;
8256
+ effectiveFrom: string;
8257
+ status: string;
8258
+ administrativeAreaId?: string | null | undefined;
8259
+ locationType?: string | null | undefined;
8260
+ };
8261
+ } | {
8262
+ id: string;
8263
+ clientId: string;
8264
+ clientType: "system" | "user";
8265
+ createdAt: string;
8266
+ operation: "locations.update";
8267
+ requestData: {
8268
+ id: string;
8269
+ versionId: string;
8270
+ name: string;
8271
+ externalId?: string | null | undefined;
8272
+ status: string;
8273
+ effectiveFrom: string;
8274
+ lastVersionId: string;
8275
+ };
8276
+ responseSummary: {
8277
+ previousVersionId: string;
8278
+ versionId: string;
8279
+ changed: {
8280
+ name?: {
8281
+ from: string;
8282
+ to: string;
8283
+ } | undefined;
8284
+ externalId?: {
8285
+ from: string | null;
8286
+ to: string | null;
8287
+ } | undefined;
8288
+ status?: {
8289
+ from: string;
8290
+ to: string;
8291
+ } | undefined;
8292
+ };
8293
+ };
8294
+ } | {
8295
+ id: string;
8296
+ clientId: string;
8297
+ clientType: "system" | "user";
8298
+ createdAt: string;
8299
+ operation: "administrativeAreas.update";
8300
+ requestData: {
8301
+ id: string;
8302
+ versionId: string;
8303
+ name: string;
8304
+ externalId?: string | null | undefined;
8305
+ status: string;
8306
+ effectiveFrom: string;
8307
+ lastVersionId: string;
8308
+ };
8309
+ responseSummary: {
8310
+ previousVersionId: string;
8311
+ versionId: string;
8312
+ changed: {
8313
+ name?: {
8314
+ from: string;
8315
+ to: string;
8316
+ } | undefined;
8317
+ externalId?: {
8318
+ from: string | null;
8319
+ to: string | null;
8320
+ } | undefined;
8321
+ status?: {
8322
+ from: string;
8323
+ to: string;
8324
+ } | undefined;
8325
+ };
8326
+ };
8327
+ } | {
8328
+ id: string;
8329
+ clientId: string;
8330
+ clientType: "system" | "user";
8331
+ createdAt: string;
8332
+ operation: "locations.withdrawVersion";
8333
+ requestData: {
8334
+ id: string;
8335
+ versionId: string;
8336
+ };
8337
+ responseSummary: {
8338
+ effectiveFrom: string;
8339
+ name: string;
8340
+ externalId?: string | null | undefined;
8341
+ status: string;
8342
+ };
8343
+ } | {
8344
+ id: string;
8345
+ clientId: string;
8346
+ clientType: "system" | "user";
8347
+ createdAt: string;
8348
+ operation: "administrativeAreas.withdrawVersion";
8349
+ requestData: {
8350
+ id: string;
8351
+ versionId: string;
8352
+ };
8353
+ responseSummary: {
8354
+ effectiveFrom: string;
8355
+ name: string;
8356
+ externalId?: string | null | undefined;
8357
+ status: string;
8358
+ };
8359
+ } | {
8360
+ id: string;
8361
+ clientId: string;
8362
+ clientType: "system" | "user";
8363
+ createdAt: string;
8364
+ operation: "administrativeAreas.create";
8365
+ requestData: {
8366
+ id: string;
8367
+ versionId: string;
8368
+ name: string;
8369
+ externalId?: string | null | undefined;
8370
+ effectiveFrom: string;
8371
+ status: string;
8372
+ parentId?: string | null | undefined;
8373
+ };
8245
8374
  } | {
8246
8375
  id: string;
8247
8376
  clientId: string;
@@ -8363,16 +8492,82 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8363
8492
  }[];
8364
8493
  meta: object;
8365
8494
  }>;
8366
- set: import("@trpc/server").TRPCMutationProcedure<{
8495
+ create: import("@trpc/server").TRPCMutationProcedure<{
8367
8496
  input: {
8368
- id: string;
8497
+ id?: string | undefined;
8498
+ versionId?: string | undefined;
8369
8499
  name: string;
8370
8500
  externalId?: string | null | undefined;
8371
8501
  administrativeAreaId: string | null;
8372
8502
  locationType: string | null;
8373
- }[];
8374
- output: void;
8375
- meta: object;
8503
+ effectiveFrom?: string | undefined;
8504
+ status?: "active" | "inactive" | undefined;
8505
+ };
8506
+ output: {
8507
+ id: string & import("zod").$brand<"UUID">;
8508
+ name: string;
8509
+ externalId?: string | null | undefined;
8510
+ administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
8511
+ locationType: string | null;
8512
+ status: "active" | "inactive";
8513
+ versions: {
8514
+ versionId: string & import("zod").$brand<"UUID">;
8515
+ effectiveFrom: string;
8516
+ name: string;
8517
+ externalId?: string | null | undefined;
8518
+ status: "active" | "inactive";
8519
+ }[];
8520
+ };
8521
+ meta: import("trpc-to-openapi").OpenApiMeta;
8522
+ }>;
8523
+ update: import("@trpc/server").TRPCMutationProcedure<{
8524
+ input: {
8525
+ id: string;
8526
+ versionId?: string | undefined;
8527
+ name: string;
8528
+ externalId?: string | null | undefined;
8529
+ status: "active" | "inactive";
8530
+ effectiveFrom?: string | undefined;
8531
+ lastVersionId: string;
8532
+ };
8533
+ output: {
8534
+ id: string & import("zod").$brand<"UUID">;
8535
+ name: string;
8536
+ externalId?: string | null | undefined;
8537
+ administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
8538
+ locationType: string | null;
8539
+ status: "active" | "inactive";
8540
+ versions: {
8541
+ versionId: string & import("zod").$brand<"UUID">;
8542
+ effectiveFrom: string;
8543
+ name: string;
8544
+ externalId?: string | null | undefined;
8545
+ status: "active" | "inactive";
8546
+ }[];
8547
+ };
8548
+ meta: import("trpc-to-openapi").OpenApiMeta;
8549
+ }>;
8550
+ withdrawVersion: import("@trpc/server").TRPCMutationProcedure<{
8551
+ input: {
8552
+ id: string;
8553
+ versionId: string;
8554
+ };
8555
+ output: {
8556
+ id: string & import("zod").$brand<"UUID">;
8557
+ name: string;
8558
+ externalId?: string | null | undefined;
8559
+ administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
8560
+ locationType: string | null;
8561
+ status: "active" | "inactive";
8562
+ versions: {
8563
+ versionId: string & import("zod").$brand<"UUID">;
8564
+ effectiveFrom: string;
8565
+ name: string;
8566
+ externalId?: string | null | undefined;
8567
+ status: "active" | "inactive";
8568
+ }[];
8569
+ };
8570
+ meta: import("trpc-to-openapi").OpenApiMeta;
8376
8571
  }>;
8377
8572
  get: import("@trpc/server").TRPCQueryProcedure<{
8378
8573
  input: {
@@ -8748,7 +8943,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8748
8943
  $event: "assignedTo" | "createdAt" | "createdAtLocation" | "createdBy" | "createdByUserType" | "dateOfEvent" | "flags" | "id" | "legalStatuses" | "outbox" | "placeOfEvent" | "status" | "title" | "trackingId" | "type" | "updatedAt" | "updatedAtLocation" | "updatedBy" | "updatedByUserRole";
8749
8944
  };
8750
8945
  }[];
8751
- icon: "Activity" | "Archive" | "ArchiveBox" | "ArchiveTray" | "Archived" | "ArrowCircleDown" | "ArrowCounterClockwise" | "ArrowLeft" | "ArrowRight" | "Assigned" | "Briefcase" | "Buildings" | "CaretDown" | "CaretLeft" | "CaretRight" | "Certified" | "ChartActivity" | "ChartBar" | "ChartLine" | "ChatCircle" | "ChatText" | "Check" | "CheckSquare" | "Circle" | "CircleWavyCheck" | "CircleWavyQuestion" | "Clock" | "Close" | "Collapse" | "Compass" | "Copy" | "Database" | "DeviceTabletCamera" | "DotsThreeVertical" | "Draft" | "DuplicateYellow" | "Envelope" | "Expand" | "Export" | "ExternalValidate" | "Eye" | "EyeSlash" | "File" | "FileArrowUp" | "FileDotted" | "FileMinus" | "FilePlus" | "FileSearch" | "FileText" | "FileX" | "Files" | "FilledCheck" | "Fingerprint" | "Gear" | "GitBranch" | "Globe" | "Handshake" | "IdentificationCard" | "InReview" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "MapPin" | "Medal" | "NotePencil" | "Offline" | "PaperPlaneTilt" | "Paperclip" | "Pen" | "PenNib" | "Pencil" | "PencilCircle" | "PencilLine" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "PushPin" | "QrCode" | "Registered" | "RequiresUpdates" | "Sent" | "SignOut" | "Stamp" | "Star" | "Sun" | "Target" | "TextT" | "Timer" | "Trash" | "UploadSimple" | "User" | "UserCircle" | "UserPlus" | "Users" | "Validated" | "WaitingApproval" | "WarningCircle" | "Webcam" | "X";
8946
+ icon: "Activity" | "Archive" | "ArchiveBox" | "ArchiveTray" | "Archived" | "ArrowCircleDown" | "ArrowCounterClockwise" | "ArrowLeft" | "ArrowRight" | "Assigned" | "Briefcase" | "Buildings" | "CaretDown" | "CaretLeft" | "CaretRight" | "Certified" | "ChartActivity" | "ChartBar" | "ChartLine" | "ChatCircle" | "ChatText" | "Check" | "CheckSquare" | "Circle" | "CircleWavyCheck" | "CircleWavyQuestion" | "Clock" | "Close" | "Collapse" | "Compass" | "Copy" | "Database" | "DeviceTabletCamera" | "DotsThreeVertical" | "Draft" | "DuplicateYellow" | "Envelope" | "Expand" | "Export" | "ExternalValidate" | "Eye" | "EyeSlash" | "File" | "FileArrowUp" | "FileDotted" | "FileLock" | "FileMinus" | "FilePlus" | "FileSearch" | "FileText" | "FileX" | "Files" | "FilledCheck" | "Fingerprint" | "Gear" | "GitBranch" | "Globe" | "Handshake" | "IdentificationCard" | "InReview" | "List" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "MapPin" | "Medal" | "NotePencil" | "Offline" | "PaperPlaneTilt" | "Paperclip" | "Pen" | "PenNib" | "Pencil" | "PencilCircle" | "PencilLine" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "PushPin" | "QrCode" | "Registered" | "RequiresUpdates" | "Sent" | "SignOut" | "Stamp" | "Star" | "Sun" | "Target" | "TextT" | "Timer" | "Trash" | "UploadSimple" | "User" | "UserCircle" | "UserPlus" | "Users" | "Validated" | "WaitingApproval" | "WarningCircle" | "Webcam" | "X";
8752
8947
  emptyMessage?: {
8753
8948
  id: string;
8754
8949
  defaultMessage: string;
@@ -8810,15 +9005,78 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8810
9005
  }[];
8811
9006
  meta: import("trpc-to-openapi").OpenApiMeta;
8812
9007
  }>;
8813
- set: import("@trpc/server").TRPCMutationProcedure<{
9008
+ create: import("@trpc/server").TRPCMutationProcedure<{
8814
9009
  input: {
8815
- id: string;
9010
+ id?: string | undefined;
9011
+ versionId?: string | undefined;
8816
9012
  name: string;
8817
9013
  externalId?: string | null | undefined;
8818
9014
  parentId: string | null;
8819
- }[];
8820
- output: void;
8821
- meta: object;
9015
+ effectiveFrom?: string | undefined;
9016
+ status?: "active" | "inactive" | undefined;
9017
+ };
9018
+ output: {
9019
+ id: string & import("zod").$brand<"UUID">;
9020
+ name: string;
9021
+ externalId?: string | null | undefined;
9022
+ parentId: (string & import("zod").$brand<"UUID">) | null;
9023
+ status: "active" | "inactive";
9024
+ versions: {
9025
+ versionId: string & import("zod").$brand<"UUID">;
9026
+ effectiveFrom: string;
9027
+ name: string;
9028
+ externalId?: string | null | undefined;
9029
+ status: "active" | "inactive";
9030
+ }[];
9031
+ };
9032
+ meta: import("trpc-to-openapi").OpenApiMeta;
9033
+ }>;
9034
+ update: import("@trpc/server").TRPCMutationProcedure<{
9035
+ input: {
9036
+ id: string;
9037
+ versionId?: string | undefined;
9038
+ name: string;
9039
+ externalId?: string | null | undefined;
9040
+ status: "active" | "inactive";
9041
+ effectiveFrom?: string | undefined;
9042
+ lastVersionId: string;
9043
+ };
9044
+ output: {
9045
+ id: string & import("zod").$brand<"UUID">;
9046
+ name: string;
9047
+ externalId?: string | null | undefined;
9048
+ parentId: (string & import("zod").$brand<"UUID">) | null;
9049
+ status: "active" | "inactive";
9050
+ versions: {
9051
+ versionId: string & import("zod").$brand<"UUID">;
9052
+ effectiveFrom: string;
9053
+ name: string;
9054
+ externalId?: string | null | undefined;
9055
+ status: "active" | "inactive";
9056
+ }[];
9057
+ };
9058
+ meta: import("trpc-to-openapi").OpenApiMeta;
9059
+ }>;
9060
+ withdrawVersion: import("@trpc/server").TRPCMutationProcedure<{
9061
+ input: {
9062
+ id: string;
9063
+ versionId: string;
9064
+ };
9065
+ output: {
9066
+ id: string & import("zod").$brand<"UUID">;
9067
+ name: string;
9068
+ externalId?: string | null | undefined;
9069
+ parentId: (string & import("zod").$brand<"UUID">) | null;
9070
+ status: "active" | "inactive";
9071
+ versions: {
9072
+ versionId: string & import("zod").$brand<"UUID">;
9073
+ effectiveFrom: string;
9074
+ name: string;
9075
+ externalId?: string | null | undefined;
9076
+ status: "active" | "inactive";
9077
+ }[];
9078
+ };
9079
+ meta: import("trpc-to-openapi").OpenApiMeta;
8822
9080
  }>;
8823
9081
  }>>;
8824
9082
  integrations: import("@trpc/server").TRPCBuiltRouter<{
@@ -85,16 +85,16 @@ export declare const now: typeof todayDateTimeValueSerializer;
85
85
  export declare const user: typeof userSerializer & {
86
86
  scope: (scope: import("../scopes").ScopeType) => {
87
87
  attribute: (option: import("../scopes").ScopeOptionKey) => {
88
- $scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.create" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.archive" | "record.confirm-registration" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reject" | "record.reject-registration" | "record.request-correction" | "record.review-duplicates" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
88
+ $scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.create" | "location.edit" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.archive" | "record.confirm-registration" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reject" | "record.reject-registration" | "record.request-correction" | "record.review-duplicates" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
89
89
  $option: "accessLevel" | "declaredBy" | "declaredIn" | "event" | "flags" | "ids" | "notifiedBy" | "notifiedIn" | "placeOfEvent" | "registeredBy" | "registeredIn" | "role";
90
90
  };
91
91
  };
92
92
  jurisdiction: (jurisdiction: import("../scopes").JurisdictionFilter | {
93
- $scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.create" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.archive" | "record.confirm-registration" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reject" | "record.reject-registration" | "record.request-correction" | "record.review-duplicates" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
93
+ $scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.create" | "location.edit" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.archive" | "record.confirm-registration" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reject" | "record.reject-registration" | "record.request-correction" | "record.review-duplicates" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
94
94
  $option: "accessLevel" | "declaredBy" | "declaredIn" | "event" | "flags" | "ids" | "notifiedBy" | "notifiedIn" | "placeOfEvent" | "registeredBy" | "registeredIn" | "role";
95
95
  }) => {
96
96
  $jurisdiction: "administrativeArea" | "all" | "location" | {
97
- $scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.create" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.archive" | "record.confirm-registration" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reject" | "record.reject-registration" | "record.request-correction" | "record.review-duplicates" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
97
+ $scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.create" | "location.edit" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.archive" | "record.confirm-registration" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reject" | "record.reject-registration" | "record.request-correction" | "record.review-duplicates" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
98
98
  $option: "accessLevel" | "declaredBy" | "declaredIn" | "event" | "flags" | "ids" | "notifiedBy" | "notifiedIn" | "placeOfEvent" | "registeredBy" | "registeredIn" | "role";
99
99
  };
100
100
  };
@@ -2,7 +2,7 @@ import { ConditionalParameters, JSONSchema } from './conditionals';
2
2
  import { ActionUpdate, EventState } from '../events/ActionDocument';
3
3
  import { FieldConditional } from '../events/Conditional';
4
4
  import { FieldConfig } from '../events/FieldConfig';
5
- import { FieldUpdateValue, FieldValue } from '../events/FieldValue';
5
+ import { PlainDate, FieldUpdateValue, FieldValue } from '../events/FieldValue';
6
6
  import { TranslationConfig } from '../events/TranslationConfig';
7
7
  import { ITokenPayload } from '../authentication';
8
8
  import { UUID } from '../uuid';
@@ -14,8 +14,8 @@ import { EventDocument } from '../events/EventDocument';
14
14
  import { EventIndex } from '../events/EventIndex';
15
15
  import { Location } from '../events/locations';
16
16
  import { SystemVariables } from '../events/TemplateConfig';
17
- /** Returns today's date as an ISO date string (YYYY-MM-DD). */
18
- export declare function todayISO(): string;
17
+ /** Returns today's date as a {@link PlainDate} (YYYY-MM-DD), device-local. */
18
+ export declare function todayISO(): PlainDate;
19
19
  /**
20
20
  * Context passed to every serialised client-side function ({@link runClientFunction}).
21
21
  *
@@ -70,6 +70,12 @@ export declare function validateValue(schema: JSONSchema, data: unknown): boolea
70
70
  export declare function isOnline(): boolean;
71
71
  export declare function isConditionMet(conditional: JSONSchema, values: EventState | ActionUpdate, context: ValidatorContext): boolean;
72
72
  export declare function areConditionsMet(conditions: FieldConditional[], values: Record<string, FieldValue>, context: ValidatorContext, event: EventIndex): boolean;
73
+ /**
74
+ * Given a field's `secured` property (a boolean, or a JSONSchema conditional
75
+ * evaluated against the event, e.g. `flag('sealed')`), returns whether the
76
+ * field is currently secured for the given event.
77
+ */
78
+ export declare function isFieldSecured(field: Pick<FieldConfig, 'secured'>, event: EventIndex, context?: ValidatorContext): boolean;
73
79
  export type ValidatorContext = {
74
80
  user?: ITokenPayload;
75
81
  leafAdminStructureLocationIds?: Array<{
@@ -13,7 +13,6 @@ export declare const ActionConfigBase: z.ZodObject<{
13
13
  readonly CORRECTION_REQUESTED: 'correction-requested';
14
14
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
15
15
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
16
- readonly SEALED: 'sealed';
17
16
  }>]>, z.ZodString]>;
18
17
  operation: z.ZodEnum<{
19
18
  add: "add";
@@ -40,7 +39,6 @@ declare const CustomActionConfig: z.ZodObject<{
40
39
  readonly CORRECTION_REQUESTED: 'correction-requested';
41
40
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
42
41
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
43
- readonly SEALED: 'sealed';
44
42
  }>]>, z.ZodString]>;
45
43
  operation: z.ZodEnum<{
46
44
  add: "add";
@@ -72,7 +70,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
72
70
  readonly CORRECTION_REQUESTED: 'correction-requested';
73
71
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
74
72
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
75
- readonly SEALED: 'sealed';
76
73
  }>]>, z.ZodString]>;
77
74
  operation: z.ZodEnum<{
78
75
  add: "add";
@@ -123,7 +120,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
123
120
  readonly CORRECTION_REQUESTED: 'correction-requested';
124
121
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
125
122
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
126
- readonly SEALED: 'sealed';
127
123
  }>]>, z.ZodString]>;
128
124
  operation: z.ZodEnum<{
129
125
  add: "add";
@@ -150,7 +146,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
150
146
  readonly CORRECTION_REQUESTED: 'correction-requested';
151
147
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
152
148
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
153
- readonly SEALED: 'sealed';
154
149
  }>]>, z.ZodString]>;
155
150
  operation: z.ZodEnum<{
156
151
  add: "add";
@@ -178,7 +173,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
178
173
  readonly CORRECTION_REQUESTED: 'correction-requested';
179
174
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
180
175
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
181
- readonly SEALED: 'sealed';
182
176
  }>]>, z.ZodString]>;
183
177
  operation: z.ZodEnum<{
184
178
  add: "add";
@@ -219,7 +213,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
219
213
  readonly CORRECTION_REQUESTED: 'correction-requested';
220
214
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
221
215
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
222
- readonly SEALED: 'sealed';
223
216
  }>]>, z.ZodString]>;
224
217
  operation: z.ZodEnum<{
225
218
  add: "add";
@@ -241,7 +234,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
241
234
  readonly CORRECTION_REQUESTED: 'correction-requested';
242
235
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
243
236
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
244
- readonly SEALED: 'sealed';
245
237
  }>]>, z.ZodString]>;
246
238
  operation: z.ZodEnum<{
247
239
  add: "add";
@@ -268,7 +260,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
268
260
  readonly CORRECTION_REQUESTED: 'correction-requested';
269
261
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
270
262
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
271
- readonly SEALED: 'sealed';
272
263
  }>]>, z.ZodString]>;
273
264
  operation: z.ZodEnum<{
274
265
  add: "add";
@@ -295,7 +286,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
295
286
  readonly CORRECTION_REQUESTED: 'correction-requested';
296
287
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
297
288
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
298
- readonly SEALED: 'sealed';
299
289
  }>]>, z.ZodString]>;
300
290
  operation: z.ZodEnum<{
301
291
  add: "add";
@@ -323,7 +313,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
323
313
  readonly CORRECTION_REQUESTED: 'correction-requested';
324
314
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
325
315
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
326
- readonly SEALED: 'sealed';
327
316
  }>]>, z.ZodString]>;
328
317
  operation: z.ZodEnum<{
329
318
  add: "add";
@@ -356,7 +345,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
356
345
  readonly CORRECTION_REQUESTED: 'correction-requested';
357
346
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
358
347
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
359
- readonly SEALED: 'sealed';
360
348
  }>]>, z.ZodString]>;
361
349
  operation: z.ZodEnum<{
362
350
  add: "add";
@@ -413,7 +401,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
413
401
  readonly CORRECTION_REQUESTED: 'correction-requested';
414
402
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
415
403
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
416
- readonly SEALED: 'sealed';
417
404
  }>]>, z.ZodString]>;
418
405
  operation: z.ZodEnum<{
419
406
  add: "add";
@@ -470,7 +457,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
470
457
  readonly CORRECTION_REQUESTED: 'correction-requested';
471
458
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
472
459
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
473
- readonly SEALED: 'sealed';
474
460
  }>]>, z.ZodString]>;
475
461
  operation: z.ZodEnum<{
476
462
  add: "add";
@@ -497,7 +483,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
497
483
  readonly CORRECTION_REQUESTED: 'correction-requested';
498
484
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
499
485
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
500
- readonly SEALED: 'sealed';
501
486
  }>]>, z.ZodString]>;
502
487
  operation: z.ZodEnum<{
503
488
  add: "add";
@@ -524,7 +509,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
524
509
  readonly CORRECTION_REQUESTED: 'correction-requested';
525
510
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
526
511
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
527
- readonly SEALED: 'sealed';
528
512
  }>]>, z.ZodString]>;
529
513
  operation: z.ZodEnum<{
530
514
  add: "add";
@@ -556,7 +540,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
556
540
  readonly CORRECTION_REQUESTED: 'correction-requested';
557
541
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
558
542
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
559
- readonly SEALED: 'sealed';
560
543
  }>]>, z.ZodString]>;
561
544
  operation: z.ZodEnum<{
562
545
  add: "add";
@@ -584,7 +567,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
584
567
  readonly CORRECTION_REQUESTED: 'correction-requested';
585
568
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
586
569
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
587
- readonly SEALED: 'sealed';
588
570
  }>]>, z.ZodString]>;
589
571
  operation: z.ZodEnum<{
590
572
  add: "add";
@@ -611,7 +593,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
611
593
  readonly CORRECTION_REQUESTED: 'correction-requested';
612
594
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
613
595
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
614
- readonly SEALED: 'sealed';
615
596
  }>]>, z.ZodString]>;
616
597
  operation: z.ZodEnum<{
617
598
  add: "add";
@@ -653,7 +634,6 @@ export declare const DeclarationActionConfig: z.ZodDiscriminatedUnion<[z.ZodObje
653
634
  readonly CORRECTION_REQUESTED: 'correction-requested';
654
635
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
655
636
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
656
- readonly SEALED: 'sealed';
657
637
  }>]>, z.ZodString]>;
658
638
  operation: z.ZodEnum<{
659
639
  add: "add";
@@ -695,7 +675,6 @@ export declare const DeclarationActionConfig: z.ZodDiscriminatedUnion<[z.ZodObje
695
675
  readonly CORRECTION_REQUESTED: 'correction-requested';
696
676
  readonly POTENTIAL_DUPLICATE: 'potential-duplicate';
697
677
  readonly EDIT_IN_PROGRESS: 'edit-in-progress';
698
- readonly SEALED: 'sealed';
699
678
  }>]>, z.ZodString]>;
700
679
  operation: z.ZodEnum<{
701
680
  add: "add";
@@ -103,6 +103,7 @@ export declare const FieldConfigSchema: z.ZodObject<{
103
103
  "config.update-all": "config.update-all";
104
104
  "dashboard.view": "dashboard.view";
105
105
  "integration.create": "integration.create";
106
+ "location.edit": "location.edit";
106
107
  "organisation.read-locations": "organisation.read-locations";
107
108
  "performance.read": "performance.read";
108
109
  "performance.read-dashboards": "performance.read-dashboards";
@@ -284,6 +285,7 @@ export declare const EventFieldConfigSchema: z.ZodObject<{
284
285
  "config.update-all": "config.update-all";
285
286
  "dashboard.view": "dashboard.view";
286
287
  "integration.create": "integration.create";
288
+ "location.edit": "location.edit";
287
289
  "organisation.read-locations": "organisation.read-locations";
288
290
  "performance.read": "performance.read";
289
291
  "performance.read-dashboards": "performance.read-dashboards";
@@ -441,6 +443,7 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
441
443
  "config.update-all": "config.update-all";
442
444
  "dashboard.view": "dashboard.view";
443
445
  "integration.create": "integration.create";
446
+ "location.edit": "location.edit";
444
447
  "organisation.read-locations": "organisation.read-locations";
445
448
  "performance.read": "performance.read";
446
449
  "performance.read-dashboards": "performance.read-dashboards";
@@ -590,6 +593,7 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
590
593
  "config.update-all": "config.update-all";
591
594
  "dashboard.view": "dashboard.view";
592
595
  "integration.create": "integration.create";
596
+ "location.edit": "location.edit";
593
597
  "organisation.read-locations": "organisation.read-locations";
594
598
  "performance.read": "performance.read";
595
599
  "performance.read-dashboards": "performance.read-dashboards";
@@ -750,6 +754,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
750
754
  "config.update-all": "config.update-all";
751
755
  "dashboard.view": "dashboard.view";
752
756
  "integration.create": "integration.create";
757
+ "location.edit": "location.edit";
753
758
  "organisation.read-locations": "organisation.read-locations";
754
759
  "performance.read": "performance.read";
755
760
  "performance.read-dashboards": "performance.read-dashboards";
@@ -899,6 +904,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
899
904
  "config.update-all": "config.update-all";
900
905
  "dashboard.view": "dashboard.view";
901
906
  "integration.create": "integration.create";
907
+ "location.edit": "location.edit";
902
908
  "organisation.read-locations": "organisation.read-locations";
903
909
  "performance.read": "performance.read";
904
910
  "performance.read-dashboards": "performance.read-dashboards";