@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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResearchOutputTableQuestionSchema = exports.
|
|
3
|
+
exports.ResearchOutputTableQuestionJSONSchema = exports.TableQuestionJSONSchema = exports.AnyTableColumnQuestionJSONSchema = exports.DefaultResearchOutputTableQuestion = exports.ResearchOutputTableQuestionSchema = exports.DefaultResearchOutputCustomColumn = exports.ResearchOutputCustomColumnSchema = exports.DefaultTableQuestion = exports.TableQuestionSchema = exports.DefaultTableColumn = exports.TableColumnSchema = exports.AnyTableColumnQuestionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const numberQuestions_1 = require("./numberQuestions");
|
|
6
6
|
const textQuestions_1 = require("./textQuestions");
|
|
@@ -8,7 +8,6 @@ const dateQuestions_1 = require("./dateQuestions");
|
|
|
8
8
|
const optionBasedQuestions_1 = require("./optionBasedQuestions");
|
|
9
9
|
const graphQLQuestions_1 = require("./graphQLQuestions");
|
|
10
10
|
const question_1 = require("./question");
|
|
11
|
-
const BaseAttributes = question_1.QuestionSchema.shape.attributes;
|
|
12
11
|
// Union types for all questions and answers (tables cannot be nested so no TableQuestion here!)
|
|
13
12
|
exports.AnyTableColumnQuestionSchema = zod_1.z.discriminatedUnion('type', [
|
|
14
13
|
graphQLQuestions_1.AffiliationSearchQuestionSchema,
|
|
@@ -27,203 +26,211 @@ exports.AnyTableColumnQuestionSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
27
26
|
optionBasedQuestions_1.SelectBoxQuestionSchema,
|
|
28
27
|
textQuestions_1.TextAreaQuestionSchema,
|
|
29
28
|
textQuestions_1.TextQuestionSchema,
|
|
30
|
-
textQuestions_1.URLQuestionSchema
|
|
29
|
+
textQuestions_1.URLQuestionSchema,
|
|
31
30
|
]);
|
|
32
|
-
|
|
31
|
+
const TableAttributesSchema = question_1.BaseAttributesSchema.extend({
|
|
32
|
+
canAddRows: zod_1.z.boolean().default(true),
|
|
33
|
+
canRemoveRows: zod_1.z.boolean().default(true),
|
|
34
|
+
initialRows: zod_1.z.number().default(1),
|
|
35
|
+
maxRows: zod_1.z.number().optional(), // The maximum number of rows (no default)
|
|
36
|
+
minRows: zod_1.z.number().optional() // The minimum number of rows (no default)
|
|
37
|
+
});
|
|
38
|
+
const DefaultTableAttributes = TableAttributesSchema.parse({});
|
|
39
|
+
exports.TableColumnSchema = zod_1.z.object({
|
|
33
40
|
heading: zod_1.z.string().default('Column A'), // The heading of the column
|
|
41
|
+
help: zod_1.z.string().optional(), // Help text for the column
|
|
34
42
|
required: zod_1.z.boolean().default(false), // Whether the column is required
|
|
35
43
|
enabled: zod_1.z.boolean().default(true), // Whether the column is enabled
|
|
36
|
-
content: exports.AnyTableColumnQuestionSchema
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
content: exports.AnyTableColumnQuestionSchema
|
|
45
|
+
});
|
|
46
|
+
exports.DefaultTableColumn = exports.TableColumnSchema.parse({
|
|
47
|
+
heading: 'Column A',
|
|
48
|
+
help: 'Enter the value for column A',
|
|
49
|
+
required: false,
|
|
50
|
+
enabled: true,
|
|
51
|
+
content: {
|
|
52
|
+
type: 'textArea',
|
|
53
|
+
attributes: { label: '' },
|
|
54
|
+
meta: { schema: question_1.CURRENT_SCHEMA_VERSION }
|
|
55
|
+
}
|
|
41
56
|
});
|
|
42
57
|
// Table question
|
|
43
|
-
exports.TableQuestionSchema = question_1.QuestionSchema.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
attributes:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
minRows: zod_1.z.number().optional() // The minimum number of rows (no default)
|
|
52
|
-
})).default({})
|
|
53
|
-
}));
|
|
54
|
-
exports.ResearchOutputTableColumnPreferenceSchema = zod_1.z.object({
|
|
58
|
+
exports.TableQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, question_1.QuestionSchema.shape), { type: zod_1.z.literal('table'), columns: zod_1.z.array(exports.TableColumnSchema), attributes: TableAttributesSchema.optional() }));
|
|
59
|
+
exports.DefaultTableQuestion = exports.TableQuestionSchema.parse({
|
|
60
|
+
type: 'table',
|
|
61
|
+
attributes: DefaultTableAttributes,
|
|
62
|
+
meta: question_1.DefaultMeta,
|
|
63
|
+
columns: [exports.DefaultTableColumn]
|
|
64
|
+
});
|
|
65
|
+
const ResearchOutputTableColumnPreferenceSchema = zod_1.z.object({
|
|
55
66
|
label: zod_1.z.string().default(''), // The label of the preference option
|
|
56
67
|
value: zod_1.z.string().default('') // The value of the preference option
|
|
57
68
|
});
|
|
58
|
-
const ResearchOutputTitleColumnSchema = exports.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
help: zod_1.z.string().default('Enter the title of this research output'),
|
|
64
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.title.heading')
|
|
65
|
-
}).default({})
|
|
66
|
-
}).default({ type: 'text' })
|
|
67
|
-
});
|
|
68
|
-
const ResearchOutputDescriptionColumnSchema = exports.TableColumn.extend({
|
|
69
|
-
heading: zod_1.z.string().default('Description'),
|
|
70
|
-
content: textQuestions_1.TextAreaQuestionSchema.extend({
|
|
71
|
-
attributes: zod_1.z.object({
|
|
72
|
-
help: zod_1.z.string().default('Provide a brief description of this research output'),
|
|
73
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.description.heading')
|
|
74
|
-
}).default({})
|
|
75
|
-
}).default({ type: 'textArea' })
|
|
76
|
-
});
|
|
77
|
-
const ResearchOutputOutputTypeColumnSchema = exports.TableColumn.extend({
|
|
78
|
-
heading: zod_1.z.string().default('Output Type'),
|
|
79
|
-
required: zod_1.z.literal(true),
|
|
80
|
-
content: optionBasedQuestions_1.SelectBoxQuestionSchema.extend({
|
|
81
|
-
attributes: zod_1.z.object({
|
|
82
|
-
multiple: zod_1.z.literal(false),
|
|
83
|
-
help: zod_1.z.string().default('Select the type that best describes this research output'),
|
|
84
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.outputType.heading')
|
|
85
|
-
}).default({ multiple: false }),
|
|
86
|
-
}).default({ type: 'selectBox' })
|
|
87
|
-
});
|
|
88
|
-
const ResearchOutputDataFlagsColumnSchema = exports.TableColumn.extend({
|
|
89
|
-
heading: zod_1.z.string().default('Data Flags'),
|
|
90
|
-
enabled: zod_1.z.boolean().default(false),
|
|
91
|
-
content: optionBasedQuestions_1.CheckboxesQuestionSchema.extend({
|
|
92
|
-
attributes: zod_1.z.object({
|
|
93
|
-
help: zod_1.z.string().default('Select any data flags that apply to this research output'),
|
|
94
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.dataFlags.heading')
|
|
95
|
-
}).default({}),
|
|
96
|
-
options: zod_1.z.array(zod_1.z.object({
|
|
97
|
-
label: zod_1.z.string(),
|
|
98
|
-
value: zod_1.z.string()
|
|
99
|
-
})).default([
|
|
100
|
-
{ label: 'May contain sensitive data?', value: 'sensitive' },
|
|
101
|
-
{ label: 'May contain personally identifiable information?', value: 'personal' },
|
|
102
|
-
])
|
|
103
|
-
}).default({ type: 'checkBoxes' })
|
|
104
|
-
});
|
|
105
|
-
const ResearchOutputAccessLevelColumnSchema = exports.TableColumn.extend({
|
|
106
|
-
heading: zod_1.z.string().default('Initial Access Level'),
|
|
107
|
-
enabled: zod_1.z.boolean().default(false),
|
|
108
|
-
content: optionBasedQuestions_1.SelectBoxQuestionSchema.extend({
|
|
109
|
-
attributes: zod_1.z.object({
|
|
110
|
-
multiple: zod_1.z.literal(false),
|
|
111
|
-
help: zod_1.z.string().default('The initial access level for the research output'),
|
|
112
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.accessLevel.heading')
|
|
113
|
-
}).default({ multiple: false }),
|
|
114
|
-
options: zod_1.z.array(zod_1.z.object({
|
|
115
|
-
label: zod_1.z.string(),
|
|
116
|
-
value: zod_1.z.string()
|
|
117
|
-
})).default([
|
|
118
|
-
{ label: 'Unrestricted Access', value: 'open' },
|
|
119
|
-
{ label: 'Controlled Access', value: 'restricted' },
|
|
120
|
-
{ label: 'Other', value: 'closed' },
|
|
121
|
-
])
|
|
122
|
-
}).default({ type: 'selectBox' })
|
|
123
|
-
});
|
|
124
|
-
const ResearchOutputReleaseDateColumnSchema = exports.TableColumn.extend({
|
|
125
|
-
heading: zod_1.z.string().default('Anticipated Release Date'),
|
|
126
|
-
enabled: zod_1.z.boolean().default(false),
|
|
127
|
-
content: dateQuestions_1.DateQuestionSchema.extend({
|
|
128
|
-
attributes: zod_1.z.object({
|
|
129
|
-
help: zod_1.z.string().default('The anticipated release date for the research output'),
|
|
130
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.releaseDate.heading')
|
|
131
|
-
}).default({})
|
|
132
|
-
}).default({ type: 'date' })
|
|
133
|
-
});
|
|
134
|
-
const ResearchOutputByteSizeColumnSchema = exports.TableColumn.extend({
|
|
135
|
-
heading: zod_1.z.string().default('Byte Size'),
|
|
136
|
-
enabled: zod_1.z.boolean().default(false),
|
|
137
|
-
content: numberQuestions_1.NumberWithContextQuestionSchema.extend({
|
|
138
|
-
attributes: zod_1.z.object({
|
|
139
|
-
min: zod_1.z.number().default(0),
|
|
140
|
-
help: zod_1.z.string().default('The size of the research output in bytes'),
|
|
141
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.byteSize.heading'),
|
|
142
|
-
context: zod_1.z.array(zod_1.z.object({
|
|
143
|
-
label: zod_1.z.string().default('MB (megabytes)'),
|
|
144
|
-
value: zod_1.z.string().default('mb')
|
|
145
|
-
})).default([
|
|
146
|
-
{ label: 'bytes', value: 'bytes' },
|
|
147
|
-
{ label: 'KB (kilobytes)', value: 'kb' },
|
|
148
|
-
{ label: 'MB (megabytes)', value: 'mb' },
|
|
149
|
-
{ label: 'GB (gigabytes)', value: 'gb' },
|
|
150
|
-
{ label: 'TB (terabytes)', value: 'tb' },
|
|
151
|
-
{ label: 'PB (petabytes)', value: 'pb' }
|
|
152
|
-
])
|
|
153
|
-
}).default({})
|
|
154
|
-
}).default({ type: 'numberWithContext' })
|
|
155
|
-
});
|
|
156
|
-
const ResearchOutputRepositoryColumnSchema = exports.TableColumn.extend({
|
|
157
|
-
heading: zod_1.z.string().default('Repository'),
|
|
158
|
-
enabled: zod_1.z.boolean().default(false),
|
|
159
|
-
content: graphQLQuestions_1.RepositorySearchQuestionSchema.default({ type: 'repositorySearch' }),
|
|
160
|
-
preferences: zod_1.z.array(exports.ResearchOutputTableColumnPreferenceSchema).default([]),
|
|
161
|
-
attributes: zod_1.z.object({
|
|
162
|
-
help: zod_1.z.string().default('Select repositor(ies) you would prefer users to deposit in'),
|
|
163
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.repository.heading')
|
|
164
|
-
}).default({})
|
|
165
|
-
});
|
|
166
|
-
const ResearchOutputMetadataStandardColumnSchema = exports.TableColumn.extend({
|
|
167
|
-
heading: zod_1.z.string().default('Metadata Standard'),
|
|
168
|
-
enabled: zod_1.z.boolean().default(false),
|
|
169
|
-
content: graphQLQuestions_1.MetadataStandardSearchQuestionSchema.default({ type: 'metadataStandardSearch' }),
|
|
170
|
-
preferences: zod_1.z.array(exports.ResearchOutputTableColumnPreferenceSchema).default([]),
|
|
171
|
-
attributes: zod_1.z.object({
|
|
172
|
-
help: zod_1.z.string().default('Select metadata standard(s) you would prefer users to use'),
|
|
173
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.metadataStandard.heading')
|
|
174
|
-
}).default({})
|
|
175
|
-
});
|
|
176
|
-
const ResearchOutputLicenseColumnSchema = exports.TableColumn.extend({
|
|
177
|
-
heading: zod_1.z.string().default('License'),
|
|
178
|
-
enabled: zod_1.z.boolean().default(false),
|
|
179
|
-
content: graphQLQuestions_1.LicenseSearchQuestionSchema.default({ type: 'licenseSearch' }),
|
|
180
|
-
preferences: zod_1.z.array(exports.ResearchOutputTableColumnPreferenceSchema).default([]),
|
|
181
|
-
attributes: zod_1.z.object({
|
|
182
|
-
help: zod_1.z.string().default('Select license(s) you would prefer users to apply to the research output'),
|
|
183
|
-
labelTranslationKey: zod_1.z.string().default('researchOutput.license.heading')
|
|
184
|
-
}).default({})
|
|
185
|
-
});
|
|
186
|
-
const ResearchOutputCustomColumnSchema = exports.TableColumn.extend({
|
|
187
|
-
heading: zod_1.z.string().default('Custom Column'),
|
|
188
|
-
enabled: zod_1.z.boolean().default(false),
|
|
189
|
-
content: textQuestions_1.TextQuestionSchema.extend({
|
|
190
|
-
attributes: zod_1.z.object({
|
|
191
|
-
help: zod_1.z.string().default('Explanation of what we expect the user to enter.'),
|
|
192
|
-
maxLength: zod_1.z.number().default(255),
|
|
193
|
-
defaultValue: zod_1.z.string().optional(),
|
|
194
|
-
}).default({})
|
|
195
|
-
}).default({ type: 'text' })
|
|
196
|
-
});
|
|
197
|
-
const defaultTitleColumn = ResearchOutputTitleColumnSchema.parse({
|
|
69
|
+
const ResearchOutputTitleColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Title'), help: zod_1.z.string().default('Enter the title of this research output'), required: zod_1.z.boolean().default(true), content: textQuestions_1.TextQuestionSchema }));
|
|
70
|
+
// Blank out the label and help text as these are set at the column level
|
|
71
|
+
const DefaultResearchOutputTitleContent = Object.assign(Object.assign({}, textQuestions_1.DefaultTextQuestion), { label: '', help: '' });
|
|
72
|
+
const DefaultResearchOutputTitleColumn = ResearchOutputTitleColumnSchema.parse({
|
|
73
|
+
heading: 'Title',
|
|
198
74
|
required: true,
|
|
199
|
-
content:
|
|
75
|
+
content: DefaultResearchOutputTitleContent
|
|
200
76
|
});
|
|
201
|
-
const
|
|
202
|
-
|
|
77
|
+
const ResearchOutputDescriptionColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Description'), help: zod_1.z.string().default('Enter a brief description of this research output'), content: textQuestions_1.TextAreaQuestionSchema }));
|
|
78
|
+
// Blank out the label and help text as these are set at the column level
|
|
79
|
+
const DefaultResearchOutputDescriptionContent = Object.assign(Object.assign({}, textQuestions_1.DefaultTextAreaQuestion), { label: '', help: '' });
|
|
80
|
+
const DefaultResearchOutputDescriptionColumn = ResearchOutputDescriptionColumnSchema.parse({
|
|
81
|
+
heading: 'Description',
|
|
82
|
+
enabled: false,
|
|
83
|
+
content: DefaultResearchOutputDescriptionContent
|
|
84
|
+
});
|
|
85
|
+
const DefaultResearchOutputTypeOptions = [
|
|
86
|
+
{ label: 'Dataset', value: 'dataset' },
|
|
87
|
+
{ label: 'Software', value: 'software' },
|
|
88
|
+
{ label: 'Other', value: 'other' },
|
|
89
|
+
];
|
|
90
|
+
const DefaultResearchOutputTypeContent = optionBasedQuestions_1.SelectBoxQuestionSchema.parse({
|
|
91
|
+
type: 'selectBox',
|
|
92
|
+
attributes: optionBasedQuestions_1.DefaultSelectBoxQuestion.attributes,
|
|
93
|
+
meta: question_1.DefaultMeta,
|
|
94
|
+
options: DefaultResearchOutputTypeOptions
|
|
95
|
+
});
|
|
96
|
+
const ResearchOutputTypeColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Type'), help: zod_1.z.string().default('Select the type of this research output'), required: zod_1.z.boolean().default(true), content: optionBasedQuestions_1.SelectBoxQuestionSchema }));
|
|
97
|
+
const DefaultResearchOutputTypeColumn = ResearchOutputTypeColumnSchema.parse({
|
|
98
|
+
heading: 'Type',
|
|
203
99
|
required: true,
|
|
204
|
-
content:
|
|
205
|
-
});
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
100
|
+
content: DefaultResearchOutputTypeContent,
|
|
101
|
+
});
|
|
102
|
+
const DefaultResearchOutputDataFlagsOptions = [
|
|
103
|
+
{ label: 'May contain sensitive data?', value: 'sensitive', checked: false },
|
|
104
|
+
{ label: 'May contain personally identifiable information?', value: 'personal', checked: false },
|
|
105
|
+
];
|
|
106
|
+
const DefaultResearchOutputDataFlagsContent = optionBasedQuestions_1.CheckboxesQuestionSchema.parse({
|
|
107
|
+
type: 'checkBoxes',
|
|
108
|
+
attributes: optionBasedQuestions_1.DefaultCheckboxesQuestion.attributes,
|
|
109
|
+
meta: question_1.DefaultMeta,
|
|
110
|
+
options: DefaultResearchOutputDataFlagsOptions
|
|
111
|
+
});
|
|
112
|
+
const ResearchOutputDataFlagsColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Data Flags'), help: zod_1.z.string().default('Mark all of the statements that are true about the dataset'), enabled: zod_1.z.boolean().default(false), content: optionBasedQuestions_1.CheckboxesQuestionSchema }));
|
|
113
|
+
const DefaultResearchOutputDataFlagsColumn = ResearchOutputDataFlagsColumnSchema.parse({
|
|
114
|
+
heading: 'Data Flags',
|
|
115
|
+
enabled: false,
|
|
116
|
+
content: DefaultResearchOutputDataFlagsContent
|
|
117
|
+
});
|
|
118
|
+
const DefaultResearchOutputAccessLevelOptions = [
|
|
119
|
+
{ label: 'Open Access', value: 'open', selected: false },
|
|
120
|
+
{ label: 'Restricted Access', value: 'restricted', selected: false },
|
|
121
|
+
{ label: 'Other', value: 'closed', selected: false },
|
|
122
|
+
];
|
|
123
|
+
const DefaultResearchOutputAccessLevelContent = optionBasedQuestions_1.RadioButtonsQuestionSchema.parse({
|
|
124
|
+
type: 'radioButtons',
|
|
125
|
+
attributes: optionBasedQuestions_1.DefaultRadioButtonsQuestion.attributes,
|
|
126
|
+
meta: question_1.DefaultMeta,
|
|
127
|
+
options: DefaultResearchOutputAccessLevelOptions
|
|
128
|
+
});
|
|
129
|
+
const ResearchOutputAccessLevelColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Access Level'), help: zod_1.z.string().default('Select the access level for this research output'), enabled: zod_1.z.boolean().default(false), content: optionBasedQuestions_1.RadioButtonsQuestionSchema }));
|
|
130
|
+
const DefaultResearchOutputAccessLevelColumn = ResearchOutputAccessLevelColumnSchema.parse({
|
|
131
|
+
heading: 'Access Level',
|
|
132
|
+
enabled: false,
|
|
133
|
+
content: DefaultResearchOutputAccessLevelContent
|
|
134
|
+
});
|
|
135
|
+
const ResearchOutputReleaseDateColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Anticipated Release Date'), help: zod_1.z.string().default('The anticipated release date for the research output'), enabled: zod_1.z.boolean().default(false), content: dateQuestions_1.DateQuestionSchema }));
|
|
136
|
+
const DefaultResearchOutputReleaseDateColumn = ResearchOutputReleaseDateColumnSchema.parse({
|
|
137
|
+
heading: 'Anticipated Release Date',
|
|
138
|
+
enabled: false,
|
|
139
|
+
content: dateQuestions_1.DefaultDateQuestion,
|
|
140
|
+
});
|
|
141
|
+
const DefaultResearchOutputByteSizeOptions = [
|
|
142
|
+
{ label: 'bytes', value: 'bytes', selected: false },
|
|
143
|
+
{ label: 'KB (kilobytes)', value: 'kb', selected: true },
|
|
144
|
+
{ label: 'MB (megabytes)', value: 'mb', selected: false },
|
|
145
|
+
{ label: 'GB (gigabytes)', value: 'gb', selected: false },
|
|
146
|
+
{ label: 'TB (terabytes)', value: 'tb', selected: false },
|
|
147
|
+
{ label: 'PB (petabytes)', value: 'pb', selected: false }
|
|
148
|
+
];
|
|
149
|
+
const DefaultResearchOutputByteSizeContentAttributes = Object.assign(Object.assign({}, numberQuestions_1.DefaultNumberWithContextQuestion.attributes), { context: DefaultResearchOutputByteSizeOptions });
|
|
150
|
+
const DefaultResearchOutputByteSizeContent = numberQuestions_1.NumberWithContextQuestionSchema.parse({
|
|
151
|
+
type: 'numberWithContext',
|
|
152
|
+
attributes: DefaultResearchOutputByteSizeContentAttributes,
|
|
153
|
+
meta: question_1.DefaultMeta,
|
|
154
|
+
});
|
|
155
|
+
const ResearchOutputByteSizeColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Byte Size'), help: zod_1.z.string().default('The size of the research output in bytes'), enabled: zod_1.z.boolean().default(false), content: numberQuestions_1.NumberWithContextQuestionSchema }));
|
|
156
|
+
const DefaultResearchOutputByteSizeColumn = ResearchOutputByteSizeColumnSchema.parse({
|
|
157
|
+
heading: 'Byte Size',
|
|
158
|
+
enabled: false,
|
|
159
|
+
content: DefaultResearchOutputByteSizeContent
|
|
160
|
+
});
|
|
161
|
+
const ResearchOutputRepositoryColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Repository'), help: zod_1.z.string().default('Select repository(ies) you would prefer users to deposit in'), enabled: zod_1.z.boolean().default(false), content: graphQLQuestions_1.RepositorySearchQuestionSchema, preferences: zod_1.z.array(ResearchOutputTableColumnPreferenceSchema).default([]) }));
|
|
162
|
+
const DefaultResearchOutputRepositoryColumn = ResearchOutputRepositoryColumnSchema.parse({
|
|
163
|
+
heading: 'Repository(ies)',
|
|
164
|
+
enabled: false,
|
|
165
|
+
content: graphQLQuestions_1.DefaultRepositorySearchQuestion,
|
|
166
|
+
preferences: []
|
|
167
|
+
});
|
|
168
|
+
const ResearchOutputMetadataStandardColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Metadata Standard'), help: zod_1.z.string().default('Select metadata standard(s) you would prefer users to use'), enabled: zod_1.z.boolean().default(false), content: graphQLQuestions_1.MetadataStandardSearchQuestionSchema, preferences: zod_1.z.array(ResearchOutputTableColumnPreferenceSchema).default([]) }));
|
|
169
|
+
const DefaultResearchOutputMetadataStandardColumn = ResearchOutputMetadataStandardColumnSchema.parse({
|
|
170
|
+
heading: 'Metadata Standard(s)',
|
|
171
|
+
enabled: false,
|
|
172
|
+
content: graphQLQuestions_1.DefaultMetadataStandardSearchQuestion,
|
|
173
|
+
preferences: []
|
|
174
|
+
});
|
|
175
|
+
const ResearchOutputLicenseColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('License'), help: zod_1.z.string().default('Select the license you will apply to the research output'), enabled: zod_1.z.boolean().default(false), content: graphQLQuestions_1.LicenseSearchQuestionSchema, preferences: zod_1.z.array(ResearchOutputTableColumnPreferenceSchema).default([]) }));
|
|
176
|
+
const DefaultResearchOutputLicenseColumn = ResearchOutputLicenseColumnSchema.parse({
|
|
177
|
+
heading: 'License',
|
|
178
|
+
enabled: false,
|
|
179
|
+
content: graphQLQuestions_1.DefaultLicenseSearchQuestion,
|
|
180
|
+
preferences: []
|
|
181
|
+
});
|
|
182
|
+
const ResearchOutputCustomContentAttributesSchema = textQuestions_1.TextQuestionSchema.shape.attributes.extend({
|
|
183
|
+
label: zod_1.z.string().optional(),
|
|
184
|
+
help: zod_1.z.string().optional()
|
|
185
|
+
});
|
|
186
|
+
const DefaultResearchOutputCustomContentAttributes = ResearchOutputCustomContentAttributesSchema.parse({});
|
|
187
|
+
const ResearchOutputCustomContentSchema = zod_1.z.object(Object.assign(Object.assign({}, textQuestions_1.TextQuestionSchema.shape), { attributes: ResearchOutputCustomContentAttributesSchema }));
|
|
188
|
+
const DefaultResearchOutputCustomContent = ResearchOutputCustomContentSchema.parse({
|
|
189
|
+
type: 'text',
|
|
190
|
+
attributes: DefaultResearchOutputCustomContentAttributes,
|
|
191
|
+
meta: question_1.DefaultMeta
|
|
192
|
+
});
|
|
193
|
+
exports.ResearchOutputCustomColumnSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableColumnSchema.shape), { heading: zod_1.z.string().default('Custom Column'), help: zod_1.z.string().default('Explanation of what we expect the user to enter.'), enabled: zod_1.z.boolean().default(false), content: ResearchOutputCustomContentSchema }));
|
|
194
|
+
exports.DefaultResearchOutputCustomColumn = exports.ResearchOutputCustomColumnSchema.parse({
|
|
195
|
+
heading: 'Custom Column',
|
|
196
|
+
enabled: false,
|
|
197
|
+
content: DefaultResearchOutputCustomContent
|
|
198
|
+
});
|
|
199
|
+
// Add this BEFORE ResearchOutputTableQuestionSchema
|
|
200
|
+
const AnyResearchOutputColumnSchema = zod_1.z.union([
|
|
201
|
+
ResearchOutputTitleColumnSchema,
|
|
202
|
+
ResearchOutputDescriptionColumnSchema,
|
|
203
|
+
ResearchOutputTypeColumnSchema,
|
|
204
|
+
ResearchOutputDataFlagsColumnSchema,
|
|
205
|
+
ResearchOutputAccessLevelColumnSchema,
|
|
206
|
+
ResearchOutputReleaseDateColumnSchema,
|
|
207
|
+
ResearchOutputByteSizeColumnSchema,
|
|
208
|
+
ResearchOutputRepositoryColumnSchema,
|
|
209
|
+
ResearchOutputMetadataStandardColumnSchema,
|
|
210
|
+
ResearchOutputLicenseColumnSchema,
|
|
211
|
+
exports.ResearchOutputCustomColumnSchema,
|
|
212
|
+
exports.ResearchOutputCustomColumnSchema
|
|
213
|
+
]);
|
|
214
|
+
// Update ResearchOutputTableQuestionSchema
|
|
215
|
+
exports.ResearchOutputTableQuestionSchema = zod_1.z.object(Object.assign(Object.assign({}, exports.TableQuestionSchema.shape), { type: zod_1.z.literal('researchOutputTable'), columns: zod_1.z.array(AnyResearchOutputColumnSchema) }));
|
|
216
|
+
exports.DefaultResearchOutputTableQuestion = exports.ResearchOutputTableQuestionSchema.parse({
|
|
217
|
+
type: 'researchOutputTable',
|
|
218
|
+
attributes: DefaultTableAttributes,
|
|
219
|
+
meta: question_1.DefaultMeta,
|
|
220
|
+
columns: [
|
|
221
|
+
DefaultResearchOutputTitleColumn,
|
|
222
|
+
DefaultResearchOutputDescriptionColumn,
|
|
223
|
+
DefaultResearchOutputTypeColumn,
|
|
224
|
+
DefaultResearchOutputDataFlagsColumn,
|
|
225
|
+
DefaultResearchOutputAccessLevelColumn,
|
|
226
|
+
DefaultResearchOutputReleaseDateColumn,
|
|
227
|
+
DefaultResearchOutputByteSizeColumn,
|
|
228
|
+
DefaultResearchOutputRepositoryColumn,
|
|
229
|
+
DefaultResearchOutputMetadataStandardColumn,
|
|
230
|
+
DefaultResearchOutputLicenseColumn,
|
|
231
|
+
exports.DefaultResearchOutputCustomColumn,
|
|
232
|
+
]
|
|
233
|
+
});
|
|
234
|
+
exports.AnyTableColumnQuestionJSONSchema = zod_1.z.toJSONSchema(exports.AnyTableColumnQuestionSchema);
|
|
235
|
+
exports.TableQuestionJSONSchema = zod_1.z.toJSONSchema(exports.TableQuestionSchema);
|
|
236
|
+
exports.ResearchOutputTableQuestionJSONSchema = zod_1.z.toJSONSchema(exports.ResearchOutputTableQuestionSchema);
|