@opencrvs/toolkit 1.8.0-rc.f8296f8 → 1.8.0-rc.f84146e

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 (32) hide show
  1. package/dist/commons/api/router.d.ts +2944 -1117
  2. package/dist/commons/conditionals/conditionals.d.ts +6 -2
  3. package/dist/commons/conditionals/validate.d.ts +6 -0
  4. package/dist/commons/events/ActionConfig.d.ts +24179 -11127
  5. package/dist/commons/events/ActionDocument.d.ts +1818 -414
  6. package/dist/commons/events/ActionInput.d.ts +1504 -304
  7. package/dist/commons/events/ActionType.d.ts +4 -0
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +75 -3
  9. package/dist/commons/events/CompositeFieldValue.d.ts +28 -0
  10. package/dist/commons/events/Constants.d.ts +1 -0
  11. package/dist/commons/events/CreatedAtLocation.d.ts +2 -1
  12. package/dist/commons/events/Draft.d.ts +129 -33
  13. package/dist/commons/events/EventConfig.d.ts +12161 -5927
  14. package/dist/commons/events/EventDocument.d.ts +1162 -298
  15. package/dist/commons/events/EventIndex.d.ts +284 -31
  16. package/dist/commons/events/EventMetadata.d.ts +57 -57
  17. package/dist/commons/events/FieldConfig.d.ts +2074 -1202
  18. package/dist/commons/events/FieldType.d.ts +4 -1
  19. package/dist/commons/events/FieldTypeMapping.d.ts +94 -52
  20. package/dist/commons/events/FieldValue.d.ts +43 -5
  21. package/dist/commons/events/FormConfig.d.ts +10259 -4769
  22. package/dist/commons/events/PageConfig.d.ts +3480 -2134
  23. package/dist/commons/events/SummaryConfig.d.ts +0 -5
  24. package/dist/commons/events/WorkqueueConfig.d.ts +297 -19
  25. package/dist/commons/events/defineConfig.d.ts +1724 -701
  26. package/dist/commons/events/field.d.ts +5 -10
  27. package/dist/commons/events/test.utils.d.ts +125 -40
  28. package/dist/commons/events/transactions.d.ts +1 -1
  29. package/dist/commons/events/utils.d.ts +10015 -331
  30. package/dist/conditionals/index.js +26 -6
  31. package/dist/events/index.js +760 -491
  32. package/package.json +1 -1
@@ -29,11 +29,6 @@ export declare const SummaryConfig: z.ZodObject<{
29
29
  description: string;
30
30
  defaultMessage: string;
31
31
  }>;
32
- emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
33
- id: string;
34
- description: string;
35
- defaultMessage: string;
36
- }>>;
37
32
  }>, "strip", z.ZodTypeAny, {
38
33
  id: string;
39
34
  value: TranslationConfig;
@@ -1,11 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  import { TranslationConfig } from './TranslationConfig';
3
- export declare const dateOfEventColumn: {
3
+ export declare const mandatoryColumns: {
4
4
  value: {
5
5
  $event: "type" | "id" | "status" | "title" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "updatedAt" | "trackingId" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags";
6
6
  };
7
7
  label: TranslationConfig;
8
8
  }[];
9
+ export declare const WorkqueueActionsWithDefault: z.ZodEnum<["DELETE", "DECLARE", "VALIDATE", "REGISTER", "PRINT_CERTIFICATE", "READ", "ASSIGN", "UNASSIGN", "DEFAULT"]>;
10
+ export type WorkqueueActionsWithDefault = z.infer<typeof WorkqueueActionsWithDefault>;
9
11
  /**
10
12
  * Configuration for workqueue. Workqueues are used to display a list of events.
11
13
  */
@@ -1118,13 +1120,13 @@ export declare const WorkqueueConfig: z.ZodObject<{
1118
1120
  }[];
1119
1121
  }>]>;
1120
1122
  actions: z.ZodArray<z.ZodObject<{
1121
- type: z.ZodString;
1123
+ type: z.ZodEnum<["DELETE", "DECLARE", "VALIDATE", "REGISTER", "PRINT_CERTIFICATE", "READ", "ASSIGN", "UNASSIGN", "DEFAULT"]>;
1122
1124
  conditionals: z.ZodOptional<z.ZodArray<z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>, "many">>;
1123
1125
  }, "strip", z.ZodTypeAny, {
1124
- type: string;
1126
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
1125
1127
  conditionals?: import(".").JSONSchema[] | undefined;
1126
1128
  }, {
1127
- type: string;
1129
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
1128
1130
  conditionals?: import(".").JSONSchema[] | undefined;
1129
1131
  }>, "many">;
1130
1132
  columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1159,7 +1161,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
