pgbeam 0.3.12 → 0.3.13

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.
package/dist/index.mjs CHANGED
@@ -58,6 +58,40 @@
58
58
  path: "/v1/projects/{project_id}/audit-logs/verify"
59
59
  }
60
60
  },
61
+ policies: {
62
+ recommendAgentPolicy: {
63
+ method: "POST",
64
+ path: "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation"
65
+ },
66
+ listPolicyProfiles: {
67
+ method: "GET",
68
+ path: "/v1/projects/{project_id}/policies"
69
+ },
70
+ createPolicyProfile: {
71
+ method: "POST",
72
+ path: "/v1/projects/{project_id}/policies"
73
+ },
74
+ getPolicyProfile: {
75
+ method: "GET",
76
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
77
+ },
78
+ updatePolicyProfile: {
79
+ method: "PUT",
80
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
81
+ },
82
+ deletePolicyProfile: {
83
+ method: "DELETE",
84
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
85
+ },
86
+ dryEvalPolicy: {
87
+ method: "POST",
88
+ path: "/v1/projects/{project_id}/policy-evaluations"
89
+ },
90
+ replayPolicy: {
91
+ method: "POST",
92
+ path: "/v1/projects/{project_id}/policy-replays"
93
+ }
94
+ },
61
95
  anomalies: {
62
96
  listAnomalyAlerts: {
63
97
  method: "GET",
@@ -248,40 +282,32 @@
248
282
  path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}/rotate"
249
283
  }
250
284
  },
