@edgestore/server 0.1.2 → 0.1.3-alpha.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/next/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAK7E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAenD,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,IAAI,IAAI,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACzD;IACE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;CAC/B,GACD;IACE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,aAAa,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CACnE,CAAC;AAEN,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,SAEhD,WAAW,uBAgI/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/next/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAK7E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAenD,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,IAAI,IAAI,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACzD;IACE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;CAC/B,GACD;IACE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,aAAa,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CACnE,CAAC;AAEN,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,SAEhD,WAAW,uBAmI/B"}
@@ -24,16 +24,19 @@ function createEdgeStoreNextHandler(config) {
24
24
  provider,
25
25
  router: config.router
26
26
  });
27
- return new Response(JSON.stringify({
27
+ const res = new Response(JSON.stringify({
28
28
  token,
29
29
  baseUrl
30
30
  }), {
31
31
  status: 200,
32
32
  headers: {
33
- 'Content-Type': 'application/json',
34
- 'Set-Cookie': newCookies.join('; ')
33
+ 'Content-Type': 'application/json'
35
34
  }
36
35
  });
36
+ for (const cookie of newCookies){
37
+ res.headers.append('Set-Cookie', cookie);
38
+ }
39
+ return res;
37
40
  } else if (req.nextUrl.pathname === '/api/edgestore/request-upload') {
38
41
  const res = await shared.requestUpload({
39
42
  provider,
@@ -20,16 +20,19 @@ function createEdgeStoreNextHandler(config) {
20
20
  provider,
21
21
  router: config.router
22
22
  });
23
- return new Response(JSON.stringify({
23
+ const res = new Response(JSON.stringify({
24
24
  token,
25
25
  baseUrl
26
26
  }), {
27
27
  status: 200,
28
28
  headers: {
29
- 'Content-Type': 'application/json',
30
- 'Set-Cookie': newCookies.join('; ')
29
+ 'Content-Type': 'application/json'
31
30
  }
32
31
  });
32
+ for (const cookie of newCookies){
33
+ res.headers.append('Set-Cookie', cookie);
34
+ }
35
+ return res;
33
36
  } else if (req.nextUrl.pathname === '/api/edgestore/request-upload') {
34
37
  const res = await requestUpload({
35
38
  provider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgestore/server",
3
- "version": "0.1.2",
3
+ "version": "0.1.3-alpha.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",
@@ -104,5 +104,5 @@
104
104
  "typescript": "^5.1.6",
105
105
  "zod": "^3.21.4"
106
106
  },
107
- "gitHead": "99519b57aa7a5cbbe5cab16b85a70d437cb87435"
107
+ "gitHead": "3ed23e543ee1ed151685884bb0983c2471e03880"
108
108
  }
@@ -49,7 +49,7 @@ export function createEdgeStoreNextHandler<TCtx>(config: Config<TCtx>) {
49
49
  provider,
50
50
  router: config.router,
51
51
  });
52
- return new Response(
52
+ const res = new Response(
53
53
  JSON.stringify({
54
54
  token,
55
55
  baseUrl,
@@ -58,10 +58,13 @@ export function createEdgeStoreNextHandler<TCtx>(config: Config<TCtx>) {
58
58
  status: 200,
59
59
  headers: {
60
60
  'Content-Type': 'application/json',
61
- 'Set-Cookie': newCookies.join('; '),
62
61
  },
63
62
  },
64
63
  );
64
+ for (const cookie of newCookies) {
65
+ res.headers.append('Set-Cookie', cookie);
66
+ }
67
+ return res;
65
68
  } else if (req.nextUrl.pathname === '/api/edgestore/request-upload') {
66
69
  const res = await requestUpload({
67
70
  provider,