@base44-preview/sdk 0.8.44-pr.265.a1a63b2 → 0.8.44-pr.267.4549331

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/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import { createClient, createClientFromRequest, type Base44Client, type CreateClientConfig, type CreateClientOptions } from "./client.js";
2
- import { createPlatformClient, type CreatePlatformClientConfig, type PlatformClient, type PrincipalClient } from "./platform-client.js";
3
- import { createBuilderSession, type CreateBuilderSessionConfig } from "./builder-session.js";
4
2
  import { Base44Error, type Base44ErrorJSON } from "./utils/axios-client.js";
5
3
  import { getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl } from "./utils/auth-utils.js";
6
- export { createClient, createClientFromRequest, createPlatformClient, createBuilderSession, Base44Error, getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl, };
7
- export type { Base44Client, CreateClientConfig, CreateClientOptions, Base44ErrorJSON, CreatePlatformClientConfig, PlatformClient, PrincipalClient, CreateBuilderSessionConfig, };
4
+ export { createClient, createClientFromRequest, Base44Error, getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl, };
5
+ export type { Base44Client, CreateClientConfig, CreateClientOptions, Base44ErrorJSON, };
8
6
  export * from "./types.js";
9
7
  export type { DeleteManyResult, DeleteResult, EntitiesModule, EntityFilterOperators, EntityFilterQuery, EntityFilterValue, EntityHandler, EntityRecord, EntityTypeRegistry, ImportResult, RealtimeEventType, RealtimeEvent, RealtimeCallback, SortField, UpdateManyResult, } from "./modules/entities.types.js";
10
8
  export type { AuthModule, LoginResponse, RegisterParams, VerifyOtpParams, ChangePasswordParams, ResetPasswordParams, User, } from "./modules/auth.types.js";
@@ -15,8 +13,6 @@ export type { AiGatewayModule, AiGatewayConnection, } from "./modules/ai-gateway
15
13
  export type { AppLogsModule } from "./modules/app-logs.types.js";
16
14
  export type { ActorsModule, ActorClient, ActorRef, Connection, ActorSubscription, ActorConnectOptions, ActorNameRegistry, ActorRegistry, } from "./modules/actors.types.js";
17
15
  export type { SsoModule, SsoAccessTokenResponse } from "./modules/sso.types.js";
18
- export type { PlatformsModule, PrincipalRole, ProvisionPrincipalParams, ServicePrincipal, DeprovisionResult, } from "./modules/platforms.types.js";
19
- export type { BuilderEvent, BuilderEventType, BuilderGrant, BuilderMessage, BuilderMessagePage, BuilderResponse, BuilderSession, BuilderSessionReader, BuilderState, BuilderStatus, BuilderToolCall, BuilderTurn, BuilderTurnRef, BuilderWaitingKind, BuilderWaitingOn, CreateBuilderGrantOptions, ListBuilderMessagesOptions, RespondToBuilderOptions, SendBuilderMessageOptions, SubscribeToBuilderOptions, WaitForTurnOptions, } from "./modules/builder.types.js";
20
16
  export { Actor, type Conn } from "./actor.js";
21
17
  export type { ConnectorsModule, UserConnectorsModule, ConnectorApiRequest, ConnectorApiResponse, ConnectorApiResponsePhase, } from "./modules/connectors.types.js";
22
18
  export type { CustomIntegrationsModule, CustomIntegrationCallParams, CustomIntegrationCallResponse, } from "./modules/custom-integrations.types.js";
package/dist/index.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import { createClient, createClientFromRequest, } from "./client.js";
2
- import { createPlatformClient, } from "./platform-client.js";
3
- import { createBuilderSession, } from "./builder-session.js";
4
2
  import { Base44Error } from "./utils/axios-client.js";
5
3
  import { getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl, } from "./utils/auth-utils.js";
6
- export { createClient, createClientFromRequest, createPlatformClient, createBuilderSession, Base44Error, getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl, };
4
+ export { createClient, createClientFromRequest, Base44Error, getAccessToken, saveAccessToken, removeAccessToken, getLoginUrl, };
7
5
  export * from "./types.js";
8
6
  export { Actor } from "./actor.js";
