@dmptool/types 1.0.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/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/answers.d.ts +558 -0
- package/dist/answers.js +87 -0
- package/dist/dateQuestions.d.ts +244 -0
- package/dist/dateQuestions.js +30 -0
- package/dist/graphQLQuestions.d.ts +288 -0
- package/dist/graphQLQuestions.js +41 -0
- package/dist/optionBasedQuestions.d.ts +236 -0
- package/dist/optionBasedQuestions.js +44 -0
- package/dist/primitiveQuestions.d.ts +367 -0
- package/dist/primitiveQuestions.js +96 -0
- package/dist/schemas/anyAnswer.schema.json +267 -0
- package/dist/schemas/anyQuestion.schema.json +726 -0
- package/dist/schemas/booleanAnswer.schema.json +23 -0
- package/dist/schemas/booleanQuestion.schema.json +46 -0
- package/dist/schemas/checkboxesAnswer.schema.json +26 -0
- package/dist/schemas/checkboxesQuestion.schema.json +73 -0
- package/dist/schemas/currencyAnswer.schema.json +23 -0
- package/dist/schemas/currencyQuestion.schema.json +45 -0
- package/dist/schemas/datePickerAnswer.schema.json +23 -0
- package/dist/schemas/datePickerQuestion.schema.json +52 -0
- package/dist/schemas/dateRangeAnswer.schema.json +36 -0
- package/dist/schemas/dateRangeQuestion.schema.json +106 -0
- package/dist/schemas/emailAnswer.schema.json +23 -0
- package/dist/schemas/emailQuestion.schema.json +55 -0
- package/dist/schemas/filteredSearchAnswer.schema.json +26 -0
- package/dist/schemas/filteredSearchQuestion.schema.json +120 -0
- package/dist/schemas/numberAnswer.schema.json +23 -0
- package/dist/schemas/numberQuestion.schema.json +52 -0
- package/dist/schemas/radioButtonsAnswer.schema.json +23 -0
- package/dist/schemas/radioButtonsQuestion.schema.json +73 -0
- package/dist/schemas/selectBoxAnswer.schema.json +23 -0
- package/dist/schemas/selectBoxQuestion.schema.json +83 -0
- package/dist/schemas/tableAnswer.schema.json +284 -0
- package/dist/schemas/tableQuestion.schema.json +680 -0
- package/dist/schemas/textAnswer.schema.json +23 -0
- package/dist/schemas/textAreaAnswer.schema.json +23 -0
- package/dist/schemas/textAreaQuestion.schema.json +48 -0
- package/dist/schemas/textQuestion.schema.json +52 -0
- package/dist/schemas/typeaheadSearchAnswer.schema.json +23 -0
- package/dist/schemas/typeaheadSearchQuestion.schema.json +110 -0
- package/dist/schemas/urlAnswer.schema.json +23 -0
- package/dist/schemas/urlQuestion.schema.json +52 -0
- package/dist/tableQuestions.d.ts +4195 -0
- package/dist/tableQuestions.js +55 -0
- package/package.json +41 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DatePickerQuestion: z.ZodObject<{
|
|
3
|
+
meta: z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
5
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
schemaVersion: "1.0";
|
|
8
|
+
labelTranslationKey?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
schemaVersion: "1.0";
|
|
11
|
+
labelTranslationKey?: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
} & {
|
|
14
|
+
type: z.ZodLiteral<"datePicker">;
|
|
15
|
+
attributes: z.ZodObject<{
|
|
16
|
+
max: z.ZodOptional<z.ZodString>;
|
|
17
|
+
min: z.ZodOptional<z.ZodString>;
|
|
18
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
max?: string | undefined;
|
|
21
|
+
min?: string | undefined;
|
|
22
|
+
step?: number | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
max?: string | undefined;
|
|
25
|
+
min?: string | undefined;
|
|
26
|
+
step?: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
type: "datePicker";
|
|
30
|
+
meta: {
|
|
31
|
+
schemaVersion: "1.0";
|
|
32
|
+
labelTranslationKey?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
attributes: {
|
|
35
|
+
max?: string | undefined;
|
|
36
|
+
min?: string | undefined;
|
|
37
|
+
step?: number | undefined;
|
|
38
|
+
};
|
|
39
|
+
}, {
|
|
40
|
+
type: "datePicker";
|
|
41
|
+
meta: {
|
|
42
|
+
schemaVersion: "1.0";
|
|
43
|
+
labelTranslationKey?: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
attributes: {
|
|
46
|
+
max?: string | undefined;
|
|
47
|
+
min?: string | undefined;
|
|
48
|
+
step?: number | undefined;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
export declare const DateRangeQuestion: z.ZodObject<{
|
|
52
|
+
meta: z.ZodObject<{
|
|
53
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
54
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
schemaVersion: "1.0";
|
|
57
|
+
labelTranslationKey?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
schemaVersion: "1.0";
|
|
60
|
+
labelTranslationKey?: string | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
} & {
|
|
63
|
+
type: z.ZodLiteral<"dateRange">;
|
|
64
|
+
columns: z.ZodObject<{
|
|
65
|
+
start: z.ZodObject<{
|
|
66
|
+
meta: z.ZodObject<{
|
|
67
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
68
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
schemaVersion: "1.0";
|
|
71
|
+
labelTranslationKey?: string | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
schemaVersion: "1.0";
|
|
74
|
+
labelTranslationKey?: string | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
type: z.ZodLiteral<"datePicker">;
|
|
77
|
+
} & {
|
|
78
|
+
attributes: z.ZodObject<{
|
|
79
|
+
label: z.ZodString;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
label: string;
|
|
82
|
+
}, {
|
|
83
|
+
label: string;
|
|
84
|
+
}>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
type: "datePicker";
|
|
87
|
+
meta: {
|
|
88
|
+
schemaVersion: "1.0";
|
|
89
|
+
labelTranslationKey?: string | undefined;
|
|
90
|
+
};
|
|
91
|
+
attributes: {
|
|
92
|
+
label: string;
|
|
93
|
+
};
|
|
94
|
+
}, {
|
|
95
|
+
type: "datePicker";
|
|
96
|
+
meta: {
|
|
97
|
+
schemaVersion: "1.0";
|
|
98
|
+
labelTranslationKey?: string | undefined;
|
|
99
|
+
};
|
|
100
|
+
attributes: {
|
|
101
|
+
label: string;
|
|
102
|
+
};
|
|
103
|
+
}>;
|
|
104
|
+
end: z.ZodObject<{
|
|
105
|
+
meta: z.ZodObject<{
|
|
106
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
107
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
schemaVersion: "1.0";
|
|
110
|
+
labelTranslationKey?: string | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
schemaVersion: "1.0";
|
|
113
|
+
labelTranslationKey?: string | undefined;
|
|
114
|
+
}>;
|
|
115
|
+
type: z.ZodLiteral<"datePicker">;
|
|
116
|
+
} & {
|
|
117
|
+
attributes: z.ZodObject<{
|
|
118
|
+
label: z.ZodString;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
label: string;
|
|
121
|
+
}, {
|
|
122
|
+
label: string;
|
|
123
|
+
}>;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
type: "datePicker";
|
|
126
|
+
meta: {
|
|
127
|
+
schemaVersion: "1.0";
|
|
128
|
+
labelTranslationKey?: string | undefined;
|
|
129
|
+
};
|
|
130
|
+
attributes: {
|
|
131
|
+
label: string;
|
|
132
|
+
};
|
|
133
|
+
}, {
|
|
134
|
+
type: "datePicker";
|
|
135
|
+
meta: {
|
|
136
|
+
schemaVersion: "1.0";
|
|
137
|
+
labelTranslationKey?: string | undefined;
|
|
138
|
+
};
|
|
139
|
+
attributes: {
|
|
140
|
+
label: string;
|
|
141
|
+
};
|
|
142
|
+
}>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
start: {
|
|
145
|
+
type: "datePicker";
|
|
146
|
+
meta: {
|
|
147
|
+
schemaVersion: "1.0";
|
|
148
|
+
labelTranslationKey?: string | undefined;
|
|
149
|
+
};
|
|
150
|
+
attributes: {
|
|
151
|
+
label: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
end: {
|
|
155
|
+
type: "datePicker";
|
|
156
|
+
meta: {
|
|
157
|
+
schemaVersion: "1.0";
|
|
158
|
+
labelTranslationKey?: string | undefined;
|
|
159
|
+
};
|
|
160
|
+
attributes: {
|
|
161
|
+
label: string;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
}, {
|
|
165
|
+
start: {
|
|
166
|
+
type: "datePicker";
|
|
167
|
+
meta: {
|
|
168
|
+
schemaVersion: "1.0";
|
|
169
|
+
labelTranslationKey?: string | undefined;
|
|
170
|
+
};
|
|
171
|
+
attributes: {
|
|
172
|
+
label: string;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
end: {
|
|
176
|
+
type: "datePicker";
|
|
177
|
+
meta: {
|
|
178
|
+
schemaVersion: "1.0";
|
|
179
|
+
labelTranslationKey?: string | undefined;
|
|
180
|
+
};
|
|
181
|
+
attributes: {
|
|
182
|
+
label: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
}>;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
type: "dateRange";
|
|
188
|
+
meta: {
|
|
189
|
+
schemaVersion: "1.0";
|
|
190
|
+
labelTranslationKey?: string | undefined;
|
|
191
|
+
};
|
|
192
|
+
columns: {
|
|
193
|
+
start: {
|
|
194
|
+
type: "datePicker";
|
|
195
|
+
meta: {
|
|
196
|
+
schemaVersion: "1.0";
|
|
197
|
+
labelTranslationKey?: string | undefined;
|
|
198
|
+
};
|
|
199
|
+
attributes: {
|
|
200
|
+
label: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
end: {
|
|
204
|
+
type: "datePicker";
|
|
205
|
+
meta: {
|
|
206
|
+
schemaVersion: "1.0";
|
|
207
|
+
labelTranslationKey?: string | undefined;
|
|
208
|
+
};
|
|
209
|
+
attributes: {
|
|
210
|
+
label: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
}, {
|
|
215
|
+
type: "dateRange";
|
|
216
|
+
meta: {
|
|
217
|
+
schemaVersion: "1.0";
|
|
218
|
+
labelTranslationKey?: string | undefined;
|
|
219
|
+
};
|
|
220
|
+
columns: {
|
|
221
|
+
start: {
|
|
222
|
+
type: "datePicker";
|
|
223
|
+
meta: {
|
|
224
|
+
schemaVersion: "1.0";
|
|
225
|
+
labelTranslationKey?: string | undefined;
|
|
226
|
+
};
|
|
227
|
+
attributes: {
|
|
228
|
+
label: string;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
end: {
|
|
232
|
+
type: "datePicker";
|
|
233
|
+
meta: {
|
|
234
|
+
schemaVersion: "1.0";
|
|
235
|
+
labelTranslationKey?: string | undefined;
|
|
236
|
+
};
|
|
237
|
+
attributes: {
|
|
238
|
+
label: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
}>;
|
|
243
|
+
export type DatePickerQuestionType = z.infer<typeof DatePickerQuestion>;
|
|
244
|
+
export type DateRangeQuestionType = z.infer<typeof DateRangeQuestion>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateRangeQuestion = exports.DatePickerQuestion = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const primitiveQuestions_1 = require("./primitiveQuestions");
|
|
6
|
+
// Date picker question and answer
|
|
7
|
+
exports.DatePickerQuestion = primitiveQuestions_1.Question.merge(zod_1.z.object({
|
|
8
|
+
type: zod_1.z.literal('datePicker'), // The type of question
|
|
9
|
+
attributes: zod_1.z.object({
|
|
10
|
+
max: zod_1.z.string().optional(), // The maximum date (no default)
|
|
11
|
+
min: zod_1.z.string().optional(), // The minimum date (no default)
|
|
12
|
+
step: zod_1.z.number().optional() // The step value (default is 1 day)
|
|
13
|
+
})
|
|
14
|
+
}));
|
|
15
|
+
// Date range question and answer
|
|
16
|
+
exports.DateRangeQuestion = primitiveQuestions_1.Question.merge(zod_1.z.object({
|
|
17
|
+
type: zod_1.z.literal('dateRange'), // The type of question
|
|
18
|
+
columns: zod_1.z.object({
|
|
19
|
+
start: exports.DatePickerQuestion.merge(zod_1.z.object({
|
|
20
|
+
attributes: zod_1.z.object({
|
|
21
|
+
label: zod_1.z.string() // The label for the start date picker
|
|
22
|
+
})
|
|
23
|
+
})),
|
|
24
|
+
end: exports.DatePickerQuestion.merge(zod_1.z.object({
|
|
25
|
+
attributes: zod_1.z.object({
|
|
26
|
+
label: zod_1.z.string() // The label for the end date picker
|
|
27
|
+
})
|
|
28
|
+
}))
|
|
29
|
+
})
|
|
30
|
+
}));
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FilteredSearchQuestion: z.ZodObject<{
|
|
3
|
+
meta: z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
5
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
schemaVersion: "1.0";
|
|
8
|
+
labelTranslationKey?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
schemaVersion: "1.0";
|
|
11
|
+
labelTranslationKey?: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
} & {
|
|
14
|
+
type: z.ZodLiteral<"filteredSearch">;
|
|
15
|
+
graphQL: z.ZodObject<{
|
|
16
|
+
displayFields: z.ZodArray<z.ZodObject<{
|
|
17
|
+
propertyName: z.ZodString;
|
|
18
|
+
label: z.ZodString;
|
|
19
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
label: string;
|
|
22
|
+
propertyName: string;
|
|
23
|
+
labelTranslationKey?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
label: string;
|
|
26
|
+
propertyName: string;
|
|
27
|
+
labelTranslationKey?: string | undefined;
|
|
28
|
+
}>, "many">;
|
|
29
|
+
localQueryId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
query: z.ZodOptional<z.ZodString>;
|
|
31
|
+
responseField: z.ZodString;
|
|
32
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
33
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
label: z.ZodOptional<z.ZodString>;
|
|
35
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
type: z.ZodString;
|
|
38
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
type: string;
|
|
41
|
+
name: string;
|
|
42
|
+
labelTranslationKey?: string | undefined;
|
|
43
|
+
minLength?: number | undefined;
|
|
44
|
+
label?: string | undefined;
|
|
45
|
+
defaultValue?: string | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
type: string;
|
|
48
|
+
name: string;
|
|
49
|
+
labelTranslationKey?: string | undefined;
|
|
50
|
+
minLength?: number | undefined;
|
|
51
|
+
label?: string | undefined;
|
|
52
|
+
defaultValue?: string | undefined;
|
|
53
|
+
}>, "many">;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
displayFields: {
|
|
56
|
+
label: string;
|
|
57
|
+
propertyName: string;
|
|
58
|
+
labelTranslationKey?: string | undefined;
|
|
59
|
+
}[];
|
|
60
|
+
responseField: string;
|
|
61
|
+
variables: {
|
|
62
|
+
type: string;
|
|
63
|
+
name: string;
|
|
64
|
+
labelTranslationKey?: string | undefined;
|
|
65
|
+
minLength?: number | undefined;
|
|
66
|
+
label?: string | undefined;
|
|
67
|
+
defaultValue?: string | undefined;
|
|
68
|
+
}[];
|
|
69
|
+
localQueryId?: string | undefined;
|
|
70
|
+
query?: string | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
displayFields: {
|
|
73
|
+
label: string;
|
|
74
|
+
propertyName: string;
|
|
75
|
+
labelTranslationKey?: string | undefined;
|
|
76
|
+
}[];
|
|
77
|
+
responseField: string;
|
|
78
|
+
variables: {
|
|
79
|
+
type: string;
|
|
80
|
+
name: string;
|
|
81
|
+
labelTranslationKey?: string | undefined;
|
|
82
|
+
minLength?: number | undefined;
|
|
83
|
+
label?: string | undefined;
|
|
84
|
+
defaultValue?: string | undefined;
|
|
85
|
+
}[];
|
|
86
|
+
localQueryId?: string | undefined;
|
|
87
|
+
query?: string | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
attributes: z.ZodObject<{
|
|
90
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
multiple?: boolean | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
multiple?: boolean | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
type: "filteredSearch";
|
|
98
|
+
meta: {
|
|
99
|
+
schemaVersion: "1.0";
|
|
100
|
+
labelTranslationKey?: string | undefined;
|
|
101
|
+
};
|
|
102
|
+
attributes: {
|
|
103
|
+
multiple?: boolean | undefined;
|
|
104
|
+
};
|
|
105
|
+
graphQL: {
|
|
106
|
+
displayFields: {
|
|
107
|
+
label: string;
|
|
108
|
+
propertyName: string;
|
|
109
|
+
labelTranslationKey?: string | undefined;
|
|
110
|
+
}[];
|
|
111
|
+
responseField: string;
|
|
112
|
+
variables: {
|
|
113
|
+
type: string;
|
|
114
|
+
name: string;
|
|
115
|
+
labelTranslationKey?: string | undefined;
|
|
116
|
+
minLength?: number | undefined;
|
|
117
|
+
label?: string | undefined;
|
|
118
|
+
defaultValue?: string | undefined;
|
|
119
|
+
}[];
|
|
120
|
+
localQueryId?: string | undefined;
|
|
121
|
+
query?: string | undefined;
|
|
122
|
+
};
|
|
123
|
+
}, {
|
|
124
|
+
type: "filteredSearch";
|
|
125
|
+
meta: {
|
|
126
|
+
schemaVersion: "1.0";
|
|
127
|
+
labelTranslationKey?: string | undefined;
|
|
128
|
+
};
|
|
129
|
+
attributes: {
|
|
130
|
+
multiple?: boolean | undefined;
|
|
131
|
+
};
|
|
132
|
+
graphQL: {
|
|
133
|
+
displayFields: {
|
|
134
|
+
label: string;
|
|
135
|
+
propertyName: string;
|
|
136
|
+
labelTranslationKey?: string | undefined;
|
|
137
|
+
}[];
|
|
138
|
+
responseField: string;
|
|
139
|
+
variables: {
|
|
140
|
+
type: string;
|
|
141
|
+
name: string;
|
|
142
|
+
labelTranslationKey?: string | undefined;
|
|
143
|
+
minLength?: number | undefined;
|
|
144
|
+
label?: string | undefined;
|
|
145
|
+
defaultValue?: string | undefined;
|
|
146
|
+
}[];
|
|
147
|
+
localQueryId?: string | undefined;
|
|
148
|
+
query?: string | undefined;
|
|
149
|
+
};
|
|
150
|
+
}>;
|
|
151
|
+
export declare const TypeaheadSearchQuestion: z.ZodObject<{
|
|
152
|
+
meta: z.ZodObject<{
|
|
153
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
154
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, "strip", z.ZodTypeAny, {
|
|
156
|
+
schemaVersion: "1.0";
|
|
157
|
+
labelTranslationKey?: string | undefined;
|
|
158
|
+
}, {
|
|
159
|
+
schemaVersion: "1.0";
|
|
160
|
+
labelTranslationKey?: string | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
} & {
|
|
163
|
+
type: z.ZodLiteral<"typeaheadSearch">;
|
|
164
|
+
graphQL: z.ZodObject<{
|
|
165
|
+
displayFields: z.ZodArray<z.ZodObject<{
|
|
166
|
+
propertyName: z.ZodString;
|
|
167
|
+
label: z.ZodString;
|
|
168
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
label: string;
|
|
171
|
+
propertyName: string;
|
|
172
|
+
labelTranslationKey?: string | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
label: string;
|
|
175
|
+
propertyName: string;
|
|
176
|
+
labelTranslationKey?: string | undefined;
|
|
177
|
+
}>, "many">;
|
|
178
|
+
localQueryId: z.ZodOptional<z.ZodString>;
|
|
179
|
+
query: z.ZodOptional<z.ZodString>;
|
|
180
|
+
responseField: z.ZodString;
|
|
181
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
182
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
label: z.ZodOptional<z.ZodString>;
|
|
184
|
+
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
185
|
+
name: z.ZodString;
|
|
186
|
+
type: z.ZodString;
|
|
187
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
type: string;
|
|
190
|
+
name: string;
|
|
191
|
+
labelTranslationKey?: string | undefined;
|
|
192
|
+
minLength?: number | undefined;
|
|
193
|
+
label?: string | undefined;
|
|
194
|
+
defaultValue?: string | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
type: string;
|
|
197
|
+
name: string;
|
|
198
|
+
labelTranslationKey?: string | undefined;
|
|
199
|
+
minLength?: number | undefined;
|
|
200
|
+
label?: string | undefined;
|
|
201
|
+
defaultValue?: string | undefined;
|
|
202
|
+
}>, "many">;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
displayFields: {
|
|
205
|
+
label: string;
|
|
206
|
+
propertyName: string;
|
|
207
|
+
labelTranslationKey?: string | undefined;
|
|
208
|
+
}[];
|
|
209
|
+
responseField: string;
|
|
210
|
+
variables: {
|
|
211
|
+
type: string;
|
|
212
|
+
name: string;
|
|
213
|
+
labelTranslationKey?: string | undefined;
|
|
214
|
+
minLength?: number | undefined;
|
|
215
|
+
label?: string | undefined;
|
|
216
|
+
defaultValue?: string | undefined;
|
|
217
|
+
}[];
|
|
218
|
+
localQueryId?: string | undefined;
|
|
219
|
+
query?: string | undefined;
|
|
220
|
+
}, {
|
|
221
|
+
displayFields: {
|
|
222
|
+
label: string;
|
|
223
|
+
propertyName: string;
|
|
224
|
+
labelTranslationKey?: string | undefined;
|
|
225
|
+
}[];
|
|
226
|
+
responseField: string;
|
|
227
|
+
variables: {
|
|
228
|
+
type: string;
|
|
229
|
+
name: string;
|
|
230
|
+
labelTranslationKey?: string | undefined;
|
|
231
|
+
minLength?: number | undefined;
|
|
232
|
+
label?: string | undefined;
|
|
233
|
+
defaultValue?: string | undefined;
|
|
234
|
+
}[];
|
|
235
|
+
localQueryId?: string | undefined;
|
|
236
|
+
query?: string | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
type: "typeaheadSearch";
|
|
240
|
+
meta: {
|
|
241
|
+
schemaVersion: "1.0";
|
|
242
|
+
labelTranslationKey?: string | undefined;
|
|
243
|
+
};
|
|
244
|
+
graphQL: {
|
|
245
|
+
displayFields: {
|
|
246
|
+
label: string;
|
|
247
|
+
propertyName: string;
|
|
248
|
+
labelTranslationKey?: string | undefined;
|
|
249
|
+
}[];
|
|
250
|
+
responseField: string;
|
|
251
|
+
variables: {
|
|
252
|
+
type: string;
|
|
253
|
+
name: string;
|
|
254
|
+
labelTranslationKey?: string | undefined;
|
|
255
|
+
minLength?: number | undefined;
|
|
256
|
+
label?: string | undefined;
|
|
257
|
+
defaultValue?: string | undefined;
|
|
258
|
+
}[];
|
|
259
|
+
localQueryId?: string | undefined;
|
|
260
|
+
query?: string | undefined;
|
|
261
|
+
};
|
|
262
|
+
}, {
|
|
263
|
+
type: "typeaheadSearch";
|
|
264
|
+
meta: {
|
|
265
|
+
schemaVersion: "1.0";
|
|
266
|
+
labelTranslationKey?: string | undefined;
|
|
267
|
+
};
|
|
268
|
+
graphQL: {
|
|
269
|
+
displayFields: {
|
|
270
|
+
label: string;
|
|
271
|
+
propertyName: string;
|
|
272
|
+
labelTranslationKey?: string | undefined;
|
|
273
|
+
}[];
|
|
274
|
+
responseField: string;
|
|
275
|
+
variables: {
|
|
276
|
+
type: string;
|
|
277
|
+
name: string;
|
|
278
|
+
labelTranslationKey?: string | undefined;
|
|
279
|
+
minLength?: number | undefined;
|
|
280
|
+
label?: string | undefined;
|
|
281
|
+
defaultValue?: string | undefined;
|
|
282
|
+
}[];
|
|
283
|
+
localQueryId?: string | undefined;
|
|
284
|
+
query?: string | undefined;
|
|
285
|
+
};
|
|
286
|
+
}>;
|
|
287
|
+
export type FilteredSearchQuestionType = z.infer<typeof FilteredSearchQuestion>;
|
|
288
|
+
export type TypeaheadSearchQuestionType = z.infer<typeof TypeaheadSearchQuestion>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeaheadSearchQuestion = exports.FilteredSearchQuestion = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const primitiveQuestions_1 = require("./primitiveQuestions");
|
|
6
|
+
// An input variable for a GraphQL query
|
|
7
|
+
const GraphQLVariable = zod_1.z.object({
|
|
8
|
+
minLength: zod_1.z.number().optional(), // A min length for the variable before executing the query
|
|
9
|
+
label: zod_1.z.string().optional(), // The label for the variable (default to the name)
|
|
10
|
+
labelTranslationKey: zod_1.z.string().optional(), // The translation key for the label (DMP Tool only)
|
|
11
|
+
name: zod_1.z.string(), // MUST match the input variable name in the query
|
|
12
|
+
type: zod_1.z.string(), // The type of the variable (default is string)
|
|
13
|
+
defaultValue: zod_1.z.string().optional() // The default value for the variable (no default)
|
|
14
|
+
});
|
|
15
|
+
// A property from a GraphQL query response that will be displayed to the user
|
|
16
|
+
const GraphQLDisplayField = zod_1.z.object({
|
|
17
|
+
propertyName: zod_1.z.string(), // MUST match a property name in the query response
|
|
18
|
+
label: zod_1.z.string(), // The label for the field
|
|
19
|
+
labelTranslationKey: zod_1.z.string().optional() // The translation key for the label (DMP Tool only)
|
|
20
|
+
});
|
|
21
|
+
// A GraphQL query object
|
|
22
|
+
const GraphQLQuery = zod_1.z.object({
|
|
23
|
+
displayFields: zod_1.z.array(GraphQLDisplayField), // The fields to display from the query response
|
|
24
|
+
localQueryId: zod_1.z.string().optional(), // The ID of the query (required if no query)
|
|
25
|
+
query: zod_1.z.string().optional(), // The GraphQL query to execute (required if no localQueryId)
|
|
26
|
+
responseField: zod_1.z.string(), // How to get at the location of displayFields in the response
|
|
27
|
+
variables: zod_1.z.array(GraphQLVariable) // The variables for the query
|
|
28
|
+
});
|
|
29
|
+
// Filtered search question and answer
|
|
30
|
+
exports.FilteredSearchQuestion = primitiveQuestions_1.Question.merge(zod_1.z.object({
|
|
31
|
+
type: zod_1.z.literal('filteredSearch'), // The type of question
|
|
32
|
+
graphQL: GraphQLQuery, // The GraphQL query options for the filtered search
|
|
33
|
+
attributes: zod_1.z.object({
|
|
34
|
+
multiple: zod_1.z.boolean().optional() // Whether to allow multiple selections (default is true)
|
|
35
|
+
})
|
|
36
|
+
}));
|
|
37
|
+
// Typeahead search question and answer
|
|
38
|
+
exports.TypeaheadSearchQuestion = primitiveQuestions_1.Question.merge(zod_1.z.object({
|
|
39
|
+
type: zod_1.z.literal('typeaheadSearch'), // The type of question
|
|
40
|
+
graphQL: GraphQLQuery, // The GraphQL query options for the typeahead search
|
|
41
|
+
}));
|