@opencrvs/toolkit 2.1.0-rc.47017f6 → 2.1.0-rc.69ab488
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/events/ActionConfig.d.ts +0 -7
- package/dist/commons/events/utils.d.ts +0 -8
- package/dist/events/index.js +12 -29
- package/dist/notification/index.js +11 -15
- package/opencrvs-toolkit-2.1.0-rc.69ab488.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.1.0-rc.47017f6.tgz +0 -0
|
@@ -163,7 +163,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
163
163
|
conditional: z.ZodAny;
|
|
164
164
|
}, z.core.$strip>], "type">>>;
|
|
165
165
|
type: z.ZodLiteral<"NOTIFY">;
|
|
166
|
-
form: z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>>;
|
|
167
166
|
}, z.core.$strip>, z.ZodObject<{
|
|
168
167
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
169
168
|
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -199,7 +198,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
199
198
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
200
199
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
201
200
|
}, z.core.$strip>;
|
|
202
|
-
form: z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>>;
|
|
203
201
|
dialogCopy: z.ZodOptional<z.ZodObject<{
|
|
204
202
|
notify: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
205
203
|
declare: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
@@ -303,7 +301,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
303
301
|
conditional: z.ZodAny;
|
|
304
302
|
}, z.core.$strip>], "type">>>;
|
|
305
303
|
type: z.ZodLiteral<"REJECT">;
|
|
306
|
-
form: z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>>;
|
|
307
304
|
}, z.core.$strip>, z.ZodObject<{
|
|
308
305
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
309
306
|
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -335,7 +332,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
335
332
|
query: z.ZodType<import("./DeduplicationConfig").ClauseOutput, import("./DeduplicationConfig").ClauseInput, z.core.$ZodTypeInternals<import("./DeduplicationConfig").ClauseOutput, import("./DeduplicationConfig").ClauseInput>>;
|
|
336
333
|
}, z.core.$strip>>;
|
|
337
334
|
type: z.ZodLiteral<"REGISTER">;
|
|
338
|
-
form: z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>>;
|
|
339
335
|
}, z.core.$strip>, z.ZodObject<{
|
|
340
336
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
341
337
|
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -557,7 +553,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
557
553
|
conditional: z.ZodAny;
|
|
558
554
|
}, z.core.$strip>], "type">>>;
|
|
559
555
|
type: z.ZodLiteral<"ARCHIVE">;
|
|
560
|
-
form: z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>>;
|
|
561
556
|
}, z.core.$strip>, z.ZodObject<{
|
|
562
557
|
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
563
558
|
flags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -660,7 +655,6 @@ export declare const DeclarationActionConfig: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
660
655
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
661
656
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
662
657
|
}, z.core.$strip>;
|
|
663
|
-
form: z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>>;
|
|
664
658
|
dialogCopy: z.ZodOptional<z.ZodObject<{
|
|
665
659
|
notify: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
666
660
|
declare: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
@@ -697,7 +691,6 @@ export declare const DeclarationActionConfig: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
697
691
|
query: z.ZodType<import("./DeduplicationConfig").ClauseOutput, import("./DeduplicationConfig").ClauseInput, z.core.$ZodTypeInternals<import("./DeduplicationConfig").ClauseOutput, import("./DeduplicationConfig").ClauseInput>>;
|
|
698
692
|
}, z.core.$strip>>;
|
|
699
693
|
type: z.ZodLiteral<"REGISTER">;
|
|
700
|
-
form: z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>>;
|
|
701
694
|
}, z.core.$strip>], "type">;
|
|
702
695
|
export type DeclarationActionConfig = z.infer<typeof DeclarationActionConfig>;
|
|
703
696
|
export {};
|
|
@@ -50,14 +50,6 @@ export declare function getActionConfig({ eventConfiguration, actionType, custom
|
|
|
50
50
|
customActionType?: string;
|
|
51
51
|
}): ActionConfig | undefined;
|
|
52
52
|
export declare function getCustomActionFields(eventConfiguration: EventConfig, customActionType: string): FieldConfig[];
|
|
53
|
-
/**
|
|
54
|
-
* Returns the fields configured for an action's confirmation dialog.
|
|
55
|
-
*
|
|
56
|
-
* Unlike review fields and supporting copy, NOTIFY does NOT fall back to the
|
|
57
|
-
* DECLARE config here: dialog fields always come from the action's own
|
|
58
|
-
* configuration entry.
|
|
59
|
-
*/
|
|
60
|
-
export declare function getActionFormFields(eventConfiguration: EventConfig, actionType: ActionType, customActionType?: string): FieldConfig[];
|
|
61
53
|
export declare function getPrintCertificatePages(configuration: EventConfig): ({
|
|
62
54
|
id: string;
|
|
63
55
|
title: {
|
package/dist/events/index.js
CHANGED
|
@@ -313,7 +313,6 @@ __export(events_exports, {
|
|
|
313
313
|
getActionAnnotation: () => getActionAnnotation,
|
|
314
314
|
getActionAnnotationFields: () => getActionAnnotationFields,
|
|
315
315
|
getActionConfig: () => getActionConfig,
|
|
316
|
-
getActionFormFields: () => getActionFormFields,
|
|
317
316
|
getActionReview: () => getActionReview,
|
|
318
317
|
getActionReviewFields: () => getActionReviewFields,
|
|
319
318
|
getAdministrativeAreaHierarchy: () => getAdministrativeAreaHierarchy,
|
|
@@ -3239,9 +3238,6 @@ var ActionConfigBase = z24.object({
|
|
|
3239
3238
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
3240
3239
|
deduplication: DeduplicationConfig.optional()
|
|
3241
3240
|
});
|
|
3242
|
-
var actionConfirmationForm = z24.array(FieldConfig).optional().describe(
|
|
3243
|
-
"Fields rendered on the action confirmation dialog. Submitted values are stored in the action annotation and shown in the audit history."
|
|
3244
|
-
);
|
|
3245
3241
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
3246
3242
|
z24.object({
|
|
3247
3243
|
type: z24.literal(ActionType.READ),
|
|
@@ -3253,8 +3249,7 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
3253
3249
|
);
|
|
3254
3250
|
var NotifyConfig = ActionConfigBase.extend(
|
|
3255
3251
|
z24.object({
|
|
3256
|
-
type: z24.literal(ActionType.NOTIFY)
|
|
3257
|
-
form: actionConfirmationForm
|
|
3252
|
+
type: z24.literal(ActionType.NOTIFY)
|
|
3258
3253
|
}).shape
|
|
3259
3254
|
);
|
|
3260
3255
|
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
@@ -3309,7 +3304,6 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
3309
3304
|
review: DeclarationReviewConfig.describe(
|
|
3310
3305
|
"Configuration of the review page fields."
|
|
3311
3306
|
),
|
|
3312
|
-
form: actionConfirmationForm,
|
|
3313
3307
|
dialogCopy: z24.object({
|
|
3314
3308
|
notify: TranslationConfig.describe(
|
|
3315
3309
|
"Confirmation text for the notify action"
|
|
@@ -3325,8 +3319,7 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
3325
3319
|
);
|
|
3326
3320
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
3327
3321
|
z24.object({
|
|
3328
|
-
type: z24.literal(ActionType.ARCHIVE)
|
|
3329
|
-
form: actionConfirmationForm
|
|
3322
|
+
type: z24.literal(ActionType.ARCHIVE)
|
|
3330
3323
|
}).shape
|
|
3331
3324
|
);
|
|
3332
3325
|
var UnarchiveConfig = ActionConfigBase.extend(
|
|
@@ -3352,14 +3345,12 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
3352
3345
|
);
|
|
3353
3346
|
var RejectConfig = ActionConfigBase.extend(
|
|
3354
3347
|
z24.object({
|
|
3355
|
-
type: z24.literal(ActionType.REJECT)
|
|
3356
|
-
form: actionConfirmationForm
|
|
3348
|
+
type: z24.literal(ActionType.REJECT)
|
|
3357
3349
|
}).shape
|
|
3358
3350
|
);
|
|
3359
3351
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
3360
3352
|
z24.object({
|
|
3361
|
-
type: z24.literal(ActionType.REGISTER)
|
|
3362
|
-
form: actionConfirmationForm
|
|
3353
|
+
type: z24.literal(ActionType.REGISTER)
|
|
3363
3354
|
}).shape
|
|
3364
3355
|
);
|
|
3365
3356
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
@@ -4633,19 +4624,7 @@ function getCustomActionFields(eventConfiguration, customActionType) {
|
|
|
4633
4624
|
customActionType,
|
|
4634
4625
|
actionType: ActionType.CUSTOM
|
|
4635
4626
|
});
|
|
4636
|
-
if (!actionConfig ||
|
|
4637
|
-
return [];
|
|
4638
|
-
}
|
|
4639
|
-
return actionConfig.form;
|
|
4640
|
-
}
|
|
4641
|
-
function getActionFormFields(eventConfiguration, actionType, customActionType) {
|
|
4642
|
-
const actionConfig = eventConfiguration.actions.find((a) => {
|
|
4643
|
-
if (a.type === ActionType.CUSTOM && customActionType) {
|
|
4644
|
-
return a.customActionType === customActionType;
|
|
4645
|
-
}
|
|
4646
|
-
return a.type === actionType;
|
|
4647
|
-
});
|
|
4648
|
-
if (!actionConfig || !("form" in actionConfig) || actionConfig.form == null) {
|
|
4627
|
+
if (!actionConfig || !("form" in actionConfig)) {
|
|
4649
4628
|
return [];
|
|
4650
4629
|
}
|
|
4651
4630
|
return actionConfig.form;
|
|
@@ -4666,9 +4645,13 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
4666
4645
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
4667
4646
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
4668
4647
|
}
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4648
|
+
if (actionConfig.type === ActionType.CUSTOM) {
|
|
4649
|
+
return actionConfig.form;
|
|
4650
|
+
}
|
|
4651
|
+
if ("review" in actionConfig && actionConfig.review != null) {
|
|
4652
|
+
return actionConfig.review.fields;
|
|
4653
|
+
}
|
|
4654
|
+
return [];
|
|
4672
4655
|
};
|
|
4673
4656
|
function getAllAnnotationFields(config) {
|
|
4674
4657
|
return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
|
|
@@ -2694,9 +2694,6 @@ var ActionConfigBase = z24.object({
|
|
|
2694
2694
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2695
2695
|
deduplication: DeduplicationConfig.optional()
|
|
2696
2696
|
});
|
|
2697
|
-
var actionConfirmationForm = z24.array(FieldConfig).optional().describe(
|
|
2698
|
-
"Fields rendered on the action confirmation dialog. Submitted values are stored in the action annotation and shown in the audit history."
|
|
2699
|
-
);
|
|
2700
2697
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
2701
2698
|
z24.object({
|
|
2702
2699
|
type: z24.literal(ActionType.READ),
|
|
@@ -2708,8 +2705,7 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
2708
2705
|
);
|
|
2709
2706
|
var NotifyConfig = ActionConfigBase.extend(
|
|
2710
2707
|
z24.object({
|
|
2711
|
-
type: z24.literal(ActionType.NOTIFY)
|
|
2712
|
-
form: actionConfirmationForm
|
|
2708
|
+
type: z24.literal(ActionType.NOTIFY)
|
|
2713
2709
|
}).shape
|
|
2714
2710
|
);
|
|
2715
2711
|
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
@@ -2764,7 +2760,6 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2764
2760
|
review: DeclarationReviewConfig.describe(
|
|
2765
2761
|
"Configuration of the review page fields."
|
|
2766
2762
|
),
|
|
2767
|
-
form: actionConfirmationForm,
|
|
2768
2763
|
dialogCopy: z24.object({
|
|
2769
2764
|
notify: TranslationConfig.describe(
|
|
2770
2765
|
"Confirmation text for the notify action"
|
|
@@ -2780,8 +2775,7 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2780
2775
|
);
|
|
2781
2776
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
2782
2777
|
z24.object({
|
|
2783
|
-
type: z24.literal(ActionType.ARCHIVE)
|
|
2784
|
-
form: actionConfirmationForm
|
|
2778
|
+
type: z24.literal(ActionType.ARCHIVE)
|
|
2785
2779
|
}).shape
|
|
2786
2780
|
);
|
|
2787
2781
|
var UnarchiveConfig = ActionConfigBase.extend(
|
|
@@ -2807,14 +2801,12 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
2807
2801
|
);
|
|
2808
2802
|
var RejectConfig = ActionConfigBase.extend(
|
|
2809
2803
|
z24.object({
|
|
2810
|
-
type: z24.literal(ActionType.REJECT)
|
|
2811
|
-
form: actionConfirmationForm
|
|
2804
|
+
type: z24.literal(ActionType.REJECT)
|
|
2812
2805
|
}).shape
|
|
2813
2806
|
);
|
|
2814
2807
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
2815
2808
|
z24.object({
|
|
2816
|
-
type: z24.literal(ActionType.REGISTER)
|
|
2817
|
-
form: actionConfirmationForm
|
|
2809
|
+
type: z24.literal(ActionType.REGISTER)
|
|
2818
2810
|
}).shape
|
|
2819
2811
|
);
|
|
2820
2812
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
@@ -3334,9 +3326,13 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
3334
3326
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
3335
3327
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
3336
3328
|
}
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3329
|
+
if (actionConfig.type === ActionType.CUSTOM) {
|
|
3330
|
+
return actionConfig.form;
|
|
3331
|
+
}
|
|
3332
|
+
if ("review" in actionConfig && actionConfig.review != null) {
|
|
3333
|
+
return actionConfig.review.fields;
|
|
3334
|
+
}
|
|
3335
|
+
return [];
|
|
3340
3336
|
};
|
|
3341
3337
|
function getAllAnnotationFields(config) {
|
|
3342
3338
|
return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|