@base44-preview/sdk 0.8.10-pr.62.fa928f8 → 0.8.11-pr.63.10884cf

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.
@@ -16,9 +16,15 @@ export function createCustomIntegrationsModule(axios, appId) {
16
16
  if (!(operationId === null || operationId === void 0 ? void 0 : operationId.trim())) {
17
17
  throw new Error("Operation ID is required and cannot be empty");
18
18
  }
19
+ // Convert camelCase to snake_case for Python backend
20
+ const { pathParams, queryParams, ...rest } = params !== null && params !== void 0 ? params : {};
21
+ const body = {
22
+ ...rest,
23
+ ...(pathParams && { path_params: pathParams }),
24
+ ...(queryParams && { query_params: queryParams }),
25
+ };
19
26
  // Make the API call
20
- // Note: axios interceptor extracts response.data, so we get the payload directly
21
- const response = await axios.post(`/apps/${appId}/integrations/custom/${slug}/${operationId}`, params !== null && params !== void 0 ? params : {});
27
+ const response = await axios.post(`/apps/${appId}/integrations/custom/${slug}/${operationId}`, body);
22
28
  // The axios interceptor extracts response.data, so we get the payload directly
23
29
  return response;
24
30
  },
@@ -9,11 +9,11 @@ export interface CustomIntegrationCallParams {
9
9
  /**
10
10
  * Path parameters to substitute in the URL (e.g., `{ owner: "user", repo: "repo" }`).
11
11
  */
12
- path_params?: Record<string, string>;
12
+ pathParams?: Record<string, string>;
13
13
  /**
14
14
  * Query string parameters to append to the URL.
15
15
  */
16
- query_params?: Record<string, any>;
16
+ queryParams?: Record<string, any>;
17
17
  /**
18
18
  * Additional headers to send with this specific request.
19
19
  * These are merged with the integration's configured headers.
@@ -57,8 +57,8 @@ export interface CustomIntegrationCallResponse {
57
57
  * "github", // integration slug (defined by workspace admin)
58
58
  * "listIssues", // operation ID from the OpenAPI spec
59
59
  * {
60
- * path_params: { owner: "myorg", repo: "myrepo" },
61
- * query_params: { state: "open", per_page: 100 }
60
+ * pathParams: { owner: "myorg", repo: "myrepo" },
61
+ * queryParams: { state: "open", per_page: 100 }
62
62
  * }
63
63
  * );
64
64
  *
@@ -76,7 +76,7 @@ export interface CustomIntegrationCallResponse {
76
76
  * "github",
77
77
  * "createIssue",
78
78
  * {
79
- * path_params: { owner: "myorg", repo: "myrepo" },
79
+ * pathParams: { owner: "myorg", repo: "myrepo" },
80
80
  * payload: {
81
81
  * title: "Bug report",
82
82
  * body: "Something is broken",
@@ -92,7 +92,7 @@ export interface CustomIntegrationsModule {
92
92
  *
93
93
  * @param slug - The integration's unique identifier (slug), as defined by the workspace admin.
94
94
  * @param operationId - The operation ID from the OpenAPI spec (e.g., "listIssues", "getUser").
95
- * @param params - Optional parameters including payload, path params, query params, and headers.
95
+ * @param params - Optional parameters including payload, pathParams, queryParams, and headers.
96
96
  * @returns Promise resolving to the integration call response.
97
97
  *
98
98
  * @throws {Error} If slug is not provided.
@@ -32,6 +32,13 @@ export function createEntitiesModule(axios, appId) {
32
32
  */
33
33
  function createEntityHandler(axios, appId, entityName) {
34
34
  const baseURL = `/apps/${appId}/entities/${entityName}`;
35
+ const isDevMode = new URLSearchParams(window.location.search).get("use_dev_table") === "true";
36
+ axios.interceptors.request.use((config) => {
37
+ var _a;
38
+ config.headers = (_a = config.headers) !== null && _a !== void 0 ? _a : {};
39
+ config.headers["X-Dev-Mode"] = String(isDevMode);
40
+ return config;
41
+ });
35
42
  return {
36
43
  // List entities with optional pagination and sorting
37
44
  async list(sort, limit, skip, fields) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.10-pr.62.fa928f8",
3
+ "version": "0.8.11-pr.63.10884cf",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",