zenodo 3.0.0 → 4.0.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.
Files changed (96) hide show
  1. package/lib/Zenodo.d.ts +18 -31
  2. package/lib/Zenodo.d.ts.map +1 -1
  3. package/lib/Zenodo.js +29 -44
  4. package/lib/Zenodo.js.map +1 -1
  5. package/lib/ZenodoAuthenticationStates.d.ts +6 -5
  6. package/lib/ZenodoAuthenticationStates.d.ts.map +1 -1
  7. package/lib/ZenodoAuthenticationStates.js +3 -5
  8. package/lib/ZenodoAuthenticationStates.js.map +1 -1
  9. package/lib/ZenodoFile.d.ts +26 -1
  10. package/lib/ZenodoFile.d.ts.map +1 -1
  11. package/lib/ZenodoFile.js +2 -3
  12. package/lib/ZenodoFile.js.map +1 -1
  13. package/lib/fetchZenodo.d.ts +2 -2
  14. package/lib/fetchZenodo.d.ts.map +1 -1
  15. package/lib/fetchZenodo.js +94 -11
  16. package/lib/fetchZenodo.js.map +1 -1
  17. package/lib/index.d.ts +0 -1
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +0 -1
  20. package/lib/index.js.map +1 -1
  21. package/lib/records/ListDepositionsOptions.d.ts.map +1 -0
  22. package/lib/records/ListDepositionsOptions.js.map +1 -0
  23. package/lib/records/Record.d.ts +34 -0
  24. package/lib/records/Record.d.ts.map +1 -0
  25. package/lib/records/Record.js +225 -0
  26. package/lib/records/Record.js.map +1 -0
  27. package/lib/records/RecordType.d.ts +513 -0
  28. package/lib/records/RecordType.d.ts.map +1 -0
  29. package/lib/records/RecordType.js +2 -0
  30. package/lib/records/RecordType.js.map +1 -0
  31. package/lib/records/RequestType.d.ts +37 -0
  32. package/lib/records/RequestType.d.ts.map +1 -0
  33. package/lib/records/RequestType.js +2 -0
  34. package/lib/records/RequestType.js.map +1 -0
  35. package/lib/utilities/zipFiles.js +1 -1
  36. package/lib/utilities/zipFiles.js.map +1 -1
  37. package/package.json +5 -5
  38. package/src/Zenodo.ts +41 -57
  39. package/src/ZenodoAuthenticationStates.ts +6 -5
  40. package/src/ZenodoFile.ts +24 -4
  41. package/src/fetchZenodo.ts +105 -18
  42. package/src/index.ts +0 -2
  43. package/src/records/Record.ts +298 -0
  44. package/src/records/RecordType.ts +479 -0
  45. package/src/records/RequestType.ts +37 -0
  46. package/src/utilities/zipFiles.ts +1 -1
  47. package/lib/depositions/Deposition.d.ts +0 -98
  48. package/lib/depositions/Deposition.d.ts.map +0 -1
  49. package/lib/depositions/Deposition.js +0 -224
  50. package/lib/depositions/Deposition.js.map +0 -1
  51. package/lib/depositions/ListDepositionsOptions.d.ts.map +0 -1
  52. package/lib/depositions/ListDepositionsOptions.js.map +0 -1
  53. package/lib/depositions/Record.d.ts +0 -10
  54. package/lib/depositions/Record.d.ts.map +0 -1
  55. package/lib/depositions/Record.js +0 -19
  56. package/lib/depositions/Record.js.map +0 -1
  57. package/lib/utilities/ZenodoDepositionSchema.d.ts +0 -473
  58. package/lib/utilities/ZenodoDepositionSchema.d.ts.map +0 -1
  59. package/lib/utilities/ZenodoDepositionSchema.js +0 -80
  60. package/lib/utilities/ZenodoDepositionSchema.js.map +0 -1
  61. package/lib/utilities/ZenodoFileSchema.d.ts +0 -39
  62. package/lib/utilities/ZenodoFileSchema.d.ts.map +0 -1
  63. package/lib/utilities/ZenodoFileSchema.js +0 -37
  64. package/lib/utilities/ZenodoFileSchema.js.map +0 -1
  65. package/lib/utilities/ZenodoMetadataSchema.d.ts +0 -400
  66. package/lib/utilities/ZenodoMetadataSchema.d.ts.map +0 -1
  67. package/lib/utilities/ZenodoMetadataSchema.js +0 -602
  68. package/lib/utilities/ZenodoMetadataSchema.js.map +0 -1
  69. package/lib/utilities/ZenodoRecordSchema.d.ts +0 -544
  70. package/lib/utilities/ZenodoRecordSchema.d.ts.map +0 -1
  71. package/lib/utilities/ZenodoRecordSchema.js +0 -70
  72. package/lib/utilities/ZenodoRecordSchema.js.map +0 -1
  73. package/lib/utilities/ZenodoReviewSchema.d.ts +0 -112
  74. package/lib/utilities/ZenodoReviewSchema.d.ts.map +0 -1
  75. package/lib/utilities/ZenodoReviewSchema.js +0 -80
  76. package/lib/utilities/ZenodoReviewSchema.js.map +0 -1
  77. package/lib/utilities/licensesEnum.d.ts +0 -4
  78. package/lib/utilities/licensesEnum.d.ts.map +0 -1
  79. package/lib/utilities/licensesEnum.js +0 -449
  80. package/lib/utilities/licensesEnum.js.map +0 -1
  81. package/lib/utilities/schemaValidation.d.ts +0 -50
  82. package/lib/utilities/schemaValidation.d.ts.map +0 -1
  83. package/lib/utilities/schemaValidation.js +0 -124
  84. package/lib/utilities/schemaValidation.js.map +0 -1
  85. package/src/depositions/Deposition.ts +0 -272
  86. package/src/depositions/Record.ts +0 -25
  87. package/src/utilities/ZenodoDepositionSchema.ts +0 -90
  88. package/src/utilities/ZenodoFileSchema.ts +0 -40
  89. package/src/utilities/ZenodoMetadataSchema.ts +0 -608
  90. package/src/utilities/ZenodoRecordSchema.ts +0 -75
  91. package/src/utilities/ZenodoReviewSchema.ts +0 -84
  92. package/src/utilities/licensesEnum.ts +0 -448
  93. package/src/utilities/schemaValidation.ts +0 -150
  94. /package/lib/{depositions → records}/ListDepositionsOptions.d.ts +0 -0
  95. /package/lib/{depositions → records}/ListDepositionsOptions.js +0 -0
  96. /package/src/{depositions → records}/ListDepositionsOptions.ts +0 -0
