pgbeam 0.3.8 → 0.3.9

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.
@@ -1456,6 +1456,21 @@ type AuditLogEntry = {
1456
1456
  * @type string
1457
1457
  */
1458
1458
  ts: string;
1459
+ /**
1460
+ * @description Monotonic per-project position in the tamper-evident hash chain.
1461
+ * @type integer | undefined
1462
+ */
1463
+ seq?: number;
1464
+ /**
1465
+ * @description Hex SHA-256 of the previous chained entry (a fixed genesis value for the first entry). Empty for pre-chain legacy entries.
1466
+ * @type string | undefined
1467
+ */
1468
+ prev_hash?: string;
1469
+ /**
1470
+ * @description Hex SHA-256 of this entry\'s canonical content chained onto prev_hash. Empty for pre-chain legacy entries.
1471
+ * @type string | undefined
1472
+ */
1473
+ entry_hash?: string;
1459
1474
  };
1460
1475
 
1461
1476
  /**
@@ -1648,6 +1663,108 @@ type ExportAuditLogsRequestConfig = {
1648
1663
  url: `/v1/projects/${string}/audit-logs/export`;
1649
1664
  };
1650
1665
 
1666
+ /**
1667
+ * Generated by Kubb (https://kubb.dev/).
1668
+ * Do not edit manually.
1669
+ */
1670
+ /**
1671
+ * @description Result of recomputing the project\'s tamper-evident audit hash chain over a time range. The chain links each entry to its predecessor, so editing or deleting any row breaks it.
1672
+ * @type object
1673
+ */
1674
+ type AuditChainVerification = {
1675
+ /**
1676
+ * @description True when every chained entry in the range links correctly and no tampering or deletion was detected.
1677
+ * @type boolean
1678
+ */
1679
+ ok: boolean;
1680
+ /**
1681
+ * @description Number of chained entries checked.
1682
+ * @type integer
1683
+ */
1684
+ verified_count: number;
1685
+ /**
1686
+ * @description Pre-chain (legacy) entries in the range that predate the hash chain and were skipped rather than treated as tampering.
1687
+ * @type integer
1688
+ */
1689
+ unchained_count: number;
1690
+ /**
1691
+ * @description Sequence number of the first chained entry checked. Null when none.
1692
+ * @type integer
1693
+ */
1694
+ chain_start_seq?: number | null;
1695
+ /**
1696
+ * @description Sequence number of the last chained entry checked. Null when none.
1697
+ * @type integer
1698
+ */
1699
+ chain_end_seq?: number | null;
1700
+ /**
1701
+ * @description Sequence number where verification first failed (a tampered or deleted entry). Null when ok.
1702
+ * @type integer
1703
+ */
1704
+ first_broken_seq?: number | null;
1705
+ /**
1706
+ * @description Machine-readable failure kind: hash_mismatch (entry content edited), broken_link (prev_hash does not match the predecessor), or missing_entry (a sequence number was deleted). Null when ok.
1707
+ * @type string
1708
+ */
1709
+ failure_reason?: string | null;
1710
+ /**
1711
+ * @description When verification ran.
1712
+ * @type string
1713
+ */
1714
+ verified_at: string;
1715
+ };
1716
+
1717
+ /**
1718
+ * Generated by Kubb (https://kubb.dev/).
1719
+ * Do not edit manually.
1720
+ */
1721
+
1722
+ /**
1723
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
1724
+ * @pattern ^[a-zA-Z0-9_.-]+$
1725
+ * @type string
1726
+ */
1727
+ type VerifyAuditChainPathProjectId = string;
1728
+ /**
1729
+ * @description Return entries at or after this timestamp (inclusive lower bound).
1730
+ * @type string | undefined
1731
+ */
1732
+ type VerifyAuditChainQueryStart = string | undefined;
1733
+ /**
1734
+ * @description Return entries strictly older than this timestamp (cursor / upper bound).
1735
+ * @type string | undefined
1736
+ */
1737
+ type VerifyAuditChainQueryEnd = string | undefined;
1738
+ /**
1739
+ * @description Result of recomputing the project\'s tamper-evident audit hash chain over a time range. The chain links each entry to its predecessor, so editing or deleting any row breaks it.
1740
+ * @type object
1741
+ */
1742
+ type VerifyAuditChainStatus200 = AuditChainVerification;
1743
+ /**
1744
+ * @type object
1745
+ */
1746
+ type VerifyAuditChainRequestConfig = {
1747
+ data?: never;
1748
+ /**
1749
+ * @type object
1750
+ */
1751
+ pathParams: {
1752
+ project_id: VerifyAuditChainPathProjectId;
1753
+ };
1754
+ /**
1755
+ * @type object | undefined
1756
+ */
1757
+ queryParams?: {
1758
+ start?: VerifyAuditChainQueryStart;
1759
+ end?: VerifyAuditChainQueryEnd;
1760
+ };
1761
+ headerParams?: never;
1762
+ /**
1763
+ * @type string
1764
+ */
1765
+ url: `/v1/projects/${string}/audit-logs/verify`;
1766
+ };
1767
+
1651
1768
  /**
1652
1769
  * Generated by Kubb (https://kubb.dev/).
1653
1770
  * Do not edit manually.
@@ -5406,6 +5523,250 @@ type DryEvalPolicyRequestConfig = {
5406
5523
  url: `/v1/projects/${string}/policy-evaluations`;
5407
5524
  };
5408
5525
 
5526
+ /**
5527
+ * Generated by Kubb (https://kubb.dev/).
5528
+ * Do not edit manually.
5529
+ */
5530
+
5531
+ /**
5532
+ * @description A window of recorded agent traffic to replay plus the candidate policy to replay it against. Supply exactly one of policy_id (an existing saved policy) or policy (an unsaved draft, e.g. the in-progress editor form).
5533
+ * @type object
5534
+ */
5535
+ type PolicyReplayInput = {
5536
+ /**
5537
+ * @description ID of an existing saved policy profile to replay against.
5538
+ * @example pol_01h455vb4pex5vsknk084sn02q
5539
+ * @type string | undefined
5540
+ */
5541
+ policy_id?: string;
5542
+ /**
5543
+ * @description Mutable fields of a policy profile (used for create and update).
5544
+ * @type object | undefined
5545
+ */
5546
+ policy?: PolicyProfileInput;
5547
+ /**
5548
+ * @description Restrict the replay to traffic recorded for one agent credential.
5549
+ * @example cred_01h455vb4pex5vsknk084sn02q
5550
+ * @type string | undefined
5551
+ */
5552
+ credential_id?: string;
5553
+ /**
5554
+ * @description Start of the traffic window (inclusive). Defaults to 7 days before end_ts.
5555
+ * @type string | undefined
5556
+ */
5557
+ start_ts?: string;
5558
+ /**
5559
+ * @description End of the traffic window (exclusive). Defaults to now.
5560
+ * @type string | undefined
5561
+ */
5562
+ end_ts?: string;
5563
+ /**
5564
+ * @description Maximum number of distinct queries to replay, newest first. Traffic is deduplicated by normalized query hash before evaluation.
5565
+ * @minLength 1
5566
+ * @maxLength 500
5567
+ * @default 200
5568
+ * @type integer | undefined
5569
+ */
5570
+ limit?: number;
5571
+ };
5572
+
5573
+ /**
5574
+ * Generated by Kubb (https://kubb.dev/).
5575
+ * Do not edit manually.
5576
+ */
5577
+
5578
+ declare const policyReplayItemChangeEnum: {
5579
+ readonly newly_blocked: "newly_blocked";
5580
+ readonly newly_allowed: "newly_allowed";
5581
+ readonly still_allowed: "still_allowed";
5582
+ readonly still_blocked: "still_blocked";
5583
+ };
5584
+ type PolicyReplayItemChangeEnumKey = (typeof policyReplayItemChangeEnum)[keyof typeof policyReplayItemChangeEnum];
5585
+ /**
5586
+ * @description One distinct recorded query and the decision the candidate policy would reach for it.
5587
+ * @type object
5588
+ */
5589
+ type PolicyReplayItem = {
5590
+ /**
5591
+ * @description Normalized query hash identifying this statement shape.
5592
+ * @type string
5593
+ */
5594
+ query_hash: string;
5595
+ /**
5596
+ * @description The recorded statement (normalized, literals replaced with $N placeholders), from its most recent occurrence.
5597
+ * @type string
5598
+ */
5599
+ sql: string;
5600
+ /**
5601
+ * @description Statement kind (select, insert, update, delete, ddl, ...).
5602
+ * @type string | undefined
5603
+ */
5604
+ statement_kind?: string;
5605
+ /**
5606
+ * @description How many recorded entries share this query shape in the window.
5607
+ * @type integer
5608
+ */
5609
+ occurrences: number;
5610
+ /**
5611
+ * @description Oldest occurrence in the window.
5612
+ * @type string
5613
+ */
5614
+ first_seen: string;
5615
+ /**
5616
+ * @description Newest occurrence in the window.
5617
+ * @type string
5618
+ */
5619
+ last_seen: string;
5620
+ /**
5621
+ * @description The most recent recorded outcome for this query (query, masked, truncated, or blocked).
5622
+ * @type string
5623
+ */
5624
+ recorded_event: string;
5625
+ /**
5626
+ * @description The decision rule recorded with a blocked outcome.
5627
+ * @type string | undefined
5628
+ */
5629
+ recorded_rule?: string;
5630
+ /**
5631
+ * @description How the candidate decision compares to the recorded outcome. newly_blocked and newly_allowed are the changes worth reviewing before rollout; still_allowed and still_blocked are unchanged.
5632
+ * @type string
5633
+ */
5634
+ change: PolicyReplayItemChangeEnumKey;
5635
+ /**
5636
+ * @description The decision the proxy would reach for the supplied statement under the supplied policy. verdict is the headline outcome; the remaining fields detail why.
5637
+ * @type object
5638
+ */
5639
+ result: DryEvalResult;
5640
+ };
5641
+
5642
+ /**
5643
+ * Generated by Kubb (https://kubb.dev/).
5644
+ * Do not edit manually.
5645
+ */
5646
+ /**
5647
+ * @description Aggregate outcome of a policy replay.
5648
+ * @type object
5649
+ */
5650
+ type PolicyReplaySummary = {
5651
+ /**
5652
+ * @description Recorded audit entries covered by the replayed queries.
5653
+ * @type integer
5654
+ */
5655
+ entries_scanned: number;
5656
+ /**
5657
+ * @description Distinct normalized queries found in the window (capped at limit).
5658
+ * @type integer
5659
+ */
5660
+ distinct_queries: number;
5661
+ /**
5662
+ * @description Distinct queries actually evaluated against the candidate policy.
5663
+ * @type integer
5664
+ */
5665
+ evaluated: number;
5666
+ /**
5667
+ * @description Queries the candidate policy would allow unchanged.
5668
+ * @type integer
5669
+ */
5670
+ would_allow: number;
5671
+ /**
5672
+ * @description Queries the candidate policy would block.
5673
+ * @type integer
5674
+ */
5675
+ would_block: number;
5676
+ /**
5677
+ * @description Queries the candidate policy would mask result columns on.
5678
+ * @type integer
5679
+ */
5680
+ would_mask: number;
5681
+ /**
5682
+ * @description Queries the candidate policy would inject a row filter into.
5683
+ * @type integer
5684
+ */
5685
+ would_row_filter: number;
5686
+ /**
5687
+ * @description Queries that executed under the recorded policy but the candidate policy would block.
5688
+ * @type integer
5689
+ */
5690
+ newly_blocked: number;
5691
+ /**
5692
+ * @description Queries that were blocked when recorded but the candidate policy would permit.
5693
+ * @type integer
5694
+ */
5695
+ newly_allowed: number;
5696
+ /**
5697
+ * @description Distinct queries skipped because the stored statement was truncated at record time and can no longer be parsed faithfully.
5698
+ * @type integer
5699
+ */
5700
+ skipped_unparseable: number;
5701
+ /**
5702
+ * @description True when the window contained more distinct queries than limit; only the newest were replayed.
5703
+ * @type boolean
5704
+ */
5705
+ truncated: boolean;
5706
+ };
5707
+
5708
+ /**
5709
+ * Generated by Kubb (https://kubb.dev/).
5710
+ * Do not edit manually.
5711
+ */
5712
+
5713
+ /**
5714
+ * @description The outcome of replaying recorded agent traffic against a candidate policy: an aggregate summary plus per-query decisions, changes first.
5715
+ * @type object
5716
+ */
5717
+ type PolicyReplayResult = {
5718
+ /**
5719
+ * @description Aggregate outcome of a policy replay.
5720
+ * @type object
5721
+ */
5722
+ summary: PolicyReplaySummary;
5723
+ /**
5724
+ * @description Per-query replay decisions, ordered changes first (newly blocked, then newly allowed), then by occurrence count.
5725
+ * @type array
5726
+ */
5727
+ items: PolicyReplayItem[];
5728
+ };
5729
+
5730
+ /**
5731
+ * Generated by Kubb (https://kubb.dev/).
5732
+ * Do not edit manually.
5733
+ */
5734
+
5735
+ /**
5736
+ * @description Unique project identifier (prefixed, e.g. prj_xxx).
5737
+ * @pattern ^[a-zA-Z0-9_.-]+$
5738
+ * @type string
5739
+ */
5740
+ type ReplayPolicyPathProjectId = string;
5741
+ /**
5742
+ * @description The outcome of replaying recorded agent traffic against a candidate policy: an aggregate summary plus per-query decisions, changes first.
5743
+ * @type object
5744
+ */
5745
+ type ReplayPolicyStatus200 = PolicyReplayResult;
5746
+ /**
5747
+ * @description A window of recorded agent traffic to replay plus the candidate policy to replay it against. Supply exactly one of policy_id (an existing saved policy) or policy (an unsaved draft, e.g. the in-progress editor form).
5748
+ * @type object
5749
+ */
5750
+ type ReplayPolicyData = PolicyReplayInput;
5751
+ /**
5752
+ * @type object
5753
+ */
5754
+ type ReplayPolicyRequestConfig = {
5755
+ data?: ReplayPolicyData;
5756
+ /**
5757
+ * @type object
5758
+ */
5759
+ pathParams: {
5760
+ project_id: ReplayPolicyPathProjectId;
5761
+ };
5762
+ queryParams?: never;
5763
+ headerParams?: never;
5764
+ /**
5765
+ * @type string
5766
+ */
5767
+ url: `/v1/projects/${string}/policy-replays`;
5768
+ };
5769
+
5409
5770
  /**
5410
5771
  * Generated by Kubb (https://kubb.dev/).
5411
5772
  * Do not edit manually.
@@ -7947,6 +8308,10 @@ declare const operationsByTag: {
7947
8308
  readonly method: "GET";
7948
8309
  readonly path: "/v1/projects/{project_id}/audit-logs/export";
7949
8310
  };
8311
+ readonly verifyAuditChain: {
8312
+ readonly method: "GET";
8313
+ readonly path: "/v1/projects/{project_id}/audit-logs/verify";
8314
+ };
7950
8315
  };
7951
8316
  readonly anomalies: {
7952
8317
  readonly listAnomalyAlerts: {
@@ -8165,6 +8530,10 @@ declare const operationsByTag: {
8165
8530
  readonly method: "POST";
8166
8531
  readonly path: "/v1/projects/{project_id}/policy-evaluations";
8167
8532
  };
8533
+ readonly replayPolicy: {
8534
+ readonly method: "POST";
8535
+ readonly path: "/v1/projects/{project_id}/policy-replays";
8536
+ };
8168
8537
  };
8169
8538
  readonly support: {
8170
8539
  readonly listSupportCases: {
@@ -8292,6 +8661,11 @@ declare const operationsByPath: {
8292
8661
  readonly path: "/v1/projects/{project_id}/audit-logs/export";
8293
8662
  readonly operationId: "exportAuditLogs";
8294
8663
  };
8664
+ readonly "GET /v1/projects/{project_id}/audit-logs/verify": {
8665
+ readonly method: "GET";
8666
+ readonly path: "/v1/projects/{project_id}/audit-logs/verify";
8667
+ readonly operationId: "verifyAuditChain";
8668
+ };
8295
8669
  readonly "GET /v1/plans": {
8296
8670
  readonly method: "GET";
8297
8671
  readonly path: "/v1/plans";
@@ -8452,6 +8826,11 @@ declare const operationsByPath: {
8452
8826
  readonly path: "/v1/projects/{project_id}/policy-evaluations";
8453
8827
  readonly operationId: "dryEvalPolicy";
8454
8828
  };
8829
+ readonly "POST /v1/projects/{project_id}/policy-replays": {
8830
+ readonly method: "POST";
8831
+ readonly path: "/v1/projects/{project_id}/policy-replays";
8832
+ readonly operationId: "replayPolicy";
8833
+ };
8455
8834
  readonly "GET /v1/projects": {
8456
8835
  readonly method: "GET";
8457
8836
  readonly path: "/v1/projects";
@@ -8637,6 +9016,10 @@ type ExportAuditLogsParams = {
8637
9016
  pathParams: NonNullable<ExportAuditLogsRequestConfig["pathParams"]>;
8638
9017
  queryParams?: NonNullable<ExportAuditLogsRequestConfig["queryParams"]>;
8639
9018
  };
9019
+ type VerifyAuditChainParams = {
9020
+ pathParams: NonNullable<VerifyAuditChainRequestConfig["pathParams"]>;
9021
+ queryParams?: NonNullable<VerifyAuditChainRequestConfig["queryParams"]>;
9022
+ };
8640
9023
  type GetOrganizationPlanParams = {
8641
9024
  pathParams: NonNullable<GetOrganizationPlanRequestConfig["pathParams"]>;
8642
9025
  };
@@ -8744,6 +9127,10 @@ type DryEvalPolicyParams = {
8744
9127
  pathParams: NonNullable<DryEvalPolicyRequestConfig["pathParams"]>;
8745
9128
  body: NonNullable<DryEvalPolicyRequestConfig["data"]>;
8746
9129
  };
9130
+ type ReplayPolicyParams = {
9131
+ pathParams: NonNullable<ReplayPolicyRequestConfig["pathParams"]>;
9132
+ body: NonNullable<ReplayPolicyRequestConfig["data"]>;
9133
+ };
8747
9134
  type ListProjectsParams = {
8748
9135
  queryParams: NonNullable<ListProjectsRequestConfig["queryParams"]>;
8749
9136
  };
@@ -8850,6 +9237,7 @@ interface ApiOperations {
8850
9237
  rotateAgentCredential(params: RotateAgentCredentialParams): Promise<RotateAgentCredentialStatus200>;
8851
9238
  listAuditLogs(params: ListAuditLogsParams): Promise<ListAuditLogsStatus200>;
8852
9239
  exportAuditLogs(params: ExportAuditLogsParams): Promise<ExportAuditLogsStatus200>;
9240
+ verifyAuditChain(params: VerifyAuditChainParams): Promise<VerifyAuditChainStatus200>;
8853
9241
  };
8854
9242
  anomalies: {
8855
9243
  listAnomalyAlerts(params: ListAnomalyAlertsParams): Promise<ListAnomalyAlertsStatus200>;
@@ -8918,6 +9306,7 @@ interface ApiOperations {
8918
9306
  updatePolicyProfile(params: UpdatePolicyProfileParams): Promise<UpdatePolicyProfileStatus200>;
8919
9307
  deletePolicyProfile(params: DeletePolicyProfileParams): Promise<void>;
8920
9308
  dryEvalPolicy(params: DryEvalPolicyParams): Promise<DryEvalPolicyStatus200>;
9309
+ replayPolicy(params: ReplayPolicyParams): Promise<ReplayPolicyStatus200>;
8921
9310
  };
8922
9311
  support: {
8923
9312
  listSupportCases(params: ListSupportCasesParams): Promise<ListSupportCasesStatus200>;
@@ -8995,6 +9384,10 @@ interface RequestMap {
8995
9384
  params: ExportAuditLogsParams;
8996
9385
  response: ExportAuditLogsStatus200;
8997
9386
  };
9387
+ "GET /v1/projects/{project_id}/audit-logs/verify": {
9388
+ params: VerifyAuditChainParams;
9389
+ response: VerifyAuditChainStatus200;
9390
+ };
8998
9391
  "GET /v1/plans": {
8999
9392
  params?: undefined;
9000
9393
  response: ListPlansStatus200;
@@ -9123,6 +9516,10 @@ interface RequestMap {
9123
9516
  params: DryEvalPolicyParams;
9124
9517
  response: DryEvalPolicyStatus200;
9125
9518
  };
9519
+ "POST /v1/projects/{project_id}/policy-replays": {
9520
+ params: ReplayPolicyParams;
9521
+ response: ReplayPolicyStatus200;
9522
+ };
9126
9523
  "GET /v1/projects": {
9127
9524
  params: ListProjectsParams;
9128
9525
  response: ListProjectsStatus200;
@@ -416,7 +416,7 @@
416
416
  ],
417
417
  "requestBodyType": "",
418
418
  "requestBodyRequired": false,
419
- "responseType": "{ entries: ({ bytes_out?: number; cache_status?: string; client_ip?: string; credential_id?: string; decision_rule?: string; event: string; id: string; latency_ms?: number; normalized_sql?: string; project_id: string; query_hash?: string; reason?: string; region?: string; rows_returned?: number; session_id?: string; source?: string; sql?: string; statement_kind?: string; ts: string })[]; next_page_token?: string }",
419
+ "responseType": "{ entries: ({ bytes_out?: number; cache_status?: string; client_ip?: string; credential_id?: string; decision_rule?: string; entry_hash?: string; event: string; id: string; latency_ms?: number; normalized_sql?: string; prev_hash?: string; project_id: string; query_hash?: string; reason?: string; region?: string; rows_returned?: number; seq?: number; session_id?: string; source?: string; sql?: string; statement_kind?: string; ts: string })[]; next_page_token?: string }",
420
420
  "responseStatus": "200"
421
421
  },
422
422
  "exportAuditLogs": {
@@ -481,6 +481,40 @@
481
481
  "responseType": "",
482
482
  "responseStatus": "200"
483
483
  },
484
+ "verifyAuditChain": {
485
+ "operationId": "verifyAuditChain",
486
+ "method": "GET",
487
+ "path": "/v1/projects/{project_id}/audit-logs/verify",
488
+ "summary": "Verify the tamper-evident audit chain",
489
+ "description": "Recomputes the project's audit hash chain over an optional time range and reports whether it is intact. Each audit entry is linked to its predecessor with a SHA-256 hash, so editing or deleting any row breaks the chain. On a break, the response reports the first sequence number where a tampered or deleted entry was detected. Requires the same audit:read permission as the list and export endpoints.",
490
+ "parameters": [
491
+ {
492
+ "name": "project_id",
493
+ "in": "path",
494
+ "required": true,
495
+ "type": "string",
496
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
497
+ },
498
+ {
499
+ "name": "start",
500
+ "in": "query",
501
+ "required": false,
502
+ "type": "string",
503
+ "description": "Return entries at or after this timestamp (inclusive lower bound)."
504
+ },
505
+ {
506
+ "name": "end",
507
+ "in": "query",
508
+ "required": false,
509
+ "type": "string",
510
+ "description": "Return entries strictly older than this timestamp (cursor / upper bound)."
511
+ }
512
+ ],
513
+ "requestBodyType": "",
514
+ "requestBodyRequired": false,
515
+ "responseType": "{ chain_end_seq?: number; chain_start_seq?: number; failure_reason?: string; first_broken_seq?: number; ok: boolean; unchained_count: number; verified_at: string; verified_count: number }",
516
+ "responseStatus": "200"
517
+ },
484
518
  "listPlans": {
485
519
  "operationId": "listPlans",
486
520
  "method": "GET",
@@ -1301,6 +1335,26 @@
1301
1335
  "responseType": "{ hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }",
1302
1336
  "responseStatus": "200"
1303
1337
  },
1338
+ "replayPolicy": {
1339
+ "operationId": "replayPolicy",
1340
+ "method": "POST",
1341
+ "path": "/v1/projects/{project_id}/policy-replays",
1342
+ "summary": "Replay recorded agent traffic against a policy",
1343
+ "description": "Replays the project's recorded agent audit traffic against a candidate policy (either a draft supplied inline or an existing policy referenced by id) and reports what would change: which queries that ran would now be blocked, which blocked queries would now be permitted, and which results would be masked or row-filtered. Traffic is deduplicated by normalized query shape, newest first, and every statement is evaluated through the data plane's own policy engine, so the verdicts match real enforcement. Stateful checks (budgets, approvals, write-mode routing) are reported as informational notes on each result, not verdicts. This endpoint reads only the audit log; it never connects to the upstream database and persists nothing.",
1344
+ "parameters": [
1345
+ {
1346
+ "name": "project_id",
1347
+ "in": "path",
1348
+ "required": true,
1349
+ "type": "string",
1350
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1351
+ }
1352
+ ],
1353
+ "requestBodyType": "{ credential_id?: string; end_ts?: string; limit?: number; policy?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; policy_id?: string; start_ts?: string }",
1354
+ "requestBodyRequired": true,
1355
+ "responseType": "{ items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }",
1356
+ "responseStatus": "200"
1357
+ },
1304
1358
  "listProjects": {
1305
1359
  "operationId": "listProjects",
1306
1360
  "method": "GET",
@@ -2037,6 +2091,10 @@
2037
2091
  exportAuditLogs: {
2038
2092
  method: "GET",
2039
2093
  path: "/v1/projects/{project_id}/audit-logs/export"
2094
+ },
2095
+ verifyAuditChain: {
2096
+ method: "GET",
2097
+ path: "/v1/projects/{project_id}/audit-logs/verify"
2040
2098
  }
2041
2099
  },
2042
2100
  anomalies: {
@@ -2255,6 +2313,10 @@
2255
2313
  dryEvalPolicy: {
2256
2314
  method: "POST",
2257
2315
  path: "/v1/projects/{project_id}/policy-evaluations"
2316
+ },
2317
+ replayPolicy: {
2318
+ method: "POST",
2319
+ path: "/v1/projects/{project_id}/policy-replays"
2258
2320
  }
2259
2321
  },
2260
2322
  support: {
@@ -2383,6 +2445,11 @@ const operationsByPath = {
2383
2445
  path: "/v1/projects/{project_id}/audit-logs/export",
2384
2446
  operationId: "exportAuditLogs"
2385
2447
  },
2448
+ "GET /v1/projects/{project_id}/audit-logs/verify": {
2449
+ method: "GET",
2450
+ path: "/v1/projects/{project_id}/audit-logs/verify",
2451
+ operationId: "verifyAuditChain"
2452
+ },
2386
2453
  "GET /v1/plans": {
2387
2454
  method: "GET",
2388
2455
  path: "/v1/plans",
@@ -2543,6 +2610,11 @@ const operationsByPath = {
2543
2610
  path: "/v1/projects/{project_id}/policy-evaluations",
2544
2611
  operationId: "dryEvalPolicy"
2545
2612
  },
2613
+ "POST /v1/projects/{project_id}/policy-replays": {
2614
+ method: "POST",
2615
+ path: "/v1/projects/{project_id}/policy-replays",
2616
+ operationId: "replayPolicy"
2617
+ },
2546
2618
  "GET /v1/projects": {
2547
2619
  method: "GET",
2548
2620
  path: "/v1/projects",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgbeam",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "TypeScript SDK for the PgBeam API — globally distributed PostgreSQL proxy platform",
5
5
  "type": "module",
6
6
  "exports": {