@dmptool/types 1.0.3 → 1.0.5
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 +25 -3
- package/dist/answers/answer.d.ts +3 -3
- package/dist/answers/index.d.ts +2 -0
- package/dist/answers/index.js +19 -1
- package/dist/questions/dateQuestions.d.ts +6 -6
- package/dist/questions/dateQuestions.js +1 -1
- package/dist/questions/graphQLQuestions.d.ts +36 -36
- package/dist/questions/graphQLQuestions.js +1 -1
- package/dist/questions/index.d.ts +250 -248
- package/dist/questions/index.js +19 -1
- package/dist/questions/optionBasedQuestions.d.ts +6 -6
- package/dist/questions/optionBasedQuestions.js +1 -1
- package/dist/questions/primitiveQuestions.d.ts +42 -42
- package/dist/questions/primitiveQuestions.js +6 -6
- package/dist/questions/question.d.ts +4 -4
- package/dist/questions/question.js +0 -1
- package/dist/questions/tableQuestions.d.ts +248 -248
- package/dist/questions/tableQuestions.js +1 -1
- package/dist/schemas/anyQuestion.schema.json +11 -22
- package/dist/schemas/anyTableColumnQuestion.schema.json +10 -20
- package/dist/schemas/booleanQuestion.schema.json +1 -2
- package/dist/schemas/currencyQuestion.schema.json +1 -2
- package/dist/schemas/datePickerQuestion.schema.json +1 -2
- package/dist/schemas/emailQuestion.schema.json +1 -2
- package/dist/schemas/filteredSearchQuestion.schema.json +1 -2
- package/dist/schemas/numberQuestion.schema.json +1 -2
- package/dist/schemas/selectBoxQuestion.schema.json +1 -2
- package/dist/schemas/tableQuestion.schema.json +11 -22
- package/dist/schemas/textAreaQuestion.schema.json +1 -2
- package/dist/schemas/textQuestion.schema.json +1 -2
- package/dist/schemas/typeaheadSearchQuestion.schema.json +1 -2
- package/dist/schemas/urlQuestion.schema.json +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,8 +69,9 @@ DMP Tool specific extensions to the RDA Common Standard for DMPs
|
|
|
69
69
|
Add the DMP Tool types to your `package.json` by running `npm add @dmptool/types`
|
|
70
70
|
|
|
71
71
|
Once added, you can then import the Types and Zod shemas like this:
|
|
72
|
-
`import {
|
|
72
|
+
`import { BooleanQuestionSchema, BooleanQuestionType, CURRENT_SCHEMA_VERSION } from '@dmptool/types';`
|
|
73
73
|
|
|
74
|
+
// Use the available Type to help define the JSON object
|
|
74
75
|
const boolQ: BooleanQuestionType = {
|
|
75
76
|
type: "boolean",
|
|
76
77
|
attributes: {
|
|
@@ -81,13 +82,34 @@ const boolQ: BooleanQuestionType = {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
// Use the Zod Schema to validate the JSON
|
|
86
|
+
const isBoolQ = BooleanQuestionSchema.parse(boolQ);
|
|
85
87
|
console.log('isBoolQ', isBoolQ);
|
|
86
|
-
console.log(BooleanQuestion.parse(123));
|
|
87
88
|
|
|
89
|
+
// Force an error to see (see below for what a Zod error message looks like)
|
|
90
|
+
try {
|
|
91
|
+
BooleanQuestionSchema.parse(123);
|
|
92
|
+
} catch (e) {
|
|
93
|
+
console.log(e.message);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Use the Schema Maps to get the correct Schema for the specificed question type
|
|
97
|
+
try {
|
|
98
|
+
// Validate the questionJSON against the Zod schema
|
|
99
|
+
QuestionSchemaMap[boolQ.type]?.parse(boolQ);
|
|
100
|
+
} catch (e) {
|
|
101
|
+
console.log(e.message);
|
|
102
|
+
}
|
|
88
103
|
|
|
104
|
+
// Use the Any unions to generically define a Question or Answer type
|
|
105
|
+
public questionJSON: AnyQuestionType;
|
|
106
|
+
|
|
107
|
+
// Use the QuestionTypesEnum to fetch a list of all the valid question types
|
|
108
|
+
console.log(QuestionTypeEnums);
|
|
109
|
+
```
|
|
89
110
|
|
|
90
111
|
|
|
112
|
+
Example Zod error:
|
|
91
113
|
```
|
|
92
114
|
ZodError: [
|
|
93
115
|
{
|
package/dist/answers/answer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const AnswerSchema: z.ZodObject<{
|
|
3
|
-
type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "
|
|
3
|
+
type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
|
|
4
4
|
answer: z.ZodString;
|
|
5
5
|
meta: z.ZodObject<{
|
|
6
6
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
@@ -10,13 +10,13 @@ export declare const AnswerSchema: z.ZodObject<{
|
|
|
10
10
|
schemaVersion: "1.0";
|
|
11
11
|
}>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "
|
|
13
|
+
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
|
|
14
14
|
meta: {
|
|
15
15
|
schemaVersion: "1.0";
|
|
16
16
|
};
|
|
17
17
|
answer: string;
|
|
18
18
|
}, {
|
|
19
|
-
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "
|
|
19
|
+
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
|
|
20
20
|
meta: {
|
|
21
21
|
schemaVersion: "1.0";
|
|
22
22
|
};
|
package/dist/answers/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { QuestionTypesEnum } from '../questions';
|
|
2
3
|
export * from './answer';
|
|
3
4
|
export * from './dateAnswers';
|
|
4
5
|
export * from './graphQLAnswers';
|
|
@@ -877,4 +878,5 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
877
878
|
};
|
|
878
879
|
answer: string;
|
|
879
880
|
}>]>;
|
|
881
|
+
export declare const AnswerSchemaMap: Record<z.infer<typeof QuestionTypesEnum>, z.ZodTypeAny>;
|
|
880
882
|
export type AnyAnswerType = z.infer<typeof AnyAnswerSchema>;
|
package/dist/answers/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.AnyAnswerSchema = void 0;
|
|
17
|
+
exports.AnswerSchemaMap = exports.AnyAnswerSchema = void 0;
|
|
18
18
|
const zod_1 = require("zod");
|
|
19
19
|
const dateAnswers_1 = require("./dateAnswers");
|
|
20
20
|
const graphQLAnswers_1 = require("./graphQLAnswers");
|
|
@@ -46,3 +46,21 @@ exports.AnyAnswerSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
46
46
|
graphQLAnswers_1.TypeaheadSearchAnswerSchema,
|
|
47
47
|
primitiveAnswers_1.URLAnswerSchema
|
|
48
48
|
]);
|
|
49
|
+
// Export a mapping between question types and their corresponding answer schemas
|
|
50
|
+
exports.AnswerSchemaMap = {
|
|
51
|
+
boolean: primitiveAnswers_1.BooleanAnswerSchema,
|
|
52
|
+
checkBoxes: optionBasedAnswers_1.CheckboxesAnswerSchema,
|
|
53
|
+
currency: primitiveAnswers_1.CurrencyAnswerSchema,
|
|
54
|
+
datePicker: dateAnswers_1.DatePickerAnswerSchema,
|
|
55
|
+
dateRange: dateAnswers_1.DateRangeAnswerSchema,
|
|
56
|
+
email: primitiveAnswers_1.EmailAnswerSchema,
|
|
57
|
+
filteredSearch: graphQLAnswers_1.FilteredSearchAnswerSchema,
|
|
58
|
+
number: primitiveAnswers_1.NumberAnswerSchema,
|
|
59
|
+
radioButtons: optionBasedAnswers_1.RadioButtonsAnswerSchema,
|
|
60
|
+
selectBox: optionBasedAnswers_1.SelectBoxAnswerSchema,
|
|
61
|
+
table: tableAnswers_1.TableAnswerSchema,
|
|
62
|
+
text: primitiveAnswers_1.TextAnswerSchema,
|
|
63
|
+
textArea: primitiveAnswers_1.TextAreaAnswerSchema,
|
|
64
|
+
typeaheadSearch: graphQLAnswers_1.TypeaheadSearchAnswerSchema,
|
|
65
|
+
url: primitiveAnswers_1.URLAnswerSchema
|
|
66
|
+
};
|
|
@@ -12,7 +12,7 @@ export declare const DatePickerQuestionSchema: z.ZodObject<{
|
|
|
12
12
|
}>;
|
|
13
13
|
} & {
|
|
14
14
|
type: z.ZodLiteral<"datePicker">;
|
|
15
|
-
attributes: z.ZodObject<{
|
|
15
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
16
16
|
max: z.ZodOptional<z.ZodString>;
|
|
17
17
|
min: z.ZodOptional<z.ZodString>;
|
|
18
18
|
step: z.ZodOptional<z.ZodNumber>;
|
|
@@ -24,29 +24,29 @@ export declare const DatePickerQuestionSchema: z.ZodObject<{
|
|
|
24
24
|
max?: string | undefined;
|
|
25
25
|
min?: string | undefined;
|
|
26
26
|
step?: number | undefined;
|
|
27
|
-
}
|
|
27
|
+
}>>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
type: "datePicker";
|
|
30
30
|
meta: {
|
|
31
31
|
schemaVersion: "1.0";
|
|
32
32
|
labelTranslationKey?: string | undefined;
|
|
33
33
|
};
|
|
34
|
-
attributes
|
|
34
|
+
attributes?: {
|
|
35
35
|
max?: string | undefined;
|
|
36
36
|
min?: string | undefined;
|
|
37
37
|
step?: number | undefined;
|
|
38
|
-
};
|
|
38
|
+
} | undefined;
|
|
39
39
|
}, {
|
|
40
40
|
type: "datePicker";
|
|
41
41
|
meta: {
|
|
42
42
|
schemaVersion: "1.0";
|
|
43
43
|
labelTranslationKey?: string | undefined;
|
|
44
44
|
};
|
|
45
|
-
attributes
|
|
45
|
+
attributes?: {
|
|
46
46
|
max?: string | undefined;
|
|
47
47
|
min?: string | undefined;
|
|
48
48
|
step?: number | undefined;
|
|
49
|
-
};
|
|
49
|
+
} | undefined;
|
|
50
50
|
}>;
|
|
51
51
|
export declare const DateRangeQuestionSchema: z.ZodObject<{
|
|
52
52
|
meta: z.ZodObject<{
|
|
@@ -10,7 +10,7 @@ exports.DatePickerQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.objec
|
|
|
10
10
|
max: zod_1.z.string().optional(), // The maximum date (no default)
|
|
11
11
|
min: zod_1.z.string().optional(), // The minimum date (no default)
|
|
12
12
|
step: zod_1.z.number().optional() // The step value (default is 1 day)
|
|
13
|
-
})
|
|
13
|
+
}).optional(),
|
|
14
14
|
}));
|
|
15
15
|
// Date range question and answer
|
|
16
16
|
exports.DateRangeQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
@@ -29,7 +29,7 @@ export declare const FilteredSearchQuestionSchema: z.ZodObject<{
|
|
|
29
29
|
localQueryId: z.ZodOptional<z.ZodString>;
|
|
30
30
|
query: z.ZodOptional<z.ZodString>;
|
|
31
31
|
responseField: z.ZodString;
|
|
32
|
-
variables: z.ZodArray<z.ZodObject<{
|
|
32
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
33
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
label: z.ZodOptional<z.ZodString>;
|
|
35
35
|
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
@@ -50,7 +50,7 @@ export declare const FilteredSearchQuestionSchema: z.ZodObject<{
|
|
|
50
50
|
minLength?: number | undefined;
|
|
51
51
|
label?: string | undefined;
|
|
52
52
|
defaultValue?: string | undefined;
|
|
53
|
-
}>, "many"
|
|
53
|
+
}>, "many">>;
|
|
54
54
|
}, "strip", z.ZodTypeAny, {
|
|
55
55
|
displayFields: {
|
|
56
56
|
label: string;
|
|
@@ -58,16 +58,16 @@ export declare const FilteredSearchQuestionSchema: z.ZodObject<{
|
|
|
58
58
|
labelTranslationKey?: string | undefined;
|
|
59
59
|
}[];
|
|
60
60
|
responseField: string;
|
|
61
|
-
|
|
61
|
+
localQueryId?: string | undefined;
|
|
62
|
+
query?: string | undefined;
|
|
63
|
+
variables?: {
|
|
62
64
|
type: string;
|
|
63
65
|
name: string;
|
|
64
66
|
labelTranslationKey?: string | undefined;
|
|
65
67
|
minLength?: number | undefined;
|
|
66
68
|
label?: string | undefined;
|
|
67
69
|
defaultValue?: string | undefined;
|
|
68
|
-
}[];
|
|
69
|
-
localQueryId?: string | undefined;
|
|
70
|
-
query?: string | undefined;
|
|
70
|
+
}[] | undefined;
|
|
71
71
|
}, {
|
|
72
72
|
displayFields: {
|
|
73
73
|
label: string;
|
|
@@ -75,16 +75,16 @@ export declare const FilteredSearchQuestionSchema: z.ZodObject<{
|
|
|
75
75
|
labelTranslationKey?: string | undefined;
|
|
76
76
|
}[];
|
|
77
77
|
responseField: string;
|
|
78
|
-
|
|
78
|
+
localQueryId?: string | undefined;
|
|
79
|
+
query?: string | undefined;
|
|
80
|
+
variables?: {
|
|
79
81
|
type: string;
|
|
80
82
|
name: string;
|
|
81
83
|
labelTranslationKey?: string | undefined;
|
|
82
84
|
minLength?: number | undefined;
|
|
83
85
|
label?: string | undefined;
|
|
84
86
|
defaultValue?: string | undefined;
|
|
85
|
-
}[];
|
|
86
|
-
localQueryId?: string | undefined;
|
|
87
|
-
query?: string | undefined;
|
|
87
|
+
}[] | undefined;
|
|
88
88
|
}>;
|
|
89
89
|
attributes: z.ZodObject<{
|
|
90
90
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -109,16 +109,16 @@ export declare const FilteredSearchQuestionSchema: z.ZodObject<{
|
|
|
109
109
|
labelTranslationKey?: string | undefined;
|
|
110
110
|
}[];
|
|
111
111
|
responseField: string;
|
|
112
|
-
|
|
112
|
+
localQueryId?: string | undefined;
|
|
113
|
+
query?: string | undefined;
|
|
114
|
+
variables?: {
|
|
113
115
|
type: string;
|
|
114
116
|
name: string;
|
|
115
117
|
labelTranslationKey?: string | undefined;
|
|
116
118
|
minLength?: number | undefined;
|
|
117
119
|
label?: string | undefined;
|
|
118
120
|
defaultValue?: string | undefined;
|
|
119
|
-
}[];
|
|
120
|
-
localQueryId?: string | undefined;
|
|
121
|
-
query?: string | undefined;
|
|
121
|
+
}[] | undefined;
|
|
122
122
|
};
|
|
123
123
|
}, {
|
|
124
124
|
type: "filteredSearch";
|
|
@@ -136,16 +136,16 @@ export declare const FilteredSearchQuestionSchema: z.ZodObject<{
|
|
|
136
136
|
labelTranslationKey?: string | undefined;
|
|
137
137
|
}[];
|
|
138
138
|
responseField: string;
|
|
139
|
-
|
|
139
|
+
localQueryId?: string | undefined;
|
|
140
|
+
query?: string | undefined;
|
|
141
|
+
variables?: {
|
|
140
142
|
type: string;
|
|
141
143
|
name: string;
|
|
142
144
|
labelTranslationKey?: string | undefined;
|
|
143
145
|
minLength?: number | undefined;
|
|
144
146
|
label?: string | undefined;
|
|
145
147
|
defaultValue?: string | undefined;
|
|
146
|
-
}[];
|
|
147
|
-
localQueryId?: string | undefined;
|
|
148
|
-
query?: string | undefined;
|
|
148
|
+
}[] | undefined;
|
|
149
149
|
};
|
|
150
150
|
}>;
|
|
151
151
|
export declare const TypeaheadSearchQuestionSchema: z.ZodObject<{
|
|
@@ -178,7 +178,7 @@ export declare const TypeaheadSearchQuestionSchema: z.ZodObject<{
|
|
|
178
178
|
localQueryId: z.ZodOptional<z.ZodString>;
|
|
179
179
|
query: z.ZodOptional<z.ZodString>;
|
|
180
180
|
responseField: z.ZodString;
|
|
181
|
-
variables: z.ZodArray<z.ZodObject<{
|
|
181
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
182
182
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
183
183
|
label: z.ZodOptional<z.ZodString>;
|
|
184
184
|
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
@@ -199,7 +199,7 @@ export declare const TypeaheadSearchQuestionSchema: z.ZodObject<{
|
|
|
199
199
|
minLength?: number | undefined;
|
|
200
200
|
label?: string | undefined;
|
|
201
201
|
defaultValue?: string | undefined;
|
|
202
|
-
}>, "many"
|
|
202
|
+
}>, "many">>;
|
|
203
203
|
}, "strip", z.ZodTypeAny, {
|
|
204
204
|
displayFields: {
|
|
205
205
|
label: string;
|
|
@@ -207,16 +207,16 @@ export declare const TypeaheadSearchQuestionSchema: z.ZodObject<{
|
|
|
207
207
|
labelTranslationKey?: string | undefined;
|
|
208
208
|
}[];
|
|
209
209
|
responseField: string;
|
|
210
|
-
|
|
210
|
+
localQueryId?: string | undefined;
|
|
211
|
+
query?: string | undefined;
|
|
212
|
+
variables?: {
|
|
211
213
|
type: string;
|
|
212
214
|
name: string;
|
|
213
215
|
labelTranslationKey?: string | undefined;
|
|
214
216
|
minLength?: number | undefined;
|
|
215
217
|
label?: string | undefined;
|
|
216
218
|
defaultValue?: string | undefined;
|
|
217
|
-
}[];
|
|
218
|
-
localQueryId?: string | undefined;
|
|
219
|
-
query?: string | undefined;
|
|
219
|
+
}[] | undefined;
|
|
220
220
|
}, {
|
|
221
221
|
displayFields: {
|
|
222
222
|
label: string;
|
|
@@ -224,16 +224,16 @@ export declare const TypeaheadSearchQuestionSchema: z.ZodObject<{
|
|
|
224
224
|
labelTranslationKey?: string | undefined;
|
|
225
225
|
}[];
|
|
226
226
|
responseField: string;
|
|
227
|
-
|
|
227
|
+
localQueryId?: string | undefined;
|
|
228
|
+
query?: string | undefined;
|
|
229
|
+
variables?: {
|
|
228
230
|
type: string;
|
|
229
231
|
name: string;
|
|
230
232
|
labelTranslationKey?: string | undefined;
|
|
231
233
|
minLength?: number | undefined;
|
|
232
234
|
label?: string | undefined;
|
|
233
235
|
defaultValue?: string | undefined;
|
|
234
|
-
}[];
|
|
235
|
-
localQueryId?: string | undefined;
|
|
236
|
-
query?: string | undefined;
|
|
236
|
+
}[] | undefined;
|
|
237
237
|
}>;
|
|
238
238
|
}, "strip", z.ZodTypeAny, {
|
|
239
239
|
type: "typeaheadSearch";
|
|
@@ -248,16 +248,16 @@ export declare const TypeaheadSearchQuestionSchema: z.ZodObject<{
|
|
|
248
248
|
labelTranslationKey?: string | undefined;
|
|
249
249
|
}[];
|
|
250
250
|
responseField: string;
|
|
251
|
-
|
|
251
|
+
localQueryId?: string | undefined;
|
|
252
|
+
query?: string | undefined;
|
|
253
|
+
variables?: {
|
|
252
254
|
type: string;
|
|
253
255
|
name: string;
|
|
254
256
|
labelTranslationKey?: string | undefined;
|
|
255
257
|
minLength?: number | undefined;
|
|
256
258
|
label?: string | undefined;
|
|
257
259
|
defaultValue?: string | undefined;
|
|
258
|
-
}[];
|
|
259
|
-
localQueryId?: string | undefined;
|
|
260
|
-
query?: string | undefined;
|
|
260
|
+
}[] | undefined;
|
|
261
261
|
};
|
|
262
262
|
}, {
|
|
263
263
|
type: "typeaheadSearch";
|
|
@@ -272,16 +272,16 @@ export declare const TypeaheadSearchQuestionSchema: z.ZodObject<{
|
|
|
272
272
|
labelTranslationKey?: string | undefined;
|
|
273
273
|
}[];
|
|
274
274
|
responseField: string;
|
|
275
|
-
|
|
275
|
+
localQueryId?: string | undefined;
|
|
276
|
+
query?: string | undefined;
|
|
277
|
+
variables?: {
|
|
276
278
|
type: string;
|
|
277
279
|
name: string;
|
|
278
280
|
labelTranslationKey?: string | undefined;
|
|
279
281
|
minLength?: number | undefined;
|
|
280
282
|
label?: string | undefined;
|
|
281
283
|
defaultValue?: string | undefined;
|
|
282
|
-
}[];
|
|
283
|
-
localQueryId?: string | undefined;
|
|
284
|
-
query?: string | undefined;
|
|
284
|
+
}[] | undefined;
|
|
285
285
|
};
|
|
286
286
|
}>;
|
|
287
287
|
export type FilteredSearchQuestionType = z.infer<typeof FilteredSearchQuestionSchema>;
|
|
@@ -24,7 +24,7 @@ const GraphQLQuery = zod_1.z.object({
|
|
|
24
24
|
localQueryId: zod_1.z.string().optional(), // The ID of the query (required if no query)
|
|
25
25
|
query: zod_1.z.string().optional(), // The GraphQL query to execute (required if no localQueryId)
|
|
26
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
|
|
27
|
+
variables: zod_1.z.array(GraphQLVariable).optional() // The variables for the query
|
|
28
28
|
});
|
|
29
29
|
// Filtered search question and answer
|
|
30
30
|
exports.FilteredSearchQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|