@opencrvs/toolkit 1.8.0-rc.f8f3eb3 → 1.8.0-rc.f97f8f2

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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +11637 -10482
  3. package/dist/commons/conditionals/conditionals.d.ts +33 -6
  4. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  5. package/dist/commons/conditionals/validate.d.ts +39 -17
  6. package/dist/commons/conditionals/validate.test.d.ts +2 -0
  7. package/dist/commons/events/ActionConfig.d.ts +89415 -2021
  8. package/dist/commons/events/ActionDocument.d.ts +9820 -313
  9. package/dist/commons/events/ActionInput.d.ts +5365 -584
  10. package/dist/commons/events/ActionType.d.ts +27 -12
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +369 -25
  12. package/dist/commons/events/CompositeFieldValue.d.ts +155 -2
  13. package/dist/commons/events/Conditional.d.ts +21 -5
  14. package/dist/commons/events/CountryConfigQueryInput.d.ts +1506 -0
  15. package/dist/commons/events/Draft.d.ts +367 -54
  16. package/dist/commons/events/EventConfig.d.ts +42573 -1784
  17. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  18. package/dist/commons/events/EventDocument.d.ts +3526 -429
  19. package/dist/commons/events/EventIndex.d.ts +1548 -10
  20. package/dist/commons/events/EventInput.d.ts +13 -0
  21. package/dist/commons/events/EventMetadata.d.ts +277 -8
  22. package/dist/commons/events/FieldConfig.d.ts +4262 -800
  23. package/dist/commons/events/FieldType.d.ts +7 -2
  24. package/dist/commons/events/FieldTypeMapping.d.ts +164 -6
  25. package/dist/commons/events/FieldValue.d.ts +82 -5
  26. package/dist/commons/events/FormConfig.d.ts +40636 -73
  27. package/dist/commons/events/PageConfig.d.ts +10209 -0
  28. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  29. package/dist/commons/events/TemplateConfig.d.ts +38 -0
  30. package/dist/commons/events/User.d.ts +31 -2
  31. package/dist/commons/events/WorkqueueColumnConfig.d.ts +42 -0
  32. package/dist/commons/events/WorkqueueConfig.d.ts +2834 -19
  33. package/dist/commons/events/defineConfig.d.ts +7030 -230
  34. package/dist/commons/events/event.d.ts +27 -0
  35. package/dist/commons/events/field.d.ts +68 -0
  36. package/dist/commons/events/index.d.ts +9 -1
  37. package/dist/commons/events/scopes.d.ts +26 -0
  38. package/dist/commons/events/serializer.d.ts +2 -0
  39. package/dist/commons/events/test.utils.d.ts +128 -238
  40. package/dist/commons/events/utils.d.ts +3679 -69
  41. package/dist/commons/events/utils.test.d.ts +2 -0
  42. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  43. package/dist/conditionals/index.js +215 -110
  44. package/dist/events/index.js +3157 -1372
  45. package/dist/scopes/index.d.ts +105 -1
  46. package/dist/scopes/index.js +140 -0
  47. package/package.json +3 -2
