@dmptool/types 3.0.0 → 3.1.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.
@@ -93,22 +93,8 @@ describe('questions return the expected defaults', () => {
93
93
  graphQL: {
94
94
  query: graphQLQuestions_1.licenseQuery,
95
95
  queryId: "useLicensesQuery",
96
- variables: [
97
- {
98
- type: "string",
99
- name: "term",
100
- label: "Search for a license",
101
- labelTranslationKey: "LicenseSearch.term",
102
- minLength: 3
103
- },
104
- {
105
- type: "OFFSET",
106
- name: "paginationOptions",
107
- label: "Pagination Options",
108
- labelTranslationKey: "PaginationOptions.label",
109
- }
110
- ],
111
- responseField: "licenses.items",
96
+ variables: [],
97
+ responseField: "licenses",
112
98
  answerField: "uri",
113
99
  displayFields: [
114
100
  {
@@ -515,7 +501,7 @@ describe('questions return the expected defaults', () => {
515
501
  type: "licenseSearch",
516
502
  attributes: {},
517
503
  graphQL: {
518
- query: "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }",
504
+ query: "query Licenses{ licenses { id name uri description } }",
519
505
  queryId: 'useLicensesQuery',
520
506
  displayFields: [
521
507
  {
@@ -535,22 +521,8 @@ describe('questions return the expected defaults', () => {
535
521
  },
536
522
  ],
537
523
  answerField: "uri",
538
- responseField: "licenses.items",
539
- variables: [
540
- {
541
- type: "string",
542
- name: "term",
543
- label: "Search for a license",
544
- labelTranslationKey: "LicenseSearch.term",
545
- minLength: 3
546
- },
547
- {
548
- type: "OFFSET",
549
- name: "paginationOptions",
550
- label: "Pagination Options",
551
- labelTranslationKey: "PaginationOptions.label"
552
- }
553
- ],
524
+ responseField: "licenses",
525
+ variables: [],
554
526
  },
555
527
  meta: { schemaVersion: "1.0" }
556
528
  }
@@ -53,7 +53,7 @@ const graphQLQuestions_1 = require("../graphQLQuestions");
53
53
  help: "Search for a license",
54
54
  },
55
55
  graphQL: {
56
- query: "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }",
56
+ query: "query Licenses{ licenses { id name uri description } }",
57
57
  displayFields: [
58
58
  {
59
59
  propertyName: "name",
@@ -69,15 +69,8 @@ const graphQLQuestions_1 = require("../graphQLQuestions");
69
69
  }
70
70
  ],
71
71
  answerField: "uri",
72
- responseField: "licenses.items",
73
- variables: [
74
- {
75
- type: "string",
76
- name: "term",
77
- label: "Search term",
78
- minLength: 2
79
- },
80
- ],
72
+ responseField: "licenses",
73
+ variables: [],
81
74
  },
82
75
  meta: {
83
76
  schemaVersion: "1.0"
@@ -93,7 +86,6 @@ const graphQLQuestions_1 = require("../graphQLQuestions");
93
86
  query: 'myInvalidQuery { licenses { id name } }',
94
87
  variables: [
95
88
  {
96
- name: "term",
97
89
  type: "invalid"
98
90
  },
99
91
  ],
@@ -309,7 +309,7 @@ export declare const LicenseGraphQLQuery: z.ZodObject<{
309
309
  label: z.ZodDefault<z.ZodString>;
310
310
  labelTranslationKey: z.ZodOptional<z.ZodString>;
311
311
  }, z.core.$strip>>;
312
- responseField: z.ZodLiteral<"licenses.items">;
312
+ responseField: z.ZodLiteral<"licenses">;
313
313
  localQueryId: z.ZodOptional<z.ZodString>;
314
314
  }, z.core.$strip>;
315
315
  export declare const DefaultLicenseGraphQLQuery: {
@@ -328,7 +328,7 @@ export declare const DefaultLicenseGraphQLQuery: {
328
328
  label: string;
329
329
  labelTranslationKey?: string | undefined;
330
330
  }[];
331
- responseField: "licenses.items";
331
+ responseField: "licenses";
332
332
  queryId?: string | undefined;
333
333
  localQueryId?: string | undefined;
334
334
  };
@@ -351,7 +351,7 @@ export declare const LicenseSearchQuestionSchema: z.ZodObject<{
351
351
  label: z.ZodDefault<z.ZodString>;
352
352
  labelTranslationKey: z.ZodOptional<z.ZodString>;
353
353
  }, z.core.$strip>>;
354
- responseField: z.ZodLiteral<"licenses.items">;
354
+ responseField: z.ZodLiteral<"licenses">;
355
355
  localQueryId: z.ZodOptional<z.ZodString>;
356
356
  }, z.core.$strip>;
357
357
  attributes: z.ZodObject<{
@@ -383,7 +383,7 @@ export declare const DefaultLicenseSearchQuestion: {
383
383
  label: string;
384
384
  labelTranslationKey?: string | undefined;
385
385
  }[];
386
- responseField: "licenses.items";
386
+ responseField: "licenses";
387
387
  queryId?: string | undefined;
388
388
  localQueryId?: string | undefined;
389
389
  };
@@ -260,29 +260,14 @@ exports.DefaultMetadataStandardSearchQuestion = exports.MetadataStandardSearchQu
260
260
  graphQL: exports.DefaultMetadataStandardGraphQLQuery,
261
261
  });
262
262
  exports.licenseQuery = '' +
263
- 'query Licenses($term: String, $paginationOptions: PaginationOptions){ ' +
264
- 'license(term: $term, paginationOptions: $paginationOptions) { ' +
265
- 'totalCount ' +
266
- 'currentOffset ' +
267
- 'limit ' +
268
- 'hasNextPage ' +
269
- 'hasPreviousPage ' +
270
- 'availableSortFields ' +
271
- 'items { ' +
263
+ 'query Licenses{ ' +
264
+ 'licenses { ' +
272
265
  'id ' +
273
266
  'name ' +
274
267
  'uri ' +
275
268
  'description ' +
276
269
  '} ' +
277
- '} ' +
278
270
  '}';
279
- const DefaultLicenseSearchTermVariable = GraphQLVariable.parse({
280
- name: 'term',
281
- type: 'string',
282
- label: 'Search for a license',
283
- minLength: 3,
284
- labelTranslationKey: 'LicenseSearch.term'
285
- });
286
271
  const DefaultLicenseNameDisplayField = GraphQLDisplayField.parse({
287
272
  propertyName: 'name',
288
273
  label: 'Name',
@@ -298,14 +283,11 @@ const DefaultLicenseRecommendedDisplayField = GraphQLDisplayField.parse({
298
283
  label: 'Recommended',
299
284
  labelTranslationKey: 'LicenseSearch.recommended'
300
285
  });
301
- exports.LicenseGraphQLQuery = zod_1.z.object(Object.assign(Object.assign({}, GraphQLQuery.shape), { query: zod_1.z.literal(exports.licenseQuery), queryId: zod_1.z.string().default('useLicensesQuery').optional(), variables: zod_1.z.array(GraphQLVariable), answerField: zod_1.z.literal('uri'), displayFields: zod_1.z.array(GraphQLDisplayField), responseField: zod_1.z.literal("licenses.items") }));
286
+ exports.LicenseGraphQLQuery = zod_1.z.object(Object.assign(Object.assign({}, GraphQLQuery.shape), { query: zod_1.z.literal(exports.licenseQuery), queryId: zod_1.z.string().default('useLicensesQuery').optional(), variables: zod_1.z.array(GraphQLVariable), answerField: zod_1.z.literal('uri'), displayFields: zod_1.z.array(GraphQLDisplayField), responseField: zod_1.z.literal("licenses") }));
302
287
  exports.DefaultLicenseGraphQLQuery = exports.LicenseGraphQLQuery.parse({
303
288
  query: exports.licenseQuery,
304
- variables: [
305
- DefaultLicenseSearchTermVariable,
306
- DefaultGraphQLPaginationVariables
307
- ],
308
- responseField: 'licenses.items',
289
+ variables: [],
290
+ responseField: 'licenses',
309
291
  answerField: 'uri',
310
292
  displayFields: [
311
293
  DefaultLicenseNameDisplayField,
@@ -177,7 +177,7 @@ export declare const AnyQuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
177
177
  label: z.ZodDefault<z.ZodString>;
178
178
  labelTranslationKey: z.ZodOptional<z.ZodString>;
179
179
  }, z.core.$strip>>;
180
- responseField: z.ZodLiteral<"licenses.items">;
180
+ responseField: z.ZodLiteral<"licenses">;
181
181
  localQueryId: z.ZodOptional<z.ZodString>;
182
182
  }, z.core.$strip>;
183
183
  attributes: z.ZodObject<{
@@ -632,7 +632,7 @@ export declare const AnyQuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
632
632
  label: z.ZodDefault<z.ZodString>;
633
633
  labelTranslationKey: z.ZodOptional<z.ZodString>;
634
634
  }, z.core.$strip>>;
635
- responseField: z.ZodLiteral<"licenses.items">;
635
+ responseField: z.ZodLiteral<"licenses">;
636
636
  localQueryId: z.ZodOptional<z.ZodString>;
637
637
  }, z.core.$strip>;
638
638
  attributes: z.ZodObject<{
@@ -880,7 +880,7 @@ export declare const AnyQuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
880
880
  label: z.ZodDefault<z.ZodString>;
881
881
  labelTranslationKey: z.ZodOptional<z.ZodString>;
882
882
  }, z.core.$strip>>;
883
- responseField: z.ZodLiteral<"licenses.items">;
883
+ responseField: z.ZodLiteral<"licenses">;
884
884
  localQueryId: z.ZodOptional<z.ZodString>;
885
885
  }, z.core.$strip>;
886
886
  attributes: z.ZodObject<{
@@ -163,7 +163,7 @@ export declare const AnyTableColumnQuestionSchema: z.ZodDiscriminatedUnion<[z.Zo
163
163
  label: z.ZodDefault<z.ZodString>;
164
164
  labelTranslationKey: z.ZodOptional<z.ZodString>;
165
165
  }, z.core.$strip>>;
166
- responseField: z.ZodLiteral<"licenses.items">;
166
+ responseField: z.ZodLiteral<"licenses">;
167
167
  localQueryId: z.ZodOptional<z.ZodString>;
168
168
  }, z.core.$strip>;
169
169
  attributes: z.ZodObject<{
@@ -539,7 +539,7 @@ export declare const TableColumnSchema: z.ZodObject<{
539
539
  label: z.ZodDefault<z.ZodString>;
540
540
  labelTranslationKey: z.ZodOptional<z.ZodString>;
541
541
  }, z.core.$strip>>;
542
- responseField: z.ZodLiteral<"licenses.items">;
542
+ responseField: z.ZodLiteral<"licenses">;
543
543
  localQueryId: z.ZodOptional<z.ZodString>;
544
544
  }, z.core.$strip>;
545
545
  attributes: z.ZodObject<{
@@ -1107,7 +1107,7 @@ export declare const DefaultTableColumn: {
1107
1107
  label: string;
1108
1108
  labelTranslationKey?: string | undefined;
1109
1109
  }[];
1110
- responseField: "licenses.items";
1110
+ responseField: "licenses";
1111
1111
  queryId?: string | undefined;
1112
1112
  localQueryId?: string | undefined;
1113
1113
  };
@@ -1295,7 +1295,7 @@ export declare const TableQuestionSchema: z.ZodObject<{
1295
1295
  label: z.ZodDefault<z.ZodString>;
1296
1296
  labelTranslationKey: z.ZodOptional<z.ZodString>;
1297
1297
  }, z.core.$strip>>;
1298
- responseField: z.ZodLiteral<"licenses.items">;
1298
+ responseField: z.ZodLiteral<"licenses">;
1299
1299
  localQueryId: z.ZodOptional<z.ZodString>;
1300
1300
  }, z.core.$strip>;
1301
1301
  attributes: z.ZodObject<{
@@ -1881,7 +1881,7 @@ export declare const DefaultTableQuestion: {
1881
1881
  label: string;
1882
1882
  labelTranslationKey?: string | undefined;
1883
1883
  }[];
1884
- responseField: "licenses.items";
1884
+ responseField: "licenses";
1885
1885
  queryId?: string | undefined;
1886
1886
  localQueryId?: string | undefined;
1887
1887
  };
@@ -2277,7 +2277,7 @@ declare const AnyResearchOutputColumnSchema: z.ZodUnion<readonly [z.ZodObject<{
2277
2277
  label: z.ZodDefault<z.ZodString>;
2278
2278
  labelTranslationKey: z.ZodOptional<z.ZodString>;
2279
2279
  }, z.core.$strip>>;
2280
- responseField: z.ZodLiteral<"licenses.items">;
2280
+ responseField: z.ZodLiteral<"licenses">;
2281
2281
  localQueryId: z.ZodOptional<z.ZodString>;
2282
2282
  }, z.core.$strip>;
2283
2283
  attributes: z.ZodObject<{
@@ -2611,7 +2611,7 @@ export declare const ResearchOutputTableQuestionSchema: z.ZodObject<{
2611
2611
  label: z.ZodDefault<z.ZodString>;
2612
2612
  labelTranslationKey: z.ZodOptional<z.ZodString>;
2613
2613
  }, z.core.$strip>>;
2614
- responseField: z.ZodLiteral<"licenses.items">;
2614
+ responseField: z.ZodLiteral<"licenses">;
2615
2615
  localQueryId: z.ZodOptional<z.ZodString>;
2616
2616
  }, z.core.$strip>;
2617
2617
  attributes: z.ZodObject<{
@@ -2959,7 +2959,7 @@ export declare const DefaultResearchOutputTableQuestion: {
2959
2959
  label: string;
2960
2960
  labelTranslationKey?: string | undefined;
2961
2961
  }[];
2962
- responseField: "licenses.items";
2962
+ responseField: "licenses";
2963
2963
  queryId?: string | undefined;
2964
2964
  localQueryId?: string | undefined;
2965
2965
  };
@@ -683,11 +683,11 @@
683
683
  },
684
684
  "query": {
685
685
  "type": "string",
686
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
686
+ "const": "query Licenses{ licenses { id name uri description } }"
687
687
  },
688
688
  "responseField": {
689
689
  "type": "string",
690
- "const": "licenses.items"
690
+ "const": "licenses"
691
691
  },
692
692
  "variables": {
693
693
  "type": "array",
@@ -2721,11 +2721,11 @@
2721
2721
  },
2722
2722
  "query": {
2723
2723
  "type": "string",
2724
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
2724
+ "const": "query Licenses{ licenses { id name uri description } }"
2725
2725
  },
2726
2726
  "responseField": {
2727
2727
  "type": "string",
2728
- "const": "licenses.items"
2728
+ "const": "licenses"
2729
2729
  },
2730
2730
  "variables": {
2731
2731
  "type": "array",
@@ -3780,11 +3780,11 @@
3780
3780
  },
3781
3781
  "query": {
3782
3782
  "type": "string",
3783
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
3783
+ "const": "query Licenses{ licenses { id name uri description } }"
3784
3784
  },
3785
3785
  "responseField": {
3786
3786
  "type": "string",
3787
- "const": "licenses.items"
3787
+ "const": "licenses"
3788
3788
  },
3789
3789
  "variables": {
3790
3790
  "type": "array",
@@ -683,11 +683,11 @@
683
683
  },
684
684
  "query": {
685
685
  "type": "string",
686
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
686
+ "const": "query Licenses{ licenses { id name uri description } }"
687
687
  },
688
688
  "responseField": {
689
689
  "type": "string",
690
- "const": "licenses.items"
690
+ "const": "licenses"
691
691
  },
692
692
  "variables": {
693
693
  "type": "array",
@@ -72,11 +72,11 @@
72
72
  },
73
73
  "query": {
74
74
  "type": "string",
75
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
75
+ "const": "query Licenses{ licenses { id name uri description } }"
76
76
  },
77
77
  "responseField": {
78
78
  "type": "string",
79
- "const": "licenses.items"
79
+ "const": "licenses"
80
80
  },
81
81
  "variables": {
82
82
  "type": "array",
@@ -1329,11 +1329,11 @@
1329
1329
  },
1330
1330
  "query": {
1331
1331
  "type": "string",
1332
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
1332
+ "const": "query Licenses{ licenses { id name uri description } }"
1333
1333
  },
1334
1334
  "responseField": {
1335
1335
  "type": "string",
1336
- "const": "licenses.items"
1336
+ "const": "licenses"
1337
1337
  },
1338
1338
  "variables": {
1339
1339
  "type": "array",
@@ -767,11 +767,11 @@
767
767
  },
768
768
  "query": {
769
769
  "type": "string",
770
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
770
+ "const": "query Licenses{ licenses { id name uri description } }"
771
771
  },
772
772
  "responseField": {
773
773
  "type": "string",
774
- "const": "licenses.items"
774
+ "const": "licenses"
775
775
  },
776
776
  "variables": {
777
777
  "type": "array",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmptool/types",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "TypeScript types for DMPTool",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -56,4 +56,4 @@
56
56
  "typescript": "^5.2.2",
57
57
  "typescript-eslint": "^8.32.1"
58
58
  }
59
- }
59
+ }
@@ -683,11 +683,11 @@
683
683
  },