1159
1161
  }, "strip", z.ZodTypeAny, {
1160
1162
  name: TranslationConfig;
1161
1163
  actions: {
1162
- type: string;
1164
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
1163
1165
  conditionals?: import(".").JSONSchema[] | undefined;
1164
1166
  }[];
1165
1167
  query: {
@@ -1338,7 +1340,7 @@ export declare const WorkqueueConfig: z.ZodObject<{
1338
1340
  defaultMessage: string;
1339
1341
  };
1340
1342
  actions: {
1341
- type: string;
1343
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
1342
1344
  conditionals?: import(".").JSONSchema[] | undefined;
1343
1345
  }[];
1344
1346
  query: {
@@ -3011,13 +3013,13 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
3011
3013
  }[];
3012
3014
  }>]>;
3013
3015
  actions: z.ZodArray<z.ZodObject<{
3014
- type: z.ZodString;
3016
+ type: z.ZodEnum<["DELETE", "DECLARE", "VALIDATE", "REGISTER", "PRINT_CERTIFICATE", "READ", "ASSIGN", "UNASSIGN", "DEFAULT"]>;
3015
3017
  conditionals: z.ZodOptional<z.ZodArray<z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>, "many">>;
3016
3018
  }, "strip", z.ZodTypeAny, {
3017
- type: string;
3019
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
3018
3020
  conditionals?: import(".").JSONSchema[] | undefined;
3019
3021
  }, {
3020
- type: string;
3022
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
3021
3023
  conditionals?: import(".").JSONSchema[] | undefined;
3022
3024
  }>, "many">;
3023
3025
  columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -3052,7 +3054,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
