@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.
Files changed (42) hide show
  1. package/README.md +8 -0
  2. package/dist/answers/__tests__/answers.spec.js +122 -6
  3. package/dist/answers/answer.d.ts +3 -3
  4. package/dist/answers/graphQLAnswers.d.ts +120 -25
  5. package/dist/answers/graphQLAnswers.js +22 -5
  6. package/dist/answers/index.d.ts +399 -31
  7. package/dist/answers/index.js +8 -2
  8. package/dist/answers/numberAnswers.d.ts +40 -0
  9. package/dist/answers/numberAnswers.js +8 -1
  10. package/dist/answers/tableAnswers.d.ts +1688 -75
  11. package/dist/answers/tableAnswers.js +63 -2
  12. package/dist/questions/__tests__/graphQLQuestions.spec.js +177 -39
  13. package/dist/questions/__tests__/numberQuestions.spec.js +36 -0
  14. package/dist/questions/__tests__/tableQuestion.spec.js +145 -0
  15. package/dist/questions/__tests__/usage.spec.js +162 -1
  16. package/dist/questions/graphQLQuestions.d.ts +420 -60
  17. package/dist/questions/graphQLQuestions.js +257 -11
  18. package/dist/questions/index.d.ts +4849 -189
  19. package/dist/questions/index.js +9 -2
  20. package/dist/questions/numberQuestions.d.ts +105 -0
  21. package/dist/questions/numberQuestions.js +12 -1
  22. package/dist/questions/question.d.ts +4 -4
  23. package/dist/questions/question.js +25 -4
  24. package/dist/questions/tableQuestions.d.ts +5930 -679
  25. package/dist/questions/tableQuestions.js +188 -3
  26. package/dist/schemas/anyAnswer.schema.json +137 -17
  27. package/dist/schemas/anyQuestion.schema.json +847 -101
  28. package/dist/schemas/anyTableColumnAnswer.schema.json +116 -5
  29. package/dist/schemas/anyTableColumnQuestion.schema.json +326 -24
  30. package/dist/schemas/licenseSearchAnswer.schema.json +49 -0
  31. package/dist/schemas/licenseSearchQuestion.schema.json +164 -0
  32. package/dist/schemas/metadataStandardSearchAnswer.schema.json +49 -0
  33. package/dist/schemas/metadataStandardSearchQuestion.schema.json +174 -0
  34. package/dist/schemas/numberWithContextAnswer.schema.json +45 -0
  35. package/dist/schemas/numberWithContextQuestion.schema.json +84 -0
  36. package/dist/schemas/repositorySearchAnswer.schema.json +49 -0
  37. package/dist/schemas/repositorySearchQuestion.schema.json +180 -0
  38. package/dist/schemas/researchOutputTableAnswer.schema.json +519 -0
  39. package/dist/schemas/researchOutputTableQuestion.schema.json +1183 -0
  40. package/dist/schemas/tableAnswer.schema.json +116 -5
  41. package/dist/schemas/tableQuestion.schema.json +348 -24
  42. 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
  };