251
- migrations: {
252
- lintMigration: {
253
- method: "POST",
254
- path: "/v1/projects/{project_id}/migrations:lint"
255
- }
256
- },
257
- policies: {
258
- listPolicyProfiles: {
285
+ honeytokens: {
286
+ listHoneytokens: {
259
287
  method: "GET",
260
- path: "/v1/projects/{project_id}/policies"
288
+ path: "/v1/projects/{project_id}/honeytokens"
261
289
  },
262
- createPolicyProfile: {
290
+ createHoneytoken: {
263
291
  method: "POST",
264
- path: "/v1/projects/{project_id}/policies"
292
+ path: "/v1/projects/{project_id}/honeytokens"
265
293
  },
266
- getPolicyProfile: {
294
+ getHoneytoken: {
267
295
  method: "GET",
268
- path: "/v1/projects/{project_id}/policies/{policy_id}"
296
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
269
297
  },
270
- updatePolicyProfile: {
298
+ updateHoneytoken: {
271
299
  method: "PUT",
272
- path: "/v1/projects/{project_id}/policies/{policy_id}"
300
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
273
301
  },
274
- deletePolicyProfile: {
302
+ deleteHoneytoken: {
275
303
  method: "DELETE",
276
- path: "/v1/projects/{project_id}/policies/{policy_id}"
277
- },
278
- dryEvalPolicy: {
279
- method: "POST",
280
- path: "/v1/projects/{project_id}/policy-evaluations"
281
- },
282
- replayPolicy: {
304
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
305
+ }
306
+ },
307
+ migrations: {
308
+ lintMigration: {
283
309
  method: "POST",
284
- path: "/v1/projects/{project_id}/policy-replays"
310
+ path: "/v1/projects/{project_id}/migrations:lint"
285
311
  }
286
312
  },
287
313
  support: {
@@ -375,6 +401,11 @@ const operationsByPath = {
375
401
  path: "/v1/projects/{project_id}/agents/{agent_id}/rotate",
376
402
  operationId: "rotateAgentCredential"
377
403
  },
404
+ "POST /v1/projects/{project_id}/agents/{agent_id}/policy-recommendation": {
405
+ method: "POST",
406
+ path: "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation",
407
+ operationId: "recommendAgentPolicy"
408
+ },
378
409
  "GET /v1/projects/{project_id}/anomalies": {
379
410
  method: "GET",
380
411
  path: "/v1/projects/{project_id}/anomalies",
@@ -525,6 +556,31 @@ const operationsByPath = {
525
556
  path: "/v1/health",
526
557
  operationId: "getHealth"
527
558
  },
559
+ "GET /v1/projects/{project_id}/honeytokens": {
560
+ method: "GET",
561
+ path: "/v1/projects/{project_id}/honeytokens",
562
+ operationId: "listHoneytokens"
563
+ },
564
+ "POST /v1/projects/{project_id}/honeytokens": {
565
+ method: "POST",
566
+ path: "/v1/projects/{project_id}/honeytokens",
567
+ operationId: "createHoneytoken"
568
+ },
569
+ "GET /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
570
+ method: "GET",
571
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
572
+ operationId: "getHoneytoken"
573
+ },
574
+ "PUT /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
575
+ method: "PUT",
576
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
577
+ operationId: "updateHoneytoken"
578
+ },
579
+ "DELETE /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
580
+ method: "DELETE",
581
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
582
+ operationId: "deleteHoneytoken"
583
+ },
528
584
  "GET /v1/projects/{project_id}/insights": {
529
585
  method: "GET",
530
586
  path: "/v1/projects/{project_id}/insights",
@@ -182,6 +182,33 @@ Object.defineProperty(exports, '__esModule', { value: true });
182
182
  "responseType": "{ connection_string: string; credential: { auth_method?: \"cleartext\" | \"scram-sha-256\"; created_at: string; expires_at?: string; id: string; last_used_at?: string; name: string; pg_username: string; policy_profile_id: string; principal_type?: \"agent\" | \"human\"; project_id: string; status: \"active\" | \"disabled\" | \"revoked\"; updated_at: string }; mcp_token: string; mcp_url: string }",
183
183
  "responseStatus": "200"
184
184
  },
185
+ "recommendAgentPolicy": {
186
+ "operationId": "recommendAgentPolicy",
187
+ "method": "POST",
188
+ "path": "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation",
189
+ "summary": "Recommend a least-privilege policy from recorded traffic",
190
+ "description": "Derives the tightest policy that would still pass every statement this agent credential has legitimately run, using its recorded audit history over a lookback window (default 30 days). The candidate's table allowlist is the union of relations actually referenced, its statement-kind allow set is the observed set, it downgrades to read-only when no writes were seen, and its max_rows ceiling comes from an observed high-percentile row count. The candidate is proven safe by replaying it through the data plane's own policy engine against the same history: a good recommendation has replay.summary.newly_blocked == 0. This endpoint is advisory only. It reads the audit log, never connects to the upstream database, and never creates, updates, or mutates any policy or credential; the operator loads the candidate into the editor and saves it themselves.",
191
+ "parameters": [
192
+ {
193
+ "name": "project_id",
194
+ "in": "path",
195
+ "required": true,
196
+ "type": "string",
197
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
198
+ },
199
+ {
200
+ "name": "agent_id",
201
+ "in": "path",
202
+ "required": true,
203
+ "type": "string",
204
+ "description": "Unique agent credential identifier (prefixed, e.g. agt_xxx)."
205
+ }
206
+ ],
207
+ "requestBodyType": "{ limit?: number; lookback_days?: number }",
208
+ "requestBodyRequired": false,
209
+ "responseType": "{ candidate?: { 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\" }; message?: string; notes?: string[]; observed_entries: number; observed_queries: number; replay?: { 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 } }; sufficient_history: boolean; window_end: string; window_start: string }",
210
+ "responseStatus": "200"
211
+ },
185
212
  "listAnomalyAlerts": {
186
213
  "operationId": "listAnomalyAlerts",
187
214
  "method": "GET",
@@ -1088,6 +1115,141 @@ Object.defineProperty(exports, '__esModule', { value: true });
1088
1115
  "responseType": "{ image_sha: string; status: \"ok\" | \"degraded\"; timestamp?: string; version: string }",
1089
1116
  "responseStatus": "200"
1090
1117
  },
1118
+ "listHoneytokens": {
1119
+ "operationId": "listHoneytokens",
1120
+ "method": "GET",
1121
+ "path": "/v1/projects/{project_id}/honeytokens",
1122
+ "summary": "List honeytokens",
1123
+ "description": "Lists the project's honeytokens.",
1124
+ "parameters": [
1125
+ {
1126
+ "name": "project_id",
1127
+ "in": "path",
1128
+ "required": true,
1129
+ "type": "string",
1130
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1131
+ },
1132
+ {
1133
+ "name": "page_size",
1134
+ "in": "query",
1135
+ "required": false,
1136
+ "type": "number",
1137
+ "description": "Maximum number of items to return (1-100, default 20)."
1138
+ },
1139
+ {
1140
+ "name": "page_token",
1141
+ "in": "query",
1142
+ "required": false,
1143
+ "type": "string",
1144
+ "description": "Opaque token for cursor-based pagination."
1145
+ }
1146
+ ],
1147
+ "requestBodyType": "",
1148
+ "requestBodyRequired": false,
1149
+ "responseType": "{ honeytokens: ({ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string })[]; next_page_token?: string }",
1150
+ "responseStatus": "200"
1151
+ },
1152
+ "createHoneytoken": {
1153
+ "operationId": "createHoneytoken",
1154
+ "method": "POST",
1155
+ "path": "/v1/projects/{project_id}/honeytokens",
1156
+ "summary": "Register a honeytoken",
1157
+ "description": "Registers a decoy (canary) relation for the project. Any agent statement\nthat references it is blocked and recorded as a canary_tripped audit event.\n",
1158
+ "parameters": [
1159
+ {
1160
+ "name": "project_id",
1161
+ "in": "path",
1162
+ "required": true,
1163
+ "type": "string",
1164
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1165
+ }
1166
+ ],
1167
+ "requestBodyType": "{ action: \"audit_only\" | \"kill\"; relation_name: string; schema_name?: string }",
1168
+ "requestBodyRequired": true,
1169
+ "responseType": "{ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string }",
1170
+ "responseStatus": "201"
1171
+ },
1172
+ "getHoneytoken": {
1173
+ "operationId": "getHoneytoken",
1174
+ "method": "GET",
1175
+ "path": "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
1176
+ "summary": "Get a honeytoken",
1177
+ "description": "Returns a single honeytoken by ID.",
1178
+ "parameters": [
1179
+ {
1180
+ "name": "project_id",
1181
+ "in": "path",
1182
+ "required": true,
1183
+ "type": "string",
1184
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1185
+ },
1186
+ {
1187
+ "name": "honeytoken_id",
1188
+ "in": "path",
1189
+ "required": true,
1190
+ "type": "string",
1191
+ "description": "Unique honeytoken identifier (prefixed, e.g. hnt_xxx)."
1192
+ }
1193
+ ],
1194
+ "requestBodyType": "",
1195
+ "requestBodyRequired": false,
1196
+ "responseType": "{ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string }",
1197
+ "responseStatus": "200"
1198
+ },
1199
+ "updateHoneytoken": {
1200
+ "operationId": "updateHoneytoken",
1201
+ "method": "PUT",
1202
+ "path": "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
1203
+ "summary": "Update a honeytoken",
1204
+ "description": "Updates a honeytoken's relation or action.",
1205
+ "parameters": [
1206
+ {
1207
+ "name": "project_id",
1208
+ "in": "path",
1209
+ "required": true,
1210
+ "type": "string",
1211
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1212
+ },
1213
+ {
1214
+ "name": "honeytoken_id",
1215
+ "in": "path",
1216
+ "required": true,
1217
+ "type": "string",
1218
+ "description": "Unique honeytoken identifier (prefixed, e.g. hnt_xxx)."
1219
+ }
1220
+ ],
1221
+ "requestBodyType": "{ action: \"audit_only\" | \"kill\"; relation_name: string; schema_name?: string }",
1222
+ "requestBodyRequired": true,
1223
+ "responseType": "{ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string }",
1224
+ "responseStatus": "200"
1225
+ },
1226
+ "deleteHoneytoken": {
1227
+ "operationId": "deleteHoneytoken",
1228
+ "method": "DELETE",
1229
+ "path": "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
1230
+ "summary": "Delete a honeytoken",
1231
+ "description": "Removes a honeytoken from the project.",
1232
+ "parameters": [
1233
+ {
1234
+ "name": "project_id",
1235
+ "in": "path",
1236
+ "required": true,
1237
+ "type": "string",
1238
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1239
+ },
1240
+ {
1241
+ "name": "honeytoken_id",
1242
+ "in": "path",
1243
+ "required": true,
1244
+ "type": "string",
1245
+ "description": "Unique honeytoken identifier (prefixed, e.g. hnt_xxx)."
1246
+ }
1247
+ ],
1248
+ "requestBodyType": "",
1249
+ "requestBodyRequired": false,
1250
+ "responseType": "",
1251
+ "responseStatus": "204"
1252
+ },
1091
1253
  "getProjectInsights": {
1092
1254
  "operationId": "getProjectInsights",
1093
1255
  "method": "GET",
@@ -2142,6 +2304,40 @@ Object.defineProperty(exports, '__esModule', { value: true });
2142
2304
  path: "/v1/projects/{project_id}/audit-logs/verify"
2143
2305
  }
2144
2306
  },
2307
+ policies: {
2308
+ recommendAgentPolicy: {
2309
+ method: "POST",
2310
+ path: "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation"
2311
+ },
2312
+ listPolicyProfiles: {
2313
+ method: "GET",
2314
+ path: "/v1/projects/{project_id}/policies"
2315
+ },
2316
+ createPolicyProfile: {
2317
+ method: "POST",
2318
+ path: "/v1/projects/{project_id}/policies"
2319
+ },
2320
+ getPolicyProfile: {
2321
+ method: "GET",
2322
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
2323
+ },
2324
+ updatePolicyProfile: {
2325
+ method: "PUT",
2326
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
2327
+ },
2328
+ deletePolicyProfile: {
2329
+ method: "DELETE",
2330
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
2331
+ },
2332
+ dryEvalPolicy: {
2333
+ method: "POST",
2334
+ path: "/v1/projects/{project_id}/policy-evaluations"
2335
+ },
2336
+ replayPolicy: {
2337
+ method: "POST",
2338
+ path: "/v1/projects/{project_id}/policy-replays"
2339
+ }
2340
+ },
2145
2341
  anomalies: {
2146
2342
  listAnomalyAlerts: {
2147
2343
  method: "GET",
@@ -2332,40 +2528,32 @@ Object.defineProperty(exports, '__esModule', { value: true });
2332
2528
  path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}/rotate"
2333
2529
  }
2334
2530
  },
2335
- migrations: {
2336
- lintMigration: {
2337
- method: "POST",
2338
- path: "/v1/projects/{project_id}/migrations:lint"
2339
- }
2340
- },
2341
- policies: {
2342
- listPolicyProfiles: {
2531
+ honeytokens: {
2532
+ listHoneytokens: {
2343
2533
  method: "GET",
2344
- path: "/v1/projects/{project_id}/policies"
2534
+ path: "/v1/projects/{project_id}/honeytokens"
2345
2535
  },
2346
- createPolicyProfile: {
2536
+ createHoneytoken: {
2347
2537
  method: "POST",
2348
- path: "/v1/projects/{project_id}/policies"
2538
+ path: "/v1/projects/{project_id}/honeytokens"
2349
2539
  },
2350
- getPolicyProfile: {
2540
+ getHoneytoken: {
2351
2541
  method: "GET",
2352
- path: "/v1/projects/{project_id}/policies/{policy_id}"
2542
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
2353
2543
  },
2354
- updatePolicyProfile: {
2544
+ updateHoneytoken: {
2355
2545
  method: "PUT",
2356
- path: "/v1/projects/{project_id}/policies/{policy_id}"
2546
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
2357
2547
  },
2358
- deletePolicyProfile: {
2548
+ deleteHoneytoken: {
2359
2549
  method: "DELETE",
2360
- path: "/v1/projects/{project_id}/policies/{policy_id}"
2361
- },
2362
- dryEvalPolicy: {
2363
- method: "POST",
2364
- path: "/v1/projects/{project_id}/policy-evaluations"
2365
- },
2366
- replayPolicy: {
2550
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
2551
+ }
2552
+ },
2553
+ migrations: {
2554
+ lintMigration: {
2367
2555
  method: "POST",
2368
- path: "/v1/projects/{project_id}/policy-replays"
2556
+ path: "/v1/projects/{project_id}/migrations:lint"
2369
2557
  }
2370
2558
  },
2371
2559
  support: {
@@ -2459,6 +2647,11 @@ const operationsByPath = {
2459
2647
  path: "/v1/projects/{project_id}/agents/{agent_id}/rotate",
2460
2648
  operationId: "rotateAgentCredential"
2461
2649
  },
2650
+ "POST /v1/projects/{project_id}/agents/{agent_id}/policy-recommendation": {
2651
+ method: "POST",
2652
+ path: "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation",
2653
+ operationId: "recommendAgentPolicy"
2654
+ },
2462
2655
  "GET /v1/projects/{project_id}/anomalies": {
2463
2656
  method: "GET",
2464
2657
  path: "/v1/projects/{project_id}/anomalies",
@@ -2609,6 +2802,31 @@ const operationsByPath = {
2609
2802
  path: "/v1/health",
2610
2803
  operationId: "getHealth"
2611
2804
  },
2805
+ "GET /v1/projects/{project_id}/honeytokens": {
2806
+ method: "GET",
2807
+ path: "/v1/projects/{project_id}/honeytokens",
2808
+ operationId: "listHoneytokens"
2809
+ },
2810
+ "POST /v1/projects/{project_id}/honeytokens": {
2811
+ method: "POST",
2812
+ path: "/v1/projects/{project_id}/honeytokens",
2813
+ operationId: "createHoneytoken"
2814
+ },
2815
+ "GET /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
2816
+ method: "GET",
2817
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
2818
+ operationId: "getHoneytoken"
2819
+ },
2820
+ "PUT /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
2821
+ method: "PUT",
2822
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
2823
+ operationId: "updateHoneytoken"
2824
+ },
2825
+ "DELETE /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
2826
+ method: "DELETE",
2827
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
2828
+ operationId: "deleteHoneytoken"
2829
+ },
2612
2830
  "GET /v1/projects/{project_id}/insights": {
2613
2831
  method: "GET",
2614
2832
  path: "/v1/projects/{project_id}/insights",