@base44-preview/sdk 0.8.18-pr.70.4e2bede → 0.8.18-pr.76.8d342cf

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.
@@ -11,7 +11,9 @@ export interface ConnectorAccessTokenResponse {
11
11
  /**
12
12
  * Connectors module for managing OAuth tokens for external services.
13
13
  *
14
- * This module allows you to retrieve OAuth access tokens for external services that the app has connected to. Connectors are app-scoped. When an app builder connects an integration like Google Calendar or Slack, all users of the app share that same connection.
14
+ * This module allows you to retrieve OAuth access tokens for external services
15
+ * that the app has connected to. Use these tokens to make API
16
+ * calls to external services.
15
17
  *
16
18
  * Unlike the integrations module that provides pre-built functions, connectors give you
17
19
  * raw OAuth tokens so you can call external service APIs directly with full control over
@@ -24,9 +26,9 @@ export interface ConnectorsModule {
24
26
  /**
25
27
  * Retrieves an OAuth access token for a specific external integration type.
26
28
  *
27
- * Returns the OAuth token string for an external service that an app builder
28
- * has connected to. This token represents the connected app builder's account
29
- * and can be used to make authenticated API calls to that external service on behalf of the app.
29
+ * Returns the OAuth token string for an external service that the app
30
+ * has connected to. You can then use this token to make authenticated API calls
31
+ * to that external service.
30
32
  *
31
33
  * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`.
32
34
  * @returns Promise resolving to the access token string.
@@ -8,13 +8,18 @@ export interface CustomIntegrationCallParams {
8
8
  */
9
9
  payload?: Record<string, any>;
10
10
  /**
11
- * Path parameters to substitute in the URL. For example, `{ owner: "user", repo: "repo" }`.
11
+ * Path parameters to substitute in the URL (e.g., `{ owner: "user", repo: "repo" }`).
12
12
  */
13
13
  pathParams?: Record<string, string>;
14
14
  /**
15
15
  * Query string parameters to append to the URL.
16
16
  */
17
17
  queryParams?: Record<string, any>;
18
+ /**
19
+ * Additional headers to send with this specific request.
20
+ * These are merged with the integration's configured headers.
21
+ */
22
+ headers?: Record<string, string>;
18
23
  }
19
24
  /**
20
25
  * Response from a custom integration call.
@@ -36,17 +41,61 @@ export interface CustomIntegrationCallResponse {
36
41
  data: any;
37
42
  }
38
43
  /**
39
- * Module for calling custom pre-configured API integrations.
44
+ * Module for calling custom workspace-level API integrations.
45
+ *
46
+ * Custom integrations allow workspace administrators to connect any external API
47
+ * by importing an OpenAPI specification. Apps in the workspace can then call
48
+ * these integrations using this module.
49
+ *
50
+ * Unlike the built-in integrations (like `Core`), custom integrations:
51
+ * - Are defined per-workspace by importing OpenAPI specs
52
+ * - Use a slug-based identifier instead of package names
53
+ * - Proxy requests through Base44's backend (credentials never exposed to frontend)
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * // Call a custom GitHub integration
58
+ * const response = await base44.integrations.custom.call(
59
+ * "github", // integration slug (defined by workspace admin)
60
+ * "get:/repos/{owner}/{repo}/issues", // endpoint in method:path format
61
+ * {
62
+ * pathParams: { owner: "myorg", repo: "myrepo" },
63
+ * queryParams: { state: "open", per_page: 100 }
64
+ * }
65
+ * );
40
66
  *
41
- * 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.
67
+ * if (response.success) {
68
+ * console.log("Issues:", response.data);
69
+ * } else {
70
+ * console.error("API returned error:", response.status_code);
71
+ * }
72
+ * ```
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * // Call with request body payload
77
+ * const response = await base44.integrations.custom.call(
78
+ * "github",
79
+ * "post:/repos/{owner}/{repo}/issues",
80
+ * {
81
+ * pathParams: { owner: "myorg", repo: "myrepo" },
82
+ * payload: {
83
+ * title: "Bug report",
84
+ * body: "Something is broken",
85
+ * labels: ["bug"]
86
+ * }
87
+ * }
88
+ * );
89
+ * ```
90
+ * @internal
42
91
  */
