totalum-sdk 0.1.0-dev.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/_types/{billing.d-C1exPLN6.d.ts → billing.d-BcRcDH4Y.d.ts} +1 -1
  3. package/dist/_types/{coerce.d-RtY2zQyw.d.ts → coerce.d-BXj_o-j6.d.ts} +1 -1
  4. package/dist/_types/{errors.d-yrue1e9O.d.ts → errors.d-Dtt-BIwJ.d.ts} +62 -2
  5. package/dist/_types/{integrations.d-BKPWost0.d.ts → integrations.d-DjOeFaYn.d.ts} +2 -2
  6. package/dist/_types/{ops.d-BOMT9yln.d.ts → ops.d-BKBWL6Qf.d.ts} +2 -2
  7. package/dist/ai/index.d.ts +42 -26
  8. package/dist/ai/index.js +13 -9
  9. package/dist/analytics/index.d.ts +4 -4
  10. package/dist/browser/index.d.ts +114 -5
  11. package/dist/browser/index.js +22 -5
  12. package/dist/cron/index.d.ts +5 -5
  13. package/dist/cron/index.js +2 -10
  14. package/dist/d1/index.d.ts +6 -4
  15. package/dist/d1/lazy.js +21 -3
  16. package/dist/d1/session.js +83 -15
  17. package/dist/deprecate.js +16 -0
  18. package/dist/email/index.d.ts +12 -6
  19. package/dist/email/index.js +4 -3
  20. package/dist/files/index.d.ts +11 -9
  21. package/dist/files/index.js +10 -5
  22. package/dist/index.d.ts +11 -8
  23. package/dist/index.js +3 -0
  24. package/dist/logs/index.d.ts +5 -5
  25. package/dist/payments/index.d.ts +5 -5
  26. package/dist/pdf/index.d.ts +5 -5
  27. package/dist/react/index.d.ts +91 -0
  28. package/dist/react/index.js +178 -0
  29. package/dist/realtime/index.d.ts +2 -2
  30. package/dist/scan/index.d.ts +14 -6
  31. package/dist/scan/index.js +5 -1
  32. package/dist/seo/index.d.ts +4 -4
  33. package/dist/speech/index.d.ts +26 -13
  34. package/dist/speech/index.js +24 -12
  35. package/dist/vectors/index.d.ts +167 -0
  36. package/dist/vectors/index.js +28 -0
  37. package/dist/web/index.d.ts +6 -6
  38. package/dist/web/index.js +1 -1
  39. package/dist/webhooks/index.d.ts +4 -4
  40. package/package.json +24 -4
  41. package/totalum-sdk.md +152 -24
  42. package/totalum-sdk.signatures.json +313 -0
