@opencrvs/toolkit 2.0.0-rc.df6de0f → 2.0.0-rc.df870e8
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/application-config/index.js +6 -0
- package/dist/commons/api/router.d.ts +11 -2
- package/dist/commons/events/FieldConfig.d.ts +1 -0
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/events/index.js +19 -9
- package/dist/notification/index.js +15 -0
- package/opencrvs-toolkit-2.0.0-rc.df870e8.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.df6de0f.tgz +0 -0
|
@@ -206,6 +206,11 @@ var FieldTypesToHideInReview = [
|
|
|
206
206
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
207
207
|
FieldType.ALPHA_HIDDEN
|
|
208
208
|
];
|
|
209
|
+
var HiddenFieldTypes = [
|
|
210
|
+
FieldType.HTTP,
|
|
211
|
+
FieldType.QUERY_PARAM_READER,
|
|
212
|
+
FieldType.ALPHA_HIDDEN
|
|
213
|
+
];
|
|
209
214
|
|
|
210
215
|
// ../commons/src/events/FieldValue.ts
|
|
211
216
|
var z7 = __toESM(require("zod/v4"));
|
|
@@ -1495,6 +1500,7 @@ var NumberField = BaseField.extend({
|
|
|
1495
1500
|
configuration: import_v43.default.object({
|
|
1496
1501
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1497
1502
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1503
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1498
1504
|
prefix: TranslationConfig.optional(),
|
|
1499
1505
|
postfix: TranslationConfig.optional()
|
|
1500
1506
|
}).optional()
|
|
@@ -7374,9 +7374,18 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
7374
7374
|
output: void;
|
|
7375
7375
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
7376
7376
|
}>;
|
|
7377
|
-
|
|
7377
|
+
requestEmailChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
7378
7378
|
input: {
|
|
7379
|
-
|
|
7379
|
+
email: string;
|
|
7380
|
+
};
|
|
7381
|
+
output: {
|
|
7382
|
+
nonce: string;
|
|
7383
|
+
};
|
|
7384
|
+
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
7385
|
+
}>;
|
|
7386
|
+
requestPhoneChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
7387
|
+
input: {
|
|
7388
|
+
phoneNumber: string;
|
|
7380
7389
|
};
|
|
7381
7390
|
output: {
|
|
7382
7391
|
nonce: string;
|
|
@@ -267,6 +267,7 @@ declare const NumberField: z.ZodObject<{
|
|
|
267
267
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
268
268
|
min: z.ZodOptional<z.ZodNumber>;
|
|
269
269
|
max: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
integer: z.ZodOptional<z.ZodBoolean>;
|
|
270
271
|
prefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
271
272
|
postfix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
272
273
|
}, z.core.$strip>>;
|
|
@@ -75,4 +75,5 @@ export type FieldType = (typeof fieldTypes)[number];
|
|
|
75
75
|
*/
|
|
76
76
|
export declare const compositeFieldTypes: ("NAME" | "ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS" | "DATA" | "ID_READER")[];
|
|
77
77
|
export declare const FieldTypesToHideInReview: ("IMAGE_VIEW" | "PARAGRAPH" | "PAGE_HEADER" | "BULLET_LIST" | "DIVIDER" | "DATA" | "ALPHA_PRINT_BUTTON" | "HTTP" | "QUERY_PARAM_READER" | "ID_READER" | "LOADER" | "ALPHA_HIDDEN")[];
|
|
78
|
+
export declare const HiddenFieldTypes: ("HTTP" | "QUERY_PARAM_READER" | "ALPHA_HIDDEN")[];
|
|
78
79
|
//# sourceMappingURL=FieldType.d.ts.map
|
|
@@ -690,7 +690,7 @@ export declare const isHiddenFieldType: (field: {
|
|
|
690
690
|
value: undefined;
|
|
691
691
|
config: HiddenField;
|
|
692
692
|
};
|
|
693
|
-
export type NonInteractiveFieldType = Divider | PageHeader | ImageViewField | Paragraph | Heading | BulletList | DataField | AlphaPrintButton |
|
|
693
|
+
export type NonInteractiveFieldType = Divider | PageHeader | ImageViewField | Paragraph | Heading | BulletList | DataField | AlphaPrintButton | LinkButtonField | LoaderField | AutocompleteField;
|
|
694
694
|
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
|
695
695
|
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
|
696
696
|
export {};
|
package/dist/events/index.js
CHANGED
|
@@ -151,6 +151,7 @@ __export(events_exports, {
|
|
|
151
151
|
FormPageConfig: () => FormPageConfig,
|
|
152
152
|
Fuzzy: () => Fuzzy,
|
|
153
153
|
GeographicalArea: () => GeographicalArea,
|
|
154
|
+
HiddenFieldTypes: () => HiddenFieldTypes,
|
|
154
155
|
HiddenFieldValue: () => HiddenFieldValue,
|
|
155
156
|
HttpFieldUpdateValue: () => HttpFieldUpdateValue,
|
|
156
157
|
HttpFieldValue: () => HttpFieldValue,
|
|
@@ -1219,6 +1220,11 @@ var FieldTypesToHideInReview = [
|
|
|
1219
1220
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
1220
1221
|
FieldType.ALPHA_HIDDEN
|
|
1221
1222
|
];
|
|
1223
|
+
var HiddenFieldTypes = [
|
|
1224
|
+
FieldType.HTTP,
|
|
1225
|
+
FieldType.QUERY_PARAM_READER,
|
|
1226
|
+
FieldType.ALPHA_HIDDEN
|
|
1227
|
+
];
|
|
1222
1228
|
|
|
1223
1229
|
// ../commons/src/events/FieldValue.ts
|
|
1224
1230
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -2292,6 +2298,7 @@ var NumberField = BaseField.extend({
|
|
|
2292
2298
|
configuration: import_v43.default.object({
|
|
2293
2299
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
2294
2300
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
2301
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
2295
2302
|
prefix: TranslationConfig.optional(),
|
|
2296
2303
|
postfix: TranslationConfig.optional()
|
|
2297
2304
|
}).optional()
|
|
@@ -3908,7 +3915,7 @@ var isHiddenFieldType = (field3) => {
|
|
|
3908
3915
|
return field3.config.type === FieldType.ALPHA_HIDDEN;
|
|
3909
3916
|
};
|
|
3910
3917
|
var isNonInteractiveFieldType = (field3) => {
|
|
3911
|
-
return field3.type === FieldType.DIVIDER || field3.type === FieldType.PAGE_HEADER || field3.type === FieldType.PARAGRAPH || field3.type === FieldType.HEADING || field3.type === FieldType.BULLET_LIST || field3.type === FieldType.DATA || field3.type === FieldType.ALPHA_PRINT_BUTTON || field3.type === FieldType.
|
|
3918
|
+
return field3.type === FieldType.DIVIDER || field3.type === FieldType.PAGE_HEADER || field3.type === FieldType.PARAGRAPH || field3.type === FieldType.HEADING || field3.type === FieldType.BULLET_LIST || field3.type === FieldType.DATA || field3.type === FieldType.ALPHA_PRINT_BUTTON || field3.type === FieldType.LINK_BUTTON || field3.type === FieldType.LOADER;
|
|
3912
3919
|
};
|
|
3913
3920
|
|
|
3914
3921
|
// ../commons/src/conditionals/validate.ts
|
|
@@ -6485,6 +6492,8 @@ var updateActions = ActionTypes.extract([
|
|
|
6485
6492
|
ActionType.ARCHIVE,
|
|
6486
6493
|
ActionType.PRINT_CERTIFICATE,
|
|
6487
6494
|
ActionType.REQUEST_CORRECTION,
|
|
6495
|
+
ActionType.APPROVE_CORRECTION,
|
|
6496
|
+
ActionType.REJECT_CORRECTION,
|
|
6488
6497
|
ActionType.CUSTOM
|
|
6489
6498
|
]);
|
|
6490
6499
|
function getActionUpdateMetadata(actions) {
|
|
@@ -10623,18 +10632,19 @@ var ACTION_FILTERS = {
|
|
|
10623
10632
|
function filterActionsByFlags(actions, flags) {
|
|
10624
10633
|
return actions.filter((action) => ACTION_FILTERS[action]?.(flags) ?? true);
|
|
10625
10634
|
}
|
|
10635
|
+
var REJECTED_ACTIONS = [
|
|
10636
|
+
ActionType.READ,
|
|
10637
|
+
ActionType.NOTIFY,
|
|
10638
|
+
ActionType.CUSTOM,
|
|
10639
|
+
ActionType.EDIT,
|
|
10640
|
+
ActionType.ARCHIVE
|
|
10641
|
+
];
|
|
10626
10642
|
function getAvailableActionsWithoutFlagFilters(status2, flags) {
|
|
10627
10643
|
if (flags.includes(InherentFlags.EDIT_IN_PROGRESS)) {
|
|
10628
10644
|
return [ActionType.NOTIFY, ActionType.DECLARE, ActionType.REGISTER];
|
|
10629
10645
|
}
|
|
10630
|
-
if (flags.includes(InherentFlags.REJECTED)) {
|
|
10631
|
-
return
|
|
10632
|
-
ActionType.READ,
|
|
10633
|
-
ActionType.NOTIFY,
|
|
10634
|
-
ActionType.CUSTOM,
|
|
10635
|
-
ActionType.EDIT,
|
|
10636
|
-
ActionType.ARCHIVE
|
|
10637
|
-
];
|
|
10646
|
+
if (flags.includes(InherentFlags.REJECTED) && status2 !== EventStatus.enum.ARCHIVED) {
|
|
10647
|
+
return REJECTED_ACTIONS;
|
|
10638
10648
|
}
|
|
10639
10649
|
return AVAILABLE_ACTIONS_BY_EVENT_STATUS[status2];
|
|
10640
10650
|
}
|
|
@@ -770,6 +770,11 @@ var FieldTypesToHideInReview = [
|
|
|
770
770
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
771
771
|
FieldType.ALPHA_HIDDEN
|
|
772
772
|
];
|
|
773
|
+
var HiddenFieldTypes = [
|
|
774
|
+
FieldType.HTTP,
|
|
775
|
+
FieldType.QUERY_PARAM_READER,
|
|
776
|
+
FieldType.ALPHA_HIDDEN
|
|
777
|
+
];
|
|
773
778
|
|
|
774
779
|
// ../commons/src/events/FieldValue.ts
|
|
775
780
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -1750,6 +1755,7 @@ var NumberField = BaseField.extend({
|
|
|
1750
1755
|
configuration: import_v43.default.object({
|
|
1751
1756
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1752
1757
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1758
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1753
1759
|
prefix: TranslationConfig.optional(),
|
|
1754
1760
|
postfix: TranslationConfig.optional()
|
|
1755
1761
|
}).optional()
|
|
@@ -4697,6 +4703,8 @@ var updateActions = ActionTypes.extract([
|
|
|
4697
4703
|
ActionType.ARCHIVE,
|
|
4698
4704
|
ActionType.PRINT_CERTIFICATE,
|
|
4699
4705
|
ActionType.REQUEST_CORRECTION,
|
|
4706
|
+
ActionType.APPROVE_CORRECTION,
|
|
4707
|
+
ActionType.REJECT_CORRECTION,
|
|
4700
4708
|
ActionType.CUSTOM
|
|
4701
4709
|
]);
|
|
4702
4710
|
|
|
@@ -7241,6 +7249,13 @@ var ACTION_FILTERS = {
|
|
|
7241
7249
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7242
7250
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
7243
7251
|
};
|
|
7252
|
+
var REJECTED_ACTIONS = [
|
|
7253
|
+
ActionType.READ,
|
|
7254
|
+
ActionType.NOTIFY,
|
|
7255
|
+
ActionType.CUSTOM,
|
|
7256
|
+
ActionType.EDIT,
|
|
7257
|
+
ActionType.ARCHIVE
|
|
7258
|
+
];
|
|
7244
7259
|
|
|
7245
7260
|
// ../commons/src/events/FileUtils.ts
|
|
7246
7261
|
var import_lodash7 = require("lodash");
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|