@dmptool/types 1.2.5 → 2.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/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/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 +680 -8090
- 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 +2029 -10357
- package/dist/questions/tableQuestions.js +197 -190
- package/dist/questions/textQuestions.d.ts +70 -226
- package/dist/questions/textQuestions.js +31 -31
- package/package.json +3 -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/schemas/affiliationSearchAnswer.schema.json +0 -45
- package/dist/schemas/affiliationSearchQuestion.schema.json +0 -140
- package/dist/schemas/anyAnswer.schema.json +0 -605
- package/dist/schemas/anyQuestion.schema.json +0 -1737
- package/dist/schemas/anyTableColumnAnswer.schema.json +0 -466
- package/dist/schemas/anyTableColumnQuestion.schema.json +0 -1092
- package/dist/schemas/booleanAnswer.schema.json +0 -34
- package/dist/schemas/booleanQuestion.schema.json +0 -56
- package/dist/schemas/checkboxesAnswer.schema.json +0 -39
- package/dist/schemas/checkboxesQuestion.schema.json +0 -76
- package/dist/schemas/currencyAnswer.schema.json +0 -34
- package/dist/schemas/currencyQuestion.schema.json +0 -67
- package/dist/schemas/dateAnswer.schema.json +0 -34
- package/dist/schemas/datePickerAnswer.schema.json +0 -37
- package/dist/schemas/datePickerQuestion.schema.json +0 -52
- package/dist/schemas/dateQuestion.schema.json +0 -62
- package/dist/schemas/dateRangeAnswer.schema.json +0 -45
- package/dist/schemas/dateRangeQuestion.schema.json +0 -112
- package/dist/schemas/emailAnswer.schema.json +0 -34
- package/dist/schemas/emailQuestion.schema.json +0 -66
- package/dist/schemas/filteredSearchAnswer.schema.json +0 -40
- package/dist/schemas/filteredSearchQuestion.schema.json +0 -130
- package/dist/schemas/licenseSearchAnswer.schema.json +0 -49
- package/dist/schemas/licenseSearchQuestion.schema.json +0 -164
- package/dist/schemas/metadataStandardSearchAnswer.schema.json +0 -49
- package/dist/schemas/metadataStandardSearchQuestion.schema.json +0 -174
- package/dist/schemas/multiselectBoxAnswer.schema.json +0 -39
- package/dist/schemas/multiselectBoxQuestion.schema.json +0 -85
- package/dist/schemas/numberAnswer.schema.json +0 -34
- package/dist/schemas/numberQuestion.schema.json +0 -63
- package/dist/schemas/numberRangeAnswer.schema.json +0 -45
- package/dist/schemas/numberRangeQuestion.schema.json +0 -94
- package/dist/schemas/numberWithContextAnswer.schema.json +0 -45
- package/dist/schemas/numberWithContextQuestion.schema.json +0 -84
- package/dist/schemas/radioButtonsAnswer.schema.json +0 -34
- package/dist/schemas/radioButtonsQuestion.schema.json +0 -76
- package/dist/schemas/repositorySearchAnswer.schema.json +0 -49
- package/dist/schemas/repositorySearchQuestion.schema.json +0 -180
- package/dist/schemas/researchOutputTableAnswer.schema.json +0 -519
- package/dist/schemas/researchOutputTableQuestion.schema.json +0 -1183
- package/dist/schemas/selectBoxAnswer.schema.json +0 -34
- package/dist/schemas/selectBoxQuestion.schema.json +0 -85
- package/dist/schemas/tableAnswer.schema.json +0 -519
- package/dist/schemas/tableQuestion.schema.json +0 -1183
- package/dist/schemas/textAnswer.schema.json +0 -34
- package/dist/schemas/textAreaAnswer.schema.json +0 -34
- package/dist/schemas/textAreaQuestion.schema.json +0 -70
- package/dist/schemas/textQuestion.schema.json +0 -62
- package/dist/schemas/typeaheadSearchAnswer.schema.json +0 -37
- package/dist/schemas/typeaheadSearchQuestion.schema.json +0 -120
- package/dist/schemas/urlAnswer.schema.json +0 -34
- package/dist/schemas/urlQuestion.schema.json +0 -62
- /package/dist/answers/__tests__/{usage.spec.d.ts → defaults.spec.d.ts} +0 -0
|
@@ -1,34 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RepositorySearchAnswerSchema = exports.MetadataStandardSearchAnswerSchema = exports.LicenseSearchAnswerSchema = exports.AffiliationSearchAnswerSchema = void 0;
|
|
3
|
+
exports.RepositorySearchAnswerJSONSchema = exports.MetadataStandardSearchAnswerJSONSchema = exports.LicenseSearchAnswerJSONSchema = exports.AffiliationSearchAnswerJSONSchema = exports.DefaultRepositorySearchAnswer = exports.RepositorySearchAnswerSchema = exports.DefaultMetadataStandardSearchAnswer = exports.MetadataStandardSearchAnswerSchema = exports.DefaultLicenseSearchAnswer = exports.LicenseSearchAnswerSchema = exports.DefaultAffiliationSearchAnswer = exports.AffiliationSearchAnswerSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const answer_1 = require("./answer");
|
|
6
|
+
const questions_1 = require("../questions");
|
|
6
7
|
// Answers to GraphQL Question Types
|
|
7
|
-
exports.AffiliationSearchAnswerSchema = answer_1.AnswerSchema.
|
|
8
|
-
type: zod_1.z.literal('affiliationSearch'),
|
|
9
|
-
answer: zod_1.z.object({
|
|
8
|
+
exports.AffiliationSearchAnswerSchema = zod_1.z.object(Object.assign(Object.assign({}, answer_1.AnswerSchema.shape), { type: zod_1.z.literal('affiliationSearch'), answer: zod_1.z.object({
|
|
10
9
|
affiliationId: zod_1.z.string().default(''), // The unique id of the affiliation (e.g. ROR URI)
|
|
11
10
|
affiliationName: zod_1.z.string().default('') // The name of the affiliation
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
}) }));
|
|
12
|
+
exports.DefaultAffiliationSearchAnswer = exports.AffiliationSearchAnswerSchema.parse({
|
|
13
|
+
type: 'affiliationSearch',
|
|
14
|
+
answer: {
|
|
15
|
+
affiliationId: '',
|
|
16
|
+
affiliationName: ''
|
|
17
|
+
},
|
|
18
|
+
meta: questions_1.DefaultMeta
|
|
19
|
+
});
|
|
20
|
+
exports.LicenseSearchAnswerSchema = zod_1.z.object(Object.assign(Object.assign({}, answer_1.AnswerSchema.shape), { type: zod_1.z.literal('licenseSearch'), answer: zod_1.z.array(zod_1.z.object({
|
|
17
21
|
licenseId: zod_1.z.string().default(''), // The unique id of the license
|
|
18
22
|
licenseName: zod_1.z.string().default('') // The name of the license
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
})).default([]) }));
|
|
24
|
+
exports.DefaultLicenseSearchAnswer = exports.LicenseSearchAnswerSchema.parse({
|
|
25
|
+
type: 'licenseSearch',
|
|
26
|
+
answer: [{
|
|
27
|
+
licenseId: '',
|
|
28
|
+
licenseName: ''
|
|
29
|
+
}],
|
|
30
|
+
meta: questions_1.DefaultMeta
|
|
31
|
+
});
|
|
32
|
+
exports.MetadataStandardSearchAnswerSchema = zod_1.z.object(Object.assign(Object.assign({}, answer_1.AnswerSchema.shape), { type: zod_1.z.literal('metadataStandardSearch'), answer: zod_1.z.array(zod_1.z.object({
|
|
24
33
|
metadataStandardId: zod_1.z.string().default(''), // The unique id of the metadata standard
|
|
25
34
|
metadataStandardName: zod_1.z.string().default('') // The name of the metadata standard
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
})).default([]) }));
|
|
36
|
+
exports.DefaultMetadataStandardSearchAnswer = exports.MetadataStandardSearchAnswerSchema.parse({
|
|
37
|
+
type: 'metadataStandardSearch',
|
|
38
|
+
answer: [{
|
|
39
|
+
metadataStandardId: '',
|
|
40
|
+
metadataStandardName: ''
|
|
41
|
+
}],
|
|
42
|
+
meta: questions_1.DefaultMeta
|
|
43
|
+
});
|
|
44
|
+
exports.RepositorySearchAnswerSchema = zod_1.z.object(Object.assign(Object.assign({}, answer_1.AnswerSchema.shape), { type: zod_1.z.literal('repositorySearch'), answer: zod_1.z.array(zod_1.z.object({
|
|
31
45
|
repositoryId: zod_1.z.string().default(''), // The unique id of the repository
|
|
32
46
|
repositoryName: zod_1.z.string().default('') // The name of the repository
|
|
33
|
-
})
|
|
34
|
-
|
|
47
|
+
})).default([]) }));
|
|
48
|
+
exports.DefaultRepositorySearchAnswer = exports.RepositorySearchAnswerSchema.parse({
|
|
49
|
+
type: 'repositorySearch',
|
|
50
|
+
answer: [{
|
|
51
|
+
repositoryId: '',
|
|
52
|
+
repositoryName: ''
|
|
53
|
+
}],
|
|
54
|
+
meta: questions_1.DefaultMeta
|
|
55
|
+
});
|
|
56
|
+
exports.AffiliationSearchAnswerJSONSchema = zod_1.z.toJSONSchema(exports.AffiliationSearchAnswerSchema);
|
|
57
|
+
exports.LicenseSearchAnswerJSONSchema = zod_1.z.toJSONSchema(exports.LicenseSearchAnswerSchema);
|
|
58
|
+
exports.MetadataStandardSearchAnswerJSONSchema = zod_1.z.toJSONSchema(exports.MetadataStandardSearchAnswerSchema);
|
|
59
|
+
exports.RepositorySearchAnswerJSONSchema = zod_1.z.toJSONSchema(exports.RepositorySearchAnswerSchema);
|