@dev-crew-berlin/enter-js-utils 0.24.0 → 0.30.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.
- package/README.md +2 -7
- package/dist/api-client/api-base.d.ts +22 -7
- package/dist/api-client/api-base.js +30 -32
- package/dist/api-client/index.d.ts +27 -45
- package/dist/api-client/index.js +58 -46
- package/dist/generated/api-schema.d.ts +1665 -0
- package/dist/generated/api-schema.js +1 -0
- package/dist/lib/api-result.d.ts +1 -8
- package/dist/lib/api-result.js +1 -12
- package/dist/models/access-token.d.ts +2 -11
- package/dist/models/access-token.js +1 -11
- package/dist/models/attendee.d.ts +13 -60
- package/dist/models/attendee.js +41 -87
- package/dist/models/checkin-counts.d.ts +4 -10
- package/dist/models/checkin-counts.js +1 -10
- package/dist/models/checkin.d.ts +9 -0
- package/dist/models/checkin.js +16 -0
- package/dist/models/checkins.d.ts +4 -32
- package/dist/models/checkins.js +14 -42
- package/dist/models/event.d.ts +2 -40
- package/dist/models/field-group.d.ts +5 -448
- package/dist/models/field-group.js +4 -31
- package/dist/models/field-value.d.ts +0 -1
- package/dist/models/field-value.js +1 -3
- package/dist/models/field.d.ts +11 -297
- package/dist/models/field.js +1 -89
- package/dist/models/index.d.ts +2 -3
- package/dist/models/instance.d.ts +10 -53
- package/dist/models/instance.js +23 -65
- package/dist/models/user.d.ts +2 -20
- package/dist/models/user.js +1 -13
- package/dist/models/variable.d.ts +2 -27
- package/dist/models/variable.js +1 -16
- package/dist/ui/companion-info.stories.js +1 -3
- package/dist/ui/guest-card.stories.js +2 -6
- package/package.json +10 -8
- package/dist/models/_helpers.d.ts +0 -23
- package/dist/models/_helpers.js +0 -89
- package/dist/models/invite.d.ts +0 -33
- package/dist/models/invite.js +0 -21
- package/dist/models/meta-field.d.ts +0 -7
- package/dist/models/meta-field.js +0 -9
|
@@ -1,456 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { components } from '../generated/api-schema';
|
|
2
|
+
export declare type Dictionary<T> = Record<string, T>;
|
|
3
|
+
export declare type FieldGroup = components['schemas']['FieldGroup'];
|
|
4
|
+
export declare type FieldLabels = Record<string, FieldTitle | undefined>;
|
|
4
5
|
declare type FieldTitle = string | Dictionary<string>;
|
|
5
|
-
export declare type FieldLabels = Record<string, FieldTitle | null>;
|
|
6
6
|
export declare class FieldGroups {
|
|
7
7
|
groups: FieldGroup[];
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(json: FieldGroup[]);
|
|
9
9
|
toJSON(): FieldGroup[];
|
|
10
10
|
getFieldLabels(): FieldLabels;
|
|
11
11
|
getLabelForField(fieldKey: string, language: string): string;
|
|
12
12
|
}
|
|
13
|
-
export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
14
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
15
|
-
optional: true;
|
|
16
|
-
};
|
|
17
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
18
|
-
optional: true;
|
|
19
|
-
};
|
|
20
|
-
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
21
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
22
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
23
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
24
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
25
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
26
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
27
|
-
type: import("fefe").Validator<"static", import("fefe").LeafError>;
|
|
28
|
-
}> | import("fefe").ObjectResult<{
|
|
29
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
30
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
31
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
32
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
33
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
34
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
35
|
-
type: import("fefe").Validator<"text", import("fefe").LeafError>;
|
|
36
|
-
}> | import("fefe").ObjectResult<{
|
|
37
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
38
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
39
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
40
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
41
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
42
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
43
|
-
type: import("fefe").Validator<"longtext", import("fefe").LeafError>;
|
|
44
|
-
}> | import("fefe").ObjectResult<{
|
|
45
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
46
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
47
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
48
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
49
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
50
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
51
|
-
type: import("fefe").Validator<"email", import("fefe").LeafError>;
|
|
52
|
-
}> | import("fefe").ObjectResult<{
|
|
53
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
54
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
55
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
56
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
57
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
58
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
59
|
-
type: import("fefe").Validator<"number", import("fefe").LeafError>;
|
|
60
|
-
}> | import("fefe").ObjectResult<{
|
|
61
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
62
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
63
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
64
|
-
}>[], import("fefe").FefeError>;
|
|
65
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
66
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
67
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
68
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
69
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
70
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
71
|
-
type: import("fefe").Validator<"check", import("fefe").LeafError>;
|
|
72
|
-
}> | import("fefe").ObjectResult<{
|
|
73
|
-
value: import("fefe").Validator<number, import("fefe").FefeError>;
|
|
74
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
75
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
76
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
77
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
78
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
79
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
80
|
-
type: import("fefe").Validator<"checkbox", import("fefe").LeafError>;
|
|
81
|
-
}> | import("fefe").ObjectResult<{
|
|
82
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
83
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
84
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
85
|
-
}>[], import("fefe").FefeError>;
|
|
86
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
87
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
88
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
89
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
90
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
91
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
92
|
-
type: import("fefe").Validator<"radio", import("fefe").LeafError>;
|
|
93
|
-
}> | import("fefe").ObjectResult<{
|
|
94
|
-
itemval: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
95
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
96
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
97
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
98
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
99
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
100
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
101
|
-
type: import("fefe").Validator<"radiobutton", import("fefe").LeafError>;
|
|
102
|
-
}> | import("fefe").ObjectResult<{
|
|
103
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
104
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
105
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
106
|
-
}>[], import("fefe").FefeError>;
|
|
107
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
108
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
109
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
110
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
111
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
112
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
113
|
-
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
114
|
-
}>)[], import("fefe").FefeError>;
|
|
115
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
116
|
-
optional: true;
|
|
117
|
-
};
|
|
118
|
-
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
119
|
-
optional: true;
|
|
120
|
-
};
|
|
121
|
-
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
122
|
-
}>, import("fefe").FefeError>;
|
|
123
|
-
declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
124
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
125
|
-
optional: true;
|
|
126
|
-
};
|
|
127
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
128
|
-
optional: true;
|
|
129
|
-
};
|
|
130
|
-
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
131
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
132
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
133
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
134
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
135
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
136
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
137
|
-
type: import("fefe").Validator<"static", import("fefe").LeafError>;
|
|
138
|
-
}> | import("fefe").ObjectResult<{
|
|
139
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
140
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
141
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
142
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
143
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
144
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
145
|
-
type: import("fefe").Validator<"text", import("fefe").LeafError>;
|
|
146
|
-
}> | import("fefe").ObjectResult<{
|
|
147
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
148
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
149
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
150
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
151
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
152
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
153
|
-
type: import("fefe").Validator<"longtext", import("fefe").LeafError>;
|
|
154
|
-
}> | import("fefe").ObjectResult<{
|
|
155
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
156
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
157
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
158
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
159
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
160
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
161
|
-
type: import("fefe").Validator<"email", import("fefe").LeafError>;
|
|
162
|
-
}> | import("fefe").ObjectResult<{
|
|
163
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
164
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
165
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
166
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
167
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
168
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
169
|
-
type: import("fefe").Validator<"number", import("fefe").LeafError>;
|
|
170
|
-
}> | import("fefe").ObjectResult<{
|
|
171
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
172
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
173
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
174
|
-
}>[], import("fefe").FefeError>;
|
|
175
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
176
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
177
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
178
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
179
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
180
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
181
|
-
type: import("fefe").Validator<"check", import("fefe").LeafError>;
|
|
182
|
-
}> | import("fefe").ObjectResult<{
|
|
183
|
-
value: import("fefe").Validator<number, import("fefe").FefeError>;
|
|
184
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
185
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
186
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
187
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
188
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
189
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
190
|
-
type: import("fefe").Validator<"checkbox", import("fefe").LeafError>;
|
|
191
|
-
}> | import("fefe").ObjectResult<{
|
|
192
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
193
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
194
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
195
|
-
}>[], import("fefe").FefeError>;
|
|
196
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
197
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
198
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
199
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
200
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
201
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
202
|
-
type: import("fefe").Validator<"radio", import("fefe").LeafError>;
|
|
203
|
-
}> | import("fefe").ObjectResult<{
|
|
204
|
-
itemval: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
205
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
206
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
207
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
208
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
209
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
210
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
211
|
-
type: import("fefe").Validator<"radiobutton", import("fefe").LeafError>;
|
|
212
|
-
}> | import("fefe").ObjectResult<{
|
|
213
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
214
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
215
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
216
|
-
}>[], import("fefe").FefeError>;
|
|
217
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
218
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
219
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
220
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
221
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
222
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
223
|
-
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
224
|
-
}>)[], import("fefe").FefeError>;
|
|
225
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
226
|
-
optional: true;
|
|
227
|
-
};
|
|
228
|
-
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
229
|
-
optional: true;
|
|
230
|
-
};
|
|
231
|
-
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
232
|
-
}>[], import("fefe").FefeError>;
|
|
233
|
-
export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
234
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
235
|
-
optional: true;
|
|
236
|
-
};
|
|
237
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
238
|
-
optional: true;
|
|
239
|
-
};
|
|
240
|
-
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
241
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
242
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
243
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
244
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
245
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
246
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
247
|
-
type: import("fefe").Validator<"static", import("fefe").LeafError>;
|
|
248
|
-
}> | import("fefe").ObjectResult<{
|
|
249
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
250
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
251
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
252
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
253
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
254
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
255
|
-
type: import("fefe").Validator<"text", import("fefe").LeafError>;
|
|
256
|
-
}> | import("fefe").ObjectResult<{
|
|
257
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
258
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
259
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
260
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
261
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
262
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
263
|
-
type: import("fefe").Validator<"longtext", import("fefe").LeafError>;
|
|
264
|
-
}> | import("fefe").ObjectResult<{
|
|
265
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
266
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
267
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
268
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
269
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
270
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
271
|
-
type: import("fefe").Validator<"email", import("fefe").LeafError>;
|
|
272
|
-
}> | import("fefe").ObjectResult<{
|
|
273
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
274
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
275
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
276
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
277
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
278
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
279
|
-
type: import("fefe").Validator<"number", import("fefe").LeafError>;
|
|
280
|
-
}> | import("fefe").ObjectResult<{
|
|
281
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
282
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
283
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
284
|
-
}>[], import("fefe").FefeError>;
|
|
285
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
286
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
287
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
288
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
289
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
290
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
291
|
-
type: import("fefe").Validator<"check", import("fefe").LeafError>;
|
|
292
|
-
}> | import("fefe").ObjectResult<{
|
|
293
|
-
value: import("fefe").Validator<number, import("fefe").FefeError>;
|
|
294
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
295
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
296
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
297
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
298
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
299
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
300
|
-
type: import("fefe").Validator<"checkbox", import("fefe").LeafError>;
|
|
301
|
-
}> | import("fefe").ObjectResult<{
|
|
302
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
303
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
304
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
305
|
-
}>[], import("fefe").FefeError>;
|
|
306
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
307
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
308
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
309
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
310
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
311
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
312
|
-
type: import("fefe").Validator<"radio", import("fefe").LeafError>;
|
|
313
|
-
}> | import("fefe").ObjectResult<{
|
|
314
|
-
itemval: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
315
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
316
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
317
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
318
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
319
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
320
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
321
|
-
type: import("fefe").Validator<"radiobutton", import("fefe").LeafError>;
|
|
322
|
-
}> | import("fefe").ObjectResult<{
|
|
323
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
324
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
325
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
326
|
-
}>[], import("fefe").FefeError>;
|
|
327
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
328
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
329
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
330
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
331
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
332
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
333
|
-
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
334
|
-
}>)[], import("fefe").FefeError>;
|
|
335
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
336
|
-
optional: true;
|
|
337
|
-
};
|
|
338
|
-
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
339
|
-
optional: true;
|
|
340
|
-
};
|
|
341
|
-
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
342
|
-
}>>;
|
|
343
|
-
export declare const parseRawFieldGroupList: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
344
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
345
|
-
optional: true;
|
|
346
|
-
};
|
|
347
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
348
|
-
optional: true;
|
|
349
|
-
};
|
|
350
|
-
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
351
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
352
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
353
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
354
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
355
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
356
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
357
|
-
type: import("fefe").Validator<"static", import("fefe").LeafError>;
|
|
358
|
-
}> | import("fefe").ObjectResult<{
|
|
359
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
360
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
361
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
362
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
363
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
364
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
365
|
-
type: import("fefe").Validator<"text", import("fefe").LeafError>;
|
|
366
|
-
}> | import("fefe").ObjectResult<{
|
|
367
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
368
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
369
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
370
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
371
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
372
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
373
|
-
type: import("fefe").Validator<"longtext", import("fefe").LeafError>;
|
|
374
|
-
}> | import("fefe").ObjectResult<{
|
|
375
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
376
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
377
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
378
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
379
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
380
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
381
|
-
type: import("fefe").Validator<"email", import("fefe").LeafError>;
|
|
382
|
-
}> | import("fefe").ObjectResult<{
|
|
383
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
384
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
385
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
386
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
387
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
388
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
389
|
-
type: import("fefe").Validator<"number", import("fefe").LeafError>;
|
|
390
|
-
}> | import("fefe").ObjectResult<{
|
|
391
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
392
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
393
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
394
|
-
}>[], import("fefe").FefeError>;
|
|
395
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
396
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
397
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
398
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
399
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
400
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
401
|
-
type: import("fefe").Validator<"check", import("fefe").LeafError>;
|
|
402
|
-
}> | import("fefe").ObjectResult<{
|
|
403
|
-
value: import("fefe").Validator<number, import("fefe").FefeError>;
|
|
404
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
405
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
406
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
407
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
408
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
409
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
410
|
-
type: import("fefe").Validator<"checkbox", import("fefe").LeafError>;
|
|
411
|
-
}> | import("fefe").ObjectResult<{
|
|
412
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
413
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
414
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
415
|
-
}>[], import("fefe").FefeError>;
|
|
416
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
417
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
418
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
419
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
420
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
421
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
422
|
-
type: import("fefe").Validator<"radio", import("fefe").LeafError>;
|
|
423
|
-
}> | import("fefe").ObjectResult<{
|
|
424
|
-
itemval: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
425
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
426
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
427
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
428
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
429
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
430
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
431
|
-
type: import("fefe").Validator<"radiobutton", import("fefe").LeafError>;
|
|
432
|
-
}> | import("fefe").ObjectResult<{
|
|
433
|
-
items: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
434
|
-
name: import("fefe").Validator<string | Dictionary<string>, import("fefe").LeafError>;
|
|
435
|
-
value: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
436
|
-
}>[], import("fefe").FefeError>;
|
|
437
|
-
name: import("fefe").Validator<string, import("fefe").LeafError>;
|
|
438
|
-
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
439
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError>;
|
|
440
|
-
required: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
441
|
-
isMetaField: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
442
|
-
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
443
|
-
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
444
|
-
}>)[], import("fefe").FefeError>;
|
|
445
|
-
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
446
|
-
optional: true;
|
|
447
|
-
};
|
|
448
|
-
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
449
|
-
optional: true;
|
|
450
|
-
};
|
|
451
|
-
isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
452
|
-
}>[]>;
|
|
453
|
-
export declare type RawFieldGroupList = ValidatorReturnType<typeof rawFieldGroupList>;
|
|
454
|
-
export declare type FieldGroup = ValidatorReturnType<typeof fieldGroup>;
|
|
455
|
-
export declare const parseFieldGroups: (value: unknown) => APIResult<FieldGroups>;
|
|
456
13
|
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { array, object, string, optional, union, boolean } from 'fefe';
|
|
2
|
-
import { apiValidator, success } from '../lib';
|
|
3
|
-
import { field } from './field';
|
|
4
|
-
import { dictionary, maybe } from './_helpers';
|
|
5
1
|
export class FieldGroups {
|
|
6
|
-
constructor(
|
|
7
|
-
this.groups =
|
|
2
|
+
constructor(json) {
|
|
3
|
+
this.groups = json;
|
|
8
4
|
}
|
|
9
5
|
|
|
10
6
|
toJSON() {
|
|
@@ -22,31 +18,8 @@ export class FieldGroups {
|
|
|
22
18
|
|
|
23
19
|
getLabelForField(fieldKey, language) {
|
|
24
20
|
const fieldLabel = this.getFieldLabels()[fieldKey];
|
|
25
|
-
const translatedLabel = fieldLabel ===
|
|
21
|
+
const translatedLabel = fieldLabel === undefined || typeof fieldLabel === 'string' ? fieldLabel : fieldLabel[language];
|
|
26
22
|
return translatedLabel ?? fieldKey;
|
|
27
23
|
}
|
|
28
24
|
|
|
29
|
-
}
|
|
30
|
-
export const fieldGroup = object({
|
|
31
|
-
title: optional(maybe(union(string(), dictionary(string())))),
|
|
32
|
-
class: optional(maybe(string())),
|
|
33
|
-
questions: array(field),
|
|
34
|
-
info: optional(maybe(union(string(), dictionary(string())))),
|
|
35
|
-
if: optional(maybe(string())),
|
|
36
|
-
isMetaGroup: boolean()
|
|
37
|
-
}, {
|
|
38
|
-
allowExcessProperties: true
|
|
39
|
-
});
|
|
40
|
-
const rawFieldGroupList = array(fieldGroup);
|
|
41
|
-
export const parseFieldGroup = apiValidator(fieldGroup);
|
|
42
|
-
export const parseRawFieldGroupList = apiValidator(rawFieldGroupList);
|
|
43
|
-
// export const fieldGroups = (value: unknown): FefeResult<FieldGroups> => {
|
|
44
|
-
// const result = rawFieldGroupList(value)
|
|
45
|
-
// if (isFailure(result)) return result
|
|
46
|
-
// return fefeSuccess(new FieldGroups(result.right))
|
|
47
|
-
// }
|
|
48
|
-
export const parseFieldGroups = value => {
|
|
49
|
-
const result = apiValidator(rawFieldGroupList)(value);
|
|
50
|
-
if (!result.success) return result;
|
|
51
|
-
return success(new FieldGroups(result.data));
|
|
52
|
-
};
|
|
25
|
+
}
|