@limrun/api 0.46.2 → 0.46.4

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/src/ios-client.ts CHANGED
@@ -2385,11 +2385,13 @@ export async function createInstanceClient(options: InstanceClientOptions): Prom
2385
2385
  const setStoreKitConfig = async (bundleId: string, storekit: Buffer | Uint8Array): Promise<void> => {
2386
2386
  const body = Buffer.isBuffer(storekit) ? storekit : Buffer.from(storekit);
2387
2387
  const url = `${options.apiUrl}/payments/storeKitConfigs/${encodeURIComponent(bundleId)}`;
2388
+ // No manual Content-Length: fetch computes it from the Buffer, and setting
2389
+ // it too makes Node 22's built-in fetch send a duplicate that the npm undici
2390
+ // proxy dispatcher rejects whenever HTTP(S)_PROXY is set.
2388
2391
  const response = await nodeProxyTransport.fetch(url, {
2389
2392
  method: 'PUT',
2390
2393
  headers: {
2391
2394
  'Content-Type': 'application/octet-stream',
2392
- 'Content-Length': body.length.toString(),
2393
2395
  Authorization: `Bearer ${options.token}`,
2394
2396
  },
2395
2397
  body: body as any,
@@ -54,9 +54,10 @@ export interface AssetGetOrUploadResponse {
54
54
 
55
55
  /**
56
56
  * Body init for the signed-URL PUT. Without a progress callback the buffer is sent
57
- * directly. With one, the buffer is wrapped in a ReadableStream so the callback can
58
- * fire as chunks are pulled onto the socket; the explicit Content-Length header set
59
- * by the caller keeps the request non-chunked, which signed URLs require.
57
+ * directly and fetch derives Content-Length from it. With one, the buffer is wrapped
58
+ * in a ReadableStream so the callback can fire as chunks are pulled onto the socket;
59
+ * the explicit Content-Length header set by the caller keeps the request non-chunked,
60
+ * which signed URLs require.
60
61
  */
61
62
  function uploadBodyInit(
62
63
  data: Buffer,
@@ -109,9 +110,13 @@ export class Assets extends GeneratedAssets {
109
110
  ...(creationResponse.expiresAt && { expiresAt: creationResponse.expiresAt }),
110
111
  };
111
112
  }
113
+ // Content-Length is set manually only for the streamed body; for the buffered
114
+ // body fetch computes it itself, and setting it too makes Node 22's built-in
115
+ // fetch send a duplicate that the npm undici proxy dispatcher rejects with
116
+ // "invalid content-length header" whenever HTTP(S)_PROXY is set.
112
117
  const uploadResponse = await nodeProxyTransport.fetch(creationResponse.signedUploadUrl, {
113
118
  headers: {
114
- 'Content-Length': data.length.toString(),
119
+ ...(body.onUploadProgress && { 'Content-Length': data.length.toString() }),
115
120
  'Content-Type': 'application/octet-stream',
116
121
  },
117
122
  method: 'PUT',
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.46.2'; // x-release-please-version
1
+ export const VERSION = '0.46.4'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.46.2";
1
+ export declare const VERSION = "0.46.4";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.46.2";
1
+ export declare const VERSION = "0.46.4";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.46.2'; // x-release-please-version
4
+ exports.VERSION = '0.46.4'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.46.2'; // x-release-please-version
1
+ export const VERSION = '0.46.4'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map