@checkbox-site/node 0.1.1 → 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 +70 -2
- package/dist/generated/operations.d.ts +171 -27
- package/dist/generated/operations.js +152 -23
- package/dist/generated/types.d.ts +819 -153
- package/dist/generated/types.js +8 -3
- 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",
|
|
@@ -1565,6 +1599,23 @@ export const OPERATIONS = {
|
|
|
1565
1599
|
paginated: false,
|
|
1566
1600
|
summary: "Delete a registered checkout config",
|
|
1567
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
|
+
},
|
|
1568
1619
|
createTestRun: {
|
|
1569
1620
|
operationId: "createTestRun",
|
|
1570
1621
|
namespace: "testRuns",
|
|
@@ -1606,7 +1657,7 @@ export const OPERATIONS = {
|
|
|
1606
1657
|
httpMethod: "GET",
|
|
1607
1658
|
path: "/v1/test_runs/{test_run}",
|
|
1608
1659
|
pathParams: ["test_run"],
|
|
1609
|
-
queryParams: [],
|
|
1660
|
+
queryParams: ["wait"],
|
|
1610
1661
|
body: false,
|
|
1611
1662
|
idempotent: false,
|
|
1612
1663
|
auth: true,
|
|
@@ -1786,6 +1837,23 @@ export const OPERATIONS = {
|
|
|
1786
1837
|
paginated: false,
|
|
1787
1838
|
summary: "Send feedback",
|
|
1788
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
|
+
},
|
|
1789
1857
|
};
|
|
1790
1858
|
/** `checkbox.device` */
|
|
1791
1859
|
export class DeviceResource extends Resource {
|
|
@@ -1857,7 +1925,7 @@ export class SetupSessionsResource extends Resource {
|
|
|
1857
1925
|
/**
|
|
1858
1926
|
* Re-check the site now.
|
|
1859
1927
|
*
|
|
1860
|
-
* 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.
|
|
1861
1929
|
*
|
|
1862
1930
|
* @param setupSession Unique identifier of the setup session (setup_…).
|
|
1863
1931
|
* @see POST /v1/setup_sessions/{setup_session}/verify (operation `verifySetupSession`, scope `setup_sessions:write`)
|
|
@@ -1892,7 +1960,7 @@ export class AccountResource extends Resource {
|
|
|
1892
1960
|
/**
|
|
1893
1961
|
* Update the account.
|
|
1894
1962
|
*
|
|
1895
|
-
* 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).
|
|
1896
1964
|
*
|
|
1897
1965
|
* @see POST /v1/account (operation `updateAccount`, scope `account:write`)
|
|
1898
1966
|
*/
|
|
@@ -1925,7 +1993,7 @@ export class SitesResource extends Resource {
|
|
|
1925
1993
|
/**
|
|
1926
1994
|
* Retrieve a site.
|
|
1927
1995
|
*
|
|
1928
|
-
* Returns a site with its latest compliance
|
|
1996
|
+
* Returns a site with its latest compliance status (label and counts) and install details.
|
|
1929
1997
|
*
|
|
1930
1998
|
* @param site Unique identifier of the site (site_…).
|
|
1931
1999
|
* @see GET /v1/sites/{site} (operation `retrieveSite`, scope `sites:read`)
|
|
@@ -1973,7 +2041,7 @@ export class SitesResource extends Resource {
|
|
|
1973
2041
|
/**
|
|
1974
2042
|
* Connect a billing platform.
|
|
1975
2043
|
*
|
|
1976
|
-
* 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.
|
|
1977
2045
|
*
|
|
1978
2046
|
* @param site Unique identifier of the site (site_…).
|
|
1979
2047
|
* @see POST /v1/sites/{site}/integrations (operation `connectBillingPlatform`, scope `sites:write`)
|
|
@@ -2020,7 +2088,7 @@ export class DomainVerificationsResource extends Resource {
|
|
|
2020
2088
|
/**
|
|
2021
2089
|
* Check domain verification now.
|
|
2022
2090
|
*
|
|
2023
|
-
* 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.
|
|
2024
2092
|
*
|
|
2025
2093
|
* @param site Unique identifier of the site (site_…).
|
|
2026
2094
|
* @see POST /v1/sites/{site}/domain_verification/check (operation `checkDomainVerification`, scope `sites:write`)
|
|
@@ -2029,6 +2097,20 @@ export class DomainVerificationsResource extends Resource {
|
|
|
2029
2097
|
return this._request(OPERATIONS.checkDomainVerification, [site], undefined, options);
|
|
2030
2098
|
}
|
|
2031
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
|
+
}
|
|
2032
2114
|
/** `checkbox.scans` */
|
|
2033
2115
|
export class ScansResource extends Resource {
|
|
2034
2116
|
/**
|
|
@@ -2080,7 +2162,7 @@ export class EvaluationsResource extends Resource {
|
|
|
2080
2162
|
/**
|
|
2081
2163
|
* List evaluations.
|
|
2082
2164
|
*
|
|
2083
|
-
* Verdicts newest first (
|
|
2165
|
+
* Verdicts newest first (status history), optionally for one site.
|
|
2084
2166
|
*
|
|
2085
2167
|
* @see GET /v1/evaluations (operation `listEvaluations`, scope `evaluations:read`)
|
|
2086
2168
|
*/
|
|
@@ -2101,7 +2183,7 @@ export class EvaluationsResource extends Resource {
|
|
|
2101
2183
|
/**
|
|
2102
2184
|
* Get the current verdict of a site.
|
|
2103
2185
|
*
|
|
2104
|
-
* 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.
|
|
2105
2187
|
*
|
|
2106
2188
|
* @param site Unique identifier of the site (site_…).
|
|
2107
2189
|
* @see GET /v1/sites/{site}/evaluation (operation `retrieveLatestEvaluation`, scope `evaluations:read`)
|
|
@@ -2115,7 +2197,7 @@ export class FindingsResource extends Resource {
|
|
|
2115
2197
|
/**
|
|
2116
2198
|
* List findings.
|
|
2117
2199
|
*
|
|
2118
|
-
* 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.
|
|
2119
2201
|
*
|
|
2120
2202
|
* @see GET /v1/findings (operation `listFindings`, scope `findings:read`)
|
|
2121
2203
|
*/
|
|
@@ -2150,7 +2232,7 @@ export class PlansResource extends Resource {
|
|
|
2150
2232
|
/**
|
|
2151
2233
|
* Get the compliance plan for a site.
|
|
2152
2234
|
*
|
|
2153
|
-
* 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.
|
|
2154
2236
|
*
|
|
2155
2237
|
* @param site Unique identifier of the site (site_…).
|
|
2156
2238
|
* @see GET /v1/sites/{site}/plan (operation `retrieveCompliancePlan`, scope `compliance_plans:read`)
|
|
@@ -2211,7 +2293,7 @@ export class VerificationsResource extends Resource {
|
|
|
2211
2293
|
/**
|
|
2212
2294
|
* Get a verification (long-poll with ?wait=30).
|
|
2213
2295
|
*
|
|
2214
|
-
* 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.
|
|
2215
2297
|
*
|
|
2216
2298
|
* @param verification Unique identifier of the verification (ver_…).
|
|
2217
2299
|
* @see GET /v1/verifications/{verification} (operation `retrieveVerification`, scope `compliance_plans:read`)
|
|
@@ -2255,6 +2337,17 @@ export class FixesResource extends Resource {
|
|
|
2255
2337
|
list(site, params, options) {
|
|
2256
2338
|
return this._request(OPERATIONS.listSiteFixes, [site], params, options);
|
|
2257
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
|
+
}
|
|
2258
2351
|
}
|
|
2259
2352
|
/** `checkbox.evidence` */
|
|
2260
2353
|
export class EvidenceResource extends Resource {
|
|
@@ -2364,7 +2457,7 @@ export class NoticeSettingsResource extends Resource {
|
|
|
2364
2457
|
/**
|
|
2365
2458
|
* Update notice settings.
|
|
2366
2459
|
*
|
|
2367
|
-
* 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.
|
|
2368
2461
|
*
|
|
2369
2462
|
* @param site Unique identifier of the site (site_…).
|
|
2370
2463
|
* @see POST /v1/sites/{site}/notice_settings (operation `updateNoticeSettings`, scope `notices:write`, live mode needs an activated account)
|
|
@@ -2468,7 +2561,7 @@ export class ChecksResource extends Resource {
|
|
|
2468
2561
|
/**
|
|
2469
2562
|
* Check checkout disclosure text.
|
|
2470
2563
|
*
|
|
2471
|
-
* 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.
|
|
2472
2565
|
*
|
|
2473
2566
|
* @see POST /v1/checks/disclosure (operation `checkDisclosure`, scope `checks:read`)
|
|
2474
2567
|
*/
|
|
@@ -2498,7 +2591,7 @@ export class ChecksResource extends Resource {
|
|
|
2498
2591
|
/**
|
|
2499
2592
|
* Check a subscription lifecycle email.
|
|
2500
2593
|
*
|
|
2501
|
-
* 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.
|
|
2502
2595
|
*
|
|
2503
2596
|
* @see POST /v1/checks/email (operation `checkEmail`, scope `checks:read`)
|
|
2504
2597
|
*/
|
|
@@ -2518,7 +2611,7 @@ export class ChecksResource extends Resource {
|
|
|
2518
2611
|
/**
|
|
2519
2612
|
* Get the dates each required notice must be sent.
|
|
2520
2613
|
*
|
|
2521
|
-
* 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.
|
|
2522
2615
|
*
|
|
2523
2616
|
* @see POST /v1/checks/notice_schedule (operation `checkNoticeSchedule`, scope `checks:read`)
|
|
2524
2617
|
*/
|
|
@@ -2691,7 +2784,7 @@ export class ReceiptsResource extends Resource {
|
|
|
2691
2784
|
/**
|
|
2692
2785
|
* Erase a subscriber's receipts.
|
|
2693
2786
|
*
|
|
2694
|
-
* 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.
|
|
2695
2788
|
*
|
|
2696
2789
|
* @see POST /v1/receipts/erase (operation `eraseReceipts`, scope `receipts:write`)
|
|
2697
2790
|
*/
|
|
@@ -2758,7 +2851,7 @@ export class ReceiptSettingsResource extends Resource {
|
|
|
2758
2851
|
/**
|
|
2759
2852
|
* Update receipt settings.
|
|
2760
2853
|
*
|
|
2761
|
-
* 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.
|
|
2762
2855
|
*
|
|
2763
2856
|
* @see POST /v1/receipt_settings (operation `updateReceiptSettings`, scope `receipts:write`)
|
|
2764
2857
|
*/
|
|
@@ -2812,7 +2905,7 @@ export class StripeCheckoutConfigsResource extends Resource {
|
|
|
2812
2905
|
/**
|
|
2813
2906
|
* Register the Checkout Session params your code uses.
|
|
2814
2907
|
*
|
|
2815
|
-
* 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.
|
|
2816
2909
|
*
|
|
2817
2910
|
* @param site Unique identifier of the site (site_…).
|
|
2818
2911
|
* @see POST /v1/sites/{site}/stripe_checkout_configs (operation `createStripeCheckoutConfig`, scope `test_runs:write`)
|
|
@@ -2858,12 +2951,31 @@ export class StripeCheckoutConfigsResource extends Resource {
|
|
|
2858
2951
|
return this.del(stripeCheckoutConfig, options);
|
|
2859
2952
|
}
|
|
2860
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
|
+
}
|
|
2861
2973
|
/** `checkbox.testRuns` */
|
|
2862
2974
|
export class TestRunsResource extends Resource {
|
|
2863
2975
|
/**
|
|
2864
2976
|
* Start a lifecycle test run.
|
|
2865
2977
|
*
|
|
2866
|
-
* 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.
|
|
2867
2979
|
*
|
|
2868
2980
|
* @param site Unique identifier of the site (site_…).
|
|
2869
2981
|
* @see POST /v1/sites/{site}/test_runs (operation `createTestRun`, scope `test_runs:write`, live mode needs an activated account)
|
|
@@ -2885,13 +2997,13 @@ export class TestRunsResource extends Resource {
|
|
|
2885
2997
|
/**
|
|
2886
2998
|
* Retrieve a test run.
|
|
2887
2999
|
*
|
|
2888
|
-
* 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".
|
|
2889
3001
|
*
|
|
2890
3002
|
* @param testRun Unique identifier of the test run (run_…).
|
|
2891
3003
|
* @see GET /v1/test_runs/{test_run} (operation `retrieveTestRun`, scope `test_runs:read`)
|
|
2892
3004
|
*/
|
|
2893
|
-
retrieve(testRun, options) {
|
|
2894
|
-
return this._request(OPERATIONS.retrieveTestRun, [testRun],
|
|
3005
|
+
retrieve(testRun, params, options) {
|
|
3006
|
+
return this._request(OPERATIONS.retrieveTestRun, [testRun], params, options);
|
|
2895
3007
|
}
|
|
2896
3008
|
/**
|
|
2897
3009
|
* Cancel a test run.
|
|
@@ -3005,7 +3117,7 @@ export class FeedbacksResource extends Resource {
|
|
|
3005
3117
|
/**
|
|
3006
3118
|
* Send feedback.
|
|
3007
3119
|
*
|
|
3008
|
-
* 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.
|
|
3009
3121
|
*
|
|
3010
3122
|
* @see POST /v1/feedback (operation `createFeedback`, scope `account:read`)
|
|
3011
3123
|
*/
|
|
@@ -3013,6 +3125,20 @@ export class FeedbacksResource extends Resource {
|
|
|
3013
3125
|
return this._request(OPERATIONS.createFeedback, [], params, options);
|
|
3014
3126
|
}
|
|
3015
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
|
+
}
|
|
3016
3142
|
/** Resource namespaces of the client. */
|
|
3017
3143
|
export const RESOURCES = {
|
|
3018
3144
|
device: DeviceResource,
|
|
@@ -3020,6 +3146,7 @@ export const RESOURCES = {
|
|
|
3020
3146
|
account: AccountResource,
|
|
3021
3147
|
sites: SitesResource,
|
|
3022
3148
|
domainVerifications: DomainVerificationsResource,
|
|
3149
|
+
billings: BillingsResource,
|
|
3023
3150
|
scans: ScansResource,
|
|
3024
3151
|
evaluations: EvaluationsResource,
|
|
3025
3152
|
findings: FindingsResource,
|
|
@@ -3042,8 +3169,10 @@ export const RESOURCES = {
|
|
|
3042
3169
|
receiptSettings: ReceiptSettingsResource,
|
|
3043
3170
|
testCredentials: TestCredentialsResource,
|
|
3044
3171
|
stripeCheckoutConfigs: StripeCheckoutConfigsResource,
|
|
3172
|
+
siteStripeCheckoutConfigs: SiteStripeCheckoutConfigsResource,
|
|
3045
3173
|
testRuns: TestRunsResource,
|
|
3046
3174
|
webhookEndpoints: WebhookEndpointsResource,
|
|
3047
3175
|
events: EventsResource,
|
|
3048
3176
|
feedbacks: FeedbacksResource,
|
|
3177
|
+
reviewPrompts: ReviewPromptsResource,
|
|
3049
3178
|
};
|