684
684
  "query": {
685
685
  "type": "string",
686
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
686
+ "const": "query Licenses{ licenses { id name uri description } }"
687
687
  },
688
688
  "responseField": {
689
689
  "type": "string",
690
- "const": "licenses.items"
690
+ "const": "licenses"
691
691
  },
692
692
  "variables": {
693
693
  "type": "array",
@@ -2721,11 +2721,11 @@
2721
2721
  },
2722
2722
  "query": {
2723
2723
  "type": "string",
2724
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
2724
+ "const": "query Licenses{ licenses { id name uri description } }"
2725
2725
  },
2726
2726
  "responseField": {
2727
2727
  "type": "string",
2728
- "const": "licenses.items"
2728
+ "const": "licenses"
2729
2729
  },
2730
2730
  "variables": {
2731
2731
  "type": "array",
@@ -3780,11 +3780,11 @@
3780
3780
  },
3781
3781
  "query": {
3782
3782
  "type": "string",
3783
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
3783
+ "const": "query Licenses{ licenses { id name uri description } }"
3784
3784
  },
3785
3785
  "responseField": {
3786
3786
  "type": "string",
3787
- "const": "licenses.items"
3787
+ "const": "licenses"
3788
3788
  },
3789
3789
  "variables": {
3790
3790
  "type": "array",
@@ -683,11 +683,11 @@
683
683
  },
