@dmptool/types 1.1.2 → 1.1.3
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/dist/questions/__tests__/graphQLQuestions.spec.js +6 -4
- package/dist/questions/__tests__/optionBasedQuestions.spec.js +4 -12
- package/dist/questions/dateQuestions.d.ts +31 -41
- package/dist/questions/dateQuestions.js +5 -20
- package/dist/questions/graphQLQuestions.d.ts +75 -81
- package/dist/questions/graphQLQuestions.js +18 -24
- package/dist/questions/index.d.ts +524 -723
- package/dist/questions/numberQuestions.d.ts +51 -66
- package/dist/questions/numberQuestions.js +6 -28
- package/dist/questions/optionBasedQuestions.d.ts +44 -69
- package/dist/questions/optionBasedQuestions.js +7 -55
- package/dist/questions/question.d.ts +0 -8
- package/dist/questions/question.js +0 -1
- package/dist/questions/tableQuestions.d.ts +717 -998
- package/dist/questions/tableQuestions.js +3 -10
- package/dist/questions/textQuestions.d.ts +21 -41
- package/dist/questions/textQuestions.js +10 -34
- package/dist/schemas/affiliationSearchQuestion.schema.json +39 -26
- package/dist/schemas/anyQuestion.schema.json +152 -119
- package/dist/schemas/anyTableColumnQuestion.schema.json +142 -104
- package/dist/schemas/booleanQuestion.schema.json +2 -5
- package/dist/schemas/checkboxesQuestion.schema.json +6 -11
- package/dist/schemas/currencyQuestion.schema.json +6 -7
- package/dist/schemas/dateQuestion.schema.json +2 -5
- package/dist/schemas/dateRangeQuestion.schema.json +6 -5
- package/dist/schemas/emailQuestion.schema.json +4 -6
- package/dist/schemas/filteredSearchQuestion.schema.json +0 -3
- package/dist/schemas/multiselectBoxQuestion.schema.json +6 -11
- package/dist/schemas/numberQuestion.schema.json +4 -6
- package/dist/schemas/numberRangeQuestion.schema.json +8 -6
- package/dist/schemas/radioButtonsQuestion.schema.json +6 -11
- package/dist/schemas/selectBoxQuestion.schema.json +7 -15
- package/dist/schemas/tableQuestion.schema.json +148 -111
- package/dist/schemas/textAreaQuestion.schema.json +6 -7
- package/dist/schemas/textQuestion.schema.json +2 -5
- package/dist/schemas/urlQuestion.schema.json +2 -5
- package/package.json +1 -1
|
@@ -46,34 +46,28 @@ const TypeaheadSearchQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.ob
|
|
|
46
46
|
type: zod_1.z.literal('typeaheadSearch'), // The type of question
|
|
47
47
|
graphQL: GraphQLQuery, // The GraphQL query options for the typeahead search
|
|
48
48
|
}));
|
|
49
|
-
const defaultAffiliationSearchJSON = {
|
|
50
|
-
type: 'affiliationSearch',
|
|
51
|
-
attributes: Object.assign({}, question_1.defaultAttributes),
|
|
52
|
-
meta: Object.assign({}, question_1.defaultMeta),
|
|
53
|
-
graphQL: {
|
|
54
|
-
query: "query Affiliations($name: String!){affiliations(name: $name) { totalCount nextCursor items {id displayName uri}}}",
|
|
55
|
-
queryId: "useAffiliationsQuery",
|
|
56
|
-
variables: [{
|
|
57
|
-
name: "term",
|
|
58
|
-
type: "string",
|
|
59
|
-
label: "Search for your institution",
|
|
60
|
-
minLength: 3,
|
|
61
|
-
labelTranslationKey: "SignupPage.institutionHelp"
|
|
62
|
-
}],
|
|
63
|
-
answerField: "uri",
|
|
64
|
-
displayFields: [{
|
|
65
|
-
label: "Institution",
|
|
66
|
-
propertyName: "displayName",
|
|
67
|
-
labelTranslationKey: "SignupPage.institution"
|
|
68
|
-
}],
|
|
69
|
-
responseField: "affiliations.items"
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
49
|
exports.AffiliationSearchQuestionSchema = TypeaheadSearchQuestionSchema.merge(zod_1.z.object({
|
|
73
50
|
type: zod_1.z.literal('affiliationSearch'),
|
|
51
|
+
graphQL: GraphQLQuery.merge(zod_1.z.object({
|
|
52
|
+
query: zod_1.z.literal('query Affiliations($name: String!){affiliations(name: $name) { totalCount nextCursor items {id displayName uri}}}'),
|
|
53
|
+
queryId: zod_1.z.string().default('useAffiliationsQuery').optional(),
|
|
54
|
+
variables: zod_1.z.array(zod_1.z.object({
|
|
55
|
+
name: zod_1.z.literal("name"),
|
|
56
|
+
type: zod_1.z.string().default("string"),
|
|
57
|
+
label: zod_1.z.string().default("Search for your institution"),
|
|
58
|
+
minLength: zod_1.z.literal(3),
|
|
59
|
+
labelTranslationKey: zod_1.z.string().default("SignupPage.institutionHelp").optional(),
|
|
60
|
+
})),
|
|
61
|
+
answerField: zod_1.z.literal('uri'),
|
|
62
|
+
displayFields: zod_1.z.array(zod_1.z.object({
|
|
63
|
+
propertyName: zod_1.z.literal("displayName"),
|
|
64
|
+
label: zod_1.z.string().default("Institution"),
|
|
65
|
+
labelTranslationKey: zod_1.z.string().default("SignupPage.institution").optional(),
|
|
66
|
+
})),
|
|
67
|
+
responseField: zod_1.z.literal("affiliations.items")
|
|
68
|
+
})),
|
|
74
69
|
meta: BaseMeta.unwrap().merge(zod_1.z.object({
|
|
75
70
|
title: zod_1.z.literal('Affiliation Search').optional(),
|
|
76
71
|
usageDescription: zod_1.z.literal('For questions that require the user to select from a controlled list of institutions.').optional(),
|
|
77
|
-
defaultJSON: zod_1.z.literal(JSON.stringify(defaultAffiliationSearchJSON)).optional(),
|
|
78
72
|
}))
|
|
79
73
|
}));
|