@storecraft/storage-google 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Storecraft Google Cloud Storage
2
2
 
3
+ <div style="text-align:center">
4
+ <img src='https://storecraft.app/storecraft-color.svg'
5
+ width='90%'' />
6
+ </div><hr/><br/>
7
+
3
8
  `fetch` ready support for an `GCP` **Storage**
4
9
 
5
10
  Features:
@@ -7,6 +12,10 @@ Features:
7
12
  - Supports streaming `Get` / `Put` / `Delete`
8
13
  - Supports `presigned` `Get` / `Put` requests to offload to client
9
14
 
15
+ ```bash
16
+ npm i @storecraft/storage-google
17
+ ```
18
+
10
19
  ## How-to
11
20
  1. Create a bucket at `GCP console` or even at `firebase`
12
21
  2. Download the `service json file`
@@ -35,7 +44,7 @@ await storage.putBlob(
35
44
 
36
45
  // read
37
46
  const { value } = await storage.getBlob('folder1/tomer.txt');
38
- const url = await storage.getSigned('folder1/tomer.txt');
47
+ const { url } = await storage.getSigned('folder1/tomer.txt');
39
48
  console.log('presign GET url ', url);
40
49
 
41
50
  ```
package/adapter.js CHANGED
@@ -24,8 +24,8 @@ const infer_content_type = (name) => {
24
24
 
25
25
 
26
26
  /**
27
- * @typedef {import('./types.public.js').ServiceFile} ServiceFile
28
- * @typedef {import('./types.public.js').Config} Config
27
+ * @typedef {import('./types.public.d.ts').ServiceFile} ServiceFile
28
+ * @typedef {import('./types.public.d.ts').Config} Config
29
29
  */
30
30
 
31
31
  /**
package/adapter.utils.js CHANGED
@@ -2,7 +2,7 @@ import { base64, jwt } from '@storecraft/core/v-crypto';
2
2
 
3
3
  /**
4
4
  *
5
- * @param {import('./types.public.js').ServiceFile} sf Google service account json
5
+ * @param {import('./types.public.d.ts').ServiceFile} sf Google service account json
6
6
  * @param {string} [aud]
7
7
  * @returns
8
8
  */
@@ -1,11 +1,7 @@
1
1
  {
2
- "compileOnSave": false,
3
2
  "compilerOptions": {
4
- "noEmit": true,
5
- "allowJs": true,
6
3
  "checkJs": true,
7
4
  "target": "ESNext",
8
- "resolveJsonModule": true,
9
5
  "moduleResolution": "NodeNext",
10
6
  "module": "NodeNext",
11
7
  "composite": true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@storecraft/storage-google",
3
- "version": "1.0.0",
4
- "description": "Google Storage support",
3
+ "version": "1.0.1",
4
+ "description": "Official Google Storage adapter for storecraft",
5
5
  "license": "MIT",
6
6
  "author": "Tomer Shalev (https://github.com/store-craft)",
7
7
  "homepage": "https://github.com/store-craft/storecraft",
@@ -21,8 +21,8 @@
21
21
  "storage-google:publish": "npm publish --access public"
22
22
  },
23
23
  "type": "module",
24
- "main": "index.js",
25
- "types": "./types.public.d.ts",
24
+ "main": "adapter.js",
25
+ "types": "types.public.d.ts",
26
26
  "dependencies": {
27
27
  "@storecraft/core": "^1.0.0"
28
28
  },
@@ -1,7 +1,7 @@
1
1
  import 'dotenv/config';
2
2
  import { test } from 'uvu';
3
3
  import * as assert from 'uvu/assert';
4
- import { GoogleStorage } from '../adapter.js'
4
+ import { GoogleStorage } from '@storecraft/storage-google'
5
5
  import { readFile } from 'node:fs/promises';
6
6
 
7
7
  const areBlobsEqual = async (blob1, blob2) => {
package/types.public.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './index.js';
1
+ export { GoogleStorage } from './adapter.js';
2
2
 
3
3
  export type ServiceFile = {
4
4
  type?: string;
package/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './adapter.js'