@base44-preview/sdk 0.8.47-pr.279.adde4da → 0.8.48-pr.145.de7eff3

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.
@@ -41,8 +41,12 @@ export function createFunctionsModule(axios, appId, config) {
41
41
  let formData;
42
42
  let contentType;
43
43
  // Handle file uploads with FormData
44
- if (data instanceof FormData ||
45
- (data && Object.values(data).some((value) => value instanceof File))) {
44
+ if (data instanceof FormData) {
45
+ // Preserve fields, repeated keys, and files already encoded by callers.
46
+ formData = data;
47
+ contentType = "multipart/form-data";
48
+ }
49
+ else if (data && Object.values(data).some((value) => value instanceof File)) {
46
50
  formData = new FormData();
47
51
  Object.keys(data).forEach((key) => {
48
52
  if (data[key] instanceof File) {
@@ -1,6 +1,4 @@
1
1
  import type { AxiosInstance } from "axios";
2
- /** `fetch`-compatible transport that can resolve a root-relative path. */
3
- type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
4
2
  /** Options for {@link Base44Client.fetchWithAuth}. */
5
3
  export interface FetchWithAuthInit extends RequestInit {
6
4
  /**
@@ -10,7 +8,7 @@ export interface FetchWithAuthInit extends RequestInit {
10
8
  * against. In Nitro pass its own, which routes a leading-slash path
11
9
  * in-process: `import { fetch } from "nitro"`.
12
10
  */
13
- fetch?: FetchLike;
11
+ fetch?: (input: string, init?: RequestInit) => Promise<Response>;
14
12
  }
15
13
  /**
16
14
  * Builds the client's `fetchWithAuth`: a `fetch` to the app's own origin that
@@ -43,4 +41,3 @@ export declare function createFetchWithAuth({ axios, serviceRoleAxios, appId, se
43
41
  functionsVersion?: string;
44
42
  platformHeaders?: Record<string, string>;
45
43
  }): (path: string, init?: FetchWithAuthInit) => Promise<Response>;
46
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.47-pr.279.adde4da",
3
+ "version": "0.8.48-pr.145.de7eff3",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "test": "npm run test:types && vitest run",
15
15
  "test:types": "tsc --noEmit -p tsconfig.type-tests.json",
16
16
  "test:unit": "vitest run tests/unit",
17
- "test:e2e": "vitest run tests/e2e",
17
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
18
18
  "test:watch": "vitest",
19
19
  "test:coverage": "vitest run --coverage",
20
20
  "docs": "typedoc",
@@ -42,7 +42,7 @@
42
42
  "dotenv": "^16.3.1",
43
43
  "eslint": "^9.39.2",
44
44
  "eslint-plugin-import": "^2.32.0",
45
- "nock": "^13.4.0",
45
+ "msw": "^2.12.11",
46
46
  "typedoc": "^0.28.14",
47
47
  "typedoc-plugin-markdown": "^4.9.0",
48
48
  "typescript": "^5.3.2",