totalum-sdk 1.10.0 → 1.10.2

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 (56) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/_types/{coerce.d-3Xj4xYuy.d.ts → coerce.d-CPCsfDiI.d.ts} +1 -1
  3. package/dist/_types/{errors.d-BBRayxHv.d.ts → errors.d-BPFTeSP3.d.ts} +8 -6
  4. package/dist/_types/{integrations.d-Hj3BqI02.d.ts → integrations.d-BvRYfTa8.d.ts} +11 -11
  5. package/dist/_types/{ops.d-D_3lqkJ2.d.ts → ops.d-BbXiJS_G.d.ts} +3 -3
  6. package/dist/ai/index.d.ts +11 -12
  7. package/dist/ai/index.js +3 -3
  8. package/dist/analytics/index.d.ts +5 -5
  9. package/dist/analytics/index.js +1 -1
  10. package/dist/browser/index.d.ts +15 -12
  11. package/dist/browser/index.js +4 -4
  12. package/dist/cron/index.d.ts +10 -10
  13. package/dist/cron/index.js +5 -5
  14. package/dist/d1/d1-limits.js +1 -1
  15. package/dist/d1/errors.js +3 -3
  16. package/dist/d1/https.js +3 -3
  17. package/dist/d1/index.d.ts +12 -12
  18. package/dist/d1/index.js +2 -2
  19. package/dist/d1/lazy.js +4 -4
  20. package/dist/d1/libsql.js +5 -5
  21. package/dist/d1/migrate-rules.js +5 -5
  22. package/dist/d1/native-shape.js +2 -2
  23. package/dist/d1/retry.js +3 -3
  24. package/dist/d1/session.js +3 -3
  25. package/dist/d1/sql.js +2 -2
  26. package/dist/email/index.d.ts +6 -6
  27. package/dist/email/index.js +1 -1
  28. package/dist/errors.js +4 -4
  29. package/dist/files/index.d.ts +11 -11
  30. package/dist/files/index.js +4 -4
  31. package/dist/http.js +7 -7
  32. package/dist/index.d.ts +5 -5
  33. package/dist/index.js +1 -1
  34. package/dist/logs/index.d.ts +6 -6
  35. package/dist/logs/index.js +1 -1
  36. package/dist/payments/index.d.ts +9 -7
  37. package/dist/payments/index.js +4 -2
  38. package/dist/pdf/index.d.ts +6 -6
  39. package/dist/pdf/index.js +1 -1
  40. package/dist/react/index.d.ts +1 -1
  41. package/dist/realtime/index.d.ts +5 -5
  42. package/dist/realtime/index.js +1 -1
  43. package/dist/scan/index.d.ts +6 -6
  44. package/dist/scan/index.js +1 -1
  45. package/dist/seo/index.d.ts +5 -5
  46. package/dist/seo/index.js +1 -1
  47. package/dist/speech/index.d.ts +6 -6
  48. package/dist/speech/index.js +1 -1
  49. package/dist/vectors/index.d.ts +4 -4
  50. package/dist/web/index.d.ts +6 -6
  51. package/dist/web/index.js +1 -1
  52. package/dist/webhooks/index.d.ts +6 -5
  53. package/dist/webhooks/index.js +5 -4
  54. package/package.json +2 -2
  55. package/totalum-sdk.md +30 -27
  56. package/totalum-sdk.signatures.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { jsonClient } from '../http.js';
2
2
  export { TotalumError, isTotalumError } from '../errors.js';
3
3
  /**
4
- * `totalum.logs` (plan 05 §6.11) over SDK-API `/v1/logs` (scope `logs:read`; the agent's sandbox key reads its dev
4
+ * `totalum.logs` over the Totalum API `/v1/logs` (scope `logs:read`; the agent's sandbox key reads its dev
5
5
  * preview for free): the Worker invocations of the published app (`env: 'live'`) or the preview (`'dev'`). Free.
6
6
  */
