totalum-sdk 0.1.0-dev.11 → 0.1.0-dev.13

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.
@@ -1,4 +1,4 @@
1
- import { Z as ZodObject, k as ZodNumber, c as ZodOptional, d as ZodString, m as $strip, o as output, t as ZodISODateTime, f as ZodEnum, j as ZodBoolean, h as ZodRecord, g as ZodUnknown, v as ZodNullable, p as ZodURL } from './errors.d-CbnzfZ4q.js';
1
+ import { Z as ZodObject, k as ZodNumber, c as ZodOptional, d as ZodString, m as $strip, o as output, u as ZodISODateTime, f as ZodEnum, j as ZodBoolean, h as ZodRecord, g as ZodUnknown, w as ZodNullable, p as ZodURL } from './errors.d-By9SsgZX.js';
2
2
 
3
3
  /** `usage` on every integration result (plan 11 §0.8): what the call cost, credits with 4 decimals. */
4
4
  declare const IntegrationUsage: ZodObject<{
@@ -1,4 +1,4 @@
1
- import { _ as _ZodNumber, x as $ZodNumberInternals } from './errors.d-CbnzfZ4q.js';
1
+ import { _ as _ZodNumber, y as $ZodNumberInternals } from './errors.d-By9SsgZX.js';
2
2
 
3
3
  interface ZodCoercedNumber<T = unknown> extends _ZodNumber<$ZodNumberInternals<T>> {
4
4
  }
@@ -3091,5 +3091,5 @@ declare class TotalumError extends Error {
3091
3091
  }
3092
3092
  declare function isTotalumError(e: unknown): e is TotalumError;
3093
3093
 
3094
- export { ErrorBody as E, ZodObject as Z, TotalumError as a, ZodOptional as c, ZodString as d, ZodArray as e, ZodEnum as f, ZodUnknown as g, ZodRecord as h, isTotalumError as i, ZodBoolean as j, ZodNumber as k, ZodUnion as n, ZodURL as p, ZodLiteral as q, ZodType as r, ZodISODateTime as t, ZodNullable as v, ZodEmail as w };
3095
- export type { $loose as $, SdkClientErrorCode as S, TotalumClientOptions as T, _ZodNumber as _, TotalumErrorCode as b, ZodInt as l, $strip as m, output as o, $ZodTypeInternals as s, $catchall as u, $ZodNumberInternals as x };
3094
+ export { ErrorBody as E, ZodObject as Z, TotalumError as a, ZodOptional as c, ZodString as d, ZodArray as e, ZodEnum as f, ZodUnknown as g, ZodRecord as h, isTotalumError as i, ZodBoolean as j, ZodNumber as k, ZodUnion as n, ZodURL as p, ZodLiteral as r, ZodType as s, ZodISODateTime as u, ZodNullable as w, ZodEmail as x };
3095
+ export type { $loose as $, SdkClientErrorCode as S, TotalumClientOptions as T, _ZodNumber as _, TotalumErrorCode as b, ZodInt as l, $strip as m, output as o, $partial as q, $ZodTypeInternals as t, $catchall as v, $ZodNumberInternals as y };
@@ -1,5 +1,5 @@
1
- import { Z as ZodObject, d as ZodString, c as ZodOptional, f as ZodEnum, k as ZodNumber, j as ZodBoolean, m as $strip, o as output, p as ZodURL, e as ZodArray, n as ZodUnion, l as ZodInt, h as ZodRecord, v as ZodNullable, t as ZodISODateTime, w as ZodEmail, q as ZodLiteral, g as ZodUnknown } from './errors.d-CbnzfZ4q.js';
2
- import { Z as ZodCoercedNumber } from './coerce.d-CEK0K3O_.js';
1
+ import { Z as ZodObject, d as ZodString, c as ZodOptional, f as ZodEnum, k as ZodNumber, j as ZodBoolean, m as $strip, o as output, p as ZodURL, e as ZodArray, n as ZodUnion, l as ZodInt, h as ZodRecord, w as ZodNullable, u as ZodISODateTime, x as ZodEmail, r as ZodLiteral, g as ZodUnknown } from './errors.d-By9SsgZX.js';
2
+ import { Z as ZodCoercedNumber } from './coerce.d-o2vQHoho.js';
3
3
 
4
4
  /** `202` of every async integration call; `estimatedCredits` = the reserved estimate (settled to the real cost). */
5
5
  declare const JobCreated: ZodObject<{
@@ -1,5 +1,5 @@
1
- import { Z as ZodObject, c as ZodOptional, e as ZodArray, t as ZodISODateTime, u as $catchall, k as ZodNumber, d as ZodString, f as ZodEnum, m as $strip, q as ZodLiteral, j as ZodBoolean, o as output, v as ZodNullable, l as ZodInt } from './errors.d-CbnzfZ4q.js';
2
- import { Z as ZodCoercedNumber } from './coerce.d-CEK0K3O_.js';
1
+ import { Z as ZodObject, c as ZodOptional, e as ZodArray, u as ZodISODateTime, v as $catchall, k as ZodNumber, d as ZodString, f as ZodEnum, m as $strip, r as ZodLiteral, j as ZodBoolean, o as output, w as ZodNullable, l as ZodInt } from './errors.d-By9SsgZX.js';
2
+ import { Z as ZodCoercedNumber } from './coerce.d-o2vQHoho.js';
3
3
 
4
4
  declare const SiteMetric: ZodEnum<{
5
5
  bytes: "bytes";
@@ -1,9 +1,9 @@
1
1
  import { SpeechAudio } from '../speech/index.js';
2
- import { Z as ZodObject, c as ZodOptional, d as ZodString, e as ZodArray, f as ZodEnum, g as ZodUnknown, $ as $loose, h as ZodRecord, j as ZodBoolean, k as ZodNumber, l as ZodInt, m as $strip, o as output, n as ZodUnion, p as ZodURL, q as ZodLiteral, T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
3
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
4
- import { I as IntegrationUsage } from '../_types/billing.d-yekNDC4X.js';
2
+ import { Z as ZodObject, c as ZodOptional, d as ZodString, e as ZodArray, f as ZodEnum, g as ZodUnknown, $ as $loose, h as ZodRecord, j as ZodBoolean, k as ZodNumber, l as ZodInt, m as $strip, o as output, n as ZodUnion, p as ZodURL, q as $partial, r as ZodLiteral, T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
3
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
4
+ import { I as IntegrationUsage } from '../_types/billing.d-B85Ll6tb.js';
5
5
  import { SpeakInput, StoredMedia, TranscribeInput } from '../index.js';
6
- import '../_types/coerce.d-CEK0K3O_.js';
6
+ import '../_types/coerce.d-o2vQHoho.js';
7
7
 
8
8
  /** `POST /v1/ai/chat` (integration `ai_text`); `stream:true` answers SSE ending with `AiStreamCreditsChunk`. */
9
9
  declare const AiChatInput: ZodObject<{
@@ -185,13 +185,20 @@ declare const AiTextOutput: ZodObject<{
185
185
  }, $strip>;
186
186
  }, $strip>;
187
187
  type AiTextOutput = output<typeof AiTextOutput>;
188
- /** `GET /v1/ai/models` (cached 1 h). */
188
+ /** `GET /v1/ai/models` (cached 1 h): each preset's current slug, and the catalogue the plan may call. */
189
189
  declare const AiModelsOutput: ZodObject<{
190
- aliases: ZodObject<{
191
- cheap: ZodString;
192
- normal: ZodString;
193
- best: ZodString;
194
- }, $strip>;
190
+ presets: ZodRecord<ZodEnum<{
191
+ fast: "fast";
192
+ smart: "smart";
193
+ reasoning: "reasoning";
194
+ vision: "vision";
195
+ image: "image";
196
+ "image-edit": "image-edit";
197
+ video: "video";
198
+ tts: "tts";
199
+ stt: "stt";
200
+ embed: "embed";
201
+ }> & $partial, ZodString>;
195
202
  models: ZodArray<ZodObject<{
196
203
  slug: ZodString;
197
204
  name: ZodString;
@@ -399,11 +406,7 @@ declare function totalumAi(options?: TotalumAiOptions): {
399
406
  models: {
400
407
  /** The model aliases and the models a project may call, with their prices. */
401
408
  list: () => Promise<{
402
- aliases: {
403
- cheap: string;
404
- normal: string;
405
- best: string;
406
- };
409
+ presets: Partial<Record<"fast" | "reasoning" | "video" | "image" | "smart" | "vision" | "image-edit" | "tts" | "stt" | "embed", string>>;
407
410
  models: {
408
411
  slug: string;
409
412
  name: string;
@@ -1,7 +1,7 @@
1
- import { b as SiteMetric, a as SiteDimension, S as SiteAnalyticsOutput } from '../_types/ops.d-wJWD6Zj7.js';
2
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
3
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
4
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { b as SiteMetric, a as SiteDimension, S as SiteAnalyticsOutput } from '../_types/ops.d-EKzQhzOB.js';
2
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
3
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
4
+ import '../_types/coerce.d-o2vQHoho.js';
5
5
 
6
6
  interface SiteAnalyticsQuery {
7
7
  /** ISO; default the last 7 days. */
@@ -1,5 +1,5 @@
1
- import { Z as ZodObject, e as ZodArray, j as ZodBoolean, c as ZodOptional, g as ZodUnknown, f as ZodEnum, d as ZodString, m as $strip, l as ZodInt, o as output, $ as $loose, r as ZodType, s as $ZodTypeInternals, h as ZodRecord, p as ZodURL, t as ZodISODateTime, k as ZodNumber, q as ZodLiteral, T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
2
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
1
+ import { Z as ZodObject, e as ZodArray, j as ZodBoolean, c as ZodOptional, g as ZodUnknown, f as ZodEnum, d as ZodString, m as $strip, l as ZodInt, o as output, $ as $loose, s as ZodType, t as $ZodTypeInternals, h as ZodRecord, p as ZodURL, u as ZodISODateTime, k as ZodNumber, r as ZodLiteral, T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
2
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
3
3
 
4
4
  declare const BrowserCommandName: ZodEnum<{
5
5
  type: "type";
@@ -1,8 +1,8 @@
1
- import { c as CronJobInput, b as CronJob, d as CronJobPatch } from '../_types/integrations.d-Bb3j7BnK.js';
2
- export { e as CronRun, f as CronRunsPage } from '../_types/integrations.d-Bb3j7BnK.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { c as CronJobInput, b as CronJob, d as CronJobPatch } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { e as CronRun, f as CronRunsPage } from '../_types/integrations.d-DH0xUdPA.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.js';
6
6
 
7
7
  /**
8
8
  * `totalum.cron` (plan 05 §6.9) over SDK-API `/v1/cron/*` (scope `cron`): HTTP jobs against the project's own host,
@@ -1,6 +1,6 @@
1
- import { S as SdkClientErrorCode, a as TotalumError, b as TotalumErrorCode, E as ErrorBody } from '../_types/errors.d-CbnzfZ4q.js';
1
+ import { S as SdkClientErrorCode, a as TotalumError, b as TotalumErrorCode, E as ErrorBody } from '../_types/errors.d-By9SsgZX.js';
2
2
  import { TotalumClientOptions } from '../ai/index.js';
3
- export { i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
3
+ export { i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
4
4
 
5
5
  /**
6
6
  * Cloudflare's `D1Database` surface, re-declared structurally so an app needs no Cloudflare types to compile
@@ -90,7 +90,8 @@ declare const READ_YOUR_WRITES_COOKIE = "__tlm_d1_w";
90
90
  * Runs one request of a Worker with a replicated D1 (A3.23, research 46 §6.3): a `GET`/`HEAD` reads through a
91
91
  * `first-unconstrained` session — the nearest replica — unless the browser wrote in the last 10 s; any other method
92
92
  * uses the plain binding (writes go to the primary; measured faster than any session) and its response sets the short
93
- * cookie that sends that browser's next reads to the primary. `run` receives the env to hand to the app, whose
93
+ * cookie that sends that browser's next reads to the primary. A replica read that takes over `REPLICA_READ_TIMEOUT_MS`
94
+ * is answered by the primary instead, and the rest of that request reads the primary. `run` receives the env to hand to the app, whose
94
95
  * `totalumD1()` reads `TOTALUM_DB` from it on every statement. No D1 binding (Turso, a laptop): `run(env)` unchanged.
95
96
  */
96
97
  declare function withTotalumSession<E extends object>(request: Request, env: E, run: (env: E) => Promise<Response>): Promise<Response>;
@@ -3,11 +3,21 @@ export const READ_YOUR_WRITES_COOKIE = '__tlm_d1_w';
3
3
  /** Replicas lag the primary by 30–75 ms (Cloudflare); 10 s leaves a wide margin (research 46 §6.3). */
4
4
  const WINDOW_SECONDS = 10;
5
5
  const READS = new Set(['GET', 'HEAD']);
6
+ /**
7
+ * A replica read slower than this is re-run on the primary, and the rest of the request reads the primary. Replicas
8
+ * answer in tens of ms; measured stalls last 10 s or more while the primary stays fast (ui-evidence/preview-hang).
9
+ * D1's Sessions API documents no timeout or fallback of its own.
10
+ */
11
+ export const REPLICA_READ_TIMEOUT_MS = 2000;
12
+ /** Only a `SELECT` is re-run: a write that stalled may still land, and running it twice would duplicate it. */
13
+ const PURE_READ = /^\s*select\b/i;
14
+ const LATE = Symbol('late');
6
15
  /**
7
16
  * Runs one request of a Worker with a replicated D1 (A3.23, research 46 §6.3): a `GET`/`HEAD` reads through a
8
17
  * `first-unconstrained` session — the nearest replica — unless the browser wrote in the last 10 s; any other method
9
18
  * uses the plain binding (writes go to the primary; measured faster than any session) and its response sets the short
10
- * cookie that sends that browser's next reads to the primary. `run` receives the env to hand to the app, whose
19
+ * cookie that sends that browser's next reads to the primary. A replica read that takes over `REPLICA_READ_TIMEOUT_MS`
20
+ * is answered by the primary instead, and the rest of that request reads the primary. `run` receives the env to hand to the app, whose
11
21
  * `totalumD1()` reads `TOTALUM_DB` from it on every statement. No D1 binding (Turso, a laptop): `run(env)` unchanged.
12
22
  */
13
23
  export async function withTotalumSession(request, env, run) {
@@ -15,24 +25,82 @@ export async function withTotalumSession(request, env, run) {
15
25
  if (typeof db?.withSession !== 'function')
16
26
  return run(env);
17
27
  const binding = db;
18
- if (!READS.has(request.method)) {
19
- const res = await run(env);
20
- if (res.status === 101)
21
- return res; // a WebSocket upgrade cannot be re-wrapped
22
- const out = new Response(res.body, res);
23
- out.headers.append('set-cookie', `${READ_YOUR_WRITES_COOKIE}=1; Max-Age=${String(WINDOW_SECONDS)}; Path=/; HttpOnly; Secure; SameSite=None; Partitioned`);
24
- return out;
25
- }
28
+ if (!READS.has(request.method))
29
+ return withCookie(await run(env));
26
30
  const cookies = request.headers.get('cookie') ?? '';
27
31
  if (new RegExp(`(?:^|;\\s*)${READ_YOUR_WRITES_COOKIE}=`).test(cookies))
28
32
  return run(env);
29
- const session = binding.withSession('first-unconstrained');
30
- const replicaDb = {
31
- prepare: (sql) => session.prepare(sql),
32
- batch: (statements) => session.batch(statements),
33
- exec: (sql) => binding.exec(sql),
33
+ const replica = boundedReplica(binding, binding.withSession('first-unconstrained'));
34
+ const res = await run({ ...env, TOTALUM_DB: replica.db });
35
+ // a GET that wrote (a first visit creating its row, an OAuth callback) sends the browser's next reads to the primary too
36
+ return replica.wrote() ? withCookie(res) : res;
37
+ }
38
+ function withCookie(res) {
39
+ if (res.status === 101)
40
+ return res; // a WebSocket upgrade cannot be re-wrapped
41
+ const out = new Response(res.body, res);
42
+ out.headers.append('set-cookie', `${READ_YOUR_WRITES_COOKIE}=1; Max-Age=${String(WINDOW_SECONDS)}; Path=/; HttpOnly; Secure; SameSite=None; Partitioned`);
43
+ return out;
44
+ }
45
+ /**
46
+ * The request's database on the nearest replica, each pure read bounded by `REPLICA_READ_TIMEOUT_MS`: past it, the read
47
+ * runs on the primary (the stalled replica call is abandoned) and so does every later statement of this request. Any
48
+ * other statement (a write, even one that fails) runs on the primary and so does the rest of the request: a lost-race
49
+ * re-read (better-auth's rate limiter: insert → UNIQUE → read again) must see the row the replica has not received yet.
50
+ */
51
+ function boundedReplica(binding, session) {
52
+ let primary = false;
53
+ let wrote = false;
54
+ async function read(sqls, call) {
55
+ if (!sqls.every((sql) => PURE_READ.test(sql))) {
56
+ primary = wrote = true;
57
+ return call(binding);
58
+ }
59
+ if (primary)
60
+ return call(binding);
61
+ let timer;
62
+ const late = new Promise((resolve) => {
63
+ timer = setTimeout(() => {
64
+ resolve(LATE);
65
+ }, REPLICA_READ_TIMEOUT_MS);
66
+ });
67
+ try {
68
+ const out = await Promise.race([call(session), late]);
69
+ if (out !== LATE)
70
+ return out;
71
+ }
72
+ finally {
73
+ clearTimeout(timer);
74
+ }
75
+ primary = true;
76
+ console.warn(JSON.stringify({ event: 'd1_replica_read_timeout', ms: REPLICA_READ_TIMEOUT_MS }));
77
+ return call(binding);
78
+ }
79
+ const statement = (sql, params = []) => {
80
+ const real = (db) => db.prepare(sql).bind(...params);
81
+ const bounded = (method) => (...args) => read([sql], (db) => real(db)[method](...args));
82
+ return {
83
+ sql,
84
+ real,
85
+ bind: (...values) => statement(sql, values),
86
+ first: bounded('first'),
87
+ run: bounded('run'),
88
+ all: bounded('all'),
89
+ raw: bounded('raw'),
90
+ };
91
+ };
92
+ const db = {
93
+ prepare: (sql) => statement(sql),
94
+ batch: (statements) => {
95
+ const mine = statements;
96
+ return read(mine.map((s) => s.sql), (d) => d.batch(mine.map((s) => s.real(d))));
97
+ },
98
+ exec: (sql) => {
99
+ primary = wrote = true;
100
+ return binding.exec(sql);
101
+ },
34
102
  dump: () => binding.dump(),
35
103
  withSession: (c) => binding.withSession(c),
36
104
  };
37
- return run({ ...env, TOTALUM_DB: replicaDb });
105
+ return { db, wrote: () => wrote };
38
106
  }
@@ -1,8 +1,8 @@
1
- import { E as EmailSendInput, j as EmailView } from '../_types/integrations.d-Bb3j7BnK.js';
2
- export { i as EmailSendOutput } from '../_types/integrations.d-Bb3j7BnK.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { E as EmailSendInput, j as EmailView } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { i as EmailSendOutput } from '../_types/integrations.d-DH0xUdPA.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.js';
6
6
 
7
7
  /**
8
8
  * `totalum.email` (plan 05 §6.4) over SDK-API `/v1/email/*` (scope `email`): Resend, HTML sent byte for byte, charged
@@ -1,8 +1,8 @@
1
- import { F as FileDescriptor, k as FileUploadUrlInput, m as FilesListQuery } from '../_types/integrations.d-Bb3j7BnK.js';
2
- export { l as FileUploadUrlOutput, n as FilesPage } from '../_types/integrations.d-Bb3j7BnK.js';
1
+ import { F as FileDescriptor, k as FileUploadUrlInput, m as FilesListQuery } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { l as FileUploadUrlOutput, n as FilesPage } from '../_types/integrations.d-DH0xUdPA.js';
3
3
  import { TotalumClientOptions } from '../ai/index.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.js';
6
6
 
7
7
  interface TotalumFilesOptions extends TotalumClientOptions {
8
8
  /** The public files host; default `TOTALUM_FILES_URL`, else `https://files.totalum-project.com` (A10.1). */
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-CbnzfZ4q.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-Bb3j7BnK.js';
34
- export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-wJWD6Zj7.js';
35
- export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-yekNDC4X.js';
36
- import './_types/coerce.d-CEK0K3O_.js';
32
+ export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-By9SsgZX.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-DH0xUdPA.js';
34
+ export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-EKzQhzOB.js';
35
+ export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-B85Ll6tb.js';
36
+ import './_types/coerce.d-o2vQHoho.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-wJWD6Zj7.js';
2
- export { L as LogsPage } from '../_types/ops.d-wJWD6Zj7.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { c as LogsQueryInput } from '../_types/ops.d-EKzQhzOB.js';
2
+ export { L as LogsPage } from '../_types/ops.d-EKzQhzOB.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.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-Bb3j7BnK.js';
2
- export { a as CheckoutOutput, h as CustomerPortalLinkOutput, o as OnboardingLinkOutput, P as PaymentsStatus } from '../_types/integrations.d-Bb3j7BnK.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { O as OnboardingLinkInput, C as CheckoutInput, g as CustomerPortalLinkInput } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { a as CheckoutOutput, h as CustomerPortalLinkOutput, o as OnboardingLinkOutput, P as PaymentsStatus } from '../_types/integrations.d-DH0xUdPA.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.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-Bb3j7BnK.js';
2
- export { r as PdfOutput } from '../_types/integrations.d-Bb3j7BnK.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { p as PdfFromHtmlInput, q as PdfFromUrlInput } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { r as PdfOutput } from '../_types/integrations.d-DH0xUdPA.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.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): {
@@ -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-CbnzfZ4q.js';
2
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
1
+ import { Z as ZodObject, c as ZodOptional, d as ZodString, g as ZodUnknown, m as $strip, o as output, u as ZodISODateTime, l as ZodInt, h as ZodRecord, j as ZodBoolean, T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
2
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.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-Bb3j7BnK.js';
2
- export { t as ScanOcrOutput } from '../_types/integrations.d-Bb3j7BnK.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { S as ScanDocumentInput, s as ScanOcrInput } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { t as ScanOcrOutput } from '../_types/integrations.d-DH0xUdPA.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.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-Bb3j7BnK.js';
2
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
3
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
4
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ export { w as SeoIndexNowKey, x as SeoNotifyOutput } from '../_types/integrations.d-DH0xUdPA.js';
2
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
3
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
4
+ import '../_types/coerce.d-o2vQHoho.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-Bb3j7BnK.js';
2
- export { A as TranscribeOutput } from '../_types/integrations.d-Bb3j7BnK.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { T as TranscribeInput, y as SpeakInput, z as StoredMedia } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { A as TranscribeOutput } from '../_types/integrations.d-DH0xUdPA.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.js';
6
6
 
7
7
  /** `totalum.speech` (plan 05 §6.8) over `/v1/speech/*` (scope `speech`): OpenRouter speech through Totalum. */
8
8
  /** The audio bytes of `synthesize` without `store`. */
@@ -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-Bb3j7BnK.js';
2
- export { J as JobCreated, v as ScreenshotOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from '../_types/integrations.d-Bb3j7BnK.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
5
- import '../_types/coerce.d-CEK0K3O_.js';
1
+ import { G as WebScrapeInput, H as WebSearchInput, I as WebMapInput, K as WebCrawlInput, u as ScreenshotInput } from '../_types/integrations.d-DH0xUdPA.js';
2
+ export { J as JobCreated, v as ScreenshotOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from '../_types/integrations.d-DH0xUdPA.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-By9SsgZX.js';
4
+ export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-By9SsgZX.js';
5
+ import '../_types/coerce.d-o2vQHoho.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-yekNDC4X.js';
2
- export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-yekNDC4X.js';
3
- import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-CbnzfZ4q.js';
4
- export { i as isTotalumError } from '../_types/errors.d-CbnzfZ4q.js';
1
+ import { a as WebhookEvent } from '../_types/billing.d-B85Ll6tb.js';
2
+ export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-B85Ll6tb.js';
3
+ import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-By9SsgZX.js';
4
+ export { i as isTotalumError } from '../_types/errors.d-By9SsgZX.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.11",
3
+ "version": "0.1.0-dev.13",
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",