@opencrvs/toolkit 1.9.13-rc.72233cd → 1.9.13-rc.797da9b
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/build.sh +0 -13
- package/dist/api/index.d.ts.map +1 -1
- package/dist/commons/api/router.d.ts +4561 -3370
- package/dist/commons/conditionals/conditionals.d.ts +295 -28
- package/dist/commons/conditionals/validate.d.ts +9 -11
- package/dist/commons/events/ActionConfig.d.ts +1555 -415
- package/dist/commons/events/ActionDocument.d.ts +1941 -888
- package/dist/commons/events/ActionInput.d.ts +1277 -277
- package/dist/commons/events/ActionType.d.ts +11 -91
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1496 -294
- package/dist/commons/events/CompositeFieldValue.d.ts +190 -30
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4471 -1592
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +171 -15
- package/dist/commons/events/Draft.d.ts +113 -72
- package/dist/commons/events/DynamicFieldValue.d.ts +78 -12
- package/dist/commons/events/EventConfig.d.ts +2420 -35
- package/dist/commons/events/EventConfigInput.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +1366 -354
- package/dist/commons/events/EventIndex.d.ts +1010 -212
- package/dist/commons/events/EventInput.d.ts +8 -3
- package/dist/commons/events/EventMetadata.d.ts +357 -130
- package/dist/commons/events/FieldConfig.d.ts +16025 -2936
- package/dist/commons/events/FieldType.d.ts +4 -26
- package/dist/commons/events/FieldTypeMapping.d.ts +906 -314
- package/dist/commons/events/FieldValue.d.ts +527 -149
- package/dist/commons/events/FileUtils.d.ts +2 -2
- package/dist/commons/events/FormConfig.d.ts +721 -54
- package/dist/commons/events/PageConfig.d.ts +320 -58
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -2
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
- package/dist/commons/events/WorkqueueConfig.d.ts +7480 -2135
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +247 -2
- package/dist/commons/events/field.d.ts +22 -0
- package/dist/commons/events/index.d.ts +0 -3
- package/dist/commons/events/locations.d.ts +20 -57
- package/dist/commons/events/scopes.d.ts +34 -35
- package/dist/commons/events/state/availableActions.d.ts +2 -7
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +27 -30
- package/dist/commons/events/state/utils.d.ts +172 -190
- package/dist/commons/events/test.utils.d.ts +11 -52
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +273 -373
- package/dist/commons/notification/UserNotifications.d.ts +637 -61
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +2006 -270
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +2203 -2847
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1844 -2076
- package/dist/scopes/index.d.ts +353 -640
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +300 -340
- package/package.json +3 -13
- package/tsconfig.json +2 -12
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/application-config/index.d.ts +0 -2
- package/dist/application-config/index.d.ts.map +0 -1
- package/dist/application-config/index.js +0 -2128
- package/dist/cli.d.ts +0 -2
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -3237
- package/dist/commons/application-config/index.d.ts +0 -84
- package/dist/commons/events/AuditLog.d.ts +0 -405
- package/dist/commons/events/Flag.d.ts +0 -67
- package/dist/commons/events/eventConfigValidation.d.ts +0 -8
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -405
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -829
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -159
- package/dist/migrations/v2.0/index.d.ts +0 -7
- package/dist/migrations/v2.0/index.d.ts.map +0 -1
- package/dist/migrations/v2.0/index.js +0 -3176
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -344
- package/dist/migrations/v2.0/migrate-scopes.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-scopes.js +0 -282
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -268
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -237
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +0 -157
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +0 -75
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -97
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -78
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -110
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -164
- package/dist/migrations/v2.0/rename-api-paths.d.ts +0 -3
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-api-paths.js +0 -188
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +0 -181
- package/opencrvs-toolkit-1.9.13-rc.72233cd.tgz +0 -0
|
@@ -7,17 +7,17 @@ export declare function field(fieldId: string): {
|
|
|
7
7
|
fieldId: string;
|
|
8
8
|
type: "fuzzy";
|
|
9
9
|
options: {
|
|
10
|
-
fuzziness?: string | number | undefined;
|
|
11
10
|
boost?: number | undefined;
|
|
12
11
|
matchAgainst?: string | undefined;
|
|
12
|
+
fuzziness?: string | number | undefined;
|
|
13
13
|
} | undefined;
|
|
14
14
|
};
|
|
15
15
|
strictMatches: (options?: StrictMatcherOptions) => {
|
|
16
16
|
fieldId: string;
|
|
17
17
|
type: "strict";
|
|
18
18
|
options: {
|
|
19
|
-
boost?: number | undefined;
|
|
20
19
|
value?: string | undefined;
|
|
20
|
+
boost?: number | undefined;
|
|
21
21
|
matchAgainst?: string | undefined;
|
|
22
22
|
} | undefined;
|
|
23
23
|
};
|
|
@@ -60,9 +60,9 @@ export declare function field(fieldId: string): {
|
|
|
60
60
|
type: "dateRange";
|
|
61
61
|
options: {
|
|
62
62
|
days: number;
|
|
63
|
-
pivot?: number | undefined;
|
|
64
63
|
boost?: number | undefined;
|
|
65
64
|
matchAgainst?: string | undefined;
|
|
65
|
+
pivot?: number | undefined;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
};
|
|
@@ -1,3 +1,248 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { EventConfigInput } from './EventConfigInput';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a validated configuration for an event
|
|
4
|
+
* @param config - Event specific configuration
|
|
5
|
+
*/
|
|
6
|
+
export declare const defineConfig: (config: EventConfigInput) => {
|
|
7
|
+
id: string;
|
|
8
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
9
|
+
declaration: {
|
|
10
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
11
|
+
pages: {
|
|
12
|
+
type: "FORM";
|
|
13
|
+
id: string;
|
|
14
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
15
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
16
|
+
requireCompletionToContinue: boolean;
|
|
17
|
+
conditional?: import(".").JSONSchema | undefined;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
actions: ({
|
|
21
|
+
type: "READ";
|
|
22
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
23
|
+
review: {
|
|
24
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
25
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
26
|
+
};
|
|
27
|
+
} | {
|
|
28
|
+
type: "DECLARE";
|
|
29
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
30
|
+
review: {
|
|
31
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
32
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
33
|
+
};
|
|
34
|
+
deduplication?: {
|
|
35
|
+
id: string;
|
|
36
|
+
query: import("./DeduplicationConfig").ClauseOutput;
|
|
37
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
type: "VALIDATE";
|
|
41
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
42
|
+
review: {
|
|
43
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
44
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
45
|
+
};
|
|
46
|
+
deduplication?: {
|
|
47
|
+
id: string;
|
|
48
|
+
query: import("./DeduplicationConfig").ClauseOutput;
|
|
49
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
50
|
+
} | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
type: "REJECT";
|
|
53
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
54
|
+
} | {
|
|
55
|
+
type: "ARCHIVE";
|
|
56
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
57
|
+
} | {
|
|
58
|
+
type: "REGISTER";
|
|
59
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
60
|
+
review: {
|
|
61
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
62
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
63
|
+
};
|
|
64
|
+
deduplication?: {
|
|
65
|
+
id: string;
|
|
66
|
+
query: import("./DeduplicationConfig").ClauseOutput;
|
|
67
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
68
|
+
} | undefined;
|
|
69
|
+
} | {
|
|
70
|
+
type: "DELETE";
|
|
71
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
72
|
+
} | {
|
|
73
|
+
type: "PRINT_CERTIFICATE";
|
|
74
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
75
|
+
printForm: {
|
|
76
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
77
|
+
pages: ({
|
|
78
|
+
type: "FORM";
|
|
79
|
+
id: string;
|
|
80
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
81
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
82
|
+
requireCompletionToContinue: boolean;
|
|
83
|
+
conditional?: import(".").JSONSchema | undefined;
|
|
84
|
+
} | {
|
|
85
|
+
type: "VERIFICATION";
|
|
86
|
+
id: string;
|
|
87
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
88
|
+
actions: {
|
|
89
|
+
cancel: {
|
|
90
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
91
|
+
confirmation: {
|
|
92
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
93
|
+
body: import("./TranslationConfig").TranslationConfig;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
verify: {
|
|
97
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
101
|
+
requireCompletionToContinue: boolean;
|
|
102
|
+
conditional?: import(".").JSONSchema | undefined;
|
|
103
|
+
})[];
|
|
104
|
+
};
|
|
105
|
+
} | {
|
|
106
|
+
type: "REQUEST_CORRECTION";
|
|
107
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
108
|
+
correctionForm: {
|
|
109
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
110
|
+
pages: ({
|
|
111
|
+
type: "FORM";
|
|
112
|
+
id: string;
|
|
113
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
114
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
115
|
+
requireCompletionToContinue: boolean;
|
|
116
|
+
conditional?: import(".").JSONSchema | undefined;
|
|
117
|
+
} | {
|
|
118
|
+
type: "VERIFICATION";
|
|
119
|
+
id: string;
|
|
120
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
121
|
+
actions: {
|
|
122
|
+
cancel: {
|
|
123
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
124
|
+
confirmation: {
|
|
125
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
126
|
+
body: import("./TranslationConfig").TranslationConfig;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
verify: {
|
|
130
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
fields: import("./FieldConfig").FieldConfig[];
|
|
134
|
+
requireCompletionToContinue: boolean;
|
|
135
|
+
conditional?: import(".").JSONSchema | undefined;
|
|
136
|
+
})[];
|
|
137
|
+
};
|
|
138
|
+
} | {
|
|
139
|
+
type: "REJECT_CORRECTION";
|
|
140
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
141
|
+
} | {
|
|
142
|
+
type: "APPROVE_CORRECTION";
|
|
143
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
144
|
+
})[];
|
|
145
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
146
|
+
summary: {
|
|
147
|
+
fields: ({
|
|
148
|
+
fieldId: string;
|
|
149
|
+
label?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
150
|
+
conditionals?: {
|
|
151
|
+
type: "SHOW";
|
|
152
|
+
conditional: import(".").JSONSchema;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
emptyValueMessage?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
155
|
+
} | {
|
|
156
|
+
id: string;
|
|
157
|
+
value: import("./TranslationConfig").TranslationConfig;
|
|
158
|
+
label: import("./TranslationConfig").TranslationConfig;
|
|
159
|
+
conditionals?: {
|
|
160
|
+
type: "SHOW";
|
|
161
|
+
conditional: import(".").JSONSchema;
|
|
162
|
+
}[] | undefined;
|
|
163
|
+
emptyValueMessage?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
164
|
+
})[];
|
|
165
|
+
};
|
|
166
|
+
advancedSearch: {
|
|
167
|
+
title: import("./TranslationConfig").TranslationConfig;
|
|
168
|
+
fields: ({
|
|
169
|
+
config: {
|
|
170
|
+
type: "exact" | "fuzzy" | "range" | "within";
|
|
171
|
+
searchFields?: string[] | undefined;
|
|
172
|
+
};
|
|
173
|
+
fieldId: string;
|
|
174
|
+
fieldType: "field";
|
|
175
|
+
type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FIELD_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
|
|
176
|
+
options?: {
|
|
177
|
+
value: string;
|
|
178
|
+
label: string | import("./TranslationConfig").TranslationConfig;
|
|
179
|
+
conditionals?: ({
|
|
180
|
+
type: "SHOW";
|
|
181
|
+
conditional: import(".").JSONSchema;
|
|
182
|
+
} | {
|
|
183
|
+
type: "ENABLE";
|
|
184
|
+
conditional: import(".").JSONSchema;
|
|
185
|
+
})[] | undefined;
|
|
186
|
+
}[] | undefined;
|
|
187
|
+
label?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
188
|
+
conditionals?: ({
|
|
189
|
+
type: "SHOW";
|
|
190
|
+
conditional: import(".").JSONSchema;
|
|
191
|
+
} | {
|
|
192
|
+
type: "ENABLE";
|
|
193
|
+
conditional: import(".").JSONSchema;
|
|
194
|
+
} | {
|
|
195
|
+
type: "DISPLAY_ON_REVIEW";
|
|
196
|
+
conditional: import(".").JSONSchema;
|
|
197
|
+
})[] | undefined;
|
|
198
|
+
searchCriteriaLabelPrefix?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
199
|
+
validations?: {
|
|
200
|
+
message: import("./TranslationConfig").TranslationConfig;
|
|
201
|
+
validator: import(".").JSONSchema;
|
|
202
|
+
}[] | undefined;
|
|
203
|
+
} | {
|
|
204
|
+
config: {
|
|
205
|
+
type: "exact" | "fuzzy" | "range" | "within";
|
|
206
|
+
searchFields?: string[] | undefined;
|
|
207
|
+
};
|
|
208
|
+
fieldId: "event.status" | "event.trackingId" | "event.updatedAt" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation" | "event.legalStatuses.REGISTERED.registrationNumber";
|
|
209
|
+
fieldType: "event";
|
|
210
|
+
type?: "NAME" | "PHONE" | "ID" | "ADDRESS" | "TEXT" | "NUMBER" | "NUMBER_WITH_UNIT" | "TEXTAREA" | "EMAIL" | "DATE" | "AGE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FIELD_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA" | "BUTTON" | "SEARCH" | "ALPHA_PRINT_BUTTON" | "HTTP" | "LINK_BUTTON" | "VERIFICATION_STATUS" | "QUERY_PARAM_READER" | "QR_READER" | "ID_READER" | "LOADER" | undefined;
|
|
211
|
+
options?: {
|
|
212
|
+
value: string;
|
|
213
|
+
label: string | import("./TranslationConfig").TranslationConfig;
|
|
214
|
+
conditionals?: ({
|
|
215
|
+
type: "SHOW";
|
|
216
|
+
conditional: import(".").JSONSchema;
|
|
217
|
+
} | {
|
|
218
|
+
type: "ENABLE";
|
|
219
|
+
conditional: import(".").JSONSchema;
|
|
220
|
+
})[] | undefined;
|
|
221
|
+
}[] | undefined;
|
|
222
|
+
label?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
223
|
+
conditionals?: ({
|
|
224
|
+
type: "SHOW";
|
|
225
|
+
conditional: import(".").JSONSchema;
|
|
226
|
+
} | {
|
|
227
|
+
type: "ENABLE";
|
|
228
|
+
conditional: import(".").JSONSchema;
|
|
229
|
+
} | {
|
|
230
|
+
type: "DISPLAY_ON_REVIEW";
|
|
231
|
+
conditional: import(".").JSONSchema;
|
|
232
|
+
})[] | undefined;
|
|
233
|
+
searchCriteriaLabelPrefix?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
234
|
+
validations?: {
|
|
235
|
+
message: import("./TranslationConfig").TranslationConfig;
|
|
236
|
+
validator: import(".").JSONSchema;
|
|
237
|
+
}[] | undefined;
|
|
238
|
+
})[];
|
|
239
|
+
}[];
|
|
240
|
+
dateOfEvent?: {
|
|
241
|
+
$$field: string;
|
|
242
|
+
$$subfield: string[];
|
|
243
|
+
} | {
|
|
244
|
+
$$event: "createdAt" | "updatedAt" | "legalStatuses.DECLARED.createdAt" | "legalStatuses.DECLARED.acceptedAt" | "legalStatuses.REGISTERED.createdAt" | "legalStatuses.REGISTERED.acceptedAt";
|
|
245
|
+
} | undefined;
|
|
246
|
+
fallbackTitle?: import("./TranslationConfig").TranslationConfig | undefined;
|
|
247
|
+
};
|
|
3
248
|
//# sourceMappingURL=defineConfig.d.ts.map
|
|
@@ -107,6 +107,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
107
107
|
fieldId: string;
|
|
108
108
|
};
|
|
109
109
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
110
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
111
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
110
112
|
};
|
|
111
113
|
asDob(): any;
|
|
112
114
|
asAge(): any;
|
|
@@ -144,6 +146,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
144
146
|
fieldId: string;
|
|
145
147
|
};
|
|
146
148
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
149
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
150
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
147
151
|
};
|
|
148
152
|
getByPath(fieldPath: string[]): {
|
|
149
153
|
$$subfield: string[];
|
|
@@ -189,6 +193,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
189
193
|
fieldId: string;
|
|
190
194
|
};
|
|
191
195
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
196
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
197
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
192
198
|
};
|
|
193
199
|
getByPath(fieldPath: string[]): any;
|
|
194
200
|
asDob(): {
|
|
@@ -232,6 +238,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
232
238
|
fieldId: string;
|
|
233
239
|
};
|
|
234
240
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
241
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
242
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
235
243
|
};
|
|
236
244
|
asAge(): {
|
|
237
245
|
$$subfield: string[];
|
|
@@ -274,6 +282,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
274
282
|
fieldId: string;
|
|
275
283
|
};
|
|
276
284
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
285
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
286
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
277
287
|
};
|
|
278
288
|
isAfter(): {
|
|
279
289
|
days: (days: number) => {
|
|
@@ -309,6 +319,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
309
319
|
fieldId: string;
|
|
310
320
|
};
|
|
311
321
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
322
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
323
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
312
324
|
};
|
|
313
325
|
asDob(): {
|
|
314
326
|
$$subfield: string[];
|
|
@@ -355,6 +367,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
355
367
|
fieldId: string;
|
|
356
368
|
};
|
|
357
369
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
370
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
371
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
358
372
|
};
|
|
359
373
|
asDob(): any;
|
|
360
374
|
asAge(): any;
|
|
@@ -392,6 +406,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
392
406
|
fieldId: string;
|
|
393
407
|
};
|
|
394
408
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
409
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
410
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
395
411
|
};
|
|
396
412
|
asAge(): {
|
|
397
413
|
$$subfield: string[];
|
|
@@ -438,6 +454,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
438
454
|
fieldId: string;
|
|
439
455
|
};
|
|
440
456
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
457
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
458
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
441
459
|
};
|
|
442
460
|
asDob(): any;
|
|
443
461
|
asAge(): any;
|
|
@@ -475,6 +493,8 @@ export declare function field(fieldId: string, options?: {
|
|
|
475
493
|
fieldId: string;
|
|
476
494
|
};
|
|
477
495
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
496
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
497
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
478
498
|
};
|
|
479
499
|
isAfter(): {
|
|
480
500
|
days: (days: number) => {
|
|
@@ -510,5 +530,7 @@ export declare function field(fieldId: string, options?: {
|
|
|
510
530
|
fieldId: string;
|
|
511
531
|
};
|
|
512
532
|
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
|
533
|
+
customClientValidator(validationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => boolean): import("../conditionals/conditionals").JSONSchema;
|
|
534
|
+
customClientEvaluation(computationFn: (fieldValue: unknown, context: import("../conditionals/conditionals").FormConditionalParameters) => unknown): import("./FieldConfig").CodeToEvaluate;
|
|
513
535
|
};
|
|
514
536
|
//# sourceMappingURL=field.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './AuditLog';
|
|
2
1
|
export * from './Constants';
|
|
3
2
|
export * from './ActionConfig';
|
|
4
3
|
export * from './offline';
|
|
@@ -40,9 +39,7 @@ export * from './FileUtils';
|
|
|
40
39
|
export * from '../conditionals/conditionals';
|
|
41
40
|
export * from '../conditionals/validate';
|
|
42
41
|
export * from './field';
|
|
43
|
-
export * from './Flag';
|
|
44
42
|
export * from './event';
|
|
45
43
|
export * from './locations';
|
|
46
44
|
export { UUID } from '../uuid';
|
|
47
|
-
export { DocumentPath } from '../documents';
|
|
48
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,61 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { RecordScopeV2 } from '../scopes';
|
|
5
|
-
import { SystemContext, UserContext } from '../users/User';
|
|
6
|
-
/** @deprecated Moving on, location types are arbitrary and defined by the country config. */
|
|
7
|
-
export declare const LocationTypeV1: z.ZodEnum<{
|
|
8
|
-
ADMIN_STRUCTURE: "ADMIN_STRUCTURE";
|
|
9
|
-
HEALTH_FACILITY: "HEALTH_FACILITY";
|
|
10
|
-
CRVS_OFFICE: "CRVS_OFFICE";
|
|
11
|
-
}>;
|
|
12
|
-
export type LocationTypeV1 = z.infer<typeof LocationTypeV1>;
|
|
13
|
-
export declare const AdministrativeArea: z.ZodObject<{
|
|
14
|
-
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
15
|
-
name: z.ZodString;
|
|
16
|
-
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
-
parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
18
|
-
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
export type AdministrativeArea = z.infer<typeof AdministrativeArea>;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LocationType: z.ZodEnum<["ADMIN_STRUCTURE", "CRVS_OFFICE", "HEALTH_FACILITY"]>;
|
|
3
|
+
export type LocationType = z.infer<typeof LocationType>;
|
|
21
4
|
export declare const Location: z.ZodObject<{
|
|
22
|
-
id: z.
|
|
5
|
+
id: z.ZodBranded<z.ZodString, "UUID">;
|
|
23
6
|
name: z.ZodString;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
7
|
+
parentId: z.ZodNullable<z.ZodBranded<z.ZodString, "UUID">>;
|
|
8
|
+
validUntil: z.ZodNullable<z.ZodString>;
|
|
9
|
+
locationType: z.ZodNullable<z.ZodEnum<["ADMIN_STRUCTURE", "CRVS_OFFICE", "HEALTH_FACILITY"]>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
id: string & z.BRAND<"UUID">;
|
|
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
|
+
}>;
|
|
29
23
|
export type Location = z.infer<typeof Location>;
|
|
30
|
-
type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
|
|
31
|
-
/**
|
|
32
|
-
* For type T, convert fields K to arrays. If field is string, convert to string[].
|
|
33
|
-
*/
|
|
34
|
-
type ToArrayFields<T, K extends PropertyKey> = T extends unknown ? T extends object ? {
|
|
35
|
-
[P in keyof T]: P extends K ? WrapArrayPreserveNullish<T[P]> : T[P];
|
|
36
|
-
} : T : never;
|
|
37
|
-
/**
|
|
38
|
-
* Event index type where all location fields are arrays representing full location hierarchy.
|
|
39
|
-
*/
|
|
40
|
-
export type EventIndexWithAdministrativeHierarchy = Omit<ToArrayFields<EventIndex, 'createdAtLocation' | 'updatedAtLocation' | 'placeOfEvent'>, 'legalStatuses'> & {
|
|
41
|
-
legalStatuses: {
|
|
42
|
-
DECLARED: ToArrayFields<ActionCreationMetadata, 'createdAtLocation'> | undefined;
|
|
43
|
-
REGISTERED: ToArrayFields<RegistrationCreationMetadata, 'createdAtLocation'> | undefined;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Given indexed event and resolved scope, determine if the scope allows access to the event.
|
|
48
|
-
*
|
|
49
|
-
* All of the options within the scope must be satisfied for access to be granted.
|
|
50
|
-
* Return false early to break out of checks as soon as possible - if any option is not satisfied, the scope does not allow access to the event, so no need to check further options.
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
53
|
-
export declare function canAccessEventWithScope(event: Partial<EventIndexWithAdministrativeHierarchy>, scope: RecordScopeV2, user: UserContext | SystemContext, customActionType?: string): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Given indexed event and list of resolved scopes, determine if any of the scopes allow access to the event.
|
|
56
|
-
*
|
|
57
|
-
* One of the scopes must allow access for the event to be accessible.
|
|
58
|
-
*/
|
|
59
|
-
export declare function userCanAccessEventWithScopes(event: Partial<EventIndexWithAdministrativeHierarchy>, scopes: RecordScopeV2[], user: UserContext | SystemContext, customActionType?: string): boolean;
|
|
60
|
-
export {};
|
|
61
24
|
//# sourceMappingURL=locations.d.ts.map
|
|
@@ -1,56 +1,55 @@
|
|
|
1
|
+
import { ConfigurableScopeType, Scope } from '../scopes';
|
|
1
2
|
import { DisplayableAction } from './ActionType';
|
|
2
|
-
import { EncodedScope } from '../scopes';
|
|
3
|
-
import { EventIndexWithAdministrativeHierarchy } from './locations';
|
|
4
|
-
import { UserContext } from '../users/User';
|
|
5
3
|
import { EventIndex } from './EventIndex';
|
|
6
4
|
export declare const ACTION_SCOPE_MAP: {
|
|
7
5
|
READ: "record.read"[];
|
|
8
6
|
CREATE: "record.create"[];
|
|
9
7
|
NOTIFY: "record.notify"[];
|
|
10
|
-
DECLARE: ("record.declare" | "record.
|
|
11
|
-
EDIT: "record.edit"[];
|
|
8
|
+
DECLARE: ("record.register" | "record.declare" | "record.declared.validate")[];
|
|
12
9
|
DELETE: "record.declare"[];
|
|
10
|
+
VALIDATE: ("record.register" | "record.declared.validate")[];
|
|
13
11
|
REGISTER: "record.register"[];
|
|
14
|
-
PRINT_CERTIFICATE: "record.print-certified-copies"[];
|
|
15
|
-
REQUEST_CORRECTION: ("record.request-correction" | "record.correct")[];
|
|
16
|
-
REVIEW_CORRECTION_REQUEST: "record.correct"[];
|
|
17
|
-
REJECT_CORRECTION: "record.correct"[];
|
|
18
|
-
APPROVE_CORRECTION: "record.correct"[];
|
|
19
|
-
MARK_AS_DUPLICATE: "record.review-duplicates"[];
|
|
20
|
-
MARK_AS_NOT_DUPLICATE: "record.review-duplicates"[];
|
|
21
|
-
ARCHIVE: "record.archive"[];
|
|
22
|
-
REJECT: "record.reject"[];
|
|
12
|
+
PRINT_CERTIFICATE: "record.registered.print-certified-copies"[];
|
|
13
|
+
REQUEST_CORRECTION: ("record.registered.request-correction" | "record.registered.correct")[];
|
|
14
|
+
REVIEW_CORRECTION_REQUEST: "record.registered.correct"[];
|
|
15
|
+
REJECT_CORRECTION: "record.registered.correct"[];
|
|
16
|
+
APPROVE_CORRECTION: "record.registered.correct"[];
|
|
17
|
+
MARK_AS_DUPLICATE: "record.declared.review-duplicates"[];
|
|
18
|
+
MARK_AS_NOT_DUPLICATE: "record.declared.review-duplicates"[];
|
|
19
|
+
ARCHIVE: "record.declared.archive"[];
|
|
20
|
+
REJECT: "record.declared.reject"[];
|
|
23
21
|
ASSIGN: null;
|
|
24
22
|
UNASSIGN: null;
|
|
25
23
|
DUPLICATE_DETECTED: never[];
|
|
26
|
-
CUSTOM: never[];
|
|
27
24
|
};
|
|
28
|
-
export declare function hasAnyOfScopes(a:
|
|
29
|
-
export declare
|
|
30
|
-
readonly ASSIGNED_TO_SELF: "ASSIGNED_TO_SELF";
|
|
31
|
-
readonly ASSIGNED_TO_OTHERS: "ASSIGNED_TO_OTHERS";
|
|
32
|
-
readonly UNASSIGNED: "UNASSIGNED";
|
|
33
|
-
};
|
|
34
|
-
export type AssignmentStatus = (typeof AssignmentStatus)[keyof typeof AssignmentStatus];
|
|
35
|
-
export declare function getAssignmentStatus(eventState: EventIndex | EventIndexWithAdministrativeHierarchy, userId: string): AssignmentStatus;
|
|
25
|
+
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
|
26
|
+
export declare function configurableEventScopeAllowed(scopes: Scope[], allowedConfigurableScopes: ConfigurableScopeType[], eventType: string): boolean;
|
|
36
27
|
/**
|
|
37
|
-
* Checks if a given action is allowed for the provided scopes
|
|
28
|
+
* Checks if a given action is allowed for the provided scopes and event type.
|
|
38
29
|
*
|
|
39
30
|
* This function determines whether the user, with the given set of scopes, is authorized
|
|
40
|
-
* to perform the specified action on the given
|
|
41
|
-
* (hardcoded, non-configurable) and
|
|
42
|
-
* and user context via {@link userCanAccessEventWithScopes}.
|
|
31
|
+
* to perform the specified action on an event of the given type. It checks both "plain" scopes
|
|
32
|
+
* (hardcoded, non-configurable) and "configurable" scopes (which may be tied to specific event types).
|
|
43
33
|
*
|
|
44
|
-
* @param {
|
|
34
|
+
* @param {Scope[]} scopes - The list of scopes the user possesses.
|
|
45
35
|
* @param {DisplayableAction} action - The action to check authorization for.
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {UserContext} currentUser - The current user's context used for V2 scope validation.
|
|
36
|
+
* @param {string} eventType - The type of event for which the action is being checked.
|
|
48
37
|
* @returns {boolean} True if the action is in scope for the user, otherwise false.
|
|
49
38
|
*/
|
|
50
|
-
export declare function isActionInScope(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
export declare function isActionInScope(scopes: Scope[], action: DisplayableAction, eventType: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* A shared utility to check if the user can read a record.
|
|
42
|
+
* This will be removed in 1.10 and implemented by scopes.
|
|
43
|
+
*
|
|
44
|
+
* In order for us to limit the usage of 'record.read' scope, we allow users to view records they have created on system-level.
|
|
45
|
+
*
|
|
46
|
+
* @deprecated - Will be removed in 1.10
|
|
47
|
+
*/
|
|
48
|
+
export declare function canUserReadEvent(event: EventIndex | {
|
|
49
|
+
createdBy: string;
|
|
50
|
+
type: string;
|
|
51
|
+
}, { userId, scopes }: {
|
|
52
|
+
userId: string;
|
|
53
|
+
scopes: string[];
|
|
55
54
|
}): boolean;
|
|
56
55
|
//# sourceMappingURL=scopes.d.ts.map
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { DisplayableAction } from '../ActionType';
|
|
2
2
|
import { EventIndex } from '../EventIndex';
|
|
3
|
-
import { Flag } from '../
|
|
4
|
-
|
|
5
|
-
* Filters actions based on flags
|
|
6
|
-
* Some actions can be performed only if certain flags are
|
|
7
|
-
* present and others only if certain flags are absent
|
|
8
|
-
*/
|
|
9
|
-
export declare function filterActionsByFlags(actions: DisplayableAction[], flags: Flag[]): DisplayableAction[];
|
|
3
|
+
import { EventStatus, Flag } from '../EventMetadata';
|
|
4
|
+
export declare function getAvailableActions(status: EventStatus, flags: Flag[]): DisplayableAction[];
|
|
10
5
|
export declare function getAvailableActionsForEvent(event: EventIndex): DisplayableAction[];
|
|
11
6
|
//# sourceMappingURL=availableActions.d.ts.map
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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[];
|
|
1
|
+
import { Action } from '../ActionDocument';
|
|
2
|
+
import { Flag } from '../EventMetadata';
|
|
3
|
+
export declare function getFlagsFromActions(actions: Action[]): Flag[];
|
|
22
4
|
//# sourceMappingURL=flags.d.ts.map
|