@base44-preview/sdk 0.8.35-pr.214.aef73de → 0.8.35-pr.217.90d697b

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.
package/dist/client.js CHANGED
@@ -7,7 +7,6 @@ import { createConnectorsModule, createUserConnectorsModule, } from "./modules/c
7
7
  import { getAccessToken } from "./utils/auth-utils.js";
8
8
  import { createFunctionsModule } from "./modules/functions.js";
9
9
  import { createAgentsModule } from "./modules/agents.js";
10
- import { createAiGatewayModule } from "./modules/ai-gateway.js";
11
10
  import { createAppLogsModule } from "./modules/app-logs.js";
12
11
  import { createUsersModule } from "./modules/users.js";
13
12
  import { RoomsSocket } from "./utils/socket-utils.js";
@@ -151,7 +150,6 @@ export function createClient(config) {
151
150
  serverUrl,
152
151
  token,
153
152
  }),
154
- aiGateway: createAiGatewayModule({ serverUrl, token }),
155
153
  appLogs: createAppLogsModule(axiosClient, appId),
156
154
  users: createUsersModule(axiosClient, appId),
157
155
  analytics: createAnalyticsModule({
@@ -194,7 +192,6 @@ export function createClient(config) {
194
192
  serverUrl,
195
193
  token,
196
194
  }),
197
- aiGateway: createAiGatewayModule({ serverUrl, token: serviceToken }),
198
195
  appLogs: createAppLogsModule(serviceRoleAxiosClient, appId),
199
196
  cleanup: () => {
200
197
  if (socket) {
@@ -5,7 +5,6 @@ import type { SsoModule } from "./modules/sso.types.js";
5
5
  import type { ConnectorsModule, UserConnectorsModule } from "./modules/connectors.types.js";
6
6
  import type { FunctionsModule } from "./modules/functions.types.js";
7
7
  import type { AgentsModule } from "./modules/agents.types.js";
8
- import type { AiGatewayModule } from "./modules/ai-gateway.types.js";
9
8
  import type { AppLogsModule } from "./modules/app-logs.types.js";
10
9
  import type { AnalyticsModule } from "./modules/analytics.types.js";
11
10
  /**
@@ -82,8 +81,6 @@ export interface CreateClientConfig {
82
81
  export interface Base44Client {
83
82
  /** {@link AgentsModule | Agents module} for managing AI agent conversations. */
84
83
  agents: AgentsModule;
85
- /** {@link AiGatewayModule | AI Gateway module} for connecting to the Base44 AI Gateway with your own SDK. */
86
- aiGateway: AiGatewayModule;
87
84
  /** {@link AnalyticsModule | Analytics module} for tracking custom events in your app. */
88
85
  analytics: AnalyticsModule;
89
86
  /** {@link AppLogsModule | App logs module} for tracking app usage. */
@@ -127,8 +124,6 @@ export interface Base44Client {
127
124
  readonly asServiceRole: {
128
125
  /** {@link AgentsModule | Agents module} with elevated permissions. */
129
126
  agents: AgentsModule;
130
- /** {@link AiGatewayModule | AI Gateway module} with the service-role token. */
131
- aiGateway: AiGatewayModule;
132
127
  /** {@link AppLogsModule | App logs module} with elevated permissions. */
133
128
  appLogs: AppLogsModule;
134
129
  /** {@link ConnectorsModule | Connectors module} for OAuth token retrieval. */
package/dist/index.d.ts CHANGED
@@ -9,7 +9,6 @@ export type { AuthModule, LoginResponse, RegisterParams, VerifyOtpParams, Change
9
9
  export type { IntegrationsModule, 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, FunctionName, FunctionNameRegistry, } from "./modules/functions.types.js";
11
11
  export type { AgentsModule, AgentName, AgentNameRegistry, AgentConversation, AgentMessage, AgentMessageReasoning, AgentMessageToolCall, AgentMessageUsage, AgentMessageCustomContext, AgentMessageMetadata, CreateConversationParams, } from "./modules/agents.types.js";
12
- export type { AiGatewayModule, AiGatewayConnection, } from "./modules/ai-gateway.types.js";
13
12
  export type { AppLogsModule } from "./modules/app-logs.types.js";
14
13
  export type { SsoModule, SsoAccessTokenResponse } from "./modules/sso.types.js";
15
14
  export type { ConnectorsModule, UserConnectorsModule, } from "./modules/connectors.types.js";
@@ -1,5 +1,4 @@
1
1
  export * from "./app.types.js";
2
2
  export * from "./agents.types.js";
3
- export * from "./ai-gateway.types.js";
4
3
  export * from "./connectors.types.js";
5
4
  export * from "./analytics.types.js";
@@ -1,5 +1,4 @@
1
1
  export * from "./app.types.js";
2
2
  export * from "./agents.types.js";
3
- export * from "./ai-gateway.types.js";
4
3
  export * from "./connectors.types.js";
5
4
  export * from "./analytics.types.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.35-pr.214.aef73de",
3
+ "version": "0.8.35-pr.217.90d697b",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import { AiGatewayModule, AiGatewayModuleConfig } from "./ai-gateway.types.js";
2
- export declare function createAiGatewayModule({ serverUrl, token, }: AiGatewayModuleConfig): AiGatewayModule;
@@ -1,13 +0,0 @@
1
- import { getAccessToken } from "../utils/auth-utils.js";
2
- export function createAiGatewayModule({ serverUrl, token, }) {
3
- const connection = () => {
4
- var _a;
5
- return ({
6
- baseURL: `${serverUrl}/api/ai/openai/v1`,
7
- token: (_a = token !== null && token !== void 0 ? token : getAccessToken()) !== null && _a !== void 0 ? _a : "",
8
- });
9
- };
10
- return {
11
- connection,
12
- };
13
- }
@@ -1,65 +0,0 @@
1
- /**
2
- * A connection to the Base44 AI Gateway.
3
- *
4
- * Contains the base URL and bearer token to use with any OpenAI-compatible client
5
- * (the OpenAI SDK, Mastra, and others) pointed at the Base44 AI Gateway.
6
- */
7
- export interface AiGatewayConnection {
8
- /** Base URL of the gateway's OpenAI-compatible endpoint. */
9
- baseURL: string;
10
- /** Bearer token used to authenticate requests to the gateway. */
11
- token: string;
12
- }
13
- /**
14
- * Configuration for the AI Gateway module.
15
- * @internal
16
- */
17
- export interface AiGatewayModuleConfig {
18
- /** Server URL */
19
- serverUrl?: string;
20
- /** Authentication token */
21
- token?: string;
22
- }
23
- /**
24
- * The AI Gateway module.
25
- *
26
- * Exposes the connection details for the Base44 AI Gateway so you can call it from
27
- * your own code using any OpenAI-compatible SDK — for example, to build a custom
28
- * agent on top of the gateway.
29
- */
30
- export interface AiGatewayModule {
31
- /**
32
- * Gets the connection details for the Base44 AI Gateway.
33
- *
34
- * Returns the `baseURL` and `token` to pass to any OpenAI-compatible client (the
35
- * OpenAI SDK, Mastra, and others), so you can call the gateway from your own code
36
- * without constructing the URL or handling the token yourself.
37
- *
38
- * The `token` is the current caller's bearer token: the app user's token for
39
- * `base44.aiGateway`, or the service-role token for `base44.asServiceRole.aiGateway`.
40
- * When the caller is unauthenticated, `token` is an empty string and gateway
41
- * requests will be rejected.
42
- *
43
- * @returns The gateway {@linkcode AiGatewayConnection | connection} (`baseURL` and `token`).
44
- *
45
- * @example
46
- * ```typescript
47
- * // Inside a backend function, call the gateway with any OpenAI-compatible SDK
48
- * import { createClientFromRequest } from 'npm:@base44/sdk';
49
- * import OpenAI from 'npm:openai';
50
- *
51
- * Deno.serve(async (req) => {
52
- * const base44 = createClientFromRequest(req);
53
- * const { baseURL, token } = base44.aiGateway.connection();
54
- *
55
- * const openai = new OpenAI({ baseURL, apiKey: token });
56
- * const res = await openai.chat.completions.create({
57
- * model: 'claude_sonnet_4_6',
58
- * messages: [{ role: 'user', content: 'Hello!' }],
59
- * });
60
- * return Response.json({ text: res.choices[0].message.content });
61
- * });
62
- * ```
63
- */
64
- connection(): AiGatewayConnection;
65
- }
@@ -1 +0,0 @@
1
- export {};