@opencrvs/toolkit 1.8.1-rc.651c27c → 1.8.1-rc.7900702
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/commons/api/router.d.ts +24 -0
- package/dist/commons/events/ActionDocument.d.ts +36 -0
- package/dist/commons/events/ActionInput.d.ts +36 -0
- package/dist/commons/events/EventDocument.d.ts +26 -0
- package/dist/commons/events/test.utils.d.ts +5 -1
- package/dist/events/index.js +9 -5
- package/package.json +1 -1
@@ -1418,6 +1418,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
1418
1418
|
type: "REJECT_CORRECTION";
|
1419
1419
|
id: string & import("zod").BRAND<"UUID">;
|
1420
1420
|
status: "Rejected" | "Requested" | "Accepted";
|
1421
|
+
reason: {
|
1422
|
+
message: string;
|
1423
|
+
isDuplicate?: boolean | undefined;
|
1424
|
+
};
|
1421
1425
|
transactionId: string;
|
1422
1426
|
createdByUserType: "system" | "user";
|
1423
1427
|
createdAt: string;
|
@@ -2984,6 +2988,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
2984
2988
|
type: "REJECT_CORRECTION";
|
2985
2989
|
id: string & import("zod").BRAND<"UUID">;
|
2986
2990
|
status: "Rejected" | "Requested" | "Accepted";
|
2991
|
+
reason: {
|
2992
|
+
message: string;
|
2993
|
+
isDuplicate?: boolean | undefined;
|
2994
|
+
};
|
2987
2995
|
transactionId: string;
|
2988
2996
|
createdByUserType: "system" | "user";
|
2989
2997
|
createdAt: string;
|
@@ -5342,6 +5350,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
5342
5350
|
type: "REJECT_CORRECTION";
|
5343
5351
|
id: string & import("zod").BRAND<"UUID">;
|
5344
5352
|
status: "Rejected" | "Requested" | "Accepted";
|
5353
|
+
reason: {
|
5354
|
+
message: string;
|
5355
|
+
isDuplicate?: boolean | undefined;
|
5356
|
+
};
|
5345
5357
|
transactionId: string;
|
5346
5358
|
createdByUserType: "system" | "user";
|
5347
5359
|
createdAt: string;
|
@@ -7005,6 +7017,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
7005
7017
|
type: "REJECT_CORRECTION";
|
7006
7018
|
id: string & import("zod").BRAND<"UUID">;
|
7007
7019
|
status: "Rejected" | "Requested" | "Accepted";
|
7020
|
+
reason: {
|
7021
|
+
message: string;
|
7022
|
+
isDuplicate?: boolean | undefined;
|
7023
|
+
};
|
7008
7024
|
transactionId: string;
|
7009
7025
|
createdByUserType: "system" | "user";
|
7010
7026
|
createdAt: string;
|
@@ -8910,6 +8926,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
8910
8926
|
type: "REJECT_CORRECTION";
|
8911
8927
|
id: string;
|
8912
8928
|
status: "Rejected" | "Requested" | "Accepted";
|
8929
|
+
reason: {
|
8930
|
+
message: string;
|
8931
|
+
isDuplicate?: boolean | undefined;
|
8932
|
+
};
|
8913
8933
|
transactionId: string;
|
8914
8934
|
createdByUserType: "system" | "user";
|
8915
8935
|
createdAt: string;
|
@@ -10472,6 +10492,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
10472
10492
|
type: "REJECT_CORRECTION";
|
10473
10493
|
id: string & import("zod").BRAND<"UUID">;
|
10474
10494
|
status: "Rejected" | "Requested" | "Accepted";
|
10495
|
+
reason: {
|
10496
|
+
message: string;
|
10497
|
+
isDuplicate?: boolean | undefined;
|
10498
|
+
};
|
10475
10499
|
transactionId: string;
|
10476
10500
|
createdByUserType: "system" | "user";
|
10477
10501
|
createdAt: string;
|
@@ -7945,10 +7945,24 @@ export declare const ActionDocument: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
7945
7945
|
}, {
|
7946
7946
|
type: z.ZodLiteral<"REJECT_CORRECTION">;
|
7947
7947
|
requestId: z.ZodString;
|
7948
|
+
reason: z.ZodObject<{
|
7949
|
+
message: z.ZodString;
|
7950
|
+
isDuplicate: z.ZodOptional<z.ZodBoolean>;
|
7951
|
+
}, "strip", z.ZodTypeAny, {
|
7952
|
+
message: string;
|
7953
|
+
isDuplicate?: boolean | undefined;
|
7954
|
+
}, {
|
7955
|
+
message: string;
|
7956
|
+
isDuplicate?: boolean | undefined;
|
7957
|
+
}>;
|
7948
7958
|
}>, "strip", z.ZodTypeAny, {
|
7949
7959
|
type: "REJECT_CORRECTION";
|
7950
7960
|
id: string & z.BRAND<"UUID">;
|
7951
7961
|
status: "Rejected" | "Requested" | "Accepted";
|
7962
|
+
reason: {
|
7963
|
+
message: string;
|
7964
|
+
isDuplicate?: boolean | undefined;
|
7965
|
+
};
|
7952
7966
|
transactionId: string;
|
7953
7967
|
createdByUserType: "system" | "user";
|
7954
7968
|
createdAt: string;
|
@@ -8052,6 +8066,10 @@ export declare const ActionDocument: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
8052
8066
|
type: "REJECT_CORRECTION";
|
8053
8067
|
id: string;
|
8054
8068
|
status: "Rejected" | "Requested" | "Accepted";
|
8069
|
+
reason: {
|
8070
|
+
message: string;
|
8071
|
+
isDuplicate?: boolean | undefined;
|
8072
|
+
};
|
8055
8073
|
transactionId: string;
|
8056
8074
|
createdByUserType: "system" | "user";
|
8057
8075
|
createdAt: string;
|
@@ -15610,10 +15628,24 @@ export declare const Action: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
15610
15628
|
}, {
|
15611
15629
|
type: z.ZodLiteral<"REJECT_CORRECTION">;
|
15612
15630
|
requestId: z.ZodString;
|
15631
|
+
reason: z.ZodObject<{
|
15632
|
+
message: z.ZodString;
|
15633
|
+
isDuplicate: z.ZodOptional<z.ZodBoolean>;
|
15634
|
+
}, "strip", z.ZodTypeAny, {
|
15635
|
+
message: string;
|
15636
|
+
isDuplicate?: boolean | undefined;
|
15637
|
+
}, {
|
15638
|
+
message: string;
|
15639
|
+
isDuplicate?: boolean | undefined;
|
15640
|
+
}>;
|
15613
15641
|
}>, "strip", z.ZodTypeAny, {
|
15614
15642
|
type: "REJECT_CORRECTION";
|
15615
15643
|
id: string & z.BRAND<"UUID">;
|
15616
15644
|
status: "Rejected" | "Requested" | "Accepted";
|
15645
|
+
reason: {
|
15646
|
+
message: string;
|
15647
|
+
isDuplicate?: boolean | undefined;
|
15648
|
+
};
|
15617
15649
|
transactionId: string;
|
15618
15650
|
createdByUserType: "system" | "user";
|
15619
15651
|
createdAt: string;
|
@@ -15717,6 +15749,10 @@ export declare const Action: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
15717
15749
|
type: "REJECT_CORRECTION";
|
15718
15750
|
id: string;
|
15719
15751
|
status: "Rejected" | "Requested" | "Accepted";
|
15752
|
+
reason: {
|
15753
|
+
message: string;
|
15754
|
+
isDuplicate?: boolean | undefined;
|
15755
|
+
};
|
15720
15756
|
transactionId: string;
|
15721
15757
|
createdByUserType: "system" | "user";
|
15722
15758
|
createdAt: string;
|
@@ -5971,8 +5971,22 @@ export declare const RejectCorrectionActionInput: z.ZodObject<z.objectUtil.exten
|
|
5971
5971
|
}, {
|
5972
5972
|
requestId: z.ZodString;
|
5973
5973
|
type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
|
5974
|
+
reason: z.ZodObject<{
|
5975
|
+
message: z.ZodString;
|
5976
|
+
isDuplicate: z.ZodOptional<z.ZodBoolean>;
|
5977
|
+
}, "strip", z.ZodTypeAny, {
|
5978
|
+
message: string;
|
5979
|
+
isDuplicate?: boolean | undefined;
|
5980
|
+
}, {
|
5981
|
+
message: string;
|
5982
|
+
isDuplicate?: boolean | undefined;
|
5983
|
+
}>;
|
5974
5984
|
}>, "strip", z.ZodTypeAny, {
|
5975
5985
|
type: "REJECT_CORRECTION";
|
5986
|
+
reason: {
|
5987
|
+
message: string;
|
5988
|
+
isDuplicate?: boolean | undefined;
|
5989
|
+
};
|
5976
5990
|
transactionId: string;
|
5977
5991
|
declaration: Record<string, string | number | boolean | {
|
5978
5992
|
type: string;
|
@@ -6069,6 +6083,10 @@ export declare const RejectCorrectionActionInput: z.ZodObject<z.objectUtil.exten
|
|
6069
6083
|
originalActionId?: (string & z.BRAND<"UUID">) | undefined;
|
6070
6084
|
keepAssignment?: boolean | undefined;
|
6071
6085
|
}, {
|
6086
|
+
reason: {
|
6087
|
+
message: string;
|
6088
|
+
isDuplicate?: boolean | undefined;
|
6089
|
+
};
|
6072
6090
|
transactionId: string;
|
6073
6091
|
requestId: string;
|
6074
6092
|
eventId: string;
|
@@ -13085,8 +13103,22 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z
|
|
13085
13103
|
}, {
|
13086
13104
|
requestId: z.ZodString;
|
13087
13105
|
type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
|
13106
|
+
reason: z.ZodObject<{
|
13107
|
+
message: z.ZodString;
|
13108
|
+
isDuplicate: z.ZodOptional<z.ZodBoolean>;
|
13109
|
+
}, "strip", z.ZodTypeAny, {
|
13110
|
+
message: string;
|
13111
|
+
isDuplicate?: boolean | undefined;
|
13112
|
+
}, {
|
13113
|
+
message: string;
|
13114
|
+
isDuplicate?: boolean | undefined;
|
13115
|
+
}>;
|
13088
13116
|
}>, "strip", z.ZodTypeAny, {
|
13089
13117
|
type: "REJECT_CORRECTION";
|
13118
|
+
reason: {
|
13119
|
+
message: string;
|
13120
|
+
isDuplicate?: boolean | undefined;
|
13121
|
+
};
|
13090
13122
|
transactionId: string;
|
13091
13123
|
declaration: Record<string, string | number | boolean | {
|
13092
13124
|
type: string;
|
@@ -13183,6 +13215,10 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z
|
|
13183
13215
|
originalActionId?: (string & z.BRAND<"UUID">) | undefined;
|
13184
13216
|
keepAssignment?: boolean | undefined;
|
13185
13217
|
}, {
|
13218
|
+
reason: {
|
13219
|
+
message: string;
|
13220
|
+
isDuplicate?: boolean | undefined;
|
13221
|
+
};
|
13186
13222
|
transactionId: string;
|
13187
13223
|
requestId: string;
|
13188
13224
|
eventId: string;
|
@@ -5690,10 +5690,24 @@ export declare const EventDocument: z.ZodObject<{
|
|
5690
5690
|
}, {
|
5691
5691
|
type: z.ZodLiteral<"REJECT_CORRECTION">;
|
5692
5692
|
requestId: z.ZodString;
|
5693
|
+
reason: z.ZodObject<{
|
5694
|
+
message: z.ZodString;
|
5695
|
+
isDuplicate: z.ZodOptional<z.ZodBoolean>;
|
5696
|
+
}, "strip", z.ZodTypeAny, {
|
5697
|
+
message: string;
|
5698
|
+
isDuplicate?: boolean | undefined;
|
5699
|
+
}, {
|
5700
|
+
message: string;
|
5701
|
+
isDuplicate?: boolean | undefined;
|
5702
|
+
}>;
|
5693
5703
|
}>, "strip", z.ZodTypeAny, {
|
5694
5704
|
type: "REJECT_CORRECTION";
|
5695
5705
|
id: string & z.BRAND<"UUID">;
|
5696
5706
|
status: "Rejected" | "Requested" | "Accepted";
|
5707
|
+
reason: {
|
5708
|
+
message: string;
|
5709
|
+
isDuplicate?: boolean | undefined;
|
5710
|
+
};
|
5697
5711
|
transactionId: string;
|
5698
5712
|
createdByUserType: "system" | "user";
|
5699
5713
|
createdAt: string;
|
@@ -5797,6 +5811,10 @@ export declare const EventDocument: z.ZodObject<{
|
|
5797
5811
|
type: "REJECT_CORRECTION";
|
5798
5812
|
id: string;
|
5799
5813
|
status: "Rejected" | "Requested" | "Accepted";
|
5814
|
+
reason: {
|
5815
|
+
message: string;
|
5816
|
+
isDuplicate?: boolean | undefined;
|
5817
|
+
};
|
5800
5818
|
transactionId: string;
|
5801
5819
|
createdByUserType: "system" | "user";
|
5802
5820
|
createdAt: string;
|
@@ -9013,6 +9031,10 @@ export declare const EventDocument: z.ZodObject<{
|
|
9013
9031
|
type: "REJECT_CORRECTION";
|
9014
9032
|
id: string & z.BRAND<"UUID">;
|
9015
9033
|
status: "Rejected" | "Requested" | "Accepted";
|
9034
|
+
reason: {
|
9035
|
+
message: string;
|
9036
|
+
isDuplicate?: boolean | undefined;
|
9037
|
+
};
|
9016
9038
|
transactionId: string;
|
9017
9039
|
createdByUserType: "system" | "user";
|
9018
9040
|
createdAt: string;
|
@@ -10574,6 +10596,10 @@ export declare const EventDocument: z.ZodObject<{
|
|
10574
10596
|
type: "REJECT_CORRECTION";
|
10575
10597
|
id: string;
|
10576
10598
|
status: "Rejected" | "Requested" | "Accepted";
|
10599
|
+
reason: {
|
10600
|
+
message: string;
|
10601
|
+
isDuplicate?: boolean | undefined;
|
10602
|
+
};
|
10577
10603
|
transactionId: string;
|
10578
10604
|
createdByUserType: "system" | "user";
|
10579
10605
|
createdAt: string;
|
@@ -414,7 +414,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
414
414
|
requestId: string;
|
415
415
|
keepAssignment: boolean | undefined;
|
416
416
|
};
|
417
|
-
reject: (eventId: string, requestId: string, input
|
417
|
+
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment" | "reason">>) => {
|
418
418
|
type: "REJECT_CORRECTION";
|
419
419
|
transactionId: string;
|
420
420
|
declaration: {};
|
@@ -422,6 +422,10 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
422
422
|
eventId: string;
|
423
423
|
requestId: string;
|
424
424
|
keepAssignment: boolean | undefined;
|
425
|
+
reason: {
|
426
|
+
message: string;
|
427
|
+
isDuplicate?: boolean | undefined;
|
428
|
+
};
|
425
429
|
};
|
426
430
|
};
|
427
431
|
};
|
package/dist/events/index.js
CHANGED
@@ -1980,7 +1980,8 @@ var ApprovedCorrectionAction = ActionBase.merge(
|
|
1980
1980
|
var RejectedCorrectionAction = ActionBase.merge(
|
1981
1981
|
import_zod19.z.object({
|
1982
1982
|
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION),
|
1983
|
-
requestId: import_zod19.z.string()
|
1983
|
+
requestId: import_zod19.z.string(),
|
1984
|
+
reason: RejectionReason
|
1984
1985
|
})
|
1985
1986
|
);
|
1986
1987
|
var ReadAction = ActionBase.merge(
|
@@ -3916,7 +3917,8 @@ var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3916
3917
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
3917
3918
|
import_zod29.z.object({
|
3918
3919
|
requestId: import_zod29.z.string(),
|
3919
|
-
type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION)
|
3920
|
+
type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
3921
|
+
reason: RejectionReason
|
3920
3922
|
})
|
3921
3923
|
);
|
3922
3924
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
@@ -6755,7 +6757,7 @@ function eventPayloadGenerator(rng) {
|
|
6755
6757
|
requestId,
|
6756
6758
|
keepAssignment: input.keepAssignment
|
6757
6759
|
}),
|
6758
|
-
reject: (eventId, requestId, input
|
6760
|
+
reject: (eventId, requestId, input) => ({
|
6759
6761
|
type: ActionType.REJECT_CORRECTION,
|
6760
6762
|
transactionId: input.transactionId ?? getUUID(),
|
6761
6763
|
declaration: {},
|
@@ -6766,7 +6768,8 @@ function eventPayloadGenerator(rng) {
|
|
6766
6768
|
),
|
6767
6769
|
eventId,
|
6768
6770
|
requestId,
|
6769
|
-
keepAssignment: input.keepAssignment
|
6771
|
+
keepAssignment: input.keepAssignment,
|
6772
|
+
reason: input.reason ?? { message: "" }
|
6770
6773
|
})
|
6771
6774
|
}
|
6772
6775
|
}
|
@@ -6825,7 +6828,8 @@ function generateActionDocument({
|
|
6825
6828
|
return {
|
6826
6829
|
...actionBase,
|
6827
6830
|
requestId: getUUID(),
|
6828
|
-
type: action
|
6831
|
+
type: action,
|
6832
|
+
reason: { message: "Correction rejection" }
|
6829
6833
|
};
|
6830
6834
|
case ActionType.REGISTER:
|
6831
6835
|
return {
|