@dev-crew-berlin/enter-js-utils 0.16.0 → 0.18.0
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.
|
@@ -11,10 +11,10 @@ export declare class FieldGroups {
|
|
|
11
11
|
getLabelForField(fieldKey: string, language: string): string;
|
|
12
12
|
}
|
|
13
13
|
export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
14
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
14
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
15
15
|
optional: true;
|
|
16
16
|
};
|
|
17
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
17
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
18
18
|
optional: true;
|
|
19
19
|
};
|
|
20
20
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -112,18 +112,19 @@ export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectR
|
|
|
112
112
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
113
113
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
114
114
|
}>)[], import("fefe").FefeError>;
|
|
115
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
115
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
116
116
|
optional: true;
|
|
117
117
|
};
|
|
118
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
118
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
119
119
|
optional: true;
|
|
120
120
|
};
|
|
121
|
+
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
121
122
|
}>, import("fefe").FefeError>;
|
|
122
123
|
declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
123
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
124
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
124
125
|
optional: true;
|
|
125
126
|
};
|
|
126
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
127
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
127
128
|
optional: true;
|
|
128
129
|
};
|
|
129
130
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -221,18 +222,19 @@ declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectR
|
|
|
221
222
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
222
223
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
223
224
|
}>)[], import("fefe").FefeError>;
|
|
224
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
225
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
225
226
|
optional: true;
|
|
226
227
|
};
|
|
227
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
228
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
228
229
|
optional: true;
|
|
229
230
|
};
|
|
231
|
+
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
230
232
|
}>[], import("fefe").FefeError>;
|
|
231
233
|
export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
232
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
234
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
233
235
|
optional: true;
|
|
234
236
|
};
|
|
235
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
237
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
236
238
|
optional: true;
|
|
237
239
|
};
|
|
238
240
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -330,18 +332,19 @@ export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe
|
|
|
330
332
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
331
333
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
332
334
|
}>)[], import("fefe").FefeError>;
|
|
333
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
335
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
334
336
|
optional: true;
|
|
335
337
|
};
|
|
336
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
338
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
337
339
|
optional: true;
|
|
338
340
|
};
|
|
341
|
+
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
339
342
|
}>>;
|
|
340
343
|
export declare const parseRawFieldGroupList: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
341
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
344
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
342
345
|
optional: true;
|
|
343
346
|
};
|
|
344
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
347
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
345
348
|
optional: true;
|
|
346
349
|
};
|
|
347
350
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -439,12 +442,13 @@ export declare const parseRawFieldGroupList: import("../lib").APIValidator<impor
|
|
|
439
442
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
440
443
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
441
444
|
}>)[], import("fefe").FefeError>;
|
|
442
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
445
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
443
446
|
optional: true;
|
|
444
447
|
};
|
|
445
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
448
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
446
449
|
optional: true;
|
|
447
450
|
};
|
|
451
|
+
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
448
452
|
}>[]>;
|
|
449
453
|
export declare type RawFieldGroupList = ValidatorReturnType<typeof rawFieldGroupList>;
|
|
450
454
|
export declare type FieldGroup = ValidatorReturnType<typeof fieldGroup>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { array, object, string, optional, union } from 'fefe';
|
|
1
|
+
import { array, object, string, optional, union, boolean } from 'fefe';
|
|
2
2
|
import { apiValidator, success } from '../lib';
|
|
3
3
|
import { field } from './field';
|
|
4
|
-
import { dictionary } from './_helpers';
|
|
4
|
+
import { dictionary, maybe } from './_helpers';
|
|
5
5
|
export class FieldGroups {
|
|
6
6
|
constructor(rawFieldGroupList) {
|
|
7
7
|
this.groups = rawFieldGroupList;
|
|
@@ -28,11 +28,12 @@ export class FieldGroups {
|
|
|
28
28
|
|
|
29
29
|
}
|
|
30
30
|
export const fieldGroup = object({
|
|
31
|
-
title: optional(union(string(), dictionary(string()))),
|
|
32
|
-
class: optional(string()),
|
|
31
|
+
title: optional(maybe(union(string(), dictionary(string())))),
|
|
32
|
+
class: optional(maybe(string())),
|
|
33
33
|
questions: array(field),
|
|
34
|
-
info: optional(union(string(), dictionary(string()))),
|
|
35
|
-
if: optional(string())
|
|
34
|
+
info: optional(maybe(union(string(), dictionary(string())))),
|
|
35
|
+
if: optional(maybe(string())),
|
|
36
|
+
isMetaGroup: boolean()
|
|
36
37
|
}, {
|
|
37
38
|
allowExcessProperties: true
|
|
38
39
|
});
|