@base44-preview/sdk 0.8.17-pr.75.4ddbc56 → 0.8.17-pr.76.9ab8dcd

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;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl } from
4
4
  export { createClient, createClientFromRequest, Base44Error, getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl, };
5
5
  export type { Base44Client, CreateClientConfig, CreateClientOptions, Base44ErrorJSON, };
6
6
  export * from "./types.js";
7
- export type { EntitiesModule, EntityHandler, RealtimeEventType, RealtimeEvent, RealtimeCallback, Subscription, } from "./modules/entities.types.js";
7
+ export type { EntitiesModule, EntityHandler, RealtimeEventType, RealtimeEvent, RealtimeCallback, } from "./modules/entities.types.js";
8
8
  export type { AuthModule, LoginResponse, RegisterParams, VerifyOtpParams, ChangePasswordParams, ResetPasswordParams, User, } from "./modules/auth.types.js";
9
9
  export type { IntegrationsModule, IntegrationPackage, IntegrationEndpointFunction, CoreIntegrations, InvokeLLMParams, GenerateImageParams, GenerateImageResult, UploadFileParams, UploadFileResult, SendEmailParams, SendEmailResult, ExtractDataFromUploadedFileParams, ExtractDataFromUploadedFileResult, UploadPrivateFileParams, UploadPrivateFileResult, CreateFileSignedUrlParams, CreateFileSignedUrlResult, } from "./modules/integrations.types.js";
10
10
  export type { FunctionsModule } from "./modules/functions.types.js";
