@base44-preview/platform 0.1.0-pr.319.1e807d1 → 0.1.0-pr.319.cf89f7f
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/README.md +3 -3
- package/dist/client/client.d.ts +9 -3
- package/dist/client/client.js +6 -5
- package/dist/client/client.types.d.ts +0 -6
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ shared socket. It is independent of the app SDK (`@base44/sdk`).
|
|
|
10
10
|
The workspace must have white-label sockets enabled; this SDK does not open sessions.
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
|
-
import {
|
|
13
|
+
import { Base44PlatformClient } from "@base44/platform";
|
|
14
14
|
|
|
15
|
-
const client =
|
|
15
|
+
const client = new Base44PlatformClient({
|
|
16
16
|
serverUrl: "https://base44.app",
|
|
17
17
|
async getSessionToken() {
|
|
18
18
|
const response = await fetch("/api/builder-socket-session", { method: "POST" });
|
|
@@ -109,7 +109,7 @@ older one, which stops with `session_replaced`. Open one session per page.
|
|
|
109
109
|
|
|
110
110
|
## Lifecycle
|
|
111
111
|
|
|
112
|
-
`
|
|
112
|
+
`new Base44PlatformClient({ serverUrl, getSessionToken })` creates a lightweight module
|
|
113
113
|
container: no Socket.IO instance, timers, token request or network activity. Its
|
|
114
114
|
`builder` module follows the server SDK's module-factory pattern.
|
|
115
115
|
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { PlatformClientOptions } from "./client.types.js";
|
|
2
|
+
import type { BuilderModule } from "./modules/builder.types.js";
|
|
3
|
+
/** Browser platform client. Construction creates no sockets, timers or network requests. */
|
|
4
|
+
export declare class Base44PlatformClient {
|
|
5
|
+
/** Lazy builder subscriptions with independent session lifecycles. */
|
|
6
|
+
readonly builder: BuilderModule;
|
|
7
|
+
/** Configure shared service/auth settings; each module initializes its own resources. */
|
|
8
|
+
constructor(options: PlatformClientOptions);
|
|
9
|
+
}
|
package/dist/client/client.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { normalizeServerUrl } from "../shared/server-url.js";
|
|
2
2
|
import { createBuilder } from "./modules/builder.js";
|
|
3
|
-
/**
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
/** Browser platform client. Construction creates no sockets, timers or network requests. */
|
|
4
|
+
export class Base44PlatformClient {
|
|
5
|
+
/** Configure shared service/auth settings; each module initializes its own resources. */
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.builder = Object.freeze(createBuilder({ ...options, serverUrl: normalizeServerUrl(options.serverUrl) }));
|
|
8
|
+
}
|
|
8
9
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { BuilderModule } from "./modules/builder.types.js";
|
|
2
1
|
/** Shared configuration for browser platform modules. Never supply an API key. */
|
|
3
2
|
export interface PlatformClientOptions {
|
|
4
3
|
/** Origin of the platform service, e.g. https://base44.app. No path/query/credentials. */
|
|
@@ -11,8 +10,3 @@ export interface PlatformClientOptions {
|
|
|
11
10
|
*/
|
|
12
11
|
getSessionToken: () => string | Promise<string>;
|
|
13
12
|
}
|
|
14
|
-
/** Browser platform client, returned by `createBase44PlatformClient`. */
|
|
15
|
-
export interface Base44PlatformClient {
|
|
16
|
-
/** Lazy builder subscriptions with independent session lifecycles. */
|
|
17
|
-
readonly builder: BuilderModule;
|
|
18
|
-
}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Browser platform modules, separate from the runtime and server SDKs. */
|
|
2
|
-
export {
|
|
2
|
+
export { Base44PlatformClient } from "./client.js";
|
|
3
3
|
export { PlatformSocketError } from "./errors.js";
|
|
4
4
|
export type { PlatformSocketErrorCode } from "./errors.types.js";
|
|
5
|
-
export type {
|
|
5
|
+
export type { PlatformClientOptions } from "./client.types.js";
|
|
6
6
|
export type { BuilderModule, BuilderInitOptions, BuilderSession, PlatformSubscription, SubscriptionOptions } from "./modules/builder.types.js";
|
|
7
7
|
export type { AppStatus, AppStatusChanged, BranchScoped, ChatMessage, ImageResolved, MessageParams, MessageRemoved, MessageUpdated, PlatformEvent, PlatformEventMap, PreviewNavigationRequested, QueueItem, QueueUpdated, Snapshot, SnapshotQueue, TaskProgressed, ToolArguments, ToolCall, ToolDisplay, ToolEntityMutationArguments, ToolGuardApproval, ToolMediaArguments, ToolMediaResult, ToolPackageArguments, ToolPackageOperation, ToolPlanArguments, ToolPlanUpdate, ToolPrdArguments, ToolQuestion, ToolQuestionAnswer, ToolQuestionArguments, ToolQuestionInput, ToolQuestionOption, ToolSecretArguments, ToolSecretField, } from "./modules/builder.events.types.js";
|
package/dist/client/index.js
CHANGED
package/package.json
CHANGED