3052
3054
  }, "strip", z.ZodTypeAny, {
3053
3055
  name: TranslationConfig;
3054
3056
  actions: {
3055
- type: string;
3057
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
3056
3058
  conditionals?: import(".").JSONSchema[] | undefined;
3057
3059
  }[];
3058
3060
  query: {
@@ -3308,7 +3310,7 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
3308
3310
  defaultMessage: string;
3309
3311
  };
3310
3312
  actions: {
3311
- type: string;
3313
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
3312
3314
  conditionals?: import(".").JSONSchema[] | undefined;
3313
3315
  }[];
3314
3316
  query: {
@@ -3567,7 +3569,7 @@ export type WorkqueueConfigInput = z.input<typeof WorkqueueConfigInput>;
3567
3569
  export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
3568
3570
  name: TranslationConfig;
3569
3571
  actions: {
3570
- type: string;
3572
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
3571
3573
  conditionals?: import(".").JSONSchema[] | undefined;
3572
3574
  }[];
3573
3575
  query: {
@@ -3743,7 +3745,7 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
3743
3745
  export declare function defineWorkqueues(workqueues: WorkqueueConfigInput[]): {
3744
3746
  name: TranslationConfig;
3745
3747
  actions: {
3746
- type: string;
3748
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "PRINT_CERTIFICATE" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
3747
3749
  conditionals?: import(".").JSONSchema[] | undefined;
3748
3750
  }[];
3749
3751
  query: {
@@ -4026,6 +4028,16 @@ export declare const WorkqueueCountInput: z.ZodArray<z.ZodObject<{
4026
4028
  type: "exact";
4027
4029
  term: string;
4028
4030
  }>]>>>;
4031
+ 'legalStatus.REGISTERED.registrationNumber': z.ZodOptional<z.ZodOptional<z.ZodObject<{
4032
+ type: z.ZodLiteral<"exact">;
4033
+ term: z.ZodString;
4034
+ }, "strip", z.ZodTypeAny, {
4035
+ type: "exact";
4036
+ term: string;
4037
+ }, {
4038
+ type: "exact";
4039
+ term: string;
4040
+ }>>>;
4029
4041
  createdAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
4030
4042
  type: z.ZodLiteral<"within">;
4031
4043
  location: z.ZodString;
@@ -4202,6 +4214,10 @@ export declare const WorkqueueCountInput: z.ZodArray<z.ZodObject<{
4202
4214
  type: "within";
4203
4215
  location: string;
4204
4216
  } | undefined;
4217
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4218
+ type: "exact";
4219
+ term: string;
4220
+ } | undefined;
4205
4221
  }, {
4206
4222
  status?: {
4207
4223
  type: "exact";
@@ -4280,7 +4296,93 @@ export declare const WorkqueueCountInput: z.ZodArray<z.ZodObject<{
4280
4296
  type: "within";
4281
4297
  location: string;
4282
4298
  } | undefined;
4283
- }>, "many">, {
4299
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4300
+ type: "exact";
4301
+ term: string;
4302
+ } | undefined;
4303
+ }>, "atleastone">, [{
4304
+ status?: {
4305
+ type: "exact";
4306
+ term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
4307
+ } | {
4308
+ type: "anyOf";
4309
+ terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[];
4310
+ } | undefined;
4311
+ data?: any;
4312
+ createdAt?: {
4313
+ type: "exact";
4314
+ term: string;
4315
+ } | {
4316
+ type: "range";
4317
+ gte: string;
4318
+ lte: string;
4319
+ } | undefined;
4320
+ createdBy?: {
4321
+ type: "exact";
4322
+ term: string;
4323
+ } | undefined;
4324
+ createdAtLocation?: {
4325
+ type: "exact";
4326
+ term: string;
4327
+ } | {
4328
+ type: "within";
4329
+ location: string;
4330
+ } | undefined;
4331
+ assignedTo?: {
4332
+ type: "exact";
4333
+ term: string;
4334
+ } | undefined;
4335
+ updatedAt?: {
4336
+ type: "exact";
4337
+ term: string;
4338
+ } | {
4339
+ type: "range";
4340
+ gte: string;
4341
+ lte: string;
4342
+ } | undefined;
4343
+ trackingId?: {
4344
+ type: "exact";
4345
+ term: string;
4346
+ } | undefined;
4347
+ updatedAtLocation?: {
4348
+ type: "exact";
4349
+ term: string;
4350
+ } | {
4351
+ type: "within";
4352
+ location: string;
4353
+ } | undefined;
4354
+ updatedBy?: {
4355
+ type: "exact";
4356
+ term: string;
4357
+ } | undefined;
4358
+ flags?: ({
4359
+ type: "anyOf";
4360
+ terms: string[];
4361
+ } | {
4362
+ type: "not";
4363
+ term: string;
4364
+ })[] | undefined;
4365
+ eventType?: string | undefined;
4366
+ 'legalStatus.REGISTERED.createdAt'?: {
4367
+ type: "exact";
4368
+ term: string;
4369
+ } | {
4370
+ type: "range";
4371
+ gte: string;
4372
+ lte: string;
4373
+ } | undefined;
4374
+ 'legalStatus.REGISTERED.createdAtLocation'?: {
4375
+ type: "exact";
4376
+ term: string;
4377
+ } | {
4378
+ type: "within";
4379
+ location: string;
4380
+ } | undefined;
4381
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4382
+ type: "exact";
4383
+ term: string;
4384
+ } | undefined;
4385
+ }, ...{
4284
4386
  status?: {
4285
4387
  type: "exact";
4286
4388
  term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
@@ -4358,10 +4460,14 @@ export declare const WorkqueueCountInput: z.ZodArray<z.ZodObject<{
4358
4460
  type: "within";
4359
4461
  location: string;
4360
4462
  } | undefined;
4361
- }[], unknown>;
4463
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4464
+ type: "exact";
4465
+ term: string;
4466
+ } | undefined;
4467
+ }[]], unknown>;
4362
4468
  }, "strip", z.ZodTypeAny, {
4363
4469
  type: "and" | "or";
4364
- clauses: {
4470
+ clauses: [{
4365
4471
  status?: {
4366
4472
  type: "exact";
4367
4473
  term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
@@ -4439,7 +4545,93 @@ export declare const WorkqueueCountInput: z.ZodArray<z.ZodObject<{
4439
4545
  type: "within";
4440
4546
  location: string;
4441
4547
  } | undefined;
4442
- }[];
4548
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4549
+ type: "exact";
4550
+ term: string;
4551
+ } | undefined;
4552
+ }, ...{
4553
+ status?: {
4554
+ type: "exact";
4555
+ term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
4556
+ } | {
4557
+ type: "anyOf";
4558
+ terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[];
4559
+ } | undefined;
4560
+ data?: any;
4561
+ createdAt?: {
4562
+ type: "exact";
4563
+ term: string;
4564
+ } | {
4565
+ type: "range";
4566
+ gte: string;
4567
+ lte: string;
4568
+ } | undefined;
4569
+ createdBy?: {
4570
+ type: "exact";
4571
+ term: string;
4572
+ } | undefined;
4573
+ createdAtLocation?: {
4574
+ type: "exact";
4575
+ term: string;
4576
+ } | {
4577
+ type: "within";
4578
+ location: string;
4579
+ } | undefined;
4580
+ assignedTo?: {
4581
+ type: "exact";
4582
+ term: string;
4583
+ } | undefined;
4584
+ updatedAt?: {
4585
+ type: "exact";
4586
+ term: string;
4587
+ } | {
4588
+ type: "range";
4589
+ gte: string;
4590
+ lte: string;
4591
+ } | undefined;
4592
+ trackingId?: {
4593
+ type: "exact";
4594
+ term: string;
4595
+ } | undefined;
4596
+ updatedAtLocation?: {
4597
+ type: "exact";
4598
+ term: string;
4599
+ } | {
4600
+ type: "within";
4601
+ location: string;
4602
+ } | undefined;
4603
+ updatedBy?: {
4604
+ type: "exact";
4605
+ term: string;
4606
+ } | undefined;
4607
+ flags?: ({
4608
+ type: "anyOf";
4609
+ terms: string[];
4610
+ } | {
4611
+ type: "not";
4612
+ term: string;
4613
+ })[] | undefined;
4614
+ eventType?: string | undefined;
4615
+ 'legalStatus.REGISTERED.createdAt'?: {
4616
+ type: "exact";
4617
+ term: string;
4618
+ } | {
4619
+ type: "range";
4620
+ gte: string;
4621
+ lte: string;
4622
+ } | undefined;
4623
+ 'legalStatus.REGISTERED.createdAtLocation'?: {
4624
+ type: "exact";
4625
+ term: string;
4626
+ } | {
4627
+ type: "within";
4628
+ location: string;
4629
+ } | undefined;
4630
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4631
+ type: "exact";
4632
+ term: string;
4633
+ } | undefined;
4634
+ }[]];
4443
4635
  }, {
4444
4636
  type: "and" | "or";
4445
4637
  clauses?: unknown;
@@ -4447,7 +4639,7 @@ export declare const WorkqueueCountInput: z.ZodArray<z.ZodObject<{
4447
4639
  }, "strip", z.ZodTypeAny, {
4448
4640
  query: {
4449
4641
  type: "and" | "or";
4450
- clauses: {
4642
+ clauses: [{
4451
4643
  status?: {
4452
4644
  type: "exact";
4453
4645
  term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
@@ -4525,7 +4717,93 @@ export declare const WorkqueueCountInput: z.ZodArray<z.ZodObject<{
4525
4717
  type: "within";
4526
4718
  location: string;
4527
4719
  } | undefined;
4528
- }[];
4720
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4721
+ type: "exact";
4722
+ term: string;
4723
+ } | undefined;
4724
+ }, ...{
4725
+ status?: {
4726
+ type: "exact";
4727
+ term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED";
4728
+ } | {
4729
+ type: "anyOf";
4730
+ terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[];
4731
+ } | undefined;
4732
+ data?: any;
4733
+ createdAt?: {
4734
+ type: "exact";
4735
+ term: string;
4736
+ } | {
4737
+ type: "range";
4738
+ gte: string;
4739
+ lte: string;
4740
+ } | undefined;
4741
+ createdBy?: {
4742
+ type: "exact";
4743
+ term: string;
4744
+ } | undefined;
4745
+ createdAtLocation?: {
4746
+ type: "exact";
4747
+ term: string;
4748
+ } | {
4749
+ type: "within";
4750
+ location: string;
4751
+ } | undefined;
4752
+ assignedTo?: {
4753
+ type: "exact";
4754
+ term: string;
4755
+ } | undefined;
4756
+ updatedAt?: {
4757
+ type: "exact";
4758
+ term: string;
4759
+ } | {
4760
+ type: "range";
4761
+ gte: string;
4762
+ lte: string;
4763
+ } | undefined;
4764
+ trackingId?: {
4765
+ type: "exact";
4766
+ term: string;
4767
+ } | undefined;
4768
+ updatedAtLocation?: {
4769
+ type: "exact";
4770
+ term: string;
4771
+ } | {
4772
+ type: "within";
4773
+ location: string;
4774
+ } | undefined;
4775
+ updatedBy?: {
4776
+ type: "exact";
4777
+ term: string;
4778
+ } | undefined;
4779
+ flags?: ({
4780
+ type: "anyOf";
4781
+ terms: string[];
4782
+ } | {
4783
+ type: "not";
4784
+ term: string;
4785
+ })[] | undefined;
4786
+ eventType?: string | undefined;
4787
+ 'legalStatus.REGISTERED.createdAt'?: {
4788
+ type: "exact";
4789
+ term: string;
4790
+ } | {
4791
+ type: "range";
4792
+ gte: string;
4793
+ lte: string;
4794
+ } | undefined;
4795
+ 'legalStatus.REGISTERED.createdAtLocation'?: {
4796
+ type: "exact";
4797
+ term: string;
4798
+ } | {
4799
+ type: "within";
4800
+ location: string;
4801
+ } | undefined;
4802
+ 'legalStatus.REGISTERED.registrationNumber'?: {
4803
+ type: "exact";
4804
+ term: string;
4805
+ } | undefined;
4806
+ }[]];
4529
4807
  };
4530
4808
  slug: string;
4531
4809
  }, {