pgbeam 0.3.6 → 0.3.8

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.
@@ -1697,6 +1697,36 @@ type PlanLimits = {
1697
1697
  * @type integer
1698
1698
  */
1699
1699
  included_seats: number;
1700
+ /**
1701
+ * @description Maximum agent credentials per organization. 0 means unlimited.
1702
+ * @type integer
1703
+ */
1704
+ max_agent_credentials: number;
1705
+ /**
1706
+ * @description Agent audit-log retention window in days.
1707
+ * @type integer
1708
+ */
1709
+ audit_retention_days: number;
1710
+ /**
1711
+ * @description Maximum concurrently active instant (sandbox) branches. 0 means no limit.
1712
+ * @type integer
1713
+ */
1714
+ sandbox_max_branches: number;
1715
+ /**
1716
+ * @description Maximum upstream source-database size a sandbox base sync accepts, in bytes. 0 means no limit.
1717
+ * @type integer
1718
+ */
1719
+ sandbox_max_upstream_bytes: number;
1720
+ /**
1721
+ * @description Idle time before an instant (sandbox) branch scales to zero, in seconds.
1722
+ * @type integer
1723
+ */
1724
+ sandbox_idle_seconds: number;
1725
+ /**
1726
+ * @description Lifetime of an instant (sandbox) branch before the TTL sweep discards it, in seconds.
1727
+ * @type integer
1728
+ */
1729
+ sandbox_ttl_seconds: number;
1700
1730
  };
1701
1731
 
1702
1732
  /**
@@ -1857,6 +1887,16 @@ type OrganizationPlan = {
1857
1887
  * @type number
1858
1888
  */
1859
1889
  spend_limit?: number | null;
1890
+ /**
1891
+ * @description Whether the organization has hit its spend limit and agent access is paused at the proxy. Lifts automatically when usage resets for the new billing period, or immediately when the spend limit is raised or removed.
1892
+ * @type boolean | undefined
1893
+ */
1894
+ spend_capped?: boolean;
1895
+ /**
1896
+ * @description When the spend cap was applied. Null when not capped.
1897
+ * @type string
1898
+ */
1899
+ spend_capped_at?: string | null;
1860
1900
  /**
1861
1901
  * @description Effective usage limits enforced for an organization plan.
1862
1902
  * @type object
@@ -4796,6 +4836,13 @@ type PolicyProfile = {
4796
4836
  * @type integer | undefined
4797
4837
  */
4798
4838
  egress_bytes_per_day?: number;
4839
+ /**
4840
+ * @description Hard cap on rows a single write (INSERT/UPDATE/DELETE) may affect. A write whose affected-row count would exceed this is executed inside a transaction, checked, and rolled back so nothing persists, then blocked. Enforced independently of human approval. 0 means unlimited.
4841
+ * @minLength 0
4842
+ * @default 0
4843
+ * @type integer | undefined
4844
+ */
4845
+ max_affected_rows?: number;
4799
4846
  /**
4800
4847
  * @description When the policy profile was created.
4801
4848
  * @type string
@@ -5024,6 +5071,13 @@ type PolicyProfileInput = {
5024
5071
  * @type integer | undefined
5025
5072
  */
5026
5073
  egress_bytes_per_day?: number;
5074
+ /**
5075
+ * @description Hard cap on rows a single write (INSERT/UPDATE/DELETE) may affect. A write whose affected-row count would exceed this is executed inside a transaction, checked, and rolled back so nothing persists, then blocked. Enforced independently of human approval. 0 means unlimited.
5076
+ * @minLength 0
5077
+ * @default 0
5078
+ * @type integer | undefined
5079
+ */
5080
+ max_affected_rows?: number;
5027
5081
  };
5028
5082
 
5029
5083
  /**
@@ -5377,6 +5431,17 @@ type CidrEntry = {
5377
5431
  label?: string;
5378
5432
  };
5379
5433
 
5434
+ /**
5435
+ * Generated by Kubb (https://kubb.dev/).
5436
+ * Do not edit manually.
5437
+ */
5438
+ declare const dataResidency: {
5439
+ readonly any: "any";
5440
+ readonly us: "us";
5441
+ readonly eu: "eu";
5442
+ };
5443
+ type DataResidencyKey = (typeof dataResidency)[keyof typeof dataResidency];
5444
+
5380
5445
  /**
5381
5446
  * Generated by Kubb (https://kubb.dev/).
5382
5447
  * Do not edit manually.
@@ -5442,6 +5507,12 @@ type Project = {
5442
5507
  * @type string | undefined
5443
5508
  */
