@opencrvs/toolkit 1.8.0-rc.f876361 → 1.8.0-rc.f8a9481
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/dist/commons/api/router.d.ts +393 -1324
- package/dist/commons/conditionals/conditionals.d.ts +15 -8
- package/dist/commons/conditionals/validate.d.ts +12 -17
- package/dist/commons/events/ActionDocument.d.ts +214 -2
- package/dist/commons/events/ActionInput.d.ts +1135 -232
- package/dist/commons/events/ActionType.d.ts +5 -3
- package/dist/commons/events/CompositeFieldValue.d.ts +3 -0
- package/dist/commons/events/Conditional.d.ts +21 -5
- package/dist/commons/events/Draft.d.ts +27 -10
- package/dist/commons/events/EventConfig.d.ts +153 -68
- package/dist/commons/events/EventDocument.d.ts +165 -1
- package/dist/commons/events/EventIndex.d.ts +6 -0
- package/dist/commons/events/EventMetadata.d.ts +6 -0
- package/dist/commons/events/FieldConfig.d.ts +212 -33
- package/dist/commons/events/PageConfig.d.ts +0 -24
- package/dist/commons/events/SummaryConfig.d.ts +93 -7
- package/dist/commons/events/TemplateConfig.d.ts +5 -5
- package/dist/commons/events/User.d.ts +5 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +44 -20
- package/dist/commons/events/defineConfig.d.ts +13 -8
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/scopes.d.ts +25 -0
- package/dist/commons/events/test.utils.d.ts +20 -112
- package/dist/commons/events/utils.d.ts +65 -56
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/conditionals/index.js +131 -151
- package/dist/events/index.js +1037 -783
- package/package.json +1 -1
@@ -1,23 +1,12 @@
|
|
1
|
-
import { ActionType,
|
1
|
+
import { ActionType, DeclarationActionType } from './ActionType';
|
2
2
|
import { EventConfig } from './EventConfig';
|
3
3
|
import { FieldConfig } from './FieldConfig';
|
4
|
-
import {
|
5
|
-
import { ActionUpdate, EventState } from './ActionDocument';
|
4
|
+
import { Action, ActionUpdate, EventState } from './ActionDocument';
|
6
5
|
import { PageConfig, VerificationPageConfig } from './PageConfig';
|
7
6
|
import { Draft } from './Draft';
|
8
7
|
import { EventDocument } from './EventDocument';
|
9
8
|
import { ActionConfig } from './ActionConfig';
|
10
9
|
import { FormConfig } from './FormConfig';
|
11
|
-
/**
|
12
|
-
* @returns All the fields in the event configuration.
|
13
|
-
*/
|
14
|
-
export declare const findAllFields: (config: EventConfig) => FieldConfig[];
|
15
|
-
export declare const getAllAnnotationFields: (config: EventConfig) => FieldConfig[];
|
16
|
-
export declare const getActionAnnotationFields: (actionConfig: ActionConfig) => import("./FieldConfig").Inferred[];
|
17
|
-
/**
|
18
|
-
* @TODO: Request correction should have same format as print certificate
|
19
|
-
*/
|
20
|
-
export declare const findRecordActionPages: (config: EventConfig, actionType: ActionType) => PageConfig[];
|
21
10
|
export declare function getDeclarationFields(configuration: EventConfig): FieldConfig[];
|
22
11
|
export declare function getDeclarationPages(configuration: EventConfig): {
|
23
12
|
type: "FORM";
|
@@ -36,15 +25,61 @@ export declare function getDeclaration(configuration: EventConfig): {
|
|
36
25
|
conditional?: import(".").JSONSchema | undefined;
|
37
26
|
}[];
|
38
27
|
};
|
39
|
-
export declare
|
28
|
+
export declare const getActionAnnotationFields: (actionConfig: ActionConfig) => import("./FieldConfig").Inferred[];
|
29
|
+
export declare const getAllAnnotationFields: (config: EventConfig) => FieldConfig[];
|
30
|
+
/**
|
31
|
+
* @returns All the fields in the event configuration.
|
32
|
+
*/
|
33
|
+
export declare const findAllFields: (config: EventConfig) => FieldConfig[];
|
34
|
+
/**
|
35
|
+
* @TODO: Request correction should have same format as print certificate
|
36
|
+
*/
|
37
|
+
export declare const findRecordActionPages: (config: EventConfig, actionType: ActionType) => PageConfig[];
|
40
38
|
export declare function getActionReview(configuration: EventConfig, actionType: ActionType): {
|
41
39
|
title: import("./TranslationConfig").TranslationConfig;
|
42
40
|
fields: import("./FieldConfig").Inferred[];
|
43
41
|
};
|
44
|
-
export declare function
|
42
|
+
export declare function getActionReviewFields(configuration: EventConfig, actionType: DeclarationActionType): import("./FieldConfig").Inferred[];
|
45
43
|
export declare function isPageVisible(page: PageConfig, formValues: ActionUpdate): boolean;
|
46
|
-
export declare
|
47
|
-
|
44
|
+
export declare function omitHiddenFields(fields: FieldConfig[], values: EventState): import("lodash").Dictionary<string | number | boolean | {
|
45
|
+
type: string;
|
46
|
+
filename: string;
|
47
|
+
originalFilename: string;
|
48
|
+
} | {
|
49
|
+
country: string;
|
50
|
+
district: string;
|
51
|
+
addressType: "DOMESTIC";
|
52
|
+
province: string;
|
53
|
+
urbanOrRural: "URBAN";
|
54
|
+
number?: string | undefined;
|
55
|
+
town?: string | undefined;
|
56
|
+
residentialArea?: string | undefined;
|
57
|
+
street?: string | undefined;
|
58
|
+
zipCode?: string | undefined;
|
59
|
+
} | {
|
60
|
+
country: string;
|
61
|
+
district: string;
|
62
|
+
addressType: "DOMESTIC";
|
63
|
+
province: string;
|
64
|
+
urbanOrRural: "RURAL";
|
65
|
+
village?: string | undefined;
|
66
|
+
} | {
|
67
|
+
country: string;
|
68
|
+
state: string;
|
69
|
+
addressType: "INTERNATIONAL";
|
70
|
+
district2: string;
|
71
|
+
cityOrTown?: string | undefined;
|
72
|
+
addressLine1?: string | undefined;
|
73
|
+
addressLine2?: string | undefined;
|
74
|
+
addressLine3?: string | undefined;
|
75
|
+
postcodeOrZip?: string | undefined;
|
76
|
+
} | {
|
77
|
+
type: string;
|
78
|
+
option: string;
|
79
|
+
filename: string;
|
80
|
+
originalFilename: string;
|
81
|
+
}[] | undefined>;
|
82
|
+
export declare function omitHiddenPaginatedFields(formConfig: FormConfig, declaration: EventState): import("lodash").Dictionary<string | number | boolean | {
|
48
83
|
type: string;
|
49
84
|
filename: string;
|
50
85
|
originalFilename: string;
|
@@ -84,13 +119,16 @@ export declare function stripHiddenFields(fields: FieldConfig[], declaration: Ev
|
|
84
119
|
}[] | undefined>;
|
85
120
|
export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]): {
|
86
121
|
id: string;
|
122
|
+
transactionId: string;
|
87
123
|
createdAt: string;
|
88
124
|
eventId: string;
|
89
|
-
transactionId: string;
|
90
125
|
action: {
|
91
126
|
type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
|
127
|
+
status: "Rejected" | "Requested" | "Accepted";
|
128
|
+
transactionId: string;
|
92
129
|
createdAt: string;
|
93
130
|
createdBy: string;
|
131
|
+
createdByRole: string;
|
94
132
|
declaration: Record<string, string | number | boolean | {
|
95
133
|
type: string;
|
96
134
|
filename: string;
|
@@ -186,42 +224,13 @@ export declare function createEmptyDraft(eventId: string, draftId: string, actio
|
|
186
224
|
};
|
187
225
|
};
|
188
226
|
export declare function isVerificationPage(page: PageConfig): page is VerificationPageConfig;
|
189
|
-
export declare function deepMerge(currentDocument:
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
urbanOrRural: "URBAN";
|
199
|
-
number?: string | null | undefined;
|
200
|
-
town?: string | null | undefined;
|
201
|
-
residentialArea?: string | null | undefined;
|
202
|
-
street?: string | null | undefined;
|
203
|
-
zipCode?: string | null | undefined;
|
204
|
-
} | {
|
205
|
-
country: string;
|
206
|
-
district: string;
|
207
|
-
addressType: "DOMESTIC";
|
208
|
-
province: string;
|
209
|
-
urbanOrRural: "RURAL";
|
210
|
-
village?: string | null | undefined;
|
211
|
-
} | {
|
212
|
-
country: string;
|
213
|
-
state: string;
|
214
|
-
addressType: "INTERNATIONAL";
|
215
|
-
district2: string;
|
216
|
-
cityOrTown?: string | null | undefined;
|
217
|
-
addressLine1?: string | null | undefined;
|
218
|
-
addressLine2?: string | null | undefined;
|
219
|
-
addressLine3?: string | null | undefined;
|
220
|
-
postcodeOrZip?: string | null | undefined;
|
221
|
-
} | {
|
222
|
-
type: string;
|
223
|
-
option: string;
|
224
|
-
filename: string;
|
225
|
-
originalFilename: string;
|
226
|
-
}[] | undefined>;
|
227
|
+
export declare function deepMerge<T extends Record<string, unknown>>(currentDocument: T, actionDocument: T): T;
|
228
|
+
export declare function findLastAssignmentAction(actions: Action[]): Action | undefined;
|
229
|
+
/** Tell compiler that accessing record with arbitrary key might result to undefined
|
230
|
+
* Use when you **cannot guarantee** that key exists in the record
|
231
|
+
*/
|
232
|
+
export type IndexMap<T> = {
|
233
|
+
[id: string]: T | undefined;
|
234
|
+
};
|
235
|
+
export declare function isWriteAction(actionType: ActionType): boolean;
|
227
236
|
//# sourceMappingURL=utils.d.ts.map
|
@@ -23,8 +23,10 @@ __export(conditionals_exports, {
|
|
23
23
|
alwaysTrue: () => alwaysTrue,
|
24
24
|
and: () => and,
|
25
25
|
defineConditional: () => defineConditional,
|
26
|
+
defineFormConditional: () => defineFormConditional,
|
26
27
|
event: () => event,
|
27
28
|
field: () => field,
|
29
|
+
never: () => never,
|
28
30
|
not: () => not,
|
29
31
|
or: () => or,
|
30
32
|
user: () => user
|
@@ -35,6 +37,16 @@ module.exports = __toCommonJS(conditionals_exports);
|
|
35
37
|
function defineConditional(schema) {
|
36
38
|
return schema;
|
37
39
|
}
|
40
|
+
function defineFormConditional(schema) {
|
41
|
+
const schemaWithForm = {
|
42
|
+
type: "object",
|
43
|
+
properties: {
|
44
|
+
$form: schema
|
45
|
+
},
|
46
|
+
required: ["$form"]
|
47
|
+
};
|
48
|
+
return defineConditional(schemaWithForm);
|
49
|
+
}
|
38
50
|
function alwaysTrue() {
|
39
51
|
return {};
|
40
52
|
}
|
@@ -59,6 +71,9 @@ function not(condition) {
|
|
59
71
|
required: []
|
60
72
|
});
|
61
73
|
}
|
74
|
+
function never() {
|
75
|
+
return not(alwaysTrue());
|
76
|
+
}
|
62
77
|
var user = {
|
63
78
|
hasScope: (scope) => defineConditional({
|
64
79
|
type: "object",
|
@@ -106,100 +121,118 @@ var event = {
|
|
106
121
|
required: ["$event"]
|
107
122
|
})
|
108
123
|
};
|
124
|
+
function getDateFromNow(days) {
|
125
|
+
return new Date(Date.now() - days * 24 * 60 * 60 * 1e3).toISOString().split("T")[0];
|
126
|
+
}
|
127
|
+
function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
|
128
|
+
return {
|
129
|
+
type: "object",
|
130
|
+
properties: {
|
131
|
+
[fieldId]: {
|
132
|
+
type: "string",
|
133
|
+
format: "date",
|
134
|
+
[clause]: { $data: `1/${comparedFieldId}` }
|
135
|
+
},
|
136
|
+
[comparedFieldId]: { type: "string", format: "date" }
|
137
|
+
},
|
138
|
+
required: [fieldId]
|
139
|
+
};
|
140
|
+
}
|
141
|
+
function isFieldReference(value) {
|
142
|
+
return typeof value === "object" && value !== null && "_fieldId" in value;
|
143
|
+
}
|
109
144
|
function field(fieldId) {
|
110
|
-
const getDateFromNow = (days) => new Date(Date.now() - days * 24 * 60 * 60 * 1e3).toISOString().split("T")[0];
|
111
145
|
const getDateRange = (date, clause) => ({
|
112
146
|
type: "object",
|
113
147
|
properties: {
|
114
|
-
|
115
|
-
type: "
|
116
|
-
|
117
|
-
|
118
|
-
type: "string",
|
119
|
-
format: "date",
|
120
|
-
[clause]: date
|
121
|
-
}
|
122
|
-
},
|
123
|
-
required: [fieldId]
|
148
|
+
[fieldId]: {
|
149
|
+
type: "string",
|
150
|
+
format: "date",
|
151
|
+
[clause]: date
|
124
152
|
}
|
125
153
|
},
|
126
|
-
required: [
|
154
|
+
required: [fieldId]
|
127
155
|
});
|
128
156
|
return {
|
129
157
|
/**
|
130
158
|
* @private Internal property used for field reference tracking.
|
131
159
|
*/
|
132
|
-
|
160
|
+
_fieldId: fieldId,
|
133
161
|
isAfter: () => ({
|
134
162
|
days: (days) => ({
|
135
|
-
inPast: () =>
|
163
|
+
inPast: () => defineFormConditional(
|
136
164
|
getDateRange(getDateFromNow(days), "formatMinimum")
|
137
165
|
),
|
138
|
-
inFuture: () =>
|
166
|
+
inFuture: () => defineFormConditional(
|
139
167
|
getDateRange(getDateFromNow(-days), "formatMinimum")
|
140
168
|
)
|
141
169
|
}),
|
142
|
-
date: (date) =>
|
143
|
-
|
170
|
+
date: (date) => {
|
171
|
+
if (isFieldReference(date)) {
|
172
|
+
const comparedFieldId = date._fieldId;
|
173
|
+
return defineFormConditional(
|
174
|
+
getDateRangeToFieldReference(
|
175
|
+
fieldId,
|
176
|
+
comparedFieldId,
|
177
|
+
"formatMinimum"
|
178
|
+
)
|
179
|
+
);
|
180
|
+
}
|
181
|
+
return defineFormConditional(getDateRange(date, "formatMinimum"));
|
182
|
+
},
|
183
|
+
now: () => defineFormConditional(getDateRange(getDateFromNow(0), "formatMinimum"))
|
144
184
|
}),
|
145
185
|
isBefore: () => ({
|
146
186
|
days: (days) => ({
|
147
|
-
inPast: () =>
|
187
|
+
inPast: () => defineFormConditional(
|
148
188
|
getDateRange(getDateFromNow(days), "formatMaximum")
|
149
189
|
),
|
150
|
-
inFuture: () =>
|
190
|
+
inFuture: () => defineFormConditional(
|
151
191
|
getDateRange(getDateFromNow(-days), "formatMaximum")
|
152
192
|
)
|
153
193
|
}),
|
154
|
-
date: (date) =>
|
155
|
-
|
194
|
+
date: (date) => {
|
195
|
+
if (isFieldReference(date)) {
|
196
|
+
const comparedFieldId = date._fieldId;
|
197
|
+
return defineFormConditional(
|
198
|
+
getDateRangeToFieldReference(
|
199
|
+
fieldId,
|
200
|
+
comparedFieldId,
|
201
|
+
"formatMaximum"
|
202
|
+
)
|
203
|
+
);
|
204
|
+
}
|
205
|
+
return defineFormConditional(getDateRange(date, "formatMaximum"));
|
206
|
+
},
|
207
|
+
now: () => defineFormConditional(getDateRange(getDateFromNow(0), "formatMaximum"))
|
156
208
|
}),
|
157
|
-
// TODO CIHAN: typing
|
158
209
|
isEqualTo: (value) => {
|
159
|
-
if (
|
160
|
-
const comparedFieldId = value.
|
161
|
-
return
|
210
|
+
if (isFieldReference(value)) {
|
211
|
+
const comparedFieldId = value._fieldId;
|
212
|
+
return defineFormConditional({
|
162
213
|
type: "object",
|
163
214
|
properties: {
|
164
|
-
|
165
|
-
type: "
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
},
|
170
|
-
required: [fieldId, comparedFieldId],
|
171
|
-
allOf: [
|
172
|
-
{
|
173
|
-
properties: {
|
174
|
-
[fieldId]: {
|
175
|
-
const: { $data: `1/${comparedFieldId}` }
|
176
|
-
}
|
177
|
-
}
|
178
|
-
}
|
179
|
-
]
|
180
|
-
}
|
215
|
+
[fieldId]: {
|
216
|
+
type: ["string", "boolean"],
|
217
|
+
const: { $data: `1/${comparedFieldId}` }
|
218
|
+
},
|
219
|
+
[comparedFieldId]: { type: ["string", "boolean"] }
|
181
220
|
},
|
182
|
-
required: [
|
221
|
+
required: [fieldId, comparedFieldId]
|
183
222
|
});
|
184
223
|
}
|
185
|
-
return
|
224
|
+
return defineFormConditional({
|
186
225
|
type: "object",
|
187
226
|
properties: {
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
{ type: "boolean", const: value }
|
195
|
-
],
|
196
|
-
const: value
|
197
|
-
}
|
198
|
-
},
|
199
|
-
required: [fieldId]
|
227
|
+
[fieldId]: {
|
228
|
+
oneOf: [
|
229
|
+
{ type: "string", const: value },
|
230
|
+
{ type: "boolean", const: value }
|
231
|
+
],
|
232
|
+
const: value
|
200
233
|
}
|
201
234
|
},
|
202
|
-
required: [
|
235
|
+
required: [fieldId]
|
203
236
|
});
|
204
237
|
},
|
205
238
|
/**
|
@@ -210,140 +243,87 @@ function field(fieldId) {
|
|
210
243
|
* NOTE: For now, this only works with string, boolean, and null types. 0 is still allowed.
|
211
244
|
*
|
212
245
|
*/
|
213
|
-
isFalsy: () =>
|
246
|
+
isFalsy: () => defineFormConditional({
|
214
247
|
type: "object",
|
215
248
|
properties: {
|
216
|
-
|
217
|
-
type: "object",
|
218
|
-
properties: {
|
219
|
-
[fieldId]: {
|
220
|
-
anyOf: [
|
221
|
-
{ const: "undefined" },
|
222
|
-
{ const: false },
|
223
|
-
{ const: null },
|
224
|
-
{ const: "" }
|
225
|
-
]
|
226
|
-
}
|
227
|
-
},
|
249
|
+
[fieldId]: {
|
228
250
|
anyOf: [
|
229
|
-
{
|
230
|
-
|
231
|
-
},
|
232
|
-
{
|
233
|
-
not: {
|
234
|
-
required: [fieldId]
|
235
|
-
}
|
236
|
-
}
|
251
|
+
{ const: "undefined" },
|
252
|
+
{ const: false },
|
253
|
+
{ const: null },
|
254
|
+
{ const: "" }
|
237
255
|
]
|
238
256
|
}
|
239
257
|
},
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
$form: {
|
246
|
-
type: "object",
|
247
|
-
properties: {
|
248
|
-
[fieldId]: {
|
249
|
-
type: "string",
|
250
|
-
enum: ["undefined"]
|
251
|
-
}
|
252
|
-
},
|
258
|
+
anyOf: [
|
259
|
+
{
|
260
|
+
required: [fieldId]
|
261
|
+
},
|
262
|
+
{
|
253
263
|
not: {
|
254
264
|
required: [fieldId]
|
255
265
|
}
|
256
266
|
}
|
257
|
-
|
258
|
-
required: ["$form"]
|
267
|
+
]
|
259
268
|
}),
|
260
|
-
|
269
|
+
isUndefined: () => defineFormConditional({
|
261
270
|
type: "object",
|
262
271
|
properties: {
|
263
|
-
|
264
|
-
type: "
|
265
|
-
|
266
|
-
[fieldId]: {
|
267
|
-
type: "string",
|
268
|
-
enum: values
|
269
|
-
}
|
270
|
-
},
|
271
|
-
required: [fieldId]
|
272
|
+
[fieldId]: {
|
273
|
+
type: "string",
|
274
|
+
enum: ["undefined"]
|
272
275
|
}
|
273
276
|
},
|
274
|
-
|
277
|
+
not: {
|
278
|
+
required: [fieldId]
|
279
|
+
}
|
275
280
|
}),
|
276
|
-
|
281
|
+
inArray: (values) => defineFormConditional({
|
277
282
|
type: "object",
|
278
283
|
properties: {
|
279
|
-
|
280
|
-
type: "
|
281
|
-
|
282
|
-
[fieldId]: {
|
283
|
-
type: "string",
|
284
|
-
pattern: "^[\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*( [\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*)*$",
|
285
|
-
description: "Name must contain only letters, numbers, and allowed special characters ('._-). No double spaces."
|
286
|
-
}
|
287
|
-
},
|
288
|
-
required: [fieldId]
|
284
|
+
[fieldId]: {
|
285
|
+
type: "string",
|
286
|
+
enum: values
|
289
287
|
}
|
290
288
|
},
|
291
|
-
required: [
|
289
|
+
required: [fieldId]
|
292
290
|
}),
|
293
|
-
|
291
|
+
isValidEnglishName: () => defineFormConditional({
|
294
292
|
type: "object",
|
295
293
|
properties: {
|
296
|
-
|
297
|
-
type: "
|
298
|
-
|
299
|
-
|
300
|
-
type: "string",
|
301
|
-
pattern: "^[0-9]{9}$",
|
302
|
-
description: "The National ID can only be numeric and must be 9 digits long."
|
303
|
-
}
|
304
|
-
},
|
305
|
-
required: [fieldId]
|
294
|
+
[fieldId]: {
|
295
|
+
type: "string",
|
296
|
+
pattern: "^[\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*( [\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*)*$",
|
297
|
+
description: "Name must contain only letters, numbers, and allowed special characters ('._-). No double spaces."
|
306
298
|
}
|
307
299
|
},
|
308
|
-
required: [
|
300
|
+
required: [fieldId]
|
309
301
|
}),
|
310
302
|
/**
|
311
303
|
* Checks if the field value matches a given regular expression pattern.
|
312
304
|
* @param pattern - The regular expression pattern to match the field value against.
|
313
305
|
* @returns A JSONSchema conditional that validates the field value against the pattern.
|
314
306
|
*/
|
315
|
-
matches: (pattern) =>
|
307
|
+
matches: (pattern) => defineFormConditional({
|
316
308
|
type: "object",
|
317
309
|
properties: {
|
318
|
-
|
319
|
-
type: "
|
320
|
-
|
321
|
-
[fieldId]: {
|
322
|
-
type: "string",
|
323
|
-
pattern
|
324
|
-
}
|
325
|
-
},
|
326
|
-
required: [fieldId]
|
310
|
+
[fieldId]: {
|
311
|
+
type: "string",
|
312
|
+
pattern
|
327
313
|
}
|
328
314
|
},
|
329
|
-
required: [
|
315
|
+
required: [fieldId]
|
330
316
|
}),
|
331
|
-
isBetween: (min, max) =>
|
317
|
+
isBetween: (min, max) => defineFormConditional({
|
332
318
|
type: "object",
|
333
319
|
properties: {
|
334
|
-
|
335
|
-
type: "
|
336
|
-
|
337
|
-
|
338
|
-
type: "number",
|
339
|
-
minimum: min,
|
340
|
-
maximum: max
|
341
|
-
}
|
342
|
-
},
|
343
|
-
required: [fieldId]
|
320
|
+
[fieldId]: {
|
321
|
+
type: "number",
|
322
|
+
minimum: min,
|
323
|
+
maximum: max
|
344
324
|
}
|
345
325
|
},
|
346
|
-
required: [
|
326
|
+
required: [fieldId]
|
347
327
|
})
|
348
328
|
};
|
349
329
|
}
|