@rytass/storages-adapter-gcs 0.1.1 → 0.1.2
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/index.cjs.js +5 -0
- package/package.json +2 -2
- package/storages-adapter-gcs.d.ts +1 -0
- package/storages-adapter-gcs.js +5 -0
package/index.cjs.js
CHANGED
|
@@ -105,6 +105,11 @@ class StorageGCSService extends storages.Storage {
|
|
|
105
105
|
async remove(key) {
|
|
106
106
|
await this.bucket.file(key).delete();
|
|
107
107
|
}
|
|
108
|
+
async isExists(filename) {
|
|
109
|
+
const file = this.bucket.file(filename);
|
|
110
|
+
const [exists] = await file.exists();
|
|
111
|
+
return exists;
|
|
112
|
+
}
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
exports.StorageGCSService = StorageGCSService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/storages-adapter-gcs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Google Cloud Storage Adapter for @rytass/storages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gcp",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@google-cloud/storage": "^6.5.3",
|
|
25
|
-
"@rytass/storages": "^0.1.
|
|
25
|
+
"@rytass/storages": "^0.1.3",
|
|
26
26
|
"uuid": "^8.3.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -16,4 +16,5 @@ export declare class StorageGCSService extends Storage<GCSOptions> {
|
|
|
16
16
|
write(file: InputFile, options?: WriteFileOptions): Promise<StorageFile>;
|
|
17
17
|
batchWrite(files: InputFile[]): Promise<StorageFile[]>;
|
|
18
18
|
remove(key: string): Promise<void>;
|
|
19
|
+
isExists(filename: string): Promise<boolean>;
|
|
19
20
|
}
|
package/storages-adapter-gcs.js
CHANGED
|
@@ -101,6 +101,11 @@ class StorageGCSService extends Storage {
|
|
|
101
101
|
async remove(key) {
|
|
102
102
|
await this.bucket.file(key).delete();
|
|
103
103
|
}
|
|
104
|
+
async isExists(filename) {
|
|
105
|
+
const file = this.bucket.file(filename);
|
|
106
|
+
const [exists] = await file.exists();
|
|
107
|
+
return exists;
|
|
108
|
+
}
|
|
104
109
|
}
|
|
105
110
|
|
|
106
111
|
export { StorageGCSService };
|