zenodo 1.0.2 → 3.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 (89) hide show
  1. package/README.md +60 -0
  2. package/lib/Zenodo.d.ts +91 -0
  3. package/lib/Zenodo.d.ts.map +1 -0
  4. package/lib/Zenodo.js +186 -0
  5. package/lib/Zenodo.js.map +1 -0
  6. package/lib/ZenodoAuthenticationStates.d.ts +21 -0
  7. package/lib/ZenodoAuthenticationStates.d.ts.map +1 -0
  8. package/lib/ZenodoAuthenticationStates.js +20 -0
  9. package/lib/ZenodoAuthenticationStates.js.map +1 -0
  10. package/lib/ZenodoFile.d.ts +9 -0
  11. package/lib/ZenodoFile.d.ts.map +1 -0
  12. package/lib/ZenodoFile.js +22 -0
  13. package/lib/ZenodoFile.js.map +1 -0
  14. package/lib/depositions/Deposition.d.ts +98 -0
  15. package/lib/depositions/Deposition.d.ts.map +1 -0
  16. package/lib/depositions/Deposition.js +224 -0
  17. package/lib/depositions/Deposition.js.map +1 -0
  18. package/lib/depositions/ListDepositionsOptions.d.ts +34 -0
  19. package/lib/depositions/ListDepositionsOptions.d.ts.map +1 -0
  20. package/lib/depositions/ListDepositionsOptions.js +2 -0
  21. package/lib/depositions/ListDepositionsOptions.js.map +1 -0
  22. package/lib/depositions/Record.d.ts +10 -0
  23. package/lib/depositions/Record.d.ts.map +1 -0
  24. package/lib/depositions/Record.js +19 -0
  25. package/lib/depositions/Record.js.map +1 -0
  26. package/lib/fetchZenodo.d.ts +55 -0
  27. package/lib/fetchZenodo.d.ts.map +1 -0
  28. package/lib/fetchZenodo.js +233 -0
  29. package/lib/fetchZenodo.js.map +1 -0
  30. package/lib/index.d.ts +4 -0
  31. package/lib/index.d.ts.map +1 -0
  32. package/lib/index.js +4 -0
  33. package/lib/index.js.map +1 -0
  34. package/lib/responseStatuses.d.ts +8 -0
  35. package/lib/responseStatuses.d.ts.map +1 -0
  36. package/lib/responseStatuses.js +68 -0
  37. package/lib/responseStatuses.js.map +1 -0
  38. package/lib/utilities/ZenodoDepositionSchema.d.ts +473 -0
  39. package/lib/utilities/ZenodoDepositionSchema.d.ts.map +1 -0
  40. package/lib/utilities/ZenodoDepositionSchema.js +80 -0
  41. package/lib/utilities/ZenodoDepositionSchema.js.map +1 -0
  42. package/lib/utilities/ZenodoFileSchema.d.ts +39 -0
  43. package/lib/utilities/ZenodoFileSchema.d.ts.map +1 -0
  44. package/lib/utilities/ZenodoFileSchema.js +37 -0
  45. package/lib/utilities/ZenodoFileSchema.js.map +1 -0
  46. package/lib/utilities/ZenodoMetadataSchema.d.ts +400 -0
  47. package/lib/utilities/ZenodoMetadataSchema.d.ts.map +1 -0
  48. package/lib/utilities/ZenodoMetadataSchema.js +602 -0
  49. package/lib/utilities/ZenodoMetadataSchema.js.map +1 -0
  50. package/lib/utilities/ZenodoRecordSchema.d.ts +544 -0
  51. package/lib/utilities/ZenodoRecordSchema.d.ts.map +1 -0
  52. package/lib/utilities/ZenodoRecordSchema.js +70 -0
  53. package/lib/utilities/ZenodoRecordSchema.js.map +1 -0
  54. package/lib/utilities/ZenodoReviewSchema.d.ts +112 -0
  55. package/lib/utilities/ZenodoReviewSchema.d.ts.map +1 -0
  56. package/lib/utilities/ZenodoReviewSchema.js +80 -0
  57. package/lib/utilities/ZenodoReviewSchema.js.map +1 -0
  58. package/lib/utilities/licensesEnum.d.ts +4 -0
  59. package/lib/utilities/licensesEnum.d.ts.map +1 -0
  60. package/lib/utilities/licensesEnum.js +449 -0
  61. package/lib/utilities/licensesEnum.js.map +1 -0
  62. package/lib/utilities/schemaValidation.d.ts +50 -0
  63. package/lib/utilities/schemaValidation.d.ts.map +1 -0
  64. package/lib/utilities/schemaValidation.js +124 -0
  65. package/lib/utilities/schemaValidation.js.map +1 -0
  66. package/lib/utilities/zipFiles.d.ts +9 -0
  67. package/lib/utilities/zipFiles.d.ts.map +1 -0
  68. package/lib/utilities/zipFiles.js +28 -0
  69. package/lib/utilities/zipFiles.js.map +1 -0
  70. package/package.json +41 -8
  71. package/src/Zenodo.ts +238 -0
  72. package/src/ZenodoAuthenticationStates.ts +22 -0
  73. package/src/ZenodoFile.ts +26 -0
  74. package/src/depositions/Deposition.ts +272 -0
  75. package/src/depositions/ListDepositionsOptions.ts +38 -0
  76. package/src/depositions/Record.ts +25 -0
  77. package/src/fetchZenodo.ts +439 -0
  78. package/src/index.ts +5 -0
  79. package/src/responseStatuses.ts +85 -0
  80. package/src/utilities/ZenodoDepositionSchema.ts +90 -0
  81. package/src/utilities/ZenodoFileSchema.ts +40 -0
  82. package/src/utilities/ZenodoMetadataSchema.ts +608 -0
  83. package/src/utilities/ZenodoRecordSchema.ts +75 -0
  84. package/src/utilities/ZenodoReviewSchema.ts +84 -0
  85. package/src/utilities/licensesEnum.ts +448 -0
  86. package/src/utilities/schemaValidation.ts +150 -0
  87. package/src/utilities/zipFiles.ts +36 -0
  88. package/History.md +0 -73
  89. package/src/index.js +0 -171
