@eik/sink-gcs 2.0.13 → 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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [3.0.0](https://github.com/eik-lib/sink-gcs/compare/v2.0.13...v3.0.0) (2025-12-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * upgrade to v7 of google-cloud/storage ([#321](https://github.com/eik-lib/sink-gcs/issues/321)) ([2201055](https://github.com/eik-lib/sink-gcs/commit/2201055c99ef4dbf2458df85e927bda88fe4aef0))
7
+
8
+
9
+ ### BREAKING CHANGES
10
+
11
+ * Now uses v7 of google-cloud/storage under the hood. Refer to the [upstream changelog](https://github.com/googleapis/nodejs-storage/blob/HEAD/CHANGELOG.md?rgh-link-date=2025-12-15T15%3A27%3A20Z#700-2023-08-03) for a list of breaking changes.
12
+
1
13
  ## [2.0.13](https://github.com/eik-lib/sink-gcs/compare/v2.0.12...v2.0.13) (2025-12-12)
2
14
 
3
15
 
package/lib/main.js CHANGED
@@ -40,7 +40,10 @@ const SinkGCS = class SinkGCS extends Sink {
40
40
  this._writeTimeout = writeTimeout;
41
41
  this._writeGzip = writeGzip;
42
42
  this._rootPath = rootPath;
43
- this._storage = new Storage(storageOptions);
43
+ this._storage = new Storage({
44
+ ...storageOptions,
45
+ timeout: writeTimeout,
46
+ });
44
47
  this._bucket = this._storage.bucket(bucket);
45
48
  this._metrics = new Metrics();
46
49
  this._counter = this._metrics.counter({
@@ -58,6 +61,11 @@ const SinkGCS = class SinkGCS extends Sink {
58
61
  return this._metrics;
59
62
  }
60
63
 
64
+ /**
65
+ * @param {string} filePath
66
+ * @param {string} contentType
67
+ * @returns {Promise<import("node:stream").Writable>}
68
+ */
61
69
  write(filePath, contentType) {
62
70
  return new Promise((resolve, reject) => {
63
71
  const operation = "write";
@@ -86,7 +94,6 @@ const SinkGCS = class SinkGCS extends Sink {
86
94
  cacheControl: "public, max-age=31536000",
87
95
  contentType,
88
96
  },
89
- timeout: this._writeTimeout,
90
97
  gzip: this._writeGzip,
91
98
  });
92
99
 
@@ -104,6 +111,10 @@ const SinkGCS = class SinkGCS extends Sink {
104
111
  });
105
112
  }
106
113
 
114
+ /**
115
+ * @param {string} filePath
116
+ * @returns {Promise<import("@eik/common").ReadFile>}
117
+ */
107
118
  read(filePath) {
108
119
  return new Promise((resolve, reject) => {
109
120
  const operation = "read";
@@ -164,6 +175,10 @@ const SinkGCS = class SinkGCS extends Sink {
164
175
  });
165
176
  }
166
177
 
178
+ /**
179
+ * @param {string} filePath
180
+ * @returns {Promise<void>}
181
+ */
167
182
  delete(filePath) {
168
183
  return new Promise((resolve, reject) => {
169
184
  const operation = "delete";
@@ -201,6 +216,11 @@ const SinkGCS = class SinkGCS extends Sink {
201
216
  });
202
217
  }
203
218
 
219
+ /**
220
+ * Resolves if it exists, rejects if not.
221
+ * @param {string} filePath
222
+ * @returns {Promise<void>}
223
+ */
204
224
  exist(filePath) {
205
225
  return new Promise((resolve, reject) => {
206
226
  const operation = "exist";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eik/sink-gcs",
3
- "version": "2.0.13",
3
+ "version": "3.0.0",
4
4
  "description": "Sink for Google Cloud Storage",
5
5
  "main": "lib/main.js",
6
6
  "types": "./types/main.d.ts",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@eik/common": "5.1.11",
37
37
  "@eik/sink": "1.2.5",
38
- "@google-cloud/storage": "6.12.0",
38
+ "@google-cloud/storage": "7.18.0",
39
39
  "@metrics/client": "2.5.5"
40
40
  },
41
41
  "devDependencies": {
package/types/main.d.ts CHANGED
@@ -26,10 +26,28 @@ declare const SinkGCS: {
26
26
  _metrics: Metrics;
27
27
  _counter: Metrics.MetricsCounter;
28
28
  get metrics(): Metrics;
29
- write(filePath: any, contentType: any): Promise<any>;
30
- read(filePath: any): Promise<any>;
31
- delete(filePath: any): Promise<any>;
32
- exist(filePath: any): Promise<any>;
29
+ /**
30
+ * @param {string} filePath
31
+ * @param {string} contentType
32
+ * @returns {Promise<import("node:stream").Writable>}
33
+ */
34
+ write(filePath: string, contentType: string): Promise<import("node:stream").Writable>;
35
+ /**
36
+ * @param {string} filePath
37
+ * @returns {Promise<import("@eik/common").ReadFile>}
38
+ */
39
+ read(filePath: string): Promise<any>;
40
+ /**
41
+ * @param {string} filePath
42
+ * @returns {Promise<void>}
43
+ */
44
+ delete(filePath: string): Promise<void>;
45
+ /**
46
+ * Resolves if it exists, rejects if not.
47
+ * @param {string} filePath
48
+ * @returns {Promise<void>}
49
+ */
50
+ exist(filePath: string): Promise<void>;
33
51
  get [Symbol.toStringTag](): string;
34
52
  };
35
53
  validateFilePath(filePath: string): string;