684
684
  "query": {
685
685
  "type": "string",
686
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
686
+ "const": "query Licenses{ licenses { id name uri description } }"
687
687
  },
688
688
  "responseField": {
689
689
  "type": "string",
690
- "const": "licenses.items"
690
+ "const": "licenses"
691
691
  },
692
692
  "variables": {
693
693
  "type": "array",
@@ -72,11 +72,11 @@
72
72
  },
73
73
  "query": {
74
74
  "type": "string",
75
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
75
+ "const": "query Licenses{ licenses { id name uri description } }"
76
76
  },
77
77
  "responseField": {
78
78
  "type": "string",
79
- "const": "licenses.items"
79
+ "const": "licenses"
80
80
  },
81
81
  "variables": {
82
82
  "type": "array",
@@ -1329,11 +1329,11 @@
1329
1329
  },
1330
1330
  "query": {
1331
1331
  "type": "string",
1332
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
1332
+ "const": "query Licenses{ licenses { id name uri description } }"
1333
1333
  },
1334
1334
  "responseField": {
1335
1335
  "type": "string",
1336
- "const": "licenses.items"
1336
+ "const": "licenses"
1337
1337
  },
1338
1338
  "variables": {
1339
1339
  "type": "array",
@@ -767,11 +767,11 @@
767
767
  },
768
768
  "query": {
769
769
  "type": "string",
770
- "const": "query Licenses($term: String, $paginationOptions: PaginationOptions){ license(term: $term, paginationOptions: $paginationOptions) { totalCount currentOffset limit hasNextPage hasPreviousPage availableSortFields items { id name uri description } } }"
770
+ "const": "query Licenses{ licenses { id name uri description } }"
771
771
  },
772
772
  "responseField": {
773
773
  "type": "string",
774
- "const": "licenses.items"
774
+ "const": "licenses"
775
775
  },
776
776
  "variables": {
777
777
  "type": "array",