@base44-preview/sdk 0.8.17-pr.70.19d8c0f → 0.8.17-pr.70.d526c10

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.
@@ -83,7 +83,10 @@ export interface Base44Client {
83
83
  agents: AgentsModule;
84
84
  /** {@link AppLogsModule | App logs module} for tracking app usage. */
85
85
  appLogs: AppLogsModule;
86
- /** {@link AnalyticsModule | Analytics module} for tracking app usage. */
86
+ /**
87
+ * {@link AnalyticsModule | Analytics module} for tracking app usage.
88
+ * @internal
89
+ */
87
90
  analytics: AnalyticsModule;
88
91
  /** Cleanup function to disconnect WebSocket connections. Call when you're done with the client. */
89
92
  cleanup: () => void;
@@ -7,7 +7,7 @@ export interface CustomIntegrationCallParams {
7
7
  */
8
8
  payload?: Record<string, any>;
9
9
  /**
10
- * Path parameters to substitute in the URL (e.g., `{ owner: "user", repo: "repo" }`).
10
+ * Path parameters to substitute in the URL. For example, `{ owner: "user", repo: "repo" }`.
11
11
  */
12
12
  pathParams?: Record<string, string>;
13
13
  /**
@@ -34,66 +34,54 @@ export interface CustomIntegrationCallResponse {
34
34
  data: any;
35
35
  }
36
36
  /**
37
- * Module for calling custom workspace-level API integrations.
37
+ * Module for calling custom pre-configured API integrations.
38
38
  *
39
- * Custom integrations allow workspace administrators to connect any external API
40
- * by importing an OpenAPI specification. Apps in the workspace can then call
41
- * these integrations using this module.
42
- *
43
- * Unlike the built-in integrations (like `Core`), custom integrations:
44
- * - Are defined per-workspace by importing OpenAPI specs
45
- * - Use a slug-based identifier instead of package names
46
- * - Proxy requests through Base44's backend (credentials never exposed to frontend)
47
- *
48
- * @example
49
- * ```typescript
50
- * // Call a custom CRM integration
51
- * const response = await base44.integrations.custom.call(
52
- * "my-crm", // integration slug (defined by workspace admin)
53
- * "get:/contacts", // endpoint: method:path format
54
- * {
55
- * queryParams: { limit: 10 }
56
- * }
57
- * );
58
- *
59
- * if (response.success) {
60
- * console.log("Contacts:", response.data);
61
- * } else {
62
- * console.error("API returned error:", response.status_code);
63
- * }
64
- * ```
65
- *
66
- * @example
67
- * ```typescript
68
- * // Call with path params and request body payload
69
- * const response = await base44.integrations.custom.call(
70
- * "github",
71
- * "post:/repos/{owner}/{repo}/issues",
72
- * {
73
- * pathParams: { owner: "myorg", repo: "myrepo" },
74
- * payload: {
75
- * title: "Bug report",
76
- * body: "Something is broken",
77
- * labels: ["bug"]
78
- * }
79
- * }
80
- * );
81
- * ```
39
+ * Custom integrations allow workspace administrators to connect any external API by importing an OpenAPI specification. Apps in the workspace can then call these integrations using this module.
82
40
  */
83
41
  export interface CustomIntegrationsModule {
84
42
  /**
85
43
  * Call a custom integration endpoint.
86
44
  *
87
- * @param slug - The integration's unique identifier (slug), as defined by the workspace admin.
88
- * @param endpoint - The endpoint in `method:path` format (e.g., `"get:/contacts"`, `"post:/users/{id}"`). The method is the HTTP verb (lowercase) and the path matches the OpenAPI specification.
45
+ * @param slug - The integration's unique identifier, as defined by the workspace admin.
46
+ * @param operationId - The endpoint in `method:path` format. For example, `"get:/contacts"`, or `"post:/users/{id}"`. The method is the HTTP verb in lowercase and the path matches the OpenAPI specification.
89
47
  * @param params - Optional parameters including payload, pathParams, and queryParams.
90
48
  * @returns Promise resolving to the integration call response.
91
49
  *
92
50
  * @throws {Error} If slug is not provided.
93
- * @throws {Error} If endpoint is not provided.
94
- * @throws {Base44Error} If the integration or endpoint is not found (404).
51
+ * @throws {Error} If operationId is not provided.
52
+ * @throws {Base44Error} If the integration or operation is not found (404).
95
53
  * @throws {Base44Error} If the external API call fails (502).
96
54
  * @throws {Base44Error} If the request times out (504).
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * // Call a custom CRM integration
59
+ * const response = await base44.integrations.custom.call(
60
+ * "my-crm",
61
+ * "get:/contacts",
62
+ * { queryParams: { limit: 10 } }
63
+ * );
64
+ *
65
+ * if (response.success) {
66
+ * console.log("Contacts:", response.data);
67
+ * }
68
+ * ```
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * // Call with path params and request body
73
+ * const response = await base44.integrations.custom.call(
74
+ * "github",
75
+ * "post:/repos/{owner}/{repo}/issues",
76
+ * {
77
+ * pathParams: { owner: "myorg", repo: "myrepo" },
78
+ * payload: {
79
+ * title: "Bug report",
80
+ * body: "Something is broken"
81
+ * }
82
+ * }
83
+ * );
84
+ * ```
97
85
  */
98
- call(slug: string, endpoint: string, params?: CustomIntegrationCallParams): Promise<CustomIntegrationCallResponse>;
86
+ call(slug: string, operationId: string, params?: CustomIntegrationCallParams): Promise<CustomIntegrationCallResponse>;
99
87
  }
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * Event types for realtime entity updates.
3
+ * @internal
3
4
  */
4
5
  export type RealtimeEventType = "create" | "update" | "delete";
5
6
  /**
6
7
  * Payload received when a realtime event occurs.
8
+ * @internal
7
9
  */
8
10
  export interface RealtimeEvent {
9
11
  /** The type of change that occurred */
@@ -17,10 +19,12 @@ export interface RealtimeEvent {
17
19
  }
18
20
  /**
19
21
  * Callback function invoked when a realtime event occurs.
22
+ * @internal
20
23
  */
21
24
  export type RealtimeCallback = (event: RealtimeEvent) => void;
22
25
  /**
23
26
  * Function returned from subscribe, call it to unsubscribe.
27
+ * @internal
24
28
  */
25
29
  export type Subscription = () => void;
26
30
  /**
@@ -285,6 +289,7 @@ export interface EntityHandler {
285
289
  * // Later, unsubscribe
286
290
  * unsubscribe();
287
291
  * ```
292
+ * @internal
288
293
  */
289
294
  subscribe(callback: RealtimeCallback): Subscription;
290
295
  }
@@ -320,22 +320,28 @@ export interface CoreIntegrations {
320
320
  CreateFileSignedUrl(params: CreateFileSignedUrlParams): Promise<CreateFileSignedUrlResult>;
321
321
  }
322
322
  /**
323
- * Integrations module for calling integration endpoints.
323
+ * Integrations module for calling integration methods.
324
324
  *
325
- * This module provides access to integration endpoints for interacting with external
326
- * services. Integrations are organized into packages. Base44 provides built-in integrations
327
- * in the `Core` package.
325
+ * This module provides access to integration methods for interacting with external services. Unlike the connectors module that gives you raw OAuth tokens, integrations provide pre-built functions that Base44 executes on your behalf.
328
326
  *
329
- * Unlike the connectors module that gives you raw OAuth tokens, integrations provide
330
- * pre-built functions that Base44 executes on your behalf.
327
+ * There are two types of integrations:
331
328
  *
332
- * Integration endpoints are accessed dynamically using the pattern:
333
- * `base44.integrations.PackageName.EndpointName(params)`
329
+ * - **Built-in integrations** (`Core`): Pre-built functions provided by Base44 for common tasks such as AI-powered text generation, image creation, file uploads, and email. Access core integration methods using:
330
+ * ```
331
+ * base44.integrations.Core.FunctionName(params)
332
+ * ```
333
+ *
334
+ * - **Custom integrations** (`custom`): Pre-configured external APIs. Custom integration calls are proxied through Base44's backend, so credentials are never exposed to the frontend. Access custom integration methods using:
335
+ * ```
336
+ * base44.integrations.custom.call(slug, operationId, params)
337
+ * ```
338
+ *
339
+ * <Info>To call a custom integration, it must be pre-configured by a workspace administrator who imports an OpenAPI specification.</Info>
334
340
  *
335
341
  * This module is available to use with a client in all authentication modes:
336
342
  *
337
- * - **Anonymous or User authentication** (`base44.integrations`): Integration endpoints are invoked with the current user's permissions. Anonymous users invoke endpoints without authentication, while authenticated users invoke endpoints with their authentication context.
338
- * - **Service role authentication** (`base44.asServiceRole.integrations`): Integration endpoints are invoked with elevated admin-level permissions. The endpoints execute with admin authentication context.
343
+ * - **Anonymous or User authentication** (`base44.integrations`): Integration methods are invoked with the current user's permissions. Anonymous users invoke methods without authentication, while authenticated users invoke methods with their authentication context.
344
+ * - **Service role authentication** (`base44.asServiceRole.integrations`): Integration methods are invoked with elevated admin-level permissions. The methods execute with admin authentication context.
339
345
  */
340
346
  export type IntegrationsModule = {
341
347
  /**
@@ -343,22 +349,7 @@ export type IntegrationsModule = {
343
349
  */
344
350
  Core: CoreIntegrations;
345
351
  /**
346
- * Custom integrations module for calling workspace-level API integrations.
347
- *
348
- * Allows calling external APIs that workspace admins have configured
349
- * by importing OpenAPI specifications.
350
- *
351
- * @example
352
- * ```typescript
353
- * const response = await base44.integrations.custom.call(
354
- * "github", // integration slug
355
- * "listIssues", // operation ID
356
- * {
357
- * pathParams: { owner: "myorg", repo: "myrepo" },
358
- * queryParams: { state: "open" }
359
- * }
360
- * );
361
- * ```
352
+ * Custom integrations module for calling pre-configured external APIs.
362
353
  */
363
354
  custom: CustomIntegrationsModule;
364
355
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.17-pr.70.19d8c0f",
3
+ "version": "0.8.17-pr.70.d526c10",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",