@opencrvs/toolkit 1.9.6 → 1.9.7-rc.03e4d07

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 (59) hide show
  1. package/dist/commons/api/router.d.ts +29431 -2353
  2. package/dist/commons/conditionals/conditionals.d.ts +10 -1
  3. package/dist/commons/conditionals/validate.d.ts +11 -4
  4. package/dist/commons/events/ActionConfig.d.ts +25043 -1552
  5. package/dist/commons/events/ActionDocument.d.ts +803 -1856
  6. package/dist/commons/events/ActionInput.d.ts +277 -1073
  7. package/dist/commons/events/ActionType.d.ts +86 -9
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +228 -1238
  9. package/dist/commons/events/CompositeFieldValue.d.ts +29 -190
  10. package/dist/commons/events/Conditional.d.ts +26 -38
  11. package/dist/commons/events/Constants.d.ts +1 -1
  12. package/dist/commons/events/CountryConfigQueryInput.d.ts +1195 -4223
  13. package/dist/commons/events/DeduplicationConfig.d.ts +18 -150
  14. package/dist/commons/events/Draft.d.ts +70 -105
  15. package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
  16. package/dist/commons/events/EventConfig.d.ts +19988 -2120
  17. package/dist/commons/events/EventConfigInput.d.ts +1 -1
  18. package/dist/commons/events/EventDocument.d.ts +320 -1332
  19. package/dist/commons/events/EventIndex.d.ts +193 -980
  20. package/dist/commons/events/EventInput.d.ts +3 -8
  21. package/dist/commons/events/EventMetadata.d.ts +106 -347
  22. package/dist/commons/events/FieldConfig.d.ts +4545 -12303
  23. package/dist/commons/events/FieldType.d.ts +20 -4
  24. package/dist/commons/events/FieldTypeMapping.d.ts +193 -897
  25. package/dist/commons/events/FieldValue.d.ts +87 -396
  26. package/dist/commons/events/Flag.d.ts +67 -0
  27. package/dist/commons/events/FormConfig.d.ts +14022 -721
  28. package/dist/commons/events/PageConfig.d.ts +9368 -319
  29. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  30. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  31. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  32. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  33. package/dist/commons/events/WorkqueueConfig.d.ts +1865 -7177
  34. package/dist/commons/events/deduplication.d.ts +40 -3
  35. package/dist/commons/events/defineConfig.d.ts +26571 -147
  36. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  37. package/dist/commons/events/index.d.ts +1 -0
  38. package/dist/commons/events/locations.d.ts +26 -19
  39. package/dist/commons/events/scopes.d.ts +5 -4
  40. package/dist/commons/events/state/availableActions.d.ts +0 -2
  41. package/dist/commons/events/state/flags.d.ts +21 -3
  42. package/dist/commons/events/state/index.d.ts +22 -19
  43. package/dist/commons/events/state/utils.d.ts +130 -112
  44. package/dist/commons/events/test.utils.d.ts +31 -8
  45. package/dist/commons/events/transactions.d.ts +1 -1
  46. package/dist/commons/events/utils.d.ts +53180 -367
  47. package/dist/commons/notification/UserNotifications.d.ts +55 -636
  48. package/dist/conditionals/index.d.ts.map +1 -1
  49. package/dist/conditionals/index.js +45 -11
  50. package/dist/events/deduplication.d.ts +40 -3
  51. package/dist/events/deduplication.js +34 -0
  52. package/dist/events/index.js +2077 -1714
  53. package/dist/notification/index.d.ts.map +1 -1
  54. package/dist/notification/index.js +1677 -1558
  55. package/dist/scopes/index.d.ts +167 -132
  56. package/dist/scopes/index.d.ts.map +1 -1
  57. package/dist/scopes/index.js +133 -94
  58. package/package.json +5 -5
  59. package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
@@ -7,25 +7,62 @@ export declare function field(fieldId: string): {
7
7
  fieldId: string;
8
8
  type: "fuzzy";
9
9
  options: {
10
- boost?: number | undefined;
11
10
  fuzziness?: string | number | undefined;
11
+ boost?: number | undefined;
12
+ matchAgainst?: string | undefined;
12
13
  } | undefined;
13
14
  };
14
15
  strictMatches: (options?: StrictMatcherOptions) => {
15
16
  fieldId: string;
16
17
  type: "strict";
17
18
  options: {
18
- value?: string | undefined;
19
19
  boost?: number | undefined;
20
+ value?: string | undefined;
21
+ matchAgainst?: string | undefined;
20
22
  } | undefined;
21
23
  };
24
+ /**
25
+ * Creates a date range matcher that finds records where date field fall within a specified range.
26
+ *
27
+ * By default, matches against the field specified in `field()` (e.g., 'mother.dob').
28
+ * When `matchAgainst` is provided, it overwrites the default field and searches against that field with OR logic .
29
+ *
30
+ * @param options - Configuration for the date range matching
31
+ * @param options.days - Number of days before and after the target date to search (creates a ±days range)
32
+ * @param options.pivot - Optional. Distance in days where relevance scoring drops by 50%. Defaults to ⌊(days * 2) / 3⌋
33
+ * @param options.boost - Optional. Scoring boost multiplier for matching results. Defaults to 1
34
+ * @param options.matchAgainst - Optional. Additional field to match against. When provided,
35
+ * the query matches if the field fall within the date range. The default field is always excluded in the search in that case.
36
+ *
37
+ * @returns A clause that matches records where at least one of the specified date field is within the range
38
+ *
39
+ * @example
40
+ * // Matches only against mother.dob (±365 days)
41
+ * field('mother.dob').dateRangeMatches({ days: 365 })
42
+ *
43
+ * @example
44
+ * // Matches against mother.age OR spouse.dob, not mother.dob
45
+ * field('mother.dob').dateRangeMatches({
46
+ * days: 365,
47
+ * matchAgainst: $field('mother.age')
48
+ * })
49
+ *
50
+ * @example
51
+ * // With custom pivot and boost
52
+ * field('mother.dob').dateRangeMatches({
53
+ * days: 730,
54
+ * pivot: 365,
55
+ * boost: 2
56
+ * })
57
+ */
22
58
  dateRangeMatches: (options: DateRangeMatcherOptions) => {
23
59
  fieldId: string;
24
60
  type: "dateRange";
25
61
  options: {
26
62
  days: number;
27
- boost?: number | undefined;
28
63
  pivot?: number | undefined;
64
+ boost?: number | undefined;
65
+ matchAgainst?: string | undefined;
29
66
  };
30
67
  };
31
68
  };