@lessly/sdk-app 50.0.0 → 51.0.0
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/analytics/index.d.cts +1 -1
- package/dist/analytics/index.d.ts +1 -1
- package/dist/brain/index.cjs +0 -5
- package/dist/brain/index.cjs.map +1 -1
- package/dist/brain/index.d.cts +2 -6
- package/dist/brain/index.d.ts +2 -6
- package/dist/brain/index.js +1 -5
- package/dist/brain/index.js.map +1 -1
- package/dist/chunk-5IRH5DIK.js +8710 -0
- package/dist/chunk-5IRH5DIK.js.map +1 -0
- package/dist/{client.gen-Dw0AIIZi.d.cts → client.gen-Boew7CkH.d.cts} +4824 -363
- package/dist/{client.gen-Dw0AIIZi.d.ts → client.gen-Boew7CkH.d.ts} +4824 -363
- package/dist/consent/index.d.cts +1 -1
- package/dist/consent/index.d.ts +1 -1
- package/dist/content/index.cjs +161 -0
- package/dist/content/index.cjs.map +1 -0
- package/dist/content/index.d.cts +128 -0
- package/dist/content/index.d.ts +128 -0
- package/dist/content/index.js +129 -0
- package/dist/content/index.js.map +1 -0
- package/dist/deployment/index.cjs +15 -5
- package/dist/deployment/index.cjs.map +1 -1
- package/dist/deployment/index.d.cts +14 -6
- package/dist/deployment/index.d.ts +14 -6
- package/dist/deployment/index.js +13 -5
- package/dist/deployment/index.js.map +1 -1
- package/dist/index.cjs +780 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -83
- package/dist/index.d.ts +4 -83
- package/dist/index.js +2 -8016
- package/dist/index.js.map +1 -1
- package/dist/mail/index.d.cts +2 -2
- package/dist/mail/index.d.ts +2 -2
- package/dist/observe/index.d.cts +1 -1
- package/dist/observe/index.d.ts +1 -1
- package/dist/organization/index.d.cts +1 -1
- package/dist/organization/index.d.ts +1 -1
- package/dist/playground/index.cjs +81 -0
- package/dist/playground/index.cjs.map +1 -0
- package/dist/playground/index.d.cts +55 -0
- package/dist/playground/index.d.ts +55 -0
- package/dist/playground/index.js +58 -0
- package/dist/playground/index.js.map +1 -0
- package/dist/realtime/index.d.cts +1 -1
- package/dist/realtime/index.d.ts +1 -1
- package/dist/support/index.d.cts +1 -1
- package/dist/support/index.d.ts +1 -1
- package/dist/tracking/index.d.cts +1 -1
- package/dist/tracking/index.d.ts +1 -1
- package/dist/types-gTIUAUsP.d.cts +82 -0
- package/dist/types-gTIUAUsP.d.ts +82 -0
- package/dist/users/index.d.cts +1 -1
- package/dist/users/index.d.ts +1 -1
- package/dist/waitlist/index.d.cts +1 -1
- package/dist/waitlist/index.d.ts +1 -1
- package/package.json +12 -2
- package/src/gen/bindings.gen.ts +789 -99
- package/src/gen/brain/index.ts +1 -1
- package/src/gen/brain/queryOptions.gen.ts +0 -7
- package/src/gen/client.gen.ts +180 -10
- package/src/gen/content/index.ts +3 -0
- package/src/gen/content/queryOptions.gen.ts +202 -0
- package/src/gen/deployment/index.ts +1 -1
- package/src/gen/deployment/queryOptions.gen.ts +20 -7
- package/src/gen/manifest.gen.ts +1 -1
- package/src/gen/playground/connect.gen.ts +9 -0
- package/src/gen/playground/index.ts +4 -0
- package/src/gen/playground/queryOptions.gen.ts +86 -0
- package/src/gen/types.gen.ts +4403 -154
package/dist/index.d.cts
CHANGED
|
@@ -1,85 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type ParamIn = 'path' | 'query' | 'body';
|
|
5
|
-
interface ParamSpec {
|
|
6
|
-
name: string;
|
|
7
|
-
in: ParamIn;
|
|
8
|
-
}
|
|
9
|
-
interface Binding {
|
|
10
|
-
method: HttpMethod;
|
|
11
|
-
path: string;
|
|
12
|
-
readOnly: boolean;
|
|
13
|
-
params?: ParamSpec[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The streaming counterpart of `Binding`: the upgrade route of a ws-bound tool. No method (an
|
|
17
|
-
* upgrade is always a GET) and no `readOnly` (a socket is neither a read nor a write — the tool's
|
|
18
|
-
* own description defines its framing).
|
|
19
|
-
*/
|
|
20
|
-
interface WsBinding {
|
|
21
|
-
path: string;
|
|
22
|
-
params?: ParamSpec[];
|
|
23
|
-
}
|
|
24
|
-
type ActionBindings = Record<string, Binding>;
|
|
25
|
-
type ResourceBindings = Record<string, ActionBindings>;
|
|
26
|
-
type BindingsMap = Record<string, ResourceBindings>;
|
|
27
|
-
type WsActionBindings = Record<string, WsBinding>;
|
|
28
|
-
type WsResourceBindings = Record<string, WsActionBindings>;
|
|
29
|
-
type WsBindingsMap = Record<string, WsResourceBindings>;
|
|
30
|
-
/** Close information, as delivered to every `onClose` subscriber. */
|
|
31
|
-
interface StreamCloseInfo {
|
|
32
|
-
code: number;
|
|
33
|
-
reason: string;
|
|
34
|
-
wasClean: boolean;
|
|
35
|
-
}
|
|
36
|
-
/** Frame payload, exactly as the socket delivered it — never parsed by the SDK. */
|
|
37
|
-
type StreamData = string | ArrayBufferLike | ArrayBufferView | Blob;
|
|
38
|
-
/**
|
|
39
|
-
* The handle returned by `connectStream`. Deliberately small: no reconnection, no backoff, no
|
|
40
|
-
* heartbeat and no framing. A dropped connection surfaces once, through `onClose` with the close
|
|
41
|
-
* code; deciding whether and how to reconnect is the App's business, not the SDK's.
|
|
42
|
-
*/
|
|
43
|
-
interface LesslyStream {
|
|
44
|
-
/** Queued until the socket is OPEN, then flushed in order. Ignored once the stream is closed. */
|
|
45
|
-
send(data: StreamData): void;
|
|
46
|
-
close(code?: number, reason?: string): void;
|
|
47
|
-
/** Delivers `MessageEvent.data` as-is. Returns an unsubscribe function. */
|
|
48
|
-
onMessage(cb: (data: StreamData) => void): () => void;
|
|
49
|
-
/** Returns an unsubscribe function. */
|
|
50
|
-
onClose(cb: (info: StreamCloseInfo) => void): () => void;
|
|
51
|
-
/** The underlying socket's readyState (0 CONNECTING, 1 OPEN, 2 CLOSING, 3 CLOSED). */
|
|
52
|
-
readonly readyState: number;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* What a generated `<tool>Connect` factory needs from the client: the ability to open a stream
|
|
56
|
-
* for a binding. `createLesslyApp`'s client implements it (see `LesslyClientBase`).
|
|
57
|
-
*/
|
|
58
|
-
interface LesslyStreamOpener {
|
|
59
|
-
openStream(binding: WsBinding, input?: Record<string, unknown>): LesslyStream;
|
|
60
|
-
}
|
|
61
|
-
/** The shape of `globalThis.WebSocket` this SDK relies on — injectable, like `fetch`. */
|
|
62
|
-
type WebSocketCtor = new (url: string) => WebSocketLike;
|
|
63
|
-
interface WebSocketLike {
|
|
64
|
-
readonly readyState: number;
|
|
65
|
-
send(data: StreamData): void;
|
|
66
|
-
close(code?: number, reason?: string): void;
|
|
67
|
-
addEventListener(type: string, cb: (ev: never) => void): void;
|
|
68
|
-
removeEventListener(type: string, cb: (ev: never) => void): void;
|
|
69
|
-
}
|
|
70
|
-
interface LesslyAppOptions {
|
|
71
|
-
/**
|
|
72
|
-
* Absolute origin ("https://api.lessly.dev") or a path relative to the page
|
|
73
|
-
* ("/api", ""), which is resolved against globalThis.location and therefore
|
|
74
|
-
* only works in a browser.
|
|
75
|
-
*/
|
|
76
|
-
baseUrl: string;
|
|
77
|
-
productId: string;
|
|
78
|
-
getCsrfToken?: () => string | null | undefined;
|
|
79
|
-
fetch?: typeof fetch;
|
|
80
|
-
/** Injectable WebSocket constructor for `connectStream`; defaults to `globalThis.WebSocket`. */
|
|
81
|
-
WebSocket?: WebSocketCtor;
|
|
82
|
-
}
|
|
1
|
+
import { L as LesslyStreamOpener, b as LesslyAppOptions, W as WsBinding, a as LesslyStream } from './types-gTIUAUsP.cjs';
|
|
2
|
+
export { B as Binding, c as BindingsMap, H as HttpMethod, P as ParamIn, d as ParamSpec, S as StreamCloseInfo, e as StreamData, f as WebSocketCtor, g as WebSocketLike, h as WsBindingsMap } from './types-gTIUAUsP.cjs';
|
|
3
|
+
import { G as GeneratedClient } from './client.gen-Boew7CkH.cjs';
|
|
83
4
|
|
|
84
5
|
interface LesslyClientBase extends LesslyStreamOpener {
|
|
85
6
|
call(toolName: string, input?: Record<string, unknown>): Promise<unknown>;
|
|
@@ -108,4 +29,4 @@ declare class LesslyApiError extends Error {
|
|
|
108
29
|
constructor(status: number, code: string | null, message: string, body: unknown);
|
|
109
30
|
}
|
|
110
31
|
|
|
111
|
-
export {
|
|
32
|
+
export { GeneratedClient, LesslyApiError, LesslyAppOptions, type LesslyClientBase, LesslyStream, LesslyStreamOpener, WsBinding, connectStream, createLesslyApp };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,85 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type ParamIn = 'path' | 'query' | 'body';
|
|
5
|
-
interface ParamSpec {
|
|
6
|
-
name: string;
|
|
7
|
-
in: ParamIn;
|
|
8
|
-
}
|
|
9
|
-
interface Binding {
|
|
10
|
-
method: HttpMethod;
|
|
11
|
-
path: string;
|
|
12
|
-
readOnly: boolean;
|
|
13
|
-
params?: ParamSpec[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The streaming counterpart of `Binding`: the upgrade route of a ws-bound tool. No method (an
|
|
17
|
-
* upgrade is always a GET) and no `readOnly` (a socket is neither a read nor a write — the tool's
|
|
18
|
-
* own description defines its framing).
|
|
19
|
-
*/
|
|
20
|
-
interface WsBinding {
|
|
21
|
-
path: string;
|
|
22
|
-
params?: ParamSpec[];
|
|
23
|
-
}
|
|
24
|
-
type ActionBindings = Record<string, Binding>;
|
|
25
|
-
type ResourceBindings = Record<string, ActionBindings>;
|
|
26
|
-
type BindingsMap = Record<string, ResourceBindings>;
|
|
27
|
-
type WsActionBindings = Record<string, WsBinding>;
|
|
28
|
-
type WsResourceBindings = Record<string, WsActionBindings>;
|
|
29
|
-
type WsBindingsMap = Record<string, WsResourceBindings>;
|
|
30
|
-
/** Close information, as delivered to every `onClose` subscriber. */
|
|
31
|
-
interface StreamCloseInfo {
|
|
32
|
-
code: number;
|
|
33
|
-
reason: string;
|
|
34
|
-
wasClean: boolean;
|
|
35
|
-
}
|
|
36
|
-
/** Frame payload, exactly as the socket delivered it — never parsed by the SDK. */
|
|
37
|
-
type StreamData = string | ArrayBufferLike | ArrayBufferView | Blob;
|
|
38
|
-
/**
|
|
39
|
-
* The handle returned by `connectStream`. Deliberately small: no reconnection, no backoff, no
|
|
40
|
-
* heartbeat and no framing. A dropped connection surfaces once, through `onClose` with the close
|
|
41
|
-
* code; deciding whether and how to reconnect is the App's business, not the SDK's.
|
|
42
|
-
*/
|
|
43
|
-
interface LesslyStream {
|
|
44
|
-
/** Queued until the socket is OPEN, then flushed in order. Ignored once the stream is closed. */
|
|
45
|
-
send(data: StreamData): void;
|
|
46
|
-
close(code?: number, reason?: string): void;
|
|
47
|
-
/** Delivers `MessageEvent.data` as-is. Returns an unsubscribe function. */
|
|
48
|
-
onMessage(cb: (data: StreamData) => void): () => void;
|
|
49
|
-
/** Returns an unsubscribe function. */
|
|
50
|
-
onClose(cb: (info: StreamCloseInfo) => void): () => void;
|
|
51
|
-
/** The underlying socket's readyState (0 CONNECTING, 1 OPEN, 2 CLOSING, 3 CLOSED). */
|
|
52
|
-
readonly readyState: number;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* What a generated `<tool>Connect` factory needs from the client: the ability to open a stream
|
|
56
|
-
* for a binding. `createLesslyApp`'s client implements it (see `LesslyClientBase`).
|
|
57
|
-
*/
|
|
58
|
-
interface LesslyStreamOpener {
|
|
59
|
-
openStream(binding: WsBinding, input?: Record<string, unknown>): LesslyStream;
|
|
60
|
-
}
|
|
61
|
-
/** The shape of `globalThis.WebSocket` this SDK relies on — injectable, like `fetch`. */
|
|
62
|
-
type WebSocketCtor = new (url: string) => WebSocketLike;
|
|
63
|
-
interface WebSocketLike {
|
|
64
|
-
readonly readyState: number;
|
|
65
|
-
send(data: StreamData): void;
|
|
66
|
-
close(code?: number, reason?: string): void;
|
|
67
|
-
addEventListener(type: string, cb: (ev: never) => void): void;
|
|
68
|
-
removeEventListener(type: string, cb: (ev: never) => void): void;
|
|
69
|
-
}
|
|
70
|
-
interface LesslyAppOptions {
|
|
71
|
-
/**
|
|
72
|
-
* Absolute origin ("https://api.lessly.dev") or a path relative to the page
|
|
73
|
-
* ("/api", ""), which is resolved against globalThis.location and therefore
|
|
74
|
-
* only works in a browser.
|
|
75
|
-
*/
|
|
76
|
-
baseUrl: string;
|
|
77
|
-
productId: string;
|
|
78
|
-
getCsrfToken?: () => string | null | undefined;
|
|
79
|
-
fetch?: typeof fetch;
|
|
80
|
-
/** Injectable WebSocket constructor for `connectStream`; defaults to `globalThis.WebSocket`. */
|
|
81
|
-
WebSocket?: WebSocketCtor;
|
|
82
|
-
}
|
|
1
|
+
import { L as LesslyStreamOpener, b as LesslyAppOptions, W as WsBinding, a as LesslyStream } from './types-gTIUAUsP.js';
|
|
2
|
+
export { B as Binding, c as BindingsMap, H as HttpMethod, P as ParamIn, d as ParamSpec, S as StreamCloseInfo, e as StreamData, f as WebSocketCtor, g as WebSocketLike, h as WsBindingsMap } from './types-gTIUAUsP.js';
|
|
3
|
+
import { G as GeneratedClient } from './client.gen-Boew7CkH.js';
|
|
83
4
|
|
|
84
5
|
interface LesslyClientBase extends LesslyStreamOpener {
|
|
85
6
|
call(toolName: string, input?: Record<string, unknown>): Promise<unknown>;
|
|
@@ -108,4 +29,4 @@ declare class LesslyApiError extends Error {
|
|
|
108
29
|
constructor(status: number, code: string | null, message: string, body: unknown);
|
|
109
30
|
}
|
|
110
31
|
|
|
111
|
-
export {
|
|
32
|
+
export { GeneratedClient, LesslyApiError, LesslyAppOptions, type LesslyClientBase, LesslyStream, LesslyStreamOpener, WsBinding, connectStream, createLesslyApp };
|