@@ -0,0 +1,27 @@
1
+ import { EventFieldId } from './AdvancedSearchConfig';
2
+ import { EventMetadataKeys, EventMetadataParameter } from './EventMetadata';
3
+ import { SelectOption } from './FieldConfig';
4
+ /**
5
+ * Creates a function that acts like a callable + static method container.
6
+ *
7
+ * @example
8
+ * event('status') // → returns search config
9
+ * event.hasAction('CLICKED') // → returns conditional
10
+ */
11
+ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
12
+ fieldId: "status" | "trackingId";
13
+ options: {
14
+ value: string;
15
+ label: import("./TranslationConfig").TranslationConfig;
16
+ }[] | undefined;
17
+ config: {
18
+ type: "exact";
19
+ };
20
+ fieldType: "event";
21
+ };
22
+ declare const event: typeof eventFn & {
23
+ field(field: EventMetadataKeys): EventMetadataParameter;
24
+ hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
25
+ };
26
+ export { event };
27
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Entry point for defining conditional logic or configuration for a form field.
3
+ * @param fieldId - The ID of the field to define rules or config for.
4
+ * @returns An object combining conditional methods and configuration builders.
5
+ */
6
+ export declare function field(fieldId: string): {
7
+ range: () => {
8
+ config: {
9
+ type: "range";
10
+ };
11
+ fieldId: string;
12
+ fieldType: "field";
13
+ };
14
+ exact: () => {
15
+ config: {
16
+ type: "exact";
17
+ };
18
+ fieldId: string;
19
+ fieldType: "field";
20
+ };
21
+ fuzzy: () => {
22
+ config: {
23
+ type: "fuzzy";
24
+ };
25
+ fieldId: string;
26
+ fieldType: "field";
27
+ };
28
+ isAfter: () => {
29
+ days: (days: number) => {
30
+ inPast: () => import("../conditionals/conditionals").JSONSchema;
31
+ inFuture: () => import("../conditionals/conditionals").JSONSchema;
32
+ };
33
+ date: (date: string | {
34
+ [key: string]: unknown;
35
+ _fieldId: string;
36
+ }) => import("../conditionals/conditionals").JSONSchema;
37
+ now: () => import("../conditionals/conditionals").JSONSchema;
38
+ };
39
+ isBefore: () => {
40
+ days: (days: number) => {
41
+ inPast: () => import("../conditionals/conditionals").JSONSchema;
42
+ inFuture: () => import("../conditionals/conditionals").JSONSchema;
43
+ };
44
+ date: (date: string | {
45
+ [key: string]: unknown;
46
+ _fieldId: string;
47
+ }) => import("../conditionals/conditionals").JSONSchema;
48
+ now: () => import("../conditionals/conditionals").JSONSchema;
49
+ };
50
+ isEqualTo: (value: string | boolean | {
51
+ [key: string]: unknown;
52
+ _fieldId: string;
53
+ }) => import("../conditionals/conditionals").JSONSchema;
54
+ isFalsy: () => import("../conditionals/conditionals").JSONSchema;
55
+ isUndefined: () => import("../conditionals/conditionals").JSONSchema;
56
+ inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
57
+ isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
58
+ matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
59
+ isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
60
+ getId: () => {
61
+ fieldId: string;
62
+ };
63
+ /**
64
+ * @private Internal property used for field reference tracking.
65
+ */
66
+ _fieldId: string;
67
+ };
68
+ //# sourceMappingURL=field.d.ts.map
@@ -3,9 +3,11 @@ export * from './offline';
3
3
  export * from './EventConfig';
4
4
  export * from './EventConfigInput';
5
5
  export * from './FieldConfig';
6
- export * from './FormConfig';
6
+ export * from './PageConfig';
7
7
  export * from './SummaryConfig';
8
8
  export * from './WorkqueueConfig';
9
+ export * from './WorkqueueColumnConfig';
10
+ export * from './workqueueDefaultColumns';
9
11
  export * from './Draft';
10
12
  export * from './EventMetadata';
11
13
  export * from './EventInput';
@@ -15,6 +17,7 @@ export * from './ActionDocument';
15
17
  export * from './EventIndex';
16
18
  export * from './TranslationConfig';
17
19
  export * from './FieldValue';
20
+ export * from './FormConfig';
18
21
  export * from './CompositeFieldValue';
19
22
  export * from './state';
20
23
  export * from './utils';
@@ -28,6 +31,11 @@ export * from './FieldTypeMapping';
28
31
  export * from './Conditional';
29
32
  export * from './AdvancedSearchConfig';
30
33
  export * from './test.utils';
34
+ export * from './TemplateConfig';
35
+ export * from './scopes';
36
+ export * from './serializer';
31
37
  export * from '../conditionals/conditionals';
32
38
  export * from '../conditionals/validate';
39
+ export * from './field';
40
+ export * from './event';
33
41
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,26 @@
1
+ import { Scope } from '../scopes';
2
+ import { ActionType } from './ActionType';
3
+ export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
4
+ export declare const CONFIG_GET_ALLOWED_SCOPES: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records", "config", "config.update:all"];
5
+ export declare const CONFIG_SEARCH_ALLOWED_SCOPES: ("search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage")[];
6
+ export declare const ACTION_ALLOWED_SCOPES: {
7
+ READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"];
8
+ CREATE: ["record.declare-birth", "record.declaration-submit-incomplete", "record.declaration-submit-for-review"];
9
+ NOTIFY: ["record.declaration-submit-incomplete"];
10
+ DECLARE: ["record.declare-birth", "record.declaration-submit-for-approval", "record.register"];
11
+ DELETE: ["record.declare-birth"];
12
+ VALIDATE: ["record.declaration-submit-for-approval", "record.register"];
13
+ REGISTER: ["record.register"];
14
+ PRINT_CERTIFICATE: ["record.registration-print&issue-certified-copies"];
15
+ REQUEST_CORRECTION: ["record.registration-request-correction"];
16
+ REJECT_CORRECTION: ["record.registration-correct"];
17
+ APPROVE_CORRECTION: ["record.registration-correct"];
18
+ MARKED_AS_DUPLICATE: ["record.declaration-archive"];
19
+ ARCHIVE: ["record.declaration-archive"];
20
+ REJECT: ["record.declaration-submit-for-updates"];
21
+ ASSIGN: null;
22
+ UNASSIGN: null;
23
+ DETECT_DUPLICATE: [];
24
+ };
25
+ export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
26
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { deserializeQuery } from './serializers/user/deserializer';
2
+ //# sourceMappingURL=serializer.d.ts.map