7
7
  export function totalumLogs(options = {}) {
@@ -1,14 +1,16 @@
1
- import { O as OnboardingLinkInput, C as CheckoutInput, h as CustomerPortalLinkInput, G as SubscriptionUpdateInput, R as RefundInput } from '../_types/integrations.d-Hj3BqI02.js';
2
- export { a as CheckoutOutput, b as CheckoutSession, i as CustomerPortalLinkOutput, p as OnboardingLinkOutput, P as PaymentsStatus, t as RefundOutput, D as Subscription } from '../_types/integrations.d-Hj3BqI02.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-BBRayxHv.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.js';
5
- import '../_types/coerce.d-3Xj4xYuy.js';
1
+ import { O as OnboardingLinkInput, C as CheckoutInput, h as CustomerPortalLinkInput, G as SubscriptionUpdateInput, R as RefundInput } from '../_types/integrations.d-BvRYfTa8.js';
2
+ export { a as CheckoutOutput, b as CheckoutSession, i as CustomerPortalLinkOutput, p as OnboardingLinkOutput, P as PaymentsStatus, t as RefundOutput, D as Subscription } from '../_types/integrations.d-BvRYfTa8.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-BPFTeSP3.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.js';
5
+ import '../_types/coerce.d-CPCsfDiI.js';
6
6
 
7
7
  /**
8
- * `totalum.payments` (plan 05, plan 11 §9.5) over SDK-API `/v1/payments/*` with a project key (scope `payments`): Stripe
8
+ * `totalum.payments` over the Totalum API `/v1/payments/*` with a project key (scope `payments`): Stripe
9
9
  * Connect direct charges on the project's own connected account. Card data never passes through here — send buyers to
10
- * the hosted Checkout `url` (SAQ-A); SDK-API refuses card fields with `CARD_DATA_NOT_ACCEPTED`. Stripe test mode on the
10
+ * the hosted Checkout `url` (SAQ-A); the Totalum API refuses card fields with `CARD_DATA_NOT_ACCEPTED`. Stripe test mode on the
11
11
  * preview and in the sandbox; live mode only on the published site, once the owner onboarded and switched live on.
12
+ * Payment events (`payments.<Stripe type>`) reach the app's own `POST /api/webhooks/stripe` with no setup — test mode's
13
+ * on the preview, live mode's on the published site — signed by Totalum: verify them with `totalum.webhooks.verify`.
12
14
  */
13
15
  declare function totalumPayments(options?: TotalumClientOptions): {
14
16
  /** Whether the project's Stripe account can take payments (charges, payouts, pending requirements). */
@@ -1,10 +1,12 @@
1
1
  import { jsonClient } from '../http.js';
2
2
  export { TotalumError, isTotalumError } from '../errors.js';
3
3
  /**
4
- * `totalum.payments` (plan 05, plan 11 §9.5) over SDK-API `/v1/payments/*` with a project key (scope `payments`): Stripe
4
+ * `totalum.payments` over the Totalum API `/v1/payments/*` with a project key (scope `payments`): Stripe
5
5
  * Connect direct charges on the project's own connected account. Card data never passes through here — send buyers to
6
- * the hosted Checkout `url` (SAQ-A); SDK-API refuses card fields with `CARD_DATA_NOT_ACCEPTED`. Stripe test mode on the
6
+ * the hosted Checkout `url` (SAQ-A); the Totalum API refuses card fields with `CARD_DATA_NOT_ACCEPTED`. Stripe test mode on the
7
7
  * preview and in the sandbox; live mode only on the published site, once the owner onboarded and switched live on.
8
+ * Payment events (`payments.<Stripe type>`) reach the app's own `POST /api/webhooks/stripe` with no setup — test mode's
9
+ * on the preview, live mode's on the published site — signed by Totalum: verify them with `totalum.webhooks.verify`.
8
10
  */
9
11
  export function totalumPayments(options = {}) {
10
12
  const call = jsonClient(options);
@@ -1,10 +1,10 @@
1
- import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-BBRayxHv.js';
2
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.js';
3
- import { q as PdfFromHtmlInput, r as PdfFromUrlInput } from '../_types/integrations.d-Hj3BqI02.js';
4
- export { s as PdfOutput } from '../_types/integrations.d-Hj3BqI02.js';
5
- import '../_types/coerce.d-3Xj4xYuy.js';
1
+ import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-BPFTeSP3.js';
2
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.js';
3
+ import { q as PdfFromHtmlInput, r as PdfFromUrlInput } from '../_types/integrations.d-BvRYfTa8.js';
4
+ export { s as PdfOutput } from '../_types/integrations.d-BvRYfTa8.js';
5
+ import '../_types/coerce.d-CPCsfDiI.js';
6
6
 
7
- /** `totalum.pdf` (plan 04 §5.5) over `/v1/pdf/*` (scope `files:write`): a new file in the project's storage each time. */
7
+ /** `totalum.pdf` over `/v1/pdf/*` (scope `files:write`): a new file in the project's storage each time. */
8
8
  declare function totalumPdf(options?: TotalumClientOptions): {
9
9
  /**
10
10
  * A PDF rendered from HTML, stored as a project file (`key`, `url`).
package/dist/pdf/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { envelopeClient, withUsage } from '../http.js';
2
2
  export { TotalumError, isTotalumError } from '../errors.js';
3
- /** `totalum.pdf` (plan 04 §5.5) over `/v1/pdf/*` (scope `files:write`): a new file in the project's storage each time. */
3
+ /** `totalum.pdf` over `/v1/pdf/*` (scope `files:write`): a new file in the project's storage each time. */
4
4
  export function totalumPdf(options = {}) {
5
5
  const call = envelopeClient(options);
6
6
  return {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `totalum-sdk/react` (plan 06 §12.5, A6.33): the browser side of `totalum.realtime`. The page never holds a key: it
2
+ * `totalum-sdk/react`: the browser side of `totalum.realtime`. The page never holds a key: it
3
3
  * asks the app's own server for a ticket (`POST ticketUrl {room}`, default `/api/realtime/ticket`), opens the room's
4
4
  * socket, and on every drop — a Totalum deploy drops them all — re-tickets and reconnects with backoff. Presence is
5
5
  * built on the same socket: `presence:*` messages plus a 30 s heartbeat (a room with present users stays awake).
@@ -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-BBRayxHv.js';
2
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.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-BPFTeSP3.js';
2
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.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<{
@@ -33,8 +33,8 @@ declare const RealtimeTicketOutput: ZodObject<{
33
33
  }, $strip>;
34
34
  type RealtimeTicketOutput = output<typeof RealtimeTicketOutput>;
35
35
  /**
36
- * `POST /v1/realtime/rooms/:room/publish` (scope `realtime`; plan 04 §5.16): server-side publish over HTTPS from the
37
- * app's own routes or a cron job. The room is resolved inside the key's project (A8.6); `identity` defaults to
36
+ * `POST /v1/realtime/rooms/:room/publish` (scope `realtime`): server-side publish over HTTPS from the
37
+ * app's own routes or a cron job. The room is resolved inside the key's project; `identity` defaults to
38
38
  * `{id: 'server'}`. Answers `202`.
39
39
  */
40
40
  declare const RealtimePublishInput: ZodObject<{
@@ -55,7 +55,7 @@ declare const RealtimePublishOutput: ZodObject<{
55
55
  type RealtimePublishOutput = output<typeof RealtimePublishOutput>;
56
56
 
57
57
  /**
58
- * `totalum.realtime` server side (plan 05 §6.14.1) over SDK-API `/v1/realtime/*` (scope `realtime`). The app's own
58
+ * `totalum.realtime` server side over the Totalum API `/v1/realtime/*` (scope `realtime`). The app's own
59
59
  * server mints a short-lived ticket after its own auth check and hands `{ticket, url}` to the page; the page opens the
60
60
  * `wss://` `url` and never holds a key.
61
61
  *
@@ -1,7 +1,7 @@
1
1
  import { jsonClient } from '../http.js';
2
2
  export { TotalumError, isTotalumError } from '../errors.js';
3
3
  /**
4
- * `totalum.realtime` server side (plan 05 §6.14.1) over SDK-API `/v1/realtime/*` (scope `realtime`). The app's own
4
+ * `totalum.realtime` server side over the Totalum API `/v1/realtime/*` (scope `realtime`). The app's own
5
5
  * server mints a short-lived ticket after its own auth check and hands `{ticket, url}` to the page; the page opens the
6
6
  * `wss://` `url` and never holds a key.
7
7
  *
@@ -1,8 +1,8 @@
1
- import { S as ScanDocumentInput, u as ScanOcrInput } from '../_types/integrations.d-Hj3BqI02.js';
2
- export { v as ScanOcrOutput } from '../_types/integrations.d-Hj3BqI02.js';
3
- import { U as Usage, T as TotalumClientOptions } from '../_types/errors.d-BBRayxHv.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.js';
5
- import '../_types/coerce.d-3Xj4xYuy.js';
1
+ import { S as ScanDocumentInput, u as ScanOcrInput } from '../_types/integrations.d-BvRYfTa8.js';
2
+ export { v as ScanOcrOutput } from '../_types/integrations.d-BvRYfTa8.js';
3
+ import { U as Usage, T as TotalumClientOptions } from '../_types/errors.d-BPFTeSP3.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.js';
5
+ import '../_types/coerce.d-CPCsfDiI.js';
6
6
 
7
7
  /**
8
8
  * The v1 scan result: the extracted fields (one set per page with `processEveryPdfPageAsDifferentScan`), the v1
@@ -19,7 +19,7 @@ interface ScanDocumentResult {
19
19
  };
20
20
  usage: Usage;
21
21
  }
22
- /** `totalum.scan` (plan 05 §6.7) over `/v1/scan/*` (scope `scan`): a vision model through Totalum's AI gateway. */
22
+ /** `totalum.scan` over `/v1/scan/*` (scope `scan`): a vision model through Totalum's AI gateway. */
23
23
  declare function totalumScan(options?: TotalumClientOptions): {
24
24
  /** Extracts the fields described by `properties` from a document or image (one set per page on request). */
25
25
  document: (input: ScanDocumentInput) => Promise<ScanDocumentResult>;
@@ -1,6 +1,6 @@
1
1
  import { envelopeClient, withUsage } from '../http.js';
2
2
  export { TotalumError, isTotalumError } from '../errors.js';
3
- /** `totalum.scan` (plan 05 §6.7) over `/v1/scan/*` (scope `scan`): a vision model through Totalum's AI gateway. */
3
+ /** `totalum.scan` over `/v1/scan/*` (scope `scan`): a vision model through Totalum's AI gateway. */
4
4
  export function totalumScan(options = {}) {
5
5
  const call = envelopeClient(options);
6
6
  return {
@@ -1,9 +1,9 @@
1
- export { y as SeoIndexNowKey, z as SeoNotifyOutput } from '../_types/integrations.d-Hj3BqI02.js';
2
- import { T as TotalumClientOptions } from '../_types/errors.d-BBRayxHv.js';
3
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.js';
4
- import '../_types/coerce.d-3Xj4xYuy.js';
1
+ export { y as SeoIndexNowKey, z as SeoNotifyOutput } from '../_types/integrations.d-BvRYfTa8.js';
2
+ import { T as TotalumClientOptions } from '../_types/errors.d-BPFTeSP3.js';
3
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.js';
4
+ import '../_types/coerce.d-CPCsfDiI.js';
5
5
 
6
- /** `totalum.seo` (plan 05 §6.10) over SDK-API `/v1/seo/*` (scope `seo`): IndexNow for verified custom domains, free. */
6
+ /** `totalum.seo` over the Totalum API `/v1/seo/*` (scope `seo`): IndexNow for verified custom domains, free. */
7
7
  declare function totalumSeo(options?: TotalumClientOptions): {
8
8
  /** Tells search engines (IndexNow) that these URLs of the project's custom domains changed. */
9
9
  notifyChanged: (urls: string[]) => Promise<{
package/dist/seo/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsonClient } from '../http.js';
2
2
  export { TotalumError, isTotalumError } from '../errors.js';
3
- /** `totalum.seo` (plan 05 §6.10) over SDK-API `/v1/seo/*` (scope `seo`): IndexNow for verified custom domains, free. */
3
+ /** `totalum.seo` over the Totalum API `/v1/seo/*` (scope `seo`): IndexNow for verified custom domains, free. */
4
4
  export function totalumSeo(options = {}) {
5
5
  const call = jsonClient(options);
6
6
  return {
@@ -1,8 +1,8 @@
1
- import { T as TranscribeInput, A as SpeakInput, B as StoredMedia } from '../_types/integrations.d-Hj3BqI02.js';
2
- export { H as TranscribeOutput } from '../_types/integrations.d-Hj3BqI02.js';
3
- import { T as TotalumClientOptions } from '../_types/errors.d-BBRayxHv.js';
4
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.js';
5
- import '../_types/coerce.d-3Xj4xYuy.js';
1
+ import { T as TranscribeInput, A as SpeakInput, B as StoredMedia } from '../_types/integrations.d-BvRYfTa8.js';
2
+ export { H as TranscribeOutput } from '../_types/integrations.d-BvRYfTa8.js';
3
+ import { T as TotalumClientOptions } from '../_types/errors.d-BPFTeSP3.js';
4
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.js';
5
+ import '../_types/coerce.d-CPCsfDiI.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 {
@@ -14,7 +14,7 @@ interface SpeechAudio {
14
14
  /** @deprecated Since 1.0.0: use `usage.credits` (the same number). */
15
15
  readonly credits: number;
16
16
  }
17
- /** `totalum.speech` (plan 05 §6.8) over `/v1/speech/*` (scope `speech`): speech to text and text to speech through Totalum. */
17
+ /** `totalum.speech` over `/v1/speech/*` (scope `speech`): speech to text and text to speech through Totalum. */
18
18
  declare function totalumSpeech(options?: TotalumClientOptions): {
19
19
  /**
20
20
  * Speech to text from `audioBase64` (+ `filename` with its extension) or a `url` — a public one, or a file this
@@ -1,7 +1,7 @@
1
1
  import { deprecated } from '../deprecate.js';
2
2
  import { jsonClient, rawClient } from '../http.js';
3
3
  export { TotalumError, isTotalumError } from '../errors.js';
4
- /** `totalum.speech` (plan 05 §6.8) over `/v1/speech/*` (scope `speech`): speech to text and text to speech through Totalum. */
4
+ /** `totalum.speech` over `/v1/speech/*` (scope `speech`): speech to text and text to speech through Totalum. */
5
5
  export function totalumSpeech(options = {}) {
6
6
  const call = jsonClient(options);
7
7
  const raw = rawClient(options);
@@ -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, U as Usage } from '../_types/errors.d-BBRayxHv.js';
2
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.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, U as Usage } from '../_types/errors.d-BPFTeSP3.js';
2
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.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<{
@@ -7,7 +7,7 @@ declare const VectorSpace: ZodEnum<{
7
7
  image: "image";
8
8
  }>;
9
9
  type VectorSpace = output<typeof VectorSpace>;
10
- /** ≤ 9 KiB as JSON (Vectorize keeps 10 KiB); keys starting with `_` are reserved. */
10
+ /** ≤ 9 KiB as JSON (the vector index keeps 10 KiB); keys starting with `_` are reserved. */
11
11
  declare const VectorMetadata: ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>;
12
12
  type VectorMetadata = output<typeof VectorMetadata>;
13
13
  declare const VectorUpsertItem: ZodObject<{
@@ -22,7 +22,7 @@ declare const VectorUpsertItem: ZodObject<{
22
22
  metadata: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>>;
23
23
  }, $strip>;
24
24
  type VectorUpsertItem = output<typeof VectorUpsertItem>;
25
- /** A Vectorize metadata filter on `VECTOR_FILTER_KEYS` only. */
25
+ /** A the vector index metadata filter on `VECTOR_FILTER_KEYS` only. */
26
26
  declare const VectorFilter: ZodRecord<ZodEnum<{
27
27
  type: "type";
28
28
  source: "source";
@@ -1,11 +1,11 @@
1
- import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-BBRayxHv.js';
2
- export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.js';
3
- import { L as WebScrapeInput, M as WebSearchInput, N as WebMapInput, Q as WebCrawlInput, w as ScreenshotInput } from '../_types/integrations.d-Hj3BqI02.js';
4
- export { J as JobCreated, x as ScreenshotOutput, W as WebJob, I as WebScrapeOutput, K as WebSearchOutput } from '../_types/integrations.d-Hj3BqI02.js';
5
- import '../_types/coerce.d-3Xj4xYuy.js';
1
+ import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-BPFTeSP3.js';
2
+ export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.js';
3
+ import { L as WebScrapeInput, M as WebSearchInput, N as WebMapInput, Q as WebCrawlInput, w as ScreenshotInput } from '../_types/integrations.d-BvRYfTa8.js';
4
+ export { J as JobCreated, x as ScreenshotOutput, W as WebJob, I as WebScrapeOutput, K as WebSearchOutput } from '../_types/integrations.d-BvRYfTa8.js';
5
+ import '../_types/coerce.d-CPCsfDiI.js';
6
6
 
7
7
  /**
8
- * `totalum.web` (plan 05 §6.2) over SDK-API `/v1/web/*` (scope `web`): scrape, search, map, crawl and screenshots,
8
+ * `totalum.web` over the Totalum API `/v1/web/*` (scope `web`): scrape, search, map, crawl and screenshots,
9
9
  * billed in credits — every result carries `usage.credits`.
10
10
  */
11
11
  declare function totalumWeb(options?: TotalumClientOptions): {
package/dist/web/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { envelopeClient, withUsage } from '../http.js';
2
2
  export { TotalumError, isTotalumError } from '../errors.js';
3
3
  /**
4
- * `totalum.web` (plan 05 §6.2) over SDK-API `/v1/web/*` (scope `web`): scrape, search, map, crawl and screenshots,
4
+ * `totalum.web` over the Totalum API `/v1/web/*` (scope `web`): scrape, search, map, crawl and screenshots,
5
5
  * billed in credits — every result carries `usage.credits`.
6
6
  */
7
7
  export function totalumWeb(options = {}) {
@@ -1,5 +1,5 @@
1
- import { Z as ZodObject, d as ZodString, u as ZodISODateTime, f as ZodEnum, c as ZodOptional, j as ZodBoolean, h as ZodRecord, g as ZodUnknown, m as $strip, o as output, w as ZodNullable, p as ZodURL, T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-BBRayxHv.js';
2
- export { b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BBRayxHv.js';
1
+ import { Z as ZodObject, d as ZodString, u as ZodISODateTime, f as ZodEnum, c as ZodOptional, j as ZodBoolean, h as ZodRecord, g as ZodUnknown, m as $strip, o as output, w as ZodNullable, p as ZodURL, T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-BPFTeSP3.js';
2
+ export { b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BPFTeSP3.js';
3
3
 
4
4
  /** The delivery body: `{id, type, createdAt, projectId, env, livemode?, data}`, idempotent by `id`. */
5
5
  declare const WebhookEvent: ZodObject<{
@@ -28,14 +28,14 @@ declare const WebhookSecretOutput: ZodObject<{
28
28
  }, $strip>;
29
29
  type WebhookSecretOutput = output<typeof WebhookSecretOutput>;
30
30
 
31
- /** A webhook refusal (plan 05 §7.2): the codes never travel, the app answers 400. */
31
+ /** A webhook refusal: the codes never travel, the app answers 400. */
32
32
  declare class TotalumWebhookError extends TotalumError {
33
33
  name: string;
34
34
  readonly errorCode: 'WEBHOOK_SECRET_MISSING' | 'WEBHOOK_SIGNATURE_INVALID' | 'WEBHOOK_TIMESTAMP_EXPIRED';
35
35
  constructor(errorCode: TotalumWebhookError['errorCode'], message: string);
36
36
  }
37
37
  /**
38
- * `totalum.webhooks.verify` (plan 04 §5.13): checks `Totalum-Signature: t=…,v1=…` — HMAC-SHA256 keyed with the
38
+ * `totalum.webhooks.verify`: checks `Totalum-Signature: t=…,v1=…` — HMAC-SHA256 keyed with the
39
39
  * endpoint's secret string over `${t}.${rawBody}` — within ±300 s, and returns the parsed event. Pass the body exactly
40
40
  * as received (`await request.text()`). `secret` defaults to `TOTALUM_WEBHOOK_SECRET`, which Totalum sets on the
41
41
  * preview, the published site and the sandbox (a rotation reaches them at once): never ask the owner to set it.
@@ -45,8 +45,9 @@ declare class TotalumWebhookError extends TotalumError {
45
45
  */
46
46
  declare function verifyWebhook(rawBody: string, headers: Headers | Record<string, string | undefined>, secret?: string | undefined, now?: number): Promise<WebhookEvent>;
47
47
  /**
48
- * `totalum.webhooks` (plan 04 §5.13) over SDK-API `/v1/webhooks` (a key with scope `*`): where the project receives its
48
+ * `totalum.webhooks` over the Totalum API `/v1/webhooks` (a key with scope `*`): where the project receives its
49
49
  * signed events (payments, e-mail, browser programs, `project.credits.exhausted`) and the secret they are signed with.
50
+ * Payment events also reach the app's own `/api/webhooks/stripe` by themselves; this URL is an optional extra address.
50
51
  */
51
52
  declare function totalumWebhooks(options?: TotalumClientOptions): {
52
53
  /** Same as `verifyWebhook`: checks `Totalum-Signature` and returns the parsed event. */
@@ -1,10 +1,10 @@
1
1
  import { TotalumError } from '../errors.js';
2
2
  import { jsonClient, readEnv } from '../http.js';
3
3
  export { TotalumError, isTotalumError } from '../errors.js';
4
- /** Literals type-locked to contracts, so the published package imports nothing at runtime (plan 05 §1). */
4
+ /** Literals type-locked to contracts, so the published package imports nothing at runtime. */
5
5
  const SIGNATURE_HEADER = 'Totalum-Signature';
6
6
  const TOLERANCE_SECONDS = 300;
7
- /** A webhook refusal (plan 05 §7.2): the codes never travel, the app answers 400. */
7
+ /** A webhook refusal: the codes never travel, the app answers 400. */
8
8
  export class TotalumWebhookError extends TotalumError {
9
9
  name = 'TotalumWebhookError';
10
10
  constructor(errorCode, message) {
@@ -13,7 +13,7 @@ export class TotalumWebhookError extends TotalumError {
13
13
  }
14
14
  const enc = new TextEncoder();
15
15
  /**
16
- * `totalum.webhooks.verify` (plan 04 §5.13): checks `Totalum-Signature: t=…,v1=…` — HMAC-SHA256 keyed with the
16
+ * `totalum.webhooks.verify`: checks `Totalum-Signature: t=…,v1=…` — HMAC-SHA256 keyed with the
17
17
  * endpoint's secret string over `${t}.${rawBody}` — within ±300 s, and returns the parsed event. Pass the body exactly
18
18
  * as received (`await request.text()`). `secret` defaults to `TOTALUM_WEBHOOK_SECRET`, which Totalum sets on the
19
19
  * preview, the published site and the sandbox (a rotation reaches them at once): never ask the owner to set it.
@@ -44,8 +44,9 @@ export async function verifyWebhook(rawBody, headers, secret = readEnv('TOTALUM_
44
44
  throw new TotalumWebhookError('WEBHOOK_SIGNATURE_INVALID', 'Totalum-Signature does not match');
45
45
  }
46
46
  /**
47
- * `totalum.webhooks` (plan 04 §5.13) over SDK-API `/v1/webhooks` (a key with scope `*`): where the project receives its
47
+ * `totalum.webhooks` over the Totalum API `/v1/webhooks` (a key with scope `*`): where the project receives its
48
48
  * signed events (payments, e-mail, browser programs, `project.credits.exhausted`) and the secret they are signed with.
49
+ * Payment events also reach the app's own `/api/webhooks/stripe` by themselves; this URL is an optional extra address.
49
50
  */
50
51
  export function totalumWebhooks(options = {}) {
51
52
  const call = jsonClient(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "totalum-sdk",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
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",
@@ -102,7 +102,7 @@
102
102
  "api:check": "node scripts/api-report.mjs --check",
103
103
  "compat": "node scripts/compat.mjs",
104
104
  "release:dev": "rm -rf dist && pnpm build && npm publish --tag dev",
105
- "release:next": "rm -rf dist && pnpm build && pnpm types:check && pnpm api:check && pnpm compat && npm publish --tag next",
105
+ "release:next": "rm -rf dist && pnpm build && pnpm types:check && pnpm api:check && pnpm compat && npm publish --tag latest && npm dist-tag add totalum-sdk@$npm_package_version next",
106
106
  "typecheck": "tsc --noEmit",
107
107
  "lint": "eslint . && prettier --check .",
108
108
  "format": "prettier --write .",