totalum-sdk 1.10.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-3Xj4xYuy.d.ts → coerce.d-DiNiCkat.d.ts} +1 -1
- package/dist/_types/{errors.d-BBRayxHv.d.ts → errors.d-BfXTsxYG.d.ts} +6 -6
- package/dist/_types/{integrations.d-Hj3BqI02.d.ts → integrations.d-DL2_rTOs.d.ts} +11 -11
- package/dist/_types/{ops.d-D_3lqkJ2.d.ts → ops.d-fwLDriUN.d.ts} +3 -3
- package/dist/ai/index.d.ts +11 -12
- package/dist/ai/index.js +3 -3
- 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 +6 -6
- 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 +7 -7
- package/dist/index.d.ts +5 -5
- 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 +6 -6
- 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 +6 -6
- 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 -6
- package/dist/speech/index.js +1 -1
- package/dist/vectors/index.d.ts +4 -4
- package/dist/web/index.d.ts +6 -6
- package/dist/web/index.js +1 -1
- package/dist/webhooks/index.d.ts +5 -5
- package/dist/webhooks/index.js +4 -4
- package/package.json +1 -1
- package/totalum-sdk.md +23 -23
- package/totalum-sdk.signatures.json +1 -1
package/dist/d1/lazy.js
CHANGED
|
@@ -14,7 +14,7 @@ const READ = /^\s*(select|with)\b/i;
|
|
|
14
14
|
const uniqueColumns = (sql) => READ.test(sql) ? `SELECT * FROM (\n${sql.replace(/[\s;]+$/, '')}\n)` : sql;
|
|
15
15
|
/**
|
|
16
16
|
* The object `totalumD1()` hands out: no I/O and no environment detection until the first statement runs;
|
|
17
|
-
* the target is resolved once and cached
|
|
17
|
+
* the target is resolved once and cached — in a Worker that target reads the request's own binding on
|
|
18
18
|
* every statement (`index.ts`), so one module-scope instance serves every request with that request's database.
|
|
19
19
|
* Statements remember `sql` + params and are materialised on the target when executed, so `drizzle(totalumD1())` at
|
|
20
20
|
* module scope is legal.
|
|
@@ -40,14 +40,14 @@ export function lazyD1(resolve, migrate, { destructive = false } = {}) {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Off the binding, several statements in one call run as one batch (atomic, as on D1) and answer the last one's
|
|
43
|
-
* result with every statement's `changes
|
|
43
|
+
* result with every statement's `changes`; one statement is prepared as written.
|
|
44
44
|
*/
|
|
45
45
|
async result() {
|
|
46
46
|
const t = await this.on();
|
|
47
47
|
if (isNative(t)) {
|
|
48
48
|
assertStatement(this.sql);
|
|
49
49
|
const params = bindable(this.params);
|
|
50
|
-
// a migration straight onto a binding (`npm run dev`'s local D1) follows
|
|
50
|
+
// a migration straight onto a binding (`npm run dev`'s local D1) follows the Totalum API's migrate-mode rules
|
|
51
51
|
if (migrate) {
|
|
52
52
|
refuseTransactions(this.sql);
|
|
53
53
|
guardMigration([{ sql: this.sql }], destructive);
|
|
@@ -131,7 +131,7 @@ export function lazyD1(resolve, migrate, { destructive = false } = {}) {
|
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
/**
|
|
134
|
-
* A D1 session (read replication
|
|
134
|
+
* A D1 session (read replication): on the native binding the binding's own `withSession()`, created on the
|
|
135
135
|
* first statement, so bookmarks work in hand-written code; on HTTPS and Turso there are no replicas and the session
|
|
136
136
|
* is the database itself, `getBookmark()` → `null`.
|
|
137
137
|
*/
|
package/dist/d1/libsql.js
CHANGED
|
@@ -3,13 +3,13 @@ import { TotalumD1Error } from './errors.js';
|
|
|
3
3
|
import { NO_STATEMENTS } from './native-shape.js';
|
|
4
4
|
import { bindable, pickFirst } from './sql.js';
|
|
5
5
|
/**
|
|
6
|
-
* D1 enforces foreign keys; a Turso database on the new engine
|
|
6
|
+
* D1 enforces foreign keys; a Turso database on the new engine starts every connection with them off, and each
|
|
7
7
|
* Hrana request is a new connection. So every request carries the pragma, inside the one transaction libsql opens for
|
|
8
8
|
* it (the new engine applies it there; libSQL has them on already and ignores it inside a transaction).
|
|
9
9
|
*/
|
|
10
10
|
const FOREIGN_KEYS_ON = { sql: 'PRAGMA foreign_keys = ON', args: [] };
|
|
11
11
|
/**
|
|
12
|
-
* The Turso path
|
|
12
|
+
* The Turso path: a `D1Database`-compatible executor over a libsql client created with
|
|
13
13
|
* `intMode: 'bigint'` (integers beyond 2^53 then degrade to the same double D1 returns instead of throwing).
|
|
14
14
|
* `meta` is synthesised from what libsql reports; `size_after` is not reported by libsql and is 0.
|
|
15
15
|
*/
|
|
@@ -135,7 +135,7 @@ function d1Error(sqliteMessage) {
|
|
|
135
135
|
return TotalumD1Error.engine(sqliteMessage, { status: 400, details: { sqliteMessage } });
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
|
-
* Turso's own failures in the words D1 has for the same situation (
|
|
138
|
+
* Turso's own failures in the words D1 has for the same situation (D1's list:
|
|
139
139
|
* developers.cloudflare.com/d1/observability/debug-d1), so code and the driver's retry rule (`retry.ts`) read one
|
|
140
140
|
* vocabulary on every connection: a statement cut off for running too long (524 after ≈ 125 s, 504), a gateway that
|
|
141
141
|
* lost the database (502, 52x: the statement may have run), a request not taken (503: it did not run), too many
|
|
@@ -174,7 +174,7 @@ function fromLibsqlValue(v) {
|
|
|
174
174
|
return v;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
* The new engine (
|
|
177
|
+
* The new engine (recorded 2026-09-24) words the same SQLite failures as `Tursodb error: Runtime error: <msg> (19)`
|
|
178
178
|
* or `Tursodb error: Parse error: <msg>`, and a composite key as `t.(a, b)` where SQLite says `t.a, t.b`.
|
|
179
179
|
*/
|
|
180
180
|
const TURSODB_PREFIX = /^Tursodb error: [A-Za-z ]+ error: /;
|
|
@@ -191,7 +191,7 @@ function mapLibsqlError(e, primaryKey) {
|
|
|
191
191
|
if (typeof err.message !== 'string')
|
|
192
192
|
return e;
|
|
193
193
|
if (typeof err.code !== 'string') {
|
|
194
|
-
// not libsql's: the Worker's own failure while reading the answer, or the connection
|
|
194
|
+
// not libsql's: the Worker's own failure while reading the answer, or the connection
|
|
195
195
|
if (err.message.startsWith('Memory limit exceeded'))
|
|
196
196
|
return d1Error(err.message);
|
|
197
197
|
return DROPPED.test(err.message) ? providerError(LOST) : e;
|
package/dist/d1/migrate-rules.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { TotalumD1Error } from './errors.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* of `npm run dev` (`scripts/migrate.ts --local
|
|
3
|
+
* the Totalum API's migrate-mode rules, applied where a migration reaches a D1 binding directly — the local D1
|
|
4
|
+
* of `npm run dev` (`scripts/migrate.ts --local`): a migration that the pipeline refuses is refused here
|
|
5
5
|
* too, with the same code and words, and drizzle-kit's table rebuild keeps the child rows as it does there. Without
|
|
6
6
|
* them `--local` accepted FTS5 tables and unconfirmed drops the preview then refused, and a rebuild emptied every
|
|
7
7
|
* table referencing the rebuilt one (D1 ignores `PRAGMA foreign_keys=OFF` inside a batch).
|
|
8
8
|
*
|
|
9
|
-
* `classify` is a copy of
|
|
9
|
+
* `classify` is a copy of the Totalum API's `packages/data-worker/guard.mjs`, `keepChildRows` of contracts'
|
|
10
10
|
* `sql-rebuild.ts` (with `safeRebuilds`) and `rowLoss` of contracts' `sql-row-loss.ts` (this package has no runtime
|
|
11
|
-
* dependency
|
|
11
|
+
* dependency); `test/node/migrate-rules.test.ts` holds the copies to the originals on a corpus.
|
|
12
12
|
*/
|
|
13
13
|
const READ_PRAGMAS = new Set([
|
|
14
14
|
'TABLE_INFO',
|
|
@@ -111,7 +111,7 @@ function mainKeywordAfterCte(body) {
|
|
|
111
111
|
}
|
|
112
112
|
return '';
|
|
113
113
|
}
|
|
114
|
-
/** One statement: read / write / DDL, or the guard's refusal (
|
|
114
|
+
/** One statement: read / write / DDL, or the guard's refusal ( keyword table). */
|
|
115
115
|
export function classify(sql) {
|
|
116
116
|
const { statements, norm } = tokenize(sql);
|
|
117
117
|
if (statements !== 1)
|
package/dist/d1/native-shape.js
CHANGED
|
@@ -2,12 +2,12 @@ import { TotalumD1Error } from './errors.js';
|
|
|
2
2
|
import { splitStatements } from './sql.js';
|
|
3
3
|
/**
|
|
4
4
|
* What the native binding does with the text of a statement, for the executors that are not the binding (HTTPS to
|
|
5
|
-
*
|
|
5
|
+
* the Totalum API, libsql to Turso): measured on production D1, so a statement answers the same on every path.
|
|
6
6
|
*
|
|
7
7
|
* - no statement (empty, only comments) → `D1_ERROR: No SQL statements detected.`;
|
|
8
8
|
* - transaction control (`BEGIN`, `COMMIT`, `END`, `ROLLBACK`, `SAVEPOINT`, `RELEASE`) → D1's refusal, word for word;
|
|
9
9
|
* - several statements in one call run as one atomic unit and answer the last one's rows, their `changes` summed; only
|
|
10
|
-
*
|
|
10
|
+
* the last may have parameters; inside `batch()` such a statement is refused.
|
|
11
11
|
*/
|
|
12
12
|
export const NO_STATEMENTS = 'No SQL statements detected.';
|
|
13
13
|
export const TRANSACTIONS = "To execute a transaction, please use the state.storage.transaction() or state.storage.transactionSync() APIs instead of the SQL BEGIN TRANSACTION or SAVEPOINT statements. The JavaScript API is safer because it will automatically roll back on exceptions, and because it interacts correctly with Durable Objects' automatic atomic write coalescing.";
|
package/dist/d1/retry.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { bare } from './native-shape.js';
|
|
2
2
|
/**
|
|
3
|
-
* The failures the driver repeats
|
|
3
|
+
* The failures the driver repeats, named by D1's own words — the Turso adapter words its provider's
|
|
4
4
|
* failures the same way (`libsql.ts`), so one rule covers the binding, Turso and the HTTPS path.
|
|
5
5
|
*
|
|
6
6
|
* - `TRANSIENT`: what Cloudflare documents as retryable (developers.cloudflare.com/d1/observability/debug-d1), plus the
|
|
7
|
-
*
|
|
7
|
+
* HTTPS path's `NETWORK_ERROR`. The statement may or may not have run, so only a pure read is repeated.
|
|
8
8
|
* - `NEVER_RAN`: the request did not reach a running database (D1 could not resolve or start it; Turso answered 503),
|
|
9
|
-
*
|
|
9
|
+
* so a write is repeated too.
|
|
10
10
|
*
|
|
11
11
|
* Never repeated: an overloaded database (D1: "send fewer requests"), a statement over a time, memory or size limit,
|
|
12
12
|
* any SQL error, and a write after `Network connection lost.` (it may have been applied).
|
package/dist/d1/session.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Set on every mutating response; while the browser holds it, its reads go to the primary (read-your-writes). */
|
|
2
2
|
export const READ_YOUR_WRITES_COOKIE = '__tlm_d1_w';
|
|
3
|
-
/** Replicas lag the primary by 30–75 ms (Cloudflare); 10 s leaves a wide margin
|
|
3
|
+
/** Replicas lag the primary by 30–75 ms (Cloudflare); 10 s leaves a wide margin. */
|
|
4
4
|
const WINDOW_SECONDS = 10;
|
|
5
5
|
const READS = new Set(['GET', 'HEAD']);
|
|
6
6
|
/**
|
|
@@ -13,12 +13,12 @@ export const REPLICA_READ_TIMEOUT_MS = 2000;
|
|
|
13
13
|
const PURE_READ = /^\s*select\b/i;
|
|
14
14
|
const LATE = Symbol('late');
|
|
15
15
|
/**
|
|
16
|
-
* Runs one request of a Worker with a replicated D1
|
|
16
|
+
* Runs one request of a Worker with a replicated D1: a `GET`/`HEAD` reads through a
|
|
17
17
|
* `first-unconstrained` session — the nearest replica — unless the browser wrote in the last 10 s; any other method
|
|
18
18
|
* uses the plain binding (writes go to the primary; measured faster than any session) and its response sets the short
|
|
19
19
|
* cookie that sends that browser's next reads to the primary. A replica read that takes over `REPLICA_READ_TIMEOUT_MS`
|
|
20
20
|
* is answered by the primary instead, and the rest of that request reads the primary. A mutation's pure read the primary
|
|
21
|
-
* does not answer in that time is asked again on the primary (
|
|
21
|
+
* does not answer in that time is asked again on the primary (one call stalled while the database answered
|
|
22
22
|
* others; a sign-up waited on its first SELECT until the Worker was cancelled). `run` receives the env to hand to the
|
|
23
23
|
* app, whose `totalumD1()` reads `TOTALUM_DB` from it on every statement. No D1 binding (Turso, a laptop): `run(env)`
|
|
24
24
|
* unchanged.
|
package/dist/d1/sql.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isRecord } from './errors.js';
|
|
2
2
|
/**
|
|
3
|
-
* Each value as the native binding binds it (
|
|
3
|
+
* Each value as the native binding binds it (measured on production D1): `null`, strings, numbers and
|
|
4
4
|
* booleans as they are (a non-finite number binds as `NULL`); `ArrayBuffer`, `Uint8Array` (a `Buffer`) and an empty
|
|
5
5
|
* array as a BLOB; a `DataView` as an empty BLOB; any other typed array as its text (`Int16Array [1, 256]` → `'1,256'`).
|
|
6
6
|
* Anything else is refused at `bind()` with the binding's own `D1_TYPE_ERROR` (the value printed as `${value}`).
|
|
@@ -40,7 +40,7 @@ export function pickFirst(results, colName) {
|
|
|
40
40
|
return row[colName];
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* A `;` inside the `BEGIN … END` body of a `CREATE TRIGGER` ends one of its statements, not the trigger (as
|
|
43
|
+
* A `;` inside the `BEGIN … END` body of a `CREATE TRIGGER` ends one of its statements, not the trigger (as the Totalum API's
|
|
44
44
|
* statement guard reads it). Keywords are counted with literals and comments blanked; a `CASE` brings its own `END`.
|
|
45
45
|
*/
|
|
46
46
|
function insideTriggerBody(fragment) {
|
package/dist/email/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-
|
|
2
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
3
|
-
import { E as EmailSendInput, k as EmailView } from '../_types/integrations.d-
|
|
4
|
-
export { j as EmailSendOutput } from '../_types/integrations.d-
|
|
5
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-BfXTsxYG.js';
|
|
2
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BfXTsxYG.js';
|
|
3
|
+
import { E as EmailSendInput, k as EmailView } from '../_types/integrations.d-DL2_rTOs.js';
|
|
4
|
+
export { j as EmailSendOutput } from '../_types/integrations.d-DL2_rTOs.js';
|
|
5
|
+
import '../_types/coerce.d-DiNiCkat.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* `totalum.email`
|
|
8
|
+
* `totalum.email` over the Totalum API `/v1/email/*` (scope `email`): HTML sent byte for byte, charged
|
|
9
9
|
* per recipient. On dev only allow-listed recipients are accepted (`DEV_RECIPIENT_NOT_ALLOWED`).
|
|
10
10
|
*/
|
|
11
11
|
declare function totalumEmail(options?: TotalumClientOptions): {
|
package/dist/email/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isTotalumError } from '../errors.js';
|
|
|
2
2
|
import { envelopeClient, jsonClient, withUsage } from '../http.js';
|
|
3
3
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
4
4
|
/**
|
|
5
|
-
* `totalum.email`
|
|
5
|
+
* `totalum.email` over the Totalum API `/v1/email/*` (scope `email`): HTML sent byte for byte, charged
|
|
6
6
|
* per recipient. On dev only allow-listed recipients are accepted (`DEV_RECIPIENT_NOT_ALLOWED`).
|
|
7
7
|
*/
|
|
8
8
|
export function totalumEmail(options = {}) {
|
package/dist/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The one error every `totalum-sdk` call throws
|
|
2
|
+
* The one error every `totalum-sdk` call throws: the Totalum API envelope's frozen `errorCode`, the HTTP
|
|
3
3
|
* status and `details`. `TotalumD1Error` (`totalum-sdk/d1`) and `TotalumWebhookError` (`totalum-sdk/webhooks`)
|
|
4
4
|
* extend it, so one `isTotalumError(e)` check covers the whole package.
|
|
5
5
|
*/
|
|
@@ -9,7 +9,7 @@ export class TotalumError extends Error {
|
|
|
9
9
|
/** HTTP status; 0 for network errors, 500 for client-side refusals. */
|
|
10
10
|
status;
|
|
11
11
|
details;
|
|
12
|
-
/**
|
|
12
|
+
/** the Totalum API's request id, for support and the logs explorer. */
|
|
13
13
|
requestId;
|
|
14
14
|
constructor(errorCode, message, status = 500, details, requestId) {
|
|
15
15
|
super(message);
|
|
@@ -39,10 +39,10 @@ export class TotalumError extends Error {
|
|
|
39
39
|
export function isTotalumError(e) {
|
|
40
40
|
return e instanceof TotalumError;
|
|
41
41
|
}
|
|
42
|
-
/** Inside workerd: the preview and the published app
|
|
42
|
+
/** Inside workerd: the preview and the published app. */
|
|
43
43
|
export const inWorker = () => typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers';
|
|
44
44
|
/**
|
|
45
|
-
* Refuses a Node-only method inside a Worker
|
|
45
|
+
* Refuses a Node-only method inside a Worker: the message says where the app runs, what was called and
|
|
46
46
|
* the HTTPS replacement; `details {method, replacement, docsUrl}` lets a caller render the hint.
|
|
47
47
|
*/
|
|
48
48
|
export function assertNode(method, replacement, docsUrl) {
|
package/dist/files/index.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { F as FileDescriptor, l as FileUploadUrlInput, n as FilesListQuery } from '../_types/integrations.d-
|
|
2
|
-
export { m as FileUploadUrlOutput, o as FilesPage } 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 { F as FileDescriptor, l as FileUploadUrlInput, n as FilesListQuery } from '../_types/integrations.d-DL2_rTOs.js';
|
|
2
|
+
export { m as FileUploadUrlOutput, o as FilesPage } 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
|
interface TotalumFilesOptions extends TotalumClientOptions {
|
|
8
|
-
/** The public files host; default `TOTALUM_FILES_URL`, else `https://files.totalum-project.com
|
|
8
|
+
/** The public files host; default `TOTALUM_FILES_URL`, else `https://files.totalum-project.com`. */
|
|
9
9
|
filesUrl?: string;
|
|
10
10
|
}
|
|
11
11
|
interface UploadOptions {
|
|
12
12
|
name?: string;
|
|
13
13
|
contentType?: string;
|
|
14
|
-
/** `true` stores the file under the private prefix: no public URL, read it through `getSignedUrl
|
|
14
|
+
/** `true` stores the file under the private prefix: no public URL, read it through `getSignedUrl`. */
|
|
15
15
|
private?: boolean;
|
|
16
16
|
folder?: string;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* `totalum.files` (
|
|
19
|
+
* `totalum.files` (the Totalum API ) over HTTPS with the project key. Every call returns the file
|
|
20
20
|
* descriptor `{key, fileName, fileSize, contentType, fileUrl, visibility, createdAt}` meant to be stored as-is in the
|
|
21
|
-
* row's file column; failures throw `TotalumError` with
|
|
21
|
+
* row's file column; failures throw `TotalumError` with the Totalum API's frozen code.
|
|
22
22
|
*/
|
|
23
23
|
declare function totalumFiles(options?: TotalumFilesOptions): {
|
|
24
|
-
/** Up to 25 MB through
|
|
24
|
+
/** Up to 25 MB through the Totalum API; larger files go through `getUploadUrl` + `complete`. */
|
|
25
25
|
upload(input: Blob | ArrayBuffer | Uint8Array | string, opts?: UploadOptions): Promise<FileDescriptor>;
|
|
26
26
|
/**
|
|
27
27
|
* A presigned PUT (15 min, bound to this type and size) for a direct browser/Node upload; then `complete(key)`.
|
|
@@ -116,7 +116,7 @@ declare function totalumFiles(options?: TotalumFilesOptions): {
|
|
|
116
116
|
stream: (key: string, opts?: {
|
|
117
117
|
range?: string;
|
|
118
118
|
}) => Promise<Response>;
|
|
119
|
-
/** Sync, no I/O: the public URL of a `p/` key, or the authenticated
|
|
119
|
+
/** Sync, no I/O: the public URL of a `p/` key, or the authenticated the Totalum API URL of a private `pv/` key. */
|
|
120
120
|
url(key: string): string;
|
|
121
121
|
};
|
|
122
122
|
type TotalumFiles = ReturnType<typeof totalumFiles>;
|
package/dist/files/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import { apiUrlOf, jsonClient, query, rawClient, readEnv } from '../http.js';
|
|
|
3
3
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
4
4
|
const DEFAULT_FILES_URL = 'https://files.totalum-project.com';
|
|
5
5
|
/**
|
|
6
|
-
* `totalum.files` (
|
|
6
|
+
* `totalum.files` (the Totalum API ) over HTTPS with the project key. Every call returns the file
|
|
7
7
|
* descriptor `{key, fileName, fileSize, contentType, fileUrl, visibility, createdAt}` meant to be stored as-is in the
|
|
8
|
-
* row's file column; failures throw `TotalumError` with
|
|
8
|
+
* row's file column; failures throw `TotalumError` with the Totalum API's frozen code.
|
|
9
9
|
*/
|
|
10
10
|
export function totalumFiles(options = {}) {
|
|
11
11
|
const call = jsonClient(options);
|
|
@@ -17,7 +17,7 @@ export function totalumFiles(options = {}) {
|
|
|
17
17
|
return (await call('GET', `${path(key)}/download-url${q}`)).url;
|
|
18
18
|
};
|
|
19
19
|
return {
|
|
20
|
-
/** Up to 25 MB through
|
|
20
|
+
/** Up to 25 MB through the Totalum API; larger files go through `getUploadUrl` + `complete`. */
|
|
21
21
|
upload(input, opts = {}) {
|
|
22
22
|
const type = opts.contentType ?? (input instanceof Blob ? input.type : '');
|
|
23
23
|
const name = opts.name ?? (input instanceof File ? input.name : 'file');
|
|
@@ -64,7 +64,7 @@ export function totalumFiles(options = {}) {
|
|
|
64
64
|
},
|
|
65
65
|
/** The object itself (private files included), with `Range` support; errors throw like every other call. */
|
|
66
66
|
stream: (key, opts = {}) => raw(path(key), undefined, 'GET', opts.range ? { range: opts.range } : {}),
|
|
67
|
-
/** Sync, no I/O: the public URL of a `p/` key, or the authenticated
|
|
67
|
+
/** Sync, no I/O: the public URL of a `p/` key, or the authenticated the Totalum API URL of a private `pv/` key. */
|
|
68
68
|
url(key) {
|
|
69
69
|
return key.startsWith('pv/') ? apiUrlOf(options) + path(key) : `${filesUrl()}/${key}`;
|
|
70
70
|
},
|
package/dist/http.js
CHANGED
|
@@ -19,15 +19,15 @@ export function projectKey(options) {
|
|
|
19
19
|
}
|
|
20
20
|
export const apiUrlOf = (options) => options.apiUrl ?? readEnv('TOTALUM_SDK_API_URL') ?? DEFAULT_API_URL;
|
|
21
21
|
export const envOf = (options) => options.env ?? (readEnv('TOTALUM_ENV') === 'dev' ? 'dev' : 'live');
|
|
22
|
-
/** One HTTPS call to
|
|
22
|
+
/** One HTTPS call to the Totalum API with the project key; a transport failure is `NETWORK_ERROR`. */
|
|
23
23
|
export async function send(options, method, route, body, extra = {}) {
|
|
24
24
|
const headers = {
|
|
25
25
|
...extra,
|
|
26
26
|
authorization: `Bearer ${projectKey(options)}`,
|
|
27
27
|
'x-totalum-env': envOf(options),
|
|
28
28
|
};
|
|
29
|
-
// which deployment is calling (
|
|
30
|
-
// in Stripe live mode only from `live`
|
|
29
|
+
// which deployment is calling (Totalum binds `dev` on the preview Worker, `live` on the published one): payments charge
|
|
30
|
+
// in Stripe live mode only from `live`
|
|
31
31
|
const usageEnv = readEnv('TOTALUM_USAGE_ENV');
|
|
32
32
|
if (usageEnv === 'dev' || usageEnv === 'live')
|
|
33
33
|
headers['x-totalum-usage-env'] = usageEnv;
|
|
@@ -58,7 +58,7 @@ export async function send(options, method, route, body, extra = {}) {
|
|
|
58
58
|
/** A `429 RATE_LIMITED` (the project's built-in calls per second) is retried this many times, then thrown. */
|
|
59
59
|
const RATE_RETRIES = 2;
|
|
60
60
|
/**
|
|
61
|
-
* The wait before retrying a `429 RATE_LIMITED`, else 0.
|
|
61
|
+
* The wait before retrying a `429 RATE_LIMITED`, else 0. the Totalum API refuses it before any charge or vendor call, so a retry
|
|
62
62
|
* is always safe; `retryAfterMs` plus up to as much again of jitter spreads a burst over the next second.
|
|
63
63
|
*/
|
|
64
64
|
async function rateLimitedWait(res) {
|
|
@@ -89,11 +89,11 @@ export async function envelopeOf(res) {
|
|
|
89
89
|
}
|
|
90
90
|
return envelope;
|
|
91
91
|
}
|
|
92
|
-
/** JSON calls to
|
|
92
|
+
/** JSON calls to the Totalum API with the project key: the whole envelope, or `TotalumError` with the frozen code. */
|
|
93
93
|
export function envelopeClient(options) {
|
|
94
94
|
return async (method, route, body) => envelopeOf(await send(options, method, route, body));
|
|
95
95
|
}
|
|
96
|
-
/** JSON calls to
|
|
96
|
+
/** JSON calls to the Totalum API with the project key: the envelope's `data`, or `TotalumError` with the frozen code. */
|
|
97
97
|
export function jsonClient(options) {
|
|
98
98
|
const call = envelopeClient(options);
|
|
99
99
|
return async (method, route, body) => (await call(method, route, body)).data;
|
|
@@ -115,7 +115,7 @@ export function query(params) {
|
|
|
115
115
|
q.set(k, Array.isArray(v) ? v.join(',') : String(v));
|
|
116
116
|
return q.size ? `?${q.toString()}` : '';
|
|
117
117
|
}
|
|
118
|
-
/** `data` + `usage {credits}` from `metadata` (
|
|
118
|
+
/** `data` + `usage {credits}` from `metadata` (every integration result shows its price, in credits only). */
|
|
119
119
|
export const withUsage = ({ data, metadata, }) => {
|
|
120
120
|
const rest = { ...data };
|
|
121
121
|
delete rest.usage;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,10 +31,10 @@ export { TotalumWeb } from './web/index.js';
|
|
|
31
31
|
import { totalumWebhooks } from './webhooks/index.js';
|
|
32
32
|
export { TotalumWebhookError, TotalumWebhooks, WebhookConfig, WebhookEvent, WebhookSecretOutput, 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-
|
|
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, D as Subscription, G as SubscriptionUpdateInput, T as TranscribeInput, H as TranscribeOutput, W as WebJob, I as WebScrapeOutput, K as WebSearchOutput } from './_types/integrations.d-
|
|
36
|
-
export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-
|
|
37
|
-
import './_types/coerce.d-
|
|
34
|
+
export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-BfXTsxYG.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, D as Subscription, G as SubscriptionUpdateInput, T as TranscribeInput, H as TranscribeOutput, W as WebJob, I as WebScrapeOutput, K as WebSearchOutput } from './_types/integrations.d-DL2_rTOs.js';
|
|
36
|
+
export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-fwLDriUN.js';
|
|
37
|
+
import './_types/coerce.d-DiNiCkat.js';
|
|
38
38
|
|
|
39
39
|
/** The options of `createTotalum()`: every namespace's options in one object (each falls back to its env var). */
|
|
40
40
|
type TotalumOptions = TotalumAiOptions & TotalumFilesOptions;
|
|
@@ -60,7 +60,7 @@ type Totalum = {
|
|
|
60
60
|
readonly [K in keyof typeof namespaces]: ReturnType<(typeof namespaces)[K]>;
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
63
|
-
* Every integration namespace on one object
|
|
63
|
+
* Every integration namespace on one object, each built on first access with the same options — no I/O
|
|
64
64
|
* and no env read until a method is called. The database is `totalumD1()` from `totalum-sdk/d1`, not a namespace.
|
|
65
65
|
*
|
|
66
66
|
* @example
|
package/dist/index.js
CHANGED
|
@@ -50,7 +50,7 @@ const namespaces = {
|
|
|
50
50
|
webhooks: totalumWebhooks,
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
|
-
* Every integration namespace on one object
|
|
53
|
+
* Every integration namespace on one object, each built on first access with the same options — no I/O
|
|
54
54
|
* and no env read until a method is called. The database is `totalumD1()` from `totalum-sdk/d1`, not a namespace.
|
|
55
55
|
*
|
|
56
56
|
* @example
|
package/dist/logs/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as LogsQueryInput } from '../_types/ops.d-
|
|
2
|
-
export { L as LogsPage } from '../_types/ops.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 { c as LogsQueryInput } from '../_types/ops.d-fwLDriUN.js';
|
|
2
|
+
export { L as LogsPage } from '../_types/ops.d-fwLDriUN.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
|
/** 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'>;
|
|
9
9
|
/**
|
|
10
|
-
* `totalum.logs`
|
|
10
|
+
* `totalum.logs` over the Totalum API `/v1/logs` (scope `logs:read`; the agent's sandbox key reads its dev
|
|
11
11
|
* preview for free): the Worker invocations of the published app (`env: 'live'`) or the preview (`'dev'`). Free.
|
|
12
12
|
*/
|
|
13
13
|
declare function totalumLogs(options?: TotalumClientOptions): {
|
package/dist/logs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsonClient } from '../http.js';
|
|
2
2
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
3
3
|
/**
|
|
4
|
-
* `totalum.logs`
|
|
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 = {}) {
|
package/dist/payments/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as OnboardingLinkInput, C as CheckoutInput, h as CustomerPortalLinkInput, G as SubscriptionUpdateInput, R as RefundInput } from '../_types/integrations.d-
|
|
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-
|
|
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 { O as OnboardingLinkInput, C as CheckoutInput, h as CustomerPortalLinkInput, G as SubscriptionUpdateInput, R as RefundInput } from '../_types/integrations.d-DL2_rTOs.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-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.payments`
|
|
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);
|
|
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
12
|
*/
|
|
13
13
|
declare function totalumPayments(options?: TotalumClientOptions): {
|
package/dist/payments/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsonClient } from '../http.js';
|
|
2
2
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
3
3
|
/**
|
|
4
|
-
* `totalum.payments`
|
|
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);
|
|
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
8
|
*/
|
|
9
9
|
export function totalumPayments(options = {}) {
|
package/dist/pdf/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-
|
|
2
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
3
|
-
import { q as PdfFromHtmlInput, r as PdfFromUrlInput } from '../_types/integrations.d-
|
|
4
|
-
export { s as PdfOutput } from '../_types/integrations.d-
|
|
5
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { T as TotalumClientOptions, U as Usage } from '../_types/errors.d-BfXTsxYG.js';
|
|
2
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BfXTsxYG.js';
|
|
3
|
+
import { q as PdfFromHtmlInput, r as PdfFromUrlInput } from '../_types/integrations.d-DL2_rTOs.js';
|
|
4
|
+
export { s as PdfOutput } from '../_types/integrations.d-DL2_rTOs.js';
|
|
5
|
+
import '../_types/coerce.d-DiNiCkat.js';
|
|
6
6
|
|
|
7
|
-
/** `totalum.pdf`
|
|
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`
|
|
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 {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `totalum-sdk/react
|
|
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).
|
package/dist/realtime/index.d.ts
CHANGED
|
@@ -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-
|
|
2
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
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-BfXTsxYG.js';
|
|
2
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BfXTsxYG.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
|
|
37
|
-
* app's own routes or a cron job. The room is resolved inside the key's project
|
|
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
|
|
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
|
*
|
package/dist/realtime/index.js
CHANGED
|
@@ -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
|
|
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
|
*
|
package/dist/scan/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as ScanDocumentInput, u as ScanOcrInput } from '../_types/integrations.d-
|
|
2
|
-
export { v as ScanOcrOutput } from '../_types/integrations.d-
|
|
3
|
-
import { U as Usage, 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 { S as ScanDocumentInput, u as ScanOcrInput } from '../_types/integrations.d-DL2_rTOs.js';
|
|
2
|
+
export { v as ScanOcrOutput } from '../_types/integrations.d-DL2_rTOs.js';
|
|
3
|
+
import { U as Usage, 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
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`
|
|
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>;
|
package/dist/scan/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.scan`
|
|
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 {
|
package/dist/seo/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { y as SeoIndexNowKey, z as SeoNotifyOutput } from '../_types/integrations.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
|
+
export { y as SeoIndexNowKey, z as SeoNotifyOutput } from '../_types/integrations.d-DL2_rTOs.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
|
-
/** `totalum.seo`
|
|
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<{
|