@dmptool/types 1.2.6 → 2.1.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 +1 -1
- package/dist/answers/__tests__/defaults.spec.js +216 -0
- package/dist/answers/answer.d.ts +29 -14
- package/dist/answers/answer.js +11 -5
- package/dist/answers/dateAnswers.d.ts +20 -47
- package/dist/answers/dateAnswers.js +20 -10
- package/dist/answers/graphQLAnswers.d.ts +48 -120
- package/dist/answers/graphQLAnswers.js +46 -21
- package/dist/answers/index.d.ts +155 -1439
- package/dist/answers/index.js +26 -1
- package/dist/answers/numberAnswers.d.ts +38 -92
- package/dist/answers/numberAnswers.js +38 -19
- package/dist/answers/optionBasedAnswers.d.ts +42 -87
- package/dist/answers/optionBasedAnswers.js +37 -21
- package/dist/answers/tableAnswers.d.ts +348 -3032
- package/dist/answers/tableAnswers.js +25 -61
- package/dist/answers/textAnswers.d.ts +32 -68
- package/dist/answers/textAnswers.js +30 -17
- package/dist/dmp/__tests__/commonStandard.spec.d.ts +1 -0
- package/dist/dmp/__tests__/commonStandard.spec.js +210 -0
- package/dist/dmp/__tests__/extensions.spec.d.ts +1 -0
- package/dist/dmp/__tests__/extensions.spec.js +99 -0
- package/dist/dmp/extension.d.ts +1006 -0
- package/dist/dmp/extension.js +234 -0
- package/dist/dmp/index.d.ts +9 -0
- package/dist/dmp/index.js +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/questions/__tests__/dateQuestions.spec.js +3 -0
- package/dist/questions/__tests__/defaults.spec.d.ts +1 -0
- package/dist/questions/__tests__/defaults.spec.js +668 -0
- package/dist/questions/__tests__/optionBasedQuestions.spec.js +3 -2
- package/dist/questions/__tests__/tableQuestion.spec.js +22 -23
- package/dist/questions/__tests__/textQuestions.spec.js +32 -0
- package/dist/questions/dateQuestions.d.ts +45 -191
- package/dist/questions/dateQuestions.js +26 -23
- package/dist/questions/graphQLQuestions.d.ts +262 -556
- package/dist/questions/graphQLQuestions.js +225 -223
- package/dist/questions/index.d.ts +670 -7441
- package/dist/questions/index.js +26 -1
- package/dist/questions/numberQuestions.d.ts +85 -331
- package/dist/questions/numberQuestions.js +50 -36
- package/dist/questions/optionBasedQuestions.d.ts +83 -290
- package/dist/questions/optionBasedQuestions.js +58 -41
- package/dist/questions/question.d.ts +72 -35
- package/dist/questions/question.js +14 -5
- package/dist/questions/tableQuestions.d.ts +2228 -9599
- package/dist/questions/tableQuestions.js +185 -192
- package/dist/questions/textQuestions.d.ts +70 -226
- package/dist/questions/textQuestions.js +31 -31
- package/dist/schemas/affiliationSearchAnswer.schema.json +35 -33
- package/dist/schemas/affiliationSearchQuestion.schema.json +124 -122
- package/dist/schemas/anyAnswer.schema.json +1229 -408
- package/dist/schemas/anyQuestion.schema.json +4312 -2023
- package/dist/schemas/anyTableColumnAnswer.schema.json +535 -314
- package/dist/schemas/anyTableColumnQuestion.schema.json +1309 -874
- package/dist/schemas/booleanAnswer.schema.json +22 -23
- package/dist/schemas/booleanQuestion.schema.json +39 -43
- package/dist/schemas/checkboxesAnswer.schema.json +27 -28
- package/dist/schemas/checkboxesQuestion.schema.json +63 -62
- package/dist/schemas/currencyAnswer.schema.json +22 -23
- package/dist/schemas/currencyQuestion.schema.json +57 -54
- package/dist/schemas/dateAnswer.schema.json +22 -23
- package/dist/schemas/dateQuestion.schema.json +50 -49
- package/dist/schemas/dateRangeAnswer.schema.json +35 -33
- package/dist/schemas/dateRangeQuestion.schema.json +87 -78
- package/dist/schemas/dmp.schema.json +2070 -0
- package/dist/schemas/dmpExtension.schema.json +1874 -0
- package/dist/schemas/emailAnswer.schema.json +22 -23
- package/dist/schemas/emailQuestion.schema.json +55 -53
- package/dist/schemas/licenseSearchAnswer.schema.json +40 -38
- package/dist/schemas/licenseSearchQuestion.schema.json +122 -146
- package/dist/schemas/metadataStandardSearchAnswer.schema.json +40 -38
- package/dist/schemas/metadataStandardSearchQuestion.schema.json +123 -156
- package/dist/schemas/multiselectBoxAnswer.schema.json +27 -28
- package/dist/schemas/multiselectBoxQuestion.schema.json +70 -71
- package/dist/schemas/numberAnswer.schema.json +22 -23
- package/dist/schemas/numberQuestion.schema.json +52 -50
- package/dist/schemas/numberRangeAnswer.schema.json +35 -33
- package/dist/schemas/numberRangeQuestion.schema.json +91 -60
- package/dist/schemas/numberWithContextAnswer.schema.json +35 -33
- package/dist/schemas/numberWithContextQuestion.schema.json +81 -70
- package/dist/schemas/radioButtonsAnswer.schema.json +22 -23
- package/dist/schemas/radioButtonsQuestion.schema.json +63 -62
- package/dist/schemas/repositorySearchAnswer.schema.json +40 -38
- package/dist/schemas/repositorySearchQuestion.schema.json +122 -162
- package/dist/schemas/researchOutputTableAnswer.schema.json +16622 -411
- package/dist/schemas/researchOutputTableQuestion.schema.json +114 -1157
- package/dist/schemas/selectBoxAnswer.schema.json +22 -23
- package/dist/schemas/selectBoxQuestion.schema.json +70 -71
- package/dist/schemas/tableAnswer.schema.json +581 -360
- package/dist/schemas/tableQuestion.schema.json +1388 -942
- package/dist/schemas/textAnswer.schema.json +22 -23
- package/dist/schemas/textAreaAnswer.schema.json +22 -23
- package/dist/schemas/textAreaQuestion.schema.json +65 -57
- package/dist/schemas/textQuestion.schema.json +50 -49
- package/dist/schemas/urlAnswer.schema.json +22 -23
- package/dist/schemas/urlQuestion.schema.json +50 -49
- package/package.json +6 -4
- package/dist/answers/__tests__/usage.spec.js +0 -178
- package/dist/questions/__tests__/usage.spec.d.ts +0 -8
- package/dist/questions/__tests__/usage.spec.js +0 -473
- /package/dist/answers/__tests__/{usage.spec.d.ts → defaults.spec.d.ts} +0 -0
|
@@ -1,301 +1,145 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const EmailQuestionSchema: z.ZodObject<{
|
|
3
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
4
|
-
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
5
|
-
title: z.ZodOptional<z.ZodString>;
|
|
6
|
-
usageDescription: z.ZodOptional<z.ZodString>;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
schemaVersion: string;
|
|
9
|
-
title?: string | undefined;
|
|
10
|
-
usageDescription?: string | undefined;
|
|
11
|
-
}, {
|
|
12
|
-
schemaVersion?: string | undefined;
|
|
13
|
-
title?: string | undefined;
|
|
14
|
-
usageDescription?: string | undefined;
|
|
15
|
-
}>>;
|
|
16
|
-
} & {
|
|
17
3
|
type: z.ZodLiteral<"email">;
|
|
18
|
-
attributes: z.
|
|
19
|
-
|
|
20
|
-
help: z.ZodOptional<z.ZodString>;
|
|
21
|
-
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
22
|
-
} & {
|
|
4
|
+
attributes: z.ZodObject<{
|
|
5
|
+
multiple: z.ZodDefault<z.ZodBoolean>;
|
|
23
6
|
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
24
7
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
25
8
|
pattern: z.ZodOptional<z.ZodString>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
label?: string | undefined;
|
|
38
|
-
help?: string | undefined;
|
|
39
|
-
labelTranslationKey?: string | undefined;
|
|
40
|
-
maxLength?: number | undefined;
|
|
41
|
-
minLength?: number | undefined;
|
|
42
|
-
pattern?: string | undefined;
|
|
43
|
-
multiple?: boolean | undefined;
|
|
44
|
-
}>>;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
label: z.ZodOptional<z.ZodString>;
|
|
10
|
+
help: z.ZodOptional<z.ZodString>;
|
|
11
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
meta: z.ZodObject<{
|
|
14
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
15
|
+
title: z.ZodOptional<z.ZodString>;
|
|
16
|
+
usageDescription: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const DefaultEmailQuestion: {
|
|
46
20
|
type: "email";
|
|
47
21
|
attributes: {
|
|
48
|
-
maxLength: number;
|
|
49
22
|
multiple: boolean;
|
|
23
|
+
maxLength: number;
|
|
24
|
+
minLength?: number | undefined;
|
|
25
|
+
pattern?: string | undefined;
|
|
50
26
|
label?: string | undefined;
|
|
51
27
|
help?: string | undefined;
|
|
52
28
|
labelTranslationKey?: string | undefined;
|
|
53
|
-
minLength?: number | undefined;
|
|
54
|
-
pattern?: string | undefined;
|
|
55
29
|
};
|
|
56
30
|
meta: {
|
|
57
31
|
schemaVersion: string;
|
|
58
32
|
title?: string | undefined;
|
|
59
33
|
usageDescription?: string | undefined;
|
|
60
34
|
};
|
|
61
|
-
}
|
|
62
|
-
type: "email";
|
|
63
|
-
attributes?: {
|
|
64
|
-
label?: string | undefined;
|
|
65
|
-
help?: string | undefined;
|
|
66
|
-
labelTranslationKey?: string | undefined;
|
|
67
|
-
maxLength?: number | undefined;
|
|
68
|
-
minLength?: number | undefined;
|
|
69
|
-
pattern?: string | undefined;
|
|
70
|
-
multiple?: boolean | undefined;
|
|
71
|
-
} | undefined;
|
|
72
|
-
meta?: {
|
|
73
|
-
schemaVersion?: string | undefined;
|
|
74
|
-
title?: string | undefined;
|
|
75
|
-
usageDescription?: string | undefined;
|
|
76
|
-
} | undefined;
|
|
77
|
-
}>;
|
|
35
|
+
};
|
|
78
36
|
export declare const TextAreaQuestionSchema: z.ZodObject<{
|
|
79
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
80
|
-
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
81
|
-
title: z.ZodOptional<z.ZodString>;
|
|
82
|
-
usageDescription: z.ZodOptional<z.ZodString>;
|
|
83
|
-
}, "strip", z.ZodTypeAny, {
|
|
84
|
-
schemaVersion: string;
|
|
85
|
-
title?: string | undefined;
|
|
86
|
-
usageDescription?: string | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
schemaVersion?: string | undefined;
|
|
89
|
-
title?: string | undefined;
|
|
90
|
-
usageDescription?: string | undefined;
|
|
91
|
-
}>>;
|
|
92
|
-
} & {
|
|
93
37
|
type: z.ZodLiteral<"textArea">;
|
|
94
|
-
attributes: z.
|
|
95
|
-
label: z.ZodOptional<z.ZodString>;
|
|
96
|
-
help: z.ZodOptional<z.ZodString>;
|
|
97
|
-
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
98
|
-
} & {
|
|
38
|
+
attributes: z.ZodObject<{
|
|
99
39
|
cols: z.ZodDefault<z.ZodNumber>;
|
|
100
|
-
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
101
|
-
minLength: z.ZodOptional<z.ZodNumber>;
|
|
102
40
|
rows: z.ZodDefault<z.ZodNumber>;
|
|
103
41
|
asRichText: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
minLength?: number | undefined;
|
|
119
|
-
cols?: number | undefined;
|
|
120
|
-
rows?: number | undefined;
|
|
121
|
-
asRichText?: boolean | undefined;
|
|
122
|
-
}>>;
|
|
123
|
-
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
43
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
45
|
+
label: z.ZodOptional<z.ZodString>;
|
|
46
|
+
help: z.ZodOptional<z.ZodString>;
|
|
47
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
meta: z.ZodObject<{
|
|
50
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
51
|
+
title: z.ZodOptional<z.ZodString>;
|
|
52
|
+
usageDescription: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export declare const DefaultTextAreaQuestion: {
|
|
124
56
|
type: "textArea";
|
|
125
57
|
attributes: {
|
|
126
58
|
cols: number;
|
|
127
59
|
rows: number;
|
|
128
60
|
asRichText: boolean;
|
|
61
|
+
maxLength: number;
|
|
62
|
+
minLength?: number | undefined;
|
|
63
|
+
pattern?: string | undefined;
|
|
129
64
|
label?: string | undefined;
|
|
130
65
|
help?: string | undefined;
|
|
131
66
|
labelTranslationKey?: string | undefined;
|
|
132
|
-
maxLength?: number | undefined;
|
|
133
|
-
minLength?: number | undefined;
|
|
134
67
|
};
|
|
135
68
|
meta: {
|
|
136
69
|
schemaVersion: string;
|
|
137
70
|
title?: string | undefined;
|
|
138
71
|
usageDescription?: string | undefined;
|
|
139
72
|
};
|
|
140
|
-
}
|
|
141
|
-
type: "textArea";
|
|
142
|
-
attributes?: {
|
|
143
|
-
label?: string | undefined;
|
|
144
|
-
help?: string | undefined;
|
|
145
|
-
labelTranslationKey?: string | undefined;
|
|
146
|
-
maxLength?: number | undefined;
|
|
147
|
-
minLength?: number | undefined;
|
|
148
|
-
cols?: number | undefined;
|
|
149
|
-
rows?: number | undefined;
|
|
150
|
-
asRichText?: boolean | undefined;
|
|
151
|
-
} | undefined;
|
|
152
|
-
meta?: {
|
|
153
|
-
schemaVersion?: string | undefined;
|
|
154
|
-
title?: string | undefined;
|
|
155
|
-
usageDescription?: string | undefined;
|
|
156
|
-
} | undefined;
|
|
157
|
-
}>;
|
|
73
|
+
};
|
|
158
74
|
export declare const TextQuestionSchema: z.ZodObject<{
|
|
159
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
160
|
-
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
161
|
-
title: z.ZodOptional<z.ZodString>;
|
|
162
|
-
usageDescription: z.ZodOptional<z.ZodString>;
|
|
163
|
-
}, "strip", z.ZodTypeAny, {
|
|
164
|
-
schemaVersion: string;
|
|
165
|
-
title?: string | undefined;
|
|
166
|
-
usageDescription?: string | undefined;
|
|
167
|
-
}, {
|
|
168
|
-
schemaVersion?: string | undefined;
|
|
169
|
-
title?: string | undefined;
|
|
170
|
-
usageDescription?: string | undefined;
|
|
171
|
-
}>>;
|
|
172
|
-
} & {
|
|
173
75
|
type: z.ZodLiteral<"text">;
|
|
174
|
-
attributes: z.
|
|
175
|
-
label: z.ZodOptional<z.ZodString>;
|
|
176
|
-
help: z.ZodOptional<z.ZodString>;
|
|
177
|
-
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
178
|
-
} & {
|
|
76
|
+
attributes: z.ZodObject<{
|
|
179
77
|
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
180
78
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
181
79
|
pattern: z.ZodOptional<z.ZodString>;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
maxLength?: number | undefined;
|
|
194
|
-
minLength?: number | undefined;
|
|
195
|
-
pattern?: string | undefined;
|
|
196
|
-
}>>;
|
|
197
|
-
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
label: z.ZodOptional<z.ZodString>;
|
|
81
|
+
help: z.ZodOptional<z.ZodString>;
|
|
82
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
meta: z.ZodObject<{
|
|
85
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
86
|
+
title: z.ZodOptional<z.ZodString>;
|
|
87
|
+
usageDescription: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export declare const DefaultTextQuestion: {
|
|
198
91
|
type: "text";
|
|
199
92
|
attributes: {
|
|
200
93
|
maxLength: number;
|
|
94
|
+
minLength?: number | undefined;
|
|
95
|
+
pattern?: string | undefined;
|
|
201
96
|
label?: string | undefined;
|
|
202
97
|
help?: string | undefined;
|
|
203
98
|
labelTranslationKey?: string | undefined;
|
|
204
|
-
minLength?: number | undefined;
|
|
205
|
-
pattern?: string | undefined;
|
|
206
99
|
};
|
|
207
100
|
meta: {
|
|
208
101
|
schemaVersion: string;
|
|
209
102
|
title?: string | undefined;
|
|
210
103
|
usageDescription?: string | undefined;
|
|
211
104
|
};
|
|
212
|
-
}
|
|
213
|
-
type: "text";
|
|
214
|
-
attributes?: {
|
|
215
|
-
label?: string | undefined;
|
|
216
|
-
help?: string | undefined;
|
|
217
|
-
labelTranslationKey?: string | undefined;
|
|
218
|
-
maxLength?: number | undefined;
|
|
219
|
-
minLength?: number | undefined;
|
|
220
|
-
pattern?: string | undefined;
|
|
221
|
-
} | undefined;
|
|
222
|
-
meta?: {
|
|
223
|
-
schemaVersion?: string | undefined;
|
|
224
|
-
title?: string | undefined;
|
|
225
|
-
usageDescription?: string | undefined;
|
|
226
|
-
} | undefined;
|
|
227
|
-
}>;
|
|
105
|
+
};
|
|
228
106
|
export declare const URLQuestionSchema: z.ZodObject<{
|
|
229
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
230
|
-
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
231
|
-
title: z.ZodOptional<z.ZodString>;
|
|
232
|
-
usageDescription: z.ZodOptional<z.ZodString>;
|
|
233
|
-
}, "strip", z.ZodTypeAny, {
|
|
234
|
-
schemaVersion: string;
|
|
235
|
-
title?: string | undefined;
|
|
236
|
-
usageDescription?: string | undefined;
|
|
237
|
-
}, {
|
|
238
|
-
schemaVersion?: string | undefined;
|
|
239
|
-
title?: string | undefined;
|
|
240
|
-
usageDescription?: string | undefined;
|
|
241
|
-
}>>;
|
|
242
|
-
} & {
|
|
243
107
|
type: z.ZodLiteral<"url">;
|
|
244
|
-
attributes: z.
|
|
245
|
-
label: z.ZodOptional<z.ZodString>;
|
|
246
|
-
help: z.ZodOptional<z.ZodString>;
|
|
247
|
-
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
248
|
-
} & {
|
|
108
|
+
attributes: z.ZodObject<{
|
|
249
109
|
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
250
110
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
251
111
|
pattern: z.ZodOptional<z.ZodString>;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
maxLength?: number | undefined;
|
|
264
|
-
minLength?: number | undefined;
|
|
265
|
-
pattern?: string | undefined;
|
|
266
|
-
}>>;
|
|
267
|
-
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
label: z.ZodOptional<z.ZodString>;
|
|
113
|
+
help: z.ZodOptional<z.ZodString>;
|
|
114
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
meta: z.ZodObject<{
|
|
117
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
118
|
+
title: z.ZodOptional<z.ZodString>;
|
|
119
|
+
usageDescription: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export declare const DefaultURLQuestion: {
|
|
268
123
|
type: "url";
|
|
269
124
|
attributes: {
|
|
270
125
|
maxLength: number;
|
|
126
|
+
minLength?: number | undefined;
|
|
127
|
+
pattern?: string | undefined;
|
|
271
128
|
label?: string | undefined;
|
|
272
129
|
help?: string | undefined;
|
|
273
130
|
labelTranslationKey?: string | undefined;
|
|
274
|
-
minLength?: number | undefined;
|
|
275
|
-
pattern?: string | undefined;
|
|
276
131
|
};
|
|
277
132
|
meta: {
|
|
278
133
|
schemaVersion: string;
|
|
279
134
|
title?: string | undefined;
|
|
280
135
|
usageDescription?: string | undefined;
|
|
281
136
|
};
|
|
282
|
-
}
|
|
283
|
-
type: "url";
|
|
284
|
-
attributes?: {
|
|
285
|
-
label?: string | undefined;
|
|
286
|
-
help?: string | undefined;
|
|
287
|
-
labelTranslationKey?: string | undefined;
|
|
288
|
-
maxLength?: number | undefined;
|
|
289
|
-
minLength?: number | undefined;
|
|
290
|
-
pattern?: string | undefined;
|
|
291
|
-
} | undefined;
|
|
292
|
-
meta?: {
|
|
293
|
-
schemaVersion?: string | undefined;
|
|
294
|
-
title?: string | undefined;
|
|
295
|
-
usageDescription?: string | undefined;
|
|
296
|
-
} | undefined;
|
|
297
|
-
}>;
|
|
137
|
+
};
|
|
298
138
|
export type EmailQuestionType = z.infer<typeof EmailQuestionSchema>;
|
|
299
139
|
export type TextAreaQuestionType = z.infer<typeof TextAreaQuestionSchema>;
|
|
300
140
|
export type TextQuestionType = z.infer<typeof TextQuestionSchema>;
|
|
301
141
|
export type URLQuestionType = z.infer<typeof URLQuestionSchema>;
|
|
142
|
+
export declare const EmailQuestionJSONSchema: z.core.JSONSchema.JSONSchema;
|
|
143
|
+
export declare const TextAreaQuestionJSONSchema: z.core.JSONSchema.JSONSchema;
|
|
144
|
+
export declare const TextQuestionJSONSchema: z.core.JSONSchema.JSONSchema;
|
|
145
|
+
export declare const URLQuestionJSONSchema: z.core.JSONSchema.JSONSchema;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.URLQuestionSchema = exports.TextQuestionSchema = exports.TextAreaQuestionSchema = exports.EmailQuestionSchema = void 0;
|
|
3
|
+
exports.URLQuestionJSONSchema = exports.TextQuestionJSONSchema = exports.TextAreaQuestionJSONSchema = exports.EmailQuestionJSONSchema = exports.DefaultURLQuestion = exports.URLQuestionSchema = exports.DefaultTextQuestion = exports.TextQuestionSchema = exports.DefaultTextAreaQuestion = exports.TextAreaQuestionSchema = exports.DefaultEmailQuestion = exports.EmailQuestionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const question_1 = require("./question");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
maxLength: zod_1.z.number().default(255),
|
|
9
|
-
minLength: zod_1.z.number().optional(),
|
|
10
|
-
pattern: zod_1.z.string().optional()
|
|
11
|
-
}));
|
|
6
|
+
const TextAttributesSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.BaseAttributesSchema.shape), { maxLength: zod_1.z.number().default(255), minLength: zod_1.z.number().optional(), pattern: zod_1.z.string().optional() }));
|
|
7
|
+
const DefaultTextAttributes = TextAttributesSchema.parse({});
|
|
12
8
|
// Email question and answer
|
|
13
|
-
exports.EmailQuestionSchema = question_1.QuestionSchema.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})
|
|
9
|
+
exports.EmailQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.QuestionSchema.shape), { type: zod_1.z.literal('email'), attributes: zod_1.z.object(Object.assign(Object.assign({}, TextAttributesSchema.shape), { multiple: zod_1.z.boolean().default(false) })) }));
|
|
10
|
+
exports.DefaultEmailQuestion = exports.EmailQuestionSchema.parse({
|
|
11
|
+
type: 'email',
|
|
12
|
+
attributes: exports.EmailQuestionSchema.shape.attributes,
|
|
13
|
+
meta: question_1.DefaultMeta
|
|
14
|
+
});
|
|
19
15
|
// Text area question and answer
|
|
20
|
-
exports.TextAreaQuestionSchema = question_1.QuestionSchema.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
rows: zod_1.z.number().default(2),
|
|
27
|
-
asRichText: zod_1.z.boolean().default(true),
|
|
28
|
-
})).default({})
|
|
29
|
-
}));
|
|
16
|
+
exports.TextAreaQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.QuestionSchema.shape), { type: zod_1.z.literal('textArea'), attributes: zod_1.z.object(Object.assign(Object.assign({}, TextAttributesSchema.shape), { cols: zod_1.z.number().default(20), rows: zod_1.z.number().default(2), asRichText: zod_1.z.boolean().default(true), maxLength: zod_1.z.number().default(10000) })) }));
|
|
17
|
+
exports.DefaultTextAreaQuestion = exports.TextAreaQuestionSchema.parse({
|
|
18
|
+
type: 'textArea',
|
|
19
|
+
attributes: exports.TextAreaQuestionSchema.shape.attributes,
|
|
20
|
+
meta: question_1.DefaultMeta
|
|
21
|
+
});
|
|
30
22
|
// Text question and answer
|
|
31
|
-
exports.TextQuestionSchema = question_1.QuestionSchema.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
exports.TextQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.QuestionSchema.shape), { type: zod_1.z.literal('text'), attributes: TextAttributesSchema }));
|
|
24
|
+
exports.DefaultTextQuestion = exports.TextQuestionSchema.parse({
|
|
25
|
+
type: 'text',
|
|
26
|
+
attributes: DefaultTextAttributes,
|
|
27
|
+
meta: question_1.DefaultMeta
|
|
28
|
+
});
|
|
35
29
|
// URL question and answer
|
|
36
|
-
exports.URLQuestionSchema = question_1.QuestionSchema.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
exports.URLQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.QuestionSchema.shape), { type: zod_1.z.literal('url'), attributes: TextAttributesSchema }));
|
|
31
|
+
exports.DefaultURLQuestion = exports.URLQuestionSchema.parse({
|
|
32
|
+
type: 'url',
|
|
33
|
+
attributes: DefaultTextAttributes,
|
|
34
|
+
meta: question_1.DefaultMeta
|
|
35
|
+
});
|
|
36
|
+
exports.EmailQuestionJSONSchema = zod_1.z.toJSONSchema(exports.EmailQuestionSchema);
|
|
37
|
+
exports.TextAreaQuestionJSONSchema = zod_1.z.toJSONSchema(exports.TextAreaQuestionSchema);
|
|
38
|
+
exports.TextQuestionJSONSchema = zod_1.z.toJSONSchema(exports.TextQuestionSchema);
|
|
39
|
+
exports.URLQuestionJSONSchema = zod_1.z.toJSONSchema(exports.URLQuestionSchema);
|
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$
|
|
3
|
-
"
|
|
4
|
-
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"type": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"const": "affiliationSearch"
|
|
8
|
+
},
|
|
9
|
+
"meta": {
|
|
5
10
|
"type": "object",
|
|
6
11
|
"properties": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"default": "1.0",
|
|
14
|
+
"type": "string"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": [
|
|
18
|
+
"schemaVersion"
|
|
19
|
+
],
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
},
|
|
22
|
+
"answer": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"affiliationId": {
|
|
26
|
+
"default": "",
|
|
27
|
+
"type": "string"
|
|
21
28
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"affiliationId": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"default": ""
|
|
28
|
-
},
|
|
29
|
-
"affiliationName": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"default": ""
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"additionalProperties": false,
|
|
35
|
-
"default": {}
|
|
29
|
+
"affiliationName": {
|
|
30
|
+
"default": "",
|
|
31
|
+
"type": "string"
|
|
36
32
|
}
|
|
37
33
|
},
|
|
38
34
|
"required": [
|
|
39
|
-
"
|
|
35
|
+
"affiliationId",
|
|
36
|
+
"affiliationName"
|
|
40
37
|
],
|
|
41
38
|
"additionalProperties": false
|
|
42
39
|
}
|
|
43
40
|
},
|
|
44
|
-
"
|
|
41
|
+
"required": [
|
|
42
|
+
"type",
|
|
43
|
+
"meta",
|
|
44
|
+
"answer"
|
|
45
|
+
],
|
|
46
|
+
"additionalProperties": false
|
|
45
47
|
}
|