@edgestore/react 0.5.3 → 0.5.6

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 EdgeStore contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -419,27 +419,37 @@ function EdgeStoreProviderInner({ children, context, basePath, maxConcurrentUplo
419
419
  });
420
420
  if (res.ok) {
421
421
  const json = await res.json();
422
- const innerRes = await fetch(`${DEFAULT_BASE_URL}/_init`, {
423
- method: 'GET',
424
- credentials: 'include',
425
- headers: {
426
- 'x-edgestore-token': json.token
422
+ // Only call _init API if provider is edgestore
423
+ if (json.providerName === 'edgestore') {
424
+ const innerRes = await fetch(`${DEFAULT_BASE_URL}/_init`, {
425
+ method: 'GET',
426
+ credentials: 'include',
427
+ headers: {
428
+ 'x-edgestore-token': json.token
429
+ }
430
+ });
431
+ if (innerRes.ok) {
432
+ // update state
433
+ setState({
434
+ loading: false,
435
+ initialized: true,
436
+ error: false
437
+ });
438
+ } else {
439
+ setState({
440
+ loading: false,
441
+ initialized: false,
442
+ error: true
443
+ });
444
+ throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
427
445
  }
428
- });
429
- if (innerRes.ok) {
430
- // update state
446
+ } else {
447
+ // For non-edgestore providers, just update state without calling _init
431
448
  setState({
432
449
  loading: false,
433
450
  initialized: true,
434
451
  error: false
435
452
  });
436
- } else {
437
- setState({
438
- loading: false,
439
- initialized: false,
440
- error: true
441
- });
442
- throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
443
453
  }
444
454
  } else {
445
455
  setState({
package/dist/index.mjs CHANGED
@@ -395,27 +395,37 @@ function EdgeStoreProviderInner({ children, context, basePath, maxConcurrentUplo
395
395
  });
396
396
  if (res.ok) {
397
397
  const json = await res.json();
398
- const innerRes = await fetch(`${DEFAULT_BASE_URL}/_init`, {
399
- method: 'GET',
400
- credentials: 'include',
401
- headers: {
402
- 'x-edgestore-token': json.token
398
+ // Only call _init API if provider is edgestore
399
+ if (json.providerName === 'edgestore') {
400
+ const innerRes = await fetch(`${DEFAULT_BASE_URL}/_init`, {
401
+ method: 'GET',
402
+ credentials: 'include',
403
+ headers: {
404
+ 'x-edgestore-token': json.token
405
+ }
406
+ });
407
+ if (innerRes.ok) {
408
+ // update state
409
+ setState({
410
+ loading: false,
411
+ initialized: true,
412
+ error: false
413
+ });
414
+ } else {
415
+ setState({
416
+ loading: false,
417
+ initialized: false,
418
+ error: true
419
+ });
420
+ throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
403
421
  }
404
- });
405
- if (innerRes.ok) {
406
- // update state
422
+ } else {
423
+ // For non-edgestore providers, just update state without calling _init
407
424
  setState({
408
425
  loading: false,
409
426
  initialized: true,
410
427
  error: false
411
428
  });
412
- } else {
413
- setState({
414
- loading: false,
415
- initialized: false,
416
- error: true
417
- });
418
- throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
419
429
  }
420
430
  } else {
421
431
  setState({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgestore/react",
3
- "version": "0.5.3",
3
+ "version": "0.5.6",
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",
@@ -52,6 +52,7 @@
52
52
  "dist",
53
53
  "src",
54
54
  "README.md",
55
+ "LICENSE",
55
56
  "package.json",
56
57
  "utils",
57
58
  "shared",
@@ -66,7 +67,7 @@
66
67
  "dependencies": {
67
68
  "@aws-sdk/client-s3": "^3.294.0",
68
69
  "@aws-sdk/s3-request-presigner": "^3.294.0",
69
- "@edgestore/shared": "0.5.3",
70
+ "@edgestore/shared": "0.5.6",
70
71
  "@panva/hkdf": "^1.0.4",
71
72
  "cookie": "^0.5.0",
72
73
  "jose": "^4.13.1",
@@ -82,11 +83,11 @@
82
83
  "@types/cookie": "^0.5.1",
83
84
  "@types/node": "^20",
84
85
  "@types/uuid": "^9.0.1",
85
- "next": "15.3.1",
86
- "react": "19.1.0",
87
- "react-dom": "19.1.0",
86
+ "next": "15.3.8",
87
+ "react": "19.1.4",
88
+ "react-dom": "19.1.4",
88
89
  "typescript": "^5",
89
90
  "zod": "3.25.42"
90
91
  },
91
- "gitHead": "fb6625eb48bf5565acc01fe765dcc949f8641e84"
92
+ "gitHead": "ec9fcccedc17b8706fded1217db2b5cafee37e7e"
92
93
  }
@@ -157,27 +157,38 @@ function EdgeStoreProviderInner<TRouter extends AnyRouter>({
157
157
  });
158
158
  if (res.ok) {
159
159
  const json = await res.json();
160
- const innerRes = await fetch(`${DEFAULT_BASE_URL}/_init`, {
161
- method: 'GET',
162
- credentials: 'include',
163
- headers: {
164
- 'x-edgestore-token': json.token,
165
- },
166
- });
167
- if (innerRes.ok) {
168
- // update state
169
- setState({
170
- loading: false,
171
- initialized: true,
172
- error: false,
160
+
161
+ // Only call _init API if provider is edgestore
162
+ if (json.providerName === 'edgestore') {
163
+ const innerRes = await fetch(`${DEFAULT_BASE_URL}/_init`, {
164
+ method: 'GET',
165
+ credentials: 'include',
166
+ headers: {
167
+ 'x-edgestore-token': json.token,
168
+ },
173
169
  });
170
+ if (innerRes.ok) {
171
+ // update state
172
+ setState({
173
+ loading: false,
174
+ initialized: true,
175
+ error: false,
176
+ });
177
+ } else {
178
+ setState({
179
+ loading: false,
180
+ initialized: false,
181
+ error: true,
182
+ });
183
+ throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
184
+ }
174
185
  } else {
186
+ // For non-edgestore providers, just update state without calling _init
175
187
  setState({
176
188
  loading: false,
177
- initialized: false,
178
- error: true,
189
+ initialized: true,
190
+ error: false,
179
191
  });
180
- throw new EdgeStoreClientError("Couldn't initialize EdgeStore.");
181
192
  }
182
193
  } else {
183
194
  setState({