@dmptool/types 2.2.1 → 2.3.1
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/answers/__tests__/answers.spec.js +27 -14
- package/dist/answers/__tests__/defaults.spec.js +2 -0
- package/dist/answers/index.d.ts +102 -0
- package/dist/answers/index.js +1 -0
- package/dist/answers/tableAnswers.d.ts +614 -136
- package/dist/answers/tableAnswers.js +43 -20
- package/dist/dmp/__tests__/commonStandard.spec.js +26 -22
- package/dist/dmp/__tests__/extensions.spec.js +21 -15
- package/dist/dmp/extension.d.ts +385 -92
- package/dist/dmp/extension.js +49 -103
- package/dist/dmp/index.d.ts +515 -2
- package/dist/dmp/index.js +11 -1
- package/dist/questions/__tests__/defaults.spec.js +10 -0
- package/dist/questions/__tests__/tableQuestion.spec.js +5 -0
- package/dist/questions/index.d.ts +10 -0
- package/dist/questions/tableQuestions.d.ts +30 -0
- package/dist/questions/tableQuestions.js +47 -10
- package/dist/schemas/anyAnswer.schema.json +514 -0
- package/dist/schemas/anyQuestion.schema.json +30 -0
- package/dist/schemas/dmpExtension.schema.json +636 -140
- package/dist/schemas/researchOutputTableAnswer.schema.json +6047 -11983
- package/package.json +2 -2
- package/schemas/anyAnswer.schema.json +514 -0
- package/schemas/anyQuestion.schema.json +30 -0
- package/schemas/dmpExtension.schema.json +636 -140
- package/schemas/researchOutputTableAnswer.schema.json +6047 -11983
package/dist/dmp/index.d.ts
CHANGED
|
@@ -1,9 +1,522 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FromSchema } from "json-schema-to-ts";
|
|
3
|
-
import {
|
|
3
|
+
import { ExtensionSchema } from "./extension";
|
|
4
|
+
export declare const RDA_COMMON_STANDARD_VERSION = "1.2";
|
|
4
5
|
declare const jsonSchema: any;
|
|
5
6
|
export declare const RDACommonStandardDMPJSONSchema: any;
|
|
6
7
|
export type RDACommonStandardDMPType = FromSchema<typeof jsonSchema>;
|
|
7
|
-
export type
|
|
8
|
+
export type DMPToolExtensionType = z.infer<typeof ExtensionSchema>;
|
|
9
|
+
export declare const DMPToolExtensionSchema: z.ZodObject<{
|
|
10
|
+
rda_schema_version: z.ZodDefault<z.ZodString>;
|
|
11
|
+
provenance: z.ZodString;
|
|
12
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
13
|
+
[x: string]: string;
|
|
14
|
+
}>>;
|
|
15
|
+
privacy: z.ZodDefault<z.ZodEnum<{
|
|
16
|
+
[x: string]: string;
|
|
17
|
+
}>>;
|
|
18
|
+
featured: z.ZodDefault<z.ZodEnum<{
|
|
19
|
+
yes: "yes";
|
|
20
|
+
no: "no";
|
|
21
|
+
}>>;
|
|
22
|
+
registered: z.ZodOptional<z.ZodISODateTime>;
|
|
23
|
+
tombstoned: z.ZodOptional<z.ZodISODateTime>;
|
|
24
|
+
narrative: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
download_url: z.ZodOptional<z.ZodString>;
|
|
26
|
+
template: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
id: z.ZodNumber;
|
|
28
|
+
title: z.ZodString;
|
|
29
|
+
description: z.ZodOptional<z.ZodString>;
|
|
30
|
+
version: z.ZodOptional<z.ZodString>;
|
|
31
|
+
section: z.ZodArray<z.ZodObject<{
|
|
32
|
+
id: z.ZodNumber;
|
|
33
|
+
order: z.ZodNumber;
|
|
34
|
+
title: z.ZodString;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
question: z.ZodArray<z.ZodObject<{
|
|
37
|
+
id: z.ZodNumber;
|
|
38
|
+
order: z.ZodNumber;
|
|
39
|
+
text: z.ZodString;
|
|
40
|
+
answer: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
id: z.ZodNumber;
|
|
42
|
+
json: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"affiliationSearch">;
|
|
44
|
+
answer: z.ZodObject<{
|
|
45
|
+
affiliationId: z.ZodDefault<z.ZodString>;
|
|
46
|
+
affiliationName: z.ZodDefault<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
meta: z.ZodObject<{
|
|
49
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"boolean">;
|
|
54
|
+
answer: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
meta: z.ZodObject<{
|
|
56
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"checkBoxes">;
|
|
61
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
62
|
+
meta: z.ZodObject<{
|
|
63
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"currency">;
|
|
68
|
+
answer: z.ZodDefault<z.ZodNumber>;
|
|
69
|
+
meta: z.ZodObject<{
|
|
70
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
type: z.ZodLiteral<"date">;
|
|
75
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
76
|
+
meta: z.ZodObject<{
|
|
77
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"dateRange">;
|
|
82
|
+
answer: z.ZodObject<{
|
|
83
|
+
start: z.ZodDefault<z.ZodString>;
|
|
84
|
+
end: z.ZodDefault<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
meta: z.ZodObject<{
|
|
87
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
91
|
+
type: z.ZodLiteral<"email">;
|
|
92
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
93
|
+
meta: z.ZodObject<{
|
|
94
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
type: z.ZodLiteral<"licenseSearch">;
|
|
99
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
100
|
+
licenseId: z.ZodDefault<z.ZodString>;
|
|
101
|
+
licenseName: z.ZodDefault<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>>>;
|
|
103
|
+
meta: z.ZodObject<{
|
|
104
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
+
type: z.ZodLiteral<"metadataStandardSearch">;
|
|
109
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
110
|
+
metadataStandardId: z.ZodDefault<z.ZodString>;
|
|
111
|
+
metadataStandardName: z.ZodDefault<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>>>;
|
|
113
|
+
meta: z.ZodObject<{
|
|
114
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"multiselectBox">;
|
|
119
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
120
|
+
meta: z.ZodObject<{
|
|
121
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
125
|
+
type: z.ZodLiteral<"number">;
|
|
126
|
+
answer: z.ZodDefault<z.ZodNumber>;
|
|
127
|
+
meta: z.ZodObject<{
|
|
128
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"numberRange">;
|
|
133
|
+
answer: z.ZodObject<{
|
|
134
|
+
start: z.ZodDefault<z.ZodNumber>;
|
|
135
|
+
end: z.ZodDefault<z.ZodNumber>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
meta: z.ZodObject<{
|
|
138
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
+
type: z.ZodLiteral<"radioButtons">;
|
|
143
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
144
|
+
meta: z.ZodObject<{
|
|
145
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
149
|
+
type: z.ZodLiteral<"repositorySearch">;
|
|
150
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
151
|
+
repositoryId: z.ZodDefault<z.ZodString>;
|
|
152
|
+
repositoryName: z.ZodDefault<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>>>;
|
|
154
|
+
meta: z.ZodObject<{
|
|
155
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
159
|
+
type: z.ZodLiteral<"researchOutputTable">;
|
|
160
|
+
columnHeadings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
161
|
+
answer: z.ZodArray<z.ZodObject<{
|
|
162
|
+
columns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
163
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
164
|
+
type: z.ZodLiteral<"checkBoxes">;
|
|
165
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
166
|
+
meta: z.ZodObject<{
|
|
167
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
171
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
172
|
+
type: z.ZodLiteral<"date">;
|
|
173
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
174
|
+
meta: z.ZodObject<{
|
|
175
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
179
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
180
|
+
type: z.ZodLiteral<"licenseSearch">;
|
|
181
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
182
|
+
licenseId: z.ZodDefault<z.ZodString>;
|
|
183
|
+
licenseName: z.ZodDefault<z.ZodString>;
|
|
184
|
+
}, z.core.$strip>>>;
|
|
185
|
+
meta: z.ZodObject<{
|
|
186
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
190
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
191
|
+
type: z.ZodLiteral<"metadataStandardSearch">;
|
|
192
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
193
|
+
metadataStandardId: z.ZodDefault<z.ZodString>;
|
|
194
|
+
metadataStandardName: z.ZodDefault<z.ZodString>;
|
|
195
|
+
}, z.core.$strip>>>;
|
|
196
|
+
meta: z.ZodObject<{
|
|
197
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
202
|
+
type: z.ZodLiteral<"numberWithContext">;
|
|
203
|
+
answer: z.ZodObject<{
|
|
204
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
205
|
+
context: z.ZodDefault<z.ZodString>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
meta: z.ZodObject<{
|
|
208
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
212
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
213
|
+
type: z.ZodLiteral<"radioButtons">;
|
|
214
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
215
|
+
meta: z.ZodObject<{
|
|
216
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
220
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
221
|
+
type: z.ZodLiteral<"repositorySearch">;
|
|
222
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
223
|
+
repositoryId: z.ZodDefault<z.ZodString>;
|
|
224
|
+
repositoryName: z.ZodDefault<z.ZodString>;
|
|
225
|
+
}, z.core.$strip>>>;
|
|
226
|
+
meta: z.ZodObject<{
|
|
227
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
232
|
+
type: z.ZodLiteral<"selectBox">;
|
|
233
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
234
|
+
meta: z.ZodObject<{
|
|
235
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
240
|
+
type: z.ZodLiteral<"text">;
|
|
241
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
242
|
+
meta: z.ZodObject<{
|
|
243
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
247
|
+
commonStandardId: z.ZodOptional<z.ZodString>;
|
|
248
|
+
type: z.ZodLiteral<"textArea">;
|
|
249
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
250
|
+
meta: z.ZodObject<{
|
|
251
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
254
|
+
}, z.core.$strip>], "type">>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
meta: z.ZodObject<{
|
|
257
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
261
|
+
type: z.ZodLiteral<"selectBox">;
|
|
262
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
263
|
+
meta: z.ZodObject<{
|
|
264
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
+
type: z.ZodLiteral<"table">;
|
|
269
|
+
columnHeadings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
270
|
+
answer: z.ZodArray<z.ZodObject<{
|
|
271
|
+
columns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
272
|
+
type: z.ZodLiteral<"affiliationSearch">;
|
|
273
|
+
answer: z.ZodObject<{
|
|
274
|
+
affiliationId: z.ZodDefault<z.ZodString>;
|
|
275
|
+
affiliationName: z.ZodDefault<z.ZodString>;
|
|
276
|
+
}, z.core.$strip>;
|
|
277
|
+
meta: z.ZodObject<{
|
|
278
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
281
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
282
|
+
type: z.ZodLiteral<"boolean">;
|
|
283
|
+
answer: z.ZodDefault<z.ZodBoolean>;
|
|
284
|
+
meta: z.ZodObject<{
|
|
285
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
286
|
+
}, z.core.$strip>;
|
|
287
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
288
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
+
type: z.ZodLiteral<"checkBoxes">;
|
|
290
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
291
|
+
meta: z.ZodObject<{
|
|
292
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
295
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
296
|
+
type: z.ZodLiteral<"currency">;
|
|
297
|
+
answer: z.ZodDefault<z.ZodNumber>;
|
|
298
|
+
meta: z.ZodObject<{
|
|
299
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
302
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
303
|
+
type: z.ZodLiteral<"date">;
|
|
304
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
305
|
+
meta: z.ZodObject<{
|
|
306
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
310
|
+
type: z.ZodLiteral<"dateRange">;
|
|
311
|
+
answer: z.ZodObject<{
|
|
312
|
+
start: z.ZodDefault<z.ZodString>;
|
|
313
|
+
end: z.ZodDefault<z.ZodString>;
|
|
314
|
+
}, z.core.$strip>;
|
|
315
|
+
meta: z.ZodObject<{
|
|
316
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
319
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
320
|
+
type: z.ZodLiteral<"email">;
|
|
321
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
322
|
+
meta: z.ZodObject<{
|
|
323
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
327
|
+
type: z.ZodLiteral<"licenseSearch">;
|
|
328
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
329
|
+
licenseId: z.ZodDefault<z.ZodString>;
|
|
330
|
+
licenseName: z.ZodDefault<z.ZodString>;
|
|
331
|
+
}, z.core.$strip>>>;
|
|
332
|
+
meta: z.ZodObject<{
|
|
333
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
336
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
337
|
+
type: z.ZodLiteral<"metadataStandardSearch">;
|
|
338
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
339
|
+
metadataStandardId: z.ZodDefault<z.ZodString>;
|
|
340
|
+
metadataStandardName: z.ZodDefault<z.ZodString>;
|
|
341
|
+
}, z.core.$strip>>>;
|
|
342
|
+
meta: z.ZodObject<{
|
|
343
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
344
|
+
}, z.core.$strip>;
|
|
345
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
346
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
347
|
+
type: z.ZodLiteral<"multiselectBox">;
|
|
348
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
349
|
+
meta: z.ZodObject<{
|
|
350
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
353
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
354
|
+
type: z.ZodLiteral<"number">;
|
|
355
|
+
answer: z.ZodDefault<z.ZodNumber>;
|
|
356
|
+
meta: z.ZodObject<{
|
|
357
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
358
|
+
}, z.core.$strip>;
|
|
359
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
361
|
+
type: z.ZodLiteral<"numberWithContext">;
|
|
362
|
+
answer: z.ZodObject<{
|
|
363
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
364
|
+
context: z.ZodDefault<z.ZodString>;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
meta: z.ZodObject<{
|
|
367
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
368
|
+
}, z.core.$strip>;
|
|
369
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
370
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
371
|
+
type: z.ZodLiteral<"radioButtons">;
|
|
372
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
373
|
+
meta: z.ZodObject<{
|
|
374
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
377
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
378
|
+
type: z.ZodLiteral<"repositorySearch">;
|
|
379
|
+
answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
380
|
+
repositoryId: z.ZodDefault<z.ZodString>;
|
|
381
|
+
repositoryName: z.ZodDefault<z.ZodString>;
|
|
382
|
+
}, z.core.$strip>>>;
|
|
383
|
+
meta: z.ZodObject<{
|
|
384
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
385
|
+
}, z.core.$strip>;
|
|
386
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
387
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
388
|
+
type: z.ZodLiteral<"selectBox">;
|
|
389
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
390
|
+
meta: z.ZodObject<{
|
|
391
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
394
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
395
|
+
type: z.ZodLiteral<"text">;
|
|
396
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
397
|
+
meta: z.ZodObject<{
|
|
398
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
401
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
402
|
+
type: z.ZodLiteral<"textArea">;
|
|
403
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
404
|
+
meta: z.ZodObject<{
|
|
405
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
406
|
+
}, z.core.$strip>;
|
|
407
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
408
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
409
|
+
type: z.ZodLiteral<"url">;
|
|
410
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
411
|
+
meta: z.ZodObject<{
|
|
412
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
413
|
+
}, z.core.$strip>;
|
|
414
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
415
|
+
}, z.core.$strip>], "type">>;
|
|
416
|
+
}, z.core.$strip>>;
|
|
417
|
+
meta: z.ZodObject<{
|
|
418
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
419
|
+
}, z.core.$strip>;
|
|
420
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
421
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
422
|
+
type: z.ZodLiteral<"text">;
|
|
423
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
424
|
+
meta: z.ZodObject<{
|
|
425
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
426
|
+
}, z.core.$strip>;
|
|
427
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
428
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
429
|
+
type: z.ZodLiteral<"textArea">;
|
|
430
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
431
|
+
meta: z.ZodObject<{
|
|
432
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
433
|
+
}, z.core.$strip>;
|
|
434
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
435
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
436
|
+
type: z.ZodLiteral<"url">;
|
|
437
|
+
answer: z.ZodDefault<z.ZodString>;
|
|
438
|
+
meta: z.ZodObject<{
|
|
439
|
+
schemaVersion: z.ZodDefault<z.ZodString>;
|
|
440
|
+
}, z.core.$strip>;
|
|
441
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
442
|
+
}, z.core.$strip>], "type">;
|
|
443
|
+
}, z.core.$strip>>;
|
|
444
|
+
}, z.core.$strip>>;
|
|
445
|
+
}, z.core.$strip>>;
|
|
446
|
+
}, z.core.$strip>>;
|
|
447
|
+
}, z.core.$strip>>;
|
|
448
|
+
research_domain: z.ZodOptional<z.ZodObject<{
|
|
449
|
+
name: z.ZodString;
|
|
450
|
+
research_domain_identifier: z.ZodOptional<z.ZodObject<{
|
|
451
|
+
identifier: z.ZodString;
|
|
452
|
+
type: z.ZodEnum<{
|
|
453
|
+
[x: string]: string;
|
|
454
|
+
}>;
|
|
455
|
+
}, z.core.$strip>>;
|
|
456
|
+
}, z.core.$strip>>;
|
|
457
|
+
research_facility: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
458
|
+
name: z.ZodString;
|
|
459
|
+
type: z.ZodEnum<{
|
|
460
|
+
[x: string]: string;
|
|
461
|
+
}>;
|
|
462
|
+
research_facility_identifier: z.ZodOptional<z.ZodObject<{
|
|
463
|
+
identifier: z.ZodString;
|
|
464
|
+
type: z.ZodEnum<{
|
|
465
|
+
[x: string]: string;
|
|
466
|
+
}>;
|
|
467
|
+
}, z.core.$strip>>;
|
|
468
|
+
}, z.core.$strip>>>;
|
|
469
|
+
version: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
470
|
+
access_url: z.ZodString;
|
|
471
|
+
version: z.ZodISODateTime;
|
|
472
|
+
}, z.core.$strip>>>;
|
|
473
|
+
funding_opportunity: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
474
|
+
project_id: z.ZodObject<{
|
|
475
|
+
identifier: z.ZodString;
|
|
476
|
+
type: z.ZodEnum<{
|
|
477
|
+
[x: string]: string;
|
|
478
|
+
}>;
|
|
479
|
+
}, z.core.$strip>;
|
|
480
|
+
funder_id: z.ZodObject<{
|
|
481
|
+
identifier: z.ZodString;
|
|
482
|
+
type: z.ZodEnum<{
|
|
483
|
+
[x: string]: string;
|
|
484
|
+
}>;
|
|
485
|
+
}, z.core.$strip>;
|
|
486
|
+
opportunity_identifier: z.ZodObject<{
|
|
487
|
+
identifier: z.ZodString;
|
|
488
|
+
type: z.ZodEnum<{
|
|
489
|
+
[x: string]: string;
|
|
490
|
+
}>;
|
|
491
|
+
}, z.core.$strip>;
|
|
492
|
+
}, z.core.$strip>>>;
|
|
493
|
+
funding_project: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
494
|
+
project_id: z.ZodObject<{
|
|
495
|
+
identifier: z.ZodString;
|
|
496
|
+
type: z.ZodEnum<{
|
|
497
|
+
[x: string]: string;
|
|
498
|
+
}>;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
funder_id: z.ZodObject<{
|
|
501
|
+
identifier: z.ZodString;
|
|
502
|
+
type: z.ZodEnum<{
|
|
503
|
+
[x: string]: string;
|
|
504
|
+
}>;
|
|
505
|
+
}, z.core.$strip>;
|
|
506
|
+
project_identifier: z.ZodObject<{
|
|
507
|
+
identifier: z.ZodString;
|
|
508
|
+
type: z.ZodEnum<{
|
|
509
|
+
[x: string]: string;
|
|
510
|
+
}>;
|
|
511
|
+
}, z.core.$strip>;
|
|
512
|
+
}, z.core.$strip>>>;
|
|
513
|
+
}, z.core.$strip>;
|
|
8
514
|
export declare const ExtensionJSONSchema: z.core.JSONSchema.JSONSchema;
|
|
515
|
+
type RDAInner = RDACommonStandardDMPType extends {
|
|
516
|
+
dmp: infer T;
|
|
517
|
+
} ? T : any;
|
|
518
|
+
type MergedDMP = RDAInner & DMPToolExtensionType;
|
|
519
|
+
export type DMPToolDMPType = {
|
|
520
|
+
dmp: MergedDMP;
|
|
521
|
+
};
|
|
9
522
|
export {};
|
package/dist/dmp/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExtensionJSONSchema = exports.RDACommonStandardDMPJSONSchema = void 0;
|
|
6
|
+
exports.ExtensionJSONSchema = exports.DMPToolExtensionSchema = exports.RDACommonStandardDMPJSONSchema = exports.RDA_COMMON_STANDARD_VERSION = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const zod_1 = require("zod");
|
|
@@ -15,6 +15,15 @@ const extension_1 = require("./extension");
|
|
|
15
15
|
// At this time, there is a PR to add support for converting a JSON Schema into
|
|
16
16
|
// a Zod schema, but it is not there yet.
|
|
17
17
|
//
|
|
18
|
+
// Define the current version of the RDA Common Standard. This will be used to
|
|
19
|
+
// mark DMP Tool extension records with the version of the RDA Common Standard
|
|
20
|
+
// that the DMP conforms to.
|
|
21
|
+
//
|
|
22
|
+
// TODO: For some reason, Zod's `z.toJSONSchema(ExtensionSchema)` below is unable
|
|
23
|
+
// to work with a reference to this constant (or any variable really and
|
|
24
|
+
// requires all defaults be hard-coded values!), so be sure to update the
|
|
25
|
+
// `extension.ts` file to set the version there as well.
|
|
26
|
+
exports.RDA_COMMON_STANDARD_VERSION = "1.2";
|
|
18
27
|
// Convert the downloaded JSON schema into types
|
|
19
28
|
// First try resolving via the package export (works when installed from GitHub branch or npm)
|
|
20
29
|
function resolveSchemaPath() {
|
|
@@ -66,4 +75,5 @@ if (!fs_1.default.existsSync(RDA_COMMON_STANDARD_JSON_FILE)) {
|
|
|
66
75
|
// but that's exactly what we want to do.
|
|
67
76
|
const jsonSchema = JSON.parse(fs_1.default.readFileSync(RDA_COMMON_STANDARD_JSON_FILE, "utf8"));
|
|
68
77
|
exports.RDACommonStandardDMPJSONSchema = jsonSchema;
|
|
78
|
+
exports.DMPToolExtensionSchema = extension_1.ExtensionSchema;
|
|
69
79
|
exports.ExtensionJSONSchema = zod_1.z.toJSONSchema(extension_1.ExtensionSchema);
|
|
@@ -247,6 +247,7 @@ describe('questions return the expected defaults', () => {
|
|
|
247
247
|
columns: [
|
|
248
248
|
{
|
|
249
249
|
heading: "Title",
|
|
250
|
+
commonStandardId: 'title',
|
|
250
251
|
help: "Enter the title of this research output",
|
|
251
252
|
required: true,
|
|
252
253
|
enabled: true,
|
|
@@ -258,6 +259,7 @@ describe('questions return the expected defaults', () => {
|
|
|
258
259
|
},
|
|
259
260
|
{
|
|
260
261
|
heading: "Description",
|
|
262
|
+
commonStandardId: 'description',
|
|
261
263
|
help: "Enter a brief description of this research output",
|
|
262
264
|
required: false,
|
|
263
265
|
enabled: false,
|
|
@@ -274,6 +276,7 @@ describe('questions return the expected defaults', () => {
|
|
|
274
276
|
},
|
|
275
277
|
{
|
|
276
278
|
heading: "Type",
|
|
279
|
+
commonStandardId: 'type',
|
|
277
280
|
help: "Select the type of this research output",
|
|
278
281
|
required: true,
|
|
279
282
|
enabled: true,
|
|
@@ -290,6 +293,7 @@ describe('questions return the expected defaults', () => {
|
|
|
290
293
|
},
|
|
291
294
|
{
|
|
292
295
|
heading: 'Data Flags',
|
|
296
|
+
commonStandardId: 'data_flags',
|
|
293
297
|
help: 'Mark all of the statements that are true about the dataset',
|
|
294
298
|
required: false,
|
|
295
299
|
enabled: false,
|
|
@@ -313,6 +317,7 @@ describe('questions return the expected defaults', () => {
|
|
|
313
317
|
},
|
|
314
318
|
{
|
|
315
319
|
heading: 'Access Level',
|
|
320
|
+
commonStandardId: 'data_access',
|
|
316
321
|
help: 'Select the access level for this research output',
|
|
317
322
|
required: false,
|
|
318
323
|
enabled: false,
|
|
@@ -329,6 +334,7 @@ describe('questions return the expected defaults', () => {
|
|
|
329
334
|
},
|
|
330
335
|
{
|
|
331
336
|
heading: "Anticipated Release Date",
|
|
337
|
+
commonStandardId: 'issued',
|
|
332
338
|
help: "The anticipated release date for the research output",
|
|
333
339
|
required: false,
|
|
334
340
|
enabled: false,
|
|
@@ -342,6 +348,7 @@ describe('questions return the expected defaults', () => {
|
|
|
342
348
|
},
|
|
343
349
|
{
|
|
344
350
|
heading: "Byte Size",
|
|
351
|
+
commonStandardId: 'byte_size',
|
|
345
352
|
help: "The size of the research output in bytes",
|
|
346
353
|
required: false,
|
|
347
354
|
enabled: false,
|
|
@@ -366,6 +373,7 @@ describe('questions return the expected defaults', () => {
|
|
|
366
373
|
},
|
|
367
374
|
{
|
|
368
375
|
heading: "Repository(ies)",
|
|
376
|
+
commonStandardId: 'host',
|
|
369
377
|
help: "Select repository(ies) you would prefer users to deposit in",
|
|
370
378
|
required: false,
|
|
371
379
|
enabled: false,
|
|
@@ -435,6 +443,7 @@ describe('questions return the expected defaults', () => {
|
|
|
435
443
|
},
|
|
436
444
|
{
|
|
437
445
|
heading: "Metadata Standard(s)",
|
|
446
|
+
commonStandardId: 'metadata',
|
|
438
447
|
help: "Select metadata standard(s) you would prefer users to use",
|
|
439
448
|
required: false,
|
|
440
449
|
enabled: false,
|
|
@@ -497,6 +506,7 @@ describe('questions return the expected defaults', () => {
|
|
|
497
506
|
},
|
|
498
507
|
{
|
|
499
508
|
heading: "License",
|
|
509
|
+
commonStandardId: 'license_ref',
|
|
500
510
|
help: "Select the license you will apply to the research output",
|
|
501
511
|
required: false,
|
|
502
512
|
enabled: false,
|