@@ -43,9 +43,9 @@ export interface InvokeLLMParams {
43
43
  prompt: string;
44
44
  /** Optionally specify a model to override the app-level model setting for this specific call.
45
45
  *
46
- * Options: `"gpt_5_mini"`, `"gemini_3_flash"`, `"gpt_5_4"`, `"gpt_5_5"`, `"gemini_3_1_pro"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`, `"claude_opus_4_8"`
46
+ * Options: `"gpt_5_mini"`, `"gemini_3_flash"`, `"gpt_5_4"`, `"gpt_5_6_sol"`, `"gpt_5_6_luna"`, `"gemini_3_1_pro"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`, `"claude_opus_4_8"`, `"claude-sonnet-5"`
47
47
  */
48
- model?: 'gpt_5_mini' | 'gemini_3_flash' | 'gpt_5_4' | 'gpt_5_5' | 'gemini_3_1_pro' | 'claude_sonnet_4_6' | 'claude_opus_4_6' | 'claude_opus_4_7' | 'claude_opus_4_8';
48
+ model?: 'gpt_5_mini' | 'gemini_3_flash' | 'gpt_5_4' | 'gpt_5_6_sol' | 'gpt_5_6_luna' | 'gemini_3_1_pro' | 'claude_sonnet_4_6' | 'claude_opus_4_6' | 'claude_opus_4_7' | 'claude_opus_4_8' | 'claude-sonnet-5';
49
49
  /** If set to `true`, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
50
50
  * @default false
51
51
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.44-pr.265.a1a63b2",
3
+ "version": "0.8.44-pr.267.4549331",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,79 +0,0 @@
1
- import type { BuilderSessionReader } from "./modules/builder.types.js";
2
- import type { CreateClientOptions } from "./client.types.js";
3
- /**
4
- * Configuration for reading a builder session with a grant.
5
- */
6
- export interface CreateBuilderSessionConfig {
7
- /** The app being built. A builder session *is* an app — there is nothing separate to open. */
8
- appId: string;
9
- /**
10
- * The Base44 server URL.
11
- *
12
- * @defaultValue `"https://base44.app"`
13
- */
14
- serverUrl?: string;
15
- /**
16
- * A grant token.
17
- *
18
- * Use {@link CreateBuilderSessionConfig.getToken | getToken} instead for anything
19
- * that outlives one grant, which most builds do.
20
- */
21
- token?: string;
22
- /**
23
- * Called for a grant before every request and every stream (re)connect.
24
- *
25
- * The shape to prefer. A grant is short-lived on purpose, so a build routinely
26
- * outlasts the one it started with; re-reading the credential rather than
27
- * capturing it is what makes a refresh invisible to the caller, and it is the
28
- * habit the SDK's actors module already has internally.
29
- */
30
- getToken?: () => string | Promise<string> | undefined;
31
- /** Additional client options. */
32
- options?: CreateClientOptions;
33
- }
34
- /**
35
- * Reads one builder session with a grant.
36
- *
37
- * The browser's entry point. A grant is read-only, scoped to one session and
38
- * short-lived, so this returns the read half of a builder session and nothing else
39
- * — the writes live on the server, where the credential that can start a turn
40
- * belongs.
41
- *
42
- * That asymmetry is the design rather than a limitation, and it is the thing an
43
- * integrator gets wrong first: reads go browser to Base44 directly, keeping an
44
- * open stream off your serverless function path, while writes go browser to your
45
- * server to Base44. Because a grant cannot send, no configuration lets a leaked
46
- * browser credential spend your workspace's credits.
47
- *
48
- * Mint the grant on your server with
49
- * {@link BuilderSession.createGrant | createGrant()}.
50
- *
51
- * @param config - The app, and how to get a grant for it.
52
- * @returns The read-only session.
53
- *
54
- * @example
55
- * ```typescript
56
- * import { createBuilderSession } from '@base44/sdk';
57
- *
58
- * const builder = createBuilderSession({
59
- * appId,
60
- * // Re-read on every reconnect, so a build outliving its grant just works.
61
- * getToken: () =>
62
- * fetch('/api/base44/grant', { method: 'POST', body: JSON.stringify({ appId }) })
63
- * .then((response) => response.json())
64
- * .then((grant) => grant.token),
65
- * });
66
- *
67
- * const unsubscribe = builder.subscribe((event) => {
68
- * switch (event.type) {
69
- * case 'message.updated': upsertMessage(event.data); break; // by messageId
70
- * case 'state.changed': setStatus(event.data); break;
71
- * case 'turn.finished': markDone(event.turnId); break;
72
- * }
73
- * });
74
- *
75
- * // Sending goes to YOUR server, which holds the write credential.
76
- * await fetch('/api/base44/message', { method: 'POST', body: … });
77
- * ```
78
- */
79
- export declare function createBuilderSession(config: CreateBuilderSessionConfig): BuilderSessionReader;
@@ -1,59 +0,0 @@
1
- import { createAxiosClient } from "./utils/axios-client.js";
2
- import { createBuilderSessionReader } from "./modules/builder.js";
3
- /**
4
- * Reads one builder session with a grant.
5
- *
6
- * The browser's entry point. A grant is read-only, scoped to one session and
7
- * short-lived, so this returns the read half of a builder session and nothing else
8
- * — the writes live on the server, where the credential that can start a turn
9
- * belongs.
10
- *
11
- * That asymmetry is the design rather than a limitation, and it is the thing an
12
- * integrator gets wrong first: reads go browser to Base44 directly, keeping an
13
- * open stream off your serverless function path, while writes go browser to your
14
- * server to Base44. Because a grant cannot send, no configuration lets a leaked
15
- * browser credential spend your workspace's credits.
16
- *
17
- * Mint the grant on your server with
18
- * {@link BuilderSession.createGrant | createGrant()}.
19
- *
20
- * @param config - The app, and how to get a grant for it.
21
- * @returns The read-only session.
22
- *
23
- * @example
24
- * ```typescript
25
- * import { createBuilderSession } from '@base44/sdk';
26
- *
27
- * const builder = createBuilderSession({
28
- * appId,
29
- * // Re-read on every reconnect, so a build outliving its grant just works.
30
- * getToken: () =>
31
- * fetch('/api/base44/grant', { method: 'POST', body: JSON.stringify({ appId }) })
32
- * .then((response) => response.json())
33
- * .then((grant) => grant.token),
34
- * });
35
- *
36
- * const unsubscribe = builder.subscribe((event) => {
37
- * switch (event.type) {
38
- * case 'message.updated': upsertMessage(event.data); break; // by messageId
39
- * case 'state.changed': setStatus(event.data); break;
40
- * case 'turn.finished': markDone(event.turnId); break;
41
- * }
42
- * });
43
- *
44
- * // Sending goes to YOUR server, which holds the write credential.
45
- * await fetch('/api/base44/message', { method: 'POST', body: … });
46
- * ```
47
- */
48
- export function createBuilderSession(config) {
49
- const { appId, serverUrl = "https://base44.app", token, getToken, options, } = config;
50
- return createBuilderSessionReader({
51
- axios: createAxiosClient({
52
- baseURL: `${serverUrl}/api`,
53
- onError: options === null || options === void 0 ? void 0 : options.onError,
54
- }),
55
- appId,
56
- serverUrl,
57
- getToken: getToken !== null && getToken !== void 0 ? getToken : (() => token),
58
- });
59
- }
@@ -1,38 +0,0 @@
1
- import type { AxiosInstance } from "axios";
2
- import type { BuilderSession, BuilderSessionReader } from "./builder.types.js";
3
- /** What the build module needs to talk to one app's session. @internal */
4
- export interface BuilderSessionDeps {
5
- /** An Axios client based at `${serverUrl}/api`. */
6
- axios: AxiosInstance;
7
- /** The app whose builder session this is. */
8
- appId: string;
9
- /** Used to build the absolute stream URL, which `fetch` needs. */
10
- serverUrl: string;
11
- /**
12
- * Re-read before every request and every stream (re)connect.
13
- *
14
- * A getter rather than a string because both credentials that reach here
15
- * rotate: a grant expires inside a single build, and a principal's access
16
- * token lives an hour. Capturing either would work right up until the first
17
- * build long enough to matter.
18
- *
19
- * Omitted when the Axios client already carries a static credential.
20
- */
21
- getToken?: () => string | Promise<string> | undefined;
22
- }
23
- /**
24
- * The read half of a builder session — what a grant can do.
25
- *
26
- * @param deps - Transport, app id and credential.
27
- * @returns The read-only session.
28
- * @internal
29
- */
30
- export declare function createBuilderSessionReader(deps: BuilderSessionDeps): BuilderSessionReader;
31
- /**
32
- * A builder session with the writes, for a credential that may start turns.
33
- *
34
- * @param deps - Transport, app id and credential.
35
- * @returns The full session.
36
- * @internal
37
- */
38
- export declare function createBuilderSessionModule(deps: BuilderSessionDeps): BuilderSession;