pgbeam 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4262 @@
1
+ /**
2
+ * Generated by Kubb (https://kubb.dev/).
3
+ * Do not edit manually.
4
+ */
5
+ /**
6
+ * @description Full account data export for privacy and data-portability requests.
7
+ */
8
+ type AccountExport = {
9
+ /**
10
+ * @description Core user profile data.
11
+ * @type object
12
+ */
13
+ user: {
14
+ /**
15
+ * @description User identifier.
16
+ * @type string
17
+ */
18
+ id: string;
19
+ /**
20
+ * @description Display name for the user.
21
+ * @type string
22
+ */
23
+ name: string;
24
+ /**
25
+ * @description Primary account email address.
26
+ * @type string, email
27
+ */
28
+ email: string;
29
+ /**
30
+ * @description Whether the email address has been verified.
31
+ * @type boolean
32
+ */
33
+ email_verified: boolean;
34
+ /**
35
+ * @description Avatar image URL, if present.
36
+ * @type string | undefined
37
+ */
38
+ image?: string;
39
+ /**
40
+ * @description When the user account was created.
41
+ * @type string, date-time
42
+ */
43
+ created_at: string;
44
+ /**
45
+ * @description When the user profile was last updated.
46
+ * @type string, date-time
47
+ */
48
+ updated_at: string;
49
+ };
50
+ /**
51
+ * @description Organizations the user belongs to.
52
+ * @type array
53
+ */
54
+ organizations: {
55
+ /**
56
+ * @description Organization identifier.
57
+ * @type string
58
+ */
59
+ id: string;
60
+ /**
61
+ * @description Organization display name.
62
+ * @type string
63
+ */
64
+ name: string;
65
+ /**
66
+ * @description Organization slug used in URLs and routing.
67
+ * @type string
68
+ */
69
+ slug: string;
70
+ /**
71
+ * @description User role within the organization.
72
+ * @type string
73
+ */
74
+ role: string;
75
+ /**
76
+ * @description When the organization membership was created.
77
+ * @type string, date-time
78
+ */
79
+ created_at: string;
80
+ }[];
81
+ /**
82
+ * @description Projects owned through the user\'s organizations.
83
+ * @type array
84
+ */
85
+ projects: {
86
+ /**
87
+ * @description Project identifier.
88
+ * @type string
89
+ */
90
+ id: string;
91
+ /**
92
+ * @description Owning organization identifier.
93
+ * @type string
94
+ */
95
+ org_id: string;
96
+ /**
97
+ * @description Project display name.
98
+ * @type string
99
+ */
100
+ name: string;
101
+ /**
102
+ * @description Project description at export time.
103
+ * @type string
104
+ */
105
+ description: string;
106
+ /**
107
+ * @description Project lifecycle status.
108
+ * @type string
109
+ */
110
+ status: string;
111
+ /**
112
+ * @description When the project was created.
113
+ * @type string, date-time
114
+ */
115
+ created_at: string;
116
+ }[];
117
+ /**
118
+ * @description Databases registered under the exported projects.
119
+ * @type array
120
+ */
121
+ databases: {
122
+ /**
123
+ * @description Database identifier.
124
+ * @type string
125
+ */
126
+ id: string;
127
+ /**
128
+ * @description Owning project identifier.
129
+ * @type string
130
+ */
131
+ project_id: string;
132
+ /**
133
+ * @description Upstream PostgreSQL host.
134
+ * @type string
135
+ */
136
+ host: string;
137
+ /**
138
+ * @description Upstream PostgreSQL port.
139
+ * @type integer
140
+ */
141
+ port: number;
142
+ /**
143
+ * @description Upstream PostgreSQL database name.
144
+ * @type string
145
+ */
146
+ name: string;
147
+ /**
148
+ * @description PostgreSQL SSL mode in use for the database.
149
+ * @type string
150
+ */
151
+ ssl_mode: string;
152
+ /**
153
+ * @description Database role within the project.
154
+ * @type string
155
+ */
156
+ role: string;
157
+ /**
158
+ * @description When the database registration was created.
159
+ * @type string, date-time
160
+ */
161
+ created_at: string;
162
+ }[];
163
+ /**
164
+ * @description Auth sessions associated with the user.
165
+ * @type array
166
+ */
167
+ sessions: {
168
+ /**
169
+ * @description Session identifier.
170
+ * @type string
171
+ */
172
+ id: string;
173
+ /**
174
+ * @description When the session expires.
175
+ * @type string, date-time
176
+ */
177
+ expires_at: string;
178
+ /**
179
+ * @description When the session was created.
180
+ * @type string, date-time
181
+ */
182
+ created_at: string;
183
+ /**
184
+ * @description IP address used to create the session, if known.
185
+ * @type string | undefined
186
+ */
187
+ ip_address?: string;
188
+ /**
189
+ * @description User agent captured for the session, if known.
190
+ * @type string | undefined
191
+ */
192
+ user_agent?: string;
193
+ }[];
194
+ /**
195
+ * @description User communication preferences.
196
+ * @type object
197
+ */
198
+ email_preferences: {
199
+ /**
200
+ * @description Whether marketing emails are enabled.
201
+ * @type boolean | undefined
202
+ */
203
+ marketing_emails?: boolean;
204
+ /**
205
+ * @description Whether usage alert emails are enabled.
206
+ * @type boolean | undefined
207
+ */
208
+ usage_limit_alerts?: boolean;
209
+ };
210
+ /**
211
+ * @description Recorded legal-document acceptances for the user.
212
+ * @type array
213
+ */
214
+ consents: {
215
+ /**
216
+ * @description Consent record identifier.
217
+ * @type string
218
+ */
219
+ id: string;
220
+ /**
221
+ * @description Legal document type accepted by the user.
222
+ * @type string
223
+ */
224
+ document_type: string;
225
+ /**
226
+ * @description Accepted document version.
227
+ * @type string
228
+ */
229
+ document_version: string;
230
+ /**
231
+ * @description When the document was accepted.
232
+ * @type string, date-time
233
+ */
234
+ accepted_at: string;
235
+ /**
236
+ * @description IP address captured when consent was recorded.
237
+ * @type string | undefined
238
+ */
239
+ ip_address?: string;
240
+ }[];
241
+ /**
242
+ * @description Recent audit log entries associated with the account.
243
+ * @type array
244
+ */
245
+ audit_logs: {
246
+ /**
247
+ * @description Audit log entry identifier.
248
+ * @type string
249
+ */
250
+ id: string;
251
+ /**
252
+ * @description Action captured by the audit log entry.
253
+ * @type string
254
+ */
255
+ action: string;
256
+ /**
257
+ * @description Type of resource affected by the action.
258
+ * @type string | undefined
259
+ */
260
+ resource_type?: string;
261
+ /**
262
+ * @description Identifier of the affected resource.
263
+ * @type string | undefined
264
+ */
265
+ resource_id?: string;
266
+ /**
267
+ * @description IP address associated with the action, if known.
268
+ * @type string | undefined
269
+ */
270
+ ip_address?: string;
271
+ /**
272
+ * @description When the audit log entry was recorded.
273
+ * @type string, date-time
274
+ */
275
+ created_at: string;
276
+ }[];
277
+ /**
278
+ * @description When the export was generated.
279
+ * @type string, date-time
280
+ */
281
+ exported_at: string;
282
+ };
283
+
284
+ /**
285
+ * Generated by Kubb (https://kubb.dev/).
286
+ * Do not edit manually.
287
+ */
288
+ /**
289
+ * @description Standard error response envelope for PgBeam API requests.
290
+ */
291
+ type Error$1 = {
292
+ /**
293
+ * @description Error metadata for the failed request.
294
+ * @type object
295
+ */
296
+ error: {
297
+ /**
298
+ * @description Machine-readable error code.
299
+ * @type string
300
+ */
301
+ code: string;
302
+ /**
303
+ * @description Human-readable error message.
304
+ * @type string
305
+ */
306
+ message: string;
307
+ };
308
+ };
309
+
310
+ /**
311
+ * Generated by Kubb (https://kubb.dev/).
312
+ * Do not edit manually.
313
+ */
314
+
315
+ /**
316
+ * @description Account data export.
317
+ */
318
+ type ExportAccountData200 = AccountExport;
319
+ /**
320
+ * @description Missing or invalid authentication.
321
+ */
322
+ type ExportAccountData401 = Error$1;
323
+ /**
324
+ * @description Resource not found.
325
+ */
326
+ type ExportAccountData404 = Error$1;
327
+ /**
328
+ * @description Rate limited. Try again later.
329
+ */
330
+ type ExportAccountData429 = Error$1;
331
+ type ExportAccountDataQueryResponse = ExportAccountData200;
332
+ type ExportAccountDataQuery = {
333
+ Response: ExportAccountData200;
334
+ Errors: ExportAccountData401 | ExportAccountData404 | ExportAccountData429;
335
+ };
336
+
337
+ /**
338
+ * Generated by Kubb (https://kubb.dev/).
339
+ * Do not edit manually.
340
+ */
341
+ /**
342
+ * @description Recent activity snapshot for a project in an organization.
343
+ */
344
+ type ActivityEntry = {
345
+ /**
346
+ * @description Unique activity snapshot identifier.
347
+ * @type string
348
+ */
349
+ id: string;
350
+ /**
351
+ * @description Project that produced the activity snapshot.
352
+ * @type string
353
+ */
354
+ project_id: string;
355
+ /**
356
+ * @description Project display name at the time of the snapshot.
357
+ * @type string
358
+ */
359
+ project_name: string;
360
+ /**
361
+ * @description Region where the activity was observed.
362
+ * @type string
363
+ */
364
+ region: string;
365
+ /**
366
+ * @description Total queries observed in the snapshot interval.
367
+ * @type integer, int64
368
+ */
369
+ queries_total: number;
370
+ /**
371
+ * @description Number of cache hits during the interval.
372
+ * @type integer, int64
373
+ */
374
+ cache_hits: number;
375
+ /**
376
+ * @description Number of cache misses during the interval.
377
+ * @type integer, int64
378
+ */
379
+ cache_misses: number;
380
+ /**
381
+ * @description Average query latency in milliseconds.
382
+ * @type number, double
383
+ */
384
+ avg_latency_ms: number;
385
+ /**
386
+ * @description 99th percentile query latency in milliseconds.
387
+ * @type number, double
388
+ */
389
+ p99_latency_ms: number;
390
+ /**
391
+ * @description Number of active proxy connections during the interval.
392
+ * @type integer
393
+ */
394
+ active_connections: number;
395
+ /**
396
+ * @description When the activity snapshot was recorded.
397
+ * @type string, date-time
398
+ */
399
+ created_at: string;
400
+ };
401
+
402
+ /**
403
+ * Generated by Kubb (https://kubb.dev/).
404
+ * Do not edit manually.
405
+ */
406
+
407
+ /**
408
+ * @description Response envelope for organization activity queries.
409
+ */
410
+ type ActivityResponse = {
411
+ /**
412
+ * @description Recent activity snapshots for projects in the organization.
413
+ * @type array
414
+ */
415
+ entries: ActivityEntry[];
416
+ };
417
+
418
+ /**
419
+ * Generated by Kubb (https://kubb.dev/).
420
+ * Do not edit manually.
421
+ */
422
+
423
+ type GetOrganizationActivityPathParams = {
424
+ /**
425
+ * @description Unique organization identifier.
426
+ * @pattern ^[a-zA-Z0-9_.-]+$
427
+ * @type string
428
+ */
429
+ org_id: string;
430
+ };
431
+ type GetOrganizationActivityQueryParams = {
432
+ /**
433
+ * @description Maximum number of activity entries to return.
434
+ * @minLength 1
435
+ * @maxLength 1000
436
+ * @default 100
437
+ * @type integer | undefined
438
+ */
439
+ limit?: number;
440
+ /**
441
+ * @description Filter activity by event type (e.g. metrics, connection).
442
+ * @type string | undefined
443
+ */
444
+ event_type?: string;
445
+ };
446
+ /**
447
+ * @description Recent activity entries.
448
+ */
449
+ type GetOrganizationActivity200 = ActivityResponse;
450
+ /**
451
+ * @description Invalid request parameters.
452
+ */
453
+ type GetOrganizationActivity400 = Error$1;
454
+ /**
455
+ * @description Missing or invalid authentication.
456
+ */
457
+ type GetOrganizationActivity401 = Error$1;
458
+ /**
459
+ * @description Operation not allowed by current plan limits.
460
+ */
461
+ type GetOrganizationActivity403 = Error$1;
462
+ /**
463
+ * @description Rate limited. Try again later.
464
+ */
465
+ type GetOrganizationActivity429 = Error$1;
466
+ type GetOrganizationActivityQueryResponse = GetOrganizationActivity200;
467
+ type GetOrganizationActivityQuery = {
468
+ Response: GetOrganizationActivity200;
469
+ PathParams: GetOrganizationActivityPathParams;
470
+ QueryParams: GetOrganizationActivityQueryParams;
471
+ Errors: GetOrganizationActivity400 | GetOrganizationActivity401 | GetOrganizationActivity403 | GetOrganizationActivity429;
472
+ };
473
+
474
+ /**
475
+ * Generated by Kubb (https://kubb.dev/).
476
+ * Do not edit manually.
477
+ */
478
+ /**
479
+ * @description Effective usage limits enforced for an organization plan.
480
+ */
481
+ type PlanLimits = {
482
+ /**
483
+ * @description Maximum queries per day across all projects. 0 means unlimited.
484
+ * @type integer, int64
485
+ */
486
+ queries_per_day: number;
487
+ /**
488
+ * @description Maximum number of active projects.
489
+ * @type integer
490
+ */
491
+ max_projects: number;
492
+ /**
493
+ * @description Maximum databases per project.
494
+ * @type integer
495
+ */
496
+ max_databases: number;
497
+ /**
498
+ * @description Maximum concurrent connections per project.
499
+ * @type integer
500
+ */
501
+ max_connections: number;
502
+ /**
503
+ * @description Maximum queries per second per project.
504
+ * @type integer
505
+ */
506
+ queries_per_second: number;
507
+ /**
508
+ * @description Monthly data transfer quota in bytes. 0 means unlimited.
509
+ * @type integer, int64
510
+ */
511
+ bytes_per_month: number;
512
+ /**
513
+ * @description Maximum query shapes in cache rules. 0 means unlimited.
514
+ * @type integer
515
+ */
516
+ max_query_shapes: number;
517
+ /**
518
+ * @description Number of seats included in the plan.
519
+ * @type integer
520
+ */
521
+ included_seats: number;
522
+ };
523
+
524
+ /**
525
+ * Generated by Kubb (https://kubb.dev/).
526
+ * Do not edit manually.
527
+ */
528
+
529
+ /**
530
+ * @description Publicly visible plan metadata and limits.
531
+ */
532
+ type PlanInfo = {
533
+ /**
534
+ * @description Plan tier name (starter, pro, scale).
535
+ * @type string
536
+ */
537
+ name: string;
538
+ /**
539
+ * @description Display label for the plan.
540
+ * @type string
541
+ */
542
+ label: string;
543
+ /**
544
+ * @description Monthly price in dollars.
545
+ * @type integer
546
+ */
547
+ monthly_price: number;
548
+ /**
549
+ * @description Annual price in dollars (if applicable).
550
+ * @type integer | undefined
551
+ */
552
+ annual_price?: number;
553
+ /**
554
+ * @description Short description of the plan.
555
+ * @type string | undefined
556
+ */
557
+ description?: string;
558
+ /**
559
+ * @description Human-readable overage pricing text.
560
+ * @type string | undefined
561
+ */
562
+ overage_text?: string;
563
+ /**
564
+ * @description Number of trial days for new signups.
565
+ * @type integer | undefined
566
+ */
567
+ trial_days?: number;
568
+ /**
569
+ * @description Effective usage limits enforced for an organization plan.
570
+ * @type object
571
+ */
572
+ limits: PlanLimits;
573
+ };
574
+
575
+ /**
576
+ * Generated by Kubb (https://kubb.dev/).
577
+ * Do not edit manually.
578
+ */
579
+
580
+ /**
581
+ * @description Response envelope for listing available billing plans.
582
+ */
583
+ type ListPlansResponse = {
584
+ /**
585
+ * @description Billing plans available for self-serve signups.
586
+ * @type array
587
+ */
588
+ plans: PlanInfo[];
589
+ };
590
+
591
+ /**
592
+ * Generated by Kubb (https://kubb.dev/).
593
+ * Do not edit manually.
594
+ */
595
+
596
+ /**
597
+ * @description List of available plans.
598
+ */
599
+ type ListPlans200 = ListPlansResponse;
600
+ /**
601
+ * @description Missing or invalid authentication.
602
+ */
603
+ type ListPlans401 = Error$1;
604
+ /**
605
+ * @description Rate limited. Try again later.
606
+ */
607
+ type ListPlans429 = Error$1;
608
+ type ListPlansQueryResponse = ListPlans200;
609
+ type ListPlansQuery = {
610
+ Response: ListPlans200;
611
+ Errors: ListPlans401 | ListPlans429;
612
+ };
613
+
614
+ /**
615
+ * Generated by Kubb (https://kubb.dev/).
616
+ * Do not edit manually.
617
+ */
618
+
619
+ declare const organizationPlanPlanEnum: {
620
+ readonly starter: "starter";
621
+ readonly pro: "pro";
622
+ readonly scale: "scale";
623
+ readonly enterprise: "enterprise";
624
+ };
625
+ type OrganizationPlanPlanEnumKey = (typeof organizationPlanPlanEnum)[keyof typeof organizationPlanPlanEnum];
626
+ declare const organizationPlanBillingProviderEnum: {
627
+ readonly stripe: "stripe";
628
+ readonly vercel: "vercel";
629
+ readonly aws: "aws";
630
+ };
631
+ type OrganizationPlanBillingProviderEnumKey = (typeof organizationPlanBillingProviderEnum)[keyof typeof organizationPlanBillingProviderEnum];
632
+ declare const organizationPlanSubscriptionStatusEnum: {
633
+ readonly none: "none";
634
+ readonly active: "active";
635
+ readonly trialing: "trialing";
636
+ readonly past_due: "past_due";
637
+ readonly canceled: "canceled";
638
+ readonly unpaid: "unpaid";
639
+ readonly incomplete: "incomplete";
640
+ readonly incomplete_expired: "incomplete_expired";
641
+ readonly paused: "paused";
642
+ };
643
+ type OrganizationPlanSubscriptionStatusEnumKey = (typeof organizationPlanSubscriptionStatusEnum)[keyof typeof organizationPlanSubscriptionStatusEnum];
644
+ /**
645
+ * @description Billing state and plan limits for an organization.
646
+ */
647
+ type OrganizationPlan = {
648
+ /**
649
+ * @description Organization identifier the plan applies to.
650
+ * @type string
651
+ */
652
+ org_id: string;
653
+ /**
654
+ * @description Current plan tier.
655
+ * @type string
656
+ */
657
+ plan: OrganizationPlanPlanEnumKey;
658
+ /**
659
+ * @description Which billing provider manages this organization\'s subscription.
660
+ * @type string | undefined
661
+ */
662
+ billing_provider?: OrganizationPlanBillingProviderEnumKey;
663
+ /**
664
+ * @description Stripe subscription status.
665
+ * @type string | undefined
666
+ */
667
+ subscription_status?: OrganizationPlanSubscriptionStatusEnumKey;
668
+ /**
669
+ * @description End of current billing period.
670
+ * @type string | undefined, date-time
671
+ */
672
+ current_period_end?: string;
673
+ /**
674
+ * @description Whether the organization billing is active (false = suspended).
675
+ * @type boolean | undefined
676
+ */
677
+ enabled?: boolean;
678
+ /**
679
+ * @description Whether the organization has custom enterprise pricing.
680
+ * @type boolean | undefined
681
+ */
682
+ custom_pricing?: boolean;
683
+ /**
684
+ * @description Monthly spend limit in dollars. Null means no limit.
685
+ * @type number, double
686
+ */
687
+ spend_limit?: number | null;
688
+ /**
689
+ * @description Effective usage limits enforced for an organization plan.
690
+ * @type object
691
+ */
692
+ limits: PlanLimits;
693
+ /**
694
+ * @description When the billing record was created.
695
+ * @type string | undefined, date-time
696
+ */
697
+ created_at?: string;
698
+ /**
699
+ * @description When the billing record was last updated.
700
+ * @type string | undefined, date-time
701
+ */
702
+ updated_at?: string;
703
+ };
704
+
705
+ /**
706
+ * Generated by Kubb (https://kubb.dev/).
707
+ * Do not edit manually.
708
+ */
709
+
710
+ type GetOrganizationPlanPathParams = {
711
+ /**
712
+ * @description Unique organization identifier.
713
+ * @pattern ^[a-zA-Z0-9_.-]+$
714
+ * @type string
715
+ */
716
+ org_id: string;
717
+ };
718
+ /**
719
+ * @description Organization plan details.
720
+ */
721
+ type GetOrganizationPlan200 = OrganizationPlan;
722
+ /**
723
+ * @description Invalid request parameters.
724
+ */
725
+ type GetOrganizationPlan400 = Error$1;
726
+ /**
727
+ * @description Missing or invalid authentication.
728
+ */
729
+ type GetOrganizationPlan401 = Error$1;
730
+ /**
731
+ * @description Operation not allowed by current plan limits.
732
+ */
733
+ type GetOrganizationPlan403 = Error$1;
734
+ /**
735
+ * @description Rate limited. Try again later.
736
+ */
737
+ type GetOrganizationPlan429 = Error$1;
738
+ type GetOrganizationPlanQueryResponse = GetOrganizationPlan200;
739
+ type GetOrganizationPlanQuery = {
740
+ Response: GetOrganizationPlan200;
741
+ PathParams: GetOrganizationPlanPathParams;
742
+ Errors: GetOrganizationPlan400 | GetOrganizationPlan401 | GetOrganizationPlan403 | GetOrganizationPlan429;
743
+ };
744
+
745
+ /**
746
+ * Generated by Kubb (https://kubb.dev/).
747
+ * Do not edit manually.
748
+ */
749
+ /**
750
+ * @description Request body for updating an organization\'s monthly spend cap.
751
+ */
752
+ type UpdateSpendLimitRequest = {
753
+ /**
754
+ * @description Monthly spend limit in dollars. Null to remove the limit.
755
+ * @type number, double
756
+ */
757
+ spend_limit?: number | null;
758
+ };
759
+
760
+ /**
761
+ * Generated by Kubb (https://kubb.dev/).
762
+ * Do not edit manually.
763
+ */
764
+
765
+ type UpdateSpendLimitPathParams = {
766
+ /**
767
+ * @description Unique organization identifier.
768
+ * @pattern ^[a-zA-Z0-9_.-]+$
769
+ * @type string
770
+ */
771
+ org_id: string;
772
+ };
773
+ /**
774
+ * @description Spend limit updated.
775
+ */
776
+ type UpdateSpendLimit200 = OrganizationPlan;
777
+ /**
778
+ * @description Invalid request parameters.
779
+ */
780
+ type UpdateSpendLimit400 = Error$1;
781
+ /**
782
+ * @description Missing or invalid authentication.
783
+ */
784
+ type UpdateSpendLimit401 = Error$1;
785
+ /**
786
+ * @description Operation not allowed by current plan limits.
787
+ */
788
+ type UpdateSpendLimit403 = Error$1;
789
+ /**
790
+ * @description Rate limited. Try again later.
791
+ */
792
+ type UpdateSpendLimit429 = Error$1;
793
+ type UpdateSpendLimitMutationRequest = UpdateSpendLimitRequest;
794
+ type UpdateSpendLimitMutationResponse = UpdateSpendLimit200;
795
+ type UpdateSpendLimitMutation = {
796
+ Response: UpdateSpendLimit200;
797
+ Request: UpdateSpendLimitMutationRequest;
798
+ PathParams: UpdateSpendLimitPathParams;
799
+ Errors: UpdateSpendLimit400 | UpdateSpendLimit401 | UpdateSpendLimit403 | UpdateSpendLimit429;
800
+ };
801
+
802
+ /**
803
+ * Generated by Kubb (https://kubb.dev/).
804
+ * Do not edit manually.
805
+ */
806
+ /**
807
+ * @description Request body for capturing cancellation feedback from a user.
808
+ */
809
+ type CancellationFeedbackRequest = {
810
+ /**
811
+ * @description Predefined cancellation reason.
812
+ * @type string | undefined
813
+ */
814
+ reason?: string;
815
+ /**
816
+ * @description Free-text feedback from the user.
817
+ * @type string | undefined
818
+ */
819
+ feedback?: string;
820
+ };
821
+
822
+ /**
823
+ * Generated by Kubb (https://kubb.dev/).
824
+ * Do not edit manually.
825
+ */
826
+
827
+ type SubmitCancellationFeedbackPathParams = {
828
+ /**
829
+ * @description Unique organization identifier.
830
+ * @pattern ^[a-zA-Z0-9_.-]+$
831
+ * @type string
832
+ */
833
+ org_id: string;
834
+ };
835
+ /**
836
+ * @description Feedback recorded.
837
+ */
838
+ type SubmitCancellationFeedback204 = any;
839
+ /**
840
+ * @description Invalid request parameters.
841
+ */
842
+ type SubmitCancellationFeedback400 = Error$1;
843
+ /**
844
+ * @description Missing or invalid authentication.
845
+ */
846
+ type SubmitCancellationFeedback401 = Error$1;
847
+ /**
848
+ * @description Operation not allowed by current plan limits.
849
+ */
850
+ type SubmitCancellationFeedback403 = Error$1;
851
+ /**
852
+ * @description Rate limited. Try again later.
853
+ */
854
+ type SubmitCancellationFeedback429 = Error$1;
855
+ type SubmitCancellationFeedbackMutationRequest = CancellationFeedbackRequest;
856
+ type SubmitCancellationFeedbackMutationResponse = SubmitCancellationFeedback204;
857
+ type SubmitCancellationFeedbackMutation = {
858
+ Response: SubmitCancellationFeedback204;
859
+ Request: SubmitCancellationFeedbackMutationRequest;
860
+ PathParams: SubmitCancellationFeedbackPathParams;
861
+ Errors: SubmitCancellationFeedback400 | SubmitCancellationFeedback401 | SubmitCancellationFeedback403 | SubmitCancellationFeedback429;
862
+ };
863
+
864
+ /**
865
+ * Generated by Kubb (https://kubb.dev/).
866
+ * Do not edit manually.
867
+ */
868
+ declare const cacheRuleEntryQueryTypeEnum: {
869
+ readonly read: "read";
870
+ readonly write: "write";
871
+ readonly other: "other";
872
+ };
873
+ type CacheRuleEntryQueryTypeEnumKey = (typeof cacheRuleEntryQueryTypeEnum)[keyof typeof cacheRuleEntryQueryTypeEnum];
874
+ declare const cacheRuleEntryRecommendationEnum: {
875
+ readonly great: "great";
876
+ readonly good: "good";
877
+ readonly fair: "fair";
878
+ readonly poor: "poor";
879
+ };
880
+ type CacheRuleEntryRecommendationEnumKey = (typeof cacheRuleEntryRecommendationEnum)[keyof typeof cacheRuleEntryRecommendationEnum];
881
+ /**
882
+ * @description Observed query shape and its cache recommendation for a database.
883
+ */
884
+ type CacheRuleEntry = {
885
+ /**
886
+ * @description xxhash64 hex of the normalized SQL.
887
+ * @type string
888
+ */
889
+ query_hash: string;
890
+ /**
891
+ * @description SQL with literals replaced by $N placeholders.
892
+ * @type string
893
+ */
894
+ normalized_sql: string;
895
+ /**
896
+ * @description Query classification.
897
+ * @type string
898
+ */
899
+ query_type: CacheRuleEntryQueryTypeEnumKey;
900
+ /**
901
+ * @description Whether caching is enabled for this query shape.
902
+ * @type boolean
903
+ */
904
+ cache_enabled: boolean;
905
+ /**
906
+ * @description TTL override in seconds. Null means use project default.
907
+ * @minLength 0
908
+ * @type integer
909
+ */
910
+ cache_ttl_seconds?: number | null;
911
+ /**
912
+ * @description SWR override in seconds. Null means use project default.
913
+ * @minLength 0
914
+ * @type integer
915
+ */
916
+ cache_swr_seconds?: number | null;
917
+ /**
918
+ * @description Total number of executions observed.
919
+ * @type integer, int64
920
+ */
921
+ call_count: number;
922
+ /**
923
+ * @description Average query latency in milliseconds.
924
+ * @type number, double
925
+ */
926
+ avg_latency_ms: number;
927
+ /**
928
+ * @description 95th percentile latency in milliseconds.
929
+ * @type number, double
930
+ */
931
+ p95_latency_ms: number;
932
+ /**
933
+ * @description Average response size in bytes.
934
+ * @type integer, int64
935
+ */
936
+ avg_response_bytes: number;
937
+ /**
938
+ * @description Response stability rate (0.0 to 1.0). Higher means more stable.
939
+ * @type number, double
940
+ */
941
+ stability_rate: number;
942
+ /**
943
+ * @description Cache recommendation based on frequency, latency, and stability.
944
+ * @type string
945
+ */
946
+ recommendation: CacheRuleEntryRecommendationEnumKey;
947
+ /**
948
+ * @description When this query was first observed.
949
+ * @type string, date-time
950
+ */
951
+ first_seen_at: string;
952
+ /**
953
+ * @description When this query was last observed.
954
+ * @type string, date-time
955
+ */
956
+ last_seen_at: string;
957
+ };
958
+
959
+ /**
960
+ * Generated by Kubb (https://kubb.dev/).
961
+ * Do not edit manually.
962
+ */
963
+
964
+ /**
965
+ * @description Cursor-paginated cache-rule entries for a database.
966
+ */
967
+ type ListCacheRulesResponse = {
968
+ /**
969
+ * @description Query shapes returned for the current page.
970
+ * @type array
971
+ */
972
+ entries: CacheRuleEntry[];
973
+ /**
974
+ * @description Opaque token for cursor-based pagination.
975
+ * @type string | undefined
976
+ */
977
+ next_page_token?: string;
978
+ };
979
+
980
+ /**
981
+ * Generated by Kubb (https://kubb.dev/).
982
+ * Do not edit manually.
983
+ */
984
+
985
+ type ListCacheRulesPathParams = {
986
+ /**
987
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
988
+ * @pattern ^[a-zA-Z0-9_.-]+$
989
+ * @type string
990
+ */
991
+ project_id: string;
992
+ /**
993
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
994
+ * @pattern ^[a-zA-Z0-9_.-]+$
995
+ * @type string
996
+ */
997
+ database_id: string;
998
+ };
999
+ type ListCacheRulesQueryParams = {
1000
+ /**
1001
+ * @description Maximum number of items to return (1-100, default 20).
1002
+ * @minLength 1
1003
+ * @maxLength 100
1004
+ * @default 20
1005
+ * @type integer | undefined
1006
+ */
1007
+ page_size?: number;
1008
+ /**
1009
+ * @description Opaque token for cursor-based pagination.
1010
+ * @pattern ^[a-zA-Z0-9_.-]+$
1011
+ * @type string | undefined
1012
+ */
1013
+ page_token?: string;
1014
+ };
1015
+ /**
1016
+ * @description Cache rule entries.
1017
+ */
1018
+ type ListCacheRules200 = ListCacheRulesResponse;
1019
+ /**
1020
+ * @description Invalid request parameters.
1021
+ */
1022
+ type ListCacheRules400 = Error$1;
1023
+ /**
1024
+ * @description Missing or invalid authentication.
1025
+ */
1026
+ type ListCacheRules401 = Error$1;
1027
+ /**
1028
+ * @description Operation not allowed by current plan limits.
1029
+ */
1030
+ type ListCacheRules403 = Error$1;
1031
+ /**
1032
+ * @description Resource not found.
1033
+ */
1034
+ type ListCacheRules404 = Error$1;
1035
+ /**
1036
+ * @description Rate limited. Try again later.
1037
+ */
1038
+ type ListCacheRules429 = Error$1;
1039
+ type ListCacheRulesQueryResponse = ListCacheRules200;
1040
+ type ListCacheRulesQuery = {
1041
+ Response: ListCacheRules200;
1042
+ PathParams: ListCacheRulesPathParams;
1043
+ QueryParams: ListCacheRulesQueryParams;
1044
+ Errors: ListCacheRules400 | ListCacheRules401 | ListCacheRules403 | ListCacheRules404 | ListCacheRules429;
1045
+ };
1046
+
1047
+ /**
1048
+ * Generated by Kubb (https://kubb.dev/).
1049
+ * Do not edit manually.
1050
+ */
1051
+ /**
1052
+ * @description Request body for updating cache behavior of a query shape.
1053
+ */
1054
+ type UpdateCacheRuleRequest = {
1055
+ /**
1056
+ * @description Whether to enable caching for this query shape.
1057
+ * @type boolean
1058
+ */
1059
+ cache_enabled: boolean;
1060
+ /**
1061
+ * @description TTL override in seconds. Null to use project default.
1062
+ * @minLength 0
1063
+ * @maxLength 86400
1064
+ * @type integer
1065
+ */
1066
+ cache_ttl_seconds?: number | null;
1067
+ /**
1068
+ * @description SWR override in seconds. Null to use project default.
1069
+ * @minLength 0
1070
+ * @maxLength 86400
1071
+ * @type integer
1072
+ */
1073
+ cache_swr_seconds?: number | null;
1074
+ };
1075
+
1076
+ /**
1077
+ * Generated by Kubb (https://kubb.dev/).
1078
+ * Do not edit manually.
1079
+ */
1080
+
1081
+ /**
1082
+ * @description Response returned after updating a cache rule.
1083
+ */
1084
+ type UpdateCacheRuleResponse = {
1085
+ /**
1086
+ * @description Observed query shape and its cache recommendation for a database.
1087
+ * @type object
1088
+ */
1089
+ entry: CacheRuleEntry;
1090
+ };
1091
+
1092
+ /**
1093
+ * Generated by Kubb (https://kubb.dev/).
1094
+ * Do not edit manually.
1095
+ */
1096
+
1097
+ type UpdateCacheRulePathParams = {
1098
+ /**
1099
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1100
+ * @pattern ^[a-zA-Z0-9_.-]+$
1101
+ * @type string
1102
+ */
1103
+ project_id: string;
1104
+ /**
1105
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
1106
+ * @pattern ^[a-zA-Z0-9_.-]+$
1107
+ * @type string
1108
+ */
1109
+ database_id: string;
1110
+ /**
1111
+ * @description xxhash64 hex of the normalized SQL.
1112
+ * @minLength 16
1113
+ * @maxLength 16
1114
+ * @pattern ^[a-f0-9]+$
1115
+ * @type string
1116
+ */
1117
+ query_hash: string;
1118
+ };
1119
+ /**
1120
+ * @description Cache rule updated.
1121
+ */
1122
+ type UpdateCacheRule200 = UpdateCacheRuleResponse;
1123
+ /**
1124
+ * @description Invalid request parameters.
1125
+ */
1126
+ type UpdateCacheRule400 = Error$1;
1127
+ /**
1128
+ * @description Missing or invalid authentication.
1129
+ */
1130
+ type UpdateCacheRule401 = Error$1;
1131
+ /**
1132
+ * @description Operation not allowed by current plan limits.
1133
+ */
1134
+ type UpdateCacheRule403 = Error$1;
1135
+ /**
1136
+ * @description Resource not found.
1137
+ */
1138
+ type UpdateCacheRule404 = Error$1;
1139
+ /**
1140
+ * @description Rate limited. Try again later.
1141
+ */
1142
+ type UpdateCacheRule429 = Error$1;
1143
+ type UpdateCacheRuleMutationRequest = UpdateCacheRuleRequest;
1144
+ type UpdateCacheRuleMutationResponse = UpdateCacheRule200;
1145
+ type UpdateCacheRuleMutation = {
1146
+ Response: UpdateCacheRule200;
1147
+ Request: UpdateCacheRuleMutationRequest;
1148
+ PathParams: UpdateCacheRulePathParams;
1149
+ Errors: UpdateCacheRule400 | UpdateCacheRule401 | UpdateCacheRule403 | UpdateCacheRule404 | UpdateCacheRule429;
1150
+ };
1151
+
1152
+ /**
1153
+ * Generated by Kubb (https://kubb.dev/).
1154
+ * Do not edit manually.
1155
+ */
1156
+ /**
1157
+ * @description Query cache configuration.
1158
+ */
1159
+ type CacheConfig = {
1160
+ /**
1161
+ * @description Whether query caching is enabled. When false, all queries bypass the cache.
1162
+ * @default true
1163
+ * @type boolean
1164
+ */
1165
+ enabled: boolean;
1166
+ /**
1167
+ * @description Cache TTL in seconds for query results.
1168
+ * @minLength 0
1169
+ * @maxLength 86400
1170
+ * @default 60
1171
+ * @type integer
1172
+ */
1173
+ ttl_seconds: number;
1174
+ /**
1175
+ * @description Maximum number of cached query results.
1176
+ * @minLength 0
1177
+ * @maxLength 1000000
1178
+ * @default 10000
1179
+ * @type integer
1180
+ */
1181
+ max_entries: number;
1182
+ /**
1183
+ * @description Stale-while-revalidate window in seconds.
1184
+ * @minLength 0
1185
+ * @maxLength 86400
1186
+ * @default 30
1187
+ * @type integer
1188
+ */
1189
+ swr_seconds: number;
1190
+ };
1191
+
1192
+ /**
1193
+ * Generated by Kubb (https://kubb.dev/).
1194
+ * Do not edit manually.
1195
+ */
1196
+ declare const databaseRoleEnum: {
1197
+ readonly primary: "primary";
1198
+ readonly replica: "replica";
1199
+ };
1200
+ type DatabaseRoleEnumKey = (typeof databaseRoleEnum)[keyof typeof databaseRoleEnum];
1201
+ /**
1202
+ * @description Database role. Primary receives writes, replicas receive reads.
1203
+ * @default primary
1204
+ */
1205
+ type DatabaseRole = DatabaseRoleEnumKey;
1206
+
1207
+ /**
1208
+ * Generated by Kubb (https://kubb.dev/).
1209
+ * Do not edit manually.
1210
+ */
1211
+ declare const poolModeEnum: {
1212
+ readonly session: "session";
1213
+ readonly transaction: "transaction";
1214
+ readonly statement: "statement";
1215
+ };
1216
+ type PoolModeEnumKey = (typeof poolModeEnum)[keyof typeof poolModeEnum];
1217
+ /**
1218
+ * @description Connection pool mode.
1219
+ */
1220
+ type PoolMode = PoolModeEnumKey;
1221
+
1222
+ /**
1223
+ * Generated by Kubb (https://kubb.dev/).
1224
+ * Do not edit manually.
1225
+ */
1226
+
1227
+ /**
1228
+ * @description Connection pool configuration.
1229
+ */
1230
+ type PoolConfig = {
1231
+ /**
1232
+ * @description Maximum connections in the pool.
1233
+ * @minLength 1
1234
+ * @maxLength 10000
1235
+ * @default 10
1236
+ * @type integer
1237
+ */
1238
+ pool_size: number;
1239
+ /**
1240
+ * @description Minimum idle connections maintained.
1241
+ * @minLength 1
1242
+ * @maxLength 10000
1243
+ * @default 1
1244
+ * @type integer
1245
+ */
1246
+ min_pool_size: number;
1247
+ /**
1248
+ * @description Connection pool mode.
1249
+ * @type string
1250
+ */
1251
+ pool_mode: PoolMode;
1252
+ /**
1253
+ * @description Maximum concurrent upstream connections per pool.
1254
+ * @minLength 1
1255
+ * @maxLength 10000
1256
+ * @default 200
1257
+ * @type integer | undefined
1258
+ */
1259
+ max_active?: number;
1260
+ };
1261
+
1262
+ /**
1263
+ * Generated by Kubb (https://kubb.dev/).
1264
+ * Do not edit manually.
1265
+ */
1266
+ declare const SSLModeEnum: {
1267
+ readonly disable: "disable";
1268
+ readonly allow: "allow";
1269
+ readonly prefer: "prefer";
1270
+ readonly require: "require";
1271
+ readonly "verify-ca": "verify-ca";
1272
+ readonly "verify-full": "verify-full";
1273
+ };
1274
+ type SSLModeEnumKey = (typeof SSLModeEnum)[keyof typeof SSLModeEnum];
1275
+ /**
1276
+ * @description PostgreSQL SSL connection mode.
1277
+ */
1278
+ type SSLMode = SSLModeEnumKey;
1279
+
1280
+ /**
1281
+ * Generated by Kubb (https://kubb.dev/).
1282
+ * Do not edit manually.
1283
+ */
1284
+
1285
+ /**
1286
+ * @description Registered upstream PostgreSQL database for a project.
1287
+ */
1288
+ type Database = {
1289
+ /**
1290
+ * @description Unique database identifier (prefixed).
1291
+ * @type string
1292
+ */
1293
+ id: string;
1294
+ /**
1295
+ * @description Owning project ID.
1296
+ * @type string
1297
+ */
1298
+ project_id: string;
1299
+ /**
1300
+ * @description Connection string for connecting through PgBeam proxy. Password is replaced with a placeholder.
1301
+ * @type string | undefined
1302
+ */
1303
+ readonly connection_string?: string;
1304
+ /**
1305
+ * @description PostgreSQL host.
1306
+ * @type string
1307
+ */
1308
+ host: string;
1309
+ /**
1310
+ * @description PostgreSQL port.
1311
+ * @minLength 1
1312
+ * @maxLength 65535
1313
+ * @type integer
1314
+ */
1315
+ port: number;
1316
+ /**
1317
+ * @description PostgreSQL database name.
1318
+ * @type string
1319
+ */
1320
+ name: string;
1321
+ /**
1322
+ * @description PostgreSQL username.
1323
+ * @type string
1324
+ */
1325
+ username: string;
1326
+ /**
1327
+ * @description PostgreSQL SSL connection mode.
1328
+ * @type string
1329
+ */
1330
+ ssl_mode: SSLMode;
1331
+ /**
1332
+ * @description Database role. Primary receives writes, replicas receive reads.
1333
+ * @default "primary"
1334
+ * @type string | undefined
1335
+ */
1336
+ role?: DatabaseRole;
1337
+ /**
1338
+ * @description Region where the connection pool is maintained (near the database). When set and different from the client\'s edge region, queries are relayed through the pool region\'s data plane. Empty means direct connection.\n
1339
+ * @type string | undefined
1340
+ */
1341
+ pool_region?: string;
1342
+ /**
1343
+ * @description Query cache configuration.
1344
+ * @type object
1345
+ */
1346
+ cache_config: CacheConfig;
1347
+ /**
1348
+ * @description Connection pool configuration.
1349
+ * @type object
1350
+ */
1351
+ pool_config: PoolConfig;
1352
+ /**
1353
+ * @description When the database registration was created.
1354
+ * @type string, date-time
1355
+ */
1356
+ created_at: string;
1357
+ /**
1358
+ * @description When the database registration was last updated.
1359
+ * @type string, date-time
1360
+ */
1361
+ updated_at: string;
1362
+ };
1363
+
1364
+ /**
1365
+ * Generated by Kubb (https://kubb.dev/).
1366
+ * Do not edit manually.
1367
+ */
1368
+
1369
+ /**
1370
+ * @description Cursor-paginated list of databases attached to a project.
1371
+ */
1372
+ type ListDatabasesResponse = {
1373
+ /**
1374
+ * @description Databases on the current page.
1375
+ * @type array
1376
+ */
1377
+ databases: Database[];
1378
+ /**
1379
+ * @description Token for the next page. Empty if no more results.
1380
+ * @type string | undefined
1381
+ */
1382
+ next_page_token?: string;
1383
+ };
1384
+
1385
+ /**
1386
+ * Generated by Kubb (https://kubb.dev/).
1387
+ * Do not edit manually.
1388
+ */
1389
+
1390
+ type ListDatabasesPathParams = {
1391
+ /**
1392
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1393
+ * @pattern ^[a-zA-Z0-9_.-]+$
1394
+ * @type string
1395
+ */
1396
+ project_id: string;
1397
+ };
1398
+ type ListDatabasesQueryParams = {
1399
+ /**
1400
+ * @description Maximum number of items to return (1-100, default 20).
1401
+ * @minLength 1
1402
+ * @maxLength 100
1403
+ * @default 20
1404
+ * @type integer | undefined
1405
+ */
1406
+ page_size?: number;
1407
+ /**
1408
+ * @description Opaque token for cursor-based pagination.
1409
+ * @pattern ^[a-zA-Z0-9_.-]+$
1410
+ * @type string | undefined
1411
+ */
1412
+ page_token?: string;
1413
+ };
1414
+ /**
1415
+ * @description List of databases.
1416
+ */
1417
+ type ListDatabases200 = ListDatabasesResponse;
1418
+ /**
1419
+ * @description Invalid request parameters.
1420
+ */
1421
+ type ListDatabases400 = Error$1;
1422
+ /**
1423
+ * @description Missing or invalid authentication.
1424
+ */
1425
+ type ListDatabases401 = Error$1;
1426
+ /**
1427
+ * @description Operation not allowed by current plan limits.
1428
+ */
1429
+ type ListDatabases403 = Error$1;
1430
+ /**
1431
+ * @description Resource not found.
1432
+ */
1433
+ type ListDatabases404 = Error$1;
1434
+ /**
1435
+ * @description Rate limited. Try again later.
1436
+ */
1437
+ type ListDatabases429 = Error$1;
1438
+ type ListDatabasesQueryResponse = ListDatabases200;
1439
+ type ListDatabasesQuery = {
1440
+ Response: ListDatabases200;
1441
+ PathParams: ListDatabasesPathParams;
1442
+ QueryParams: ListDatabasesQueryParams;
1443
+ Errors: ListDatabases400 | ListDatabases401 | ListDatabases403 | ListDatabases404 | ListDatabases429;
1444
+ };
1445
+
1446
+ /**
1447
+ * Generated by Kubb (https://kubb.dev/).
1448
+ * Do not edit manually.
1449
+ */
1450
+
1451
+ /**
1452
+ * @description Request body for registering an upstream database.
1453
+ */
1454
+ type CreateDatabaseRequest = {
1455
+ /**
1456
+ * @description PostgreSQL host.
1457
+ * @minLength 1
1458
+ * @pattern ^[^\s\x00]+$
1459
+ * @type string
1460
+ */
1461
+ host: string;
1462
+ /**
1463
+ * @description PostgreSQL port.
1464
+ * @minLength 1
1465
+ * @maxLength 65535
1466
+ * @type integer
1467
+ */
1468
+ port: number;
1469
+ /**
1470
+ * @description PostgreSQL database name.
1471
+ * @minLength 1
1472
+ * @pattern ^[^\x00]+$
1473
+ * @type string
1474
+ */
1475
+ name: string;
1476
+ /**
1477
+ * @description PostgreSQL username.
1478
+ * @minLength 1
1479
+ * @pattern ^[^\x00]+$
1480
+ * @type string
1481
+ */
1482
+ username: string;
1483
+ /**
1484
+ * @description PostgreSQL password. Stored encrypted at rest.
1485
+ * @minLength 1
1486
+ * @pattern ^[^\x00]+$
1487
+ * @type string, password
1488
+ */
1489
+ password: string;
1490
+ /**
1491
+ * @description PostgreSQL SSL connection mode.
1492
+ * @type string | undefined
1493
+ */
1494
+ ssl_mode?: SSLMode;
1495
+ /**
1496
+ * @description Database role. Primary receives writes, replicas receive reads.
1497
+ * @default "primary"
1498
+ * @type string | undefined
1499
+ */
1500
+ role?: DatabaseRole;
1501
+ /**
1502
+ * @description Region where the connection pool is maintained (near the database). When set and different from the client\'s edge region, queries are relayed through the pool region\'s data plane. Empty means direct connection.\n
1503
+ * @type string | undefined
1504
+ */
1505
+ pool_region?: string;
1506
+ /**
1507
+ * @description Query cache configuration.
1508
+ * @type object | undefined
1509
+ */
1510
+ cache_config?: CacheConfig;
1511
+ /**
1512
+ * @description Connection pool configuration.
1513
+ * @type object | undefined
1514
+ */
1515
+ pool_config?: PoolConfig;
1516
+ };
1517
+
1518
+ /**
1519
+ * Generated by Kubb (https://kubb.dev/).
1520
+ * Do not edit manually.
1521
+ */
1522
+
1523
+ type CreateDatabasePathParams = {
1524
+ /**
1525
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1526
+ * @pattern ^[a-zA-Z0-9_.-]+$
1527
+ * @type string
1528
+ */
1529
+ project_id: string;
1530
+ };
1531
+ /**
1532
+ * @description Database created.
1533
+ */
1534
+ type CreateDatabase201 = Database;
1535
+ /**
1536
+ * @description Invalid request parameters.
1537
+ */
1538
+ type CreateDatabase400 = Error$1;
1539
+ /**
1540
+ * @description Missing or invalid authentication.
1541
+ */
1542
+ type CreateDatabase401 = Error$1;
1543
+ /**
1544
+ * @description Operation not allowed by current plan limits.
1545
+ */
1546
+ type CreateDatabase403 = Error$1;
1547
+ /**
1548
+ * @description Resource not found.
1549
+ */
1550
+ type CreateDatabase404 = Error$1;
1551
+ /**
1552
+ * @description Rate limited. Try again later.
1553
+ */
1554
+ type CreateDatabase429 = Error$1;
1555
+ type CreateDatabaseMutationRequest = CreateDatabaseRequest;
1556
+ type CreateDatabaseMutationResponse = CreateDatabase201;
1557
+ type CreateDatabaseMutation = {
1558
+ Response: CreateDatabase201;
1559
+ Request: CreateDatabaseMutationRequest;
1560
+ PathParams: CreateDatabasePathParams;
1561
+ Errors: CreateDatabase400 | CreateDatabase401 | CreateDatabase403 | CreateDatabase404 | CreateDatabase429;
1562
+ };
1563
+
1564
+ /**
1565
+ * Generated by Kubb (https://kubb.dev/).
1566
+ * Do not edit manually.
1567
+ */
1568
+
1569
+ type GetDatabasePathParams = {
1570
+ /**
1571
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1572
+ * @pattern ^[a-zA-Z0-9_.-]+$
1573
+ * @type string
1574
+ */
1575
+ project_id: string;
1576
+ /**
1577
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
1578
+ * @pattern ^[a-zA-Z0-9_.-]+$
1579
+ * @type string
1580
+ */
1581
+ database_id: string;
1582
+ };
1583
+ /**
1584
+ * @description Database found.
1585
+ */
1586
+ type GetDatabase200 = Database;
1587
+ /**
1588
+ * @description Invalid request parameters.
1589
+ */
1590
+ type GetDatabase400 = Error$1;
1591
+ /**
1592
+ * @description Missing or invalid authentication.
1593
+ */
1594
+ type GetDatabase401 = Error$1;
1595
+ /**
1596
+ * @description Operation not allowed by current plan limits.
1597
+ */
1598
+ type GetDatabase403 = Error$1;
1599
+ /**
1600
+ * @description Resource not found.
1601
+ */
1602
+ type GetDatabase404 = Error$1;
1603
+ /**
1604
+ * @description Rate limited. Try again later.
1605
+ */
1606
+ type GetDatabase429 = Error$1;
1607
+ type GetDatabaseQueryResponse = GetDatabase200;
1608
+ type GetDatabaseQuery = {
1609
+ Response: GetDatabase200;
1610
+ PathParams: GetDatabasePathParams;
1611
+ Errors: GetDatabase400 | GetDatabase401 | GetDatabase403 | GetDatabase404 | GetDatabase429;
1612
+ };
1613
+
1614
+ /**
1615
+ * Generated by Kubb (https://kubb.dev/).
1616
+ * Do not edit manually.
1617
+ */
1618
+
1619
+ /**
1620
+ * @description Request body for partially updating an upstream database.
1621
+ */
1622
+ type UpdateDatabaseRequest = {
1623
+ /**
1624
+ * @description Updated PostgreSQL host.
1625
+ * @minLength 1
1626
+ * @pattern ^[^\x00]+$
1627
+ * @type string | undefined
1628
+ */
1629
+ host?: string;
1630
+ /**
1631
+ * @description Updated PostgreSQL port.
1632
+ * @minLength 1
1633
+ * @maxLength 65535
1634
+ * @type integer | undefined
1635
+ */
1636
+ port?: number;
1637
+ /**
1638
+ * @description Updated PostgreSQL database name.
1639
+ * @pattern ^[^\x00]*$
1640
+ * @type string | undefined
1641
+ */
1642
+ name?: string;
1643
+ /**
1644
+ * @description Updated PostgreSQL username.
1645
+ * @pattern ^[^\x00]*$
1646
+ * @type string | undefined
1647
+ */
1648
+ username?: string;
1649
+ /**
1650
+ * @description Updated PostgreSQL password.
1651
+ * @pattern ^[^\x00]*$
1652
+ * @type string | undefined, password
1653
+ */
1654
+ password?: string;
1655
+ /**
1656
+ * @description PostgreSQL SSL connection mode.
1657
+ * @type string | undefined
1658
+ */
1659
+ ssl_mode?: SSLMode;
1660
+ /**
1661
+ * @description Database role. Primary receives writes, replicas receive reads.
1662
+ * @default "primary"
1663
+ * @type string | undefined
1664
+ */
1665
+ role?: DatabaseRole;
1666
+ /**
1667
+ * @description Region where the connection pool is maintained (near the database). When set and different from the client\'s edge region, queries are relayed through the pool region\'s data plane. Empty means direct connection.\n
1668
+ * @type string | undefined
1669
+ */
1670
+ pool_region?: string;
1671
+ /**
1672
+ * @description Query cache configuration.
1673
+ * @type object | undefined
1674
+ */
1675
+ cache_config?: CacheConfig;
1676
+ /**
1677
+ * @description Connection pool configuration.
1678
+ * @type object | undefined
1679
+ */
1680
+ pool_config?: PoolConfig;
1681
+ };
1682
+
1683
+ /**
1684
+ * Generated by Kubb (https://kubb.dev/).
1685
+ * Do not edit manually.
1686
+ */
1687
+
1688
+ type UpdateDatabasePathParams = {
1689
+ /**
1690
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1691
+ * @pattern ^[a-zA-Z0-9_.-]+$
1692
+ * @type string
1693
+ */
1694
+ project_id: string;
1695
+ /**
1696
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
1697
+ * @pattern ^[a-zA-Z0-9_.-]+$
1698
+ * @type string
1699
+ */
1700
+ database_id: string;
1701
+ };
1702
+ /**
1703
+ * @description Database updated.
1704
+ */
1705
+ type UpdateDatabase200 = Database;
1706
+ /**
1707
+ * @description Invalid request parameters.
1708
+ */
1709
+ type UpdateDatabase400 = Error$1;
1710
+ /**
1711
+ * @description Missing or invalid authentication.
1712
+ */
1713
+ type UpdateDatabase401 = Error$1;
1714
+ /**
1715
+ * @description Operation not allowed by current plan limits.
1716
+ */
1717
+ type UpdateDatabase403 = Error$1;
1718
+ /**
1719
+ * @description Resource not found.
1720
+ */
1721
+ type UpdateDatabase404 = Error$1;
1722
+ /**
1723
+ * @description Rate limited. Try again later.
1724
+ */
1725
+ type UpdateDatabase429 = Error$1;
1726
+ type UpdateDatabaseMutationRequest = UpdateDatabaseRequest;
1727
+ type UpdateDatabaseMutationResponse = UpdateDatabase200;
1728
+ type UpdateDatabaseMutation = {
1729
+ Response: UpdateDatabase200;
1730
+ Request: UpdateDatabaseMutationRequest;
1731
+ PathParams: UpdateDatabasePathParams;
1732
+ Errors: UpdateDatabase400 | UpdateDatabase401 | UpdateDatabase403 | UpdateDatabase404 | UpdateDatabase429;
1733
+ };
1734
+
1735
+ /**
1736
+ * Generated by Kubb (https://kubb.dev/).
1737
+ * Do not edit manually.
1738
+ */
1739
+
1740
+ type DeleteDatabasePathParams = {
1741
+ /**
1742
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1743
+ * @pattern ^[a-zA-Z0-9_.-]+$
1744
+ * @type string
1745
+ */
1746
+ project_id: string;
1747
+ /**
1748
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
1749
+ * @pattern ^[a-zA-Z0-9_.-]+$
1750
+ * @type string
1751
+ */
1752
+ database_id: string;
1753
+ };
1754
+ /**
1755
+ * @description Database deleted.
1756
+ */
1757
+ type DeleteDatabase204 = any;
1758
+ /**
1759
+ * @description Invalid request parameters.
1760
+ */
1761
+ type DeleteDatabase400 = Error$1;
1762
+ /**
1763
+ * @description Missing or invalid authentication.
1764
+ */
1765
+ type DeleteDatabase401 = Error$1;
1766
+ /**
1767
+ * @description Operation not allowed by current plan limits.
1768
+ */
1769
+ type DeleteDatabase403 = Error$1;
1770
+ /**
1771
+ * @description Resource not found.
1772
+ */
1773
+ type DeleteDatabase404 = Error$1;
1774
+ /**
1775
+ * @description Rate limited. Try again later.
1776
+ */
1777
+ type DeleteDatabase429 = Error$1;
1778
+ type DeleteDatabaseMutationResponse = DeleteDatabase204;
1779
+ type DeleteDatabaseMutation = {
1780
+ Response: DeleteDatabase204;
1781
+ PathParams: DeleteDatabasePathParams;
1782
+ Errors: DeleteDatabase400 | DeleteDatabase401 | DeleteDatabase403 | DeleteDatabase404 | DeleteDatabase429;
1783
+ };
1784
+
1785
+ /**
1786
+ * Generated by Kubb (https://kubb.dev/).
1787
+ * Do not edit manually.
1788
+ */
1789
+ /**
1790
+ * @description Result of testing connectivity to an upstream database.
1791
+ */
1792
+ type TestConnectionResult = {
1793
+ /**
1794
+ * @description Whether the connection test succeeded.
1795
+ * @type boolean
1796
+ */
1797
+ ok: boolean;
1798
+ /**
1799
+ * @description Round-trip connection time in milliseconds.
1800
+ * @type number
1801
+ */
1802
+ latency_ms?: number | null;
1803
+ /**
1804
+ * @description Error message if the connection test failed.
1805
+ * @type string | undefined
1806
+ */
1807
+ error?: string;
1808
+ /**
1809
+ * @description PostgreSQL server version string, if available.
1810
+ * @type string | undefined
1811
+ */
1812
+ server_version?: string;
1813
+ };
1814
+
1815
+ /**
1816
+ * Generated by Kubb (https://kubb.dev/).
1817
+ * Do not edit manually.
1818
+ */
1819
+
1820
+ type TestDatabaseConnectionPathParams = {
1821
+ /**
1822
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1823
+ * @pattern ^[a-zA-Z0-9_.-]+$
1824
+ * @type string
1825
+ */
1826
+ project_id: string;
1827
+ /**
1828
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
1829
+ * @pattern ^[a-zA-Z0-9_.-]+$
1830
+ * @type string
1831
+ */
1832
+ database_id: string;
1833
+ };
1834
+ /**
1835
+ * @description Connection test result.
1836
+ */
1837
+ type TestDatabaseConnection200 = TestConnectionResult;
1838
+ /**
1839
+ * @description Invalid request parameters.
1840
+ */
1841
+ type TestDatabaseConnection400 = Error$1;
1842
+ /**
1843
+ * @description Missing or invalid authentication.
1844
+ */
1845
+ type TestDatabaseConnection401 = Error$1;
1846
+ /**
1847
+ * @description Operation not allowed by current plan limits.
1848
+ */
1849
+ type TestDatabaseConnection403 = Error$1;
1850
+ /**
1851
+ * @description Resource not found.
1852
+ */
1853
+ type TestDatabaseConnection404 = Error$1;
1854
+ /**
1855
+ * @description Rate limited. Try again later.
1856
+ */
1857
+ type TestDatabaseConnection429 = Error$1;
1858
+ type TestDatabaseConnectionMutationResponse = TestDatabaseConnection200;
1859
+ type TestDatabaseConnectionMutation = {
1860
+ Response: TestDatabaseConnection200;
1861
+ PathParams: TestDatabaseConnectionPathParams;
1862
+ Errors: TestDatabaseConnection400 | TestDatabaseConnection401 | TestDatabaseConnection403 | TestDatabaseConnection404 | TestDatabaseConnection429;
1863
+ };
1864
+
1865
+ /**
1866
+ * Generated by Kubb (https://kubb.dev/).
1867
+ * Do not edit manually.
1868
+ */
1869
+ /**
1870
+ * @description Custom database hostname attached to a project.
1871
+ */
1872
+ type CustomDomain = {
1873
+ /**
1874
+ * @description Unique domain identifier (prefixed).
1875
+ * @type string
1876
+ */
1877
+ id: string;
1878
+ /**
1879
+ * @description Owning project ID.
1880
+ * @type string
1881
+ */
1882
+ project_id: string;
1883
+ /**
1884
+ * @description The custom domain name.
1885
+ * @type string
1886
+ */
1887
+ domain: string;
1888
+ /**
1889
+ * @description Whether DNS ownership has been verified.
1890
+ * @type boolean
1891
+ */
1892
+ verified: boolean;
1893
+ /**
1894
+ * @description When DNS verification was completed.
1895
+ * @type string, date-time
1896
+ */
1897
+ verified_at?: string | null;
1898
+ /**
1899
+ * @description When the TLS certificate expires.
1900
+ * @type string, date-time
1901
+ */
1902
+ tls_cert_expiry?: string | null;
1903
+ /**
1904
+ * @description Token value for the DNS TXT record verification.
1905
+ * @type string
1906
+ */
1907
+ dns_verification_token: string;
1908
+ /**
1909
+ * @description DNS records the user needs to create.
1910
+ * @type object | undefined
1911
+ */
1912
+ dns_instructions?: {
1913
+ /**
1914
+ * @description The CNAME record host.
1915
+ * @type string | undefined
1916
+ */
1917
+ cname_host?: string;
1918
+ /**
1919
+ * @description The CNAME record target.
1920
+ * @type string | undefined
1921
+ */
1922
+ cname_target?: string;
1923
+ /**
1924
+ * @description The TXT record host for verification.
1925
+ * @type string | undefined
1926
+ */
1927
+ txt_host?: string;
1928
+ /**
1929
+ * @description The TXT record value for verification.
1930
+ * @type string | undefined
1931
+ */
1932
+ txt_value?: string;
1933
+ /**
1934
+ * @description The CNAME record host for ACME TLS certificate issuance.
1935
+ * @type string | undefined
1936
+ */
1937
+ acme_cname_host?: string;
1938
+ /**
1939
+ * @description The CNAME target for ACME challenge delegation.
1940
+ * @type string | undefined
1941
+ */
1942
+ acme_cname_target?: string;
1943
+ };
1944
+ /**
1945
+ * @description When the custom domain was created.
1946
+ * @type string, date-time
1947
+ */
1948
+ created_at: string;
1949
+ /**
1950
+ * @description When the custom domain was last updated.
1951
+ * @type string, date-time
1952
+ */
1953
+ updated_at: string;
1954
+ };
1955
+
1956
+ /**
1957
+ * Generated by Kubb (https://kubb.dev/).
1958
+ * Do not edit manually.
1959
+ */
1960
+
1961
+ /**
1962
+ * @description Cursor-paginated list of custom domains for a project.
1963
+ */
1964
+ type ListCustomDomainsResponse = {
1965
+ /**
1966
+ * @description Custom domains on the current page.
1967
+ * @type array
1968
+ */
1969
+ domains: CustomDomain[];
1970
+ /**
1971
+ * @description Token for the next page. Empty if no more results.
1972
+ * @type string | undefined
1973
+ */
1974
+ next_page_token?: string;
1975
+ };
1976
+
1977
+ /**
1978
+ * Generated by Kubb (https://kubb.dev/).
1979
+ * Do not edit manually.
1980
+ */
1981
+
1982
+ type ListCustomDomainsPathParams = {
1983
+ /**
1984
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1985
+ * @pattern ^[a-zA-Z0-9_.-]+$
1986
+ * @type string
1987
+ */
1988
+ project_id: string;
1989
+ };
1990
+ type ListCustomDomainsQueryParams = {
1991
+ /**
1992
+ * @description Maximum number of items to return (1-100, default 20).
1993
+ * @minLength 1
1994
+ * @maxLength 100
1995
+ * @default 20
1996
+ * @type integer | undefined
1997
+ */
1998
+ page_size?: number;
1999
+ /**
2000
+ * @description Opaque token for cursor-based pagination.
2001
+ * @pattern ^[a-zA-Z0-9_.-]+$
2002
+ * @type string | undefined
2003
+ */
2004
+ page_token?: string;
2005
+ };
2006
+ /**
2007
+ * @description List of custom domains.
2008
+ */
2009
+ type ListCustomDomains200 = ListCustomDomainsResponse;
2010
+ /**
2011
+ * @description Invalid request parameters.
2012
+ */
2013
+ type ListCustomDomains400 = Error$1;
2014
+ /**
2015
+ * @description Missing or invalid authentication.
2016
+ */
2017
+ type ListCustomDomains401 = Error$1;
2018
+ /**
2019
+ * @description Operation not allowed by current plan limits.
2020
+ */
2021
+ type ListCustomDomains403 = Error$1;
2022
+ /**
2023
+ * @description Resource not found.
2024
+ */
2025
+ type ListCustomDomains404 = Error$1;
2026
+ /**
2027
+ * @description Rate limited. Try again later.
2028
+ */
2029
+ type ListCustomDomains429 = Error$1;
2030
+ type ListCustomDomainsQueryResponse = ListCustomDomains200;
2031
+ type ListCustomDomainsQuery = {
2032
+ Response: ListCustomDomains200;
2033
+ PathParams: ListCustomDomainsPathParams;
2034
+ QueryParams: ListCustomDomainsQueryParams;
2035
+ Errors: ListCustomDomains400 | ListCustomDomains401 | ListCustomDomains403 | ListCustomDomains404 | ListCustomDomains429;
2036
+ };
2037
+
2038
+ /**
2039
+ * Generated by Kubb (https://kubb.dev/).
2040
+ * Do not edit manually.
2041
+ */
2042
+ /**
2043
+ * @description Request body for attaching a custom domain to a project.
2044
+ */
2045
+ type CreateCustomDomainRequest = {
2046
+ /**
2047
+ * @description The custom domain name to add (e.g., db.example.com).
2048
+ * @minLength 1
2049
+ * @maxLength 253
2050
+ * @pattern ^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$
2051
+ * @type string
2052
+ */
2053
+ domain: string;
2054
+ };
2055
+
2056
+ /**
2057
+ * Generated by Kubb (https://kubb.dev/).
2058
+ * Do not edit manually.
2059
+ */
2060
+
2061
+ type CreateCustomDomainPathParams = {
2062
+ /**
2063
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
2064
+ * @pattern ^[a-zA-Z0-9_.-]+$
2065
+ * @type string
2066
+ */
2067
+ project_id: string;
2068
+ };
2069
+ /**
2070
+ * @description Custom domain created.
2071
+ */
2072
+ type CreateCustomDomain201 = CustomDomain;
2073
+ /**
2074
+ * @description Invalid request parameters.
2075
+ */
2076
+ type CreateCustomDomain400 = Error$1;
2077
+ /**
2078
+ * @description Missing or invalid authentication.
2079
+ */
2080
+ type CreateCustomDomain401 = Error$1;
2081
+ /**
2082
+ * @description Custom domains require a Scale or Enterprise plan.
2083
+ */
2084
+ type CreateCustomDomain403 = Error$1;
2085
+ /**
2086
+ * @description Resource not found.
2087
+ */
2088
+ type CreateCustomDomain404 = Error$1;
2089
+ /**
2090
+ * @description Resource already exists or conflicts with current state.
2091
+ */
2092
+ type CreateCustomDomain409 = Error$1;
2093
+ /**
2094
+ * @description Rate limited. Try again later.
2095
+ */
2096
+ type CreateCustomDomain429 = Error$1;
2097
+ type CreateCustomDomainMutationRequest = CreateCustomDomainRequest;
2098
+ type CreateCustomDomainMutationResponse = CreateCustomDomain201;
2099
+ type CreateCustomDomainMutation = {
2100
+ Response: CreateCustomDomain201;
2101
+ Request: CreateCustomDomainMutationRequest;
2102
+ PathParams: CreateCustomDomainPathParams;
2103
+ Errors: CreateCustomDomain400 | CreateCustomDomain401 | CreateCustomDomain403 | CreateCustomDomain404 | CreateCustomDomain409 | CreateCustomDomain429;
2104
+ };
2105
+
2106
+ /**
2107
+ * Generated by Kubb (https://kubb.dev/).
2108
+ * Do not edit manually.
2109
+ */
2110
+
2111
+ type DeleteCustomDomainPathParams = {
2112
+ /**
2113
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
2114
+ * @pattern ^[a-zA-Z0-9_.-]+$
2115
+ * @type string
2116
+ */
2117
+ project_id: string;
2118
+ /**
2119
+ * @description Unique custom domain identifier (prefixed, e.g. dom_xxx).
2120
+ * @pattern ^[a-zA-Z0-9_.-]+$
2121
+ * @type string
2122
+ */
2123
+ domain_id: string;
2124
+ };
2125
+ /**
2126
+ * @description Custom domain deleted.
2127
+ */
2128
+ type DeleteCustomDomain204 = any;
2129
+ /**
2130
+ * @description Invalid request parameters.
2131
+ */
2132
+ type DeleteCustomDomain400 = Error$1;
2133
+ /**
2134
+ * @description Missing or invalid authentication.
2135
+ */
2136
+ type DeleteCustomDomain401 = Error$1;
2137
+ /**
2138
+ * @description Operation not allowed by current plan limits.
2139
+ */
2140
+ type DeleteCustomDomain403 = Error$1;
2141
+ /**
2142
+ * @description Resource not found.
2143
+ */
2144
+ type DeleteCustomDomain404 = Error$1;
2145
+ /**
2146
+ * @description Rate limited. Try again later.
2147
+ */
2148
+ type DeleteCustomDomain429 = Error$1;
2149
+ type DeleteCustomDomainMutationResponse = DeleteCustomDomain204;
2150
+ type DeleteCustomDomainMutation = {
2151
+ Response: DeleteCustomDomain204;
2152
+ PathParams: DeleteCustomDomainPathParams;
2153
+ Errors: DeleteCustomDomain400 | DeleteCustomDomain401 | DeleteCustomDomain403 | DeleteCustomDomain404 | DeleteCustomDomain429;
2154
+ };
2155
+
2156
+ /**
2157
+ * Generated by Kubb (https://kubb.dev/).
2158
+ * Do not edit manually.
2159
+ */
2160
+
2161
+ /**
2162
+ * @description Result of checking DNS ownership for a custom domain.
2163
+ */
2164
+ type VerifyCustomDomainResponse = {
2165
+ /**
2166
+ * @description Whether DNS verification succeeded.
2167
+ * @type boolean
2168
+ */
2169
+ verified: boolean;
2170
+ /**
2171
+ * @description Error message if verification failed.
2172
+ * @type string | undefined
2173
+ */
2174
+ error?: string;
2175
+ /**
2176
+ * @description Custom database hostname attached to a project.
2177
+ * @type object | undefined
2178
+ */
2179
+ domain?: CustomDomain;
2180
+ };
2181
+
2182
+ /**
2183
+ * Generated by Kubb (https://kubb.dev/).
2184
+ * Do not edit manually.
2185
+ */
2186
+
2187
+ type VerifyCustomDomainPathParams = {
2188
+ /**
2189
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
2190
+ * @pattern ^[a-zA-Z0-9_.-]+$
2191
+ * @type string
2192
+ */
2193
+ project_id: string;
2194
+ /**
2195
+ * @description Unique custom domain identifier (prefixed, e.g. dom_xxx).
2196
+ * @pattern ^[a-zA-Z0-9_.-]+$
2197
+ * @type string
2198
+ */
2199
+ domain_id: string;
2200
+ };
2201
+ /**
2202
+ * @description Verification result.
2203
+ */
2204
+ type VerifyCustomDomain200 = VerifyCustomDomainResponse;
2205
+ /**
2206
+ * @description Invalid request parameters.
2207
+ */
2208
+ type VerifyCustomDomain400 = Error$1;
2209
+ /**
2210
+ * @description Missing or invalid authentication.
2211
+ */
2212
+ type VerifyCustomDomain401 = Error$1;
2213
+ /**
2214
+ * @description Custom domains require a Scale or Enterprise plan.
2215
+ */
2216
+ type VerifyCustomDomain403 = Error$1;
2217
+ /**
2218
+ * @description Resource not found.
2219
+ */
2220
+ type VerifyCustomDomain404 = Error$1;
2221
+ /**
2222
+ * @description Rate limited. Try again later.
2223
+ */
2224
+ type VerifyCustomDomain429 = Error$1;
2225
+ type VerifyCustomDomainMutationResponse = VerifyCustomDomain200;
2226
+ type VerifyCustomDomainMutation = {
2227
+ Response: VerifyCustomDomain200;
2228
+ PathParams: VerifyCustomDomainPathParams;
2229
+ Errors: VerifyCustomDomain400 | VerifyCustomDomain401 | VerifyCustomDomain403 | VerifyCustomDomain404 | VerifyCustomDomain429;
2230
+ };
2231
+
2232
+ /**
2233
+ * Generated by Kubb (https://kubb.dev/).
2234
+ * Do not edit manually.
2235
+ */
2236
+ declare const healthResponseStatusEnum: {
2237
+ readonly ok: "ok";
2238
+ readonly degraded: "degraded";
2239
+ };
2240
+ type HealthResponseStatusEnumKey = (typeof healthResponseStatusEnum)[keyof typeof healthResponseStatusEnum];
2241
+ /**
2242
+ * @description Health status and build metadata for the API service.
2243
+ */
2244
+ type HealthResponse = {
2245
+ /**
2246
+ * @description Overall service health.
2247
+ * @type string
2248
+ */
2249
+ status: HealthResponseStatusEnumKey;
2250
+ /**
2251
+ * @description API server version.
2252
+ * @type string
2253
+ */
2254
+ version: string;
2255
+ /**
2256
+ * @description Resolved image SHA (digest or SHA tag).
2257
+ * @type string
2258
+ */
2259
+ image_sha: string;
2260
+ /**
2261
+ * @description Server time.
2262
+ * @type string | undefined, date-time
2263
+ */
2264
+ timestamp?: string;
2265
+ };
2266
+
2267
+ /**
2268
+ * Generated by Kubb (https://kubb.dev/).
2269
+ * Do not edit manually.
2270
+ */
2271
+
2272
+ /**
2273
+ * @description Service is healthy.
2274
+ */
2275
+ type GetHealth200 = HealthResponse;
2276
+ /**
2277
+ * @description Rate limited. Try again later.
2278
+ */
2279
+ type GetHealth429 = Error$1;
2280
+ type GetHealthQueryResponse = GetHealth200;
2281
+ type GetHealthQuery = {
2282
+ Response: GetHealth200;
2283
+ Errors: GetHealth429;
2284
+ };
2285
+
2286
+ /**
2287
+ * Generated by Kubb (https://kubb.dev/).
2288
+ * Do not edit manually.
2289
+ */
2290
+ /**
2291
+ * @description Aggregate cache performance metrics for the selected time range.
2292
+ */
2293
+ type CacheSummary = {
2294
+ /**
2295
+ * @description Total number of cache hits in the selected time range.
2296
+ * @type integer, int64
2297
+ */
2298
+ total_hits: number;
2299
+ /**
2300
+ * @description Total number of cache misses in the selected time range.
2301
+ * @type integer, int64
2302
+ */
2303
+ total_misses: number;
2304
+ /**
2305
+ * @description Cache hit rate as a fraction (0.0 to 1.0).
2306
+ * @type number, double
2307
+ */
2308
+ hit_rate: number;
2309
+ };
2310
+
2311
+ /**
2312
+ * Generated by Kubb (https://kubb.dev/).
2313
+ * Do not edit manually.
2314
+ */
2315
+ /**
2316
+ * @description Aggregate latency metrics for the selected time range.
2317
+ */
2318
+ type LatencySummary = {
2319
+ /**
2320
+ * @description Average latency in milliseconds across all queries.
2321
+ * @type number, double
2322
+ */
2323
+ avg_ms: number;
2324
+ /**
2325
+ * @description P99 latency in milliseconds across all queries.
2326
+ * @type number, double
2327
+ */
2328
+ p99_ms: number;
2329
+ };
2330
+
2331
+ /**
2332
+ * Generated by Kubb (https://kubb.dev/).
2333
+ * Do not edit manually.
2334
+ */
2335
+ /**
2336
+ * @description Aggregated analytics for a normalized SQL query shape.
2337
+ */
2338
+ type QueryInsight = {
2339
+ /**
2340
+ * @description xxhash64 of the normalized SQL pattern (hex).
2341
+ * @type string
2342
+ */
2343
+ query_hash: string;
2344
+ /**
2345
+ * @description Normalized SQL pattern (truncated to 500 chars).
2346
+ * @type string
2347
+ */
2348
+ query_pattern: string;
2349
+ /**
2350
+ * @description Total number of executions in the time range.
2351
+ * @type integer, int64
2352
+ */
2353
+ total_count: number;
2354
+ /**
2355
+ * @description Total cache hits attributed to the query shape.
2356
+ * @type integer, int64
2357
+ */
2358
+ total_cache_hits: number;
2359
+ /**
2360
+ * @description Total cache misses attributed to the query shape.
2361
+ * @type integer, int64
2362
+ */
2363
+ total_cache_misses: number;
2364
+ /**
2365
+ * @description Average query latency in milliseconds.
2366
+ * @type number, double
2367
+ */
2368
+ avg_latency_ms: number;
2369
+ /**
2370
+ * @description P99 query latency in milliseconds.
2371
+ * @type number, double
2372
+ */
2373
+ p99_latency_ms: number;
2374
+ };
2375
+
2376
+ /**
2377
+ * Generated by Kubb (https://kubb.dev/).
2378
+ * Do not edit manually.
2379
+ */
2380
+
2381
+ /**
2382
+ * @description Query insights, cache performance, and latency for a project.
2383
+ */
2384
+ type ProjectInsights = {
2385
+ /**
2386
+ * @description Top query shapes observed for the project.
2387
+ * @type array
2388
+ */
2389
+ queries: QueryInsight[];
2390
+ /**
2391
+ * @description Aggregate cache performance metrics for the selected time range.
2392
+ * @type object
2393
+ */
2394
+ cache: CacheSummary;
2395
+ /**
2396
+ * @description Aggregate latency metrics for the selected time range.
2397
+ * @type object
2398
+ */
2399
+ latency: LatencySummary;
2400
+ };
2401
+
2402
+ /**
2403
+ * Generated by Kubb (https://kubb.dev/).
2404
+ * Do not edit manually.
2405
+ */
2406
+
2407
+ type GetProjectInsightsPathParams = {
2408
+ /**
2409
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
2410
+ * @pattern ^[a-zA-Z0-9_.-]+$
2411
+ * @type string
2412
+ */
2413
+ project_id: string;
2414
+ };
2415
+ declare const getProjectInsightsQueryParamsRangeEnum: {
2416
+ readonly "1h": "1h";
2417
+ readonly "6h": "6h";
2418
+ readonly "24h": "24h";
2419
+ readonly "7d": "7d";
2420
+ };
2421
+ type GetProjectInsightsQueryParamsRangeEnumKey = (typeof getProjectInsightsQueryParamsRangeEnum)[keyof typeof getProjectInsightsQueryParamsRangeEnum];
2422
+ type GetProjectInsightsQueryParams = {
2423
+ /**
2424
+ * @description Time range to query. Defaults to 24h.
2425
+ * @default "24h"
2426
+ * @type string | undefined
2427
+ */
2428
+ range?: GetProjectInsightsQueryParamsRangeEnumKey;
2429
+ /**
2430
+ * @description Maximum number of top queries to return (1-100).
2431
+ * @minLength 1
2432
+ * @maxLength 100
2433
+ * @default 20
2434
+ * @type integer | undefined
2435
+ */
2436
+ limit?: number;
2437
+ };
2438
+ /**
2439
+ * @description Query insights for the project.
2440
+ */
2441
+ type GetProjectInsights200 = ProjectInsights;
2442
+ /**
2443
+ * @description Invalid request parameters.
2444
+ */
2445
+ type GetProjectInsights400 = Error$1;
2446
+ /**
2447
+ * @description Missing or invalid authentication.
2448
+ */
2449
+ type GetProjectInsights401 = Error$1;
2450
+ /**
2451
+ * @description Resource not found.
2452
+ */
2453
+ type GetProjectInsights404 = Error$1;
2454
+ /**
2455
+ * @description Rate limited. Try again later.
2456
+ */
2457
+ type GetProjectInsights429 = Error$1;
2458
+ type GetProjectInsightsQueryResponse = GetProjectInsights200;
2459
+ type GetProjectInsightsQuery = {
2460
+ Response: GetProjectInsights200;
2461
+ PathParams: GetProjectInsightsPathParams;
2462
+ QueryParams: GetProjectInsightsQueryParams;
2463
+ Errors: GetProjectInsights400 | GetProjectInsights401 | GetProjectInsights404 | GetProjectInsights429;
2464
+ };
2465
+
2466
+ /**
2467
+ * Generated by Kubb (https://kubb.dev/).
2468
+ * Do not edit manually.
2469
+ */
2470
+ /**
2471
+ * @description Progress state for the dashboard onboarding checklist.
2472
+ */
2473
+ type OnboardingProgress = {
2474
+ /**
2475
+ * @description Organization ID this onboarding belongs to.
2476
+ * @type string
2477
+ */
2478
+ organization_id: string;
2479
+ /**
2480
+ * @description Whether the organization has been created.
2481
+ * @type boolean
2482
+ */
2483
+ org_created: boolean;
2484
+ /**
2485
+ * @description Whether a project has been created.
2486
+ * @type boolean
2487
+ */
2488
+ project_created: boolean;
2489
+ /**
2490
+ * @description Whether a database has been added.
2491
+ * @type boolean
2492
+ */
2493
+ database_added: boolean;
2494
+ /**
2495
+ * @description Whether the database connection has been tested.
2496
+ * @type boolean
2497
+ */
2498
+ connection_tested: boolean;
2499
+ /**
2500
+ * @description Whether the connection string has been copied.
2501
+ * @type boolean
2502
+ */
2503
+ connection_string_copied: boolean;
2504
+ /**
2505
+ * @description Whether the first query has been run through PgBeam.
2506
+ * @type boolean
2507
+ */
2508
+ first_query_run: boolean;
2509
+ /**
2510
+ * @description Whether the user has dismissed the onboarding checklist.
2511
+ * @type boolean
2512
+ */
2513
+ dismissed: boolean;
2514
+ /**
2515
+ * @description Whether all onboarding steps are complete.
2516
+ * @type boolean
2517
+ */
2518
+ completed: boolean;
2519
+ /**
2520
+ * @description Number of completed onboarding steps.
2521
+ * @type integer
2522
+ */
2523
+ steps_completed: number;
2524
+ /**
2525
+ * @description Total number of onboarding steps.
2526
+ * @type integer
2527
+ */
2528
+ steps_total: number;
2529
+ /**
2530
+ * @description When onboarding was completed. Null if not yet completed.
2531
+ * @type string, date-time
2532
+ */
2533
+ completed_at?: string | null;
2534
+ };
2535
+
2536
+ /**
2537
+ * Generated by Kubb (https://kubb.dev/).
2538
+ * Do not edit manually.
2539
+ */
2540
+
2541
+ type GetOnboardingProgressPathParams = {
2542
+ /**
2543
+ * @description Unique organization identifier.
2544
+ * @pattern ^[a-zA-Z0-9_.-]+$
2545
+ * @type string
2546
+ */
2547
+ org_id: string;
2548
+ };
2549
+ /**
2550
+ * @description Onboarding progress.
2551
+ */
2552
+ type GetOnboardingProgress200 = OnboardingProgress;
2553
+ /**
2554
+ * @description Invalid request parameters.
2555
+ */
2556
+ type GetOnboardingProgress400 = Error$1;
2557
+ /**
2558
+ * @description Missing or invalid authentication.
2559
+ */
2560
+ type GetOnboardingProgress401 = Error$1;
2561
+ /**
2562
+ * @description Operation not allowed by current plan limits.
2563
+ */
2564
+ type GetOnboardingProgress403 = Error$1;
2565
+ /**
2566
+ * @description Resource not found.
2567
+ */
2568
+ type GetOnboardingProgress404 = Error$1;
2569
+ /**
2570
+ * @description Rate limited. Try again later.
2571
+ */
2572
+ type GetOnboardingProgress429 = Error$1;
2573
+ type GetOnboardingProgressQueryResponse = GetOnboardingProgress200;
2574
+ type GetOnboardingProgressQuery = {
2575
+ Response: GetOnboardingProgress200;
2576
+ PathParams: GetOnboardingProgressPathParams;
2577
+ Errors: GetOnboardingProgress400 | GetOnboardingProgress401 | GetOnboardingProgress403 | GetOnboardingProgress404 | GetOnboardingProgress429;
2578
+ };
2579
+
2580
+ /**
2581
+ * Generated by Kubb (https://kubb.dev/).
2582
+ * Do not edit manually.
2583
+ */
2584
+ declare const updateOnboardingRequestStepEnum: {
2585
+ readonly project_created: "project_created";
2586
+ readonly database_added: "database_added";
2587
+ readonly connection_tested: "connection_tested";
2588
+ readonly connection_string_copied: "connection_string_copied";
2589
+ readonly first_query_run: "first_query_run";
2590
+ };
2591
+ type UpdateOnboardingRequestStepEnumKey = (typeof updateOnboardingRequestStepEnum)[keyof typeof updateOnboardingRequestStepEnum];
2592
+ /**
2593
+ * @description Request body for advancing or dismissing onboarding.
2594
+ */
2595
+ type UpdateOnboardingRequest = {
2596
+ /**
2597
+ * @description The onboarding step to mark as complete.
2598
+ * @type string | undefined
2599
+ */
2600
+ step?: UpdateOnboardingRequestStepEnumKey;
2601
+ /**
2602
+ * @description Set to true to dismiss the onboarding checklist.
2603
+ * @type boolean | undefined
2604
+ */
2605
+ dismiss?: boolean;
2606
+ };
2607
+
2608
+ /**
2609
+ * Generated by Kubb (https://kubb.dev/).
2610
+ * Do not edit manually.
2611
+ */
2612
+
2613
+ type UpdateOnboardingProgressPathParams = {
2614
+ /**
2615
+ * @description Unique organization identifier.
2616
+ * @pattern ^[a-zA-Z0-9_.-]+$
2617
+ * @type string
2618
+ */
2619
+ org_id: string;
2620
+ };
2621
+ /**
2622
+ * @description Updated onboarding progress.
2623
+ */
2624
+ type UpdateOnboardingProgress200 = OnboardingProgress;
2625
+ /**
2626
+ * @description Invalid request parameters.
2627
+ */
2628
+ type UpdateOnboardingProgress400 = Error$1;
2629
+ /**
2630
+ * @description Missing or invalid authentication.
2631
+ */
2632
+ type UpdateOnboardingProgress401 = Error$1;
2633
+ /**
2634
+ * @description Operation not allowed by current plan limits.
2635
+ */
2636
+ type UpdateOnboardingProgress403 = Error$1;
2637
+ /**
2638
+ * @description Resource not found.
2639
+ */
2640
+ type UpdateOnboardingProgress404 = Error$1;
2641
+ /**
2642
+ * @description Rate limited. Try again later.
2643
+ */
2644
+ type UpdateOnboardingProgress429 = Error$1;
2645
+ type UpdateOnboardingProgressMutationRequest = UpdateOnboardingRequest;
2646
+ type UpdateOnboardingProgressMutationResponse = UpdateOnboardingProgress200;
2647
+ type UpdateOnboardingProgressMutation = {
2648
+ Response: UpdateOnboardingProgress200;
2649
+ Request: UpdateOnboardingProgressMutationRequest;
2650
+ PathParams: UpdateOnboardingProgressPathParams;
2651
+ Errors: UpdateOnboardingProgress400 | UpdateOnboardingProgress401 | UpdateOnboardingProgress403 | UpdateOnboardingProgress404 | UpdateOnboardingProgress429;
2652
+ };
2653
+
2654
+ /**
2655
+ * Generated by Kubb (https://kubb.dev/).
2656
+ * Do not edit manually.
2657
+ */
2658
+ declare const projectStatusEnum: {
2659
+ readonly active: "active";
2660
+ readonly suspended: "suspended";
2661
+ readonly deleted: "deleted";
2662
+ };
2663
+ type ProjectStatusEnumKey = (typeof projectStatusEnum)[keyof typeof projectStatusEnum];
2664
+ /**
2665
+ * @description Project lifecycle status.
2666
+ */
2667
+ type ProjectStatus = ProjectStatusEnumKey;
2668
+
2669
+ /**
2670
+ * Generated by Kubb (https://kubb.dev/).
2671
+ * Do not edit manually.
2672
+ */
2673
+
2674
+ declare const projectCloudEnum: {
2675
+ readonly aws: "aws";
2676
+ readonly azure: "azure";
2677
+ readonly gcp: "gcp";
2678
+ };
2679
+ type ProjectCloudEnumKey = (typeof projectCloudEnum)[keyof typeof projectCloudEnum];
2680
+ /**
2681
+ * @description Project configuration and current control-plane state.
2682
+ */
2683
+ type Project = {
2684
+ /**
2685
+ * @description Unique project identifier (prefixed).
2686
+ * @type string
2687
+ */
2688
+ id: string;
2689
+ /**
2690
+ * @description Better Auth organization ID that owns this project.
2691
+ * @type string
2692
+ */
2693
+ org_id: string;
2694
+ /**
2695
+ * @description Human-readable project name.
2696
+ * @minLength 1
2697
+ * @maxLength 100
2698
+ * @type string
2699
+ */
2700
+ name: string;
2701
+ /**
2702
+ * @description Optional project description.
2703
+ * @maxLength 500
2704
+ * @type string | undefined
2705
+ */
2706
+ description?: string;
2707
+ /**
2708
+ * @description User-defined labels applied to the project.
2709
+ * @type array | undefined
2710
+ */
2711
+ tags?: string[];
2712
+ /**
2713
+ * @description Cloud provider where the project runs.
2714
+ * @type string | undefined
2715
+ */
2716
+ readonly cloud?: ProjectCloudEnumKey;
2717
+ /**
2718
+ * @description Proxy hostname for connecting through PgBeam (e.g., myproject.aws.pgbeam.app).
2719
+ * @type string | undefined
2720
+ */
2721
+ readonly proxy_host?: string;
2722
+ /**
2723
+ * @description Maximum queries per second for this project. 0 means unlimited.
2724
+ * @minLength 0
2725
+ * @maxLength 2147483647
2726
+ * @type integer | undefined, int32
2727
+ */
2728
+ queries_per_second?: number;
2729
+ /**
2730
+ * @description Burst allowance above the steady-state rate. 0 uses queries_per_second as burst.
2731
+ * @minLength 0
2732
+ * @maxLength 2147483647
2733
+ * @type integer | undefined, int32
2734
+ */
2735
+ burst_size?: number;
2736
+ /**
2737
+ * @description Maximum concurrent proxy connections. 0 means unlimited.
2738
+ * @minLength 0
2739
+ * @maxLength 2147483647
2740
+ * @type integer | undefined, int32
2741
+ */
2742
+ max_connections?: number;
2743
+ /**
2744
+ * @description Number of databases attached to this project.
2745
+ * @type integer | undefined
2746
+ */
2747
+ readonly database_count?: number;
2748
+ /**
2749
+ * @description Current active connections (latest metrics snapshot). 0 when no metrics data.
2750
+ * @type integer | undefined
2751
+ */
2752
+ readonly active_connections?: number;
2753
+ /**
2754
+ * @description Project lifecycle status.
2755
+ * @type string
2756
+ */
2757
+ status: ProjectStatus;
2758
+ /**
2759
+ * @description When the project was created.
2760
+ * @type string, date-time
2761
+ */
2762
+ created_at: string;
2763
+ /**
2764
+ * @description When the project was last updated.
2765
+ * @type string, date-time
2766
+ */
2767
+ updated_at: string;
2768
+ };
2769
+
2770
+ /**
2771
+ * Generated by Kubb (https://kubb.dev/).
2772
+ * Do not edit manually.
2773
+ */
2774
+
2775
+ /**
2776
+ * @description Cursor-paginated list of projects for an organization.
2777
+ */
2778
+ type ListProjectsResponse = {
2779
+ /**
2780
+ * @description Projects on the current page.
2781
+ * @type array
2782
+ */
2783
+ projects: Project[];
2784
+ /**
2785
+ * @description Total number of projects (across all pages).
2786
+ * @type integer
2787
+ */
2788
+ total: number;
2789
+ /**
2790
+ * @description Token for the next page. Empty if no more results.
2791
+ * @type string | undefined
2792
+ */
2793
+ next_page_token?: string;
2794
+ };
2795
+
2796
+ /**
2797
+ * Generated by Kubb (https://kubb.dev/).
2798
+ * Do not edit manually.
2799
+ */
2800
+
2801
+ declare const listProjectsQueryParamsSortByEnum: {
2802
+ readonly name: "name";
2803
+ readonly created_at: "created_at";
2804
+ readonly active_connections: "active_connections";
2805
+ };
2806
+ type ListProjectsQueryParamsSortByEnumKey = (typeof listProjectsQueryParamsSortByEnum)[keyof typeof listProjectsQueryParamsSortByEnum];
2807
+ type ListProjectsQueryParams = {
2808
+ /**
2809
+ * @description Organization ID to filter projects.
2810
+ * @pattern ^[\x20-\x7E]+$
2811
+ * @type string
2812
+ */
2813
+ org_id: string;
2814
+ /**
2815
+ * @description Maximum number of items to return (1-100, default 20).
2816
+ * @minLength 1
2817
+ * @maxLength 100
2818
+ * @default 20
2819
+ * @type integer | undefined
2820
+ */
2821
+ page_size?: number;
2822
+ /**
2823
+ * @description Opaque token for cursor-based pagination.
2824
+ * @pattern ^[a-zA-Z0-9_.-]+$
2825
+ * @type string | undefined
2826
+ */
2827
+ page_token?: string;
2828
+ /**
2829
+ * @description Sort field for projects list.
2830
+ * @default "created_at"
2831
+ * @type string | undefined
2832
+ */
2833
+ sort_by?: ListProjectsQueryParamsSortByEnumKey;
2834
+ };
2835
+ /**
2836
+ * @description List of projects.
2837
+ */
2838
+ type ListProjects200 = ListProjectsResponse;
2839
+ /**
2840
+ * @description Invalid request parameters.
2841
+ */
2842
+ type ListProjects400 = Error$1;
2843
+ /**
2844
+ * @description Missing or invalid authentication.
2845
+ */
2846
+ type ListProjects401 = Error$1;
2847
+ /**
2848
+ * @description Operation not allowed by current plan limits.
2849
+ */
2850
+ type ListProjects403 = Error$1;
2851
+ /**
2852
+ * @description Rate limited. Try again later.
2853
+ */
2854
+ type ListProjects429 = Error$1;
2855
+ type ListProjectsQueryResponse = ListProjects200;
2856
+ type ListProjectsQuery = {
2857
+ Response: ListProjects200;
2858
+ QueryParams: ListProjectsQueryParams;
2859
+ Errors: ListProjects400 | ListProjects401 | ListProjects403 | ListProjects429;
2860
+ };
2861
+
2862
+ /**
2863
+ * Generated by Kubb (https://kubb.dev/).
2864
+ * Do not edit manually.
2865
+ */
2866
+
2867
+ declare const createProjectRequestCloudEnum: {
2868
+ readonly aws: "aws";
2869
+ readonly azure: "azure";
2870
+ readonly gcp: "gcp";
2871
+ };
2872
+ type CreateProjectRequestCloudEnumKey = (typeof createProjectRequestCloudEnum)[keyof typeof createProjectRequestCloudEnum];
2873
+ /**
2874
+ * @description Request body for creating a project and its primary database.
2875
+ */
2876
+ type CreateProjectRequest = {
2877
+ /**
2878
+ * @description Human-readable project name.
2879
+ * @minLength 1
2880
+ * @maxLength 100
2881
+ * @pattern ^[^\x00]*$
2882
+ * @type string
2883
+ */
2884
+ name: string;
2885
+ /**
2886
+ * @description Better Auth organization ID.
2887
+ * @minLength 1
2888
+ * @pattern ^[^\x00]+$
2889
+ * @type string
2890
+ */
2891
+ org_id: string;
2892
+ /**
2893
+ * @description Optional project description.
2894
+ * @maxLength 500
2895
+ * @type string | undefined
2896
+ */
2897
+ description?: string;
2898
+ /**
2899
+ * @description User-defined labels to attach to the project.
2900
+ * @type array | undefined
2901
+ */
2902
+ tags?: string[];
2903
+ /**
2904
+ * @description Cloud provider for the project.
2905
+ * @default "aws"
2906
+ * @type string | undefined
2907
+ */
2908
+ cloud?: CreateProjectRequestCloudEnumKey;
2909
+ /**
2910
+ * @description Request body for registering an upstream database.
2911
+ * @type object
2912
+ */
2913
+ database: CreateDatabaseRequest;
2914
+ };
2915
+
2916
+ /**
2917
+ * Generated by Kubb (https://kubb.dev/).
2918
+ * Do not edit manually.
2919
+ */
2920
+
2921
+ /**
2922
+ * @description Response returned after creating a project and its primary database.
2923
+ */
2924
+ type CreateProjectResponse = {
2925
+ /**
2926
+ * @description Project configuration and current control-plane state.
2927
+ * @type object
2928
+ */
2929
+ project: Project;
2930
+ /**
2931
+ * @description Registered upstream PostgreSQL database for a project.
2932
+ * @type object | undefined
2933
+ */
2934
+ database?: Database;
2935
+ };
2936
+
2937
+ /**
2938
+ * Generated by Kubb (https://kubb.dev/).
2939
+ * Do not edit manually.
2940
+ */
2941
+
2942
+ /**
2943
+ * @description Project created.
2944
+ */
2945
+ type CreateProject201 = CreateProjectResponse;
2946
+ /**
2947
+ * @description Invalid request parameters.
2948
+ */
2949
+ type CreateProject400 = Error$1;
2950
+ /**
2951
+ * @description Missing or invalid authentication.
2952
+ */
2953
+ type CreateProject401 = Error$1;
2954
+ /**
2955
+ * @description Operation not allowed by current plan limits.
2956
+ */
2957
+ type CreateProject403 = Error$1;
2958
+ /**
2959
+ * @description Resource already exists or conflicts with current state.
2960
+ */
2961
+ type CreateProject409 = Error$1;
2962
+ /**
2963
+ * @description Rate limited. Try again later.
2964
+ */
2965
+ type CreateProject429 = Error$1;
2966
+ type CreateProjectMutationRequest = CreateProjectRequest;
2967
+ type CreateProjectMutationResponse = CreateProject201;
2968
+ type CreateProjectMutation = {
2969
+ Response: CreateProject201;
2970
+ Request: CreateProjectMutationRequest;
2971
+ Errors: CreateProject400 | CreateProject401 | CreateProject403 | CreateProject409 | CreateProject429;
2972
+ };
2973
+
2974
+ /**
2975
+ * Generated by Kubb (https://kubb.dev/).
2976
+ * Do not edit manually.
2977
+ */
2978
+
2979
+ type GetProjectPathParams = {
2980
+ /**
2981
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
2982
+ * @pattern ^[a-zA-Z0-9_.-]+$
2983
+ * @type string
2984
+ */
2985
+ project_id: string;
2986
+ };
2987
+ /**
2988
+ * @description Project found.
2989
+ */
2990
+ type GetProject200 = Project;
2991
+ /**
2992
+ * @description Invalid request parameters.
2993
+ */
2994
+ type GetProject400 = Error$1;
2995
+ /**
2996
+ * @description Missing or invalid authentication.
2997
+ */
2998
+ type GetProject401 = Error$1;
2999
+ /**
3000
+ * @description Operation not allowed by current plan limits.
3001
+ */
3002
+ type GetProject403 = Error$1;
3003
+ /**
3004
+ * @description Resource not found.
3005
+ */
3006
+ type GetProject404 = Error$1;
3007
+ /**
3008
+ * @description Rate limited. Try again later.
3009
+ */
3010
+ type GetProject429 = Error$1;
3011
+ type GetProjectQueryResponse = GetProject200;
3012
+ type GetProjectQuery = {
3013
+ Response: GetProject200;
3014
+ PathParams: GetProjectPathParams;
3015
+ Errors: GetProject400 | GetProject401 | GetProject403 | GetProject404 | GetProject429;
3016
+ };
3017
+
3018
+ /**
3019
+ * Generated by Kubb (https://kubb.dev/).
3020
+ * Do not edit manually.
3021
+ */
3022
+
3023
+ /**
3024
+ * @description Request body for partially updating a project.
3025
+ */
3026
+ type UpdateProjectRequest = {
3027
+ /**
3028
+ * @description Updated project name.
3029
+ * @minLength 1
3030
+ * @maxLength 100
3031
+ * @pattern ^[^\x00]*$
3032
+ * @type string | undefined
3033
+ */
3034
+ name?: string;
3035
+ /**
3036
+ * @description Updated project description.
3037
+ * @maxLength 500
3038
+ * @type string | undefined
3039
+ */
3040
+ description?: string;
3041
+ /**
3042
+ * @description Replacement set of user-defined project labels.
3043
+ * @type array | undefined
3044
+ */
3045
+ tags?: string[];
3046
+ /**
3047
+ * @description Project lifecycle status.
3048
+ * @type string | undefined
3049
+ */
3050
+ status?: ProjectStatus;
3051
+ /**
3052
+ * @description Maximum queries per second. 0 means unlimited.
3053
+ * @minLength 0
3054
+ * @maxLength 2147483647
3055
+ * @type integer | undefined, int32
3056
+ */
3057
+ queries_per_second?: number;
3058
+ /**
3059
+ * @description Burst allowance above steady-state rate.
3060
+ * @minLength 0
3061
+ * @maxLength 2147483647
3062
+ * @type integer | undefined, int32
3063
+ */
3064
+ burst_size?: number;
3065
+ /**
3066
+ * @description Maximum concurrent proxy connections. 0 means unlimited.
3067
+ * @minLength 0
3068
+ * @maxLength 2147483647
3069
+ * @type integer | undefined, int32
3070
+ */
3071
+ max_connections?: number;
3072
+ };
3073
+
3074
+ /**
3075
+ * Generated by Kubb (https://kubb.dev/).
3076
+ * Do not edit manually.
3077
+ */
3078
+
3079
+ type UpdateProjectPathParams = {
3080
+ /**
3081
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
3082
+ * @pattern ^[a-zA-Z0-9_.-]+$
3083
+ * @type string
3084
+ */
3085
+ project_id: string;
3086
+ };
3087
+ /**
3088
+ * @description Project updated.
3089
+ */
3090
+ type UpdateProject200 = Project;
3091
+ /**
3092
+ * @description Invalid request parameters.
3093
+ */
3094
+ type UpdateProject400 = Error$1;
3095
+ /**
3096
+ * @description Missing or invalid authentication.
3097
+ */
3098
+ type UpdateProject401 = Error$1;
3099
+ /**
3100
+ * @description Operation not allowed by current plan limits.
3101
+ */
3102
+ type UpdateProject403 = Error$1;
3103
+ /**
3104
+ * @description Resource not found.
3105
+ */
3106
+ type UpdateProject404 = Error$1;
3107
+ /**
3108
+ * @description Rate limited. Try again later.
3109
+ */
3110
+ type UpdateProject429 = Error$1;
3111
+ type UpdateProjectMutationRequest = UpdateProjectRequest;
3112
+ type UpdateProjectMutationResponse = UpdateProject200;
3113
+ type UpdateProjectMutation = {
3114
+ Response: UpdateProject200;
3115
+ Request: UpdateProjectMutationRequest;
3116
+ PathParams: UpdateProjectPathParams;
3117
+ Errors: UpdateProject400 | UpdateProject401 | UpdateProject403 | UpdateProject404 | UpdateProject429;
3118
+ };
3119
+
3120
+ /**
3121
+ * Generated by Kubb (https://kubb.dev/).
3122
+ * Do not edit manually.
3123
+ */
3124
+
3125
+ type DeleteProjectPathParams = {
3126
+ /**
3127
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
3128
+ * @pattern ^[a-zA-Z0-9_.-]+$
3129
+ * @type string
3130
+ */
3131
+ project_id: string;
3132
+ };
3133
+ /**
3134
+ * @description Project deleted.
3135
+ */
3136
+ type DeleteProject204 = any;
3137
+ /**
3138
+ * @description Invalid request parameters.
3139
+ */
3140
+ type DeleteProject400 = Error$1;
3141
+ /**
3142
+ * @description Missing or invalid authentication.
3143
+ */
3144
+ type DeleteProject401 = Error$1;
3145
+ /**
3146
+ * @description Operation not allowed by current plan limits.
3147
+ */
3148
+ type DeleteProject403 = Error$1;
3149
+ /**
3150
+ * @description Resource not found.
3151
+ */
3152
+ type DeleteProject404 = Error$1;
3153
+ /**
3154
+ * @description Rate limited. Try again later.
3155
+ */
3156
+ type DeleteProject429 = Error$1;
3157
+ type DeleteProjectMutationResponse = DeleteProject204;
3158
+ type DeleteProjectMutation = {
3159
+ Response: DeleteProject204;
3160
+ PathParams: DeleteProjectPathParams;
3161
+ Errors: DeleteProject400 | DeleteProject401 | DeleteProject403 | DeleteProject404 | DeleteProject429;
3162
+ };
3163
+
3164
+ /**
3165
+ * Generated by Kubb (https://kubb.dev/).
3166
+ * Do not edit manually.
3167
+ */
3168
+ /**
3169
+ * @description Aggregated project metrics captured for a point in time.
3170
+ */
3171
+ type MetricsSnapshot = {
3172
+ /**
3173
+ * @description Unique metrics snapshot identifier.
3174
+ * @type string
3175
+ */
3176
+ id: string;
3177
+ /**
3178
+ * @description Project that produced the metrics snapshot.
3179
+ * @type string
3180
+ */
3181
+ project_id: string;
3182
+ /**
3183
+ * @description Region where the traffic was served.
3184
+ * @type string
3185
+ */
3186
+ region: string;
3187
+ /**
3188
+ * @description Total queries served during the snapshot interval.
3189
+ * @type integer, int64
3190
+ */
3191
+ queries_total: number;
3192
+ /**
3193
+ * @description Number of queries served from cache.
3194
+ * @type integer, int64
3195
+ */
3196
+ cache_hits: number;
3197
+ /**
3198
+ * @description Number of queries forwarded upstream.
3199
+ * @type integer, int64
3200
+ */
3201
+ cache_misses: number;
3202
+ /**
3203
+ * @description Current active proxy connections.
3204
+ * @type integer
3205
+ */
3206
+ active_connections: number;
3207
+ /**
3208
+ * @description Average end-to-end query latency in milliseconds.
3209
+ * @type number, double
3210
+ */
3211
+ avg_latency_ms: number;
3212
+ /**
3213
+ * @description 99th percentile end-to-end query latency in milliseconds.
3214
+ * @type number, double
3215
+ */
3216
+ p99_latency_ms: number;
3217
+ /**
3218
+ * @description Average upstream connection acquisition latency in milliseconds.
3219
+ * @type number | undefined, double
3220
+ */
3221
+ avg_connect_ms?: number;
3222
+ /**
3223
+ * @description Average upstream query execution latency in milliseconds.
3224
+ * @type number | undefined, double
3225
+ */
3226
+ avg_query_ms?: number;
3227
+ /**
3228
+ * @description When the snapshot was recorded.
3229
+ * @type string, date-time
3230
+ */
3231
+ created_at: string;
3232
+ };
3233
+
3234
+ /**
3235
+ * Generated by Kubb (https://kubb.dev/).
3236
+ * Do not edit manually.
3237
+ */
3238
+
3239
+ /**
3240
+ * @description Response envelope for recent project metrics snapshots.
3241
+ */
3242
+ type ProjectMetricsResponse = {
3243
+ /**
3244
+ * @description Metrics snapshots ordered from newest to oldest.
3245
+ * @type array
3246
+ */
3247
+ snapshots: MetricsSnapshot[];
3248
+ };
3249
+
3250
+ /**
3251
+ * Generated by Kubb (https://kubb.dev/).
3252
+ * Do not edit manually.
3253
+ */
3254
+
3255
+ type GetProjectMetricsPathParams = {
3256
+ /**
3257
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
3258
+ * @pattern ^[a-zA-Z0-9_.-]+$
3259
+ * @type string
3260
+ */
3261
+ project_id: string;
3262
+ };
3263
+ type GetProjectMetricsQueryParams = {
3264
+ /**
3265
+ * @description Maximum number of recent snapshots to return.
3266
+ * @minLength 1
3267
+ * @maxLength 1000
3268
+ * @default 60
3269
+ * @type integer | undefined
3270
+ */
3271
+ limit?: number;
3272
+ /**
3273
+ * @description Filter metrics by region code.
3274
+ * @type string | undefined
3275
+ */
3276
+ region?: string;
3277
+ };
3278
+ /**
3279
+ * @description Metrics snapshots
3280
+ */
3281
+ type GetProjectMetrics200 = ProjectMetricsResponse;
3282
+ /**
3283
+ * @description Invalid request parameters.
3284
+ */
3285
+ type GetProjectMetrics400 = Error$1;
3286
+ /**
3287
+ * @description Missing or invalid authentication.
3288
+ */
3289
+ type GetProjectMetrics401 = Error$1;
3290
+ /**
3291
+ * @description Resource not found.
3292
+ */
3293
+ type GetProjectMetrics404 = Error$1;
3294
+ /**
3295
+ * @description Rate limited. Try again later.
3296
+ */
3297
+ type GetProjectMetrics429 = Error$1;
3298
+ type GetProjectMetricsQueryResponse = GetProjectMetrics200;
3299
+ type GetProjectMetricsQuery = {
3300
+ Response: GetProjectMetrics200;
3301
+ PathParams: GetProjectMetricsPathParams;
3302
+ QueryParams: GetProjectMetricsQueryParams;
3303
+ Errors: GetProjectMetrics400 | GetProjectMetrics401 | GetProjectMetrics404 | GetProjectMetrics429;
3304
+ };
3305
+
3306
+ /**
3307
+ * Generated by Kubb (https://kubb.dev/).
3308
+ * Do not edit manually.
3309
+ */
3310
+ declare const regionProviderEnum: {
3311
+ readonly aws: "aws";
3312
+ readonly azure: "azure";
3313
+ readonly gcp: "gcp";
3314
+ };
3315
+ type RegionProviderEnumKey = (typeof regionProviderEnum)[keyof typeof regionProviderEnum];
3316
+ declare const regionStatusEnum: {
3317
+ readonly active: "active";
3318
+ readonly draining: "draining";
3319
+ readonly inactive: "inactive";
3320
+ };
3321
+ type RegionStatusEnumKey = (typeof regionStatusEnum)[keyof typeof regionStatusEnum];
3322
+ /**
3323
+ * @description Data plane region available for PgBeam traffic.
3324
+ */
3325
+ type Region = {
3326
+ /**
3327
+ * @description Region identifier (e.g. us-east-1).
3328
+ * @type string
3329
+ */
3330
+ id: string;
3331
+ /**
3332
+ * @description Human-readable region name.
3333
+ * @type string
3334
+ */
3335
+ name: string;
3336
+ /**
3337
+ * @description Cloud provider.
3338
+ * @type string
3339
+ */
3340
+ provider: RegionProviderEnumKey;
3341
+ /**
3342
+ * @description Region operational status.
3343
+ * @type string
3344
+ */
3345
+ status: RegionStatusEnumKey;
3346
+ /**
3347
+ * @description Whether new projects can currently be assigned to the region.
3348
+ * @type boolean
3349
+ */
3350
+ available: boolean;
3351
+ /**
3352
+ * @description Continent where the region is located.
3353
+ * @type string | undefined
3354
+ */
3355
+ continent?: string;
3356
+ /**
3357
+ * @description Country where the region is located.
3358
+ * @type string | undefined
3359
+ */
3360
+ country?: string;
3361
+ };
3362
+
3363
+ /**
3364
+ * Generated by Kubb (https://kubb.dev/).
3365
+ * Do not edit manually.
3366
+ */
3367
+
3368
+ /**
3369
+ * @description Response envelope for available region queries.
3370
+ */
3371
+ type ListRegionsResponse = {
3372
+ /**
3373
+ * @description Regions currently known to the control plane.
3374
+ * @type array
3375
+ */
3376
+ regions: Region[];
3377
+ };
3378
+
3379
+ /**
3380
+ * Generated by Kubb (https://kubb.dev/).
3381
+ * Do not edit manually.
3382
+ */
3383
+
3384
+ /**
3385
+ * @description List of regions.
3386
+ */
3387
+ type ListRegions200 = ListRegionsResponse;
3388
+ /**
3389
+ * @description Missing or invalid authentication.
3390
+ */
3391
+ type ListRegions401 = Error$1;
3392
+ /**
3393
+ * @description Rate limited. Try again later.
3394
+ */
3395
+ type ListRegions429 = Error$1;
3396
+ type ListRegionsQueryResponse = ListRegions200;
3397
+ type ListRegionsQuery = {
3398
+ Response: ListRegions200;
3399
+ Errors: ListRegions401 | ListRegions429;
3400
+ };
3401
+
3402
+ /**
3403
+ * Generated by Kubb (https://kubb.dev/).
3404
+ * Do not edit manually.
3405
+ */
3406
+
3407
+ /**
3408
+ * @description Read replica registered for a primary database.
3409
+ */
3410
+ type Replica = {
3411
+ /**
3412
+ * @description Unique replica identifier (prefixed).
3413
+ * @type string
3414
+ */
3415
+ id: string;
3416
+ /**
3417
+ * @description Parent database ID.
3418
+ * @type string
3419
+ */
3420
+ database_id: string;
3421
+ /**
3422
+ * @description PostgreSQL replica host.
3423
+ * @type string
3424
+ */
3425
+ host: string;
3426
+ /**
3427
+ * @description PostgreSQL replica port.
3428
+ * @minLength 1
3429
+ * @maxLength 65535
3430
+ * @type integer
3431
+ */
3432
+ port: number;
3433
+ /**
3434
+ * @description PostgreSQL SSL connection mode.
3435
+ * @type string
3436
+ */
3437
+ ssl_mode: SSLMode;
3438
+ /**
3439
+ * @description When the replica was created.
3440
+ * @type string, date-time
3441
+ */
3442
+ created_at: string;
3443
+ /**
3444
+ * @description When the replica was last updated.
3445
+ * @type string, date-time
3446
+ */
3447
+ updated_at: string;
3448
+ };
3449
+
3450
+ /**
3451
+ * Generated by Kubb (https://kubb.dev/).
3452
+ * Do not edit manually.
3453
+ */
3454
+
3455
+ /**
3456
+ * @description Response envelope for listing registered replicas.
3457
+ */
3458
+ type ListReplicasResponse = {
3459
+ /**
3460
+ * @description Read replicas attached to the database.
3461
+ * @type array
3462
+ */
3463
+ replicas: Replica[];
3464
+ };
3465
+
3466
+ /**
3467
+ * Generated by Kubb (https://kubb.dev/).
3468
+ * Do not edit manually.
3469
+ */
3470
+
3471
+ type ListReplicasPathParams = {
3472
+ /**
3473
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
3474
+ * @pattern ^[a-zA-Z0-9_.-]+$
3475
+ * @type string
3476
+ */
3477
+ database_id: string;
3478
+ };
3479
+ /**
3480
+ * @description List of replicas.
3481
+ */
3482
+ type ListReplicas200 = ListReplicasResponse;
3483
+ /**
3484
+ * @description Invalid request parameters.
3485
+ */
3486
+ type ListReplicas400 = Error$1;
3487
+ /**
3488
+ * @description Missing or invalid authentication.
3489
+ */
3490
+ type ListReplicas401 = Error$1;
3491
+ /**
3492
+ * @description Operation not allowed by current plan limits.
3493
+ */
3494
+ type ListReplicas403 = Error$1;
3495
+ /**
3496
+ * @description Resource not found.
3497
+ */
3498
+ type ListReplicas404 = Error$1;
3499
+ /**
3500
+ * @description Rate limited. Try again later.
3501
+ */
3502
+ type ListReplicas429 = Error$1;
3503
+ type ListReplicasQueryResponse = ListReplicas200;
3504
+ type ListReplicasQuery = {
3505
+ Response: ListReplicas200;
3506
+ PathParams: ListReplicasPathParams;
3507
+ Errors: ListReplicas400 | ListReplicas401 | ListReplicas403 | ListReplicas404 | ListReplicas429;
3508
+ };
3509
+
3510
+ /**
3511
+ * Generated by Kubb (https://kubb.dev/).
3512
+ * Do not edit manually.
3513
+ */
3514
+
3515
+ /**
3516
+ * @description Request body for adding a read replica to a database.
3517
+ */
3518
+ type CreateReplicaRequest = {
3519
+ /**
3520
+ * @description PostgreSQL replica host.
3521
+ * @minLength 1
3522
+ * @pattern ^[^\s\x00]+$
3523
+ * @type string
3524
+ */
3525
+ host: string;
3526
+ /**
3527
+ * @description PostgreSQL replica port.
3528
+ * @minLength 1
3529
+ * @maxLength 65535
3530
+ * @type integer
3531
+ */
3532
+ port: number;
3533
+ /**
3534
+ * @description PostgreSQL SSL connection mode.
3535
+ * @type string | undefined
3536
+ */
3537
+ ssl_mode?: SSLMode;
3538
+ };
3539
+
3540
+ /**
3541
+ * Generated by Kubb (https://kubb.dev/).
3542
+ * Do not edit manually.
3543
+ */
3544
+
3545
+ type CreateReplicaPathParams = {
3546
+ /**
3547
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
3548
+ * @pattern ^[a-zA-Z0-9_.-]+$
3549
+ * @type string
3550
+ */
3551
+ database_id: string;
3552
+ };
3553
+ /**
3554
+ * @description Replica created.
3555
+ */
3556
+ type CreateReplica201 = Replica;
3557
+ /**
3558
+ * @description Invalid request parameters.
3559
+ */
3560
+ type CreateReplica400 = Error$1;
3561
+ /**
3562
+ * @description Missing or invalid authentication.
3563
+ */
3564
+ type CreateReplica401 = Error$1;
3565
+ /**
3566
+ * @description Operation not allowed by current plan limits.
3567
+ */
3568
+ type CreateReplica403 = Error$1;
3569
+ /**
3570
+ * @description Resource not found.
3571
+ */
3572
+ type CreateReplica404 = Error$1;
3573
+ /**
3574
+ * @description Rate limited. Try again later.
3575
+ */
3576
+ type CreateReplica429 = Error$1;
3577
+ type CreateReplicaMutationRequest = CreateReplicaRequest;
3578
+ type CreateReplicaMutationResponse = CreateReplica201;
3579
+ type CreateReplicaMutation = {
3580
+ Response: CreateReplica201;
3581
+ Request: CreateReplicaMutationRequest;
3582
+ PathParams: CreateReplicaPathParams;
3583
+ Errors: CreateReplica400 | CreateReplica401 | CreateReplica403 | CreateReplica404 | CreateReplica429;
3584
+ };
3585
+
3586
+ /**
3587
+ * Generated by Kubb (https://kubb.dev/).
3588
+ * Do not edit manually.
3589
+ */
3590
+
3591
+ type DeleteReplicaPathParams = {
3592
+ /**
3593
+ * @description Unique database identifier (prefixed, e.g. db_xxx).
3594
+ * @pattern ^[a-zA-Z0-9_.-]+$
3595
+ * @type string
3596
+ */
3597
+ database_id: string;
3598
+ /**
3599
+ * @description Unique replica identifier (prefixed, e.g. rep_xxx).
3600
+ * @pattern ^[a-zA-Z0-9_.-]+$
3601
+ * @type string
3602
+ */
3603
+ replica_id: string;
3604
+ };
3605
+ /**
3606
+ * @description Replica deleted.
3607
+ */
3608
+ type DeleteReplica204 = any;
3609
+ /**
3610
+ * @description Invalid request parameters.
3611
+ */
3612
+ type DeleteReplica400 = Error$1;
3613
+ /**
3614
+ * @description Missing or invalid authentication.
3615
+ */
3616
+ type DeleteReplica401 = Error$1;
3617
+ /**
3618
+ * @description Operation not allowed by current plan limits.
3619
+ */
3620
+ type DeleteReplica403 = Error$1;
3621
+ /**
3622
+ * @description Resource not found.
3623
+ */
3624
+ type DeleteReplica404 = Error$1;
3625
+ /**
3626
+ * @description Rate limited. Try again later.
3627
+ */
3628
+ type DeleteReplica429 = Error$1;
3629
+ type DeleteReplicaMutationResponse = DeleteReplica204;
3630
+ type DeleteReplicaMutation = {
3631
+ Response: DeleteReplica204;
3632
+ PathParams: DeleteReplicaPathParams;
3633
+ Errors: DeleteReplica400 | DeleteReplica401 | DeleteReplica403 | DeleteReplica404 | DeleteReplica429;
3634
+ };
3635
+
3636
+ /**
3637
+ * Generated by Kubb (https://kubb.dev/).
3638
+ * Do not edit manually.
3639
+ */
3640
+ /**
3641
+ * @description Daily usage totals aggregated across all projects in an organization.
3642
+ */
3643
+ type DailyUsage = {
3644
+ /**
3645
+ * @description Usage date in UTC.
3646
+ * @type string, date
3647
+ */
3648
+ day: string;
3649
+ /**
3650
+ * @description Total queries served on the day.
3651
+ * @type integer, int64
3652
+ */
3653
+ queries_total: number;
3654
+ /**
3655
+ * @description Total cache hits on the day.
3656
+ * @type integer, int64
3657
+ */
3658
+ cache_hits: number;
3659
+ /**
3660
+ * @description Total cache misses on the day.
3661
+ * @type integer, int64
3662
+ */
3663
+ cache_misses: number;
3664
+ /**
3665
+ * @description Total proxy connection time consumed on the day.
3666
+ * @type integer, int64
3667
+ */
3668
+ connection_seconds: number;
3669
+ /**
3670
+ * @description Total bytes transferred to clients.
3671
+ * @type integer, int64
3672
+ */
3673
+ bytes_transferred: number;
3674
+ };
3675
+
3676
+ /**
3677
+ * Generated by Kubb (https://kubb.dev/).
3678
+ * Do not edit manually.
3679
+ */
3680
+
3681
+ /**
3682
+ * @description Response envelope for organization usage queries.
3683
+ */
3684
+ type UsageResponse = {
3685
+ /**
3686
+ * @description Daily usage entries aggregated across the organization.
3687
+ * @type array
3688
+ */
3689
+ usage: DailyUsage[];
3690
+ };
3691
+
3692
+ /**
3693
+ * Generated by Kubb (https://kubb.dev/).
3694
+ * Do not edit manually.
3695
+ */
3696
+
3697
+ type GetOrganizationUsagePathParams = {
3698
+ /**
3699
+ * @description Unique organization identifier.
3700
+ * @pattern ^[a-zA-Z0-9_.-]+$
3701
+ * @type string
3702
+ */
3703
+ org_id: string;
3704
+ };
3705
+ type GetOrganizationUsageQueryParams = {
3706
+ /**
3707
+ * @description Start date (inclusive, YYYY-MM-DD).
3708
+ * @type string, date
3709
+ */
3710
+ start_date: string;
3711
+ /**
3712
+ * @description End date (inclusive, YYYY-MM-DD).
3713
+ * @type string, date
3714
+ */
3715
+ end_date: string;
3716
+ };
3717
+ /**
3718
+ * @description Daily usage data.
3719
+ */
3720
+ type GetOrganizationUsage200 = UsageResponse;
3721
+ /**
3722
+ * @description Invalid request parameters.
3723
+ */
3724
+ type GetOrganizationUsage400 = Error$1;
3725
+ /**
3726
+ * @description Missing or invalid authentication.
3727
+ */
3728
+ type GetOrganizationUsage401 = Error$1;
3729
+ /**
3730
+ * @description Operation not allowed by current plan limits.
3731
+ */
3732
+ type GetOrganizationUsage403 = Error$1;
3733
+ /**
3734
+ * @description Rate limited. Try again later.
3735
+ */
3736
+ type GetOrganizationUsage429 = Error$1;
3737
+ type GetOrganizationUsageQueryResponse = GetOrganizationUsage200;
3738
+ type GetOrganizationUsageQuery = {
3739
+ Response: GetOrganizationUsage200;
3740
+ PathParams: GetOrganizationUsagePathParams;
3741
+ QueryParams: GetOrganizationUsageQueryParams;
3742
+ Errors: GetOrganizationUsage400 | GetOrganizationUsage401 | GetOrganizationUsage403 | GetOrganizationUsage429;
3743
+ };
3744
+
3745
+ /**
3746
+ * Generated by Kubb (https://kubb.dev/).
3747
+ * Do not edit manually.
3748
+ */
3749
+ /**
3750
+ * @description Daily usage totals for a single project and region.
3751
+ */
3752
+ type ProjectDailyUsage = {
3753
+ /**
3754
+ * @description Usage date in UTC.
3755
+ * @type string, date
3756
+ */
3757
+ day: string;
3758
+ /**
3759
+ * @description Region where the traffic was served.
3760
+ * @type string
3761
+ */
3762
+ region: string;
3763
+ /**
3764
+ * @description Total queries served on the day.
3765
+ * @type integer, int64
3766
+ */
3767
+ queries_total: number;
3768
+ /**
3769
+ * @description Total cache hits on the day.
3770
+ * @type integer, int64
3771
+ */
3772
+ cache_hits: number;
3773
+ /**
3774
+ * @description Total cache misses on the day.
3775
+ * @type integer, int64
3776
+ */
3777
+ cache_misses: number;
3778
+ /**
3779
+ * @description Total proxy connection time consumed on the day.
3780
+ * @type integer, int64
3781
+ */
3782
+ connection_seconds: number;
3783
+ /**
3784
+ * @description Total bytes transferred to clients.
3785
+ * @type integer, int64
3786
+ */
3787
+ bytes_transferred: number;
3788
+ };
3789
+
3790
+ /**
3791
+ * Generated by Kubb (https://kubb.dev/).
3792
+ * Do not edit manually.
3793
+ */
3794
+
3795
+ /**
3796
+ * @description Response envelope for project usage queries.
3797
+ */
3798
+ type ProjectUsageResponse = {
3799
+ /**
3800
+ * @description Daily usage entries grouped by region for the project.
3801
+ * @type array
3802
+ */
3803
+ usage: ProjectDailyUsage[];
3804
+ };
3805
+
3806
+ /**
3807
+ * Generated by Kubb (https://kubb.dev/).
3808
+ * Do not edit manually.
3809
+ */
3810
+
3811
+ type GetProjectUsagePathParams = {
3812
+ /**
3813
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
3814
+ * @pattern ^[a-zA-Z0-9_.-]+$
3815
+ * @type string
3816
+ */
3817
+ project_id: string;
3818
+ };
3819
+ type GetProjectUsageQueryParams = {
3820
+ /**
3821
+ * @description Start date (inclusive, YYYY-MM-DD).
3822
+ * @type string, date
3823
+ */
3824
+ start_date: string;
3825
+ /**
3826
+ * @description End date (inclusive, YYYY-MM-DD).
3827
+ * @type string, date
3828
+ */
3829
+ end_date: string;
3830
+ };
3831
+ /**
3832
+ * @description Daily usage data by region.
3833
+ */
3834
+ type GetProjectUsage200 = ProjectUsageResponse;
3835
+ /**
3836
+ * @description Invalid request parameters.
3837
+ */
3838
+ type GetProjectUsage400 = Error$1;
3839
+ /**
3840
+ * @description Missing or invalid authentication.
3841
+ */
3842
+ type GetProjectUsage401 = Error$1;
3843
+ /**
3844
+ * @description Resource not found.
3845
+ */
3846
+ type GetProjectUsage404 = Error$1;
3847
+ /**
3848
+ * @description Rate limited. Try again later.
3849
+ */
3850
+ type GetProjectUsage429 = Error$1;
3851
+ type GetProjectUsageQueryResponse = GetProjectUsage200;
3852
+ type GetProjectUsageQuery = {
3853
+ Response: GetProjectUsage200;
3854
+ PathParams: GetProjectUsagePathParams;
3855
+ QueryParams: GetProjectUsageQueryParams;
3856
+ Errors: GetProjectUsage400 | GetProjectUsage401 | GetProjectUsage404 | GetProjectUsage429;
3857
+ };
3858
+
3859
+ /**
3860
+ * Generated by scripts/generate-maps.ts — do not edit manually.
3861
+ * Run: pnpm --filter pgbeam generate
3862
+ */
3863
+
3864
+ interface ApiOperations {
3865
+ account: {
3866
+ exportAccountData(): Promise<ExportAccountDataQueryResponse>;
3867
+ getOnboardingProgress(params: {
3868
+ pathParams: GetOnboardingProgressPathParams;
3869
+ }): Promise<GetOnboardingProgressQueryResponse>;
3870
+ updateOnboardingProgress(params: {
3871
+ pathParams: UpdateOnboardingProgressPathParams;
3872
+ body: UpdateOnboardingProgressMutationRequest;
3873
+ }): Promise<UpdateOnboardingProgressMutationResponse>;
3874
+ };
3875
+ analytics: {
3876
+ getOrganizationActivity(params: {
3877
+ pathParams: GetOrganizationActivityPathParams;
3878
+ queryParams?: GetOrganizationActivityQueryParams;
3879
+ }): Promise<GetOrganizationActivityQueryResponse>;
3880
+ listPlans(): Promise<ListPlansQueryResponse>;
3881
+ getOrganizationPlan(params: {
3882
+ pathParams: GetOrganizationPlanPathParams;
3883
+ }): Promise<GetOrganizationPlanQueryResponse>;
3884
+ updateSpendLimit(params: {
3885
+ pathParams: UpdateSpendLimitPathParams;
3886
+ body: UpdateSpendLimitMutationRequest;
3887
+ }): Promise<UpdateSpendLimitMutationResponse>;
3888
+ submitCancellationFeedback(params: {
3889
+ pathParams: SubmitCancellationFeedbackPathParams;
3890
+ body: SubmitCancellationFeedbackMutationRequest;
3891
+ }): Promise<void>;
3892
+ getProjectInsights(params: {
3893
+ pathParams: GetProjectInsightsPathParams;
3894
+ queryParams?: GetProjectInsightsQueryParams;
3895
+ }): Promise<GetProjectInsightsQueryResponse>;
3896
+ getOrganizationUsage(params: {
3897
+ pathParams: GetOrganizationUsagePathParams;
3898
+ queryParams: GetOrganizationUsageQueryParams;
3899
+ }): Promise<GetOrganizationUsageQueryResponse>;
3900
+ getProjectUsage(params: {
3901
+ pathParams: GetProjectUsagePathParams;
3902
+ queryParams: GetProjectUsageQueryParams;
3903
+ }): Promise<GetProjectUsageQueryResponse>;
3904
+ };
3905
+ projects: {
3906
+ listCacheRules(params: {
3907
+ pathParams: ListCacheRulesPathParams;
3908
+ queryParams?: ListCacheRulesQueryParams;
3909
+ }): Promise<ListCacheRulesQueryResponse>;
3910
+ updateCacheRule(params: {
3911
+ pathParams: UpdateCacheRulePathParams;
3912
+ body: UpdateCacheRuleMutationRequest;
3913
+ }): Promise<UpdateCacheRuleMutationResponse>;
3914
+ listCustomDomains(params: {
3915
+ pathParams: ListCustomDomainsPathParams;
3916
+ queryParams?: ListCustomDomainsQueryParams;
3917
+ }): Promise<ListCustomDomainsQueryResponse>;
3918
+ createCustomDomain(params: {
3919
+ pathParams: CreateCustomDomainPathParams;
3920
+ body: CreateCustomDomainMutationRequest;
3921
+ }): Promise<CreateCustomDomainMutationResponse>;
3922
+ deleteCustomDomain(params: {
3923
+ pathParams: DeleteCustomDomainPathParams;
3924
+ }): Promise<void>;
3925
+ verifyCustomDomain(params: {
3926
+ pathParams: VerifyCustomDomainPathParams;
3927
+ }): Promise<VerifyCustomDomainMutationResponse>;
3928
+ listProjects(params: {
3929
+ queryParams: ListProjectsQueryParams;
3930
+ }): Promise<ListProjectsQueryResponse>;
3931
+ createProject(params: {
3932
+ body: CreateProjectMutationRequest;
3933
+ }): Promise<CreateProjectMutationResponse>;
3934
+ getProject(params: {
3935
+ pathParams: GetProjectPathParams;
3936
+ }): Promise<GetProjectQueryResponse>;
3937
+ updateProject(params: {
3938
+ pathParams: UpdateProjectPathParams;
3939
+ body: UpdateProjectMutationRequest;
3940
+ }): Promise<UpdateProjectMutationResponse>;
3941
+ deleteProject(params: {
3942
+ pathParams: DeleteProjectPathParams;
3943
+ }): Promise<void>;
3944
+ getProjectMetrics(params: {
3945
+ pathParams: GetProjectMetricsPathParams;
3946
+ queryParams?: GetProjectMetricsQueryParams;
3947
+ }): Promise<GetProjectMetricsQueryResponse>;
3948
+ listReplicas(params: {
3949
+ pathParams: ListReplicasPathParams;
3950
+ }): Promise<ListReplicasQueryResponse>;
3951
+ createReplica(params: {
3952
+ pathParams: CreateReplicaPathParams;
3953
+ body: CreateReplicaMutationRequest;
3954
+ }): Promise<CreateReplicaMutationResponse>;
3955
+ deleteReplica(params: {
3956
+ pathParams: DeleteReplicaPathParams;
3957
+ }): Promise<void>;
3958
+ };
3959
+ databases: {
3960
+ listDatabases(params: {
3961
+ pathParams: ListDatabasesPathParams;
3962
+ queryParams?: ListDatabasesQueryParams;
3963
+ }): Promise<ListDatabasesQueryResponse>;
3964
+ createDatabase(params: {
3965
+ pathParams: CreateDatabasePathParams;
3966
+ body: CreateDatabaseMutationRequest;
3967
+ }): Promise<CreateDatabaseMutationResponse>;
3968
+ getDatabase(params: {
3969
+ pathParams: GetDatabasePathParams;
3970
+ }): Promise<GetDatabaseQueryResponse>;
3971
+ updateDatabase(params: {
3972
+ pathParams: UpdateDatabasePathParams;
3973
+ body: UpdateDatabaseMutationRequest;
3974
+ }): Promise<UpdateDatabaseMutationResponse>;
3975
+ deleteDatabase(params: {
3976
+ pathParams: DeleteDatabasePathParams;
3977
+ }): Promise<void>;
3978
+ testDatabaseConnection(params: {
3979
+ pathParams: TestDatabaseConnectionPathParams;
3980
+ }): Promise<TestDatabaseConnectionMutationResponse>;
3981
+ };
3982
+ platform: {
3983
+ getHealth(): Promise<GetHealthQueryResponse>;
3984
+ listRegions(): Promise<ListRegionsQueryResponse>;
3985
+ };
3986
+ }
3987
+ interface RequestMap {
3988
+ "GET /v1/account/export": {
3989
+ params?: undefined;
3990
+ response: ExportAccountDataQueryResponse;
3991
+ };
3992
+ "GET /v1/organizations/{org_id}/activity": {
3993
+ params: {
3994
+ pathParams: GetOrganizationActivityPathParams;
3995
+ queryParams?: GetOrganizationActivityQueryParams;
3996
+ };
3997
+ response: GetOrganizationActivityQueryResponse;
3998
+ };
3999
+ "GET /v1/plans": {
4000
+ params?: undefined;
4001
+ response: ListPlansQueryResponse;
4002
+ };
4003
+ "GET /v1/organizations/{org_id}/plan": {
4004
+ params: {
4005
+ pathParams: GetOrganizationPlanPathParams;
4006
+ };
4007
+ response: GetOrganizationPlanQueryResponse;
4008
+ };
4009
+ "PUT /v1/organizations/{org_id}/spend-limit": {
4010
+ params: {
4011
+ pathParams: UpdateSpendLimitPathParams;
4012
+ body: UpdateSpendLimitMutationRequest;
4013
+ };
4014
+ response: UpdateSpendLimitMutationResponse;
4015
+ };
4016
+ "POST /v1/organizations/{org_id}/cancellation-feedback": {
4017
+ params: {
4018
+ pathParams: SubmitCancellationFeedbackPathParams;
4019
+ body: SubmitCancellationFeedbackMutationRequest;
4020
+ };
4021
+ response: void;
4022
+ };
4023
+ "GET /v1/projects/{project_id}/databases/{database_id}/cache-rules": {
4024
+ params: {
4025
+ pathParams: ListCacheRulesPathParams;
4026
+ queryParams?: ListCacheRulesQueryParams;
4027
+ };
4028
+ response: ListCacheRulesQueryResponse;
4029
+ };
4030
+ "PUT /v1/projects/{project_id}/databases/{database_id}/cache-rules/{query_hash}": {
4031
+ params: {
4032
+ pathParams: UpdateCacheRulePathParams;
4033
+ body: UpdateCacheRuleMutationRequest;
4034
+ };
4035
+ response: UpdateCacheRuleMutationResponse;
4036
+ };
4037
+ "GET /v1/projects/{project_id}/databases": {
4038
+ params: {
4039
+ pathParams: ListDatabasesPathParams;
4040
+ queryParams?: ListDatabasesQueryParams;
4041
+ };
4042
+ response: ListDatabasesQueryResponse;
4043
+ };
4044
+ "POST /v1/projects/{project_id}/databases": {
4045
+ params: {
4046
+ pathParams: CreateDatabasePathParams;
4047
+ body: CreateDatabaseMutationRequest;
4048
+ };
4049
+ response: CreateDatabaseMutationResponse;
4050
+ };
4051
+ "GET /v1/projects/{project_id}/databases/{database_id}": {
4052
+ params: {
4053
+ pathParams: GetDatabasePathParams;
4054
+ };
4055
+ response: GetDatabaseQueryResponse;
4056
+ };
4057
+ "PATCH /v1/projects/{project_id}/databases/{database_id}": {
4058
+ params: {
4059
+ pathParams: UpdateDatabasePathParams;
4060
+ body: UpdateDatabaseMutationRequest;
4061
+ };
4062
+ response: UpdateDatabaseMutationResponse;
4063
+ };
4064
+ "DELETE /v1/projects/{project_id}/databases/{database_id}": {
4065
+ params: {
4066
+ pathParams: DeleteDatabasePathParams;
4067
+ };
4068
+ response: void;
4069
+ };
4070
+ "POST /v1/projects/{project_id}/databases/{database_id}/test-connection": {
4071
+ params: {
4072
+ pathParams: TestDatabaseConnectionPathParams;
4073
+ };
4074
+ response: TestDatabaseConnectionMutationResponse;
4075
+ };
4076
+ "GET /v1/projects/{project_id}/domains": {
4077
+ params: {
4078
+ pathParams: ListCustomDomainsPathParams;
4079
+ queryParams?: ListCustomDomainsQueryParams;
4080
+ };
4081
+ response: ListCustomDomainsQueryResponse;
4082
+ };
4083
+ "POST /v1/projects/{project_id}/domains": {
4084
+ params: {
4085
+ pathParams: CreateCustomDomainPathParams;
4086
+ body: CreateCustomDomainMutationRequest;
4087
+ };
4088
+ response: CreateCustomDomainMutationResponse;
4089
+ };
4090
+ "DELETE /v1/projects/{project_id}/domains/{domain_id}": {
4091
+ params: {
4092
+ pathParams: DeleteCustomDomainPathParams;
4093
+ };
4094
+ response: void;
4095
+ };
4096
+ "POST /v1/projects/{project_id}/domains/{domain_id}/verify": {
4097
+ params: {
4098
+ pathParams: VerifyCustomDomainPathParams;
4099
+ };
4100
+ response: VerifyCustomDomainMutationResponse;
4101
+ };
4102
+ "GET /v1/health": {
4103
+ params?: undefined;
4104
+ response: GetHealthQueryResponse;
4105
+ };
4106
+ "GET /v1/projects/{project_id}/insights": {
4107
+ params: {
4108
+ pathParams: GetProjectInsightsPathParams;
4109
+ queryParams?: GetProjectInsightsQueryParams;
4110
+ };
4111
+ response: GetProjectInsightsQueryResponse;
4112
+ };
4113
+ "GET /v1/organizations/{org_id}/onboarding": {
4114
+ params: {
4115
+ pathParams: GetOnboardingProgressPathParams;
4116
+ };
4117
+ response: GetOnboardingProgressQueryResponse;
4118
+ };
4119
+ "PATCH /v1/organizations/{org_id}/onboarding": {
4120
+ params: {
4121
+ pathParams: UpdateOnboardingProgressPathParams;
4122
+ body: UpdateOnboardingProgressMutationRequest;
4123
+ };
4124
+ response: UpdateOnboardingProgressMutationResponse;
4125
+ };
4126
+ "GET /v1/projects": {
4127
+ params: {
4128
+ queryParams: ListProjectsQueryParams;
4129
+ };
4130
+ response: ListProjectsQueryResponse;
4131
+ };
4132
+ "POST /v1/projects": {
4133
+ params: {
4134
+ body: CreateProjectMutationRequest;
4135
+ };
4136
+ response: CreateProjectMutationResponse;
4137
+ };
4138
+ "GET /v1/projects/{project_id}": {
4139
+ params: {
4140
+ pathParams: GetProjectPathParams;
4141
+ };
4142
+ response: GetProjectQueryResponse;
4143
+ };
4144
+ "PATCH /v1/projects/{project_id}": {
4145
+ params: {
4146
+ pathParams: UpdateProjectPathParams;
4147
+ body: UpdateProjectMutationRequest;
4148
+ };
4149
+ response: UpdateProjectMutationResponse;
4150
+ };
4151
+ "DELETE /v1/projects/{project_id}": {
4152
+ params: {
4153
+ pathParams: DeleteProjectPathParams;
4154
+ };
4155
+ response: void;
4156
+ };
4157
+ "GET /v1/projects/{project_id}/metrics": {
4158
+ params: {
4159
+ pathParams: GetProjectMetricsPathParams;
4160
+ queryParams?: GetProjectMetricsQueryParams;
4161
+ };
4162
+ response: GetProjectMetricsQueryResponse;
4163
+ };
4164
+ "GET /v1/regions": {
4165
+ params?: undefined;
4166
+ response: ListRegionsQueryResponse;
4167
+ };
4168
+ "GET /v1/databases/{database_id}/replicas": {
4169
+ params: {
4170
+ pathParams: ListReplicasPathParams;
4171
+ };
4172
+ response: ListReplicasQueryResponse;
4173
+ };
4174
+ "POST /v1/databases/{database_id}/replicas": {
4175
+ params: {
4176
+ pathParams: CreateReplicaPathParams;
4177
+ body: CreateReplicaMutationRequest;
4178
+ };
4179
+ response: CreateReplicaMutationResponse;
4180
+ };
4181
+ "DELETE /v1/databases/{database_id}/replicas/{replica_id}": {
4182
+ params: {
4183
+ pathParams: DeleteReplicaPathParams;
4184
+ };
4185
+ response: void;
4186
+ };
4187
+ "GET /v1/organizations/{org_id}/usage": {
4188
+ params: {
4189
+ pathParams: GetOrganizationUsagePathParams;
4190
+ queryParams: GetOrganizationUsageQueryParams;
4191
+ };
4192
+ response: GetOrganizationUsageQueryResponse;
4193
+ };
4194
+ "GET /v1/projects/{project_id}/usage": {
4195
+ params: {
4196
+ pathParams: GetProjectUsagePathParams;
4197
+ queryParams: GetProjectUsageQueryParams;
4198
+ };
4199
+ response: GetProjectUsageQueryResponse;
4200
+ };
4201
+ }
4202
+ type Route = keyof RequestMap;
4203
+
4204
+ declare class ApiError extends Error {
4205
+ status: number;
4206
+ statusText: string;
4207
+ body: unknown;
4208
+ constructor(status: number, statusText: string, body: unknown);
4209
+ }
4210
+ /** Extract a human-readable message from an API error body. */
4211
+ declare function extractMessage(body: unknown): string | undefined;
4212
+ type OnResponseHook = (response: Response) => void | Promise<void>;
4213
+ interface RetryConfig {
4214
+ /** Max retry attempts after initial request (default: 5, 0 = disabled). */
4215
+ maxRetries?: number;
4216
+ /** Initial backoff in ms (default: 500). */
4217
+ initialDelayMs?: number;
4218
+ /** Max backoff in ms (default: 30_000). */
4219
+ maxDelayMs?: number;
4220
+ /** Auto-send Idempotency-Key on mutating retries (default: true). */
4221
+ idempotencyKeys?: boolean;
4222
+ }
4223
+
4224
+ interface PgBeamClientOptions {
4225
+ /** JWT token, or async function that resolves one (for lazy/refreshing tokens). */
4226
+ token: string | null | (() => Promise<string | null>);
4227
+ /** Base URL of the PgBeam API (e.g. "https://api.pgbeam.com"). */
4228
+ baseUrl: string;
4229
+ /** Optional custom fetch implementation. */
4230
+ fetch?: typeof globalThis.fetch;
4231
+ /** Optional hook called after every response (e.g. for 401 redirect). */
4232
+ onResponse?: OnResponseHook;
4233
+ /** Retry configuration. Default: { maxRetries: 5 }. Set false to disable. */
4234
+ retry?: RetryConfig | false;
4235
+ }
4236
+ /** Type-safe client with tag-based proxy access and .request() method. */
4237
+ type ApiClient = ApiOperations & {
4238
+ /**
4239
+ * Type-safe request by route string.
4240
+ *
4241
+ * @example
4242
+ * const projects = await api.request('GET /v1/projects', { queryParams: { org_id } });
4243
+ * const project = await api.request('GET /v1/projects/{project_id}', { pathParams: { project_id } });
4244
+ */
4245
+ request: <K extends Route>(route: K, ...args: RequestMap[K]["params"] extends undefined ? [params?: undefined] : [params: RequestMap[K]["params"]]) => Promise<RequestMap[K]["response"]>;
4246
+ };
4247
+ declare class PgBeamClient {
4248
+ private _baseUrl;
4249
+ private _tokenOrFn;
4250
+ private _fetchImpl?;
4251
+ private _onResponse?;
4252
+ private _retry?;
4253
+ private _api?;
4254
+ constructor(options: PgBeamClientOptions);
4255
+ private _resolveToken;
4256
+ private _call;
4257
+ /** Access API operations via tag-based namespaces or `.request()`. */
4258
+ get api(): ApiClient;
4259
+ }
4260
+
4261
+ export { ApiError, PgBeamClient, SSLModeEnum, cacheRuleEntryQueryTypeEnum, cacheRuleEntryRecommendationEnum, createProjectRequestCloudEnum, databaseRoleEnum, extractMessage, getProjectInsightsQueryParamsRangeEnum, healthResponseStatusEnum, listProjectsQueryParamsSortByEnum, organizationPlanBillingProviderEnum, organizationPlanPlanEnum, organizationPlanSubscriptionStatusEnum, poolModeEnum, projectCloudEnum, projectStatusEnum, regionProviderEnum, regionStatusEnum, updateOnboardingRequestStepEnum };
4262
+ export type { AccountExport, ActivityEntry, ActivityResponse, ApiClient, CacheConfig, CacheRuleEntry, CacheRuleEntryQueryTypeEnumKey, CacheRuleEntryRecommendationEnumKey, CacheSummary, CancellationFeedbackRequest, CreateCustomDomain201, CreateCustomDomain400, CreateCustomDomain401, CreateCustomDomain403, CreateCustomDomain404, CreateCustomDomain409, CreateCustomDomain429, CreateCustomDomainMutation, CreateCustomDomainMutationRequest, CreateCustomDomainMutationResponse, CreateCustomDomainPathParams, CreateCustomDomainRequest, CreateDatabase201, CreateDatabase400, CreateDatabase401, CreateDatabase403, CreateDatabase404, CreateDatabase429, CreateDatabaseMutation, CreateDatabaseMutationRequest, CreateDatabaseMutationResponse, CreateDatabasePathParams, CreateDatabaseRequest, CreateProject201, CreateProject400, CreateProject401, CreateProject403, CreateProject409, CreateProject429, CreateProjectMutation, CreateProjectMutationRequest, CreateProjectMutationResponse, CreateProjectRequest, CreateProjectRequestCloudEnumKey, CreateProjectResponse, CreateReplica201, CreateReplica400, CreateReplica401, CreateReplica403, CreateReplica404, CreateReplica429, CreateReplicaMutation, CreateReplicaMutationRequest, CreateReplicaMutationResponse, CreateReplicaPathParams, CreateReplicaRequest, CustomDomain, DailyUsage, Database, DatabaseRole, DatabaseRoleEnumKey, DeleteCustomDomain204, DeleteCustomDomain400, DeleteCustomDomain401, DeleteCustomDomain403, DeleteCustomDomain404, DeleteCustomDomain429, DeleteCustomDomainMutation, DeleteCustomDomainMutationResponse, DeleteCustomDomainPathParams, DeleteDatabase204, DeleteDatabase400, DeleteDatabase401, DeleteDatabase403, DeleteDatabase404, DeleteDatabase429, DeleteDatabaseMutation, DeleteDatabaseMutationResponse, DeleteDatabasePathParams, DeleteProject204, DeleteProject400, DeleteProject401, DeleteProject403, DeleteProject404, DeleteProject429, DeleteProjectMutation, DeleteProjectMutationResponse, DeleteProjectPathParams, DeleteReplica204, DeleteReplica400, DeleteReplica401, DeleteReplica403, DeleteReplica404, DeleteReplica429, DeleteReplicaMutation, DeleteReplicaMutationResponse, DeleteReplicaPathParams, Error$1 as Error, ExportAccountData200, ExportAccountData401, ExportAccountData404, ExportAccountData429, ExportAccountDataQuery, ExportAccountDataQueryResponse, GetDatabase200, GetDatabase400, GetDatabase401, GetDatabase403, GetDatabase404, GetDatabase429, GetDatabasePathParams, GetDatabaseQuery, GetDatabaseQueryResponse, GetHealth200, GetHealth429, GetHealthQuery, GetHealthQueryResponse, GetOnboardingProgress200, GetOnboardingProgress400, GetOnboardingProgress401, GetOnboardingProgress403, GetOnboardingProgress404, GetOnboardingProgress429, GetOnboardingProgressPathParams, GetOnboardingProgressQuery, GetOnboardingProgressQueryResponse, GetOrganizationActivity200, GetOrganizationActivity400, GetOrganizationActivity401, GetOrganizationActivity403, GetOrganizationActivity429, GetOrganizationActivityPathParams, GetOrganizationActivityQuery, GetOrganizationActivityQueryParams, GetOrganizationActivityQueryResponse, GetOrganizationPlan200, GetOrganizationPlan400, GetOrganizationPlan401, GetOrganizationPlan403, GetOrganizationPlan429, GetOrganizationPlanPathParams, GetOrganizationPlanQuery, GetOrganizationPlanQueryResponse, GetOrganizationUsage200, GetOrganizationUsage400, GetOrganizationUsage401, GetOrganizationUsage403, GetOrganizationUsage429, GetOrganizationUsagePathParams, GetOrganizationUsageQuery, GetOrganizationUsageQueryParams, GetOrganizationUsageQueryResponse, GetProject200, GetProject400, GetProject401, GetProject403, GetProject404, GetProject429, GetProjectInsights200, GetProjectInsights400, GetProjectInsights401, GetProjectInsights404, GetProjectInsights429, GetProjectInsightsPathParams, GetProjectInsightsQuery, GetProjectInsightsQueryParams, GetProjectInsightsQueryParamsRangeEnumKey, GetProjectInsightsQueryResponse, GetProjectMetrics200, GetProjectMetrics400, GetProjectMetrics401, GetProjectMetrics404, GetProjectMetrics429, GetProjectMetricsPathParams, GetProjectMetricsQuery, GetProjectMetricsQueryParams, GetProjectMetricsQueryResponse, GetProjectPathParams, GetProjectQuery, GetProjectQueryResponse, GetProjectUsage200, GetProjectUsage400, GetProjectUsage401, GetProjectUsage404, GetProjectUsage429, GetProjectUsagePathParams, GetProjectUsageQuery, GetProjectUsageQueryParams, GetProjectUsageQueryResponse, HealthResponse, HealthResponseStatusEnumKey, LatencySummary, ListCacheRules200, ListCacheRules400, ListCacheRules401, ListCacheRules403, ListCacheRules404, ListCacheRules429, ListCacheRulesPathParams, ListCacheRulesQuery, ListCacheRulesQueryParams, ListCacheRulesQueryResponse, ListCacheRulesResponse, ListCustomDomains200, ListCustomDomains400, ListCustomDomains401, ListCustomDomains403, ListCustomDomains404, ListCustomDomains429, ListCustomDomainsPathParams, ListCustomDomainsQuery, ListCustomDomainsQueryParams, ListCustomDomainsQueryResponse, ListCustomDomainsResponse, ListDatabases200, ListDatabases400, ListDatabases401, ListDatabases403, ListDatabases404, ListDatabases429, ListDatabasesPathParams, ListDatabasesQuery, ListDatabasesQueryParams, ListDatabasesQueryResponse, ListDatabasesResponse, ListPlans200, ListPlans401, ListPlans429, ListPlansQuery, ListPlansQueryResponse, ListPlansResponse, ListProjects200, ListProjects400, ListProjects401, ListProjects403, ListProjects429, ListProjectsQuery, ListProjectsQueryParams, ListProjectsQueryParamsSortByEnumKey, ListProjectsQueryResponse, ListProjectsResponse, ListRegions200, ListRegions401, ListRegions429, ListRegionsQuery, ListRegionsQueryResponse, ListRegionsResponse, ListReplicas200, ListReplicas400, ListReplicas401, ListReplicas403, ListReplicas404, ListReplicas429, ListReplicasPathParams, ListReplicasQuery, ListReplicasQueryResponse, ListReplicasResponse, MetricsSnapshot, OnboardingProgress, OrganizationPlan, OrganizationPlanBillingProviderEnumKey, OrganizationPlanPlanEnumKey, OrganizationPlanSubscriptionStatusEnumKey, PgBeamClientOptions, PlanInfo, PlanLimits, PoolConfig, PoolMode, PoolModeEnumKey, Project, ProjectCloudEnumKey, ProjectDailyUsage, ProjectInsights, ProjectMetricsResponse, ProjectStatus, ProjectStatusEnumKey, ProjectUsageResponse, QueryInsight, Region, RegionProviderEnumKey, RegionStatusEnumKey, Replica, RetryConfig, SSLMode, SSLModeEnumKey, SubmitCancellationFeedback204, SubmitCancellationFeedback400, SubmitCancellationFeedback401, SubmitCancellationFeedback403, SubmitCancellationFeedback429, SubmitCancellationFeedbackMutation, SubmitCancellationFeedbackMutationRequest, SubmitCancellationFeedbackMutationResponse, SubmitCancellationFeedbackPathParams, TestConnectionResult, TestDatabaseConnection200, TestDatabaseConnection400, TestDatabaseConnection401, TestDatabaseConnection403, TestDatabaseConnection404, TestDatabaseConnection429, TestDatabaseConnectionMutation, TestDatabaseConnectionMutationResponse, TestDatabaseConnectionPathParams, UpdateCacheRule200, UpdateCacheRule400, UpdateCacheRule401, UpdateCacheRule403, UpdateCacheRule404, UpdateCacheRule429, UpdateCacheRuleMutation, UpdateCacheRuleMutationRequest, UpdateCacheRuleMutationResponse, UpdateCacheRulePathParams, UpdateCacheRuleRequest, UpdateCacheRuleResponse, UpdateDatabase200, UpdateDatabase400, UpdateDatabase401, UpdateDatabase403, UpdateDatabase404, UpdateDatabase429, UpdateDatabaseMutation, UpdateDatabaseMutationRequest, UpdateDatabaseMutationResponse, UpdateDatabasePathParams, UpdateDatabaseRequest, UpdateOnboardingProgress200, UpdateOnboardingProgress400, UpdateOnboardingProgress401, UpdateOnboardingProgress403, UpdateOnboardingProgress404, UpdateOnboardingProgress429, UpdateOnboardingProgressMutation, UpdateOnboardingProgressMutationRequest, UpdateOnboardingProgressMutationResponse, UpdateOnboardingProgressPathParams, UpdateOnboardingRequest, UpdateOnboardingRequestStepEnumKey, UpdateProject200, UpdateProject400, UpdateProject401, UpdateProject403, UpdateProject404, UpdateProject429, UpdateProjectMutation, UpdateProjectMutationRequest, UpdateProjectMutationResponse, UpdateProjectPathParams, UpdateProjectRequest, UpdateSpendLimit200, UpdateSpendLimit400, UpdateSpendLimit401, UpdateSpendLimit403, UpdateSpendLimit429, UpdateSpendLimitMutation, UpdateSpendLimitMutationRequest, UpdateSpendLimitMutationResponse, UpdateSpendLimitPathParams, UpdateSpendLimitRequest, UsageResponse, VerifyCustomDomain200, VerifyCustomDomain400, VerifyCustomDomain401, VerifyCustomDomain403, VerifyCustomDomain404, VerifyCustomDomain429, VerifyCustomDomainMutation, VerifyCustomDomainMutationResponse, VerifyCustomDomainPathParams, VerifyCustomDomainResponse };