@@ -0,0 +1,313 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "methods": [
4
+ {
5
+ "call": "totalum.files.upload(input, { name?, contentType?, private?, folder? })",
6
+ "returns": "{ key, fileName, fileSize, contentType, fileUrl, visibility: 'public-by-link' | 'private', createdAt, etag?, storageClass?: 'Standard' | 'InfrequentAccess', name?, url?, size?, id?, fileNameId? }"
7
+ },
8
+ {
9
+ "call": "totalum.files.getUploadUrl({ name, contentType, size, folder?, private? })",
10
+ "returns": "{ uploadUrl, key, headers, expiresAt }"
11
+ },
12
+ {
13
+ "call": "totalum.files.complete(key)",
14
+ "returns": "{ key, fileName, fileSize, contentType, fileUrl, visibility: 'public-by-link' | 'private', createdAt, etag?, storageClass?: 'Standard' | 'InfrequentAccess', name?, url?, size?, id?, fileNameId? }"
15
+ },
16
+ {
17
+ "call": "totalum.files.list({ name?, folder?, type?, createdFrom?, createdTo?, sizeFrom?, sizeTo?, cursor?, limit? })",
18
+ "returns": "{ items, nextCursor, totalBytes, fileCount }"
19
+ },
20
+ {
21
+ "call": "totalum.files.get(key)",
22
+ "returns": "{ key, fileName, fileSize, contentType, fileUrl, visibility: 'public-by-link' | 'private', createdAt, etag?, storageClass?: 'Standard' | 'InfrequentAccess', name?, url?, size?, id?, fileNameId? }"
23
+ },
24
+ {
25
+ "call": "totalum.files.getSignedUrl(key, { expiresInSeconds?, download? })",
26
+ "returns": "string"
27
+ },
28
+ {
29
+ "call": "totalum.files.getDownloadUrl(key, { expiresInSeconds?, download? })",
30
+ "returns": "string",
31
+ "deprecated": true
32
+ },
33
+ {
34
+ "call": "totalum.files.presign(keys, { expiresInSeconds?, download? })",
35
+ "returns": "Record<string, string>"
36
+ },
37
+ {
38
+ "call": "totalum.files.delete(keys)",
39
+ "returns": "—"
40
+ },
41
+ {
42
+ "call": "totalum.files.stream(key, { range? })",
43
+ "returns": "Response"
44
+ },
45
+ {
46
+ "call": "totalum.files.url(key)",
47
+ "returns": "string"
48
+ },
49
+ {
50
+ "call": "totalum.payments.getStatus()",
51
+ "returns": "{ enabled, mode: 'connect' | 'own_key', accountId, livemode, chargesEnabled, payoutsEnabled, detailsSubmitted, requirements, applicationFeeBps }"
52
+ },
53
+ {
54
+ "call": "totalum.payments.onboardingLink({ returnUrl, refreshUrl, type?: 'account_onboarding' | 'account_update', country? })",
55
+ "returns": "{ url, expiresAt }"
56
+ },
57
+ {
58
+ "call": "totalum.payments.createCheckout({ mode: 'payment' | 'subscription' | 'setup', successUrl, cancelUrl, lineItems?, currency?, customerEmail?, customerId?, metadata?, allowPromotionCodes?, automaticTax?, trialDays?, clientReferenceId? })",
59
+ "returns": "{ id, url }"
60
+ },
61
+ {
62
+ "call": "totalum.payments.customerPortalLink({ customerId, returnUrl })",
63
+ "returns": "{ url }"
64
+ },
65
+ {
66
+ "call": "totalum.webhooks.verify(rawBody, headers, secret?, now?)",
67
+ "returns": "{ id, type, createdAt, projectId, env: 'dev' | 'live', data, livemode? }"
68
+ },
69
+ {
70
+ "call": "totalum.webhooks.get()",
71
+ "returns": "{ url, enabled, secretPrefix }"
72
+ },
73
+ {
74
+ "call": "totalum.webhooks.setUrl(url)",
75
+ "returns": "{ url, enabled, secretPrefix }"
76
+ },
77
+ {
78
+ "call": "totalum.webhooks.rotateSecret()",
79
+ "returns": "{ secret }"
80
+ },
81
+ {
82
+ "call": "totalum.web.scrape(url, { formats?, onlyMainContent?, waitFor?, timeout?, proxy?: 'basic' | 'stealth' | 'auto', location?, actions?, schema?, prompt?, cacheMaxAgeMs? })",
83
+ "returns": "{ url, statusCode, metadata, usage, markdown?, html?, rawHtml?, links?, screenshotUrl?, json?, summary?, contentUrl? }"
84
+ },
85
+ {
86
+ "call": "totalum.web.search(query, { limit?, location?, sources?, timeRange?: 'day' | 'month' | 'week' | 'year', scrapeOptions? })",
87
+ "returns": "{ web, news?, images?, scraped?, usage }"
88
+ },
89
+ {
90
+ "call": "totalum.web.map(url, { limit?, search? })",
91
+ "returns": "{ links, usage }"
92
+ },
93
+ {
94
+ "call": "totalum.web.crawl(url, { limit?, scrapeOptions?, maxDepth?, includePaths?, excludePaths?, webhook? })",
95
+ "returns": "{ jobId, estimatedCredits? }"
96
+ },
97
+ {
98
+ "call": "totalum.web.crawlStatus(jobId)",
99
+ "returns": "{ jobId, status: 'completed' | 'queued' | 'running' | 'failed' | 'cancelled' | 'expired', total, completed, creditsUsed, data, next?, resultUrl? }"
100
+ },
101
+ {
102
+ "call": "totalum.web.cancelCrawl(jobId)",
103
+ "returns": "{ jobId, status: 'completed' | 'queued' | 'running' | 'failed' | 'cancelled' | 'expired', total, completed, creditsUsed, data, next?, resultUrl? }"
104
+ },
105
+ {
106
+ "call": "totalum.web.screenshot({ url?, html?, fullPage?, viewport?, format?: 'png' | 'jpeg' | 'webp', waitForSelector?, inline? })",
107
+ "returns": "{ key, url, format: 'png' | 'jpeg' | 'webp', base64?, usage }"
108
+ },
109
+ {
110
+ "call": "totalum.pdf.fromHtml({ name, html?, base64HtmlString?, options?, waitForSelector? })",
111
+ "returns": "{ url, fileName, key, usage }"
112
+ },
113
+ {
114
+ "call": "totalum.pdf.fromUrl({ url, name, options?, cookies?, headers? })",
115
+ "returns": "{ url, fileName, key, usage }"
116
+ },
117
+ {
118
+ "call": "totalum.scan.document({ properties, options?, fileName?, key?, url? })",
119
+ "returns": "{ data, metadata, usage }"
120
+ },
121
+ {
122
+ "call": "totalum.scan.ocr({ pages?, fileName?, key?, url? })",
123
+ "returns": "{ text, pages, fullDetails?, usage }"
124
+ },
125
+ {
126
+ "call": "totalum.vectors.upsert(vectors)",
127
+ "returns": "{ upserted, count, usage }"
128
+ },
129
+ {
130
+ "call": "totalum.vectors.query({ text?, values?, image?, space?: 'text' | 'image', topK?, filter?, includeValues? })",
131
+ "returns": "{ matches, usage }"
132
+ },
133
+ {
134
+ "call": "totalum.vectors.get(ids)",
135
+ "returns": "[{ id, space: 'text' | 'image', values, metadata? }]"
136
+ },
137
+ {
138
+ "call": "totalum.vectors.delete(ids)",
139
+ "returns": "{ count, deleted, usage }"
140
+ },
141
+ {
142
+ "call": "totalum.vectors.count()",
143
+ "returns": "{ count, text, image }"
144
+ },
145
+ {
146
+ "call": "totalum.speech.transcribe({ audioBase64?, filename?, url?, language?, model?: 'fast' | 'accurate', diarize?, timestamps?: 'word' | 'segment', keyterms? })",
147
+ "returns": "{ text, durationSec, usage, language?, segments?, words? }"
148
+ },
149
+ {
150
+ "call": "totalum.speech.synthesize({ text, voice?, language?, model?: 'standard' | 'premium', format?: 'mp3' | 'wav' | 'opus', speed?, store })",
151
+ "returns": "{ key, url, usage }"
152
+ },
153
+ {
154
+ "call": "totalum.speech.synthesize({ text, voice?, language?, model?: 'standard' | 'premium', format?: 'mp3' | 'wav' | 'opus', speed?, store? })",
155
+ "returns": "{ key, url, usage } | { audio, contentType, usage }"
156
+ },
157
+ {
158
+ "call": "totalum.ai.chat({ model?, messages, tools?, toolChoice?, parallelToolCalls?, responseFormat?, temperature?, maxTokens?, reasoning?, serverTools?, maxToolCalls?, cache?, zdr?, fastMode?, user? })",
159
+ "returns": "{ id, model, text, toolCalls, finishReason, usage, raw }"
160
+ },
161
+ {
162
+ "call": "totalum.ai.chat.stream({ model?, messages, tools?, toolChoice?, parallelToolCalls?, responseFormat?, temperature?, maxTokens?, reasoning?, serverTools?, maxToolCalls?, cache?, zdr?, fastMode?, user? })",
163
+ "returns": "{ raw, text, result }"
164
+ },
165
+ {
166
+ "call": "totalum.ai.generateObject({ schema, prompt?, messages?, model?, healing? })",
167
+ "returns": "{ object, usage }"
168
+ },
169
+ {
170
+ "call": "totalum.ai.classify({ input, options, model?, instructions? })",
171
+ "returns": "{ label }"
172
+ },
173
+ {
174
+ "call": "totalum.ai.embed({ input, model? })",
175
+ "returns": "{ embeddings, usage }"
176
+ },
177
+ {
178
+ "call": "totalum.ai.image.generate({ prompt, model?, aspectRatio?, resolution?: '1K' | '2K' | '4K' | '512', quality?, outputFormat?: 'png' | 'jpeg' | 'webp', background?, n?, references?, fileName?, store? })",
179
+ "returns": "{ images, usage, fileName?, imageUrl? }"
180
+ },
181
+ {
182
+ "call": "totalum.ai.image.edit({ prompt, images, mask?, fileName?, size?, quality?, outputFormat?: 'png' | 'jpeg' | 'webp', background?, inputFidelity? })",
183
+ "returns": "{ images, usage, fileName?, imageUrl? }"
184
+ },
185
+ {
186
+ "call": "totalum.ai.video.generate({ prompt, durationSec, model?, resolution?, aspectRatio?, firstFrame?, lastFrame?, references?, generateAudio?, seed?, webhook? })",
187
+ "returns": "{ jobId, status, estimatedCredits }"
188
+ },
189
+ {
190
+ "call": "totalum.ai.video.get(jobId)",
191
+ "returns": "{ jobId, status: 'completed' | 'queued' | 'running' | 'failed' | 'cancelled' | 'expired', progress?, video?, usage?, error? }"
192
+ },
193
+ {
194
+ "call": "totalum.ai.video.wait(jobId, { intervalMs?, timeoutMs? })",
195
+ "returns": "{ jobId, status: 'completed' | 'queued' | 'running' | 'failed' | 'cancelled' | 'expired', progress?, video?, usage?, error? }"
196
+ },
197
+ {
198
+ "call": "totalum.ai.vision.describe({ image, prompt?, model? })",
199
+ "returns": "{ text, usage }"
200
+ },
201
+ {
202
+ "call": "totalum.ai.speech.speak({ text, voice?, language?, model?: 'standard' | 'premium', format?: 'mp3' | 'wav' | 'opus', speed?, store })",
203
+ "returns": "{ key, url, usage }",
204
+ "deprecated": true
205
+ },
206
+ {
207
+ "call": "totalum.ai.speech.speak({ text, voice?, language?, model?: 'standard' | 'premium', format?: 'mp3' | 'wav' | 'opus', speed?, store? })",
208
+ "returns": "{ key, url, usage } | { audio, contentType, usage }",
209
+ "deprecated": true
210
+ },
211
+ {
212
+ "call": "totalum.ai.speech.transcribe({ audioBase64?, filename?, url?, language?, model?: 'fast' | 'accurate', diarize?, timestamps?: 'word' | 'segment', keyterms? })",
213
+ "returns": "{ text, durationSec, usage, language?, segments?, words? }",
214
+ "deprecated": true
215
+ },
216
+ {
217
+ "call": "totalum.ai.models.list()",
218
+ "returns": "{ presets, models, denylist? }"
219
+ },
220
+ {
221
+ "call": "totalum.ai.gatewayConfig()",
222
+ "returns": "{ baseURL, apiKey }"
223
+ },
224
+ {
225
+ "call": "totalum.email.send({ to, subject, html?, text?, from?, replyTo?, cc?, bcc?, headers?, attachments?, tags?, scheduledAt?, idempotencyKey?, bulk? })",
226
+ "returns": "{ success, message, messageId, id, status: 'queued' | 'sent', usage }"
227
+ },
228
+ {
229
+ "call": "totalum.email.get(id)",
230
+ "returns": "{ id, from, to, subject, status, lastEventAt, events }"
231
+ },
232
+ {
233
+ "call": "totalum.cron.create({ name, schedule, request, enabled?, description?, env?: 'dev' | 'live' })",
234
+ "returns": "{ id, name, schedule, request, enabled, status: 'active' | 'paused' | 'paused_failures', nextRunAt, createdAt, env: 'dev' | 'live', lastRun?, description? }"
235
+ },
236
+ {
237
+ "call": "totalum.cron.list()",
238
+ "returns": "[{ id, name, schedule, request, enabled, status: 'active' | 'paused' | 'paused_failures', nextRunAt, createdAt, env: 'dev' | 'live', lastRun?, description? }]"
239
+ },
240
+ {
241
+ "call": "totalum.cron.get(id)",
242
+ "returns": "{ id, name, schedule, request, enabled, status: 'active' | 'paused' | 'paused_failures', nextRunAt, createdAt, env: 'dev' | 'live', lastRun?, description? }"
243
+ },
244
+ {
245
+ "call": "totalum.cron.update(id, { name?, schedule?, request?, enabled?, description?, env?: 'dev' | 'live' })",
246
+ "returns": "{ id, name, schedule, request, enabled, status: 'active' | 'paused' | 'paused_failures', nextRunAt, createdAt, env: 'dev' | 'live', lastRun?, description? }"
247
+ },
248
+ {
249
+ "call": "totalum.cron.delete(id)",
250
+ "returns": "—"
251
+ },
252
+ {
253
+ "call": "totalum.cron.pause(id)",
254
+ "returns": "{ id, name, schedule, request, enabled, status: 'active' | 'paused' | 'paused_failures', nextRunAt, createdAt, env: 'dev' | 'live', lastRun?, description? }"
255
+ },
256
+ {
257
+ "call": "totalum.cron.resume(id)",
258
+ "returns": "{ id, name, schedule, request, enabled, status: 'active' | 'paused' | 'paused_failures', nextRunAt, createdAt, env: 'dev' | 'live', lastRun?, description? }"
259
+ },
260
+ {
261
+ "call": "totalum.cron.runs(id, { limit?, cursor? })",
262
+ "returns": "{ items, nextCursor }"
263
+ },
264
+ {
265
+ "call": "totalum.cron.trigger(id)",
266
+ "returns": "{ runId }"
267
+ },
268
+ {
269
+ "call": "totalum.seo.notifyChanged(urls)",
270
+ "returns": "{ accepted, indexNow: 'error' | 'sent' | 'skipped_no_custom_domain', sitemapsPinged }"
271
+ },
272
+ {
273
+ "call": "totalum.seo.indexNowKey()",
274
+ "returns": "{ key, keyLocation }"
275
+ },
276
+ {
277
+ "call": "totalum.browser.session({ proxy?, solveCaptchas?, captcha?, stealth?: 'basic' | 'off' | 'verified', fingerprintOs?: 'mobile' | 'windows' | 'mac' | 'linux' | 'tablet', timeoutMinutes?, keepAlive?, context?, contextId?, blockAds?, allowedDomains?, ignoreCertificateErrors?, caCertificateIds?, extensionId?, metadata?, logSession?, recordSession?, region?: 'eu' | 'us-west-2' | 'us-east-1' | 'eu-central-1' | 'ap-southeast-1' | 'us', locale?, timezone?, geolocation?, userAgent?, extraHeaders?, blockResources?, device?, captureDownloads?, viewport? })",
278
+ "returns": "BrowserSession"
279
+ },
280
+ {
281
+ "call": "totalum.browser.sessions.list({ status?, metadata?, limit?, cursor? })",
282
+ "returns": "{ items, nextCursor? }"
283
+ },
284
+ {
285
+ "call": "totalum.browser.sessions.get(id)",
286
+ "returns": "BrowserSession"
287
+ },
288
+ {
289
+ "call": "totalum.browser.programs.get(programId)",
290
+ "returns": "{ programId, sessionId, status: 'completed' | 'running' | 'failed' | 'pending' | 'timed_out', steps, vars, startedAt, credits, result?, endedAt? }"
291
+ },
292
+ {
293
+ "call": "totalum.browser.programs.wait(programId, { intervalMs?, timeoutMs? })",
294
+ "returns": "{ programId, sessionId, status: 'completed' | 'running' | 'failed' | 'pending' | 'timed_out', steps, vars, startedAt, credits, result?, endedAt? }"
295
+ },
296
+ {
297
+ "call": "totalum.realtime.ticket({ room, identity, permissions?, ttl? })",
298
+ "returns": "{ ticket, url, room, identity, permissions, expiresAt }"
299
+ },
300
+ {
301
+ "call": "totalum.realtime.publish(room, { data, event?, identity? })",
302
+ "returns": "{ messageId, at, connections }"
303
+ },
304
+ {
305
+ "call": "totalum.logs.query({ limit?, env?: 'dev' | 'live', requestId?, status?, source?: 'live' | 'auto' | 'buffer', to?, from?, level?: 'error' | 'log' | 'debug' | 'info' | 'warn', q?, path? })",
306
+ "returns": "{ items, window, nextCursor, sampled, hint? }"
307
+ },
308
+ {
309
+ "call": "totalum.analytics.site({ from?, to?, granularity?: 'day' | 'hour' | 'minute', metric?, dimension?, limit?, bots?: 'exclude' | 'include' | 'only', env?: 'dev' | 'live' })",
310
+ "returns": "{ window, source, approximate, cachedAt, series?, top? }"
311
+ }
312
+ ]
313
+ }