@opencrvs/toolkit 2.0.0-rc.4844c26 → 2.0.0-rc.4917ce5
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/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +17 -10
- package/dist/commons/api/router.d.ts +14 -3
- package/dist/commons/conditionals/conditionals.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +36 -36
- package/dist/commons/events/Draft.d.ts +2 -3
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/state/flags.d.ts +15 -0
- package/dist/conditionals/index.js +4 -0
- package/dist/events/index.js +483 -54
- package/dist/notification/index.js +420 -29
- package/opencrvs-toolkit-2.0.0-rc.4917ce5.tgz +0 -0
- package/package.json +6 -2
- package/opencrvs-toolkit-2.0.0-rc.4844c26.tgz +0 -0
|
@@ -45,16 +45,15 @@ export declare const Draft: z.ZodObject<{
|
|
|
45
45
|
}, z.core.$strip>;
|
|
46
46
|
}, z.core.$strip>;
|
|
47
47
|
export declare const DraftInput: z.ZodObject<{
|
|
48
|
-
eventId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
49
48
|
transactionId: z.ZodString;
|
|
49
|
+
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
50
50
|
declaration: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
51
51
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
52
52
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
53
|
+
eventId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
53
54
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
54
55
|
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
55
56
|
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
-
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
-
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
58
57
|
type: z.ZodEnum<{
|
|
59
58
|
CUSTOM: "CUSTOM";
|
|
60
59
|
CREATE: "CREATE";
|
|
@@ -37,6 +37,7 @@ export * from './scopes';
|
|
|
37
37
|
export * from './serializer';
|
|
38
38
|
export * from './state/availableActions';
|
|
39
39
|
export * from './FileUtils';
|
|
40
|
+
export * from './mocks.test.utils';
|
|
40
41
|
export * from '../conditionals/conditionals';
|
|
41
42
|
export * from '../conditionals/validate';
|
|
42
43
|
export * from './field';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Action, RequestedCorrectionAction } from '../ActionDocument';
|
|
1
2
|
import { Flag, CustomFlag } from '../Flag';
|
|
2
3
|
import { EventConfig } from '../EventConfig';
|
|
3
4
|
import { EventDocument } from '../EventDocument';
|
|
5
|
+
export declare function findPendingCorrectionAction(writeActions: Action[]): RequestedCorrectionAction | undefined;
|
|
4
6
|
/**
|
|
5
7
|
* This function resolves custom flags for an event based on its actions.
|
|
6
8
|
* Flags are not stored to the event state or any database directly, instead they are always computed/evaluated from the event actions.
|
|
@@ -18,5 +20,18 @@ import { EventDocument } from '../EventDocument';
|
|
|
18
20
|
* // Returns: ['flag-1', 'flag-3']
|
|
19
21
|
*/
|
|
20
22
|
export declare function resolveEventCustomFlags(event: EventDocument, eventConfiguration: EventConfig): CustomFlag[];
|
|
23
|
+
/**
|
|
24
|
+
* Computes all flags (inherent, action status, and custom) that should be attached to the given event,
|
|
25
|
+
* based on its actions and event-specific configuration.
|
|
26
|
+
*
|
|
27
|
+
* Flags are determined by combining:
|
|
28
|
+
* - Action status flags (format 'ActionType:ActionStatus')
|
|
29
|
+
* - Inherent flags (e.g. incomplete, rejected, correction requested, potential duplicate, edit in progress)
|
|
30
|
+
* - Event type-specific custom flags defined in the event configuration
|
|
31
|
+
*
|
|
32
|
+
* @param event - The EventDocument containing the action history and payload
|
|
33
|
+
* @param config - The EventConfig providing rules for custom flag evaluation
|
|
34
|
+
* @returns An array of flags currently relevant/applicable to the event
|
|
35
|
+
*/
|
|
21
36
|
export declare function getEventFlags(event: EventDocument, config: EventConfig): Flag[];
|
|
22
37
|
//# sourceMappingURL=flags.d.ts.map
|
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/conditionals/index.ts
|
|
31
31
|
var conditionals_exports = {};
|
|
32
32
|
__export(conditionals_exports, {
|
|
33
|
+
always: () => always,
|
|
33
34
|
alwaysTrue: () => alwaysTrue,
|
|
34
35
|
and: () => and,
|
|
35
36
|
createFieldConditionals: () => createFieldConditionals,
|
|
@@ -454,6 +455,9 @@ function not(condition) {
|
|
|
454
455
|
function never() {
|
|
455
456
|
return not(alwaysTrue());
|
|
456
457
|
}
|
|
458
|
+
function always() {
|
|
459
|
+
return defineConditional(alwaysTrue());
|
|
460
|
+
}
|
|
457
461
|
function jsonFieldPath(field) {
|
|
458
462
|
return [field.$$field, ...field.$$subfield].join("/");
|
|
459
463
|
}
|