@checkbox-site/node 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +35 -1
- package/dist/client.js +3 -2
- package/dist/generated/operations.d.ts +72 -7
- package/dist/generated/operations.js +66 -7
- package/dist/generated/types.d.ts +586 -55
- package/dist/generated/types.js +1 -1
- package/dist/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -96,6 +96,8 @@ export interface DeviceAuthorizationParams {
|
|
|
96
96
|
package_manager?: string;
|
|
97
97
|
/** Detected billing platform. */
|
|
98
98
|
billing_platform?: string;
|
|
99
|
+
/** Business name (round 3: names the site and workspace instead of the host). */
|
|
100
|
+
merchant_name?: string;
|
|
99
101
|
/** Also ask for live-mode keys (live mode activates after domain verification). */
|
|
100
102
|
live?: boolean;
|
|
101
103
|
/** A HINT of the Stripe TEST key found in the project ("sk_test_…a1b2" — never the key). The human is asked once whether Checkbox may use it for synthetic test subscriptions. */
|
|
@@ -292,8 +294,6 @@ export interface SetupSession {
|
|
|
292
294
|
compliance: {
|
|
293
295
|
/** 0-100. */
|
|
294
296
|
score: number;
|
|
295
|
-
/** No critical/high failure open. */
|
|
296
|
-
insurable: boolean;
|
|
297
297
|
/** When it was evaluated. Unix timestamp in seconds. */
|
|
298
298
|
evaluated: number;
|
|
299
299
|
/** Open failing findings. */
|
|
@@ -487,8 +487,6 @@ export interface Account {
|
|
|
487
487
|
billing: {
|
|
488
488
|
/** Checkbox is free to use. */
|
|
489
489
|
plan: "free";
|
|
490
|
-
/** The compliance warranty is not offered yet (waitlist only; no coverage). */
|
|
491
|
-
warranty: "coming_soon";
|
|
492
490
|
};
|
|
493
491
|
/** When the account was created. Unix timestamp in seconds. */
|
|
494
492
|
created: number;
|
|
@@ -510,6 +508,8 @@ export interface SiteFacts {
|
|
|
510
508
|
notice_channel_email?: boolean;
|
|
511
509
|
/** Price increases need consent or allow a refund (NY). */
|
|
512
510
|
price_increase_consent_or_refund?: boolean;
|
|
511
|
+
/** The billing-platform price this checkout sells (e.g. a Stripe price id). Terms copy and the price cross-check use only this price; without it, a connected price never rewrites Terms copy or reopens a verified task. */
|
|
512
|
+
plan_price_id?: string;
|
|
513
513
|
/** Accepted payment methods (debit / ACH bring in Reg E). */
|
|
514
514
|
payment_methods?: Array<"card" | "debit" | "ach" | "wallet" | "other">;
|
|
515
515
|
}
|
|
@@ -528,18 +528,65 @@ export interface SiteMonitoring {
|
|
|
528
528
|
/** Domains to verify before Checkbox scans the site (first: createDomainVerification for the site's own domain). */
|
|
529
529
|
verify_domains: Array<string>;
|
|
530
530
|
}
|
|
531
|
+
/** A live check Checkbox has not observed yet, and how it completes. */
|
|
532
|
+
export interface PendingLiveCheck {
|
|
533
|
+
/** What has not been observed yet. */
|
|
534
|
+
what: string;
|
|
535
|
+
/** When / how it completes. */
|
|
536
|
+
completes: string;
|
|
537
|
+
/** How it completes: run_proof, bcc_real_sends, wait_for_event, connect_billing, resync_billing, scan, check_rendered_page, register_checkout, publish_policy. */
|
|
538
|
+
action: "run_proof" | "bcc_real_sends" | "wait_for_event" | "connect_billing" | "resync_billing" | "scan" | "check_rendered_page" | "register_checkout" | "publish_policy";
|
|
539
|
+
/** ISO date when it completes on its own (a reminder window), when known. */
|
|
540
|
+
due: string | null;
|
|
541
|
+
}
|
|
542
|
+
/** Roll-up of the user-facing statuses of the required checks. */
|
|
543
|
+
export interface ComplianceRollup {
|
|
544
|
+
/** needs_fix (a required check needs a fix or something is not set up yet), your_call (a decision is needed), incomplete (only "not checked yet" items are left, e.g. the cancel flow was never tried), compliant (pending live checks count as compliant), not_checked (never evaluated). */
|
|
545
|
+
status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
546
|
+
/** Label to show. */
|
|
547
|
+
label: string;
|
|
548
|
+
/** Required checks per user-facing status. */
|
|
549
|
+
counts: {
|
|
550
|
+
/** Required checks that need a fix. */
|
|
551
|
+
needs_fix: number;
|
|
552
|
+
/** Decisions for a person. */
|
|
553
|
+
your_call: number;
|
|
554
|
+
/** Compliant, live check pending. */
|
|
555
|
+
pending_live_check: number;
|
|
556
|
+
/** Verified live. */
|
|
557
|
+
verified_live: number;
|
|
558
|
+
/** Compliant. */
|
|
559
|
+
compliant: number;
|
|
560
|
+
/** Not applicable. */
|
|
561
|
+
not_applicable: number;
|
|
562
|
+
/** Not set up yet (no sign the email or setting exists). */
|
|
563
|
+
not_set_up: number;
|
|
564
|
+
/** Not checked yet (Checkbox has not tried it). */
|
|
565
|
+
not_checked: number;
|
|
566
|
+
};
|
|
567
|
+
/** What each pending live check waits for and how it completes. */
|
|
568
|
+
pending_live_checks: Array<PendingLiveCheck & {
|
|
569
|
+
/** Check id. */
|
|
570
|
+
check_id: string;
|
|
571
|
+
}>;
|
|
572
|
+
/** Recommended / extra items open (never block compliant). */
|
|
573
|
+
suggestions: number;
|
|
574
|
+
}
|
|
531
575
|
/** Latest verdict; null until the first evaluation. */
|
|
532
576
|
export type SiteCompliance = {
|
|
533
577
|
/** Compliance score 0-100 (one decimal place). */
|
|
534
578
|
score: number;
|
|
535
|
-
/** No critical/high obligation failing or unverified. */
|
|
536
|
-
insurable: boolean;
|
|
537
579
|
/** When the latest evaluation ran. Unix timestamp in seconds. */
|
|
538
580
|
evaluated: number;
|
|
539
581
|
/** Open findings whose latest status is fail. */
|
|
540
582
|
open_findings: number;
|
|
541
583
|
/** Open findings waiting for a human look. */
|
|
542
584
|
needs_review: number;
|
|
585
|
+
/** User-facing roll-up of the required checks: needs_fix > your_call > compliant (pending live checks count as compliant). */
|
|
586
|
+
status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
587
|
+
/** Label to show. */
|
|
588
|
+
label: string;
|
|
589
|
+
rollup: ComplianceRollup;
|
|
543
590
|
} | null;
|
|
544
591
|
/** What to install on the merchant site. */
|
|
545
592
|
export interface SiteInstall {
|
|
@@ -576,8 +623,6 @@ export interface Scan {
|
|
|
576
623
|
evaluation: string | null;
|
|
577
624
|
/** Score of that evaluation (0-100, one decimal place). */
|
|
578
625
|
score: number | null;
|
|
579
|
-
/** Insurable flag of that evaluation. */
|
|
580
|
-
insurable: boolean | null;
|
|
581
626
|
/** When the scan started. Unix timestamp in seconds. */
|
|
582
627
|
started: number | null;
|
|
583
628
|
/** When the scan finished. Unix timestamp in seconds. */
|
|
@@ -681,8 +726,12 @@ export interface Site {
|
|
|
681
726
|
account_url: string | null;
|
|
682
727
|
/** Terms of service page read on every scan. */
|
|
683
728
|
terms_url: string | null;
|
|
729
|
+
/** The checkout page is the home page (checkout_url was omitted or set to the site root). Sign-up checks then judge the home page: set checkout_url to the page with the subscribe button unless the home page really has it. */
|
|
730
|
+
homepage_as_checkout: boolean;
|
|
684
731
|
};
|
|
685
732
|
monitoring: SiteMonitoring;
|
|
733
|
+
/** Which requirement tiers Checkbox shows (minimum: required only; balanced: + recommended suggestions; maximum: + extras). Only required items affect compliance. */
|
|
734
|
+
protection_level: "minimum" | "balanced" | "maximum";
|
|
686
735
|
compliance: SiteCompliance;
|
|
687
736
|
install: SiteInstall;
|
|
688
737
|
/** Archived (soft-deleted); evidence is retained. */
|
|
@@ -755,7 +804,9 @@ export interface SiteTestAccount {
|
|
|
755
804
|
password: string;
|
|
756
805
|
/** Custom login steps. */
|
|
757
806
|
login_steps?: Array<ScanStep>;
|
|
758
|
-
/** Optional page on your site that
|
|
807
|
+
/** Optional page on your site that RE-ACTIVATES the test subscription (a test-only route). The cancellation test really cancels the test account; the scanner opens this page after logging in, before cancelling, so every scan starts subscribed. Without it, a scan after a completed cancellation reports "not observed: the test account has no active subscription" (needs review). (Round 3: renamed from reset_url, which meant the opposite of the proof run's stripe.cleanup_url.) */
|
|
808
|
+
reactivate_url?: string;
|
|
809
|
+
/** Deprecated alias of reactivate_url. */
|
|
759
810
|
reset_url?: string;
|
|
760
811
|
}
|
|
761
812
|
export interface CreateSiteParams {
|
|
@@ -786,6 +837,8 @@ export interface CreateSiteParams {
|
|
|
786
837
|
devices?: Array<"desktop" | "mobile">;
|
|
787
838
|
/** Scheduled re-scan interval (0 = off, minimum 60). Default 1440 in live mode, 0 in test mode. */
|
|
788
839
|
monitoring_interval_minutes?: number;
|
|
840
|
+
/** Which requirement tiers Checkbox shows. minimum: the legal floor only (required items). balanced (default): required items plus recommended suggestions (consent receipts, a cancellation confirmation email…), collapsed and never blocking "compliant". maximum: everything, including extra protections (a separate checkbox per term, a pre-purchase summary). Only required items can make a site not compliant, at every level. */
|
|
841
|
+
protection_level?: "minimum" | "balanced" | "maximum";
|
|
789
842
|
}
|
|
790
843
|
export interface UpdateSiteParams {
|
|
791
844
|
/** Display name. */
|
|
@@ -815,6 +868,8 @@ export interface UpdateSiteParams {
|
|
|
815
868
|
devices?: Array<"desktop" | "mobile">;
|
|
816
869
|
/** Scheduled re-scan interval (0 = off, minimum 60). Default 1440 in live mode, 0 in test mode. */
|
|
817
870
|
monitoring_interval_minutes?: number;
|
|
871
|
+
/** Which requirement tiers Checkbox shows. minimum: the legal floor only (required items). balanced (default): required items plus recommended suggestions (consent receipts, a cancellation confirmation email…), collapsed and never blocking "compliant". maximum: everything, including extra protections (a separate checkbox per term, a pre-purchase summary). Only required items can make a site not compliant, at every level. */
|
|
872
|
+
protection_level?: "minimum" | "balanced" | "maximum";
|
|
818
873
|
}
|
|
819
874
|
/** A billing-platform connection of a site. */
|
|
820
875
|
export interface Integration {
|
|
@@ -862,6 +917,8 @@ export interface CheckSummary {
|
|
|
862
917
|
severity: "critical" | "high" | "medium" | "low";
|
|
863
918
|
/** Lifecycle stage. */
|
|
864
919
|
stage: "signup" | "confirmation" | "reminder" | "cancellation" | "config";
|
|
920
|
+
/** User-facing status. needs_fix (a clear violation: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as compliant), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as compliant), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as compliant). */
|
|
921
|
+
compliance_status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
865
922
|
}
|
|
866
923
|
/** A compliance verdict for a site at a point in time. */
|
|
867
924
|
export interface Evaluation {
|
|
@@ -877,8 +934,6 @@ export interface Evaluation {
|
|
|
877
934
|
scan: string;
|
|
878
935
|
/** Compliance score 0-100 (severity-weighted, one decimal place, e.g. 82.5). */
|
|
879
936
|
score: number;
|
|
880
|
-
/** No critical/high check failing, no critical check undecided, no high check without evidence. */
|
|
881
|
-
insurable: boolean;
|
|
882
937
|
/** Legal catalog / rules version used. */
|
|
883
938
|
rules_version: string;
|
|
884
939
|
/** When it was evaluated. Unix timestamp in seconds. */
|
|
@@ -896,8 +951,9 @@ export interface Evaluation {
|
|
|
896
951
|
/** Checks that do not apply. */
|
|
897
952
|
not_applicable: number;
|
|
898
953
|
};
|
|
899
|
-
/**
|
|
954
|
+
/** Blocking checks: critical or high-severity checks that fail, are undecided (critical) or lack evidence (high). */
|
|
900
955
|
blockers: Array<CheckSummary>;
|
|
956
|
+
compliance: ComplianceRollup;
|
|
901
957
|
/** Every check evaluated. */
|
|
902
958
|
checks: Array<CheckSummary>;
|
|
903
959
|
}
|
|
@@ -943,6 +999,78 @@ export type Remediation = {
|
|
|
943
999
|
code: string;
|
|
944
1000
|
} | null;
|
|
945
1001
|
} | null;
|
|
1002
|
+
/** One piece of evidence a verdict relied on. */
|
|
1003
|
+
export interface EvidenceItem {
|
|
1004
|
+
/** What kind of evidence: a captured page, an email, a billing-platform setting, a lifecycle event, a fetched policy document, a test cancellation, or the request input (preflight). */
|
|
1005
|
+
source: "page" | "email" | "billing" | "event" | "policy" | "flow" | "input";
|
|
1006
|
+
/** Id of the capture / email / event / evidence record. */
|
|
1007
|
+
ref?: string;
|
|
1008
|
+
/** Page URL. */
|
|
1009
|
+
url?: string;
|
|
1010
|
+
/** The exact text the verdict relied on. */
|
|
1011
|
+
quote?: string;
|
|
1012
|
+
/** The element on the page (CSS selector). */
|
|
1013
|
+
selector?: string;
|
|
1014
|
+
/** Where the element was, in page coordinates (the crop of the screenshot). */
|
|
1015
|
+
rect?: {
|
|
1016
|
+
/** Left edge (px). */
|
|
1017
|
+
x: number;
|
|
1018
|
+
/** Top edge (px, from the top of the page). */
|
|
1019
|
+
y: number;
|
|
1020
|
+
/** Width (px). */
|
|
1021
|
+
width: number;
|
|
1022
|
+
/** Height (px). */
|
|
1023
|
+
height: number;
|
|
1024
|
+
};
|
|
1025
|
+
/** Billing-platform field the verdict read. */
|
|
1026
|
+
field?: string;
|
|
1027
|
+
/** Value of that field. */
|
|
1028
|
+
value?: unknown;
|
|
1029
|
+
/** Where it was seen (region and device, email subject, …). */
|
|
1030
|
+
label?: string;
|
|
1031
|
+
/** This item’s own outcome when the check judged several. */
|
|
1032
|
+
status?: "pass" | "fail" | "needs_review" | "not_applicable";
|
|
1033
|
+
/** What the check concluded from this item. */
|
|
1034
|
+
detail?: string;
|
|
1035
|
+
/** Evidence id of the page screenshot. */
|
|
1036
|
+
screenshot_ref?: string;
|
|
1037
|
+
/** When it was captured / received. */
|
|
1038
|
+
at?: string;
|
|
1039
|
+
}
|
|
1040
|
+
/** What a verdict was based on. Never a pass without it; needs_review says what is missing. */
|
|
1041
|
+
export interface VerdictEvidence {
|
|
1042
|
+
/** What the verdict rests on, in one line. */
|
|
1043
|
+
summary: string;
|
|
1044
|
+
/** The exact texts, elements, emails, settings and events relied on (failing / unclear first). */
|
|
1045
|
+
items: Array<EvidenceItem>;
|
|
1046
|
+
/** For needs_review: the missing piece that would decide it. */
|
|
1047
|
+
missing?: string;
|
|
1048
|
+
}
|
|
1049
|
+
/** What a person should do about one check (the user-facing layer over `status`). */
|
|
1050
|
+
export interface ComplianceInfo {
|
|
1051
|
+
/** User-facing status. needs_fix (a clear violation: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as compliant), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as compliant), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as compliant). */
|
|
1052
|
+
status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
1053
|
+
/** Label to show: "Needs a fix", "Not set up yet", "Not checked yet", "Looks compliant — live check pending", "Verified live", "Your call", "Compliant", "Looks compliant", "Looks compliant with a note", "Not applicable". */
|
|
1054
|
+
label: string;
|
|
1055
|
+
/** Stable code of the mapping rule (docs/ACCURACY.md). */
|
|
1056
|
+
reason: string;
|
|
1057
|
+
/** required (legal floor: the only tier that can make a site not compliant), recommended (lowers lawsuit risk, conversion-neutral), extra (maximum protection). */
|
|
1058
|
+
tier: "required" | "recommended" | "extra";
|
|
1059
|
+
/** needs_fix: the one change that fixes it. */
|
|
1060
|
+
fix: string | null;
|
|
1061
|
+
/** A short note (grey area, stylistic suggestion). */
|
|
1062
|
+
note: string | null;
|
|
1063
|
+
pending_live_check: PendingLiveCheck | null;
|
|
1064
|
+
/** your_call: the question. */
|
|
1065
|
+
question: {
|
|
1066
|
+
/** One plain-language question. */
|
|
1067
|
+
text: string;
|
|
1068
|
+
/** The answer Checkbox recommends. */
|
|
1069
|
+
recommended: string;
|
|
1070
|
+
/** Why a person has to decide. */
|
|
1071
|
+
why: string;
|
|
1072
|
+
} | null;
|
|
1073
|
+
}
|
|
946
1074
|
/** The latest result of one legal check for a site. */
|
|
947
1075
|
export interface Finding {
|
|
948
1076
|
/** Unique identifier of the finding (fnd_…). */
|
|
@@ -980,6 +1108,10 @@ export interface Finding {
|
|
|
980
1108
|
evidence_refs: Array<string>;
|
|
981
1109
|
/** Check-specific details (failing regions/devices/URLs, measurements, quotes). */
|
|
982
1110
|
details: Record<string, unknown>;
|
|
1111
|
+
evidence: VerdictEvidence;
|
|
1112
|
+
/** User-facing status. needs_fix (a clear violation: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as compliant), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as compliant), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as compliant). */
|
|
1113
|
+
compliance_status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
1114
|
+
compliance: ComplianceInfo;
|
|
983
1115
|
/** Scan that produced the latest result. */
|
|
984
1116
|
scan: string | null;
|
|
985
1117
|
/** First time the check was evaluated. Unix timestamp in seconds. */
|
|
@@ -1060,10 +1192,14 @@ export interface Task {
|
|
|
1060
1192
|
key: string;
|
|
1061
1193
|
/** Short imperative title. */
|
|
1062
1194
|
title: string;
|
|
1063
|
-
/** open (apply the change), in_progress (an agent claimed it), verifying (a verification is waiting for a confirming observation), done, wont_fix (the merchant declined, with a reason), manual (needs a human answer: see question). */
|
|
1064
|
-
status: "open" | "in_progress" | "verifying" | "done" | "wont_fix" | "manual";
|
|
1195
|
+
/** open (apply the change), in_progress (an agent claimed it), verifying (a verification is waiting for a confirming observation), done, wont_fix (the merchant declined, with a reason), manual (needs a human answer: see question), pending_live_check (everything Checkbox can see is right; it waits for a live observation — see change for how it completes. Counts as compliant and never blocks the plan). */
|
|
1196
|
+
status: "open" | "in_progress" | "verifying" | "done" | "wont_fix" | "manual" | "pending_live_check";
|
|
1065
1197
|
/** Strictest severity among the task's legal checks. */
|
|
1066
1198
|
priority: "critical" | "high" | "medium" | "low";
|
|
1199
|
+
/** required (the legal floor: the only tier that can keep the site from being compliant), recommended (lowers lawsuit risk, conversion-neutral; shown at protection level balanced and maximum, never blocks), extra (maximum protection only). Always present on API responses. */
|
|
1200
|
+
tier?: "required" | "recommended" | "extra";
|
|
1201
|
+
/** User-facing status. needs_fix (a clear violation: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as compliant), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as compliant), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as compliant). */
|
|
1202
|
+
compliance_status?: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
1067
1203
|
/** Position in the plan (1 = do first). Dependency-aware. */
|
|
1068
1204
|
order: number;
|
|
1069
1205
|
/** Legal checks this task makes pass. */
|
|
@@ -1173,6 +1309,8 @@ export interface Task {
|
|
|
1173
1309
|
created: number;
|
|
1174
1310
|
} | null;
|
|
1175
1311
|
next_action: PlanNextAction;
|
|
1312
|
+
/** Email tasks only (null otherwise): what Checkbox has seen of this email. not_seen (nothing yet), template_checked (a template or sample passed the email checks, but Checkbox has not seen it sent for a real event: the task stays open), delivery_seen (captured from a real event: a test run, a notice for a real subscriber, or a BCC copy matching that subscriber's billing event). Only delivery_seen satisfies the task. */
|
|
1313
|
+
verification_level: "not_seen" | "template_checked" | "delivery_seen" | null;
|
|
1176
1314
|
/** When the task first appeared. Unix timestamp in seconds. */
|
|
1177
1315
|
first_seen: number;
|
|
1178
1316
|
/** When it was done. Unix timestamp in seconds. */
|
|
@@ -1188,12 +1326,10 @@ export interface CompliancePlan {
|
|
|
1188
1326
|
livemode: boolean;
|
|
1189
1327
|
/** The site. */
|
|
1190
1328
|
site: string;
|
|
1191
|
-
/** action_required (an agent can apply open tasks now), verifying (changes applied; waiting for confirming observations), compliant (every
|
|
1329
|
+
/** action_required (an agent can apply open tasks now), verifying (changes applied; waiting for confirming observations), compliant (every required check passes or only waits for a live check — an automated assessment, not a legal determination; see compliance.pending_live_checks and coverage), blocked (only human answers ("Your call") or declined critical tasks remain). */
|
|
1192
1330
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
1193
1331
|
/** Compliance score 0-100 of the latest evaluation. */
|
|
1194
1332
|
score: number | null;
|
|
1195
|
-
/** Preview flag the planned Checkbox Warranty will key on (no checks failing at high severity). No warranty or insurance is offered yet; this is not an underwriting decision. */
|
|
1196
|
-
insurable: boolean | null;
|
|
1197
1333
|
/** The evaluation the plan was built from (null before the first check). */
|
|
1198
1334
|
evaluation: string | null;
|
|
1199
1335
|
/** When that evaluation ran. Unix timestamp in seconds. */
|
|
@@ -1210,6 +1346,8 @@ export interface CompliancePlan {
|
|
|
1210
1346
|
verifying: number;
|
|
1211
1347
|
/** Tasks waiting for a human answer. */
|
|
1212
1348
|
manual: number;
|
|
1349
|
+
/** Tasks that only wait for a live observation (count as compliant). */
|
|
1350
|
+
pending_live_check?: number;
|
|
1213
1351
|
/** Done tasks. */
|
|
1214
1352
|
done: number;
|
|
1215
1353
|
/** Declined tasks. */
|
|
@@ -1217,6 +1355,18 @@ export interface CompliancePlan {
|
|
|
1217
1355
|
};
|
|
1218
1356
|
/** Tasks in the order to do them (done tasks last). */
|
|
1219
1357
|
tasks: Array<Task>;
|
|
1358
|
+
/** The site's protection level: minimum lists required tasks only; balanced adds recommended suggestions; maximum adds extras. Only required tasks change the plan status. */
|
|
1359
|
+
protection_level: "minimum" | "balanced" | "maximum";
|
|
1360
|
+
/** Task ids grouped by tier, in plan order. */
|
|
1361
|
+
groups: {
|
|
1362
|
+
/** Required tasks (the legal floor). */
|
|
1363
|
+
required: Array<string>;
|
|
1364
|
+
/** Recommended suggestions (never block compliant). */
|
|
1365
|
+
recommended: Array<string>;
|
|
1366
|
+
/** Extra protections (maximum only). */
|
|
1367
|
+
extra: Array<string>;
|
|
1368
|
+
};
|
|
1369
|
+
compliance: ComplianceRollup | null;
|
|
1220
1370
|
/** What the assessment rests on. Tell the human about not_observed and attested items; never call the site "compliant" without them. */
|
|
1221
1371
|
coverage: {
|
|
1222
1372
|
/** Lifecycle stages Checkbox observed (signup, acknowledgment_email, reminders, cancellation, policies, billing_settings). */
|
|
@@ -1229,12 +1379,43 @@ export interface CompliancePlan {
|
|
|
1229
1379
|
billing_connected: boolean;
|
|
1230
1380
|
};
|
|
1231
1381
|
next_action: PlanNextAction;
|
|
1382
|
+
/** Evidence level per required email kind. A plan is never compliant on template_checked emails. */
|
|
1383
|
+
email_verification: Array<{
|
|
1384
|
+
/** Email kind (acknowledgment, trial_ending, renewal_reminder, annual_terms, charge_notice, price_change, cancellation_confirmation). */
|
|
1385
|
+
kind: string;
|
|
1386
|
+
/** not_seen, template_checked (template or sample only: never counted as compliant) or delivery_seen (sent for a real event). */
|
|
1387
|
+
verification_level: "not_seen" | "template_checked" | "delivery_seen";
|
|
1388
|
+
/** Why this level, in plain words. */
|
|
1389
|
+
reason: string;
|
|
1390
|
+
/** The email the level rests on (the delivered one, else the newest). */
|
|
1391
|
+
email: string | null;
|
|
1392
|
+
/** delivery_seen only: the real event the email came from. */
|
|
1393
|
+
basis: "test_run" | "synthetic_signup" | "checkbox_sent" | "notice_due" | "billing_event" | null;
|
|
1394
|
+
}>;
|
|
1232
1395
|
/** Rules / catalog version of the evaluation. */
|
|
1233
1396
|
rules_version: string | null;
|
|
1234
1397
|
/** Automated assessment; not legal advice. */
|
|
1235
1398
|
disclaimer: string;
|
|
1236
1399
|
/** When the plan was computed. Unix timestamp in seconds. */
|
|
1237
1400
|
generated: number;
|
|
1401
|
+
/** Optional improvements beyond compliance. Never tasks, never blocking, never counted toward compliance. */
|
|
1402
|
+
optional_improvements?: {
|
|
1403
|
+
/** Compliant conversion suggestions for this site. */
|
|
1404
|
+
conversion_suggestions: {
|
|
1405
|
+
/** What they are. */
|
|
1406
|
+
description: string;
|
|
1407
|
+
/** Always false. */
|
|
1408
|
+
blocking: false;
|
|
1409
|
+
/** Always false: they never change status, score or tasks. */
|
|
1410
|
+
counts_toward_compliance: false;
|
|
1411
|
+
/** Operation that lists them. */
|
|
1412
|
+
operation_id: string;
|
|
1413
|
+
/** MCP tool that lists them. */
|
|
1414
|
+
mcp_tool: string;
|
|
1415
|
+
/** HTTP endpoint. */
|
|
1416
|
+
endpoint: string;
|
|
1417
|
+
};
|
|
1418
|
+
};
|
|
1238
1419
|
}
|
|
1239
1420
|
export interface UpdateTaskParams {
|
|
1240
1421
|
/** in_progress claims the task (other agents see it), wont_fix declines it (needs reason; a declined critical/high task keeps the plan from being compliant), not_applicable records that the task does not apply to this business (needs reason, e.g. "no price changes are planned"; the task closes as no_longer_applicable and does not block the plan), open clears any of them. */
|
|
@@ -1275,8 +1456,8 @@ export interface Verification {
|
|
|
1275
1456
|
task: string | null;
|
|
1276
1457
|
/** One task or the whole site. */
|
|
1277
1458
|
scope: "task" | "site";
|
|
1278
|
-
/** pending (waiting for the confirming scan / re-evaluation), passed (Checkbox observed the expected result), failed (it did not: see diff). */
|
|
1279
|
-
status: "pending" | "passed" | "failed";
|
|
1459
|
+
/** pending (waiting for the confirming scan / re-evaluation), passed (Checkbox observed the expected result), passed_with_gaps (nothing observed fails, but some checks could not be observed: observed missing_data — not verified), failed (it did not: see diff). */
|
|
1460
|
+
status: "pending" | "passed" | "passed_with_gaps" | "failed";
|
|
1280
1461
|
/** How it was re-checked. */
|
|
1281
1462
|
method: "page_fetch" | "policy_refetch" | "stripe_params" | "email_copy" | "platform_sync" | "attestation" | "evaluation" | "test_run";
|
|
1282
1463
|
/** The fast pre-check run immediately (seconds). A failing pre-check fails the verification at once. */
|
|
@@ -1311,6 +1492,8 @@ export interface VerifyTaskParams {
|
|
|
1311
1492
|
html?: string;
|
|
1312
1493
|
/** stripe_params tasks: exactly what your code now passes to stripe.checkout.sessions.create. */
|
|
1313
1494
|
stripe_checkout_session?: Record<string, unknown>;
|
|
1495
|
+
/** stripe_params tasks with several Checkout code paths (one per plan, e.g. monthly and annual-with-trial): every params object your code passes to stripe.checkout.sessions.create. The pre-check fails when any of them fails. Without either field, every registered config (newest per name) is checked. */
|
|
1496
|
+
stripe_checkout_sessions?: Array<Record<string, unknown>>;
|
|
1314
1497
|
/** email_copy tasks: the new email template (pre-check; the real email confirms). */
|
|
1315
1498
|
email?: {
|
|
1316
1499
|
/** Email kind (default: from the task). */
|
|
@@ -1457,7 +1640,7 @@ export interface EvidenceChainVerification {
|
|
|
1457
1640
|
/** Current chain head hash. */
|
|
1458
1641
|
head: string | null;
|
|
1459
1642
|
}
|
|
1460
|
-
/** A signed monitoring certificate: the site
|
|
1643
|
+
/** A signed monitoring certificate: for the required streak of days the site passed the checks Checkbox ran for every critical and high obligation (emails count only when seen sent for a real event, never on templates alone). It records what was monitored and when; it is not legal advice and not a legal opinion that the site is compliant. */
|
|
1461
1644
|
export interface Certificate {
|
|
1462
1645
|
/** Unique identifier of the certificate (cert_…). */
|
|
1463
1646
|
id: string;
|
|
@@ -1467,13 +1650,13 @@ export interface Certificate {
|
|
|
1467
1650
|
livemode: boolean;
|
|
1468
1651
|
/** Certified site. */
|
|
1469
1652
|
site: string;
|
|
1470
|
-
/** active while monitoring keeps the
|
|
1653
|
+
/** active while monitoring keeps passing the checks Checkbox runs (no critical or high obligation failing or unproven); lapses automatically otherwise. */
|
|
1471
1654
|
status: "active" | "lapsed" | "revoked" | "superseded";
|
|
1472
1655
|
/** Verified domain frozen into the certificate. */
|
|
1473
1656
|
domain: string;
|
|
1474
1657
|
/** Issue time. Unix timestamp in seconds. */
|
|
1475
1658
|
issued: number;
|
|
1476
|
-
/** Expiry (renewed automatically while
|
|
1659
|
+
/** Expiry (renewed automatically while the site keeps passing the checks Checkbox runs). Unix timestamp in seconds. */
|
|
1477
1660
|
valid_until: number;
|
|
1478
1661
|
/** Last renewal. Unix timestamp in seconds. */
|
|
1479
1662
|
renewed: number | null;
|
|
@@ -1483,7 +1666,7 @@ export interface Certificate {
|
|
|
1483
1666
|
public_reason: string | null;
|
|
1484
1667
|
/** Public verification page. */
|
|
1485
1668
|
verify_url: string;
|
|
1486
|
-
/**
|
|
1669
|
+
/** Monitoring badge for the merchant site: it links to the verification page, which says what was checked and when. It does not say the site is legally compliant. */
|
|
1487
1670
|
badge: {
|
|
1488
1671
|
/** Badge image. */
|
|
1489
1672
|
svg_url: string;
|
|
@@ -1519,7 +1702,7 @@ export interface NoticeSettings {
|
|
|
1519
1702
|
/** The site's inbound address. Copies to it confirm a notice only when your sending domain authenticates them (DKIM/SPF, a trusted sending domain) and they go to the subscriber; to confirm any copy, BCC each due notice's own bcc address instead (listDueNotices / the notice.due webhook). */
|
|
1520
1703
|
bcc: string;
|
|
1521
1704
|
/** mode checkbox: the notices Checkbox sends for the merchant. */
|
|
1522
|
-
enabled_kinds: Array<"acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change">;
|
|
1705
|
+
enabled_kinds: Array<"acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice">;
|
|
1523
1706
|
/** Brand shown in notices (defaults to the site name). */
|
|
1524
1707
|
brand_name: string | null;
|
|
1525
1708
|
/** Product name used in notices. */
|
|
@@ -1534,6 +1717,13 @@ export interface NoticeSettings {
|
|
|
1534
1717
|
brand_color: string | null;
|
|
1535
1718
|
/** Mailbox name of the sender. */
|
|
1536
1719
|
from_local_part: string;
|
|
1720
|
+
/** Who Checkbox can send notices to (null when unknown). */
|
|
1721
|
+
subscribers: {
|
|
1722
|
+
/** Active subscriptions Checkbox knows from the billing platform. */
|
|
1723
|
+
active: number;
|
|
1724
|
+
/** Of those, how many have a known email address (Checkbox can only send to these). */
|
|
1725
|
+
with_email: number;
|
|
1726
|
+
} | null;
|
|
1537
1727
|
/** Confirmed cancellation policy (required before notices go out). */
|
|
1538
1728
|
policy: {
|
|
1539
1729
|
/** When a cancellation takes effect. */
|
|
@@ -1560,7 +1750,7 @@ export interface NoticeSettings {
|
|
|
1560
1750
|
/** Every notice kind. */
|
|
1561
1751
|
kinds: Array<{
|
|
1562
1752
|
/** Notice kind. */
|
|
1563
|
-
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change";
|
|
1753
|
+
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
1564
1754
|
/** Label. */
|
|
1565
1755
|
label: string;
|
|
1566
1756
|
/** What it is and when it is sent. */
|
|
@@ -1578,7 +1768,7 @@ export interface UpdateNoticeSettingsParams {
|
|
|
1578
1768
|
/** merchant: you send the emails (Checkbox tracks them); checkbox: Checkbox sends them. Turning an enabled_kinds notice on implies checkbox. */
|
|
1579
1769
|
mode?: "merchant" | "checkbox";
|
|
1580
1770
|
/** Notices to send (turning one on needs cancel_url, a confirmed policy and a connected Stripe/Recharge account). trial_reminder is accepted as an alias of trial_ending. */
|
|
1581
|
-
enabled_kinds?: Array<"acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "trial_reminder">;
|
|
1771
|
+
enabled_kinds?: Array<"acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice" | "trial_reminder">;
|
|
1582
1772
|
/** Brand name. */
|
|
1583
1773
|
brand_name?: string | null;
|
|
1584
1774
|
/** Product name. */
|
|
@@ -1922,6 +2112,10 @@ export interface CheckVerdict {
|
|
|
1922
2112
|
fix?: string;
|
|
1923
2113
|
/** Page checks on static HTML: the engine status on the estimated layout. */
|
|
1924
2114
|
static_estimate?: "pass" | "fail" | "needs_review" | "not_applicable";
|
|
2115
|
+
evidence: VerdictEvidence;
|
|
2116
|
+
/** User-facing status. needs_fix (a clear violation: `compliance.fix` is the one change), pending_live_check (everything Checkbox can see is right; the live event has not been observed yet — counts as compliant), verified_live (observed live: proof run, real BCC'd send, Stripe-confirmed cancellation), your_call (a real decision for a person: `compliance.question`), compliant (passes; grey areas carry a `compliance.note`), not_applicable, not_set_up (no sign the email or setting exists yet: `compliance.fix` is the one-click way to set it up; never counts as compliant), not_checked (Checkbox has not tried it yet, e.g. the cancel flow: `compliance.fix` says how; never counts as compliant). */
|
|
2117
|
+
compliance_status: "needs_fix" | "pending_live_check" | "verified_live" | "your_call" | "compliant" | "not_applicable" | "not_set_up" | "not_checked";
|
|
2118
|
+
compliance: ComplianceInfo;
|
|
1925
2119
|
}
|
|
1926
2120
|
/** Verdict per legal requirement. */
|
|
1927
2121
|
export type CheckRequirementVerdict = CheckRequirementRef & {
|
|
@@ -2002,6 +2196,9 @@ export interface DisclosureCheckResult {
|
|
|
2002
2196
|
/** Not legal advice. */
|
|
2003
2197
|
disclaimer: string;
|
|
2004
2198
|
next_action: NextAction;
|
|
2199
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as compliant). `verdict` keeps the machine value. */
|
|
2200
|
+
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2201
|
+
compliance: ComplianceRollup;
|
|
2005
2202
|
replacement: CheckReplacement;
|
|
2006
2203
|
}
|
|
2007
2204
|
/** A checkout disclosure to check before it ships. */
|
|
@@ -2118,6 +2315,9 @@ export interface StripeCheckoutSessionCheckResult {
|
|
|
2118
2315
|
/** Not legal advice. */
|
|
2119
2316
|
disclaimer: string;
|
|
2120
2317
|
next_action: NextAction;
|
|
2318
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as compliant). `verdict` keeps the machine value. */
|
|
2319
|
+
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2320
|
+
compliance: ComplianceRollup;
|
|
2121
2321
|
/** The fix. */
|
|
2122
2322
|
correction: {
|
|
2123
2323
|
/** JSON Patch turning params into corrected_params (empty: nothing to change). */
|
|
@@ -2223,6 +2423,9 @@ export interface StripePaymentLinkCheckResult {
|
|
|
2223
2423
|
/** Not legal advice. */
|
|
2224
2424
|
disclaimer: string;
|
|
2225
2425
|
next_action: NextAction;
|
|
2426
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as compliant). `verdict` keeps the machine value. */
|
|
2427
|
+
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2428
|
+
compliance: ComplianceRollup;
|
|
2226
2429
|
/** The fix. */
|
|
2227
2430
|
correction: {
|
|
2228
2431
|
/** JSON Patch turning params into corrected_params (empty: nothing to change). */
|
|
@@ -2299,8 +2502,13 @@ export interface EmailCheckResult {
|
|
|
2299
2502
|
/** Not legal advice. */
|
|
2300
2503
|
disclaimer: string;
|
|
2301
2504
|
next_action: NextAction;
|
|
2505
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as compliant). `verdict` keeps the machine value. */
|
|
2506
|
+
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2507
|
+
compliance: ComplianceRollup;
|
|
2302
2508
|
/** The email kind checked. */
|
|
2303
2509
|
email_kind: string;
|
|
2510
|
+
/** Always template_checked: this checks the wording you send in, not that your system sends it. On the site, the email only counts once Checkbox sees it sent for a real event (delivery_seen: a test run, a notice for a real subscriber, or a BCC copy matching that subscriber's billing event). */
|
|
2511
|
+
verification_level: "template_checked";
|
|
2304
2512
|
/** Requirements that make this email mandatory for this plan (empty: not legally required). */
|
|
2305
2513
|
required_by: Array<string>;
|
|
2306
2514
|
/** A compliant template generated from the plan terms. */
|
|
@@ -2389,6 +2597,9 @@ export interface PageCheckResult {
|
|
|
2389
2597
|
/** Not legal advice. */
|
|
2390
2598
|
disclaimer: string;
|
|
2391
2599
|
next_action: NextAction;
|
|
2600
|
+
/** User-facing roll-up: needs_fix > your_call > incomplete > compliant (pending live checks count as compliant). `verdict` keeps the machine value. */
|
|
2601
|
+
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2602
|
+
compliance: ComplianceRollup;
|
|
2392
2603
|
/** Whether html was given or fetched from url. */
|
|
2393
2604
|
source: "html" | "url";
|
|
2394
2605
|
/** What was read from the page. */
|
|
@@ -2439,7 +2650,7 @@ export interface PageCheckParams {
|
|
|
2439
2650
|
/** One notice to send. */
|
|
2440
2651
|
export interface ScheduledNotice {
|
|
2441
2652
|
/** Notice kind. */
|
|
2442
|
-
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change";
|
|
2653
|
+
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
2443
2654
|
/** What the notice announces. */
|
|
2444
2655
|
occasion: string;
|
|
2445
2656
|
/** Date of the event (YYYY-MM-DD, UTC). */
|
|
@@ -2519,6 +2730,256 @@ export interface NoticeScheduleParams {
|
|
|
2519
2730
|
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
2520
2731
|
as_of?: string;
|
|
2521
2732
|
}
|
|
2733
|
+
/** RFC 6902 operation. */
|
|
2734
|
+
export interface SuggestionPatchOp {
|
|
2735
|
+
/** JSON Patch operation. */
|
|
2736
|
+
op: "add" | "replace" | "remove";
|
|
2737
|
+
/** JSON Pointer. */
|
|
2738
|
+
path: string;
|
|
2739
|
+
/** Value. */
|
|
2740
|
+
value?: unknown;
|
|
2741
|
+
}
|
|
2742
|
+
/** A legal guardrail the suggestion respects. */
|
|
2743
|
+
export interface SuggestionGuardrail {
|
|
2744
|
+
/** What the change must respect, in plain words. */
|
|
2745
|
+
rule: string;
|
|
2746
|
+
/** Catalog requirement ids the rule comes from. */
|
|
2747
|
+
requirement_ids: Array<string>;
|
|
2748
|
+
}
|
|
2749
|
+
/** One optional, compliant conversion suggestion. */
|
|
2750
|
+
export interface Suggestion {
|
|
2751
|
+
/** Stable id of the suggestion in Checkbox’s library. */
|
|
2752
|
+
key: string;
|
|
2753
|
+
/** String representing the object's type. Always "suggestion". */
|
|
2754
|
+
object: "suggestion";
|
|
2755
|
+
/** Where it applies. */
|
|
2756
|
+
surface: "checkout_page" | "stripe_checkout" | "acknowledgment_email" | "trial_reminder_email" | "renewal_reminder_email" | "price_change_email" | "cancellation_flow" | "cancellation_confirmation_email";
|
|
2757
|
+
/** What to change. */
|
|
2758
|
+
title: string;
|
|
2759
|
+
/** Why it commonly helps conversion or retention (no invented figures). */
|
|
2760
|
+
why: string;
|
|
2761
|
+
/** detected: your observed copy lacks it; recommended: the surface was not observed but it fits your plan. */
|
|
2762
|
+
match: "detected" | "recommended";
|
|
2763
|
+
/** Why it applies to you. */
|
|
2764
|
+
reason: string;
|
|
2765
|
+
/** Before. */
|
|
2766
|
+
before: {
|
|
2767
|
+
/** What is shown. */
|
|
2768
|
+
label: string;
|
|
2769
|
+
/** Your current copy (or a typical example). */
|
|
2770
|
+
text: string;
|
|
2771
|
+
};
|
|
2772
|
+
/** After. */
|
|
2773
|
+
after: {
|
|
2774
|
+
/** What is shown. */
|
|
2775
|
+
label: string;
|
|
2776
|
+
/** The improved copy, from your plan terms. */
|
|
2777
|
+
text: string;
|
|
2778
|
+
};
|
|
2779
|
+
/** How to apply it. */
|
|
2780
|
+
apply: {
|
|
2781
|
+
/** Kind of change. */
|
|
2782
|
+
type: "replace_text" | "insert_text" | "replace_email" | "stripe_params" | "flow_change" | "settings";
|
|
2783
|
+
/** Where to make it. */
|
|
2784
|
+
where: string;
|
|
2785
|
+
/** The exact copy / markup / JSON to apply. */
|
|
2786
|
+
content: string;
|
|
2787
|
+
/** stripe_params: RFC 6902 patch for the params your code passes to Stripe. */
|
|
2788
|
+
json_patch?: Array<SuggestionPatchOp>;
|
|
2789
|
+
/** One or two sentences an agent can follow literally. */
|
|
2790
|
+
instructions: string;
|
|
2791
|
+
};
|
|
2792
|
+
/** What must be true before you use it (never claim it otherwise). */
|
|
2793
|
+
preconditions: Array<string>;
|
|
2794
|
+
/** Legal guardrails (catalog ids) the change must respect. */
|
|
2795
|
+
guardrails: Array<SuggestionGuardrail>;
|
|
2796
|
+
/** The engine check of the after-example (only verified suggestions are offered). */
|
|
2797
|
+
verification: {
|
|
2798
|
+
/** The check the after-example was run through. */
|
|
2799
|
+
operation_id: "checkDisclosure" | "checkStripeCheckoutSession" | "checkEmail" | "cancellation_flow_model";
|
|
2800
|
+
/** Verdict of that check. */
|
|
2801
|
+
verdict: "pass" | "fail" | "needs_review" | "not_applicable";
|
|
2802
|
+
/** Nothing fails and nothing new needs review. */
|
|
2803
|
+
verified: boolean;
|
|
2804
|
+
/** Checks that did not pass (empty when verified). */
|
|
2805
|
+
open_checks: Array<string>;
|
|
2806
|
+
/** The after-example's status roll-up (the same labels as compliance on sites and check results): compliant for every offered suggestion. */
|
|
2807
|
+
compliance_status: "needs_fix" | "your_call" | "incomplete" | "compliant" | "not_checked";
|
|
2808
|
+
/** Its label. */
|
|
2809
|
+
compliance_label: string;
|
|
2810
|
+
/** Jurisdictions checked. */
|
|
2811
|
+
jurisdictions: "all" | Array<string>;
|
|
2812
|
+
/** How it was checked. */
|
|
2813
|
+
note: string;
|
|
2814
|
+
} | null;
|
|
2815
|
+
/** Placeholders you must fill (e.g. {{cancel_url}}). */
|
|
2816
|
+
placeholders: Array<string>;
|
|
2817
|
+
}
|
|
2818
|
+
/** Optional, compliant conversion suggestions for a checkout, Stripe Checkout, lifecycle emails and the cancellation flow. Never a compliance task. */
|
|
2819
|
+
export interface SuggestionReport {
|
|
2820
|
+
/** Id of this report (sugr_…). Reports are computed on request and not stored. */
|
|
2821
|
+
id: string;
|
|
2822
|
+
/** String representing the object's type. Always "suggestion_report". */
|
|
2823
|
+
object: "suggestion_report";
|
|
2824
|
+
/** true for live-mode objects, false for test mode (ck_test_ keys act on an isolated sandbox). */
|
|
2825
|
+
livemode: boolean;
|
|
2826
|
+
/** When it was computed. Unix seconds. */
|
|
2827
|
+
created: number;
|
|
2828
|
+
/** The site (GET /v1/sites/:site/suggestions), or null for POST /v1/suggestions. */
|
|
2829
|
+
site: string | null;
|
|
2830
|
+
/** Always true: suggestions are optional and never block anything. */
|
|
2831
|
+
optional: true;
|
|
2832
|
+
/** Always false: suggestions never count for or against compliance, the score or the plan status. */
|
|
2833
|
+
counts_toward_compliance: false;
|
|
2834
|
+
/** One paragraph for an LLM or a human. */
|
|
2835
|
+
summary: string;
|
|
2836
|
+
/** Jurisdictions the examples were checked for. */
|
|
2837
|
+
jurisdictions: "all" | Array<string>;
|
|
2838
|
+
/** Date the law was evaluated at. */
|
|
2839
|
+
as_of: string;
|
|
2840
|
+
/** Version of the suggestion library. */
|
|
2841
|
+
library_version: string;
|
|
2842
|
+
/** Rules engine version. */
|
|
2843
|
+
rules_version: string;
|
|
2844
|
+
/** Legal catalog version. */
|
|
2845
|
+
catalog_version: string;
|
|
2846
|
+
/** Per surface. */
|
|
2847
|
+
surfaces: Array<{
|
|
2848
|
+
/** Surface. */
|
|
2849
|
+
surface: "checkout_page" | "stripe_checkout" | "acknowledgment_email" | "trial_reminder_email" | "renewal_reminder_email" | "price_change_email" | "cancellation_flow" | "cancellation_confirmation_email";
|
|
2850
|
+
/** offered; held (a compliance check on it fails: fix that first); none (nothing to suggest). */
|
|
2851
|
+
status: "offered" | "held" | "none";
|
|
2852
|
+
/** Checkbox saw this surface (or you sent it). */
|
|
2853
|
+
observed: boolean;
|
|
2854
|
+
/** Failing checks that hold it. */
|
|
2855
|
+
held_by: Array<string>;
|
|
2856
|
+
/** The status label of those checks ("Needs a fix"), or null. */
|
|
2857
|
+
held_label: string | null;
|
|
2858
|
+
/** Suggestions offered for it. */
|
|
2859
|
+
offered: number;
|
|
2860
|
+
}>;
|
|
2861
|
+
/** Offered suggestions: detected gaps in your own copy first. */
|
|
2862
|
+
suggestions: Array<Suggestion>;
|
|
2863
|
+
/** Suggestions that would apply but are withheld, and why. */
|
|
2864
|
+
withheld: Array<{
|
|
2865
|
+
/** Suggestion key. */
|
|
2866
|
+
key: string;
|
|
2867
|
+
/** Surface. */
|
|
2868
|
+
surface: "checkout_page" | "stripe_checkout" | "acknowledgment_email" | "trial_reminder_email" | "renewal_reminder_email" | "price_change_email" | "cancellation_flow" | "cancellation_confirmation_email";
|
|
2869
|
+
/** Title. */
|
|
2870
|
+
title: string;
|
|
2871
|
+
/** Why it is not offered to you (a guardrail, a failing check, or an untrue precondition). */
|
|
2872
|
+
reason: string;
|
|
2873
|
+
}>;
|
|
2874
|
+
/** Next step. */
|
|
2875
|
+
next_action: {
|
|
2876
|
+
/** What to do next. */
|
|
2877
|
+
type: "apply_suggestion" | "fix_compliance_first" | "none";
|
|
2878
|
+
/** One or two sentences for an agent. */
|
|
2879
|
+
message: string;
|
|
2880
|
+
/** The operation to call next, when there is one. */
|
|
2881
|
+
operation_id?: string;
|
|
2882
|
+
/** The MCP tool for operation_id. */
|
|
2883
|
+
mcp_tool?: string;
|
|
2884
|
+
};
|
|
2885
|
+
/** Not legal advice; optional; results vary. */
|
|
2886
|
+
disclaimer: string;
|
|
2887
|
+
}
|
|
2888
|
+
/** What to suggest improvements for: the same inputs as /v1/checks/*, any subset. */
|
|
2889
|
+
export interface SuggestionsParams {
|
|
2890
|
+
terms?: CheckPlanTerms;
|
|
2891
|
+
/** Other plans you sell (enables “point to a cheaper plan” and plan-choice suggestions). */
|
|
2892
|
+
other_plans?: Array<CheckPlanTerms & {
|
|
2893
|
+
/** Plan name shown to subscribers. */
|
|
2894
|
+
name: string;
|
|
2895
|
+
}>;
|
|
2896
|
+
/** Where you sell: "all" (default) or state codes ("US-CA", "CA", "US-NY"; "US-FED" is always included). */
|
|
2897
|
+
jurisdictions?: "all" | Array<string>;
|
|
2898
|
+
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
2899
|
+
as_of?: string;
|
|
2900
|
+
/** Only suggest for these surfaces (default: all). */
|
|
2901
|
+
surfaces?: Array<"checkout_page" | "stripe_checkout" | "acknowledgment_email" | "trial_reminder_email" | "renewal_reminder_email" | "price_change_email" | "cancellation_flow" | "cancellation_confirmation_email">;
|
|
2902
|
+
/** Your own checkout: the same fields as checkDisclosure (without the plan terms, which go in terms). */
|
|
2903
|
+
disclosure?: {
|
|
2904
|
+
/** The disclosure shown next to the purchase button, exactly as rendered. */
|
|
2905
|
+
text: string;
|
|
2906
|
+
/** Label of the purchase button. */
|
|
2907
|
+
button_text?: string;
|
|
2908
|
+
/** Other text next to the button (order summary). */
|
|
2909
|
+
order_summary?: string;
|
|
2910
|
+
/** Where and how the disclosure is shown (as in checkDisclosure). */
|
|
2911
|
+
placement?: {
|
|
2912
|
+
/** Shown above the purchase button (default true). */
|
|
2913
|
+
above_button?: boolean;
|
|
2914
|
+
/** On the same page as the payment form (default true). */
|
|
2915
|
+
same_page_as_payment?: boolean;
|
|
2916
|
+
/** Font size (default 14). */
|
|
2917
|
+
font_size_px?: number;
|
|
2918
|
+
/** WCAG contrast ratio. */
|
|
2919
|
+
contrast_ratio?: number;
|
|
2920
|
+
/** Bold / semibold. */
|
|
2921
|
+
bold?: boolean;
|
|
2922
|
+
/** Set off in a box. */
|
|
2923
|
+
boxed?: boolean;
|
|
2924
|
+
/** Surrounding body text size (default 14). */
|
|
2925
|
+
body_font_size_px?: number;
|
|
2926
|
+
};
|
|
2927
|
+
/** The consent checkbox (as in checkDisclosure). */
|
|
2928
|
+
consent?: {
|
|
2929
|
+
/** There is a renewal consent checkbox. */
|
|
2930
|
+
checkbox: boolean;
|
|
2931
|
+
/** Ticked by default. */
|
|
2932
|
+
prechecked?: boolean;
|
|
2933
|
+
/** Its label. */
|
|
2934
|
+
label?: string;
|
|
2935
|
+
/** Required to submit (default true). */
|
|
2936
|
+
required?: boolean;
|
|
2937
|
+
};
|
|
2938
|
+
};
|
|
2939
|
+
/** Your checkout page HTML (as in checkPage; html only). */
|
|
2940
|
+
page?: {
|
|
2941
|
+
/** Rendered checkout page HTML (as in checkPage). */
|
|
2942
|
+
html: string;
|
|
2943
|
+
/** Where the page lives (resolves relative links). */
|
|
2944
|
+
url?: string;
|
|
2945
|
+
};
|
|
2946
|
+
/** Stripe Checkout Session params (as in checkStripeCheckoutSession; plan terms in terms). */
|
|
2947
|
+
stripe_checkout_session?: {
|
|
2948
|
+
/** Exactly what your code passes to stripe.checkout.sessions.create. */
|
|
2949
|
+
params: Record<string, unknown>;
|
|
2950
|
+
};
|
|
2951
|
+
/** Lifecycle emails (as in checkEmail; plan terms in terms). */
|
|
2952
|
+
emails?: Array<{
|
|
2953
|
+
/** Which lifecycle email (as in checkEmail). */
|
|
2954
|
+
kind: "acknowledgment" | "trial_reminder" | "trial_ending" | "renewal_reminder" | "price_change" | "annual_terms" | "charge_notice" | "cancellation_confirmation";
|
|
2955
|
+
/** Subject line. */
|
|
2956
|
+
subject: string;
|
|
2957
|
+
/** Plain-text body. */
|
|
2958
|
+
text?: string;
|
|
2959
|
+
/** HTML body. */
|
|
2960
|
+
html?: string;
|
|
2961
|
+
/** price_change only: the old price, major units. */
|
|
2962
|
+
previous_price?: number | string;
|
|
2963
|
+
}>;
|
|
2964
|
+
/** Your cancellation flow as a subscriber sees it. */
|
|
2965
|
+
cancellation_flow?: {
|
|
2966
|
+
/** Screens from the account page to the confirmation, in order. */
|
|
2967
|
+
steps: Array<{
|
|
2968
|
+
/** What the screen says. */
|
|
2969
|
+
text: string;
|
|
2970
|
+
/** Buttons and links on the screen. */
|
|
2971
|
+
buttons?: Array<string>;
|
|
2972
|
+
/** The screen shows a retention (save) offer or pause option. */
|
|
2973
|
+
offer?: boolean;
|
|
2974
|
+
}>;
|
|
2975
|
+
/** A confirmation is shown at the end (default true). */
|
|
2976
|
+
confirmation_shown?: boolean;
|
|
2977
|
+
};
|
|
2978
|
+
/** You send a trial-ending reminder to every trial subscriber (false withholds suggestions that promise one). */
|
|
2979
|
+
trial_reminders?: boolean;
|
|
2980
|
+
/** Your site’s base URL (used in example links). */
|
|
2981
|
+
site_url?: string;
|
|
2982
|
+
}
|
|
2522
2983
|
export interface ElementsRelease {
|
|
2523
2984
|
/** Semver of the bundle. */
|
|
2524
2985
|
version: string;
|
|
@@ -3261,11 +3722,11 @@ export type TestRunFix = {
|
|
|
3261
3722
|
} | null;
|
|
3262
3723
|
/** One observed lifecycle step of a test run. */
|
|
3263
3724
|
export interface TestRunStep {
|
|
3264
|
-
/** Stable step key: credentials, checkout_config, checkout_page, subscribe, acknowledgment_email, trial_reminder, renewal, cancel_online, cancellation_email, cleanup. */
|
|
3725
|
+
/** Stable step key: credentials, checkout_config, checkout_page, subscribe, acknowledgment_email, trial_reminder, renewal, cancel_online, cancellation_email, webhooks (real_checkout), cleanup. */
|
|
3265
3726
|
key: string;
|
|
3266
3727
|
/** Human-readable step title. */
|
|
3267
3728
|
title: string;
|
|
3268
|
-
/** passed: observed and
|
|
3729
|
+
/** passed: observed, with evidence, and every judged check passed (never on an assumption); failed: a check failed or the step broke the run; warning: needs review — could not be fully observed or proven (see code and fix); skipped: not applicable or turned off. */
|
|
3269
3730
|
status: "pending" | "running" | "passed" | "failed" | "warning" | "skipped";
|
|
3270
3731
|
/** What was observed, in one or two sentences. */
|
|
3271
3732
|
summary: string | null;
|
|
@@ -3291,7 +3752,7 @@ export interface TestRunStep {
|
|
|
3291
3752
|
observations: Record<string, unknown>;
|
|
3292
3753
|
/** Evidence records (screenshots, page captures, raw emails) behind the step. */
|
|
3293
3754
|
evidence: Array<string>;
|
|
3294
|
-
/** Warning or failure code of the step (stable): key_missing, key_not_test_mode, key_invalid, key_permission_missing, checkout_config_missing, price_not_in_test_mode, checkout_session_failed, checkout_page_unreadable, checkout_not_completed, subscription_create_failed, test_clock_failed, no_email_received_within, reminder_not_received, portal_not_configured, cancel_not_completed, cancellation_email_not_received, scan_config_missing, domain_not_verified, scanner_failed, stripe_api_error, timeout, canceled, internal_error. */
|
|
3755
|
+
/** Warning or failure code of the step (stable): key_missing, key_not_test_mode, key_invalid, key_permission_missing, checkout_config_missing, price_not_in_test_mode, checkout_session_failed, checkout_page_unreadable, checkout_not_completed, subscription_create_failed, test_clock_failed, no_email_received_within, reminder_not_received, portal_not_configured, cancel_not_completed, cancellation_email_not_received, checkout_url_missing, real_checkout_not_completed, payment_link_not_found, webhook_not_delivered, reminder_outside_window, reminder_timing_not_observed, cancel_flow_not_configured, cancel_not_confirmed_in_stripe, acknowledgment_content_incomplete, cancel_replaced_by_other_subscription, not_judged, scan_config_missing, domain_not_verified, scanner_failed, stripe_api_error, timeout, canceled, internal_error. */
|
|
3295
3756
|
code: string | null;
|
|
3296
3757
|
fix: TestRunFix;
|
|
3297
3758
|
}
|
|
@@ -3307,6 +3768,8 @@ export interface TestRun {
|
|
|
3307
3768
|
site: string;
|
|
3308
3769
|
/** stripe: Stripe test mode with a test clock; generic: any site with a test coupon / test account (no time travel). */
|
|
3309
3770
|
type: "stripe" | "generic";
|
|
3771
|
+
/** Stripe runs: mirror (Checkbox mirrors your checkout into test mode and moves a test clock through trial and renewal) or real_checkout (the shopper buys through YOUR checkout on your test deployment, so your own webhook handlers and email code fire: the proof that your real system works). null for generic runs. */
|
|
3772
|
+
mode: "mirror" | "real_checkout" | null;
|
|
3310
3773
|
/** succeeded means the run finished (steps may still have failing checks); failed means it stopped early (see failure). */
|
|
3311
3774
|
status: "queued" | "running" | "succeeded" | "failed" | "canceled";
|
|
3312
3775
|
/** Internal phase (prepare, checkout, await_ack, advance, settle, cancel, await_cancel_email, finalize, done). */
|
|
@@ -3325,7 +3788,7 @@ export interface TestRun {
|
|
|
3325
3788
|
steps: Array<TestRunStep>;
|
|
3326
3789
|
/** Why the run stopped (failed / canceled runs). */
|
|
3327
3790
|
failure: {
|
|
3328
|
-
/** Stable failure code: key_missing, key_not_test_mode, key_invalid, key_permission_missing, checkout_config_missing, price_not_in_test_mode, checkout_session_failed, checkout_page_unreadable, checkout_not_completed, subscription_create_failed, test_clock_failed, no_email_received_within, reminder_not_received, portal_not_configured, cancel_not_completed, cancellation_email_not_received, scan_config_missing, domain_not_verified, scanner_failed, stripe_api_error, timeout, canceled, internal_error. */
|
|
3791
|
+
/** Stable failure code: key_missing, key_not_test_mode, key_invalid, key_permission_missing, checkout_config_missing, price_not_in_test_mode, checkout_session_failed, checkout_page_unreadable, checkout_not_completed, subscription_create_failed, test_clock_failed, no_email_received_within, reminder_not_received, portal_not_configured, cancel_not_completed, cancellation_email_not_received, checkout_url_missing, real_checkout_not_completed, payment_link_not_found, webhook_not_delivered, reminder_outside_window, reminder_timing_not_observed, cancel_flow_not_configured, cancel_not_confirmed_in_stripe, acknowledgment_content_incomplete, cancel_replaced_by_other_subscription, not_judged, scan_config_missing, domain_not_verified, scanner_failed, stripe_api_error, timeout, canceled, internal_error. */
|
|
3329
3792
|
code: string;
|
|
3330
3793
|
/** What went wrong. */
|
|
3331
3794
|
message: string;
|
|
@@ -3381,8 +3844,8 @@ export interface TestRun {
|
|
|
3381
3844
|
subscription: string | null;
|
|
3382
3845
|
/** Mirrored test-mode Checkout Session. */
|
|
3383
3846
|
checkout_session: string | null;
|
|
3384
|
-
/** Where the checkout configuration came from. */
|
|
3385
|
-
mirrored_from: "registered" | "live" | "request" | null;
|
|
3847
|
+
/** Where the checkout configuration came from (mirror mode). */
|
|
3848
|
+
mirrored_from: "registered" | "live" | "request" | "payment_link" | null;
|
|
3386
3849
|
/** Registered config used (scc_…). */
|
|
3387
3850
|
checkout_config: string | null;
|
|
3388
3851
|
/** Compliance fingerprint of the mirrored checkout. */
|
|
@@ -3392,6 +3855,52 @@ export interface TestRun {
|
|
|
3392
3855
|
/** Whether the test clock (with its customer and subscription) was deleted. */
|
|
3393
3856
|
cleaned_up: boolean;
|
|
3394
3857
|
} | null;
|
|
3858
|
+
/** What the run proves and the evidence beyond the steps (Stripe runs). */
|
|
3859
|
+
proof: {
|
|
3860
|
+
/** The run mode. */
|
|
3861
|
+
mode: "mirror" | "real_checkout";
|
|
3862
|
+
/** What this run is evidence of, and what it is not, in one sentence. */
|
|
3863
|
+
what_it_proves: string;
|
|
3864
|
+
/** Notices mode of the site at the run: checkbox (Checkbox Notices sends; the run exercises them), merchant (you send; the run watches for yours) or off. */
|
|
3865
|
+
notices: "checkbox" | "merchant" | "off" | null;
|
|
3866
|
+
/** Who was expected to send the lifecycle emails. */
|
|
3867
|
+
notices_sender: "checkbox" | "merchant" | null;
|
|
3868
|
+
/** Payment Link mirrored or bought through (plink_…). */
|
|
3869
|
+
payment_link: string | null;
|
|
3870
|
+
/** Your Stripe test-mode webhook endpoints (host only) when the key may read them. */
|
|
3871
|
+
webhook_endpoints: Array<{
|
|
3872
|
+
/** Host of the endpoint URL (the path is not shown). */
|
|
3873
|
+
host: string;
|
|
3874
|
+
/** Event types it listens for ("*" = all). */
|
|
3875
|
+
enabled_events: Array<string>;
|
|
3876
|
+
/** enabled or disabled. */
|
|
3877
|
+
status: string;
|
|
3878
|
+
}>;
|
|
3879
|
+
/** Stripe events of the run's subscription (evidence). pending_webhooks > 0: an endpoint did not acknowledge it. */
|
|
3880
|
+
stripe_events: Array<{
|
|
3881
|
+
/** Stripe event id (test mode). */
|
|
3882
|
+
id: string;
|
|
3883
|
+
/** Stripe event type. */
|
|
3884
|
+
type: string;
|
|
3885
|
+
/** When Stripe created it (unix seconds). */
|
|
3886
|
+
created: number;
|
|
3887
|
+
/** Deliveries Stripe still had pending when Checkbox looked (0 = acknowledged by every endpoint, or no endpoint). */
|
|
3888
|
+
pending_webhooks: number | null;
|
|
3889
|
+
}>;
|
|
3890
|
+
/** How the cancellation was attempted and what Stripe showed. */
|
|
3891
|
+
cancellation: {
|
|
3892
|
+
/** Where the shopper cancelled. */
|
|
3893
|
+
via: "merchant_flow" | "stripe_portal" | "cancel_url";
|
|
3894
|
+
/** false: nothing told Checkbox how customers cancel, so it used the Stripe portal (step warning cancel_flow_not_configured). */
|
|
3895
|
+
declared_by_merchant: boolean;
|
|
3896
|
+
/** Stripe showed a subscription set to cancel after the shopper's flow. */
|
|
3897
|
+
confirmed_in_stripe: boolean;
|
|
3898
|
+
/** The subscription Stripe showed canceled. */
|
|
3899
|
+
subscription: string | null;
|
|
3900
|
+
/** Why Stripe could not be checked, when it could not. */
|
|
3901
|
+
note: string | null;
|
|
3902
|
+
} | null;
|
|
3903
|
+
} | null;
|
|
3395
3904
|
next_action: NextAction;
|
|
3396
3905
|
}
|
|
3397
3906
|
/** A page of test runs, newest first. */
|
|
@@ -3456,7 +3965,7 @@ export interface Event {
|
|
|
3456
3965
|
id: string;
|
|
3457
3966
|
/** String representing the object's type. Always "event". */
|
|
3458
3967
|
object: "event";
|
|
3459
|
-
/** Event type: site.score_changed,
|
|
3968
|
+
/** Event type: site.score_changed, finding.created, finding.resolved, scan.completed, scan.failed, law.changed, certificate.issued, certificate.lapsed, certificate.revoked, notice.sent, notice.due, notice.overdue, consent.created, receipt.created, test_run.completed, test_run.failed, plan.updated, site.compliant, task.verified. */
|
|
3460
3969
|
type: string;
|
|
3461
3970
|
/** API version used to render data.object. */
|
|
3462
3971
|
api_version: string;
|
|
@@ -3532,12 +4041,10 @@ export interface CompliancePlanSummary {
|
|
|
3532
4041
|
livemode: boolean;
|
|
3533
4042
|
/** The site. */
|
|
3534
4043
|
site: string;
|
|
3535
|
-
/** action_required (an agent can apply open tasks now), verifying (changes applied; waiting for confirming observations), compliant (every
|
|
4044
|
+
/** action_required (an agent can apply open tasks now), verifying (changes applied; waiting for confirming observations), compliant (every required check passes or only waits for a live check — an automated assessment, not a legal determination; see compliance.pending_live_checks and coverage), blocked (only human answers ("Your call") or declined critical tasks remain). */
|
|
3536
4045
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
3537
4046
|
/** Compliance score 0-100 of the latest evaluation. */
|
|
3538
4047
|
score: number | null;
|
|
3539
|
-
/** Preview flag the planned Checkbox Warranty will key on (no checks failing at high severity). No warranty or insurance is offered yet; this is not an underwriting decision. */
|
|
3540
|
-
insurable: boolean | null;
|
|
3541
4048
|
/** Two or three sentences for an LLM: where the site stands and what comes next. */
|
|
3542
4049
|
summary: string;
|
|
3543
4050
|
/** Tasks per status. */
|
|
@@ -3550,6 +4057,8 @@ export interface CompliancePlanSummary {
|
|
|
3550
4057
|
verifying: number;
|
|
3551
4058
|
/** Tasks waiting for a human answer. */
|
|
3552
4059
|
manual: number;
|
|
4060
|
+
/** Tasks that only wait for a live observation (count as compliant). */
|
|
4061
|
+
pending_live_check?: number;
|
|
3553
4062
|
/** Done tasks. */
|
|
3554
4063
|
done: number;
|
|
3555
4064
|
/** Declined tasks. */
|
|
@@ -3576,7 +4085,7 @@ export interface CompliancePlanSummary {
|
|
|
3576
4085
|
/** Task key. */
|
|
3577
4086
|
key: string;
|
|
3578
4087
|
/** Task status. */
|
|
3579
|
-
status: "open" | "in_progress" | "verifying" | "done" | "wont_fix" | "manual";
|
|
4088
|
+
status: "open" | "in_progress" | "verifying" | "done" | "wont_fix" | "manual" | "pending_live_check";
|
|
3580
4089
|
/** Priority. */
|
|
3581
4090
|
priority: "critical" | "high" | "medium" | "low";
|
|
3582
4091
|
/** Title. */
|
|
@@ -3594,7 +4103,7 @@ export interface Notice {
|
|
|
3594
4103
|
/** The site. */
|
|
3595
4104
|
site: string;
|
|
3596
4105
|
/** Notice kind. */
|
|
3597
|
-
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change";
|
|
4106
|
+
kind: "acknowledgment" | "trial_ending" | "renewal_reminder" | "annual_terms" | "price_change" | "cancellation_confirmation" | "charge_notice";
|
|
3598
4107
|
/** Delivery status. */
|
|
3599
4108
|
status: "claimed" | "sent" | "failed" | "bounced" | "skipped";
|
|
3600
4109
|
/** Billing platform of the subscription. */
|
|
@@ -3813,6 +4322,11 @@ export interface ListLawUpdatesParams {
|
|
|
3813
4322
|
/** Only changes on or after this date (YYYY-MM-DD). */
|
|
3814
4323
|
since?: string;
|
|
3815
4324
|
}
|
|
4325
|
+
/** Parameters of `suggestions.forSite()` (listSiteSuggestions). */
|
|
4326
|
+
export interface ListSiteSuggestionsParams {
|
|
4327
|
+
/** Comma-separated surfaces to include (default all). */
|
|
4328
|
+
surfaces?: string;
|
|
4329
|
+
}
|
|
3816
4330
|
/** Parameters of `consents.list()` (listConsents). */
|
|
3817
4331
|
export interface ListConsentsParams {
|
|
3818
4332
|
/** Number of objects to return, 1-100 (default 10). */
|
|
@@ -3884,6 +4398,8 @@ export interface ListStripeCheckoutConfigsParams {
|
|
|
3884
4398
|
}
|
|
3885
4399
|
/** Parameters of `testRuns.create()` (createTestRun). */
|
|
3886
4400
|
export interface CreateTestRunParams {
|
|
4401
|
+
/** Stripe runs. mirror (default): Checkbox mirrors your checkout into test mode and moves a test clock through every legal notice window. real_checkout ("Run proof"): the shopper buys through YOUR checkout on your test deployment (stripe.checkout_url or stripe.payment_link) with card 4242 and the run inbox, so your own webhook handlers and email code fire; Checkbox watches the inbox, Stripe's events and your cancel flow. Needs your test deployment on Stripe TEST keys with a test-mode webhook endpoint. */
|
|
4402
|
+
mode?: "mirror" | "real_checkout";
|
|
3887
4403
|
/** stripe (default when a Stripe test key is stored or the site uses Stripe) or generic (test coupon / test account, no time travel). */
|
|
3888
4404
|
type?: "stripe" | "generic";
|
|
3889
4405
|
/** How long to wait for each email (acknowledgment, reminders, cancellation), 15-900 seconds (default 120). */
|
|
@@ -3896,7 +4412,7 @@ export interface CreateTestRunParams {
|
|
|
3896
4412
|
region?: "US-FED" | "US-AL" | "US-AK" | "US-AZ" | "US-AR" | "US-CA" | "US-CO" | "US-CT" | "US-DE" | "US-DC" | "US-FL" | "US-GA" | "US-HI" | "US-ID" | "US-IL" | "US-IN" | "US-IA" | "US-KS" | "US-KY" | "US-LA" | "US-ME" | "US-MD" | "US-MA" | "US-MI" | "US-MN" | "US-MS" | "US-MO" | "US-MT" | "US-NE" | "US-NV" | "US-NH" | "US-NJ" | "US-NM" | "US-NY" | "US-NC" | "US-ND" | "US-OH" | "US-OK" | "US-OR" | "US-PA" | "US-RI" | "US-SC" | "US-SD" | "US-TN" | "US-TX" | "US-UT" | "US-VT" | "US-VA" | "US-WA" | "US-WV" | "US-WI" | "US-WY";
|
|
3897
4413
|
/** Stripe options. */
|
|
3898
4414
|
stripe?: {
|
|
3899
|
-
/** Registered checkout config (scc_…) to mirror; default: the newest one, else your latest live Checkout Session. */
|
|
4415
|
+
/** Registered checkout config (scc_…) to mirror; default: the newest one, else your latest live Checkout Session. "none" skips the registered configs (mirror your live checkout, stripe.price or stripe.payment_link instead). */
|
|
3900
4416
|
checkout_config?: string;
|
|
3901
4417
|
/** A test-mode price to subscribe to when nothing is registered. */
|
|
3902
4418
|
price?: string;
|
|
@@ -3906,8 +4422,33 @@ export interface CreateTestRunParams {
|
|
|
3906
4422
|
price_map?: Record<string, string>;
|
|
3907
4423
|
/** Steps that complete your hosted checkout with card 4242 4242 4242 4242 when it differs from Stripe's default page. */
|
|
3908
4424
|
checkout_steps?: Array<ScanStep>;
|
|
3909
|
-
/**
|
|
4425
|
+
/** Your cancellation page (after login with test_account, or public). Checkbox never falls back to the Stripe portal when your flow fails. */
|
|
3910
4426
|
cancel_url?: string;
|
|
4427
|
+
/** Clicks that cancel in your flow (after login / cancel_url), e.g. [{ "action": "click", "text": "Cancel subscription" }, { "action": "click", "text": "Confirm" }]. */
|
|
4428
|
+
cancel_steps?: Array<ScanStep>;
|
|
4429
|
+
/** How your customers cancel. Default: your flow when test_account / cancel_url / cancel_steps describe it, else the Stripe portal reported as a warning (cancel_flow_not_configured). */
|
|
4430
|
+
cancel_via?: "merchant_flow" | "stripe_portal";
|
|
4431
|
+
/** A test account the shopper logs into: to buy as a logged-in user (real_checkout) and to cancel through your in-app flow. Mail to its address counts when you BCC the site's Checkbox address. */
|
|
4432
|
+
test_account?: {
|
|
4433
|
+
/** Login page of the test account on your (test) deployment. */
|
|
4434
|
+
login_url: string;
|
|
4435
|
+
/** Its email; "{{inbox}}" = the run inbox (the account the shopper creates at checkout). */
|
|
4436
|
+
email: string;
|
|
4437
|
+
/** Its password (stored encrypted, never returned). Generated for "{{inbox}}" accounts when omitted. */
|
|
4438
|
+
password?: string;
|
|
4439
|
+
/** Custom login steps ({{email}}, {{password}}). */
|
|
4440
|
+
login_steps?: Array<ScanStep>;
|
|
4441
|
+
};
|
|
4442
|
+
/** A Stripe Payment Link (plink_… or its buy.stripe.com URL): mirror mode mirrors its prices, custom_text, consent_collection and trial; real_checkout buys through it (test-mode links only). */
|
|
4443
|
+
payment_link?: string;
|
|
4444
|
+
/** real_checkout: the page of your TEST deployment that leads to your Stripe test-mode checkout (a pricing page, or a route that creates the Checkout Session and redirects). */
|
|
4445
|
+
checkout_url?: string;
|
|
4446
|
+
/** real_checkout: clicks from checkout_url to the payment page, e.g. [{ "action": "click", "text": "Start free trial" }]. */
|
|
4447
|
+
pre_checkout_steps?: Array<ScanStep>;
|
|
4448
|
+
/** A page of your test deployment Checkbox opens before the checkout (after logging in) that CLEANS UP the test account (ends its subscription), so every run starts without one. Mirror mode opens it before cancelling the test account's subscription. (Round 3: renamed from reset_url, which meant the opposite of the site's test_account.reactivate_url.) */
|
|
4449
|
+
cleanup_url?: string;
|
|
4450
|
+
/** Deprecated alias of cleanup_url. */
|
|
4451
|
+
reset_url?: string;
|
|
3911
4452
|
};
|
|
3912
4453
|
/** Generic (non-Stripe) options. */
|
|
3913
4454
|
generic?: {
|
|
@@ -3950,7 +4491,7 @@ export interface ListTestRunsParams {
|
|
|
3950
4491
|
export interface CreateWebhookEndpointParams {
|
|
3951
4492
|
/** HTTPS URL. */
|
|
3952
4493
|
url: string;
|
|
3953
|
-
/** Event types to send, or ["*"] for all: site.score_changed,
|
|
4494
|
+
/** Event types to send, or ["*"] for all: site.score_changed, finding.created, finding.resolved, scan.completed, scan.failed, law.changed, certificate.issued, certificate.lapsed, certificate.revoked, notice.sent, notice.due, notice.overdue, consent.created, receipt.created, test_run.completed, test_run.failed, plan.updated, site.compliant, task.verified. */
|
|
3954
4495
|
enabled_events: Array<string>;
|
|
3955
4496
|
/** Description. */
|
|
3956
4497
|
description?: string;
|
|
@@ -3970,7 +4511,7 @@ export interface ListWebhookEndpointsParams {
|
|
|
3970
4511
|
export interface UpdateWebhookEndpointParams {
|
|
3971
4512
|
/** HTTPS URL. */
|
|
3972
4513
|
url?: string;
|
|
3973
|
-
/** Event types to send, or ["*"] for all: site.score_changed,
|
|
4514
|
+
/** Event types to send, or ["*"] for all: site.score_changed, finding.created, finding.resolved, scan.completed, scan.failed, law.changed, certificate.issued, certificate.lapsed, certificate.revoked, notice.sent, notice.due, notice.overdue, consent.created, receipt.created, test_run.completed, test_run.failed, plan.updated, site.compliant, task.verified. */
|
|
3974
4515
|
enabled_events?: Array<string>;
|
|
3975
4516
|
/** Description (null clears it). */
|
|
3976
4517
|
description?: string | null;
|
|
@@ -4076,16 +4617,6 @@ export type SiteScoreChangedEvent = Event & {
|
|
|
4076
4617
|
previous_attributes?: Record<string, unknown>;
|
|
4077
4618
|
};
|
|
4078
4619
|
};
|
|
4079
|
-
/** `site.insurable_changed`: A site became insurable or stopped being insurable. */
|
|
4080
|
-
export type SiteInsurableChangedEvent = Event & {
|
|
4081
|
-
/** Event type. */
|
|
4082
|
-
type?: "site.insurable_changed";
|
|
4083
|
-
data?: {
|
|
4084
|
-
object: Site;
|
|
4085
|
-
/** Previous values of changed fields. */
|
|
4086
|
-
previous_attributes?: Record<string, unknown>;
|
|
4087
|
-
};
|
|
4088
|
-
};
|
|
4089
4620
|
/** `finding.created`: A check started failing (new finding, or a resolved / passing one failing again). */
|
|
4090
4621
|
export type FindingCreatedEvent = Event & {
|
|
4091
4622
|
/** Event type. */
|
|
@@ -4197,9 +4728,9 @@ export type SiteCompliantEvent = Event & {
|
|
|
4197
4728
|
};
|
|
4198
4729
|
};
|
|
4199
4730
|
/** Every event Checkbox delivers to webhook endpoints, discriminated by `type`. */
|
|
4200
|
-
export type WebhookEvent = PlanUpdatedEvent | TaskVerifiedEvent | NoticeDueEvent | NoticeOverdueEvent | ReceiptCreatedEvent | TestRunCompletedEvent | TestRunFailedEvent | SiteScoreChangedEvent |
|
|
4731
|
+
export type WebhookEvent = PlanUpdatedEvent | TaskVerifiedEvent | NoticeDueEvent | NoticeOverdueEvent | ReceiptCreatedEvent | TestRunCompletedEvent | TestRunFailedEvent | SiteScoreChangedEvent | FindingCreatedEvent | FindingResolvedEvent | ScanCompletedEvent | ScanFailedEvent | LawChangedEvent | CertificateIssuedEvent | CertificateLapsedEvent | CertificateRevokedEvent | NoticeSentEvent | ConsentCreatedEvent | SiteCompliantEvent;
|
|
4201
4732
|
/** Every webhook event type. */
|
|
4202
|
-
export declare const WEBHOOK_EVENT_TYPES: readonly ["plan.updated", "task.verified", "notice.due", "notice.overdue", "receipt.created", "test_run.completed", "test_run.failed", "site.score_changed", "
|
|
4733
|
+
export declare const WEBHOOK_EVENT_TYPES: readonly ["plan.updated", "task.verified", "notice.due", "notice.overdue", "receipt.created", "test_run.completed", "test_run.failed", "site.score_changed", "finding.created", "finding.resolved", "scan.completed", "scan.failed", "law.changed", "certificate.issued", "certificate.lapsed", "certificate.revoked", "notice.sent", "consent.created", "site.compliant"];
|
|
4203
4734
|
export type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
|
|
4204
4735
|
/** Stable error codes (`error.code`), with HTTP status, type and meaning. Codes are never renamed. */
|
|
4205
4736
|
export declare const ERROR_CODES: {
|