@distilled.cloud/xata 0.0.0 → 1.0.0-rc.11

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 (47) hide show
  1. package/LICENSE +201 -0
  2. package/lib/credentials.d.ts +29 -0
  3. package/lib/credentials.d.ts.map +1 -0
  4. package/lib/credentials.js +35 -0
  5. package/lib/credentials.js.map +1 -0
  6. package/lib/errors.d.ts +36 -0
  7. package/lib/errors.d.ts.map +1 -0
  8. package/lib/errors.js +26 -0
  9. package/lib/errors.js.map +1 -0
  10. package/lib/index.d.ts +24 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +28 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/pagination.d.ts +9 -0
  15. package/lib/pagination.d.ts.map +1 -0
  16. package/lib/pagination.js +9 -0
  17. package/lib/pagination.js.map +1 -0
  18. package/lib/protocol.d.ts +18 -0
  19. package/lib/protocol.d.ts.map +1 -0
  20. package/lib/protocol.js +45 -0
  21. package/lib/protocol.js.map +1 -0
  22. package/lib/retry.d.ts +32 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +32 -0
  25. package/lib/retry.js.map +1 -0
  26. package/lib/services/index.d.ts +2 -0
  27. package/lib/services/index.d.ts.map +1 -0
  28. package/lib/services/index.js +3 -0
  29. package/lib/services/index.js.map +1 -0
  30. package/lib/services/xata.d.ts +1973 -0
  31. package/lib/services/xata.d.ts.map +1 -0
  32. package/lib/services/xata.js +1996 -0
  33. package/lib/services/xata.js.map +1 -0
  34. package/lib/traits.d.ts +11 -0
  35. package/lib/traits.d.ts.map +1 -0
  36. package/lib/traits.js +11 -0
  37. package/lib/traits.js.map +1 -0
  38. package/package.json +77 -6
  39. package/src/credentials.ts +57 -0
  40. package/src/errors.ts +50 -0
  41. package/src/index.ts +31 -0
  42. package/src/pagination.ts +8 -0
  43. package/src/protocol.ts +69 -0
  44. package/src/retry.ts +54 -0
  45. package/src/services/index.ts +2 -0
  46. package/src/services/xata.ts +4907 -0
  47. package/src/traits.ts +44 -0