5444
5509
  readonly cloud?: ProjectCloudEnumKey;
5510
+ /**
5511
+ * @description When true, this project\'s data plane runs in the customer\'s own VPC/cluster (BYOC): the control plane does not provision hosted infra, and a self-hosted proxy dials home over the config/audit gRPC stream. Requires the Scale or enterprise plan.\n
5512
+ * @example false
5513
+ * @type boolean | undefined
5514
+ */
5515
+ readonly self_hosted?: boolean;
5445
5516
  /**
5446
5517
  * @description Proxy hostname for connecting through PgBeam (e.g., myproject.proxy.pgbeam.app).
5447
5518
  * @type string | undefined
@@ -5477,6 +5548,13 @@ type Project = {
5477
5548
  * @type string
5478
5549
  */
5479
5550
  default_policy_profile_id?: string | null;
5551
+ /**
5552
+ * @description Data-residency requirement for the project. \"any\" (default) lets queries be served from the nearest data-plane metro. \"us\" or \"eu\" require the serving metro to be in that jurisdiction; the proxy fails a connection closed when it is served from a metro outside the required jurisdiction, so regulated workloads never process outside their permitted region.\n
5553
+ * @default "any"
5554
+ * @example eu
5555
+ * @type string | undefined
5556
+ */
5557
+ residency?: DataResidencyKey;
5480
5558
  /**
5481
5559
  * @description Project-level kill-switch. When true, ALL agent-credential connections to this project are blocked at the proxy and live agent sessions are dropped within seconds. Passthrough/human connections are unaffected.\n
5482
5560
  * @example false
@@ -5649,6 +5727,12 @@ type CreateProjectRequest = {
5649
5727
  * @type string | undefined
5650
5728
  */
5651
5729
  cloud?: CreateProjectRequestCloudEnumKey;
5730
+ /**
5731
+ * @description Mark this project as running on a self-hosted (BYOC) data plane in the customer\'s own VPC/cluster. Requires the Scale or enterprise plan.\n
5732
+ * @default false
5733
+ * @type boolean | undefined
5734
+ */
5735
+ self_hosted?: boolean;
5652
5736
  /**
5653
5737
  * @description Primary database. Created atomically with the project.
5654
5738
  * @type object
@@ -5791,6 +5875,13 @@ type UpdateProjectRequest = {
5791
5875
  * @type string
5792
5876
  */
5793
5877
  default_policy_profile_id?: string | null;
