totalum-sdk 1.9.0 → 1.10.1
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/_types/{coerce.d-Cli9TkUD.d.ts → coerce.d-DiNiCkat.d.ts} +1 -1
- package/dist/_types/{errors.d-WcXvShIX.d.ts → errors.d-BfXTsxYG.d.ts} +11 -7
- package/dist/_types/{integrations.d-WM81VvEj.d.ts → integrations.d-DL2_rTOs.d.ts} +11 -20
- package/dist/_types/{ops.d-CS92EKY-.d.ts → ops.d-fwLDriUN.d.ts} +3 -3
- package/dist/ai/index.d.ts +14 -48
- package/dist/ai/index.js +6 -6
- package/dist/analytics/index.d.ts +5 -5
- package/dist/analytics/index.js +1 -1
- package/dist/browser/index.d.ts +10 -10
- package/dist/browser/index.js +4 -4
- package/dist/cron/index.d.ts +10 -10
- package/dist/cron/index.js +5 -5
- package/dist/d1/d1-limits.js +1 -1
- package/dist/d1/errors.js +3 -3
- package/dist/d1/https.js +3 -3
- package/dist/d1/index.d.ts +12 -12
- package/dist/d1/index.js +2 -2
- package/dist/d1/lazy.js +4 -4
- package/dist/d1/libsql.js +5 -5
- package/dist/d1/migrate-rules.js +5 -5
- package/dist/d1/native-shape.js +2 -2
- package/dist/d1/retry.js +3 -3
- package/dist/d1/session.js +3 -3
- package/dist/d1/sql.js +2 -2
- package/dist/email/index.d.ts +9 -13
- package/dist/email/index.js +1 -1
- package/dist/errors.js +4 -4
- package/dist/files/index.d.ts +11 -11
- package/dist/files/index.js +4 -4
- package/dist/http.js +12 -11
- package/dist/index.d.ts +6 -7
- package/dist/index.js +1 -1
- package/dist/logs/index.d.ts +6 -6
- package/dist/logs/index.js +1 -1
- package/dist/payments/index.d.ts +7 -7
- package/dist/payments/index.js +2 -2
- package/dist/pdf/index.d.ts +12 -20
- package/dist/pdf/index.js +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/realtime/index.d.ts +5 -5
- package/dist/realtime/index.js +1 -1
- package/dist/scan/index.d.ts +10 -18
- package/dist/scan/index.js +1 -1
- package/dist/seo/index.d.ts +5 -5
- package/dist/seo/index.js +1 -1
- package/dist/speech/index.d.ts +6 -9
- package/dist/speech/index.js +1 -1
- package/dist/vectors/index.d.ts +13 -31
- package/dist/web/index.d.ts +15 -30
- package/dist/web/index.js +1 -1
- package/dist/webhooks/index.d.ts +33 -8
- package/dist/webhooks/index.js +4 -4
- package/package.json +1 -1
- package/totalum-sdk.md +54 -54
- package/totalum-sdk.signatures.json +5 -5
- package/dist/_types/billing.d-Bl2JQGMY.d.ts +0 -42
|
@@ -2708,12 +2708,12 @@ declare const ErrorCode: ZodEnum<{
|
|
|
2708
2708
|
}>;
|
|
2709
2709
|
type ErrorCode = output<typeof ErrorCode>;
|
|
2710
2710
|
/**
|
|
2711
|
-
* Codes thrown only by `totalum-sdk` on the client, never sent by
|
|
2711
|
+
* Codes thrown only by `totalum-sdk` on the client, never sent by the Totalum API. Kept apart from
|
|
2712
2712
|
* `ERROR_CODES` so a server test never expects one; the SDK's `errorCode` type is the union of both lists.
|
|
2713
2713
|
*/
|
|
2714
2714
|
declare const SDK_CLIENT_ERROR_CODES: readonly ["SDK_NOT_CONFIGURED", "NOT_SUPPORTED", "BATCH_FOREIGN_STATEMENT", "TRANSACTIONS_NOT_SUPPORTED", "NETWORK_ERROR", "TIMEOUT", "RESPONSE_PARSE_ERROR", "NODE_ONLY", "WEBHOOK_SECRET_MISSING", "WEBHOOK_SIGNATURE_INVALID", "WEBHOOK_TIMESTAMP_EXPIRED"];
|
|
2715
2715
|
type SdkClientErrorCode = (typeof SDK_CLIENT_ERROR_CODES)[number];
|
|
2716
|
-
/** `errors` of a failed call — `errorCode` is authoritative, the HTTP status is informative
|
|
2716
|
+
/** `errors` of a failed call — `errorCode` is authoritative, the HTTP status is informative. */
|
|
2717
2717
|
declare const ErrorBody: ZodObject<{
|
|
2718
2718
|
errorCode: ZodEnum<{
|
|
2719
2719
|
SERVICE_UNAUTHORIZED: "SERVICE_UNAUTHORIZED";
|
|
@@ -3124,7 +3124,7 @@ declare const ErrorBody: ZodObject<{
|
|
|
3124
3124
|
}, $strip>;
|
|
3125
3125
|
type ErrorBody = output<typeof ErrorBody>;
|
|
3126
3126
|
|
|
3127
|
-
/** The options every namespace takes; each one falls back to the same environment variable everywhere
|
|
3127
|
+
/** The options every namespace takes; each one falls back to the same environment variable everywhere. */
|
|
3128
3128
|
interface TotalumClientOptions {
|
|
3129
3129
|
/** Project key `tlm_pk_…`; default `TOTALUM_PROJECT_KEY`. Server-side only. */
|
|
3130
3130
|
key?: string;
|
|
@@ -3133,11 +3133,15 @@ interface TotalumClientOptions {
|
|
|
3133
3133
|
/** Sent as `x-totalum-env` on every call (the database it targets, and dev vs live usage); default `TOTALUM_ENV`, else `live`. */
|
|
3134
3134
|
env?: 'dev' | 'live';
|
|
3135
3135
|
}
|
|
3136
|
+
/** What a call was charged, in Totalum credits: the only usage Totalum shows (never a vendor, units or a cost). */
|
|
3137
|
+
interface Usage {
|
|
3138
|
+
credits: number;
|
|
3139
|
+
}
|
|
3136
3140
|
|
|
3137
|
-
/** Every code a `TotalumError` can carry:
|
|
3141
|
+
/** Every code a `TotalumError` can carry: the Totalum API's frozen codes plus the client-side ones. */
|
|
3138
3142
|
type TotalumErrorCode = ErrorCode | SdkClientErrorCode;
|
|
3139
3143
|
/**
|
|
3140
|
-
* The one error every `totalum-sdk` call throws
|
|
3144
|
+
* The one error every `totalum-sdk` call throws: the Totalum API envelope's frozen `errorCode`, the HTTP
|
|
3141
3145
|
* status and `details`. `TotalumD1Error` (`totalum-sdk/d1`) and `TotalumWebhookError` (`totalum-sdk/webhooks`)
|
|
3142
3146
|
* extend it, so one `isTotalumError(e)` check covers the whole package.
|
|
3143
3147
|
*/
|
|
@@ -3147,7 +3151,7 @@ declare class TotalumError extends Error {
|
|
|
3147
3151
|
/** HTTP status; 0 for network errors, 500 for client-side refusals. */
|
|
3148
3152
|
readonly status: number;
|
|
3149
3153
|
readonly details: Record<string, unknown> | undefined;
|
|
3150
|
-
/**
|
|
3154
|
+
/** the Totalum API's request id, for support and the logs explorer. */
|
|
3151
3155
|
readonly requestId: string | undefined;
|
|
3152
3156
|
constructor(errorCode: TotalumErrorCode, message: string, status?: number, details?: Record<string, unknown>, requestId?: string);
|
|
3153
3157
|
/** `TotalumError [CODE]: message` — what a log shows for `String(err)` (workerd's tail serialises an Error so). */
|
|
@@ -3158,4 +3162,4 @@ declare class TotalumError extends Error {
|
|
|
3158
3162
|
declare function isTotalumError(e: unknown): e is TotalumError;
|
|
3159
3163
|
|
|
3160
3164
|
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 y };
|
|
3161
|
-
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, $strict as x, $ZodNumberInternals as z };
|
|
3165
|
+
export type { $loose as $, SdkClientErrorCode as S, TotalumClientOptions as T, Usage as U, _ZodNumber as _, TotalumErrorCode as b, ZodInt as l, $strip as m, output as o, $partial as q, $ZodTypeInternals as t, $catchall as v, $strict as x, $ZodNumberInternals as z };
|
|
@@ -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, w as ZodNullable, u as ZodISODateTime, y as ZodEmail, r as ZodLiteral, g as ZodUnknown } from './errors.d-
|
|
2
|
-
import { Z as ZodCoercedNumber } from './coerce.d-
|
|
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, y as ZodEmail, r as ZodLiteral, g as ZodUnknown } from './errors.d-BfXTsxYG.js';
|
|
2
|
+
import { Z as ZodCoercedNumber } from './coerce.d-DiNiCkat.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<{
|
|
@@ -8,7 +8,7 @@ declare const JobCreated: ZodObject<{
|
|
|
8
8
|
}, $strip>;
|
|
9
9
|
type JobCreated = output<typeof JobCreated>;
|
|
10
10
|
/**
|
|
11
|
-
* The file descriptor every file route answers (
|
|
11
|
+
* The file descriptor every file route answers (the `{fileName, fileSize, fileUrl}` convention
|
|
12
12
|
* keeps). `fileUrl` is the public `https://files.<zone>/<key>` URL, `null` when private (read it through a signed URL).
|
|
13
13
|
* `name`/`url`/`size`/`id`/`fileNameId` are the compat keys of the upload response (`fileNameId` = `key`).
|
|
14
14
|
*/
|
|
@@ -141,9 +141,6 @@ declare const WebScrapeOutput: ZodObject<{
|
|
|
141
141
|
contentUrl: ZodOptional<ZodURL>;
|
|
142
142
|
usage: ZodObject<{
|
|
143
143
|
credits: ZodNumber;
|
|
144
|
-
vendor: ZodOptional<ZodString>;
|
|
145
|
-
units: ZodOptional<ZodNumber>;
|
|
146
|
-
vendorCostUsd: ZodOptional<ZodNumber>;
|
|
147
144
|
}, $strip>;
|
|
148
145
|
}, $strip>;
|
|
149
146
|
type WebScrapeOutput = output<typeof WebScrapeOutput>;
|
|
@@ -184,7 +181,7 @@ declare const WebCrawlInput: ZodObject<{
|
|
|
184
181
|
webhook: ZodOptional<ZodBoolean>;
|
|
185
182
|
}, $strip>;
|
|
186
183
|
type WebCrawlInput = output<typeof WebCrawlInput>;
|
|
187
|
-
/** `GET /v1/web/jobs/:jobId`: progress, the
|
|
184
|
+
/** `GET /v1/web/jobs/:jobId`: progress, the credits used, pages paged by `next`. */
|
|
188
185
|
declare const WebJob: ZodObject<{
|
|
189
186
|
jobId: ZodString;
|
|
190
187
|
status: ZodEnum<{
|
|
@@ -227,7 +224,7 @@ declare const WebMapInput: ZodObject<{
|
|
|
227
224
|
limit: ZodOptional<ZodInt>;
|
|
228
225
|
}, $strip>;
|
|
229
226
|
type WebMapInput = output<typeof WebMapInput>;
|
|
230
|
-
/** `POST /v1/web/search
|
|
227
|
+
/** `POST /v1/web/search`; `scrapeOptions` scrapes the results inline. */
|
|
231
228
|
declare const WebSearchInput: ZodObject<{
|
|
232
229
|
query: ZodString;
|
|
233
230
|
limit: ZodOptional<ZodInt>;
|
|
@@ -459,9 +456,6 @@ declare const TranscribeOutput: ZodObject<{
|
|
|
459
456
|
}, $strip>>>;
|
|
460
457
|
usage: ZodObject<{
|
|
461
458
|
credits: ZodNumber;
|
|
462
|
-
vendor: ZodOptional<ZodString>;
|
|
463
|
-
units: ZodOptional<ZodNumber>;
|
|
464
|
-
vendorCostUsd: ZodOptional<ZodNumber>;
|
|
465
459
|
}, $strip>;
|
|
466
460
|
}, $strip>;
|
|
467
461
|
type TranscribeOutput = output<typeof TranscribeOutput>;
|
|
@@ -489,9 +483,6 @@ declare const StoredMedia: ZodObject<{
|
|
|
489
483
|
url: ZodURL;
|
|
490
484
|
usage: ZodObject<{
|
|
491
485
|
credits: ZodNumber;
|
|
492
|
-
vendor: ZodOptional<ZodString>;
|
|
493
|
-
units: ZodOptional<ZodNumber>;
|
|
494
|
-
vendorCostUsd: ZodOptional<ZodNumber>;
|
|
495
486
|
}, $strip>;
|
|
496
487
|
}, $strip>;
|
|
497
488
|
type StoredMedia = output<typeof StoredMedia>;
|
|
@@ -561,7 +552,7 @@ declare const EmailView: ZodObject<{
|
|
|
561
552
|
}, $strip>>;
|
|
562
553
|
}, $strip>;
|
|
563
554
|
type EmailView = output<typeof EmailView>;
|
|
564
|
-
/** `POST /v1/cron/jobs`; header values may reference `{{secret:NAME}}` (resolved by
|
|
555
|
+
/** `POST /v1/cron/jobs`; header values may reference `{{secret:NAME}}` (resolved by Totalum at fire time). */
|
|
565
556
|
declare const CronJobInput: ZodObject<{
|
|
566
557
|
name: ZodString;
|
|
567
558
|
schedule: ZodUnion<readonly [ZodString, ZodObject<{
|
|
@@ -754,8 +745,8 @@ declare const OnboardingLinkOutput: ZodObject<{
|
|
|
754
745
|
type OnboardingLinkOutput = output<typeof OnboardingLinkOutput>;
|
|
755
746
|
/**
|
|
756
747
|
* `POST /v1/payments/checkout` — the direct charge: a hosted Checkout Session on the connected account
|
|
757
|
-
* (`Stripe-Account`),
|
|
758
|
-
* `mode: 'setup'` saves a card for a later charge
|
|
748
|
+
* (`Stripe-Account`), the Totalum API injects the application fee; any `card[...]` field → `400 CARD_DATA_NOT_ACCEPTED`.
|
|
749
|
+
* `mode: 'setup'` saves a card for a later charge: no `lineItems`, and `currency` is required — Stripe
|
|
759
750
|
* asks for one in setup mode. `mode: 'subscription'` takes a recurring price: a `priceId` the owner made in Stripe, or an
|
|
760
751
|
* inline item with `recurring`; `metadata` is copied onto the subscription, so its webhooks carry it too.
|
|
761
752
|
*/
|
|
@@ -801,7 +792,7 @@ declare const CheckoutOutput: ZodObject<{
|
|
|
801
792
|
}, $strip>;
|
|
802
793
|
type CheckoutOutput = output<typeof CheckoutOutput>;
|
|
803
794
|
/**
|
|
804
|
-
* `GET /v1/payments/checkout/:id
|
|
795
|
+
* `GET /v1/payments/checkout/:id`: the Checkout Session read back from the project's own connected
|
|
805
796
|
* account, so the page Stripe returns the buyer to (`successUrl` with `{CHECKOUT_SESSION_ID}`) can confirm the payment
|
|
806
797
|
* itself — no webhook to set up. A session of another account is Stripe's 404.
|
|
807
798
|
*/
|
|
@@ -828,7 +819,7 @@ declare const CheckoutSession: ZodObject<{
|
|
|
828
819
|
}, $strip>;
|
|
829
820
|
type CheckoutSession = output<typeof CheckoutSession>;
|
|
830
821
|
/**
|
|
831
|
-
* `GET|PATCH|DELETE /v1/payments/subscriptions/:id` (
|
|
822
|
+
* `GET|PATCH|DELETE /v1/payments/subscriptions/:id` (G1): a subscription on the project's own connected
|
|
832
823
|
* account (another account's id is Stripe's 404). Access is `status` `active` or `trialing`; `currentPeriodEnd` = the
|
|
833
824
|
* next renewal (or the end of access when `cancelAtPeriodEnd`). `DELETE` cancels at once (`status: 'canceled'`).
|
|
834
825
|
*/
|
|
@@ -856,7 +847,7 @@ declare const SubscriptionUpdateInput: ZodObject<{
|
|
|
856
847
|
cancelAtPeriodEnd: ZodBoolean;
|
|
857
848
|
}, $strip>;
|
|
858
849
|
type SubscriptionUpdateInput = output<typeof SubscriptionUpdateInput>;
|
|
859
|
-
/** `POST /v1/payments/customer-portal-link`: Stripe's hosted customer portal on the connected account
|
|
850
|
+
/** `POST /v1/payments/customer-portal-link`: Stripe's hosted customer portal on the connected account. */
|
|
860
851
|
declare const CustomerPortalLinkInput: ZodObject<{
|
|
861
852
|
customerId: ZodString;
|
|
862
853
|
returnUrl: ZodURL;
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { Z as ZodCoercedNumber } from './coerce.d-
|
|
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-BfXTsxYG.js';
|
|
2
|
+
import { Z as ZodCoercedNumber } from './coerce.d-DiNiCkat.js';
|
|
3
3
|
|
|
4
4
|
declare const SiteMetric: ZodEnum<{
|
|
5
5
|
bytes: "bytes";
|
|
@@ -47,7 +47,7 @@ declare const SiteAnalyticsOutput: ZodObject<{
|
|
|
47
47
|
cachedAt: ZodISODateTime;
|
|
48
48
|
}, $strip>;
|
|
49
49
|
type SiteAnalyticsOutput = output<typeof SiteAnalyticsOutput>;
|
|
50
|
-
/** `POST /projects/:id/logs/query` (
|
|
50
|
+
/** `POST /projects/:id/logs/query` (Totalum) = `GET /v1/logs` query (the Totalum API). `env`: dev = preview, live = published. */
|
|
51
51
|
declare const LogsQueryInput: ZodObject<{
|
|
52
52
|
requestId: ZodOptional<ZodString>;
|
|
53
53
|
limit: ZodOptional<ZodCoercedNumber<unknown>>;
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
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 $partial, r as ZodLiteral, T as TotalumClientOptions } from '../_types/errors.d-
|
|
3
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
4
|
-
import { I as IntegrationUsage } from '../_types/billing.d-Bl2JQGMY.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, U as Usage } from '../_types/errors.d-BfXTsxYG.js';
|
|
3
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BfXTsxYG.js';
|
|
5
4
|
import { SpeakInput, StoredMedia, TranscribeInput } from '../index.js';
|
|
6
|
-
import '../_types/coerce.d-
|
|
5
|
+
import '../_types/coerce.d-DiNiCkat.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
|
-
* Named model presets
|
|
10
|
-
*
|
|
11
|
-
* field takes a preset or a pinned OpenRouter slug; a `:free` slug is never sent (20 req/min, shared by every tenant).
|
|
8
|
+
* Named model presets: the Totalum API resolves each to an model id refreshed from the model catalogue to the newest non-deprecated model of the preset's family. A `model`
|
|
9
|
+
* field takes a preset or a pinned model id; a `:free` slug is never sent (20 req/min, shared by every tenant).
|
|
12
10
|
*/
|
|
13
11
|
declare const AI_PRESETS: readonly ["fast", "smart", "reasoning", "vision", "image", "image-edit", "video", "tts", "stt", "embed", "embed-image"];
|
|
14
12
|
type AiPresetName = (typeof AI_PRESETS)[number];
|
|
@@ -60,9 +58,6 @@ declare const AiEmbedOutput: ZodObject<{
|
|
|
60
58
|
embeddings: ZodArray<ZodArray<ZodNumber>>;
|
|
61
59
|
usage: ZodObject<{
|
|
62
60
|
credits: ZodNumber;
|
|
63
|
-
vendor: ZodOptional<ZodString>;
|
|
64
|
-
units: ZodOptional<ZodNumber>;
|
|
65
|
-
vendorCostUsd: ZodOptional<ZodNumber>;
|
|
66
61
|
}, $strip>;
|
|
67
62
|
}, $strip>;
|
|
68
63
|
type AiEmbedOutput = output<typeof AiEmbedOutput>;
|
|
@@ -118,15 +113,12 @@ declare const AiImageOutput: ZodObject<{
|
|
|
118
113
|
}, $strip>>;
|
|
119
114
|
usage: ZodObject<{
|
|
120
115
|
credits: ZodNumber;
|
|
121
|
-
vendor: ZodOptional<ZodString>;
|
|
122
|
-
units: ZodOptional<ZodNumber>;
|
|
123
|
-
vendorCostUsd: ZodOptional<ZodNumber>;
|
|
124
116
|
}, $strip>;
|
|
125
117
|
fileName: ZodOptional<ZodString>;
|
|
126
118
|
imageUrl: ZodOptional<ZodURL>;
|
|
127
119
|
}, $strip>;
|
|
128
120
|
type AiImageOutput = output<typeof AiImageOutput>;
|
|
129
|
-
/** `POST /v1/ai/video` (integration `ai_video`, every plan incl. Free —
|
|
121
|
+
/** `POST /v1/ai/video` (integration `ai_video`, every plan incl. Free — ): `202 AiVideoCreated`. */
|
|
130
122
|
declare const AiVideoInput: ZodObject<{
|
|
131
123
|
prompt: ZodString;
|
|
132
124
|
model: ZodOptional<ZodString>;
|
|
@@ -164,9 +156,6 @@ declare const AiVideoJob: ZodObject<{
|
|
|
164
156
|
}, $strip>>;
|
|
165
157
|
usage: ZodOptional<ZodObject<{
|
|
166
158
|
credits: ZodNumber;
|
|
167
|
-
vendor: ZodOptional<ZodString>;
|
|
168
|
-
units: ZodOptional<ZodNumber>;
|
|
169
|
-
vendorCostUsd: ZodOptional<ZodNumber>;
|
|
170
159
|
}, $strip>>;
|
|
171
160
|
error: ZodOptional<ZodObject<{
|
|
172
161
|
code: ZodString;
|
|
@@ -185,9 +174,6 @@ declare const AiTextOutput: ZodObject<{
|
|
|
185
174
|
text: ZodString;
|
|
186
175
|
usage: ZodObject<{
|
|
187
176
|
credits: ZodNumber;
|
|
188
|
-
vendor: ZodOptional<ZodString>;
|
|
189
|
-
units: ZodOptional<ZodNumber>;
|
|
190
|
-
vendorCostUsd: ZodOptional<ZodNumber>;
|
|
191
177
|
}, $strip>;
|
|
192
178
|
}, $strip>;
|
|
193
179
|
type AiTextOutput = output<typeof AiTextOutput>;
|
|
@@ -218,18 +204,16 @@ declare const AiModelsOutput: ZodObject<{
|
|
|
218
204
|
type AiModelsOutput = output<typeof AiModelsOutput>;
|
|
219
205
|
|
|
220
206
|
interface TotalumAiOptions extends TotalumClientOptions {
|
|
221
|
-
/** The
|
|
207
|
+
/** The OpenAI-compatible AI gateway `gatewayConfig()` returns; default `TOTALUM_AI_BASE_URL`, else `https://ai.totalum.app/api/v1`. */
|
|
222
208
|
aiBaseUrl?: string;
|
|
223
209
|
}
|
|
224
|
-
/** What a call was charged, in Totalum credits — the only usage Totalum shows (no tokens
|
|
210
|
+
/** What a call was charged, in Totalum credits — the only usage Totalum shows (no tokens). */
|
|
225
211
|
interface ChatUsage {
|
|
226
212
|
credits: number;
|
|
227
213
|
/** @deprecated Since 1.1.0: always 0 — Totalum shows only `credits`. */
|
|
228
214
|
inputTokens: number;
|
|
229
215
|
/** @deprecated Since 1.1.0: always 0 — Totalum shows only `credits`. */
|
|
230
216
|
outputTokens: number;
|
|
231
|
-
/** @deprecated Since 1.1.0: always 0 — Totalum shows only `credits`. */
|
|
232
|
-
costUsd: number;
|
|
233
217
|
}
|
|
234
218
|
interface ToolCall {
|
|
235
219
|
id: string;
|
|
@@ -239,7 +223,7 @@ interface ToolCall {
|
|
|
239
223
|
arguments: string;
|
|
240
224
|
};
|
|
241
225
|
}
|
|
242
|
-
/** `ai.chat()
|
|
226
|
+
/** `ai.chat()`: the first choice read out, the raw completion kept. */
|
|
243
227
|
interface ChatResult {
|
|
244
228
|
id: string;
|
|
245
229
|
model: string;
|
|
@@ -256,10 +240,10 @@ interface ChatStream {
|
|
|
256
240
|
result(): Promise<ChatResult>;
|
|
257
241
|
}
|
|
258
242
|
/**
|
|
259
|
-
* `totalum.ai`
|
|
243
|
+
* `totalum.ai` over the Totalum API `/v1/ai/*` (scope `ai`): a `model` is a preset (`fast`,
|
|
260
244
|
* `smart`, `reasoning`, `vision`, `image`, `image-edit`, `video`, `tts`, `stt`, `embed` — each follows the newest model
|
|
261
|
-
* of its family, resolved by Totalum) or a pinned
|
|
262
|
-
* charged (`usage.credits`, never tokens
|
|
245
|
+
* of its family, resolved by Totalum) or a pinned model id; every call returned with the Totalum credits it was
|
|
246
|
+
* charged (`usage.credits`, never tokens). No `ai.agent()` — the
|
|
263
247
|
* agent loop is the template's `src/agents/` on the Vercel AI SDK, pointed at `gatewayConfig()`.
|
|
264
248
|
*/
|
|
265
249
|
declare function totalumAi(options?: TotalumAiOptions): {
|
|
@@ -278,7 +262,7 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
278
262
|
healing?: boolean;
|
|
279
263
|
}) => Promise<{
|
|
280
264
|
object: unknown;
|
|
281
|
-
usage:
|
|
265
|
+
usage: Usage;
|
|
282
266
|
}>;
|
|
283
267
|
/** Sugar over `generateObject`: one of `options`, chosen by the model. */
|
|
284
268
|
classify(req: {
|
|
@@ -294,9 +278,6 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
294
278
|
embeddings: number[][];
|
|
295
279
|
usage: {
|
|
296
280
|
credits: number;
|
|
297
|
-
vendor?: string | undefined;
|
|
298
|
-
units?: number | undefined;
|
|
299
|
-
vendorCostUsd?: number | undefined;
|
|
300
281
|
};
|
|
301
282
|
}>;
|
|
302
283
|
image: {
|
|
@@ -311,9 +292,6 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
311
292
|
}[];
|
|
312
293
|
usage: {
|
|
313
294
|
credits: number;
|
|
314
|
-
vendor?: string | undefined;
|
|
315
|
-
units?: number | undefined;
|
|
316
|
-
vendorCostUsd?: number | undefined;
|
|
317
295
|
};
|
|
318
296
|
fileName?: string | undefined;
|
|
319
297
|
imageUrl?: string | undefined;
|
|
@@ -329,9 +307,6 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
329
307
|
}[];
|
|
330
308
|
usage: {
|
|
331
309
|
credits: number;
|
|
332
|
-
vendor?: string | undefined;
|
|
333
|
-
units?: number | undefined;
|
|
334
|
-
vendorCostUsd?: number | undefined;
|
|
335
310
|
};
|
|
336
311
|
fileName?: string | undefined;
|
|
337
312
|
imageUrl?: string | undefined;
|
|
@@ -355,9 +330,6 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
355
330
|
} | undefined;
|
|
356
331
|
usage?: {
|
|
357
332
|
credits: number;
|
|
358
|
-
vendor?: string | undefined;
|
|
359
|
-
units?: number | undefined;
|
|
360
|
-
vendorCostUsd?: number | undefined;
|
|
361
333
|
} | undefined;
|
|
362
334
|
error?: {
|
|
363
335
|
code: string;
|
|
@@ -380,9 +352,6 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
380
352
|
text: string;
|
|
381
353
|
usage: {
|
|
382
354
|
credits: number;
|
|
383
|
-
vendor?: string | undefined;
|
|
384
|
-
units?: number | undefined;
|
|
385
|
-
vendorCostUsd?: number | undefined;
|
|
386
355
|
};
|
|
387
356
|
}>;
|
|
388
357
|
};
|
|
@@ -401,9 +370,6 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
401
370
|
durationSec: number;
|
|
402
371
|
usage: {
|
|
403
372
|
credits: number;
|
|
404
|
-
vendor?: string | undefined;
|
|
405
|
-
units?: number | undefined;
|
|
406
|
-
vendorCostUsd?: number | undefined;
|
|
407
373
|
};
|
|
408
374
|
language?: string | undefined;
|
|
409
375
|
segments?: {
|
|
@@ -432,7 +398,7 @@ declare function totalumAi(options?: TotalumAiOptions): {
|
|
|
432
398
|
denylist?: string[] | undefined;
|
|
433
399
|
}>;
|
|
434
400
|
};
|
|
435
|
-
/** The
|
|
401
|
+
/** The OpenAI-compatible API for any OpenAI-compatible client: `new OpenAI(ai.gatewayConfig())`. Server-side only. */
|
|
436
402
|
gatewayConfig: () => {
|
|
437
403
|
baseURL: string;
|
|
438
404
|
apiKey: string;
|
package/dist/ai/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const resultOf = (c) => ({
|
|
|
11
11
|
text: c.choices?.[0]?.message?.content ?? '',
|
|
12
12
|
toolCalls: c.choices?.[0]?.message?.tool_calls ?? [],
|
|
13
13
|
finishReason: c.choices?.[0]?.finish_reason ?? null,
|
|
14
|
-
usage: { credits: c.usage?.credits ?? 0, inputTokens: 0, outputTokens: 0
|
|
14
|
+
usage: { credits: c.usage?.credits ?? 0, inputTokens: 0, outputTokens: 0 },
|
|
15
15
|
raw: c,
|
|
16
16
|
});
|
|
17
17
|
/** SSE `data:` payloads of a stream, in order (`[DONE]` ends it). */
|
|
@@ -83,10 +83,10 @@ function chatStream(body) {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
* `totalum.ai`
|
|
86
|
+
* `totalum.ai` over the Totalum API `/v1/ai/*` (scope `ai`): a `model` is a preset (`fast`,
|
|
87
87
|
* `smart`, `reasoning`, `vision`, `image`, `image-edit`, `video`, `tts`, `stt`, `embed` — each follows the newest model
|
|
88
|
-
* of its family, resolved by Totalum) or a pinned
|
|
89
|
-
* charged (`usage.credits`, never tokens
|
|
88
|
+
* of its family, resolved by Totalum) or a pinned model id; every call returned with the Totalum credits it was
|
|
89
|
+
* charged (`usage.credits`, never tokens). No `ai.agent()` — the
|
|
90
90
|
* agent loop is the template's `src/agents/` on the Vercel AI SDK, pointed at `gatewayConfig()`.
|
|
91
91
|
*/
|
|
92
92
|
export function totalumAi(options = {}) {
|
|
@@ -94,7 +94,7 @@ export function totalumAi(options = {}) {
|
|
|
94
94
|
const raw = rawClient(options);
|
|
95
95
|
const speech = totalumSpeech(options);
|
|
96
96
|
/**
|
|
97
|
-
* A chat completion; `model` is a preset (`fast`, `smart` — the default — or `reasoning`) or a pinned
|
|
97
|
+
* A chat completion; `model` is a preset (`fast`, `smart` — the default — or `reasoning`) or a pinned model id.
|
|
98
98
|
*
|
|
99
99
|
* @example
|
|
100
100
|
* const { text } = await ai.chat({ model: 'fast', messages: [{ role: 'user', content: 'Hi' }] });
|
|
@@ -176,7 +176,7 @@ export function totalumAi(options = {}) {
|
|
|
176
176
|
/** Each preset's current model and the models a project may call, with their prices. */
|
|
177
177
|
list: () => call('GET', '/v1/ai/models'),
|
|
178
178
|
},
|
|
179
|
-
/** The
|
|
179
|
+
/** The OpenAI-compatible API for any OpenAI-compatible client: `new OpenAI(ai.gatewayConfig())`. Server-side only. */
|
|
180
180
|
gatewayConfig: () => ({
|
|
181
181
|
baseURL: options.aiBaseUrl ?? readEnv('TOTALUM_AI_BASE_URL') ?? 'https://ai.totalum.app/api/v1',
|
|
182
182
|
apiKey: projectKey(options),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as SiteMetric, a as SiteDimension, S as SiteAnalyticsOutput } from '../_types/ops.d-
|
|
2
|
-
import { T as TotalumClientOptions } from '../_types/errors.d-
|
|
3
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
4
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { b as SiteMetric, a as SiteDimension, S as SiteAnalyticsOutput } from '../_types/ops.d-fwLDriUN.js';
|
|
2
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BfXTsxYG.js';
|
|
3
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BfXTsxYG.js';
|
|
4
|
+
import '../_types/coerce.d-DiNiCkat.js';
|
|
5
5
|
|
|
6
6
|
interface SiteAnalyticsQuery {
|
|
7
7
|
/** ISO; default the last 7 days. */
|
|
@@ -19,7 +19,7 @@ interface SiteAnalyticsQuery {
|
|
|
19
19
|
/** `dev` = the preview host, `live` = the published and custom hosts; omitted = both. */
|
|
20
20
|
env?: 'dev' | 'live';
|
|
21
21
|
}
|
|
22
|
-
/** `totalum.analytics`
|
|
22
|
+
/** `totalum.analytics` over the Totalum API `/v1/analytics/site` (scope `analytics:read`): the site's own traffic. Free. */
|
|
23
23
|
declare function totalumAnalytics(options?: TotalumClientOptions): {
|
|
24
24
|
/**
|
|
25
25
|
* Page views, visits, uniques, errors, bytes or TTFB as a series or a top-N.
|
package/dist/analytics/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsonClient, query } from '../http.js';
|
|
2
2
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
3
|
-
/** `totalum.analytics`
|
|
3
|
+
/** `totalum.analytics` over the Totalum API `/v1/analytics/site` (scope `analytics:read`): the site's own traffic. Free. */
|
|
4
4
|
export function totalumAnalytics(options = {}) {
|
|
5
5
|
const call = jsonClient(options);
|
|
6
6
|
return {
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -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, 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-
|
|
2
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
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-BfXTsxYG.js';
|
|
2
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BfXTsxYG.js';
|
|
3
3
|
|
|
4
4
|
declare const BrowserCommandName: ZodEnum<{
|
|
5
5
|
type: "type";
|
|
@@ -72,7 +72,7 @@ declare const BrowserCommandName: ZodEnum<{
|
|
|
72
72
|
}>;
|
|
73
73
|
type BrowserCommandName = output<typeof BrowserCommandName>;
|
|
74
74
|
/**
|
|
75
|
-
* One command: `{ type
|
|
75
|
+
* One command: `{ type,...params }`, the parameters of –§3.4.10 / per command. Every
|
|
76
76
|
* interaction command takes optional `frame`, `tabId` and `timeoutMs`. A `type` outside the list is
|
|
77
77
|
* `400 UNKNOWN_COMMAND`.
|
|
78
78
|
*/
|
|
@@ -152,7 +152,7 @@ declare const BrowserCommand: ZodObject<{
|
|
|
152
152
|
}, $loose>;
|
|
153
153
|
type BrowserCommand = output<typeof BrowserCommand>;
|
|
154
154
|
/**
|
|
155
|
-
* `POST /v1/browser/sessions
|
|
155
|
+
* `POST /v1/browser/sessions`. The first block is passed to the vendor; `locale`, `timezone`,
|
|
156
156
|
* `geolocation`, `userAgent`, `extraHeaders`, `blockResources`, `device`, `captureDownloads` and `viewport` are
|
|
157
157
|
* synthesised by the `BrowserSession` DO over CDP (the vendor validates none of them). `stealth:'verified'` below the
|
|
158
158
|
* vendor's Scale tier is `409 STEALTH_TIER_UNAVAILABLE`; `viewport` is ignored under it.
|
|
@@ -240,7 +240,7 @@ declare const BrowserSessionInput: ZodObject<{
|
|
|
240
240
|
}, $strip>>;
|
|
241
241
|
}, $strip>;
|
|
242
242
|
type BrowserSessionInput = output<typeof BrowserSessionInput>;
|
|
243
|
-
/** `201` of the create: `liveViewUrl` is
|
|
243
|
+
/** `201` of the create: `liveViewUrl` is the Totalum API-proxied and signed (the vendor URL embeds Totalum's key). */
|
|
244
244
|
declare const BrowserSessionCreated: ZodObject<{
|
|
245
245
|
id: ZodString;
|
|
246
246
|
status: ZodLiteral<"running">;
|
|
@@ -1597,7 +1597,7 @@ type Group<K extends string> = K extends `${infer G}.${infer M}` ? {
|
|
|
1597
1597
|
[P in G]: Record<M, Command>;
|
|
1598
1598
|
} : Record<K, Command>;
|
|
1599
1599
|
type Merge<U> = (U extends unknown ? (u: U) => void : never) extends (u: infer I) => void ? I : never;
|
|
1600
|
-
/** One method per command of
|
|
1600
|
+
/** One method per command of (`goto`, `click`, … `tabs.new`, `network.har`, …), named like the command. */
|
|
1601
1601
|
type BrowserCommands = Merge<Group<BrowserCommandName>>;
|
|
1602
1602
|
type BrowserSession = BrowserCommands & {
|
|
1603
1603
|
readonly id: string;
|
|
@@ -1607,20 +1607,20 @@ type BrowserSession = BrowserCommands & {
|
|
|
1607
1607
|
actions(batch: BrowserCommand[], opts?: {
|
|
1608
1608
|
stopOnError?: boolean;
|
|
1609
1609
|
}): Promise<BrowserCommandResult[]>;
|
|
1610
|
-
/** A declarative program
|
|
1610
|
+
/** A declarative program: the commands plus bounded `repeat`, `if`, `try`, `set` — data, never code. */
|
|
1611
1611
|
program(program: BrowserProgram): Promise<BrowserProgramCreated>;
|
|
1612
1612
|
status(): Promise<BrowserSessionStatus>;
|
|
1613
1613
|
close(): Promise<BrowserSessionClosed>;
|
|
1614
1614
|
};
|
|
1615
1615
|
/**
|
|
1616
|
-
* `totalum.browser`
|
|
1617
|
-
* over HTTPS, so every command works from a Worker
|
|
1616
|
+
* `totalum.browser` over the Totalum API `/v1/browser/*` (scope `browser`): remote browser sessions driven entirely
|
|
1617
|
+
* over HTTPS, so every command works from a Worker. A command's refusal throws `TotalumError` with its frozen
|
|
1618
1618
|
* code (`ACTION_TIMEOUT`, `ACTION_FAILED`, …); `actions()` returns every result instead.
|
|
1619
1619
|
*
|
|
1620
1620
|
* #### Things that still need a CDP connection
|
|
1621
1621
|
*
|
|
1622
1622
|
* Nothing an app needs. Every capability is a command or a create-time option, so it works in a published app. The
|
|
1623
|
-
* list keeps exactly two entries, neither of which an app needs
|
|
1623
|
+
* list keeps exactly two entries, neither of which an app needs:
|
|
1624
1624
|
*
|
|
1625
1625
|
* - Attaching a raw CDP domain listener for a continuous event stream — `network.subscribe` is the push channel for the app case.
|
|
1626
1626
|
* - Driving the session with a third-party Node library's own protocol client (`connectOverCDP`, `puppeteer.connect`).
|
package/dist/browser/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TotalumError } from '../errors.js';
|
|
2
2
|
import { jsonClient, query } from '../http.js';
|
|
3
3
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
4
|
-
/** The frozen 67 (contracts `BROWSER_COMMANDS
|
|
4
|
+
/** The frozen 67 (contracts `BROWSER_COMMANDS`) as a literal, so nothing is imported at runtime. */
|
|
5
5
|
const BROWSER_COMMANDS = [
|
|
6
6
|
...[
|
|
7
7
|
'goto',
|
|
@@ -98,14 +98,14 @@ const POSITIONAL = {
|
|
|
98
98
|
observe: ['instruction'],
|
|
99
99
|
};
|
|
100
100
|
/**
|
|
101
|
-
* `totalum.browser`
|
|
102
|
-
* over HTTPS, so every command works from a Worker
|
|
101
|
+
* `totalum.browser` over the Totalum API `/v1/browser/*` (scope `browser`): remote browser sessions driven entirely
|
|
102
|
+
* over HTTPS, so every command works from a Worker. A command's refusal throws `TotalumError` with its frozen
|
|
103
103
|
* code (`ACTION_TIMEOUT`, `ACTION_FAILED`, …); `actions()` returns every result instead.
|
|
104
104
|
*
|
|
105
105
|
* #### Things that still need a CDP connection
|
|
106
106
|
*
|
|
107
107
|
* Nothing an app needs. Every capability is a command or a create-time option, so it works in a published app. The
|
|
108
|
-
* list keeps exactly two entries, neither of which an app needs
|
|
108
|
+
* list keeps exactly two entries, neither of which an app needs:
|
|
109
109
|
*
|
|
110
110
|
* - Attaching a raw CDP domain listener for a continuous event stream — `network.subscribe` is the push channel for the app case.
|
|
111
111
|
* - Driving the session with a third-party Node library's own protocol client (`connectOverCDP`, `puppeteer.connect`).
|
package/dist/cron/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { d as CronJobInput, c as CronJob, e as CronJobPatch } from '../_types/integrations.d-
|
|
2
|
-
export { f as CronRun, g as CronRunsPage } from '../_types/integrations.d-
|
|
3
|
-
import { T as TotalumClientOptions } from '../_types/errors.d-
|
|
4
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
5
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { d as CronJobInput, c as CronJob, e as CronJobPatch } from '../_types/integrations.d-DL2_rTOs.js';
|
|
2
|
+
export { f as CronRun, g as CronRunsPage } from '../_types/integrations.d-DL2_rTOs.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BfXTsxYG.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BfXTsxYG.js';
|
|
5
|
+
import '../_types/coerce.d-DiNiCkat.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* `totalum.cron`
|
|
8
|
+
* `totalum.cron` over the Totalum API `/v1/cron/*` (scope `cron`): HTTP jobs against the project's own host,
|
|
9
9
|
* fired by Totalum's Scheduler; limits per plan (`429 CRON_LIMIT_REACHED {limit, plan}`, `400 INVALID_SCHEDULE
|
|
10
10
|
* {minIntervalSeconds}`). Executions cost nothing. `timezone` (IANA) reads the schedule on that zone's clock, daylight
|
|
11
11
|
* saving included; `pauseAfterFailures` (1–100, default 3; `null` = never) sets how many failed runs in a row pause it.
|
|
@@ -16,10 +16,10 @@ declare function totalumCron(options?: TotalumClientOptions): {
|
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* await cron.create({
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* name: 'daily-report',
|
|
20
|
+
* schedule: '0 8 * * *', // 08:00 in Madrid all year
|
|
21
|
+
* timezone: 'Europe/Madrid',
|
|
22
|
+
* request: { method: 'POST', url: 'https://my-app.totalum-project.com/api/cron/report' },
|
|
23
23
|
* });
|
|
24
24
|
*/
|
|
25
25
|
create: (input: CronJobInput) => Promise<{
|
package/dist/cron/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isTotalumError } from '../errors.js';
|
|
|
2
2
|
import { jsonClient, query } from '../http.js';
|
|
3
3
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
4
4
|
/**
|
|
5
|
-
* `totalum.cron`
|
|
5
|
+
* `totalum.cron` over the Totalum API `/v1/cron/*` (scope `cron`): HTTP jobs against the project's own host,
|
|
6
6
|
* fired by Totalum's Scheduler; limits per plan (`429 CRON_LIMIT_REACHED {limit, plan}`, `400 INVALID_SCHEDULE
|
|
7
7
|
* {minIntervalSeconds}`). Executions cost nothing. `timezone` (IANA) reads the schedule on that zone's clock, daylight
|
|
8
8
|
* saving included; `pauseAfterFailures` (1–100, default 3; `null` = never) sets how many failed runs in a row pause it.
|
|
@@ -17,10 +17,10 @@ export function totalumCron(options = {}) {
|
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* await cron.create({
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
20
|
+
* name: 'daily-report',
|
|
21
|
+
* schedule: '0 8 * * *', // 08:00 in Madrid all year
|
|
22
|
+
* timezone: 'Europe/Madrid',
|
|
23
|
+
* request: { method: 'POST', url: 'https://my-app.totalum-project.com/api/cron/report' },
|
|
24
24
|
* });
|
|
25
25
|
*/
|
|
26
26
|
create: (input) => call('POST', '/v1/cron/jobs', input),
|
package/dist/d1/d1-limits.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d1Error } from './native-shape.js';
|
|
2
2
|
/**
|
|
3
3
|
* D1's per-statement limits, for the engine that has none of them (Turso, reached by libsql from a Worker): a statement
|
|
4
|
-
* D1 refuses is refused here before it runs, with D1's own words (
|
|
4
|
+
* D1 refuses is refused here before it runs, with D1's own words (measured on production D1 and
|
|
5
5
|
* Miniflare). So an app built and tried against D1 — `npm run dev` is always a local D1 — behaves the same once its
|
|
6
6
|
* project moved to Turso. A pattern built at run time (`LIKE '%' || ? || '%'`) cannot be measured before it runs and is
|
|
7
7
|
* not checked.
|