@edgestore/react 0.3.2 → 0.4.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/README.md +3 -3
- package/dist/contextProvider.d.ts +3 -3
- package/dist/contextProvider.d.ts.map +1 -1
- package/dist/createNextProxy.d.ts +0 -1
- package/dist/createNextProxy.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +8 -9
- package/src/contextProvider.tsx +3 -3
package/README.md
CHANGED
|
@@ -26,9 +26,9 @@ EDGE_STORE_SECRET_KEY=your-secret-key
|
|
|
26
26
|
### Backend
|
|
27
27
|
|
|
28
28
|
Now we can create the backend code for our Next.js app.<br/>
|
|
29
|
-
|
|
29
|
+
EdgeStore is compatible with both types of Next.js apps (`pages router` and `app router`).
|
|
30
30
|
|
|
31
|
-
The example below is the simplest bucket you can create with
|
|
31
|
+
The example below is the simplest bucket you can create with EdgeStore. Just a simple file bucket with no validation that will be accessible by anyone with the link.
|
|
32
32
|
|
|
33
33
|
You can have multiple buckets in your app, each with its own configuration.
|
|
34
34
|
|
|
@@ -39,7 +39,7 @@ import { createEdgeStoreNextHandler } from '@edgestore/server/adapters/next/app'
|
|
|
39
39
|
const es = initEdgeStore.create();
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* This is the main router for the
|
|
42
|
+
* This is the main router for the EdgeStore buckets.
|
|
43
43
|
*/
|
|
44
44
|
const edgeStoreRouter = es.router({
|
|
45
45
|
publicFiles: es.fileBucket(),
|
|
@@ -4,14 +4,14 @@ import { type BucketFunctions } from './createNextProxy';
|
|
|
4
4
|
type EdgeStoreContextValue<TRouter extends AnyRouter> = {
|
|
5
5
|
edgestore: BucketFunctions<TRouter>;
|
|
6
6
|
/**
|
|
7
|
-
* This will re-run the
|
|
7
|
+
* This will re-run the EdgeStore initialization process,
|
|
8
8
|
* which will run the `createContext` function again.
|
|
9
9
|
*
|
|
10
10
|
* Can be used after a sign-in or sign-out, for example.
|
|
11
11
|
*/
|
|
12
12
|
reset: () => Promise<void>;
|
|
13
13
|
/**
|
|
14
|
-
* The current state of the
|
|
14
|
+
* The current state of the EdgeStore provider.
|
|
15
15
|
*
|
|
16
16
|
* You can use this to wait for the provider to be initialized
|
|
17
17
|
* before trying to show private images on your app.
|
|
@@ -37,7 +37,7 @@ export declare function createEdgeStoreProvider<TRouter extends AnyRouter>(opts?
|
|
|
37
37
|
*
|
|
38
38
|
* @example - If your app is hosted at `https://example.com/my-app`, you can set the `basePath` to `/my-app/api/edgestore`.
|
|
39
39
|
*/
|
|
40
|
-
basePath?: string
|
|
40
|
+
basePath?: string;
|
|
41
41
|
}) => React.JSX.Element;
|
|
42
42
|
useEdgeStore: () => EdgeStoreContextValue<TRouter>;
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextProvider.d.ts","sourceRoot":"","sources":["../src/contextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAU1E,KAAK,qBAAqB,CAAC,OAAO,SAAS,SAAS,IAAI;IACtD,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACpC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,OAAO,SAAS,SAAS,EAAE,IAAI,CAAC,EAAE;IACxE;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B
|
|
1
|
+
{"version":3,"file":"contextProvider.d.ts","sourceRoot":"","sources":["../src/contextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAU1E,KAAK,qBAAqB,CAAC,OAAO,SAAS,SAAS,IAAI;IACtD,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACpC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,OAAO,SAAS,SAAS,EAAE,IAAI,CAAC,EAAE;IACxE;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;iDAQI;QACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B;;;;;;WAMG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;;EA8BF;AAED,KAAK,aAAa,GACd;IACE,OAAO,EAAE,IAAI,CAAC;IACd,WAAW,EAAE,KAAK,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;CACd,GACD;IACE,OAAO,EAAE,KAAK,CAAC;IACf,WAAW,EAAE,KAAK,CAAC;IACnB,KAAK,EAAE,IAAI,CAAC;CACb,GACD;IACE,OAAO,EAAE,KAAK,CAAC;IACf,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNextProxy.d.ts","sourceRoot":"","sources":["../src/createNextProxy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createNextProxy.d.ts","sourceRoot":"","sources":["../src/createNextProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAExB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC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438,7 @@ function EdgeStoreProviderInner({ children, context, basePath, maxConcurrentUplo
|
|
|
438
438
|
initialized: false,
|
|
439
439
|
error: true
|
|
440
440
|
});
|
|
441
|
-
throw new EdgeStoreClientError("Couldn't initialize
|
|
441
|
+
throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
|
|
442
442
|
}
|
|
443
443
|
} else {
|
|
444
444
|
setState({
|
package/dist/index.mjs
CHANGED
|
@@ -414,7 +414,7 @@ function EdgeStoreProviderInner({ children, context, basePath, maxConcurrentUplo
|
|
|
414
414
|
initialized: false,
|
|
415
415
|
error: true
|
|
416
416
|
});
|
|
417
|
-
throw new EdgeStoreClientError("Couldn't initialize
|
|
417
|
+
throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
|
|
418
418
|
}
|
|
419
419
|
} else {
|
|
420
420
|
setState({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgestore/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Upload files with ease from React/Next.js",
|
|
5
5
|
"homepage": "https://edgestore.dev",
|
|
6
6
|
"repository": "https://github.com/edgestorejs/edgestore.git",
|
|
@@ -66,14 +66,13 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@aws-sdk/client-s3": "^3.294.0",
|
|
68
68
|
"@aws-sdk/s3-request-presigner": "^3.294.0",
|
|
69
|
-
"@edgestore/shared": "0.
|
|
69
|
+
"@edgestore/shared": "0.4.0",
|
|
70
70
|
"@panva/hkdf": "^1.0.4",
|
|
71
71
|
"cookie": "^0.5.0",
|
|
72
72
|
"jose": "^4.13.1",
|
|
73
73
|
"uuid": "^9.0.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"next": "*",
|
|
77
76
|
"react": ">=16.8.0",
|
|
78
77
|
"react-dom": ">=16.8.0",
|
|
79
78
|
"zod": ">=3.0.0"
|
|
@@ -81,13 +80,13 @@
|
|
|
81
80
|
"devDependencies": {
|
|
82
81
|
"@swc/helpers": "0.5.3",
|
|
83
82
|
"@types/cookie": "^0.5.1",
|
|
84
|
-
"@types/node": "^
|
|
83
|
+
"@types/node": "^20",
|
|
85
84
|
"@types/uuid": "^9.0.1",
|
|
86
|
-
"next": "^
|
|
87
|
-
"react": "^
|
|
88
|
-
"react-dom": "^
|
|
89
|
-
"typescript": "^5
|
|
85
|
+
"next": "^15.2.4",
|
|
86
|
+
"react": "^19.0.0",
|
|
87
|
+
"react-dom": "^19.0.0",
|
|
88
|
+
"typescript": "^5",
|
|
90
89
|
"zod": "3.21.4"
|
|
91
90
|
},
|
|
92
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "63d6ba86e038a61bfbf506385183482c91e80842"
|
|
93
92
|
}
|
package/src/contextProvider.tsx
CHANGED
|
@@ -13,14 +13,14 @@ const DEFAULT_BASE_URL =
|
|
|
13
13
|
type EdgeStoreContextValue<TRouter extends AnyRouter> = {
|
|
14
14
|
edgestore: BucketFunctions<TRouter>;
|
|
15
15
|
/**
|
|
16
|
-
* This will re-run the
|
|
16
|
+
* This will re-run the EdgeStore initialization process,
|
|
17
17
|
* which will run the `createContext` function again.
|
|
18
18
|
*
|
|
19
19
|
* Can be used after a sign-in or sign-out, for example.
|
|
20
20
|
*/
|
|
21
21
|
reset: () => Promise<void>;
|
|
22
22
|
/**
|
|
23
|
-
* The current state of the
|
|
23
|
+
* The current state of the EdgeStore provider.
|
|
24
24
|
*
|
|
25
25
|
* You can use this to wait for the provider to be initialized
|
|
26
26
|
* before trying to show private images on your app.
|
|
@@ -167,7 +167,7 @@ function EdgeStoreProviderInner<TRouter extends AnyRouter>({
|
|
|
167
167
|
initialized: false,
|
|
168
168
|
error: true,
|
|
169
169
|
});
|
|
170
|
-
throw new EdgeStoreClientError("Couldn't initialize
|
|
170
|
+
throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
|
|
171
171
|
}
|
|
172
172
|
} else {
|
|
173
173
|
setState({
|