5878
+ /**
5879
+ * @description Data-residency requirement for the project. \"any\" (default) lets queries be served from the nearest data-plane metro. \"us\" or \"eu\" require the serving metro to be in that jurisdiction; the proxy fails a connection closed when it is served from a metro outside the required jurisdiction, so regulated workloads never process outside their permitted region.\n
5880
+ * @default "any"
5881
+ * @example eu
5882
+ * @type string | undefined
5883
+ */
5884
+ residency?: DataResidencyKey;
5794
5885
  /**
5795
5886
  * @description Project-level kill-switch. Set true to block ALL agent-credential connections to this project (live agent sessions are dropped within seconds); set false to re-enable them. Passthrough/human connections are unaffected. Engaging the kill-switch emits a kill_switch webhook event.\n
5796
5887
  * @example true
@@ -6323,6 +6414,244 @@ type DeleteReplicaRequestConfig = {
6323
6414
  url: `/v1/databases/${string}/replicas/${string}`;
6324
6415
  };
6325
6416
 
6417
+ /**
6418
+ * Generated by Kubb (https://kubb.dev/).
6419
+ * Do not edit manually.
6420
+ */
6421
+ /**
6422
+ * @description An enrollment that lets a self-hosted (BYOC) proxy authenticate to the control plane\'s config/audit gRPC stream on behalf of an organization. The token itself is never returned after creation, only its metadata.\n
6423
+ * @type object
6424
+ */
6425
+ type SelfHostEnrollment = {
6426
+ /**
6427
+ * @description Unique enrollment identifier.
6428
+ * @example she_01h455vb4pex5vsknk084sn02q
6429
+ * @type string
6430
+ */
6431
+ id: string;
6432
+ /**
6433
+ * @description Organization that owns this enrollment.
6434
+ * @example org_abc123
6435
+ * @type string
6436
+ */
6437
+ org_id: string;
6438
+ /**
6439
+ * @description Operator-supplied label for where the proxy runs (informational).
6440
+ * @example customer-vpc-us-east
6441
+ * @type string | undefined
6442
+ */
6443
+ region_label?: string;
6444
+ /**
6445
+ * @description Optional human-readable note.
6446
+ * @example prod cluster
6447
+ * @type string | undefined
6448
+ */
6449
+ description?: string;
6450
+ /**
6451
+ * @description User ID that created the enrollment.
6452
+ * @type string
6453
+ */
6454
+ created_by?: string | null;
6455
+ /**
6456
+ * @description When the enrollment was created.
6457
+ * @type string
6458
+ */
6459
+ created_at: string;
6460
+ /**
6461
+ * @description Last time a proxy authenticated with this enrollment.
6462
+ * @type string
6463
+ */
6464
+ last_seen_at?: string | null;
6465
+ /**
6466
+ * @description When the enrollment was revoked. Null means active.
6467
+ * @type string
6468
+ */
6469
+ revoked_at?: string | null;
6470
+ };
6471
+
6472
+ /**
6473
+ * Generated by Kubb (https://kubb.dev/).
6474
+ * Do not edit manually.
6475
+ */
6476
+
6477
+ /**
6478
+ * @description List of self-host enrollments for an organization.
6479
+ * @type object
6480
+ */
6481
+ type ListSelfHostEnrollmentsResponse = {
6482
+ /**
6483
+ * @description The organization\'s self-host enrollments, newest first.
6484
+ * @type array
6485
+ */
6486
+ enrollments: SelfHostEnrollment[];
6487
+ };
6488
+
6489
+ /**
6490
+ * Generated by Kubb (https://kubb.dev/).
6491
+ * Do not edit manually.
6492
+ */
6493
+
6494
+ /**
6495
+ * @description Unique organization identifier.
6496
+ * @pattern ^[a-zA-Z0-9_.-]+$
6497
+ * @example org_abc123
6498
+ * @type string
6499
+ */
6500
+ type ListSelfHostEnrollmentsPathOrgId = string;
6501
+ /**
6502
+ * @description List of self-host enrollments for an organization.
6503
+ * @type object
6504
+ */
6505
+ type ListSelfHostEnrollmentsStatus200 = ListSelfHostEnrollmentsResponse;
6506
+ /**
6507
+ * @type object
6508
+ */
6509
+ type ListSelfHostEnrollmentsRequestConfig = {
6510
+ data?: never;
6511
+ /**
6512
+ * @type object
6513
+ */
6514
+ pathParams: {
6515
+ org_id: ListSelfHostEnrollmentsPathOrgId;
6516
+ };
6517
+ queryParams?: never;
6518
+ headerParams?: never;
6519
+ /**
6520
+ * @type string
6521
+ */
6522
+ url: `/v1/organizations/${string}/self-host-enrollments`;
6523
+ };
6524
+
6525
+ /**
6526
+ * Generated by Kubb (https://kubb.dev/).
6527
+ * Do not edit manually.
6528
+ */
6529
+ /**
6530
+ * @description Request body for issuing a self-host enrollment token.
6531
+ * @type object
6532
+ */
6533
+ type CreateSelfHostEnrollmentRequest = {
6534
+ /**
6535
+ * @description Operator-supplied label for where the proxy runs.
6536
+ * @maxLength 100
6537
+ * @pattern ^[^\x00]*$
6538
+ * @example customer-vpc-us-east
6539
+ * @type string | undefined
6540
+ */
6541
+ region_label?: string;
6542
+ /**
6543
+ * @description Optional human-readable note.
6544
+ * @maxLength 500
6545
+ * @pattern ^[^\x00]*$
6546
+ * @example prod cluster
6547
+ * @type string | undefined
6548
+ */
6549
+ description?: string;
6550
+ };
6551
+
6552
+ /**
6553
+ * Generated by Kubb (https://kubb.dev/).
6554
+ * Do not edit manually.
6555
+ */
6556
+
6557
+ /**
6558
+ * @description Response returned once when an enrollment is created. The token is shown a single time and cannot be retrieved again; set it as GRPC_AUTH_TOKEN on the self-hosted proxy.\n
6559
+ * @type object
6560
+ */
6561
+ type SelfHostEnrollmentSecret = {
6562
+ /**
6563
+ * @description An enrollment that lets a self-hosted (BYOC) proxy authenticate to the control plane\'s config/audit gRPC stream on behalf of an organization. The token itself is never returned after creation, only its metadata.\n
6564
+ * @type object
6565
+ */
6566
+ enrollment: SelfHostEnrollment;
6567
+ /**
6568
+ * @description The plaintext enrollment token (pbh_...). Shown once.
6569
+ * @example pbh_01h455vb4pex5vsknk084sn02q9zk3m7
6570
+ * @type string
6571
+ */
6572
+ token: string;
6573
+ };
6574
+
6575
+ /**
6576
+ * Generated by Kubb (https://kubb.dev/).
6577
+ * Do not edit manually.
6578
+ */
6579
+
6580
+ /**
6581
+ * @description Unique organization identifier.
6582
+ * @pattern ^[a-zA-Z0-9_.-]+$
6583
+ * @example org_abc123
6584
+ * @type string
6585
+ */
6586
+ type CreateSelfHostEnrollmentPathOrgId = string;
6587
+ /**
6588
+ * @description Response returned once when an enrollment is created. The token is shown a single time and cannot be retrieved again; set it as GRPC_AUTH_TOKEN on the self-hosted proxy.\n
6589
+ * @type object
6590
+ */
6591
+ type CreateSelfHostEnrollmentStatus201 = SelfHostEnrollmentSecret;
6592
+ /**
6593
+ * @description Request body for issuing a self-host enrollment token.
6594
+ * @type object | undefined
6595
+ */
6596
+ type CreateSelfHostEnrollmentData = CreateSelfHostEnrollmentRequest | undefined;
6597
+ /**
6598
+ * @type object
6599
+ */
6600
+ type CreateSelfHostEnrollmentRequestConfig = {
6601
+ data?: CreateSelfHostEnrollmentData;
6602
+ /**
6603
+ * @type object
6604
+ */
6605
+ pathParams: {
6606
+ org_id: CreateSelfHostEnrollmentPathOrgId;
6607
+ };
6608
+ queryParams?: never;
6609
+ headerParams?: never;
6610
+ /**
6611
+ * @type string
6612
+ */
6613
+ url: `/v1/organizations/${string}/self-host-enrollments`;
6614
+ };
6615
+
6616
+ /**
6617
+ * Generated by Kubb (https://kubb.dev/).
6618
+ * Do not edit manually.
6619
+ */
6620
+
6621
+ /**
6622
+ * @description Unique organization identifier.
6623
+ * @pattern ^[a-zA-Z0-9_.-]+$
6624
+ * @example org_abc123
6625
+ * @type string
6626
+ */
6627
+ type RevokeSelfHostEnrollmentPathOrgId = string;
6628
+ /**
6629
+ * @description Unique enrollment identifier.
6630
+ * @pattern ^[a-zA-Z0-9_.-]+$
6631
+ * @example she_01h455vb4pex5vsknk084sn02q
6632
+ * @type string
6633
+ */
6634
+ type RevokeSelfHostEnrollmentPathEnrollmentId = string;
6635
+ /**
6636
+ * @type object
6637
+ */
6638
+ type RevokeSelfHostEnrollmentRequestConfig = {
6639
+ data?: never;
6640
+ /**
6641
+ * @type object
6642
+ */
6643
+ pathParams: {
6644
+ org_id: RevokeSelfHostEnrollmentPathOrgId;
6645
+ enrollment_id: RevokeSelfHostEnrollmentPathEnrollmentId;
6646
+ };
6647
+ queryParams?: never;
6648
+ headerParams?: never;
6649
+ /**
6650
+ * @type string
6651
+ */
6652
+ url: `/v1/organizations/${string}/self-host-enrollments/${string}`;
6653
+ };
6654
+
6326
6655
  /**
6327
6656
  * Generated by Kubb (https://kubb.dev/).
6328
6657
  * Do not edit manually.
@@ -7792,6 +8121,18 @@ declare const operationsByTag: {
7792
8121
  readonly method: "GET";
7793
8122
  readonly path: "/v1/regions";
7794
8123
  };
8124
+ readonly listSelfHostEnrollments: {
8125
+ readonly method: "GET";
8126
+ readonly path: "/v1/organizations/{org_id}/self-host-enrollments";
8127
+ };
8128
+ readonly createSelfHostEnrollment: {
8129
+ readonly method: "POST";
8130
+ readonly path: "/v1/organizations/{org_id}/self-host-enrollments";
8131
+ };
8132
+ readonly revokeSelfHostEnrollment: {
8133
+ readonly method: "DELETE";
8134
+ readonly path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}";
8135
+ };
7795
8136
  };
7796
8137
  readonly migrations: {
7797
8138
  readonly lintMigration: {
@@ -8161,6 +8502,21 @@ declare const operationsByPath: {
8161
8502
  readonly path: "/v1/databases/{database_id}/replicas/{replica_id}";
8162
8503
  readonly operationId: "deleteReplica";
8163
8504
  };
8505
+ readonly "GET /v1/organizations/{org_id}/self-host-enrollments": {
8506
+ readonly method: "GET";
8507
+ readonly path: "/v1/organizations/{org_id}/self-host-enrollments";
8508
+ readonly operationId: "listSelfHostEnrollments";
8509
+ };
8510
+ readonly "POST /v1/organizations/{org_id}/self-host-enrollments": {
8511
+ readonly method: "POST";
8512
+ readonly path: "/v1/organizations/{org_id}/self-host-enrollments";
8513
+ readonly operationId: "createSelfHostEnrollment";
8514
+ };
8515
+ readonly "DELETE /v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}": {
8516
+ readonly method: "DELETE";
8517
+ readonly path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}";
8518
+ readonly operationId: "revokeSelfHostEnrollment";
8519
+ };
8164
8520
  readonly "GET /v1/organizations/{org_id}/support/cases": {
8165
8521
  readonly method: "GET";
8166
8522
  readonly path: "/v1/organizations/{org_id}/support/cases";
@@ -8418,6 +8774,16 @@ type CreateReplicaParams = {
8418
8774
  type DeleteReplicaParams = {
8419
8775
  pathParams: NonNullable<DeleteReplicaRequestConfig["pathParams"]>;
8420
8776
  };
8777
+ type ListSelfHostEnrollmentsParams = {
8778
+ pathParams: NonNullable<ListSelfHostEnrollmentsRequestConfig["pathParams"]>;
8779
+ };
8780
+ type CreateSelfHostEnrollmentParams = {
8781
+ pathParams: NonNullable<CreateSelfHostEnrollmentRequestConfig["pathParams"]>;
8782
+ body: NonNullable<CreateSelfHostEnrollmentRequestConfig["data"]>;
8783
+ };
8784
+ type RevokeSelfHostEnrollmentParams = {
8785
+ pathParams: NonNullable<RevokeSelfHostEnrollmentRequestConfig["pathParams"]>;
8786
+ };
8421
8787
  type ListSupportCasesParams = {
8422
8788
  pathParams: NonNullable<ListSupportCasesRequestConfig["pathParams"]>;
8423
8789
  queryParams?: NonNullable<ListSupportCasesRequestConfig["queryParams"]>;
@@ -8538,6 +8904,9 @@ interface ApiOperations {
8538
8904
  platform: {
8539
8905
  getHealth(): Promise<GetHealthStatus200>;
8540
8906
  listRegions(): Promise<ListRegionsStatus200>;
8907
+ listSelfHostEnrollments(params: ListSelfHostEnrollmentsParams): Promise<ListSelfHostEnrollmentsStatus200>;
8908
+ createSelfHostEnrollment(params: CreateSelfHostEnrollmentParams): Promise<CreateSelfHostEnrollmentStatus201>;
8909
+ revokeSelfHostEnrollment(params: RevokeSelfHostEnrollmentParams): Promise<void>;
8541
8910
  };
8542
8911
  migrations: {
8543
8912
  lintMigration(params: LintMigrationParams): Promise<LintMigrationStatus200>;
@@ -8794,6 +9163,18 @@ interface RequestMap {
8794
9163
  params: DeleteReplicaParams;
8795
9164
  response: void;
8796
9165
  };
9166
+ "GET /v1/organizations/{org_id}/self-host-enrollments": {
9167
+ params: ListSelfHostEnrollmentsParams;
9168
+ response: ListSelfHostEnrollmentsStatus200;
9169
+ };
9170
+ "POST /v1/organizations/{org_id}/self-host-enrollments": {
9171
+ params: CreateSelfHostEnrollmentParams;
9172
+ response: CreateSelfHostEnrollmentStatus201;
9173
+ };
9174
+ "DELETE /v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}": {
9175
+ params: RevokeSelfHostEnrollmentParams;
9176
+ response: void;
9177
+ };
8797
9178
  "GET /v1/organizations/{org_id}/support/cases": {
8798
9179
  params: ListSupportCasesParams;
8799
9180
  response: ListSupportCasesStatus200;