pgbeam 0.3.14 → 0.4.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.
package/dist/index.mjs CHANGED
@@ -1,1052 +1,4 @@
1
- /**
2
- * Generated by generate-sdk-ts-maps.ts — do not edit manually.
3
- * Run: pnpm --filter pgbeam generate
4
- */ const operationsByTag = {
5
- account: {
6
- exportAccountData: {
7
- method: "GET",
8
- path: "/v1/account/export"
9
- },
10
- getOnboardingProgress: {
11
- method: "GET",
12
- path: "/v1/organizations/{org_id}/onboarding"
13
- },
14
- updateOnboardingProgress: {
15
- method: "PATCH",
16
- path: "/v1/organizations/{org_id}/onboarding"
17
- },
18
- listOrganizations: {
19
- method: "GET",
20
- path: "/v1/organizations"
21
- }
22
- },
23
- agents: {
24
- listAgentCredentials: {
25
- method: "GET",
26
- path: "/v1/projects/{project_id}/agents"
27
- },
28
- createAgentCredential: {
29
- method: "POST",
30
- path: "/v1/projects/{project_id}/agents"
31
- },
32
- getAgentCredential: {
33
- method: "GET",
34
- path: "/v1/projects/{project_id}/agents/{agent_id}"
35
- },
36
- updateAgentCredentialStatus: {
37
- method: "PATCH",
38
- path: "/v1/projects/{project_id}/agents/{agent_id}"
39
- },
40
- revokeAgentCredential: {
41
- method: "DELETE",
42
- path: "/v1/projects/{project_id}/agents/{agent_id}"
43
- },
44
- rotateAgentCredential: {
45
- method: "POST",
46
- path: "/v1/projects/{project_id}/agents/{agent_id}/rotate"
47
- },
48
- listAuditLogs: {
49
- method: "GET",
50
- path: "/v1/projects/{project_id}/audit-logs"
51
- },
52
- exportAuditLogs: {
53
- method: "GET",
54
- path: "/v1/projects/{project_id}/audit-logs/export"
55
- },
56
- verifyAuditChain: {
57
- method: "GET",
58
- path: "/v1/projects/{project_id}/audit-logs/verify"
59
- }
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
- },
95
- anomalies: {
96
- listAnomalyAlerts: {
97
- method: "GET",
98
- path: "/v1/projects/{project_id}/anomalies"
99
- },
100
- updateAnomalyAlert: {
101
- method: "PATCH",
102
- path: "/v1/projects/{project_id}/anomalies/{anomaly_id}"
103
- }
104
- },
105
- approvals: {
106
- listApprovalRequests: {
107
- method: "GET",
108
- path: "/v1/projects/{project_id}/approvals"
109
- },
110
- approveApprovalRequest: {
111
- method: "POST",
112
- path: "/v1/projects/{project_id}/approvals/{approval_id}/approve"
113
- },
114
- rejectApprovalRequest: {
115
- method: "POST",
116
- path: "/v1/projects/{project_id}/approvals/{approval_id}/reject"
117
- }
118
- },
119
- analytics: {
120
- listPlans: {
121
- method: "GET",
122
- path: "/v1/plans"
123
- },
124
- getOrganizationPlan: {
125
- method: "GET",
126
- path: "/v1/organizations/{org_id}/plan"
127
- },
128
- getVercelInstallation: {
129
- method: "GET",
130
- path: "/v1/organizations/{org_id}/vercel-installation"
131
- },
132
- updateSpendLimit: {
133
- method: "PUT",
134
- path: "/v1/organizations/{org_id}/spend-limit"
135
- },
136
- submitCancellationFeedback: {
137
- method: "POST",
138
- path: "/v1/organizations/{org_id}/cancellation-feedback"
139
- },
140
- getProjectInsights: {
141
- method: "GET",
142
- path: "/v1/projects/{project_id}/insights"
143
- },
144
- getOrganizationUsage: {
145
- method: "GET",
146
- path: "/v1/organizations/{org_id}/usage"
147
- },
148
- getProjectUsage: {
149
- method: "GET",
150
- path: "/v1/projects/{project_id}/usage"
151
- }
152
- },
153
- branches: {
154
- listDatabaseBranches: {
155
- method: "GET",
156
- path: "/v1/projects/{project_id}/branches"
157
- },
158
- discardDatabaseBranch: {
159
- method: "DELETE",
160
- path: "/v1/projects/{project_id}/branches/{branch_id}"
161
- }
162
- },
163
- projects: {
164
- listCacheRules: {
165
- method: "GET",
166
- path: "/v1/projects/{project_id}/databases/{database_id}/cache-rules"
167
- },
168
- updateCacheRule: {
169
- method: "PUT",
170
- path: "/v1/projects/{project_id}/databases/{database_id}/cache-rules/{query_hash}"
171
- },
172
- listCustomDomains: {
173
- method: "GET",
174
- path: "/v1/projects/{project_id}/domains"
175
- },
176
- createCustomDomain: {
177
- method: "POST",
178
- path: "/v1/projects/{project_id}/domains"
179
- },
180
- deleteCustomDomain: {
181
- method: "DELETE",
182
- path: "/v1/projects/{project_id}/domains/{domain_id}"
183
- },
184
- verifyCustomDomain: {
185
- method: "POST",
186
- path: "/v1/projects/{project_id}/domains/{domain_id}/verify"
187
- },
188
- listProjects: {
189
- method: "GET",
190
- path: "/v1/projects"
191
- },
192
- createProject: {
193
- method: "POST",
194
- path: "/v1/projects"
195
- },
196
- getProject: {
197
- method: "GET",
198
- path: "/v1/projects/{project_id}"
199
- },
200
- updateProject: {
201
- method: "PATCH",
202
- path: "/v1/projects/{project_id}"
203
- },
204
- deleteProject: {
205
- method: "DELETE",
206
- path: "/v1/projects/{project_id}"
207
- },
208
- getProjectMetrics: {
209
- method: "GET",
210
- path: "/v1/projects/{project_id}/metrics"
211
- },
212
- listReplicas: {
213
- method: "GET",
214
- path: "/v1/databases/{database_id}/replicas"
215
- },
216
- createReplica: {
217
- method: "POST",
218
- path: "/v1/databases/{database_id}/replicas"
219
- },
220
- deleteReplica: {
221
- method: "DELETE",
222
- path: "/v1/databases/{database_id}/replicas/{replica_id}"
223
- }
224
- },
225
- crm: {
226
- listCrmCompanies: {
227
- method: "GET",
228
- path: "/v1/organizations/{org_id}/crm/companies"
229
- },
230
- createCrmCompany: {
231
- method: "POST",
232
- path: "/v1/organizations/{org_id}/crm/companies"
233
- },
234
- getCrmCompany: {
235
- method: "GET",
236
- path: "/v1/organizations/{org_id}/crm/companies/{company_id}"
237
- },
238
- updateCrmCompany: {
239
- method: "PUT",
240
- path: "/v1/organizations/{org_id}/crm/companies/{company_id}"
241
- },
242
- deleteCrmCompany: {
243
- method: "DELETE",
244
- path: "/v1/organizations/{org_id}/crm/companies/{company_id}"
245
- },
246
- listCrmContacts: {
247
- method: "GET",
248
- path: "/v1/organizations/{org_id}/crm/contacts"
249
- },
250
- createCrmContact: {
251
- method: "POST",
252
- path: "/v1/organizations/{org_id}/crm/contacts"
253
- },
254
- getCrmContact: {
255
- method: "GET",
256
- path: "/v1/organizations/{org_id}/crm/contacts/{contact_id}"
257
- },
258
- updateCrmContact: {
259
- method: "PUT",
260
- path: "/v1/organizations/{org_id}/crm/contacts/{contact_id}"
261
- },
262
- deleteCrmContact: {
263
- method: "DELETE",
264
- path: "/v1/organizations/{org_id}/crm/contacts/{contact_id}"
265
- },
266
- listCrmDeals: {
267
- method: "GET",
268
- path: "/v1/organizations/{org_id}/crm/deals"
269
- },
270
- createCrmDeal: {
271
- method: "POST",
272
- path: "/v1/organizations/{org_id}/crm/deals"
273
- },
274
- getCrmPipeline: {
275
- method: "GET",
276
- path: "/v1/organizations/{org_id}/crm/pipeline"
277
- },
278
- getCrmDeal: {
279
- method: "GET",
280
- path: "/v1/organizations/{org_id}/crm/deals/{deal_id}"
281
- },
282
- updateCrmDeal: {
283
- method: "PUT",
284
- path: "/v1/organizations/{org_id}/crm/deals/{deal_id}"
285
- },
286
- deleteCrmDeal: {
287
- method: "DELETE",
288
- path: "/v1/organizations/{org_id}/crm/deals/{deal_id}"
289
- },
290
- listCrmResearchTasks: {
291
- method: "GET",
292
- path: "/v1/organizations/{org_id}/crm/research-tasks"
293
- },
294
- createCrmResearchTask: {
295
- method: "POST",
296
- path: "/v1/organizations/{org_id}/crm/research-tasks"
297
- },
298
- getCrmResearchTask: {
299
- method: "GET",
300
- path: "/v1/organizations/{org_id}/crm/research-tasks/{task_id}"
301
- },
302
- cancelCrmResearchTask: {
303
- method: "POST",
304
- path: "/v1/organizations/{org_id}/crm/research-tasks/{task_id}/cancel"
305
- },
306
- getCrmContext: {
307
- method: "GET",
308
- path: "/v1/organizations/{org_id}/crm/context"
309
- },
310
- updateCrmContext: {
311
- method: "PUT",
312
- path: "/v1/organizations/{org_id}/crm/context"
313
- },
314
- approveCrmResearchTask: {
315
- method: "POST",
316
- path: "/v1/organizations/{org_id}/crm/research-tasks/{task_id}/approve"
317
- },
318
- listCrmArtifacts: {
319
- method: "GET",
320
- path: "/v1/organizations/{org_id}/crm/artifacts"
321
- },
322
- getCrmArtifact: {
323
- method: "GET",
324
- path: "/v1/organizations/{org_id}/crm/artifacts/{artifact_id}"
325
- },
326
- listCrmActivities: {
327
- method: "GET",
328
- path: "/v1/organizations/{org_id}/crm/activities"
329
- }
330
- },
331
- databases: {
332
- listDatabases: {
333
- method: "GET",
334
- path: "/v1/projects/{project_id}/databases"
335
- },
336
- createDatabase: {
337
- method: "POST",
338
- path: "/v1/projects/{project_id}/databases"
339
- },
340
- getDatabase: {
341
- method: "GET",
342
- path: "/v1/projects/{project_id}/databases/{database_id}"
343
- },
344
- updateDatabase: {
345
- method: "PATCH",
346
- path: "/v1/projects/{project_id}/databases/{database_id}"
347
- },
348
- deleteDatabase: {
349
- method: "DELETE",
350
- path: "/v1/projects/{project_id}/databases/{database_id}"
351
- },
352
- testDatabaseConnection: {
353
- method: "POST",
354
- path: "/v1/projects/{project_id}/databases/{database_id}/test-connection"
355
- },
356
- scanDatabaseForPii: {
357
- method: "POST",
358
- path: "/v1/projects/{project_id}/databases/{database_id}/scan-pii"
359
- },
360
- getSchemaCatalog: {
361
- method: "GET",
362
- path: "/v1/projects/{project_id}/databases/{database_id}/schema-catalog"
363
- }
364
- },
365
- platform: {
366
- getHealth: {
367
- method: "GET",
368
- path: "/v1/health"
369
- },
370
- listRegions: {
371
- method: "GET",
372
- path: "/v1/regions"
373
- },
374
- listSelfHostEnrollments: {
375
- method: "GET",
376
- path: "/v1/organizations/{org_id}/self-host-enrollments"
377
- },
378
- createSelfHostEnrollment: {
379
- method: "POST",
380
- path: "/v1/organizations/{org_id}/self-host-enrollments"
381
- },
382
- revokeSelfHostEnrollment: {
383
- method: "DELETE",
384
- path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}"
385
- },
386
- rotateSelfHostEnrollment: {
387
- method: "POST",
388
- path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}/rotate"
389
- }
390
- },
391
- honeytokens: {
392
- listHoneytokens: {
393
- method: "GET",
394
- path: "/v1/projects/{project_id}/honeytokens"
395
- },
396
- createHoneytoken: {
397
- method: "POST",
398
- path: "/v1/projects/{project_id}/honeytokens"
399
- },
400
- getHoneytoken: {
401
- method: "GET",
402
- path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
403
- },
404
- updateHoneytoken: {
405
- method: "PUT",
406
- path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
407
- },
408
- deleteHoneytoken: {
409
- method: "DELETE",
410
- path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
411
- }
412
- },
413
- migrations: {
414
- lintMigration: {
415
- method: "POST",
416
- path: "/v1/projects/{project_id}/migrations:lint"
417
- }
418
- },
419
- schemaAnnotations: {
420
- listSchemaAnnotations: {
421
- method: "GET",
422
- path: "/v1/projects/{project_id}/schema-annotations"
423
- },
424
- putSchemaAnnotation: {
425
- method: "PUT",
426
- path: "/v1/projects/{project_id}/schema-annotations"
427
- },
428
- deleteSchemaAnnotation: {
429
- method: "DELETE",
430
- path: "/v1/projects/{project_id}/schema-annotations"
431
- }
432
- },
433
- support: {
434
- listSupportCases: {
435
- method: "GET",
436
- path: "/v1/organizations/{org_id}/support/cases"
437
- },
438
- createSupportCase: {
439
- method: "POST",
440
- path: "/v1/organizations/{org_id}/support/cases"
441
- },
442
- getSupportCase: {
443
- method: "GET",
444
- path: "/v1/organizations/{org_id}/support/cases/{case_id}"
445
- },
446
- updateSupportCase: {
447
- method: "PATCH",
448
- path: "/v1/organizations/{org_id}/support/cases/{case_id}"
449
- },
450
- createSupportMessage: {
451
- method: "POST",
452
- path: "/v1/organizations/{org_id}/support/cases/{case_id}/messages"
453
- }
454
- },
455
- internal: {
456
- handleSlackSupportEvent: {
457
- method: "POST",
458
- path: "/v1/internal/support/slack-event"
459
- }
460
- },
461
- webhooks: {
462
- listWebhookEndpoints: {
463
- method: "GET",
464
- path: "/v1/projects/{project_id}/webhooks"
465
- },
466
- createWebhookEndpoint: {
467
- method: "POST",
468
- path: "/v1/projects/{project_id}/webhooks"
469
- },
470
- getWebhookEndpoint: {
471
- method: "GET",
472
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}"
473
- },
474
- updateWebhookEndpoint: {
475
- method: "PUT",
476
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}"
477
- },
478
- deleteWebhookEndpoint: {
479
- method: "DELETE",
480
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}"
481
- },
482
- testWebhookEndpoint: {
483
- method: "POST",
484
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}/test"
485
- }
486
- }
487
- };
488
- const operationsByPath = {
489
- "GET /v1/account/export": {
490
- method: "GET",
491
- path: "/v1/account/export",
492
- operationId: "exportAccountData"
493
- },
494
- "GET /v1/projects/{project_id}/agents": {
495
- method: "GET",
496
- path: "/v1/projects/{project_id}/agents",
497
- operationId: "listAgentCredentials"
498
- },
499
- "POST /v1/projects/{project_id}/agents": {
500
- method: "POST",
501
- path: "/v1/projects/{project_id}/agents",
502
- operationId: "createAgentCredential"
503
- },
504
- "GET /v1/projects/{project_id}/agents/{agent_id}": {
505
- method: "GET",
506
- path: "/v1/projects/{project_id}/agents/{agent_id}",
507
- operationId: "getAgentCredential"
508
- },
509
- "PATCH /v1/projects/{project_id}/agents/{agent_id}": {
510
- method: "PATCH",
511
- path: "/v1/projects/{project_id}/agents/{agent_id}",
512
- operationId: "updateAgentCredentialStatus"
513
- },
514
- "DELETE /v1/projects/{project_id}/agents/{agent_id}": {
515
- method: "DELETE",
516
- path: "/v1/projects/{project_id}/agents/{agent_id}",
517
- operationId: "revokeAgentCredential"
518
- },
519
- "POST /v1/projects/{project_id}/agents/{agent_id}/rotate": {
520
- method: "POST",
521
- path: "/v1/projects/{project_id}/agents/{agent_id}/rotate",
522
- operationId: "rotateAgentCredential"
523
- },
524
- "POST /v1/projects/{project_id}/agents/{agent_id}/policy-recommendation": {
525
- method: "POST",
526
- path: "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation",
527
- operationId: "recommendAgentPolicy"
528
- },
529
- "GET /v1/projects/{project_id}/anomalies": {
530
- method: "GET",
531
- path: "/v1/projects/{project_id}/anomalies",
532
- operationId: "listAnomalyAlerts"
533
- },
534
- "PATCH /v1/projects/{project_id}/anomalies/{anomaly_id}": {
535
- method: "PATCH",
536
- path: "/v1/projects/{project_id}/anomalies/{anomaly_id}",
537
- operationId: "updateAnomalyAlert"
538
- },
539
- "GET /v1/projects/{project_id}/approvals": {
540
- method: "GET",
541
- path: "/v1/projects/{project_id}/approvals",
542
- operationId: "listApprovalRequests"
543
- },
544
- "POST /v1/projects/{project_id}/approvals/{approval_id}/approve": {
545
- method: "POST",
546
- path: "/v1/projects/{project_id}/approvals/{approval_id}/approve",
547
- operationId: "approveApprovalRequest"
548
- },
549
- "POST /v1/projects/{project_id}/approvals/{approval_id}/reject": {
550
- method: "POST",
551
- path: "/v1/projects/{project_id}/approvals/{approval_id}/reject",
552
- operationId: "rejectApprovalRequest"
553
- },
554
- "GET /v1/projects/{project_id}/audit-logs": {
555
- method: "GET",
556
- path: "/v1/projects/{project_id}/audit-logs",
557
- operationId: "listAuditLogs"
558
- },
559
- "GET /v1/projects/{project_id}/audit-logs/export": {
560
- method: "GET",
561
- path: "/v1/projects/{project_id}/audit-logs/export",
562
- operationId: "exportAuditLogs"
563
- },
564
- "GET /v1/projects/{project_id}/audit-logs/verify": {
565
- method: "GET",
566
- path: "/v1/projects/{project_id}/audit-logs/verify",
567
- operationId: "verifyAuditChain"
568
- },
569
- "GET /v1/plans": {
570
- method: "GET",
571
- path: "/v1/plans",
572
- operationId: "listPlans"
573
- },
574
- "GET /v1/organizations/{org_id}/plan": {
575
- method: "GET",
576
- path: "/v1/organizations/{org_id}/plan",
577
- operationId: "getOrganizationPlan"
578
- },
579
- "GET /v1/organizations/{org_id}/vercel-installation": {
580
- method: "GET",
581
- path: "/v1/organizations/{org_id}/vercel-installation",
582
- operationId: "getVercelInstallation"
583
- },
584
- "PUT /v1/organizations/{org_id}/spend-limit": {
585
- method: "PUT",
586
- path: "/v1/organizations/{org_id}/spend-limit",
587
- operationId: "updateSpendLimit"
588
- },
589
- "POST /v1/organizations/{org_id}/cancellation-feedback": {
590
- method: "POST",
591
- path: "/v1/organizations/{org_id}/cancellation-feedback",
592
- operationId: "submitCancellationFeedback"
593
- },
594
- "GET /v1/projects/{project_id}/branches": {
595
- method: "GET",
596
- path: "/v1/projects/{project_id}/branches",
597
- operationId: "listDatabaseBranches"
598
- },
599
- "DELETE /v1/projects/{project_id}/branches/{branch_id}": {
600
- method: "DELETE",
601
- path: "/v1/projects/{project_id}/branches/{branch_id}",
602
- operationId: "discardDatabaseBranch"
603
- },
604
- "GET /v1/projects/{project_id}/databases/{database_id}/cache-rules": {
605
- method: "GET",
606
- path: "/v1/projects/{project_id}/databases/{database_id}/cache-rules",
607
- operationId: "listCacheRules"
608
- },
609
- "PUT /v1/projects/{project_id}/databases/{database_id}/cache-rules/{query_hash}": {
610
- method: "PUT",
611
- path: "/v1/projects/{project_id}/databases/{database_id}/cache-rules/{query_hash}",
612
- operationId: "updateCacheRule"
613
- },
614
- "GET /v1/organizations/{org_id}/crm/companies": {
615
- method: "GET",
616
- path: "/v1/organizations/{org_id}/crm/companies",
617
- operationId: "listCrmCompanies"
618
- },
619
- "POST /v1/organizations/{org_id}/crm/companies": {
620
- method: "POST",
621
- path: "/v1/organizations/{org_id}/crm/companies",
622
- operationId: "createCrmCompany"
623
- },
624
- "GET /v1/organizations/{org_id}/crm/companies/{company_id}": {
625
- method: "GET",
626
- path: "/v1/organizations/{org_id}/crm/companies/{company_id}",
627
- operationId: "getCrmCompany"
628
- },
629
- "PUT /v1/organizations/{org_id}/crm/companies/{company_id}": {
630
- method: "PUT",
631
- path: "/v1/organizations/{org_id}/crm/companies/{company_id}",
632
- operationId: "updateCrmCompany"
633
- },
634
- "DELETE /v1/organizations/{org_id}/crm/companies/{company_id}": {
635
- method: "DELETE",
636
- path: "/v1/organizations/{org_id}/crm/companies/{company_id}",
637
- operationId: "deleteCrmCompany"
638
- },
639
- "GET /v1/organizations/{org_id}/crm/contacts": {
640
- method: "GET",
641
- path: "/v1/organizations/{org_id}/crm/contacts",
642
- operationId: "listCrmContacts"
643
- },
644
- "POST /v1/organizations/{org_id}/crm/contacts": {
645
- method: "POST",
646
- path: "/v1/organizations/{org_id}/crm/contacts",
647
- operationId: "createCrmContact"
648
- },
649
- "GET /v1/organizations/{org_id}/crm/contacts/{contact_id}": {
650
- method: "GET",
651
- path: "/v1/organizations/{org_id}/crm/contacts/{contact_id}",
652
- operationId: "getCrmContact"
653
- },
654
- "PUT /v1/organizations/{org_id}/crm/contacts/{contact_id}": {
655
- method: "PUT",
656
- path: "/v1/organizations/{org_id}/crm/contacts/{contact_id}",
657
- operationId: "updateCrmContact"
658
- },
659
- "DELETE /v1/organizations/{org_id}/crm/contacts/{contact_id}": {
660
- method: "DELETE",
661
- path: "/v1/organizations/{org_id}/crm/contacts/{contact_id}",
662
- operationId: "deleteCrmContact"
663
- },
664
- "GET /v1/organizations/{org_id}/crm/deals": {
665
- method: "GET",
666
- path: "/v1/organizations/{org_id}/crm/deals",
667
- operationId: "listCrmDeals"
668
- },
669
- "POST /v1/organizations/{org_id}/crm/deals": {
670
- method: "POST",
671
- path: "/v1/organizations/{org_id}/crm/deals",
672
- operationId: "createCrmDeal"
673
- },
674
- "GET /v1/organizations/{org_id}/crm/pipeline": {
675
- method: "GET",
676
- path: "/v1/organizations/{org_id}/crm/pipeline",
677
- operationId: "getCrmPipeline"
678
- },
679
- "GET /v1/organizations/{org_id}/crm/deals/{deal_id}": {
680
- method: "GET",
681
- path: "/v1/organizations/{org_id}/crm/deals/{deal_id}",
682
- operationId: "getCrmDeal"
683
- },
684
- "PUT /v1/organizations/{org_id}/crm/deals/{deal_id}": {
685
- method: "PUT",
686
- path: "/v1/organizations/{org_id}/crm/deals/{deal_id}",
687
- operationId: "updateCrmDeal"
688
- },
689
- "DELETE /v1/organizations/{org_id}/crm/deals/{deal_id}": {
690
- method: "DELETE",
691
- path: "/v1/organizations/{org_id}/crm/deals/{deal_id}",
692
- operationId: "deleteCrmDeal"
693
- },
694
- "GET /v1/organizations/{org_id}/crm/research-tasks": {
695
- method: "GET",
696
- path: "/v1/organizations/{org_id}/crm/research-tasks",
697
- operationId: "listCrmResearchTasks"
698
- },
699
- "POST /v1/organizations/{org_id}/crm/research-tasks": {
700
- method: "POST",
701
- path: "/v1/organizations/{org_id}/crm/research-tasks",
702
- operationId: "createCrmResearchTask"
703
- },
704
- "GET /v1/organizations/{org_id}/crm/research-tasks/{task_id}": {
705
- method: "GET",
706
- path: "/v1/organizations/{org_id}/crm/research-tasks/{task_id}",
707
- operationId: "getCrmResearchTask"
708
- },
709
- "POST /v1/organizations/{org_id}/crm/research-tasks/{task_id}/cancel": {
710
- method: "POST",
711
- path: "/v1/organizations/{org_id}/crm/research-tasks/{task_id}/cancel",
712
- operationId: "cancelCrmResearchTask"
713
- },
714
- "GET /v1/organizations/{org_id}/crm/context": {
715
- method: "GET",
716
- path: "/v1/organizations/{org_id}/crm/context",
717
- operationId: "getCrmContext"
718
- },
719
- "PUT /v1/organizations/{org_id}/crm/context": {
720
- method: "PUT",
721
- path: "/v1/organizations/{org_id}/crm/context",
722
- operationId: "updateCrmContext"
723
- },
724
- "POST /v1/organizations/{org_id}/crm/research-tasks/{task_id}/approve": {
725
- method: "POST",
726
- path: "/v1/organizations/{org_id}/crm/research-tasks/{task_id}/approve",
727
- operationId: "approveCrmResearchTask"
728
- },
729
- "GET /v1/organizations/{org_id}/crm/artifacts": {
730
- method: "GET",
731
- path: "/v1/organizations/{org_id}/crm/artifacts",
732
- operationId: "listCrmArtifacts"
733
- },
734
- "GET /v1/organizations/{org_id}/crm/artifacts/{artifact_id}": {
735
- method: "GET",
736
- path: "/v1/organizations/{org_id}/crm/artifacts/{artifact_id}",
737
- operationId: "getCrmArtifact"
738
- },
739
- "GET /v1/organizations/{org_id}/crm/activities": {
740
- method: "GET",
741
- path: "/v1/organizations/{org_id}/crm/activities",
742
- operationId: "listCrmActivities"
743
- },
744
- "GET /v1/projects/{project_id}/databases": {
745
- method: "GET",
746
- path: "/v1/projects/{project_id}/databases",
747
- operationId: "listDatabases"
748
- },
749
- "POST /v1/projects/{project_id}/databases": {
750
- method: "POST",
751
- path: "/v1/projects/{project_id}/databases",
752
- operationId: "createDatabase"
753
- },
754
- "GET /v1/projects/{project_id}/databases/{database_id}": {
755
- method: "GET",
756
- path: "/v1/projects/{project_id}/databases/{database_id}",
757
- operationId: "getDatabase"
758
- },
759
- "PATCH /v1/projects/{project_id}/databases/{database_id}": {
760
- method: "PATCH",
761
- path: "/v1/projects/{project_id}/databases/{database_id}",
762
- operationId: "updateDatabase"
763
- },
764
- "DELETE /v1/projects/{project_id}/databases/{database_id}": {
765
- method: "DELETE",
766
- path: "/v1/projects/{project_id}/databases/{database_id}",
767
- operationId: "deleteDatabase"
768
- },
769
- "POST /v1/projects/{project_id}/databases/{database_id}/test-connection": {
770
- method: "POST",
771
- path: "/v1/projects/{project_id}/databases/{database_id}/test-connection",
772
- operationId: "testDatabaseConnection"
773
- },
774
- "POST /v1/projects/{project_id}/databases/{database_id}/scan-pii": {
775
- method: "POST",
776
- path: "/v1/projects/{project_id}/databases/{database_id}/scan-pii",
777
- operationId: "scanDatabaseForPii"
778
- },
779
- "GET /v1/projects/{project_id}/databases/{database_id}/schema-catalog": {
780
- method: "GET",
781
- path: "/v1/projects/{project_id}/databases/{database_id}/schema-catalog",
782
- operationId: "getSchemaCatalog"
783
- },
784
- "GET /v1/projects/{project_id}/domains": {
785
- method: "GET",
786
- path: "/v1/projects/{project_id}/domains",
787
- operationId: "listCustomDomains"
788
- },
789
- "POST /v1/projects/{project_id}/domains": {
790
- method: "POST",
791
- path: "/v1/projects/{project_id}/domains",
792
- operationId: "createCustomDomain"
793
- },
794
- "DELETE /v1/projects/{project_id}/domains/{domain_id}": {
795
- method: "DELETE",
796
- path: "/v1/projects/{project_id}/domains/{domain_id}",
797
- operationId: "deleteCustomDomain"
798
- },
799
- "POST /v1/projects/{project_id}/domains/{domain_id}/verify": {
800
- method: "POST",
801
- path: "/v1/projects/{project_id}/domains/{domain_id}/verify",
802
- operationId: "verifyCustomDomain"
803
- },
804
- "GET /v1/health": {
805
- method: "GET",
806
- path: "/v1/health",
807
- operationId: "getHealth"
808
- },
809
- "GET /v1/projects/{project_id}/honeytokens": {
810
- method: "GET",
811
- path: "/v1/projects/{project_id}/honeytokens",
812
- operationId: "listHoneytokens"
813
- },
814
- "POST /v1/projects/{project_id}/honeytokens": {
815
- method: "POST",
816
- path: "/v1/projects/{project_id}/honeytokens",
817
- operationId: "createHoneytoken"
818
- },
819
- "GET /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
820
- method: "GET",
821
- path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
822
- operationId: "getHoneytoken"
823
- },
824
- "PUT /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
825
- method: "PUT",
826
- path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
827
- operationId: "updateHoneytoken"
828
- },
829
- "DELETE /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
830
- method: "DELETE",
831
- path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
832
- operationId: "deleteHoneytoken"
833
- },
834
- "GET /v1/projects/{project_id}/insights": {
835
- method: "GET",
836
- path: "/v1/projects/{project_id}/insights",
837
- operationId: "getProjectInsights"
838
- },
839
- "POST /v1/projects/{project_id}/migrations:lint": {
840
- method: "POST",
841
- path: "/v1/projects/{project_id}/migrations:lint",
842
- operationId: "lintMigration"
843
- },
844
- "GET /v1/organizations/{org_id}/onboarding": {
845
- method: "GET",
846
- path: "/v1/organizations/{org_id}/onboarding",
847
- operationId: "getOnboardingProgress"
848
- },
849
- "PATCH /v1/organizations/{org_id}/onboarding": {
850
- method: "PATCH",
851
- path: "/v1/organizations/{org_id}/onboarding",
852
- operationId: "updateOnboardingProgress"
853
- },
854
- "GET /v1/organizations": {
855
- method: "GET",
856
- path: "/v1/organizations",
857
- operationId: "listOrganizations"
858
- },
859
- "GET /v1/projects/{project_id}/policies": {
860
- method: "GET",
861
- path: "/v1/projects/{project_id}/policies",
862
- operationId: "listPolicyProfiles"
863
- },
864
- "POST /v1/projects/{project_id}/policies": {
865
- method: "POST",
866
- path: "/v1/projects/{project_id}/policies",
867
- operationId: "createPolicyProfile"
868
- },
869
- "GET /v1/projects/{project_id}/policies/{policy_id}": {
870
- method: "GET",
871
- path: "/v1/projects/{project_id}/policies/{policy_id}",
872
- operationId: "getPolicyProfile"
873
- },
874
- "PUT /v1/projects/{project_id}/policies/{policy_id}": {
875
- method: "PUT",
876
- path: "/v1/projects/{project_id}/policies/{policy_id}",
877
- operationId: "updatePolicyProfile"
878
- },
879
- "DELETE /v1/projects/{project_id}/policies/{policy_id}": {
880
- method: "DELETE",
881
- path: "/v1/projects/{project_id}/policies/{policy_id}",
882
- operationId: "deletePolicyProfile"
883
- },
884
- "POST /v1/projects/{project_id}/policy-evaluations": {
885
- method: "POST",
886
- path: "/v1/projects/{project_id}/policy-evaluations",
887
- operationId: "dryEvalPolicy"
888
- },
889
- "POST /v1/projects/{project_id}/policy-replays": {
890
- method: "POST",
891
- path: "/v1/projects/{project_id}/policy-replays",
892
- operationId: "replayPolicy"
893
- },
894
- "GET /v1/projects": {
895
- method: "GET",
896
- path: "/v1/projects",
897
- operationId: "listProjects"
898
- },
899
- "POST /v1/projects": {
900
- method: "POST",
901
- path: "/v1/projects",
902
- operationId: "createProject"
903
- },
904
- "GET /v1/projects/{project_id}": {
905
- method: "GET",
906
- path: "/v1/projects/{project_id}",
907
- operationId: "getProject"
908
- },
909
- "PATCH /v1/projects/{project_id}": {
910
- method: "PATCH",
911
- path: "/v1/projects/{project_id}",
912
- operationId: "updateProject"
913
- },
914
- "DELETE /v1/projects/{project_id}": {
915
- method: "DELETE",
916
- path: "/v1/projects/{project_id}",
917
- operationId: "deleteProject"
918
- },
919
- "GET /v1/projects/{project_id}/metrics": {
920
- method: "GET",
921
- path: "/v1/projects/{project_id}/metrics",
922
- operationId: "getProjectMetrics"
923
- },
924
- "GET /v1/regions": {
925
- method: "GET",
926
- path: "/v1/regions",
927
- operationId: "listRegions"
928
- },
929
- "GET /v1/databases/{database_id}/replicas": {
930
- method: "GET",
931
- path: "/v1/databases/{database_id}/replicas",
932
- operationId: "listReplicas"
933
- },
934
- "POST /v1/databases/{database_id}/replicas": {
935
- method: "POST",
936
- path: "/v1/databases/{database_id}/replicas",
937
- operationId: "createReplica"
938
- },
939
- "DELETE /v1/databases/{database_id}/replicas/{replica_id}": {
940
- method: "DELETE",
941
- path: "/v1/databases/{database_id}/replicas/{replica_id}",
942
- operationId: "deleteReplica"
943
- },
944
- "GET /v1/projects/{project_id}/schema-annotations": {
945
- method: "GET",
946
- path: "/v1/projects/{project_id}/schema-annotations",
947
- operationId: "listSchemaAnnotations"
948
- },
949
- "PUT /v1/projects/{project_id}/schema-annotations": {
950
- method: "PUT",
951
- path: "/v1/projects/{project_id}/schema-annotations",
952
- operationId: "putSchemaAnnotation"
953
- },
954
- "DELETE /v1/projects/{project_id}/schema-annotations": {
955
- method: "DELETE",
956
- path: "/v1/projects/{project_id}/schema-annotations",
957
- operationId: "deleteSchemaAnnotation"
958
- },
959
- "GET /v1/organizations/{org_id}/self-host-enrollments": {
960
- method: "GET",
961
- path: "/v1/organizations/{org_id}/self-host-enrollments",
962
- operationId: "listSelfHostEnrollments"
963
- },
964
- "POST /v1/organizations/{org_id}/self-host-enrollments": {
965
- method: "POST",
966
- path: "/v1/organizations/{org_id}/self-host-enrollments",
967
- operationId: "createSelfHostEnrollment"
968
- },
969
- "DELETE /v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}": {
970
- method: "DELETE",
971
- path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}",
972
- operationId: "revokeSelfHostEnrollment"
973
- },
974
- "POST /v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}/rotate": {
975
- method: "POST",
976
- path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}/rotate",
977
- operationId: "rotateSelfHostEnrollment"
978
- },
979
- "GET /v1/organizations/{org_id}/support/cases": {
980
- method: "GET",
981
- path: "/v1/organizations/{org_id}/support/cases",
982
- operationId: "listSupportCases"
983
- },
984
- "POST /v1/organizations/{org_id}/support/cases": {
985
- method: "POST",
986
- path: "/v1/organizations/{org_id}/support/cases",
987
- operationId: "createSupportCase"
988
- },
989
- "GET /v1/organizations/{org_id}/support/cases/{case_id}": {
990
- method: "GET",
991
- path: "/v1/organizations/{org_id}/support/cases/{case_id}",
992
- operationId: "getSupportCase"
993
- },
994
- "PATCH /v1/organizations/{org_id}/support/cases/{case_id}": {
995
- method: "PATCH",
996
- path: "/v1/organizations/{org_id}/support/cases/{case_id}",
997
- operationId: "updateSupportCase"
998
- },
999
- "POST /v1/organizations/{org_id}/support/cases/{case_id}/messages": {
1000
- method: "POST",
1001
- path: "/v1/organizations/{org_id}/support/cases/{case_id}/messages",
1002
- operationId: "createSupportMessage"
1003
- },
1004
- "POST /v1/internal/support/slack-event": {
1005
- method: "POST",
1006
- path: "/v1/internal/support/slack-event",
1007
- operationId: "handleSlackSupportEvent"
1008
- },
1009
- "GET /v1/organizations/{org_id}/usage": {
1010
- method: "GET",
1011
- path: "/v1/organizations/{org_id}/usage",
1012
- operationId: "getOrganizationUsage"
1013
- },
1014
- "GET /v1/projects/{project_id}/usage": {
1015
- method: "GET",
1016
- path: "/v1/projects/{project_id}/usage",
1017
- operationId: "getProjectUsage"
1018
- },
1019
- "GET /v1/projects/{project_id}/webhooks": {
1020
- method: "GET",
1021
- path: "/v1/projects/{project_id}/webhooks",
1022
- operationId: "listWebhookEndpoints"
1023
- },
1024
- "POST /v1/projects/{project_id}/webhooks": {
1025
- method: "POST",
1026
- path: "/v1/projects/{project_id}/webhooks",
1027
- operationId: "createWebhookEndpoint"
1028
- },
1029
- "GET /v1/projects/{project_id}/webhooks/{webhook_id}": {
1030
- method: "GET",
1031
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}",
1032
- operationId: "getWebhookEndpoint"
1033
- },
1034
- "PUT /v1/projects/{project_id}/webhooks/{webhook_id}": {
1035
- method: "PUT",
1036
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}",
1037
- operationId: "updateWebhookEndpoint"
1038
- },
1039
- "DELETE /v1/projects/{project_id}/webhooks/{webhook_id}": {
1040
- method: "DELETE",
1041
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}",
1042
- operationId: "deleteWebhookEndpoint"
1043
- },
1044
- "POST /v1/projects/{project_id}/webhooks/{webhook_id}/test": {
1045
- method: "POST",
1046
- path: "/v1/projects/{project_id}/webhooks/{webhook_id}/test",
1047
- operationId: "testWebhookEndpoint"
1048
- }
1049
- };
1
+ import { o as operationsByPath, a as operationsByTag } from './operations-map.gen-g44nmkz5.js';
1050
2
 
