totalum-sdk 0.1.0-dev.7 → 0.1.0-dev.9

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
@@ -29,11 +29,11 @@ export { TotalumWeb } from './web/index.js';
29
29
  import { totalumWebhooks } from './webhooks/index.js';
30
30
  export { TotalumWebhookError, TotalumWebhooks, verifyWebhook } from './webhooks/index.js';
31
31
  export { D1Database, D1DatabaseSession, D1ExecResult, D1PreparedStatement, D1Result, READ_YOUR_WRITES_COOKIE, TotalumD1ClientCode, TotalumD1Error, TotalumD1ErrorCode, TotalumD1Options, isTotalumD1Error, totalumD1, withTotalumSession } from './d1/index.js';
32
- export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-yrue1e9O.js';
33
- export { C as CheckoutInput, a as CheckoutOutput, b as CronJob, c as CronJobInput, d as CronJobPatch, e as CronRun, f as CronRunsPage, g as CustomerPortalLinkInput, h as CustomerPortalLinkOutput, E as EmailSendInput, i as EmailSendOutput, j as EmailView, F as FileDescriptor, k as FileUploadUrlInput, l as FileUploadUrlOutput, m as FilesListQuery, n as FilesPage, J as JobCreated, O as OnboardingLinkInput, o as OnboardingLinkOutput, P as PaymentsStatus, p as PdfFromHtmlInput, q as PdfFromUrlInput, r as PdfOutput, S as ScanDocumentInput, s as ScanOcrInput, t as ScanOcrOutput, u as ScreenshotInput, v as ScreenshotOutput, w as SeoIndexNowKey, x as SeoNotifyOutput, y as SpeakInput, z as StoredMedia, T as TranscribeInput, A as TranscribeOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from './_types/integrations.d-BKPWost0.js';
34
- export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-BOMT9yln.js';
35
- export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-C1exPLN6.js';
36
- import './_types/coerce.d-RtY2zQyw.js';
32
+ export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-Cu3q_E_r.js';
33
+ export { C as CheckoutInput, a as CheckoutOutput, b as CronJob, c as CronJobInput, d as CronJobPatch, e as CronRun, f as CronRunsPage, g as CustomerPortalLinkInput, h as CustomerPortalLinkOutput, E as EmailSendInput, i as EmailSendOutput, j as EmailView, F as FileDescriptor, k as FileUploadUrlInput, l as FileUploadUrlOutput, m as FilesListQuery, n as FilesPage, J as JobCreated, O as OnboardingLinkInput, o as OnboardingLinkOutput, P as PaymentsStatus, p as PdfFromHtmlInput, q as PdfFromUrlInput, r as PdfOutput, S as ScanDocumentInput, s as ScanOcrInput, t as ScanOcrOutput, u as ScreenshotInput, v as ScreenshotOutput, w as SeoIndexNowKey, x as SeoNotifyOutput, y as SpeakInput, z as StoredMedia, T as TranscribeInput, A as TranscribeOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from './_types/integrations.d-BNGV70e3.js';
34
+ export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-C9375KIG.js';
35
+ export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-BbSZh1wY.js';
36
+ import './_types/coerce.d-C0KIW76L.js';
37
37
 
38
38
  /** The options of `createTotalum()`: every namespace's options in one object (each falls back to its env var). */
39
39
  type TotalumOptions = TotalumAiOptions & TotalumFilesOptions;
@@ -1,8 +1,8 @@
1
- import { c as LogsQueryInput } from '../_types/ops.d-BOMT9yln.js';
2
- export { L as LogsPage } from '../_types/ops.d-BOMT9yln.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
5
- import '../_types/coerce.d-RtY2zQyw.js';
1
+ import { c as LogsQueryInput } from '../_types/ops.d-C9375KIG.js';
2
+ export { L as LogsPage } from '../_types/ops.d-C9375KIG.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
5
+ import '../_types/coerce.d-C0KIW76L.js';
6
6
 
7
7
  /** A `logs.query` filter: the window (default the last hour), level, substring, status class, path, request id, env. */
8
8
  type LogsQuery = Omit<LogsQueryInput, 'caller' | 'runId'>;
@@ -1,8 +1,8 @@
1
- import { O as OnboardingLinkInput, C as CheckoutInput, g as CustomerPortalLinkInput } from '../_types/integrations.d-BKPWost0.js';
2
- export { a as CheckoutOutput, h as CustomerPortalLinkOutput, o as OnboardingLinkOutput, P as PaymentsStatus } from '../_types/integrations.d-BKPWost0.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
5
- import '../_types/coerce.d-RtY2zQyw.js';
1
+ import { O as OnboardingLinkInput, C as CheckoutInput, g as CustomerPortalLinkInput } from '../_types/integrations.d-BNGV70e3.js';
2
+ export { a as CheckoutOutput, h as CustomerPortalLinkOutput, o as OnboardingLinkOutput, P as PaymentsStatus } from '../_types/integrations.d-BNGV70e3.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
5
+ import '../_types/coerce.d-C0KIW76L.js';
6
6
 
7
7
  /**
8
8
  * `totalum.payments` (plan 05, plan 11 §9.5) over SDK-API `/v1/payments/*` with a project key (scope `payments`): Stripe
@@ -1,8 +1,8 @@
1
- import { p as PdfFromHtmlInput, q as PdfFromUrlInput } from '../_types/integrations.d-BKPWost0.js';
2
- export { r as PdfOutput } from '../_types/integrations.d-BKPWost0.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
5
- import '../_types/coerce.d-RtY2zQyw.js';
1
+ import { p as PdfFromHtmlInput, q as PdfFromUrlInput } from '../_types/integrations.d-BNGV70e3.js';
2
+ export { r as PdfOutput } from '../_types/integrations.d-BNGV70e3.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
5
+ import '../_types/coerce.d-C0KIW76L.js';
6
6
 
7
7
  /** `totalum.pdf` (plan 04 §5.5) over `/v1/pdf/*` (scope `files:write`): a new file in the project's storage each time. */
8
8
  declare function totalumPdf(options?: TotalumClientOptions): {
@@ -0,0 +1,91 @@
1
+ /**
2
+ * `totalum-sdk/react` (plan 06 §12.5, A6.33): the browser side of `totalum.realtime`. The page never holds a key: it
3
+ * asks the app's own server for a ticket (`POST ticketUrl {room}`, default `/api/realtime/ticket`), opens the room's
4
+ * socket, and on every drop — a Totalum deploy drops them all — re-tickets and reconnects with backoff. Presence is
5
+ * built on the same socket: `presence:*` messages plus a 30 s heartbeat (a room with present users stays awake).
6
+ */
7
+ type RealtimeStatus = 'connecting' | 'open' | 'reconnecting' | 'closed';
8
+ interface RealtimeMessage<T = unknown> {
9
+ id: string;
10
+ event: string;
11
+ identity: {
12
+ id: string;
13
+ name?: string;
14
+ };
15
+ data: T;
16
+ ts: string;
17
+ }
18
+ interface RealtimePeer<M = Record<string, unknown>> {
19
+ /** One per open socket: the same user in two tabs is two peers with the same `identity`. */
20
+ connectionId: string;
21
+ identity: {
22
+ id: string;
23
+ name?: string;
24
+ };
25
+ meta: M;
26
+ }
27
+ interface RealtimeChannelOptions<M = Record<string, unknown>> {
28
+ /** The app's route that mints the ticket; it receives `{ room }` and answers `{ url }` or `{ data: { url } }`. */
29
+ ticketUrl?: string;
30
+ /** Or mint the ticket yourself. */
31
+ getTicket?: (room: string) => Promise<{
32
+ url: string;
33
+ }>;
34
+ /** Announce this connection's presence with this metadata (name, colour…); `others` lists everyone else's. */
35
+ presence?: M;
36
+ /** Messages kept in memory, newest last (default 100). */
37
+ keep?: number;
38
+ /** Tests only. */
39
+ WebSocket?: typeof WebSocket;
40
+ }
41
+ interface RealtimeSnapshot<M = Record<string, unknown>> {
42
+ status: RealtimeStatus;
43
+ messages: RealtimeMessage[];
44
+ others: RealtimePeer<M>[];
45
+ }
46
+ /** One room, one socket; framework-free (the hook below is a thin wrapper). */
47
+ declare class RealtimeChannel<M = Record<string, unknown>> {
48
+ readonly room: string;
49
+ private readonly options;
50
+ private ws;
51
+ private stopped;
52
+ private attempt;
53
+ private timer;
54
+ private heartbeat;
55
+ private readonly peers;
56
+ private readonly listeners;
57
+ private readonly connectionId;
58
+ private snapshot;
59
+ constructor(room: string, options?: RealtimeChannelOptions<M>);
60
+ subscribe: (listener: () => void) => (() => void);
61
+ getSnapshot: () => RealtimeSnapshot<M>;
62
+ connect(): void;
63
+ /** Sends `data` to everyone in the room (you included); `false` when the socket is not open. */
64
+ publish: (data: unknown, event?: string) => boolean;
65
+ close(): void;
66
+ private open;
67
+ private ticket;
68
+ /** A drop is normal (every deploy drops every socket): re-ticket and reconnect, 0.5 s … 30 s apart. */
69
+ private retry;
70
+ private send;
71
+ private receive;
72
+ /** Peers whose socket dropped without a goodbye disappear after 75 s of silence. */
73
+ private expire;
74
+ private set;
75
+ }
76
+ /**
77
+ * A room in a client component: `status`, the `messages` received since it opened, `others` (with `presence`), and
78
+ * `publish(data, event?)`. Render `status === 'reconnecting'` as an ordinary state, not an error.
79
+ *
80
+ * @example
81
+ * const { messages, others, publish, status } = useRealtimeChannel(`chat:${roomId}`, { presence: { name } });
82
+ */
83
+ declare function useRealtimeChannel<M = Record<string, unknown>>(room: string, options?: RealtimeChannelOptions<M>): {
84
+ publish: (data: unknown, event?: string) => boolean;
85
+ status: RealtimeStatus;
86
+ messages: RealtimeMessage[];
87
+ others: RealtimePeer<M>[];
88
+ };
89
+
90
+ export { RealtimeChannel, useRealtimeChannel };
91
+ export type { RealtimeChannelOptions, RealtimeMessage, RealtimePeer, RealtimeSnapshot, RealtimeStatus };
@@ -0,0 +1,178 @@
1
+ import { useEffect, useMemo, useSyncExternalStore } from 'react';
2
+ const HEARTBEAT_MS = 30_000;
3
+ const STALE_MS = 75_000;
4
+ const PRESENCE = 'presence:';
5
+ /** One room, one socket; framework-free (the hook below is a thin wrapper). */
6
+ export class RealtimeChannel {
7
+ room;
8
+ options;
9
+ ws;
10
+ stopped = true;
11
+ attempt = 0;
12
+ timer;
13
+ heartbeat;
14
+ peers = new Map();
15
+ listeners = new Set();
16
+ connectionId = crypto.randomUUID();
17
+ snapshot = { status: 'closed', messages: [], others: [] };
18
+ constructor(room, options = {}) {
19
+ this.room = room;
20
+ this.options = options;
21
+ }
22
+ subscribe = (listener) => {
23
+ this.listeners.add(listener);
24
+ return () => this.listeners.delete(listener);
25
+ };
26
+ getSnapshot = () => this.snapshot;
27
+ connect() {
28
+ if (!this.stopped)
29
+ return;
30
+ this.stopped = false;
31
+ this.set({ status: 'connecting' });
32
+ void this.open();
33
+ if (this.options.presence)
34
+ this.heartbeat = setInterval(() => {
35
+ this.send(`${PRESENCE}here`, this.options.presence);
36
+ this.expire();
37
+ }, HEARTBEAT_MS);
38
+ }
39
+ /** Sends `data` to everyone in the room (you included); `false` when the socket is not open. */
40
+ publish = (data, event = 'message') => this.send(event, data);
41
+ close() {
42
+ if (this.options.presence)
43
+ this.send(`${PRESENCE}leave`, null);
44
+ this.stopped = true;
45
+ clearTimeout(this.timer);
46
+ clearInterval(this.heartbeat);
47
+ this.ws?.close(1000, 'closed');
48
+ this.ws = undefined;
49
+ this.peers.clear();
50
+ this.set({ status: 'closed', others: [] });
51
+ }
52
+ async open() {
53
+ try {
54
+ const { url } = await this.ticket();
55
+ if (this.stopped)
56
+ return;
57
+ const ws = new (this.options.WebSocket ?? WebSocket)(url);
58
+ this.ws = ws;
59
+ ws.addEventListener('open', () => {
60
+ this.attempt = 0;
61
+ this.set({ status: 'open' });
62
+ if (this.options.presence)
63
+ this.send(`${PRESENCE}join`, this.options.presence);
64
+ });
65
+ ws.addEventListener('message', (e) => {
66
+ this.receive(String(e.data));
67
+ });
68
+ ws.addEventListener('close', () => {
69
+ if (this.ws === ws)
70
+ this.retry();
71
+ });
72
+ }
73
+ catch {
74
+ this.retry();
75
+ }
76
+ }
77
+ async ticket() {
78
+ if (this.options.getTicket)
79
+ return this.options.getTicket(this.room);
80
+ const res = await fetch(this.options.ticketUrl ?? '/api/realtime/ticket', {
81
+ method: 'POST',
82
+ headers: { 'content-type': 'application/json' },
83
+ body: JSON.stringify({ room: this.room }),
84
+ });
85
+ if (!res.ok)
86
+ throw new Error(`ticket ${String(res.status)}`);
87
+ const body = await res.json();
88
+ const { url, data } = body;
89
+ return { url: url ?? data?.url ?? '' };
90
+ }
91
+ /** A drop is normal (every deploy drops every socket): re-ticket and reconnect, 0.5 s … 30 s apart. */
92
+ retry() {
93
+ this.ws = undefined;
94
+ if (this.stopped)
95
+ return;
96
+ this.peers.clear();
97
+ this.set({ status: 'reconnecting', others: [] });
98
+ const delay = Math.min(30_000, 500 * 2 ** this.attempt++) * (0.75 + Math.random() / 2);
99
+ this.timer = setTimeout(() => void this.open(), delay);
100
+ }
101
+ send(event, data) {
102
+ if (this.ws?.readyState !== 1)
103
+ return false;
104
+ const payload = event.startsWith(PRESENCE) ? { connectionId: this.connectionId, meta: data } : data;
105
+ this.ws.send(JSON.stringify({ type: 'publish', event, data: payload }));
106
+ return true;
107
+ }
108
+ receive(raw) {
109
+ let frame;
110
+ try {
111
+ frame = JSON.parse(raw);
112
+ }
113
+ catch {
114
+ return;
115
+ }
116
+ if (frame.type !== 'message' || !frame.event || !frame.identity)
117
+ return;
118
+ if (!frame.event.startsWith(PRESENCE)) {
119
+ const keep = this.options.keep ?? 100;
120
+ this.set({ messages: [...this.snapshot.messages, frame].slice(-keep) });
121
+ return;
122
+ }
123
+ const { connectionId, meta } = (frame.data ?? {});
124
+ if (!this.options.presence || !connectionId || connectionId === this.connectionId)
125
+ return;
126
+ if (frame.event === `${PRESENCE}leave`)
127
+ this.peers.delete(connectionId);
128
+ else {
129
+ // a newcomer learns who is already here
130
+ if (frame.event === `${PRESENCE}join`)
131
+ this.send(`${PRESENCE}here`, this.options.presence);
132
+ this.peers.set(connectionId, {
133
+ connectionId,
134
+ identity: frame.identity,
135
+ meta: meta,
136
+ seen: Date.now(),
137
+ });
138
+ }
139
+ this.expire();
140
+ }
141
+ /** Peers whose socket dropped without a goodbye disappear after 75 s of silence. */
142
+ expire() {
143
+ for (const [id, peer] of this.peers)
144
+ if (Date.now() - peer.seen > STALE_MS)
145
+ this.peers.delete(id);
146
+ const others = [...this.peers.values()].map(({ connectionId, identity, meta }) => ({
147
+ connectionId,
148
+ identity,
149
+ meta,
150
+ }));
151
+ this.set({ others });
152
+ }
153
+ set(patch) {
154
+ this.snapshot = { ...this.snapshot, ...patch };
155
+ for (const listener of this.listeners)
156
+ listener();
157
+ }
158
+ }
159
+ const SERVER = { status: 'connecting', messages: [], others: [] };
160
+ /**
161
+ * A room in a client component: `status`, the `messages` received since it opened, `others` (with `presence`), and
162
+ * `publish(data, event?)`. Render `status === 'reconnecting'` as an ordinary state, not an error.
163
+ *
164
+ * @example
165
+ * const { messages, others, publish, status } = useRealtimeChannel(`chat:${roomId}`, { presence: { name } });
166
+ */
167
+ export function useRealtimeChannel(room, options = {}) {
168
+ // one channel per room; the options of its first render are the ones it keeps
169
+ const channel = useMemo(() => new RealtimeChannel(room, options), [room]);
170
+ useEffect(() => {
171
+ channel.connect();
172
+ return () => {
173
+ channel.close();
174
+ };
175
+ }, [channel]);
176
+ const snapshot = useSyncExternalStore(channel.subscribe, channel.getSnapshot, () => SERVER);
177
+ return { ...snapshot, publish: channel.publish };
178
+ }
@@ -1,5 +1,5 @@
1
- import { Z as ZodObject, c as ZodOptional, d as ZodString, g as ZodUnknown, m as $strip, o as output, t as ZodISODateTime, l as ZodInt, h as ZodRecord, j as ZodBoolean, T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
2
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
1
+ import { Z as ZodObject, c as ZodOptional, d as ZodString, g as ZodUnknown, m as $strip, o as output, t as ZodISODateTime, l as ZodInt, h as ZodRecord, j as ZodBoolean, T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
2
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
3
3
 
4
4
  /** `POST /v1/realtime/tickets` (scope `realtime`). `ttl` is the join window in seconds, not the session length. */
5
5
  declare const RealtimeTicketInput: ZodObject<{
@@ -1,8 +1,8 @@
1
- import { S as ScanDocumentInput, s as ScanOcrInput } from '../_types/integrations.d-BKPWost0.js';
2
- export { t as ScanOcrOutput } from '../_types/integrations.d-BKPWost0.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
5
- import '../_types/coerce.d-RtY2zQyw.js';
1
+ import { S as ScanDocumentInput, s as ScanOcrInput } from '../_types/integrations.d-BNGV70e3.js';
2
+ export { t as ScanOcrOutput } from '../_types/integrations.d-BNGV70e3.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
5
+ import '../_types/coerce.d-C0KIW76L.js';
6
6
 
7
7
  /** The v1 scan result: the extracted fields (one set per page with `processEveryPdfPageAsDifferentScan`) + `metadata`. */
8
8
  interface ScanDocumentResult {
@@ -1,7 +1,7 @@
1
- export { w as SeoIndexNowKey, x as SeoNotifyOutput } from '../_types/integrations.d-BKPWost0.js';
2
- import { T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
3
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
4
- import '../_types/coerce.d-RtY2zQyw.js';
1
+ export { w as SeoIndexNowKey, x as SeoNotifyOutput } from '../_types/integrations.d-BNGV70e3.js';
2
+ import { T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
3
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
4
+ import '../_types/coerce.d-C0KIW76L.js';
5
5
 
6
6
  /** `totalum.seo` (plan 05 §6.10) over SDK-API `/v1/seo/*` (scope `seo`): IndexNow for verified custom domains, free. */
7
7
  declare function totalumSeo(options?: TotalumClientOptions): {
@@ -1,8 +1,8 @@
1
- import { T as TranscribeInput, y as SpeakInput, z as StoredMedia } from '../_types/integrations.d-BKPWost0.js';
2
- export { A as TranscribeOutput } from '../_types/integrations.d-BKPWost0.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
5
- import '../_types/coerce.d-RtY2zQyw.js';
1
+ import { T as TranscribeInput, y as SpeakInput, z as StoredMedia } from '../_types/integrations.d-BNGV70e3.js';
2
+ export { A as TranscribeOutput } from '../_types/integrations.d-BNGV70e3.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
5
+ import '../_types/coerce.d-C0KIW76L.js';
6
6
 
7
7
  /** `totalum.speech` (plan 05 §6.8) over `/v1/speech/*` (scope `speech`): OpenRouter speech through Totalum. */
8
8
  declare function totalumSpeech(options?: TotalumClientOptions): {
@@ -1,8 +1,8 @@
1
- import { G as WebScrapeInput, H as WebSearchInput, I as WebMapInput, K as WebCrawlInput, u as ScreenshotInput } from '../_types/integrations.d-BKPWost0.js';
2
- export { J as JobCreated, v as ScreenshotOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from '../_types/integrations.d-BKPWost0.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-yrue1e9O.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
5
- import '../_types/coerce.d-RtY2zQyw.js';
1
+ import { G as WebScrapeInput, H as WebSearchInput, I as WebMapInput, K as WebCrawlInput, u as ScreenshotInput } from '../_types/integrations.d-BNGV70e3.js';
2
+ export { J as JobCreated, v as ScreenshotOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from '../_types/integrations.d-BNGV70e3.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-Cu3q_E_r.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
5
+ import '../_types/coerce.d-C0KIW76L.js';
6
6
 
7
7
  /**
8
8
  * `totalum.web` (plan 05 §6.2) over SDK-API `/v1/web/*` (scope `web`): Firecrawl scrape/search/map/crawl and Browser
@@ -1,7 +1,7 @@
1
- import { a as WebhookEvent } from '../_types/billing.d-C1exPLN6.js';
2
- export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-C1exPLN6.js';
3
- import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-yrue1e9O.js';
4
- export { i as isTotalumError } from '../_types/errors.d-yrue1e9O.js';
1
+ import { a as WebhookEvent } from '../_types/billing.d-BbSZh1wY.js';
2
+ export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-BbSZh1wY.js';
3
+ import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-Cu3q_E_r.js';
4
+ export { i as isTotalumError } from '../_types/errors.d-Cu3q_E_r.js';
5
5
 
6
6
  /** A webhook refusal (plan 05 §7.2): the codes never travel, the app answers 400. */
7
7
  declare class TotalumWebhookError extends TotalumError {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "totalum-sdk",
3
- "version": "0.1.0-dev.7",
3
+ "version": "0.1.0-dev.9",
4
4
  "description": "The SDK generated Totalum apps import: every integration namespace over SDK-API (totalum-sdk, or one subpath each: /files, /ai, /web, …) and totalum-sdk/d1, the D1 driver",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -80,6 +80,10 @@
80
80
  "./analytics": {
81
81
  "types": "./dist/analytics/index.d.ts",
82
82
  "default": "./dist/analytics/index.js"
83
+ },
84
+ "./react": {
85
+ "types": "./dist/react/index.d.ts",
86
+ "default": "./dist/react/index.js"
83
87
  }
84
88
  },
85
89
  "sideEffects": false,
@@ -100,11 +104,15 @@
100
104
  "types:check": "node scripts/check-types.mjs"
101
105
  },
102
106
  "peerDependencies": {
103
- "@libsql/client": "0.18.0"
107
+ "@libsql/client": "0.18.0",
108
+ "react": ">=18"
104
109
  },
105
110
  "peerDependenciesMeta": {
106
111
  "@libsql/client": {
107
112
  "optional": true
113
+ },
114
+ "react": {
115
+ "optional": true
108
116
  }
109
117
  },
110
118
  "devDependencies": {
@@ -116,6 +124,7 @@
116
124
  "@libsql/client": "0.18.0",
117
125
  "@speed-paradigm/totalum-contracts": "link:../totalum-contracts",
118
126
  "@types/node": "22.20.4",
127
+ "@types/react": "19.3.0",
119
128
  "drizzle-orm": "0.45.3",
120
129
  "esbuild": "0.28.1",
121
130
  "eslint": "9.39.5",
@@ -124,6 +133,7 @@
124
133
  "lefthook": "2.1.14",
125
134
  "miniflare": "5.20260921.0-alpha",
126
135
  "prettier": "3.9.8",
136
+ "react": "19.3.0",
127
137
  "rollup": "4.63.4",
128
138
  "rollup-plugin-dts": "6.5.1",
129
139
  "totalum-sdk-api": "link:../totalum-sdk-api",