@opencrvs/toolkit 1.8.0-rc.faeb298 → 1.8.0-rc.fafdecd

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +13709 -10901
  3. package/dist/commons/conditionals/conditionals.d.ts +31 -12
  4. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  5. package/dist/commons/conditionals/validate.d.ts +45 -17
  6. package/dist/commons/conditionals/validate.test.d.ts +2 -0
  7. package/dist/commons/events/ActionConfig.d.ts +124449 -3217
  8. package/dist/commons/events/ActionDocument.d.ts +13021 -780
  9. package/dist/commons/events/ActionInput.d.ts +8135 -1098
  10. package/dist/commons/events/ActionType.d.ts +31 -12
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +1260 -22
  12. package/dist/commons/events/CompositeFieldValue.d.ts +192 -11
  13. package/dist/commons/events/Conditional.d.ts +21 -5
  14. package/dist/commons/events/Constants.d.ts +3 -0
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +4132 -0
  16. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  17. package/dist/commons/events/Draft.d.ts +608 -114
  18. package/dist/commons/events/EventConfig.d.ts +59751 -2927
  19. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  20. package/dist/commons/events/EventDocument.d.ts +5806 -1003
  21. package/dist/commons/events/EventIndex.d.ts +2226 -24
  22. package/dist/commons/events/EventMetadata.d.ts +343 -42
  23. package/dist/commons/events/FieldConfig.d.ts +6240 -1011
  24. package/dist/commons/events/FieldType.d.ts +7 -3
  25. package/dist/commons/events/FieldTypeMapping.d.ts +264 -52
  26. package/dist/commons/events/FieldValue.d.ts +164 -20
  27. package/dist/commons/events/FormConfig.d.ts +52490 -275
  28. package/dist/commons/events/PageConfig.d.ts +13129 -0
  29. package/dist/commons/events/SummaryConfig.d.ts +93 -42
  30. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  31. package/dist/commons/events/User.d.ts +34 -2
  32. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  33. package/dist/commons/events/WorkqueueConfig.d.ts +8116 -20
  34. package/dist/commons/events/defineConfig.d.ts +9734 -458
  35. package/dist/commons/events/event.d.ts +46 -0
  36. package/dist/commons/events/field.d.ts +82 -0
  37. package/dist/commons/events/index.d.ts +10 -1
  38. package/dist/commons/events/scopes.d.ts +44 -0
  39. package/dist/commons/events/serializer.d.ts +2 -0
  40. package/dist/commons/events/test.utils.d.ts +280 -237
  41. package/dist/commons/events/transactions.d.ts +1 -1
  42. package/dist/commons/events/utils.d.ts +16261 -122
  43. package/dist/commons/events/utils.test.d.ts +2 -0
  44. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  45. package/dist/conditionals/index.js +211 -115
  46. package/dist/events/index.js +5431 -2046
  47. package/dist/scopes/index.d.ts +247 -1
  48. package/dist/scopes/index.js +231 -1
  49. package/package.json +4 -3
@@ -0,0 +1,46 @@
1
+ import { ActionType } from './ActionType';
2
+ import { EventFieldId } from './AdvancedSearchConfig';
3
+ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
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): {
12
+ range: () => {
13
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
14
+ fieldType: "event";
15
+ } & {
16
+ config: {
17
+ type: "range";
18
+ };
19
+ };
20
+ exact: () => {
21
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
22
+ fieldType: "event";
23
+ } & {
24
+ config: {
25
+ type: "exact";
26
+ };
27
+ };
28
+ fuzzy: () => {
29
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
30
+ fieldType: "event";
31
+ } & {
32
+ config: {
33
+ type: "fuzzy";
34
+ };
35
+ };
36
+ };
37
+ declare const event: typeof eventFn & {
38
+ /**
39
+ * Checks if the event contains a specific action type.
40
+ * @param action - The action type to check for.
41
+ */
42
+ hasAction: (action: ActionType) => import("../conditionals/conditionals").JSONSchema;
43
+ field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
44
+ };
45
+ export { event };
46
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1,82 @@
1
+ import { FieldConditional } from './Conditional';
2
+ import { TranslationConfig } from './TranslationConfig';
3
+ import { ValidationConfig } from './FieldConfig';
4
+ /**
5
+ * Entry point for defining conditional logic or configuration for a form field.
6
+ * @param fieldId - The ID of the field to define rules or config for.
7
+ * @returns An object combining conditional methods and configuration builders.
8
+ */
9
+ export declare function field(fieldId: string, options?: {
10
+ conditionals?: FieldConditional[];
11
+ validations?: ValidationConfig[];
12
+ searchCriteriaLabelPrefix?: TranslationConfig;
13
+ }): {
14
+ range: () => {
15
+ conditionals?: FieldConditional[];
16
+ validations?: ValidationConfig[];
17
+ searchCriteriaLabelPrefix?: TranslationConfig;
18
+ fieldId: string;
19
+ fieldType: "field";
20
+ } & {
21
+ config: {
22
+ type: "range";
23
+ };
24
+ };
25
+ exact: () => {
26
+ conditionals?: FieldConditional[];
27
+ validations?: ValidationConfig[];
28
+ searchCriteriaLabelPrefix?: TranslationConfig;
29
+ fieldId: string;
30
+ fieldType: "field";
31
+ } & {
32
+ config: {
33
+ type: "exact";
34
+ };
35
+ };
36
+ fuzzy: () => {
37
+ conditionals?: FieldConditional[];
38
+ validations?: ValidationConfig[];
39
+ searchCriteriaLabelPrefix?: TranslationConfig;
40
+ fieldId: string;
41
+ fieldType: "field";
42
+ } & {
43
+ config: {
44
+ type: "fuzzy";
45
+ };
46
+ };
47
+ $$field: string;
48
+ isAfter: () => {
49
+ days: (days: number) => {
50
+ inPast: () => import("../conditionals/conditionals").JSONSchema;
51
+ inFuture: () => import("../conditionals/conditionals").JSONSchema;
52
+ };
53
+ date: (date: string | {
54
+ $$field: string;
55
+ }) => import("../conditionals/conditionals").JSONSchema;
56
+ now: () => import("../conditionals/conditionals").JSONSchema;
57
+ };
58
+ isBefore: () => {
59
+ days: (days: number) => {
60
+ inPast: () => import("../conditionals/conditionals").JSONSchema;
61
+ inFuture: () => import("../conditionals/conditionals").JSONSchema;
62
+ };
63
+ date: (date: string | {
64
+ $$field: string;
65
+ }) => import("../conditionals/conditionals").JSONSchema;
66
+ now: () => import("../conditionals/conditionals").JSONSchema;
67
+ };
68
+ isEqualTo: (value: string | boolean | {
69
+ $$field: string;
70
+ }) => import("../conditionals/conditionals").JSONSchema;
71
+ isFalsy: () => import("../conditionals/conditionals").JSONSchema;
72
+ isUndefined: () => import("../conditionals/conditionals").JSONSchema;
73
+ inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
74
+ isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
75
+ matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
76
+ isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
77
+ getId: () => {
78
+ fieldId: string;
79
+ };
80
+ object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
81
+ };
82
+ //# sourceMappingURL=field.d.ts.map
@@ -1,11 +1,14 @@
1
+ export * from './Constants';
1
2
  export * from './ActionConfig';
