@sovaria/sdk 0.0.0-stage → 0.4.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.
@@ -0,0 +1,1227 @@
1
+ import type { JsonObject, JsonValue, RequestOptions } from './index.js';
2
+ type Request = <T>(method: string, path: string, options?: RequestOptions) => Promise<T>;
3
+ type Scope = () => {
4
+ orgId?: string;
5
+ projectId?: string;
6
+ envId?: string;
7
+ } | undefined;
8
+ /** Every Sovaria API operation, grouped by module. */
9
+ export declare function createGeneratedApi(request: Request, scope: Scope): {
10
+ attestation: {
11
+ /** App attestation settings, credentials (metadata only), debug tokens and the last 7 days. `GET /api/v1/projects/{project_id}/attestation` */
12
+ getConfig: (args?: {
13
+ projectId?: string;
14
+ }) => Promise<JsonValue>;
15
+ /** Set mode (off | monitor | enforce), tokenTtlSeconds, providers, playIntegrity, appAttest. `PUT /api/v1/projects/{project_id}/attestation` */
16
+ updateConfig: (args: {
17
+ projectId?: string;
18
+ body: JsonObject;
19
+ }) => Promise<JsonValue>;
20
+ /** Google service account for Play Integrity (encrypted, write-only). `PUT /api/v1/projects/{project_id}/attestation/credentials/google` */
21
+ setGoogleCredentials: (args: {
22
+ projectId?: string;
23
+ serviceAccount: JsonValue;
24
+ }) => Promise<JsonValue>;
25
+ /** Apple key with DeviceCheck enabled (encrypted, write-only). `PUT /api/v1/projects/{project_id}/attestation/credentials/apple` */
26
+ setAppleCredentials: (args: {
27
+ projectId?: string;
28
+ p8: JsonValue;
29
+ keyId: JsonValue;
30
+ teamId: JsonValue;
31
+ }) => Promise<JsonValue>;
32
+ /** Remove the google or apple attestation credentials. `DELETE /api/v1/projects/{project_id}/attestation/credentials/{which}` */
33
+ deleteCredentials: (args: {
34
+ projectId?: string;
35
+ which: string;
36
+ }) => Promise<JsonValue>;
37
+ /** Create a debug token for simulators and CI (shown once). `POST /api/v1/projects/{project_id}/attestation/debug-tokens` */
38
+ createDebugToken: (args?: {
39
+ projectId?: string;
40
+ name?: JsonValue;
41
+ }) => Promise<JsonValue>;
42
+ /** Delete a debug token. `DELETE /api/v1/projects/{project_id}/attestation/debug-tokens/{token_id}` */
43
+ deleteDebugToken: (args: {
44
+ projectId?: string;
45
+ tokenId: string;
46
+ }) => Promise<JsonValue>;
47
+ /** One-time challenge to bind attestation evidence to (anon key). `POST /api/v1/attest/challenge` */
48
+ challenge: () => Promise<JsonValue>;
49
+ /** Exchange Play Integrity / App Attest / DeviceCheck / debug evidence for an attestation token. `POST /api/v1/attest/exchange` */
50
+ exchange: (args: {
51
+ provider: JsonValue;
52
+ appId?: JsonValue;
53
+ challenge?: JsonValue;
54
+ token?: JsonValue;
55
+ keyId?: JsonValue;
56
+ attestation?: JsonValue;
57
+ assertion?: JsonValue;
58
+ development?: JsonValue;
59
+ }) => Promise<JsonValue>;
60
+ };
61
+ auth: {
62
+ /** Confirm an email verification token. `POST /api/v1/auth/verify-email/confirm` */
63
+ confirmVerificationEmail: (args: {
64
+ token: JsonValue;
65
+ }) => Promise<JsonValue>;
66
+ /** `DELETE /api/v1/auth/mfa` */
67
+ disableMfa: (args: {
68
+ totpCode: JsonValue;
69
+ }) => Promise<JsonValue>;
70
+ /** `POST /api/v1/auth/mfa/enroll` */
71
+ enrollMfa: () => Promise<JsonValue>;
72
+ /** `GET /api/v1/auth/mfa/status` */
73
+ getMfaStatus: () => Promise<JsonValue>;
74
+ /** `GET /api/v1/auth/providers/config` */
75
+ getProvidersConfig: () => Promise<JsonValue>;
76
+ /** `GET /api/v1/auth/sessions/config` */
77
+ getSessionsConfig: () => Promise<JsonValue>;
78
+ /** `GET /api/v1/auth/product-users` */
79
+ listConsoleProductUsers: () => Promise<JsonValue>;
80
+ /** `GET /api/v1/auth/sessions` */
81
+ listSessions: () => Promise<JsonValue>;
82
+ /** `POST /api/v1/auth/sessions/revoke-others` */
83
+ revokeOtherSessions: () => Promise<JsonValue>;
84
+ /** `DELETE /api/v1/auth/sessions/{session_id}` */
85
+ revokeSession: (args: {
86
+ sessionId: string;
87
+ }) => Promise<JsonValue>;
88
+ /** Trigger a verification email for the authenticated user. `POST /api/v1/auth/verify-email/send` */
89
+ sendVerificationEmail: () => Promise<JsonValue>;
90
+ /** `PUT /api/v1/auth/providers/config` */
91
+ updateProvidersConfig: (args: {
92
+ body: JsonObject;
93
+ }) => Promise<JsonValue>;
94
+ /** `PUT /api/v1/auth/sessions/config` */
95
+ updateSessionsConfig: (args: {
96
+ body: JsonObject;
97
+ }) => Promise<JsonValue>;
98
+ /** Devices the signed-in user is signed in on (current = this one). `GET /api/v1/auth/devices` */
99
+ listDevices: () => Promise<JsonValue>;
100
+ /** Sign one device out: its sessions end and push tokens are removed. `DELETE /api/v1/auth/devices/{device_id}` */
101
+ signOutDevice: (args: {
102
+ deviceId: string;
103
+ }) => Promise<JsonValue>;
104
+ };
105
+ billing: {
106
+ /** `POST /api/v1/invoices/{org_id}/build` */
107
+ buildInvoice: (args?: {
108
+ orgId?: string;
109
+ period?: JsonValue;
110
+ }) => Promise<JsonValue>;
111
+ /** `POST /api/v1/accounts/{account_id}/cancel` */
112
+ cancelAccount: (args: {
113
+ accountId: string;
114
+ }) => Promise<JsonValue>;
115
+ /** `POST /api/v1/billing/checkout` */
116
+ checkout: (args: {
117
+ body: JsonObject;
118
+ }) => Promise<JsonValue>;
119
+ /** `GET /api/v1/accounts/{account_id}` */
120
+ getAccount: (args: {
121
+ accountId: string;
122
+ }) => Promise<JsonValue>;
123
+ /** `GET /api/v1/billing/accounts/{account_id}/overage` */
124
+ getAccountOverage: (args: {
125
+ accountId: string;
126
+ }) => Promise<JsonValue>;
127
+ /** `GET /api/v1/billing/accounts/{account_id}/overage-prefs` */
128
+ getAccountOveragePrefs: (args: {
129
+ accountId: string;
130
+ }) => Promise<JsonValue>;
131
+ /** The org's overage switches (one setting for the whole org) `GET /api/v1/billing/orgs/{org_id}/overage-prefs` */
132
+ getOrgOveragePrefs: (args?: {
133
+ orgId?: string;
134
+ }) => Promise<JsonValue>;
135
+ /** `GET /api/v1/compute/{org_id}` */
136
+ getCompute: (args?: {
137
+ orgId?: string;
138
+ period?: JsonValue;
139
+ }) => Promise<JsonValue>;
140
+ /** `GET /api/v1/billing/fx` */
141
+ getFx: () => Promise<JsonValue>;
142
+ /** `GET /api/v1/billing/invoices/open` */
143
+ getOpenInvoice: () => Promise<JsonValue>;
144
+ /** `GET /api/v1/billing/overage/{org_id}` */
145
+ getOverage: (args?: {
146
+ orgId?: string;
147
+ }) => Promise<JsonValue>;
148
+ /** Fetch a billing plan by name. `GET /api/v1/plans/{name}` */
149
+ getPlan: (args: {
150
+ name: string;
151
+ }) => Promise<JsonValue>;
152
+ /** `GET /api/v1/billing/provider` */
153
+ getProvider: () => Promise<JsonValue>;
154
+ /** Fetch the active subscription for an organisation. `GET /api/v1/subscriptions/{org_id}` */
155
+ getSubscription: (args?: {
156
+ orgId?: string;
157
+ }) => Promise<JsonValue>;
158
+ /** Fetch usage counters for an organisation. `GET /api/v1/usage/{org_id}` */
159
+ getUsage: (args?: {
160
+ orgId?: string;
161
+ period?: JsonValue;
162
+ }) => Promise<JsonValue>;
163
+ /** Fetch historical usage for an organisation. `GET /api/v1/usage/{org_id}/history` */
164
+ getUsageHistory: (args?: {
165
+ orgId?: string;
166
+ months?: JsonValue;
167
+ }) => Promise<JsonValue>;
168
+ /** `GET /api/v1/invoices/{org_id}` */
169
+ listInvoices: (args?: {
170
+ orgId?: string;
171
+ }) => Promise<JsonValue>;
172
+ /** List public billing plans. `GET /api/v1/plans` */
173
+ listPlans: () => Promise<JsonValue>;
174
+ /** List subscriptions visible to the authenticated caller. `GET /api/v1/subscriptions` */
175
+ listSubscriptions: () => Promise<JsonValue>;
176
+ /** `POST /api/v1/billing/invoices/{org_id}/{period}/pay` */
177
+ payInvoice: (args: {
178
+ orgId?: string;
179
+ period: string;
180
+ }) => Promise<JsonValue>;
181
+ /** `POST /api/v1/billing/razorpay/create-order` */
182
+ razorpayCreateOrder: (args: {
183
+ body: JsonObject;
184
+ }) => Promise<JsonValue>;
185
+ /** `POST /api/v1/billing/razorpay/verify-payment` */
186
+ razorpayVerifyPayment: (args: {
187
+ body: JsonObject;
188
+ }) => Promise<JsonValue>;
189
+ /** `POST /api/v1/accounts/{account_id}/resume` */
190
+ resumeAccount: (args: {
191
+ accountId: string;
192
+ }) => Promise<JsonValue>;
193
+ /** `PUT /api/v1/billing/accounts/{account_id}/overage-prefs` */
194
+ setAccountOveragePrefs: (args: {
195
+ accountId: string;
196
+ services: JsonValue;
197
+ }) => Promise<JsonValue>;
198
+ /** Change the org's overage switches (org owners and admins) `PUT /api/v1/billing/orgs/{org_id}/overage-prefs` */
199
+ setOrgOveragePrefs: (args: {
200
+ orgId?: string;
201
+ services: JsonValue;
202
+ }) => Promise<JsonValue>;
203
+ };
204
+ builds: {
205
+ /** Check an app build Sovariq wrote (title, description, migration {name, up_sql, down_sql}, policies [{id, spl}], functions [{name, runtime, files}], tests [rules test cases]) against the project — nothing changes: the migration is dry-run up, down and up again, rules are simulated, rules tests run with the build's rules. Returns the build id and the report. `POST /api/v1/fn/builds/check` */
206
+ check: (args: {
207
+ build: JsonValue;
208
+ }) => Promise<JsonValue>;
209
+ /** Recent app builds of the project: title, status (checked, failed, pr_opened), each check's result and the pull request. `GET /api/v1/fn/builds` */
210
+ list: (args?: {
211
+ limit?: JsonValue;
212
+ }) => Promise<JsonValue>;
213
+ /** One app build: its files (the bundle), the check report and the pull request. `GET /api/v1/fn/builds/{build_id}` */
214
+ get: (args: {
215
+ buildId: string;
216
+ }) => Promise<JsonValue>;
217
+ /** Check the build again and open it as a pull request on the project's linked GitHub repository (one commit on a new branch; dev.app_build_prs_month). GitHub needs repository access: connect it with repository access or pass a token with repo scope. `POST /api/v1/fn/builds/{build_id}/pull-request` */
218
+ pullRequest: (args: {
219
+ buildId: string;
220
+ token?: JsonValue;
221
+ }) => Promise<JsonValue>;
222
+ /** Forget an app build (its pull request, if opened, stays on GitHub). `DELETE /api/v1/fn/builds/{build_id}` */
223
+ delete: (args: {
224
+ buildId: string;
225
+ }) => Promise<JsonValue>;
226
+ };
227
+ byok: {
228
+ /** Your organization's own encryption key (Enterprise): whether it's on, the key, its data key version, whether it is usable now, what it covers, and setup (Sovaria's AWS principal and the key policy statement). `GET /api/v1/byok` */
229
+ get: () => Promise<JsonValue>;
230
+ /** Use your AWS KMS key (its ARN) for the organization's storage files and backups. Checked end to end first (wrap, unwrap, a file written and read with it). Organization owners. `PUT /api/v1/byok` */
231
+ set: (args: {
232
+ provider?: JsonValue;
233
+ keyRef: JsonValue;
234
+ }) => Promise<JsonValue>;
235
+ /** A new data key version under the same KMS key; older versions stay to decrypt what they encrypted. Organization owners. `POST /api/v1/byok/rotate` */
236
+ rotate: () => Promise<JsonValue>;
237
+ /** Ask your KMS now whether Sovaria can still use the key. `POST /api/v1/byok/check` */
238
+ check: () => Promise<JsonValue>;
239
+ /** Rewrite the organization's existing storage files under its key (in the background; progress in byok.get). Organization owners. `POST /api/v1/byok/reencrypt-storage` */
240
+ reencryptStorage: () => Promise<JsonValue>;
241
+ };
242
+ crashes: {
243
+ /** App crash issues of the project (grouped reports from sov.crashes), newest first, with the plan's limits. `GET /api/v1/crashes/issues` */
244
+ listIssues: (args?: {
245
+ status?: JsonValue;
246
+ limit?: JsonValue;
247
+ }) => Promise<JsonValue>;
248
+ /** One crash issue: sample report (stack, breadcrumbs, device, release) and its last 50 reports. `GET /api/v1/crashes/issues/{fingerprint}` */
249
+ getIssue: (args: {
250
+ fingerprint: string;
251
+ }) => Promise<JsonValue>;
252
+ /** Mark a crash issue open, resolved (reopens if it happens again) or ignored. `POST /api/v1/crashes/issues/{fingerprint}/status` */
253
+ setIssueStatus: (args: {
254
+ fingerprint: string;
255
+ status: JsonValue;
256
+ }) => Promise<JsonValue>;
257
+ /** Crash reports accepted and dropped this month, and the plan's limits. `GET /api/v1/crashes/usage` */
258
+ usage: () => Promise<JsonValue>;
259
+ };
260
+ data: {
261
+ /** Add a column to an existing table. `POST /api/v1/data/rel/column/add` */
262
+ addColumn: (args: {
263
+ tableName: JsonValue;
264
+ columnName: JsonValue;
265
+ dataType: JsonValue;
266
+ isNullable?: JsonValue;
267
+ isUnique?: JsonValue;
268
+ defaultValue?: JsonValue;
269
+ }) => Promise<JsonValue>;
270
+ /** Add a foreign-key relation. `POST /api/v1/data/rel/foreign-key/add` */
271
+ addForeignKey: (args: {
272
+ tableName: JsonValue;
273
+ columnName: JsonValue;
274
+ referencedTable: JsonValue;
275
+ referencedColumn: JsonValue;
276
+ }) => Promise<JsonValue>;
277
+ /** Start a table transaction and receive tx/snapshot IDs. `POST /api/v1/data/rel/transaction/begin` */
278
+ beginTransaction: () => Promise<JsonValue>;
279
+ /** Commit a previously opened table transaction. `POST /api/v1/data/rel/transaction/commit` */
280
+ commitTransaction: (args: {
281
+ txid: JsonValue;
282
+ }) => Promise<JsonValue>;
283
+ /** Drop a column from a table. `POST /api/v1/data/rel/column/drop` */
284
+ dropColumn: (args: {
285
+ tableName: JsonValue;
286
+ columnName: JsonValue;
287
+ }) => Promise<JsonValue>;
288
+ /** Drop a foreign-key relation. `POST /api/v1/data/rel/foreign-key/drop` */
289
+ dropForeignKey: (args: {
290
+ tableName: JsonValue;
291
+ columnName: JsonValue;
292
+ referencedTable: JsonValue;
293
+ referencedColumn: JsonValue;
294
+ }) => Promise<JsonValue>;
295
+ /** Drop a relational table. `POST /api/v1/data/rel/drop` */
296
+ dropTable: (args: {
297
+ tableName: JsonValue;
298
+ }) => Promise<JsonValue>;
299
+ /** `POST /api/v1/data/rel/transaction/rollback` */
300
+ rollbackTransaction: (args: {
301
+ txid: JsonValue;
302
+ }) => Promise<JsonValue>;
303
+ /** Tables that keep history (versions, oldest, retention) and the plan's db.history_* limits. `GET /api/v1/data/rel/history` */
304
+ tableHistory: () => Promise<JsonValue>;
305
+ /** Turn a table's history on (every row version kept; read with sov_as_of(NULL::table, time)) or off (versions dropped). `POST /api/v1/data/rel/history` */
306
+ setTableHistory: (args: {
307
+ tableName: JsonValue;
308
+ enabled: JsonValue;
309
+ keepDays?: JsonValue;
310
+ }) => Promise<JsonValue>;
311
+ /** The schema as one short line per table: columns with types, keys, →references, allowed values, indexes and owner-only rows. tables (comma-separated) expands only those in a big schema; since=<version> answers unchanged when nothing changed. `GET /api/v1/data/rel/schema/digest` */
312
+ schemaDigest: (args?: {
313
+ tables?: JsonValue;
314
+ maxChars?: JsonValue;
315
+ since?: JsonValue;
316
+ }) => Promise<JsonValue>;
317
+ /** Create or extend tables from one declarative plan ([{name, columns, patterns, unique, indexes}]; columns as objects or short form like "status text!='draft' in(draft|live)" or "customer_id →customers cascade"). Checked first (422 lists every problem, nothing changes), then applied as one reversible migration and verified. dry_run returns the SQL without applying. `POST /api/v1/data/rel/schema/plan` */
318
+ applySchemaPlan: (args: {
319
+ tables: JsonValue;
320
+ dryRun?: JsonValue;
321
+ name?: JsonValue;
322
+ }) => Promise<JsonValue>;
323
+ /** Apply a migration and record it in the project's history, in one transaction (all or nothing). down_sql makes it reversible; the same version with the same SQL again does nothing, with different SQL it is refused (409). `POST /api/v1/data/rel/migrations/apply` */
324
+ applyMigration: (args: {
325
+ name: JsonValue;
326
+ upSql: JsonValue;
327
+ downSql?: JsonValue;
328
+ version?: JsonValue;
329
+ }) => Promise<JsonValue>;
330
+ /** Run a migration inside a transaction and roll it back: whether it would apply. Nothing is kept. `POST /api/v1/data/rel/migrations/dry-run` */
331
+ dryRunMigration: (args: {
332
+ name: JsonValue;
333
+ upSql: JsonValue;
334
+ downSql?: JsonValue;
335
+ }) => Promise<JsonValue>;
336
+ /** Check several migrations ([{name, up_sql}], up to 500 and 5 MB of SQL) in order inside one transaction that is rolled back, so later ones see what earlier ones create. Returns status dry_run_ok, or failed with failed.index, name and error for the first that fails. `POST /api/v1/data/rel/migrations/dry-run-sequence` */
337
+ dryRunMigrations: (args: {
338
+ migrations: JsonValue;
339
+ }) => Promise<JsonValue>;
340
+ /** Undo the most recent migration with its down SQL (or version, with force when it isn't the latest). `POST /api/v1/data/rel/migrations/rollback` */
341
+ rollbackMigration: (args?: {
342
+ version?: JsonValue;
343
+ force?: JsonValue;
344
+ }) => Promise<JsonValue>;
345
+ };
346
+ e2ee: {
347
+ /** Create (or fetch) the active e2ee channel key. `POST /api/v1/rt/e2ee/keys/bootstrap` */
348
+ bootstrapKey: (args: {
349
+ channel: JsonValue;
350
+ ttlSeconds?: JsonValue;
351
+ forceNew?: JsonValue;
352
+ }) => Promise<JsonValue>;
353
+ /** Get the active e2ee key for a channel, wrapped for ``client_public_key``. `GET /api/v1/rt/e2ee/keys/active/{channel}` */
354
+ getActiveKey: (args: {
355
+ channel: string;
356
+ clientPublicKey?: JsonValue;
357
+ }) => Promise<JsonValue>;
358
+ /** Get key material by channel/key_id, wrapped for ``client_public_key``. `GET /api/v1/rt/e2ee/keys/{channel}/{key_id}` */
359
+ getKey: (args: {
360
+ channel: string;
361
+ keyId: string;
362
+ clientPublicKey?: JsonValue;
363
+ }) => Promise<JsonValue>;
364
+ /** List key metadata for a channel. `GET /api/v1/rt/e2ee/keys/{channel}` */
365
+ listKeys: (args: {
366
+ channel: string;
367
+ }) => Promise<JsonValue>;
368
+ /** Revoke an active or historical channel key. `POST /api/v1/rt/e2ee/keys/revoke` */
369
+ revokeKey: (args: {
370
+ channel: JsonValue;
371
+ keyId?: JsonValue;
372
+ reason?: JsonValue;
373
+ }) => Promise<JsonValue>;
374
+ /** Rotate e2ee key material for a channel. `POST /api/v1/rt/e2ee/keys/rotate` */
375
+ rotateKey: (args: {
376
+ channel: JsonValue;
377
+ ttlSeconds?: JsonValue;
378
+ }) => Promise<JsonValue>;
379
+ };
380
+ functions: {
381
+ /** `DELETE /api/v1/fn/functions/{function_name}` */
382
+ delete: (args: {
383
+ functionName: string;
384
+ }) => Promise<JsonValue>;
385
+ /** `GET /api/v1/fn/functions/{function_name}` */
386
+ get: (args: {
387
+ functionName: string;
388
+ projectId?: JsonValue;
389
+ }) => Promise<JsonValue>;
390
+ /** `GET /api/v1/fn/functions/{function_name}/bindings` */
391
+ getBindings: (args: {
392
+ functionName: string;
393
+ }) => Promise<JsonValue>;
394
+ /** `GET /api/v1/fn/functions/{function_name}/policy` */
395
+ getPolicy: (args: {
396
+ functionName: string;
397
+ }) => Promise<JsonValue>;
398
+ /** `GET /api/v1/fn/functions/{function_name}/source` */
399
+ getSource: (args: {
400
+ functionName: string;
401
+ projectId?: JsonValue;
402
+ }) => Promise<JsonValue>;
403
+ /** `POST /api/v1/fn/github/commit` */
404
+ githubCommit: (args: {
405
+ body: JsonObject;
406
+ }) => Promise<JsonValue>;
407
+ /** `POST /api/v1/fn/github/import` */
408
+ githubImport: (args: {
409
+ body: JsonObject;
410
+ }) => Promise<JsonValue>;
411
+ /** Get status for an async Forge invocation id. `GET /api/v1/fn/invocations/{invocation_id}` */
412
+ invocationStatus: (args: {
413
+ invocationId: string;
414
+ projectId?: JsonValue;
415
+ }) => Promise<JsonValue>;
416
+ /** List Forge functions with active version and queue summary. `GET /api/v1/fn/functions` */
417
+ list: (args?: {
418
+ projectId?: JsonValue;
419
+ limit?: JsonValue;
420
+ offset?: JsonValue;
421
+ }) => Promise<JsonValue>;
422
+ /** Diff two simulation invocation outputs. `GET /api/v1/fn/{function_name}/history/simulation-diff` */
423
+ simulationDiff: (args: {
424
+ functionName: string;
425
+ projectId?: JsonValue;
426
+ leftInvocationId?: JsonValue;
427
+ rightInvocationId?: JsonValue;
428
+ }) => Promise<JsonValue>;
429
+ /** Get forge deployment status by deploy id. `GET /api/v1/fn/{deploy_id}/status` */
430
+ status: (args: {
431
+ deployId: string;
432
+ projectId?: JsonValue;
433
+ }) => Promise<JsonValue>;
434
+ /** `PATCH /api/v1/fn/functions/{function_name}` */
435
+ update: (args: {
436
+ functionName: string;
437
+ body: JsonObject;
438
+ projectId?: JsonValue;
439
+ }) => Promise<JsonValue>;
440
+ /** `PUT /api/v1/fn/functions/{function_name}/bindings` */
441
+ updateBindings: (args: {
442
+ functionName: string;
443
+ bindings: JsonValue;
444
+ }) => Promise<JsonValue>;
445
+ /** `PUT /api/v1/fn/functions/{function_name}/policy` */
446
+ updatePolicy: (args: {
447
+ functionName: string;
448
+ policy: JsonObject;
449
+ }) => Promise<JsonValue>;
450
+ /** List deployment versions for a Forge function. `GET /api/v1/fn/{function_name}/versions` */
451
+ versions: (args: {
452
+ functionName: string;
453
+ projectId?: JsonValue;
454
+ limit?: JsonValue;
455
+ offset?: JsonValue;
456
+ }) => Promise<JsonValue>;
457
+ };
458
+ governance: {
459
+ /** `GET /api/v1/governance/admin/databases` */
460
+ adminDatabases: () => Promise<JsonValue>;
461
+ /** `GET /api/v1/governance/tenants/{org_id}` */
462
+ getTenant: (args?: {
463
+ orgId?: string;
464
+ }) => Promise<JsonValue>;
465
+ /** `GET /api/v1/governance/tenants/{org_id}/databases/{project_id}/connection` */
466
+ getTenantDatabaseConnection: (args?: {
467
+ orgId?: string;
468
+ projectId?: string;
469
+ }) => Promise<JsonValue>;
470
+ /** `GET /api/v1/governance/hosts` */
471
+ listHosts: (args?: {
472
+ regionId?: JsonValue;
473
+ }) => Promise<JsonValue>;
474
+ /** `GET /api/v1/governance/regions` */
475
+ listRegions: () => Promise<JsonValue>;
476
+ /** `GET /api/v1/governance/tenants/{org_id}/databases/{project_id}/backups` */
477
+ listTenantDatabaseBackups: (args?: {
478
+ orgId?: string;
479
+ projectId?: string;
480
+ limit?: JsonValue;
481
+ }) => Promise<JsonValue>;
482
+ /** `GET /api/v1/governance/tenants/{org_id}/databases` */
483
+ listTenantDatabases: (args?: {
484
+ orgId?: string;
485
+ }) => Promise<JsonValue>;
486
+ /** `GET /api/v1/governance/tenants` */
487
+ listTenants: () => Promise<JsonValue>;
488
+ /** `GET /api/v1/governance/metrics/overview` */
489
+ metricsOverview: () => Promise<JsonValue>;
490
+ /** `PATCH /api/v1/governance/hosts/{host_id}` */
491
+ patchHost: (args: {
492
+ hostId: string;
493
+ body: JsonObject;
494
+ }) => Promise<JsonValue>;
495
+ /** `PATCH /api/v1/governance/regions/{region_id}` */
496
+ patchRegion: (args: {
497
+ regionId: string;
498
+ body: JsonObject;
499
+ }) => Promise<JsonValue>;
500
+ /** `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/pause` */
501
+ pauseTenantDatabase: (args?: {
502
+ orgId?: string;
503
+ projectId?: string;
504
+ }) => Promise<JsonValue>;
505
+ /** `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/resize` */
506
+ resizeTenantDatabase: (args: {
507
+ orgId?: string;
508
+ projectId?: string;
509
+ computeSize: JsonValue;
510
+ }) => Promise<JsonValue>;
511
+ /** `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/resume` */
512
+ resumeTenantDatabase: (args?: {
513
+ orgId?: string;
514
+ projectId?: string;
515
+ }) => Promise<JsonValue>;
516
+ /** Reveal a database connection string (staff, with an active access grant). `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/connection/reveal` */
517
+ revealTenantDatabaseConnection: (args: {
518
+ orgId?: string;
519
+ projectId?: string;
520
+ grantId: JsonValue;
521
+ }) => Promise<JsonValue>;
522
+ /** `POST /api/v1/governance/tenants/{org_id}/status` */
523
+ setTenantStatus: (args: {
524
+ orgId?: string;
525
+ status: JsonValue;
526
+ }) => Promise<JsonValue>;
527
+ /** `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/backups` */
528
+ triggerTenantDatabaseBackup: (args?: {
529
+ orgId?: string;
530
+ projectId?: string;
531
+ }) => Promise<JsonValue>;
532
+ /** Read replicas of the project's dedicated database: status, connection string, lag behind the primary, plan limit. `GET /api/v1/governance/tenants/{org_id}/databases/{project_id}/replicas` */
533
+ listDatabaseReplicas: (args?: {
534
+ orgId?: string;
535
+ projectId?: string;
536
+ }) => Promise<JsonValue>;
537
+ /** Start a streaming read replica (status provisioning until its base backup is done, then ready). `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/replicas` */
538
+ createDatabaseReplica: (args?: {
539
+ orgId?: string;
540
+ projectId?: string;
541
+ }) => Promise<JsonValue>;
542
+ /** Remove a read replica and its copy of the data. `DELETE /api/v1/governance/tenants/{org_id}/databases/{project_id}/replicas/{replica_id}` */
543
+ deleteDatabaseReplica: (args: {
544
+ orgId?: string;
545
+ projectId?: string;
546
+ replicaId: string;
547
+ }) => Promise<JsonValue>;
548
+ /** What changed between two moments of the database — a backup id or "now" on each side: schema objects added, removed or changed (with a diff) and rows per table. `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/compare` */
549
+ compareDatabaseMoments: (args: {
550
+ orgId?: string;
551
+ projectId?: string;
552
+ fromMoment: JsonValue;
553
+ toMoment?: JsonValue;
554
+ includePlatform?: JsonValue;
555
+ }) => Promise<JsonValue>;
556
+ /** Replace the project's database with a backup (dedicated databases): a safety backup is taken first, the backup loads beside production in one transaction and is swapped in; undo within 7 days. Org owners and admins. `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/backups/{backup_id}/restore` */
557
+ restoreDatabaseBackup: (args: {
558
+ orgId?: string;
559
+ projectId?: string;
560
+ backupId: string;
561
+ confirm: JsonValue;
562
+ }) => Promise<JsonValue>;
563
+ /** Database restores of the project: status, the backup used, the safety backup and until when it can be undone. `GET /api/v1/governance/tenants/{org_id}/databases/{project_id}/restores` */
564
+ listDatabaseRestores: (args?: {
565
+ orgId?: string;
566
+ projectId?: string;
567
+ }) => Promise<JsonValue>;
568
+ /** Put back the database exactly as it was right before a restore (within the undo window). `POST /api/v1/governance/tenants/{org_id}/databases/{project_id}/restores/{restore_id}/undo` */
569
+ undoDatabaseRestore: (args: {
570
+ orgId?: string;
571
+ projectId?: string;
572
+ restoreId: string;
573
+ }) => Promise<JsonValue>;
574
+ };
575
+ history: {
576
+ /** Create a Chrono commit. `POST /api/v1/chrono/commit` */
577
+ commit: (args: {
578
+ timeline?: JsonValue;
579
+ message: JsonValue;
580
+ author?: JsonValue;
581
+ eventType?: JsonValue;
582
+ }) => Promise<JsonValue>;
583
+ /** Converge source timeline into target timeline. `POST /api/v1/chrono/timelines/converge` */
584
+ converge: (args: {
585
+ target: JsonValue;
586
+ source: JsonValue;
587
+ author: JsonValue;
588
+ message?: JsonValue;
589
+ }) => Promise<JsonValue>;
590
+ /** Create a system snapshot. `POST /api/v1/chrono/snapshots/create` */
591
+ createSnapshot: (args: {
592
+ message: JsonValue;
593
+ }) => Promise<JsonValue>;
594
+ /** Delete a timeline. `DELETE /api/v1/chrono/timelines/{name}` */
595
+ deleteTimeline: (args: {
596
+ name: string;
597
+ }) => Promise<JsonValue>;
598
+ /** Force-jump a timeline head. `POST /api/v1/chrono/timelines/{name}/jump` */
599
+ jumpTimeline: (args: {
600
+ name: string;
601
+ targetHex: JsonValue;
602
+ }) => Promise<JsonValue>;
603
+ /** List known snapshots. `GET /api/v1/chrono/snapshots` */
604
+ listSnapshots: () => Promise<JsonValue>;
605
+ /** List available timelines. `GET /api/v1/chrono/timelines` */
606
+ listTimelines: () => Promise<JsonValue>;
607
+ /** Restore a snapshot by id. `POST /api/v1/chrono/snapshots/{snapshot_id}/restore` */
608
+ restoreSnapshot: (args: {
609
+ snapshotId: string;
610
+ }) => Promise<JsonValue>;
611
+ /** Spawn a new timeline from a source chronon. `POST /api/v1/chrono/timelines/spawn` */
612
+ spawnTimeline: (args: {
613
+ name: JsonValue;
614
+ sourceHexId?: JsonValue;
615
+ }) => Promise<JsonValue>;
616
+ /** Fetch timeline history chronons. `GET /api/v1/chrono/timelines/{name}/history` */
617
+ timelineHistory: (args: {
618
+ name: string;
619
+ limit?: JsonValue;
620
+ offset?: JsonValue;
621
+ }) => Promise<JsonValue>;
622
+ /** Return timeline graph topology. `GET /api/v1/chrono/timelines/topology` */
623
+ topology: (args?: {
624
+ timeline?: JsonValue;
625
+ limit?: JsonValue;
626
+ }) => Promise<JsonValue>;
627
+ /** Calculate variance between two chronons. `POST /api/v1/chrono/variance` */
628
+ variance: (args: {
629
+ oldChrononHex: JsonValue;
630
+ newChrononHex: JsonValue;
631
+ domainFilter?: JsonValue;
632
+ }) => Promise<JsonValue>;
633
+ };
634
+ mcp: {
635
+ /** AI assistants you connected over Sovaria's MCP server: the app, its organization and project, read-only or not, when it was connected and last used. `GET /api/v1/auth/mcp/connections` */
636
+ listConnections: () => Promise<JsonValue>;
637
+ /** Disconnect one of your AI assistants: its tokens stop working at once. `DELETE /api/v1/auth/mcp/connections/{grant_id}` */
638
+ disconnect: (args: {
639
+ grantId: string;
640
+ }) => Promise<JsonValue>;
641
+ /** Whether members may connect AI assistants to this organization, the MCP server URL, and (owners and admins) every member's connection. `GET /api/v1/org/{org_id}/mcp` */
642
+ orgSettings: (args?: {
643
+ orgId?: string;
644
+ }) => Promise<JsonValue>;
645
+ /** Allow or stop AI assistants for the organization (owners and admins). Turning it off ends every member's connection. `PUT /api/v1/org/{org_id}/mcp` */
646
+ setOrgAllowed: (args: {
647
+ orgId?: string;
648
+ allowed: JsonValue;
649
+ }) => Promise<JsonValue>;
650
+ /** Disconnect a member's AI assistant from the organization (owners and admins). `DELETE /api/v1/org/{org_id}/mcp/connections/{grant_id}` */
651
+ orgDisconnect: (args: {
652
+ orgId?: string;
653
+ grantId: string;
654
+ }) => Promise<JsonValue>;
655
+ };
656
+ messaging: {
657
+ /** Message templates of the project (push and/or email content with {{ variables }}). `GET /api/v1/projects/{project_id}/messaging/templates` */
658
+ listTemplates: (args?: {
659
+ projectId?: string;
660
+ }) => Promise<JsonValue>;
661
+ /** One message template. `GET /api/v1/projects/{project_id}/messaging/templates/{name}` */
662
+ getTemplate: (args: {
663
+ projectId?: string;
664
+ name: string;
665
+ }) => Promise<JsonValue>;
666
+ /** Create or replace a template: push {title, body, image?, data?}, email {subject, html?, text?}; category transactional or marketing (marketing skips opted-out users and adds an unsubscribe link). `PUT /api/v1/projects/{project_id}/messaging/templates/{name}` */
667
+ putTemplate: (args: {
668
+ projectId?: string;
669
+ name: string;
670
+ description?: JsonValue;
671
+ category?: JsonValue;
672
+ push?: JsonValue;
673
+ email?: JsonValue;
674
+ }) => Promise<JsonValue>;
675
+ /** Delete a message template. `DELETE /api/v1/projects/{project_id}/messaging/templates/{name}` */
676
+ deleteTemplate: (args: {
677
+ projectId?: string;
678
+ name: string;
679
+ }) => Promise<JsonValue>;
680
+ /** Saved audiences: read-only SQL queries returning user_id (other columns become per-user variables). `GET /api/v1/projects/{project_id}/messaging/audiences` */
681
+ listAudiences: (args?: {
682
+ projectId?: string;
683
+ }) => Promise<JsonValue>;
684
+ /** One audience and its last count. `GET /api/v1/projects/{project_id}/messaging/audiences/{name}` */
685
+ getAudience: (args: {
686
+ projectId?: string;
687
+ name: string;
688
+ }) => Promise<JsonValue>;
689
+ /** Create or replace an audience: a SELECT on the project database returning user_id (e.g. select user_id, first_name from profiles where plan = 'pro'). `PUT /api/v1/projects/{project_id}/messaging/audiences/{name}` */
690
+ putAudience: (args: {
691
+ projectId?: string;
692
+ name: string;
693
+ sql: JsonValue;
694
+ description?: JsonValue;
695
+ }) => Promise<JsonValue>;
696
+ /** Delete an audience. `DELETE /api/v1/projects/{project_id}/messaging/audiences/{name}` */
697
+ deleteAudience: (args: {
698
+ projectId?: string;
699
+ name: string;
700
+ }) => Promise<JsonValue>;
701
+ /** Run a saved audience: how many app users it reaches, columns and a sample of 10. `POST /api/v1/projects/{project_id}/messaging/audiences/{name}/preview` */
702
+ previewAudience: (args: {
703
+ projectId?: string;
704
+ name: string;
705
+ }) => Promise<JsonValue>;
706
+ /** Try an audience query before saving it: app users reached, columns and a sample. `POST /api/v1/projects/{project_id}/messaging/audiences/preview` */
707
+ previewSql: (args: {
708
+ projectId?: string;
709
+ sql: JsonValue;
710
+ }) => Promise<JsonValue>;
711
+ /** Send a template (or content {push, email}) to {user_ids | audience | sql | topic | all_users} on push and/or email, with variables; dry_run reports who would get it and renders a preview. Runs in the background; poll getSend. `POST /api/v1/projects/{project_id}/messaging/send` */
712
+ send: (args: {
713
+ projectId?: string;
714
+ template?: JsonValue;
715
+ content?: JsonValue;
716
+ to: JsonValue;
717
+ channels?: JsonValue;
718
+ variables?: JsonValue;
719
+ category?: JsonValue;
720
+ dryRun?: JsonValue;
721
+ }) => Promise<JsonValue>;
722
+ /** Recent sends with status and per-channel counts. `GET /api/v1/projects/{project_id}/messaging/sends` */
723
+ listSends: (args?: {
724
+ projectId?: string;
725
+ limit?: JsonValue;
726
+ }) => Promise<JsonValue>;
727
+ /** One send: status (sending, done, failed) and counts per channel and outcome. `GET /api/v1/projects/{project_id}/messaging/sends/{send_id}` */
728
+ getSend: (args: {
729
+ projectId?: string;
730
+ sendId: string;
731
+ }) => Promise<JsonValue>;
732
+ /** Delivery log: per recipient and channel, sent / failed / no_device / no_email / opted_out with an error code (never content). `GET /api/v1/projects/{project_id}/messaging/deliveries` */
733
+ listDeliveries: (args?: {
734
+ projectId?: string;
735
+ sendId?: JsonValue;
736
+ userId?: JsonValue;
737
+ status?: JsonValue;
738
+ limit?: JsonValue;
739
+ offset?: JsonValue;
740
+ }) => Promise<JsonValue>;
741
+ /** Messages sent this month per channel and the plan's messaging limits. `GET /api/v1/projects/{project_id}/messaging/usage` */
742
+ usage: (args?: {
743
+ projectId?: string;
744
+ }) => Promise<JsonValue>;
745
+ /** Record an app user's marketing choice (channel push, email or all) from your own UI. `PUT /api/v1/projects/{project_id}/messaging/users/{user_id}/optouts` */
746
+ setUserOptout: (args: {
747
+ projectId?: string;
748
+ userId: string;
749
+ channel: JsonValue;
750
+ optedOut: JsonValue;
751
+ }) => Promise<JsonValue>;
752
+ /** The signed-in app user's marketing preferences per channel. `GET /api/v1/messaging/preferences` */
753
+ getPreferences: () => Promise<JsonValue>;
754
+ /** The signed-in app user turns marketing push/email on or off: { marketing: { email: false } }. `PUT /api/v1/messaging/preferences` */
755
+ setPreferences: (args: {
756
+ marketing: JsonValue;
757
+ }) => Promise<JsonValue>;
758
+ };
759
+ mobile: {
760
+ /** Registered iOS/Android apps (bundle/package ids, redirect URIs). `GET /api/v1/projects/{project_id}/mobile/apps` */
761
+ listApps: (args?: {
762
+ projectId?: string;
763
+ }) => Promise<JsonValue>;
764
+ /** Register an app: platform, bundle_id+team_id (iOS) or package_name+sha256_cert_fingerprints (Android), redirect_uris. `POST /api/v1/projects/{project_id}/mobile/apps` */
765
+ createApp: (args: {
766
+ projectId?: string;
767
+ body: JsonObject;
768
+ }) => Promise<JsonValue>;
769
+ /** Change a registered app (name, ids, fingerprints, redirect URIs). `PATCH /api/v1/projects/{project_id}/mobile/apps/{app_id}` */
770
+ updateApp: (args: {
771
+ projectId?: string;
772
+ appId: string;
773
+ body: JsonObject;
774
+ }) => Promise<JsonValue>;
775
+ /** Remove a registered app. `DELETE /api/v1/projects/{project_id}/mobile/apps/{app_id}` */
776
+ deleteApp: (args: {
777
+ projectId?: string;
778
+ appId: string;
779
+ }) => Promise<JsonValue>;
780
+ /** An app user's signed-in devices and push tokens. `GET /api/v1/projects/{project_id}/users/{user_id}/devices` */
781
+ listUserDevices: (args: {
782
+ projectId?: string;
783
+ userId: string;
784
+ }) => Promise<JsonValue>;
785
+ /** Sign one of an app user's devices out (sessions and push tokens). `DELETE /api/v1/projects/{project_id}/users/{user_id}/devices/{device_id}` */
786
+ revokeUserDevice: (args: {
787
+ projectId?: string;
788
+ userId: string;
789
+ deviceId: string;
790
+ }) => Promise<JsonValue>;
791
+ };
792
+ org: {
793
+ /** `POST /api/v1/org/invites/accept` */
794
+ acceptOrgInvite: (args: {
795
+ token: JsonValue;
796
+ }) => Promise<JsonValue>;
797
+ /** Add a user as a member of an org/project node. `POST /api/v1/org/{org_id}/member` */
798
+ addMember: (args: {
799
+ orgId?: string;
800
+ userId: JsonValue;
801
+ role: JsonValue;
802
+ }) => Promise<JsonValue>;
803
+ /** Connect two DAPG nodes with a typed relationship. `POST /api/v1/edge` */
804
+ createEdge: (args: {
805
+ sourceNodeId: JsonValue;
806
+ targetNodeId: JsonValue;
807
+ relationType: JsonValue;
808
+ role?: JsonValue;
809
+ }) => Promise<JsonValue>;
810
+ /** `POST /api/v1/org/{org_id}/invites` */
811
+ createOrgInvite: (args: {
812
+ orgId?: string;
813
+ email: JsonValue;
814
+ role: JsonValue;
815
+ }) => Promise<JsonValue>;
816
+ /** `DELETE /api/v1/org/{org_id}` */
817
+ deleteOrg: (args?: {
818
+ orgId?: string;
819
+ }) => Promise<JsonValue>;
820
+ /** `POST /api/v1/apikeys/ensure-defaults` */
821
+ ensureDefaultApiKeys: () => Promise<JsonValue>;
822
+ /** List child nodes attached by a relation (e.g. OWNS, HAS_ENV). `GET /api/v1/org/{parent_id}/children` */
823
+ getChildren: (args: {
824
+ parentId: string;
825
+ relation?: JsonValue;
826
+ }) => Promise<JsonValue>;
827
+ /** Resolve a user's roles on a resource by walking the DAPG. `GET /api/v1/context/{user_id}/{resource_id}` */
828
+ getContext: (args: {
829
+ userId: string;
830
+ resourceId: string;
831
+ }) => Promise<JsonValue>;
832
+ /** Fetch a single graph node by ID. `GET /api/v1/org/{node_id}` */
833
+ getNode: (args: {
834
+ nodeId: string;
835
+ }) => Promise<JsonValue>;
836
+ /** `GET /api/v1/org/{project_id}/ref` */
837
+ getProjectRef: (args?: {
838
+ projectId?: string;
839
+ }) => Promise<JsonValue>;
840
+ /** `GET /api/v1/project-settings` */
841
+ getProjectSettings: () => Promise<JsonValue>;
842
+ /** `GET /api/v1/roles/catalog` */
843
+ getRoleCatalog: () => Promise<JsonValue>;
844
+ /** `GET /api/v1/roles/matrix` */
845
+ getRoleMatrix: () => Promise<JsonValue>;
846
+ /** `GET /api/v1/apikeys` */
847
+ listApiKeys: () => Promise<JsonValue>;
848
+ /** List graph nodes; when provided, ``node_type`` filters by type. `GET /api/v1/org` */
849
+ listNodes: (args?: {
850
+ nodeType?: JsonValue;
851
+ }) => Promise<JsonValue>;
852
+ /** `GET /api/v1/org/{org_id}/members` */
853
+ listOrgMembers: (args?: {
854
+ orgId?: string;
855
+ }) => Promise<JsonValue>;
856
+ /** `DELETE /api/v1/org/{org_id}/member/{user_id}` */
857
+ removeOrgMember: (args: {
858
+ orgId?: string;
859
+ userId: string;
860
+ }) => Promise<JsonValue>;
861
+ /** `DELETE /api/v1/apikeys/{key_id}` */
862
+ revokeApiKey: (args: {
863
+ keyId: string;
864
+ }) => Promise<JsonValue>;
865
+ /** `PUT /api/v1/org/{org_id}/plan` */
866
+ setOrgPlan: (args: {
867
+ orgId?: string;
868
+ plan: JsonValue;
869
+ }) => Promise<JsonValue>;
870
+ /** `PUT /api/v1/org/{org_id}/member/{user_id}` */
871
+ updateMemberRole: (args: {
872
+ orgId?: string;
873
+ userId: string;
874
+ role: JsonValue;
875
+ }) => Promise<JsonValue>;
876
+ /** `PUT /api/v1/org/{org_id}` */
877
+ updateOrg: (args: {
878
+ orgId?: string;
879
+ body: JsonObject;
880
+ }) => Promise<JsonValue>;
881
+ /** `PUT /api/v1/project-settings` */
882
+ updateProjectSettings: (args: {
883
+ settings: JsonValue;
884
+ }) => Promise<JsonValue>;
885
+ /** `PUT /api/v1/roles/matrix` */
886
+ updateRoleMatrix: (args: {
887
+ matrix: JsonValue;
888
+ }) => Promise<JsonValue>;
889
+ };
890
+ platform: {
891
+ /** `POST /api/v1/auth/event-hooks` */
892
+ createEventHook: (args: {
893
+ body: JsonObject;
894
+ }) => Promise<JsonValue>;
895
+ /** `DELETE /api/v1/auth/event-hooks/{hook_id}` */
896
+ deleteEventHook: (args: {
897
+ hookId: string;
898
+ }) => Promise<JsonValue>;
899
+ /** `DELETE /api/v1/auth/github/connection-state` */
900
+ disconnectGithub: (args?: {
901
+ projectId?: JsonValue;
902
+ }) => Promise<JsonValue>;
903
+ /** `GET /healthz` */
904
+ gatewayHealth: () => Promise<JsonValue>;
905
+ /** Return aggregate gateway health for downstream engines. `GET /api/v1/system/engines/health` */
906
+ getEnginesHealth: () => Promise<JsonValue>;
907
+ /** `GET /api/v1/error-traces/{trace_id}` */
908
+ getErrorTrace: (args: {
909
+ traceId: string;
910
+ }) => Promise<JsonValue>;
911
+ /** `GET /api/v1/auth/github/connection-state` */
912
+ getGithubConnectionState: (args?: {
913
+ projectId?: JsonValue;
914
+ }) => Promise<JsonValue>;
915
+ /** `GET /api/v1/auth/event-hooks` */
916
+ listEventHooks: () => Promise<JsonValue>;
917
+ /** `PATCH /api/v1/error-traces/{trace_id}/resolved` */
918
+ resolveErrorTrace: (args: {
919
+ traceId: string;
920
+ resolved: JsonValue;
921
+ }) => Promise<JsonValue>;
922
+ };
923
+ policy: {
924
+ /** Return current audit-entry count. `GET /api/v1/audit/count` */
925
+ auditCount: () => Promise<JsonValue>;
926
+ /** Verify audit hash-chain integrity. `GET /api/v1/audit/verify` */
927
+ auditVerify: () => Promise<JsonValue>;
928
+ /** Create and compile a policy. `POST /api/v1/policies/` */
929
+ policyCreate: (args: {
930
+ policyId: JsonValue;
931
+ name: JsonValue;
932
+ splSource: JsonValue;
933
+ orgId: JsonValue;
934
+ }) => Promise<JsonValue>;
935
+ /** Delete (deactivate) a policy. `DELETE /api/v1/policies/{policy_id}` */
936
+ policyDelete: (args: {
937
+ policyId: string;
938
+ }) => Promise<JsonValue>;
939
+ /** Evaluate a policy against an explicit debug context. `POST /api/v1/policies/{policy_id}/evaluate` */
940
+ policyEvaluate: (args: {
941
+ policyId: string;
942
+ context: JsonValue;
943
+ }) => Promise<JsonValue>;
944
+ /** Get a single policy by ID. `GET /api/v1/policies/{policy_id}` */
945
+ policyGet: (args: {
946
+ policyId: string;
947
+ }) => Promise<JsonValue>;
948
+ /** Return version history for a policy. `GET /api/v1/policies/{policy_id}/history` */
949
+ policyHistory: (args: {
950
+ policyId: string;
951
+ }) => Promise<JsonValue>;
952
+ /** List active policies visible in current tenant scope. `GET /api/v1/policies/` */
953
+ policyList: () => Promise<JsonValue>;
954
+ /** Rollback a policy to a historical version. `POST /api/v1/policies/{policy_id}/rollback` */
955
+ policyRollback: (args: {
956
+ policyId: string;
957
+ version: JsonValue;
958
+ }) => Promise<JsonValue>;
959
+ /** List server-authoritative SPL templates. `GET /api/v1/policies/templates` */
960
+ policyTemplates: () => Promise<JsonValue>;
961
+ };
962
+ push: {
963
+ /** Which push providers are set up (never the keys). `GET /api/v1/projects/{project_id}/push/credentials` */
964
+ getCredentials: (args?: {
965
+ projectId?: string;
966
+ }) => Promise<JsonValue>;
967
+ /** Upload the Firebase service account JSON (encrypted, write-only). `PUT /api/v1/projects/{project_id}/push/credentials/fcm` */
968
+ setFcmCredentials: (args: {
969
+ projectId?: string;
970
+ serviceAccount: JsonValue;
971
+ }) => Promise<JsonValue>;
972
+ /** Upload the APNs .p8 key (encrypted, write-only). `PUT /api/v1/projects/{project_id}/push/credentials/apns` */
973
+ setApnsCredentials: (args: {
974
+ projectId?: string;
975
+ p8: JsonValue;
976
+ keyId: JsonValue;
977
+ teamId: JsonValue;
978
+ bundleId: JsonValue;
979
+ environment?: JsonValue;
980
+ }) => Promise<JsonValue>;
981
+ /** Remove FCM or APNs credentials. `DELETE /api/v1/projects/{project_id}/push/credentials/{provider}` */
982
+ deleteCredentials: (args: {
983
+ projectId?: string;
984
+ provider: string;
985
+ }) => Promise<JsonValue>;
986
+ /** Push devices registered in the project (tokens are never returned). `GET /api/v1/projects/{project_id}/push/devices` */
987
+ listDevices: (args?: {
988
+ projectId?: string;
989
+ userId?: JsonValue;
990
+ limit?: JsonValue;
991
+ before?: JsonValue;
992
+ }) => Promise<JsonValue>;
993
+ /** Send a push: to {user_ids|device_ids|topic}, notification {title, body, image}, data, badge, priority, ttl_seconds, dry_run. `POST /api/v1/projects/{project_id}/push/send` */
994
+ send: (args: {
995
+ projectId?: string;
996
+ message: JsonObject;
997
+ }) => Promise<JsonValue>;
998
+ /** Recent sends (counts and error codes) and this month's total. `GET /api/v1/projects/{project_id}/push/sends` */
999
+ listSends: (args?: {
1000
+ projectId?: string;
1001
+ limit?: JsonValue;
1002
+ }) => Promise<JsonValue>;
1003
+ /** Register the signed-in app user's push token (FCM or APNs). `POST /api/v1/push/devices` */
1004
+ registerDevice: (args: {
1005
+ token: JsonValue;
1006
+ platform: JsonValue;
1007
+ provider?: JsonValue;
1008
+ deviceId?: JsonValue;
1009
+ appId?: JsonValue;
1010
+ topics?: JsonValue;
1011
+ locale?: JsonValue;
1012
+ }) => Promise<JsonValue>;
1013
+ /** The signed-in app user's push tokens. `GET /api/v1/push/devices` */
1014
+ myDevices: () => Promise<JsonValue>;
1015
+ /** Subscribe a device to topics or unsubscribe it. `PATCH /api/v1/push/devices/{device_row_id}/topics` */
1016
+ updateTopics: (args: {
1017
+ deviceRowId: string;
1018
+ subscribe?: JsonValue;
1019
+ unsubscribe?: JsonValue;
1020
+ replace?: JsonValue;
1021
+ }) => Promise<JsonValue>;
1022
+ /** Remove one of the signed-in user's push devices. `DELETE /api/v1/push/devices/{device_row_id}` */
1023
+ deleteDevice: (args: {
1024
+ deviceRowId: string;
1025
+ }) => Promise<JsonValue>;
1026
+ /** Drop a push token (sign-out, notifications turned off). `POST /api/v1/push/devices/unregister` */
1027
+ unregisterToken: (args: {
1028
+ token: JsonValue;
1029
+ }) => Promise<JsonValue>;
1030
+ };
1031
+ realtime: {
1032
+ /** List active realtime channels. `GET /api/v1/rt/stream/channels` */
1033
+ channels: () => Promise<JsonValue>;
1034
+ /** Fetch presence for a realtime channel. `GET /api/v1/rt/stream/presence/{channel}` */
1035
+ presence: (args: {
1036
+ channel: string;
1037
+ }) => Promise<JsonValue>;
1038
+ /** Replay events for a realtime channel. `GET /api/v1/rt/stream/replay/{channel}` */
1039
+ replay: (args: {
1040
+ channel: string;
1041
+ after?: JsonValue;
1042
+ limit?: JsonValue;
1043
+ }) => Promise<JsonValue>;
1044
+ /** Subscribe a client ID to a realtime channel. `POST /api/v1/rt/stream/subscribe` */
1045
+ subscribe: (args: {
1046
+ channel: JsonValue;
1047
+ clientId: JsonValue;
1048
+ }) => Promise<JsonValue>;
1049
+ /** Unsubscribe a client ID from a realtime channel. `POST /api/v1/rt/stream/unsubscribe` */
1050
+ unsubscribe: (args: {
1051
+ channel: JsonValue;
1052
+ clientId: JsonValue;
1053
+ }) => Promise<JsonValue>;
1054
+ };
1055
+ simulation: {
1056
+ /** `GET /api/v1/sim/runs/{target_run_id}/compare/{baseline_run_id}` */
1057
+ compareRuns: (args: {
1058
+ targetRunId: string;
1059
+ baselineRunId: string;
1060
+ }) => Promise<JsonValue>;
1061
+ /** `POST /api/v1/sim/discover` */
1062
+ discover: () => Promise<JsonValue>;
1063
+ /** `GET /api/v1/sim/runs/{run_id}` */
1064
+ getRun: (args: {
1065
+ runId: string;
1066
+ }) => Promise<JsonValue>;
1067
+ /** `GET /api/v1/sim/runs` */
1068
+ listRuns: (args?: {
1069
+ limit?: JsonValue;
1070
+ offset?: JsonValue;
1071
+ }) => Promise<JsonValue>;
1072
+ };
1073
+ storage: {
1074
+ /** `POST /api/v1/store/buckets` */
1075
+ createBucket: (args: {
1076
+ body: JsonObject;
1077
+ }) => Promise<JsonValue>;
1078
+ /** `DELETE /api/v1/store/buckets/{name}` */
1079
+ deleteBucket: (args: {
1080
+ name: string;
1081
+ }) => Promise<JsonValue>;
1082
+ /** `GET /api/v1/store/buckets/{name}` */
1083
+ getBucket: (args: {
1084
+ name: string;
1085
+ }) => Promise<JsonValue>;
1086
+ /** `GET /api/v1/store/buckets` */
1087
+ listBuckets: () => Promise<JsonValue>;
1088
+ /** `POST /api/v1/store/objects/move` */
1089
+ moveObject: (args: {
1090
+ fromPath: JsonValue;
1091
+ toPath: JsonValue;
1092
+ }) => Promise<JsonValue>;
1093
+ /** `PATCH /api/v1/store/buckets/{name}` */
1094
+ updateBucket: (args: {
1095
+ name: string;
1096
+ body: JsonObject;
1097
+ }) => Promise<JsonValue>;
1098
+ };
1099
+ templates: {
1100
+ /** App templates (SaaS, marketplace, chat): what each creates, the tables it adds and its steps. Project team only. `GET /api/v1/templates` */
1101
+ list: () => Promise<JsonValue>;
1102
+ /** One app template, including the SQL its migration runs. `GET /api/v1/templates/{name}` */
1103
+ get: (args: {
1104
+ name: string;
1105
+ }) => Promise<JsonValue>;
1106
+ /** Apply a template to the project: its migration (tables + row-level security), buckets and their rules, realtime — each step with your own permissions, stopping at the first refusal. dry_run checks for tables that already exist and changes nothing. Needs database.admin. `POST /api/v1/governance/tenants/{org_id}/projects/{project_id}/templates/{name}/apply` */
1107
+ apply: (args: {
1108
+ orgId?: string;
1109
+ projectId?: string;
1110
+ name: string;
1111
+ dryRun?: JsonValue;
1112
+ }) => Promise<JsonValue>;
1113
+ };
1114
+ traces: {
1115
+ /** The project's recent refused (4xx) and failed (5xx) requests, each with who refused it, why and what to do (kind: denied, failed or all). Project team only. `GET /api/v1/request-traces` */
1116
+ list: (args?: {
1117
+ kind?: JsonValue;
1118
+ before?: JsonValue;
1119
+ limit?: JsonValue;
1120
+ }) => Promise<JsonValue>;
1121
+ /** One request by its trace id (SovariaError.traceId, the X-Request-ID header): every hop — gateway checks, engine, SQL — and the explanation. `GET /api/v1/request-traces/{trace_id}` */
1122
+ get: (args: {
1123
+ traceId: string;
1124
+ }) => Promise<JsonValue>;
1125
+ };
1126
+ vector: {
1127
+ /** Delete an entire vector collection. `DELETE /api/v1/collections/{collection}` */
1128
+ deleteCollection: (args: {
1129
+ collection: string;
1130
+ }) => Promise<JsonValue>;
1131
+ /** Delete a record from a vector collection. `DELETE /api/v1/collections/{collection}/records/{record_id}` */
1132
+ deleteRecord: (args: {
1133
+ collection: string;
1134
+ recordId: string;
1135
+ }) => Promise<JsonValue>;
1136
+ /** Generate embeddings for one or more texts. `POST /api/v1/embed` */
1137
+ embed: (args: {
1138
+ texts: JsonValue;
1139
+ }) => Promise<JsonValue>;
1140
+ /** List vector collections in the current project scope. `GET /api/v1/collections` */
1141
+ listCollections: () => Promise<JsonValue>;
1142
+ /** Embed and upsert documents into a vector collection. `POST /api/v1/vectors/upsert` */
1143
+ upsert: (args: {
1144
+ collection: JsonValue;
1145
+ docs: JsonValue;
1146
+ }) => Promise<JsonValue>;
1147
+ /** Collection settings. app_search: true lets the project's apps (anon key, signed-in users) search it; they can never write or list it. `PATCH /api/v1/collections/{collection}` */
1148
+ setCollection: (args: {
1149
+ collection: string;
1150
+ appSearch?: JsonValue;
1151
+ }) => Promise<JsonValue>;
1152
+ /** Embed every stored text again with the project's current model (large collections need this after a model change). `POST /api/v1/collections/{collection}/reembed` */
1153
+ reembedCollection: (args: {
1154
+ collection: string;
1155
+ force?: JsonValue;
1156
+ }) => Promise<JsonValue>;
1157
+ /** Search a SQL table: mode vector (nearest embeddings), keyword (full text) or hybrid (both, reciprocal rank fusion). text is embedded with the project's model when no vector is given. Only rows the caller may read. `POST /api/v1/data/rel/vector/search` */
1158
+ sqlSearch: (args: {
1159
+ tableName: JsonValue;
1160
+ columnName?: JsonValue;
1161
+ vector?: JsonValue;
1162
+ text?: JsonValue;
1163
+ mode?: JsonValue;
1164
+ textColumns?: JsonValue;
1165
+ language?: JsonValue;
1166
+ k?: JsonValue;
1167
+ metric?: JsonValue;
1168
+ select?: JsonValue;
1169
+ filter?: JsonValue;
1170
+ maxDistance?: JsonValue;
1171
+ }) => Promise<JsonValue>;
1172
+ /** Tables whose vector column Sovaria keeps embedded, rows embedded and waiting, last error, and the project's model. `GET /api/v1/data/rel/vector/auto` */
1173
+ sqlAutoStatus: () => Promise<JsonValue>;
1174
+ /** Keep a vector column (created if missing) filled with embeddings of the source columns; edited rows are embedded again automatically. rebuild re-embeds the whole table. `POST /api/v1/data/rel/vector/auto` */
1175
+ sqlAutoEnable: (args: {
1176
+ tableName: JsonValue;
1177
+ columnName?: JsonValue;
1178
+ sourceColumns: JsonValue;
1179
+ rebuild?: JsonValue;
1180
+ }) => Promise<JsonValue>;
1181
+ /** Stop keeping a table's vectors up to date (the column and its vectors stay). `DELETE /api/v1/data/rel/vector/auto/{table_name}` */
1182
+ sqlAutoDisable: (args: {
1183
+ tableName: string;
1184
+ }) => Promise<JsonValue>;
1185
+ /** Embed waiting rows now instead of on the next background pass (up to limit per table). `POST /api/v1/data/rel/vector/auto/sync` */
1186
+ sqlAutoSync: (args?: {
1187
+ tableName?: JsonValue;
1188
+ limit?: JsonValue;
1189
+ }) => Promise<JsonValue>;
1190
+ };
1191
+ workflows: {
1192
+ /** Start a durable workflow run of a function that uses context.step; key makes the start idempotent. `POST /api/v1/fn/workflows` */
1193
+ start: (args: {
1194
+ functionName: JsonValue;
1195
+ input?: JsonValue;
1196
+ key?: JsonValue;
1197
+ }) => Promise<JsonValue>;
1198
+ /** Workflow runs, newest first, with the plan's workflow limits. `GET /api/v1/fn/workflows` */
1199
+ list: (args?: {
1200
+ functionName?: JsonValue;
1201
+ status?: JsonValue;
1202
+ before?: JsonValue;
1203
+ limit?: JsonValue;
1204
+ }) => Promise<JsonValue>;
1205
+ /** One run: status, input, output or error, and every finished step with its result. `GET /api/v1/fn/workflows/{run_id}` */
1206
+ get: (args: {
1207
+ runId: string;
1208
+ }) => Promise<JsonValue>;
1209
+ /** Wake step.waitForSignal(name) with data (kept until the run waits for it). `POST /api/v1/fn/workflows/{run_id}/signal` */
1210
+ signal: (args: {
1211
+ runId: string;
1212
+ name: JsonValue;
1213
+ data?: JsonValue;
1214
+ }) => Promise<JsonValue>;
1215
+ /** Stop an unfinished run for good. `POST /api/v1/fn/workflows/{run_id}/cancel` */
1216
+ cancel: (args: {
1217
+ runId: string;
1218
+ }) => Promise<JsonValue>;
1219
+ /** Resume a failed run from its failed step; latest moves it to the live function version. `POST /api/v1/fn/workflows/{run_id}/retry` */
1220
+ retry: (args: {
1221
+ runId: string;
1222
+ latest?: JsonValue;
1223
+ }) => Promise<JsonValue>;
1224
+ };
1225
+ };
1226
+ export type GeneratedApi = ReturnType<typeof createGeneratedApi>;
1227
+ export {};