@storecraft/storage-google 1.0.8 → 1.0.10
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/adapter.js +8 -9
- package/package.json +1 -1
package/adapter.js
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* @import { Config, ServiceFile } from './types.public.js'
|
3
|
+
* @import { storage_driver, StorageFeatures } from '@storecraft/core/storage'
|
4
|
+
*/
|
5
|
+
|
1
6
|
import { getJWTFromServiceAccount, presign } from './adapter.utils.js';
|
2
7
|
|
3
8
|
const types = {
|
@@ -23,16 +28,10 @@ const infer_content_type = (name) => {
|
|
23
28
|
}
|
24
29
|
|
25
30
|
|
26
|
-
/**
|
27
|
-
* @typedef {import('./types.public.d.ts').ServiceFile} ServiceFile
|
28
|
-
* @typedef {import('./types.public.d.ts').Config} Config
|
29
|
-
*/
|
30
|
-
|
31
31
|
/**
|
32
32
|
* @description Google Storage adapter
|
33
|
-
* @typedef {import('@storecraft/core/storage').storage_driver} storage
|
34
33
|
*
|
35
|
-
* @implements {
|
34
|
+
* @implements {storage_driver}
|
36
35
|
*/
|
37
36
|
export class GoogleStorage {
|
38
37
|
|
@@ -49,7 +48,7 @@ export class GoogleStorage {
|
|
49
48
|
get config() { return this.#_config; }
|
50
49
|
|
51
50
|
/**
|
52
|
-
* @type {
|
51
|
+
* @type {storage_driver["init"]}
|
53
52
|
*/
|
54
53
|
async init(app) {
|
55
54
|
if(!app)
|
@@ -66,7 +65,7 @@ export class GoogleStorage {
|
|
66
65
|
}
|
67
66
|
|
68
67
|
features() {
|
69
|
-
/** @type {
|
68
|
+
/** @type {StorageFeatures} */
|
70
69
|
const f = {
|
71
70
|
supports_signed_urls: true
|
72
71
|
}
|