@opencrvs/toolkit 2.1.0-rc.b89dfd1 → 2.1.0-rc.b8f206f
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 +1580 -1580
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +2102 -259
- package/dist/commons/events/ActionConfig.d.ts +112 -105
- package/dist/commons/events/ActionDocument.d.ts +113 -113
- package/dist/commons/events/ActionType.d.ts +62 -62
- package/dist/commons/events/AdvancedSearchConfig.d.ts +507 -507
- package/dist/commons/events/AuditLog.d.ts +43 -43
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
- package/dist/commons/events/Draft.d.ts +37 -37
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +5 -5
- package/dist/commons/events/EventDocument.d.ts +46 -46
- package/dist/commons/events/EventIndex.d.ts +62 -62
- package/dist/commons/events/EventMetadata.d.ts +40 -40
- package/dist/commons/events/FieldConfig.d.ts +337 -337
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/Flag.d.ts +15 -15
- package/dist/commons/events/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +820 -820
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +895 -78
- package/dist/commons/events/locations.d.ts +4 -4
- package/dist/commons/events/mocks.test.utils.d.ts +2 -2
- package/dist/commons/events/scopes.d.ts +4 -4
- package/dist/commons/events/state/index.d.ts +17 -17
- package/dist/commons/events/state/utils.d.ts +7 -7
- package/dist/commons/events/test.utils.d.ts +36 -36
- package/dist/commons/events/utils.d.ts +122 -114
- package/dist/commons/notification/UserNotifications.d.ts +10 -10
- package/dist/environment/derived-variables.d.ts +131 -131
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/questions.d.ts +74 -75
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +14 -8
- package/dist/environment/utils.d.ts +1 -1
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +29 -12
- package/dist/migrations/v2.0/migrate-application-config-url.js +3 -4
- package/dist/notification/index.js +15 -11
- package/dist/scopes/index.d.ts +146 -146
- package/opencrvs-toolkit-2.1.0-rc.b8f206f.tgz +0 -0
- package/package.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.b89dfd1.tgz +0 -0
package/dist/events/index.js
CHANGED
|
@@ -313,6 +313,7 @@ __export(events_exports, {
|
|
|
313
313
|
getActionAnnotation: () => getActionAnnotation,
|
|
314
314
|
getActionAnnotationFields: () => getActionAnnotationFields,
|
|
315
315
|
getActionConfig: () => getActionConfig,
|
|
316
|
+
getActionFormFields: () => getActionFormFields,
|
|
316
317
|
getActionReview: () => getActionReview,
|
|
317
318
|
getActionReviewFields: () => getActionReviewFields,
|
|
318
319
|
getAdministrativeAreaHierarchy: () => getAdministrativeAreaHierarchy,
|
|
@@ -3238,6 +3239,9 @@ var ActionConfigBase = z24.object({
|
|
|
3238
3239
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
3239
3240
|
deduplication: DeduplicationConfig.optional()
|
|
3240
3241
|
});
|
|
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
|
+
);
|
|
3241
3245
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
3242
3246
|
z24.object({
|
|
3243
3247
|
type: z24.literal(ActionType.READ),
|
|
@@ -3249,7 +3253,8 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
3249
3253
|
);
|
|
3250
3254
|
var NotifyConfig = ActionConfigBase.extend(
|
|
3251
3255
|
z24.object({
|
|
3252
|
-
type: z24.literal(ActionType.NOTIFY)
|
|
3256
|
+
type: z24.literal(ActionType.NOTIFY),
|
|
3257
|
+
form: actionConfirmationForm
|
|
3253
3258
|
}).shape
|
|
3254
3259
|
);
|
|
3255
3260
|
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
@@ -3304,6 +3309,7 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
3304
3309
|
review: DeclarationReviewConfig.describe(
|
|
3305
3310
|
"Configuration of the review page fields."
|
|
3306
3311
|
),
|
|
3312
|
+
form: actionConfirmationForm,
|
|
3307
3313
|
dialogCopy: z24.object({
|
|
3308
3314
|
notify: TranslationConfig.describe(
|
|
3309
3315
|
"Confirmation text for the notify action"
|
|
@@ -3319,7 +3325,8 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
3319
3325
|
);
|
|
3320
3326
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
3321
3327
|
z24.object({
|
|
3322
|
-
type: z24.literal(ActionType.ARCHIVE)
|
|
3328
|
+
type: z24.literal(ActionType.ARCHIVE),
|
|
3329
|
+
form: actionConfirmationForm
|
|
3323
3330
|
}).shape
|
|
3324
3331
|
);
|
|
3325
3332
|
var UnarchiveConfig = ActionConfigBase.extend(
|
|
@@ -3345,12 +3352,14 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
3345
3352
|
);
|
|
3346
3353
|
var RejectConfig = ActionConfigBase.extend(
|
|
3347
3354
|
z24.object({
|
|
3348
|
-
type: z24.literal(ActionType.REJECT)
|
|
3355
|
+
type: z24.literal(ActionType.REJECT),
|
|
3356
|
+
form: actionConfirmationForm
|
|
3349
3357
|
}).shape
|
|
3350
3358
|
);
|
|
3351
3359
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
3352
3360
|
z24.object({
|
|
3353
|
-
type: z24.literal(ActionType.REGISTER)
|
|
3361
|
+
type: z24.literal(ActionType.REGISTER),
|
|
3362
|
+
form: actionConfirmationForm
|
|
3354
3363
|
}).shape
|
|
3355
3364
|
);
|
|
3356
3365
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
@@ -4624,7 +4633,19 @@ function getCustomActionFields(eventConfiguration, customActionType) {
|
|
|
4624
4633
|
customActionType,
|
|
4625
4634
|
actionType: ActionType.CUSTOM
|
|
4626
4635
|
});
|
|
4627
|
-
if (!actionConfig ||
|
|
4636
|
+
if (!actionConfig || actionConfig.type !== ActionType.CUSTOM) {
|
|
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) {
|
|
4628
4649
|
return [];
|
|
4629
4650
|
}
|
|
4630
4651
|
return actionConfig.form;
|
|
@@ -4645,13 +4666,9 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
4645
4666
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
4646
4667
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
4647
4668
|
}
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
if ("review" in actionConfig && actionConfig.review != null) {
|
|
4652
|
-
return actionConfig.review.fields;
|
|
4653
|
-
}
|
|
4654
|
-
return [];
|
|
4669
|
+
const reviewFields = "review" in actionConfig && actionConfig.review != null ? actionConfig.review.fields : [];
|
|
4670
|
+
const formFields = "form" in actionConfig && actionConfig.form != null ? actionConfig.form : [];
|
|
4671
|
+
return [...reviewFields, ...formFields];
|
|
4655
4672
|
};
|
|
4656
4673
|
function getAllAnnotationFields(config) {
|
|
4657
4674
|
return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
|
|
@@ -92,10 +92,9 @@ const FUNCTION_LIKE_KINDS = [
|
|
|
92
92
|
* Falls back to `<anonymous>` when nothing useful can be derived.
|
|
93
93
|
*/
|
|
94
94
|
function describeFunction(node) {
|
|
95
|
-
var _a;
|
|
96
|
-
var _b, _c;
|
|
95
|
+
var _a, _b, _c;
|
|
97
96
|
if (ts_morph_1.Node.isFunctionDeclaration(node) || ts_morph_1.Node.isMethodDeclaration(node)) {
|
|
98
|
-
return (
|
|
97
|
+
return (_a = node.getName()) !== null && _a !== void 0 ? _a : '<anonymous>';
|
|
99
98
|
}
|
|
100
99
|
// FunctionExpression / ArrowFunction: try to pick up the assignment target.
|
|
101
100
|
const parent = node.getParent();
|
|
@@ -107,7 +106,7 @@ function describeFunction(node) {
|
|
|
107
106
|
}
|
|
108
107
|
if (ts_morph_1.Node.isFunctionExpression(node) &&
|
|
109
108
|
node.getNameNode() !== undefined) {
|
|
110
|
-
return (_c = (
|
|
109
|
+
return (_c = (_b = node.getNameNode()) === null || _b === void 0 ? void 0 : _b.getText()) !== null && _c !== void 0 ? _c : '<anonymous>';
|
|
111
110
|
}
|
|
112
111
|
return '<anonymous>';
|
|
113
112
|
}
|
|
@@ -2694,6 +2694,9 @@ 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
|
+
);
|
|
2697
2700
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
2698
2701
|
z24.object({
|
|
2699
2702
|
type: z24.literal(ActionType.READ),
|
|
@@ -2705,7 +2708,8 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
2705
2708
|
);
|
|
2706
2709
|
var NotifyConfig = ActionConfigBase.extend(
|
|
2707
2710
|
z24.object({
|
|
2708
|
-
type: z24.literal(ActionType.NOTIFY)
|
|
2711
|
+
type: z24.literal(ActionType.NOTIFY),
|
|
2712
|
+
form: actionConfirmationForm
|
|
2709
2713
|
}).shape
|
|
2710
2714
|
);
|
|
2711
2715
|
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
@@ -2760,6 +2764,7 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2760
2764
|
review: DeclarationReviewConfig.describe(
|
|
2761
2765
|
"Configuration of the review page fields."
|
|
2762
2766
|
),
|
|
2767
|
+
form: actionConfirmationForm,
|
|
2763
2768
|
dialogCopy: z24.object({
|
|
2764
2769
|
notify: TranslationConfig.describe(
|
|
2765
2770
|
"Confirmation text for the notify action"
|
|
@@ -2775,7 +2780,8 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2775
2780
|
);
|
|
2776
2781
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
2777
2782
|
z24.object({
|
|
2778
|
-
type: z24.literal(ActionType.ARCHIVE)
|
|
2783
|
+
type: z24.literal(ActionType.ARCHIVE),
|
|
2784
|
+
form: actionConfirmationForm
|
|
2779
2785
|
}).shape
|
|
2780
2786
|
);
|
|
2781
2787
|
var UnarchiveConfig = ActionConfigBase.extend(
|
|
@@ -2801,12 +2807,14 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
2801
2807
|
);
|
|
2802
2808
|
var RejectConfig = ActionConfigBase.extend(
|
|
2803
2809
|
z24.object({
|
|
2804
|
-
type: z24.literal(ActionType.REJECT)
|
|
2810
|
+
type: z24.literal(ActionType.REJECT),
|
|
2811
|
+
form: actionConfirmationForm
|
|
2805
2812
|
}).shape
|
|
2806
2813
|
);
|
|
2807
2814
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
2808
2815
|
z24.object({
|
|
2809
|
-
type: z24.literal(ActionType.REGISTER)
|
|
2816
|
+
type: z24.literal(ActionType.REGISTER),
|
|
2817
|
+
form: actionConfirmationForm
|
|
2810
2818
|
}).shape
|
|
2811
2819
|
);
|
|
2812
2820
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
@@ -3326,13 +3334,9 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
3326
3334
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
3327
3335
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
3328
3336
|
}
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
if ("review" in actionConfig && actionConfig.review != null) {
|
|
3333
|
-
return actionConfig.review.fields;
|
|
3334
|
-
}
|
|
3335
|
-
return [];
|
|
3337
|
+
const reviewFields = "review" in actionConfig && actionConfig.review != null ? actionConfig.review.fields : [];
|
|
3338
|
+
const formFields = "form" in actionConfig && actionConfig.form != null ? actionConfig.form : [];
|
|
3339
|
+
return [...reviewFields, ...formFields];
|
|
3336
3340
|
};
|
|
3337
3341
|
function getAllAnnotationFields(config) {
|
|
3338
3342
|
return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
|