totalum-sdk 0.1.0-dev.13 → 0.1.0-dev.14
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/{billing.d-B85Ll6tb.d.ts → billing.d-BcRcDH4Y.d.ts} +1 -1
- package/dist/_types/{coerce.d-o2vQHoho.d.ts → coerce.d-BXj_o-j6.d.ts} +1 -1
- package/dist/_types/{errors.d-By9SsgZX.d.ts → errors.d-Dtt-BIwJ.d.ts} +24 -2
- package/dist/_types/{integrations.d-DH0xUdPA.d.ts → integrations.d-DjOeFaYn.d.ts} +2 -2
- package/dist/_types/{ops.d-EKzQhzOB.d.ts → ops.d-BKBWL6Qf.d.ts} +2 -2
- package/dist/ai/index.d.ts +19 -9
- package/dist/ai/index.js +7 -5
- package/dist/analytics/index.d.ts +4 -4
- package/dist/browser/index.d.ts +37 -4
- package/dist/cron/index.d.ts +5 -5
- package/dist/d1/index.d.ts +2 -2
- package/dist/email/index.d.ts +5 -5
- package/dist/files/index.d.ts +4 -4
- package/dist/index.d.ts +10 -7
- package/dist/index.js +3 -0
- package/dist/logs/index.d.ts +5 -5
- package/dist/payments/index.d.ts +5 -5
- package/dist/pdf/index.d.ts +5 -5
- package/dist/realtime/index.d.ts +2 -2
- 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 +167 -0
- package/dist/vectors/index.js +28 -0
- package/dist/web/index.d.ts +5 -5
- package/dist/webhooks/index.d.ts +4 -4
- package/package.json +5 -1
- package/totalum-sdk.md +68 -11
package/dist/scan/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as ScanDocumentInput, s as ScanOcrInput } from '../_types/integrations.d-
|
|
2
|
-
export { t as ScanOcrOutput } from '../_types/integrations.d-
|
|
3
|
-
import { T as TotalumClientOptions } from '../_types/errors.d-
|
|
4
|
-
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-
|
|
5
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { S as ScanDocumentInput, s as ScanOcrInput } from '../_types/integrations.d-DjOeFaYn.js';
|
|
2
|
+
export { t as ScanOcrOutput } from '../_types/integrations.d-DjOeFaYn.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
4
|
+
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
5
|
+
import '../_types/coerce.d-BXj_o-j6.js';
|
|
6
6
|
|
|
7
7
|
/** The v1 scan result: the extracted fields (one set per page with `processEveryPdfPageAsDifferentScan`) + `metadata`. */
|
|
8
8
|
interface ScanDocumentResult {
|
package/dist/seo/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { w as SeoIndexNowKey, x as SeoNotifyOutput } from '../_types/integrations.d-
|
|
2
|
-
import { T as TotalumClientOptions } from '../_types/errors.d-
|
|
3
|
-
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-
|
|
4
|
-
import '../_types/coerce.d-
|
|
1
|
+
export { w as SeoIndexNowKey, x as SeoNotifyOutput } from '../_types/integrations.d-DjOeFaYn.js';
|
|
2
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
3
|
+
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
4
|
+
import '../_types/coerce.d-BXj_o-j6.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, y as SpeakInput, z as StoredMedia } from '../_types/integrations.d-
|
|
2
|
-
export { A as TranscribeOutput } from '../_types/integrations.d-
|
|
3
|
-
import { T as TotalumClientOptions } from '../_types/errors.d-
|
|
4
|
-
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-
|
|
5
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { T as TranscribeInput, y as SpeakInput, z as StoredMedia } from '../_types/integrations.d-DjOeFaYn.js';
|
|
2
|
+
export { A as TranscribeOutput } from '../_types/integrations.d-DjOeFaYn.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
4
|
+
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
5
|
+
import '../_types/coerce.d-BXj_o-j6.js';
|
|
6
6
|
|
|
7
7
|
/** `totalum.speech` (plan 05 §6.8) over `/v1/speech/*` (scope `speech`): OpenRouter speech through Totalum. */
|
|
8
8
|
/** The audio bytes of `synthesize` without `store`. */
|
|
@@ -0,0 +1,167 @@
|
|
|
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-Dtt-BIwJ.js';
|
|
2
|
+
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
3
|
+
|
|
4
|
+
/** `text` = the `embed` preset's space; `image` = the `embed-image` preset's text+image space. */
|
|
5
|
+
declare const VectorSpace: ZodEnum<{
|
|
6
|
+
text: "text";
|
|
7
|
+
image: "image";
|
|
8
|
+
}>;
|
|
9
|
+
type VectorSpace = output<typeof VectorSpace>;
|
|
10
|
+
/** ≤ 9 KiB as JSON (Vectorize keeps 10 KiB); keys starting with `_` are reserved. */
|
|
11
|
+
declare const VectorMetadata: ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>;
|
|
12
|
+
type VectorMetadata = output<typeof VectorMetadata>;
|
|
13
|
+
declare const VectorUpsertItem: ZodObject<{
|
|
14
|
+
id: ZodString;
|
|
15
|
+
values: ZodOptional<ZodArray<ZodNumber>>;
|
|
16
|
+
text: ZodOptional<ZodString>;
|
|
17
|
+
image: ZodOptional<ZodString>;
|
|
18
|
+
space: ZodOptional<ZodEnum<{
|
|
19
|
+
text: "text";
|
|
20
|
+
image: "image";
|
|
21
|
+
}>>;
|
|
22
|
+
metadata: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>>;
|
|
23
|
+
}, $strip>;
|
|
24
|
+
type VectorUpsertItem = output<typeof VectorUpsertItem>;
|
|
25
|
+
/** A Vectorize metadata filter on `VECTOR_FILTER_KEYS` only. */
|
|
26
|
+
declare const VectorFilter: ZodRecord<ZodEnum<{
|
|
27
|
+
type: "type";
|
|
28
|
+
source: "source";
|
|
29
|
+
page: "page";
|
|
30
|
+
tag: "tag";
|
|
31
|
+
group: "group";
|
|
32
|
+
}> & $partial, ZodUnion<readonly [ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>, ZodObject<{
|
|
33
|
+
$eq: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>;
|
|
34
|
+
$ne: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>;
|
|
35
|
+
$in: ZodOptional<ZodArray<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>>;
|
|
36
|
+
$nin: ZodOptional<ZodArray<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>>;
|
|
37
|
+
$lt: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
38
|
+
$lte: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
39
|
+
$gt: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
40
|
+
$gte: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
41
|
+
}, $strict>]>>;
|
|
42
|
+
type VectorFilter = output<typeof VectorFilter>;
|
|
43
|
+
/**
|
|
44
|
+
* `POST /v1/vectors/query`: one of `text`, `values` or `image`. `space: 'image'` searches the images (with `text`,
|
|
45
|
+
* the words are embedded by `embed-image`: image search by text); an `image` query is always in the image space.
|
|
46
|
+
*/
|
|
47
|
+
declare const VectorsQueryInput: ZodObject<{
|
|
48
|
+
text: ZodOptional<ZodString>;
|
|
49
|
+
values: ZodOptional<ZodArray<ZodNumber>>;
|
|
50
|
+
image: ZodOptional<ZodString>;
|
|
51
|
+
space: ZodOptional<ZodEnum<{
|
|
52
|
+
text: "text";
|
|
53
|
+
image: "image";
|
|
54
|
+
}>>;
|
|
55
|
+
topK: ZodOptional<ZodInt>;
|
|
56
|
+
filter: ZodOptional<ZodRecord<ZodEnum<{
|
|
57
|
+
type: "type";
|
|
58
|
+
source: "source";
|
|
59
|
+
page: "page";
|
|
60
|
+
tag: "tag";
|
|
61
|
+
group: "group";
|
|
62
|
+
}> & $partial, ZodUnion<readonly [ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>, ZodObject<{
|
|
63
|
+
$eq: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>;
|
|
64
|
+
$ne: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>;
|
|
65
|
+
$in: ZodOptional<ZodArray<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>>;
|
|
66
|
+
$nin: ZodOptional<ZodArray<ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>>;
|
|
67
|
+
$lt: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
68
|
+
$lte: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
69
|
+
$gt: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
70
|
+
$gte: ZodOptional<ZodUnion<readonly [ZodNumber, ZodString]>>;
|
|
71
|
+
}, $strict>]>>>;
|
|
72
|
+
includeValues: ZodOptional<ZodBoolean>;
|
|
73
|
+
}, $strip>;
|
|
74
|
+
type VectorsQueryInput = output<typeof VectorsQueryInput>;
|
|
75
|
+
declare const VectorMatch: ZodObject<{
|
|
76
|
+
id: ZodString;
|
|
77
|
+
score: ZodNumber;
|
|
78
|
+
space: ZodEnum<{
|
|
79
|
+
text: "text";
|
|
80
|
+
image: "image";
|
|
81
|
+
}>;
|
|
82
|
+
metadata: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>>;
|
|
83
|
+
values: ZodOptional<ZodArray<ZodNumber>>;
|
|
84
|
+
}, $strip>;
|
|
85
|
+
type VectorMatch = output<typeof VectorMatch>;
|
|
86
|
+
declare const VectorRecord: ZodObject<{
|
|
87
|
+
id: ZodString;
|
|
88
|
+
space: ZodEnum<{
|
|
89
|
+
text: "text";
|
|
90
|
+
image: "image";
|
|
91
|
+
}>;
|
|
92
|
+
values: ZodArray<ZodNumber>;
|
|
93
|
+
metadata: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>>;
|
|
94
|
+
}, $strip>;
|
|
95
|
+
type VectorRecord = output<typeof VectorRecord>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* `totalum.vectors` over `/v1/vectors/*` (scope `vectors`; server-side code only: it needs the project key). Every
|
|
99
|
+
* project environment has its own private vector store: ids, namespaces and indexes are Totalum's, never yours to
|
|
100
|
+
* name, and `x-totalum-env` (the `env` option) keeps dev and live apart. Vectors are 1,024 numbers; `text` is
|
|
101
|
+
* embedded with the `embed` model and `image` (a project file key, a files URL, an https URL or a data URL) with the
|
|
102
|
+
* `embed-image` model, whose space also embeds text: search images by words with `space: 'image'`. Filter on the
|
|
103
|
+
* metadata keys `source`, `type`, `tag`, `group` (strings) and `page` (number).
|
|
104
|
+
*/
|
|
105
|
+
declare function totalumVectors(options?: TotalumClientOptions): {
|
|
106
|
+
/** Inserts or replaces up to 100 vectors (≤ 8 images) from `values`, `text` or `image`, with optional metadata. */
|
|
107
|
+
upsert: (vectors: VectorUpsertItem[]) => Promise<Omit<{
|
|
108
|
+
upserted: number;
|
|
109
|
+
count: number;
|
|
110
|
+
usage: {
|
|
111
|
+
credits: number;
|
|
112
|
+
vendor?: string | undefined;
|
|
113
|
+
units?: number | undefined;
|
|
114
|
+
vendorCostUsd?: number | undefined;
|
|
115
|
+
};
|
|
116
|
+
}, "usage"> & {
|
|
117
|
+
usage: {
|
|
118
|
+
vendor?: string | undefined;
|
|
119
|
+
units?: number | undefined;
|
|
120
|
+
credits: number;
|
|
121
|
+
};
|
|
122
|
+
}>;
|
|
123
|
+
/** The `topK` (≤ 50, default 5) closest vectors to `text`, `values` or `image`, with their metadata. */
|
|
124
|
+
query: (input: VectorsQueryInput) => Promise<{
|
|
125
|
+
matches: VectorMatch[];
|
|
126
|
+
} & {
|
|
127
|
+
usage: {
|
|
128
|
+
vendor?: string | undefined;
|
|
129
|
+
units?: number | undefined;
|
|
130
|
+
credits: number;
|
|
131
|
+
};
|
|
132
|
+
}>;
|
|
133
|
+
/** The stored vectors (values and metadata) of up to 100 ids; unknown ids are left out. */
|
|
134
|
+
get: (ids: string[]) => Promise<{
|
|
135
|
+
id: string;
|
|
136
|
+
space: "text" | "image";
|
|
137
|
+
values: number[];
|
|
138
|
+
metadata?: Record<string, string | number | boolean | string[]> | undefined;
|
|
139
|
+
}[]>;
|
|
140
|
+
/** Deletes up to 1,000 ids; answers how many existed and how many are left. */
|
|
141
|
+
delete: (ids: string[]) => Promise<Omit<{
|
|
142
|
+
deleted: number;
|
|
143
|
+
count: number;
|
|
144
|
+
usage: {
|
|
145
|
+
credits: number;
|
|
146
|
+
vendor?: string | undefined;
|
|
147
|
+
units?: number | undefined;
|
|
148
|
+
vendorCostUsd?: number | undefined;
|
|
149
|
+
};
|
|
150
|
+
}, "usage"> & {
|
|
151
|
+
usage: {
|
|
152
|
+
vendor?: string | undefined;
|
|
153
|
+
units?: number | undefined;
|
|
154
|
+
credits: number;
|
|
155
|
+
};
|
|
156
|
+
}>;
|
|
157
|
+
/** How many vectors this environment stores (free). */
|
|
158
|
+
count: () => Promise<{
|
|
159
|
+
count: number;
|
|
160
|
+
text: number;
|
|
161
|
+
image: number;
|
|
162
|
+
}>;
|
|
163
|
+
};
|
|
164
|
+
type TotalumVectors = ReturnType<typeof totalumVectors>;
|
|
165
|
+
|
|
166
|
+
export { TotalumClientOptions, VectorFilter, VectorMatch, VectorMetadata, VectorRecord, VectorSpace, VectorUpsertItem, VectorsQueryInput, totalumVectors };
|
|
167
|
+
export type { TotalumVectors };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { envelopeClient, jsonClient, withUsage } from '../http.js';
|
|
2
|
+
export { TotalumError, isTotalumError } from '../errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* `totalum.vectors` over `/v1/vectors/*` (scope `vectors`; server-side code only: it needs the project key). Every
|
|
5
|
+
* project environment has its own private vector store: ids, namespaces and indexes are Totalum's, never yours to
|
|
6
|
+
* name, and `x-totalum-env` (the `env` option) keeps dev and live apart. Vectors are 1,024 numbers; `text` is
|
|
7
|
+
* embedded with the `embed` model and `image` (a project file key, a files URL, an https URL or a data URL) with the
|
|
8
|
+
* `embed-image` model, whose space also embeds text: search images by words with `space: 'image'`. Filter on the
|
|
9
|
+
* metadata keys `source`, `type`, `tag`, `group` (strings) and `page` (number).
|
|
10
|
+
*/
|
|
11
|
+
export function totalumVectors(options = {}) {
|
|
12
|
+
const call = envelopeClient(options);
|
|
13
|
+
const data = jsonClient(options);
|
|
14
|
+
return {
|
|
15
|
+
/** Inserts or replaces up to 100 vectors (≤ 8 images) from `values`, `text` or `image`, with optional metadata. */
|
|
16
|
+
upsert: async (vectors) => withUsage(await call('POST', '/v1/vectors/upsert', {
|
|
17
|
+
vectors,
|
|
18
|
+
})),
|
|
19
|
+
/** The `topK` (≤ 50, default 5) closest vectors to `text`, `values` or `image`, with their metadata. */
|
|
20
|
+
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. */
|
|
22
|
+
get: async (ids) => (await data('POST', '/v1/vectors/get', { ids })).vectors,
|
|
23
|
+
/** Deletes up to 1,000 ids; answers how many existed and how many are left. */
|
|
24
|
+
delete: async (ids) => withUsage(await call('POST', '/v1/vectors/delete', { ids })),
|
|
25
|
+
/** How many vectors this environment stores (free). */
|
|
26
|
+
count: () => data('GET', '/v1/vectors/count'),
|
|
27
|
+
};
|
|
28
|
+
}
|
package/dist/web/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { G as WebScrapeInput, H as WebSearchInput, I as WebMapInput, K as WebCrawlInput, u as ScreenshotInput } from '../_types/integrations.d-
|
|
2
|
-
export { J as JobCreated, v as ScreenshotOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from '../_types/integrations.d-
|
|
3
|
-
import { T as TotalumClientOptions } from '../_types/errors.d-
|
|
4
|
-
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-
|
|
5
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { G as WebScrapeInput, H as WebSearchInput, I as WebMapInput, K as WebCrawlInput, u as ScreenshotInput } from '../_types/integrations.d-DjOeFaYn.js';
|
|
2
|
+
export { J as JobCreated, v as ScreenshotOutput, W as WebJob, B as WebScrapeOutput, D as WebSearchOutput } from '../_types/integrations.d-DjOeFaYn.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
4
|
+
export { a as TotalumError, i as isTotalumError } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
5
|
+
import '../_types/coerce.d-BXj_o-j6.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 { i as isTotalumError } from '../_types/errors.d-
|
|
1
|
+
import { a as WebhookEvent } from '../_types/billing.d-BcRcDH4Y.js';
|
|
2
|
+
export { W as WebhookConfig, b as WebhookSecretOutput } from '../_types/billing.d-BcRcDH4Y.js';
|
|
3
|
+
import { T as TotalumClientOptions, a as TotalumError } from '../_types/errors.d-Dtt-BIwJ.js';
|
|
4
|
+
export { i as isTotalumError } from '../_types/errors.d-Dtt-BIwJ.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": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.14",
|
|
4
4
|
"description": "The SDK generated Totalum apps import: every integration namespace over SDK-API (totalum-sdk, or one subpath each: /files, /ai, /web, …) and totalum-sdk/d1, the D1 driver",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -45,6 +45,10 @@
|
|
|
45
45
|
"types": "./dist/scan/index.d.ts",
|
|
46
46
|
"default": "./dist/scan/index.js"
|
|
47
47
|
},
|
|
48
|
+
"./vectors": {
|
|
49
|
+
"types": "./dist/vectors/index.d.ts",
|
|
50
|
+
"default": "./dist/vectors/index.js"
|
|
51
|
+
},
|
|
48
52
|
"./speech": {
|
|
49
53
|
"types": "./dist/speech/index.d.ts",
|
|
50
54
|
"default": "./dist/speech/index.js"
|