@@ -0,0 +1,4907 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-xata). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as Redacted from "effect/Redacted";
4
+ import * as API from "@distilled.cloud/core/api";
5
+ import * as C from "@distilled.cloud/core/category";
6
+ import * as T from "../traits.ts";
7
+ import {
8
+ XataProtocol,
9
+ type XataOpError,
10
+ type XataOpContext,
11
+ } from "../protocol.ts";
12
+ import { UnknownXataError } from "../errors.ts";
13
+ import * as Retry from "../retry.ts";
14
+
15
+ export type { XataOpError, XataOpContext };
16
+
17
+ export class BadRequest
18
+ extends /*@__PURE__*/ T.applyErrorMatchers(
19
+ /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
20
+ code: S.Number,
21
+ message: S.String,
22
+ }).pipe(C.withBadRequestError),
23
+ [{ status: 400 }],
24
+ ) {}
25
+
26
+ export class Conflict
27
+ extends /*@__PURE__*/ T.applyErrorMatchers(
28
+ /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
29
+ code: S.Number,
30
+ message: S.String,
31
+ }).pipe(C.withConflictError),
32
+ [{ status: 409 }],
33
+ ) {}
34
+
35
+ export class Forbidden
36
+ extends /*@__PURE__*/ T.applyErrorMatchers(
37
+ /*@__PURE__*/ S.TaggedError<Forbidden>()("Forbidden", {
38
+ code: S.Number,
39
+ message: S.String,
40
+ }).pipe(C.withAuthError),
41
+ [{ status: 403 }],
42
+ ) {}
43
+
44
+ export class NotFound
45
+ extends /*@__PURE__*/ T.applyErrorMatchers(
46
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
47
+ code: S.Number,
48
+ message: S.String,
49
+ }).pipe(C.withBadRequestError),
50
+ [{ status: 404 }],
51
+ ) {}
52
+
53
+ /** Log attribute to filter on. */
54
+ export type LogFilterField = "instance" | "level" | "process" | "body";
55
+ export const LogFilterField = S.String;
56
+
57
+ /** Match operator. */
58
+ export type LogFilterOp = "in" | "contains" | "icontains" | "regex" | "iregex";
59
+ export const LogFilterOp = S.String;
60
+
61
+ /** Used with `op: in`. */
62
+ export type LogFilterValuesList = Array<string>;
63
+ export const LogFilterValuesList = /*@__PURE__*/ S.Array(
64
+ S.String,
65
+ ) as any as S.Schema<LogFilterValuesList>;
66
+
67
+ /** A single filter on log entries. */
68
+ export interface LogFilter {
69
+ /** Log attribute to filter on. */
70
+ field: LogFilterField | (string & {});
71
+ /** Match operator. */
72
+ op: LogFilterOp | (string & {});
73
+ /** Used with `op: in`. */
74
+ values?: LogFilterValuesList;
75
+ /** Used with the body operators. */
76
+ value?: string;
77
+ }
78
+ export const LogFilter = /*@__PURE__*/ S.suspend(() =>
79
+ S.Struct({
80
+ field: LogFilterField,
81
+ op: LogFilterOp,
82
+ values: S.optional(LogFilterValuesList),
83
+ value: S.optional(S.String),
84
+ }),
85
+ ).annotate({ identifier: "LogFilter" }) as any as S.Schema<LogFilter>;
86
+
87
+ /** Filters applied to log entries. Multiple filters are combined with AND. */
88
+ export type BranchLogsRequestFiltersList = Array<LogFilter>;
89
+ export const BranchLogsRequestFiltersList = /*@__PURE__*/ S.Array(
90
+ LogFilter,
91
+ ) as any as S.Schema<BranchLogsRequestFiltersList>;
92
+
93
+ export interface BranchLogsRequest {
94
+ organizationID: string;
95
+ projectID: string;
96
+ branchID: string;
97
+ /** Start time */
98
+ start: string;
99
+ /** End time */
100
+ end: string;
101
+ /** Filters applied to log entries. Multiple filters are combined with AND. */
102
+ filters?: BranchLogsRequestFiltersList;
103
+ limit?: number;
104
+ /** Pagination cursor from a previous response */
105
+ cursor?: string;
106
+ }
107
+ export const BranchLogsRequest = /*@__PURE__*/ S.suspend(() =>
108
+ S.Struct({
109
+ organizationID: S.String.pipe(T.Label()),
110
+ projectID: S.String.pipe(T.Label()),
111
+ branchID: S.String.pipe(T.Label()),
112
+ start: S.String,
113
+ end: S.String,
114
+ filters: S.optional(BranchLogsRequestFiltersList),
115
+ limit: S.optional(S.Number),
116
+ cursor: S.optional(S.String),
117
+ }).pipe(
118
+ T.Http({
119
+ method: "POST",
120
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/logs",
121
+ code: 200,
122
+ }),
123
+ ),
124
+ ).annotate({
125
+ identifier: "BranchLogsRequest",
126
+ }) as any as S.Schema<BranchLogsRequest>;
127
+
128
+ /** Log level enumeration */
129
+ export type LogLevel = "debug" | "info" | "warning" | "error";
130
+ export const LogLevel = S.String;
131
+
132
+ export interface LogEntry {
133
+ timestamp: string;
134
+ instanceID: string;
135
+ level?: LogLevel;
136
+ message: string;
137
+ /** Name of the PostgreSQL process that emitted the log */
138
+ process?: string;
139
+ }
140
+ export const LogEntry = /*@__PURE__*/ S.suspend(() =>
141
+ S.Struct({
142
+ timestamp: S.String,
143
+ instanceID: S.String,
144
+ level: S.optional(LogLevel),
145
+ message: S.String,
146
+ process: S.optional(S.String),
147
+ }),
148
+ ).annotate({ identifier: "LogEntry" }) as any as S.Schema<LogEntry>;
149
+
150
+ export type BranchLogsLogsList = Array<LogEntry>;
151
+ export const BranchLogsLogsList = /*@__PURE__*/ S.Array(
152
+ LogEntry,
153
+ ) as any as S.Schema<BranchLogsLogsList>;
154
+
155
+ /** A collection of logs for each of the instances of a branch */
156
+ export interface BranchLogs {
157
+ start: string;
158
+ end: string;
159
+ logs: BranchLogsLogsList;
160
+ /** Pagination cursor for the next page */
161
+ nextCursor: string | null;
162
+ }
163
+ export const BranchLogs = /*@__PURE__*/ S.suspend(() =>
164
+ S.Struct({
165
+ start: S.String,
166
+ end: S.String,
167
+ logs: BranchLogsLogsList,
168
+ nextCursor: S.NullOr(S.String),
169
+ }),
170
+ ).annotate({ identifier: "BranchLogs" }) as any as S.Schema<BranchLogs>;
171
+
172
+ /** Name of a branch metric exposed by the API. */
173
+ export type BranchMetricName =
174
+ | "cpu"
175
+ | "memory"
176
+ | "disk"
177
+ | "connections_active"
178
+ | "connections_idle"
179
+ | "network_ingress"
180
+ | "network_egress"
181
+ | "iops_read"
182
+ | "iops_write"
183
+ | "latency_read"
184
+ | "latency_write"
185
+ | "throughput_read"
186
+ | "throughput_write"
187
+ | "wal_sync_time"
188
+ | "replication_lag_time";
189
+ export const BranchMetricName = S.String;
190
+
191
+ /** List of metric names to query. */
192
+ export type BranchMetricsRequestMetricsList = Array<
193
+ BranchMetricName | (string & {})
194
+ >;
195
+ export const BranchMetricsRequestMetricsList = /*@__PURE__*/ S.Array(
196
+ BranchMetricName,
197
+ ) as any as S.Schema<BranchMetricsRequestMetricsList>;
198
+
199
+ /** List of instance IDs to query */
200
+ export type BranchMetricsRequestInstancesList = Array<string>;
201
+ export const BranchMetricsRequestInstancesList = /*@__PURE__*/ S.Array(
202
+ S.String,
203
+ ) as any as S.Schema<BranchMetricsRequestInstancesList>;
204
+
205
+ export type BranchMetricsRequestAggregationsItem = "avg" | "max" | "min";
206
+ export const BranchMetricsRequestAggregationsItem = S.String;
207
+
208
+ /** List of aggregations to get, this is how the data-points within the interval are aggregated. Each one will generate a separate time-series per metric in the response. */
209
+ export type BranchMetricsRequestAggregationsList = Array<
210
+ BranchMetricsRequestAggregationsItem | (string & {})
211
+ >;
212
+ export const BranchMetricsRequestAggregationsList = /*@__PURE__*/ S.Array(
213
+ BranchMetricsRequestAggregationsItem,
214
+ ) as any as S.Schema<BranchMetricsRequestAggregationsList>;
215
+
216
+ export interface BranchMetricsRequest {
217
+ organizationID: string;
218
+ projectID: string;
219
+ branchID: string;
220
+ /** Start time */
221
+ start: string;
222
+ /** End time */
223
+ end: string;
224
+ /** List of metric names to query. */
225
+ metrics: BranchMetricsRequestMetricsList;
226
+ /** List of instance IDs to query */
227
+ instances?: BranchMetricsRequestInstancesList;
228
+ /** List of aggregations to get, this is how the data-points within the interval are aggregated. Each one will generate a separate time-series per metric in the response. */
229
+ aggregations: BranchMetricsRequestAggregationsList;
230
+ }
231
+ export const BranchMetricsRequest = /*@__PURE__*/ S.suspend(() =>
232
+ S.Struct({
233
+ organizationID: S.String.pipe(T.Label()),
234
+ projectID: S.String.pipe(T.Label()),
235
+ branchID: S.String.pipe(T.Label()),
236
+ start: S.String,
237
+ end: S.String,
238
+ metrics: BranchMetricsRequestMetricsList,
239
+ instances: S.optional(BranchMetricsRequestInstancesList),
240
+ aggregations: BranchMetricsRequestAggregationsList,
241
+ }).pipe(
242
+ T.Http({
243
+ method: "POST",
244
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/metrics",
245
+ code: 200,
246
+ }),
247
+ ),
248
+ ).annotate({
249
+ identifier: "BranchMetricsRequest",
250
+ }) as any as S.Schema<BranchMetricsRequest>;
251
+
252
+ /** The aggregation used to generate this time-series */
253
+ export type MetricSeriesAggregation = "avg" | "max" | "min";
254
+ export const MetricSeriesAggregation = S.String;
255
+
256
+ export interface MetricSeriesValuesItem {
257
+ timestamp: string;
258
+ value: number;
259
+ }
260
+ export const MetricSeriesValuesItem = /*@__PURE__*/ S.suspend(() =>
261
+ S.Struct({
262
+ timestamp: S.String,
263
+ value: S.Number,
264
+ }),
265
+ ).annotate({
266
+ identifier: "MetricSeriesValuesItem",
267
+ }) as any as S.Schema<MetricSeriesValuesItem>;
268
+
269
+ export type MetricSeriesValuesList = Array<MetricSeriesValuesItem>;
270
+ export const MetricSeriesValuesList = /*@__PURE__*/ S.Array(
271
+ MetricSeriesValuesItem,
272
+ ) as any as S.Schema<MetricSeriesValuesList>;
273
+
274
+ /** The metric series */
275
+ export interface MetricSeries {
276
+ /** ID of the instance */
277
+ instanceID: string;
278
+ /** The aggregation used to generate this time-series */
279
+ aggregation: MetricSeriesAggregation;
280
+ values: MetricSeriesValuesList;
281
+ }
282
+ export const MetricSeries = /*@__PURE__*/ S.suspend(() =>
283
+ S.Struct({
284
+ instanceID: S.String,
285
+ aggregation: MetricSeriesAggregation,
286
+ values: MetricSeriesValuesList,
287
+ }),
288
+ ).annotate({ identifier: "MetricSeries" }) as any as S.Schema<MetricSeries>;
289
+
290
+ export type BranchMetricResultSeriesList = Array<MetricSeries>;
291
+ export const BranchMetricResultSeriesList = /*@__PURE__*/ S.Array(
292
+ MetricSeries,
293
+ ) as any as S.Schema<BranchMetricResultSeriesList>;
294
+
295
+ /** Time-series for a single metric. */
296
+ export interface BranchMetricResult {
297
+ /** Name of the queried metric. */
298
+ metric: string;
299
+ /** Unit of the metric (percentage, bytes, ms, etc.) */
300
+ unit: string;
301
+ series: BranchMetricResultSeriesList;
302
+ }
303
+ export const BranchMetricResult = /*@__PURE__*/ S.suspend(() =>
304
+ S.Struct({
305
+ metric: S.String,
306
+ unit: S.String,
307
+ series: BranchMetricResultSeriesList,
308
+ }),
309
+ ).annotate({
310
+ identifier: "BranchMetricResult",
311
+ }) as any as S.Schema<BranchMetricResult>;
312
+
313
+ /** One entry per requested metric, in the order the metrics were requested. */
314
+ export type BranchMetricsResultsList = Array<BranchMetricResult>;
315
+ export const BranchMetricsResultsList = /*@__PURE__*/ S.Array(
316
+ BranchMetricResult,
317
+ ) as any as S.Schema<BranchMetricsResultsList>;
318
+
319
+ /** A collection of metrics (cpu, memory, disk,...) for each of the instances of a branch */
320
+ export interface BranchMetrics {
321
+ start: string;
322
+ end: string;
323
+ /** One entry per requested metric, in the order the metrics were requested. */
324
+ results: BranchMetricsResultsList;
325
+ }
326
+ export const BranchMetrics = /*@__PURE__*/ S.suspend(() =>
327
+ S.Struct({
328
+ start: S.String,
329
+ end: S.String,
330
+ results: BranchMetricsResultsList,
331
+ }),
332
+ ).annotate({ identifier: "BranchMetrics" }) as any as S.Schema<BranchMetrics>;
333
+
334
+ export interface CreateBillingCheckoutSessionRequest {
335
+ /** Unique identifier for a specific organization */
336
+ organizationID: string;
337
+ }
338
+ export const CreateBillingCheckoutSessionRequest = /*@__PURE__*/ S.suspend(() =>
339
+ S.Struct({
340
+ organizationID: S.String.pipe(T.Label()),
341
+ }).pipe(
342
+ T.Http({
343
+ method: "POST",
344
+ uri: "/organizations/{organizationID}/billing/checkout-session",
345
+ code: 200,
346
+ }),
347
+ ),
348
+ ).annotate({
349
+ identifier: "CreateBillingCheckoutSessionRequest",
350
+ }) as any as S.Schema<CreateBillingCheckoutSessionRequest>;
351
+
352
+ export interface BillingCheckoutSessionResponse {
353
+ /** Stripe checkout session URL */
354
+ url: string;
355
+ }
356
+ export const BillingCheckoutSessionResponse = /*@__PURE__*/ S.suspend(() =>
357
+ S.Struct({
358
+ url: S.String,
359
+ }),
360
+ ).annotate({
361
+ identifier: "BillingCheckoutSessionResponse",
362
+ }) as any as S.Schema<BillingCheckoutSessionResponse>;
363
+
364
+ export interface CreateBillingPaymentMethodSessionRequest {
365
+ /** Unique identifier for a specific organization */
366
+ organizationID: string;
367
+ }
368
+ export const CreateBillingPaymentMethodSessionRequest = /*@__PURE__*/ S.suspend(
369
+ () =>
370
+ S.Struct({
371
+ organizationID: S.String.pipe(T.Label()),
372
+ }).pipe(
373
+ T.Http({
374
+ method: "POST",
375
+ uri: "/organizations/{organizationID}/billing/payment-method-session",
376
+ code: 200,
377
+ }),
378
+ ),
379
+ ).annotate({
380
+ identifier: "CreateBillingPaymentMethodSessionRequest",
381
+ }) as any as S.Schema<CreateBillingPaymentMethodSessionRequest>;
382
+
383
+ export interface BillingPaymentMethodSessionResponse {
384
+ /** Stripe payment method session URL */
385
+ url: string;
386
+ }
387
+ export const BillingPaymentMethodSessionResponse = /*@__PURE__*/ S.suspend(() =>
388
+ S.Struct({
389
+ url: S.String,
390
+ }),
391
+ ).annotate({
392
+ identifier: "BillingPaymentMethodSessionResponse",
393
+ }) as any as S.Schema<BillingPaymentMethodSessionResponse>;
394
+
395
+ /** Configuration for scaling branches to zero when not in use */
396
+ export interface ScaleToZeroConfiguration {
397
+ /** Whether scale to zero is enabled */
398
+ enabled: boolean;
399
+ /** Duration in minutes after which branches will be hibernated if not accessed */
400
+ inactivityPeriodMinutes: number;
401
+ }
402
+ export const ScaleToZeroConfiguration = /*@__PURE__*/ S.suspend(() =>
403
+ S.Struct({
404
+ enabled: S.Boolean,
405
+ inactivityPeriodMinutes: S.Number,
406
+ }),
407
+ ).annotate({
408
+ identifier: "ScaleToZeroConfiguration",
409
+ }) as any as S.Schema<ScaleToZeroConfiguration>;
410
+
411
+ /** Details about the branch continuous backup configuration */
412
+ export interface BackupConfiguration {
413
+ /** how long are we keeping the backups around for */
414
+ retentionPeriod?: number;
415
+ /** time of day/week when we are taking a full backup */
416
+ backupTime?: string;
417
+ }
418
+ export const BackupConfiguration = /*@__PURE__*/ S.suspend(() =>
419
+ S.Struct({
420
+ retentionPeriod: S.optional(S.Number),
421
+ backupTime: S.optional(S.String),
422
+ }),
423
+ ).annotate({
424
+ identifier: "BackupConfiguration",
425
+ }) as any as S.Schema<BackupConfiguration>;
426
+
427
+ /** The mode used to discriminate between types of branches. */
428
+ export type CreateBranchRequestMode = "inherit" | "custom";
429
+ export const CreateBranchRequestMode = S.String;
430
+
431
+ export interface CreateBranchRequest {
432
+ /** Unique identifier of the organization containing the project */
433
+ organizationID: string;
434
+ /** Unique identifier of the project to create the branch in */
435
+ projectID: string;
436
+ /** Human-readable name for the new branch */
437
+ name: string;
438
+ /** Optional description for the branch purpose or contents (max 50 characters) */
439
+ description?: string;
440
+ scaleToZero?: ScaleToZeroConfiguration;
441
+ backupConfiguration?: BackupConfiguration;
442
+ /** The mode used to discriminate between types of branches. */
443
+ mode: CreateBranchRequestMode | (string & {});
444
+ }
445
+ export const CreateBranchRequest = /*@__PURE__*/ S.suspend(() =>
446
+ S.Struct({
447
+ organizationID: S.String.pipe(T.Label()),
448
+ projectID: S.String.pipe(T.Label()),
449
+ name: S.String,
450
+ description: S.optional(S.String),
451
+ scaleToZero: S.optional(ScaleToZeroConfiguration),
452
+ backupConfiguration: S.optional(BackupConfiguration),
453
+ mode: CreateBranchRequestMode,
454
+ }).pipe(
455
+ T.Http({
456
+ method: "POST",
457
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches",
458
+ code: 200,
459
+ }),
460
+ ),
461
+ ).annotate({
462
+ identifier: "CreateBranchRequest",
463
+ }) as any as S.Schema<CreateBranchRequest>;
464
+
465
+ /** Basic metadata about a branch, used in response to create/update operations */
466
+ export interface BranchShortMetadata {
467
+ /** Unique identifier for the branch */
468
+ id: string;
469
+ /** Human-readable name of the branch */
470
+ name: string;
471
+ /** Optional description of the branch purpose or contents */
472
+ description?: string;
473
+ /** Timestamp when the branch was created */
474
+ createdAt: string;
475
+ /** Timestamp when the branch was last updated */
476
+ updatedAt: string;
477
+ /** Identifier of the parent branch if this is a derived branch, null otherwise */
478
+ parentID?: string | null;
479
+ /** Deprecated: retrieve the connection string from the branch credentials endpoint (GET .../branches/{branchID}/credentials) instead. The hostname in this connection string carries a -deprecated marker in its first DNS label. */
480
+ connectionString?: string | Redacted.Redacted<string> | null;
481
+ /** Geographic region where the branch is deployed */
482
+ region: string;
483
+ /** Whether the branch allows public access without authentication */
484
+ publicAccess: boolean;
485
+ }
486
+ export const BranchShortMetadata = /*@__PURE__*/ S.suspend(() =>
487
+ S.Struct({
488
+ id: S.String,
489
+ name: S.String,
490
+ description: S.optional(S.String),
491
+ createdAt: S.String,
492
+ updatedAt: S.String,
493
+ parentID: S.optional(S.NullOr(S.String)),
494
+ connectionString: S.optional(S.NullOr(S.String).pipe(T.SensitiveValue({}))),
495
+ region: S.String,
496
+ publicAccess: S.Boolean,
497
+ }),
498
+ ).annotate({
499
+ identifier: "BranchShortMetadata",
500
+ }) as any as S.Schema<BranchShortMetadata>;
501
+
502
+ export interface CreateGithubAppInstallationRequest {
503
+ /** Unique identifier of the organization */
504
+ organizationID: string;
505
+ /** GitHub App installation ID */
506
+ installationId: number;
507
+ }
508
+ export const CreateGithubAppInstallationRequest = /*@__PURE__*/ S.suspend(() =>
509
+ S.Struct({
510
+ organizationID: S.String.pipe(T.Label()),
511
+ installationId: S.Number,
512
+ }).pipe(
513
+ T.Http({
514
+ method: "POST",
515
+ uri: "/organizations/{organizationID}/githubapp/installations",
516
+ code: 200,
517
+ }),
518
+ ),
519
+ ).annotate({
520
+ identifier: "CreateGithubAppInstallationRequest",
521
+ }) as any as S.Schema<CreateGithubAppInstallationRequest>;
522
+
523
+ /** A GitHub App installation associated with an organization */
524
+ export interface GithubInstallation {
525
+ /** Unique identifier of the installation record */
526
+ id: string;
527
+ /** GitHub App installation ID */
528
+ installationId: number;
529
+ /** Organization ID this installation belongs to */
530
+ organization: string;
531
+ /** Timestamp when the installation was created */
532
+ createdAt: string;
533
+ /** Timestamp when the installation was last updated */
534
+ updatedAt: string;
535
+ }
536
+ export const GithubInstallation = /*@__PURE__*/ S.suspend(() =>
537
+ S.Struct({
538
+ id: S.String,
539
+ installationId: S.Number,
540
+ organization: S.String,
541
+ createdAt: S.String,
542
+ updatedAt: S.String,
543
+ }),
544
+ ).annotate({
545
+ identifier: "GithubInstallation",
546
+ }) as any as S.Schema<GithubInstallation>;
547
+
548
+ export interface CreateGithubRepositoryRequest {
549
+ /** Unique identifier of the organization */
550
+ organizationID: string;
551
+ /** Unique identifier of the project */
552
+ projectID: string;
553
+ /** Unique identifier of the branch */
554
+ branchID: string;
555
+ /** GitHub repository ID */
556
+ githubRepositoryID: number;
557
+ }
558
+ export const CreateGithubRepositoryRequest = /*@__PURE__*/ S.suspend(() =>
559
+ S.Struct({
560
+ organizationID: S.String.pipe(T.Label()),
561
+ projectID: S.String.pipe(T.Label()),
562
+ branchID: S.String.pipe(T.Label()),
563
+ githubRepositoryID: S.Number,
564
+ }).pipe(
565
+ T.Http({
566
+ method: "POST",
567
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/githubapp/repository",
568
+ code: 200,
569
+ }),
570
+ ),
571
+ ).annotate({
572
+ identifier: "CreateGithubRepositoryRequest",
573
+ }) as any as S.Schema<CreateGithubRepositoryRequest>;
574
+
575
+ /** A mapping between a GitHub repository and a Xata project */
576
+ export interface GithubRepository {
577
+ /** Unique identifier of the mapping record */
578
+ id: string;
579
+ /** GitHub repository ID */
580
+ githubRepositoryID: number;
581
+ /** Project ID this mapping is associated with */
582
+ project: string;
583
+ /** ID of the root Xata branch mapped to this repository */
584
+ rootBranchId: string;
585
+ /** Timestamp when the mapping was created */
586
+ createdAt: string;
587
+ /** Timestamp when the mapping was last updated */
588
+ updatedAt: string;
589
+ }
590
+ export const GithubRepository = /*@__PURE__*/ S.suspend(() =>
591
+ S.Struct({
592
+ id: S.String,
593
+ githubRepositoryID: S.Number,
594
+ project: S.String,
595
+ rootBranchId: S.String,
596
+ createdAt: S.String,
597
+ updatedAt: S.String,
598
+ }),
599
+ ).annotate({
600
+ identifier: "GithubRepository",
601
+ }) as any as S.Schema<GithubRepository>;
602
+
603
+ export interface CreateOrganizationRequest {
604
+ /** Name for the new organization */
605
+ name: string;
606
+ }
607
+ export const CreateOrganizationRequest = /*@__PURE__*/ S.suspend(() =>
608
+ S.Struct({
609
+ name: S.String,
610
+ }).pipe(T.Http({ method: "POST", uri: "/organizations", code: 200 })),
611
+ ).annotate({
612
+ identifier: "CreateOrganizationRequest",
613
+ }) as any as S.Schema<CreateOrganizationRequest>;
614
+
615
+ /** Indicates whether the organization is active, it's computed as `!disabled_by_admin AND billing_status == 'ok'` */
616
+ export type OrganizationStatusStatus = "enabled" | "disabled";
617
+ export const OrganizationStatusStatus = S.String;
618
+
619
+ /** Indicates the status of the organization from a billing perspective */
620
+ export type OrganizationStatusBillingStatus =
621
+ | "ok"
622
+ | "no_payment_method"
623
+ | "invoice_overdue"
624
+ | "unknown"
625
+ | "deletion_requested";
626
+ export const OrganizationStatusBillingStatus = S.String;
627
+
628
+ /** Usage tier of the organization. t1 is the default for new organizations, t2 is assigned when a valid payment method is on file. */
629
+ export type OrganizationStatusUsageTier = "t1" | "t2";
630
+ export const OrganizationStatusUsageTier = S.String;
631
+
632
+ export interface OrganizationStatus {
633
+ /** Indicates whether the organization is active, it's computed as `!disabled_by_admin AND billing_status == 'ok'` */
634
+ status: OrganizationStatusStatus;
635
+ /** Indicates if the organization has been disabled by an admin */
636
+ disabled_by_admin: boolean;
637
+ /** Reason for the current admin status */
638
+ admin_reason?: string;
639
+ /** Indicates the status of the organization from a billing perspective */
640
+ billing_status: OrganizationStatusBillingStatus;
641
+ /** Reason for the current billing status */
642
+ billing_reason?: string;
643
+ /** Usage tier of the organization. t1 is the default for new organizations, t2 is assigned when a valid payment method is on file. */
644
+ usage_tier: OrganizationStatusUsageTier;
645
+ /** Timestamp of the last update to the organization's status */
646
+ last_updated: string;
647
+ /** Timestamp when the organization was created */
648
+ created_at?: string;
649
+ }
650
+ export const OrganizationStatus = /*@__PURE__*/ S.suspend(() =>
651
+ S.Struct({
652
+ status: OrganizationStatusStatus,
653
+ disabled_by_admin: S.Boolean,
654
+ admin_reason: S.optional(S.String),
655
+ billing_status: OrganizationStatusBillingStatus,
656
+ billing_reason: S.optional(S.String),
657
+ usage_tier: OrganizationStatusUsageTier,
658
+ last_updated: S.String,
659
+ created_at: S.optional(S.String),
660
+ }),
661
+ ).annotate({
662
+ identifier: "OrganizationStatus",
663
+ }) as any as S.Schema<OrganizationStatus>;
664
+
665
+ /** Marketplace provider associated with an organization. */
666
+ export type OrganizationMarketplaceProvider = "aws";
667
+ export const OrganizationMarketplaceProvider = S.String;
668
+
669
+ /** Organization details including ID and name */
670
+ export interface Organization {
671
+ /** Unique identifier for the organization */
672
+ id: string;
673
+ /** Human-readable name of the organization */
674
+ name: string;
675
+ /** Current status of the organization */
676
+ status: OrganizationStatus;
677
+ /** Marketplace provider for this organization (e.g. "aws"), if billed through a marketplace */
678
+ marketplace?: OrganizationMarketplaceProvider | null;
679
+ }
680
+ export const Organization = /*@__PURE__*/ S.suspend(() =>
681
+ S.Struct({
682
+ id: S.String,
683
+ name: S.String,
684
+ status: OrganizationStatus,
685
+ marketplace: S.optional(S.NullOr(OrganizationMarketplaceProvider)),
686
+ }),
687
+ ).annotate({ identifier: "Organization" }) as any as S.Schema<Organization>;
688
+
689
+ /** Optional scopes assigned to the API key */
690
+ export type CreateOrganizationAPIKeyRequestScopesList = Array<string>;
691
+ export const CreateOrganizationAPIKeyRequestScopesList = /*@__PURE__*/ S.Array(
692
+ S.String,
693
+ ) as any as S.Schema<CreateOrganizationAPIKeyRequestScopesList>;
694
+
695
+ /** Limit access to these projects */
696
+ export type CreateOrganizationAPIKeyRequestProjectsList = Array<string>;
697
+ export const CreateOrganizationAPIKeyRequestProjectsList =
698
+ /*@__PURE__*/ S.Array(
699
+ S.String,
700
+ ) as any as S.Schema<CreateOrganizationAPIKeyRequestProjectsList>;
701
+
702
+ /** Limit access to these branches */
703
+ export type CreateOrganizationAPIKeyRequestBranchesList = Array<string>;
704
+ export const CreateOrganizationAPIKeyRequestBranchesList =
705
+ /*@__PURE__*/ S.Array(
706
+ S.String,
707
+ ) as any as S.Schema<CreateOrganizationAPIKeyRequestBranchesList>;
708
+
709
+ export interface CreateOrganizationAPIKeyRequest {
710
+ /** Unique identifier for a specific organization */
711
+ organizationID: string;
712
+ name: string;
713
+ /** Expiration date for the API key, null for no expiry */
714
+ expiry?: string | null;
715
+ /** Optional scopes assigned to the API key */
716
+ scopes?: CreateOrganizationAPIKeyRequestScopesList;
717
+ /** Limit access to these projects */
718
+ projects?: CreateOrganizationAPIKeyRequestProjectsList;
719
+ /** Limit access to these branches */
720
+ branches?: CreateOrganizationAPIKeyRequestBranchesList;
721
+ }
722
+ export const CreateOrganizationAPIKeyRequest = /*@__PURE__*/ S.suspend(() =>
723
+ S.Struct({
724
+ organizationID: S.String.pipe(T.Label()),
725
+ name: S.String,
726
+ expiry: S.optional(S.NullOr(S.String)),
727
+ scopes: S.optional(CreateOrganizationAPIKeyRequestScopesList),
728
+ projects: S.optional(CreateOrganizationAPIKeyRequestProjectsList),
729
+ branches: S.optional(CreateOrganizationAPIKeyRequestBranchesList),
730
+ }).pipe(
731
+ T.Http({
732
+ method: "POST",
733
+ uri: "/organizations/{organizationID}/api-keys",
734
+ code: 200,
735
+ }),
736
+ ),
737
+ ).annotate({
738
+ identifier: "CreateOrganizationAPIKeyRequest",
739
+ }) as any as S.Schema<CreateOrganizationAPIKeyRequest>;
740
+
741
+ export type FullAPIKeyScopesList = Array<string>;
742
+ export const FullAPIKeyScopesList = /*@__PURE__*/ S.Array(
743
+ S.String,
744
+ ) as any as S.Schema<FullAPIKeyScopesList>;
745
+
746
+ /** Projects this API key has access to */
747
+ export type FullAPIKeyProjectsList = Array<string>;
748
+ export const FullAPIKeyProjectsList = /*@__PURE__*/ S.Array(
749
+ S.String,
750
+ ) as any as S.Schema<FullAPIKeyProjectsList>;
751
+
752
+ /** Branches this API key has access to */
753
+ export type FullAPIKeyBranchesList = Array<string>;
754
+ export const FullAPIKeyBranchesList = /*@__PURE__*/ S.Array(
755
+ S.String,
756
+ ) as any as S.Schema<FullAPIKeyBranchesList>;
757
+
758
+ export interface FullAPIKey {
759
+ id: string;
760
+ name: string;
761
+ preview: string;
762
+ scopes: FullAPIKeyScopesList;
763
+ /** Projects this API key has access to */
764
+ projects: FullAPIKeyProjectsList;
765
+ /** Branches this API key has access to */
766
+ branches: FullAPIKeyBranchesList;
767
+ created_at: string;
768
+ /** Date when the API key expires (null if no expiry) */
769
+ expiry: string | null;
770
+ /** Timestamp of the last time the key was used (null if never) */
771
+ last_used: string | null;
772
+ /** The actual API key token */
773
+ token: string;
774
+ /** ID of the user that created this API key */
775
+ created_by?: string | null;
776
+ /** ID of the API key that created this API key */
777
+ created_by_key?: string | null;
778
+ }
779
+ export const FullAPIKey = /*@__PURE__*/ S.suspend(() =>
780
+ S.Struct({
781
+ id: S.String,
782
+ name: S.String,
783
+ preview: S.String,
784
+ scopes: FullAPIKeyScopesList,
785
+ projects: FullAPIKeyProjectsList,
786
+ branches: FullAPIKeyBranchesList,
787
+ created_at: S.String,
788
+ expiry: S.NullOr(S.String),
789
+ last_used: S.NullOr(S.String),
790
+ token: S.String,
791
+ created_by: S.optional(S.NullOr(S.String)),
792
+ created_by_key: S.optional(S.NullOr(S.String)),
793
+ }),
794
+ ).annotate({ identifier: "FullAPIKey" }) as any as S.Schema<FullAPIKey>;
795
+
796
+ export interface CreateOrganizationAPIKeyResponse {
797
+ key: FullAPIKey;
798
+ }
799
+ export const CreateOrganizationAPIKeyResponse = /*@__PURE__*/ S.suspend(() =>
800
+ S.Struct({
801
+ key: FullAPIKey,
802
+ }),
803
+ ).annotate({
804
+ identifier: "CreateOrganizationAPIKeyResponse",
805
+ }) as any as S.Schema<CreateOrganizationAPIKeyResponse>;
806
+
807
+ export interface CreateOrganizationInvitationRequest {
808
+ /** Unique identifier for a specific organization */
809
+ organizationID: string;
810
+ /** Email address of the user to invite */
811
+ email: string;
812
+ }
813
+ export const CreateOrganizationInvitationRequest = /*@__PURE__*/ S.suspend(() =>
814
+ S.Struct({
815
+ organizationID: S.String.pipe(T.Label()),
816
+ email: S.String,
817
+ }).pipe(
818
+ T.Http({
819
+ method: "POST",
820
+ uri: "/organizations/{organizationID}/invitations",
821
+ code: 200,
822
+ }),
823
+ ),
824
+ ).annotate({
825
+ identifier: "CreateOrganizationInvitationRequest",
826
+ }) as any as S.Schema<CreateOrganizationInvitationRequest>;
827
+
828
+ export interface CreateOrganizationInvitationResponse {}
829
+ export const CreateOrganizationInvitationResponse = /*@__PURE__*/ S.suspend(
830
+ () => S.Struct({}),
831
+ ).annotate({
832
+ identifier: "CreateOrganizationInvitationResponse",
833
+ }) as any as S.Schema<CreateOrganizationInvitationResponse>;
834
+
835
+ /** Whether the project branches are configured to scale down to zero when not in use */
836
+ export interface ProjectScaleToZeroConfiguration {
837
+ baseBranches: ScaleToZeroConfiguration;
838
+ childBranches: ScaleToZeroConfiguration;
839
+ }
840
+ export const ProjectScaleToZeroConfiguration = /*@__PURE__*/ S.suspend(() =>
841
+ S.Struct({
842
+ baseBranches: ScaleToZeroConfiguration,
843
+ childBranches: ScaleToZeroConfiguration,
844
+ }),
845
+ ).annotate({
846
+ identifier: "ProjectScaleToZeroConfiguration",
847
+ }) as any as S.Schema<ProjectScaleToZeroConfiguration>;
848
+
849
+ export interface CidrEntry {
850
+ /** IP address or CIDR block (e.g., "192.168.0.0/24") */
851
+ cidr: string;
852
+ /** Optional label for the CIDR entry */
853
+ description?: string;
854
+ }
855
+ export const CidrEntry = /*@__PURE__*/ S.suspend(() =>
856
+ S.Struct({
857
+ cidr: S.String,
858
+ description: S.optional(S.String),
859
+ }),
860
+ ).annotate({ identifier: "CidrEntry" }) as any as S.Schema<CidrEntry>;
861
+
862
+ export type IPFilteringConfigurationCidrList = Array<CidrEntry>;
863
+ export const IPFilteringConfigurationCidrList = /*@__PURE__*/ S.Array(
864
+ CidrEntry,
865
+ ) as any as S.Schema<IPFilteringConfigurationCidrList>;
866
+
867
+ /** Configuration for IP filtering on project branches */
868
+ export interface IPFilteringConfiguration {
869
+ /** Whether IP filtering is enabled */
870
+ enabled: boolean;
871
+ cidr: IPFilteringConfigurationCidrList;
872
+ }
873
+ export const IPFilteringConfiguration = /*@__PURE__*/ S.suspend(() =>
874
+ S.Struct({
875
+ enabled: S.Boolean,
876
+ cidr: IPFilteringConfigurationCidrList,
877
+ }),
878
+ ).annotate({
879
+ identifier: "IPFilteringConfiguration",
880
+ }) as any as S.Schema<IPFilteringConfiguration>;
881
+
882
+ /** Configuration details for a project, including its scale to zero settings */
883
+ export interface ProjectConfiguration {
884
+ scaleToZero: ProjectScaleToZeroConfiguration;
885
+ ipFiltering?: IPFilteringConfiguration;
886
+ }
887
+ export const ProjectConfiguration = /*@__PURE__*/ S.suspend(() =>
888
+ S.Struct({
889
+ scaleToZero: ProjectScaleToZeroConfiguration,
890
+ ipFiltering: S.optional(IPFilteringConfiguration),
891
+ }),
892
+ ).annotate({
893
+ identifier: "ProjectConfiguration",
894
+ }) as any as S.Schema<ProjectConfiguration>;
895
+
896
+ export interface CreateProjectRequest {
897
+ /** Unique identifier of the organization to create the project in */
898
+ organizationID: string;
899
+ /** Human-readable name for the new project */
900
+ name: string;
901
+ configuration?: ProjectConfiguration;
902
+ }
903
+ export const CreateProjectRequest = /*@__PURE__*/ S.suspend(() =>
904
+ S.Struct({
905
+ organizationID: S.String.pipe(T.Label()),
906
+ name: S.String,
907
+ configuration: S.optional(ProjectConfiguration),
908
+ }).pipe(
909
+ T.Http({
910
+ method: "POST",
911
+ uri: "/organizations/{organizationID}/projects",
912
+ code: 200,
913
+ }),
914
+ ),
915
+ ).annotate({
916
+ identifier: "CreateProjectRequest",
917
+ }) as any as S.Schema<CreateProjectRequest>;
918
+
919
+ /** Details of a project including its ID, name, and creation/update timestamps */
920
+ export interface Project {
921
+ /** Unique identifier for the project */
922
+ id: string;
923
+ /** Human-readable name of the project */
924
+ name: string;
925
+ /** Timestamp when the project was created */
926
+ createdAt: string;
927
+ /** Timestamp when the project was last updated */
928
+ updatedAt: string;
929
+ configuration: ProjectConfiguration;
930
+ }
931
+ export const Project = /*@__PURE__*/ S.suspend(() =>
932
+ S.Struct({
933
+ id: S.String,
934
+ name: S.String,
935
+ createdAt: S.String,
936
+ updatedAt: S.String,
937
+ configuration: ProjectConfiguration,
938
+ }),
939
+ ).annotate({ identifier: "Project" }) as any as S.Schema<Project>;
940
+
941
+ /** Optional scopes assigned to the API key */
942
+ export type CreateUserAPIKeyRequestScopesList = Array<string>;
943
+ export const CreateUserAPIKeyRequestScopesList = /*@__PURE__*/ S.Array(
944
+ S.String,
945
+ ) as any as S.Schema<CreateUserAPIKeyRequestScopesList>;
946
+
947
+ /** Limit access to these projects */
948
+ export type CreateUserAPIKeyRequestProjectsList = Array<string>;
949
+ export const CreateUserAPIKeyRequestProjectsList = /*@__PURE__*/ S.Array(
950
+ S.String,
951
+ ) as any as S.Schema<CreateUserAPIKeyRequestProjectsList>;
952
+
953
+ /** Limit access to these branches */
954
+ export type CreateUserAPIKeyRequestBranchesList = Array<string>;
955
+ export const CreateUserAPIKeyRequestBranchesList = /*@__PURE__*/ S.Array(
956
+ S.String,
957
+ ) as any as S.Schema<CreateUserAPIKeyRequestBranchesList>;
958
+
959
+ export interface CreateUserAPIKeyRequest {
960
+ name: string;
961
+ /** Expiration date for the API key, null for no expiry */
962
+ expiry?: string | null;
963
+ /** Optional scopes assigned to the API key */
964
+ scopes?: CreateUserAPIKeyRequestScopesList;
965
+ /** Limit access to these projects */
966
+ projects?: CreateUserAPIKeyRequestProjectsList;
967
+ /** Limit access to these branches */
968
+ branches?: CreateUserAPIKeyRequestBranchesList;
969
+ }
970
+ export const CreateUserAPIKeyRequest = /*@__PURE__*/ S.suspend(() =>
971
+ S.Struct({
972
+ name: S.String,
973
+ expiry: S.optional(S.NullOr(S.String)),
974
+ scopes: S.optional(CreateUserAPIKeyRequestScopesList),
975
+ projects: S.optional(CreateUserAPIKeyRequestProjectsList),
976
+ branches: S.optional(CreateUserAPIKeyRequestBranchesList),
977
+ }).pipe(T.Http({ method: "POST", uri: "/api-keys", code: 200 })),
978
+ ).annotate({
979
+ identifier: "CreateUserAPIKeyRequest",
980
+ }) as any as S.Schema<CreateUserAPIKeyRequest>;
981
+
982
+ export interface CreateUserAPIKeyResponse {
983
+ key: FullAPIKey;
984
+ }
985
+ export const CreateUserAPIKeyResponse = /*@__PURE__*/ S.suspend(() =>
986
+ S.Struct({
987
+ key: FullAPIKey,
988
+ }),
989
+ ).annotate({
990
+ identifier: "CreateUserAPIKeyResponse",
991
+ }) as any as S.Schema<CreateUserAPIKeyResponse>;
992
+
993
+ export interface DeleteBranchRequest {
994
+ /** Unique identifier of the organization containing the project */
995
+ organizationID: string;
996
+ /** Unique identifier of the project containing the branch */
997
+ projectID: string;
998
+ /** Unique identifier of the branch to delete */
999
+ branchID: string;
1000
+ }
1001
+ export const DeleteBranchRequest = /*@__PURE__*/ S.suspend(() =>
1002
+ S.Struct({
1003
+ organizationID: S.String.pipe(T.Label()),
1004
+ projectID: S.String.pipe(T.Label()),
1005
+ branchID: S.String.pipe(T.Label()),
1006
+ }).pipe(
1007
+ T.Http({
1008
+ method: "DELETE",
1009
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}",
1010
+ code: 200,
1011
+ }),
1012
+ ),
1013
+ ).annotate({
1014
+ identifier: "DeleteBranchRequest",
1015
+ }) as any as S.Schema<DeleteBranchRequest>;
1016
+
1017
+ export interface DeleteBranchResponse {}
1018
+ export const DeleteBranchResponse = /*@__PURE__*/ S.suspend(() =>
1019
+ S.Struct({}),
1020
+ ).annotate({
1021
+ identifier: "DeleteBranchResponse",
1022
+ }) as any as S.Schema<DeleteBranchResponse>;
1023
+
1024
+ export interface DeleteGithubRepositoryRequest {
1025
+ /** Unique identifier of the organization */
1026
+ organizationID: string;
1027
+ /** Unique identifier of the project */
1028
+ projectID: string;
1029
+ /** Unique identifier of the branch */
1030
+ branchID: string;
1031
+ }
1032
+ export const DeleteGithubRepositoryRequest = /*@__PURE__*/ S.suspend(() =>
1033
+ S.Struct({
1034
+ organizationID: S.String.pipe(T.Label()),
1035
+ projectID: S.String.pipe(T.Label()),
1036
+ branchID: S.String.pipe(T.Label()),
1037
+ }).pipe(
1038
+ T.Http({
1039
+ method: "DELETE",
1040
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/githubapp/repository",
1041
+ code: 200,
1042
+ }),
1043
+ ),
1044
+ ).annotate({
1045
+ identifier: "DeleteGithubRepositoryRequest",
1046
+ }) as any as S.Schema<DeleteGithubRepositoryRequest>;
1047
+
1048
+ export interface DeleteGithubRepositoryResponse {}
1049
+ export const DeleteGithubRepositoryResponse = /*@__PURE__*/ S.suspend(() =>
1050
+ S.Struct({}),
1051
+ ).annotate({
1052
+ identifier: "DeleteGithubRepositoryResponse",
1053
+ }) as any as S.Schema<DeleteGithubRepositoryResponse>;
1054
+
1055
+ export interface DeleteInstallationRequest {
1056
+ /** Vercel installation id (icfg_...). */
1057
+ installationId: string;
1058
+ /** Whether to delete the installation's resources along with the installation. */
1059
+ cascadeResourceDeletion?: boolean;
1060
+ /** The reason for deleting the installation. */
1061
+ reason?: string;
1062
+ }
1063
+ export const DeleteInstallationRequest = /*@__PURE__*/ S.suspend(() =>
1064
+ S.Struct({
1065
+ installationId: S.String.pipe(T.Label()),
1066
+ cascadeResourceDeletion: S.optional(S.Boolean),
1067
+ reason: S.optional(S.String),
1068
+ }).pipe(
1069
+ T.Http({
1070
+ method: "DELETE",
1071
+ uri: "/v1/installations/{installationId}",
1072
+ code: 200,
1073
+ }),
1074
+ ),
1075
+ ).annotate({
1076
+ identifier: "DeleteInstallationRequest",
1077
+ }) as any as S.Schema<DeleteInstallationRequest>;
1078
+
1079
+ export interface DeleteInstallationResponse {}
1080
+ export const DeleteInstallationResponse = /*@__PURE__*/ S.suspend(() =>
1081
+ S.Struct({}),
1082
+ ).annotate({
1083
+ identifier: "DeleteInstallationResponse",
1084
+ }) as any as S.Schema<DeleteInstallationResponse>;
1085
+
1086
+ export interface DeleteOrganizationRequest {
1087
+ /** Unique identifier for a specific organization */
1088
+ organizationID: string;
1089
+ }
1090
+ export const DeleteOrganizationRequest = /*@__PURE__*/ S.suspend(() =>
1091
+ S.Struct({
1092
+ organizationID: S.String.pipe(T.Label()),
1093
+ }).pipe(
1094
+ T.Http({
1095
+ method: "DELETE",
1096
+ uri: "/organizations/{organizationID}",
1097
+ code: 200,
1098
+ }),
1099
+ ),
1100
+ ).annotate({
1101
+ identifier: "DeleteOrganizationRequest",
1102
+ }) as any as S.Schema<DeleteOrganizationRequest>;
1103
+
1104
+ export interface DeleteOrganizationResponse {}
1105
+ export const DeleteOrganizationResponse = /*@__PURE__*/ S.suspend(() =>
1106
+ S.Struct({}),
1107
+ ).annotate({
1108
+ identifier: "DeleteOrganizationResponse",
1109
+ }) as any as S.Schema<DeleteOrganizationResponse>;
1110
+
1111
+ /** Array of API key IDs to delete */
1112
+ export type DeleteOrganizationAPIKeysRequestIdsList = Array<string>;
1113
+ export const DeleteOrganizationAPIKeysRequestIdsList = /*@__PURE__*/ S.Array(
1114
+ S.String,
1115
+ ) as any as S.Schema<DeleteOrganizationAPIKeysRequestIdsList>;
1116
+
1117
+ export interface DeleteOrganizationAPIKeysRequest {
1118
+ /** Unique identifier for a specific organization */
1119
+ organizationID: string;
1120
+ /** Array of API key IDs to delete */
1121
+ ids: DeleteOrganizationAPIKeysRequestIdsList;
1122
+ }
1123
+ export const DeleteOrganizationAPIKeysRequest = /*@__PURE__*/ S.suspend(() =>
1124
+ S.Struct({
1125
+ organizationID: S.String.pipe(T.Label()),
1126
+ ids: DeleteOrganizationAPIKeysRequestIdsList,
1127
+ }).pipe(
1128
+ T.Http({
1129
+ method: "DELETE",
1130
+ uri: "/organizations/{organizationID}/api-keys",
1131
+ code: 200,
1132
+ }),
1133
+ ),
1134
+ ).annotate({
1135
+ identifier: "DeleteOrganizationAPIKeysRequest",
1136
+ }) as any as S.Schema<DeleteOrganizationAPIKeysRequest>;
1137
+
1138
+ export interface DeleteOrganizationAPIKeysResponse {}
1139
+ export const DeleteOrganizationAPIKeysResponse = /*@__PURE__*/ S.suspend(() =>
1140
+ S.Struct({}),
1141
+ ).annotate({
1142
+ identifier: "DeleteOrganizationAPIKeysResponse",
1143
+ }) as any as S.Schema<DeleteOrganizationAPIKeysResponse>;
1144
+
1145
+ export interface DeleteOrganizationInvitationRequest {
1146
+ /** Unique identifier for a specific organization */
1147
+ organizationID: string;
1148
+ /** Unique identifier for an invitation */
1149
+ invitationID: string;
1150
+ }
1151
+ export const DeleteOrganizationInvitationRequest = /*@__PURE__*/ S.suspend(() =>
1152
+ S.Struct({
1153
+ organizationID: S.String.pipe(T.Label()),
1154
+ invitationID: S.String.pipe(T.Label()),
1155
+ }).pipe(
1156
+ T.Http({
1157
+ method: "DELETE",
1158
+ uri: "/organizations/{organizationID}/invitations/{invitationID}",
1159
+ code: 200,
1160
+ }),
1161
+ ),
1162
+ ).annotate({
1163
+ identifier: "DeleteOrganizationInvitationRequest",
1164
+ }) as any as S.Schema<DeleteOrganizationInvitationRequest>;
1165
+
1166
+ export interface DeleteOrganizationInvitationResponse {}
1167
+ export const DeleteOrganizationInvitationResponse = /*@__PURE__*/ S.suspend(
1168
+ () => S.Struct({}),
1169
+ ).annotate({
1170
+ identifier: "DeleteOrganizationInvitationResponse",
1171
+ }) as any as S.Schema<DeleteOrganizationInvitationResponse>;
1172
+
1173
+ export interface DeleteProjectRequest {
1174
+ /** Unique identifier of the organization containing the project */
1175
+ organizationID: string;
1176
+ /** Unique identifier of the project to delete */
1177
+ projectID: string;
1178
+ }
1179
+ export const DeleteProjectRequest = /*@__PURE__*/ S.suspend(() =>
1180
+ S.Struct({
1181
+ organizationID: S.String.pipe(T.Label()),
1182
+ projectID: S.String.pipe(T.Label()),
1183
+ }).pipe(
1184
+ T.Http({
1185
+ method: "DELETE",
1186
+ uri: "/organizations/{organizationID}/projects/{projectID}",
1187
+ code: 200,
1188
+ }),
1189
+ ),
1190
+ ).annotate({
1191
+ identifier: "DeleteProjectRequest",
1192
+ }) as any as S.Schema<DeleteProjectRequest>;
1193
+
1194
+ export interface DeleteProjectResponse {}
1195
+ export const DeleteProjectResponse = /*@__PURE__*/ S.suspend(() =>
1196
+ S.Struct({}),
1197
+ ).annotate({
1198
+ identifier: "DeleteProjectResponse",
1199
+ }) as any as S.Schema<DeleteProjectResponse>;
1200
+
1201
+ /** Array of API key IDs to delete (maximum 50 keys per request) */
1202
+ export type DeleteUserAPIKeysRequestIdsList = Array<string>;
1203
+ export const DeleteUserAPIKeysRequestIdsList = /*@__PURE__*/ S.Array(
1204
+ S.String,
1205
+ ) as any as S.Schema<DeleteUserAPIKeysRequestIdsList>;
1206
+
1207
+ export interface DeleteUserAPIKeysRequest {
1208
+ /** Array of API key IDs to delete (maximum 50 keys per request) */
1209
+ ids: DeleteUserAPIKeysRequestIdsList;
1210
+ }
1211
+ export const DeleteUserAPIKeysRequest = /*@__PURE__*/ S.suspend(() =>
1212
+ S.Struct({
1213
+ ids: DeleteUserAPIKeysRequestIdsList,
1214
+ }).pipe(T.Http({ method: "DELETE", uri: "/api-keys", code: 200 })),
1215
+ ).annotate({
1216
+ identifier: "DeleteUserAPIKeysRequest",
1217
+ }) as any as S.Schema<DeleteUserAPIKeysRequest>;
1218
+
1219
+ export interface DeleteUserAPIKeysResponse {}
1220
+ export const DeleteUserAPIKeysResponse = /*@__PURE__*/ S.suspend(() =>
1221
+ S.Struct({}),
1222
+ ).annotate({
1223
+ identifier: "DeleteUserAPIKeysResponse",
1224
+ }) as any as S.Schema<DeleteUserAPIKeysResponse>;
1225
+
1226
+ export interface DescribeBranchRequest {
1227
+ /** Unique identifier of the organization containing the project */
1228
+ organizationID: string;
1229
+ /** Unique identifier of the project containing the branch */
1230
+ projectID: string;
1231
+ /** Unique identifier of the branch to retrieve details for */
1232
+ branchID: string;
1233
+ }
1234
+ export const DescribeBranchRequest = /*@__PURE__*/ S.suspend(() =>
1235
+ S.Struct({
1236
+ organizationID: S.String.pipe(T.Label()),
1237
+ projectID: S.String.pipe(T.Label()),
1238
+ branchID: S.String.pipe(T.Label()),
1239
+ }).pipe(
1240
+ T.Http({
1241
+ method: "GET",
1242
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}",
1243
+ code: 200,
1244
+ }),
1245
+ ),
1246
+ ).annotate({
1247
+ identifier: "DescribeBranchRequest",
1248
+ }) as any as S.Schema<DescribeBranchRequest>;
1249
+
1250
+ /** Type of status of the branch */
1251
+ export type BranchStatusStatusType =
1252
+ | "STATUS_TYPE_UNSPECIFIED"
1253
+ | "STATUS_TYPE_HEALTHY"
1254
+ | "STATUS_TYPE_TRANSIENT"
1255
+ | "STATUS_TYPE_FAULT"
1256
+ | "STATUS_TYPE_HIBERNATED";
1257
+ export const BranchStatusStatusType = S.String;
1258
+
1259
+ /** Current operational state of the cluster (ready, creating, updating, etc.) */
1260
+ export type ClusterLifecycleState =
1261
+ | "ready"
1262
+ | "creating"
1263
+ | "updating"
1264
+ | "upgrading"
1265
+ | "unknown";
1266
+ export const ClusterLifecycleState = S.String;
1267
+
1268
+ /** Information about the current lifecycle state of a database cluster */
1269
+ export interface ClusterLifecycle {
1270
+ /** Current operational state of the cluster (ready, creating, updating, etc.) */
1271
+ state: ClusterLifecycleState;
1272
+ /** Reason for the current lifecycle state, especially useful for non-ready states */
1273
+ reason?: string;
1274
+ /** Current phase within the lifecycle process */
1275
+ phase: string;
1276
+ }
1277
+ export const ClusterLifecycle = /*@__PURE__*/ S.suspend(() =>
1278
+ S.Struct({
1279
+ state: ClusterLifecycleState,
1280
+ reason: S.optional(S.String),
1281
+ phase: S.String,
1282
+ }),
1283
+ ).annotate({
1284
+ identifier: "ClusterLifecycle",
1285
+ }) as any as S.Schema<ClusterLifecycle>;
1286
+
1287
+ /** Status information about an individual database instance within a cluster */
1288
+ export interface InstanceStatus {
1289
+ /** Unique identifier for the database instance */
1290
+ id: string;
1291
+ /** Current operational status of the instance */
1292
+ status: string;
1293
+ /** Indicates if this instance is currently the primary (write) instance */
1294
+ primary: boolean;
1295
+ /** Indicates if this instance is the target primary during a failover operation */
1296
+ targetPrimary: boolean;
1297
+ }
1298
+ export const InstanceStatus = /*@__PURE__*/ S.suspend(() =>
1299
+ S.Struct({
1300
+ id: S.String,
1301
+ status: S.String,
1302
+ primary: S.Boolean,
1303
+ targetPrimary: S.Boolean,
1304
+ }),
1305
+ ).annotate({ identifier: "InstanceStatus" }) as any as S.Schema<InstanceStatus>;
1306
+
1307
+ /** Details about each individual database instance in the cluster */
1308
+ export type BranchStatusInstancesList = Array<InstanceStatus>;
1309
+ export const BranchStatusInstancesList = /*@__PURE__*/ S.Array(
1310
+ InstanceStatus,
1311
+ ) as any as S.Schema<BranchStatusInstancesList>;
1312
+
1313
+ /** Detailed status information about a branch and its underlying database cluster */
1314
+ export interface BranchStatus {
1315
+ /** Status indicator for the branch according to CNPG */
1316
+ status: string;
1317
+ /** Type of status of the branch */
1318
+ statusType: BranchStatusStatusType;
1319
+ /** Human-readable message explaining the current status */
1320
+ message?: string;
1321
+ lifecycle?: ClusterLifecycle;
1322
+ /** Total number of database instances in the cluster */
1323
+ instanceCount: number;
1324
+ /** Number of database instances that are ready and operational */
1325
+ instanceReadyCount: number;
1326
+ /** Details about each individual database instance in the cluster */
1327
+ instances: BranchStatusInstancesList;
1328
+ }
1329
+ export const BranchStatus = /*@__PURE__*/ S.suspend(() =>
1330
+ S.Struct({
1331
+ status: S.String,
1332
+ statusType: BranchStatusStatusType,
1333
+ message: S.optional(S.String),
1334
+ lifecycle: S.optional(ClusterLifecycle),
1335
+ instanceCount: S.Number,
1336
+ instanceReadyCount: S.Number,
1337
+ instances: BranchStatusInstancesList,
1338
+ }),
1339
+ ).annotate({ identifier: "BranchStatus" }) as any as S.Schema<BranchStatus>;
1340
+
1341
+ /** Arbitrary PostgreSQL configuration parameters for the cluster */
1342
+ export type ClusterConfigurationPostgresConfigurationParametersMap = {
1343
+ [key: string]: string | undefined;
1344
+ };
1345
+ export const ClusterConfigurationPostgresConfigurationParametersMap =
1346
+ /*@__PURE__*/ S.Record(
1347
+ S.String,
1348
+ S.String,
1349
+ ) as any as S.Schema<ClusterConfigurationPostgresConfigurationParametersMap>;
1350
+
1351
+ /** List of PostgreSQL extensions and libraries to preload */
1352
+ export type ClusterConfigurationPreloadLibrariesList = Array<string>;
1353
+ export const ClusterConfigurationPreloadLibrariesList = /*@__PURE__*/ S.Array(
1354
+ S.String,
1355
+ ) as any as S.Schema<ClusterConfigurationPreloadLibrariesList>;
1356
+
1357
+ /** Configuration details for a database cluster backing a branch */
1358
+ export interface ClusterConfiguration {
1359
+ /** Geographic region where the cluster will be deployed */
1360
+ region: string;
1361
+ /** Branch storage in GiB (gigabytes) */
1362
+ storage?: number;
1363
+ /** The instance type according to the xata instance types available */
1364
+ instanceType: string;
1365
+ /** PostgreSQL image to use for the database instances */
1366
+ image: string;
1367
+ /** Number of replicas in the branch. Every child branch is created with no replicas. This can be updated. */
1368
+ replicas: number;
1369
+ /** Arbitrary PostgreSQL configuration parameters for the cluster */
1370
+ postgresConfigurationParameters?: ClusterConfigurationPostgresConfigurationParametersMap;
1371
+ /** List of PostgreSQL extensions and libraries to preload */
1372
+ preloadLibraries?: ClusterConfigurationPreloadLibrariesList;
1373
+ }
1374
+ export const ClusterConfiguration = /*@__PURE__*/ S.suspend(() =>
1375
+ S.Struct({
1376
+ region: S.String,
1377
+ storage: S.optional(S.Number),
1378
+ instanceType: S.String,
1379
+ image: S.String,
1380
+ replicas: S.Number,
1381
+ postgresConfigurationParameters: S.optional(
1382
+ ClusterConfigurationPostgresConfigurationParametersMap,
1383
+ ),
1384
+ preloadLibraries: S.optional(ClusterConfigurationPreloadLibrariesList),
1385
+ }),
1386
+ ).annotate({
1387
+ identifier: "ClusterConfiguration",
1388
+ }) as any as S.Schema<ClusterConfiguration>;
1389
+
1390
+ /** Detailed metadata about a branch, including its status and configuration */
1391
+ export interface BranchMetadata {
1392
+ /** Unique identifier for the branch */
1393
+ id: string;
1394
+ /** Human-readable name of the branch */
1395
+ name: string;
1396
+ /** Optional description of the branch purpose or contents */
1397
+ description?: string;
1398
+ /** Timestamp when the branch was created */
1399
+ createdAt: string;
1400
+ /** Timestamp when the branch was last updated */
1401
+ updatedAt: string;
1402
+ /** Identifier of the parent branch if this is a derived branch, null otherwise */
1403
+ parentID?: string | null;
1404
+ /** Geographic region where the branch is deployed */
1405
+ region: string;
1406
+ status: BranchStatus;
1407
+ /** Deprecated: retrieve the connection string from the branch credentials endpoint (GET .../branches/{branchID}/credentials) instead. The hostname in this connection string carries a -deprecated marker in its first DNS label. */
1408
+ connectionString: string | Redacted.Redacted<string> | null;
1409
+ /** Whether the branch allows public access without authentication */
1410
+ publicAccess: boolean;
1411
+ /** Whether the branch is in a region that supports backups */
1412
+ backupsEnabled: boolean;
1413
+ scaleToZero: ScaleToZeroConfiguration;
1414
+ configuration: ClusterConfiguration;
1415
+ backupConfiguration?: BackupConfiguration;
1416
+ }
1417
+ export const BranchMetadata = /*@__PURE__*/ S.suspend(() =>
1418
+ S.Struct({
1419
+ id: S.String,
1420
+ name: S.String,
1421
+ description: S.optional(S.String),
1422
+ createdAt: S.String,
1423
+ updatedAt: S.String,
1424
+ parentID: S.optional(S.NullOr(S.String)),
1425
+ region: S.String,
1426
+ status: BranchStatus,
1427
+ connectionString: S.NullOr(S.String).pipe(T.SensitiveValue({})),
1428
+ publicAccess: S.Boolean,
1429
+ backupsEnabled: S.Boolean,
1430
+ scaleToZero: ScaleToZeroConfiguration,
1431
+ configuration: ClusterConfiguration,
1432
+ backupConfiguration: S.optional(BackupConfiguration),
1433
+ }),
1434
+ ).annotate({ identifier: "BranchMetadata" }) as any as S.Schema<BranchMetadata>;
1435
+
1436
+ export interface GetBackupRequest {
1437
+ /** Unique identifier of the organization containing the project */
1438
+ organizationID: string;
1439
+ /** Unique identifier of the project to retrieve backups for */
1440
+ projectID: string;
1441
+ /** Unique identifier of the backup for the project */
1442
+ backupID: string;
1443
+ }
1444
+ export const GetBackupRequest = /*@__PURE__*/ S.suspend(() =>
1445
+ S.Struct({
1446
+ organizationID: S.String.pipe(T.Label()),
1447
+ projectID: S.String.pipe(T.Label()),
1448
+ backupID: S.String.pipe(T.Label()),
1449
+ }).pipe(
1450
+ T.Http({
1451
+ method: "GET",
1452
+ uri: "/organizations/{organizationID}/projects/{projectID}/backups/{backupID}",
1453
+ code: 200,
1454
+ }),
1455
+ ),
1456
+ ).annotate({
1457
+ identifier: "GetBackupRequest",
1458
+ }) as any as S.Schema<GetBackupRequest>;
1459
+
1460
+ /** metadata about a continuous backup */
1461
+ export interface BackupMetadata {
1462
+ /** unique identifier for the backup */
1463
+ id: string;
1464
+ /** the branchID the branch associated with the backup */
1465
+ branchID: string;
1466
+ /** the earlies point in time available for restoring the branch */
1467
+ earliestRestore?: string;
1468
+ /** the latest point in time available for restoring the branch */
1469
+ latestRestore?: string;
1470
+ /** description of the backup */
1471
+ description: string;
1472
+ }
1473
+ export const BackupMetadata = /*@__PURE__*/ S.suspend(() =>
1474
+ S.Struct({
1475
+ id: S.String,
1476
+ branchID: S.String,
1477
+ earliestRestore: S.optional(S.String),
1478
+ latestRestore: S.optional(S.String),
1479
+ description: S.String,
1480
+ }),
1481
+ ).annotate({ identifier: "BackupMetadata" }) as any as S.Schema<BackupMetadata>;
1482
+
1483
+ export interface GetBillingCustomerRequest {
1484
+ /** Unique identifier for a specific organization */
1485
+ organizationID: string;
1486
+ }
1487
+ export const GetBillingCustomerRequest = /*@__PURE__*/ S.suspend(() =>
1488
+ S.Struct({
1489
+ organizationID: S.String.pipe(T.Label()),
1490
+ }).pipe(
1491
+ T.Http({
1492
+ method: "GET",
1493
+ uri: "/organizations/{organizationID}/billing/customer",
1494
+ code: 200,
1495
+ }),
1496
+ ),
1497
+ ).annotate({
1498
+ identifier: "GetBillingCustomerRequest",
1499
+ }) as any as S.Schema<GetBillingCustomerRequest>;
1500
+
1501
+ /** How billing payment is collected for the organization. */
1502
+ export type BillingCollectionMethod =
1503
+ | "unknown"
1504
+ | "stripe_payment_method"
1505
+ | "marketplace"
1506
+ | "bank_transfer";
1507
+ export const BillingCollectionMethod = S.String;
1508
+
1509
+ export interface BillingPaymentMethodCard {
1510
+ brand: string;
1511
+ last4: string;
1512
+ expiry_month: number;
1513
+ expiry_year: number;
1514
+ }
1515
+ export const BillingPaymentMethodCard = /*@__PURE__*/ S.suspend(() =>
1516
+ S.Struct({
1517
+ brand: S.String,
1518
+ last4: S.String,
1519
+ expiry_month: S.Number,
1520
+ expiry_year: S.Number,
1521
+ }),
1522
+ ).annotate({
1523
+ identifier: "BillingPaymentMethodCard",
1524
+ }) as any as S.Schema<BillingPaymentMethodCard>;
1525
+
1526
+ export interface BillingPaymentMethod {
1527
+ card: BillingPaymentMethodCard;
1528
+ }
1529
+ export const BillingPaymentMethod = /*@__PURE__*/ S.suspend(() =>
1530
+ S.Struct({
1531
+ card: BillingPaymentMethodCard,
1532
+ }),
1533
+ ).annotate({
1534
+ identifier: "BillingPaymentMethod",
1535
+ }) as any as S.Schema<BillingPaymentMethod>;
1536
+
1537
+ export type BillingCreditStatus = "active" | "pending_payment";
1538
+ export const BillingCreditStatus = S.String;
1539
+
1540
+ export interface BillingCredit {
1541
+ id: string;
1542
+ /** Remaining credit balance. */
1543
+ balance: number;
1544
+ /** Date when the credit becomes usable. */
1545
+ effective_date: string;
1546
+ /** Date when the credit expires, or null for credits that do not expire. */
1547
+ expiry_date: string | null;
1548
+ /** Initial credit balance before any usage. */
1549
+ maximum_initial_balance: number;
1550
+ status: BillingCreditStatus;
1551
+ }
1552
+ export const BillingCredit = /*@__PURE__*/ S.suspend(() =>
1553
+ S.Struct({
1554
+ id: S.String,
1555
+ balance: S.Number,
1556
+ effective_date: S.String,
1557
+ expiry_date: S.NullOr(S.String),
1558
+ maximum_initial_balance: S.Number,
1559
+ status: BillingCreditStatus,
1560
+ }),
1561
+ ).annotate({ identifier: "BillingCredit" }) as any as S.Schema<BillingCredit>;
1562
+
1563
+ export type BillingCustomerResponseCreditsList = Array<BillingCredit>;
1564
+ export const BillingCustomerResponseCreditsList = /*@__PURE__*/ S.Array(
1565
+ BillingCredit,
1566
+ ) as any as S.Schema<BillingCustomerResponseCreditsList>;
1567
+
1568
+ /** Credits with active status, a reached effective date, positive balance, and no past expiry. */
1569
+ export type BillingCreditDetailsActiveCreditsList = Array<BillingCredit>;
1570
+ export const BillingCreditDetailsActiveCreditsList = /*@__PURE__*/ S.Array(
1571
+ BillingCredit,
1572
+ ) as any as S.Schema<BillingCreditDetailsActiveCreditsList>;
1573
+
1574
+ export interface BillingCreditDetails {
1575
+ total_lifetime_credits: number;
1576
+ last_expiry: string | null;
1577
+ last_expiry_with_balance: string | null;
1578
+ /** Credits with active status, a reached effective date, positive balance, and no past expiry. */
1579
+ active_credits: BillingCreditDetailsActiveCreditsList;
1580
+ last_active_credit_expiry: string | null;
1581
+ total_active_credits: number;
1582
+ /** Days until the last active credit expiry, or null when there is no future active credit expiry. */
1583
+ days_until_last_active_credit_expiry: number | null;
1584
+ /** Days until the last positive-balance credit expiry, or null when there is no future positive-balance credit expiry. */
1585
+ days_until_last_expiry_with_balance: number | null;
1586
+ }
1587
+ export const BillingCreditDetails = /*@__PURE__*/ S.suspend(() =>
1588
+ S.Struct({
1589
+ total_lifetime_credits: S.Number,
1590
+ last_expiry: S.NullOr(S.String),
1591
+ last_expiry_with_balance: S.NullOr(S.String),
1592
+ active_credits: BillingCreditDetailsActiveCreditsList,
1593
+ last_active_credit_expiry: S.NullOr(S.String),
1594
+ total_active_credits: S.Number,
1595
+ days_until_last_active_credit_expiry: S.NullOr(S.Number),
1596
+ days_until_last_expiry_with_balance: S.NullOr(S.Number),
1597
+ }),
1598
+ ).annotate({
1599
+ identifier: "BillingCreditDetails",
1600
+ }) as any as S.Schema<BillingCreditDetails>;
1601
+
1602
+ export interface BillingCustomerResponse {
1603
+ billing_email: string;
1604
+ /** Marketplace provider for this organization (e.g. "aws"), if billed through a marketplace */
1605
+ marketplace: OrganizationMarketplaceProvider | null;
1606
+ /** Read-only collection method configured for the organization. */
1607
+ collection_method: BillingCollectionMethod;
1608
+ can_collect_payment: boolean;
1609
+ /** True when the customer has a valid Stripe default card payment method. */
1610
+ has_payment_method: boolean;
1611
+ /** The Stripe default card payment method, when one is configured and retrievable. */
1612
+ default_payment_method: BillingPaymentMethod | null;
1613
+ credits: BillingCustomerResponseCreditsList;
1614
+ credit_details: BillingCreditDetails;
1615
+ }
1616
+ export const BillingCustomerResponse = /*@__PURE__*/ S.suspend(() =>
1617
+ S.Struct({
1618
+ billing_email: S.String,
1619
+ marketplace: S.NullOr(OrganizationMarketplaceProvider),
1620
+ collection_method: BillingCollectionMethod,
1621
+ can_collect_payment: S.Boolean,
1622
+ has_payment_method: S.Boolean,
1623
+ default_payment_method: S.NullOr(BillingPaymentMethod),
1624
+ credits: BillingCustomerResponseCreditsList,
1625
+ credit_details: BillingCreditDetails,
1626
+ }),
1627
+ ).annotate({
1628
+ identifier: "BillingCustomerResponse",
1629
+ }) as any as S.Schema<BillingCustomerResponse>;
1630
+
1631
+ export interface GetBillingInvoicesRequest {
1632
+ /** Unique identifier for a specific organization */
1633
+ organizationID: string;
1634
+ /** Pagination cursor from a previous response */
1635
+ cursor?: string;
1636
+ /** Number of invoices to fetch */
1637
+ limit?: number;
1638
+ }
1639
+ export const GetBillingInvoicesRequest = /*@__PURE__*/ S.suspend(() =>
1640
+ S.Struct({
1641
+ organizationID: S.String.pipe(T.Label()),
1642
+ cursor: S.optional(S.String.pipe(T.Query())),
1643
+ limit: S.optional(S.Number.pipe(T.Query())),
1644
+ }).pipe(
1645
+ T.Http({
1646
+ method: "GET",
1647
+ uri: "/organizations/{organizationID}/billing/invoices",
1648
+ code: 200,
1649
+ }),
1650
+ ),
1651
+ ).annotate({
1652
+ identifier: "GetBillingInvoicesRequest",
1653
+ }) as any as S.Schema<GetBillingInvoicesRequest>;
1654
+
1655
+ export type BillingInvoiceStatus =
1656
+ | "draft"
1657
+ | "issued"
1658
+ | "paid"
1659
+ | "void"
1660
+ | "synced";
1661
+ export const BillingInvoiceStatus = S.String;
1662
+
1663
+ export interface BillingInvoice {
1664
+ id: string;
1665
+ invoice_number: string;
1666
+ /** Decimal amount due. */
1667
+ amount_due: number;
1668
+ currency: string;
1669
+ invoice_date: string;
1670
+ status: BillingInvoiceStatus;
1671
+ invoice_pdf: string | null;
1672
+ }
1673
+ export const BillingInvoice = /*@__PURE__*/ S.suspend(() =>
1674
+ S.Struct({
1675
+ id: S.String,
1676
+ invoice_number: S.String,
1677
+ amount_due: S.Number,
1678
+ currency: S.String,
1679
+ invoice_date: S.String,
1680
+ status: BillingInvoiceStatus,
1681
+ invoice_pdf: S.NullOr(S.String),
1682
+ }),
1683
+ ).annotate({ identifier: "BillingInvoice" }) as any as S.Schema<BillingInvoice>;
1684
+
1685
+ export type BillingInvoicesResponseDataList = Array<BillingInvoice>;
1686
+ export const BillingInvoicesResponseDataList = /*@__PURE__*/ S.Array(
1687
+ BillingInvoice,
1688
+ ) as any as S.Schema<BillingInvoicesResponseDataList>;
1689
+
1690
+ export interface PaginationMetadata {
1691
+ has_more: boolean;
1692
+ next_cursor: string | null;
1693
+ }
1694
+ export const PaginationMetadata = /*@__PURE__*/ S.suspend(() =>
1695
+ S.Struct({
1696
+ has_more: S.Boolean,
1697
+ next_cursor: S.NullOr(S.String),
1698
+ }),
1699
+ ).annotate({
1700
+ identifier: "PaginationMetadata",
1701
+ }) as any as S.Schema<PaginationMetadata>;
1702
+
1703
+ export interface BillingInvoicesResponse {
1704
+ data: BillingInvoicesResponseDataList;
1705
+ pagination_metadata: PaginationMetadata;
1706
+ }
1707
+ export const BillingInvoicesResponse = /*@__PURE__*/ S.suspend(() =>
1708
+ S.Struct({
1709
+ data: BillingInvoicesResponseDataList,
1710
+ pagination_metadata: PaginationMetadata,
1711
+ }),
1712
+ ).annotate({
1713
+ identifier: "BillingInvoicesResponse",
1714
+ }) as any as S.Schema<BillingInvoicesResponse>;
1715
+
1716
+ export interface GetBillingUpcomingInvoiceRequest {
1717
+ /** Unique identifier for a specific organization */
1718
+ organizationID: string;
1719
+ }
1720
+ export const GetBillingUpcomingInvoiceRequest = /*@__PURE__*/ S.suspend(() =>
1721
+ S.Struct({
1722
+ organizationID: S.String.pipe(T.Label()),
1723
+ }).pipe(
1724
+ T.Http({
1725
+ method: "GET",
1726
+ uri: "/organizations/{organizationID}/billing/invoices/upcoming",
1727
+ code: 200,
1728
+ }),
1729
+ ),
1730
+ ).annotate({
1731
+ identifier: "GetBillingUpcomingInvoiceRequest",
1732
+ }) as any as S.Schema<GetBillingUpcomingInvoiceRequest>;
1733
+
1734
+ export interface BillingUpcomingInvoiceResponse {
1735
+ created_at: string;
1736
+ /** Decimal amount due. */
1737
+ amount_due: number;
1738
+ currency: string;
1739
+ target_date: string;
1740
+ /** Decimal subtotal. */
1741
+ subtotal: number;
1742
+ /** Decimal total. */
1743
+ total: number;
1744
+ hosted_invoice_url: string | null;
1745
+ }
1746
+ export const BillingUpcomingInvoiceResponse = /*@__PURE__*/ S.suspend(() =>
1747
+ S.Struct({
1748
+ created_at: S.String,
1749
+ amount_due: S.Number,
1750
+ currency: S.String,
1751
+ target_date: S.String,
1752
+ subtotal: S.Number,
1753
+ total: S.Number,
1754
+ hosted_invoice_url: S.NullOr(S.String),
1755
+ }),
1756
+ ).annotate({
1757
+ identifier: "BillingUpcomingInvoiceResponse",
1758
+ }) as any as S.Schema<BillingUpcomingInvoiceResponse>;
1759
+
1760
+ export interface GetBranchCredentialsRequest {
1761
+ organizationID: string;
1762
+ projectID: string;
1763
+ branchID: string;
1764
+ /** Username that the credentials requested for, defaults to `xata` */
1765
+ username?: string;
1766
+ }
1767
+ export const GetBranchCredentialsRequest = /*@__PURE__*/ S.suspend(() =>
1768
+ S.Struct({
1769
+ organizationID: S.String.pipe(T.Label()),
1770
+ projectID: S.String.pipe(T.Label()),
1771
+ branchID: S.String.pipe(T.Label()),
1772
+ username: S.optional(S.String.pipe(T.Query())),
1773
+ }).pipe(
1774
+ T.Http({
1775
+ method: "GET",
1776
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/credentials",
1777
+ code: 200,
1778
+ }),
1779
+ ),
1780
+ ).annotate({
1781
+ identifier: "GetBranchCredentialsRequest",
1782
+ }) as any as S.Schema<GetBranchCredentialsRequest>;
1783
+
1784
+ /** Credentials and connection details for accessing a branch */
1785
+ export interface BranchCredentials {
1786
+ /** Username for accessing the branch database */
1787
+ username: string;
1788
+ /** Password for accessing the branch database */
1789
+ password: string | Redacted.Redacted<string>;
1790
+ /** Hostname for accessing the branch database */
1791
+ hostname: string;
1792
+ /** Port for accessing the branch database */
1793
+ port: number;
1794
+ /** Name of the database to connect to */
1795
+ dbname: string;
1796
+ /** Database connection string for accessing this branch. It carries no sslmode parameter, clients choose their own TLS settings. */
1797
+ connectionString: string | Redacted.Redacted<string>;
1798
+ }
1799
+ export const BranchCredentials = /*@__PURE__*/ S.suspend(() =>
1800
+ S.Struct({
1801
+ username: S.String,
1802
+ password: S.String.pipe(T.SensitiveValue({})),
1803
+ hostname: S.String,
1804
+ port: S.Number,
1805
+ dbname: S.String,
1806
+ connectionString: S.String.pipe(T.SensitiveValue({})),
1807
+ }),
1808
+ ).annotate({
1809
+ identifier: "BranchCredentials",
1810
+ }) as any as S.Schema<BranchCredentials>;
1811
+
1812
+ export interface GetBranchPostgresConfigRequest {
1813
+ /** Unique identifier of the organization containing the project */
1814
+ organizationID: string;
1815
+ /** Unique identifier of the project containing the branch */
1816
+ projectID: string;
1817
+ /** Unique identifier of the branch to retrieve PostgreSQL configuration for */
1818
+ branchID: string;
1819
+ }
1820
+ export const GetBranchPostgresConfigRequest = /*@__PURE__*/ S.suspend(() =>
1821
+ S.Struct({
1822
+ organizationID: S.String.pipe(T.Label()),
1823
+ projectID: S.String.pipe(T.Label()),
1824
+ branchID: S.String.pipe(T.Label()),
1825
+ }).pipe(
1826
+ T.Http({
1827
+ method: "GET",
1828
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/postgres-config",
1829
+ code: 200,
1830
+ }),
1831
+ ),
1832
+ ).annotate({
1833
+ identifier: "GetBranchPostgresConfigRequest",
1834
+ }) as any as S.Schema<GetBranchPostgresConfigRequest>;
1835
+
1836
+ /** The data type of the parameter */
1837
+ export type PostgresConfigParameterType =
1838
+ | "string"
1839
+ | "int"
1840
+ | "float"
1841
+ | "bytes"
1842
+ | "enum"
1843
+ | "duration"
1844
+ | "boolean";
1845
+ export const PostgresConfigParameterType = S.String;
1846
+
1847
+ /** List of allowed enum values (if applicable) */
1848
+ export type PostgresConfigParameterAcceptableRangeEnumValuesList =
1849
+ Array<string>;
1850
+ export const PostgresConfigParameterAcceptableRangeEnumValuesList =
1851
+ /*@__PURE__*/ S.Array(
1852
+ S.String,
1853
+ ) as any as S.Schema<PostgresConfigParameterAcceptableRangeEnumValuesList>;
1854
+
1855
+ /** Information about the acceptable range of values for this parameter */
1856
+ export interface PostgresConfigParameterAcceptableRange {
1857
+ /** Minimum allowed value (if applicable) */
1858
+ minValue?: string;
1859
+ /** Maximum allowed value (if applicable) */
1860
+ maxValue?: string;
1861
+ /** List of allowed enum values (if applicable) */
1862
+ enumValues?: PostgresConfigParameterAcceptableRangeEnumValuesList;
1863
+ }
1864
+ export const PostgresConfigParameterAcceptableRange = /*@__PURE__*/ S.suspend(
1865
+ () =>
1866
+ S.Struct({
1867
+ minValue: S.optional(S.String),
1868
+ maxValue: S.optional(S.String),
1869
+ enumValues: S.optional(
1870
+ PostgresConfigParameterAcceptableRangeEnumValuesList,
1871
+ ),
1872
+ }),
1873
+ ).annotate({
1874
+ identifier: "PostgresConfigParameterAcceptableRange",
1875
+ }) as any as S.Schema<PostgresConfigParameterAcceptableRange>;
1876
+
1877
+ /** The source of the default value */
1878
+ export type PostgresConfigParameterDefaultValueSource =
1879
+ | "postgres"
1880
+ | "instance_type";
1881
+ export const PostgresConfigParameterDefaultValueSource = S.String;
1882
+
1883
+ /** Detailed information about a single PostgreSQL configuration parameter */
1884
+ export interface PostgresConfigParameter {
1885
+ /** The name of the PostgreSQL parameter */
1886
+ name: string;
1887
+ /** The data type of the parameter */
1888
+ type: PostgresConfigParameterType;
1889
+ /** Human-readable description of what the parameter controls */
1890
+ description: string;
1891
+ /** The section/category this parameter belongs to */
1892
+ section: string;
1893
+ /** Information about the acceptable range of values for this parameter */
1894
+ acceptableRange?: PostgresConfigParameterAcceptableRange;
1895
+ /** The default value for this parameter */
1896
+ defaultValue: string;
1897
+ /** The source of the default value */
1898
+ defaultValueSource: PostgresConfigParameterDefaultValueSource;
1899
+ /** The current value of this parameter in the branch */
1900
+ currentValue: string;
1901
+ /** Link to PostgreSQL documentation for this parameter */
1902
+ documentationLink: string;
1903
+ /** Optional recommendation for this parameter (currently empty) */
1904
+ recommendation: string;
1905
+ /** Whether a database restart is required for this parameter change to take effect */
1906
+ restartRequired?: boolean;
1907
+ }
1908
+ export const PostgresConfigParameter = /*@__PURE__*/ S.suspend(() =>
1909
+ S.Struct({
1910
+ name: S.String,
1911
+ type: PostgresConfigParameterType,
1912
+ description: S.String,
1913
+ section: S.String,
1914
+ acceptableRange: S.optional(PostgresConfigParameterAcceptableRange),
1915
+ defaultValue: S.String,
1916
+ defaultValueSource: PostgresConfigParameterDefaultValueSource,
1917
+ currentValue: S.String,
1918
+ documentationLink: S.String,
1919
+ recommendation: S.String,
1920
+ restartRequired: S.optional(S.Boolean),
1921
+ }),
1922
+ ).annotate({
1923
+ identifier: "PostgresConfigParameter",
1924
+ }) as any as S.Schema<PostgresConfigParameter>;
1925
+
1926
+ /** Array of PostgreSQL configuration parameters with detailed information */
1927
+ export type PostgresConfigDetailsParametersList =
1928
+ Array<PostgresConfigParameter>;
1929
+ export const PostgresConfigDetailsParametersList = /*@__PURE__*/ S.Array(
1930
+ PostgresConfigParameter,
1931
+ ) as any as S.Schema<PostgresConfigDetailsParametersList>;
1932
+
1933
+ /** Detailed information about PostgreSQL configuration parameters for a branch */
1934
+ export interface PostgresConfigDetails {
1935
+ /** Array of PostgreSQL configuration parameters with detailed information */
1936
+ parameters: PostgresConfigDetailsParametersList;
1937
+ }
1938
+ export const PostgresConfigDetails = /*@__PURE__*/ S.suspend(() =>
1939
+ S.Struct({
1940
+ parameters: PostgresConfigDetailsParametersList,
1941
+ }),
1942
+ ).annotate({
1943
+ identifier: "PostgresConfigDetails",
1944
+ }) as any as S.Schema<PostgresConfigDetails>;
1945
+
1946
+ export interface GetDefaultProjectLimitsRequest {
1947
+ /** Unique identifier of the organization to get project limits for */
1948
+ organizationID: string;
1949
+ }
1950
+ export const GetDefaultProjectLimitsRequest = /*@__PURE__*/ S.suspend(() =>
1951
+ S.Struct({
1952
+ organizationID: S.String.pipe(T.Label()),
1953
+ }).pipe(
1954
+ T.Http({
1955
+ method: "GET",
1956
+ uri: "/organizations/{organizationID}/projects/limits",
1957
+ code: 200,
1958
+ }),
1959
+ ),
1960
+ ).annotate({
1961
+ identifier: "GetDefaultProjectLimitsRequest",
1962
+ }) as any as S.Schema<GetDefaultProjectLimitsRequest>;
1963
+
1964
+ /** Resource limits and constraints for projects within an organization */
1965
+ export interface ProjectLimits {
1966
+ /** Maximum number of database instances allowed per branch */
1967
+ maxInstances: number;
1968
+ /** Minimum number of database instances required per branch */
1969
+ minInstances: number;
1970
+ /** Maximum character length allowed for project descriptions */
1971
+ maxDescriptionLength: number;
1972
+ /** Maximum number of branches allowed per project */
1973
+ maxBranches: number;
1974
+ }
1975
+ export const ProjectLimits = /*@__PURE__*/ S.suspend(() =>
1976
+ S.Struct({
1977
+ maxInstances: S.Number,
1978
+ minInstances: S.Number,
1979
+ maxDescriptionLength: S.Number,
1980
+ maxBranches: S.Number,
1981
+ }),
1982
+ ).annotate({ identifier: "ProjectLimits" }) as any as S.Schema<ProjectLimits>;
1983
+
1984
+ export interface GetGithubRepositoryRequest {
1985
+ /** Unique identifier of the organization */
1986
+ organizationID: string;
1987
+ /** Unique identifier of the project */
1988
+ projectID: string;
1989
+ /** Unique identifier of the branch */
1990
+ branchID: string;
1991
+ }
1992
+ export const GetGithubRepositoryRequest = /*@__PURE__*/ S.suspend(() =>
1993
+ S.Struct({
1994
+ organizationID: S.String.pipe(T.Label()),
1995
+ projectID: S.String.pipe(T.Label()),
1996
+ branchID: S.String.pipe(T.Label()),
1997
+ }).pipe(
1998
+ T.Http({
1999
+ method: "GET",
2000
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/githubapp/repository",
2001
+ code: 200,
2002
+ }),
2003
+ ),
2004
+ ).annotate({
2005
+ identifier: "GetGithubRepositoryRequest",
2006
+ }) as any as S.Schema<GetGithubRepositoryRequest>;
2007
+
2008
+ export interface GetGithubRepositoryResponse {
2009
+ /** Repository mapping details, null if no mapping exists */
2010
+ mapping: GithubRepository | null;
2011
+ }
2012
+ export const GetGithubRepositoryResponse = /*@__PURE__*/ S.suspend(() =>
2013
+ S.Struct({
2014
+ mapping: S.NullOr(GithubRepository),
2015
+ }),
2016
+ ).annotate({
2017
+ identifier: "GetGithubRepositoryResponse",
2018
+ }) as any as S.Schema<GetGithubRepositoryResponse>;
2019
+
2020
+ export interface GetOrganizationRequest {
2021
+ /** Unique identifier for a specific organization */
2022
+ organizationID: string;
2023
+ }
2024
+ export const GetOrganizationRequest = /*@__PURE__*/ S.suspend(() =>
2025
+ S.Struct({
2026
+ organizationID: S.String.pipe(T.Label()),
2027
+ }).pipe(
2028
+ T.Http({
2029
+ method: "GET",
2030
+ uri: "/organizations/{organizationID}",
2031
+ code: 200,
2032
+ }),
2033
+ ),
2034
+ ).annotate({
2035
+ identifier: "GetOrganizationRequest",
2036
+ }) as any as S.Schema<GetOrganizationRequest>;
2037
+
2038
+ export interface GetOrganizationInvitationRequest {
2039
+ /** Unique identifier for a specific organization */
2040
+ organizationID: string;
2041
+ /** Unique identifier for an invitation */
2042
+ invitationID: string;
2043
+ }
2044
+ export const GetOrganizationInvitationRequest = /*@__PURE__*/ S.suspend(() =>
2045
+ S.Struct({
2046
+ organizationID: S.String.pipe(T.Label()),
2047
+ invitationID: S.String.pipe(T.Label()),
2048
+ }).pipe(
2049
+ T.Http({
2050
+ method: "GET",
2051
+ uri: "/organizations/{organizationID}/invitations/{invitationID}",
2052
+ code: 200,
2053
+ }),
2054
+ ),
2055
+ ).annotate({
2056
+ identifier: "GetOrganizationInvitationRequest",
2057
+ }) as any as S.Schema<GetOrganizationInvitationRequest>;
2058
+
2059
+ /** Current status of the invitation */
2060
+ export type OrganizationInvitationStatus = "pending" | "expired";
2061
+ export const OrganizationInvitationStatus = S.String;
2062
+
2063
+ export interface OrganizationInvitation {
2064
+ /** Unique identifier for the invitation */
2065
+ id: string;
2066
+ /** ID of the organization the invitation is for */
2067
+ organization_id: string;
2068
+ /** Email address of the invited user */
2069
+ email: string;
2070
+ /** First name of the invited user */
2071
+ first_name?: string | null;
2072
+ /** Last name of the invited user */
2073
+ last_name?: string | null;
2074
+ /** Timestamp when the invitation was created */
2075
+ created_at: string;
2076
+ /** Timestamp when the invitation expires */
2077
+ expires_at: string;
2078
+ /** Current status of the invitation */
2079
+ status: OrganizationInvitationStatus;
2080
+ /** URL link to accept the invitation */
2081
+ invite_link?: string;
2082
+ }
2083
+ export const OrganizationInvitation = /*@__PURE__*/ S.suspend(() =>
2084
+ S.Struct({
2085
+ id: S.String,
2086
+ organization_id: S.String,
2087
+ email: S.String,
2088
+ first_name: S.optional(S.NullOr(S.String)),
2089
+ last_name: S.optional(S.NullOr(S.String)),
2090
+ created_at: S.String,
2091
+ expires_at: S.String,
2092
+ status: OrganizationInvitationStatus,
2093
+ invite_link: S.optional(S.String),
2094
+ }),
2095
+ ).annotate({
2096
+ identifier: "OrganizationInvitation",
2097
+ }) as any as S.Schema<OrganizationInvitation>;
2098
+
2099
+ export interface GetOrganizationLimitsRequest {
2100
+ /** Unique identifier of the organization */
2101
+ organizationID: string;
2102
+ }
2103
+ export const GetOrganizationLimitsRequest = /*@__PURE__*/ S.suspend(() =>
2104
+ S.Struct({
2105
+ organizationID: S.String.pipe(T.Label()),
2106
+ }).pipe(
2107
+ T.Http({
2108
+ method: "GET",
2109
+ uri: "/organizations/{organizationID}/limits",
2110
+ code: 200,
2111
+ }),
2112
+ ),
2113
+ ).annotate({
2114
+ identifier: "GetOrganizationLimitsRequest",
2115
+ }) as any as S.Schema<GetOrganizationLimitsRequest>;
2116
+
2117
+ export interface GetOrganizationLimitsResponse {
2118
+ /** Maximum character length allowed for project descriptions */
2119
+ maxDescriptionLength: number;
2120
+ /** Maximum number of branches allowed per project */
2121
+ maxBranchesPerProject: number;
2122
+ /** Maximum number of database instances allowed per branch */
2123
+ maxInstancesPerBranch: number;
2124
+ /** Minimum number of database instances required per branch */
2125
+ minInstancesPerBranch: number;
2126
+ /** Maximum VCPUs (in millicores) allowed per instance; instance types with a higher VCPUsRequest are unavailable */
2127
+ maxAllowedInstanceType: number;
2128
+ /** Maximum number of branches that can be created in a rolling one-hour window */
2129
+ maxBranchesPerHour: number;
2130
+ /** Maximum storage in GiB (gigabytes) allowed per branch; 0 means no limit */
2131
+ maxStorageGBPerBranch: number;
2132
+ /** Maximum number of projects allowed in the organization */
2133
+ maxProjects: number;
2134
+ /** Maximum number of projects that can be created in a rolling one-hour window */
2135
+ maxProjectsPerHour: number;
2136
+ /** Maximum number of active branches allowed across all projects in the organization */
2137
+ maxBranchesPerOrg: number;
2138
+ }
2139
+ export const GetOrganizationLimitsResponse = /*@__PURE__*/ S.suspend(() =>
2140
+ S.Struct({
2141
+ maxDescriptionLength: S.Number,
2142
+ maxBranchesPerProject: S.Number,
2143
+ maxInstancesPerBranch: S.Number,
2144
+ minInstancesPerBranch: S.Number,
2145
+ maxAllowedInstanceType: S.Number,
2146
+ maxBranchesPerHour: S.Number,
2147
+ maxStorageGBPerBranch: S.Number,
2148
+ maxProjects: S.Number,
2149
+ maxProjectsPerHour: S.Number,
2150
+ maxBranchesPerOrg: S.Number,
2151
+ }),
2152
+ ).annotate({
2153
+ identifier: "GetOrganizationLimitsResponse",
2154
+ }) as any as S.Schema<GetOrganizationLimitsResponse>;
2155
+
2156
+ export interface GetOrganizationMembershipLimitsRequest {
2157
+ /** Unique identifier for a specific organization */
2158
+ organizationID: string;
2159
+ }
2160
+ export const GetOrganizationMembershipLimitsRequest = /*@__PURE__*/ S.suspend(
2161
+ () =>
2162
+ S.Struct({
2163
+ organizationID: S.String.pipe(T.Label()),
2164
+ }).pipe(
2165
+ T.Http({
2166
+ method: "GET",
2167
+ uri: "/organizations/{organizationID}/membership-limits",
2168
+ code: 200,
2169
+ }),
2170
+ ),
2171
+ ).annotate({
2172
+ identifier: "GetOrganizationMembershipLimitsRequest",
2173
+ }) as any as S.Schema<GetOrganizationMembershipLimitsRequest>;
2174
+
2175
+ /** Membership limits for an organization */
2176
+ export interface OrganizationMembershipLimits {
2177
+ /** Maximum number of members allowed in the organization */
2178
+ maxMembers: number;
2179
+ /** Maximum number of pending invitations allowed at once */
2180
+ maxInvites: number;
2181
+ }
2182
+ export const OrganizationMembershipLimits = /*@__PURE__*/ S.suspend(() =>
2183
+ S.Struct({
2184
+ maxMembers: S.Number,
2185
+ maxInvites: S.Number,
2186
+ }),
2187
+ ).annotate({
2188
+ identifier: "OrganizationMembershipLimits",
2189
+ }) as any as S.Schema<OrganizationMembershipLimits>;
2190
+
2191
+ export interface GetOrganizationsListRequest {}
2192
+ export const GetOrganizationsListRequest = /*@__PURE__*/ S.suspend(() =>
2193
+ S.Struct({}).pipe(
2194
+ T.Http({ method: "GET", uri: "/organizations", code: 200 }),
2195
+ ),
2196
+ ).annotate({
2197
+ identifier: "GetOrganizationsListRequest",
2198
+ }) as any as S.Schema<GetOrganizationsListRequest>;
2199
+
2200
+ export interface GetOrganizationsListResponseOrganizationsItem {
2201
+ /** Unique identifier for the organization */
2202
+ id: string;
2203
+ /** Human-readable name of the organization */
2204
+ name: string;
2205
+ /** Current status of the organization */
2206
+ status: OrganizationStatus;
2207
+ }
2208
+ export const GetOrganizationsListResponseOrganizationsItem =
2209
+ /*@__PURE__*/ S.suspend(() =>
2210
+ S.Struct({
2211
+ id: S.String,
2212
+ name: S.String,
2213
+ status: OrganizationStatus,
2214
+ }),
2215
+ ).annotate({
2216
+ identifier: "GetOrganizationsListResponseOrganizationsItem",
2217
+ }) as any as S.Schema<GetOrganizationsListResponseOrganizationsItem>;
2218
+
2219
+ /** List of organizations the user has access to */
2220
+ export type GetOrganizationsListResponseOrganizationsList =
2221
+ Array<GetOrganizationsListResponseOrganizationsItem>;
2222
+ export const GetOrganizationsListResponseOrganizationsList =
2223
+ /*@__PURE__*/ S.Array(
2224
+ GetOrganizationsListResponseOrganizationsItem,
2225
+ ) as any as S.Schema<GetOrganizationsListResponseOrganizationsList>;
2226
+
2227
+ export interface GetOrganizationsListResponse {
2228
+ /** List of organizations the user has access to */
2229
+ organizations: GetOrganizationsListResponseOrganizationsList;
2230
+ }
2231
+ export const GetOrganizationsListResponse = /*@__PURE__*/ S.suspend(() =>
2232
+ S.Struct({
2233
+ organizations: GetOrganizationsListResponseOrganizationsList,
2234
+ }),
2235
+ ).annotate({
2236
+ identifier: "GetOrganizationsListResponse",
2237
+ }) as any as S.Schema<GetOrganizationsListResponse>;
2238
+
2239
+ export interface GetProjectRequest {
2240
+ /** Unique identifier of the organization containing the project */
2241
+ organizationID: string;
2242
+ /** Unique identifier of the project to retrieve */
2243
+ projectID: string;
2244
+ }
2245
+ export const GetProjectRequest = /*@__PURE__*/ S.suspend(() =>
2246
+ S.Struct({
2247
+ organizationID: S.String.pipe(T.Label()),
2248
+ projectID: S.String.pipe(T.Label()),
2249
+ }).pipe(
2250
+ T.Http({
2251
+ method: "GET",
2252
+ uri: "/organizations/{organizationID}/projects/{projectID}",
2253
+ code: 200,
2254
+ }),
2255
+ ),
2256
+ ).annotate({
2257
+ identifier: "GetProjectRequest",
2258
+ }) as any as S.Schema<GetProjectRequest>;
2259
+
2260
+ export interface GetProjectLimitsRequest {
2261
+ /** Unique identifier of the organization */
2262
+ organizationID: string;
2263
+ /** Unique identifier of the project to get limits for */
2264
+ projectID: string;
2265
+ }
2266
+ export const GetProjectLimitsRequest = /*@__PURE__*/ S.suspend(() =>
2267
+ S.Struct({
2268
+ organizationID: S.String.pipe(T.Label()),
2269
+ projectID: S.String.pipe(T.Label()),
2270
+ }).pipe(
2271
+ T.Http({
2272
+ method: "GET",
2273
+ uri: "/organizations/{organizationID}/projects/{projectID}/limits",
2274
+ code: 200,
2275
+ }),
2276
+ ),
2277
+ ).annotate({
2278
+ identifier: "GetProjectLimitsRequest",
2279
+ }) as any as S.Schema<GetProjectLimitsRequest>;
2280
+
2281
+ /** Full set of resource limits applicable to a project and its branches */
2282
+ export interface EffectiveProjectLimits {
2283
+ /** Maximum character length allowed for project descriptions */
2284
+ maxDescriptionLength: number;
2285
+ /** Maximum number of branches allowed per project */
2286
+ maxBranchesPerProject: number;
2287
+ /** Maximum number of database instances allowed per branch */
2288
+ maxInstancesPerBranch: number;
2289
+ /** Minimum number of database instances required per branch */
2290
+ minInstancesPerBranch: number;
2291
+ /** Maximum VCPUs (in millicores) allowed per instance; instance types with a higher VCPUsRequest are unavailable */
2292
+ maxAllowedInstanceType: number;
2293
+ /** Maximum number of branches that can be created in a rolling one-hour window */
2294
+ maxBranchesPerHour: number;
2295
+ /** Maximum storage in GiB (gigabytes) allowed per branch; 0 means no limit */
2296
+ maxStorageGBPerBranch: number;
2297
+ }
2298
+ export const EffectiveProjectLimits = /*@__PURE__*/ S.suspend(() =>
2299
+ S.Struct({
2300
+ maxDescriptionLength: S.Number,
2301
+ maxBranchesPerProject: S.Number,
2302
+ maxInstancesPerBranch: S.Number,
2303
+ minInstancesPerBranch: S.Number,
2304
+ maxAllowedInstanceType: S.Number,
2305
+ maxBranchesPerHour: S.Number,
2306
+ maxStorageGBPerBranch: S.Number,
2307
+ }),
2308
+ ).annotate({
2309
+ identifier: "EffectiveProjectLimits",
2310
+ }) as any as S.Schema<EffectiveProjectLimits>;
2311
+
2312
+ /** GitHub webhook event payload */
2313
+ export type GithubWebhookRequestBodyMap = {
2314
+ [key: string]: unknown | undefined;
2315
+ };
2316
+ export const GithubWebhookRequestBodyMap = /*@__PURE__*/ S.Record(
2317
+ S.String,
2318
+ S.Unknown,
2319
+ ) as any as S.Schema<GithubWebhookRequestBodyMap>;
2320
+
2321
+ export interface GithubWebhookRequest {
2322
+ body: GithubWebhookRequestBodyMap;
2323
+ }
2324
+ export const GithubWebhookRequest = /*@__PURE__*/ S.suspend(() =>
2325
+ S.Struct({
2326
+ body: GithubWebhookRequestBodyMap.pipe(T.HttpBody()),
2327
+ }).pipe(T.Http({ method: "POST", uri: "/webhooks/github", code: 200 })),
2328
+ ).annotate({
2329
+ identifier: "GithubWebhookRequest",
2330
+ }) as any as S.Schema<GithubWebhookRequest>;
2331
+
2332
+ export interface GithubWebhookResponse {}
2333
+ export const GithubWebhookResponse = /*@__PURE__*/ S.suspend(() =>
2334
+ S.Struct({}),
2335
+ ).annotate({
2336
+ identifier: "GithubWebhookResponse",
2337
+ }) as any as S.Schema<GithubWebhookResponse>;
2338
+
2339
+ export interface ListBackupsRequest {
2340
+ /** Unique identifier of the organization containing the project */
2341
+ organizationID: string;
2342
+ /** Unique identifier of the project to retrieve backups for */
2343
+ projectID: string;
2344
+ }
2345
+ export const ListBackupsRequest = /*@__PURE__*/ S.suspend(() =>
2346
+ S.Struct({
2347
+ organizationID: S.String.pipe(T.Label()),
2348
+ projectID: S.String.pipe(T.Label()),
2349
+ }).pipe(
2350
+ T.Http({
2351
+ method: "GET",
2352
+ uri: "/organizations/{organizationID}/projects/{projectID}/backups",
2353
+ code: 200,
2354
+ }),
2355
+ ),
2356
+ ).annotate({
2357
+ identifier: "ListBackupsRequest",
2358
+ }) as any as S.Schema<ListBackupsRequest>;
2359
+
2360
+ /** list of backups within the project */
2361
+ export type ListBackupsResponseBackupsList = Array<BackupMetadata>;
2362
+ export const ListBackupsResponseBackupsList = /*@__PURE__*/ S.Array(
2363
+ BackupMetadata,
2364
+ ) as any as S.Schema<ListBackupsResponseBackupsList>;
2365
+
2366
+ export interface ListBackupsResponse {
2367
+ /** list of backups within the project */
2368
+ backups: ListBackupsResponseBackupsList;
2369
+ }
2370
+ export const ListBackupsResponse = /*@__PURE__*/ S.suspend(() =>
2371
+ S.Struct({
2372
+ backups: ListBackupsResponseBackupsList,
2373
+ }),
2374
+ ).annotate({
2375
+ identifier: "ListBackupsResponse",
2376
+ }) as any as S.Schema<ListBackupsResponse>;
2377
+
2378
+ export interface ListBranchesRequest {
2379
+ /** Unique identifier of the organization containing the project */
2380
+ organizationID: string;
2381
+ /** Unique identifier of the project to list branches from */
2382
+ projectID: string;
2383
+ }
2384
+ export const ListBranchesRequest = /*@__PURE__*/ S.suspend(() =>
2385
+ S.Struct({
2386
+ organizationID: S.String.pipe(T.Label()),
2387
+ projectID: S.String.pipe(T.Label()),
2388
+ }).pipe(
2389
+ T.Http({
2390
+ method: "GET",
2391
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches",
2392
+ code: 200,
2393
+ }),
2394
+ ),
2395
+ ).annotate({
2396
+ identifier: "ListBranchesRequest",
2397
+ }) as any as S.Schema<ListBranchesRequest>;
2398
+
2399
+ /** Metadata about a branch used when listing branches in a project */
2400
+ export interface BranchListMetadata {
2401
+ /** Unique identifier for the branch */
2402
+ id: string;
2403
+ /** Human-readable name of the branch */
2404
+ name: string;
2405
+ /** Optional description of the branch purpose or contents */
2406
+ description?: string;
2407
+ /** Timestamp when the branch was created */
2408
+ createdAt: string;
2409
+ /** Timestamp when the branch was last updated */
2410
+ updatedAt: string;
2411
+ /** Identifier of the parent branch if this is a derived branch, null otherwise */
2412
+ parentID?: string | null;
2413
+ /** Geographic region where the branch is deployed */
2414
+ region: string;
2415
+ /** Whether the branch allows public access without authentication */
2416
+ publicAccess: boolean;
2417
+ /** Whether the branch is in a region that supports backups */
2418
+ backupsEnabled: boolean;
2419
+ }
2420
+ export const BranchListMetadata = /*@__PURE__*/ S.suspend(() =>
2421
+ S.Struct({
2422
+ id: S.String,
2423
+ name: S.String,
2424
+ description: S.optional(S.String),
2425
+ createdAt: S.String,
2426
+ updatedAt: S.String,
2427
+ parentID: S.optional(S.NullOr(S.String)),
2428
+ region: S.String,
2429
+ publicAccess: S.Boolean,
2430
+ backupsEnabled: S.Boolean,
2431
+ }),
2432
+ ).annotate({
2433
+ identifier: "BranchListMetadata",
2434
+ }) as any as S.Schema<BranchListMetadata>;
2435
+
2436
+ /** Array of branch objects with their metadata */
2437
+ export type ListBranchesResponseBranchesList = Array<BranchListMetadata>;
2438
+ export const ListBranchesResponseBranchesList = /*@__PURE__*/ S.Array(
2439
+ BranchListMetadata,
2440
+ ) as any as S.Schema<ListBranchesResponseBranchesList>;
2441
+
2442
+ export interface ListBranchesResponse {
2443
+ /** Array of branch objects with their metadata */
2444
+ branches: ListBranchesResponseBranchesList;
2445
+ }
2446
+ export const ListBranchesResponse = /*@__PURE__*/ S.suspend(() =>
2447
+ S.Struct({
2448
+ branches: ListBranchesResponseBranchesList,
2449
+ }),
2450
+ ).annotate({
2451
+ identifier: "ListBranchesResponse",
2452
+ }) as any as S.Schema<ListBranchesResponse>;
2453
+
2454
+ export interface ListExtensionsRequest {
2455
+ /** Unique identifier of the organization to check instance type availability for */
2456
+ organizationID: string;
2457
+ /** Image for which we list extensions */
2458
+ image: string;
2459
+ /** Region to list extensions for image in */
2460
+ region?: string;
2461
+ }
2462
+ export const ListExtensionsRequest = /*@__PURE__*/ S.suspend(() =>
2463
+ S.Struct({
2464
+ organizationID: S.String.pipe(T.Label()),
2465
+ image: S.String.pipe(T.Query()),
2466
+ region: S.optional(S.String.pipe(T.Query())),
2467
+ }).pipe(
2468
+ T.Http({
2469
+ method: "GET",
2470
+ uri: "/organizations/{organizationID}/extensions",
2471
+ code: 200,
2472
+ }),
2473
+ ),
2474
+ ).annotate({
2475
+ identifier: "ListExtensionsRequest",
2476
+ }) as any as S.Schema<ListExtensionsRequest>;
2477
+
2478
+ /** type of installation */
2479
+ export type ExtensionType = "extension" | "plugin" | "module";
2480
+ export const ExtensionType = S.String;
2481
+
2482
+ /** Details of a postgres extension */
2483
+ export interface Extension {
2484
+ /** Extension name */
2485
+ name: string;
2486
+ /** Extension version */
2487
+ version: string;
2488
+ /** Extension description */
2489
+ description: string;
2490
+ /** Documentation URL */
2491
+ docs: string;
2492
+ /** is preload required for the extension or not */
2493
+ preloadRequired: boolean;
2494
+ /** type of installation */
2495
+ type: ExtensionType;
2496
+ }
2497
+ export const Extension = /*@__PURE__*/ S.suspend(() =>
2498
+ S.Struct({
2499
+ name: S.String,
2500
+ version: S.String,
2501
+ description: S.String,
2502
+ docs: S.String,
2503
+ preloadRequired: S.Boolean,
2504
+ type: ExtensionType,
2505
+ }),
2506
+ ).annotate({ identifier: "Extension" }) as any as S.Schema<Extension>;
2507
+
2508
+ /** Array of available images with their properties */
2509
+ export type ListExtensionsResponseExtensionsList = Array<Extension>;
2510
+ export const ListExtensionsResponseExtensionsList = /*@__PURE__*/ S.Array(
2511
+ Extension,
2512
+ ) as any as S.Schema<ListExtensionsResponseExtensionsList>;
2513
+
2514
+ export interface ListExtensionsResponse {
2515
+ /** Array of available images with their properties */
2516
+ extensions: ListExtensionsResponseExtensionsList;
2517
+ }
2518
+ export const ListExtensionsResponse = /*@__PURE__*/ S.suspend(() =>
2519
+ S.Struct({
2520
+ extensions: ListExtensionsResponseExtensionsList,
2521
+ }),
2522
+ ).annotate({
2523
+ identifier: "ListExtensionsResponse",
2524
+ }) as any as S.Schema<ListExtensionsResponse>;
2525
+
2526
+ export interface ListGithubAppInstallationsRequest {
2527
+ /** Unique identifier of the organization */
2528
+ organizationID: string;
2529
+ }
2530
+ export const ListGithubAppInstallationsRequest = /*@__PURE__*/ S.suspend(() =>
2531
+ S.Struct({
2532
+ organizationID: S.String.pipe(T.Label()),
2533
+ }).pipe(
2534
+ T.Http({
2535
+ method: "GET",
2536
+ uri: "/organizations/{organizationID}/githubapp/installations",
2537
+ code: 200,
2538
+ }),
2539
+ ),
2540
+ ).annotate({
2541
+ identifier: "ListGithubAppInstallationsRequest",
2542
+ }) as any as S.Schema<ListGithubAppInstallationsRequest>;
2543
+
2544
+ /** Array of GitHub App installations */
2545
+ export type ListGithubAppInstallationsResponseInstallationsList =
2546
+ Array<GithubInstallation>;
2547
+ export const ListGithubAppInstallationsResponseInstallationsList =
2548
+ /*@__PURE__*/ S.Array(
2549
+ GithubInstallation,
2550
+ ) as any as S.Schema<ListGithubAppInstallationsResponseInstallationsList>;
2551
+
2552
+ export interface ListGithubAppInstallationsResponse {
2553
+ /** Array of GitHub App installations */
2554
+ installations: ListGithubAppInstallationsResponseInstallationsList;
2555
+ }
2556
+ export const ListGithubAppInstallationsResponse = /*@__PURE__*/ S.suspend(() =>
2557
+ S.Struct({
2558
+ installations: ListGithubAppInstallationsResponseInstallationsList,
2559
+ }),
2560
+ ).annotate({
2561
+ identifier: "ListGithubAppInstallationsResponse",
2562
+ }) as any as S.Schema<ListGithubAppInstallationsResponse>;
2563
+
2564
+ export interface ListImagesRequest {
2565
+ /** Unique identifier of the organization to check image availability */
2566
+ organizationID: string;
2567
+ /** Region to check image availability for organization */
2568
+ region?: string;
2569
+ }
2570
+ export const ListImagesRequest = /*@__PURE__*/ S.suspend(() =>
2571
+ S.Struct({
2572
+ organizationID: S.String.pipe(T.Label()),
2573
+ region: S.optional(S.String.pipe(T.Query())),
2574
+ }).pipe(
2575
+ T.Http({
2576
+ method: "GET",
2577
+ uri: "/organizations/{organizationID}/images",
2578
+ code: 200,
2579
+ }),
2580
+ ),
2581
+ ).annotate({
2582
+ identifier: "ListImagesRequest",
2583
+ }) as any as S.Schema<ListImagesRequest>;
2584
+
2585
+ /** region where this instance type is available */
2586
+ export type ImageRegionList = Array<string>;
2587
+ export const ImageRegionList = /*@__PURE__*/ S.Array(
2588
+ S.String,
2589
+ ) as any as S.Schema<ImageRegionList>;
2590
+
2591
+ /** Details of a postgres image */
2592
+ export interface Image {
2593
+ /** Image name */
2594
+ name: string;
2595
+ /** major postgres version */
2596
+ majorVersion: string;
2597
+ /** full postgres version */
2598
+ fullVersion: string;
2599
+ /** region where this instance type is available */
2600
+ region?: ImageRegionList;
2601
+ }
2602
+ export const Image = /*@__PURE__*/ S.suspend(() =>
2603
+ S.Struct({
2604
+ name: S.String,
2605
+ majorVersion: S.String,
2606
+ fullVersion: S.String,
2607
+ region: S.optional(ImageRegionList),
2608
+ }),
2609
+ ).annotate({ identifier: "Image" }) as any as S.Schema<Image>;
2610
+
2611
+ /** Array of available images with their properties */
2612
+ export type ListImagesResponseImagesList = Array<Image>;
2613
+ export const ListImagesResponseImagesList = /*@__PURE__*/ S.Array(
2614
+ Image,
2615
+ ) as any as S.Schema<ListImagesResponseImagesList>;
2616
+
2617
+ export interface ListImagesResponse {
2618
+ /** Array of available images with their properties */
2619
+ images: ListImagesResponseImagesList;
2620
+ }
2621
+ export const ListImagesResponse = /*@__PURE__*/ S.suspend(() =>
2622
+ S.Struct({
2623
+ images: ListImagesResponseImagesList,
2624
+ }),
2625
+ ).annotate({
2626
+ identifier: "ListImagesResponse",
2627
+ }) as any as S.Schema<ListImagesResponse>;
2628
+
2629
+ export interface ListInstanceTypesRequest {
2630
+ /** Unique identifier of the organization to check instance type availability for */
2631
+ organizationID: string;
2632
+ /** Region to check instance type availability for */
2633
+ region: string;
2634
+ }
2635
+ export const ListInstanceTypesRequest = /*@__PURE__*/ S.suspend(() =>
2636
+ S.Struct({
2637
+ organizationID: S.String.pipe(T.Label()),
2638
+ region: S.String.pipe(T.Query()),
2639
+ }).pipe(
2640
+ T.Http({
2641
+ method: "GET",
2642
+ uri: "/organizations/{organizationID}/instanceTypes",
2643
+ code: 200,
2644
+ }),
2645
+ ),
2646
+ ).annotate({
2647
+ identifier: "ListInstanceTypesRequest",
2648
+ }) as any as S.Schema<ListInstanceTypesRequest>;
2649
+
2650
+ export interface ListInstanceTypesResponseInstanceTypesItem {
2651
+ /** Instance type name */
2652
+ name: string;
2653
+ /** number of vCPUs */
2654
+ vcpus: number;
2655
+ /** memory in Gi */
2656
+ ram: number;
2657
+ /** price per hour for this instance type and region */
2658
+ hourlyRate: number;
2659
+ /** price per month for a GB of storage for this region */
2660
+ storageMonthlyRate: number;
2661
+ /** region where this instance type is available */
2662
+ region: string;
2663
+ }
2664
+ export const ListInstanceTypesResponseInstanceTypesItem =
2665
+ /*@__PURE__*/ S.suspend(() =>
2666
+ S.Struct({
2667
+ name: S.String,
2668
+ vcpus: S.Number,
2669
+ ram: S.Number,
2670
+ hourlyRate: S.Number,
2671
+ storageMonthlyRate: S.Number,
2672
+ region: S.String,
2673
+ }),
2674
+ ).annotate({
2675
+ identifier: "ListInstanceTypesResponseInstanceTypesItem",
2676
+ }) as any as S.Schema<ListInstanceTypesResponseInstanceTypesItem>;
2677
+
2678
+ /** Array of available instance types with their properties */
2679
+ export type ListInstanceTypesResponseInstanceTypesList =
2680
+ Array<ListInstanceTypesResponseInstanceTypesItem>;
2681
+ export const ListInstanceTypesResponseInstanceTypesList = /*@__PURE__*/ S.Array(
2682
+ ListInstanceTypesResponseInstanceTypesItem,
2683
+ ) as any as S.Schema<ListInstanceTypesResponseInstanceTypesList>;
2684
+
2685
+ export interface ListInstanceTypesResponse {
2686
+ /** Array of available instance types with their properties */
2687
+ instanceTypes: ListInstanceTypesResponseInstanceTypesList;
2688
+ }
2689
+ export const ListInstanceTypesResponse = /*@__PURE__*/ S.suspend(() =>
2690
+ S.Struct({
2691
+ instanceTypes: ListInstanceTypesResponseInstanceTypesList,
2692
+ }),
2693
+ ).annotate({
2694
+ identifier: "ListInstanceTypesResponse",
2695
+ }) as any as S.Schema<ListInstanceTypesResponse>;
2696
+
2697
+ export interface ListOrganizationAPIKeysRequest {
2698
+ /** Unique identifier for a specific organization */
2699
+ organizationID: string;
2700
+ }
2701
+ export const ListOrganizationAPIKeysRequest = /*@__PURE__*/ S.suspend(() =>
2702
+ S.Struct({
2703
+ organizationID: S.String.pipe(T.Label()),
2704
+ }).pipe(
2705
+ T.Http({
2706
+ method: "GET",
2707
+ uri: "/organizations/{organizationID}/api-keys",
2708
+ code: 200,
2709
+ }),
2710
+ ),
2711
+ ).annotate({
2712
+ identifier: "ListOrganizationAPIKeysRequest",
2713
+ }) as any as S.Schema<ListOrganizationAPIKeysRequest>;
2714
+
2715
+ export type APIKeyPreviewScopesList = Array<string>;
2716
+ export const APIKeyPreviewScopesList = /*@__PURE__*/ S.Array(
2717
+ S.String,
2718
+ ) as any as S.Schema<APIKeyPreviewScopesList>;
2719
+
2720
+ /** Projects this API key has access to */
2721
+ export type APIKeyPreviewProjectsList = Array<string>;
2722
+ export const APIKeyPreviewProjectsList = /*@__PURE__*/ S.Array(
2723
+ S.String,
2724
+ ) as any as S.Schema<APIKeyPreviewProjectsList>;
2725
+
2726
+ /** Branches this API key has access to */
2727
+ export type APIKeyPreviewBranchesList = Array<string>;
2728
+ export const APIKeyPreviewBranchesList = /*@__PURE__*/ S.Array(
2729
+ S.String,
2730
+ ) as any as S.Schema<APIKeyPreviewBranchesList>;
2731
+
2732
+ export interface APIKeyPreview {
2733
+ id: string;
2734
+ name: string;
2735
+ preview: string;
2736
+ scopes: APIKeyPreviewScopesList;
2737
+ /** Projects this API key has access to */
2738
+ projects: APIKeyPreviewProjectsList;
2739
+ /** Branches this API key has access to */
2740
+ branches: APIKeyPreviewBranchesList;
2741
+ created_at: string;
2742
+ /** Date when the API key expires (null if no expiry) */
2743
+ expiry: string | null;
2744
+ /** Timestamp of the last time the key was used (null if never) */
2745
+ last_used: string | null;
2746
+ /** ID of the user that created this API key */
2747
+ created_by?: string | null;
2748
+ /** ID of the API key that created this API key */
2749
+ created_by_key?: string | null;
2750
+ }
2751
+ export const APIKeyPreview = /*@__PURE__*/ S.suspend(() =>
2752
+ S.Struct({
2753
+ id: S.String,
2754
+ name: S.String,
2755
+ preview: S.String,
2756
+ scopes: APIKeyPreviewScopesList,
2757
+ projects: APIKeyPreviewProjectsList,
2758
+ branches: APIKeyPreviewBranchesList,
2759
+ created_at: S.String,
2760
+ expiry: S.NullOr(S.String),
2761
+ last_used: S.NullOr(S.String),
2762
+ created_by: S.optional(S.NullOr(S.String)),
2763
+ created_by_key: S.optional(S.NullOr(S.String)),
2764
+ }),
2765
+ ).annotate({ identifier: "APIKeyPreview" }) as any as S.Schema<APIKeyPreview>;
2766
+
2767
+ /** Array of API keys for the organization */
2768
+ export type ListOrganizationAPIKeysResponseKeysList = Array<APIKeyPreview>;
2769
+ export const ListOrganizationAPIKeysResponseKeysList = /*@__PURE__*/ S.Array(
2770
+ APIKeyPreview,
2771
+ ) as any as S.Schema<ListOrganizationAPIKeysResponseKeysList>;
2772
+
2773
+ export interface ListOrganizationAPIKeysResponse {
2774
+ /** Array of API keys for the organization */
2775
+ keys: ListOrganizationAPIKeysResponseKeysList;
2776
+ }
2777
+ export const ListOrganizationAPIKeysResponse = /*@__PURE__*/ S.suspend(() =>
2778
+ S.Struct({
2779
+ keys: ListOrganizationAPIKeysResponseKeysList,
2780
+ }),
2781
+ ).annotate({
2782
+ identifier: "ListOrganizationAPIKeysResponse",
2783
+ }) as any as S.Schema<ListOrganizationAPIKeysResponse>;
2784
+
2785
+ export type ListOrganizationInvitationsRequestStatus = "pending" | "expired";
2786
+ export const ListOrganizationInvitationsRequestStatus = S.String;
2787
+
2788
+ export interface ListOrganizationInvitationsRequest {
2789
+ /** Unique identifier for a specific organization */
2790
+ organizationID: string;
2791
+ /** Filter invitations by status */
2792
+ status?: ListOrganizationInvitationsRequestStatus | (string & {});
2793
+ /** Filter invitations by email address */
2794
+ email?: string;
2795
+ /** Filter invitations by first name */
2796
+ first_name?: string;
2797
+ /** Filter invitations by last name */
2798
+ last_name?: string;
2799
+ /** Search invitations by email or name */
2800
+ search?: string;
2801
+ /** Index of the first result to return (0-based offset for pagination) */
2802
+ first?: number;
2803
+ /** Maximum number of results to return */
2804
+ max?: number;
2805
+ }
2806
+ export const ListOrganizationInvitationsRequest = /*@__PURE__*/ S.suspend(() =>
2807
+ S.Struct({
2808
+ organizationID: S.String.pipe(T.Label()),
2809
+ status: S.optional(
2810
+ ListOrganizationInvitationsRequestStatus.pipe(T.Query()),
2811
+ ),
2812
+ email: S.optional(S.String.pipe(T.Query())),
2813
+ first_name: S.optional(S.String.pipe(T.Query())),
2814
+ last_name: S.optional(S.String.pipe(T.Query())),
2815
+ search: S.optional(S.String.pipe(T.Query())),
2816
+ first: S.optional(S.Number.pipe(T.Query())),
2817
+ max: S.optional(S.Number.pipe(T.Query())),
2818
+ }).pipe(
2819
+ T.Http({
2820
+ method: "GET",
2821
+ uri: "/organizations/{organizationID}/invitations",
2822
+ code: 200,
2823
+ }),
2824
+ ),
2825
+ ).annotate({
2826
+ identifier: "ListOrganizationInvitationsRequest",
2827
+ }) as any as S.Schema<ListOrganizationInvitationsRequest>;
2828
+
2829
+ export type ListOrganizationInvitationsResponseInvitationsList =
2830
+ Array<OrganizationInvitation>;
2831
+ export const ListOrganizationInvitationsResponseInvitationsList =
2832
+ /*@__PURE__*/ S.Array(
2833
+ OrganizationInvitation,
2834
+ ) as any as S.Schema<ListOrganizationInvitationsResponseInvitationsList>;
2835
+
2836
+ export interface ListOrganizationInvitationsResponse {
2837
+ invitations: ListOrganizationInvitationsResponseInvitationsList;
2838
+ }
2839
+ export const ListOrganizationInvitationsResponse = /*@__PURE__*/ S.suspend(() =>
2840
+ S.Struct({
2841
+ invitations: ListOrganizationInvitationsResponseInvitationsList,
2842
+ }),
2843
+ ).annotate({
2844
+ identifier: "ListOrganizationInvitationsResponse",
2845
+ }) as any as S.Schema<ListOrganizationInvitationsResponse>;
2846
+
2847
+ export interface ListOrganizationMembersRequest {
2848
+ /** Unique identifier for a specific organization */
2849
+ organizationID: string;
2850
+ }
2851
+ export const ListOrganizationMembersRequest = /*@__PURE__*/ S.suspend(() =>
2852
+ S.Struct({
2853
+ organizationID: S.String.pipe(T.Label()),
2854
+ }).pipe(
2855
+ T.Http({
2856
+ method: "GET",
2857
+ uri: "/organizations/{organizationID}/members",
2858
+ code: 200,
2859
+ }),
2860
+ ),
2861
+ ).annotate({
2862
+ identifier: "ListOrganizationMembersRequest",
2863
+ }) as any as S.Schema<ListOrganizationMembersRequest>;
2864
+
2865
+ export interface UserWithID {
2866
+ /** Email address associated with the user account */
2867
+ email: string;
2868
+ /** Name of the user */
2869
+ name: string;
2870
+ id: string;
2871
+ }
2872
+ export const UserWithID = /*@__PURE__*/ S.suspend(() =>
2873
+ S.Struct({
2874
+ email: S.String,
2875
+ name: S.String,
2876
+ id: S.String,
2877
+ }),
2878
+ ).annotate({ identifier: "UserWithID" }) as any as S.Schema<UserWithID>;
2879
+
2880
+ export type ListOrganizationMembersResponseMembersList = Array<UserWithID>;
2881
+ export const ListOrganizationMembersResponseMembersList = /*@__PURE__*/ S.Array(
2882
+ UserWithID,
2883
+ ) as any as S.Schema<ListOrganizationMembersResponseMembersList>;
2884
+
2885
+ export interface ListOrganizationMembersResponse {
2886
+ members: ListOrganizationMembersResponseMembersList;
2887
+ }
2888
+ export const ListOrganizationMembersResponse = /*@__PURE__*/ S.suspend(() =>
2889
+ S.Struct({
2890
+ members: ListOrganizationMembersResponseMembersList,
2891
+ }),
2892
+ ).annotate({
2893
+ identifier: "ListOrganizationMembersResponse",
2894
+ }) as any as S.Schema<ListOrganizationMembersResponse>;
2895
+
2896
+ export interface ListProjectsRequest {
2897
+ /** Unique identifier of the organization to list projects from */
2898
+ organizationID: string;
2899
+ }
2900
+ export const ListProjectsRequest = /*@__PURE__*/ S.suspend(() =>
2901
+ S.Struct({
2902
+ organizationID: S.String.pipe(T.Label()),
2903
+ }).pipe(
2904
+ T.Http({
2905
+ method: "GET",
2906
+ uri: "/organizations/{organizationID}/projects",
2907
+ code: 200,
2908
+ }),
2909
+ ),
2910
+ ).annotate({
2911
+ identifier: "ListProjectsRequest",
2912
+ }) as any as S.Schema<ListProjectsRequest>;
2913
+
2914
+ /** Array of project objects with their metadata */
2915
+ export type ListProjectsResponseProjectsList = Array<Project>;
2916
+ export const ListProjectsResponseProjectsList = /*@__PURE__*/ S.Array(
2917
+ Project,
2918
+ ) as any as S.Schema<ListProjectsResponseProjectsList>;
2919
+
2920
+ export interface ListProjectsResponse {
2921
+ /** Array of project objects with their metadata */
2922
+ projects: ListProjectsResponseProjectsList;
2923
+ }
2924
+ export const ListProjectsResponse = /*@__PURE__*/ S.suspend(() =>
2925
+ S.Struct({
2926
+ projects: ListProjectsResponseProjectsList,
2927
+ }),
2928
+ ).annotate({
2929
+ identifier: "ListProjectsResponse",
2930
+ }) as any as S.Schema<ListProjectsResponse>;
2931
+
2932
+ export interface ListRegionsRequest {
2933
+ /** Unique identifier of the organization to check region availability for */
2934
+ organizationID: string;
2935
+ }
2936
+ export const ListRegionsRequest = /*@__PURE__*/ S.suspend(() =>
2937
+ S.Struct({
2938
+ organizationID: S.String.pipe(T.Label()),
2939
+ }).pipe(
2940
+ T.Http({
2941
+ method: "GET",
2942
+ uri: "/organizations/{organizationID}/regions",
2943
+ code: 200,
2944
+ }),
2945
+ ),
2946
+ ).annotate({
2947
+ identifier: "ListRegionsRequest",
2948
+ }) as any as S.Schema<ListRegionsRequest>;
2949
+
2950
+ /** Cloud provider the region runs on */
2951
+ export type ListRegionsResponseRegionsItemProvider = "aws" | "gcp" | "custom";
2952
+ export const ListRegionsResponseRegionsItemProvider = S.String;
2953
+
2954
+ export interface ListRegionsResponseRegionsItem {
2955
+ /** Unique identifier for the region */
2956
+ id: string;
2957
+ /** Whether data plane is public-facing to the internet in this region */
2958
+ publicAccess: boolean;
2959
+ /** Whether backups are enabled for branches created in this region */
2960
+ backupsEnabled: boolean;
2961
+ /** Cloud provider the region runs on */
2962
+ provider: ListRegionsResponseRegionsItemProvider;
2963
+ /** Organization that owns this region, if set the region is only available to this organization */
2964
+ organizationId: string | null;
2965
+ }
2966
+ export const ListRegionsResponseRegionsItem = /*@__PURE__*/ S.suspend(() =>
2967
+ S.Struct({
2968
+ id: S.String,
2969
+ publicAccess: S.Boolean,
2970
+ backupsEnabled: S.Boolean,
2971
+ provider: ListRegionsResponseRegionsItemProvider,
2972
+ organizationId: S.NullOr(S.String),
2973
+ }),
2974
+ ).annotate({
2975
+ identifier: "ListRegionsResponseRegionsItem",
2976
+ }) as any as S.Schema<ListRegionsResponseRegionsItem>;
2977
+
2978
+ /** Array of available regions with their properties */
2979
+ export type ListRegionsResponseRegionsList =
2980
+ Array<ListRegionsResponseRegionsItem>;
2981
+ export const ListRegionsResponseRegionsList = /*@__PURE__*/ S.Array(
2982
+ ListRegionsResponseRegionsItem,
2983
+ ) as any as S.Schema<ListRegionsResponseRegionsList>;
2984
+
2985
+ export interface ListRegionsResponse {
2986
+ /** Array of available regions with their properties */
2987
+ regions: ListRegionsResponseRegionsList;
2988
+ }
2989
+ export const ListRegionsResponse = /*@__PURE__*/ S.suspend(() =>
2990
+ S.Struct({
2991
+ regions: ListRegionsResponseRegionsList,
2992
+ }),
2993
+ ).annotate({
2994
+ identifier: "ListRegionsResponse",
2995
+ }) as any as S.Schema<ListRegionsResponse>;
2996
+
2997
+ export interface ListUserAPIKeysRequest {}
2998
+ export const ListUserAPIKeysRequest = /*@__PURE__*/ S.suspend(() =>
2999
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/api-keys", code: 200 })),
3000
+ ).annotate({
3001
+ identifier: "ListUserAPIKeysRequest",
3002
+ }) as any as S.Schema<ListUserAPIKeysRequest>;
3003
+
3004
+ /** Array of API keys for the user */
3005
+ export type ListUserAPIKeysResponseKeysList = Array<APIKeyPreview>;
3006
+ export const ListUserAPIKeysResponseKeysList = /*@__PURE__*/ S.Array(
3007
+ APIKeyPreview,
3008
+ ) as any as S.Schema<ListUserAPIKeysResponseKeysList>;
3009
+
3010
+ export interface ListUserAPIKeysResponse {
3011
+ /** Array of API keys for the user */
3012
+ keys: ListUserAPIKeysResponseKeysList;
3013
+ }
3014
+ export const ListUserAPIKeysResponse = /*@__PURE__*/ S.suspend(() =>
3015
+ S.Struct({
3016
+ keys: ListUserAPIKeysResponseKeysList,
3017
+ }),
3018
+ ).annotate({
3019
+ identifier: "ListUserAPIKeysResponse",
3020
+ }) as any as S.Schema<ListUserAPIKeysResponse>;
3021
+
3022
+ /** Orb webhook event payload */
3023
+ export type OrbWebhookRequestBodyMap = { [key: string]: unknown | undefined };
3024
+ export const OrbWebhookRequestBodyMap = /*@__PURE__*/ S.Record(
3025
+ S.String,
3026
+ S.Unknown,
3027
+ ) as any as S.Schema<OrbWebhookRequestBodyMap>;
3028
+
3029
+ export interface OrbWebhookRequest {
3030
+ body: OrbWebhookRequestBodyMap;
3031
+ }
3032
+ export const OrbWebhookRequest = /*@__PURE__*/ S.suspend(() =>
3033
+ S.Struct({
3034
+ body: OrbWebhookRequestBodyMap.pipe(T.HttpBody()),
3035
+ }).pipe(T.Http({ method: "POST", uri: "/webhooks/orb", code: 200 })),
3036
+ ).annotate({
3037
+ identifier: "OrbWebhookRequest",
3038
+ }) as any as S.Schema<OrbWebhookRequest>;
3039
+
3040
+ export interface OrbWebhookResponse {}
3041
+ export const OrbWebhookResponse = /*@__PURE__*/ S.suspend(() =>
3042
+ S.Struct({}),
3043
+ ).annotate({
3044
+ identifier: "OrbWebhookResponse",
3045
+ }) as any as S.Schema<OrbWebhookResponse>;
3046
+
3047
+ /** Positional parameters for the query (`$1`, `$2`, ...). */
3048
+ export type QueryRequestParamsList = Array<unknown>;
3049
+ export const QueryRequestParamsList = /*@__PURE__*/ S.Array(
3050
+ S.Unknown,
3051
+ ) as any as S.Schema<QueryRequestParamsList>;
3052
+
3053
+ /** Positional parameters for the query. */
3054
+ export type QueryItemParamsList = Array<unknown>;
3055
+ export const QueryItemParamsList = /*@__PURE__*/ S.Array(
3056
+ S.Unknown,
3057
+ ) as any as S.Schema<QueryItemParamsList>;
3058
+
3059
+ /** A single query within a batch request. */
3060
+ export interface QueryItem {
3061
+ /** SQL query to execute. */
3062
+ query: string;
3063
+ /** Positional parameters for the query. */
3064
+ params?: QueryItemParamsList;
3065
+ /** Override array mode for this individual query. */
3066
+ arrayMode?: boolean;
3067
+ }
3068
+ export const QueryItem = /*@__PURE__*/ S.suspend(() =>
3069
+ S.Struct({
3070
+ query: S.String,
3071
+ params: S.optional(QueryItemParamsList),
3072
+ arrayMode: S.optional(S.Boolean),
3073
+ }),
3074
+ ).annotate({ identifier: "QueryItem" }) as any as S.Schema<QueryItem>;
3075
+
3076
+ /** Array of queries for batch execution within a single transaction. */
3077
+ export type QueryRequestQueriesList = Array<QueryItem>;
3078
+ export const QueryRequestQueriesList = /*@__PURE__*/ S.Array(
3079
+ QueryItem,
3080
+ ) as any as S.Schema<QueryRequestQueriesList>;
3081
+
3082
+ export interface QueryRequest {
3083
+ /** SQL query to execute (single query mode). */
3084
+ query?: string;
3085
+ /** Positional parameters for the query (`$1`, `$2`, ...). */
3086
+ params?: QueryRequestParamsList;
3087
+ /** Array of queries for batch execution within a single transaction. */
3088
+ queries?: QueryRequestQueriesList;
3089
+ /** Override array mode for this query (single query mode only). */
3090
+ arrayMode?: boolean;
3091
+ }
3092
+ export const QueryRequest = /*@__PURE__*/ S.suspend(() =>
3093
+ S.Struct({
3094
+ query: S.optional(S.String),
3095
+ params: S.optional(QueryRequestParamsList),
3096
+ queries: S.optional(QueryRequestQueriesList),
3097
+ arrayMode: S.optional(S.Boolean),
3098
+ }).pipe(T.Http({ method: "POST", uri: "/sql", code: 200 })),
3099
+ ).annotate({ identifier: "QueryRequest" }) as any as S.Schema<QueryRequest>;
3100
+
3101
+ /** PostgreSQL column metadata from the row description message. */
3102
+ export interface FieldDefinition {
3103
+ /** Column name. */
3104
+ name: string;
3105
+ /** OID of the source table (0 if not a table column). */
3106
+ tableID: number;
3107
+ /** Attribute number of the column within the table. */
3108
+ columnID: number;
3109
+ /** OID of the column data type. */
3110
+ dataTypeID: number;
3111
+ /** Data type size (negative for variable-length types). */
3112
+ dataTypeSize: number;
3113
+ /** Type-specific modifier (e.g. precision/scale for numeric types). */
3114
+ dataTypeModifier: number;
3115
+ /** Data format (`text` or `binary`). */
3116
+ format: string;
3117
+ }
3118
+ export const FieldDefinition = /*@__PURE__*/ S.suspend(() =>
3119
+ S.Struct({
3120
+ name: S.String,
3121
+ tableID: S.Number,
3122
+ columnID: S.Number,
3123
+ dataTypeID: S.Number,
3124
+ dataTypeSize: S.Number,
3125
+ dataTypeModifier: S.Number,
3126
+ format: S.String,
3127
+ }),
3128
+ ).annotate({
3129
+ identifier: "FieldDefinition",
3130
+ }) as any as S.Schema<FieldDefinition>;
3131
+
3132
+ /** Column metadata for the result set. */
3133
+ export type QueryResultFieldsList = Array<FieldDefinition>;
3134
+ export const QueryResultFieldsList = /*@__PURE__*/ S.Array(
3135
+ FieldDefinition,
3136
+ ) as any as S.Schema<QueryResultFieldsList>;
3137
+
3138
+ /** Result rows. Each row is an object (column-name keys) or an array (when array mode is enabled). */
3139
+ export type QueryResultRowsList = Array<unknown>;
3140
+ export const QueryResultRowsList = /*@__PURE__*/ S.Array(
3141
+ S.Unknown,
3142
+ ) as any as S.Schema<QueryResultRowsList>;
3143
+
3144
+ /** Result of a single SQL query execution. */
3145
+ export interface QueryResult {
3146
+ /** Column metadata for the result set. */
3147
+ fields: QueryResultFieldsList;
3148
+ /** PostgreSQL command tag (e.g. `SELECT`, `INSERT`, `UPDATE`, `DELETE`). */
3149
+ command: string;
3150
+ /** Number of rows affected by the command. */
3151
+ rowCount: number | null;
3152
+ /** Result rows. Each row is an object (column-name keys) or an array (when array mode is enabled). */
3153
+ rows: QueryResultRowsList;
3154
+ /** Whether rows are returned as arrays (`true`) or objects (`false`). */
3155
+ rowAsArray: boolean;
3156
+ }
3157
+ export const QueryResult = /*@__PURE__*/ S.suspend(() =>
3158
+ S.Struct({
3159
+ fields: QueryResultFieldsList,
3160
+ command: S.String,
3161
+ rowCount: S.NullOr(S.Number),
3162
+ rows: QueryResultRowsList,
3163
+ rowAsArray: S.Boolean,
3164
+ }),
3165
+ ).annotate({ identifier: "QueryResult" }) as any as S.Schema<QueryResult>;
3166
+
3167
+ /** Results for each query in the batch, in order. */
3168
+ export type BatchResponseResultsList = Array<QueryResult>;
3169
+ export const BatchResponseResultsList = /*@__PURE__*/ S.Array(
3170
+ QueryResult,
3171
+ ) as any as S.Schema<BatchResponseResultsList>;
3172
+
3173
+ /** Response for a batch query execution. */
3174
+ export interface BatchResponse {
3175
+ /** Results for each query in the batch, in order. */
3176
+ results: BatchResponseResultsList;
3177
+ }
3178
+ export const BatchResponse = /*@__PURE__*/ S.suspend(() =>
3179
+ S.Struct({
3180
+ results: BatchResponseResultsList,
3181
+ }),
3182
+ ).annotate({ identifier: "BatchResponse" }) as any as S.Schema<BatchResponse>;
3183
+
3184
+ export type QueryResponseBody = QueryResult | BatchResponse;
3185
+ export const QueryResponseBody =
3186
+ S.Unknown as any as S.Schema<QueryResponseBody>;
3187
+
3188
+ export type QueryResponse = QueryResponseBody;
3189
+ export const QueryResponse = /*@__PURE__*/ S.suspend(() =>
3190
+ QueryResponseBody.pipe(T.RawResponseRoot()),
3191
+ ).annotate({ identifier: "QueryResponse" }) as any as S.Schema<QueryResponse>;
3192
+
3193
+ /** Marketplace provider accepted for registration. */
3194
+ export type MarketplaceRegistrationProvider = "aws";
3195
+ export const MarketplaceRegistrationProvider = S.String;
3196
+
3197
+ /** AWS-specific marketplace details */
3198
+ export interface RegisterMarketplaceRequestAws {
3199
+ /** AWS Marketplace customer ID */
3200
+ customer_id: string;
3201
+ /** AWS Marketplace product ID */
3202
+ product_id: string;
3203
+ /** AWS account ID */
3204
+ account_id: string;
3205
+ }
3206
+ export const RegisterMarketplaceRequestAws = /*@__PURE__*/ S.suspend(() =>
3207
+ S.Struct({
3208
+ customer_id: S.String,
3209
+ product_id: S.String,
3210
+ account_id: S.String,
3211
+ }),
3212
+ ).annotate({
3213
+ identifier: "RegisterMarketplaceRequestAws",
3214
+ }) as any as S.Schema<RegisterMarketplaceRequestAws>;
3215
+
3216
+ export interface RegisterMarketplaceRequest {
3217
+ /** The cloud marketplace provider */
3218
+ marketplace: MarketplaceRegistrationProvider | (string & {});
3219
+ /** Company name for the marketplace registration */
3220
+ company_name: string;
3221
+ /** AWS-specific marketplace details */
3222
+ aws: RegisterMarketplaceRequestAws;
3223
+ }
3224
+ export const RegisterMarketplaceRequest = /*@__PURE__*/ S.suspend(() =>
3225
+ S.Struct({
3226
+ marketplace: MarketplaceRegistrationProvider,
3227
+ company_name: S.String,
3228
+ aws: RegisterMarketplaceRequestAws,
3229
+ }).pipe(T.Http({ method: "POST", uri: "/marketplace/register", code: 200 })),
3230
+ ).annotate({
3231
+ identifier: "RegisterMarketplaceRequest",
3232
+ }) as any as S.Schema<RegisterMarketplaceRequest>;
3233
+
3234
+ export interface RegisterMarketplaceResponse {}
3235
+ export const RegisterMarketplaceResponse = /*@__PURE__*/ S.suspend(() =>
3236
+ S.Struct({}),
3237
+ ).annotate({
3238
+ identifier: "RegisterMarketplaceResponse",
3239
+ }) as any as S.Schema<RegisterMarketplaceResponse>;
3240
+
3241
+ export interface RemoveOrganizationMemberRequest {
3242
+ /** Unique identifier for a specific organization */
3243
+ organizationID: string;
3244
+ /** Unique identifier for a specific user account */
3245
+ userID: string;
3246
+ }
3247
+ export const RemoveOrganizationMemberRequest = /*@__PURE__*/ S.suspend(() =>
3248
+ S.Struct({
3249
+ organizationID: S.String.pipe(T.Label()),
3250
+ userID: S.String.pipe(T.Label()),
3251
+ }).pipe(
3252
+ T.Http({
3253
+ method: "DELETE",
3254
+ uri: "/organizations/{organizationID}/members/{userID}",
3255
+ code: 200,
3256
+ }),
3257
+ ),
3258
+ ).annotate({
3259
+ identifier: "RemoveOrganizationMemberRequest",
3260
+ }) as any as S.Schema<RemoveOrganizationMemberRequest>;
3261
+
3262
+ export interface RemoveOrganizationMemberResponse {}
3263
+ export const RemoveOrganizationMemberResponse = /*@__PURE__*/ S.suspend(() =>
3264
+ S.Struct({}),
3265
+ ).annotate({
3266
+ identifier: "RemoveOrganizationMemberResponse",
3267
+ }) as any as S.Schema<RemoveOrganizationMemberResponse>;
3268
+
3269
+ export interface RequestOrganizationDeletionRequest {
3270
+ /** Unique identifier for a specific organization */
3271
+ organizationID: string;
3272
+ }
3273
+ export const RequestOrganizationDeletionRequest = /*@__PURE__*/ S.suspend(() =>
3274
+ S.Struct({
3275
+ organizationID: S.String.pipe(T.Label()),
3276
+ }).pipe(
3277
+ T.Http({
3278
+ method: "POST",
3279
+ uri: "/organizations/{organizationID}/deletion-request",
3280
+ code: 200,
3281
+ }),
3282
+ ),
3283
+ ).annotate({
3284
+ identifier: "RequestOrganizationDeletionRequest",
3285
+ }) as any as S.Schema<RequestOrganizationDeletionRequest>;
3286
+
3287
+ export interface RequestOrganizationDeletionResponse {}
3288
+ export const RequestOrganizationDeletionResponse = /*@__PURE__*/ S.suspend(() =>
3289
+ S.Struct({}),
3290
+ ).annotate({
3291
+ identifier: "RequestOrganizationDeletionResponse",
3292
+ }) as any as S.Schema<RequestOrganizationDeletionResponse>;
3293
+
3294
+ export interface ResendOrganizationInvitationRequest {
3295
+ /** Unique identifier for a specific organization */
3296
+ organizationID: string;
3297
+ /** Unique identifier for an invitation */
3298
+ invitationID: string;
3299
+ }
3300
+ export const ResendOrganizationInvitationRequest = /*@__PURE__*/ S.suspend(() =>
3301
+ S.Struct({
3302
+ organizationID: S.String.pipe(T.Label()),
3303
+ invitationID: S.String.pipe(T.Label()),
3304
+ }).pipe(
3305
+ T.Http({
3306
+ method: "POST",
3307
+ uri: "/organizations/{organizationID}/invitations/{invitationID}/resend",
3308
+ code: 200,
3309
+ }),
3310
+ ),
3311
+ ).annotate({
3312
+ identifier: "ResendOrganizationInvitationRequest",
3313
+ }) as any as S.Schema<ResendOrganizationInvitationRequest>;
3314
+
3315
+ export interface ResendOrganizationInvitationResponse {}
3316
+ export const ResendOrganizationInvitationResponse = /*@__PURE__*/ S.suspend(
3317
+ () => S.Struct({}),
3318
+ ).annotate({
3319
+ identifier: "ResendOrganizationInvitationResponse",
3320
+ }) as any as S.Schema<ResendOrganizationInvitationResponse>;
3321
+
3322
+ export interface RestoreFromBackupRequest {
3323
+ /** Unique identifier of the organization containing the project */
3324
+ organizationID: string;
3325
+ /** Unique identifier of the project containing the source branch */
3326
+ projectID: string;
3327
+ /** Unique identifier of the source branch of the backup */
3328
+ branchID: string;
3329
+ /** Human-readable name of the branch */
3330
+ name: string;
3331
+ /** Optional description of the branch purpose or contents */
3332
+ description?: string;
3333
+ scaleToZero?: ScaleToZeroConfiguration;
3334
+ backupConfiguration?: BackupConfiguration;
3335
+ configuration?: ClusterConfiguration;
3336
+ }
3337
+ export const RestoreFromBackupRequest = /*@__PURE__*/ S.suspend(() =>
3338
+ S.Struct({
3339
+ organizationID: S.String.pipe(T.Label()),
3340
+ projectID: S.String.pipe(T.Label()),
3341
+ branchID: S.String.pipe(T.Label()),
3342
+ name: S.String,
3343
+ description: S.optional(S.String),
3344
+ scaleToZero: S.optional(ScaleToZeroConfiguration),
3345
+ backupConfiguration: S.optional(BackupConfiguration),
3346
+ configuration: S.optional(ClusterConfiguration),
3347
+ }).pipe(
3348
+ T.Http({
3349
+ method: "POST",
3350
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/restore",
3351
+ code: 200,
3352
+ }),
3353
+ ),
3354
+ ).annotate({
3355
+ identifier: "RestoreFromBackupRequest",
3356
+ }) as any as S.Schema<RestoreFromBackupRequest>;
3357
+
3358
+ export interface RotateBranchCredentialsRequest {
3359
+ organizationID: string;
3360
+ projectID: string;
3361
+ branchID: string;
3362
+ /** Database username to rotate credentials for */
3363
+ username: string;
3364
+ }
3365
+ export const RotateBranchCredentialsRequest = /*@__PURE__*/ S.suspend(() =>
3366
+ S.Struct({
3367
+ organizationID: S.String.pipe(T.Label()),
3368
+ projectID: S.String.pipe(T.Label()),
3369
+ branchID: S.String.pipe(T.Label()),
3370
+ username: S.String,
3371
+ }).pipe(
3372
+ T.Http({
3373
+ method: "POST",
3374
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/credentials/rotate",
3375
+ code: 200,
3376
+ }),
3377
+ ),
3378
+ ).annotate({
3379
+ identifier: "RotateBranchCredentialsRequest",
3380
+ }) as any as S.Schema<RotateBranchCredentialsRequest>;
3381
+
3382
+ export interface RotateBranchCredentialsResponse {}
3383
+ export const RotateBranchCredentialsResponse = /*@__PURE__*/ S.suspend(() =>
3384
+ S.Struct({}),
3385
+ ).annotate({
3386
+ identifier: "RotateBranchCredentialsResponse",
3387
+ }) as any as S.Schema<RotateBranchCredentialsResponse>;
3388
+
3389
+ /** JSON-RPC protocol version. Always `2.0`. */
3390
+ export type SendMcpRequestRequestJsonrpc = "2.0";
3391
+ export const SendMcpRequestRequestJsonrpc = S.String;
3392
+
3393
+ /** Request identifier, echoed on the response. Omitted for notifications. */
3394
+ export type SendMcpRequestRequestId = string | number;
3395
+ export const SendMcpRequestRequestId =
3396
+ S.Unknown as any as S.Schema<SendMcpRequestRequestId>;
3397
+
3398
+ /** Method parameters as defined by the MCP specification. */
3399
+ export type SendMcpRequestRequestParamsMap = {
3400
+ [key: string]: unknown | undefined;
3401
+ };
3402
+ export const SendMcpRequestRequestParamsMap = /*@__PURE__*/ S.Record(
3403
+ S.String,
3404
+ S.Unknown,
3405
+ ) as any as S.Schema<SendMcpRequestRequestParamsMap>;
3406
+
3407
+ export interface SendMcpRequestRequest {
3408
+ /** JSON-RPC protocol version. Always `2.0`. */
3409
+ jsonrpc: SendMcpRequestRequestJsonrpc | (string & {});
3410
+ /** Request identifier, echoed on the response. Omitted for notifications. */
3411
+ id?: SendMcpRequestRequestId;
3412
+ /** MCP method, such as `initialize`, `tools/list`, or `tools/call`. */
3413
+ method: string;
3414
+ /** Method parameters as defined by the MCP specification. */
3415
+ params?: SendMcpRequestRequestParamsMap;
3416
+ }
3417
+ export const SendMcpRequestRequest = /*@__PURE__*/ S.suspend(() =>
3418
+ S.Struct({
3419
+ jsonrpc: SendMcpRequestRequestJsonrpc,
3420
+ id: S.optional(SendMcpRequestRequestId),
3421
+ method: S.String,
3422
+ params: S.optional(SendMcpRequestRequestParamsMap),
3423
+ }).pipe(T.Http({ method: "POST", uri: "/mcp", code: 200 })),
3424
+ ).annotate({
3425
+ identifier: "SendMcpRequestRequest",
3426
+ }) as any as S.Schema<SendMcpRequestRequest>;
3427
+
3428
+ /** JSON-RPC protocol version. Always `2.0`. */
3429
+ export type JSONRPCResponseJsonrpc = "2.0";
3430
+ export const JSONRPCResponseJsonrpc = S.String;
3431
+
3432
+ /** Identifier of the request this responds to. */
3433
+ export type JSONRPCResponseId = string | number;
3434
+ export const JSONRPCResponseId =
3435
+ S.Unknown as any as S.Schema<JSONRPCResponseId>;
3436
+
3437
+ /** Method result as defined by the MCP specification. */
3438
+ export type JSONRPCResponseResultMap = { [key: string]: unknown | undefined };
3439
+ export const JSONRPCResponseResultMap = /*@__PURE__*/ S.Record(
3440
+ S.String,
3441
+ S.Unknown,
3442
+ ) as any as S.Schema<JSONRPCResponseResultMap>;
3443
+
3444
+ /** A JSON-RPC 2.0 error. Failures inside a tool are reported in the tool result with `isError`, not here. */
3445
+ export interface JSONRPCError {
3446
+ /** JSON-RPC error code. */
3447
+ code: number;
3448
+ /** Short description of the error. */
3449
+ message: string;
3450
+ /** Additional error detail. */
3451
+ data?: unknown;
3452
+ }
3453
+ export const JSONRPCError = /*@__PURE__*/ S.suspend(() =>
3454
+ S.Struct({
3455
+ code: S.Number,
3456
+ message: S.String,
3457
+ data: S.optional(S.Unknown),
3458
+ }),
3459
+ ).annotate({ identifier: "JSONRPCError" }) as any as S.Schema<JSONRPCError>;
3460
+
3461
+ /** A JSON-RPC 2.0 response. Exactly one of `result` or `error` is present. */
3462
+ export interface JSONRPCResponse {
3463
+ /** JSON-RPC protocol version. Always `2.0`. */
3464
+ jsonrpc: JSONRPCResponseJsonrpc;
3465
+ /** Identifier of the request this responds to. */
3466
+ id: JSONRPCResponseId;
3467
+ /** Method result as defined by the MCP specification. */
3468
+ result?: JSONRPCResponseResultMap;
3469
+ error?: JSONRPCError;
3470
+ }
3471
+ export const JSONRPCResponse = /*@__PURE__*/ S.suspend(() =>
3472
+ S.Struct({
3473
+ jsonrpc: JSONRPCResponseJsonrpc,
3474
+ id: JSONRPCResponseId,
3475
+ result: S.optional(JSONRPCResponseResultMap),
3476
+ error: S.optional(JSONRPCError),
3477
+ }),
3478
+ ).annotate({
3479
+ identifier: "JSONRPCResponse",
3480
+ }) as any as S.Schema<JSONRPCResponse>;
3481
+
3482
+ /** Stripe webhook event payload */
3483
+ export type StripeWebhookRequestBodyMap = {
3484
+ [key: string]: unknown | undefined;
3485
+ };
3486
+ export const StripeWebhookRequestBodyMap = /*@__PURE__*/ S.Record(
3487
+ S.String,
3488
+ S.Unknown,
3489
+ ) as any as S.Schema<StripeWebhookRequestBodyMap>;
3490
+
3491
+ export interface StripeWebhookRequest {
3492
+ body: StripeWebhookRequestBodyMap;
3493
+ }
3494
+ export const StripeWebhookRequest = /*@__PURE__*/ S.suspend(() =>
3495
+ S.Struct({
3496
+ body: StripeWebhookRequestBodyMap.pipe(T.HttpBody()),
3497
+ }).pipe(T.Http({ method: "POST", uri: "/webhooks/stripe", code: 200 })),
3498
+ ).annotate({
3499
+ identifier: "StripeWebhookRequest",
3500
+ }) as any as S.Schema<StripeWebhookRequest>;
3501
+
3502
+ export interface StripeWebhookResponse {}
3503
+ export const StripeWebhookResponse = /*@__PURE__*/ S.suspend(() =>
3504
+ S.Struct({}),
3505
+ ).annotate({
3506
+ identifier: "StripeWebhookResponse",
3507
+ }) as any as S.Schema<StripeWebhookResponse>;
3508
+
3509
+ export interface UpdateBillingCustomerRequest {
3510
+ /** Unique identifier for a specific organization */
3511
+ organizationID: string;
3512
+ billing_email: string;
3513
+ }
3514
+ export const UpdateBillingCustomerRequest = /*@__PURE__*/ S.suspend(() =>
3515
+ S.Struct({
3516
+ organizationID: S.String.pipe(T.Label()),
3517
+ billing_email: S.String,
3518
+ }).pipe(
3519
+ T.Http({
3520
+ method: "PATCH",
3521
+ uri: "/organizations/{organizationID}/billing/customer",
3522
+ code: 200,
3523
+ }),
3524
+ ),
3525
+ ).annotate({
3526
+ identifier: "UpdateBillingCustomerRequest",
3527
+ }) as any as S.Schema<UpdateBillingCustomerRequest>;
3528
+
3529
+ /** Arbitrary PostgreSQL configuration parameters for the cluster */
3530
+ export type UpdateBranchRequestPostgresConfigurationParametersMap = {
3531
+ [key: string]: string | undefined;
3532
+ };
3533
+ export const UpdateBranchRequestPostgresConfigurationParametersMap =
3534
+ /*@__PURE__*/ S.Record(
3535
+ S.String,
3536
+ S.String,
3537
+ ) as any as S.Schema<UpdateBranchRequestPostgresConfigurationParametersMap>;
3538
+
3539
+ /** List of PostgreSQL extensions and libraries to preload */
3540
+ export type UpdateBranchRequestPreloadLibrariesList = Array<string>;
3541
+ export const UpdateBranchRequestPreloadLibrariesList = /*@__PURE__*/ S.Array(
3542
+ S.String,
3543
+ ) as any as S.Schema<UpdateBranchRequestPreloadLibrariesList>;
3544
+
3545
+ export interface UpdateBranchRequest {
3546
+ /** Unique identifier of the organization containing the project */
3547
+ organizationID: string;
3548
+ /** Unique identifier of the project containing the branch */
3549
+ projectID: string;
3550
+ /** Unique identifier of the branch to update */
3551
+ branchID: string;
3552
+ /** New name for the branch */
3553
+ name?: string;
3554
+ /** New description for the branch (max 50 characters) */
3555
+ description?: string;
3556
+ /** Number of database replicas to scale to */
3557
+ replicas?: number;
3558
+ /** Branch storage in GiB (gigabytes). The maximum allowed value depends on the organization's storage limit. */
3559
+ storage?: number;
3560
+ /** New instance type for the branch */
3561
+ instanceType?: string;
3562
+ backupConfiguration?: BackupConfiguration;
3563
+ /** Enabled when the branch should be hibernated, disabled if it needs to be reactivated. */
3564
+ hibernate?: boolean;
3565
+ scaleToZero?: ScaleToZeroConfiguration;
3566
+ /** Arbitrary PostgreSQL configuration parameters for the cluster */
3567
+ postgresConfigurationParameters?: UpdateBranchRequestPostgresConfigurationParametersMap;
3568
+ /** List of PostgreSQL extensions and libraries to preload */
3569
+ preloadLibraries?: UpdateBranchRequestPreloadLibrariesList;
3570
+ /** PostgreSQL image to use for the database instances */
3571
+ image?: string;
3572
+ }
3573
+ export const UpdateBranchRequest = /*@__PURE__*/ S.suspend(() =>
3574
+ S.Struct({
3575
+ organizationID: S.String.pipe(T.Label()),
3576
+ projectID: S.String.pipe(T.Label()),
3577
+ branchID: S.String.pipe(T.Label()),
3578
+ name: S.optional(S.String),
3579
+ description: S.optional(S.String),
3580
+ replicas: S.optional(S.Number),
3581
+ storage: S.optional(S.Number),
3582
+ instanceType: S.optional(S.String),
3583
+ backupConfiguration: S.optional(BackupConfiguration),
3584
+ hibernate: S.optional(S.Boolean),
3585
+ scaleToZero: S.optional(ScaleToZeroConfiguration),
3586
+ postgresConfigurationParameters: S.optional(
3587
+ UpdateBranchRequestPostgresConfigurationParametersMap,
3588
+ ),
3589
+ preloadLibraries: S.optional(UpdateBranchRequestPreloadLibrariesList),
3590
+ image: S.optional(S.String),
3591
+ }).pipe(
3592
+ T.Http({
3593
+ method: "PATCH",
3594
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}",
3595
+ code: 200,
3596
+ }),
3597
+ ),
3598
+ ).annotate({
3599
+ identifier: "UpdateBranchRequest",
3600
+ }) as any as S.Schema<UpdateBranchRequest>;
3601
+
3602
+ export interface UpdateGithubAppInstallationRequest {
3603
+ /** Unique identifier of the organization */
3604
+ organizationID: string;
3605
+ /** Unique identifier of the GitHub installation record */
3606
+ githubInstallationID: string;
3607
+ /** GitHub App installation ID */
3608
+ installationId: number;
3609
+ }
3610
+ export const UpdateGithubAppInstallationRequest = /*@__PURE__*/ S.suspend(() =>
3611
+ S.Struct({
3612
+ organizationID: S.String.pipe(T.Label()),
3613
+ githubInstallationID: S.String.pipe(T.Label()),
3614
+ installationId: S.Number,
3615
+ }).pipe(
3616
+ T.Http({
3617
+ method: "PUT",
3618
+ uri: "/organizations/{organizationID}/githubapp/installations/{githubInstallationID}",
3619
+ code: 200,
3620
+ }),
3621
+ ),
3622
+ ).annotate({
3623
+ identifier: "UpdateGithubAppInstallationRequest",
3624
+ }) as any as S.Schema<UpdateGithubAppInstallationRequest>;
3625
+
3626
+ export interface UpdateGithubRepositoryRequest {
3627
+ /** Unique identifier of the organization */
3628
+ organizationID: string;
3629
+ /** Unique identifier of the project */
3630
+ projectID: string;
3631
+ /** Unique identifier of the branch */
3632
+ branchID: string;
3633
+ /** GitHub repository ID */
3634
+ githubRepositoryID: number;
3635
+ }
3636
+ export const UpdateGithubRepositoryRequest = /*@__PURE__*/ S.suspend(() =>
3637
+ S.Struct({
3638
+ organizationID: S.String.pipe(T.Label()),
3639
+ projectID: S.String.pipe(T.Label()),
3640
+ branchID: S.String.pipe(T.Label()),
3641
+ githubRepositoryID: S.Number,
3642
+ }).pipe(
3643
+ T.Http({
3644
+ method: "PUT",
3645
+ uri: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/githubapp/repository",
3646
+ code: 200,
3647
+ }),
3648
+ ),
3649
+ ).annotate({
3650
+ identifier: "UpdateGithubRepositoryRequest",
3651
+ }) as any as S.Schema<UpdateGithubRepositoryRequest>;
3652
+
3653
+ export interface UpdateOrganizationRequest {
3654
+ /** Unique identifier for a specific organization */
3655
+ organizationID: string;
3656
+ /** Unique identifier for the organization to update */
3657
+ id?: string;
3658
+ /** New name for the organization */
3659
+ name?: string;
3660
+ }
3661
+ export const UpdateOrganizationRequest = /*@__PURE__*/ S.suspend(() =>
3662
+ S.Struct({
3663
+ organizationID: S.String.pipe(T.Label()),
3664
+ id: S.optional(S.String),
3665
+ name: S.optional(S.String),
3666
+ }).pipe(
3667
+ T.Http({
3668
+ method: "PUT",
3669
+ uri: "/organizations/{organizationID}",
3670
+ code: 200,
3671
+ }),
3672
+ ),
3673
+ ).annotate({
3674
+ identifier: "UpdateOrganizationRequest",
3675
+ }) as any as S.Schema<UpdateOrganizationRequest>;
3676
+
3677
+ /** Partial configuration update for a project */
3678
+ export interface UpdateProjectConfiguration {
3679
+ scaleToZero?: ProjectScaleToZeroConfiguration;
3680
+ ipFiltering?: IPFilteringConfiguration;
3681
+ }
3682
+ export const UpdateProjectConfiguration = /*@__PURE__*/ S.suspend(() =>
3683
+ S.Struct({
3684
+ scaleToZero: S.optional(ProjectScaleToZeroConfiguration),
3685
+ ipFiltering: S.optional(IPFilteringConfiguration),
3686
+ }),
3687
+ ).annotate({
3688
+ identifier: "UpdateProjectConfiguration",
3689
+ }) as any as S.Schema<UpdateProjectConfiguration>;
3690
+
3691
+ export interface UpdateProjectRequest {
3692
+ /** Unique identifier of the organization containing the project */
3693
+ organizationID: string;
3694
+ /** Unique identifier of the project to update */
3695
+ projectID: string;
3696
+ /** New name for the project */
3697
+ name?: string;
3698
+ configuration?: UpdateProjectConfiguration;
3699
+ }
3700
+ export const UpdateProjectRequest = /*@__PURE__*/ S.suspend(() =>
3701
+ S.Struct({
3702
+ organizationID: S.String.pipe(T.Label()),
3703
+ projectID: S.String.pipe(T.Label()),
3704
+ name: S.optional(S.String),
3705
+ configuration: S.optional(UpdateProjectConfiguration),
3706
+ }).pipe(
3707
+ T.Http({
3708
+ method: "PATCH",
3709
+ uri: "/organizations/{organizationID}/projects/{projectID}",
3710
+ code: 200,
3711
+ }),
3712
+ ),
3713
+ ).annotate({
3714
+ identifier: "UpdateProjectRequest",
3715
+ }) as any as S.Schema<UpdateProjectRequest>;
3716
+
3717
+ /** Scopes granted to the installation. */
3718
+ export type UpsertInstallationRequestScopesList = Array<string>;
3719
+ export const UpsertInstallationRequestScopesList = /*@__PURE__*/ S.Array(
3720
+ S.String,
3721
+ ) as any as S.Schema<UpsertInstallationRequestScopesList>;
3722
+
3723
+ /** Map of policy id to the acceptance timestamp (RFC 3339), e.g. {"toc": "2024-02-28T10:00:00Z"}. */
3724
+ export type UpsertInstallationRequestAcceptedPoliciesMap = {
3725
+ [key: string]: string | undefined;
3726
+ };
3727
+ export const UpsertInstallationRequestAcceptedPoliciesMap =
3728
+ /*@__PURE__*/ S.Record(
3729
+ S.String,
3730
+ S.String,
3731
+ ) as any as S.Schema<UpsertInstallationRequestAcceptedPoliciesMap>;
3732
+
3733
+ export interface InstallationCredentials {
3734
+ /** Installation access token that authenticates our outbound Partner API calls to Vercel. Stored encrypted at rest. */
3735
+ access_token: string | Redacted.Redacted<string>;
3736
+ /** Token type (e.g. "Bearer"). */
3737
+ token_type: string;
3738
+ }
3739
+ export const InstallationCredentials = /*@__PURE__*/ S.suspend(() =>
3740
+ S.Struct({
3741
+ access_token: S.String.pipe(T.SensitiveValue({})),
3742
+ token_type: S.String,
3743
+ }),
3744
+ ).annotate({
3745
+ identifier: "InstallationCredentials",
3746
+ }) as any as S.Schema<InstallationCredentials>;
3747
+
3748
+ /** Contact details for the account. */
3749
+ export interface InstallationAccountContact {
3750
+ email: string;
3751
+ name?: string;
3752
+ }
3753
+ export const InstallationAccountContact = /*@__PURE__*/ S.suspend(() =>
3754
+ S.Struct({
3755
+ email: S.String,
3756
+ name: S.optional(S.String),
3757
+ }),
3758
+ ).annotate({
3759
+ identifier: "InstallationAccountContact",
3760
+ }) as any as S.Schema<InstallationAccountContact>;
3761
+
3762
+ /** The Vercel account/team installing the integration. */
3763
+ export interface InstallationAccount {
3764
+ /** Team name (absent for personal accounts). */
3765
+ name?: string;
3766
+ /** URL of the account on Vercel. */
3767
+ url: string;
3768
+ /** Contact details for the account. */
3769
+ contact?: InstallationAccountContact;
3770
+ }
3771
+ export const InstallationAccount = /*@__PURE__*/ S.suspend(() =>
3772
+ S.Struct({
3773
+ name: S.optional(S.String),
3774
+ url: S.String,
3775
+ contact: S.optional(InstallationAccountContact),
3776
+ }),
3777
+ ).annotate({
3778
+ identifier: "InstallationAccount",
3779
+ }) as any as S.Schema<InstallationAccount>;
3780
+
3781
+ export interface UpsertInstallationRequest {
3782
+ /** Vercel installation id (icfg_...). */
3783
+ installationId: string;
3784
+ /** Scopes granted to the installation. */
3785
+ scopes: UpsertInstallationRequestScopesList;
3786
+ /** Map of policy id to the acceptance timestamp (RFC 3339), e.g. {"toc": "2024-02-28T10:00:00Z"}. */
3787
+ acceptedPolicies: UpsertInstallationRequestAcceptedPoliciesMap;
3788
+ credentials: InstallationCredentials;
3789
+ account: InstallationAccount;
3790
+ }
3791
+ export const UpsertInstallationRequest = /*@__PURE__*/ S.suspend(() =>
3792
+ S.Struct({
3793
+ installationId: S.String.pipe(T.Label()),
3794
+ scopes: UpsertInstallationRequestScopesList,
3795
+ acceptedPolicies: UpsertInstallationRequestAcceptedPoliciesMap,
3796
+ credentials: InstallationCredentials,
3797
+ account: InstallationAccount,
3798
+ }).pipe(
3799
+ T.Http({
3800
+ method: "PUT",
3801
+ uri: "/v1/installations/{installationId}",
3802
+ code: 200,
3803
+ }),
3804
+ ),
3805
+ ).annotate({
3806
+ identifier: "UpsertInstallationRequest",
3807
+ }) as any as S.Schema<UpsertInstallationRequest>;
3808
+
3809
+ export interface UpsertInstallationResponse {}
3810
+ export const UpsertInstallationResponse = /*@__PURE__*/ S.suspend(() =>
3811
+ S.Struct({}),
3812
+ ).annotate({
3813
+ identifier: "UpsertInstallationResponse",
3814
+ }) as any as S.Schema<UpsertInstallationResponse>;
3815
+
3816
+ export interface WebsocketRequest {}
3817
+ export const WebsocketRequest = /*@__PURE__*/ S.suspend(() =>
3818
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v2", code: 200 })),
3819
+ ).annotate({
3820
+ identifier: "WebsocketRequest",
3821
+ }) as any as S.Schema<WebsocketRequest>;
3822
+
3823
+ export interface WebsocketResponse {}
3824
+ export const WebsocketResponse = /*@__PURE__*/ S.suspend(() =>
3825
+ S.Struct({}),
3826
+ ).annotate({
3827
+ identifier: "WebsocketResponse",
3828
+ }) as any as S.Schema<WebsocketResponse>;
3829
+
3830
+ export type BranchLogs2Error = BadRequest | NotFound | XataOpError;
3831
+ /** Retrieve branch logs */
3832
+ export const branchLogs2: API.OperationMethod<
3833
+ BranchLogsRequest,
3834
+ BranchLogs,
3835
+ BranchLogs2Error,
3836
+ XataOpContext
3837
+ > = /*@__PURE__*/ API.make(() => ({
3838
+ input: BranchLogsRequest,
3839
+ output: BranchLogs,
3840
+ errors: [BadRequest, NotFound, UnknownXataError],
3841
+ protocol: XataProtocol,
3842
+ retry: Retry.Retry,
3843
+ }));
3844
+
3845
+ export type BranchMetrics2Error = BadRequest | NotFound | XataOpError;
3846
+ /** Retrieve branch metrics Returns time-series data for one or more metrics of a branch. */
3847
+ export const branchMetrics2: API.OperationMethod<
3848
+ BranchMetricsRequest,
3849
+ BranchMetrics,
3850
+ BranchMetrics2Error,
3851
+ XataOpContext
3852
+ > = /*@__PURE__*/ API.make(() => ({
3853
+ input: BranchMetricsRequest,
3854
+ output: BranchMetrics,
3855
+ errors: [BadRequest, NotFound, UnknownXataError],
3856
+ protocol: XataProtocol,
3857
+ retry: Retry.Retry,
3858
+ }));
3859
+
3860
+ export type CreateBillingCheckoutSessionError =
3861
+ | BadRequest
3862
+ | Forbidden
3863
+ | XataOpError;
3864
+ /** Create a billing checkout session Creates a Stripe checkout session used to activate card billing for an organization. */
3865
+ export const createBillingCheckoutSession: API.OperationMethod<
3866
+ CreateBillingCheckoutSessionRequest,
3867
+ BillingCheckoutSessionResponse,
3868
+ CreateBillingCheckoutSessionError,
3869
+ XataOpContext
3870
+ > = /*@__PURE__*/ API.make(() => ({
3871
+ input: CreateBillingCheckoutSessionRequest,
3872
+ output: BillingCheckoutSessionResponse,
3873
+ errors: [BadRequest, Forbidden, UnknownXataError],
3874
+ protocol: XataProtocol,
3875
+ retry: Retry.Retry,
3876
+ }));
3877
+
3878
+ export type CreateBillingPaymentMethodSessionError =
3879
+ | BadRequest
3880
+ | Forbidden
3881
+ | XataOpError;
3882
+ /** Create a billing payment method session Creates a Stripe setup-mode checkout session used to add or update an organization payment method. */
3883
+ export const createBillingPaymentMethodSession: API.OperationMethod<
3884
+ CreateBillingPaymentMethodSessionRequest,
3885
+ BillingPaymentMethodSessionResponse,
3886
+ CreateBillingPaymentMethodSessionError,
3887
+ XataOpContext
3888
+ > = /*@__PURE__*/ API.make(() => ({
3889
+ input: CreateBillingPaymentMethodSessionRequest,
3890
+ output: BillingPaymentMethodSessionResponse,
3891
+ errors: [BadRequest, Forbidden, UnknownXataError],
3892
+ protocol: XataProtocol,
3893
+ retry: Retry.Retry,
3894
+ }));
3895
+
3896
+ export type CreateBranchError = BadRequest | NotFound | XataOpError;
3897
+ /** Create a new branch Creates a new branch within the specified project. Branches can be created from scratch or derived from an existing parent branch. */
3898
+ export const createBranch: API.OperationMethod<
3899
+ CreateBranchRequest,
3900
+ BranchShortMetadata,
3901
+ CreateBranchError,
3902
+ XataOpContext
3903
+ > = /*@__PURE__*/ API.make(() => ({
3904
+ input: CreateBranchRequest,
3905
+ output: BranchShortMetadata,
3906
+ errors: [BadRequest, NotFound, UnknownXataError],
3907
+ protocol: XataProtocol,
3908
+ retry: Retry.Retry,
3909
+ }));
3910
+
3911
+ export type CreateGithubAppInstallationError =
3912
+ | BadRequest
3913
+ | Conflict
3914
+ | XataOpError;
3915
+ /** Create GitHub App installation Creates a new GitHub App installation mapping for the specified organization. */
3916
+ export const createGithubAppInstallation: API.OperationMethod<
3917
+ CreateGithubAppInstallationRequest,
3918
+ GithubInstallation,
3919
+ CreateGithubAppInstallationError,
3920
+ XataOpContext
3921
+ > = /*@__PURE__*/ API.make(() => ({
3922
+ input: CreateGithubAppInstallationRequest,
3923
+ output: GithubInstallation,
3924
+ errors: [BadRequest, Conflict, UnknownXataError],
3925
+ protocol: XataProtocol,
3926
+ retry: Retry.Retry,
3927
+ }));
3928
+
3929
+ export type CreateGithubRepositoryError = BadRequest | Conflict | XataOpError;
3930
+ /** Create GitHub repository mapping Creates a new GitHub repository to Xata branch mapping. */
3931
+ export const createGithubRepository: API.OperationMethod<
3932
+ CreateGithubRepositoryRequest,
3933
+ GithubRepository,
3934
+ CreateGithubRepositoryError,
3935
+ XataOpContext
3936
+ > = /*@__PURE__*/ API.make(() => ({
3937
+ input: CreateGithubRepositoryRequest,
3938
+ output: GithubRepository,
3939
+ errors: [BadRequest, Conflict, UnknownXataError],
3940
+ protocol: XataProtocol,
3941
+ retry: Retry.Retry,
3942
+ }));
3943
+
3944
+ export type CreateOrganizationError = BadRequest | NotFound | XataOpError;
3945
+ /** Create a new organization Creates a new organization with the authenticated user as its single owner. */
3946
+ export const createOrganization: API.OperationMethod<
3947
+ CreateOrganizationRequest,
3948
+ Organization,
3949
+ CreateOrganizationError,
3950
+ XataOpContext
3951
+ > = /*@__PURE__*/ API.make(() => ({
3952
+ input: CreateOrganizationRequest,
3953
+ output: Organization,
3954
+ errors: [BadRequest, NotFound, UnknownXataError],
3955
+ protocol: XataProtocol,
3956
+ retry: Retry.Retry,
3957
+ }));
3958
+
3959
+ export type CreateOrganizationAPIKeyError = BadRequest | XataOpError;
3960
+ /** Create an Organization API Key Create a new API key for an organization. */
3961
+ export const createOrganizationAPIKey: API.OperationMethod<
3962
+ CreateOrganizationAPIKeyRequest,
3963
+ CreateOrganizationAPIKeyResponse,
3964
+ CreateOrganizationAPIKeyError,
3965
+ XataOpContext
3966
+ > = /*@__PURE__*/ API.make(() => ({
3967
+ input: CreateOrganizationAPIKeyRequest,
3968
+ output: CreateOrganizationAPIKeyResponse,
3969
+ errors: [BadRequest, UnknownXataError],
3970
+ protocol: XataProtocol,
3971
+ retry: Retry.Retry,
3972
+ }));
3973
+
3974
+ export type CreateOrganizationInvitationError =
3975
+ | BadRequest
3976
+ | Forbidden
3977
+ | NotFound
3978
+ | Conflict
3979
+ | XataOpError;
3980
+ /** Send an invitation to join an organization Send an invitation email to a user to join an organization. */
3981
+ export const createOrganizationInvitation: API.OperationMethod<
3982
+ CreateOrganizationInvitationRequest,
3983
+ CreateOrganizationInvitationResponse,
3984
+ CreateOrganizationInvitationError,
3985
+ XataOpContext
3986
+ > = /*@__PURE__*/ API.make(() => ({
3987
+ input: CreateOrganizationInvitationRequest,
3988
+ output: CreateOrganizationInvitationResponse,
3989
+ errors: [BadRequest, Forbidden, NotFound, Conflict, UnknownXataError],
3990
+ protocol: XataProtocol,
3991
+ retry: Retry.Retry,
3992
+ }));
3993
+
3994
+ export type CreateProjectError = BadRequest | XataOpError;
3995
+ /** Create a new project Creates a new project within the specified organization. Projects are containers for database branches and resources. */
3996
+ export const createProject: API.OperationMethod<
3997
+ CreateProjectRequest,
3998
+ Project,
3999
+ CreateProjectError,
4000
+ XataOpContext
4001
+ > = /*@__PURE__*/ API.make(() => ({
4002
+ input: CreateProjectRequest,
4003
+ output: Project,
4004
+ errors: [BadRequest, UnknownXataError],
4005
+ protocol: XataProtocol,
4006
+ retry: Retry.Retry,
4007
+ }));
4008
+
4009
+ export type CreateUserAPIKeyError = BadRequest | XataOpError;
4010
+ /** Create a User API Key Create a new API key for the authenticated user. */
4011
+ export const createUserAPIKey: API.OperationMethod<
4012
+ CreateUserAPIKeyRequest,
4013
+ CreateUserAPIKeyResponse,
4014
+ CreateUserAPIKeyError,
4015
+ XataOpContext
4016
+ > = /*@__PURE__*/ API.make(() => ({
4017
+ input: CreateUserAPIKeyRequest,
4018
+ output: CreateUserAPIKeyResponse,
4019
+ errors: [BadRequest, UnknownXataError],
4020
+ protocol: XataProtocol,
4021
+ retry: Retry.Retry,
4022
+ }));
4023
+
4024
+ export type DeleteBranchError = BadRequest | NotFound | XataOpError;
4025
+ /** Delete a branch Permanently deletes a specific branch by its ID and all associated data. This action cannot be undone. */
4026
+ export const deleteBranch: API.OperationMethod<
4027
+ DeleteBranchRequest,
4028
+ DeleteBranchResponse,
4029
+ DeleteBranchError,
4030
+ XataOpContext
4031
+ > = /*@__PURE__*/ API.make(() => ({
4032
+ input: DeleteBranchRequest,
4033
+ output: DeleteBranchResponse,
4034
+ errors: [BadRequest, NotFound, UnknownXataError],
4035
+ protocol: XataProtocol,
4036
+ retry: Retry.Retry,
4037
+ }));
4038
+
4039
+ export type DeleteGithubRepositoryError = BadRequest | NotFound | XataOpError;
4040
+ /** Delete GitHub repository mapping Deletes the GitHub repository mapping for the specified branch. */
4041
+ export const deleteGithubRepository: API.OperationMethod<
4042
+ DeleteGithubRepositoryRequest,
4043
+ DeleteGithubRepositoryResponse,
4044
+ DeleteGithubRepositoryError,
4045
+ XataOpContext
4046
+ > = /*@__PURE__*/ API.make(() => ({
4047
+ input: DeleteGithubRepositoryRequest,
4048
+ output: DeleteGithubRepositoryResponse,
4049
+ errors: [BadRequest, NotFound, UnknownXataError],
4050
+ protocol: XataProtocol,
4051
+ retry: Retry.Retry,
4052
+ }));
4053
+
4054
+ export type DeleteInstallationError = Forbidden | Conflict | XataOpError;
4055
+ /** Delete a Vercel Marketplace installation Begin uninstalling an installation. The installation is marked 'deleting' so billing can finalize before being soft-deleted; the 204 defers final deletion to Vercel's 24-hour window. (Vercel's contract also allows a 200 with {"finalized": true} for immediate deletion; Xata always finalizes asynchronously.) */
4056
+ export const deleteInstallation: API.OperationMethod<
4057
+ DeleteInstallationRequest,
4058
+ DeleteInstallationResponse,
4059
+ DeleteInstallationError,
4060
+ XataOpContext
4061
+ > = /*@__PURE__*/ API.make(() => ({
4062
+ input: DeleteInstallationRequest,
4063
+ output: DeleteInstallationResponse,
4064
+ errors: [Forbidden, Conflict, UnknownXataError],
4065
+ protocol: XataProtocol,
4066
+ retry: Retry.Retry,
4067
+ }));
4068
+
4069
+ export type DeleteOrganizationError =
4070
+ | BadRequest
4071
+ | Forbidden
4072
+ | NotFound
4073
+ | XataOpError;
4074
+ /** Delete an organization [Not implemented yet] Permanently delete an organization. This action cannot be undone. */
4075
+ export const deleteOrganization: API.OperationMethod<
4076
+ DeleteOrganizationRequest,
4077
+ DeleteOrganizationResponse,
4078
+ DeleteOrganizationError,
4079
+ XataOpContext
4080
+ > = /*@__PURE__*/ API.make(() => ({
4081
+ input: DeleteOrganizationRequest,
4082
+ output: DeleteOrganizationResponse,
4083
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4084
+ protocol: XataProtocol,
4085
+ retry: Retry.Retry,
4086
+ }));
4087
+
4088
+ export type DeleteOrganizationAPIKeysError =
4089
+ | BadRequest
4090
+ | NotFound
4091
+ | XataOpError;
4092
+ /** Bulk delete API Keys for an organization Delete multiple API keys in a single request. */
4093
+ export const deleteOrganizationAPIKeys: API.OperationMethod<
4094
+ DeleteOrganizationAPIKeysRequest,
4095
+ DeleteOrganizationAPIKeysResponse,
4096
+ DeleteOrganizationAPIKeysError,
4097
+ XataOpContext
4098
+ > = /*@__PURE__*/ API.make(() => ({
4099
+ input: DeleteOrganizationAPIKeysRequest,
4100
+ output: DeleteOrganizationAPIKeysResponse,
4101
+ errors: [BadRequest, NotFound, UnknownXataError],
4102
+ protocol: XataProtocol,
4103
+ retry: Retry.Retry,
4104
+ }));
4105
+
4106
+ export type DeleteOrganizationInvitationError =
4107
+ | BadRequest
4108
+ | Forbidden
4109
+ | NotFound
4110
+ | XataOpError;
4111
+ /** Delete an invitation Permanently delete an invitation record. */
4112
+ export const deleteOrganizationInvitation: API.OperationMethod<
4113
+ DeleteOrganizationInvitationRequest,
4114
+ DeleteOrganizationInvitationResponse,
4115
+ DeleteOrganizationInvitationError,
4116
+ XataOpContext
4117
+ > = /*@__PURE__*/ API.make(() => ({
4118
+ input: DeleteOrganizationInvitationRequest,
4119
+ output: DeleteOrganizationInvitationResponse,
4120
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4121
+ protocol: XataProtocol,
4122
+ retry: Retry.Retry,
4123
+ }));
4124
+
4125
+ export type DeleteProjectError = BadRequest | NotFound | XataOpError;
4126
+ /** Delete a project Permanently deletes a specific project by its ID and all associated resources including branches and databases. This action cannot be undone. */
4127
+ export const deleteProject: API.OperationMethod<
4128
+ DeleteProjectRequest,
4129
+ DeleteProjectResponse,
4130
+ DeleteProjectError,
4131
+ XataOpContext
4132
+ > = /*@__PURE__*/ API.make(() => ({
4133
+ input: DeleteProjectRequest,
4134
+ output: DeleteProjectResponse,
4135
+ errors: [BadRequest, NotFound, UnknownXataError],
4136
+ protocol: XataProtocol,
4137
+ retry: Retry.Retry,
4138
+ }));
4139
+
4140
+ export type DeleteUserAPIKeysError = BadRequest | NotFound | XataOpError;
4141
+ /** Bulk delete API Keys for the authenticated user Delete multiple API keys in a single request. */
4142
+ export const deleteUserAPIKeys: API.OperationMethod<
4143
+ DeleteUserAPIKeysRequest,
4144
+ DeleteUserAPIKeysResponse,
4145
+ DeleteUserAPIKeysError,
4146
+ XataOpContext
4147
+ > = /*@__PURE__*/ API.make(() => ({
4148
+ input: DeleteUserAPIKeysRequest,
4149
+ output: DeleteUserAPIKeysResponse,
4150
+ errors: [BadRequest, NotFound, UnknownXataError],
4151
+ protocol: XataProtocol,
4152
+ retry: Retry.Retry,
4153
+ }));
4154
+
4155
+ export type DescribeBranchError = BadRequest | NotFound | XataOpError;
4156
+ /** Get branch details Retrieves detailed information about a specific branch by its ID, including status, connection string, and configuration. */
4157
+ export const describeBranch: API.OperationMethod<
4158
+ DescribeBranchRequest,
4159
+ BranchMetadata,
4160
+ DescribeBranchError,
4161
+ XataOpContext
4162
+ > = /*@__PURE__*/ API.make(() => ({
4163
+ input: DescribeBranchRequest,
4164
+ output: BranchMetadata,
4165
+ errors: [BadRequest, NotFound, UnknownXataError],
4166
+ protocol: XataProtocol,
4167
+ retry: Retry.Retry,
4168
+ }));
4169
+
4170
+ export type GetBackupError = BadRequest | NotFound | XataOpError;
4171
+ /** Get project backup by ID Retrieves a backup by ID for the specified project. */
4172
+ export const getBackup: API.OperationMethod<
4173
+ GetBackupRequest,
4174
+ BackupMetadata,
4175
+ GetBackupError,
4176
+ XataOpContext
4177
+ > = /*@__PURE__*/ API.make(() => ({
4178
+ input: GetBackupRequest,
4179
+ output: BackupMetadata,
4180
+ errors: [BadRequest, NotFound, UnknownXataError],
4181
+ protocol: XataProtocol,
4182
+ retry: Retry.Retry,
4183
+ }));
4184
+
4185
+ export type GetBillingCustomerError = Forbidden | NotFound | XataOpError;
4186
+ /** Get billing customer details Retrieves billing customer details for the specified organization. */
4187
+ export const getBillingCustomer: API.OperationMethod<
4188
+ GetBillingCustomerRequest,
4189
+ BillingCustomerResponse,
4190
+ GetBillingCustomerError,
4191
+ XataOpContext
4192
+ > = /*@__PURE__*/ API.make(() => ({
4193
+ input: GetBillingCustomerRequest,
4194
+ output: BillingCustomerResponse,
4195
+ errors: [Forbidden, NotFound, UnknownXataError],
4196
+ protocol: XataProtocol,
4197
+ retry: Retry.Retry,
4198
+ }));
4199
+
4200
+ export type GetBillingInvoicesError =
4201
+ | BadRequest
4202
+ | Forbidden
4203
+ | NotFound
4204
+ | XataOpError;
4205
+ /** List billing invoices Retrieves billing invoices for the specified organization. */
4206
+ export const getBillingInvoices: API.OperationMethod<
4207
+ GetBillingInvoicesRequest,
4208
+ BillingInvoicesResponse,
4209
+ GetBillingInvoicesError,
4210
+ XataOpContext
4211
+ > = /*@__PURE__*/ API.make(() => ({
4212
+ input: GetBillingInvoicesRequest,
4213
+ output: BillingInvoicesResponse,
4214
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4215
+ protocol: XataProtocol,
4216
+ retry: Retry.Retry,
4217
+ }));
4218
+
4219
+ export type GetBillingUpcomingInvoiceError = Forbidden | NotFound | XataOpError;
4220
+ /** Get upcoming billing invoice Retrieves the upcoming billing invoice for the specified organization's active subscription. Organizations are expected to have at most one active subscription. */
4221
+ export const getBillingUpcomingInvoice: API.OperationMethod<
4222
+ GetBillingUpcomingInvoiceRequest,
4223
+ BillingUpcomingInvoiceResponse,
4224
+ GetBillingUpcomingInvoiceError,
4225
+ XataOpContext
4226
+ > = /*@__PURE__*/ API.make(() => ({
4227
+ input: GetBillingUpcomingInvoiceRequest,
4228
+ output: BillingUpcomingInvoiceResponse,
4229
+ errors: [Forbidden, NotFound, UnknownXataError],
4230
+ protocol: XataProtocol,
4231
+ retry: Retry.Retry,
4232
+ }));
4233
+
4234
+ export type GetBranchCredentialsError = BadRequest | NotFound | XataOpError;
4235
+ /** Retrieve branch credentials */
4236
+ export const getBranchCredentials: API.OperationMethod<
4237
+ GetBranchCredentialsRequest,
4238
+ BranchCredentials,
4239
+ GetBranchCredentialsError,
4240
+ XataOpContext
4241
+ > = /*@__PURE__*/ API.make(() => ({
4242
+ input: GetBranchCredentialsRequest,
4243
+ output: BranchCredentials,
4244
+ errors: [BadRequest, NotFound, UnknownXataError],
4245
+ protocol: XataProtocol,
4246
+ retry: Retry.Retry,
4247
+ }));
4248
+
4249
+ export type GetBranchPostgresConfigError = BadRequest | NotFound | XataOpError;
4250
+ /** Get PostgreSQL configuration details Retrieves detailed information about the current PostgreSQL configuration parameters for a branch, including parameter types, descriptions, acceptable ranges, default values, and current values. */
4251
+ export const getBranchPostgresConfig: API.OperationMethod<
4252
+ GetBranchPostgresConfigRequest,
4253
+ PostgresConfigDetails,
4254
+ GetBranchPostgresConfigError,
4255
+ XataOpContext
4256
+ > = /*@__PURE__*/ API.make(() => ({
4257
+ input: GetBranchPostgresConfigRequest,
4258
+ output: PostgresConfigDetails,
4259
+ errors: [BadRequest, NotFound, UnknownXataError],
4260
+ protocol: XataProtocol,
4261
+ retry: Retry.Retry,
4262
+ }));
4263
+
4264
+ export type GetDefaultProjectLimitsError = XataOpError;
4265
+ /** Get project resource limits Retrieves the default resource limits for projects in the specified organization, including maximum instances, storage, and allowed regions. */
4266
+ export const getDefaultProjectLimits: API.OperationMethod<
4267
+ GetDefaultProjectLimitsRequest,
4268
+ ProjectLimits,
4269
+ GetDefaultProjectLimitsError,
4270
+ XataOpContext
4271
+ > = /*@__PURE__*/ API.make(() => ({
4272
+ input: GetDefaultProjectLimitsRequest,
4273
+ output: ProjectLimits,
4274
+ errors: [UnknownXataError],
4275
+ protocol: XataProtocol,
4276
+ retry: Retry.Retry,
4277
+ }));
4278
+
4279
+ export type GetGithubRepositoryError = BadRequest | XataOpError;
4280
+ /** Get GitHub repository for branch Returns the GitHub repository mapping for the specified branch. */
4281
+ export const getGithubRepository: API.OperationMethod<
4282
+ GetGithubRepositoryRequest,
4283
+ GetGithubRepositoryResponse,
4284
+ GetGithubRepositoryError,
4285
+ XataOpContext
4286
+ > = /*@__PURE__*/ API.make(() => ({
4287
+ input: GetGithubRepositoryRequest,
4288
+ output: GetGithubRepositoryResponse,
4289
+ errors: [BadRequest, UnknownXataError],
4290
+ protocol: XataProtocol,
4291
+ retry: Retry.Retry,
4292
+ }));
4293
+
4294
+ export type GetOrganizationError =
4295
+ | BadRequest
4296
+ | Forbidden
4297
+ | NotFound
4298
+ | XataOpError;
4299
+ /** Get organization details Retrieve detailed information about a specific organization by its ID. */
4300
+ export const getOrganization: API.OperationMethod<
4301
+ GetOrganizationRequest,
4302
+ Organization,
4303
+ GetOrganizationError,
4304
+ XataOpContext
4305
+ > = /*@__PURE__*/ API.make(() => ({
4306
+ input: GetOrganizationRequest,
4307
+ output: Organization,
4308
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4309
+ protocol: XataProtocol,
4310
+ retry: Retry.Retry,
4311
+ }));
4312
+
4313
+ export type GetOrganizationInvitationError =
4314
+ | BadRequest
4315
+ | Forbidden
4316
+ | NotFound
4317
+ | XataOpError;
4318
+ /** Get details of a specific invitation Retrieve detailed information about a specific invitation by its ID. */
4319
+ export const getOrganizationInvitation: API.OperationMethod<
4320
+ GetOrganizationInvitationRequest,
4321
+ OrganizationInvitation,
4322
+ GetOrganizationInvitationError,
4323
+ XataOpContext
4324
+ > = /*@__PURE__*/ API.make(() => ({
4325
+ input: GetOrganizationInvitationRequest,
4326
+ output: OrganizationInvitation,
4327
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4328
+ protocol: XataProtocol,
4329
+ retry: Retry.Retry,
4330
+ }));
4331
+
4332
+ export type GetOrganizationLimitsError = Forbidden | XataOpError;
4333
+ /** Get organization resource limits Retrieves the effective org-level limits, including project creation limits and branch configuration defaults. Project-specific overrides are not applied here. */
4334
+ export const getOrganizationLimits: API.OperationMethod<
4335
+ GetOrganizationLimitsRequest,
4336
+ GetOrganizationLimitsResponse,
4337
+ GetOrganizationLimitsError,
4338
+ XataOpContext
4339
+ > = /*@__PURE__*/ API.make(() => ({
4340
+ input: GetOrganizationLimitsRequest,
4341
+ output: GetOrganizationLimitsResponse,
4342
+ errors: [Forbidden, UnknownXataError],
4343
+ protocol: XataProtocol,
4344
+ retry: Retry.Retry,
4345
+ }));
4346
+
4347
+ export type GetOrganizationMembershipLimitsError = Forbidden | XataOpError;
4348
+ /** Get organization membership limits Retrieves the membership limits for the specified organization (maximum members and invitations). */
4349
+ export const getOrganizationMembershipLimits: API.OperationMethod<
4350
+ GetOrganizationMembershipLimitsRequest,
4351
+ OrganizationMembershipLimits,
4352
+ GetOrganizationMembershipLimitsError,
4353
+ XataOpContext
4354
+ > = /*@__PURE__*/ API.make(() => ({
4355
+ input: GetOrganizationMembershipLimitsRequest,
4356
+ output: OrganizationMembershipLimits,
4357
+ errors: [Forbidden, UnknownXataError],
4358
+ protocol: XataProtocol,
4359
+ retry: Retry.Retry,
4360
+ }));
4361
+
4362
+ export type GetOrganizationsListError = BadRequest | NotFound | XataOpError;
4363
+ /** Get list of organizations Retrieve the list of all organizations the authenticated user belongs to, including their IDs and names. This endpoint allows users to view all organizations they have access to. */
4364
+ export const getOrganizationsList: API.OperationMethod<
4365
+ GetOrganizationsListRequest,
4366
+ GetOrganizationsListResponse,
4367
+ GetOrganizationsListError,
4368
+ XataOpContext
4369
+ > = /*@__PURE__*/ API.make(() => ({
4370
+ input: GetOrganizationsListRequest,
4371
+ output: GetOrganizationsListResponse,
4372
+ errors: [BadRequest, NotFound, UnknownXataError],
4373
+ protocol: XataProtocol,
4374
+ retry: Retry.Retry,
4375
+ }));
4376
+
4377
+ export type GetProjectError = BadRequest | NotFound | XataOpError;
4378
+ /** Get project details Retrieves detailed information about a specific project by its ID within the specified organization. */
4379
+ export const getProject: API.OperationMethod<
4380
+ GetProjectRequest,
4381
+ Project,
4382
+ GetProjectError,
4383
+ XataOpContext
4384
+ > = /*@__PURE__*/ API.make(() => ({
4385
+ input: GetProjectRequest,
4386
+ output: Project,
4387
+ errors: [BadRequest, NotFound, UnknownXataError],
4388
+ protocol: XataProtocol,
4389
+ retry: Retry.Retry,
4390
+ }));
4391
+
4392
+ export type GetProjectLimitsError = XataOpError;
4393
+ /** Get project resource limits Retrieves the effective resource limits for the specified project, merging organization-level overrides with any project-specific overrides. */
4394
+ export const getProjectLimits: API.OperationMethod<
4395
+ GetProjectLimitsRequest,
4396
+ EffectiveProjectLimits,
4397
+ GetProjectLimitsError,
4398
+ XataOpContext
4399
+ > = /*@__PURE__*/ API.make(() => ({
4400
+ input: GetProjectLimitsRequest,
4401
+ output: EffectiveProjectLimits,
4402
+ errors: [UnknownXataError],
4403
+ protocol: XataProtocol,
4404
+ retry: Retry.Retry,
4405
+ }));
4406
+
4407
+ export type GithubWebhookError = BadRequest | XataOpError;
4408
+ /** GitHub App webhook Endpoint used by GitHub to deliver App webhook events. This endpoint is authenticated via GitHub's HMAC-SHA256 signature header, not via the normal API authentication. */
4409
+ export const githubWebhook: API.OperationMethod<
4410
+ GithubWebhookRequest,
4411
+ GithubWebhookResponse,
4412
+ GithubWebhookError,
4413
+ XataOpContext
4414
+ > = /*@__PURE__*/ API.make(() => ({
4415
+ input: GithubWebhookRequest,
4416
+ output: GithubWebhookResponse,
4417
+ errors: [BadRequest, UnknownXataError],
4418
+ protocol: XataProtocol,
4419
+ retry: Retry.Retry,
4420
+ }));
4421
+
4422
+ export type ListBackupsError = BadRequest | NotFound | XataOpError;
4423
+ /** List project backups Retrieves a list of backups for the specified project. */
4424
+ export const listBackups: API.OperationMethod<
4425
+ ListBackupsRequest,
4426
+ ListBackupsResponse,
4427
+ ListBackupsError,
4428
+ XataOpContext
4429
+ > = /*@__PURE__*/ API.make(() => ({
4430
+ input: ListBackupsRequest,
4431
+ output: ListBackupsResponse,
4432
+ errors: [BadRequest, NotFound, UnknownXataError],
4433
+ protocol: XataProtocol,
4434
+ retry: Retry.Retry,
4435
+ }));
4436
+
4437
+ export type ListBranchesError = BadRequest | NotFound | XataOpError;
4438
+ /** List all branches Retrieves a list of all branches within the specified project, including their metadata, region, and access settings. */
4439
+ export const listBranches: API.OperationMethod<
4440
+ ListBranchesRequest,
4441
+ ListBranchesResponse,
4442
+ ListBranchesError,
4443
+ XataOpContext
4444
+ > = /*@__PURE__*/ API.make(() => ({
4445
+ input: ListBranchesRequest,
4446
+ output: ListBranchesResponse,
4447
+ errors: [BadRequest, NotFound, UnknownXataError],
4448
+ protocol: XataProtocol,
4449
+ retry: Retry.Retry,
4450
+ }));
4451
+
4452
+ export type ListExtensionsError = BadRequest | XataOpError;
4453
+ /** Get available extensions for image Retrieves a list of all extensions for the specified image in the organization and region given */
4454
+ export const listExtensions: API.OperationMethod<
4455
+ ListExtensionsRequest,
4456
+ ListExtensionsResponse,
4457
+ ListExtensionsError,
4458
+ XataOpContext
4459
+ > = /*@__PURE__*/ API.make(() => ({
4460
+ input: ListExtensionsRequest,
4461
+ output: ListExtensionsResponse,
4462
+ errors: [BadRequest, UnknownXataError],
4463
+ protocol: XataProtocol,
4464
+ retry: Retry.Retry,
4465
+ }));
4466
+
4467
+ export type ListGithubAppInstallationsError = BadRequest | XataOpError;
4468
+ /** List GitHub App installations for organization Returns all GitHub App installations associated with the specified organization. */
4469
+ export const listGithubAppInstallations: API.OperationMethod<
4470
+ ListGithubAppInstallationsRequest,
4471
+ ListGithubAppInstallationsResponse,
4472
+ ListGithubAppInstallationsError,
4473
+ XataOpContext
4474
+ > = /*@__PURE__*/ API.make(() => ({
4475
+ input: ListGithubAppInstallationsRequest,
4476
+ output: ListGithubAppInstallationsResponse,
4477
+ errors: [BadRequest, UnknownXataError],
4478
+ protocol: XataProtocol,
4479
+ retry: Retry.Retry,
4480
+ }));
4481
+
4482
+ export type ListImagesError = BadRequest | XataOpError;
4483
+ /** Get available images Retrieves a list of all images for the specified organization and region */
4484
+ export const listImages: API.OperationMethod<
4485
+ ListImagesRequest,
4486
+ ListImagesResponse,
4487
+ ListImagesError,
4488
+ XataOpContext
4489
+ > = /*@__PURE__*/ API.make(() => ({
4490
+ input: ListImagesRequest,
4491
+ output: ListImagesResponse,
4492
+ errors: [BadRequest, UnknownXataError],
4493
+ protocol: XataProtocol,
4494
+ retry: Retry.Retry,
4495
+ }));
4496
+
4497
+ export type ListInstanceTypesError = BadRequest | XataOpError;
4498
+ /** Get available instance types Retrieves a list of all instance types for the specified organization and region */
4499
+ export const listInstanceTypes: API.OperationMethod<
4500
+ ListInstanceTypesRequest,
4501
+ ListInstanceTypesResponse,
4502
+ ListInstanceTypesError,
4503
+ XataOpContext
4504
+ > = /*@__PURE__*/ API.make(() => ({
4505
+ input: ListInstanceTypesRequest,
4506
+ output: ListInstanceTypesResponse,
4507
+ errors: [BadRequest, UnknownXataError],
4508
+ protocol: XataProtocol,
4509
+ retry: Retry.Retry,
4510
+ }));
4511
+
4512
+ export type ListOrganizationAPIKeysError =
4513
+ | BadRequest
4514
+ | Forbidden
4515
+ | NotFound
4516
+ | XataOpError;
4517
+ /** List API Keys for an organization Retrieve a list of API keys for a specific organization. */
4518
+ export const listOrganizationAPIKeys: API.OperationMethod<
4519
+ ListOrganizationAPIKeysRequest,
4520
+ ListOrganizationAPIKeysResponse,
4521
+ ListOrganizationAPIKeysError,
4522
+ XataOpContext
4523
+ > = /*@__PURE__*/ API.make(() => ({
4524
+ input: ListOrganizationAPIKeysRequest,
4525
+ output: ListOrganizationAPIKeysResponse,
4526
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4527
+ protocol: XataProtocol,
4528
+ retry: Retry.Retry,
4529
+ }));
4530
+
4531
+ export type ListOrganizationInvitationsError =
4532
+ | BadRequest
4533
+ | Forbidden
4534
+ | NotFound
4535
+ | XataOpError;
4536
+ /** List invitations for an organization Retrieve all invitations for an organization with optional filtering by status, email, and name. */
4537
+ export const listOrganizationInvitations: API.OperationMethod<
4538
+ ListOrganizationInvitationsRequest,
4539
+ ListOrganizationInvitationsResponse,
4540
+ ListOrganizationInvitationsError,
4541
+ XataOpContext
4542
+ > = /*@__PURE__*/ API.make(() => ({
4543
+ input: ListOrganizationInvitationsRequest,
4544
+ output: ListOrganizationInvitationsResponse,
4545
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4546
+ protocol: XataProtocol,
4547
+ retry: Retry.Retry,
4548
+ }));
4549
+
4550
+ export type ListOrganizationMembersError = XataOpError;
4551
+ /** List members of an organization */
4552
+ export const listOrganizationMembers: API.OperationMethod<
4553
+ ListOrganizationMembersRequest,
4554
+ ListOrganizationMembersResponse,
4555
+ ListOrganizationMembersError,
4556
+ XataOpContext
4557
+ > = /*@__PURE__*/ API.make(() => ({
4558
+ input: ListOrganizationMembersRequest,
4559
+ output: ListOrganizationMembersResponse,
4560
+ errors: [UnknownXataError],
4561
+ protocol: XataProtocol,
4562
+ retry: Retry.Retry,
4563
+ }));
4564
+
4565
+ export type ListProjectsError = BadRequest | XataOpError;
4566
+ /** List all projects Retrieves a list of all projects within the specified organization that the authenticated user has access to. */
4567
+ export const listProjects: API.OperationMethod<
4568
+ ListProjectsRequest,
4569
+ ListProjectsResponse,
4570
+ ListProjectsError,
4571
+ XataOpContext
4572
+ > = /*@__PURE__*/ API.make(() => ({
4573
+ input: ListProjectsRequest,
4574
+ output: ListProjectsResponse,
4575
+ errors: [BadRequest, UnknownXataError],
4576
+ protocol: XataProtocol,
4577
+ retry: Retry.Retry,
4578
+ }));
4579
+
4580
+ export type ListRegionsError = BadRequest | XataOpError;
4581
+ /** Get available regions Retrieves a list of all regions where new branches can be deployed for the specified organization. */
4582
+ export const listRegions: API.OperationMethod<
4583
+ ListRegionsRequest,
4584
+ ListRegionsResponse,
4585
+ ListRegionsError,
4586
+ XataOpContext
4587
+ > = /*@__PURE__*/ API.make(() => ({
4588
+ input: ListRegionsRequest,
4589
+ output: ListRegionsResponse,
4590
+ errors: [BadRequest, UnknownXataError],
4591
+ protocol: XataProtocol,
4592
+ retry: Retry.Retry,
4593
+ }));
4594
+
4595
+ export type ListUserAPIKeysError = BadRequest | XataOpError;
4596
+ /** List API Keys for the authenticated user Retrieve a list of API keys for the authenticated user. */
4597
+ export const listUserAPIKeys: API.OperationMethod<
4598
+ ListUserAPIKeysRequest,
4599
+ ListUserAPIKeysResponse,
4600
+ ListUserAPIKeysError,
4601
+ XataOpContext
4602
+ > = /*@__PURE__*/ API.make(() => ({
4603
+ input: ListUserAPIKeysRequest,
4604
+ output: ListUserAPIKeysResponse,
4605
+ errors: [BadRequest, UnknownXataError],
4606
+ protocol: XataProtocol,
4607
+ retry: Retry.Retry,
4608
+ }));
4609
+
4610
+ export type OrbWebhookError = BadRequest | XataOpError;
4611
+ /** Orb billing webhook Endpoint used by Orb to deliver billing-related webhook events. This endpoint is authenticated via Orb's HMAC signature headers, not via the normal API authentication. */
4612
+ export const orbWebhook: API.OperationMethod<
4613
+ OrbWebhookRequest,
4614
+ OrbWebhookResponse,
4615
+ OrbWebhookError,
4616
+ XataOpContext
4617
+ > = /*@__PURE__*/ API.make(() => ({
4618
+ input: OrbWebhookRequest,
4619
+ output: OrbWebhookResponse,
4620
+ errors: [BadRequest, UnknownXataError],
4621
+ protocol: XataProtocol,
4622
+ retry: Retry.Retry,
4623
+ }));
4624
+
4625
+ export type QueryError =
4626
+ | BadRequest
4627
+ | Forbidden
4628
+ | NotFound
4629
+ | Conflict
4630
+ | XataOpError;
4631
+ /** Execute SQL query Execute a single SQL query or a batch of queries against a PostgreSQL branch. **Authentication:** send the branch's PostgreSQL connection string in the `Connection-String` header. The control-plane API key (Bearer token) is **not** accepted on the gateway host. **Routing:** the target branch, region, and endpoint type are taken from the hostname embedded in the connection string, which must match the request host. See the `Connection-String` security scheme for the host format. **Single query:** provide `query` (and optional `params`) at the top level. **Batch:** provide `queries` as an array of query objects, or send the request body as a JSON array. Batch queries execute within a single transaction. */
4632
+ export const query: API.OperationMethod<
4633
+ QueryRequest,
4634
+ QueryResponse,
4635
+ QueryError,
4636
+ XataOpContext
4637
+ > = /*@__PURE__*/ API.make(() => ({
4638
+ input: QueryRequest,
4639
+ output: QueryResponse,
4640
+ errors: [BadRequest, Forbidden, NotFound, Conflict, UnknownXataError],
4641
+ protocol: XataProtocol,
4642
+ retry: Retry.Retry,
4643
+ }));
4644
+
4645
+ export type RegisterMarketplaceError = BadRequest | Conflict | XataOpError;
4646
+ /** Register with a cloud marketplace Links the authenticated user to a cloud marketplace subscription. Only one marketplace registration is allowed per user. */
4647
+ export const registerMarketplace: API.OperationMethod<
4648
+ RegisterMarketplaceRequest,
4649
+ RegisterMarketplaceResponse,
4650
+ RegisterMarketplaceError,
4651
+ XataOpContext
4652
+ > = /*@__PURE__*/ API.make(() => ({
4653
+ input: RegisterMarketplaceRequest,
4654
+ output: RegisterMarketplaceResponse,
4655
+ errors: [BadRequest, Conflict, UnknownXataError],
4656
+ protocol: XataProtocol,
4657
+ retry: Retry.Retry,
4658
+ }));
4659
+
4660
+ export type RemoveOrganizationMemberError = XataOpError;
4661
+ /** Remove a member from an organization */
4662
+ export const removeOrganizationMember: API.OperationMethod<
4663
+ RemoveOrganizationMemberRequest,
4664
+ RemoveOrganizationMemberResponse,
4665
+ RemoveOrganizationMemberError,
4666
+ XataOpContext
4667
+ > = /*@__PURE__*/ API.make(() => ({
4668
+ input: RemoveOrganizationMemberRequest,
4669
+ output: RemoveOrganizationMemberResponse,
4670
+ errors: [UnknownXataError],
4671
+ protocol: XataProtocol,
4672
+ retry: Retry.Retry,
4673
+ }));
4674
+
4675
+ export type RequestOrganizationDeletionError =
4676
+ | BadRequest
4677
+ | Forbidden
4678
+ | Conflict
4679
+ | XataOpError;
4680
+ /** Request organization deletion Flags the organization for deletion. The request is rejected if the organization still has active projects. The subscription is cancelled immediately and any outstanding invoices are collected automatically after a grace period that prevents missing delayed usage reports. Deletion completes asynchronously once all invoices are issued and settled. */
4681
+ export const requestOrganizationDeletion: API.OperationMethod<
4682
+ RequestOrganizationDeletionRequest,
4683
+ RequestOrganizationDeletionResponse,
4684
+ RequestOrganizationDeletionError,
4685
+ XataOpContext
4686
+ > = /*@__PURE__*/ API.make(() => ({
4687
+ input: RequestOrganizationDeletionRequest,
4688
+ output: RequestOrganizationDeletionResponse,
4689
+ errors: [BadRequest, Forbidden, Conflict, UnknownXataError],
4690
+ protocol: XataProtocol,
4691
+ retry: Retry.Retry,
4692
+ }));
4693
+
4694
+ export type ResendOrganizationInvitationError =
4695
+ | BadRequest
4696
+ | Forbidden
4697
+ | NotFound
4698
+ | XataOpError;
4699
+ /** Resend an invitation Resend a pending invitation with a fresh expiration time. */
4700
+ export const resendOrganizationInvitation: API.OperationMethod<
4701
+ ResendOrganizationInvitationRequest,
4702
+ ResendOrganizationInvitationResponse,
4703
+ ResendOrganizationInvitationError,
4704
+ XataOpContext
4705
+ > = /*@__PURE__*/ API.make(() => ({
4706
+ input: ResendOrganizationInvitationRequest,
4707
+ output: ResendOrganizationInvitationResponse,
4708
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4709
+ protocol: XataProtocol,
4710
+ retry: Retry.Retry,
4711
+ }));
4712
+
4713
+ export type RestoreFromBackupError = BadRequest | NotFound | XataOpError;
4714
+ /** Create a new branch from a backup of another branch Creates a new backup branch within the specified project. */
4715
+ export const restoreFromBackup: API.OperationMethod<
4716
+ RestoreFromBackupRequest,
4717
+ BranchShortMetadata,
4718
+ RestoreFromBackupError,
4719
+ XataOpContext
4720
+ > = /*@__PURE__*/ API.make(() => ({
4721
+ input: RestoreFromBackupRequest,
4722
+ output: BranchShortMetadata,
4723
+ errors: [BadRequest, NotFound, UnknownXataError],
4724
+ protocol: XataProtocol,
4725
+ retry: Retry.Retry,
4726
+ }));
4727
+
4728
+ export type RotateBranchCredentialsError = BadRequest | NotFound | XataOpError;
4729
+ /** Rotate branch credentials Triggers a credential rotation for the branch database user. The new credentials can be retrieved via the credentials endpoint after rotation completes. */
4730
+ export const rotateBranchCredentials: API.OperationMethod<
4731
+ RotateBranchCredentialsRequest,
4732
+ RotateBranchCredentialsResponse,
4733
+ RotateBranchCredentialsError,
4734
+ XataOpContext
4735
+ > = /*@__PURE__*/ API.make(() => ({
4736
+ input: RotateBranchCredentialsRequest,
4737
+ output: RotateBranchCredentialsResponse,
4738
+ errors: [BadRequest, NotFound, UnknownXataError],
4739
+ protocol: XataProtocol,
4740
+ retry: Retry.Retry,
4741
+ }));
4742
+
4743
+ export type SendMcpRequestError = BadRequest | XataOpError;
4744
+ /** Send an MCP message Handle a single JSON-RPC 2.0 message from an MCP client, per the MCP [Streamable HTTP transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports). The server is stateless: every request is self-contained and carries the caller's credential, so there is no session to establish or resume. `GET` and `DELETE` on this path return `405 Method Not Allowed`. **Requests** (messages with an `id`) are answered with the JSON-RPC response, either as `application/json` or as a `text/event-stream` carrying the response and any notifications emitted while it runs. Requests must accept both. **Notifications and responses** (messages without an `id`) are answered with `202 Accepted` and an empty body. */
4745
+ export const sendMcpRequest: API.OperationMethod<
4746
+ SendMcpRequestRequest,
4747
+ JSONRPCResponse,
4748
+ SendMcpRequestError,
4749
+ XataOpContext
4750
+ > = /*@__PURE__*/ API.make(() => ({
4751
+ input: SendMcpRequestRequest,
4752
+ output: JSONRPCResponse,
4753
+ errors: [BadRequest, UnknownXataError],
4754
+ protocol: XataProtocol,
4755
+ retry: Retry.Retry,
4756
+ }));
4757
+
4758
+ export type StripeWebhookError = BadRequest | XataOpError;
4759
+ /** Stripe webhook Endpoint used by Stripe to deliver webhook events. This endpoint is authenticated via Stripe's signature headers, not via the normal API authentication. */
4760
+ export const stripeWebhook: API.OperationMethod<
4761
+ StripeWebhookRequest,
4762
+ StripeWebhookResponse,
4763
+ StripeWebhookError,
4764
+ XataOpContext
4765
+ > = /*@__PURE__*/ API.make(() => ({
4766
+ input: StripeWebhookRequest,
4767
+ output: StripeWebhookResponse,
4768
+ errors: [BadRequest, UnknownXataError],
4769
+ protocol: XataProtocol,
4770
+ retry: Retry.Retry,
4771
+ }));
4772
+
4773
+ export type UpdateBillingCustomerError =
4774
+ | BadRequest
4775
+ | Forbidden
4776
+ | NotFound
4777
+ | XataOpError;
4778
+ /** Update billing customer details Updates billing customer details for the specified organization. */
4779
+ export const updateBillingCustomer: API.OperationMethod<
4780
+ UpdateBillingCustomerRequest,
4781
+ BillingCustomerResponse,
4782
+ UpdateBillingCustomerError,
4783
+ XataOpContext
4784
+ > = /*@__PURE__*/ API.make(() => ({
4785
+ input: UpdateBillingCustomerRequest,
4786
+ output: BillingCustomerResponse,
4787
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4788
+ protocol: XataProtocol,
4789
+ retry: Retry.Retry,
4790
+ }));
4791
+
4792
+ export type UpdateBranchError = BadRequest | NotFound | XataOpError;
4793
+ /** Update branch details Updates the configuration of a specific branch by its ID, such as changing its name, description, or resource allocation. */
4794
+ export const updateBranch: API.OperationMethod<
4795
+ UpdateBranchRequest,
4796
+ BranchShortMetadata,
4797
+ UpdateBranchError,
4798
+ XataOpContext
4799
+ > = /*@__PURE__*/ API.make(() => ({
4800
+ input: UpdateBranchRequest,
4801
+ output: BranchShortMetadata,
4802
+ errors: [BadRequest, NotFound, UnknownXataError],
4803
+ protocol: XataProtocol,
4804
+ retry: Retry.Retry,
4805
+ }));
4806
+
4807
+ export type UpdateGithubAppInstallationError =
4808
+ | BadRequest
4809
+ | NotFound
4810
+ | Conflict
4811
+ | XataOpError;
4812
+ /** Update GitHub App installation Updates an existing GitHub App installation mapping. */
4813
+ export const updateGithubAppInstallation: API.OperationMethod<
4814
+ UpdateGithubAppInstallationRequest,
4815
+ GithubInstallation,
4816
+ UpdateGithubAppInstallationError,
4817
+ XataOpContext
4818
+ > = /*@__PURE__*/ API.make(() => ({
4819
+ input: UpdateGithubAppInstallationRequest,
4820
+ output: GithubInstallation,
4821
+ errors: [BadRequest, NotFound, Conflict, UnknownXataError],
4822
+ protocol: XataProtocol,
4823
+ retry: Retry.Retry,
4824
+ }));
4825
+
4826
+ export type UpdateGithubRepositoryError = BadRequest | NotFound | XataOpError;
4827
+ /** Update GitHub repository mapping Updates an existing GitHub repository to Xata branch mapping. */
4828
+ export const updateGithubRepository: API.OperationMethod<
4829
+ UpdateGithubRepositoryRequest,
4830
+ GithubRepository,
4831
+ UpdateGithubRepositoryError,
4832
+ XataOpContext
4833
+ > = /*@__PURE__*/ API.make(() => ({
4834
+ input: UpdateGithubRepositoryRequest,
4835
+ output: GithubRepository,
4836
+ errors: [BadRequest, NotFound, UnknownXataError],
4837
+ protocol: XataProtocol,
4838
+ retry: Retry.Retry,
4839
+ }));
4840
+
4841
+ export type UpdateOrganizationError =
4842
+ | BadRequest
4843
+ | Forbidden
4844
+ | NotFound
4845
+ | XataOpError;
4846
+ /** Update organization details Update information for an existing organization, such as its name. */
4847
+ export const updateOrganization: API.OperationMethod<
4848
+ UpdateOrganizationRequest,
4849
+ Organization,
4850
+ UpdateOrganizationError,
4851
+ XataOpContext
4852
+ > = /*@__PURE__*/ API.make(() => ({
4853
+ input: UpdateOrganizationRequest,
4854
+ output: Organization,
4855
+ errors: [BadRequest, Forbidden, NotFound, UnknownXataError],
4856
+ protocol: XataProtocol,
4857
+ retry: Retry.Retry,
4858
+ }));
4859
+
4860
+ export type UpdateProjectError = BadRequest | NotFound | XataOpError;
4861
+ /** Update project details Updates the details of a specific project by its ID, such as changing its name. */
4862
+ export const updateProject: API.OperationMethod<
4863
+ UpdateProjectRequest,
4864
+ Project,
4865
+ UpdateProjectError,
4866
+ XataOpContext
4867
+ > = /*@__PURE__*/ API.make(() => ({
4868
+ input: UpdateProjectRequest,
4869
+ output: Project,
4870
+ errors: [BadRequest, NotFound, UnknownXataError],
4871
+ protocol: XataProtocol,
4872
+ retry: Retry.Retry,
4873
+ }));
4874
+
4875
+ export type UpsertInstallationError =
4876
+ | BadRequest
4877
+ | Forbidden
4878
+ | Conflict
4879
+ | XataOpError;
4880
+ /** Upsert a Vercel Marketplace installation Create or update an installation. Vercel sends this when a customer installs (or re-sends it idempotently). The acting account is taken from the signed token claims, not this body. There is one installation per Vercel team, and an installation can own many Xata organizations. */
4881
+ export const upsertInstallation: API.OperationMethod<
4882
+ UpsertInstallationRequest,
4883
+ UpsertInstallationResponse,
4884
+ UpsertInstallationError,
4885
+ XataOpContext
4886
+ > = /*@__PURE__*/ API.make(() => ({
4887
+ input: UpsertInstallationRequest,
4888
+ output: UpsertInstallationResponse,
4889
+ errors: [BadRequest, Forbidden, Conflict, UnknownXataError],
4890
+ protocol: XataProtocol,
4891
+ retry: Retry.Retry,
4892
+ }));
4893
+
4894
+ export type WebsocketError = BadRequest | XataOpError;
4895
+ /** WebSocket wire protocol proxy Upgrade to a WebSocket connection that proxies the PostgreSQL wire protocol. The client sends and receives PostgreSQL protocol messages over binary WebSocket frames. **Authentication:** the same branch connection string credential as the HTTP SQL endpoint is used, but it is supplied via the PostgreSQL startup message inside the wire protocol rather than an HTTP header. The control-plane API key (Bearer token) is not accepted. */
4896
+ export const websocket: API.OperationMethod<
4897
+ WebsocketRequest,
4898
+ WebsocketResponse,
4899
+ WebsocketError,
4900
+ XataOpContext
4901
+ > = /*@__PURE__*/ API.make(() => ({
4902
+ input: WebsocketRequest,
4903
+ output: WebsocketResponse,
4904
+ errors: [BadRequest, UnknownXataError],
4905
+ protocol: XataProtocol,
4906
+ retry: Retry.Retry,
4907
+ }));