@dmptool/types 2.2.1 → 2.3.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.
@@ -138,46 +138,55 @@ const questions_1 = require("../../questions");
138
138
  columns: [
139
139
  {
140
140
  type: 'text',
141
+ commonStandardId: 'title',
141
142
  answer: 'This is a test',
142
143
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
143
144
  },
144
145
  {
145
146
  type: 'textArea',
147
+ commonStandardId: 'description',
146
148
  answer: 'This is a longer text answer',
147
149
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
148
150
  },
149
151
  {
150
152
  type: 'selectBox',
153
+ commonStandardId: 'type',
151
154
  answer: 'dataset',
152
155
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
153
156
  },
154
157
  {
155
158
  type: 'checkBoxes',
159
+ commonStandardId: 'data_flags',
156
160
  answer: ['sensitive'],
157
161
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
158
162
  },
159
163
  {
160
164
  type: 'selectBox',
165
+ commonStandardId: 'data_access',
161
166
  answer: 'open',
162
167
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
163
168
  },
164
169
  {
165
170
  type: 'date',
171
+ commonStandardId: 'issued',
166
172
  answer: '2025-11-13',
167
173
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
168
174
  },
169
175
  {
170
176
  type: 'numberWithContext',
177
+ commonStandardId: 'byte_size',
171
178
  answer: { value: 12345, context: 'gb' },
172
179
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
173
180
  },
174
181
  {
175
182
  type: 'repositorySearch',
183
+ commonStandardId: 'host',
176
184
  answer: [{ repositoryId: 'repo1', repositoryName: 'Repository One' }],
177
185
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
178
186
  },
179
187
  {
180
188
  type: 'metadataStandardSearch',
189
+ commonStandardId: 'metadata',
181
190
  answer: [
182
191
  { metadataStandardId: 'standard1', metadataStandardName: 'Standard One' },
183
192
  { metadataStandardId: 'standard2', metadataStandardName: 'Standard Two' }
@@ -186,6 +195,7 @@ const questions_1 = require("../../questions");
186
195
  },
187
196
  {
188
197
  type: 'licenseSearch',
198
+ commonStandardId: 'license_ref',
189
199
  answer: [{ licenseId: 'license1', licenseName: 'License One' }],
190
200
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
191
201
  }
@@ -196,20 +206,23 @@ const questions_1 = require("../../questions");
196
206
  (0, globals_1.expect)(() => tableAnswers_1.ResearchOutputTableAnswerSchema.parse(validData)).not.toThrow();
197
207
  const invalidData = {
198
208
  type: 'researchOutputTable',
199
- answer: {
200
- columns: [
201
- {
202
- type: 'text',
203
- answer: 12345,
204
- meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
205
- },
206
- {
207
- type: 'selectBox',
208
- answer: 'dataset',
209
- meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
210
- }
211
- ],
212
- },
209
+ columnHeadings: ['Title', 'Output Type'],
210
+ answer: [{
211
+ columns: [
212
+ {
213
+ type: 'text',
214
+ commonStandardId: 'title',
215
+ answer: 12345,
216
+ meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
217
+ },
218
+ {
219
+ type: 'selectBox',
220
+ commonStandardId: 'type',
221
+ answer: 'dataset',
222
+ meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
223
+ }
224
+ ],
225
+ }],
213
226
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION }
214
227
  };
215
228
  (0, globals_1.expect)(() => tableAnswers_1.ResearchOutputTableAnswerSchema.parse(invalidData)).toThrow();
@@ -205,11 +205,13 @@ describe('Get question answer defaultJSON', () => {
205
205
  columns: [
206
206
  {
207
207
  type: "text",
208
+ commonStandardId: 'title',
208
209
  answer: "",
209
210
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION },
210
211
  },
211
212
  {
212
213
  type: "selectBox",
214
+ commonStandardId: 'type',
213
215
  answer: "",
214
216
  meta: { schemaVersion: questions_1.CURRENT_SCHEMA_VERSION },
215
217
  }
@@ -129,6 +129,108 @@ export declare const AnyAnswerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
129
129
  schemaVersion: z.ZodDefault<z.ZodString>;
130
130
  }, z.core.$strip>;
131
131
  comment: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ type: z.ZodLiteral<"researchOutputTable">;
134
+ columnHeadings: z.ZodDefault<z.ZodArray<z.ZodString>>;
135
+ answer: z.ZodArray<z.ZodObject<{
136
+ columns: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
137
+ commonStandardId: z.ZodOptional<z.ZodString>;
138
+ type: z.ZodLiteral<"checkBoxes">;
139
+ answer: z.ZodDefault<z.ZodArray<z.ZodString>>;
140
+ meta: z.ZodObject<{
141
+ schemaVersion: z.ZodDefault<z.ZodString>;
142
+ }, z.core.$strip>;
143
+ comment: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ commonStandardId: z.ZodOptional<z.ZodString>;
146
+ type: z.ZodLiteral<"date">;
147
+ answer: z.ZodDefault<z.ZodString>;
148
+ meta: z.ZodObject<{
149
+ schemaVersion: z.ZodDefault<z.ZodString>;
150
+ }, z.core.$strip>;
151
+ comment: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ commonStandardId: z.ZodOptional<z.ZodString>;
154
+ type: z.ZodLiteral<"licenseSearch">;
155
+ answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
156
+ licenseId: z.ZodDefault<z.ZodString>;
157
+ licenseName: z.ZodDefault<z.ZodString>;
158
+ }, z.core.$strip>>>;
159
+ meta: z.ZodObject<{
160
+ schemaVersion: z.ZodDefault<z.ZodString>;
161
+ }, z.core.$strip>;
162
+ comment: z.ZodOptional<z.ZodString>;
163
+ }, z.core.$strip>, z.ZodObject<{
164
+ commonStandardId: z.ZodOptional<z.ZodString>;
165
+ type: z.ZodLiteral<"metadataStandardSearch">;
166
+ answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
167
+ metadataStandardId: z.ZodDefault<z.ZodString>;
168
+ metadataStandardName: z.ZodDefault<z.ZodString>;
169
+ }, z.core.$strip>>>;
170
+ meta: z.ZodObject<{
171
+ schemaVersion: z.ZodDefault<z.ZodString>;
172
+ }, z.core.$strip>;
173
+ comment: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ commonStandardId: z.ZodOptional<z.ZodString>;
176
+ type: z.ZodLiteral<"numberWithContext">;
177
+ answer: z.ZodObject<{
178
+ value: z.ZodDefault<z.ZodNumber>;
179
+ context: z.ZodDefault<z.ZodString>;
180
+ }, z.core.$strip>;
181
+ meta: z.ZodObject<{
182
+ schemaVersion: z.ZodDefault<z.ZodString>;
183
+ }, z.core.$strip>;
184
+ comment: z.ZodOptional<z.ZodString>;
185
+ }, z.core.$strip>, z.ZodObject<{
186
+ commonStandardId: z.ZodOptional<z.ZodString>;
187
+ type: z.ZodLiteral<"radioButtons">;
188
+ answer: z.ZodDefault<z.ZodString>;
189
+ meta: z.ZodObject<{
190
+ schemaVersion: z.ZodDefault<z.ZodString>;
191
+ }, z.core.$strip>;
192
+ comment: z.ZodOptional<z.ZodString>;
193
+ }, z.core.$strip>, z.ZodObject<{
194
+ commonStandardId: z.ZodOptional<z.ZodString>;
195
+ type: z.ZodLiteral<"repositorySearch">;
196
+ answer: z.ZodDefault<z.ZodArray<z.ZodObject<{
197
+ repositoryId: z.ZodDefault<z.ZodString>;
198
+ repositoryName: z.ZodDefault<z.ZodString>;
199
+ }, z.core.$strip>>>;
200
+ meta: z.ZodObject<{
201
+ schemaVersion: z.ZodDefault<z.ZodString>;
202
+ }, z.core.$strip>;
203
+ comment: z.ZodOptional<z.ZodString>;
204
+ }, z.core.$strip>, z.ZodObject<{
205
+ commonStandardId: z.ZodOptional<z.ZodString>;
206
+ type: z.ZodLiteral<"selectBox">;
207
+ answer: z.ZodDefault<z.ZodString>;
208
+ meta: z.ZodObject<{
209
+ schemaVersion: z.ZodDefault<z.ZodString>;
210
+ }, z.core.$strip>;
211
+ comment: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ commonStandardId: z.ZodOptional<z.ZodString>;
214
+ type: z.ZodLiteral<"text">;
215
+ answer: z.ZodDefault<z.ZodString>;
216
+ meta: z.ZodObject<{
217
+ schemaVersion: z.ZodDefault<z.ZodString>;
218
+ }, z.core.$strip>;
219
+ comment: z.ZodOptional<z.ZodString>;
220
+ }, z.core.$strip>, z.ZodObject<{
221
+ commonStandardId: z.ZodOptional<z.ZodString>;
222
+ type: z.ZodLiteral<"textArea">;
223
+ answer: z.ZodDefault<z.ZodString>;
224
+ meta: z.ZodObject<{
225
+ schemaVersion: z.ZodDefault<z.ZodString>;
226
+ }, z.core.$strip>;
227
+ comment: z.ZodOptional<z.ZodString>;
228
+ }, z.core.$strip>], "type">>;
229
+ }, z.core.$strip>>;
230
+ meta: z.ZodObject<{
231
+ schemaVersion: z.ZodDefault<z.ZodString>;
232
+ }, z.core.$strip>;
233
+ comment: z.ZodOptional<z.ZodString>;
132
234
  }, z.core.$strip>, z.ZodObject<{
133
235
  type: z.ZodLiteral<"selectBox">;
134
236
  answer: z.ZodDefault<z.ZodString>;
@@ -46,6 +46,7 @@ exports.AnyAnswerSchema = zod_1.z.discriminatedUnion('type', [
46
46
  numberAnswers_1.NumberRangeAnswerSchema,
47
47
  optionBasedAnswers_1.RadioButtonsAnswerSchema,
48
48
  graphQLAnswers_1.RepositorySearchAnswerSchema,
49
+ tableAnswers_1.ResearchOutputTableAnswerSchema,
49
50
  optionBasedAnswers_1.SelectBoxAnswerSchema,
50
51
  tableAnswers_1.TableAnswerSchema,
51
52
  textAnswers_1.TextAnswerSchema,