2
3
  export * from './offline';
3
4
  export * from './EventConfig';
4
5
  export * from './EventConfigInput';
5
6
  export * from './FieldConfig';
6
- export * from './FormConfig';
7
+ export * from './PageConfig';
7
8
  export * from './SummaryConfig';
8
9
  export * from './WorkqueueConfig';
10
+ export * from './WorkqueueColumnConfig';
11
+ export * from './workqueueDefaultColumns';
9
12
  export * from './Draft';
10
13
  export * from './EventMetadata';
11
14
  export * from './EventInput';
@@ -15,6 +18,7 @@ export * from './ActionDocument';
15
18
  export * from './EventIndex';
16
19
  export * from './TranslationConfig';
17
20
  export * from './FieldValue';
21
+ export * from './FormConfig';
18
22
  export * from './CompositeFieldValue';
19
23
  export * from './state';
20
24
  export * from './utils';
@@ -29,6 +33,11 @@ export * from './Conditional';
29
33
  export * from './AdvancedSearchConfig';
30
34
  export * from './test.utils';
31
35
  export * from './TemplateConfig';
36
+ export * from './scopes';
37
+ export * from './serializer';
38
+ export * from './state/availableActions';
32
39
  export * from '../conditionals/conditionals';
33
40
  export * from '../conditionals/validate';
41
+ export * from './field';
42
+ export * from './event';
34
43
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { Scope } from '../scopes';
2
+ 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"];
3
+ 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")[];
4
+ export declare const ACTION_ALLOWED_SCOPES: {
5
+ READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"];
6
+ CREATE: ["record.declare-birth", "record.declaration-submit-incomplete", "record.declaration-submit-for-review"];
7
+ NOTIFY: ["record.declaration-submit-incomplete"];
8
+ DECLARE: ["record.declare-birth", "record.declaration-submit-for-approval", "record.register"];
9
+ DELETE: ["record.declare-birth"];
10
+ VALIDATE: ["record.declaration-submit-for-approval", "record.register"];
11
+ REGISTER: ["record.register"];
12
+ PRINT_CERTIFICATE: ["record.registration-print&issue-certified-copies"];
13
+ REQUEST_CORRECTION: ["record.registration-request-correction"];
14
+ REJECT_CORRECTION: ["record.registration-correct"];
15
+ APPROVE_CORRECTION: ["record.registration-correct"];
16
+ MARKED_AS_DUPLICATE: ["record.declaration-archive"];
17
+ ARCHIVE: ["record.declaration-archive"];
18
+ REJECT: ["record.declaration-submit-for-updates"];
19
+ ASSIGN: null;
20
+ UNASSIGN: null;
21
+ DETECT_DUPLICATE: [];
22
+ };
23
+ export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
24
+ READ: never[];
25
+ CREATE: "record.notify"[];
26
+ NOTIFY: "record.notify"[];
27
+ DECLARE: never[];
28
+ DELETE: never[];
29
+ VALIDATE: never[];
30
+ REGISTER: never[];
31
+ PRINT_CERTIFICATE: never[];
32
+ REQUEST_CORRECTION: never[];
33
+ REJECT_CORRECTION: never[];
34
+ APPROVE_CORRECTION: never[];
35
+ MARKED_AS_DUPLICATE: never[];
36
+ ARCHIVE: never[];
37
+ REJECT: never[];
38
+ ASSIGN: never[];
39
+ UNASSIGN: never[];
40
+ DETECT_DUPLICATE: never[];
41
+ };
42
+ export declare const WRITE_ACTION_SCOPES: ("record.declare-birth" | "record.declaration-submit-for-approval" | "record.register" | "record.registration-print&issue-certified-copies")[];
43
+ export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
44
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { deserializeQuery } from './serializers/user/deserializer';
2
+ //# sourceMappingURL=serializer.d.ts.map