@@ -72,7 +72,7 @@ export interface AgentMessageMetadata {
72
72
  export interface AgentConversation {
73
73
  /** Unique identifier for the conversation. */
74
74
  id: string;
75
- /** Application ID. */
75
+ /** App ID. */
76
76
  app_id: string;
77
77
  /** Name of the agent in this conversation. */
78
78
  agent_name: string;
@@ -138,9 +138,9 @@ export interface CreateConversationParams {
138
138
  export interface AgentsModuleConfig {
139
139
  /** Axios instance for HTTP requests */
140
140
  axios: AxiosInstance;
141
- /** Function to get WebSocket instance for real-time updates (lazy initialization) */
141
+ /** Function to get WebSocket instance for realtime updates (lazy initialization) */
142
142
  getSocket: () => ReturnType<typeof RoomsSocket>;
143
- /** Application ID */
143
+ /** App ID */
144
144
  appId: string;
145
145
  /** Server URL */
146
146
  serverUrl?: string;
@@ -151,7 +151,7 @@ export interface AgentsModuleConfig {
151
151
  * Agents module for managing AI agent conversations.
152
152
  *
153
153
  * This module provides methods to create and manage conversations with AI agents,
154
- * send messages, and subscribe to real-time updates. Conversations can be used
154
+ * send messages, and subscribe to realtime updates. Conversations can be used
155
155
  * for chat interfaces, support systems, or any interactive AI app.
156
156
  *
157
157
  * The agents module enables you to:
@@ -159,7 +159,7 @@ export interface AgentsModuleConfig {
159
159
  * - **Create conversations** with agents defined in the app.
160
160
  * - **Send messages** from users to agents and receive AI-generated responses.
161
161
  * - **Retrieve conversations** individually or as filtered lists with sorting and pagination.
162
- * - **Subscribe to real-time updates** using WebSocket connections to receive instant notifications when new messages arrive.
162
+ * - **Subscribe to realtime updates** using WebSocket connections to receive instant notifications when new messages arrive.
163
163
  * - **Attach metadata** to conversations for tracking context, categories, priorities, or linking to external systems.
164
164
  * - **Generate WhatsApp connection URLs** for users to interact with agents through WhatsApp.
165
165
  *
@@ -275,7 +275,7 @@ export interface AgentsModule {
275
275
  * Adds a message to a conversation.
276
276
  *
277
277
  * Sends a message to the agent and updates the conversation. This method
278
- * also updates the real-time socket to notify any subscribers.
278
+ * also updates the realtime socket to notify any subscribers.
279
279
  *
280
280
  * @param conversation - The conversation to add the message to.
281
281
  * @param message - The message to add.
@@ -293,19 +293,25 @@ export interface AgentsModule {
293
293
  */
294
294
  addMessage(conversation: AgentConversation, message: Partial<AgentMessage>): Promise<AgentMessage>;
295
295
  /**
296
- * Subscribes to real-time updates for a conversation.
296
+ * Subscribes to realtime updates for a conversation.
297
297
  *
298
298
  * Establishes a WebSocket connection to receive instant updates when new
299
299
  * messages are added to the conversation. Returns an unsubscribe function
300
300
  * to clean up the connection.
301
301
  *
302
302
  * @param conversationId - The conversation ID to subscribe to.
303
- * @param onUpdate - Callback function called when the conversation is updated.
303
+ * @param onUpdate - Callback function called when the conversation is updated. The callback receives a conversation object with the following properties:
304
+ * - `id`: Unique identifier for the conversation.
305
+ * - `agent_name`: Name of the agent in this conversation.
306
+ * - `created_date`: ISO 8601 timestamp of when the conversation was created.
307
+ * - `updated_date`: ISO 8601 timestamp of when the conversation was last updated.
308
+ * - `messages`: Array of messages in the conversation. Each message includes `id`, `role` (`'user'`, `'assistant'`, or `'system'`), `content`, `created_date`, and optionally `tool_calls`, `reasoning`, `file_urls`, and `usage`.
309
+ * - `metadata`: Optional metadata associated with the conversation.
304
310
  * @returns Unsubscribe function to stop receiving updates.
305
311
  *
306
312
  * @example
307
313
  * ```typescript
308
- * // Subscribe to real-time updates
314
+ * // Subscribe to realtime updates
309
315
  * const unsubscribe = base44.agents.subscribeToConversation(
310
316
  * 'conv-123',
311
317
  * (updatedConversation) => {
@@ -166,7 +166,6 @@ function startHeartBeatProcessor(track) {
166
166
  return () => { };
167
167
  }
168
168
  analyticsSharedState.isHeartBeatProcessing = true;
169
- track({ eventName: USER_HEARTBEAT_EVENT_NAME });
170
169
  const interval = setInterval(() => {
171
170
  track({ eventName: USER_HEARTBEAT_EVENT_NAME });
172
171
  }, analyticsSharedState.config.heartBeatInterval);
@@ -37,6 +37,9 @@ export type AnalyticsModuleOptions = {
37
37
  batchSize?: number;
38
38
  heartBeatInterval?: number;
39
39
  };
40
+ /**
41
+ * @internal
42
+ */
40
43
  export type AnalyticsModule = {
41
44
  track: (params: TrackEventParams) => void;
42
45
  };
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Parameters for calling a custom integration endpoint.
3
+ * @internal
3
4
  */
4
5
  export interface CustomIntegrationCallParams {
5
6
  /**
@@ -22,6 +23,7 @@ export interface CustomIntegrationCallParams {
22
23
  }
23
24
  /**
24
25
  * Response from a custom integration call.
26
+ * @internal
25
27
  */
26
28
  export interface CustomIntegrationCallResponse {
27
29
  /**
@@ -85,6 +87,7 @@ export interface CustomIntegrationCallResponse {
85
87
  * }
86
88
  * );
87
89
  * ```
90
+ * @internal
88
91
  */
89
92
  export interface CustomIntegrationsModule {
90
93
  /**
@@ -19,10 +19,6 @@ export interface RealtimeEvent {
19
19
  * Callback function invoked when a realtime event occurs.
20
20
  */
21
21
  export type RealtimeCallback = (event: RealtimeEvent) => void;
22
- /**
23
- * Function returned from subscribe, call it to unsubscribe.
24
- */
25
- export type Subscription = () => void;
26
22
  /**
27
23
  * Entity handler providing CRUD operations for a specific entity type.
28
24
  *
@@ -270,10 +266,16 @@ export interface EntityHandler {
270
266
  /**
271
267
  * Subscribes to realtime updates for all records of this entity type.
272
268
  *
273
- * Receives notifications whenever any record is created, updated, or deleted.
269
+ * Establishes a WebSocket connection to receive instant updates when any
270
+ * record is created, updated, or deleted. Returns an unsubscribe function
271
+ * to clean up the connection.
274
272
  *
275
- * @param callback - Function called when an entity changes.
276
- * @returns Unsubscribe function to stop listening.
273
+ * @param callback - Callback function called when an entity changes. The callback receives an event object with the following properties:
274
+ * - `type`: The type of change that occurred - `'create'`, `'update'`, or `'delete'`.
275
+ * - `data`: The entity data after the change.
276
+ * - `id`: The unique identifier of the affected entity.
277
+ * - `timestamp`: ISO 8601 timestamp of when the event occurred.
278
+ * @returns Unsubscribe function to stop receiving updates.
277
279
  *
278
280
  * @example
279
281
  * ```typescript
@@ -282,11 +284,11 @@ export interface EntityHandler {
282
284
  * console.log(`Task ${event.id} was ${event.type}d:`, event.data);
283
285
  * });
284
286
  *
285
- * // Later, unsubscribe
287
+ * // Later, clean up the subscription
286
288
  * unsubscribe();
287
289
  * ```
288
290
  */
289
- subscribe(callback: RealtimeCallback): Subscription;
291
+ subscribe(callback: RealtimeCallback): () => void;
290
292
  }
291
293
  /**
292
294
  * Entities module for managing app data.
@@ -359,6 +359,7 @@ export type IntegrationsModule = {
359
359
  * }
360
360
  * );
361
361
  * ```
362
+ * @internal
362
363
  */
363
364
  custom: CustomIntegrationsModule;
364
365
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.17-pr.75.4ddbc56",
3
+ "version": "0.8.17-pr.76.9ab8dcd",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,6 +20,7 @@
20
20
  "prepublishOnly": "npm run build",
21
21
  "create-docs": "npm run create-docs:generate && npm run create-docs:process",
22
22
  "push-docs": "node scripts/mintlify-post-processing/push-to-docs-repo.js",
23
+ "copy-docs-local": "node scripts/mintlify-post-processing/copy-to-local-docs.js",
23
24
  "create-docs:generate": "typedoc",
24
25
  "create-docs:process": "node scripts/mintlify-post-processing/file-processing/file-processing.js"
25
26
  },