totalum-sdk 1.6.0 → 1.7.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.
- package/CHANGELOG.md +43 -0
- package/dist/_types/{billing.d-C_EhT-A9.d.ts → billing.d-D4xsKzBh.d.ts} +1 -1
- package/dist/_types/{coerce.d-6GCI5oBM.d.ts → coerce.d-BsPi0zYd.d.ts} +1 -1
- package/dist/_types/{errors.d-CrSaXOox.d.ts → errors.d-BQCXEk1O.d.ts} +6 -0
- package/dist/_types/{integrations.d-BZwGkK-3.d.ts → integrations.d-DG5LLFMq.d.ts} +45 -4
- package/dist/_types/{ops.d-B30WmkFS.d.ts → ops.d-Y0AdHnWq.d.ts} +2 -2
- package/dist/ai/index.d.ts +4 -4
- package/dist/analytics/index.d.ts +4 -4
- package/dist/browser/index.d.ts +13 -4
- package/dist/cron/index.d.ts +5 -5
- package/dist/d1/index.d.ts +2 -2
- package/dist/d1/lazy.js +14 -6
- package/dist/d1/libsql.js +46 -3
- package/dist/d1/migrate-rules.js +88 -5
- package/dist/d1/native-shape.js +1 -1
- package/dist/d1/retry.js +39 -0
- package/dist/email/index.d.ts +5 -5
- package/dist/files/index.d.ts +10 -6
- package/dist/files/index.js +5 -1
- package/dist/index.d.ts +5 -5
- package/dist/logs/index.d.ts +5 -5
- package/dist/payments/index.d.ts +47 -8
- package/dist/payments/index.js +15 -2
- package/dist/pdf/index.d.ts +5 -5
- package/dist/realtime/index.d.ts +9 -3
- package/dist/realtime/index.js +7 -1
- package/dist/scan/index.d.ts +5 -5
- package/dist/seo/index.d.ts +4 -4
- package/dist/speech/index.d.ts +5 -5
- package/dist/vectors/index.d.ts +8 -4
- package/dist/vectors/index.js +6 -2
- package/dist/web/index.d.ts +5 -5
- package/dist/webhooks/index.d.ts +4 -4
- package/package.json +1 -1
- package/totalum-sdk.md +57 -10
- package/totalum-sdk.signatures.json +14 -2
package/dist/d1/migrate-rules.js
CHANGED
|
@@ -6,9 +6,9 @@ import { TotalumD1Error } from './errors.js';
|
|
|
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 SDK-API's `packages/data-worker/guard.mjs
|
|
10
|
-
* `sql-rebuild.ts` (with `safeRebuilds
|
|
11
|
-
* copies to the originals on a corpus.
|
|
9
|
+
* `classify` is a copy of SDK-API's `packages/data-worker/guard.mjs`, `keepChildRows` of contracts'
|
|
10
|
+
* `sql-rebuild.ts` (with `safeRebuilds`) and `rowLoss` of contracts' `sql-row-loss.ts` (this package has no runtime
|
|
11
|
+
* dependency, plan 05 §1); `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',
|
|
@@ -375,9 +375,14 @@ export function guardMigration(statements, destructive, safe = []) {
|
|
|
375
375
|
}
|
|
376
376
|
return c;
|
|
377
377
|
});
|
|
378
|
-
|
|
378
|
+
// A10.4 amended 2026-10-02 (SDK-API's migrate mode): a statement that deletes or overwrites existing rows is
|
|
379
|
+
// destructive like a dropped column
|
|
380
|
+
const lost = rowLoss(statements.map((s) => s.sql));
|
|
381
|
+
const i = classified.findIndex((c, k) => (c.destructive && !safe.includes(k)) || lost.includes(k));
|
|
379
382
|
if (i >= 0 && !destructive) {
|
|
380
|
-
throw new TotalumD1Error('DESTRUCTIVE_MIGRATION_NEEDS_CONFIRMATION',
|
|
383
|
+
throw new TotalumD1Error('DESTRUCTIVE_MIGRATION_NEEDS_CONFIRMATION', `D1_ERROR: DESTRUCTIVE_MIGRATION_NEEDS_CONFIRMATION: ${classified[i]?.kind === 'write'
|
|
384
|
+
? 'This migration deletes or overwrites existing rows, and nobody asked for that. A migration only fills empty values (UPDATE … SET col = … WHERE col IS NULL). When existing rows block a new rule (duplicates, NULLs), leave them as they are: tell the owner which rows conflict and let them decide'
|
|
385
|
+
: 'This migration drops, renames or rewrites a table or column'}`, {
|
|
381
386
|
status: 409,
|
|
382
387
|
details: {
|
|
383
388
|
statementIndex: i,
|
|
@@ -388,3 +393,81 @@ export function guardMigration(statements, destructive, safe = []) {
|
|
|
388
393
|
}
|
|
389
394
|
return classified;
|
|
390
395
|
}
|
|
396
|
+
/*
|
|
397
|
+
* `rowLoss`: a copy of contracts' `sql-row-loss.ts` (A10.4 / A10.7 as amended 2026-10-02). The indexes of one
|
|
398
|
+
* migration's statements that delete or overwrite rows existing before it — a `DELETE`, a `REPLACE` or an upsert, an
|
|
399
|
+
* `UPDATE` that is not a backfill of empty values; never on a table the same migration created.
|
|
400
|
+
*/
|
|
401
|
+
const name = (s) => (s ?? '').replace(/^[`"[]|[`"\]]$/g, '').toLowerCase();
|
|
402
|
+
const LITERALS = /--[^\n]*|\/\*[\s\S]*?\*\/|'(?:[^']|'')*'|"(?:[^"]|"")*"|`[^`]*`/g;
|
|
403
|
+
const CREATED = new RegExp(`^CREATE\\s+(?:TEMP\\s+|TEMPORARY\\s+)?TABLE\\s+(?!IF\\b)${NAME}`, 'i');
|
|
404
|
+
const ADDED = new RegExp(`^ALTER\\s+TABLE\\s+${NAME}\\s+ADD\\s+(?:COLUMN\\s+)?${NAME}`, 'i');
|
|
405
|
+
const TARGET = new RegExp(`\\b(DELETE\\s+FROM|REPLACE\\s+INTO|INSERT(?:\\s+OR\\s+\\w+)?\\s+INTO|UPDATE(?:\\s+OR\\s+\\w+)?)\\s+${NAME}`, 'i');
|
|
406
|
+
/** The statements of one file part: comments out, string literals as `'?'`, split at `;` (a trigger keeps its body). */
|
|
407
|
+
function split(sql) {
|
|
408
|
+
const plain = sql
|
|
409
|
+
.replace(LITERALS, (m) => (m.startsWith("'") ? "'?'" : /^(--|\/\*)/.test(m) ? ' ' : m))
|
|
410
|
+
.trim();
|
|
411
|
+
return /^CREATE\s+(TEMP\s+|TEMPORARY\s+)?TRIGGER\b/i.test(plain)
|
|
412
|
+
? [plain]
|
|
413
|
+
: plain.split(';').map((s) => s.trim());
|
|
414
|
+
}
|
|
415
|
+
/** The text outside every parenthesis (a subquery's `WHERE` or commas are not the statement's). */
|
|
416
|
+
function top(sql) {
|
|
417
|
+
let depth = 0;
|
|
418
|
+
let out = '';
|
|
419
|
+
for (const ch of sql) {
|
|
420
|
+
if (ch === '(')
|
|
421
|
+
depth++;
|
|
422
|
+
else if (ch === ')')
|
|
423
|
+
depth--;
|
|
424
|
+
else if (depth === 0)
|
|
425
|
+
out += ch;
|
|
426
|
+
}
|
|
427
|
+
return out.replace(/\s+/g, ' ');
|
|
428
|
+
}
|
|
429
|
+
/** An `UPDATE` that only fills empty values: each assigned column was just `added` or is `IS NULL` where it applies. */
|
|
430
|
+
function backfill(text, added) {
|
|
431
|
+
const m = /\bSET\s+(.*?)(?:\s+FROM\s.*?)?(?:\s+WHERE\s+(.*?))?(?:\s+RETURNING\s.*)?$/i.exec(text);
|
|
432
|
+
if (!m)
|
|
433
|
+
return false;
|
|
434
|
+
const assigned = (m[1] ?? '').split(',').map((a) => new RegExp(`^\\s*${NAME}\\s*=`).exec(a)?.[1]);
|
|
435
|
+
const where = m[2] ?? '';
|
|
436
|
+
const empty = /\bOR\b/i.test(where)
|
|
437
|
+
? []
|
|
438
|
+
: where
|
|
439
|
+
.split(/\bAND\b/i)
|
|
440
|
+
.map((t) => name(new RegExp(`^\\s*${NAME}\\s+IS\\s+NULL\\s*$`, 'i').exec(t)?.[1]));
|
|
441
|
+
return assigned.every((c) => c !== undefined && (added.has(name(c)) || empty.includes(name(c))));
|
|
442
|
+
}
|
|
443
|
+
/** The indexes of the `statements` (one migration's, in order) that delete or overwrite rows existing before it. */
|
|
444
|
+
export function rowLoss(statements) {
|
|
445
|
+
const created = new Set();
|
|
446
|
+
const added = new Map(); // table → the columns this migration added
|
|
447
|
+
const lost = [];
|
|
448
|
+
statements.forEach((part, i) => {
|
|
449
|
+
for (const sql of split(part)) {
|
|
450
|
+
const table = CREATED.exec(sql);
|
|
451
|
+
if (table)
|
|
452
|
+
created.add(name(table[1]));
|
|
453
|
+
const column = ADDED.exec(sql);
|
|
454
|
+
if (column)
|
|
455
|
+
added.set(name(column[1]), (added.get(name(column[1])) ?? new Set()).add(name(column[2])));
|
|
456
|
+
if (!/^(WITH|INSERT|UPDATE|DELETE|REPLACE)\b/i.test(sql))
|
|
457
|
+
continue;
|
|
458
|
+
const text = top(sql);
|
|
459
|
+
const dml = TARGET.exec(text);
|
|
460
|
+
if (!dml || created.has(name(dml[2])))
|
|
461
|
+
continue;
|
|
462
|
+
const verb = (dml[1] ?? '').toUpperCase();
|
|
463
|
+
const loss = verb.startsWith('INSERT')
|
|
464
|
+
? /\bOR\s+REPLACE\b/.test(verb) || /\bDO\s+UPDATE\b/i.test(text)
|
|
465
|
+
: verb === 'UPDATE'
|
|
466
|
+
? !backfill(text.slice(dml.index), added.get(name(dml[2])) ?? new Set())
|
|
467
|
+
: true; // DELETE, REPLACE, UPDATE OR <conflict rule>
|
|
468
|
+
if (loss && !lost.includes(i))
|
|
469
|
+
lost.push(i);
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
return lost;
|
|
473
|
+
}
|
package/dist/d1/native-shape.js
CHANGED
|
@@ -17,7 +17,7 @@ export const MULTI_IN_BATCH = 'A SQL prepared statement can only be executed onc
|
|
|
17
17
|
export const d1Error = (words) => TotalumD1Error.engine(words, { status: 400, details: { sqliteMessage: words } });
|
|
18
18
|
const TX = /^(BEGIN|COMMIT|END|ROLLBACK|SAVEPOINT|RELEASE)\b/i;
|
|
19
19
|
/** The text with its string literals, quoted identifiers and comments blanked (for looking at keywords only). */
|
|
20
|
-
const bare = (sql) => sql.replace(/'(?:[^']|'')*'|"(?:[^"]|"")*"|`[^`]*`|\[[^\]]*\]|--[^\n]*|\/\*[\s\S]*?\*\//g, ' ').trim();
|
|
20
|
+
export const bare = (sql) => sql.replace(/'(?:[^']|'')*'|"(?:[^"]|"")*"|`[^`]*`|\[[^\]]*\]|--[^\n]*|\/\*[\s\S]*?\*\//g, ' ').trim();
|
|
21
21
|
/** The binding's answer to a text with no statement; Miniflare (`npm run dev`) words a comment-only one differently. */
|
|
22
22
|
export function assertStatement(sql) {
|
|
23
23
|
if (bare(sql) === '')
|
package/dist/d1/retry.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { bare } from './native-shape.js';
|
|
2
|
+
/**
|
|
3
|
+
* The failures the driver repeats (research 75 §10.2), named by D1's own words — the Turso adapter words its provider's
|
|
4
|
+
* failures the same way (`libsql.ts`), so one rule covers the binding, Turso and the HTTPS path.
|
|
5
|
+
*
|
|
6
|
+
* - `TRANSIENT`: what Cloudflare documents as retryable (developers.cloudflare.com/d1/observability/debug-d1), plus the
|
|
7
|
+
* HTTPS path's `NETWORK_ERROR`. The statement may or may not have run, so only a pure read is repeated.
|
|
8
|
+
* - `NEVER_RAN`: the request did not reach a running database (D1 could not resolve or start it; Turso answered 503),
|
|
9
|
+
* so a write is repeated too.
|
|
10
|
+
*
|
|
11
|
+
* Never repeated: an overloaded database (D1: "send fewer requests"), a statement over a time, memory or size limit,
|
|
12
|
+
* any SQL error, and a write after `Network connection lost.` (it may have been applied).
|
|
13
|
+
*/
|
|
14
|
+
const TRANSIENT = /Network connection lost|storage caused object to be reset|reset because its code was updated|Replica disconnected from primary|Cannot resolve D1 DB due to transient issue|Can't read from request stream because client disconnected|^D1_ERROR: NETWORK_ERROR/;
|
|
15
|
+
const NEVER_RAN = /Cannot resolve D1 DB due to transient issue|Internal error while starting up D1 DB storage/;
|
|
16
|
+
/** Two more attempts, after about 100 ms and 400 ms (each 50–150 % of it): at most ≈ 0.75 s added to a request. */
|
|
17
|
+
const DELAYS_MS = [100, 400];
|
|
18
|
+
/** `SELECT …`, or `WITH …` that ends in a select: nothing it can have changed. */
|
|
19
|
+
const pureRead = (sql) => {
|
|
20
|
+
const text = bare(sql).replace(/[\s;]+$/, '');
|
|
21
|
+
return (!text.includes(';') &&
|
|
22
|
+
(/^select\b/i.test(text) || (/^with\b/i.test(text) && !/\b(insert|update|delete|replace)\b/i.test(text))));
|
|
23
|
+
};
|
|
24
|
+
/** Runs `call`, repeating it after a transient failure when that is safe for every statement of `sqls`. */
|
|
25
|
+
export async function withRetry(sqls, call) {
|
|
26
|
+
for (let attempt = 0;; attempt++) {
|
|
27
|
+
try {
|
|
28
|
+
return await call();
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
const delay = DELAYS_MS[attempt];
|
|
32
|
+
const message = e instanceof Error ? e.message : '';
|
|
33
|
+
const safe = NEVER_RAN.test(message) || (TRANSIENT.test(message) && sqls.every(pureRead));
|
|
34
|
+
if (delay === undefined || !safe)
|
|
35
|
+
throw e;
|
|
36
|
+
await new Promise((resolve) => setTimeout(resolve, delay * (0.5 + Math.random())));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
package/dist/email/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as EmailSendInput, k as EmailView } from '../_types/integrations.d-
|
|
2
|
-
export { j as EmailSendOutput } 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 { E as EmailSendInput, k as EmailView } from '../_types/integrations.d-DG5LLFMq.js';
|
|
2
|
+
export { j as EmailSendOutput } from '../_types/integrations.d-DG5LLFMq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* `totalum.email` (plan 05 §6.4) over SDK-API `/v1/email/*` (scope `email`): Resend, HTML sent byte for byte, charged
|
package/dist/files/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-DG5LLFMq.js';
|
|
2
|
+
export { m as FileUploadUrlOutput, o as FilesPage } from '../_types/integrations.d-DG5LLFMq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.js';
|
|
6
6
|
|
|
7
7
|
interface TotalumFilesOptions extends TotalumClientOptions {
|
|
8
8
|
/** The public files host; default `TOTALUM_FILES_URL`, else `https://files.totalum-project.com` (A10.1). */
|
|
@@ -23,7 +23,11 @@ interface UploadOptions {
|
|
|
23
23
|
declare function totalumFiles(options?: TotalumFilesOptions): {
|
|
24
24
|
/** Up to 25 MB through SDK-API; larger files go through `getUploadUrl` + `complete`. */
|
|
25
25
|
upload(input: Blob | ArrayBuffer | Uint8Array | string, opts?: UploadOptions): Promise<FileDescriptor>;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* A presigned PUT (15 min, bound to this type and size) for a direct browser/Node upload; then `complete(key)`.
|
|
28
|
+
* The largest file is 50 MB on the Free plan, 200 MB on Starter, 300 MB on Builder, 500 MB on Professional and
|
|
29
|
+
* 1 GB on Enterprise; above it `FILE_TOO_LARGE` (413, `details.maxBytes`).
|
|
30
|
+
*/
|
|
27
31
|
getUploadUrl: (input: FileUploadUrlInput) => Promise<{
|
|
28
32
|
uploadUrl: string;
|
|
29
33
|
key: string;
|
package/dist/files/index.js
CHANGED
|
@@ -30,7 +30,11 @@ export function totalumFiles(options = {}) {
|
|
|
30
30
|
form.set('folder', opts.folder);
|
|
31
31
|
return call('POST', '/v1/files', form);
|
|
32
32
|
},
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* A presigned PUT (15 min, bound to this type and size) for a direct browser/Node upload; then `complete(key)`.
|
|
35
|
+
* The largest file is 50 MB on the Free plan, 200 MB on Starter, 300 MB on Builder, 500 MB on Professional and
|
|
36
|
+
* 1 GB on Enterprise; above it `FILE_TOO_LARGE` (413, `details.maxBytes`).
|
|
37
|
+
*/
|
|
34
38
|
getUploadUrl: (input) => call('POST', '/v1/files/upload-url', input),
|
|
35
39
|
/** Registers a file uploaded with `getUploadUrl` and returns its descriptor. */
|
|
36
40
|
complete: (key) => call('POST', '/v1/files/complete', { key }),
|
package/dist/index.d.ts
CHANGED
|
@@ -31,11 +31,11 @@ export { TotalumWeb } from './web/index.js';
|
|
|
31
31
|
import { totalumWebhooks } from './webhooks/index.js';
|
|
32
32
|
export { TotalumWebhookError, TotalumWebhooks, verifyWebhook } from './webhooks/index.js';
|
|
33
33
|
export { D1Database, D1DatabaseSession, D1ExecResult, D1PreparedStatement, D1Result, READ_YOUR_WRITES_COOKIE, TotalumD1ClientCode, TotalumD1Error, TotalumD1ErrorCode, TotalumD1Options, isTotalumD1Error, totalumD1, withTotalumSession } from './d1/index.js';
|
|
34
|
-
export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-
|
|
35
|
-
export { C as CheckoutInput, a as CheckoutOutput, b as CheckoutSession, c as CronJob, d as CronJobInput, e as CronJobPatch, f as CronRun, g as CronRunsPage, h as CustomerPortalLinkInput, i as CustomerPortalLinkOutput, E as EmailSendInput, j as EmailSendOutput, k as EmailView, F as FileDescriptor, l as FileUploadUrlInput, m as FileUploadUrlOutput, n as FilesListQuery, o as FilesPage, J as JobCreated, O as OnboardingLinkInput, p as OnboardingLinkOutput, P as PaymentsStatus, q as PdfFromHtmlInput, r as PdfFromUrlInput, s as PdfOutput, R as RefundInput, t as RefundOutput, S as ScanDocumentInput, u as ScanOcrInput, v as ScanOcrOutput, w as ScreenshotInput, x as ScreenshotOutput, y as SeoIndexNowKey, z as SeoNotifyOutput, A as SpeakInput, B as StoredMedia, T as TranscribeInput,
|
|
36
|
-
export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-
|
|
37
|
-
export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-
|
|
38
|
-
import './_types/coerce.d-
|
|
34
|
+
export { T as TotalumClientOptions, a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from './_types/errors.d-BQCXEk1O.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-DG5LLFMq.js';
|
|
36
|
+
export { L as LogsPage, S as SiteAnalyticsOutput, a as SiteDimension, b as SiteMetric } from './_types/ops.d-Y0AdHnWq.js';
|
|
37
|
+
export { W as WebhookConfig, a as WebhookEvent, b as WebhookSecretOutput } from './_types/billing.d-D4xsKzBh.js';
|
|
38
|
+
import './_types/coerce.d-BsPi0zYd.js';
|
|
39
39
|
|
|
40
40
|
/** The options of `createTotalum()`: every namespace's options in one object (each falls back to its env var). */
|
|
41
41
|
type TotalumOptions = TotalumAiOptions & TotalumFilesOptions;
|
package/dist/logs/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-Y0AdHnWq.js';
|
|
2
|
+
export { L as LogsPage } from '../_types/ops.d-Y0AdHnWq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.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'>;
|
package/dist/payments/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { O as OnboardingLinkInput, C as CheckoutInput, h as CustomerPortalLinkInput, 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 } 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-DG5LLFMq.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-DG5LLFMq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* `totalum.payments` (plan 05, plan 11 §9.5) over SDK-API `/v1/payments/*` with a project key (scope `payments`): Stripe
|
|
@@ -33,14 +33,19 @@ declare function totalumPayments(options?: TotalumClientOptions): {
|
|
|
33
33
|
url: string;
|
|
34
34
|
expiresAt: string;
|
|
35
35
|
}>;
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* A hosted Checkout Session: `payment`, `subscription`, or `setup` (save a card for later). Redirect to `url`. A
|
|
38
|
+
* subscription needs a recurring price: an inline item with `recurring: { interval: 'month' }`, or a `priceId`;
|
|
39
|
+
* its `metadata` is also set on the subscription.
|
|
40
|
+
*/
|
|
37
41
|
createCheckout: (input: CheckoutInput) => Promise<{
|
|
38
42
|
id: string;
|
|
39
43
|
url: string;
|
|
40
44
|
}>;
|
|
41
45
|
/**
|
|
42
46
|
* A Checkout Session read back (`paymentStatus: 'paid'`, your `metadata`): the page Stripe returns the buyer to
|
|
43
|
-
* (`successUrl` with `?session_id={CHECKOUT_SESSION_ID}`) confirms the payment with it — no webhook needed.
|
|
47
|
+
* (`successUrl` with `?session_id={CHECKOUT_SESSION_ID}`) confirms the payment with it — no webhook needed. A
|
|
48
|
+
* subscription checkout also gives `subscriptionId` and `customerId`: store both on the member.
|
|
44
49
|
*/
|
|
45
50
|
getCheckout: (sessionId: string) => Promise<{
|
|
46
51
|
id: string;
|
|
@@ -52,11 +57,45 @@ declare function totalumPayments(options?: TotalumClientOptions): {
|
|
|
52
57
|
paymentIntentId: string | null;
|
|
53
58
|
customerEmail: string | null;
|
|
54
59
|
clientReferenceId: string | null;
|
|
60
|
+
customerId: string | null;
|
|
61
|
+
subscriptionId: string | null;
|
|
55
62
|
}>;
|
|
56
63
|
/** Stripe's hosted portal where a customer manages their subscriptions and saved cards. */
|
|
57
64
|
customerPortalLink: (input: CustomerPortalLinkInput) => Promise<{
|
|
58
65
|
url: string;
|
|
59
66
|
}>;
|
|
67
|
+
subscriptions: {
|
|
68
|
+
/** A subscription: access while `status` is `'active'` or `'trialing'`; `currentPeriodEnd` = next renewal. */
|
|
69
|
+
get: (subscriptionId: string) => Promise<{
|
|
70
|
+
id: string;
|
|
71
|
+
status: "active" | "paused" | "unpaid" | "incomplete" | "incomplete_expired" | "trialing" | "past_due" | "canceled";
|
|
72
|
+
customerId: string;
|
|
73
|
+
cancelAtPeriodEnd: boolean;
|
|
74
|
+
currentPeriodEnd: string | null;
|
|
75
|
+
canceledAt: string | null;
|
|
76
|
+
metadata: Record<string, string>;
|
|
77
|
+
}>;
|
|
78
|
+
/** `cancelAtPeriodEnd: true` ends it when the paid period ends (access until then); `false` resumes it. */
|
|
79
|
+
update: (subscriptionId: string, input: SubscriptionUpdateInput) => Promise<{
|
|
80
|
+
id: string;
|
|
81
|
+
status: "active" | "paused" | "unpaid" | "incomplete" | "incomplete_expired" | "trialing" | "past_due" | "canceled";
|
|
82
|
+
customerId: string;
|
|
83
|
+
cancelAtPeriodEnd: boolean;
|
|
84
|
+
currentPeriodEnd: string | null;
|
|
85
|
+
canceledAt: string | null;
|
|
86
|
+
metadata: Record<string, string>;
|
|
87
|
+
}>;
|
|
88
|
+
/** Cancel now: no more charges, `status: 'canceled'` at once. */
|
|
89
|
+
cancel: (subscriptionId: string) => Promise<{
|
|
90
|
+
id: string;
|
|
91
|
+
status: "active" | "paused" | "unpaid" | "incomplete" | "incomplete_expired" | "trialing" | "past_due" | "canceled";
|
|
92
|
+
customerId: string;
|
|
93
|
+
cancelAtPeriodEnd: boolean;
|
|
94
|
+
currentPeriodEnd: string | null;
|
|
95
|
+
canceledAt: string | null;
|
|
96
|
+
metadata: Record<string, string>;
|
|
97
|
+
}>;
|
|
98
|
+
};
|
|
60
99
|
refunds: {
|
|
61
100
|
/** Refund a payment (all of it, or `amount` in the smallest unit). */
|
|
62
101
|
create: (input: RefundInput) => Promise<{
|
|
@@ -69,5 +108,5 @@ declare function totalumPayments(options?: TotalumClientOptions): {
|
|
|
69
108
|
};
|
|
70
109
|
type TotalumPayments = ReturnType<typeof totalumPayments>;
|
|
71
110
|
|
|
72
|
-
export { CheckoutInput, CustomerPortalLinkInput, OnboardingLinkInput, RefundInput, TotalumClientOptions, totalumPayments };
|
|
111
|
+
export { CheckoutInput, CustomerPortalLinkInput, OnboardingLinkInput, RefundInput, SubscriptionUpdateInput, TotalumClientOptions, totalumPayments };
|
|
73
112
|
export type { TotalumPayments };
|
package/dist/payments/index.js
CHANGED
|
@@ -13,15 +13,28 @@ export function totalumPayments(options = {}) {
|
|
|
13
13
|
getStatus: () => call('GET', '/v1/payments/status'),
|
|
14
14
|
/** Stripe's hosted onboarding for the project owner (single use; never for the agent's sandbox key). */
|
|
15
15
|
onboardingLink: (input) => call('POST', '/v1/payments/onboarding-link', input),
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* A hosted Checkout Session: `payment`, `subscription`, or `setup` (save a card for later). Redirect to `url`. A
|
|
18
|
+
* subscription needs a recurring price: an inline item with `recurring: { interval: 'month' }`, or a `priceId`;
|
|
19
|
+
* its `metadata` is also set on the subscription.
|
|
20
|
+
*/
|
|
17
21
|
createCheckout: (input) => call('POST', '/v1/payments/checkout', input),
|
|
18
22
|
/**
|
|
19
23
|
* A Checkout Session read back (`paymentStatus: 'paid'`, your `metadata`): the page Stripe returns the buyer to
|
|
20
|
-
* (`successUrl` with `?session_id={CHECKOUT_SESSION_ID}`) confirms the payment with it — no webhook needed.
|
|
24
|
+
* (`successUrl` with `?session_id={CHECKOUT_SESSION_ID}`) confirms the payment with it — no webhook needed. A
|
|
25
|
+
* subscription checkout also gives `subscriptionId` and `customerId`: store both on the member.
|
|
21
26
|
*/
|
|
22
27
|
getCheckout: (sessionId) => call('GET', `/v1/payments/checkout/${encodeURIComponent(sessionId)}`),
|
|
23
28
|
/** Stripe's hosted portal where a customer manages their subscriptions and saved cards. */
|
|
24
29
|
customerPortalLink: (input) => call('POST', '/v1/payments/customer-portal-link', input),
|
|
30
|
+
subscriptions: {
|
|
31
|
+
/** A subscription: access while `status` is `'active'` or `'trialing'`; `currentPeriodEnd` = next renewal. */
|
|
32
|
+
get: (subscriptionId) => call('GET', `/v1/payments/subscriptions/${encodeURIComponent(subscriptionId)}`),
|
|
33
|
+
/** `cancelAtPeriodEnd: true` ends it when the paid period ends (access until then); `false` resumes it. */
|
|
34
|
+
update: (subscriptionId, input) => call('PATCH', `/v1/payments/subscriptions/${encodeURIComponent(subscriptionId)}`, input),
|
|
35
|
+
/** Cancel now: no more charges, `status: 'canceled'` at once. */
|
|
36
|
+
cancel: (subscriptionId) => call('DELETE', `/v1/payments/subscriptions/${encodeURIComponent(subscriptionId)}`),
|
|
37
|
+
},
|
|
25
38
|
refunds: {
|
|
26
39
|
/** Refund a payment (all of it, or `amount` in the smallest unit). */
|
|
27
40
|
create: (input) => call('POST', '/v1/payments/refunds', input),
|
package/dist/pdf/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as PdfFromHtmlInput, r as PdfFromUrlInput } from '../_types/integrations.d-
|
|
2
|
-
export { s as PdfOutput } 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 { q as PdfFromHtmlInput, r as PdfFromUrlInput } from '../_types/integrations.d-DG5LLFMq.js';
|
|
2
|
+
export { s as PdfOutput } from '../_types/integrations.d-DG5LLFMq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.js';
|
|
6
6
|
|
|
7
7
|
/** `totalum.pdf` (plan 04 §5.5) over `/v1/pdf/*` (scope `files:write`): a new file in the project's storage each time. */
|
|
8
8
|
declare function totalumPdf(options?: TotalumClientOptions): {
|
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-BQCXEk1O.js';
|
|
2
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.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<{
|
|
@@ -57,7 +57,13 @@ type RealtimePublishOutput = output<typeof RealtimePublishOutput>;
|
|
|
57
57
|
/**
|
|
58
58
|
* `totalum.realtime` server side (plan 05 §6.14.1) over SDK-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
|
-
* `wss://` `url` and never holds a key.
|
|
60
|
+
* `wss://` `url` and never holds a key.
|
|
61
|
+
*
|
|
62
|
+
* A room is billed in credits for each minute it is awake and for each message it receives, never per connection: a
|
|
63
|
+
* chat costs almost nothing, a busy game pays for its messages. A connection may send 120 messages a minute on the
|
|
64
|
+
* Free plan, 600 on Starter, 1,200 on Builder, 1,800 on Professional and 3,600 on Enterprise; the next one closes its
|
|
65
|
+
* socket with code 4429 (`REALTIME_MESSAGE_RATE_EXCEEDED`). Keep one room under about 1,000 messages a second in
|
|
66
|
+
* total: give each match or table its own room.
|
|
61
67
|
*/
|
|
62
68
|
declare function totalumRealtime(options?: TotalumClientOptions): {
|
|
63
69
|
/**
|
package/dist/realtime/index.js
CHANGED
|
@@ -3,7 +3,13 @@ export { TotalumError, isTotalumError } from '../errors.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* `totalum.realtime` server side (plan 05 §6.14.1) over SDK-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
|
-
* `wss://` `url` and never holds a key.
|
|
6
|
+
* `wss://` `url` and never holds a key.
|
|
7
|
+
*
|
|
8
|
+
* A room is billed in credits for each minute it is awake and for each message it receives, never per connection: a
|
|
9
|
+
* chat costs almost nothing, a busy game pays for its messages. A connection may send 120 messages a minute on the
|
|
10
|
+
* Free plan, 600 on Starter, 1,200 on Builder, 1,800 on Professional and 3,600 on Enterprise; the next one closes its
|
|
11
|
+
* socket with code 4429 (`REALTIME_MESSAGE_RATE_EXCEEDED`). Keep one room under about 1,000 messages a second in
|
|
12
|
+
* total: give each match or table its own room.
|
|
7
13
|
*/
|
|
8
14
|
export function totalumRealtime(options = {}) {
|
|
9
15
|
const call = jsonClient(options);
|
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 { 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-DG5LLFMq.js';
|
|
2
|
+
export { v as ScanOcrOutput } from '../_types/integrations.d-DG5LLFMq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The v1 scan result: the extracted fields (one set per page with `processEveryPdfPageAsDifferentScan`), the v1
|
package/dist/seo/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-DG5LLFMq.js';
|
|
2
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
3
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
import '../_types/coerce.d-BsPi0zYd.js';
|
|
5
5
|
|
|
6
6
|
/** `totalum.seo` (plan 05 §6.10) over SDK-API `/v1/seo/*` (scope `seo`): IndexNow for verified custom domains, free. */
|
|
7
7
|
declare function totalumSeo(options?: TotalumClientOptions): {
|
package/dist/speech/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as TranscribeInput, A as SpeakInput, B as StoredMedia } from '../_types/integrations.d-
|
|
2
|
-
export {
|
|
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 { T as TranscribeInput, A as SpeakInput, B as StoredMedia } from '../_types/integrations.d-DG5LLFMq.js';
|
|
2
|
+
export { H as TranscribeOutput } from '../_types/integrations.d-DG5LLFMq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.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 {
|
package/dist/vectors/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as ZodObject, d as ZodString, c as ZodOptional, e as ZodArray, k as ZodNumber, f as ZodEnum, h as ZodRecord, n as ZodUnion, j as ZodBoolean, m as $strip, o as output, l as ZodInt, q as $partial, x as $strict, T as TotalumClientOptions } from '../_types/errors.d-
|
|
2
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
1
|
+
import { Z as ZodObject, d as ZodString, c as ZodOptional, e as ZodArray, k as ZodNumber, f as ZodEnum, h as ZodRecord, n as ZodUnion, j as ZodBoolean, m as $strip, o as output, l as ZodInt, q as $partial, x as $strict, T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
2
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.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<{
|
|
@@ -103,7 +103,11 @@ type VectorRecord = output<typeof VectorRecord>;
|
|
|
103
103
|
* metadata keys `source`, `type`, `tag`, `group` (strings) and `page` (number).
|
|
104
104
|
*/
|
|
105
105
|
declare function totalumVectors(options?: TotalumClientOptions): {
|
|
106
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Inserts or replaces up to 100 vectors (≤ 8 images) from `values`, `text` or `image`, with optional metadata.
|
|
108
|
+
* The answer (and `count()`) means stored; `query` and `get` see the write later — often seconds, sometimes 10+
|
|
109
|
+
* minutes (the index applies writes asynchronously). Never wait or poll for a write to become searchable.
|
|
110
|
+
*/
|
|
107
111
|
upsert: (vectors: VectorUpsertItem[]) => Promise<Omit<{
|
|
108
112
|
upserted: number;
|
|
109
113
|
count: number;
|
|
@@ -130,7 +134,7 @@ declare function totalumVectors(options?: TotalumClientOptions): {
|
|
|
130
134
|
credits: number;
|
|
131
135
|
};
|
|
132
136
|
}>;
|
|
133
|
-
/** The stored vectors (values and metadata) of up to 100 ids; unknown ids are left out. */
|
|
137
|
+
/** The stored vectors (values and metadata) of up to 100 ids; unknown and just-written ids are left out. */
|
|
134
138
|
get: (ids: string[]) => Promise<{
|
|
135
139
|
id: string;
|
|
136
140
|
space: "text" | "image";
|
package/dist/vectors/index.js
CHANGED
|
@@ -12,13 +12,17 @@ export function totalumVectors(options = {}) {
|
|
|
12
12
|
const call = envelopeClient(options);
|
|
13
13
|
const data = jsonClient(options);
|
|
14
14
|
return {
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Inserts or replaces up to 100 vectors (≤ 8 images) from `values`, `text` or `image`, with optional metadata.
|
|
17
|
+
* The answer (and `count()`) means stored; `query` and `get` see the write later — often seconds, sometimes 10+
|
|
18
|
+
* minutes (the index applies writes asynchronously). Never wait or poll for a write to become searchable.
|
|
19
|
+
*/
|
|
16
20
|
upsert: async (vectors) => withUsage(await call('POST', '/v1/vectors/upsert', {
|
|
17
21
|
vectors,
|
|
18
22
|
})),
|
|
19
23
|
/** The `topK` (≤ 50, default 5) closest vectors to `text`, `values` or `image`, with their metadata. */
|
|
20
24
|
query: async (input) => withUsage(await call('POST', '/v1/vectors/query', input)),
|
|
21
|
-
/** The stored vectors (values and metadata) of up to 100 ids; unknown ids are left out. */
|
|
25
|
+
/** The stored vectors (values and metadata) of up to 100 ids; unknown and just-written ids are left out. */
|
|
22
26
|
get: async (ids) => (await data('POST', '/v1/vectors/get', { ids })).vectors,
|
|
23
27
|
/** Deletes up to 1,000 ids; answers how many existed and how many are left. */
|
|
24
28
|
delete: async (ids) => withUsage(await call('POST', '/v1/vectors/delete', { ids })),
|
package/dist/web/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { J as JobCreated, x as ScreenshotOutput, W as WebJob,
|
|
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 { L as WebScrapeInput, M as WebSearchInput, N as WebMapInput, Q as WebCrawlInput, w as ScreenshotInput } from '../_types/integrations.d-DG5LLFMq.js';
|
|
2
|
+
export { J as JobCreated, x as ScreenshotOutput, W as WebJob, I as WebScrapeOutput, K as WebSearchOutput } from '../_types/integrations.d-DG5LLFMq.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
|
+
import '../_types/coerce.d-BsPi0zYd.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* `totalum.web` (plan 05 §6.2) over SDK-API `/v1/web/*` (scope `web`): Firecrawl scrape/search/map/crawl and Browser
|
package/dist/webhooks/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as WebhookEvent } from '../_types/billing.d-
|
|
2
|
-
export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-
|
|
3
|
-
import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-
|
|
4
|
-
export { b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
1
|
+
import { a as WebhookEvent } from '../_types/billing.d-D4xsKzBh.js';
|
|
2
|
+
export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-D4xsKzBh.js';
|
|
3
|
+
import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
4
|
+
export { b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-BQCXEk1O.js';
|
|
5
5
|
|
|
6
6
|
/** A webhook refusal (plan 05 §7.2): the codes never travel, the app answers 400. */
|
|
7
7
|
declare class TotalumWebhookError extends TotalumError {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "totalum-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.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",
|