@checkbox-site/node 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2990 @@
1
+ import { Resource } from "../resource.js";
2
+ /** How to call each operation. Keys are the OpenAPI operationIds (also the MCP tool names). */
3
+ export const OPERATIONS = {
4
+ createDeviceAuthorization: {
5
+ operationId: "createDeviceAuthorization",
6
+ namespace: "device",
7
+ method: "authorize",
8
+ httpMethod: "POST",
9
+ path: "/v1/device/authorize",
10
+ pathParams: [],
11
+ queryParams: [],
12
+ body: true,
13
+ idempotent: false,
14
+ auth: false,
15
+ scope: "none",
16
+ response: "json",
17
+ list: false,
18
+ paginated: false,
19
+ summary: "Start a device login (setup_checkbox)",
20
+ },
21
+ createDeviceToken: {
22
+ operationId: "createDeviceToken",
23
+ namespace: "device",
24
+ method: "token",
25
+ httpMethod: "POST",
26
+ path: "/v1/device/token",
27
+ pathParams: [],
28
+ queryParams: [],
29
+ body: true,
30
+ idempotent: false,
31
+ auth: false,
32
+ scope: "none",
33
+ response: "json",
34
+ list: false,
35
+ paginated: false,
36
+ summary: "Poll a device login for its keys",
37
+ },
38
+ createSetupSession: {
39
+ operationId: "createSetupSession",
40
+ namespace: "setupSessions",
41
+ method: "create",
42
+ httpMethod: "POST",
43
+ path: "/v1/setup_sessions",
44
+ pathParams: [],
45
+ queryParams: [],
46
+ body: true,
47
+ idempotent: true,
48
+ auth: true,
49
+ scope: "setup_sessions:write",
50
+ response: "json",
51
+ list: false,
52
+ paginated: false,
53
+ summary: "Start a setup session (agents that already have a key)",
54
+ },
55
+ listSetupSessions: {
56
+ operationId: "listSetupSessions",
57
+ namespace: "setupSessions",
58
+ method: "list",
59
+ httpMethod: "GET",
60
+ path: "/v1/setup_sessions",
61
+ pathParams: [],
62
+ queryParams: ["limit", "starting_after", "ending_before"],
63
+ body: false,
64
+ idempotent: false,
65
+ auth: true,
66
+ scope: "setup_sessions:read",
67
+ response: "json",
68
+ list: true,
69
+ paginated: true,
70
+ summary: "List setup sessions",
71
+ },
72
+ retrieveSetupSession: {
73
+ operationId: "retrieveSetupSession",
74
+ namespace: "setupSessions",
75
+ method: "retrieve",
76
+ httpMethod: "GET",
77
+ path: "/v1/setup_sessions/{setup_session}",
78
+ pathParams: ["setup_session"],
79
+ queryParams: [],
80
+ body: false,
81
+ idempotent: false,
82
+ auth: true,
83
+ scope: "setup_sessions:read",
84
+ response: "json",
85
+ list: false,
86
+ paginated: false,
87
+ summary: "Retrieve a setup session",
88
+ },
89
+ updateSetupSession: {
90
+ operationId: "updateSetupSession",
91
+ namespace: "setupSessions",
92
+ method: "update",
93
+ httpMethod: "POST",
94
+ path: "/v1/setup_sessions/{setup_session}",
95
+ pathParams: ["setup_session"],
96
+ queryParams: [],
97
+ body: true,
98
+ idempotent: true,
99
+ auth: true,
100
+ scope: "setup_sessions:write",
101
+ response: "json",
102
+ list: false,
103
+ paginated: false,
104
+ summary: "Report what the agent learned or changed",
105
+ },
106
+ verifySetupSession: {
107
+ operationId: "verifySetupSession",
108
+ namespace: "setupSessions",
109
+ method: "verify",
110
+ httpMethod: "POST",
111
+ path: "/v1/setup_sessions/{setup_session}/verify",
112
+ pathParams: ["setup_session"],
113
+ queryParams: [],
114
+ body: false,
115
+ idempotent: true,
116
+ auth: true,
117
+ scope: "setup_sessions:write",
118
+ response: "json",
119
+ list: false,
120
+ paginated: false,
121
+ summary: "Re-check the site now",
122
+ },
123
+ completeSetupSession: {
124
+ operationId: "completeSetupSession",
125
+ namespace: "setupSessions",
126
+ method: "complete",
127
+ httpMethod: "POST",
128
+ path: "/v1/setup_sessions/{setup_session}/complete",
129
+ pathParams: ["setup_session"],
130
+ queryParams: [],
131
+ body: false,
132
+ idempotent: true,
133
+ auth: true,
134
+ scope: "setup_sessions:write",
135
+ response: "json",
136
+ list: false,
137
+ paginated: false,
138
+ summary: "Finish the setup and notify the human",
139
+ },
140
+ retrieveAccount: {
141
+ operationId: "retrieveAccount",
142
+ namespace: "account",
143
+ method: "retrieve",
144
+ httpMethod: "GET",
145
+ path: "/v1/account",
146
+ pathParams: [],
147
+ queryParams: [],
148
+ body: false,
149
+ idempotent: false,
150
+ auth: true,
151
+ scope: "account:read",
152
+ response: "json",
153
+ list: false,
154
+ paginated: false,
155
+ summary: "Retrieve the account",
156
+ },
157
+ updateAccount: {
158
+ operationId: "updateAccount",
159
+ namespace: "account",
160
+ method: "update",
161
+ httpMethod: "POST",
162
+ path: "/v1/account",
163
+ pathParams: [],
164
+ queryParams: [],
165
+ body: true,
166
+ idempotent: true,
167
+ auth: true,
168
+ scope: "account:write",
169
+ response: "json",
170
+ list: false,
171
+ paginated: false,
172
+ summary: "Update the account",
173
+ },
174
+ listSites: {
175
+ operationId: "listSites",
176
+ namespace: "sites",
177
+ method: "list",
178
+ httpMethod: "GET",
179
+ path: "/v1/sites",
180
+ pathParams: [],
181
+ queryParams: ["limit", "starting_after", "ending_before", "archived"],
182
+ body: false,
183
+ idempotent: false,
184
+ auth: true,
185
+ scope: "sites:read",
186
+ response: "json",
187
+ list: true,
188
+ paginated: true,
189
+ summary: "List sites",
190
+ },
191
+ createSite: {
192
+ operationId: "createSite",
193
+ namespace: "sites",
194
+ method: "create",
195
+ httpMethod: "POST",
196
+ path: "/v1/sites",
197
+ pathParams: [],
198
+ queryParams: [],
199
+ body: true,
200
+ idempotent: true,
201
+ auth: true,
202
+ scope: "sites:write",
203
+ response: "json",
204
+ list: false,
205
+ paginated: false,
206
+ summary: "Create a site",
207
+ },
208
+ retrieveSite: {
209
+ operationId: "retrieveSite",
210
+ namespace: "sites",
211
+ method: "retrieve",
212
+ httpMethod: "GET",
213
+ path: "/v1/sites/{site}",
214
+ pathParams: ["site"],
215
+ queryParams: ["expand[]"],
216
+ body: false,
217
+ idempotent: false,
218
+ auth: true,
219
+ scope: "sites:read",
220
+ response: "json",
221
+ list: false,
222
+ paginated: false,
223
+ summary: "Retrieve a site",
224
+ },
225
+ updateSite: {
226
+ operationId: "updateSite",
227
+ namespace: "sites",
228
+ method: "update",
229
+ httpMethod: "POST",
230
+ path: "/v1/sites/{site}",
231
+ pathParams: ["site"],
232
+ queryParams: [],
233
+ body: true,
234
+ idempotent: true,
235
+ auth: true,
236
+ scope: "sites:write",
237
+ response: "json",
238
+ list: false,
239
+ paginated: false,
240
+ summary: "Update a site",
241
+ },
242
+ deleteSite: {
243
+ operationId: "deleteSite",
244
+ namespace: "sites",
245
+ method: "del",
246
+ httpMethod: "DELETE",
247
+ path: "/v1/sites/{site}",
248
+ pathParams: ["site"],
249
+ queryParams: [],
250
+ body: false,
251
+ idempotent: false,
252
+ auth: true,
253
+ scope: "sites:write",
254
+ response: "json",
255
+ list: false,
256
+ paginated: false,
257
+ summary: "Archive a site",
258
+ },
259
+ restoreSite: {
260
+ operationId: "restoreSite",
261
+ namespace: "sites",
262
+ method: "restore",
263
+ httpMethod: "POST",
264
+ path: "/v1/sites/{site}/restore",
265
+ pathParams: ["site"],
266
+ queryParams: [],
267
+ body: false,
268
+ idempotent: true,
269
+ auth: true,
270
+ scope: "sites:write",
271
+ response: "json",
272
+ list: false,
273
+ paginated: false,
274
+ summary: "Restore an archived site",
275
+ },
276
+ connectBillingPlatform: {
277
+ operationId: "connectBillingPlatform",
278
+ namespace: "sites",
279
+ method: "connectBillingPlatform",
280
+ httpMethod: "POST",
281
+ path: "/v1/sites/{site}/integrations",
282
+ pathParams: ["site"],
283
+ queryParams: [],
284
+ body: true,
285
+ idempotent: true,
286
+ auth: true,
287
+ scope: "sites:write",
288
+ response: "json",
289
+ list: false,
290
+ paginated: false,
291
+ summary: "Connect a billing platform",
292
+ },
293
+ retrieveDomainVerification: {
294
+ operationId: "retrieveDomainVerification",
295
+ namespace: "domainVerifications",
296
+ method: "retrieve",
297
+ httpMethod: "GET",
298
+ path: "/v1/sites/{site}/domain_verification",
299
+ pathParams: ["site"],
300
+ queryParams: [],
301
+ body: false,
302
+ idempotent: false,
303
+ auth: true,
304
+ scope: "sites:read",
305
+ response: "json",
306
+ list: false,
307
+ paginated: false,
308
+ summary: "Retrieve domain verification",
309
+ },
310
+ createDomainVerification: {
311
+ operationId: "createDomainVerification",
312
+ namespace: "domainVerifications",
313
+ method: "create",
314
+ httpMethod: "POST",
315
+ path: "/v1/sites/{site}/domain_verification",
316
+ pathParams: ["site"],
317
+ queryParams: [],
318
+ body: true,
319
+ idempotent: true,
320
+ auth: true,
321
+ scope: "sites:write",
322
+ response: "json",
323
+ list: false,
324
+ paginated: false,
325
+ summary: "Start domain verification",
326
+ },
327
+ checkDomainVerification: {
328
+ operationId: "checkDomainVerification",
329
+ namespace: "domainVerifications",
330
+ method: "check",
331
+ httpMethod: "POST",
332
+ path: "/v1/sites/{site}/domain_verification/check",
333
+ pathParams: ["site"],
334
+ queryParams: [],
335
+ body: false,
336
+ idempotent: true,
337
+ auth: true,
338
+ scope: "sites:write",
339
+ response: "json",
340
+ list: false,
341
+ paginated: false,
342
+ summary: "Check domain verification now",
343
+ },
344
+ createScan: {
345
+ operationId: "createScan",
346
+ namespace: "scans",
347
+ method: "create",
348
+ httpMethod: "POST",
349
+ path: "/v1/sites/{site}/scans",
350
+ pathParams: ["site"],
351
+ queryParams: [],
352
+ body: true,
353
+ idempotent: true,
354
+ auth: true,
355
+ scope: "scans:write",
356
+ response: "json",
357
+ list: false,
358
+ paginated: false,
359
+ summary: "Run a scan",
360
+ },
361
+ listScans: {
362
+ operationId: "listScans",
363
+ namespace: "scans",
364
+ method: "list",
365
+ httpMethod: "GET",
366
+ path: "/v1/scans",
367
+ pathParams: [],
368
+ queryParams: ["limit", "starting_after", "ending_before", "site"],
369
+ body: false,
370
+ idempotent: false,
371
+ auth: true,
372
+ scope: "scans:read",
373
+ response: "json",
374
+ list: true,
375
+ paginated: true,
376
+ summary: "List scans",
377
+ },
378
+ retrieveScan: {
379
+ operationId: "retrieveScan",
380
+ namespace: "scans",
381
+ method: "retrieve",
382
+ httpMethod: "GET",
383
+ path: "/v1/scans/{scan}",
384
+ pathParams: ["scan"],
385
+ queryParams: [],
386
+ body: false,
387
+ idempotent: false,
388
+ auth: true,
389
+ scope: "scans:read",
390
+ response: "json",
391
+ list: false,
392
+ paginated: false,
393
+ summary: "Retrieve a scan",
394
+ },
395
+ createEvaluation: {
396
+ operationId: "createEvaluation",
397
+ namespace: "evaluations",
398
+ method: "create",
399
+ httpMethod: "POST",
400
+ path: "/v1/sites/{site}/evaluations",
401
+ pathParams: ["site"],
402
+ queryParams: [],
403
+ body: true,
404
+ idempotent: true,
405
+ auth: true,
406
+ scope: "evaluations:write",
407
+ response: "json",
408
+ list: false,
409
+ paginated: false,
410
+ summary: "Re-evaluate a site now",
411
+ },
412
+ listEvaluations: {
413
+ operationId: "listEvaluations",
414
+ namespace: "evaluations",
415
+ method: "list",
416
+ httpMethod: "GET",
417
+ path: "/v1/evaluations",
418
+ pathParams: [],
419
+ queryParams: ["limit", "starting_after", "ending_before", "site"],
420
+ body: false,
421
+ idempotent: false,
422
+ auth: true,
423
+ scope: "evaluations:read",
424
+ response: "json",
425
+ list: true,
426
+ paginated: true,
427
+ summary: "List evaluations",
428
+ },
429
+ retrieveEvaluation: {
430
+ operationId: "retrieveEvaluation",
431
+ namespace: "evaluations",
432
+ method: "retrieve",
433
+ httpMethod: "GET",
434
+ path: "/v1/evaluations/{evaluation}",
435
+ pathParams: ["evaluation"],
436
+ queryParams: [],
437
+ body: false,
438
+ idempotent: false,
439
+ auth: true,
440
+ scope: "evaluations:read",
441
+ response: "json",
442
+ list: false,
443
+ paginated: false,
444
+ summary: "Retrieve an evaluation",
445
+ },
446
+ retrieveLatestEvaluation: {
447
+ operationId: "retrieveLatestEvaluation",
448
+ namespace: "evaluations",
449
+ method: "retrieveLatest",
450
+ httpMethod: "GET",
451
+ path: "/v1/sites/{site}/evaluation",
452
+ pathParams: ["site"],
453
+ queryParams: [],
454
+ body: false,
455
+ idempotent: false,
456
+ auth: true,
457
+ scope: "evaluations:read",
458
+ response: "json",
459
+ list: false,
460
+ paginated: false,
461
+ summary: "Get the current verdict of a site",
462
+ },
463
+ listFindings: {
464
+ operationId: "listFindings",
465
+ namespace: "findings",
466
+ method: "list",
467
+ httpMethod: "GET",
468
+ path: "/v1/findings",
469
+ pathParams: [],
470
+ queryParams: ["limit", "starting_after", "ending_before", "site", "status", "state"],
471
+ body: false,
472
+ idempotent: false,
473
+ auth: true,
474
+ scope: "findings:read",
475
+ response: "json",
476
+ list: true,
477
+ paginated: true,
478
+ summary: "List findings",
479
+ },
480
+ retrieveFinding: {
481
+ operationId: "retrieveFinding",
482
+ namespace: "findings",
483
+ method: "retrieve",
484
+ httpMethod: "GET",
485
+ path: "/v1/findings/{finding}",
486
+ pathParams: ["finding"],
487
+ queryParams: [],
488
+ body: false,
489
+ idempotent: false,
490
+ auth: true,
491
+ scope: "findings:read",
492
+ response: "json",
493
+ list: false,
494
+ paginated: false,
495
+ summary: "Retrieve a finding",
496
+ },
497
+ updateFinding: {
498
+ operationId: "updateFinding",
499
+ namespace: "findings",
500
+ method: "update",
501
+ httpMethod: "POST",
502
+ path: "/v1/findings/{finding}",
503
+ pathParams: ["finding"],
504
+ queryParams: [],
505
+ body: true,
506
+ idempotent: true,
507
+ auth: true,
508
+ scope: "findings:write",
509
+ response: "json",
510
+ list: false,
511
+ paginated: false,
512
+ summary: "Triage a finding",
513
+ },
514
+ retrieveCompliancePlan: {
515
+ operationId: "retrieveCompliancePlan",
516
+ namespace: "plans",
517
+ method: "retrieve",
518
+ httpMethod: "GET",
519
+ path: "/v1/sites/{site}/plan",
520
+ pathParams: ["site"],
521
+ queryParams: [],
522
+ body: false,
523
+ idempotent: false,
524
+ auth: true,
525
+ scope: "compliance_plans:read",
526
+ response: "json",
527
+ list: false,
528
+ paginated: false,
529
+ summary: "Get the compliance plan for a site",
530
+ },
531
+ retrieveTask: {
532
+ operationId: "retrieveTask",
533
+ namespace: "tasks",
534
+ method: "retrieve",
535
+ httpMethod: "GET",
536
+ path: "/v1/tasks/{task}",
537
+ pathParams: ["task"],
538
+ queryParams: [],
539
+ body: false,
540
+ idempotent: false,
541
+ auth: true,
542
+ scope: "compliance_plans:read",
543
+ response: "json",
544
+ list: false,
545
+ paginated: false,
546
+ summary: "Get one task of a compliance plan",
547
+ },
548
+ updateTask: {
549
+ operationId: "updateTask",
550
+ namespace: "tasks",
551
+ method: "update",
552
+ httpMethod: "POST",
553
+ path: "/v1/tasks/{task}",
554
+ pathParams: ["task"],
555
+ queryParams: [],
556
+ body: true,
557
+ idempotent: true,
558
+ auth: true,
559
+ scope: "compliance_plans:write",
560
+ response: "json",
561
+ list: false,
562
+ paginated: false,
563
+ summary: "Claim, decline or reopen a task",
564
+ },
565
+ answerTask: {
566
+ operationId: "answerTask",
567
+ namespace: "tasks",
568
+ method: "answer",
569
+ httpMethod: "POST",
570
+ path: "/v1/tasks/{task}/answer",
571
+ pathParams: ["task"],
572
+ queryParams: [],
573
+ body: true,
574
+ idempotent: true,
575
+ auth: true,
576
+ scope: "compliance_plans:write",
577
+ response: "json",
578
+ list: false,
579
+ paginated: false,
580
+ summary: "Record the human answer to a manual task",
581
+ },
582
+ verifyTask: {
583
+ operationId: "verifyTask",
584
+ namespace: "tasks",
585
+ method: "verify",
586
+ httpMethod: "POST",
587
+ path: "/v1/tasks/{task}/verify",
588
+ pathParams: ["task"],
589
+ queryParams: ["wait"],
590
+ body: true,
591
+ idempotent: true,
592
+ auth: true,
593
+ scope: "compliance_plans:write",
594
+ response: "json",
595
+ list: false,
596
+ paginated: false,
597
+ summary: "Verify a task after applying its change",
598
+ },
599
+ verifySite: {
600
+ operationId: "verifySite",
601
+ namespace: "sites",
602
+ method: "verify",
603
+ httpMethod: "POST",
604
+ path: "/v1/sites/{site}/verify",
605
+ pathParams: ["site"],
606
+ queryParams: ["wait"],
607
+ body: false,
608
+ idempotent: true,
609
+ auth: true,
610
+ scope: "compliance_plans:write",
611
+ response: "json",
612
+ list: false,
613
+ paginated: false,
614
+ summary: "Re-check the whole site now",
615
+ },
616
+ retrieveVerification: {
617
+ operationId: "retrieveVerification",
618
+ namespace: "verifications",
619
+ method: "retrieve",
620
+ httpMethod: "GET",
621
+ path: "/v1/verifications/{verification}",
622
+ pathParams: ["verification"],
623
+ queryParams: ["wait"],
624
+ body: false,
625
+ idempotent: false,
626
+ auth: true,
627
+ scope: "compliance_plans:read",
628
+ response: "json",
629
+ list: false,
630
+ paginated: false,
631
+ summary: "Get a verification (long-poll with ?wait=30)",
632
+ },
633
+ listVerifications: {
634
+ operationId: "listVerifications",
635
+ namespace: "verifications",
636
+ method: "list",
637
+ httpMethod: "GET",
638
+ path: "/v1/sites/{site}/verifications",
639
+ pathParams: ["site"],
640
+ queryParams: ["limit", "starting_after", "ending_before", "task"],
641
+ body: false,
642
+ idempotent: false,
643
+ auth: true,
644
+ scope: "compliance_plans:read",
645
+ response: "json",
646
+ list: true,
647
+ paginated: true,
648
+ summary: "List verifications of a site",
649
+ },
650
+ retrieveFindingFix: {
651
+ operationId: "retrieveFindingFix",
652
+ namespace: "fixes",
653
+ method: "retrieve",
654
+ httpMethod: "GET",
655
+ path: "/v1/findings/{finding}/fix",
656
+ pathParams: ["finding"],
657
+ queryParams: ["plan", "cancel_url", "target"],
658
+ body: false,
659
+ idempotent: false,
660
+ auth: true,
661
+ scope: "fixes:read",
662
+ response: "json",
663
+ list: false,
664
+ paginated: false,
665
+ summary: "Get the fix for a finding",
666
+ },
667
+ listSiteFixes: {
668
+ operationId: "listSiteFixes",
669
+ namespace: "fixes",
670
+ method: "list",
671
+ httpMethod: "GET",
672
+ path: "/v1/sites/{site}/fixes",
673
+ pathParams: ["site"],
674
+ queryParams: ["plan", "cancel_url", "target"],
675
+ body: false,
676
+ idempotent: false,
677
+ auth: true,
678
+ scope: "fixes:read",
679
+ response: "json",
680
+ list: true,
681
+ paginated: false,
682
+ summary: "List fix plans for a site",
683
+ },
684
+ listEvidence: {
685
+ operationId: "listEvidence",
686
+ namespace: "evidence",
687
+ method: "list",
688
+ httpMethod: "GET",
689
+ path: "/v1/evidence",
690
+ pathParams: [],
691
+ queryParams: ["limit", "starting_after", "ending_before", "site", "kind"],
692
+ body: false,
693
+ idempotent: false,
694
+ auth: true,
695
+ scope: "evidence:read",
696
+ response: "json",
697
+ list: true,
698
+ paginated: true,
699
+ summary: "List evidence",
700
+ },
701
+ retrieveEvidence: {
702
+ operationId: "retrieveEvidence",
703
+ namespace: "evidence",
704
+ method: "retrieve",
705
+ httpMethod: "GET",
706
+ path: "/v1/evidence/{evidence}",
707
+ pathParams: ["evidence"],
708
+ queryParams: [],
709
+ body: false,
710
+ idempotent: false,
711
+ auth: true,
712
+ scope: "evidence:read",
713
+ response: "json",
714
+ list: false,
715
+ paginated: false,
716
+ summary: "Retrieve evidence metadata",
717
+ },
718
+ downloadEvidenceContent: {
719
+ operationId: "downloadEvidenceContent",
720
+ namespace: "evidence",
721
+ method: "downloadContent",
722
+ httpMethod: "GET",
723
+ path: "/v1/evidence/{evidence}/content",
724
+ pathParams: ["evidence"],
725
+ queryParams: [],
726
+ body: false,
727
+ idempotent: false,
728
+ auth: true,
729
+ scope: "evidence:read",
730
+ response: "binary",
731
+ list: false,
732
+ paginated: false,
733
+ summary: "Download evidence content",
734
+ },
735
+ verifyEvidenceChain: {
736
+ operationId: "verifyEvidenceChain",
737
+ namespace: "evidence",
738
+ method: "verifyChain",
739
+ httpMethod: "POST",
740
+ path: "/v1/sites/{site}/evidence/verify",
741
+ pathParams: ["site"],
742
+ queryParams: [],
743
+ body: true,
744
+ idempotent: false,
745
+ auth: true,
746
+ scope: "evidence:read",
747
+ response: "json",
748
+ list: false,
749
+ paginated: false,
750
+ summary: "Verify the evidence chain",
751
+ },
752
+ listCertificates: {
753
+ operationId: "listCertificates",
754
+ namespace: "certificates",
755
+ method: "list",
756
+ httpMethod: "GET",
757
+ path: "/v1/certificates",
758
+ pathParams: [],
759
+ queryParams: ["limit", "starting_after", "ending_before", "site"],
760
+ body: false,
761
+ idempotent: false,
762
+ auth: true,
763
+ scope: "certificates:read",
764
+ response: "json",
765
+ list: true,
766
+ paginated: true,
767
+ summary: "List certificates",
768
+ },
769
+ retrieveCertificate: {
770
+ operationId: "retrieveCertificate",
771
+ namespace: "certificates",
772
+ method: "retrieve",
773
+ httpMethod: "GET",
774
+ path: "/v1/certificates/{certificate}",
775
+ pathParams: ["certificate"],
776
+ queryParams: [],
777
+ body: false,
778
+ idempotent: false,
779
+ auth: true,
780
+ scope: "certificates:read",
781
+ response: "json",
782
+ list: false,
783
+ paginated: false,
784
+ summary: "Retrieve a certificate",
785
+ },
786
+ createCertificate: {
787
+ operationId: "createCertificate",
788
+ namespace: "certificates",
789
+ method: "create",
790
+ httpMethod: "POST",
791
+ path: "/v1/sites/{site}/certificates",
792
+ pathParams: ["site"],
793
+ queryParams: [],
794
+ body: true,
795
+ idempotent: true,
796
+ auth: true,
797
+ scope: "certificates:write",
798
+ response: "json",
799
+ list: false,
800
+ paginated: false,
801
+ summary: "Issue a certificate",
802
+ },
803
+ revokeCertificate: {
804
+ operationId: "revokeCertificate",
805
+ namespace: "certificates",
806
+ method: "revoke",
807
+ httpMethod: "POST",
808
+ path: "/v1/certificates/{certificate}/revoke",
809
+ pathParams: ["certificate"],
810
+ queryParams: [],
811
+ body: true,
812
+ idempotent: true,
813
+ auth: true,
814
+ scope: "certificates:write",
815
+ response: "json",
816
+ list: false,
817
+ paginated: false,
818
+ summary: "Revoke a certificate",
819
+ },
820
+ retrieveNoticeSettings: {
821
+ operationId: "retrieveNoticeSettings",
822
+ namespace: "noticeSettings",
823
+ method: "retrieve",
824
+ httpMethod: "GET",
825
+ path: "/v1/sites/{site}/notice_settings",
826
+ pathParams: ["site"],
827
+ queryParams: [],
828
+ body: false,
829
+ idempotent: false,
830
+ auth: true,
831
+ scope: "notices:read",
832
+ response: "json",
833
+ list: false,
834
+ paginated: false,
835
+ summary: "Retrieve notice settings",
836
+ },
837
+ updateNoticeSettings: {
838
+ operationId: "updateNoticeSettings",
839
+ namespace: "noticeSettings",
840
+ method: "update",
841
+ httpMethod: "POST",
842
+ path: "/v1/sites/{site}/notice_settings",
843
+ pathParams: ["site"],
844
+ queryParams: [],
845
+ body: true,
846
+ idempotent: true,
847
+ auth: true,
848
+ scope: "notices:write",
849
+ response: "json",
850
+ list: false,
851
+ paginated: false,
852
+ summary: "Update notice settings",
853
+ },
854
+ listDueNotices: {
855
+ operationId: "listDueNotices",
856
+ namespace: "notices",
857
+ method: "listDue",
858
+ httpMethod: "GET",
859
+ path: "/v1/notices/due",
860
+ pathParams: [],
861
+ queryParams: ["limit", "starting_after", "ending_before", "site", "status", "kind", "subscription"],
862
+ body: false,
863
+ idempotent: false,
864
+ auth: true,
865
+ scope: "notices:read",
866
+ response: "json",
867
+ list: true,
868
+ paginated: true,
869
+ summary: "List due notices",
870
+ },
871
+ listNoticeTemplates: {
872
+ operationId: "listNoticeTemplates",
873
+ namespace: "notices",
874
+ method: "listTemplates",
875
+ httpMethod: "GET",
876
+ path: "/v1/notices/templates",
877
+ pathParams: [],
878
+ queryParams: ["site"],
879
+ body: false,
880
+ idempotent: false,
881
+ auth: true,
882
+ scope: "notices:read",
883
+ response: "json",
884
+ list: true,
885
+ paginated: false,
886
+ summary: "List notice email templates",
887
+ },
888
+ checkNoticeTemplate: {
889
+ operationId: "checkNoticeTemplate",
890
+ namespace: "notices",
891
+ method: "checkTemplate",
892
+ httpMethod: "POST",
893
+ path: "/v1/notices/templates/check",
894
+ pathParams: [],
895
+ queryParams: [],
896
+ body: true,
897
+ idempotent: false,
898
+ auth: true,
899
+ scope: "notices:read",
900
+ response: "json",
901
+ list: false,
902
+ paginated: false,
903
+ summary: "Check a notice email template",
904
+ },
905
+ retrieveDueNotice: {
906
+ operationId: "retrieveDueNotice",
907
+ namespace: "notices",
908
+ method: "retrieve",
909
+ httpMethod: "GET",
910
+ path: "/v1/notices/{notice}",
911
+ pathParams: ["notice"],
912
+ queryParams: [],
913
+ body: false,
914
+ idempotent: false,
915
+ auth: true,
916
+ scope: "notices:read",
917
+ response: "json",
918
+ list: false,
919
+ paginated: false,
920
+ summary: "Retrieve a due notice",
921
+ },
922
+ markNoticeSent: {
923
+ operationId: "markNoticeSent",
924
+ namespace: "notices",
925
+ method: "markSent",
926
+ httpMethod: "POST",
927
+ path: "/v1/notices/{notice}/sent",
928
+ pathParams: ["notice"],
929
+ queryParams: [],
930
+ body: true,
931
+ idempotent: true,
932
+ auth: true,
933
+ scope: "notices:write",
934
+ response: "json",
935
+ list: false,
936
+ paginated: false,
937
+ summary: "Mark a due notice as sent",
938
+ },
939
+ markNoticeMissed: {
940
+ operationId: "markNoticeMissed",
941
+ namespace: "notices",
942
+ method: "markMissed",
943
+ httpMethod: "POST",
944
+ path: "/v1/notices/{notice}/missed",
945
+ pathParams: ["notice"],
946
+ queryParams: [],
947
+ body: true,
948
+ idempotent: true,
949
+ auth: true,
950
+ scope: "notices:write",
951
+ response: "json",
952
+ list: false,
953
+ paginated: false,
954
+ summary: "Record a due notice as missed",
955
+ },
956
+ listLawUpdates: {
957
+ operationId: "listLawUpdates",
958
+ namespace: "lawUpdates",
959
+ method: "list",
960
+ httpMethod: "GET",
961
+ path: "/v1/law_updates",
962
+ pathParams: [],
963
+ queryParams: ["limit", "starting_after", "ending_before", "since"],
964
+ body: false,
965
+ idempotent: false,
966
+ auth: true,
967
+ scope: "law_updates:read",
968
+ response: "json",
969
+ list: true,
970
+ paginated: true,
971
+ summary: "List law updates",
972
+ },
973
+ retrieveLawUpdate: {
974
+ operationId: "retrieveLawUpdate",
975
+ namespace: "lawUpdates",
976
+ method: "retrieve",
977
+ httpMethod: "GET",
978
+ path: "/v1/law_updates/{law_update}",
979
+ pathParams: ["law_update"],
980
+ queryParams: [],
981
+ body: false,
982
+ idempotent: false,
983
+ auth: true,
984
+ scope: "law_updates:read",
985
+ response: "json",
986
+ list: false,
987
+ paginated: false,
988
+ summary: "Retrieve a law update",
989
+ },
990
+ checkDisclosure: {
991
+ operationId: "checkDisclosure",
992
+ namespace: "checks",
993
+ method: "disclosure",
994
+ httpMethod: "POST",
995
+ path: "/v1/checks/disclosure",
996
+ pathParams: [],
997
+ queryParams: [],
998
+ body: true,
999
+ idempotent: false,
1000
+ auth: true,
1001
+ scope: "checks:read",
1002
+ response: "json",
1003
+ list: false,
1004
+ paginated: false,
1005
+ summary: "Check checkout disclosure text",
1006
+ },
1007
+ checkStripeCheckoutSession: {
1008
+ operationId: "checkStripeCheckoutSession",
1009
+ namespace: "checks",
1010
+ method: "stripeCheckoutSession",
1011
+ httpMethod: "POST",
1012
+ path: "/v1/checks/stripe_checkout_session",
1013
+ pathParams: [],
1014
+ queryParams: [],
1015
+ body: true,
1016
+ idempotent: false,
1017
+ auth: true,
1018
+ scope: "checks:read",
1019
+ response: "json",
1020
+ list: false,
1021
+ paginated: false,
1022
+ summary: "Check Stripe Checkout Session params",
1023
+ },
1024
+ checkStripePaymentLink: {
1025
+ operationId: "checkStripePaymentLink",
1026
+ namespace: "checks",
1027
+ method: "stripePaymentLink",
1028
+ httpMethod: "POST",
1029
+ path: "/v1/checks/stripe_payment_link",
1030
+ pathParams: [],
1031
+ queryParams: [],
1032
+ body: true,
1033
+ idempotent: false,
1034
+ auth: true,
1035
+ scope: "checks:read",
1036
+ response: "json",
1037
+ list: false,
1038
+ paginated: false,
1039
+ summary: "Check Stripe Payment Link params",
1040
+ },
1041
+ checkEmail: {
1042
+ operationId: "checkEmail",
1043
+ namespace: "checks",
1044
+ method: "email",
1045
+ httpMethod: "POST",
1046
+ path: "/v1/checks/email",
1047
+ pathParams: [],
1048
+ queryParams: [],
1049
+ body: true,
1050
+ idempotent: false,
1051
+ auth: true,
1052
+ scope: "checks:read",
1053
+ response: "json",
1054
+ list: false,
1055
+ paginated: false,
1056
+ summary: "Check a subscription lifecycle email",
1057
+ },
1058
+ checkPage: {
1059
+ operationId: "checkPage",
1060
+ namespace: "checks",
1061
+ method: "page",
1062
+ httpMethod: "POST",
1063
+ path: "/v1/checks/page",
1064
+ pathParams: [],
1065
+ queryParams: [],
1066
+ body: true,
1067
+ idempotent: false,
1068
+ auth: true,
1069
+ scope: "checks:read",
1070
+ response: "json",
1071
+ list: false,
1072
+ paginated: false,
1073
+ summary: "Check a checkout page (HTML or URL)",
1074
+ },
1075
+ checkNoticeSchedule: {
1076
+ operationId: "checkNoticeSchedule",
1077
+ namespace: "checks",
1078
+ method: "noticeSchedule",
1079
+ httpMethod: "POST",
1080
+ path: "/v1/checks/notice_schedule",
1081
+ pathParams: [],
1082
+ queryParams: [],
1083
+ body: true,
1084
+ idempotent: false,
1085
+ auth: true,
1086
+ scope: "checks:read",
1087
+ response: "json",
1088
+ list: false,
1089
+ paginated: false,
1090
+ summary: "Get the dates each required notice must be sent",
1091
+ },
1092
+ getElementsBundle: {
1093
+ operationId: "getElementsBundle",
1094
+ namespace: "elements",
1095
+ method: "retrieveBundle",
1096
+ httpMethod: "GET",
1097
+ path: "/v1/elements.js",
1098
+ pathParams: [],
1099
+ queryParams: [],
1100
+ body: false,
1101
+ idempotent: false,
1102
+ auth: false,
1103
+ scope: "none",
1104
+ response: "text",
1105
+ list: false,
1106
+ paginated: false,
1107
+ summary: "Load the Elements browser bundle",
1108
+ },
1109
+ getElementsManifest: {
1110
+ operationId: "getElementsManifest",
1111
+ namespace: "elements",
1112
+ method: "retrieveManifest",
1113
+ httpMethod: "GET",
1114
+ path: "/v1/elements/manifest.json",
1115
+ pathParams: [],
1116
+ queryParams: [],
1117
+ body: false,
1118
+ idempotent: false,
1119
+ auth: false,
1120
+ scope: "none",
1121
+ response: "json",
1122
+ list: false,
1123
+ paginated: false,
1124
+ summary: "List Elements bundle versions and SRI hashes",
1125
+ },
1126
+ getElementsBundleVersion: {
1127
+ operationId: "getElementsBundleVersion",
1128
+ namespace: "elements",
1129
+ method: "retrieveBundleVersion",
1130
+ httpMethod: "GET",
1131
+ path: "/v1/elements/{version}/elements.js",
1132
+ pathParams: ["version"],
1133
+ queryParams: [],
1134
+ body: false,
1135
+ idempotent: false,
1136
+ auth: false,
1137
+ scope: "none",
1138
+ response: "text",
1139
+ list: false,
1140
+ paginated: false,
1141
+ summary: "Load a pinned Elements bundle version",
1142
+ },
1143
+ createDisclosure: {
1144
+ operationId: "createDisclosure",
1145
+ namespace: "disclosures",
1146
+ method: "create",
1147
+ httpMethod: "POST",
1148
+ path: "/v1/disclosures",
1149
+ pathParams: [],
1150
+ queryParams: [],
1151
+ body: true,
1152
+ idempotent: true,
1153
+ auth: true,
1154
+ scope: "consents:write",
1155
+ response: "json",
1156
+ list: false,
1157
+ paginated: false,
1158
+ summary: "Create a locked disclosure for a site",
1159
+ },
1160
+ retrieveDisclosure: {
1161
+ operationId: "retrieveDisclosure",
1162
+ namespace: "disclosures",
1163
+ method: "retrieve",
1164
+ httpMethod: "GET",
1165
+ path: "/v1/disclosures/{disclosure}",
1166
+ pathParams: ["disclosure"],
1167
+ queryParams: [],
1168
+ body: false,
1169
+ idempotent: false,
1170
+ auth: true,
1171
+ scope: "publishable",
1172
+ response: "json",
1173
+ list: false,
1174
+ paginated: false,
1175
+ summary: "Retrieve a disclosure",
1176
+ },
1177
+ createConsent: {
1178
+ operationId: "createConsent",
1179
+ namespace: "consents",
1180
+ method: "create",
1181
+ httpMethod: "POST",
1182
+ path: "/v1/consents",
1183
+ pathParams: [],
1184
+ queryParams: [],
1185
+ body: true,
1186
+ idempotent: true,
1187
+ auth: true,
1188
+ scope: "publishable",
1189
+ response: "json",
1190
+ list: false,
1191
+ paginated: false,
1192
+ summary: "Record a consent",
1193
+ },
1194
+ listConsents: {
1195
+ operationId: "listConsents",
1196
+ namespace: "consents",
1197
+ method: "list",
1198
+ httpMethod: "GET",
1199
+ path: "/v1/consents",
1200
+ pathParams: [],
1201
+ queryParams: ["limit", "starting_after", "ending_before", "site", "customer_reference", "disclosure", "created_gte", "created_lte"],
1202
+ body: false,
1203
+ idempotent: false,
1204
+ auth: true,
1205
+ scope: "consents:read",
1206
+ response: "json",
1207
+ list: true,
1208
+ paginated: true,
1209
+ summary: "List consents",
1210
+ },
1211
+ retrieveConsent: {
1212
+ operationId: "retrieveConsent",
1213
+ namespace: "consents",
1214
+ method: "retrieve",
1215
+ httpMethod: "GET",
1216
+ path: "/v1/consents/{consent}",
1217
+ pathParams: ["consent"],
1218
+ queryParams: [],
1219
+ body: false,
1220
+ idempotent: false,
1221
+ auth: true,
1222
+ scope: "consents:read",
1223
+ response: "json",
1224
+ list: false,
1225
+ paginated: false,
1226
+ summary: "Retrieve a consent",
1227
+ },
1228
+ updateConsent: {
1229
+ operationId: "updateConsent",
1230
+ namespace: "consents",
1231
+ method: "update",
1232
+ httpMethod: "POST",
1233
+ path: "/v1/consents/{consent}",
1234
+ pathParams: ["consent"],
1235
+ queryParams: [],
1236
+ body: true,
1237
+ idempotent: true,
1238
+ auth: true,
1239
+ scope: "consents:write",
1240
+ response: "json",
1241
+ list: false,
1242
+ paginated: false,
1243
+ summary: "Attach a customer reference to a consent",
1244
+ },
1245
+ createReceiptToken: {
1246
+ operationId: "createReceiptToken",
1247
+ namespace: "receiptTokens",
1248
+ method: "create",
1249
+ httpMethod: "POST",
1250
+ path: "/v1/receipt_tokens",
1251
+ pathParams: [],
1252
+ queryParams: [],
1253
+ body: true,
1254
+ idempotent: true,
1255
+ auth: true,
1256
+ scope: "receipts:write",
1257
+ response: "json",
1258
+ list: false,
1259
+ paginated: false,
1260
+ summary: "Mint a capture token for a checkout",
1261
+ },
1262
+ createReceipt: {
1263
+ operationId: "createReceipt",
1264
+ namespace: "receipts",
1265
+ method: "create",
1266
+ httpMethod: "POST",
1267
+ path: "/v1/receipts",
1268
+ pathParams: [],
1269
+ queryParams: [],
1270
+ body: true,
1271
+ idempotent: true,
1272
+ auth: true,
1273
+ scope: "publishable",
1274
+ response: "json",
1275
+ list: false,
1276
+ paginated: false,
1277
+ summary: "Record a consent receipt",
1278
+ },
1279
+ listReceipts: {
1280
+ operationId: "listReceipts",
1281
+ namespace: "receipts",
1282
+ method: "list",
1283
+ httpMethod: "GET",
1284
+ path: "/v1/receipts",
1285
+ pathParams: [],
1286
+ queryParams: ["limit", "starting_after", "ending_before", "site", "customer_reference", "checkout_session", "email", "source", "binding", "created_gte", "created_lte"],
1287
+ body: false,
1288
+ idempotent: false,
1289
+ auth: true,
1290
+ scope: "receipts:read",
1291
+ response: "json",
1292
+ list: true,
1293
+ paginated: true,
1294
+ summary: "List consent receipts",
1295
+ },
1296
+ eraseReceipts: {
1297
+ operationId: "eraseReceipts",
1298
+ namespace: "receipts",
1299
+ method: "erase",
1300
+ httpMethod: "POST",
1301
+ path: "/v1/receipts/erase",
1302
+ pathParams: [],
1303
+ queryParams: [],
1304
+ body: true,
1305
+ idempotent: true,
1306
+ auth: true,
1307
+ scope: "receipts:write",
1308
+ response: "json",
1309
+ list: false,
1310
+ paginated: false,
1311
+ summary: "Erase a subscriber's receipts",
1312
+ },
1313
+ retrieveReceipt: {
1314
+ operationId: "retrieveReceipt",
1315
+ namespace: "receipts",
1316
+ method: "retrieve",
1317
+ httpMethod: "GET",
1318
+ path: "/v1/receipts/{receipt}",
1319
+ pathParams: ["receipt"],
1320
+ queryParams: [],
1321
+ body: false,
1322
+ idempotent: false,
1323
+ auth: true,
1324
+ scope: "receipts:read",
1325
+ response: "json",
1326
+ list: false,
1327
+ paginated: false,
1328
+ summary: "Retrieve a consent receipt",
1329
+ },
1330
+ renderReceipt: {
1331
+ operationId: "renderReceipt",
1332
+ namespace: "receipts",
1333
+ method: "render",
1334
+ httpMethod: "GET",
1335
+ path: "/v1/receipts/{receipt}/render.png",
1336
+ pathParams: ["receipt"],
1337
+ queryParams: [],
1338
+ body: false,
1339
+ idempotent: false,
1340
+ auth: true,
1341
+ scope: "receipts:read",
1342
+ response: "binary",
1343
+ list: false,
1344
+ paginated: false,
1345
+ summary: "Render a receipt as an image",
1346
+ },
1347
+ verifyReceipt: {
1348
+ operationId: "verifyReceipt",
1349
+ namespace: "receipts",
1350
+ method: "verify",
1351
+ httpMethod: "GET",
1352
+ path: "/v1/receipts/{receipt}/verify",
1353
+ pathParams: ["receipt"],
1354
+ queryParams: [],
1355
+ body: false,
1356
+ idempotent: false,
1357
+ auth: true,
1358
+ scope: "receipts:read",
1359
+ response: "json",
1360
+ list: false,
1361
+ paginated: false,
1362
+ summary: "Verify a receipt's integrity",
1363
+ },
1364
+ exportReceipt: {
1365
+ operationId: "exportReceipt",
1366
+ namespace: "receipts",
1367
+ method: "export",
1368
+ httpMethod: "GET",
1369
+ path: "/v1/receipts/{receipt}/export",
1370
+ pathParams: ["receipt"],
1371
+ queryParams: [],
1372
+ body: false,
1373
+ idempotent: false,
1374
+ auth: true,
1375
+ scope: "receipts:read",
1376
+ response: "binary",
1377
+ list: false,
1378
+ paginated: false,
1379
+ summary: "Download a self-verifying receipt bundle",
1380
+ },
1381
+ retrieveReceiptSettings: {
1382
+ operationId: "retrieveReceiptSettings",
1383
+ namespace: "receiptSettings",
1384
+ method: "retrieve",
1385
+ httpMethod: "GET",
1386
+ path: "/v1/receipt_settings",
1387
+ pathParams: [],
1388
+ queryParams: [],
1389
+ body: false,
1390
+ idempotent: false,
1391
+ auth: true,
1392
+ scope: "receipts:read",
1393
+ response: "json",
1394
+ list: false,
1395
+ paginated: false,
1396
+ summary: "Retrieve receipt settings",
1397
+ },
1398
+ updateReceiptSettings: {
1399
+ operationId: "updateReceiptSettings",
1400
+ namespace: "receiptSettings",
1401
+ method: "update",
1402
+ httpMethod: "POST",
1403
+ path: "/v1/receipt_settings",
1404
+ pathParams: [],
1405
+ queryParams: [],
1406
+ body: true,
1407
+ idempotent: true,
1408
+ auth: true,
1409
+ scope: "receipts:write",
1410
+ response: "json",
1411
+ list: false,
1412
+ paginated: false,
1413
+ summary: "Update receipt settings",
1414
+ },
1415
+ createTestCredential: {
1416
+ operationId: "createTestCredential",
1417
+ namespace: "testCredentials",
1418
+ method: "create",
1419
+ httpMethod: "POST",
1420
+ path: "/v1/sites/{site}/test_credentials",
1421
+ pathParams: ["site"],
1422
+ queryParams: [],
1423
+ body: true,
1424
+ idempotent: true,
1425
+ auth: true,
1426
+ scope: "test_runs:write",
1427
+ response: "json",
1428
+ list: false,
1429
+ paginated: false,
1430
+ summary: "Store a billing test-mode key",
1431
+ },
1432
+ listTestCredentials: {
1433
+ operationId: "listTestCredentials",
1434
+ namespace: "testCredentials",
1435
+ method: "list",
1436
+ httpMethod: "GET",
1437
+ path: "/v1/sites/{site}/test_credentials",
1438
+ pathParams: ["site"],
1439
+ queryParams: [],
1440
+ body: false,
1441
+ idempotent: false,
1442
+ auth: true,
1443
+ scope: "test_runs:read",
1444
+ response: "json",
1445
+ list: true,
1446
+ paginated: false,
1447
+ summary: "List billing test-mode keys of a site",
1448
+ },
1449
+ deleteTestCredential: {
1450
+ operationId: "deleteTestCredential",
1451
+ namespace: "testCredentials",
1452
+ method: "del",
1453
+ httpMethod: "DELETE",
1454
+ path: "/v1/sites/{site}/test_credentials/{test_credential}",
1455
+ pathParams: ["site", "test_credential"],
1456
+ queryParams: [],
1457
+ body: false,
1458
+ idempotent: false,
1459
+ auth: true,
1460
+ scope: "test_runs:write",
1461
+ response: "json",
1462
+ list: false,
1463
+ paginated: false,
1464
+ summary: "Delete a billing test-mode key",
1465
+ },
1466
+ createStripeCheckoutConfig: {
1467
+ operationId: "createStripeCheckoutConfig",
1468
+ namespace: "stripeCheckoutConfigs",
1469
+ method: "create",
1470
+ httpMethod: "POST",
1471
+ path: "/v1/sites/{site}/stripe_checkout_configs",
1472
+ pathParams: ["site"],
1473
+ queryParams: [],
1474
+ body: true,
1475
+ idempotent: true,
1476
+ auth: true,
1477
+ scope: "test_runs:write",
1478
+ response: "json",
1479
+ list: false,
1480
+ paginated: false,
1481
+ summary: "Register the Checkout Session params your code uses",
1482
+ },
1483
+ listStripeCheckoutConfigs: {
1484
+ operationId: "listStripeCheckoutConfigs",
1485
+ namespace: "stripeCheckoutConfigs",
1486
+ method: "list",
1487
+ httpMethod: "GET",
1488
+ path: "/v1/sites/{site}/stripe_checkout_configs",
1489
+ pathParams: ["site"],
1490
+ queryParams: ["limit", "starting_after", "ending_before"],
1491
+ body: false,
1492
+ idempotent: false,
1493
+ auth: true,
1494
+ scope: "test_runs:read",
1495
+ response: "json",
1496
+ list: true,
1497
+ paginated: true,
1498
+ summary: "List registered checkout configs",
1499
+ },
1500
+ retrieveStripeCheckoutConfig: {
1501
+ operationId: "retrieveStripeCheckoutConfig",
1502
+ namespace: "stripeCheckoutConfigs",
1503
+ method: "retrieve",
1504
+ httpMethod: "GET",
1505
+ path: "/v1/stripe_checkout_configs/{stripe_checkout_config}",
1506
+ pathParams: ["stripe_checkout_config"],
1507
+ queryParams: [],
1508
+ body: false,
1509
+ idempotent: false,
1510
+ auth: true,
1511
+ scope: "test_runs:read",
1512
+ response: "json",
1513
+ list: false,
1514
+ paginated: false,
1515
+ summary: "Retrieve a registered checkout config",
1516
+ },
1517
+ deleteStripeCheckoutConfig: {
1518
+ operationId: "deleteStripeCheckoutConfig",
1519
+ namespace: "stripeCheckoutConfigs",
1520
+ method: "del",
1521
+ httpMethod: "DELETE",
1522
+ path: "/v1/stripe_checkout_configs/{stripe_checkout_config}",
1523
+ pathParams: ["stripe_checkout_config"],
1524
+ queryParams: [],
1525
+ body: false,
1526
+ idempotent: false,
1527
+ auth: true,
1528
+ scope: "test_runs:write",
1529
+ response: "json",
1530
+ list: false,
1531
+ paginated: false,
1532
+ summary: "Delete a registered checkout config",
1533
+ },
1534
+ createTestRun: {
1535
+ operationId: "createTestRun",
1536
+ namespace: "testRuns",
1537
+ method: "create",
1538
+ httpMethod: "POST",
1539
+ path: "/v1/sites/{site}/test_runs",
1540
+ pathParams: ["site"],
1541
+ queryParams: [],
1542
+ body: true,
1543
+ idempotent: true,
1544
+ auth: true,
1545
+ scope: "test_runs:write",
1546
+ response: "json",
1547
+ list: false,
1548
+ paginated: false,
1549
+ summary: "Start a lifecycle test run",
1550
+ },
1551
+ listTestRuns: {
1552
+ operationId: "listTestRuns",
1553
+ namespace: "testRuns",
1554
+ method: "list",
1555
+ httpMethod: "GET",
1556
+ path: "/v1/sites/{site}/test_runs",
1557
+ pathParams: ["site"],
1558
+ queryParams: ["limit", "starting_after", "ending_before"],
1559
+ body: false,
1560
+ idempotent: false,
1561
+ auth: true,
1562
+ scope: "test_runs:read",
1563
+ response: "json",
1564
+ list: true,
1565
+ paginated: true,
1566
+ summary: "List test runs of a site",
1567
+ },
1568
+ retrieveTestRun: {
1569
+ operationId: "retrieveTestRun",
1570
+ namespace: "testRuns",
1571
+ method: "retrieve",
1572
+ httpMethod: "GET",
1573
+ path: "/v1/test_runs/{test_run}",
1574
+ pathParams: ["test_run"],
1575
+ queryParams: [],
1576
+ body: false,
1577
+ idempotent: false,
1578
+ auth: true,
1579
+ scope: "test_runs:read",
1580
+ response: "json",
1581
+ list: false,
1582
+ paginated: false,
1583
+ summary: "Retrieve a test run",
1584
+ },
1585
+ cancelTestRun: {
1586
+ operationId: "cancelTestRun",
1587
+ namespace: "testRuns",
1588
+ method: "cancel",
1589
+ httpMethod: "POST",
1590
+ path: "/v1/test_runs/{test_run}/cancel",
1591
+ pathParams: ["test_run"],
1592
+ queryParams: [],
1593
+ body: false,
1594
+ idempotent: true,
1595
+ auth: true,
1596
+ scope: "test_runs:write",
1597
+ response: "json",
1598
+ list: false,
1599
+ paginated: false,
1600
+ summary: "Cancel a test run",
1601
+ },
1602
+ createWebhookEndpoint: {
1603
+ operationId: "createWebhookEndpoint",
1604
+ namespace: "webhookEndpoints",
1605
+ method: "create",
1606
+ httpMethod: "POST",
1607
+ path: "/v1/webhook_endpoints",
1608
+ pathParams: [],
1609
+ queryParams: [],
1610
+ body: true,
1611
+ idempotent: true,
1612
+ auth: true,
1613
+ scope: "webhook_endpoints:write",
1614
+ response: "json",
1615
+ list: false,
1616
+ paginated: false,
1617
+ summary: "Create a webhook endpoint",
1618
+ },
1619
+ listWebhookEndpoints: {
1620
+ operationId: "listWebhookEndpoints",
1621
+ namespace: "webhookEndpoints",
1622
+ method: "list",
1623
+ httpMethod: "GET",
1624
+ path: "/v1/webhook_endpoints",
1625
+ pathParams: [],
1626
+ queryParams: ["limit", "starting_after", "ending_before"],
1627
+ body: false,
1628
+ idempotent: false,
1629
+ auth: true,
1630
+ scope: "webhook_endpoints:read",
1631
+ response: "json",
1632
+ list: true,
1633
+ paginated: true,
1634
+ summary: "List webhook endpoints",
1635
+ },
1636
+ retrieveWebhookEndpoint: {
1637
+ operationId: "retrieveWebhookEndpoint",
1638
+ namespace: "webhookEndpoints",
1639
+ method: "retrieve",
1640
+ httpMethod: "GET",
1641
+ path: "/v1/webhook_endpoints/{webhook_endpoint}",
1642
+ pathParams: ["webhook_endpoint"],
1643
+ queryParams: [],
1644
+ body: false,
1645
+ idempotent: false,
1646
+ auth: true,
1647
+ scope: "webhook_endpoints:read",
1648
+ response: "json",
1649
+ list: false,
1650
+ paginated: false,
1651
+ summary: "Retrieve a webhook endpoint",
1652
+ },
1653
+ updateWebhookEndpoint: {
1654
+ operationId: "updateWebhookEndpoint",
1655
+ namespace: "webhookEndpoints",
1656
+ method: "update",
1657
+ httpMethod: "POST",
1658
+ path: "/v1/webhook_endpoints/{webhook_endpoint}",
1659
+ pathParams: ["webhook_endpoint"],
1660
+ queryParams: [],
1661
+ body: true,
1662
+ idempotent: true,
1663
+ auth: true,
1664
+ scope: "webhook_endpoints:write",
1665
+ response: "json",
1666
+ list: false,
1667
+ paginated: false,
1668
+ summary: "Update a webhook endpoint",
1669
+ },
1670
+ deleteWebhookEndpoint: {
1671
+ operationId: "deleteWebhookEndpoint",
1672
+ namespace: "webhookEndpoints",
1673
+ method: "del",
1674
+ httpMethod: "DELETE",
1675
+ path: "/v1/webhook_endpoints/{webhook_endpoint}",
1676
+ pathParams: ["webhook_endpoint"],
1677
+ queryParams: [],
1678
+ body: false,
1679
+ idempotent: false,
1680
+ auth: true,
1681
+ scope: "webhook_endpoints:write",
1682
+ response: "json",
1683
+ list: false,
1684
+ paginated: false,
1685
+ summary: "Delete a webhook endpoint",
1686
+ },
1687
+ rollWebhookEndpointSecret: {
1688
+ operationId: "rollWebhookEndpointSecret",
1689
+ namespace: "webhookEndpoints",
1690
+ method: "rollSecret",
1691
+ httpMethod: "POST",
1692
+ path: "/v1/webhook_endpoints/{webhook_endpoint}/roll_secret",
1693
+ pathParams: ["webhook_endpoint"],
1694
+ queryParams: [],
1695
+ body: true,
1696
+ idempotent: true,
1697
+ auth: true,
1698
+ scope: "webhook_endpoints:write",
1699
+ response: "json",
1700
+ list: false,
1701
+ paginated: false,
1702
+ summary: "Roll a webhook signing secret",
1703
+ },
1704
+ listEvents: {
1705
+ operationId: "listEvents",
1706
+ namespace: "events",
1707
+ method: "list",
1708
+ httpMethod: "GET",
1709
+ path: "/v1/events",
1710
+ pathParams: [],
1711
+ queryParams: ["limit", "starting_after", "ending_before", "type", "created_gte", "created_lte"],
1712
+ body: false,
1713
+ idempotent: false,
1714
+ auth: true,
1715
+ scope: "events:read",
1716
+ response: "json",
1717
+ list: true,
1718
+ paginated: true,
1719
+ summary: "List events",
1720
+ },
1721
+ retrieveEvent: {
1722
+ operationId: "retrieveEvent",
1723
+ namespace: "events",
1724
+ method: "retrieve",
1725
+ httpMethod: "GET",
1726
+ path: "/v1/events/{event}",
1727
+ pathParams: ["event"],
1728
+ queryParams: [],
1729
+ body: false,
1730
+ idempotent: false,
1731
+ auth: true,
1732
+ scope: "events:read",
1733
+ response: "json",
1734
+ list: false,
1735
+ paginated: false,
1736
+ summary: "Retrieve an event",
1737
+ },
1738
+ createFeedback: {
1739
+ operationId: "createFeedback",
1740
+ namespace: "feedbacks",
1741
+ method: "create",
1742
+ httpMethod: "POST",
1743
+ path: "/v1/feedback",
1744
+ pathParams: [],
1745
+ queryParams: [],
1746
+ body: true,
1747
+ idempotent: true,
1748
+ auth: true,
1749
+ scope: "account:read",
1750
+ response: "json",
1751
+ list: false,
1752
+ paginated: false,
1753
+ summary: "Send feedback",
1754
+ },
1755
+ };
1756
+ /** `checkbox.device` */
1757
+ export class DeviceResource extends Resource {
1758
+ /**
1759
+ * Start a device login (setup_checkbox).
1760
+ *
1761
+ * Public (no API key). Returns a device_code (keep it private), a user_code and verification_uri_complete. Show the human ONE line ("Open <verification_uri_complete> and click Approve"), open it in their browser when possible, then poll createDeviceToken every `interval` seconds. New users sign up on that page with an email link or GitHub / Google; nothing is created until they click Approve.
1762
+ *
1763
+ * @see POST /v1/device/authorize (operation `createDeviceAuthorization`, scope `none`)
1764
+ */
1765
+ authorize(params, options) {
1766
+ return this._request(OPERATIONS.createDeviceAuthorization, [], params, options);
1767
+ }
1768
+ /**
1769
+ * Poll a device login for its keys.
1770
+ *
1771
+ * Public (no API key). Poll every `interval` seconds with the device_code. Errors (stable codes): authorization_pending (keep polling), slow_down (add 5 s), access_denied (the human clicked Deny: stop), expired_token (start again). On approval returns the keys exactly once, the setup session and the next action.
1772
+ *
1773
+ * @see POST /v1/device/token (operation `createDeviceToken`, scope `none`)
1774
+ */
1775
+ token(params, options) {
1776
+ return this._request(OPERATIONS.createDeviceToken, [], params, options);
1777
+ }
1778
+ }
1779
+ /** `checkbox.setupSessions` */
1780
+ export class SetupSessionsResource extends Resource {
1781
+ /**
1782
+ * Start a setup session (agents that already have a key).
1783
+ *
1784
+ * For agents that already hold a secret key (no device login): starts a setup session for a project with the same fields as updateSetupSession. `checkbox init` creates the session during the device login instead.
1785
+ *
1786
+ * @see POST /v1/setup_sessions (operation `createSetupSession`, scope `setup_sessions:write`)
1787
+ */
1788
+ create(params, options) {
1789
+ return this._request(OPERATIONS.createSetupSession, [], params, options);
1790
+ }
1791
+ /**
1792
+ * List setup sessions.
1793
+ *
1794
+ * Setup sessions of the account, newest first. Test keys see the sessions created in test mode (device login, test keys); live keys see all.
1795
+ *
1796
+ * @see GET /v1/setup_sessions (operation `listSetupSessions`, scope `setup_sessions:read`)
1797
+ */
1798
+ list(params, options) {
1799
+ return this._list(OPERATIONS.listSetupSessions, [], params, options);
1800
+ }
1801
+ /**
1802
+ * Retrieve a setup session.
1803
+ *
1804
+ * The setup checklist with one next_action. Agents: do next_action, then call verifySetupSession; stop when next_action.type is "done".
1805
+ *
1806
+ * @param setupSession Unique identifier of the setup session (setup_…).
1807
+ * @see GET /v1/setup_sessions/{setup_session} (operation `retrieveSetupSession`, scope `setup_sessions:read`)
1808
+ */
1809
+ retrieve(setupSession, options) {
1810
+ return this._request(OPERATIONS.retrieveSetupSession, [setupSession], undefined, options);
1811
+ }
1812
+ /**
1813
+ * Report what the agent learned or changed.
1814
+ *
1815
+ * Reports project facts and business URLs: site_url (creates the test-mode site), checkout_url, terms_url / refund_url / cancellation_url / privacy_url (fetched now, stored as evidence and checked against the law), plans, where checkout code lives, snippet_installed_in, env_written. Returns the updated checklist.
1816
+ *
1817
+ * @param setupSession Unique identifier of the setup session (setup_…).
1818
+ * @see POST /v1/setup_sessions/{setup_session} (operation `updateSetupSession`, scope `setup_sessions:write`)
1819
+ */
1820
+ update(setupSession, params, options) {
1821
+ return this._request(OPERATIONS.updateSetupSession, [setupSession], params, options);
1822
+ }
1823
+ /**
1824
+ * Re-check the site now.
1825
+ *
1826
+ * Loads the site (is the snippet live? which policy links does it have?), re-fetches the Terms and policies, re-evaluates compliance and queues the first synthetic-shopper scan. Call it after every change the agent made (and after deploying). Returns what was seen plus the updated session.
1827
+ *
1828
+ * @param setupSession Unique identifier of the setup session (setup_…).
1829
+ * @see POST /v1/setup_sessions/{setup_session}/verify (operation `verifySetupSession`, scope `setup_sessions:write`)
1830
+ */
1831
+ verify(setupSession, options) {
1832
+ return this._request(OPERATIONS.verifySetupSession, [setupSession], undefined, options);
1833
+ }
1834
+ /**
1835
+ * Finish the setup and notify the human.
1836
+ *
1837
+ * Marks the setup finished and emails the person who approved it a summary ("<agent> set up Checkbox for <domain>") with what was created, what is still open and a review link. Idempotent: the email is sent once. Checks keep running afterwards.
1838
+ *
1839
+ * @param setupSession Unique identifier of the setup session (setup_…).
1840
+ * @see POST /v1/setup_sessions/{setup_session}/complete (operation `completeSetupSession`, scope `setup_sessions:write`)
1841
+ */
1842
+ complete(setupSession, options) {
1843
+ return this._request(OPERATIONS.completeSetupSession, [setupSession], undefined, options);
1844
+ }
1845
+ }
1846
+ /** `checkbox.account` */
1847
+ export class AccountResource extends Resource {
1848
+ /**
1849
+ * Retrieve the account.
1850
+ *
1851
+ * Returns the account behind the key: test or live mode, whether live mode is activated, fair-use limits, the publishable key, and `next_action`. Call this first to check a key.
1852
+ *
1853
+ * @see GET /v1/account (operation `retrieveAccount`, scope `account:read`)
1854
+ */
1855
+ retrieve(options) {
1856
+ return this._request(OPERATIONS.retrieveAccount, [], undefined, options);
1857
+ }
1858
+ /**
1859
+ * Update the account.
1860
+ *
1861
+ * Pins the account to an API version (requests without a Checkbox-Version header use it). Known versions: 2026-10-30.
1862
+ *
1863
+ * @see POST /v1/account (operation `updateAccount`, scope `account:write`)
1864
+ */
1865
+ update(params, options) {
1866
+ return this._request(OPERATIONS.updateAccount, [], params, options);
1867
+ }
1868
+ }
1869
+ /** `checkbox.sites` */
1870
+ export class SitesResource extends Resource {
1871
+ /**
1872
+ * List sites.
1873
+ *
1874
+ * Returns the sites of the account in the current mode, newest first. Archived sites are included only with archived=true.
1875
+ *
1876
+ * @see GET /v1/sites (operation `listSites`, scope `sites:read`)
1877
+ */
1878
+ list(params, options) {
1879
+ return this._list(OPERATIONS.listSites, [], params, options);
1880
+ }
1881
+ /**
1882
+ * Create a site.
1883
+ *
1884
+ * Registers a subscription business. Only `url` is required; Checkbox derives the name and uses the URL as the checkout entry page. The response includes `install` (snippet tag, inbound email, platform webhook URLs). Next: install the snippet, then run createScan (or let `checkbox init` do both). In live mode before activation, monitoring is held until a domain is verified; in test mode, monitoring of a host that is not localhost or a domain the account verified is held the same way, and on-demand scans of such hosts are limited to a few a day.
1885
+ *
1886
+ * @see POST /v1/sites (operation `createSite`, scope `sites:write`)
1887
+ */
1888
+ create(params, options) {
1889
+ return this._request(OPERATIONS.createSite, [], params, options);
1890
+ }
1891
+ /**
1892
+ * Retrieve a site.
1893
+ *
1894
+ * Returns a site with its latest compliance verdict (score, insurable) and install details.
1895
+ *
1896
+ * @param site Unique identifier of the site (site_…).
1897
+ * @see GET /v1/sites/{site} (operation `retrieveSite`, scope `sites:read`)
1898
+ */
1899
+ retrieve(site, params, options) {
1900
+ return this._request(OPERATIONS.retrieveSite, [site], params, options);
1901
+ }
1902
+ /**
1903
+ * Update a site.
1904
+ *
1905
+ * Updates the given fields; omitted fields keep their values. Changing `url` to another domain forgets the domain verification and ends the active certificate.
1906
+ *
1907
+ * @param site Unique identifier of the site (site_…).
1908
+ * @see POST /v1/sites/{site} (operation `updateSite`, scope `sites:write`)
1909
+ */
1910
+ update(site, params, options) {
1911
+ return this._request(OPERATIONS.updateSite, [site], params, options);
1912
+ }
1913
+ /**
1914
+ * Archive a site.
1915
+ *
1916
+ * Archives (soft-deletes) the site: monitoring stops and it disappears from lists, but evidence and findings are retained for the warranty. Undo with restoreSite.
1917
+ *
1918
+ * @param site Unique identifier of the site (site_…).
1919
+ * @see DELETE /v1/sites/{site} (operation `deleteSite`, scope `sites:write`)
1920
+ */
1921
+ del(site, options) {
1922
+ return this._request(OPERATIONS.deleteSite, [site], undefined, options);
1923
+ }
1924
+ /** Alias of `del()`. */
1925
+ delete(site, options) {
1926
+ return this.del(site, options);
1927
+ }
1928
+ /**
1929
+ * Restore an archived site.
1930
+ *
1931
+ * Un-archives a site (counts against the fair-use site limit again).
1932
+ *
1933
+ * @param site Unique identifier of the site (site_…).
1934
+ * @see POST /v1/sites/{site}/restore (operation `restoreSite`, scope `sites:write`)
1935
+ */
1936
+ restore(site, options) {
1937
+ return this._request(OPERATIONS.restoreSite, [site], undefined, options);
1938
+ }
1939
+ /**
1940
+ * Connect a billing platform.
1941
+ *
1942
+ * Connects the site's billing platform with read-only credentials (a Stripe restricted key, a Recharge token or a Shopify Admin API token), so Checkbox reads the customer-portal and reminder settings. Works for test-mode sites too (use an rk_test_ key). The credentials are validated by reading the settings once and stored encrypted. Pilot fix: this used to be possible only in the dashboard, which could not open test-mode sites.
1943
+ *
1944
+ * @param site Unique identifier of the site (site_…).
1945
+ * @see POST /v1/sites/{site}/integrations (operation `connectBillingPlatform`, scope `sites:write`)
1946
+ */
1947
+ connectBillingPlatform(site, params, options) {
1948
+ return this._request(OPERATIONS.connectBillingPlatform, [site], params, options);
1949
+ }
1950
+ /**
1951
+ * Re-check the whole site now.
1952
+ *
1953
+ * Re-fetches the registered policies, pre-checks the checkout, re-evaluates and queues a scan. Use it for the first check after setup, or after applying several tasks. Pass ?wait=30 to long-poll; then get the plan (retrieveCompliancePlan).
1954
+ *
1955
+ * @param site Unique identifier of the site (site_…).
1956
+ * @see POST /v1/sites/{site}/verify (operation `verifySite`, scope `compliance_plans:write`)
1957
+ */
1958
+ verify(site, params, options) {
1959
+ return this._request(OPERATIONS.verifySite, [site], params, options);
1960
+ }
1961
+ }
1962
+ /** `checkbox.domainVerifications` */
1963
+ export class DomainVerificationsResource extends Resource {
1964
+ /**
1965
+ * Retrieve domain verification.
1966
+ *
1967
+ * Status of the site domain verification, with the DNS record / file to publish.
1968
+ *
1969
+ * @param site Unique identifier of the site (site_…).
1970
+ * @see GET /v1/sites/{site}/domain_verification (operation `retrieveDomainVerification`, scope `sites:read`)
1971
+ */
1972
+ retrieve(site, options) {
1973
+ return this._request(OPERATIONS.retrieveDomainVerification, [site], undefined, options);
1974
+ }
1975
+ /**
1976
+ * Start domain verification.
1977
+ *
1978
+ * Starts verification of the site domain and returns a DNS TXT record and a /.well-known file; publishing either proves control. Then call checkDomainVerification. Verifying a live-mode site activates live mode for the account (instant, self-serve).
1979
+ *
1980
+ * @param site Unique identifier of the site (site_…).
1981
+ * @see POST /v1/sites/{site}/domain_verification (operation `createDomainVerification`, scope `sites:write`)
1982
+ */
1983
+ create(site, params, options) {
1984
+ return this._request(OPERATIONS.createDomainVerification, [site], params, options);
1985
+ }
1986
+ /**
1987
+ * Check domain verification now.
1988
+ *
1989
+ * Looks for the DNS TXT record and the /.well-known file now. On success in live mode, the account is activated and held monitoring starts.
1990
+ *
1991
+ * @param site Unique identifier of the site (site_…).
1992
+ * @see POST /v1/sites/{site}/domain_verification/check (operation `checkDomainVerification`, scope `sites:write`)
1993
+ */
1994
+ check(site, options) {
1995
+ return this._request(OPERATIONS.checkDomainVerification, [site], undefined, options);
1996
+ }
1997
+ }
1998
+ /** `checkbox.scans` */
1999
+ export class ScansResource extends Resource {
2000
+ /**
2001
+ * Run a scan.
2002
+ *
2003
+ * Queues a synthetic-shopper scan of the site. Poll retrieveScan (or wait for the scan.completed webhook); a scan takes 1-3 minutes. When it completes, the evaluation and findings are updated. In live mode the account must be activated.
2004
+ *
2005
+ * @param site Unique identifier of the site (site_…).
2006
+ * @see POST /v1/sites/{site}/scans (operation `createScan`, scope `scans:write`, live mode needs an activated account)
2007
+ */
2008
+ create(site, params, options) {
2009
+ return this._request(OPERATIONS.createScan, [site], params, options);
2010
+ }
2011
+ /**
2012
+ * List scans.
2013
+ *
2014
+ * Scans newest first, optionally for one site.
2015
+ *
2016
+ * @see GET /v1/scans (operation `listScans`, scope `scans:read`)
2017
+ */
2018
+ list(params, options) {
2019
+ return this._list(OPERATIONS.listScans, [], params, options);
2020
+ }
2021
+ /**
2022
+ * Retrieve a scan.
2023
+ *
2024
+ * Returns a scan. When status is completed, `evaluation` names the verdict (retrieveEvaluation).
2025
+ *
2026
+ * @param scan Unique identifier of the scan (scan_…).
2027
+ * @see GET /v1/scans/{scan} (operation `retrieveScan`, scope `scans:read`)
2028
+ */
2029
+ retrieve(scan, options) {
2030
+ return this._request(OPERATIONS.retrieveScan, [scan], undefined, options);
2031
+ }
2032
+ }
2033
+ /** `checkbox.evaluations` */
2034
+ export class EvaluationsResource extends Resource {
2035
+ /**
2036
+ * Re-evaluate a site now.
2037
+ *
2038
+ * Re-runs the legal rules against the evidence already collected (no new scan) and returns the verdict synchronously. Use after changing site facts, or to get a verdict right after evidence arrived.
2039
+ *
2040
+ * @param site Unique identifier of the site (site_…).
2041
+ * @see POST /v1/sites/{site}/evaluations (operation `createEvaluation`, scope `evaluations:write`)
2042
+ */
2043
+ create(site, params, options) {
2044
+ return this._request(OPERATIONS.createEvaluation, [site], params, options);
2045
+ }
2046
+ /**
2047
+ * List evaluations.
2048
+ *
2049
+ * Verdicts newest first (score history), optionally for one site.
2050
+ *
2051
+ * @see GET /v1/evaluations (operation `listEvaluations`, scope `evaluations:read`)
2052
+ */
2053
+ list(params, options) {
2054
+ return this._list(OPERATIONS.listEvaluations, [], params, options);
2055
+ }
2056
+ /**
2057
+ * Retrieve an evaluation.
2058
+ *
2059
+ * Returns one verdict with all checks and the insurability blockers.
2060
+ *
2061
+ * @param evaluation Unique identifier of the evaluation (eval_…).
2062
+ * @see GET /v1/evaluations/{evaluation} (operation `retrieveEvaluation`, scope `evaluations:read`)
2063
+ */
2064
+ retrieve(evaluation, options) {
2065
+ return this._request(OPERATIONS.retrieveEvaluation, [evaluation], undefined, options);
2066
+ }
2067
+ /**
2068
+ * Get the current verdict of a site.
2069
+ *
2070
+ * The latest evaluation of the site: is it compliant (score) and insurable, and what blocks it. 404 resource_missing with next_action createScan when the site was never evaluated.
2071
+ *
2072
+ * @param site Unique identifier of the site (site_…).
2073
+ * @see GET /v1/sites/{site}/evaluation (operation `retrieveLatestEvaluation`, scope `evaluations:read`)
2074
+ */
2075
+ retrieveLatest(site, options) {
2076
+ return this._request(OPERATIONS.retrieveLatestEvaluation, [site], undefined, options);
2077
+ }
2078
+ }
2079
+ /** `checkbox.findings` */
2080
+ export class FindingsResource extends Resource {
2081
+ /**
2082
+ * List findings.
2083
+ *
2084
+ * Findings ordered by urgency (failing first, then by severity). Filter by site, status (fail, needs_review, pass, not_applicable) and state (open, acknowledged, resolved, accepted_risk). Fix the open `fail` findings to become compliant.
2085
+ *
2086
+ * @see GET /v1/findings (operation `listFindings`, scope `findings:read`)
2087
+ */
2088
+ list(params, options) {
2089
+ return this._list(OPERATIONS.listFindings, [], params, options);
2090
+ }
2091
+ /**
2092
+ * Retrieve a finding.
2093
+ *
2094
+ * One finding with its legal requirements (citations), evidence references and remediation.
2095
+ *
2096
+ * @param finding Unique identifier of the finding (fnd_…).
2097
+ * @see GET /v1/findings/{finding} (operation `retrieveFinding`, scope `findings:read`)
2098
+ */
2099
+ retrieve(finding, options) {
2100
+ return this._request(OPERATIONS.retrieveFinding, [finding], undefined, options);
2101
+ }
2102
+ /**
2103
+ * Triage a finding.
2104
+ *
2105
+ * Sets the triage state (open, acknowledged, accepted_risk, resolved) and an optional note. Triage does not change the check result; fixing the issue and re-scanning does.
2106
+ *
2107
+ * @param finding Unique identifier of the finding (fnd_…).
2108
+ * @see POST /v1/findings/{finding} (operation `updateFinding`, scope `findings:write`)
2109
+ */
2110
+ update(finding, params, options) {
2111
+ return this._request(OPERATIONS.updateFinding, [finding], params, options);
2112
+ }
2113
+ }
2114
+ /** `checkbox.plans` */
2115
+ export class PlansResource extends Resource {
2116
+ /**
2117
+ * Get the compliance plan for a site.
2118
+ *
2119
+ * Ordered tasks that make the site compliant, recomputed from its latest evaluation: each with the requirement and citation, where to change (file / URL / selector / Stripe object), the exact change (unified-diff template with machine-applicable edits, copy, or Stripe params) and how to verify it. Do plan.next_action: apply the first open task, call verifyTask, repeat until status is compliant. Tasks with status manual hold a question for the human (answerTask); they never block the others.
2120
+ *
2121
+ * @param site Unique identifier of the site (site_…).
2122
+ * @see GET /v1/sites/{site}/plan (operation `retrieveCompliancePlan`, scope `compliance_plans:read`)
2123
+ */
2124
+ retrieve(site, options) {
2125
+ return this._request(OPERATIONS.retrieveCompliancePlan, [site], undefined, options);
2126
+ }
2127
+ }
2128
+ /** `checkbox.tasks` */
2129
+ export class TasksResource extends Resource {
2130
+ /**
2131
+ * Get one task of a compliance plan.
2132
+ *
2133
+ * The task as in the current plan (recomputed): the change to apply, how to verify, its last verification and next_action.
2134
+ *
2135
+ * @param task Unique identifier of the task (task_…).
2136
+ * @see GET /v1/tasks/{task} (operation `retrieveTask`, scope `compliance_plans:read`)
2137
+ */
2138
+ retrieve(task, options) {
2139
+ return this._request(OPERATIONS.retrieveTask, [task], undefined, options);
2140
+ }
2141
+ /**
2142
+ * Claim, decline or reopen a task.
2143
+ *
2144
+ * status in_progress claims the task (shown to other agents and the dashboard); wont_fix declines it with a reason (the merchant's decision, recorded; a declined critical or high task keeps the plan blocked); open clears the decision. Applying a change does not need this call: call verifyTask.
2145
+ *
2146
+ * @param task Unique identifier of the task (task_…).
2147
+ * @see POST /v1/tasks/{task} (operation `updateTask`, scope `compliance_plans:write`)
2148
+ */
2149
+ update(task, params, options) {
2150
+ return this._request(OPERATIONS.updateTask, [task], params, options);
2151
+ }
2152
+ /**
2153
+ * Record the human answer to a manual task.
2154
+ *
2155
+ * For tasks with status manual: record the human's answer to task.question (ask them; never answer on their behalf). Answers that assert a legal fact (yes, confirmed) are stored as a proposal and return next_action.type "ask_human_to_confirm" with a link the human opens while signed in to Checkbox; only their confirmation writes the attestation, sets the site fact and re-evaluates. no / needs_change turn the task into a change for the agent; done (after a dashboard-only step) re-checks at once. Every answer is stored in the evidence vault.
2156
+ *
2157
+ * @param task Unique identifier of the task (task_…).
2158
+ * @see POST /v1/tasks/{task}/answer (operation `answerTask`, scope `compliance_plans:write`)
2159
+ */
2160
+ answer(task, params, options) {
2161
+ return this._request(OPERATIONS.answerTask, [task], params, options);
2162
+ }
2163
+ /**
2164
+ * Verify a task after applying its change.
2165
+ *
2166
+ * Runs the fastest re-check that can confirm the task (static fetch of the live checkout or the html you send, the Stripe params you send, the email copy you send, a re-fetch of the Terms) and queues the confirming observation (a scan, a billing-platform sync, the next email). A failing pre-check fails the verification at once with a diff. Pass ?wait=30 to long-poll; otherwise poll retrieveVerification or wait for the task.verified webhook. Then follow next_action.
2167
+ *
2168
+ * @param task Unique identifier of the task (task_…).
2169
+ * @see POST /v1/tasks/{task}/verify (operation `verifyTask`, scope `compliance_plans:write`)
2170
+ */
2171
+ verify(task, params, options) {
2172
+ return this._request(OPERATIONS.verifyTask, [task], params, options);
2173
+ }
2174
+ }
2175
+ /** `checkbox.verifications` */
2176
+ export class VerificationsResource extends Resource {
2177
+ /**
2178
+ * Get a verification (long-poll with ?wait=30).
2179
+ *
2180
+ * The verification's status (pending, passed, failed), expected vs observed per check, the diff and next_action. ?wait=N (≤ 30) holds the request until it resolves or N seconds pass.
2181
+ *
2182
+ * @param verification Unique identifier of the verification (ver_…).
2183
+ * @see GET /v1/verifications/{verification} (operation `retrieveVerification`, scope `compliance_plans:read`)
2184
+ */
2185
+ retrieve(verification, params, options) {
2186
+ return this._request(OPERATIONS.retrieveVerification, [verification], params, options);
2187
+ }
2188
+ /**
2189
+ * List verifications of a site.
2190
+ *
2191
+ * Verifications newest first (optionally for one task).
2192
+ *
2193
+ * @param site Unique identifier of the site (site_…).
2194
+ * @see GET /v1/sites/{site}/verifications (operation `listVerifications`, scope `compliance_plans:read`)
2195
+ */
2196
+ list(site, params, options) {
2197
+ return this._list(OPERATIONS.listVerifications, [site], params, options);
2198
+ }
2199
+ }
2200
+ /** `checkbox.fixes` */
2201
+ export class FixesResource extends Resource {
2202
+ /**
2203
+ * Get the fix for a finding.
2204
+ *
2205
+ * The concrete change that makes the finding pass: verified disclosure text and code for the detected platform, or the generic remediation. Apply it, then re-scan (createScan) or re-evaluate.
2206
+ *
2207
+ * @param finding Unique identifier of the finding (fnd_…).
2208
+ * @see GET /v1/findings/{finding}/fix (operation `retrieveFindingFix`, scope `fixes:read`)
2209
+ */
2210
+ retrieve(finding, params, options) {
2211
+ return this._request(OPERATIONS.retrieveFindingFix, [finding], params, options);
2212
+ }
2213
+ /**
2214
+ * List fix plans for a site.
2215
+ *
2216
+ * Site-level fix plans: the sign-up disclosure fix and the cancellation fix (hosted cancellation page), each with the checks it covers.
2217
+ *
2218
+ * @param site Unique identifier of the site (site_…).
2219
+ * @see GET /v1/sites/{site}/fixes (operation `listSiteFixes`, scope `fixes:read`)
2220
+ */
2221
+ list(site, params, options) {
2222
+ return this._request(OPERATIONS.listSiteFixes, [site], params, options);
2223
+ }
2224
+ }
2225
+ /** `checkbox.evidence` */
2226
+ export class EvidenceResource extends Resource {
2227
+ /**
2228
+ * List evidence.
2229
+ *
2230
+ * Evidence records of a site, newest first. Use downloadEvidenceContent for the raw bytes.
2231
+ *
2232
+ * @see GET /v1/evidence (operation `listEvidence`, scope `evidence:read`)
2233
+ */
2234
+ list(params, options) {
2235
+ return this._list(OPERATIONS.listEvidence, [], params, options);
2236
+ }
2237
+ /**
2238
+ * Retrieve evidence metadata.
2239
+ *
2240
+ * One evidence record (hashes, metadata, content URL).
2241
+ *
2242
+ * @param evidence Unique identifier of the evidence (ev_…).
2243
+ * @see GET /v1/evidence/{evidence} (operation `retrieveEvidence`, scope `evidence:read`)
2244
+ */
2245
+ retrieve(evidence, options) {
2246
+ return this._request(OPERATIONS.retrieveEvidence, [evidence], undefined, options);
2247
+ }
2248
+ /**
2249
+ * Download evidence content.
2250
+ *
2251
+ * The raw stored bytes (screenshot, HTML, raw email…). The X-Evidence-Sha256 header carries the hash to check.
2252
+ *
2253
+ * @param evidence Unique identifier of the evidence (ev_…).
2254
+ * @see GET /v1/evidence/{evidence}/content (operation `downloadEvidenceContent`, scope `evidence:read`)
2255
+ */
2256
+ downloadContent(evidence, options) {
2257
+ return this._request(OPERATIONS.downloadEvidenceContent, [evidence], undefined, options);
2258
+ }
2259
+ /**
2260
+ * Verify the evidence chain.
2261
+ *
2262
+ * Re-reads and re-hashes every evidence record of the site and checks the hash chain and signed anchors.
2263
+ *
2264
+ * @param site Unique identifier of the site (site_…).
2265
+ * @see POST /v1/sites/{site}/evidence/verify (operation `verifyEvidenceChain`, scope `evidence:read`)
2266
+ */
2267
+ verifyChain(site, params, options) {
2268
+ return this._request(OPERATIONS.verifyEvidenceChain, [site], params, options);
2269
+ }
2270
+ }
2271
+ /** `checkbox.certificates` */
2272
+ export class CertificatesResource extends Resource {
2273
+ /**
2274
+ * List certificates.
2275
+ *
2276
+ * Certificates newest first, optionally for one site.
2277
+ *
2278
+ * @see GET /v1/certificates (operation `listCertificates`, scope `certificates:read`)
2279
+ */
2280
+ list(params, options) {
2281
+ return this._list(OPERATIONS.listCertificates, [], params, options);
2282
+ }
2283
+ /**
2284
+ * Retrieve a certificate.
2285
+ *
2286
+ * One certificate with its verification URL and badge embed code.
2287
+ *
2288
+ * @param certificate Unique identifier of the certificate (cert_…).
2289
+ * @see GET /v1/certificates/{certificate} (operation `retrieveCertificate`, scope `certificates:read`)
2290
+ */
2291
+ retrieve(certificate, options) {
2292
+ return this._request(OPERATIONS.retrieveCertificate, [certificate], undefined, options);
2293
+ }
2294
+ /**
2295
+ * Issue a certificate.
2296
+ *
2297
+ * Issues a signed monitoring certificate once the site has been insurable for the required streak of days with a verified domain and fresh scans. Otherwise fails with resource_conflict and next_action describing what is missing.
2298
+ *
2299
+ * @param site Unique identifier of the site (site_…).
2300
+ * @see POST /v1/sites/{site}/certificates (operation `createCertificate`, scope `certificates:write`, live mode needs an activated account)
2301
+ */
2302
+ create(site, params, options) {
2303
+ return this._request(OPERATIONS.createCertificate, [site], params, options);
2304
+ }
2305
+ /**
2306
+ * Revoke a certificate.
2307
+ *
2308
+ * Revokes an active certificate. The reason stays private; the verification page shows "revoked by merchant".
2309
+ *
2310
+ * @param certificate Unique identifier of the certificate (cert_…).
2311
+ * @see POST /v1/certificates/{certificate}/revoke (operation `revokeCertificate`, scope `certificates:write`)
2312
+ */
2313
+ revoke(certificate, params, options) {
2314
+ return this._request(OPERATIONS.revokeCertificate, [certificate], params, options);
2315
+ }
2316
+ }
2317
+ /** `checkbox.noticeSettings` */
2318
+ export class NoticeSettingsResource extends Resource {
2319
+ /**
2320
+ * Retrieve notice settings.
2321
+ *
2322
+ * Who sends the site's required emails (mode), the BCC address, which notices Checkbox sends in checkbox mode, and what to do next (next_action).
2323
+ *
2324
+ * @param site Unique identifier of the site (site_…).
2325
+ * @see GET /v1/sites/{site}/notice_settings (operation `retrieveNoticeSettings`, scope `notices:read`)
2326
+ */
2327
+ retrieve(site, options) {
2328
+ return this._request(OPERATIONS.retrieveNoticeSettings, [site], undefined, options);
2329
+ }
2330
+ /**
2331
+ * Update notice settings.
2332
+ *
2333
+ * Chooses who sends the required emails (mode: merchant = you send them and Checkbox tracks them, the default; checkbox = Checkbox sends them), and sets branding, cancel_url and the confirmed cancellation policy. In checkbox mode, turning a notice on (enabled_kinds) requires cancel_url, a confirmed policy, a connected Stripe or Recharge account and a sending address; otherwise resource_conflict explains what is missing.
2334
+ *
2335
+ * @param site Unique identifier of the site (site_…).
2336
+ * @see POST /v1/sites/{site}/notice_settings (operation `updateNoticeSettings`, scope `notices:write`, live mode needs an activated account)
2337
+ */
2338
+ update(site, params, options) {
2339
+ return this._request(OPERATIONS.updateNoticeSettings, [site], params, options);
2340
+ }
2341
+ }
2342
+ /** `checkbox.notices` */
2343
+ export class NoticesResource extends Resource {
2344
+ /**
2345
+ * List due notices.
2346
+ *
2347
+ * The legally required emails you owe subscribers (sites in "You send" mode, the default): kind, the subscriber (billing-platform ids), the legal window for the subscriber's state, the recommended send date, the copy-ready email and the BCC address. Default: everything not yet sent (upcoming, due, overdue), soonest first. Live keys list live subscribers' notices, test keys test-mode ones. Send each one on its send_date (inside its window), then call markNoticeSent (or BCC the notice's bcc address). Subscribe to the notice.due webhook to get each one on its send date.
2348
+ *
2349
+ * @see GET /v1/notices/due (operation `listDueNotices`, scope `notices:read`)
2350
+ */
2351
+ listDue(params, options) {
2352
+ return this._list(OPERATIONS.listDueNotices, [], params, options);
2353
+ }
2354
+ /**
2355
+ * List notice email templates.
2356
+ *
2357
+ * Copy-ready HTML + text templates for every required notice (acknowledgment with and without a trial, trial ending, renewal, yearly terms, price change, cancellation confirmation), with {{merge_fields}}. Each passes the preflight email check for its kind when filled. Pass ?site= to get each kind's BCC address too. Adapt one, then call checkNoticeTemplate.
2358
+ *
2359
+ * @see GET /v1/notices/templates (operation `listNoticeTemplates`, scope `notices:read`)
2360
+ */
2361
+ listTemplates(params, options) {
2362
+ return this._request(OPERATIONS.listNoticeTemplates, [], params, options);
2363
+ }
2364
+ /**
2365
+ * Check a notice email template.
2366
+ *
2367
+ * Checks your own version of a notice email: Checkbox fills the merge fields with the site's plan, brand and cancel URL (sample dates), then runs the preflight email check for the kind across the site's jurisdictions. Stateless. Fix what fails (or start from listNoticeTemplates) and check again until verdict is pass.
2368
+ *
2369
+ * @see POST /v1/notices/templates/check (operation `checkNoticeTemplate`, scope `notices:read`)
2370
+ */
2371
+ checkTemplate(params, options) {
2372
+ return this._request(OPERATIONS.checkNoticeTemplate, [], params, options);
2373
+ }
2374
+ /**
2375
+ * Retrieve a due notice.
2376
+ *
2377
+ * One notice you owe a subscriber, with its window, recommended send date, copy-ready email, BCC address and send status.
2378
+ *
2379
+ * @param notice Unique identifier of the due notice (ntd_…).
2380
+ * @see GET /v1/notices/{notice} (operation `retrieveDueNotice`, scope `notices:read`)
2381
+ */
2382
+ retrieve(notice, options) {
2383
+ return this._request(OPERATIONS.retrieveDueNotice, [notice], undefined, options);
2384
+ }
2385
+ /**
2386
+ * Mark a due notice as sent.
2387
+ *
2388
+ * Records that you sent this notice (optionally with your email provider's message id). Idempotent: a notice already marked sent is returned unchanged. A send before window_start is refused (it does not satisfy the law: send again inside the window). An overdue notice marked sent stops failing its check and is recorded as late; a sent_at earlier than when it became overdue is refused (only the BCC copy can prove an in-window send). Canceled and missed notices cannot be marked. BCC'ing the notice's bcc address does the same with the email itself as evidence.
2389
+ *
2390
+ * @param notice Unique identifier of the due notice (ntd_…).
2391
+ * @see POST /v1/notices/{notice}/sent (operation `markNoticeSent`, scope `notices:write`)
2392
+ */
2393
+ markSent(notice, params, options) {
2394
+ return this._request(OPERATIONS.markNoticeSent, [notice], params, options);
2395
+ }
2396
+ /**
2397
+ * Record a due notice as missed.
2398
+ *
2399
+ * Records that an overdue notice was not sent and will not be (for example, the subscriber already left). Nothing is attested as sent: the notice moves to missed and stops failing its compliance check, and the record stays in the history. Only overdue notices can be recorded as missed. Idempotent.
2400
+ *
2401
+ * @param notice Unique identifier of the due notice (ntd_…).
2402
+ * @see POST /v1/notices/{notice}/missed (operation `markNoticeMissed`, scope `notices:write`)
2403
+ */
2404
+ markMissed(notice, params, options) {
2405
+ return this._request(OPERATIONS.markNoticeMissed, [notice], params, options);
2406
+ }
2407
+ }
2408
+ /** `checkbox.lawUpdates` */
2409
+ export class LawUpdatesResource extends Resource {
2410
+ /**
2411
+ * List law updates.
2412
+ *
2413
+ * Law changes newest first, each with its effect on this account's sites.
2414
+ *
2415
+ * @see GET /v1/law_updates (operation `listLawUpdates`, scope `law_updates:read`)
2416
+ */
2417
+ list(params, options) {
2418
+ return this._list(OPERATIONS.listLawUpdates, [], params, options);
2419
+ }
2420
+ /**
2421
+ * Retrieve a law update.
2422
+ *
2423
+ * One law change with its effect on this account's sites.
2424
+ *
2425
+ * @param lawUpdate Unique identifier of the law update (law_…).
2426
+ * @see GET /v1/law_updates/{law_update} (operation `retrieveLawUpdate`, scope `law_updates:read`)
2427
+ */
2428
+ retrieve(lawUpdate, options) {
2429
+ return this._request(OPERATIONS.retrieveLawUpdate, [lawUpdate], undefined, options);
2430
+ }
2431
+ }
2432
+ /** `checkbox.checks` */
2433
+ export class ChecksResource extends Resource {
2434
+ /**
2435
+ * Check checkout disclosure text.
2436
+ *
2437
+ * Checks the automatic-renewal disclosure you are about to show next to a subscribe button: what it says (renewal until canceled, price, frequency, trial, term, how to cancel), where it sits (above the button, same page) and how it looks (size, contrast, set off), and the consent checkbox (present, not pre-checked). Returns the verdict per check and per legal requirement, plus `replacement`: compliant text and drop-in HTML generated from your price/interval/trial/cancel_url and verified by the engine. Call it whenever you write or change checkout copy. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2438
+ *
2439
+ * @see POST /v1/checks/disclosure (operation `checkDisclosure`, scope `checks:read`)
2440
+ */
2441
+ disclosure(params, options) {
2442
+ return this._request(OPERATIONS.checkDisclosure, [], params, options);
2443
+ }
2444
+ /**
2445
+ * Check Stripe Checkout Session params.
2446
+ *
2447
+ * Pass exactly the object your code gives stripe.checkout.sessions.create (plus merchant.merchant_name and merchant.cancel_url, and merchant.price/interval when line_items use a Price id). Checkbox models the Stripe-hosted page those params render and returns findings plus `correction`: a JSON Patch (RFC 6902) and the full corrected params (custom_text.submit with the renewal terms, consent_collection.terms_of_service = "required", custom_text.terms_of_service_acceptance as the consent label), verified by the engine. Stripe's own small grey styling keeps "clear and conspicuous" at needs_review on any Stripe-hosted page; also show the terms on your page before redirecting. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2448
+ *
2449
+ * @see POST /v1/checks/stripe_checkout_session (operation `checkStripeCheckoutSession`, scope `checks:read`)
2450
+ */
2451
+ stripeCheckoutSession(params, options) {
2452
+ return this._request(OPERATIONS.checkStripeCheckoutSession, [], params, options);
2453
+ }
2454
+ /**
2455
+ * Check Stripe Payment Link params.
2456
+ *
2457
+ * Like checkStripeCheckoutSession, for stripe.paymentLinks.create params or a retrieved Payment Link object. For an existing link (params.id) the correction also gives update_params for stripe.paymentLinks.update (same URL); Stripe cannot add a consent checkbox to an existing link, so needs_new_link_for_consent says when a new link (corrected_params) is required. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2458
+ *
2459
+ * @see POST /v1/checks/stripe_payment_link (operation `checkStripePaymentLink`, scope `checks:read`)
2460
+ */
2461
+ stripePaymentLink(params, options) {
2462
+ return this._request(OPERATIONS.checkStripePaymentLink, [], params, options);
2463
+ }
2464
+ /**
2465
+ * Check a subscription lifecycle email.
2466
+ *
2467
+ * Checks the content of an acknowledgment (welcome) email, trial-ending reminder, renewal reminder, price-change notice, yearly terms reminder or cancellation confirmation against the requirements for that notice (renewal terms, amount, frequency, how to cancel, trial cancellation). The email is modelled as sent on time, so the verdict is about content; get send dates from checkNoticeSchedule. Returns `required_by` (requirements that make the email mandatory for this plan) and a compliant `template` with {{merge_tags}}, verified by the engine. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2468
+ *
2469
+ * @see POST /v1/checks/email (operation `checkEmail`, scope `checks:read`)
2470
+ */
2471
+ email(params, options) {
2472
+ return this._request(OPERATIONS.checkEmail, [], params, options);
2473
+ }
2474
+ /**
2475
+ * Check a checkout page (HTML or URL).
2476
+ *
2477
+ * Reads a checkout page's HTML (send the rendered HTML of client-side apps) with Checkbox's static extractor — purchase buttons, terms blocks, consent checkboxes, terms links — and runs the sign-up checks on it. Without a browser, placement and conspicuousness are estimates: a passing estimate is reported as needs_review (with static_estimate), never as pass; install the snippet or run a scan after deploying for rendered measurements. `url` (instead of html) fetches a public page and needs a live-mode key on an activated account. Pass terms to compare the disclosed price with your real one and get a verified replacement. Stateless and deterministic: nothing is stored, the same input on the same as_of date gives the same verdicts. Every verdict comes from the Checkbox rules engine over the legal catalog (federal ROSCA / EFTA plus the state automatic-renewal laws); the response carries rules_version, catalog_version and a disclaimer (not legal advice). Read `verdict`, then `next_action`: it tells you exactly what to change and to call the check again until verdict is pass.
2478
+ *
2479
+ * @see POST /v1/checks/page (operation `checkPage`, scope `checks:read`)
2480
+ */
2481
+ page(params, options) {
2482
+ return this._request(OPERATIONS.checkPage, [], params, options);
2483
+ }
2484
+ /**
2485
+ * Get the dates each required notice must be sent.
2486
+ *
2487
+ * For a subscription plan (price, interval, trial) and where you sell, returns every legally required notice — acknowledgment, trial-ending reminder, renewal reminders, yearly terms reminder, price-change notice — with the recommended send time and the compliant window (opens / closes), the jurisdictions each send satisfies and the citations. Uses the same timing as Checkbox Notices: per-state windows intersected, or the fewest sends that cover conflicting windows. Stateless. Check each email's content with checkEmail, or let Checkbox Notices send them.
2488
+ *
2489
+ * @see POST /v1/checks/notice_schedule (operation `checkNoticeSchedule`, scope `checks:read`)
2490
+ */
2491
+ noticeSchedule(params, options) {
2492
+ return this._request(OPERATIONS.checkNoticeSchedule, [], params, options);
2493
+ }
2494
+ }
2495
+ /** `checkbox.elements` */
2496
+ export class ElementsResource extends Resource {
2497
+ /**
2498
+ * Load the Elements browser bundle.
2499
+ *
2500
+ * The current elements.js (registers <checkbox-disclosure>). For production pin a version with SRI: use the script_tag from getElementsManifest or createDisclosure.
2501
+ *
2502
+ * @see GET /v1/elements.js (operation `getElementsBundle`, scope `none`)
2503
+ */
2504
+ retrieveBundle(options) {
2505
+ return this._request(OPERATIONS.getElementsBundle, [], undefined, options);
2506
+ }
2507
+ /**
2508
+ * List Elements bundle versions and SRI hashes.
2509
+ *
2510
+ * Released elements.js versions with their immutable URLs and Subresource Integrity hashes, plus a ready-to-paste script tag for the latest one.
2511
+ *
2512
+ * @see GET /v1/elements/manifest.json (operation `getElementsManifest`, scope `none`)
2513
+ */
2514
+ retrieveManifest(options) {
2515
+ return this._request(OPERATIONS.getElementsManifest, [], undefined, options);
2516
+ }
2517
+ /**
2518
+ * Load a pinned Elements bundle version.
2519
+ *
2520
+ * An immutable elements.js release (cached for a year). Its integrity hash is in getElementsManifest.
2521
+ *
2522
+ * @param versionId Semver, e.g. 1.0.0.
2523
+ * @see GET /v1/elements/{version}/elements.js (operation `getElementsBundleVersion`, scope `none`)
2524
+ */
2525
+ retrieveBundleVersion(versionId, options) {
2526
+ return this._request(OPERATIONS.getElementsBundleVersion, [versionId], undefined, options);
2527
+ }
2528
+ }
2529
+ /** `checkbox.disclosures` */
2530
+ export class DisclosuresResource extends Resource {
2531
+ /**
2532
+ * Create a locked disclosure for a site.
2533
+ *
2534
+ * Generates the locked automatic-renewal disclosure and consent label for the site's terms (from the billing connection, the given terms, or both), verifies with the rules engine that the element passes the sign-up checks on your checkout, and returns the markup to paste above your pay button. Next: put script_tag in <head> and element_html directly above the pay button, then call listConsents after a test sign-up.
2535
+ *
2536
+ * @see POST /v1/disclosures (operation `createDisclosure`, scope `consents:write`)
2537
+ */
2538
+ create(params, options) {
2539
+ return this._request(OPERATIONS.createDisclosure, [], params, options);
2540
+ }
2541
+ /**
2542
+ * Retrieve a disclosure.
2543
+ *
2544
+ * The locked disclosure text, consent label and terms. Works with the publishable key from the site's own pages (this is how <checkbox-disclosure disclosure="disc_…"> loads its text).
2545
+ *
2546
+ * @param disclosure Unique identifier of the disclosure (disc_…).
2547
+ * @see GET /v1/disclosures/{disclosure} (operation `retrieveDisclosure`, scope `publishable`)
2548
+ */
2549
+ retrieve(disclosure, options) {
2550
+ return this._request(OPERATIONS.retrieveDisclosure, [disclosure], undefined, options);
2551
+ }
2552
+ }
2553
+ /** `checkbox.consents` */
2554
+ export class ConsentsResource extends Resource {
2555
+ /**
2556
+ * Record a consent.
2557
+ *
2558
+ * Records that a subscriber ticked the consent checkbox for the exact disclosure shown: stored with the text, its hashes, the terms, the page, a hash of the user agent and your customer reference, written to the site's hash-chained evidence vault, and fed to the compliance evaluation as corroborating evidence. <checkbox-disclosure> calls this with the publishable key (Origin-checked); servers may call it with a secret key and site. Next: attach the returned cons_… id to the subscription (metadata.checkbox_consent) or call updateConsent.
2559
+ *
2560
+ * @see POST /v1/consents (operation `createConsent`, scope `publishable`)
2561
+ */
2562
+ create(params, options) {
2563
+ return this._request(OPERATIONS.createConsent, [], params, options);
2564
+ }
2565
+ /**
2566
+ * List consents.
2567
+ *
2568
+ * Consents, newest first. Filter by site, customer_reference (e.g. find the consent behind a disputed Stripe subscription), disclosure or creation time.
2569
+ *
2570
+ * @see GET /v1/consents (operation `listConsents`, scope `consents:read`)
2571
+ */
2572
+ list(params, options) {
2573
+ return this._list(OPERATIONS.listConsents, [], params, options);
2574
+ }
2575
+ /**
2576
+ * Retrieve a consent.
2577
+ *
2578
+ * A consent record: what the subscriber saw and agreed to, when, where, and its evidence record. Use it to answer a chargeback or a regulator: the evidence id verifies against the site's hash chain (verifyEvidenceChain) and downloads with downloadEvidenceContent.
2579
+ *
2580
+ * @param consent Unique identifier of the consent (cons_…).
2581
+ * @see GET /v1/consents/{consent} (operation `retrieveConsent`, scope `consents:read`)
2582
+ */
2583
+ retrieve(consent, options) {
2584
+ return this._request(OPERATIONS.retrieveConsent, [consent], undefined, options);
2585
+ }
2586
+ /**
2587
+ * Attach a customer reference to a consent.
2588
+ *
2589
+ * Sets customer_reference once (e.g. the Stripe subscription id created after the consent) and merges metadata. A different reference on a consent that already has one answers 409 consent_reference_locked. The change is appended to the evidence chain.
2590
+ *
2591
+ * @param consent Unique identifier of the consent (cons_…).
2592
+ * @see POST /v1/consents/{consent} (operation `updateConsent`, scope `consents:write`)
2593
+ */
2594
+ update(consent, params, options) {
2595
+ return this._request(OPERATIONS.updateConsent, [consent], params, options);
2596
+ }
2597
+ }
2598
+ /** `checkbox.receiptTokens` */
2599
+ export class ReceiptTokensResource extends Resource {
2600
+ /**
2601
+ * Mint a capture token for a checkout.
2602
+ *
2603
+ * Call from your server when you render a checkout page: returns a short-lived token (rct_…) to put into the page (data-receipt-token on the disclosure or form, or receipt-token on <checkbox-disclosure>). Receipts that present it are "bound" to this checkout and carry your customer_reference; receipts without one are accepted but flagged "unbound". For Stripe-hosted checkouts also set metadata.checkbox_receipt_token=<id> on the Checkout Session (or pass checkout_session here).
2604
+ *
2605
+ * @see POST /v1/receipt_tokens (operation `createReceiptToken`, scope `receipts:write`)
2606
+ */
2607
+ create(params, options) {
2608
+ return this._request(OPERATIONS.createReceiptToken, [], params, options);
2609
+ }
2610
+ }
2611
+ /** `checkbox.receipts` */
2612
+ export class ReceiptsResource extends Resource {
2613
+ /**
2614
+ * Record a consent receipt.
2615
+ *
2616
+ * Records one receipt from the structured snapshot the browser captured at submit (the /r.js snippet add-on calls this with the publishable key, Origin-checked; servers may call it with a secret key and site). The snapshot is validated strictly and re-sanitized. Next: retrieveReceipt / renderReceipt to see it, verifyReceipt to check its integrity.
2617
+ *
2618
+ * @see POST /v1/receipts (operation `createReceipt`, scope `publishable`)
2619
+ */
2620
+ create(params, options) {
2621
+ return this._request(OPERATIONS.createReceipt, [], params, options);
2622
+ }
2623
+ /**
2624
+ * List consent receipts.
2625
+ *
2626
+ * Receipts newest first. Filter by site, customer_reference (find the receipt behind a disputed subscription), checkout_session, email (hashed before the lookup), source, binding or creation time.
2627
+ *
2628
+ * @see GET /v1/receipts (operation `listReceipts`, scope `receipts:read`)
2629
+ */
2630
+ list(params, options) {
2631
+ return this._list(OPERATIONS.listReceipts, [], params, options);
2632
+ }
2633
+ /**
2634
+ * Erase a subscriber's receipts.
2635
+ *
2636
+ * For a subscriber's deletion request: deletes every receipt that matches customer_reference, email (hashed before the lookup) or checkout_session (optionally only for one site). The signed copy in the write-once evidence vault is kept but holds only a salted commitment to the subscriber's identifiers; erasing destroys the salt, so it can no longer be tied to the person. Pending attorney review.
2637
+ *
2638
+ * @see POST /v1/receipts/erase (operation `eraseReceipts`, scope `receipts:write`)
2639
+ */
2640
+ erase(params, options) {
2641
+ return this._request(OPERATIONS.eraseReceipts, [], params, options);
2642
+ }
2643
+ /**
2644
+ * Retrieve a consent receipt.
2645
+ *
2646
+ * What one subscriber saw and agreed to at checkout: disclosure text and presentation, checkbox state and label, button label, page, time, binding, flags and integrity data. renderReceipt shows it as an image; exportReceipt downloads a self-verifying bundle.
2647
+ *
2648
+ * @param receipt Unique identifier of the receipt (rcpt_…).
2649
+ * @see GET /v1/receipts/{receipt} (operation `retrieveReceipt`, scope `receipts:read`)
2650
+ */
2651
+ retrieve(receipt, options) {
2652
+ return this._request(OPERATIONS.retrieveReceipt, [receipt], undefined, options);
2653
+ }
2654
+ /**
2655
+ * Render a receipt as an image.
2656
+ *
2657
+ * A PNG of "what the subscriber saw", rendered on demand in an isolated Chromium (no network, scripts disabled) from the sanitized snapshot — a reconstruction, labeled as such, not a screenshot taken from the browser.
2658
+ *
2659
+ * @param receipt Unique identifier of the receipt (rcpt_…).
2660
+ * @see GET /v1/receipts/{receipt}/render.png (operation `renderReceipt`, scope `receipts:read`)
2661
+ */
2662
+ render(receipt, options) {
2663
+ return this._request(OPERATIONS.renderReceipt, [receipt], undefined, options);
2664
+ }
2665
+ /**
2666
+ * Verify a receipt's integrity.
2667
+ *
2668
+ * Re-hashes the stored receipt, checks Checkbox's Ed25519 signature over its hash and chain position, and verifies the site's evidence chain. For a check that does not rely on Checkbox, download exportReceipt and run its verify.mjs.
2669
+ *
2670
+ * @param receipt Unique identifier of the receipt (rcpt_…).
2671
+ * @see GET /v1/receipts/{receipt}/verify (operation `verifyReceipt`, scope `receipts:read`)
2672
+ */
2673
+ verify(receipt, options) {
2674
+ return this._request(OPERATIONS.verifyReceipt, [receipt], undefined, options);
2675
+ }
2676
+ /**
2677
+ * Download a self-verifying receipt bundle.
2678
+ *
2679
+ * ZIP for a lawyer, insurer or court expert: manifest.json (the receipt's evidence record with its chain links) + manifest.sig.json, the canonical receipt JSON under records/, receipt.sig.json (Checkbox's signature over the receipt hash), receipt.png and render.html (the reconstruction), README.md and verify.mjs (zero-dependency offline verifier: node verify.mjs --keys checkbox-keys.json).
2680
+ *
2681
+ * @param receipt Unique identifier of the receipt (rcpt_…).
2682
+ * @see GET /v1/receipts/{receipt}/export (operation `exportReceipt`, scope `receipts:read`)
2683
+ */
2684
+ export(receipt, options) {
2685
+ return this._request(OPERATIONS.exportReceipt, [receipt], undefined, options);
2686
+ }
2687
+ }
2688
+ /** `checkbox.receiptSettings` */
2689
+ export class ReceiptSettingsResource extends Resource {
2690
+ /**
2691
+ * Retrieve receipt settings.
2692
+ *
2693
+ * Whether consent receipts are collected for this account (in this mode) and how long they are kept.
2694
+ *
2695
+ * @see GET /v1/receipt_settings (operation `retrieveReceiptSettings`, scope `receipts:read`)
2696
+ */
2697
+ retrieve(options) {
2698
+ return this._request(OPERATIONS.retrieveReceiptSettings, [], undefined, options);
2699
+ }
2700
+ /**
2701
+ * Update receipt settings.
2702
+ *
2703
+ * Turn receipts on or off and set the retention in days (default 1461 = 4 years, the California UCL limitation period; pending attorney review). A new retention applies to receipts recorded afterwards.
2704
+ *
2705
+ * @see POST /v1/receipt_settings (operation `updateReceiptSettings`, scope `receipts:write`)
2706
+ */
2707
+ update(params, options) {
2708
+ return this._request(OPERATIONS.updateReceiptSettings, [], params, options);
2709
+ }
2710
+ }
2711
+ /** `checkbox.testCredentials` */
2712
+ export class TestCredentialsResource extends Resource {
2713
+ /**
2714
+ * Store a billing test-mode key.
2715
+ *
2716
+ * Stores the site's Stripe TEST-mode key (rk_test_… preferred) used by test runs, after checking it with Stripe. Live keys are refused (test_key_not_test_mode). Least privilege: Write on Customers, Checkout Sessions, Subscriptions, Test clocks and Customer portal; Read on Prices, Products and Billing portal configuration. Replaces an existing key. Next: createTestRun.
2717
+ *
2718
+ * @param site Unique identifier of the site (site_…).
2719
+ * @see POST /v1/sites/{site}/test_credentials (operation `createTestCredential`, scope `test_runs:write`)
2720
+ */
2721
+ create(site, params, options) {
2722
+ return this._request(OPERATIONS.createTestCredential, [site], params, options);
2723
+ }
2724
+ /**
2725
+ * List billing test-mode keys of a site.
2726
+ *
2727
+ * The site's stored test-mode keys (hints only).
2728
+ *
2729
+ * @param site Unique identifier of the site (site_…).
2730
+ * @see GET /v1/sites/{site}/test_credentials (operation `listTestCredentials`, scope `test_runs:read`)
2731
+ */
2732
+ list(site, options) {
2733
+ return this._request(OPERATIONS.listTestCredentials, [site], undefined, options);
2734
+ }
2735
+ /**
2736
+ * Delete a billing test-mode key.
2737
+ *
2738
+ * Deletes the stored key. Running test runs fail at their next Stripe call.
2739
+ *
2740
+ * @param site Unique identifier of the site (site_…).
2741
+ * @param testCredential Unique identifier of the test credential (tcred_…).
2742
+ * @see DELETE /v1/sites/{site}/test_credentials/{test_credential} (operation `deleteTestCredential`, scope `test_runs:write`)
2743
+ */
2744
+ del(site, testCredential, options) {
2745
+ return this._request(OPERATIONS.deleteTestCredential, [site, testCredential], undefined, options);
2746
+ }
2747
+ /** Alias of `del()`. */
2748
+ delete(site, testCredential, options) {
2749
+ return this.del(site, testCredential, options);
2750
+ }
2751
+ }
2752
+ /** `checkbox.stripeCheckoutConfigs` */
2753
+ export class StripeCheckoutConfigsResource extends Resource {
2754
+ /**
2755
+ * Register the Checkout Session params your code uses.
2756
+ *
2757
+ * Registers exactly the object your code passes to stripe.checkout.sessions.create (customer, URLs and secrets are not needed and are ignored). Test runs mirror it into Stripe test mode; when it matches your latest live checkout, the scanned test page counts as an observation of your live checkout. Re-register after changing your checkout code, then call createTestRun.
2758
+ *
2759
+ * @param site Unique identifier of the site (site_…).
2760
+ * @see POST /v1/sites/{site}/stripe_checkout_configs (operation `createStripeCheckoutConfig`, scope `test_runs:write`)
2761
+ */
2762
+ create(site, params, options) {
2763
+ return this._request(OPERATIONS.createStripeCheckoutConfig, [site], params, options);
2764
+ }
2765
+ /**
2766
+ * List registered checkout configs.
2767
+ *
2768
+ * Registered Checkout Session configs of the site, newest first (test runs mirror the newest by default).
2769
+ *
2770
+ * @param site Unique identifier of the site (site_…).
2771
+ * @see GET /v1/sites/{site}/stripe_checkout_configs (operation `listStripeCheckoutConfigs`, scope `test_runs:read`)
2772
+ */
2773
+ list(site, params, options) {
2774
+ return this._list(OPERATIONS.listStripeCheckoutConfigs, [site], params, options);
2775
+ }
2776
+ /**
2777
+ * Retrieve a registered checkout config.
2778
+ *
2779
+ * One registered Checkout Session config.
2780
+ *
2781
+ * @param stripeCheckoutConfig Unique identifier of the stripe checkout config (scc_…).
2782
+ * @see GET /v1/stripe_checkout_configs/{stripe_checkout_config} (operation `retrieveStripeCheckoutConfig`, scope `test_runs:read`)
2783
+ */
2784
+ retrieve(stripeCheckoutConfig, options) {
2785
+ return this._request(OPERATIONS.retrieveStripeCheckoutConfig, [stripeCheckoutConfig], undefined, options);
2786
+ }
2787
+ /**
2788
+ * Delete a registered checkout config.
2789
+ *
2790
+ * Deletes the config; later runs mirror the next newest one (or your live checkout).
2791
+ *
2792
+ * @param stripeCheckoutConfig Unique identifier of the stripe checkout config (scc_…).
2793
+ * @see DELETE /v1/stripe_checkout_configs/{stripe_checkout_config} (operation `deleteStripeCheckoutConfig`, scope `test_runs:write`)
2794
+ */
2795
+ del(stripeCheckoutConfig, options) {
2796
+ return this._request(OPERATIONS.deleteStripeCheckoutConfig, [stripeCheckoutConfig], undefined, options);
2797
+ }
2798
+ /** Alias of `del()`. */
2799
+ delete(stripeCheckoutConfig, options) {
2800
+ return this.del(stripeCheckoutConfig, options);
2801
+ }
2802
+ }
2803
+ /** `checkbox.testRuns` */
2804
+ export class TestRunsResource extends Resource {
2805
+ /**
2806
+ * Start a lifecycle test run.
2807
+ *
2808
+ * Starts a synthetic test subscription in TEST mode and returns it queued. Stripe runs mirror your checkout into a test-mode Checkout Session, subscribe a test customer (card 4242) whose email is a Checkbox inbox, wait for your acknowledgment, advance a test clock through every legal notice window before trial end and renewal, cancel online in the customer portal and wait for the confirmation; then delete the test clock. Takes about 5-20 minutes: poll retrieveTestRun (next_action says when) or listen for test_run.completed. Each step reports observations, check results and agent-readable fixes; apply them and run again to verify.
2809
+ *
2810
+ * @param site Unique identifier of the site (site_…).
2811
+ * @see POST /v1/sites/{site}/test_runs (operation `createTestRun`, scope `test_runs:write`, live mode needs an activated account)
2812
+ */
2813
+ create(site, params, options) {
2814
+ return this._request(OPERATIONS.createTestRun, [site], params, options);
2815
+ }
2816
+ /**
2817
+ * List test runs of a site.
2818
+ *
2819
+ * Test runs of the site, newest first.
2820
+ *
2821
+ * @param site Unique identifier of the site (site_…).
2822
+ * @see GET /v1/sites/{site}/test_runs (operation `listTestRuns`, scope `test_runs:read`)
2823
+ */
2824
+ list(site, params, options) {
2825
+ return this._list(OPERATIONS.listTestRuns, [site], params, options);
2826
+ }
2827
+ /**
2828
+ * Retrieve a test run.
2829
+ *
2830
+ * The run with every step's status, observations, check results and fixes. While it runs, next_action.type is "wait"; when it finished, next_action says what to fix (apply_fixes / review_warnings) or "none".
2831
+ *
2832
+ * @param testRun Unique identifier of the test run (run_…).
2833
+ * @see GET /v1/test_runs/{test_run} (operation `retrieveTestRun`, scope `test_runs:read`)
2834
+ */
2835
+ retrieve(testRun, options) {
2836
+ return this._request(OPERATIONS.retrieveTestRun, [testRun], undefined, options);
2837
+ }
2838
+ /**
2839
+ * Cancel a test run.
2840
+ *
2841
+ * Stops a queued or running test run; the worker deletes its Stripe test clock (and with it the test customer and subscription). Finished runs cannot be canceled (resource_conflict).
2842
+ *
2843
+ * @param testRun Unique identifier of the test run (run_…).
2844
+ * @see POST /v1/test_runs/{test_run}/cancel (operation `cancelTestRun`, scope `test_runs:write`)
2845
+ */
2846
+ cancel(testRun, options) {
2847
+ return this._request(OPERATIONS.cancelTestRun, [testRun], undefined, options);
2848
+ }
2849
+ }
2850
+ /** `checkbox.webhookEndpoints` */
2851
+ export class WebhookEndpointsResource extends Resource {
2852
+ /**
2853
+ * Create a webhook endpoint.
2854
+ *
2855
+ * Registers an HTTPS endpoint for the given event types. The response contains the signing `secret` (only now). Respond 2xx quickly; do slow work asynchronously.
2856
+ *
2857
+ * @see POST /v1/webhook_endpoints (operation `createWebhookEndpoint`, scope `webhook_endpoints:write`)
2858
+ */
2859
+ create(params, options) {
2860
+ return this._request(OPERATIONS.createWebhookEndpoint, [], params, options);
2861
+ }
2862
+ /**
2863
+ * List webhook endpoints.
2864
+ *
2865
+ * Webhook endpoints of this mode, newest first.
2866
+ *
2867
+ * @see GET /v1/webhook_endpoints (operation `listWebhookEndpoints`, scope `webhook_endpoints:read`)
2868
+ */
2869
+ list(params, options) {
2870
+ return this._list(OPERATIONS.listWebhookEndpoints, [], params, options);
2871
+ }
2872
+ /**
2873
+ * Retrieve a webhook endpoint.
2874
+ *
2875
+ * One webhook endpoint (without its secret).
2876
+ *
2877
+ * @param webhookEndpoint Unique identifier of the webhook endpoint (we_…).
2878
+ * @see GET /v1/webhook_endpoints/{webhook_endpoint} (operation `retrieveWebhookEndpoint`, scope `webhook_endpoints:read`)
2879
+ */
2880
+ retrieve(webhookEndpoint, options) {
2881
+ return this._request(OPERATIONS.retrieveWebhookEndpoint, [webhookEndpoint], undefined, options);
2882
+ }
2883
+ /**
2884
+ * Update a webhook endpoint.
2885
+ *
2886
+ * Changes the URL, event types, description, metadata, or disables / re-enables the endpoint.
2887
+ *
2888
+ * @param webhookEndpoint Unique identifier of the webhook endpoint (we_…).
2889
+ * @see POST /v1/webhook_endpoints/{webhook_endpoint} (operation `updateWebhookEndpoint`, scope `webhook_endpoints:write`)
2890
+ */
2891
+ update(webhookEndpoint, params, options) {
2892
+ return this._request(OPERATIONS.updateWebhookEndpoint, [webhookEndpoint], params, options);
2893
+ }
2894
+ /**
2895
+ * Delete a webhook endpoint.
2896
+ *
2897
+ * Deletes the endpoint; pending deliveries to it are dropped.
2898
+ *
2899
+ * @param webhookEndpoint Unique identifier of the webhook endpoint (we_…).
2900
+ * @see DELETE /v1/webhook_endpoints/{webhook_endpoint} (operation `deleteWebhookEndpoint`, scope `webhook_endpoints:write`)
2901
+ */
2902
+ del(webhookEndpoint, options) {
2903
+ return this._request(OPERATIONS.deleteWebhookEndpoint, [webhookEndpoint], undefined, options);
2904
+ }
2905
+ /** Alias of `del()`. */
2906
+ delete(webhookEndpoint, options) {
2907
+ return this.del(webhookEndpoint, options);
2908
+ }
2909
+ /**
2910
+ * Roll a webhook signing secret.
2911
+ *
2912
+ * Replaces the signing secret immediately and returns the new one (only now).
2913
+ *
2914
+ * @param webhookEndpoint Unique identifier of the webhook endpoint (we_…).
2915
+ * @see POST /v1/webhook_endpoints/{webhook_endpoint}/roll_secret (operation `rollWebhookEndpointSecret`, scope `webhook_endpoints:write`)
2916
+ */
2917
+ rollSecret(webhookEndpoint, params, options) {
2918
+ return this._request(OPERATIONS.rollWebhookEndpointSecret, [webhookEndpoint], params, options);
2919
+ }
2920
+ }
2921
+ /** `checkbox.events` */
2922
+ export class EventsResource extends Resource {
2923
+ /**
2924
+ * List events.
2925
+ *
2926
+ * Events newest first. Poll with ending_before=<newest id you have> to get only new events (an alternative to webhooks).
2927
+ *
2928
+ * @see GET /v1/events (operation `listEvents`, scope `events:read`)
2929
+ */
2930
+ list(params, options) {
2931
+ return this._list(OPERATIONS.listEvents, [], params, options);
2932
+ }
2933
+ /**
2934
+ * Retrieve an event.
2935
+ *
2936
+ * One event with its payload (data.object) and the number of webhook deliveries still pending.
2937
+ *
2938
+ * @param event Unique identifier of the event (evt_…).
2939
+ * @see GET /v1/events/{event} (operation `retrieveEvent`, scope `events:read`)
2940
+ */
2941
+ retrieve(event, options) {
2942
+ return this._request(OPERATIONS.retrieveEvent, [event], undefined, options);
2943
+ }
2944
+ }
2945
+ /** `checkbox.feedbacks` */
2946
+ export class FeedbacksResource extends Resource {
2947
+ /**
2948
+ * Send feedback.
2949
+ *
2950
+ * Report a problem or a missing feature in Checkbox. Include what you tried, what happened and what you expected, and the site / request id when there is one. The Checkbox team reads every message. Rate limited to 20 per key per hour.
2951
+ *
2952
+ * @see POST /v1/feedback (operation `createFeedback`, scope `account:read`)
2953
+ */
2954
+ create(params, options) {
2955
+ return this._request(OPERATIONS.createFeedback, [], params, options);
2956
+ }
2957
+ }
2958
+ /** Resource namespaces of the client. */
2959
+ export const RESOURCES = {
2960
+ device: DeviceResource,
2961
+ setupSessions: SetupSessionsResource,
2962
+ account: AccountResource,
2963
+ sites: SitesResource,
2964
+ domainVerifications: DomainVerificationsResource,
2965
+ scans: ScansResource,
2966
+ evaluations: EvaluationsResource,
2967
+ findings: FindingsResource,
2968
+ plans: PlansResource,
2969
+ tasks: TasksResource,
2970
+ verifications: VerificationsResource,
2971
+ fixes: FixesResource,
2972
+ evidence: EvidenceResource,
2973
+ certificates: CertificatesResource,
2974
+ noticeSettings: NoticeSettingsResource,
2975
+ notices: NoticesResource,
2976
+ lawUpdates: LawUpdatesResource,
2977
+ checks: ChecksResource,
2978
+ elements: ElementsResource,
2979
+ disclosures: DisclosuresResource,
2980
+ consents: ConsentsResource,
2981
+ receiptTokens: ReceiptTokensResource,
2982
+ receipts: ReceiptsResource,
2983
+ receiptSettings: ReceiptSettingsResource,
2984
+ testCredentials: TestCredentialsResource,
2985
+ stripeCheckoutConfigs: StripeCheckoutConfigsResource,
2986
+ testRuns: TestRunsResource,
2987
+ webhookEndpoints: WebhookEndpointsResource,
2988
+ events: EventsResource,
2989
+ feedbacks: FeedbacksResource,
2990
+ };