@lessly/sdk-app 49.1.0 → 50.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.
Files changed (64) hide show
  1. package/dist/analytics/index.d.cts +1 -1
  2. package/dist/analytics/index.d.ts +1 -1
  3. package/dist/brain/index.cjs +5 -0
  4. package/dist/brain/index.cjs.map +1 -1
  5. package/dist/brain/index.d.cts +6 -2
  6. package/dist/brain/index.d.ts +6 -2
  7. package/dist/brain/index.js +5 -1
  8. package/dist/brain/index.js.map +1 -1
  9. package/dist/{client.gen-C39RGAWI.d.cts → client.gen-Dw0AIIZi.d.cts} +399 -4706
  10. package/dist/{client.gen-C39RGAWI.d.ts → client.gen-Dw0AIIZi.d.ts} +399 -4706
  11. package/dist/consent/index.d.cts +1 -1
  12. package/dist/consent/index.d.ts +1 -1
  13. package/dist/deployment/index.d.cts +1 -1
  14. package/dist/deployment/index.d.ts +1 -1
  15. package/dist/index.cjs +138 -758
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +83 -4
  18. package/dist/index.d.ts +83 -4
  19. package/dist/index.js +8016 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/mail/index.d.cts +2 -2
  22. package/dist/mail/index.d.ts +2 -2
  23. package/dist/observe/index.d.cts +1 -1
  24. package/dist/observe/index.d.ts +1 -1
  25. package/dist/organization/index.d.cts +1 -1
  26. package/dist/organization/index.d.ts +1 -1
  27. package/dist/realtime/index.d.cts +1 -1
  28. package/dist/realtime/index.d.ts +1 -1
  29. package/dist/support/index.d.cts +1 -1
  30. package/dist/support/index.d.ts +1 -1
  31. package/dist/tracking/index.d.cts +1 -1
  32. package/dist/tracking/index.d.ts +1 -1
  33. package/dist/users/index.d.cts +1 -1
  34. package/dist/users/index.d.ts +1 -1
  35. package/dist/waitlist/index.d.cts +1 -1
  36. package/dist/waitlist/index.d.ts +1 -1
  37. package/package.json +2 -12
  38. package/src/gen/bindings.gen.ts +137 -765
  39. package/src/gen/brain/index.ts +1 -1
  40. package/src/gen/brain/queryOptions.gen.ts +7 -0
  41. package/src/gen/client.gen.ts +5 -165
  42. package/src/gen/manifest.gen.ts +1 -1
  43. package/src/gen/types.gen.ts +222 -4319
  44. package/dist/chunk-YVDZDXA7.js +0 -8648
  45. package/dist/chunk-YVDZDXA7.js.map +0 -1
  46. package/dist/content/index.cjs +0 -161
  47. package/dist/content/index.cjs.map +0 -1
  48. package/dist/content/index.d.cts +0 -128
  49. package/dist/content/index.d.ts +0 -128
  50. package/dist/content/index.js +0 -129
  51. package/dist/content/index.js.map +0 -1
  52. package/dist/playground/index.cjs +0 -81
  53. package/dist/playground/index.cjs.map +0 -1
  54. package/dist/playground/index.d.cts +0 -55
  55. package/dist/playground/index.d.ts +0 -55
  56. package/dist/playground/index.js +0 -58
  57. package/dist/playground/index.js.map +0 -1
  58. package/dist/types-gTIUAUsP.d.cts +0 -82
  59. package/dist/types-gTIUAUsP.d.ts +0 -82
  60. package/src/gen/content/index.ts +0 -3
  61. package/src/gen/content/queryOptions.gen.ts +0 -202
  62. package/src/gen/playground/connect.gen.ts +0 -9
  63. package/src/gen/playground/index.ts +0 -4
  64. package/src/gen/playground/queryOptions.gen.ts +0 -86
package/dist/index.d.cts CHANGED
@@ -1,6 +1,85 @@
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-C39RGAWI.cjs';
1
+ import { G as GeneratedClient } from './client.gen-Dw0AIIZi.cjs';
2
+
3
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
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
+ }
4
83
 
5
84
  interface LesslyClientBase extends LesslyStreamOpener {
6
85
  call(toolName: string, input?: Record<string, unknown>): Promise<unknown>;
@@ -29,4 +108,4 @@ declare class LesslyApiError extends Error {
29
108
  constructor(status: number, code: string | null, message: string, body: unknown);
30
109
  }
31
110
 
32
- export { GeneratedClient, LesslyApiError, LesslyAppOptions, type LesslyClientBase, LesslyStream, LesslyStreamOpener, WsBinding, connectStream, createLesslyApp };
111
+ export { type Binding, type BindingsMap, GeneratedClient, type HttpMethod, LesslyApiError, type LesslyAppOptions, type LesslyClientBase, type LesslyStream, type LesslyStreamOpener, type ParamIn, type ParamSpec, type StreamCloseInfo, type StreamData, type WebSocketCtor, type WebSocketLike, type WsBinding, type WsBindingsMap, connectStream, createLesslyApp };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,85 @@
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-C39RGAWI.js';
1
+ import { G as GeneratedClient } from './client.gen-Dw0AIIZi.js';
2
+
3
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
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
+ }
4
83
 
5
84
  interface LesslyClientBase extends LesslyStreamOpener {
6
85
  call(toolName: string, input?: Record<string, unknown>): Promise<unknown>;
@@ -29,4 +108,4 @@ declare class LesslyApiError extends Error {
29
108
  constructor(status: number, code: string | null, message: string, body: unknown);
30
109
  }
31
110
 
32
- export { GeneratedClient, LesslyApiError, LesslyAppOptions, type LesslyClientBase, LesslyStream, LesslyStreamOpener, WsBinding, connectStream, createLesslyApp };
111
+ export { type Binding, type BindingsMap, GeneratedClient, type HttpMethod, LesslyApiError, type LesslyAppOptions, type LesslyClientBase, type LesslyStream, type LesslyStreamOpener, type ParamIn, type ParamSpec, type StreamCloseInfo, type StreamData, type WebSocketCtor, type WebSocketLike, type WsBinding, type WsBindingsMap, connectStream, createLesslyApp };