package/README.md CHANGED
@@ -1,2 +1,62 @@
1
1
  # zenodo
2
+
2
3
  Node.js library to access the Zenodo API
4
+
5
+ ## Zenodo API Documentation
6
+
7
+ https://developers.zenodo.org/
8
+
9
+ ## Testing the project
10
+
11
+ In order to test the project you will have to create a .env file that contains an API key to the sandbox.
12
+
13
+ https://developers.zenodo.org/#authentication
14
+
15
+ ## Usage
16
+
17
+ ```js
18
+ // by default we set the host to 'sandbox.zenodo.org' so that you can easily play around with this library without damage
19
+ const zenodo = new Zenodo({ accessToken, host: 'zenodo.org' });
20
+
21
+ // retrieve the list of all the depositions
22
+ const depositions = await zenodo.listDepositions();
23
+ for (const deposition of depoositions) {
24
+ console.log(deposition);
25
+ }
26
+
27
+ // create a new deposition
28
+ const deposition = zenodo.createDeposition({
29
+ upload_type: 'dataset',
30
+ description: 'test',
31
+ access_right: 'open',
32
+ creators: [
33
+ {
34
+ name: 'test',
35
+ },
36
+ ],
37
+ });
38
+ const firstDeposition = await zenodo.createDeposition(depositionMetadata);
39
+
40
+ const firstFile = new File(['Hello, world!'], 'example.txt', {
41
+ type: 'text/plain',
42
+ });
43
+ const newFile = await firstDeposition.createFile(firstFile);
44
+
45
+ const secondFile = new File(['Hello, world 2!'], 'example2.txt', {
46
+ type: 'text/plain',
47
+ });
48
+ const newFile2 = await firstDeposition.createFile(secondFile);
49
+
50
+ await firstDeposition.deleteFile(newFile.id);
51
+ await firstDeposition.deleteFile(newFile2.id);
52
+
53
+ // alternatively you can upload both files at once
54
+ await firstDeposition.createFiles([firstFile, secondFile]);
55
+
56
+ // you can also create a zip contains many files
57
+ await firstDeposition.createFilesAsZip([firstFile, secondFile], {
58
+ zipName: 'data.zip',
59
+ });
60
+ ```
61
+
62
+ ## Development
@@ -0,0 +1,91 @@
1
+ import type { Logger } from 'cheminfo-types';
2
+ import type { ZenodoAuthenticationStatesType } from './ZenodoAuthenticationStates.ts';
3
+ import { Deposition } from './depositions/Deposition.ts';
4
+ import type { ListDepositionsOptions } from './depositions/ListDepositionsOptions.ts';
5
+ import { Record } from './depositions/Record.ts';
6
+ import type { ZenodoMetadata } from './utilities/ZenodoMetadataSchema.ts';
7
+ import type { ZenodoReview } from './utilities/ZenodoReviewSchema.ts';
8
+ interface ZenodoOptions {
9
+ accessToken: string;
10
+ host?: string;
11
+ logger?: Logger;
12
+ }
13
+ interface PublicRecordOptions {
14
+ isPublished?: boolean;
15
+ }
16
+ export declare class Zenodo {
17
+ host: string;
18
+ accessToken: string;
19
+ baseURL: string;
20
+ logger?: Logger;
21
+ authenticationState: ZenodoAuthenticationStatesType;
22
+ constructor(options: ZenodoOptions);
23
+ /**
24
+ * Create a new Zenodo instance.
25
+ * This method authenticates the user and initializes a new Zenodo instance.
26
+ * @param options - the options for creating a Zenodo instance
27
+ * @throws {Error} If the authentication fails
28
+ * @returns a new Zenodo instance
29
+ */
30
+ static create(options: ZenodoOptions): Promise<Zenodo>;
31
+ /**
32
+ * Verify the authentication state of the Zenodo instance.
33
+ * This method checks if the access token is valid by making a request to the Zenodo API.
34
+ * @returns true if authentication is successful, false otherwise.
35
+ */
36
+ verifyAuthentication(): Promise<boolean>;
37
+ /**
38
+ * List all depositions
39
+ * @param options - options for listing depositions
40
+ * @returns an array of deposition objects
41
+ */
42
+ listDepositions(options?: ListDepositionsOptions): Promise<Deposition[]>;
43
+ /**
44
+ * Create a new deposition
45
+ * @param metadata - the metadata for the new deposition
46
+ * @throws {Error} If the metadata is invalid or the request fails
47
+ * @description Creates a new deposition with the provided metadata.
48
+ * @returns The created deposition object
49
+ */
50
+ createDeposition(metadata: ZenodoMetadata): Promise<Deposition>;
51
+ /**
52
+ * Retrieve a deposition by its ID
53
+ * @param id - the deposition id
54
+ * @throws {Error} If the deposition does not exist or the ID is undefined
55
+ * @returns The retrieved deposition object
56
+ */
57
+ retrieveDeposition(id: number): Promise<Deposition>;
58
+ /**
59
+ * Retrieve a public deposition record
60
+ * @param id - the deposition id
61
+ * @param options - additional options for the request
62
+ * @throws {Error} If the deposition does not exist or the ID is undefined
63
+ * @returns The public deposition record
64
+ */
65
+ retrieveRecord(id: number, options?: PublicRecordOptions): Promise<Record>;
66
+ /**
67
+ * List files in a deposition
68
+ * @param depositionId - the deposition id to retrieve requests for
69
+ * @returns An object containing the total number of requests and the list of requests
70
+ */
71
+ retrieveRequests(depositionId?: number): Promise<{
72
+ hits: {
73
+ total: number;
74
+ hits: ZenodoReview[];
75
+ };
76
+ }>;
77
+ /**
78
+ * Retrieve all versions of a deposition
79
+ * @param id - the deposition id
80
+ * @returns unvalidated array of deposition versions
81
+ */
82
+ retrieveVersions(id: number): Promise<unknown[]>;
83
+ /**
84
+ * Deletes a deposition.
85
+ * @param id - the deposition id
86
+ * @throws {Error} If the deposition does not exist or the ID is undefined
87
+ */
88
+ deleteDeposition(id: number): Promise<void>;
89
+ }
90
+ export {};
91
+ //# sourceMappingURL=Zenodo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Zenodo.d.ts","sourceRoot":"","sources":["../src/Zenodo.ts"],"names":[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AClB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC;IAWlB;;;;OAIG;IACG,gBAAgB,CACpB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC;QAAE,IAAI,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,YAAY,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;IAgB7D;;;;OAIG;IACG,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IActD;;;;OAIG;IACG,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQlD"}
package/lib/Zenodo.js ADDED
@@ -0,0 +1,186 @@
1
+ import { ZenodoAuthenticationStates } from "./ZenodoAuthenticationStates.js";
2
+ import { Deposition } from "./depositions/Deposition.js";
3
+ import { Record } from "./depositions/Record.js";
4
+ import { fetchZenodo } from "./fetchZenodo.js";
5
+ export class Zenodo {
6
+ host;
7
+ accessToken;
8
+ baseURL;
9
+ logger;
10
+ authenticationState;
11
+ constructor(options) {
12
+ const { accessToken, host = 'sandbox.zenodo.org', logger } = options;
13
+ this.host = host;
14
+ this.baseURL = `https://${host}/api/`;
15
+ this.logger = logger;
16
+ this.accessToken = accessToken;
17
+ this.authenticationState = ZenodoAuthenticationStates.NOT_TRIED;
18
+ }
19
+ /**
20
+ * Create a new Zenodo instance.
21
+ * This method authenticates the user and initializes a new Zenodo instance.
22
+ * @param options - the options for creating a Zenodo instance
23
+ * @throws {Error} If the authentication fails
24
+ * @returns a new Zenodo instance
25
+ */
26
+ static async create(options) {
27
+ const zenodo = new Zenodo(options);
28
+ const response = await fetchZenodo(zenodo, {
29
+ route: 'deposit/depositions',
30
+ expectedStatus: 200,
31
+ });
32
+ if (!response.ok) {
33
+ throw new Error(`Failed to authenticate: ${response.statusText}`);
34
+ }
35
+ zenodo.logger?.info('Authenticated successfully');
36
+ zenodo.authenticationState = ZenodoAuthenticationStates.SUCCEEDED;
37
+ return zenodo;
38
+ }
39
+ /**
40
+ * Verify the authentication state of the Zenodo instance.
41
+ * This method checks if the access token is valid by making a request to the Zenodo API.
42
+ * @returns true if authentication is successful, false otherwise.
43
+ */
44
+ async verifyAuthentication() {
45
+ const url = `${this.baseURL}deposit/depositions`;
46
+ const headers = new Headers();
47
+ if (this.accessToken) {
48
+ headers.set('Authorization', `Bearer ${this.accessToken}`);
49
+ }
50
+ // can't use fetchZenodo to avoid circular dependency
51
+ try {
52
+ const response = await fetch(url, {
53
+ method: 'GET',
54
+ headers,
55
+ });
56
+ if (response.status === 200) {
57
+ this.authenticationState = ZenodoAuthenticationStates.SUCCEEDED;
58
+ this.logger?.info('Authentication verified successfully');
59
+ return true;
60
+ }
61
+ else {
62
+ this.authenticationState = ZenodoAuthenticationStates.FAILED;
63
+ this.logger?.warn(`Authentication failed with status ${response.status}`);
64
+ return false;
65
+ }
66
+ }
67
+ catch (error) {
68
+ this.authenticationState = ZenodoAuthenticationStates.FAILED;
69
+ this.logger?.error(`Authentication verification failed: ${String(error)}`);
70
+ return false;
71
+ }
72
+ }
73
+ /**
74
+ * List all depositions
75
+ * @param options - options for listing depositions
76
+ * @returns an array of deposition objects
77
+ */
78
+ async listDepositions(options = {}) {
79
+ // all the values must be string
80
+ const optionsWithStrings = Object.fromEntries(Object.entries(options).map(([key, value]) => {
81
+ if (key === 'allVersions') {
82
+ return ['all_versions', String(value)];
83
+ }
84
+ return [key, String(value)];
85
+ }));
86
+ const response = await fetchZenodo(this, {
87
+ route: 'deposit/depositions',
88
+ searchParams: optionsWithStrings,
89
+ });
90
+ const depositions = (await response.json());
91
+ this.logger?.info(`Listed ${depositions.length} depositions`);
92
+ return depositions.map((deposition) => new Deposition(this, deposition));
93
+ }
94
+ /**
95
+ * Create a new deposition
96
+ * @param metadata - the metadata for the new deposition
97
+ * @throws {Error} If the metadata is invalid or the request fails
98
+ * @description Creates a new deposition with the provided metadata.
99
+ * @returns The created deposition object
100
+ */
101
+ async createDeposition(metadata) {
102
+ const response = await fetchZenodo(this, {
103
+ route: 'deposit/depositions',
104
+ expectedStatus: 201,
105
+ method: 'POST',
106
+ body: JSON.stringify({ metadata }),
107
+ });
108
+ const deposition = new Deposition(this, await response.json());
109
+ this.logger?.info(`Created deposition ${deposition.value.id}`);
110
+ return deposition;
111
+ }
112
+ /**
113
+ * Retrieve a deposition by its ID
114
+ * @param id - the deposition id
115
+ * @throws {Error} If the deposition does not exist or the ID is undefined
116
+ * @returns The retrieved deposition object
117
+ */
118
+ async retrieveDeposition(id) {
119
+ const response = await fetchZenodo(this, {
120
+ route: `deposit/depositions/${id}`,
121
+ });
122
+ const deposition = await response.json();
123
+ this.logger?.info(`Retrieved deposition ${id}`);
124
+ return new Deposition(this, deposition);
125
+ }
126
+ /**
127
+ * Retrieve a public deposition record
128
+ * @param id - the deposition id
129
+ * @param options - additional options for the request
130
+ * @throws {Error} If the deposition does not exist or the ID is undefined
131
+ * @returns The public deposition record
132
+ */
133
+ async retrieveRecord(id, options = {}) {
134
+ const { isPublished = false } = options;
135
+ const route = isPublished ? `records/${id}` : `records/${id}/draft`;
136
+ const response = await fetchZenodo(this, {
137
+ route,
138
+ });
139
+ const deposition = await response.json();
140
+ this.logger?.info(`Retrieved public deposition ${id}`);
141
+ return new Record(this, deposition);
142
+ }
143
+ /**
144
+ * List files in a deposition
145
+ * @param depositionId - the deposition id to retrieve requests for
146
+ * @returns An object containing the total number of requests and the list of requests
147
+ */
148
+ async retrieveRequests(depositionId) {
149
+ const response = await fetchZenodo(this, {
150
+ route: `requests/`,
151
+ searchParams: {
152
+ q: String(depositionId),
153
+ },
154
+ });
155
+ const requests = (await response.json());
156
+ this.logger?.info(`Retrieved ${requests.hits.total} requests for deposition ${depositionId}`);
157
+ return requests;
158
+ }
159
+ /**
160
+ * Retrieve all versions of a deposition
161
+ * @param id - the deposition id
162
+ * @returns unvalidated array of deposition versions
163
+ */
164
+ async retrieveVersions(id) {
165
+ const response = await fetchZenodo(this, {
166
+ route: `records/${id}/versions`,
167
+ });
168
+ const versions = (await response.json());
169
+ this.logger?.info(`Retrieved ${versions?.hits.total} versions for deposition ${id}`);
170
+ return versions?.hits.hits || [];
171
+ }
172
+ /**
173
+ * Deletes a deposition.
174
+ * @param id - the deposition id
175
+ * @throws {Error} If the deposition does not exist or the ID is undefined
176
+ */
177
+ async deleteDeposition(id) {
178
+ await fetchZenodo(this, {
179
+ method: 'DELETE',
180
+ route: `deposit/depositions/${id}`,
181
+ expectedStatus: 204,
182
+ });
183
+ this.logger?.info(`Deleted deposition ${id}`);
184
+ }
185
+ }
186
+ //# sourceMappingURL=Zenodo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Zenodo.js","sourceRoot":"","sources":["../src/Zenodo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAc/C,MAAM,OAAO,MAAM;IACjB,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,OAAO,CAAS;IAChB,MAAM,CAAU;IAChB,mBAAmB,CAAiC;IAEpD,YAAY,OAAsB;QAChC,MAAM,EAAE,WAAW,EAAE,IAAI,GAAG,oBAAoB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QACrE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,WAAW,IAAI,OAAO,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,mBAAmB,GAAG,0BAA0B,CAAC,SAAS,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACH,MAAM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H,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Represents the different states of Zenodo authentication for retry logic.
3
+ *
4
+ * States:
5
+ * - NOT_TRIED: Authentication verification has not been attempted yet
6
+ * - FAILED: Authentication verification has failed
7
+ * - SUCCEEDED: Authentication verification has succeeded
8
+ *
9
+ * Usage in retry mechanism (src/services/zenodoService.ts):
10
+ * The Zenodo API sometimes returns 401 Unauthorized or 403 Forbidden due to temporary issues.
11
+ * - If SUCCEEDED: Access token is valid, safe to retry the request
12
+ * - If FAILED: Access token is invalid/expired, do not retry
13
+ * - If NOT_TRIED: Can attempt authentication once to determine next steps
14
+ */
15
+ export declare const ZenodoAuthenticationStates: {
16
+ readonly NOT_TRIED: 0;
17
+ readonly FAILED: 1;
18
+ readonly SUCCEEDED: 2;
19
+ };
20
+ export type ZenodoAuthenticationStatesType = (typeof ZenodoAuthenticationStates)[keyof typeof ZenodoAuthenticationStates];
21
+ //# sourceMappingURL=ZenodoAuthenticationStates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZenodoAuthenticationStates.d.ts","sourceRoot":"","sources":["../src/ZenodoAuthenticationStates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B;;;;CAI7B,CAAC;AAEX,MAAM,MAAM,8BAA8B,GACxC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Represents the different states of Zenodo authentication for retry logic.
3
+ *
4
+ * States:
5
+ * - NOT_TRIED: Authentication verification has not been attempted yet
6
+ * - FAILED: Authentication verification has failed
7
+ * - SUCCEEDED: Authentication verification has succeeded
8
+ *
9
+ * Usage in retry mechanism (src/services/zenodoService.ts):
10
+ * The Zenodo API sometimes returns 401 Unauthorized or 403 Forbidden due to temporary issues.
11
+ * - If SUCCEEDED: Access token is valid, safe to retry the request
12
+ * - If FAILED: Access token is invalid/expired, do not retry
13
+ * - If NOT_TRIED: Can attempt authentication once to determine next steps
14
+ */
15
+ export const ZenodoAuthenticationStates = {
16
+ NOT_TRIED: 0,
17
+ FAILED: 1,
18
+ SUCCEEDED: 2,
19
+ };
20
+ //# sourceMappingURL=ZenodoAuthenticationStates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZenodoAuthenticationStates.js","sourceRoot":"","sources":["../src/ZenodoAuthenticationStates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;CACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Zenodo } from './Zenodo.ts';
2
+ import type { ZenodoFileType } from './utilities/ZenodoFileSchema.ts';
3
+ export declare class ZenodoFile {
4
+ private zenodo;
5
+ value: ZenodoFileType;
6
+ constructor(zenodo: Zenodo, file: unknown);
7
+ getContentResponse(): Promise<Response>;
8
+ }
9
+ //# sourceMappingURL=ZenodoFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZenodoFile.d.ts","sourceRoot":"","sources":["../src/ZenodoFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAS;IAChB,KAAK,EAAE,cAAc,CAAC;gBAEjB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAKnC,kBAAkB;CAYzB"}
@@ -0,0 +1,22 @@
1
+ import { validateZenodoFile } from "./utilities/schemaValidation.js";
2
+ export class ZenodoFile {
3
+ zenodo;
4
+ value;
5
+ constructor(zenodo, file) {
6
+ this.value = validateZenodoFile(file);
7
+ this.zenodo = zenodo;
8
+ }
9
+ async getContentResponse() {
10
+ const link = this.value.links.download;
11
+ const response = await fetch(link, {
12
+ headers: {
13
+ Authorization: `Bearer ${this.zenodo.accessToken}`,
14
+ },
15
+ });
16
+ if (!response.ok) {
17
+ throw new Error(`Failed to fetch ${link}`);
18
+ }
19
+ return response;
20
+ }
21
+ }
22
+ //# sourceMappingURL=ZenodoFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZenodoFile.js","sourceRoot":"","sources":["../src/ZenodoFile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,OAAO,UAAU;IACb,MAAM,CAAS;IAChB,KAAK,CAAiB;IAE7B,YAAY,MAAc,EAAE,IAAa;QACvC,IAAI,CAAC,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;QACvC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE;YACjC,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;aACnD;SACF,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,98 @@
1
+ import type { Zenodo } from '../Zenodo.ts';
2
+ import { ZenodoFile } from '../ZenodoFile.ts';
3
+ import type { ZenodoDeposition } from '../utilities/ZenodoDepositionSchema.ts';
4
+ import type { ZenodoMetadata } from '../utilities/ZenodoMetadataSchema.ts';
5
+ import type { ZenodoReview } from '../utilities/ZenodoReviewSchema.ts';
6
+ export declare class Deposition {
7
+ private zenodo;
8
+ value: ZenodoDeposition;
9
+ constructor(zenodo: Zenodo, deposition: unknown);
10
+ /**
11
+ * This method creates a new file in the deposition. If the file is already it will first
12
+ * delete the existing file and then create a new one.
13
+ * @param file - the file to create in the deposition
14
+ * @returns the created file object
15
+ */
16
+ createFile(file: File): Promise<ZenodoFile>;
17
+ /**
18
+ * Creates multiple files in the deposition. It will attempt to create each file
19
+ * multiple times with delays in between until all files are successfully created or
20
+ * the maximum number of attempts is reached.
21
+ * @param filesAndNames - an array of File objects to be created in the deposition
22
+ * @returns an array of the created ZenodoFile objects
23
+ */
24
+ createFiles(filesAndNames: File[]): Promise<ZenodoFile[]>;
25
+ /**
26
+ * Creates a zip file from multiple files and uploads it to the deposition.
27
+ * @param filesAndNames - an array of File objects to be created in the deposition
28
+ * @param zipName - the name of the zip file to be created
29
+ * @returns an array of the created ZenodoFile objects
30
+ */
31
+ createFilesAsZip(filesAndNames: File[], zipName: string): Promise<ZenodoFile[]>;
32
+ /**
33
+ * List all files in the deposition
34
+ * @returns an array of ZenodoFile objects
35
+ */
36
+ listFiles(): Promise<ZenodoFile[]>;
37
+ /**
38
+ * Delete a file from the deposition
39
+ * @param id - the ID or the name of the file to delete
40
+ */
41
+ deleteFile(id: string): Promise<void>;
42
+ /**
43
+ * delete all files from the deposition
44
+ */
45
+ deleteAllFiles(): Promise<void>;
46
+ /**
47
+ * Retrieve a file from the deposition
48
+ * @param id - the ID or the name of the file to retrieve
49
+ * @returns the file object
50
+ */
51
+ retrieveFile(id: string): Promise<ZenodoFile>;
52
+ /**
53
+ * Update the metadata of the deposition
54
+ * @param metadata - the new metadata to update the deposition with
55
+ * @returns the updated deposition object
56
+ */
57
+ update(metadata: ZenodoMetadata): Promise<Deposition>;
58
+ /**
59
+ * Publish the deposition. This will make it publicly available.
60
+ * !!! Note that the deposition cannot be deleted after it is published.
61
+ * @returns the updated deposition object after publishing
62
+ */
63
+ publish(): Promise<Deposition>;
64
+ /**
65
+ * Creates a new version of a published deposition.
66
+ * This is useful for updating the deposition with new files or metadata.
67
+ * The new version will have a new ID and will not overwrite the existing deposition.
68
+ * @returns a new deposition object that is a new version of the current deposition
69
+ */
70
+ newVersion(): Promise<Deposition>;
71
+ /**
72
+ * Upload a file to the deposition
73
+ * @param file - the file to upload to the deposition
74
+ * @returns the created file object
75
+ */
76
+ uploadFile(file: File): Promise<ZenodoFile>;
77
+ /**
78
+ * Submits the deposition for review via browser.
79
+ * CORS request won't work from the other endpoint when using a browser.
80
+ * If a URL is provided, it will use that URL to submit the request.
81
+ * Otherwise, it will find the request for the current deposition and submit it.
82
+ * This is not the intended endpoint for submitting requests via browser.
83
+ * But the base endpoint is not CORS enabled.
84
+ * You can find the method with the right endpoint at:
85
+ * https://github.com/cheminfo/zenodo/blob/7fbf3e8bb44246b3465b94b68c21cd3f4fee3bf6/src/depositions/Deposition.ts#L286-L301
86
+ * @param url - optional URL to submit the request
87
+ * @returns The submitted Zenodo request object
88
+ */
89
+ submitForReview(url?: string): Promise<ZenodoReview>;
90
+ /**
91
+ * Adds the deposition to a community.
92
+ * This method adds the deposition to a community by creating a review request.
93
+ * @param communityId - the ID of the community to add the deposition to
94
+ * @returns the response from the Zenodo API
95
+ */
96
+ addToCommunity(communityId: string): Promise<unknown>;
97
+ }
98
+ //# sourceMappingURL=Deposition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Deposition.d.ts","sourceRoot":"","sources":["../../src/depositions/Deposition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC3E,O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