@checkbox-site/node 0.1.0 → 0.2.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.
- package/README.md +3 -1
- package/dist/client.d.ts +104 -2
- package/dist/client.js +3 -2
- package/dist/generated/operations.d.ts +240 -31
- package/dist/generated/operations.js +215 -27
- package/dist/generated/types.d.ts +1353 -156
- package/dist/generated/types.js +8 -3
- package/dist/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -341,6 +341,23 @@ export const OPERATIONS = {
|
|
|
341
341
|
paginated: false,
|
|
342
342
|
summary: "Check domain verification now",
|
|
343
343
|
},
|
|
344
|
+
resyncBilling: {
|
|
345
|
+
operationId: "resyncBilling",
|
|
346
|
+
namespace: "billings",
|
|
347
|
+
method: "resync",
|
|
348
|
+
httpMethod: "POST",
|
|
349
|
+
path: "/v1/sites/{site}/billing/resync",
|
|
350
|
+
pathParams: ["site"],
|
|
351
|
+
queryParams: [],
|
|
352
|
+
body: false,
|
|
353
|
+
idempotent: true,
|
|
354
|
+
auth: true,
|
|
355
|
+
scope: "sites:write",
|
|
356
|
+
response: "json",
|
|
357
|
+
list: false,
|
|
358
|
+
paginated: false,
|
|
359
|
+
summary: "Re-sync Stripe settings",
|
|
360
|
+
},
|
|
344
361
|
createScan: {
|
|
345
362
|
operationId: "createScan",
|
|
346
363
|
namespace: "scans",
|
|
@@ -681,6 +698,23 @@ export const OPERATIONS = {
|
|
|
681
698
|
paginated: false,
|
|
682
699
|
summary: "List fix plans for a site",
|
|
683
700
|
},
|
|
701
|
+
publishShopifyTerms: {
|
|
702
|
+
operationId: "publishShopifyTerms",
|
|
703
|
+
namespace: "fixes",
|
|
704
|
+
method: "publishShopifyTerms",
|
|
705
|
+
httpMethod: "POST",
|
|
706
|
+
path: "/v1/sites/{site}/fixes/shopify/publish",
|
|
707
|
+
pathParams: ["site"],
|
|
708
|
+
queryParams: [],
|
|
709
|
+
body: true,
|
|
710
|
+
idempotent: true,
|
|
711
|
+
auth: true,
|
|
712
|
+
scope: "fixes:write",
|
|
713
|
+
response: "json",
|
|
714
|
+
list: false,
|
|
715
|
+
paginated: false,
|
|
716
|
+
summary: "Publish the renewal terms to the Shopify app block",
|
|
717
|
+
},
|
|
684
718
|
listEvidence: {
|
|
685
719
|
operationId: "listEvidence",
|
|
686
720
|
namespace: "evidence",
|
|
@@ -1089,6 +1123,40 @@ export const OPERATIONS = {
|
|
|
1089
1123
|
paginated: false,
|
|
1090
1124
|
summary: "Get the dates each required notice must be sent",
|
|
1091
1125
|
},
|
|
1126
|
+
listSiteSuggestions: {
|
|
1127
|
+
operationId: "listSiteSuggestions",
|
|
1128
|
+
namespace: "suggestions",
|
|
1129
|
+
method: "forSite",
|
|
1130
|
+
httpMethod: "GET",
|
|
1131
|
+
path: "/v1/sites/{site}/suggestions",
|
|
1132
|
+
pathParams: ["site"],
|
|
1133
|
+
queryParams: ["surfaces"],
|
|
1134
|
+
body: false,
|
|
1135
|
+
idempotent: false,
|
|
1136
|
+
auth: true,
|
|
1137
|
+
scope: "checks:read",
|
|
1138
|
+
response: "json",
|
|
1139
|
+
list: false,
|
|
1140
|
+
paginated: false,
|
|
1141
|
+
summary: "Get conversion suggestions for a site",
|
|
1142
|
+
},
|
|
1143
|
+
suggestImprovements: {
|
|
1144
|
+
operationId: "suggestImprovements",
|
|
1145
|
+
namespace: "suggestions",
|
|
1146
|
+
method: "generate",
|
|
1147
|
+
httpMethod: "POST",
|
|
1148
|
+
path: "/v1/suggestions",
|
|
1149
|
+
pathParams: [],
|
|
1150
|
+
queryParams: [],
|
|
1151
|
+
body: true,
|
|
1152
|
+
idempotent: false,
|
|
1153
|
+
auth: true,
|
|
1154
|
+
scope: "checks:read",
|
|
1155
|
+
response: "json",
|
|
1156
|
+
list: false,
|
|
1157
|
+
paginated: false,
|
|
1158
|
+
summary: "Get conversion suggestions for copy you send",
|
|
1159
|
+
},
|
|
1092
1160
|
getElementsBundle: {
|
|
1093
1161
|
operationId: "getElementsBundle",
|
|
1094
1162
|
namespace: "elements",
|
|
@@ -1531,6 +1599,23 @@ export const OPERATIONS = {
|
|
|
1531
1599
|
paginated: false,
|
|
1532
1600
|
summary: "Delete a registered checkout config",
|
|
1533
1601
|
},
|
|
1602
|
+
deleteSiteStripeCheckoutConfig: {
|
|
1603
|
+
operationId: "deleteSiteStripeCheckoutConfig",
|
|
1604
|
+
namespace: "siteStripeCheckoutConfigs",
|
|
1605
|
+
method: "del",
|
|
1606
|
+
httpMethod: "DELETE",
|
|
1607
|
+
path: "/v1/sites/{site}/stripe_checkout_configs/{stripe_checkout_config}",
|
|
1608
|
+
pathParams: ["site", "stripe_checkout_config"],
|
|
1609
|
+
queryParams: [],
|
|
1610
|
+
body: false,
|
|
1611
|
+
idempotent: false,
|
|
1612
|
+
auth: true,
|
|
1613
|
+
scope: "test_runs:write",
|
|
1614
|
+
response: "json",
|
|
1615
|
+
list: false,
|
|
1616
|
+
paginated: false,
|
|
1617
|
+
summary: "Delete a registered checkout config (site path)",
|
|
1618
|
+
},
|
|
1534
1619
|
createTestRun: {
|
|
1535
1620
|
operationId: "createTestRun",
|
|
1536
1621
|
namespace: "testRuns",
|
|
@@ -1572,7 +1657,7 @@ export const OPERATIONS = {
|
|
|
1572
1657
|
httpMethod: "GET",
|
|
1573
1658
|
path: "/v1/test_runs/{test_run}",
|
|
1574
1659
|
pathParams: ["test_run"],
|
|
1575
|
-
queryParams: [],
|
|
1660
|
+
queryParams: ["wait"],
|
|
1576
1661
|
body: false,
|
|
1577
1662
|
idempotent: false,
|
|
1578
1663
|
auth: true,
|
|
@@ -1752,6 +1837,23 @@ export const OPERATIONS = {
|
|
|
1752
1837
|
paginated: false,
|
|
1753
1838
|
summary: "Send feedback",
|
|
1754
1839
|
},
|
|
1840
|
+
claimReviewPrompt: {
|
|
1841
|
+
operationId: "claimReviewPrompt",
|
|
1842
|
+
namespace: "reviewPrompts",
|
|
1843
|
+
method: "claim",
|
|
1844
|
+
httpMethod: "POST",
|
|
1845
|
+
path: "/v1/sites/{site}/review_prompt",
|
|
1846
|
+
pathParams: ["site"],
|
|
1847
|
+
queryParams: [],
|
|
1848
|
+
body: true,
|
|
1849
|
+
idempotent: false,
|
|
1850
|
+
auth: true,
|
|
1851
|
+
scope: "compliance_plans:read",
|
|
1852
|
+
response: "json",
|
|
1853
|
+
list: false,
|
|
1854
|
+
paginated: false,
|
|
1855
|
+
summary: "Claim the one-time review prompt for a site",
|
|
1856
|
+
},
|
|
1755
1857
|
};
|
|
1756
1858
|
/** `checkbox.device` */
|
|
1757
1859
|
export class DeviceResource extends Resource {
|
|
@@ -1823,7 +1925,7 @@ export class SetupSessionsResource extends Resource {
|
|
|
1823
1925
|
/**
|
|
1824
1926
|
* Re-check the site now.
|
|
1825
1927
|
*
|
|
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.
|
|
1928
|
+
* 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. While the domain is not verified: a live snippet (or the checkbox-verify meta tag) on the homepage verifies it now; otherwise a read-only scan of the site's own public pages is queued (unverified: no checkout is submitted). Call it after every change the agent made (and after deploying). Returns what was seen plus the updated session.
|
|
1827
1929
|
*
|
|
1828
1930
|
* @param setupSession Unique identifier of the setup session (setup_…).
|
|
1829
1931
|
* @see POST /v1/setup_sessions/{setup_session}/verify (operation `verifySetupSession`, scope `setup_sessions:write`)
|
|
@@ -1858,7 +1960,7 @@ export class AccountResource extends Resource {
|
|
|
1858
1960
|
/**
|
|
1859
1961
|
* Update the account.
|
|
1860
1962
|
*
|
|
1861
|
-
* Pins the account to an API version (requests without a Checkbox-Version header use it
|
|
1963
|
+
* Pins the account to an API version (requests without a Checkbox-Version header use it; known versions: 2026-10-30), sets the default retention, and turns the account-wide legal hold on or off. Retention and legal hold apply to the key's mode (test mode has its own).
|
|
1862
1964
|
*
|
|
1863
1965
|
* @see POST /v1/account (operation `updateAccount`, scope `account:write`)
|
|
1864
1966
|
*/
|
|
@@ -1891,7 +1993,7 @@ export class SitesResource extends Resource {
|
|
|
1891
1993
|
/**
|
|
1892
1994
|
* Retrieve a site.
|
|
1893
1995
|
*
|
|
1894
|
-
* Returns a site with its latest compliance
|
|
1996
|
+
* Returns a site with its latest compliance status (label and counts) and install details.
|
|
1895
1997
|
*
|
|
1896
1998
|
* @param site Unique identifier of the site (site_…).
|
|
1897
1999
|
* @see GET /v1/sites/{site} (operation `retrieveSite`, scope `sites:read`)
|
|
@@ -1913,7 +2015,7 @@ export class SitesResource extends Resource {
|
|
|
1913
2015
|
/**
|
|
1914
2016
|
* Archive a site.
|
|
1915
2017
|
*
|
|
1916
|
-
* Archives (soft-deletes) the site: monitoring stops and it disappears from lists, but evidence and findings are retained
|
|
2018
|
+
* Archives (soft-deletes) the site: monitoring stops and it disappears from lists, but evidence and findings are retained. Undo with restoreSite.
|
|
1917
2019
|
*
|
|
1918
2020
|
* @param site Unique identifier of the site (site_…).
|
|
1919
2021
|
* @see DELETE /v1/sites/{site} (operation `deleteSite`, scope `sites:write`)
|
|
@@ -1939,7 +2041,7 @@ export class SitesResource extends Resource {
|
|
|
1939
2041
|
/**
|
|
1940
2042
|
* Connect a billing platform.
|
|
1941
2043
|
*
|
|
1942
|
-
* Connects the site's billing platform with read-only credentials (a Stripe restricted key, a Recharge token
|
|
2044
|
+
* Connects the site's billing platform with read-only credentials (a Stripe restricted key, a Recharge token, a Shopify Admin API token, a Chargebee read-only API key, a Recurly private API key or a Paddle API key with read permissions), 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.
|
|
1943
2045
|
*
|
|
1944
2046
|
* @param site Unique identifier of the site (site_…).
|
|
1945
2047
|
* @see POST /v1/sites/{site}/integrations (operation `connectBillingPlatform`, scope `sites:write`)
|
|
@@ -1986,7 +2088,7 @@ export class DomainVerificationsResource extends Resource {
|
|
|
1986
2088
|
/**
|
|
1987
2089
|
* Check domain verification now.
|
|
1988
2090
|
*
|
|
1989
|
-
* Looks for the DNS TXT record
|
|
2091
|
+
* Looks for the DNS TXT record, the /.well-known file, and the site's Checkbox snippet or the checkbox-verify meta tag on https://<domain>/ now. On success in live mode, the account is activated and held monitoring starts.
|
|
1990
2092
|
*
|
|
1991
2093
|
* @param site Unique identifier of the site (site_…).
|
|
1992
2094
|
* @see POST /v1/sites/{site}/domain_verification/check (operation `checkDomainVerification`, scope `sites:write`)
|
|
@@ -1995,6 +2097,20 @@ export class DomainVerificationsResource extends Resource {
|
|
|
1995
2097
|
return this._request(OPERATIONS.checkDomainVerification, [site], undefined, options);
|
|
1996
2098
|
}
|
|
1997
2099
|
}
|
|
2100
|
+
/** `checkbox.billings` */
|
|
2101
|
+
export class BillingsResource extends Resource {
|
|
2102
|
+
/**
|
|
2103
|
+
* Re-sync Stripe settings.
|
|
2104
|
+
*
|
|
2105
|
+
* Re-reads the site's billing-platform settings now (Stripe customer-portal cancellation, trial-ending emails, plans) and re-evaluates the site, so a setting you just changed in Stripe shows up without waiting for the next scan. Every scan also re-reads them. Then poll retrieveLatestEvaluation (or listFindings) after about a minute.
|
|
2106
|
+
*
|
|
2107
|
+
* @param site Unique identifier of the site (site_…).
|
|
2108
|
+
* @see POST /v1/sites/{site}/billing/resync (operation `resyncBilling`, scope `sites:write`)
|
|
2109
|
+
*/
|
|
2110
|
+
resync(site, options) {
|
|
2111
|
+
return this._request(OPERATIONS.resyncBilling, [site], undefined, options);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
1998
2114
|
/** `checkbox.scans` */
|
|
1999
2115
|
export class ScansResource extends Resource {
|
|
2000
2116
|
/**
|
|
@@ -2046,7 +2162,7 @@ export class EvaluationsResource extends Resource {
|
|
|
2046
2162
|
/**
|
|
2047
2163
|
* List evaluations.
|
|
2048
2164
|
*
|
|
2049
|
-
* Verdicts newest first (
|
|
2165
|
+
* Verdicts newest first (status history), optionally for one site.
|
|
2050
2166
|
*
|
|
2051
2167
|
* @see GET /v1/evaluations (operation `listEvaluations`, scope `evaluations:read`)
|
|
2052
2168
|
*/
|
|
@@ -2056,7 +2172,7 @@ export class EvaluationsResource extends Resource {
|
|
|
2056
2172
|
/**
|
|
2057
2173
|
* Retrieve an evaluation.
|
|
2058
2174
|
*
|
|
2059
|
-
* Returns one verdict with all checks and the
|
|
2175
|
+
* Returns one verdict with all checks and the blocking checks.
|
|
2060
2176
|
*
|
|
2061
2177
|
* @param evaluation Unique identifier of the evaluation (eval_…).
|
|
2062
2178
|
* @see GET /v1/evaluations/{evaluation} (operation `retrieveEvaluation`, scope `evaluations:read`)
|
|
@@ -2067,7 +2183,7 @@ export class EvaluationsResource extends Resource {
|
|
|
2067
2183
|
/**
|
|
2068
2184
|
* Get the current verdict of a site.
|
|
2069
2185
|
*
|
|
2070
|
-
* The latest evaluation of the site:
|
|
2186
|
+
* The latest evaluation of the site: its compliance status and what blocks it. 404 resource_missing with next_action createScan when the site was never evaluated.
|
|
2071
2187
|
*
|
|
2072
2188
|
* @param site Unique identifier of the site (site_…).
|
|
2073
2189
|
* @see GET /v1/sites/{site}/evaluation (operation `retrieveLatestEvaluation`, scope `evaluations:read`)
|
|
@@ -2081,7 +2197,7 @@ export class FindingsResource extends Resource {
|
|
|
2081
2197
|
/**
|
|
2082
2198
|
* List findings.
|
|
2083
2199
|
*
|
|
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
|
|
2200
|
+
* 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 so the checks pass.
|
|
2085
2201
|
*
|
|
2086
2202
|
* @see GET /v1/findings (operation `listFindings`, scope `findings:read`)
|
|
2087
2203
|
*/
|
|
@@ -2116,7 +2232,7 @@ export class PlansResource extends Resource {
|
|
|
2116
2232
|
/**
|
|
2117
2233
|
* Get the compliance plan for a site.
|
|
2118
2234
|
*
|
|
2119
|
-
* Ordered tasks that make the site
|
|
2235
|
+
* Ordered tasks that make the site's checks pass, 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, and repeat until the checks pass (status value compliant; status_label "Checks pass"). Tasks with status manual hold a question for the human (answerTask); they never block the others.
|
|
2120
2236
|
*
|
|
2121
2237
|
* @param site Unique identifier of the site (site_…).
|
|
2122
2238
|
* @see GET /v1/sites/{site}/plan (operation `retrieveCompliancePlan`, scope `compliance_plans:read`)
|
|
@@ -2177,7 +2293,7 @@ export class VerificationsResource extends Resource {
|
|
|
2177
2293
|
/**
|
|
2178
2294
|
* Get a verification (long-poll with ?wait=30).
|
|
2179
2295
|
*
|
|
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.
|
|
2296
|
+
* The verification's status (pending, passed, failed), expected vs observed per check, the diff and next_action. Also takes a task id (task_…): the newest verification of that task. ?wait=N (≤ 30) holds the request until it resolves or N seconds pass.
|
|
2181
2297
|
*
|
|
2182
2298
|
* @param verification Unique identifier of the verification (ver_…).
|
|
2183
2299
|
* @see GET /v1/verifications/{verification} (operation `retrieveVerification`, scope `compliance_plans:read`)
|
|
@@ -2221,6 +2337,17 @@ export class FixesResource extends Resource {
|
|
|
2221
2337
|
list(site, params, options) {
|
|
2222
2338
|
return this._request(OPERATIONS.listSiteFixes, [site], params, options);
|
|
2223
2339
|
}
|
|
2340
|
+
/**
|
|
2341
|
+
* Publish the renewal terms to the Shopify app block.
|
|
2342
|
+
*
|
|
2343
|
+
* For a Shopify store connected through the Checkbox Shopify app (site.shopify.connection = app): generates the renewal disclosure and consent label from the site's real plan, verifies them against the rules engine, and publishes them to the app-owned metafield the Checkbox "Renewal terms + consent" theme block reads. Nothing else in the store changes (no theme, product or checkout edits). The merchant places the block once in the theme editor (theme_editor_url); after that, publishing again updates the text the block shows. Then verify the sign-up task (verifyTask) or the site (verifySite). Errors: shopify_not_connected (only the merchant can install and connect the app; next_action has the step), terms_incomplete (problems lists the missing plan facts; next_action names the call that sets them), fix_verification_failed, platform_error (Shopify refused the write). In test mode it acts on test-mode sites, whose connected store is written the same way.
|
|
2344
|
+
*
|
|
2345
|
+
* @param site Unique identifier of the site (site_…).
|
|
2346
|
+
* @see POST /v1/sites/{site}/fixes/shopify/publish (operation `publishShopifyTerms`, scope `fixes:write`, live mode needs an activated account)
|
|
2347
|
+
*/
|
|
2348
|
+
publishShopifyTerms(site, params, options) {
|
|
2349
|
+
return this._request(OPERATIONS.publishShopifyTerms, [site], params, options);
|
|
2350
|
+
}
|
|
2224
2351
|
}
|
|
2225
2352
|
/** `checkbox.evidence` */
|
|
2226
2353
|
export class EvidenceResource extends Resource {
|
|
@@ -2294,7 +2421,7 @@ export class CertificatesResource extends Resource {
|
|
|
2294
2421
|
/**
|
|
2295
2422
|
* Issue a certificate.
|
|
2296
2423
|
*
|
|
2297
|
-
* Issues a signed monitoring certificate once the site has
|
|
2424
|
+
* Issues a signed monitoring certificate once the site has passed every critical and high check 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
2425
|
*
|
|
2299
2426
|
* @param site Unique identifier of the site (site_…).
|
|
2300
2427
|
* @see POST /v1/sites/{site}/certificates (operation `createCertificate`, scope `certificates:write`, live mode needs an activated account)
|
|
@@ -2330,7 +2457,7 @@ export class NoticeSettingsResource extends Resource {
|
|
|
2330
2457
|
/**
|
|
2331
2458
|
* Update notice settings.
|
|
2332
2459
|
*
|
|
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
|
|
2460
|
+
* 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. add_kinds / remove_kinds turn single notices on or off and leave the others as they are; enabled_kinds replaces the whole list. In checkbox mode, turning a notice on requires cancel_url, a confirmed policy, a connected Stripe, Recharge, Chargebee, Recurly or Paddle account and a sending address; otherwise resource_conflict explains what is missing.
|
|
2334
2461
|
*
|
|
2335
2462
|
* @param site Unique identifier of the site (site_…).
|
|
2336
2463
|
* @see POST /v1/sites/{site}/notice_settings (operation `updateNoticeSettings`, scope `notices:write`, live mode needs an activated account)
|
|
@@ -2434,7 +2561,7 @@ export class ChecksResource extends Resource {
|
|
|
2434
2561
|
/**
|
|
2435
2562
|
* Check checkout disclosure text.
|
|
2436
2563
|
*
|
|
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`:
|
|
2564
|
+
* 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`: suggested text that passes the checks and drop-in HTML (and the same markup as JSX for React) 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
2565
|
*
|
|
2439
2566
|
* @see POST /v1/checks/disclosure (operation `checkDisclosure`, scope `checks:read`)
|
|
2440
2567
|
*/
|
|
@@ -2464,7 +2591,7 @@ export class ChecksResource extends Resource {
|
|
|
2464
2591
|
/**
|
|
2465
2592
|
* Check a subscription lifecycle email.
|
|
2466
2593
|
*
|
|
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
|
|
2594
|
+
* 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. Prices are judged against what Stripe charges: with `site` (or, without it, the account's one site with Stripe connected) the plan fields come from the site's plans and the email is matched to the plan it names ("Annual") first; a price that contradicts it fails, and `warnings` say which site and plan were used. Returns `required_by` (requirements that make the email mandatory for this plan) and a `template` that passes the checks, 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
2595
|
*
|
|
2469
2596
|
* @see POST /v1/checks/email (operation `checkEmail`, scope `checks:read`)
|
|
2470
2597
|
*/
|
|
@@ -2484,7 +2611,7 @@ export class ChecksResource extends Resource {
|
|
|
2484
2611
|
/**
|
|
2485
2612
|
* Get the dates each required notice must be sent.
|
|
2486
2613
|
*
|
|
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
|
|
2614
|
+
* 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 allowed send 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
2615
|
*
|
|
2489
2616
|
* @see POST /v1/checks/notice_schedule (operation `checkNoticeSchedule`, scope `checks:read`)
|
|
2490
2617
|
*/
|
|
@@ -2492,6 +2619,30 @@ export class ChecksResource extends Resource {
|
|
|
2492
2619
|
return this._request(OPERATIONS.checkNoticeSchedule, [], params, options);
|
|
2493
2620
|
}
|
|
2494
2621
|
}
|
|
2622
|
+
/** `checkbox.suggestions` */
|
|
2623
|
+
export class SuggestionsResource extends Resource {
|
|
2624
|
+
/**
|
|
2625
|
+
* Get conversion suggestions for a site.
|
|
2626
|
+
*
|
|
2627
|
+
* Suggestions for a site, detected from what Checkbox observed (checkout captures, emails, the test cancellation, billing settings, registered Stripe Checkout params) and its latest evaluation. Optional, deterministic suggestions (no LLM) from Checkbox’s curated library: each has the surface, what to change, why it commonly helps (no invented figures), a concrete before/after built from your plan terms, the exact copy / Stripe patch / flow change to apply, the legal guardrails it respects (catalog requirement ids, e.g. California’s and Minnesota’s save-offer rules), and the engine check of the after-example (only verified suggestions are offered). Surfaces whose compliance checks fail are held until fixed. Suggestions never block and never count toward compliance.
|
|
2628
|
+
*
|
|
2629
|
+
* @param site Unique identifier of the site (site_…).
|
|
2630
|
+
* @see GET /v1/sites/{site}/suggestions (operation `listSiteSuggestions`, scope `checks:read`)
|
|
2631
|
+
*/
|
|
2632
|
+
forSite(site, params, options) {
|
|
2633
|
+
return this._request(OPERATIONS.listSiteSuggestions, [site], params, options);
|
|
2634
|
+
}
|
|
2635
|
+
/**
|
|
2636
|
+
* Get conversion suggestions for copy you send.
|
|
2637
|
+
*
|
|
2638
|
+
* Stateless: send any of the inputs of /v1/checks/* (disclosure, page html, Stripe Checkout params, emails) plus a cancellation flow and your plan terms; get suggestions for them. The current status of what you send comes from the same preflight checks; nothing is stored. Optional, deterministic suggestions (no LLM) from Checkbox’s curated library: each has the surface, what to change, why it commonly helps (no invented figures), a concrete before/after built from your plan terms, the exact copy / Stripe patch / flow change to apply, the legal guardrails it respects (catalog requirement ids, e.g. California’s and Minnesota’s save-offer rules), and the engine check of the after-example (only verified suggestions are offered). Surfaces whose compliance checks fail are held until fixed. Suggestions never block and never count toward compliance.
|
|
2639
|
+
*
|
|
2640
|
+
* @see POST /v1/suggestions (operation `suggestImprovements`, scope `checks:read`)
|
|
2641
|
+
*/
|
|
2642
|
+
generate(params, options) {
|
|
2643
|
+
return this._request(OPERATIONS.suggestImprovements, [], params, options);
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2495
2646
|
/** `checkbox.elements` */
|
|
2496
2647
|
export class ElementsResource extends Resource {
|
|
2497
2648
|
/**
|
|
@@ -2633,7 +2784,7 @@ export class ReceiptsResource extends Resource {
|
|
|
2633
2784
|
/**
|
|
2634
2785
|
* Erase a subscriber's receipts.
|
|
2635
2786
|
*
|
|
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.
|
|
2787
|
+
* 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. Ask your counsel whether this meets a deletion request in your jurisdiction.
|
|
2637
2788
|
*
|
|
2638
2789
|
* @see POST /v1/receipts/erase (operation `eraseReceipts`, scope `receipts:write`)
|
|
2639
2790
|
*/
|
|
@@ -2676,7 +2827,7 @@ export class ReceiptsResource extends Resource {
|
|
|
2676
2827
|
/**
|
|
2677
2828
|
* Download a self-verifying receipt bundle.
|
|
2678
2829
|
*
|
|
2679
|
-
* ZIP for a lawyer
|
|
2830
|
+
* ZIP for a lawyer 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
2831
|
*
|
|
2681
2832
|
* @param receipt Unique identifier of the receipt (rcpt_…).
|
|
2682
2833
|
* @see GET /v1/receipts/{receipt}/export (operation `exportReceipt`, scope `receipts:read`)
|
|
@@ -2700,7 +2851,7 @@ export class ReceiptSettingsResource extends Resource {
|
|
|
2700
2851
|
/**
|
|
2701
2852
|
* Update receipt settings.
|
|
2702
2853
|
*
|
|
2703
|
-
* Turn receipts on or off and set the retention in days (default 1461 = 4 years
|
|
2854
|
+
* Turn receipts on or off and set the retention in days (default 1461 = 4 years: the California Unfair Competition Law limitation period; adjust to your counsel's advice). A new retention applies to receipts recorded afterwards.
|
|
2704
2855
|
*
|
|
2705
2856
|
* @see POST /v1/receipt_settings (operation `updateReceiptSettings`, scope `receipts:write`)
|
|
2706
2857
|
*/
|
|
@@ -2754,7 +2905,7 @@ export class StripeCheckoutConfigsResource extends Resource {
|
|
|
2754
2905
|
/**
|
|
2755
2906
|
* Register the Checkout Session params your code uses.
|
|
2756
2907
|
*
|
|
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.
|
|
2908
|
+
* Registers exactly the object your code passes to stripe.checkout.sessions.create (customer, URLs and secrets are not needed and are ignored; `warnings` says what was not stored). It is judged exactly like checkStripeCheckoutSession, discounts included. A config with the same name, or for the same Price ids, replaces the older one (`replaced`). 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
2909
|
*
|
|
2759
2910
|
* @param site Unique identifier of the site (site_…).
|
|
2760
2911
|
* @see POST /v1/sites/{site}/stripe_checkout_configs (operation `createStripeCheckoutConfig`, scope `test_runs:write`)
|
|
@@ -2800,12 +2951,31 @@ export class StripeCheckoutConfigsResource extends Resource {
|
|
|
2800
2951
|
return this.del(stripeCheckoutConfig, options);
|
|
2801
2952
|
}
|
|
2802
2953
|
}
|
|
2954
|
+
/** `checkbox.siteStripeCheckoutConfigs` */
|
|
2955
|
+
export class SiteStripeCheckoutConfigsResource extends Resource {
|
|
2956
|
+
/**
|
|
2957
|
+
* Delete a registered checkout config (site path).
|
|
2958
|
+
*
|
|
2959
|
+
* The same as deleteStripeCheckoutConfig, under the site path where configs are created and listed.
|
|
2960
|
+
*
|
|
2961
|
+
* @param site Unique identifier of the site (site_…).
|
|
2962
|
+
* @param stripeCheckoutConfig Unique identifier of the stripe checkout config (scc_…).
|
|
2963
|
+
* @see DELETE /v1/sites/{site}/stripe_checkout_configs/{stripe_checkout_config} (operation `deleteSiteStripeCheckoutConfig`, scope `test_runs:write`)
|
|
2964
|
+
*/
|
|
2965
|
+
del(site, stripeCheckoutConfig, options) {
|
|
2966
|
+
return this._request(OPERATIONS.deleteSiteStripeCheckoutConfig, [site, stripeCheckoutConfig], undefined, options);
|
|
2967
|
+
}
|
|
2968
|
+
/** Alias of `del()`. */
|
|
2969
|
+
delete(site, stripeCheckoutConfig, options) {
|
|
2970
|
+
return this.del(site, stripeCheckoutConfig, options);
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2803
2973
|
/** `checkbox.testRuns` */
|
|
2804
2974
|
export class TestRunsResource extends Resource {
|
|
2805
2975
|
/**
|
|
2806
2976
|
* Start a lifecycle test run.
|
|
2807
2977
|
*
|
|
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.
|
|
2978
|
+
* 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. Usually takes 2-4 minutes (longer when your own emails are slow to arrive): 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
2979
|
*
|
|
2810
2980
|
* @param site Unique identifier of the site (site_…).
|
|
2811
2981
|
* @see POST /v1/sites/{site}/test_runs (operation `createTestRun`, scope `test_runs:write`, live mode needs an activated account)
|
|
@@ -2827,13 +2997,13 @@ export class TestRunsResource extends Resource {
|
|
|
2827
2997
|
/**
|
|
2828
2998
|
* Retrieve a test run.
|
|
2829
2999
|
*
|
|
2830
|
-
* The run with every step's status, observations, check results and fixes. While it runs, next_action.type is "wait";
|
|
3000
|
+
* The run with every step's status, observations, check results and fixes. While it runs, next_action.type is "wait" and waiting_for says what it waits for; ?wait=30 answers as soon as the run moves on (or after 30 seconds). When it finished, next_action says what to fix (apply_fixes / review_warnings), retrieve_plan when the only warnings have nothing to change, or "none".
|
|
2831
3001
|
*
|
|
2832
3002
|
* @param testRun Unique identifier of the test run (run_…).
|
|
2833
3003
|
* @see GET /v1/test_runs/{test_run} (operation `retrieveTestRun`, scope `test_runs:read`)
|
|
2834
3004
|
*/
|
|
2835
|
-
retrieve(testRun, options) {
|
|
2836
|
-
return this._request(OPERATIONS.retrieveTestRun, [testRun],
|
|
3005
|
+
retrieve(testRun, params, options) {
|
|
3006
|
+
return this._request(OPERATIONS.retrieveTestRun, [testRun], params, options);
|
|
2837
3007
|
}
|
|
2838
3008
|
/**
|
|
2839
3009
|
* Cancel a test run.
|
|
@@ -2947,7 +3117,7 @@ export class FeedbacksResource extends Resource {
|
|
|
2947
3117
|
/**
|
|
2948
3118
|
* Send feedback.
|
|
2949
3119
|
*
|
|
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.
|
|
3120
|
+
* 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. With type review, send a structured review of Checkbox the product (score 0-10, liked, disliked, wrong_verdicts, would_keep_using, stack) — only after the human said yes and saw the text. A review describes what worked or did not in Checkbox: it never states that the site broke a law or had unfixed problems, and carries no site names, URLs, customer data or quotes of the site's pages or emails (URLs are removed and no site is attached). Never include secrets or customer data: anything that looks like a secret, card number or email address is replaced with [redacted]. The Checkbox team reads every message. Rate limited to 20 per key per hour.
|
|
2951
3121
|
*
|
|
2952
3122
|
* @see POST /v1/feedback (operation `createFeedback`, scope `account:read`)
|
|
2953
3123
|
*/
|
|
@@ -2955,6 +3125,20 @@ export class FeedbacksResource extends Resource {
|
|
|
2955
3125
|
return this._request(OPERATIONS.createFeedback, [], params, options);
|
|
2956
3126
|
}
|
|
2957
3127
|
}
|
|
3128
|
+
/** `checkbox.reviewPrompts` */
|
|
3129
|
+
export class ReviewPromptsResource extends Resource {
|
|
3130
|
+
/**
|
|
3131
|
+
* Claim the one-time review prompt for a site.
|
|
3132
|
+
*
|
|
3133
|
+
* The MCP tools call this when a site's compliance plan reaches status compliant, i.e. checks pass (including "Checks pass · N live checks pending"). show is true exactly once per site: the agent then asks the human once whether they want to send a quick review of Checkbox (createFeedback with type review), and sends it only on a yes, after showing the text. Never send a review without the human's yes.
|
|
3134
|
+
*
|
|
3135
|
+
* @param site Unique identifier of the site (site_…).
|
|
3136
|
+
* @see POST /v1/sites/{site}/review_prompt (operation `claimReviewPrompt`, scope `compliance_plans:read`)
|
|
3137
|
+
*/
|
|
3138
|
+
claim(site, params, options) {
|
|
3139
|
+
return this._request(OPERATIONS.claimReviewPrompt, [site], params, options);
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
2958
3142
|
/** Resource namespaces of the client. */
|
|
2959
3143
|
export const RESOURCES = {
|
|
2960
3144
|
device: DeviceResource,
|
|
@@ -2962,6 +3146,7 @@ export const RESOURCES = {
|
|
|
2962
3146
|
account: AccountResource,
|
|
2963
3147
|
sites: SitesResource,
|
|
2964
3148
|
domainVerifications: DomainVerificationsResource,
|
|
3149
|
+
billings: BillingsResource,
|
|
2965
3150
|
scans: ScansResource,
|
|
2966
3151
|
evaluations: EvaluationsResource,
|
|
2967
3152
|
findings: FindingsResource,
|
|
@@ -2975,6 +3160,7 @@ export const RESOURCES = {
|
|
|
2975
3160
|
notices: NoticesResource,
|
|
2976
3161
|
lawUpdates: LawUpdatesResource,
|
|
2977
3162
|
checks: ChecksResource,
|
|
3163
|
+
suggestions: SuggestionsResource,
|
|
2978
3164
|
elements: ElementsResource,
|
|
2979
3165
|
disclosures: DisclosuresResource,
|
|
2980
3166
|
consents: ConsentsResource,
|
|
@@ -2983,8 +3169,10 @@ export const RESOURCES = {
|
|
|
2983
3169
|
receiptSettings: ReceiptSettingsResource,
|
|
2984
3170
|
testCredentials: TestCredentialsResource,
|
|
2985
3171
|
stripeCheckoutConfigs: StripeCheckoutConfigsResource,
|
|
3172
|
+
siteStripeCheckoutConfigs: SiteStripeCheckoutConfigsResource,
|
|
2986
3173
|
testRuns: TestRunsResource,
|
|
2987
3174
|
webhookEndpoints: WebhookEndpointsResource,
|
|
2988
3175
|
events: EventsResource,
|
|
2989
3176
|
feedbacks: FeedbacksResource,
|
|
3177
|
+
reviewPrompts: ReviewPromptsResource,
|
|
2990
3178
|
};
|