@@ -1,608 +0,0 @@
1
- import type { FromSchema } from 'json-schema-to-ts';
2
-
3
- import { licenseEnum } from './licensesEnum.ts';
4
-
5
- /**
6
- * The schema was taken from the Unofficial JSON schema for Zenodo upload metadata the 16th of June 2025.
7
- * https:// github.com/zenodraft/metadata-schema-zenodo
8
- */
9
- export const zenodoMetadataSchema = {
10
- $schema: 'http://json-schema.org/draft-07/schema',
11
- additionalProperties: true,
12
- allOf: [
13
- {
14
- if: {
15
- type: 'object',
16
- properties: {
17
- access_right: {
18
- const: 'embargoed',
19
- },
20
- },
21
- required: ['access_right'],
22
- },
23
- // eslint-disable-next-line unicorn/no-thenable
24
- then: {
25
- type: 'object',
26
- required: ['embargo_date', 'license'],
27
- },
28
- },
29
- ],
30
- definitions: {},
31
- properties: {
32
- access_conditions: {
33
- type: 'string',
34
- },
35
- access_right: {
36
- description:
37
- 'Open access uploads have considerably higher visibility on Zenodo.',
38
- enum: ['closed', 'embargoed', 'open', 'restricted'],
39
- type: 'string',
40
- },
41
- communities: {
42
- items: {
43
- additionalProperties: true,
44
- properties: {
45
- identifier: {
46
- type: 'string',
47
- },
48
- },
49
- required: [],
50
- type: 'object',
51
- },
52
- minItems: 0,
53
- type: 'array',
54
- uniqueItems: true,
55
- },
56
- conference_acronym: {
57
- type: 'string',
58
- },
59
- conference_dates: {
60
- type: 'string',
61
- },
62
- conference_place: {
63
- type: 'string',
64
- },
65
- conference_session: {
66
- type: 'string',
67
- },
68
- conference_session_part: {
69
- type: 'string',
70
- },
71
- conference_title: {
72
- type: 'string',
73
- },
74
- conference_url: {
75
- format: 'uri',
76
- type: 'string',
77
- },
78
- contributors: {
79
- items: {
80
- additionalProperties: false,
81
- properties: {
82
- affiliation: {
83
- minLength: 1,
84
- type: ['string', 'null'],
85
- },
86
- name: {
87
- description: 'Family name, given names',
88
- minLength: 1,
89
- type: 'string',
90
- },
91
- orcid: {
92
- description: 'ORCID identifier',
93
- examples: ['0000-0002-1825-0097'],
94
- pattern: '[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]{1}',
95
- type: 'string',
96
- },
97
- type: {
98
- enum: [
99
- 'ContactPerson',
100
- 'DataCollector',
101
- 'DataCurator',
102
- 'DataManager',
103
- 'Distributor',
104
- 'Editor',
105
- 'HostingInstitution',
106
- 'Other',
107
- 'Producer',
108
- 'ProjectLeader',
109
- 'ProjectManager',
110
- 'ProjectMember',
111
- 'RegistrationAgency',
112
- 'RegistrationAuthority',
113
- 'RelatedPerson',
114
- 'Researcher',
115
- 'ResearchGroup',
116
- 'RightsHolder',
117
- 'Sponsor',
118
- 'Supervisor',
119
- 'WorkPackageLeader',
120
- null,
121
- ],
122
- type: ['string', 'null'],
123
- },
124
- },
125
- required: ['name', 'type'],
126
- type: 'object',
127
- },
128
- minItems: 0,
129
- type: 'array',
130
- uniqueItems: true,
131
- },
132
- creators: {
133
- items: {
134
- additionalProperties: false,
135
- properties: {
136
- affiliation: {
137
- minLength: 1,
138
- type: ['string', 'null'],
139
- },
140
- name: {
141
- description: 'Family name, given names',
142
- minLength: 1,
143
- type: 'string',
144
- },
145
- orcid: {
146
- description: 'ORCID identifier',
147
- examples: ['0000-0002-1825-0097'],
148
- pattern: '[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]{1}',
149
- type: 'string',
150
- },
151
- },
152
- required: ['name'],
153
- type: 'object',
154
- },
155
- type: 'array',
156
- uniqueItems: true,
157
- minItems: 1,
158
- },
159
- description: {
160
- description: 'Description',
161
- type: 'string',
162
- },
163
- doi: {
164
- oneOf: [
165
- {
166
- examples: ['10.5281/zenodo.1003150'],
167
- pattern: String.raw`^10\.\d{4,9}(\.\d+)?/[A-Za-z0-9:/_;\-\.\(\)\[\]\\]+$`,
168
- type: 'string',
169
- },
170
- {
171
- const: '',
172
- },
173
- ],
174
- },
175
- embargo_date: {
176
- format: 'date',
177
- type: 'string',
178
- },
179
- grants: {
180
- items: {
181
- additionalProperties: true,
182
- examples: ['10.13039/501100000780::675191'],
183
- properties: {
184
- id: {
185
- type: 'string',
186
- },
187
- },
188
- required: [],
189
- type: 'object',
190
- },
191
- minItems: 0,
192
- type: 'array',
193
- uniqueItems: true,
194
- },
195
- image_type: {
196
- enum: ['diagram', 'drawing', 'figure', 'other', 'photo', 'plot'],
197
- type: 'string',
198
- },
199
- imprint_isbn: {
200
- type: 'string',
201
- },
202
- imprint_place: {
203
- type: 'string',
204
- },
205
- imprint_publisher: {
206
- type: 'string',
207
- },
208
- journal_issue: {
209
- type: 'string',
210
- },
211
- journal_pages: {
212
- type: 'string',
213
- },
214
- journal_title: {
215
- type: 'string',
216
- },
217
- journal_volume: {
218
- type: 'string',
219
- },
220
- keywords: {
221
- items: {
222
- type: 'string',
223
- },
224
- minItems: 0,
225
- type: 'array',
226
- uniqueItems: true,
227
- },
228
- language: {
229
- description: 'ISO 639 language identifier.',
230
- examples: ['ada', 'eng', 'bla'],
231
- pattern: '^[a-z]{2,3}$',
232
- type: 'string',
233
- },
234
- license: {
235
- anyOf: [
236
- licenseEnum,
237
- { type: 'string' },
238
- {
239
- type: 'object',
240
- properties: {
241
- id: {
242
- anyOf: [licenseEnum, { type: 'string' }],
243
- },
244
- },
245
- required: ['id'],
246
- additionalProperties: false,
247
- },
248
- ],
249
- },
250
- notes: {
251
- minLength: 0,
252
- type: 'string',
253
- },
254
- partof_pages: {
255
- type: 'string',
256
- },
257
- partof_title: {
258
- type: 'string',
259
- },
260
- publication_date: {
261
- description:
262
- 'Format: YYYY-MM-DD. In case your upload was already published elsewhere, please use the date of first publication.',
263
- examples: ['2013-05-08'],
264
- format: 'date',
265
- type: 'string',
266
- },
267
- publication_type: {
268
- enum: [
269
- 'annotationcollection',
270
- 'article',
271
- 'book',
272
- 'conferencepaper',
273
- 'datamanagementplan',
274
- 'deliverable',
275
- 'milestone',
276
- 'other',
277
- 'patent',
278
- 'preprint',
279
- 'proposal',
280
- 'report',
281
- 'section',
282
- 'softwaredocumentation',
283
- 'taxonomictreatment',
284
- 'technicalnote',
285
- 'thesis',
286
- 'workingpaper',
287
- ],
288
- type: 'string',
289
- },
290
- references: {
291
- items: {
292
- type: 'string',
293
- },
294
- minItems: 0,
295
- type: 'array',
296
- uniqueItems: true,
297
- },
298
- related_identifiers: {
299
- items: {
300
- additionalProperties: false,
301
- properties: {
302
- identifier: {
303
- type: 'string',
304
- },
305
- relation: {
306
- enum: [
307
- 'cites',
308
- 'compiles',
309
- 'continues',
310
- 'describes',
311
- 'documents',
312
- 'hasMetadata',
313
- 'hasPart',
314
- 'hasVersion',
315
- 'isAlternateIdentifier',
316
- 'isCitedBy',
317
- 'isCompiledBy',
318
- 'isContinuedBy',
319
- 'isDerivedFrom',
320
- 'isDescribedBy',
321
- 'isDocumentedBy',
322
- 'isIdenticalTo',
323
- 'isMetadataFor',
324
- 'isNewVersionOf',
325
- 'isObsoletedBy',
326
- 'isOriginalFormOf',
327
- 'isPartOf',
328
- 'isPreviousVersionOf',
329
- 'isPublishedIn',
330
- 'isReferencedBy',
331
- 'isRequiredBy',
332
- 'isReviewedBy',
333
- 'isSourceOf',
334
- 'isSupplementedBy',
335
- 'isSupplementTo',
336
- 'isVariantFormOf',
337
- 'isVersionOf',
338
- 'obsoletes',
339
- 'references',
340
- 'requires',
341
- 'reviews',
342
- ],
343
- type: 'string',
344
- },
345
- resource_type: {
346
- enum: [
347
- 'dataset',
348
- 'image-diagram',
349
- 'image-drawing',
350
- 'image-figure',
351
- 'image-other',
352
- 'image-photo',
353
- 'image-plot',
354
- 'lesson',
355
- 'other',
356
- 'physicalobject',
357
- 'poster',
358
- 'presentation',
359
- 'publication',
360
- 'publication-annotationcollection',
361
- 'publication-article',
362
- 'publication-book',
363
- 'publication-conferencepaper',
364
- 'publication-datamanagementplan',
365
- 'publication-deliverable',
366
- 'publication-milestone',
367
- 'publication-other',
368
- 'publication-patent',
369
- 'publication-preprint',
370
- 'publication-proposal',
371
- 'publication-report',
372
- 'publication-section',
373
- 'publication-softwaredocumentation',
374
- 'publication-taxonomictreatment',
375
- 'publication-technicalnote',
376
- 'publication-thesis',
377
- 'publication-workingpaper',
378
- 'software',
379
- 'video',
380
- ],
381
- type: 'string',
382
- },
383
- scheme: {
384
- enum: [
385
- 'ads',
386
- 'ark',
387
- 'arxiv',
388
- 'doi',
389
- 'ean13',
390
- 'handle',
391
- 'isbn',
392
- 'isni',
393
- 'issn',
394
- 'istc',
395
- 'lsid',
396
- 'orcid',
397
- 'pmid',
398
- 'purl',
399
- 'url',
400
- 'urn',
401
- 'other',
402
- ],
403
- type: 'string',
404
- },
405
- },
406
- required: ['identifier', 'relation'],
407
- type: 'object',
408
- },
409
- minItems: 0,
410
- type: 'array',
411
- uniqueItems: true,
412
- },
413
- resource_type: {
414
- properties: {
415
- type: {
416
- enum: [
417
- 'dataset',
418
- 'image-diagram',
419
- 'image-drawing',
420
- 'image-figure',
421
- 'image-other',
422
- 'image-photo',
423
- 'image-plot',
424
- 'lesson',
425
- 'other',
426
- 'physicalobject',
427
- 'poster',
428
- 'presentation',
429
- 'publication',
430
- 'publication-annotationcollection',
431
- 'publication-article',
432
- 'publication-book',
433
- 'publication-conferencepaper',
434
- 'publication-datamanagementplan',
435
- 'publication-deliverable',
436
- 'publication-milestone',
437
- 'publication-other',
438
- 'publication-patent',
439
- 'publication-preprint',
440
- 'publication-proposal',
441
- 'publication-report',
442
- 'publication-section',
443
- 'publication-softwaredocumentation',
444
- 'publication-taxonomictreatment',
445
- 'publication-technicalnote',
446
- 'publication-thesis',
447
- 'publication-workingpaper',
448
- 'software',
449
- 'video',
450
- ],
451
- type: 'string',
452
- },
453
- title: {
454
- type: 'string',
455
- },
456
- },
457
- type: 'object',
458
- },
459
- relations: {
460
- additionalProperties: false,
461
- properties: {
462
- version: {
463
- type: 'array',
464
- items: {
465
- type: 'object',
466
- properties: {
467
- index: {
468
- type: 'integer',
469
- minimum: 0,
470
- },
471
- is_last: {
472
- type: 'boolean',
473
- },
474
- parent: {
475
- type: 'object',
476
- properties: {
477
- pid_type: {
478
- type: 'string',
479
- },
480
- pid_value: {
481
- type: 'string',
482
- },
483
- },
484
- },
485
- },
486
- },
487
- },
488
- },
489
- type: 'object',
490
- },
491
- subjects: {
492
- items: {
493
- additionalProperties: false,
494
- properties: {
495
- identifier: {
496
- type: 'string',
497
- },
498
- scheme: {
499
- enum: [
500
- 'ads',
501
- 'ark',
502
- 'arxiv',
503
- 'ascl',
504
- 'bioproject',
505
- 'biosample',
506
- 'doi',
507
- 'ean13',
508
- 'ean8',
509
- 'ensembl',
510
- 'genome',
511
- 'gnd',
512
- 'hal',
513
- 'handle',
514
- 'isbn',
515
- 'isni',
516
- 'issn',
517
- 'istc',
518
- 'lsid',
519
- 'orcid',
520
- 'pmcid',
521
- 'pmid',
522
- 'purl',
523
- 'refseq',
524
- 'sra',
525
- 'swh',
526
- 'uniprot',
527
- 'url',
528
- 'urn',
529
- ],
530
- type: 'string',
531
- },
532
- term: {
533
- type: 'string',
534
- },
535
- },
536
- required: ['identifier', 'term'],
537
- type: 'object',
538
- },
539
- minItems: 0,
540
- type: 'array',
541
- uniqueItems: true,
542
- },
543
- thesis_supervisors: {
544
- items: {
545
- additionalProperties: false,
546
- properties: {
547
- affiliation: {
548
- minLength: 1,
549
- type: ['string', 'null'],
550
- },
551
- name: {
552
- description: 'Family name, given names',
553
- minLength: 1,
554
- type: 'string',
555
- },
556
- orcid: {
557
- description: 'ORCID identifier',
558
- examples: ['0000-0002-1825-0097'],
559
- pattern: '[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]{1}',
560
- type: 'string',
561
- },
562
- },
563
- required: ['name'],
564
- type: 'object',
565
- },
566
- minItems: 0,
567
- type: 'array',
568
- uniqueItems: true,
569
- },
570
- thesis_university: {
571
- type: 'string',
572
- },
573
- title: {
574
- type: 'string',
575
- },
576
- upload_type: {
577
- enum: [
578
- 'dataset',
579
- 'image',
580
- 'lesson',
581
- 'other',
582
- 'physicalobject',
583
- 'poster',
584
- 'presentation',
585
- 'publication',
586
- 'software',
587
- 'video',
588
- ],
589
- type: 'string',
590
- },
591
- version: {
592
- type: 'string',
593
- },
594
- prereserve_doi: {
595
- type: 'object',
596
- required: ['doi', 'recid'],
597
- properties: {
598
- doi: { type: 'string' },
599
- recid: { type: 'integer' },
600
- },
601
- additionalProperties: false,
602
- },
603
- },
604
- required: [],
605
- type: 'object',
606
- } as const;
607
-
608
- export type ZenodoMetadata = FromSchema<typeof zenodoMetadataSchema>;
@@ -1,75 +0,0 @@
1
- import type { FromSchema } from 'json-schema-to-ts';
2
-
3
- import { zenodoDepositionSchema } from './ZenodoDepositionSchema.ts';
4
-
5
- const modifiedDepositionSchema = {
6
- ...zenodoDepositionSchema,
7
- additionalProperties: true, // Change this to match the record schema
8
- properties: {
9
- ...zenodoDepositionSchema.properties,
10
- record_id: {
11
- type: 'integer',
12
- description: 'Record identifier. Present only for published depositions.',
13
- },
14
- },
15
- } as const;
16
-
17
- export const zenodoRecordSchema = {
18
- $schema: 'http://json-schema.org/draft-07/schema#',
19
- title: 'ZenodoRecord',
20
- allOf: [
21
- modifiedDepositionSchema,
22
- {
23
- type: 'object',
24
- required: [],
25
- properties: {
26
- recid: { type: 'string' },
27
- updated: { type: 'string', format: 'date-time' },
28
- revision: { type: 'number' },
29
- swh: {
30
- type: 'object',
31
- additionalProperties: true, // structure is not known
32
- },
33
- owners: {
34
- type: 'array',
35
- items: {
36
- type: 'object',
37
- properties: {
38
- id: { type: 'string' },
39
- },
40
- required: ['id'],
41
- additionalProperties: false,
42
- },
43
- },
44
- status: { type: 'string' },
45
- stats: {
46
- type: 'object',
47
- properties: {
48
- downloads: { type: 'number' },
49
- unique_downloads: { type: 'number' },
50
- views: { type: 'number' },
51
- unique_views: { type: 'number' },
52
- version_downloads: { type: 'number' },
53
- version_unique_downloads: { type: 'number' },
54
- version_views: { type: 'number' },
55
- version_unique_views: { type: 'number' },
56
- },
57
- required: [
58
- 'downloads',
59
- 'unique_downloads',
60
- 'views',
61
- 'unique_views',
62
- 'version_downloads',
63
- 'version_unique_downloads',
64
- 'version_views',
65
- 'version_unique_views',
66
- ],
67
- additionalProperties: false,
68
- },
69
- },
70
- additionalProperties: true,
71
- },
72
- ],
73
- } as const;
74
-
75
- export type ZenodoRecord = FromSchema<typeof zenodoRecordSchema>;