totalum-sdk 1.2.0 → 1.4.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 (37) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/_types/{billing.d-NEKx9oFr.d.ts → billing.d-DYy1h_of.d.ts} +1 -1
  3. package/dist/_types/{coerce.d-Aya847-Q.d.ts → coerce.d-C8UzvDNt.d.ts} +1 -1
  4. package/dist/_types/{errors.d-EVOC2l-Z.d.ts → errors.d-D9Fn7nvE.d.ts} +2 -0
  5. package/dist/_types/{integrations.d-CGtCHddY.d.ts → integrations.d-Cs7J3hnC.d.ts} +29 -3
  6. package/dist/_types/{ops.d-DAfs2eGd.d.ts → ops.d-8jPJ2Znp.d.ts} +2 -2
  7. package/dist/ai/index.d.ts +4 -4
  8. package/dist/analytics/index.d.ts +4 -4
  9. package/dist/browser/index.d.ts +7 -4
  10. package/dist/cron/index.d.ts +5 -5
  11. package/dist/d1/d1-limits.js +88 -0
  12. package/dist/d1/errors.js +19 -5
  13. package/dist/d1/https.js +10 -6
  14. package/dist/d1/index.d.ts +13 -3
  15. package/dist/d1/index.js +3 -1
  16. package/dist/d1/lazy.js +61 -10
  17. package/dist/d1/libsql.js +106 -21
  18. package/dist/d1/migrate-rules.js +283 -0
  19. package/dist/d1/native-shape.js +42 -0
  20. package/dist/d1/sql.js +46 -33
  21. package/dist/email/index.d.ts +5 -5
  22. package/dist/files/index.d.ts +5 -5
  23. package/dist/index.d.ts +5 -5
  24. package/dist/logs/index.d.ts +5 -5
  25. package/dist/payments/index.d.ts +21 -5
  26. package/dist/payments/index.js +5 -0
  27. package/dist/pdf/index.d.ts +5 -5
  28. package/dist/realtime/index.d.ts +2 -2
  29. package/dist/scan/index.d.ts +5 -5
  30. package/dist/seo/index.d.ts +4 -4
  31. package/dist/speech/index.d.ts +5 -5
  32. package/dist/vectors/index.d.ts +2 -2
  33. package/dist/web/index.d.ts +5 -5
  34. package/dist/webhooks/index.d.ts +4 -4
  35. package/package.json +2 -1
  36. package/totalum-sdk.md +20 -11
  37. package/totalum-sdk.signatures.json +10 -6
package/dist/d1/sql.js CHANGED
@@ -1,33 +1,30 @@
1
1
  import { isRecord } from './errors.js';
