@opencrvs/toolkit 1.9.8-rc.0cafd28 → 1.9.8-rc.0cf339f
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 +31001 -2467
- package/dist/commons/conditionals/conditionals.d.ts +1037 -1
- package/dist/commons/conditionals/validate.d.ts +11 -4
- package/dist/commons/events/ActionConfig.d.ts +26853 -1552
- package/dist/commons/events/ActionDocument.d.ts +846 -1899
- package/dist/commons/events/ActionInput.d.ts +277 -1073
- package/dist/commons/events/ActionType.d.ts +86 -9
- package/dist/commons/events/AdvancedSearchConfig.d.ts +228 -1238
- package/dist/commons/events/CompositeFieldValue.d.ts +29 -190
- package/dist/commons/events/Conditional.d.ts +26 -38
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1195 -4223
- package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
- package/dist/commons/events/Draft.d.ts +71 -106
- package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
- package/dist/commons/events/EventConfig.d.ts +21436 -2120
- package/dist/commons/events/EventConfigInput.d.ts +1 -1
- package/dist/commons/events/EventDocument.d.ts +337 -1349
- package/dist/commons/events/EventIndex.d.ts +196 -983
- package/dist/commons/events/EventInput.d.ts +3 -8
- package/dist/commons/events/EventMetadata.d.ts +113 -354
- package/dist/commons/events/FieldConfig.d.ts +4974 -12346
- package/dist/commons/events/FieldType.d.ts +20 -4
- package/dist/commons/events/FieldTypeMapping.d.ts +193 -897
- package/dist/commons/events/FieldValue.d.ts +87 -396
- package/dist/commons/events/Flag.d.ts +67 -0
- package/dist/commons/events/FormConfig.d.ts +15108 -721
- package/dist/commons/events/PageConfig.d.ts +10092 -319
- package/dist/commons/events/SummaryConfig.d.ts +14 -161
- package/dist/commons/events/TemplateConfig.d.ts +2 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
- package/dist/commons/events/WorkqueueConfig.d.ts +1865 -7177
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +28019 -147
- package/dist/commons/events/eventConfigValidation.d.ts +8 -0
- package/dist/commons/events/field.d.ts +154 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locations.d.ts +26 -19
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/availableActions.d.ts +0 -2
- package/dist/commons/events/state/flags.d.ts +21 -3
- package/dist/commons/events/state/index.d.ts +24 -21
- package/dist/commons/events/state/utils.d.ts +150 -132
- package/dist/commons/events/test.utils.d.ts +31 -8
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +56079 -370
- package/dist/commons/notification/UserNotifications.d.ts +55 -636
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +155 -11
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +2210 -1734
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1802 -1571
- package/dist/scopes/index.d.ts +169 -133
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +135 -94
- package/package.json +5 -5
- package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { EventConfig } from './EventConfig';
|
|
3
|
+
export declare function validateAdvancedSearchConfig(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
|
|
4
|
+
export declare function validateDateOfEvent(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
|
|
5
|
+
export declare function validatePlaceOfEvent(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
|
|
6
|
+
export declare function validateActionFlags(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
|
|
7
|
+
export declare function validateActionOrder(event: EventConfig, ctx: z.RefinementCtx<EventConfig>): void;
|
|
8
|
+
//# sourceMappingURL=eventConfigValidation.d.ts.map
|
|
@@ -124,6 +124,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
124
124
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
125
125
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
126
126
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
127
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
128
|
+
$now: string;
|
|
129
|
+
$online: boolean;
|
|
130
|
+
} & {
|
|
131
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
132
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
133
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
134
|
+
$now: string;
|
|
135
|
+
$online: boolean;
|
|
136
|
+
} & {
|
|
137
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
138
|
+
}) => any): {
|
|
139
|
+
$$code: string;
|
|
140
|
+
};
|
|
127
141
|
getId: () => {
|
|
128
142
|
fieldId: string;
|
|
129
143
|
};
|
|
@@ -182,6 +196,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
182
196
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
183
197
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
184
198
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
199
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
200
|
+
$now: string;
|
|
201
|
+
$online: boolean;
|
|
202
|
+
} & {
|
|
203
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
204
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
205
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
206
|
+
$now: string;
|
|
207
|
+
$online: boolean;
|
|
208
|
+
} & {
|
|
209
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
210
|
+
}) => any): {
|
|
211
|
+
$$code: string;
|
|
212
|
+
};
|
|
185
213
|
getId: () => {
|
|
186
214
|
fieldId: string;
|
|
187
215
|
};
|
|
@@ -248,6 +276,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
248
276
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
249
277
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
250
278
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
279
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
280
|
+
$now: string;
|
|
281
|
+
$online: boolean;
|
|
282
|
+
} & {
|
|
283
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
284
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
285
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
286
|
+
$now: string;
|
|
287
|
+
$online: boolean;
|
|
288
|
+
} & {
|
|
289
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
290
|
+
}) => any): {
|
|
291
|
+
$$code: string;
|
|
292
|
+
};
|
|
251
293
|
getId: () => {
|
|
252
294
|
fieldId: string;
|
|
253
295
|
};
|
|
@@ -312,6 +354,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
312
354
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
313
355
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
314
356
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
357
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
358
|
+
$now: string;
|
|
359
|
+
$online: boolean;
|
|
360
|
+
} & {
|
|
361
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
362
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
363
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
364
|
+
$now: string;
|
|
365
|
+
$online: boolean;
|
|
366
|
+
} & {
|
|
367
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
368
|
+
}) => any): {
|
|
369
|
+
$$code: string;
|
|
370
|
+
};
|
|
315
371
|
getId: () => {
|
|
316
372
|
fieldId: string;
|
|
317
373
|
};
|
|
@@ -375,6 +431,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
375
431
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
376
432
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
377
433
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
434
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
435
|
+
$now: string;
|
|
436
|
+
$online: boolean;
|
|
437
|
+
} & {
|
|
438
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
439
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
440
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
441
|
+
$now: string;
|
|
442
|
+
$online: boolean;
|
|
443
|
+
} & {
|
|
444
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
445
|
+
}) => any): {
|
|
446
|
+
$$code: string;
|
|
447
|
+
};
|
|
378
448
|
getId: () => {
|
|
379
449
|
fieldId: string;
|
|
380
450
|
};
|
|
@@ -431,6 +501,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
431
501
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
432
502
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
433
503
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
504
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
505
|
+
$now: string;
|
|
506
|
+
$online: boolean;
|
|
507
|
+
} & {
|
|
508
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
509
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
510
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
511
|
+
$now: string;
|
|
512
|
+
$online: boolean;
|
|
513
|
+
} & {
|
|
514
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
515
|
+
}) => any): {
|
|
516
|
+
$$code: string;
|
|
517
|
+
};
|
|
434
518
|
getId: () => {
|
|
435
519
|
fieldId: string;
|
|
436
520
|
};
|
|
@@ -498,6 +582,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
498
582
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
499
583
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
500
584
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
585
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
586
|
+
$now: string;
|
|
587
|
+
$online: boolean;
|
|
588
|
+
} & {
|
|
589
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
590
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
591
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
592
|
+
$now: string;
|
|
593
|
+
$online: boolean;
|
|
594
|
+
} & {
|
|
595
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
596
|
+
}) => any): {
|
|
597
|
+
$$code: string;
|
|
598
|
+
};
|
|
501
599
|
getId: () => {
|
|
502
600
|
fieldId: string;
|
|
503
601
|
};
|
|
@@ -556,6 +654,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
556
654
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
557
655
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
558
656
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
657
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
658
|
+
$now: string;
|
|
659
|
+
$online: boolean;
|
|
660
|
+
} & {
|
|
661
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
662
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
663
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
664
|
+
$now: string;
|
|
665
|
+
$online: boolean;
|
|
666
|
+
} & {
|
|
667
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
668
|
+
}) => any): {
|
|
669
|
+
$$code: string;
|
|
670
|
+
};
|
|
559
671
|
getId: () => {
|
|
560
672
|
fieldId: string;
|
|
561
673
|
};
|
|
@@ -623,6 +735,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
623
735
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
624
736
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
625
737
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
738
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
739
|
+
$now: string;
|
|
740
|
+
$online: boolean;
|
|
741
|
+
} & {
|
|
742
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
743
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
744
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
745
|
+
$now: string;
|
|
746
|
+
$online: boolean;
|
|
747
|
+
} & {
|
|
748
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
749
|
+
}) => any): {
|
|
750
|
+
$$code: string;
|
|
751
|
+
};
|
|
626
752
|
getId: () => {
|
|
627
753
|
fieldId: string;
|
|
628
754
|
};
|
|
@@ -681,6 +807,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
681
807
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
682
808
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
683
809
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
810
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
811
|
+
$now: string;
|
|
812
|
+
$online: boolean;
|
|
813
|
+
} & {
|
|
814
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
815
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
816
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
817
|
+
$now: string;
|
|
818
|
+
$online: boolean;
|
|
819
|
+
} & {
|
|
820
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
821
|
+
}) => any): {
|
|
822
|
+
$$code: string;
|
|
823
|
+
};
|
|
684
824
|
getId: () => {
|
|
685
825
|
fieldId: string;
|
|
686
826
|
};
|
|
@@ -737,6 +877,20 @@ export declare function field(fieldId: string, options?: {
|
|
|
737
877
|
isValidAdministrativeLeafLevel(): import("../conditionals/conditionals").JSONSchema;
|
|
738
878
|
matches(pattern: string): import("../conditionals/conditionals").JSONSchema;
|
|
739
879
|
isBetween(min: number, max: number): import("../conditionals/conditionals").JSONSchema;
|
|
880
|
+
customClientValidator(fn: (value: unknown, context: {
|
|
881
|
+
$now: string;
|
|
882
|
+
$online: boolean;
|
|
883
|
+
} & {
|
|
884
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
885
|
+
}) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
886
|
+
customClientEvaluation(fn: (value: unknown, context: {
|
|
887
|
+
$now: string;
|
|
888
|
+
$online: boolean;
|
|
889
|
+
} & {
|
|
890
|
+
$form: import("./ActionDocument").EventState | Record<string, unknown>;
|
|
891
|
+
}) => any): {
|
|
892
|
+
$$code: string;
|
|
893
|
+
};
|
|
740
894
|
getId: () => {
|
|
741
895
|
fieldId: string;
|
|
742
896
|
};
|
|
@@ -39,6 +39,7 @@ export * from './FileUtils';
|
|
|
39
39
|
export * from '../conditionals/conditionals';
|
|
40
40
|
export * from '../conditionals/validate';
|
|
41
41
|
export * from './field';
|
|
42
|
+
export * from './Flag';
|
|
42
43
|
export * from './event';
|
|
43
44
|
export * from './locations';
|
|
44
45
|
export { UUID } from '../uuid';
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
/** @deprecated */
|
|
3
|
+
export declare const LocationTypeV1: z.ZodEnum<{
|
|
4
|
+
ADMIN_STRUCTURE: "ADMIN_STRUCTURE";
|
|
5
|
+
HEALTH_FACILITY: "HEALTH_FACILITY";
|
|
6
|
+
CRVS_OFFICE: "CRVS_OFFICE";
|
|
7
|
+
}>;
|
|
8
|
+
export type LocationTypeV1 = z.infer<typeof LocationTypeV1>;
|
|
9
|
+
export declare const LocationType: z.ZodEnum<{
|
|
10
|
+
HEALTH_FACILITY: "HEALTH_FACILITY";
|
|
11
|
+
CRVS_OFFICE: "CRVS_OFFICE";
|
|
12
|
+
}>;
|
|
3
13
|
export type LocationType = z.infer<typeof LocationType>;
|
|
14
|
+
export declare const AdministrativeArea: z.ZodObject<{
|
|
15
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID">;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>;
|
|
19
|
+
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type AdministrativeArea = z.infer<typeof AdministrativeArea>;
|
|
4
22
|
export declare const Location: z.ZodObject<{
|
|
5
|
-
id: z.ZodBranded<z.
|
|
23
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID">;
|
|
6
24
|
name: z.ZodString;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
name: string;
|
|
13
|
-
parentId: (string & z.BRAND<"UUID">) | null;
|
|
14
|
-
validUntil: string | null;
|
|
15
|
-
locationType: "ADMIN_STRUCTURE" | "HEALTH_FACILITY" | "CRVS_OFFICE" | null;
|
|
16
|
-
}, {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
parentId: string | null;
|
|
20
|
-
validUntil: string | null;
|
|
21
|
-
locationType: "ADMIN_STRUCTURE" | "HEALTH_FACILITY" | "CRVS_OFFICE" | null;
|
|
22
|
-
}>;
|
|
25
|
+
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>;
|
|
27
|
+
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
28
|
+
locationType: z.ZodNullable<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
23
30
|
export type Location = z.infer<typeof Location>;
|
|
24
31
|
//# sourceMappingURL=locations.d.ts.map
|
|
@@ -5,9 +5,9 @@ export declare const ACTION_SCOPE_MAP: {
|
|
|
5
5
|
READ: "record.read"[];
|
|
6
6
|
CREATE: "record.create"[];
|
|
7
7
|
NOTIFY: "record.notify"[];
|
|
8
|
-
DECLARE: ("record.register" | "record.declare"
|
|
8
|
+
DECLARE: ("record.register" | "record.declare")[];
|
|
9
|
+
EDIT: "record.declared.edit"[];
|
|
9
10
|
DELETE: "record.declare"[];
|
|
10
|
-
VALIDATE: ("record.register" | "record.declared.validate")[];
|
|
11
11
|
REGISTER: "record.register"[];
|
|
12
12
|
PRINT_CERTIFICATE: "record.registered.print-certified-copies"[];
|
|
13
13
|
REQUEST_CORRECTION: ("record.registered.request-correction" | "record.registered.correct")[];
|
|
@@ -21,9 +21,10 @@ export declare const ACTION_SCOPE_MAP: {
|
|
|
21
21
|
ASSIGN: null;
|
|
22
22
|
UNASSIGN: null;
|
|
23
23
|
DUPLICATE_DETECTED: never[];
|
|
24
|
+
CUSTOM: never[];
|
|
24
25
|
};
|
|
25
26
|
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
|
26
|
-
export declare function configurableEventScopeAllowed(scopes: Scope[], allowedConfigurableScopes: ConfigurableScopeType[], eventType: string): boolean;
|
|
27
|
+
export declare function configurableEventScopeAllowed(scopes: Scope[], allowedConfigurableScopes: ConfigurableScopeType[], eventType: string, customActionType?: string): boolean;
|
|
27
28
|
/**
|
|
28
29
|
* Checks if a given action is allowed for the provided scopes and event type.
|
|
29
30
|
*
|
|
@@ -36,7 +37,7 @@ export declare function configurableEventScopeAllowed(scopes: Scope[], allowedCo
|
|
|
36
37
|
* @param {string} eventType - The type of event for which the action is being checked.
|
|
37
38
|
* @returns {boolean} True if the action is in scope for the user, otherwise false.
|
|
38
39
|
*/
|
|
39
|
-
export declare function isActionInScope(scopes: Scope[], action: DisplayableAction, eventType: string): boolean;
|
|
40
|
+
export declare function isActionInScope(scopes: Scope[], action: DisplayableAction, eventType: string, customActionType?: string): boolean;
|
|
40
41
|
/**
|
|
41
42
|
* A shared utility to check if the user can read a record.
|
|
42
43
|
* This will be removed in 1.10 and implemented by scopes.
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { DisplayableAction } from '../ActionType';
|
|
2
2
|
import { EventIndex } from '../EventIndex';
|
|
3
|
-
import { EventStatus, Flag } from '../EventMetadata';
|
|
4
|
-
export declare function getAvailableActions(status: EventStatus, flags: Flag[]): DisplayableAction[];
|
|
5
3
|
export declare function getAvailableActionsForEvent(event: EventIndex): DisplayableAction[];
|
|
6
4
|
//# sourceMappingURL=availableActions.d.ts.map
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Flag, CustomFlag } from '../Flag';
|
|
2
|
+
import { EventConfig } from '../EventConfig';
|
|
3
|
+
import { EventDocument } from '../EventDocument';
|
|
4
|
+
/**
|
|
5
|
+
* This function resolves custom flags for an event based on its actions.
|
|
6
|
+
* Flags are not stored to the event state or any database directly, instead they are always computed/evaluated from the event actions.
|
|
7
|
+
*
|
|
8
|
+
* Processes accepted actions in chronological order, evaluating flag conditions
|
|
9
|
+
* at each action step. Flags can be added or removed based on action configurations
|
|
10
|
+
* and conditional logic. Duplicate flags are filtered out.
|
|
11
|
+
*
|
|
12
|
+
* @param event - The event document containing actions and metadata
|
|
13
|
+
* @param eventConfiguration - The configuration object for the event type defining action rules and flag behaviors
|
|
14
|
+
* @returns An array of unique custom flag IDs that apply to the event after processing all non-meta actions
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const flags = resolveEventCustomFlags(eventDoc, config);
|
|
18
|
+
* // Returns: ['flag-1', 'flag-3']
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveEventCustomFlags(event: EventDocument, eventConfiguration: EventConfig): CustomFlag[];
|
|
21
|
+
export declare function getEventFlags(event: EventDocument, config: EventConfig): Flag[];
|
|
4
22
|
//# sourceMappingURL=flags.d.ts.map
|
|
@@ -7,7 +7,7 @@ import { Draft } from '../Draft';
|
|
|
7
7
|
import { EventConfig } from '../EventConfig';
|
|
8
8
|
import { UUID } from '../../uuid';
|
|
9
9
|
import { DocumentPath, FullDocumentPath, FullDocumentUrl } from '../../documents';
|
|
10
|
-
export declare function getStatusFromActions(actions: Array<Action>): "ARCHIVED" | "DECLARED" | "REGISTERED" | "
|
|
10
|
+
export declare function getStatusFromActions(actions: Array<Action>): "ARCHIVED" | "DECLARED" | "REGISTERED" | "CREATED" | "NOTIFIED";
|
|
11
11
|
export declare function getAssignedUserFromActions(actions: Array<ActionDocument>): string | null;
|
|
12
12
|
export declare function getAssignedUserSignatureFromActions(actions: Array<ActionDocument>): string | null;
|
|
13
13
|
type NonNullableDeep<T> = T extends [unknown, ...unknown[]] ? {
|
|
@@ -28,6 +28,10 @@ export declare const DEFAULT_DATE_OF_EVENT_PROPERTY = "createdAt";
|
|
|
28
28
|
export declare function resolveDateOfEvent(eventMetadata: {
|
|
29
29
|
createdAt: string;
|
|
30
30
|
}, declaration: EventState, config: EventConfig): string | undefined;
|
|
31
|
+
export declare const DEFAULT_PLACE_OF_EVENT_PROPERTY = "createdAtLocation";
|
|
32
|
+
export declare function resolvePlaceOfEvent(eventMetadata: {
|
|
33
|
+
createdAtLocation?: UUID | undefined | null;
|
|
34
|
+
}, declaration: EventState, config: EventConfig): UUID | undefined | null;
|
|
31
35
|
export declare function extractPotentialDuplicatesFromActions(actions: Action[]): PotentialDuplicate[];
|
|
32
36
|
/**
|
|
33
37
|
* NOTE: This function should not run field validations. It should return the state based on the actions, without considering context (users, roles, permissions, etc).
|
|
@@ -38,9 +42,7 @@ export declare function extractPotentialDuplicatesFromActions(actions: Action[])
|
|
|
38
42
|
* @returns Calculates a snapshot summary of the event based on the actions taken on it.
|
|
39
43
|
* @see EventIndex for the description of the returned object.
|
|
40
44
|
*/
|
|
41
|
-
export declare function getCurrentEventState(event: EventDocument,
|
|
42
|
-
/** @TODO: remove config parameter, it is only used by resolveDateOfEvent. See if it can be achieved in some other way. */
|
|
43
|
-
config: EventConfig): EventIndex;
|
|
45
|
+
export declare function getCurrentEventState(event: EventDocument, config: EventConfig): EventIndex;
|
|
44
46
|
/**
|
|
45
47
|
* @returns the future state of the event with drafts applied to all fields.
|
|
46
48
|
*
|
|
@@ -62,47 +64,48 @@ export declare function applyDeclarationToEventIndex(eventIndex: EventIndex, dec
|
|
|
62
64
|
*
|
|
63
65
|
*/
|
|
64
66
|
export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Draft, eventConfiguration: EventConfig): {
|
|
67
|
+
id: string & import("zod").$brand<"UUID">;
|
|
65
68
|
type: string;
|
|
66
|
-
|
|
67
|
-
status: "ARCHIVED" | "DECLARED" | "REGISTERED" | "VALIDATED" | "CREATED" | "NOTIFIED";
|
|
68
|
-
createdAt: string;
|
|
69
|
-
createdBy: string;
|
|
70
|
-
declaration: Record<string, import("..").FieldValue>;
|
|
71
|
-
trackingId: string;
|
|
72
|
-
updatedAt: string;
|
|
69
|
+
status: "ARCHIVED" | "DECLARED" | "REGISTERED" | "CREATED" | "NOTIFIED";
|
|
73
70
|
legalStatuses: {
|
|
74
71
|
DECLARED?: {
|
|
75
72
|
createdAt: string;
|
|
76
73
|
createdBy: string;
|
|
77
|
-
createdByRole: string;
|
|
78
74
|
acceptedAt: string;
|
|
75
|
+
createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
79
76
|
createdByUserType?: "system" | "user" | null | undefined;
|
|
77
|
+
createdByRole?: string | undefined;
|
|
80
78
|
createdBySignature?: string | null | undefined;
|
|
81
|
-
createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
|
|
82
79
|
} | null | undefined;
|
|
83
80
|
REGISTERED?: {
|
|
84
81
|
createdAt: string;
|
|
85
82
|
createdBy: string;
|
|
86
|
-
createdByRole: string;
|
|
87
|
-
registrationNumber: string;
|
|
88
83
|
acceptedAt: string;
|
|
84
|
+
registrationNumber: string;
|
|
85
|
+
createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
89
86
|
createdByUserType?: "system" | "user" | null | undefined;
|
|
87
|
+
createdByRole?: string | undefined;
|
|
90
88
|
createdBySignature?: string | null | undefined;
|
|
91
|
-
createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
|
|
92
89
|
} | null | undefined;
|
|
93
90
|
};
|
|
94
|
-
|
|
91
|
+
createdAt: string;
|
|
92
|
+
createdBy: string;
|
|
93
|
+
updatedAt: string;
|
|
94
|
+
trackingId: string;
|
|
95
95
|
potentialDuplicates: {
|
|
96
|
-
id: string & import("zod")
|
|
96
|
+
id: string & import("zod").$brand<"UUID">;
|
|
97
97
|
trackingId: string;
|
|
98
98
|
}[];
|
|
99
99
|
flags: string[];
|
|
100
|
+
declaration: Record<string, import("..").FieldValue>;
|
|
101
|
+
dateOfEvent?: string | null | undefined;
|
|
102
|
+
placeOfEvent?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
100
103
|
createdByUserType?: "system" | "user" | null | undefined;
|
|
104
|
+
updatedByUserRole?: string | null | undefined;
|
|
105
|
+
createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
101
106
|
createdBySignature?: string | null | undefined;
|
|
102
|
-
|
|
107
|
+
updatedAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
103
108
|
assignedTo?: string | null | undefined;
|
|
104
|
-
dateOfEvent?: string | null | undefined;
|
|
105
|
-
updatedAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
|
|
106
109
|
updatedBy?: string | null | undefined;
|
|
107
110
|
};
|
|
108
111
|
/**
|