43
92
  export interface CustomIntegrationsModule {
44
93
  /**
45
94
  * Call a custom integration endpoint.
46
95
  *
47
- * @param slug - The integration's unique identifier, as defined by the workspace admin.
48
- * @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.
49
- * @param params - Optional parameters including payload, pathParams, and queryParams.
96
+ * @param slug - The integration's unique identifier (slug), as defined by the workspace admin.
97
+ * @param operationId - The endpoint identifier in method:path format (e.g., "get:/repos/{owner}/{repo}/issues", "get:/users/{username}").
98
+ * @param params - Optional parameters including payload, pathParams, queryParams, and headers.
50
99
  * @returns Promise resolving to the integration call response.
51
100
  *
52
101
  * @throws {Error} If slug is not provided.
@@ -54,36 +103,6 @@ export interface CustomIntegrationsModule {
54
103
  * @throws {Base44Error} If the integration or operation is not found (404).
55
104
  * @throws {Base44Error} If the external API call fails (502).
56
105
  * @throws {Base44Error} If the request times out (504).
57
- *
58
- * @example
59
- * ```typescript
60
- * // Call a custom CRM integration
61
- * const response = await base44.integrations.custom.call(
62
- * "my-crm",
63
- * "get:/contacts",
64
- * { queryParams: { limit: 10 } }
65
- * );
66
- *
67
- * if (response.success) {
68
- * console.log("Contacts:", response.data);
69
- * }
70
- * ```
71
- *
72
- * @example
73
- * ```typescript
74
- * // Call with path params and request body
75
- * const response = await base44.integrations.custom.call(
76
- * "github",
77
- * "post:/repos/{owner}/{repo}/issues",
78
- * {
79
- * pathParams: { owner: "myorg", repo: "myrepo" },
80
- * payload: {
81
- * title: "Bug report",
82
- * body: "Something is broken"
83
- * }
84
- * }
85
- * );
86
- * ```
87
106
  */
88
107
  call(slug: string, operationId: string, params?: CustomIntegrationCallParams): Promise<CustomIntegrationCallResponse>;
89
108
  }
@@ -1,11 +1,9 @@
1
1
  /**
2
2
  * Event types for realtime entity updates.
3
- * @internal
4
3
  */
5
4
  export type RealtimeEventType = "create" | "update" | "delete";
6
5
  /**
7
6
  * Payload received when a realtime event occurs.
8
- * @internal
9
7
  */
10
8
  export interface RealtimeEvent {
11
9
  /** The type of change that occurred */
@@ -19,7 +17,6 @@ export interface RealtimeEvent {
19
17
  }
20
18
  /**
21
19
  * Callback function invoked when a realtime event occurs.
22
- * @internal
23
20
  */
24
21
  export type RealtimeCallback = (event: RealtimeEvent) => void;
25
22
  /**
@@ -290,7 +287,6 @@ export interface EntityHandler {
290
287
  * // Later, clean up the subscription
291
288
  * unsubscribe();
292
289
  * ```
293
- * @internal
294
290
  */
295
291
  subscribe(callback: RealtimeCallback): () => void;
296
292
  }
@@ -320,28 +320,22 @@ export interface CoreIntegrations {
320
320
  CreateFileSignedUrl(params: CreateFileSignedUrlParams): Promise<CreateFileSignedUrlResult>;
321
321
  }
322
322
  /**
323
- * Integrations module for calling integration methods.
323
+ * Integrations module for calling integration endpoints.
324
324
  *
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.
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.
326
328
  *
327
- * There are two types of integrations:
329
+ * Unlike the connectors module that gives you raw OAuth tokens, integrations provide
330
+ * pre-built functions that Base44 executes on your behalf.
328
331
  *
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>
332
+ * Integration endpoints are accessed dynamically using the pattern:
333
+ * `base44.integrations.PackageName.EndpointName(params)`
340
334
  *
341
335
  * This module is available to use with a client in all authentication modes:
342
336
  *
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.
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.
345
339
  */
346
340
  export type IntegrationsModule = {
347
341
  /**
@@ -349,7 +343,23 @@ export type IntegrationsModule = {
349
343
  */
350
344
  Core: CoreIntegrations;
351
345
  /**
352
- * Custom integrations module for calling pre-configured external APIs.
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
+ * "get:/repos/{owner}/{repo}/issues", // endpoint in method:path format
356
+ * {
357
+ * pathParams: { owner: "myorg", repo: "myrepo" },
358
+ * queryParams: { state: "open" }
359
+ * }
360
+ * );
361
+ * ```
362
+ * @internal
353
363
  */
354
364
  custom: CustomIntegrationsModule;
355
365
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.18-pr.70.4e2bede",
3
+ "version": "0.8.18-pr.76.8d342cf",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",