1051
3
  class ApiError extends Error {
1052
4
  constructor(status, statusText, body){
@@ -1069,6 +21,61 @@ class ApiError extends Error {
1069
21
  if (typeof obj.message === "string") return obj.message;
1070
22
  return undefined;
1071
23
  }
24
+ /**
25
+ * A request that never got an HTTP answer: DNS failure, refused or reset
26
+ * connection, or a timeout. Distinct from `ApiError`, which means the server
27
+ * did answer and the answer was an error.
28
+ *
29
+ * Node reports every connection-level failure as `TypeError: fetch failed` and
30
+ * hangs the real reason off `cause`, so the message flattens that chain. A log
31
+ * line should say which URL was called and why it did not answer without the
32
+ * reader having to inspect the object.
33
+ */ class NetworkError extends Error {
34
+ constructor(args){
35
+ const reason = args.timedOut ? `timed out after ${args.timeoutMs}ms` : describeError(args.cause);
36
+ super(`${args.method} ${args.url} failed after ${args.attempts} attempt(s) in ${args.elapsedMs}ms: ${reason}`, {
37
+ cause: args.cause
38
+ });
39
+ this.name = "NetworkError";
40
+ this.url = args.url;
41
+ this.method = args.method;
42
+ this.attempts = args.attempts;
43
+ this.elapsedMs = args.elapsedMs;
44
+ this.timedOut = args.timedOut;
45
+ }
46
+ }
47
+ /**
48
+ * Flatten an error and its `cause` chain into one line.
49
+ *
50
+ * `TypeError: fetch failed` on its own says nothing. The useful detail (an
51
+ * `ECONNREFUSED` with the address it tried, a TLS failure, a DNS `EAI_AGAIN`)
52
+ * is always one or two `cause` levels down.
53
+ */ function describeError(err, depth = 0) {
54
+ if (depth > 5) return "…";
55
+ if (err === null || err === undefined) return String(err);
56
+ if (typeof err !== "object") return String(err);
57
+ const candidate = err;
58
+ const name = typeof candidate.name === "string" ? candidate.name : "Error";
59
+ const message = typeof candidate.message === "string" ? candidate.message : String(err);
60
+ const code = typeof candidate.code === "string" ? ` [${candidate.code}]` : "";
61
+ const head = `${name}: ${message}${code}`;
62
+ // AggregateError (what undici raises when every address for a host fails)
63
+ // carries the real reasons in `errors`, not in `cause`.
64
+ const errors = err.errors;
65
+ if (Array.isArray(errors) && errors.length > 0) {
66
+ const inner = errors.map((e)=>describeError(e, depth + 1)).join("; ");
67
+ return `${head} (caused by ${inner})`;
68
+ }
69
+ if (candidate.cause !== undefined && candidate.cause !== null) {
70
+ return `${head} (caused by ${describeError(candidate.cause, depth + 1)})`;
71
+ }
72
+ return head;
73
+ }
74
+ /** `AbortSignal.timeout` rejects with TimeoutError; an aborted fetch with AbortError. */ function isAbortError(err) {
75
+ if (err === null || typeof err !== "object") return false;
76
+ const name = err.name;
77
+ return name === "AbortError" || name === "TimeoutError";
78
+ }
1072
79
  const RETRYABLE_STATUS_CODES = [
1073
80
  408,
1074
81
  429,
@@ -1076,11 +83,17 @@ const RETRYABLE_STATUS_CODES = [
1076
83
  503,
1077
84
  504
1078
85
  ];
86
+ /**
87
+ * Long enough for the slowest legitimate call (an audit-log CSV export), short
88
+ * enough that a black-holed connection fails in a sane time instead of hanging
89
+ * until the platform gives up.
90
+ */ const DEFAULT_TIMEOUT_MS = 30_000;
1079
91
  const DEFAULT_RETRY = {
1080
92
  maxRetries: 5,
1081
93
  initialDelayMs: 500,
1082
94
  maxDelayMs: 30_000,
1083
- idempotencyKeys: true
95
+ idempotencyKeys: true,
96
+ totalBudgetMs: 120_000
1084
97
  };
1085
98
  function resolveRetry(config) {
1086
99
  if (!config) return {
@@ -1108,6 +121,10 @@ function resolveRetry(config) {
1108
121
  }
1109
122
  return undefined;
1110
123
  }
124
+ /** Whether waiting `delayMs` and trying again would land past the total budget. */ function outOfBudget(startedAt, delayMs, totalBudgetMs) {
125
+ if (totalBudgetMs <= 0) return false;
126
+ return Date.now() - startedAt + delayMs >= totalBudgetMs;
127
+ }
1111
128
  /** Compute exponential backoff with jitter. */ function backoff(attempt, initialDelayMs, maxDelayMs) {
1112
129
  const delay = Math.min(initialDelayMs * 2 ** attempt, maxDelayMs);
1113
130
  return delay * (0.5 + Math.random());
@@ -1151,6 +168,8 @@ async function fetcher(options) {
1151
168
  }
1152
169
  const fetchFn = options.fetchImpl ?? globalThis.fetch;
1153
170
  const retry = resolveRetry(options.retry);
171
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
172
+ const startedAt = Date.now();
1154
173
  const urlStr = fullUrl.toString();
1155
174
  const fetchBody = options.body !== undefined ? JSON.stringify(options.body) : undefined;
1156
175
  // Generate idempotency key once, reused across all retry attempts.
@@ -1163,32 +182,53 @@ async function fetcher(options) {
1163
182
  if (idempotencyKey) {
1164
183
  reqHeaders["Idempotency-Key"] = idempotencyKey;
1165
184
  }
185
+ // Distinguishes a transport failure from an `onResponse` hook that threw
186
+ // after the server had already answered.
187
+ let answered = false;
1166
188
  try {
1167
189
  const response = await fetchFn(urlStr, {
1168
190
  method: options.method,
1169
191
  headers: reqHeaders,
1170
- body: fetchBody
192
+ body: fetchBody,
193
+ ...timeoutMs > 0 ? {
194
+ signal: AbortSignal.timeout(timeoutMs)
195
+ } : {}
1171
196
  });
197
+ answered = true;
1172
198
  if (options.onResponse) {
1173
199
  await options.onResponse(response);
1174
200
  }
1175
201
  if (response.ok) {
1176
202
  return parseResponseBody(response);
1177
203
  }
1178
- // Non-retryable error or last attempt — throw immediately.
1179
- if (!RETRYABLE_STATUS_CODES.includes(response.status) || attempt === retry.maxRetries) {
204
+ const retryable = RETRYABLE_STATUS_CODES.includes(response.status) && attempt < retry.maxRetries;
205
+ const delay = retryable ? parseRetryAfter(response) ?? backoff(attempt, retry.initialDelayMs, retry.maxDelayMs) : 0;
206
+ // Not retryable, out of attempts, or the wait would outlive the budget.
207
+ if (!retryable || outOfBudget(startedAt, delay, retry.totalBudgetMs)) {
1180
208
  const errorBody = await response.json().catch(()=>null);
1181
209
  throw new ApiError(response.status, response.statusText, errorBody);
1182
210
  }
1183
- // Retryable error — wait and retry.
1184
- const delay = parseRetryAfter(response) ?? backoff(attempt, retry.initialDelayMs, retry.maxDelayMs);
1185
211
  await sleep(delay);
1186
212
  } catch (err) {
1187
213
  // If it's already an ApiError, rethrow (we threw it above).
1188
214
  if (err instanceof ApiError) throw err;
1189
- // Network error — retry if we have attempts left.
1190
- if (attempt === retry.maxRetries) throw err;
215
+ // The request never got an answer. Retry while attempts and budget last,
216
+ // then report the endpoint and the real underlying cause.
1191
217
  const delay = backoff(attempt, retry.initialDelayMs, retry.maxDelayMs);
218
+ if (attempt === retry.maxRetries || outOfBudget(startedAt, delay, retry.totalBudgetMs)) {
219
+ // The server did answer, so this is not a reachability problem. Report
220
+ // it as it came rather than dressing it up as one.
221
+ if (answered) throw err;
222
+ throw new NetworkError({
223
+ method: options.method,
224
+ url: urlStr,
225
+ attempts: attempt + 1,
226
+ elapsedMs: Date.now() - startedAt,
227
+ timedOut: isAbortError(err),
228
+ timeoutMs,
229
+ cause: err
230
+ });
231
+ }
1192
232
  await sleep(delay);
1193
233
  }
1194
234
  }
@@ -1216,6 +256,10 @@ function sleep(ms) {
1216
256
  return new Promise((resolve)=>setTimeout(resolve, ms));
1217
257
  }
1218
258
 
259
+ const publicRegistry = {
260
+ byTag: operationsByTag,
261
+ byPath: operationsByPath
262
+ };
1219
263
  class PgBeamClient {
1220
264
  constructor(options){
1221
265
  this._baseUrl = options.baseUrl;
@@ -1227,6 +271,8 @@ class PgBeamClient {
1227
271
  } : options.retry ?? {
1228
272
  maxRetries: 5
1229
273
  };
274
+ this._timeoutMs = options.timeoutMs;
275
+ this._operations = options.operations ?? publicRegistry;
1230
276
  }
1231
277
  async _resolveToken() {
1232
278
  if (typeof this._tokenOrFn === "function") {
@@ -1234,53 +280,44 @@ class PgBeamClient {
1234
280
  }
1235
281
  return this._tokenOrFn;
1236
282
  }
1237
- _call(method, path) {
1238
- return async (params = {})=>{
1239
- const token = await this._resolveToken();
1240
- return fetcher({
1241
- method,
1242
- path,
1243
- pathParams: params.pathParams,
1244
- queryParams: params.queryParams,
1245
- body: params.body,
1246
- baseUrl: this._baseUrl,
1247
- token,
1248
- fetchImpl: this._fetchImpl,
1249
- onResponse: this._onResponse,
1250
- retry: this._retry
1251
- });
1252
- };
283
+ async _send(meta, params) {
284
+ const token = await this._resolveToken();
285
+ return fetcher({
286
+ method: meta.method,
287
+ path: meta.path,
288
+ pathParams: params.pathParams,
289
+ queryParams: params.queryParams,
290
+ body: params.body,
291
+ baseUrl: this._baseUrl,
292
+ token,
293
+ fetchImpl: this._fetchImpl,
294
+ onResponse: this._onResponse,
295
+ retry: this._retry,
296
+ timeoutMs: this._timeoutMs
297
+ });
298
+ }
299
+ _call(meta) {
300
+ return (params = {})=>this._send(meta, params);
1253
301
  }
1254
302
  /** Access API operations via tag-based namespaces or `.request()`. */ get api() {
1255
303
  if (this._api) return this._api;
1256
- const request = async (route, params)=>{
1257
- const meta = operationsByPath[route];
1258
- if (!meta) throw new Error(`Unknown route: ${String(route)}`);
1259
- const token = await this._resolveToken();
1260
- return fetcher({
1261
- method: meta.method,
1262
- path: meta.path,
1263
- pathParams: params?.pathParams,
1264
- queryParams: params?.queryParams,
1265
- body: params?.body,
1266
- baseUrl: this._baseUrl,
1267
- token,
1268
- fetchImpl: this._fetchImpl,
1269
- onResponse: this._onResponse,
1270
- retry: this._retry
1271
- });
304
+ // Async so an unknown route rejects rather than throwing synchronously,
305
+ // which is what callers awaiting .request() expect.
306
+ const request = async (route, params = {})=>{
307
+ const meta = this._operations.byPath[route];
308
+ if (!meta) throw new Error(`Unknown route: ${route}`);
309
+ return this._send(meta, params);
1272
310
  };
1273
311
  this._api = new Proxy({}, {
1274
312
  get: (_, prop)=>{
1275
313
  if (prop === "request") return request;
1276
- const tagOps = operationsByTag[prop];
314
+ const tagOps = this._operations.byTag[prop];
1277
315
  if (!tagOps) return undefined;
1278
316
  return new Proxy({}, {
1279
317
  get: (_, method)=>{
1280
- const ops = tagOps;
1281
- const opMeta = ops[method];
318
+ const opMeta = tagOps[method];
1282
319
  if (!opMeta) return undefined;
1283
- return this._call(opMeta.method, opMeta.path);
320
+ return this._call(opMeta);
1284
321
  }
1285
322
  });
1286
323
  }
@@ -1289,4 +326,4 @@ class PgBeamClient {
1289
326
  }
1290
327
  }
1291
328
 
1292
- export { ApiError, PgBeamClient, extractMessage };
329
+ export { ApiError, NetworkError, PgBeamClient, describeError, extractMessage };