@base44-preview/sdk 0.8.13-pr.70.e91dc9c → 0.8.13-pr.72.b37eb76
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.
|
@@ -72,7 +72,7 @@ export interface AgentMessageMetadata {
|
|
|
72
72
|
export interface AgentConversation {
|
|
73
73
|
/** Unique identifier for the conversation. */
|
|
74
74
|
id: string;
|
|
75
|
-
/**
|
|
75
|
+
/** Application ID. */
|
|
76
76
|
app_id: string;
|
|
77
77
|
/** Name of the agent in this conversation. */
|
|
78
78
|
agent_name: string;
|
|
@@ -140,7 +140,7 @@ export interface AgentsModuleConfig {
|
|
|
140
140
|
axios: AxiosInstance;
|
|
141
141
|
/** Function to get WebSocket instance for real-time updates (lazy initialization) */
|
|
142
142
|
getSocket: () => ReturnType<typeof RoomsSocket>;
|
|
143
|
-
/**
|
|
143
|
+
/** Application ID */
|
|
144
144
|
appId: string;
|
|
145
145
|
/** Server URL */
|
|
146
146
|
serverUrl?: string;
|
|
@@ -6,8 +6,8 @@ export const ANALYTICS_SESSION_DURATION_EVENT_NAME = "__session_duration_event__
|
|
|
6
6
|
export const ANALYTICS_CONFIG_ENABLE_URL_PARAM_KEY = "analytics-enable";
|
|
7
7
|
export const ANALYTICS_SESSION_ID_LOCAL_STORAGE_KEY = "base44_analytics_session_id";
|
|
8
8
|
const defaultConfiguration = {
|
|
9
|
-
// default to
|
|
10
|
-
enabled:
|
|
9
|
+
// default to enabled //
|
|
10
|
+
enabled: true,
|
|
11
11
|
maxQueueSize: 1000,
|
|
12
12
|
throttleTime: 1000,
|
|
13
13
|
batchSize: 30,
|
|
@@ -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
|
|
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
|
|
28
|
-
* has connected to.
|
|
29
|
-
*
|
|
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.
|
|
@@ -3,23 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface CustomIntegrationCallParams {
|
|
5
5
|
/**
|
|
6
|
-
* Request body to send to the external API.
|
|
6
|
+
* Request body payload to send to the external API.
|
|
7
7
|
*/
|
|
8
8
|
payload?: Record<string, any>;
|
|
9
9
|
/**
|
|
10
|
-
* Path parameters to substitute
|
|
11
|
-
* For example, if the API endpoint is `/repos/{owner}/{repo}/issues`,
|
|
12
|
-
* pass `{ owner: "myorg", repo: "myrepo" }`.
|
|
10
|
+
* Path parameters to substitute in the URL (e.g., `{ owner: "user", repo: "repo" }`).
|
|
13
11
|
*/
|
|
14
12
|
pathParams?: Record<string, string>;
|
|
15
13
|
/**
|
|
16
14
|
* Query string parameters to append to the URL.
|
|
17
|
-
* For example, `{ state: "open", per_page: 50 }` becomes `?state=open&per_page=50`.
|
|
18
15
|
*/
|
|
19
16
|
queryParams?: Record<string, any>;
|
|
20
17
|
/**
|
|
21
|
-
* Additional
|
|
22
|
-
* These
|
|
18
|
+
* Additional headers to send with this specific request.
|
|
19
|
+
* These are merged with the integration's configured headers.
|
|
23
20
|
*/
|
|
24
21
|
headers?: Record<string, string>;
|
|
25
22
|
}
|
|
@@ -36,25 +33,66 @@ export interface CustomIntegrationCallResponse {
|
|
|
36
33
|
*/
|
|
37
34
|
status_code: number;
|
|
38
35
|
/**
|
|
39
|
-
* The
|
|
40
|
-
*
|
|
36
|
+
* The response data from the external API.
|
|
37
|
+
* Can be any JSON-serializable value depending on the external API's response.
|
|
41
38
|
*/
|
|
42
39
|
data: any;
|
|
43
40
|
}
|
|
44
41
|
/**
|
|
45
|
-
*
|
|
42
|
+
* Module for calling custom workspace-level API integrations.
|
|
43
|
+
*
|
|
44
|
+
* Custom integrations allow workspace administrators to connect any external API
|
|
45
|
+
* by importing an OpenAPI specification. Apps in the workspace can then call
|
|
46
|
+
* these integrations using this module.
|
|
47
|
+
*
|
|
48
|
+
* Unlike the built-in integrations (like `Core`), custom integrations:
|
|
49
|
+
* - Are defined per-workspace by importing OpenAPI specs
|
|
50
|
+
* - Use a slug-based identifier instead of package names
|
|
51
|
+
* - Proxy requests through Base44's backend (credentials never exposed to frontend)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // Call a custom GitHub integration
|
|
56
|
+
* const response = await base44.integrations.custom.call(
|
|
57
|
+
* "github", // integration slug (defined by workspace admin)
|
|
58
|
+
* "listIssues", // operation ID from the OpenAPI spec
|
|
59
|
+
* {
|
|
60
|
+
* pathParams: { owner: "myorg", repo: "myrepo" },
|
|
61
|
+
* queryParams: { state: "open", per_page: 100 }
|
|
62
|
+
* }
|
|
63
|
+
* );
|
|
64
|
+
*
|
|
65
|
+
* if (response.success) {
|
|
66
|
+
* console.log("Issues:", response.data);
|
|
67
|
+
* } else {
|
|
68
|
+
* console.error("API returned error:", response.status_code);
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* // Call with request body payload
|
|
75
|
+
* const response = await base44.integrations.custom.call(
|
|
76
|
+
* "github",
|
|
77
|
+
* "createIssue",
|
|
78
|
+
* {
|
|
79
|
+
* pathParams: { owner: "myorg", repo: "myrepo" },
|
|
80
|
+
* payload: {
|
|
81
|
+
* title: "Bug report",
|
|
82
|
+
* body: "Something is broken",
|
|
83
|
+
* labels: ["bug"]
|
|
84
|
+
* }
|
|
85
|
+
* }
|
|
86
|
+
* );
|
|
87
|
+
* ```
|
|
46
88
|
*/
|
|
47
89
|
export interface CustomIntegrationsModule {
|
|
48
90
|
/**
|
|
49
91
|
* Call a custom integration endpoint.
|
|
50
92
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @param slug - The integration's unique identifier, as defined by the workspace admin.
|
|
56
|
-
* @param operationId - The operation ID from the OpenAPI specification, such as `"listIssues"` or `"getUser"`.
|
|
57
|
-
* @param params - Optional parameters to send to the external API.
|
|
93
|
+
* @param slug - The integration's unique identifier (slug), as defined by the workspace admin.
|
|
94
|
+
* @param operationId - The operation ID from the OpenAPI spec (e.g., "listIssues", "getUser").
|
|
95
|
+
* @param params - Optional parameters including payload, pathParams, queryParams, and headers.
|
|
58
96
|
* @returns Promise resolving to the integration call response.
|
|
59
97
|
*
|
|
60
98
|
* @throws {Error} If slug is not provided.
|
|
@@ -62,38 +100,6 @@ export interface CustomIntegrationsModule {
|
|
|
62
100
|
* @throws {Base44Error} If the integration or operation is not found (404).
|
|
63
101
|
* @throws {Base44Error} If the external API call fails (502).
|
|
64
102
|
* @throws {Base44Error} If the request times out (504).
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* // GET request with path and query parameters
|
|
69
|
-
* const response = await base44.integrations.custom.call(
|
|
70
|
-
* "github",
|
|
71
|
-
* "listRepoIssues",
|
|
72
|
-
* {
|
|
73
|
-
* pathParams: { owner: "myorg", repo: "myrepo" },
|
|
74
|
-
* queryParams: { state: "open", per_page: 50 }
|
|
75
|
-
* }
|
|
76
|
-
* );
|
|
77
|
-
*
|
|
78
|
-
* if (response.success) {
|
|
79
|
-
* console.log("Found issues:", response.data.length);
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```typescript
|
|
85
|
-
* // POST request with a JSON body
|
|
86
|
-
* const response = await base44.integrations.custom.call(
|
|
87
|
-
* "slack",
|
|
88
|
-
* "postMessage",
|
|
89
|
-
* {
|
|
90
|
-
* payload: {
|
|
91
|
-
* channel: "#general",
|
|
92
|
-
* text: "Hello from Base44!"
|
|
93
|
-
* }
|
|
94
|
-
* }
|
|
95
|
-
* );
|
|
96
|
-
* ```
|
|
97
103
|
*/
|
|
98
104
|
call(slug: string, operationId: string, params?: CustomIntegrationCallParams): Promise<CustomIntegrationCallResponse>;
|
|
99
105
|
}
|
|
@@ -320,28 +320,22 @@ export interface CoreIntegrations {
|
|
|
320
320
|
CreateFileSignedUrl(params: CreateFileSignedUrlParams): Promise<CreateFileSignedUrlResult>;
|
|
321
321
|
}
|
|
322
322
|
/**
|
|
323
|
-
* Integrations module for calling integration
|
|
323
|
+
* Integrations module for calling integration endpoints.
|
|
324
324
|
*
|
|
325
|
-
* This module provides access to integration
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
344
|
-
* - **Service role authentication** (`base44.asServiceRole.integrations`): Integration
|
|
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,22 @@ export type IntegrationsModule = {
|
|
|
349
343
|
*/
|
|
350
344
|
Core: CoreIntegrations;
|
|
351
345
|
/**
|
|
352
|
-
* Custom integrations module for calling
|
|
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
|
+
* ```
|
|
353
362
|
*/
|
|
354
363
|
custom: CustomIntegrationsModule;
|
|
355
364
|
} & {
|