@dmptool/types 1.2.3 → 1.2.5
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 +8 -0
- package/dist/answers/__tests__/answers.spec.js +122 -6
- package/dist/answers/answer.d.ts +3 -3
- package/dist/answers/graphQLAnswers.d.ts +120 -25
- package/dist/answers/graphQLAnswers.js +22 -5
- package/dist/answers/index.d.ts +399 -31
- package/dist/answers/index.js +8 -2
- package/dist/answers/numberAnswers.d.ts +40 -0
- package/dist/answers/numberAnswers.js +8 -1
- package/dist/answers/tableAnswers.d.ts +1688 -75
- package/dist/answers/tableAnswers.js +63 -2
- package/dist/questions/__tests__/graphQLQuestions.spec.js +177 -39
- package/dist/questions/__tests__/numberQuestions.spec.js +36 -0
- package/dist/questions/__tests__/tableQuestion.spec.js +145 -0
- package/dist/questions/__tests__/usage.spec.js +162 -1
- package/dist/questions/graphQLQuestions.d.ts +420 -60
- package/dist/questions/graphQLQuestions.js +257 -11
- package/dist/questions/index.d.ts +4849 -189
- package/dist/questions/index.js +9 -2
- package/dist/questions/numberQuestions.d.ts +105 -0
- package/dist/questions/numberQuestions.js +12 -1
- package/dist/questions/question.d.ts +4 -4
- package/dist/questions/question.js +25 -4
- package/dist/questions/tableQuestions.d.ts +5930 -679
- package/dist/questions/tableQuestions.js +188 -3
- package/dist/schemas/anyAnswer.schema.json +137 -17
- package/dist/schemas/anyQuestion.schema.json +847 -101
- package/dist/schemas/anyTableColumnAnswer.schema.json +116 -5
- package/dist/schemas/anyTableColumnQuestion.schema.json +326 -24
- package/dist/schemas/licenseSearchAnswer.schema.json +49 -0
- package/dist/schemas/licenseSearchQuestion.schema.json +164 -0
- package/dist/schemas/metadataStandardSearchAnswer.schema.json +49 -0
- package/dist/schemas/metadataStandardSearchQuestion.schema.json +174 -0
- package/dist/schemas/numberWithContextAnswer.schema.json +45 -0
- package/dist/schemas/numberWithContextQuestion.schema.json +84 -0
- package/dist/schemas/repositorySearchAnswer.schema.json +49 -0
- package/dist/schemas/repositorySearchQuestion.schema.json +180 -0
- package/dist/schemas/researchOutputTableAnswer.schema.json +519 -0
- package/dist/schemas/researchOutputTableQuestion.schema.json +1183 -0
- package/dist/schemas/tableAnswer.schema.json +116 -5
- package/dist/schemas/tableQuestion.schema.json +348 -24
- package/package.json +9 -5
|
@@ -144,6 +144,104 @@ it('for email question format', () => {
|
|
|
144
144
|
};
|
|
145
145
|
expect(format === null || format === void 0 ? void 0 : format.defaultJSON).toEqual(expectedJSON);
|
|
146
146
|
});
|
|
147
|
+
it('for licenseSearch question format', () => {
|
|
148
|
+
const format = questionFormatInfo('licenseSearch');
|
|
149
|
+
expect(format === null || format === void 0 ? void 0 : format.type).toEqual('licenseSearch');
|
|
150
|
+
expect(format === null || format === void 0 ? void 0 : format.title).toEqual('License Search');
|
|
151
|
+
expect(format === null || format === void 0 ? void 0 : format.usageDescription).toBeDefined();
|
|
152
|
+
const expectedJSON = {
|
|
153
|
+
type: 'licenseSearch',
|
|
154
|
+
attributes: {},
|
|
155
|
+
meta: { schemaVersion: '1.0' },
|
|
156
|
+
graphQL: {
|
|
157
|
+
displayFields: [
|
|
158
|
+
{
|
|
159
|
+
label: "Name",
|
|
160
|
+
propertyName: "name",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
label: "Description",
|
|
164
|
+
propertyName: "description",
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
label: "Recommended",
|
|
168
|
+
propertyName: "recommended",
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
query: index_1.licenseQuery,
|
|
172
|
+
responseField: 'licenses.items',
|
|
173
|
+
variables: [
|
|
174
|
+
{
|
|
175
|
+
label: "Search for a license",
|
|
176
|
+
minLength: 3,
|
|
177
|
+
name: "term",
|
|
178
|
+
type: "string",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
label: "Pagination Options",
|
|
182
|
+
name: "paginationOptions",
|
|
183
|
+
type: "paginationOptions",
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
answerField: 'uri'
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
expect(format === null || format === void 0 ? void 0 : format.defaultJSON).toEqual(expectedJSON);
|
|
190
|
+
});
|
|
191
|
+
it('for metadataStandardSearch question format', () => {
|
|
192
|
+
const format = questionFormatInfo('metadataStandardSearch');
|
|
193
|
+
expect(format === null || format === void 0 ? void 0 : format.type).toEqual('metadataStandardSearch');
|
|
194
|
+
expect(format === null || format === void 0 ? void 0 : format.title).toEqual('Metadata Standard Search');
|
|
195
|
+
expect(format === null || format === void 0 ? void 0 : format.usageDescription).toBeDefined();
|
|
196
|
+
const expectedJSON = {
|
|
197
|
+
type: 'metadataStandardSearch',
|
|
198
|
+
attributes: {},
|
|
199
|
+
meta: { schemaVersion: '1.0' },
|
|
200
|
+
graphQL: {
|
|
201
|
+
displayFields: [
|
|
202
|
+
{
|
|
203
|
+
label: "Name",
|
|
204
|
+
propertyName: "name",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
label: "Description",
|
|
208
|
+
propertyName: "description",
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
label: "Website",
|
|
212
|
+
propertyName: "website",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
label: "Subject Areas",
|
|
216
|
+
propertyName: "keywords",
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
query: index_1.metadataStandardQuery,
|
|
220
|
+
responseField: 'metadataStandards.items',
|
|
221
|
+
variables: [
|
|
222
|
+
{
|
|
223
|
+
label: "Search for a metadata standard",
|
|
224
|
+
minLength: 3,
|
|
225
|
+
name: "term",
|
|
226
|
+
type: "string",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
label: "Subject Areas",
|
|
230
|
+
name: "keywords",
|
|
231
|
+
type: "string",
|
|
232
|
+
minLength: 3,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: "Pagination Options",
|
|
236
|
+
name: "paginationOptions",
|
|
237
|
+
type: "paginationOptions",
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
answerField: 'uri'
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
expect(format === null || format === void 0 ? void 0 : format.defaultJSON).toEqual(expectedJSON);
|
|
244
|
+
});
|
|
147
245
|
it('for multiselectBox question format', () => {
|
|
148
246
|
const format = questionFormatInfo('multiselectBox');
|
|
149
247
|
expect(format === null || format === void 0 ? void 0 : format.type).toEqual('multiselectBox');
|
|
@@ -219,6 +317,66 @@ it('for radioButtons question format', () => {
|
|
|
219
317
|
};
|
|
220
318
|
expect(format === null || format === void 0 ? void 0 : format.defaultJSON).toEqual(expectedJSON);
|
|
221
319
|
});
|
|
320
|
+
it('for repositorySearch question format', () => {
|
|
321
|
+
const format = questionFormatInfo('repositorySearch');
|
|
322
|
+
expect(format === null || format === void 0 ? void 0 : format.type).toEqual('repositorySearch');
|
|
323
|
+
expect(format === null || format === void 0 ? void 0 : format.title).toEqual('Repository Search');
|
|
324
|
+
expect(format === null || format === void 0 ? void 0 : format.usageDescription).toBeDefined();
|
|
325
|
+
const expectedJSON = {
|
|
326
|
+
type: 'repositorySearch',
|
|
327
|
+
attributes: {},
|
|
328
|
+
meta: { schemaVersion: '1.0' },
|
|
329
|
+
graphQL: {
|
|
330
|
+
displayFields: [
|
|
331
|
+
{
|
|
332
|
+
label: "Name",
|
|
333
|
+
propertyName: "name",
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
label: "Description",
|
|
337
|
+
propertyName: "description",
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
label: "Website",
|
|
341
|
+
propertyName: "website",
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
label: "Subject Areas",
|
|
345
|
+
propertyName: "keywords",
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
query: index_1.repositoryQuery,
|
|
349
|
+
responseField: 'repositories.items',
|
|
350
|
+
variables: [
|
|
351
|
+
{
|
|
352
|
+
label: "Search for a repository",
|
|
353
|
+
minLength: 3,
|
|
354
|
+
name: "term",
|
|
355
|
+
type: "string",
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
label: "Subject Areas",
|
|
359
|
+
name: "keywords",
|
|
360
|
+
type: "string",
|
|
361
|
+
minLength: 3
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
label: "Repository type",
|
|
365
|
+
name: "repositoryType",
|
|
366
|
+
type: "string",
|
|
367
|
+
minLength: 3
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
label: "Pagination Options",
|
|
371
|
+
name: "paginationOptions",
|
|
372
|
+
type: "paginationOptions",
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
answerField: 'uri'
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
expect(format === null || format === void 0 ? void 0 : format.defaultJSON).toEqual(expectedJSON);
|
|
379
|
+
});
|
|
222
380
|
it('for selectBox question format', () => {
|
|
223
381
|
const format = questionFormatInfo('selectBox');
|
|
224
382
|
expect(format === null || format === void 0 ? void 0 : format.type).toEqual('selectBox');
|
|
@@ -252,6 +410,8 @@ it('for table question format', () => {
|
|
|
252
410
|
},
|
|
253
411
|
columns: [{
|
|
254
412
|
heading: 'Column A',
|
|
413
|
+
enabled: true,
|
|
414
|
+
required: false,
|
|
255
415
|
content: {
|
|
256
416
|
type: 'textArea',
|
|
257
417
|
attributes: {
|
|
@@ -260,7 +420,8 @@ it('for table question format', () => {
|
|
|
260
420
|
rows: 2,
|
|
261
421
|
},
|
|
262
422
|
meta: { schemaVersion: question_1.CURRENT_SCHEMA_VERSION }
|
|
263
|
-
}
|
|
423
|
+
},
|
|
424
|
+
meta: { schemaVersion: question_1.CURRENT_SCHEMA_VERSION }
|
|
264
425
|
}],
|
|
265
426
|
meta: { schemaVersion: question_1.CURRENT_SCHEMA_VERSION },
|
|
266
427
|
};
|