@nira-opencrvs/toolkit 1.9.11-rc.39d8d68
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/README.md +70 -0
- package/build.sh +56 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +52 -0
- package/dist/commons/api/router.d.ts +4125 -0
- package/dist/commons/conditionals/conditionals.d.ts +824 -0
- package/dist/commons/conditionals/index.d.ts +2 -0
- package/dist/commons/conditionals/validate.d.ts +101 -0
- package/dist/commons/events/ActionConfig.d.ts +1609 -0
- package/dist/commons/events/ActionDocument.d.ts +2180 -0
- package/dist/commons/events/ActionInput.d.ts +1229 -0
- package/dist/commons/events/ActionType.d.ts +52 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1538 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +280 -0
- package/dist/commons/events/Conditional.d.ts +55 -0
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4784 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +233 -0
- package/dist/commons/events/Draft.d.ts +118 -0
- package/dist/commons/events/DynamicFieldValue.d.ts +139 -0
- package/dist/commons/events/EventConfig.d.ts +2255 -0
- package/dist/commons/events/EventConfigInput.d.ts +10 -0
- package/dist/commons/events/EventDocument.d.ts +1457 -0
- package/dist/commons/events/EventIndex.d.ts +1134 -0
- package/dist/commons/events/EventInput.d.ts +13 -0
- package/dist/commons/events/EventMetadata.d.ts +413 -0
- package/dist/commons/events/FieldConfig.d.ts +12935 -0
- package/dist/commons/events/FieldType.d.ts +55 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1289 -0
- package/dist/commons/events/FieldValue.d.ts +512 -0
- package/dist/commons/events/FileUtils.d.ts +4 -0
- package/dist/commons/events/FormConfig.d.ts +755 -0
- package/dist/commons/events/PageConfig.d.ts +342 -0
- package/dist/commons/events/PlainDate.d.ts +19 -0
- package/dist/commons/events/SummaryConfig.d.ts +170 -0
- package/dist/commons/events/TemplateConfig.d.ts +66 -0
- package/dist/commons/events/TranslationConfig.d.ts +15 -0
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +7957 -0
- package/dist/commons/events/deduplication.d.ts +69 -0
- package/dist/commons/events/defineConfig.d.ts +234 -0
- package/dist/commons/events/event.d.ts +80 -0
- package/dist/commons/events/field.d.ts +514 -0
- package/dist/commons/events/index.d.ts +45 -0
- package/dist/commons/events/locations.d.ts +24 -0
- package/dist/commons/events/scopes.d.ts +55 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/state/availableActions.d.ts +6 -0
- package/dist/commons/events/state/flags.d.ts +4 -0
- package/dist/commons/events/state/index.d.ts +119 -0
- package/dist/commons/events/state/utils.d.ts +311 -0
- package/dist/commons/events/test.utils.d.ts +248 -0
- package/dist/commons/events/transactions.d.ts +2 -0
- package/dist/commons/events/utils.d.ts +486 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/commons/notification/UserNotifications.d.ts +762 -0
- package/dist/commons/notification/index.d.ts +2 -0
- package/dist/conditionals/index.d.ts +2 -0
- package/dist/conditionals/index.d.ts.map +1 -0
- package/dist/conditionals/index.js +689 -0
- package/dist/events/deduplication.d.ts +69 -0
- package/dist/events/deduplication.d.ts.map +1 -0
- package/dist/events/deduplication.js +101 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +9327 -0
- package/dist/notification/index.d.ts +2 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/index.js +6674 -0
- package/dist/scopes/index.d.ts +385 -0
- package/dist/scopes/index.d.ts.map +1 -0
- package/dist/scopes/index.js +349 -0
- package/package.json +40 -0
- package/tsconfig.json +27 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ClauseInput, DateRangeMatcherOptions, FuzzyMatcherOptions, StrictMatcherOptions } from '.';
|
|
2
|
+
export declare function not(clause: ClauseInput): ClauseInput;
|
|
3
|
+
export declare function and(...clauses: ClauseInput[]): ClauseInput;
|
|
4
|
+
export declare function or(...clauses: ClauseInput[]): ClauseInput;
|
|
5
|
+
export declare function field(fieldId: string): {
|
|
6
|
+
fuzzyMatches: (options?: FuzzyMatcherOptions) => {
|
|
7
|
+
fieldId: string;
|
|
8
|
+
type: "fuzzy";
|
|
9
|
+
options: {
|
|
10
|
+
boost?: number | undefined;
|
|
11
|
+
matchAgainst?: string | undefined;
|
|
12
|
+
fuzziness?: string | number | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
};
|
|
15
|
+
strictMatches: (options?: StrictMatcherOptions) => {
|
|
16
|
+
fieldId: string;
|
|
17
|
+
type: "strict";
|
|
18
|
+
options: {
|
|
19
|
+
value?: string | undefined;
|
|
20
|
+
boost?: number | undefined;
|
|
21
|
+
matchAgainst?: string | undefined;
|
|
22
|
+
} | undefined;
|
|
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
|
+
*/
|
|
58
|
+
dateRangeMatches: (options: DateRangeMatcherOptions) => {
|
|
59
|
+
fieldId: string;
|
|
60
|
+
type: "dateRange";
|
|
61
|
+
options: {
|
|
62
|
+
days: number;
|
|
63
|
+
boost?: number | undefined;
|
|
64
|
+
matchAgainst?: string | undefined;
|
|
65
|
+
pivot?: number | undefined;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=deduplication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduplication.d.ts","sourceRoot":"","sources":["../../src/events/deduplication.ts"],"names":[],"mappings":"AAUA,cAAc,wCAAwC,CAAA"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/events/deduplication.ts
|
|
21
|
+
var deduplication_exports = {};
|
|
22
|
+
__export(deduplication_exports, {
|
|
23
|
+
and: () => and,
|
|
24
|
+
field: () => field,
|
|
25
|
+
not: () => not,
|
|
26
|
+
or: () => or
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(deduplication_exports);
|
|
29
|
+
|
|
30
|
+
// ../commons/src/events/deduplication.ts
|
|
31
|
+
function not(clause) {
|
|
32
|
+
return {
|
|
33
|
+
type: "not",
|
|
34
|
+
clause
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function and(...clauses) {
|
|
38
|
+
return {
|
|
39
|
+
type: "and",
|
|
40
|
+
clauses
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function or(...clauses) {
|
|
44
|
+
return {
|
|
45
|
+
type: "or",
|
|
46
|
+
clauses
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function field(fieldId) {
|
|
50
|
+
return {
|
|
51
|
+
fuzzyMatches: (options) => ({
|
|
52
|
+
fieldId,
|
|
53
|
+
type: "fuzzy",
|
|
54
|
+
options
|
|
55
|
+
}),
|
|
56
|
+
strictMatches: (options) => ({
|
|
57
|
+
fieldId,
|
|
58
|
+
type: "strict",
|
|
59
|
+
options
|
|
60
|
+
}),
|
|
61
|
+
/**
|
|
62
|
+
* Creates a date range matcher that finds records where date field fall within a specified range.
|
|
63
|
+
*
|
|
64
|
+
* By default, matches against the field specified in `field()` (e.g., 'mother.dob').
|
|
65
|
+
* When `matchAgainst` is provided, it overwrites the default field and searches against that field with OR logic .
|
|
66
|
+
*
|
|
67
|
+
* @param options - Configuration for the date range matching
|
|
68
|
+
* @param options.days - Number of days before and after the target date to search (creates a ±days range)
|
|
69
|
+
* @param options.pivot - Optional. Distance in days where relevance scoring drops by 50%. Defaults to ⌊(days * 2) / 3⌋
|
|
70
|
+
* @param options.boost - Optional. Scoring boost multiplier for matching results. Defaults to 1
|
|
71
|
+
* @param options.matchAgainst - Optional. Additional field to match against. When provided,
|
|
72
|
+
* the query matches if the field fall within the date range. The default field is always excluded in the search in that case.
|
|
73
|
+
*
|
|
74
|
+
* @returns A clause that matches records where at least one of the specified date field is within the range
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // Matches only against mother.dob (±365 days)
|
|
78
|
+
* field('mother.dob').dateRangeMatches({ days: 365 })
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Matches against mother.age OR spouse.dob, not mother.dob
|
|
82
|
+
* field('mother.dob').dateRangeMatches({
|
|
83
|
+
* days: 365,
|
|
84
|
+
* matchAgainst: $field('mother.age')
|
|
85
|
+
* })
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* // With custom pivot and boost
|
|
89
|
+
* field('mother.dob').dateRangeMatches({
|
|
90
|
+
* days: 730,
|
|
91
|
+
* pivot: 365,
|
|
92
|
+
* boost: 2
|
|
93
|
+
* })
|
|
94
|
+
*/
|
|
95
|
+
dateRangeMatches: (options) => ({
|
|
96
|
+
fieldId,
|
|
97
|
+
type: "dateRange",
|
|
98
|
+
options
|
|
99
|
+
})
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAUA,cAAc,0BAA0B,CAAA"}
|