@dmptool/types 2.0.0 → 2.2.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 +70 -1
- package/dist/answers/__tests__/defaults.spec.js +80 -21
- package/dist/answers/answer.d.ts +2 -0
- package/dist/answers/answer.js +4 -2
- package/dist/answers/dateAnswers.d.ts +4 -0
- package/dist/answers/graphQLAnswers.d.ts +8 -0
- package/dist/answers/index.d.ts +37 -0
- package/dist/answers/numberAnswers.d.ts +8 -0
- package/dist/answers/optionBasedAnswers.d.ts +10 -0
- package/dist/answers/tableAnswers.d.ts +94 -0
- package/dist/answers/textAnswers.d.ts +8 -0
- 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 +1117 -0
- package/dist/dmp/extension.js +234 -0
- package/dist/dmp/index.d.ts +9 -0
- package/dist/dmp/index.js +69 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/questions/__tests__/defaults.spec.js +2 -2
- package/dist/questions/__tests__/optionBasedQuestions.spec.js +8 -4
- package/dist/questions/dateQuestions.d.ts +4 -0
- package/dist/questions/dateQuestions.js +2 -2
- package/dist/questions/index.d.ts +30 -22
- package/dist/questions/numberQuestions.d.ts +8 -0
- package/dist/questions/numberQuestions.js +4 -4
- package/dist/questions/optionBasedQuestions.d.ts +10 -0
- package/dist/questions/optionBasedQuestions.js +5 -5
- package/dist/questions/tableQuestions.d.ts +393 -25
- package/dist/questions/tableQuestions.js +3 -2
- package/dist/questions/textQuestions.d.ts +4 -0
- package/dist/questions/textQuestions.js +2 -2
- package/dist/schemas/affiliationSearchAnswer.schema.json +50 -0
- package/dist/schemas/affiliationSearchQuestion.schema.json +142 -0
- package/dist/schemas/anyAnswer.schema.json +1537 -0
- package/dist/schemas/anyQuestion.schema.json +4828 -0
- package/dist/schemas/anyTableColumnAnswer.schema.json +741 -0
- package/dist/schemas/anyTableColumnQuestion.schema.json +1560 -0
- package/dist/schemas/booleanAnswer.schema.json +36 -0
- package/dist/schemas/booleanQuestion.schema.json +55 -0
- package/dist/schemas/checkboxesAnswer.schema.json +41 -0
- package/dist/schemas/checkboxesQuestion.schema.json +80 -0
- package/dist/schemas/currencyAnswer.schema.json +36 -0
- package/dist/schemas/currencyQuestion.schema.json +73 -0
- package/dist/schemas/dateAnswer.schema.json +36 -0
- package/dist/schemas/datePickerAnswer.schema.json +37 -0
- package/dist/schemas/datePickerQuestion.schema.json +52 -0
- package/dist/schemas/dateQuestion.schema.json +66 -0
- package/dist/schemas/dateRangeAnswer.schema.json +50 -0
- package/dist/schemas/dateRangeQuestion.schema.json +124 -0
- package/dist/schemas/dmp.schema.json +2070 -0
- package/dist/schemas/dmpExtension.schema.json +1985 -0
- package/dist/schemas/emailAnswer.schema.json +36 -0
- package/dist/schemas/emailQuestion.schema.json +71 -0
- package/dist/schemas/filteredSearchAnswer.schema.json +40 -0
- package/dist/schemas/filteredSearchQuestion.schema.json +130 -0
- package/dist/schemas/licenseSearchAnswer.schema.json +54 -0
- package/dist/schemas/licenseSearchQuestion.schema.json +140 -0
- package/dist/schemas/metadataStandardSearchAnswer.schema.json +54 -0
- package/dist/schemas/metadataStandardSearchQuestion.schema.json +141 -0
- package/dist/schemas/multiselectBoxAnswer.schema.json +41 -0
- package/dist/schemas/multiselectBoxQuestion.schema.json +87 -0
- package/dist/schemas/numberAnswer.schema.json +36 -0
- package/dist/schemas/numberQuestion.schema.json +68 -0
- package/dist/schemas/numberRangeAnswer.schema.json +50 -0
- package/dist/schemas/numberRangeQuestion.schema.json +128 -0
- package/dist/schemas/numberWithContextAnswer.schema.json +50 -0
- package/dist/schemas/numberWithContextQuestion.schema.json +98 -0
- package/dist/schemas/radioButtonsAnswer.schema.json +36 -0
- package/dist/schemas/radioButtonsQuestion.schema.json +80 -0
- package/dist/schemas/repositorySearchAnswer.schema.json +54 -0
- package/dist/schemas/repositorySearchQuestion.schema.json +140 -0
- package/dist/schemas/researchOutputTableAnswer.schema.json +20065 -0
- package/dist/schemas/researchOutputTableQuestion.schema.json +140 -0
- package/dist/schemas/selectBoxAnswer.schema.json +36 -0
- package/dist/schemas/selectBoxQuestion.schema.json +87 -0
- package/dist/schemas/tableAnswer.schema.json +797 -0
- package/dist/schemas/tableQuestion.schema.json +1662 -0
- package/dist/schemas/textAnswer.schema.json +36 -0
- package/dist/schemas/textAreaAnswer.schema.json +36 -0
- package/dist/schemas/textAreaQuestion.schema.json +78 -0
- package/dist/schemas/textQuestion.schema.json +63 -0
- package/dist/schemas/typeaheadSearchAnswer.schema.json +37 -0
- package/dist/schemas/typeaheadSearchQuestion.schema.json +120 -0
- package/dist/schemas/urlAnswer.schema.json +36 -0
- package/dist/schemas/urlQuestion.schema.json +66 -0
- package/package.json +12 -4
- package/schemas/.placeholder +0 -0
- package/schemas/affiliationSearchAnswer.schema.json +50 -0
- package/schemas/affiliationSearchQuestion.schema.json +142 -0
- package/schemas/anyAnswer.schema.json +1537 -0
- package/schemas/anyQuestion.schema.json +4828 -0
- package/schemas/anyTableColumnAnswer.schema.json +741 -0
- package/schemas/anyTableColumnQuestion.schema.json +1560 -0
- package/schemas/booleanAnswer.schema.json +36 -0
- package/schemas/booleanQuestion.schema.json +55 -0
- package/schemas/checkboxesAnswer.schema.json +41 -0
- package/schemas/checkboxesQuestion.schema.json +80 -0
- package/schemas/currencyAnswer.schema.json +36 -0
- package/schemas/currencyQuestion.schema.json +73 -0
- package/schemas/dateAnswer.schema.json +36 -0
- package/schemas/datePickerAnswer.schema.json +37 -0
- package/schemas/datePickerQuestion.schema.json +52 -0
- package/schemas/dateQuestion.schema.json +66 -0
- package/schemas/dateRangeAnswer.schema.json +50 -0
- package/schemas/dateRangeQuestion.schema.json +124 -0
- package/schemas/dmp.schema.json +2070 -0
- package/schemas/dmpExtension.schema.json +1985 -0
- package/schemas/emailAnswer.schema.json +36 -0
- package/schemas/emailQuestion.schema.json +71 -0
- package/schemas/filteredSearchAnswer.schema.json +40 -0
- package/schemas/filteredSearchQuestion.schema.json +130 -0
- package/schemas/licenseSearchAnswer.schema.json +54 -0
- package/schemas/licenseSearchQuestion.schema.json +140 -0
- package/schemas/metadataStandardSearchAnswer.schema.json +54 -0
- package/schemas/metadataStandardSearchQuestion.schema.json +141 -0
- package/schemas/multiselectBoxAnswer.schema.json +41 -0
- package/schemas/multiselectBoxQuestion.schema.json +87 -0
- package/schemas/numberAnswer.schema.json +36 -0
- package/schemas/numberQuestion.schema.json +68 -0
- package/schemas/numberRangeAnswer.schema.json +50 -0
- package/schemas/numberRangeQuestion.schema.json +128 -0
- package/schemas/numberWithContextAnswer.schema.json +50 -0
- package/schemas/numberWithContextQuestion.schema.json +98 -0
- package/schemas/radioButtonsAnswer.schema.json +36 -0
- package/schemas/radioButtonsQuestion.schema.json +80 -0
- package/schemas/repositorySearchAnswer.schema.json +54 -0
- package/schemas/repositorySearchQuestion.schema.json +140 -0
- package/schemas/researchOutputTableAnswer.schema.json +20065 -0
- package/schemas/researchOutputTableQuestion.schema.json +140 -0
- package/schemas/selectBoxAnswer.schema.json +36 -0
- package/schemas/selectBoxQuestion.schema.json +87 -0
- package/schemas/tableAnswer.schema.json +797 -0
- package/schemas/tableQuestion.schema.json +1662 -0
- package/schemas/textAnswer.schema.json +36 -0
- package/schemas/textAreaAnswer.schema.json +36 -0
- package/schemas/textAreaQuestion.schema.json +78 -0
- package/schemas/textQuestion.schema.json +63 -0
- package/schemas/typeaheadSearchAnswer.schema.json +37 -0
- package/schemas/typeaheadSearchQuestion.schema.json +120 -0
- package/schemas/urlAnswer.schema.json +36 -0
- package/schemas/urlQuestion.schema.json +66 -0
|
@@ -181,7 +181,9 @@ const DefaultResearchOutputLicenseColumn = ResearchOutputLicenseColumnSchema.par
|
|
|
181
181
|
});
|
|
182
182
|
const ResearchOutputCustomContentAttributesSchema = textQuestions_1.TextQuestionSchema.shape.attributes.extend({
|
|
183
183
|
label: zod_1.z.string().optional(),
|
|
184
|
-
help: zod_1.z.string().optional()
|
|
184
|
+
help: zod_1.z.string().optional(),
|
|
185
|
+
maxLength: zod_1.z.number().optional(),
|
|
186
|
+
defaultValue: zod_1.z.string().optional(),
|
|
185
187
|
});
|
|
186
188
|
const DefaultResearchOutputCustomContentAttributes = ResearchOutputCustomContentAttributesSchema.parse({});
|
|
187
189
|
const ResearchOutputCustomContentSchema = zod_1.z.object(Object.assign(Object.assign({}, textQuestions_1.TextQuestionSchema.shape), { attributes: ResearchOutputCustomContentAttributesSchema }));
|
|
@@ -208,7 +210,6 @@ const AnyResearchOutputColumnSchema = zod_1.z.union([
|
|
|
208
210
|
ResearchOutputRepositoryColumnSchema,
|
|
209
211
|
ResearchOutputMetadataStandardColumnSchema,
|
|
210
212
|
ResearchOutputLicenseColumnSchema,
|
|
211
|
-
exports.ResearchOutputCustomColumnSchema,
|
|
212
213
|
exports.ResearchOutputCustomColumnSchema
|
|
213
214
|
]);
|
|
214
215
|
// Update ResearchOutputTableQuestionSchema
|
|
@@ -10,6 +10,7 @@ export declare const EmailQuestionSchema: z.ZodObject<{
|
|
|
10
10
|
help: z.ZodOptional<z.ZodString>;
|
|
11
11
|
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
+
showCommentField: z.ZodOptional<z.ZodBoolean>;
|
|
13
14
|
meta: z.ZodObject<{
|
|
14
15
|
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
15
16
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -32,6 +33,7 @@ export declare const DefaultEmailQuestion: {
|
|
|
32
33
|
title?: string | undefined;
|
|
33
34
|
usageDescription?: string | undefined;
|
|
34
35
|
};
|
|
36
|
+
showCommentField?: boolean | undefined;
|
|
35
37
|
};
|
|
36
38
|
export declare const TextAreaQuestionSchema: z.ZodObject<{
|
|
37
39
|
type: z.ZodLiteral<"textArea">;
|
|
@@ -113,6 +115,7 @@ export declare const URLQuestionSchema: z.ZodObject<{
|
|
|
113
115
|
help: z.ZodOptional<z.ZodString>;
|
|
114
116
|
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
115
117
|
}, z.core.$strip>;
|
|
118
|
+
showCommentField: z.ZodOptional<z.ZodBoolean>;
|
|
116
119
|
meta: z.ZodObject<{
|
|
117
120
|
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
118
121
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -134,6 +137,7 @@ export declare const DefaultURLQuestion: {
|
|
|
134
137
|
title?: string | undefined;
|
|
135
138
|
usageDescription?: string | undefined;
|
|
136
139
|
};
|
|
140
|
+
showCommentField?: boolean | undefined;
|
|
137
141
|
};
|
|
138
142
|
export type EmailQuestionType = z.infer<typeof EmailQuestionSchema>;
|
|
139
143
|
export type TextAreaQuestionType = z.infer<typeof TextAreaQuestionSchema>;
|
|
@@ -6,7 +6,7 @@ const question_1 = require("./question");
|
|
|
6
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
7
|
const DefaultTextAttributes = TextAttributesSchema.parse({});
|
|
8
8
|
// Email question and answer
|
|
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) })) }));
|
|
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) })), showCommentField: zod_1.z.boolean().optional() }));
|
|
10
10
|
exports.DefaultEmailQuestion = exports.EmailQuestionSchema.parse({
|
|
11
11
|
type: 'email',
|
|
12
12
|
attributes: exports.EmailQuestionSchema.shape.attributes,
|
|
@@ -27,7 +27,7 @@ exports.DefaultTextQuestion = exports.TextQuestionSchema.parse({
|
|
|
27
27
|
meta: question_1.DefaultMeta
|
|
28
28
|
});
|
|
29
29
|
// URL question and answer
|
|
30
|
-
exports.URLQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.QuestionSchema.shape), { type: zod_1.z.literal('url'), attributes: TextAttributesSchema }));
|
|
30
|
+
exports.URLQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.QuestionSchema.shape), { type: zod_1.z.literal('url'), attributes: TextAttributesSchema, showCommentField: zod_1.z.boolean().optional() }));
|
|
31
31
|
exports.DefaultURLQuestion = exports.URLQuestionSchema.parse({
|
|
32
32
|
type: 'url',
|
|
33
33
|
attributes: DefaultTextAttributes,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
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": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"default": "1.0",
|
|
14
|
+
"type": "string"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": [
|
|
18
|
+
"schemaVersion"
|
|
19
|
+
],
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
},
|
|
22
|
+
"comment": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"answer": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"affiliationId": {
|
|
29
|
+
"default": "",
|
|
30
|
+
"type": "string"
|
|
31
|
+
},
|
|
32
|
+
"affiliationName": {
|
|
33
|
+
"default": "",
|
|
34
|
+
"type": "string"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"required": [
|
|
38
|
+
"affiliationId",
|
|
39
|
+
"affiliationName"
|
|
40
|
+
],
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": [
|
|
45
|
+
"type",
|
|
46
|
+
"meta",
|
|
47
|
+
"answer"
|
|
48
|
+
],
|
|
49
|
+
"additionalProperties": false
|
|
50
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
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
|
+
"attributes": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"label": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"help": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"labelTranslationKey": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
},
|
|
24
|
+
"meta": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"schemaVersion": {
|
|
28
|
+
"default": "1.0",
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"title": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"usageDescription": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": [
|
|
39
|
+
"schemaVersion"
|
|
40
|
+
],
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
},
|
|
43
|
+
"graphQL": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"displayFields": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"propertyName": {
|
|
52
|
+
"default": "id",
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"label": {
|
|
56
|
+
"default": "Id",
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"labelTranslationKey": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"required": [
|
|
64
|
+
"propertyName",
|
|
65
|
+
"label"
|
|
66
|
+
],
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"localQueryId": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"query": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"const": "query Affiliations($name: String!){ affiliations(name: $name) { totalCount nextCursor items { id displayName uri } } }"
|
|
76
|
+
},
|
|
77
|
+
"responseField": {
|
|
78
|
+
"default": "affiliations.items",
|
|
79
|
+
"type": "string",
|
|
80
|
+
"const": "affiliations.items"
|
|
81
|
+
},
|
|
82
|
+
"variables": {
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"minLength": {
|
|
88
|
+
"type": "number"
|
|
89
|
+
},
|
|
90
|
+
"label": {
|
|
91
|
+
"type": "string"
|
|
92
|
+
},
|
|
93
|
+
"labelTranslationKey": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
},
|
|
96
|
+
"name": {
|
|
97
|
+
"default": "search",
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"type": {
|
|
101
|
+
"default": "string",
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
"defaultValue": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": [
|
|
109
|
+
"name",
|
|
110
|
+
"type"
|
|
111
|
+
],
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"queryId": {
|
|
116
|
+
"default": "useAffiliationsQuery",
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"answerField": {
|
|
120
|
+
"default": "uri",
|
|
121
|
+
"type": "string",
|
|
122
|
+
"const": "uri"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": [
|
|
126
|
+
"displayFields",
|
|
127
|
+
"query",
|
|
128
|
+
"responseField",
|
|
129
|
+
"variables",
|
|
130
|
+
"answerField"
|
|
131
|
+
],
|
|
132
|
+
"additionalProperties": false
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"required": [
|
|
136
|
+
"type",
|
|
137
|
+
"attributes",
|
|
138
|
+
"meta",
|
|
139
|
+
"graphQL"
|
|
140
|
+
],
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
}
|