2
- /** Native D1 refuses these at `bind()` time with `D1_TYPE_ERROR`; both non-native paths do the same, synchronously. */
3
- export function assertBindable(values) {
4
- for (const v of values) {
5
- const ok = v === null ||
6
- typeof v === 'string' ||
7
- typeof v === 'number' ||
8
- typeof v === 'boolean' ||
9
- v instanceof ArrayBuffer ||
10
- ArrayBuffer.isView(v);
11
- if (!ok)
12
- throw new Error(`D1_TYPE_ERROR: Type '${typeof v}' not supported for value '${describe(v)}'`);
13
- }
14
- }
15
- /** The value as D1 prints it in `D1_TYPE_ERROR` (`${value}`). */
16
- function describe(v) {
17
- switch (typeof v) {
18
- case 'bigint':
19
- case 'number':
20
- case 'boolean':
21
- case 'string':
22
- case 'symbol':
23
- return v.toString();
24
- case 'undefined':
25
- return 'undefined';
26
- case 'function':
27
- return 'function';
28
- default:
29
- return '[object Object]';
30
- }
2
+ /**
3
+ * Each value as the native binding binds it (research 72, measured on production D1): `null`, strings, numbers and
4
+ * booleans as they are (a non-finite number binds as `NULL`); `ArrayBuffer`, `Uint8Array` (a `Buffer`) and an empty
5
+ * array as a BLOB; a `DataView` as an empty BLOB; any other typed array as its text (`Int16Array [1, 256]` → `'1,256'`).
6
+ * Anything else is refused at `bind()` with the binding's own `D1_TYPE_ERROR` (the value printed as `${value}`).
7
+ */
8
+ export function bindable(values) {
9
+ return values.map((v) => {
10
+ if (v === null || typeof v === 'string' || typeof v === 'boolean')
11
+ return v;
12
+ if (typeof v === 'number')
13
+ return Number.isFinite(v) ? v : null;
14
+ if (v instanceof ArrayBuffer || v instanceof Uint8Array)
15
+ return v;
16
+ if (v instanceof DataView || (Array.isArray(v) && v.length === 0))
17
+ return new Uint8Array(0);
18
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- D1 prints the value as `${value}`
19
+ if (ArrayBuffer.isView(v))
20
+ return String(v);
21
+ // D1 prints the value as `${value}`, which throws a TypeError for a Symbol (String() would not)
22
+ if (typeof v === 'symbol')
23
+ throw new TypeError('Cannot convert a Symbol value to a string');
24
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- D1 prints the value as `${value}`
25
+ const message = `Type '${typeof v}' not supported for value '${String(v)}'`;
26
+ throw new Error(`D1_TYPE_ERROR: ${message}`, { cause: new Error(message) });
27
+ });
31
28
  }
32
29
  /** `first(col)` as the binding does it: `null` on no rows, `D1_COLUMN_NOTFOUND` on an unknown column. */
33
30
  export function pickFirst(results, colName) {
@@ -37,12 +34,28 @@ export function pickFirst(results, colName) {
37
34
  if (colName === undefined)
38
35
  return row;
39
36
  if (!isRecord(row) || !(colName in row))
40
- throw new Error(`D1_COLUMN_NOTFOUND: Column not found (${colName})`);
37
+ throw new Error(`D1_COLUMN_NOTFOUND: Column not found (${colName})`, {
38
+ cause: new Error('Column not found'),
39
+ });
41
40
  return row[colName];
42
41
  }
43
42
  /**
44
- * Splits an `exec()` script on statement boundaries — `;` inside string literals, quoted identifiers and
45
- * comments is not a boundary (plan 05 §3.4). Empty trailing fragments are dropped.
43
+ * A `;` inside the `BEGIN … END` body of a `CREATE TRIGGER` ends one of its statements, not the trigger (as SDK-API's
44
+ * statement guard reads it). Keywords are counted with literals and comments blanked; a `CASE` brings its own `END`.
45
+ */
46
+ function insideTriggerBody(fragment) {
47
+ const bare = fragment
48
+ .replace(/'(?:[^']|'')*'|"(?:[^"]|"")*"|`[^`]*`|\[[^\]]*\]|--[^\n]*|\/\*[\s\S]*?\*\//g, ' ')
49
+ .toUpperCase();
50
+ if (!/^\s*CREATE\s+(TEMP\s+|TEMPORARY\s+)?TRIGGER\b/.test(bare))
51
+ return false;
52
+ const count = (word) => (bare.match(word) ?? []).length;
53
+ // every `CASE` closes with an `END` of its own
54
+ return count(/\bBEGIN\b/g) + count(/\bCASE\b/g) > count(/\bEND\b/g);
55
+ }
56
+ /**
57
+ * Splits an `exec()` script on statement boundaries — `;` inside string literals, quoted identifiers,
58
+ * comments and a trigger's body is not a boundary (plan 05 §3.4). Empty trailing fragments are dropped.
46
59
  */
47
60
  export function splitStatements(script) {
48
61
  const out = [];
@@ -74,7 +87,7 @@ export function splitStatements(script) {
74
87
  break;
75
88
  i += 2;
76
89
  }
77
- else if (c === ';') {
90
+ else if (c === ';' && !insideTriggerBody(script.slice(start, i))) {
78
91
  out.push(script.slice(start, i));
79
92
  start = ++i;
80
93
  }
@@ -1,8 +1,8 @@
1
- import { E as EmailSendInput, j as EmailView } from '../_types/integrations.d-CGtCHddY.js';
2
- export { i as EmailSendOutput } from '../_types/integrations.d-CGtCHddY.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { E as EmailSendInput, k as EmailView } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ export { j as EmailSendOutput } from '../_types/integrations.d-Cs7J3hnC.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.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-CGtCHddY.js';
2
- export { l as FileUploadUrlOutput, n as FilesPage } from '../_types/integrations.d-CGtCHddY.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { F as FileDescriptor, l as FileUploadUrlInput, n as FilesListQuery } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ export { m as FileUploadUrlOutput, o as FilesPage } from '../_types/integrations.d-Cs7J3hnC.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.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
@@ -31,11 +31,11 @@ export { TotalumWeb } from './web/index.js';
31
31
  import { totalumWebhooks } from './webhooks/index.js';
32
32
  export { TotalumWebhookError, TotalumWebhooks, verifyWebhook } from './webhooks/index.js';
33
33
  export { D1Database, D1DatabaseSession, D1ExecResult, D1PreparedStatement, D1Result, READ_YOUR_WRITES_COOKIE, TotalumD1ClientCode, TotalumD1Error, TotalumD1ErrorCode, TotalumD1Options, isTotalumD1Error, totalumD1, withTotalumSession } from './d1/index.js';
34
- export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-EVOC2l-Z.js';
35
- 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, R as RefundInput, s as RefundOutput, S as ScanDocumentInput, t as ScanOcrInput, u as ScanOcrOutput, v as ScreenshotInput, w as ScreenshotOutput, x as SeoIndexNowKey, y as SeoNotifyOutput, z as SpeakInput, A as StoredMedia, T as TranscribeInput, B as TranscribeOutput, W as WebJob, D as WebScrapeOutput, G as WebSearchOutput } from './_types/integrations.d-CGtCHddY.js';
36
- export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-DAfs2eGd.js';
37
- export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-NEKx9oFr.js';
38
- import './_types/coerce.d-Aya847-Q.js';
34
+ export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-D9Fn7nvE.js';
35
+ export { C as CheckoutInput, a as CheckoutOutput, b as CheckoutSession, c as CronJob, d as CronJobInput, e as CronJobPatch, f as CronRun, g as CronRunsPage, h as CustomerPortalLinkInput, i as CustomerPortalLinkOutput, E as EmailSendInput, j as EmailSendOutput, k as EmailView, F as FileDescriptor, l as FileUploadUrlInput, m as FileUploadUrlOutput, n as FilesListQuery, o as FilesPage, J as JobCreated, O as OnboardingLinkInput, p as OnboardingLinkOutput, P as PaymentsStatus, q as PdfFromHtmlInput, r as PdfFromUrlInput, s as PdfOutput, R as RefundInput, t as RefundOutput, S as ScanDocumentInput, u as ScanOcrInput, v as ScanOcrOutput, w as ScreenshotInput, x as ScreenshotOutput, y as SeoIndexNowKey, z as SeoNotifyOutput, A as SpeakInput, B as StoredMedia, T as TranscribeInput, D as TranscribeOutput, W as WebJob, G as WebScrapeOutput, H as WebSearchOutput } from './_types/integrations.d-Cs7J3hnC.js';
36
+ export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-8jPJ2Znp.js';
37
+ export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-DYy1h_of.js';
38
+ import './_types/coerce.d-C8UzvDNt.js';
39
39
 
40
40
  /** The options of `createTotalum()`: every namespace's options in one object (each falls back to its env var). */
41
41
  type TotalumOptions = TotalumAiOptions & TotalumFilesOptions;
@@ -1,8 +1,8 @@
1
- import { c as LogsQueryInput } from '../_types/ops.d-DAfs2eGd.js';
2
- export { L as LogsPage } from '../_types/ops.d-DAfs2eGd.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { c as LogsQueryInput } from '../_types/ops.d-8jPJ2Znp.js';
2
+ export { L as LogsPage } from '../_types/ops.d-8jPJ2Znp.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.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, R as RefundInput } from '../_types/integrations.d-CGtCHddY.js';
2
- export { a as CheckoutOutput, h as CustomerPortalLinkOutput, o as OnboardingLinkOutput, P as PaymentsStatus, s as RefundOutput } from '../_types/integrations.d-CGtCHddY.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { O as OnboardingLinkInput, C as CheckoutInput, h as CustomerPortalLinkInput, R as RefundInput } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ export { a as CheckoutOutput, b as CheckoutSession, i as CustomerPortalLinkOutput, p as OnboardingLinkOutput, P as PaymentsStatus, t as RefundOutput } from '../_types/integrations.d-Cs7J3hnC.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.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
@@ -27,6 +27,7 @@ declare function totalumPayments(options?: TotalumClientOptions): {
27
27
  };
28
28
  applicationFeeBps: number;
29
29
  liveEnabled: boolean;
30
+ disconnectedAt?: string | null | undefined;
30
31
  }>;
31
32
  /** Stripe's hosted onboarding for the project owner (single use; never for the agent's sandbox key). */
32
33
  onboardingLink: (input: OnboardingLinkInput) => Promise<{
@@ -38,6 +39,21 @@ declare function totalumPayments(options?: TotalumClientOptions): {
38
39
  id: string;
39
40
  url: string;
40
41
  }>;
42
+ /**
43
+ * A Checkout Session read back (`paymentStatus: 'paid'`, your `metadata`): the page Stripe returns the buyer to
44
+ * (`successUrl` with `?session_id={CHECKOUT_SESSION_ID}`) confirms the payment with it — no webhook needed.
45
+ */
46
+ getCheckout: (sessionId: string) => Promise<{
47
+ id: string;
48
+ status: "expired" | "open" | "complete";
49
+ paymentStatus: "paid" | "unpaid" | "no_payment_required";
50
+ amountTotal: number | null;
51
+ currency: string | null;
52
+ metadata: Record<string, string>;
53
+ paymentIntentId: string | null;
54
+ customerEmail: string | null;
55
+ clientReferenceId: string | null;
56
+ }>;
41
57
  /** Stripe's hosted portal where a customer manages their subscriptions and saved cards. */
42
58
  customerPortalLink: (input: CustomerPortalLinkInput) => Promise<{
43
59
  url: string;
@@ -15,6 +15,11 @@ export function totalumPayments(options = {}) {
15
15
  onboardingLink: (input) => call('POST', '/v1/payments/onboarding-link', input),
16
16
  /** A hosted Checkout Session: `payment`, `subscription`, or `setup` (save a card for later). Redirect to `url`. */
17
17
  createCheckout: (input) => call('POST', '/v1/payments/checkout', input),
18
+ /**
19
+ * A Checkout Session read back (`paymentStatus: 'paid'`, your `metadata`): the page Stripe returns the buyer to
20
+ * (`successUrl` with `?session_id={CHECKOUT_SESSION_ID}`) confirms the payment with it — no webhook needed.
21
+ */
22
+ getCheckout: (sessionId) => call('GET', `/v1/payments/checkout/${encodeURIComponent(sessionId)}`),
18
23
  /** Stripe's hosted portal where a customer manages their subscriptions and saved cards. */
19
24
  customerPortalLink: (input) => call('POST', '/v1/payments/customer-portal-link', input),
20
25
  refunds: {
@@ -1,8 +1,8 @@
1
- import { p as PdfFromHtmlInput, q as PdfFromUrlInput } from '../_types/integrations.d-CGtCHddY.js';
2
- export { r as PdfOutput } from '../_types/integrations.d-CGtCHddY.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { q as PdfFromHtmlInput, r as PdfFromUrlInput } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ export { s as PdfOutput } from '../_types/integrations.d-Cs7J3hnC.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.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, u as ZodISODateTime, l as ZodInt, h as ZodRecord, j as ZodBoolean, T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
2
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.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-D9Fn7nvE.js';
2
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.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, t as ScanOcrInput } from '../_types/integrations.d-CGtCHddY.js';
2
- export { u as ScanOcrOutput } from '../_types/integrations.d-CGtCHddY.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { S as ScanDocumentInput, u as ScanOcrInput } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ export { v as ScanOcrOutput } from '../_types/integrations.d-Cs7J3hnC.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.js';
6
6
 
7
7
  /**
8
8
  * The v1 scan result: the extracted fields (one set per page with `processEveryPdfPageAsDifferentScan`), the v1
@@ -1,7 +1,7 @@
1
- export { x as SeoIndexNowKey, y as SeoNotifyOutput } from '../_types/integrations.d-CGtCHddY.js';
2
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
3
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
4
- import '../_types/coerce.d-Aya847-Q.js';
1
+ export { y as SeoIndexNowKey, z as SeoNotifyOutput } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
3
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
4
+ import '../_types/coerce.d-C8UzvDNt.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, z as SpeakInput, A as StoredMedia } from '../_types/integrations.d-CGtCHddY.js';
2
- export { B as TranscribeOutput } from '../_types/integrations.d-CGtCHddY.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { T as TranscribeInput, A as SpeakInput, B as StoredMedia } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ export { D as TranscribeOutput } from '../_types/integrations.d-Cs7J3hnC.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.js';
6
6
 
7
7
  /** The audio bytes of `synthesize` without `store`, and what the call cost (`usage.credits`, the call's hold). */
8
8
  interface SpeechAudio {
@@ -1,5 +1,5 @@
1
- import { Z as ZodObject, d as ZodString, c as ZodOptional, e as ZodArray, k as ZodNumber, f as ZodEnum, h as ZodRecord, n as ZodUnion, j as ZodBoolean, m as $strip, o as output, l as ZodInt, q as $partial, x as $strict, T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
2
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
1
+ import { Z as ZodObject, d as ZodString, c as ZodOptional, e as ZodArray, k as ZodNumber, f as ZodEnum, h as ZodRecord, n as ZodUnion, j as ZodBoolean, m as $strip, o as output, l as ZodInt, q as $partial, x as $strict, T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
2
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
3
3
 
4
4
  /** `text` = the `embed` preset's space; `image` = the `embed-image` preset's text+image space. */
5
5
  declare const VectorSpace: ZodEnum<{
@@ -1,8 +1,8 @@
1
- import { H as WebScrapeInput, I as WebSearchInput, K as WebMapInput, L as WebCrawlInput, v as ScreenshotInput } from '../_types/integrations.d-CGtCHddY.js';
2
- export { J as JobCreated, w as ScreenshotOutput, W as WebJob, D as WebScrapeOutput, G as WebSearchOutput } from '../_types/integrations.d-CGtCHddY.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
5
- import '../_types/coerce.d-Aya847-Q.js';
1
+ import { I as WebScrapeInput, K as WebSearchInput, L as WebMapInput, M as WebCrawlInput, w as ScreenshotInput } from '../_types/integrations.d-Cs7J3hnC.js';
2
+ export { J as JobCreated, x as ScreenshotOutput, W as WebJob, G as WebScrapeOutput, H as WebSearchOutput } from '../_types/integrations.d-Cs7J3hnC.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.js';
5
+ import '../_types/coerce.d-C8UzvDNt.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-NEKx9oFr.js';
2
- export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-NEKx9oFr.js';
3
- import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-EVOC2l-Z.js';
4
- export { b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-EVOC2l-Z.js';
1
+ import { a as WebhookEvent } from '../_types/billing.d-DYy1h_of.js';
2
+ export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-DYy1h_of.js';
3
+ import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-D9Fn7nvE.js';
4
+ export { b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-D9Fn7nvE.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": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "The SDK generated Totalum apps import: every integration namespace over SDK-API (totalum-sdk, or one subpath each: /files, /ai, /web, \u2026) and totalum-sdk/d1, the D1 driver",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -110,6 +110,7 @@
110
110
  "test:node": "vitest run --project node",
111
111
  "test:workerd": "vitest run --project workerd",
112
112
  "test:dev": "vitest run --config test/dev/vitest.config.ts",
113
+ "test:dev-patterns": "vitest run --config test/dev-patterns/vitest.config.ts",
113
114
  "prepare": "lefthook install || echo \"lefthook: hooks not installed (git >= 2.31 required)\"",
114
115
  "types:check": "node scripts/check-types.mjs"
115
116
  },