@scalix-world/sdk 1.5.0 → 1.6.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.
@@ -49,6 +49,29 @@ export type AddPeerBody = {
49
49
  export type AiStat = {
50
50
  tokens_used: number;
51
51
  };
52
+ /**
53
+ * Body of `POST /api/v1/anomalies` — the caller supplies the activity
54
+ * window; the endpoint classifies it (the old description claimed it
55
+ * "analyzes recent activity" on its own). Mirrors `anomaly::DatabaseMetrics`.
56
+ */
57
+ export type AnomalyDetectionRequest = {
58
+ /**
59
+ * Observed queries per second.
60
+ */
61
+ query_rate: number;
62
+ /**
63
+ * Observed error rate (0.0–1.0).
64
+ */
65
+ error_rate: number;
66
+ /**
67
+ * Observed average response time in milliseconds.
68
+ */
69
+ avg_response_time_ms: number;
70
+ /**
71
+ * Observed open connection count.
72
+ */
73
+ connection_count: number;
74
+ };
52
75
  export type AuditAction = 'data_access' | 'data_modify' | 'data_delete' | 'auth_login' | 'auth_fail' | 'config_change' | 'api_key_create' | 'api_key_revoke' | 'api_key_rotate' | 'member_add' | 'member_remove' | 'compliance_export' | 'compliance_erasure';
53
76
  export type AuditEntry = {
54
77
  id: string;
@@ -90,6 +113,58 @@ export type BandwidthStat = {
90
113
  export type BatchSqlRequest = {
91
114
  queries: Array<SqlRequest>;
92
115
  };
116
+ /**
117
+ * A billing plan as the pricing page and console BillingPage render it.
118
+ */
119
+ export type BillingPlan = {
120
+ /**
121
+ * Plan id ("free", "starter", "pro", …).
122
+ */
123
+ id: string;
124
+ /**
125
+ * Display name.
126
+ */
127
+ name: string;
128
+ /**
129
+ * URL slug.
130
+ */
131
+ slug: string;
132
+ /**
133
+ * Base monthly price, in cents (USD).
134
+ */
135
+ price_cents: number;
136
+ /**
137
+ * Annual-billing price, in cents (USD); null when the plan has no
138
+ * annual price.
139
+ */
140
+ annual_price_cents?: number | null;
141
+ /**
142
+ * Maximum team seats included.
143
+ */
144
+ max_team_seats: number;
145
+ /**
146
+ * Maximum projects included.
147
+ */
148
+ max_projects: number;
149
+ /**
150
+ * Support tier ("community", "standard", "priority").
151
+ */
152
+ support_tier: string;
153
+ /**
154
+ * SLA percentage.
155
+ */
156
+ sla_pct: number;
157
+ /**
158
+ * Feature list shown on the pricing page.
159
+ */
160
+ features: Array<string>;
161
+ };
162
+ /**
163
+ * The plan list response.
164
+ */
165
+ export type BillingPlanList = {
166
+ plans: Array<BillingPlan>;
167
+ };
93
168
  /**
94
169
  * Connection endpoint of the branch's compute worker.
95
170
  */
@@ -213,6 +288,16 @@ export type BuildCreateRequest = {
213
288
  export type BulkImportBody = {
214
289
  variables: Array<SetEnvBody>;
215
290
  };
291
+ /**
292
+ * In-place plan change request.
293
+ */
294
+ export type ChangePlanRequest = {
295
+ /**
296
+ * Target plan id. The console sends `price_id` — accepted as an
297
+ * alias.
298
+ */
299
+ new_plan: string;
300
+ };
216
301
  /**
217
302
  * One completion choice: index, message, finish reason.
218
303
  */
@@ -298,10 +383,80 @@ export type ChatMessage = {
298
383
  role: string;
299
384
  content: string;
300
385
  };
386
+ /**
387
+ * Hosted checkout request (upgrade / first paid plan).
388
+ */
389
+ export type CheckoutRequest = {
390
+ /**
391
+ * Plan id to check out. The console sends `price_id` — accepted as
392
+ * an alias.
393
+ */
394
+ plan: string;
395
+ /**
396
+ * URL to return to after a successful payment.
397
+ */
398
+ success_url: string;
399
+ /**
400
+ * URL to return to when the customer cancels.
401
+ */
402
+ cancel_url: string;
403
+ /**
404
+ * Customer country code (tax calculation).
405
+ */
406
+ country_code?: string | null;
407
+ /**
408
+ * Tenant id; defaults to the caller's authenticated org.
409
+ */
410
+ tenant_id?: string | null;
411
+ /**
412
+ * Customer email for the provider customer record.
413
+ */
414
+ email?: string | null;
415
+ /**
416
+ * Billing interval: "month" (default) or "year"/"annual".
417
+ */
418
+ interval?: string | null;
419
+ };
420
+ /**
421
+ * A hosted checkout session.
422
+ */
423
+ export type CheckoutSession = {
424
+ /**
425
+ * Provider session id.
426
+ */
427
+ session_id: string;
428
+ /**
429
+ * Hosted payment page URL.
430
+ */
431
+ url: string;
432
+ /**
433
+ * Payment provider that owns the session.
434
+ */
435
+ provider: string;
436
+ /**
437
+ * Razorpay only: the public key id the console needs to open
438
+ * Checkout.js as an in-page modal.
439
+ */
440
+ razorpay_key_id?: string | null;
441
+ };
301
442
  export type ComplianceCheck = {
302
443
  name: string;
303
444
  passed: boolean;
304
445
  details: string;
446
+ /**
447
+ * How the pass was established — FAKE-05 (2026-10-31).
448
+ *
449
+ * "measured" — derived from a live signal this endpoint can read
450
+ * (a configured key, an env flag, a real probe).
451
+ * "structural"— compiled in and always true; no runtime signal exists
452
+ * to verify it, so the pass is an assertion, not a check.
453
+ *
454
+ * Before this field existed, both kinds rendered as the same green tick,
455
+ * so a compliance score of 100% could not be distinguished from a set of
456
+ * unexamined literals. Additive and optional for consumers: existing
457
+ * readers ignore unknown fields.
458
+ */
459
+ basis: string;
305
460
  };
306
461
  export type ComplianceStatus = {
307
462
  checks: Array<ComplianceCheck>;
@@ -341,13 +496,21 @@ export type ComputerCreateRequest = {
341
496
  * Guest image. `ubuntu24` is the only image available today.
342
497
  */
343
498
  image?: string | null;
344
- resources?: null | ComputerResources;
499
+ resources?: ComputerResources | null;
345
500
  /**
346
501
  * OpenSSH public keys authorised for `root`, one per array entry, max 32.
347
502
  * Optional — `exec` and the browser terminal work without one. Send the
348
503
  * public half only (the `.pub` file); a private key is rejected.
349
504
  */
350
505
  ssh_keys?: Array<string> | null;
506
+ /**
507
+ * Optional canonical region id (from `GET /v1/regions`) constraining host
508
+ * placement. The orchestrator's `CreateComputerSchema` accepts it on both
509
+ * the POST create and the by-name get-or-create; a Computer is host-bound
510
+ * for life, so the region only applies at first create. There is no
511
+ * `region_pinned` on this contract.
512
+ */
513
+ region?: string | null;
351
514
  };
352
515
  /**
353
516
  * Request body for running a command inside a Computer.
@@ -393,6 +556,11 @@ export type ComputerFileRead = {
393
556
  * One file to write into a Computer.
394
557
  */
395
558
  export type ComputerFileWrite = {
559
+ /**
560
+ * ABSOLUTE path inside the guest — relative paths are rejected with 400
561
+ * (an older guest build silently wrote them against the VM's CWD and
562
+ * reported success; audit 2026-10-21).
563
+ */
396
564
  path: string;
397
565
  /**
398
566
  * Base64-encoded contents.
@@ -525,6 +693,49 @@ export type CreateDatabaseResponse = {
525
693
  */
526
694
  pg_version: string;
527
695
  };
696
+ /**
697
+ * Create a subscription. `config` is REQUIRED and its shape depends on
698
+ * `sub_type` (the contract previously said bare `object`). Mirrors
699
+ * `eventbus::api::CreateSubscriptionRequest`.
700
+ */
701
+ export type CreateEventSubscriptionRequest = {
702
+ /**
703
+ * `webhook` or `function`.
704
+ */
705
+ sub_type: EventSubscriptionType;
706
+ /**
707
+ * webhook: `{"url": "<public https url>"}` required (SSRF-validated at
708
+ * create and re-pinned at delivery), optional `"secret"` → HMAC header
709
+ * `x-scalix-signature`, optional `"headers"` (string map).
710
+ * function: `{"function_id": "<id>"}` required.
711
+ */
712
+ config: {
713
+ [key: string]: unknown;
714
+ };
715
+ /**
716
+ * Optional event-payload filter.
717
+ */
718
+ filter?: {
719
+ [key: string]: unknown;
720
+ } | null;
721
+ /**
722
+ * Per-delivery retry budget.
723
+ */
724
+ max_retries?: number;
725
+ };
726
+ /**
727
+ * Create a topic. There is NO `display_name` field (the audit's 500 was a
728
+ * duplicate `name` — now a 409 ALREADY_EXISTS). Mirrors platform-services
729
+ * `eventbus::api::CreateTopicRequest`.
730
+ */
731
+ export type CreateEventTopicRequest = {
732
+ /**
733
+ * Topic name — unique per project; also usable as the `{id}` selector on
734
+ * topic sub-paths.
735
+ */
736
+ name: string;
737
+ description?: string | null;
738
+ };
528
739
  export type CreateGdprRequest = {
529
740
  subject_email: string;
530
741
  request_type: GdprRequestType;
@@ -543,6 +754,13 @@ export type CreateIntegrationBody = {
543
754
  auto_build?: boolean | null;
544
755
  auto_deploy?: boolean | null;
545
756
  service_id?: string | null;
757
+ /**
758
+ * Function deploy target: every later build PUTs the fresh image onto
759
+ * this function (drains its warm pool + re-warms the new revision).
760
+ * Mutually exclusive with `service_id` — one repo deploys one thing, and
761
+ * the tenant chooses which.
762
+ */
763
+ function_id?: string | null;
546
764
  preview_enabled?: boolean | null;
547
765
  preview_ttl_hours?: number | null;
548
766
  };
@@ -559,7 +777,7 @@ export type CreateLbRequest = {
559
777
  name: string;
560
778
  strategy?: Strategy;
561
779
  backends?: Array<AddBackendRequest>;
562
- health_check?: null | HealthCheckConfig;
780
+ health_check?: HealthCheckConfig | null;
563
781
  };
564
782
  export type CreateRuleRequest = {
565
783
  name: string;
@@ -584,6 +802,59 @@ export type CreateVpcBody = {
584
802
  */
585
803
  cidr: string;
586
804
  };
805
+ /**
806
+ * What a cron schedule executes.
807
+ */
808
+ export type CronActionType = 'function' | 'webhook';
809
+ /**
810
+ * Create a scheduled job. `action_type` + `action_config` are a PAIR — the
811
+ * config keys are validated per type (audit 2026-10-21: this body was a
812
+ * bare `object` in the contract and the shipped CLI posted the wrong key,
813
+ * so every CLI create 400'd). Mirrors platform-services
814
+ * `cron::api::CreateScheduleRequest`.
815
+ */
816
+ export type CronScheduleCreateRequest = {
817
+ name: string;
818
+ description?: string | null;
819
+ /**
820
+ * Five-field cron expression (minute hour day month weekday). The key is
821
+ * `cron_expression` — NOT `expression`.
822
+ */
823
+ cron_expression: string;
824
+ /**
825
+ * IANA timezone for the schedule; defaults to UTC when omitted.
826
+ */
827
+ timezone?: string | null;
828
+ /**
829
+ * Only `function` and `webhook`.
830
+ */
831
+ action_type: CronActionType;
832
+ /**
833
+ * Per-type config. `function`: `{"function_id": "<id>"}` (required) — the
834
+ * function is invoked with the fixed payload `{"trigger":"cron",
835
+ * "project_id":…}`. `webhook`: `{"url": "<public https url>"}` (required,
836
+ * SSRF-validated at create and pinned per delivery) plus optional
837
+ * `"secret"` (HMAC header `x-scalix-signature: sha256=<hex>`) and
838
+ * `"headers"` (string map). Webhook deliveries are ALWAYS POST; a
839
+ * `method` key is ignored.
840
+ */
841
+ action_config: {
842
+ [key: string]: unknown;
843
+ };
844
+ };
845
+ /**
846
+ * Update a scheduled job. The action pair is immutable — delete and recreate
847
+ * to change what runs. Mirrors `cron::api::UpdateScheduleRequest`.
848
+ */
849
+ export type CronScheduleUpdateRequest = {
850
+ name?: string | null;
851
+ description?: string | null;
852
+ cron_expression?: string | null;
853
+ /**
854
+ * Pause (false) / resume (true).
855
+ */
856
+ enabled?: boolean | null;
857
+ };
587
858
  /**
588
859
  * Customer-defined user-agent rule. Takes precedence over the built-in
589
860
  * crawler database so customers can police bots we don't know about yet —
@@ -662,6 +933,27 @@ export type DatabaseJson = {
662
933
  */
663
934
  deleted_at?: string | null;
664
935
  };
936
+ export type DatacenterEntry = {
937
+ name: string;
938
+ provider: string;
939
+ location?: string | null;
940
+ status: string;
941
+ /**
942
+ * REG-ARCH-02 (migration 050): ISO country, residency vocabularies this
943
+ * DC satisfies, provider aliases, and the regional ingress facts.
944
+ */
945
+ country_code?: string | null;
946
+ jurisdictions?: Array<string>;
947
+ aliases?: Array<string>;
948
+ ingress_ip?: string | null;
949
+ ingress_domain?: string | null;
950
+ /**
951
+ * REG-ARCH-02 follow-up (migration 052): the services this DC provides
952
+ * (`compute`, `database`, `storage`) — a compute edge omits the stateful
953
+ * ones; empty until the row is populated.
954
+ */
955
+ capabilities?: Array<string>;
956
+ };
665
957
  export type DdosStats = {
666
958
  global_rps: number;
667
959
  tracked_ips: number;
@@ -852,6 +1144,10 @@ export type ErrorResponse = {
852
1144
  */
853
1145
  field?: string | null;
854
1146
  };
1147
+ /**
1148
+ * Delivery kind for an event subscription.
1149
+ */
1150
+ export type EventSubscriptionType = 'webhook' | 'function';
855
1151
  /**
856
1152
  * Deploy a serverless function.
857
1153
  */
@@ -879,6 +1175,36 @@ export type FunctionsStat = {
879
1175
  invocations: number;
880
1176
  };
881
1177
  export type GdprRequestType = 'export' | 'erasure' | 'rectification' | 'access';
1178
+ /**
1179
+ * A tenant-authored glitch rule creation request (doc-only mirror of the
1180
+ * router's `CreateGlitchRuleBody`).
1181
+ */
1182
+ export type GlitchRuleCreate = {
1183
+ /**
1184
+ * `ignore` (never a glitch for my app) or `track` (record under my label).
1185
+ */
1186
+ action: string;
1187
+ /**
1188
+ * Required for `track`: the tenant's own category name (becomes the group key, 1-64 chars).
1189
+ */
1190
+ label?: string | null;
1191
+ /**
1192
+ * Optional: the tenant's own remediation note shown with the group (max 280 chars).
1193
+ */
1194
+ hint?: string | null;
1195
+ /**
1196
+ * HTTP status codes this rule matches (100-599, 1-32 codes).
1197
+ */
1198
+ match_statuses: Array<number>;
1199
+ /**
1200
+ * Optional path prefix the rule is scoped to (must start with `/`, max 256 chars).
1201
+ */
1202
+ path_prefix?: string | null;
1203
+ /**
1204
+ * Optional exact host the rule is scoped to (bare hostname, max 253 chars).
1205
+ */
1206
+ host?: string | null;
1207
+ };
882
1208
  export type HealthCheckConfig = {
883
1209
  interval_secs: number;
884
1210
  timeout_secs: number;
@@ -911,6 +1237,7 @@ export type IntegrationJson = {
911
1237
  auto_deploy: boolean;
912
1238
  status: string;
913
1239
  service_id?: string | null;
1240
+ function_id?: string | null;
914
1241
  preview_enabled: boolean;
915
1242
  preview_ttl_hours: number;
916
1243
  created_at: string;
@@ -1097,6 +1424,23 @@ export type MeResponse = {
1097
1424
  tools: Array<string>;
1098
1425
  limits: MeLimits;
1099
1426
  };
1427
+ export type NodeSummary = {
1428
+ active: number;
1429
+ cpu_cores: number;
1430
+ memory_gb: number;
1431
+ };
1432
+ /**
1433
+ * Body of `POST /api/v1/optimize` — the advisory analyzes the GIVEN
1434
+ * statement (the old description claimed it "analyzes the tenant's
1435
+ * database"; `sql` is required and unknown fields are rejected). Mirrors
1436
+ * server.rs `OptimizeBody`.
1437
+ */
1438
+ export type OptimizeQueryRequest = {
1439
+ /**
1440
+ * The SQL statement to analyze for index/rewrite advice.
1441
+ */
1442
+ sql: string;
1443
+ };
1100
1444
  /**
1101
1445
  * Response for `POST /v1/domains/{id}/ssl`.
1102
1446
  */
@@ -1112,6 +1456,38 @@ export type RecordConsentRequest = {
1112
1456
  consent_type: string;
1113
1457
  granted: boolean;
1114
1458
  };
1459
+ export type RegionCatalog = {
1460
+ regions: Array<RegionEntry>;
1461
+ };
1462
+ export type RegionEntry = {
1463
+ /**
1464
+ * Canonical region id (`eu-central-1`) — the value orgs/projects store
1465
+ * and placement matches on.
1466
+ */
1467
+ region: string;
1468
+ /**
1469
+ * Derived: `active` (has active DCs AND active nodes), `coming-soon`
1470
+ * (registered DCs, no active nodes yet), `maintenance` (no active DC).
1471
+ */
1472
+ status: string;
1473
+ datacenters: Array<DatacenterEntry>;
1474
+ nodes: NodeSummary;
1475
+ /**
1476
+ * REG-ARCH-02: registry-sourced metadata rollups (distinct, sorted,
1477
+ * from the region's datacenter rows — never fabricated in code).
1478
+ * Empty until the DC rows carry the columns (migration 050).
1479
+ */
1480
+ country_codes?: Array<string>;
1481
+ jurisdictions?: Array<string>;
1482
+ ingress_domains?: Array<string>;
1483
+ /**
1484
+ * Union of the region's datacenter `capabilities` (migration 052):
1485
+ * `compute`, `database`, `storage`. Registry facts only — empty (omitted)
1486
+ * until the DC rows carry the column's values, so UIs fall back to
1487
+ * neutral copy instead of inventing a tier.
1488
+ */
1489
+ capabilities?: Array<string>;
1490
+ };
1115
1491
  export type RequestStatus = 'pending' | 'in_progress' | 'completed' | 'rejected';
1116
1492
  /**
1117
1493
  * A Scalix Run service to deploy.
@@ -1383,6 +1759,24 @@ export type SignUpRequest = {
1383
1759
  } | null;
1384
1760
  captcha_token?: string | null;
1385
1761
  };
1762
+ /**
1763
+ * Spending cap configuration.
1764
+ */
1765
+ export type SpendingCapRequest = {
1766
+ /**
1767
+ * Monthly spend cap, in cents.
1768
+ */
1769
+ monthly_cap_cents: number;
1770
+ /**
1771
+ * Alert threshold as a percentage of the cap (e.g. 80 = alert at
1772
+ * 80%).
1773
+ */
1774
+ alert_threshold_pct?: number | null;
1775
+ /**
1776
+ * Hard-limit the org when the cap is reached (vs alert only).
1777
+ */
1778
+ hard_limit?: boolean | null;
1779
+ };
1386
1780
  /**
1387
1781
  * One column of a SQL result set.
1388
1782
  */
@@ -1435,6 +1829,13 @@ export type SqlRequest = {
1435
1829
  params?: {
1436
1830
  [key: string]: unknown;
1437
1831
  } | null;
1832
+ /**
1833
+ * Branch timeline to run the query against, as returned by
1834
+ * `scalix_db_branch_create` (optionally in its `db_<timeline>` connection-string
1835
+ * form). Omit for the project's primary. A timeline that is not a branch of
1836
+ * this project is rejected — it never falls back to the primary (F17).
1837
+ */
1838
+ timeline_id?: string | null;
1438
1839
  };
1439
1840
  /**
1440
1841
  * Result set returned by a SQL query. Matches the wire shape produced by
@@ -1491,6 +1892,47 @@ export type StorageStat = {
1491
1892
  gb_used: number;
1492
1893
  };
1493
1894
  export type Strategy = 'round_robin' | 'least_connections' | 'weighted_round_robin' | 'ip_hash';
1895
+ /**
1896
+ * Tax-info update (GST/VAT registration details).
1897
+ */
1898
+ export type TaxInfoRequest = {
1899
+ /**
1900
+ * Tax type ("gst", "vat", …).
1901
+ */
1902
+ tax_type: string;
1903
+ /**
1904
+ * Tax identification number.
1905
+ */
1906
+ tax_id: string;
1907
+ /**
1908
+ * ISO country code.
1909
+ */
1910
+ country_code: string;
1911
+ /**
1912
+ * Registered business name.
1913
+ */
1914
+ business_name?: string | null;
1915
+ /**
1916
+ * State/province code.
1917
+ */
1918
+ state_code?: string | null;
1919
+ /**
1920
+ * VAT number (EU).
1921
+ */
1922
+ vat_id?: string | null;
1923
+ /**
1924
+ * Reverse-charge applies (B2B intra-EU).
1925
+ */
1926
+ reverse_charge?: boolean;
1927
+ /**
1928
+ * Export LUT applies (India exports).
1929
+ */
1930
+ export_lut?: boolean;
1931
+ /**
1932
+ * The org is tax-exempt.
1933
+ */
1934
+ exempt?: boolean;
1935
+ };
1494
1936
  /**
1495
1937
  * A short-lived GitHub installation access token.
1496
1938
  */
@@ -1512,6 +1954,17 @@ export type UpdateIntegrationBody = {
1512
1954
  auto_build?: boolean | null;
1513
1955
  auto_deploy?: boolean | null;
1514
1956
  service_id?: string | null;
1957
+ /**
1958
+ * Tri-state like the functions crate's `cron_expression`: absent = keep
1959
+ * the current link, null = clear it (the console's "None" option), and a
1960
+ * string = set it. A plain Option cannot tell "clear" from "not sent",
1961
+ * which made an un-picked function target impossible to remove.
1962
+ * serde's derive alone is not enough: with a plain
1963
+ * `Option<Option<String>>`, JSON `null` also deserializes to `None`
1964
+ * (reads as "absent"), so the custom deserializer below lifts a present
1965
+ * field — null included — into the outer Some.
1966
+ */
1967
+ function_id?: string | null;
1515
1968
  preview_enabled?: boolean | null;
1516
1969
  preview_ttl_hours?: number | null;
1517
1970
  status?: string | null;
@@ -1555,12 +2008,13 @@ export type UserInfo = {
1555
2008
  last_login_at?: string | null;
1556
2009
  };
1557
2010
  /**
1558
- * A single vector entry for upsert.
2011
+ * One entry inside a `VectorUpsertRequest` batch — no `collection` (the
2012
+ * wrapper carries it) and `metadata` optional on this path.
1559
2013
  */
1560
- export type VectorEntry = {
2014
+ export type VectorBatchEntry = {
1561
2015
  id: string;
1562
2016
  /**
1563
- * The embedding values.
2017
+ * Embedding values — length must equal the collection's dimensions.
1564
2018
  */
1565
2019
  embedding: Array<number>;
1566
2020
  metadata?: {
@@ -1568,18 +2022,71 @@ export type VectorEntry = {
1568
2022
  } | null;
1569
2023
  };
1570
2024
  /**
1571
- * A nearest-neighbour vector search.
2025
+ * Create a vector collection — the real body (previously undocumented).
2026
+ * Mirrors `vector::CreateCollectionRequest`.
2027
+ */
2028
+ export type VectorCollectionCreateRequest = {
2029
+ /**
2030
+ * Collection name — unique per tenant.
2031
+ */
2032
+ name: string;
2033
+ /**
2034
+ * Embedding dimensionality; every entry must match exactly.
2035
+ */
2036
+ dimensions: number;
2037
+ /**
2038
+ * Similarity metric.
2039
+ */
2040
+ distance_metric: VectorDistanceMetric;
2041
+ };
2042
+ /**
2043
+ * Distance metric for a collection (lowercase on the wire; `dot` also
2044
+ * accepts the `inner_product` spelling). Mirrors `vector::DistanceMetric`.
2045
+ */
2046
+ export type VectorDistanceMetric = 'cosine' | 'euclidean' | 'dot';
2047
+ /**
2048
+ * ONE vector entry — the flat body of `POST /vectors/upsert` (all four
2049
+ * fields required, unknown fields rejected). Mirrors `crate::vector::
2050
+ * VectorEntry`, the enforcing struct. The `{collection, entries[]}` wrapper
2051
+ * is `VectorUpsertRequest`, which ONLY `/vectors/batch/upsert` accepts — the
2052
+ * audit's documented-body-422 came from this exact mix-up.
2053
+ */
2054
+ export type VectorEntry = {
2055
+ /**
2056
+ * Stable entry id within the collection.
2057
+ */
2058
+ id: string;
2059
+ /**
2060
+ * Collection name — collections are keyed by NAME (there is no
2061
+ * collection_id anywhere in the API).
2062
+ */
2063
+ collection: string;
2064
+ /**
2065
+ * Embedding values — length must equal the collection's dimensions.
2066
+ */
2067
+ embedding: Array<number>;
2068
+ /**
2069
+ * Metadata stored alongside the vector. Required — send `{}` for none.
2070
+ */
2071
+ metadata: {
2072
+ [key: string]: unknown;
2073
+ };
2074
+ };
2075
+ /**
2076
+ * A nearest-neighbour vector search. Mirrors `vector::VectorSearchRequest`
2077
+ * (unknown fields rejected).
1572
2078
  */
1573
2079
  export type VectorSearchRequest = {
1574
2080
  collection: string;
1575
2081
  /**
1576
- * The query embedding.
2082
+ * The query embedding — length must equal the collection's dimensions.
1577
2083
  */
1578
2084
  query_vector: Array<number>;
1579
2085
  /**
1580
- * Number of nearest neighbours to return.
2086
+ * Number of nearest neighbours to return. REQUIRED — there is no server
2087
+ * default (the contract previously marked it optional; omitting it 422s).
1581
2088
  */
1582
- top_k?: number | null;
2089
+ top_k: number;
1583
2090
  /**
1584
2091
  * Optional metadata filter.
1585
2092
  */
@@ -1588,11 +2095,12 @@ export type VectorSearchRequest = {
1588
2095
  } | null;
1589
2096
  };
1590
2097
  /**
1591
- * Upsert a batch of vectors into a collection.
2098
+ * Batch upsert body — `POST /vectors/batch/upsert` ONLY (one multi-row
2099
+ * write; returns the upserted count with 201).
1592
2100
  */
1593
2101
  export type VectorUpsertRequest = {
1594
2102
  collection: string;
1595
- entries: Array<VectorEntry>;
2103
+ entries: Array<VectorBatchEntry>;
1596
2104
  };
1597
2105
  /**
1598
2106
  * Response for `POST /v1/domains/{id}/verify`.
@@ -1722,12 +2230,66 @@ export type WafStatsResponse = {
1722
2230
  ddos: DdosStats;
1723
2231
  };
1724
2232
  /**
1725
- * Register a webhook endpoint for a set of event types.
2233
+ * Register a webhook endpoint (POST). Unknown fields are rejected; `active`
2234
+ * is PUT-only. `secret` is optional — auto-generated (32-byte hex) when
2235
+ * omitted and returned ONCE in the 201 body. Deliveries carry
2236
+ * `X-Webhook-Signature` (hex HMAC-SHA256 of the raw body) and
2237
+ * `X-Webhook-Event`; the endpoint auto-disables after 10 consecutive
2238
+ * delivery failures.
1726
2239
  */
1727
- export type WebhookRequest = {
2240
+ export type WebhookCreateRequest = {
2241
+ /**
2242
+ * Public http/https delivery URL (SSRF-guarded at registration and at
2243
+ * every delivery).
2244
+ */
1728
2245
  url: string;
1729
- events: Array<string>;
2246
+ /**
2247
+ * Event types to deliver — case-sensitive PascalCase.
2248
+ */
2249
+ events: Array<WebhookEventName>;
2250
+ /**
2251
+ * Optional HMAC signing secret; auto-generated and shown once if omitted.
2252
+ */
2253
+ secret?: string | null;
2254
+ };
2255
+ /**
2256
+ * The webhook `events` element — case-sensitive wire names accepted by
2257
+ * `CreateWebhookRequest` (the audit found this enum existed nowhere in the
2258
+ * contract while the error sanitizer withheld serde's variant list).
2259
+ */
2260
+ export type WebhookEventName = 'Insert' | 'Update' | 'Delete' | 'SchemaChange' | 'TokenCreated' | 'TokenRevoked' | 'SandboxCreated' | 'SandboxDestroyed' | 'ApiKeyExpiringSoon' | 'ApprovalRequired' | 'ApprovalGranted' | 'ApprovalRejected';
2261
+ /**
2262
+ * Fire a test delivery at a registered webhook (POST `.../webhooks/{id}/test`).
2263
+ * BOTH fields are required and unknown fields are rejected — mirrors the
2264
+ * gateway's runtime `TestWebhookBody` (`deny_unknown_fields`). The re-audit
2265
+ * 2026-10-23 got 415 on every guessed body because this operation published
2266
+ * no requestBody at all. The response reports how many webhooks were
2267
+ * triggered (`{"triggered_webhooks": n}`); delivery outcome lands in the
2268
+ * webhook's deliveries list, not in this response.
2269
+ */
2270
+ export type WebhookTestRequest = {
2271
+ /**
2272
+ * Event to deliver — same case-sensitive enum as registration `events`.
2273
+ */
2274
+ event: WebhookEventName;
2275
+ /**
2276
+ * JSON body delivered to the endpoint as the event payload.
2277
+ */
2278
+ payload: {
2279
+ [key: string]: unknown;
2280
+ };
2281
+ };
2282
+ /**
2283
+ * Update a registered webhook (PUT). Every field is optional — supplied
2284
+ * fields replace; this is the only surface that accepts `active`.
2285
+ */
2286
+ export type WebhookUpdateRequest = {
2287
+ url?: string | null;
2288
+ events?: Array<WebhookEventName> | null;
1730
2289
  secret?: string | null;
2290
+ /**
2291
+ * Pause (false) / resume (true) deliveries.
2292
+ */
1731
2293
  active?: boolean | null;
1732
2294
  };
1733
2295
  export type GenerateSpeechData = {
@@ -3218,17 +3780,16 @@ export type ListCronSchedulesResponses = {
3218
3780
  200: unknown;
3219
3781
  };
3220
3782
  export type CreateCronScheduleData = {
3221
- /**
3222
- * Create-schedule request
3223
- */
3224
- body: {
3225
- [key: string]: unknown;
3226
- };
3783
+ body: CronScheduleCreateRequest;
3227
3784
  path?: never;
3228
3785
  query?: never;
3229
3786
  url: '/v1/cron/schedules';
3230
3787
  };
3231
3788
  export type CreateCronScheduleErrors = {
3789
+ /**
3790
+ * Invalid body (e.g. `expression` instead of `cron_expression`, or action_type outside function/webhook)
3791
+ */
3792
+ 400: ErrorResponse;
3232
3793
  /**
3233
3794
  * Missing or invalid API key
3234
3795
  */
@@ -3302,12 +3863,7 @@ export type GetCronScheduleResponses = {
3302
3863
  200: unknown;
3303
3864
  };
3304
3865
  export type UpdateCronScheduleData = {
3305
- /**
3306
- * Update-schedule request
3307
- */
3308
- body: {
3309
- [key: string]: unknown;
3310
- };
3866
+ body: CronScheduleUpdateRequest;
3311
3867
  path: {
3312
3868
  /**
3313
3869
  * Schedule id
@@ -3490,9 +4046,9 @@ export type DeleteDatabaseErrors = {
3490
4046
  export type DeleteDatabaseError = DeleteDatabaseErrors[keyof DeleteDatabaseErrors];
3491
4047
  export type DeleteDatabaseResponses = {
3492
4048
  /**
3493
- * Database scheduled for deletion
4049
+ * Database scheduled for deletion (async teardown; the row enters its recovery grace window)
3494
4050
  */
3495
- 200: unknown;
4051
+ 202: unknown;
3496
4052
  };
3497
4053
  export type GetDatabaseData = {
3498
4054
  body?: never;
@@ -3859,7 +4415,7 @@ export type ListEventTopicsResponses = {
3859
4415
  200: unknown;
3860
4416
  };
3861
4417
  export type CreateEventTopicData = {
3862
- body?: never;
4418
+ body: CreateEventTopicRequest;
3863
4419
  path?: never;
3864
4420
  query?: never;
3865
4421
  url: '/v1/events/topics';
@@ -3869,6 +4425,10 @@ export type CreateEventTopicErrors = {
3869
4425
  * Missing or invalid API key
3870
4426
  */
3871
4427
  401: ErrorResponse;
4428
+ /**
4429
+ * A topic with this name already exists in the project (ALREADY_EXISTS)
4430
+ */
4431
+ 409: ErrorResponse;
3872
4432
  /**
3873
4433
  * Internal error
3874
4434
  */
@@ -4027,12 +4587,7 @@ export type ListTopicSubscriptionsResponses = {
4027
4587
  200: unknown;
4028
4588
  };
4029
4589
  export type CreateEventSubscriptionData = {
4030
- /**
4031
- * Subscription request
4032
- */
4033
- body: {
4034
- [key: string]: unknown;
4035
- };
4590
+ body: CreateEventSubscriptionRequest;
4036
4591
  path: {
4037
4592
  /**
4038
4593
  * Topic id or name
@@ -4393,6 +4948,26 @@ export type KvSetResponses = {
4393
4948
  */
4394
4949
  200: unknown;
4395
4950
  };
4951
+ export type ListRegionsData = {
4952
+ body?: never;
4953
+ path?: never;
4954
+ query?: never;
4955
+ url: '/v1/regions';
4956
+ };
4957
+ export type ListRegionsErrors = {
4958
+ /**
4959
+ * Internal error
4960
+ */
4961
+ 500: ErrorResponse;
4962
+ };
4963
+ export type ListRegionsError = ListRegionsErrors[keyof ListRegionsErrors];
4964
+ export type ListRegionsResponses = {
4965
+ /**
4966
+ * The live region catalog
4967
+ */
4968
+ 200: RegionCatalog;
4969
+ };
4970
+ export type ListRegionsResponse = ListRegionsResponses[keyof ListRegionsResponses];
4396
4971
  export type SandboxListData = {
4397
4972
  body?: never;
4398
4973
  path?: never;
@@ -4884,7 +5459,7 @@ export type GetKeysUsageErrors = {
4884
5459
  export type GetKeysUsageError = GetKeysUsageErrors[keyof GetKeysUsageErrors];
4885
5460
  export type GetKeysUsageResponses = {
4886
5461
  /**
4887
- * Per-API-key request counts for the current month
5462
+ * The organization's API keys with IAM-tracked metadata (id, name, prefix, last_used_at). Per-key request counts are NOT tracked — metering is keyed by org/project; see /v1/usage/{id} for usage totals.
4888
5463
  */
4889
5464
  200: KeysUsageResponse;
4890
5465
  };