@checkbox-site/node 0.2.5 → 0.2.7
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
CHANGED
|
@@ -45,7 +45,7 @@ export interface Checkbox extends ResourceInstances {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare class Checkbox implements RequestSender {
|
|
47
47
|
#private;
|
|
48
|
-
static readonly VERSION = "0.2.
|
|
48
|
+
static readonly VERSION = "0.2.7";
|
|
49
49
|
static readonly API_VERSION = "2026-10-30";
|
|
50
50
|
static readonly errors: typeof errors;
|
|
51
51
|
static readonly webhooks: Webhooks;
|
|
@@ -3098,7 +3098,7 @@ export declare class ChecksResource extends Resource {
|
|
|
3098
3098
|
/**
|
|
3099
3099
|
* Check a subscription lifecycle email.
|
|
3100
3100
|
*
|
|
3101
|
-
* 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 and without a price in terms, 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. Without `site`, a price you send in terms is judged as sent; when it differs from every plan of that site, the
|
|
3101
|
+
* 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 and without a price in terms, 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. Without `site`, a price you send in terms is judged as sent; when it differs from every plan of that site, the verdict is still judged with the terms you sent and a `site_plans_differ` warning says to update the site's plans (update_setup) once the change is deployed. 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.
|
|
3102
3102
|
*
|
|
3103
3103
|
* @see POST /v1/checks/email (operation `checkEmail`, scope `checks:read`)
|
|
3104
3104
|
*/
|
|
@@ -3323,7 +3323,7 @@ export declare class TestCredentialsResource extends Resource {
|
|
|
3323
3323
|
/**
|
|
3324
3324
|
* Store a billing test-mode key.
|
|
3325
3325
|
*
|
|
3326
|
-
* Stores the site's Stripe TEST-mode restricted key (rk_test_…), after checking it with Stripe the way the dashboard's Connect Stripe does. An agent may call this itself once the owner approved the setup; every store is logged on the site's setup timeline and Billing connection line, and the human can revoke it in one click. Live keys are refused (test_key_not_test_mode: a human adds live keys in the dashboard); the owner must have ticked
|
|
3326
|
+
* Stores the site's Stripe TEST-mode restricted key (rk_test_…), after checking it with Stripe the way the dashboard's Connect Stripe does. An agent may call this itself once the owner approved the setup; every store is logged on the site's setup timeline and Billing connection line, and the human can revoke it in one click. Live keys are refused (test_key_not_test_mode: a human adds live keys in the dashboard); the owner must have ticked the box “Let your agent store a Stripe test-mode restricted key for this project” (agent sign-in) or “Let this app store a Stripe test-mode restricted key for your sites” (app connection) (checkbox id consent-stripe-test-key) on the approval page of the agent's sign-in or connection (else test_key_declined); a key whose Stripe account looks like another site's is refused with billing_account_mismatch (with confirm_account_mismatch: true the key is connected on hold until a person confirms the account in the dashboard; only a person can confirm it); secret keys (sk_test_…) are refused (test_key_not_restricted). On a test-mode site without a Stripe connection the key also becomes the site's Stripe connection: one key for checks, fixes (only after the human approves each) and test runs. The key's checklist: Customers: Write, Products: Read, Prices: Read, Coupons: Read, Subscriptions: Write, Test clocks: Write, Customer portal: Write, Checkout Sessions: Write, Payment Links: Write, Webhook Endpoints: Write. Replaces an existing key. Next: createTestRun.
|
|
3327
3327
|
*
|
|
3328
3328
|
* @param site Unique identifier of the site (site_…).
|
|
3329
3329
|
* @see POST /v1/sites/{site}/test_credentials (operation `createTestCredential`, scope `test_runs:write`)
|
|
@@ -2622,7 +2622,7 @@ export class ChecksResource extends Resource {
|
|
|
2622
2622
|
/**
|
|
2623
2623
|
* Check a subscription lifecycle email.
|
|
2624
2624
|
*
|
|
2625
|
-
* 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 and without a price in terms, 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. Without `site`, a price you send in terms is judged as sent; when it differs from every plan of that site, the
|
|
2625
|
+
* 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 and without a price in terms, 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. Without `site`, a price you send in terms is judged as sent; when it differs from every plan of that site, the verdict is still judged with the terms you sent and a `site_plans_differ` warning says to update the site's plans (update_setup) once the change is deployed. 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.
|
|
2626
2626
|
*
|
|
2627
2627
|
* @see POST /v1/checks/email (operation `checkEmail`, scope `checks:read`)
|
|
2628
2628
|
*/
|
|
@@ -2895,7 +2895,7 @@ export class TestCredentialsResource extends Resource {
|
|
|
2895
2895
|
/**
|
|
2896
2896
|
* Store a billing test-mode key.
|
|
2897
2897
|
*
|
|
2898
|
-
* Stores the site's Stripe TEST-mode restricted key (rk_test_…), after checking it with Stripe the way the dashboard's Connect Stripe does. An agent may call this itself once the owner approved the setup; every store is logged on the site's setup timeline and Billing connection line, and the human can revoke it in one click. Live keys are refused (test_key_not_test_mode: a human adds live keys in the dashboard); the owner must have ticked
|
|
2898
|
+
* Stores the site's Stripe TEST-mode restricted key (rk_test_…), after checking it with Stripe the way the dashboard's Connect Stripe does. An agent may call this itself once the owner approved the setup; every store is logged on the site's setup timeline and Billing connection line, and the human can revoke it in one click. Live keys are refused (test_key_not_test_mode: a human adds live keys in the dashboard); the owner must have ticked the box “Let your agent store a Stripe test-mode restricted key for this project” (agent sign-in) or “Let this app store a Stripe test-mode restricted key for your sites” (app connection) (checkbox id consent-stripe-test-key) on the approval page of the agent's sign-in or connection (else test_key_declined); a key whose Stripe account looks like another site's is refused with billing_account_mismatch (with confirm_account_mismatch: true the key is connected on hold until a person confirms the account in the dashboard; only a person can confirm it); secret keys (sk_test_…) are refused (test_key_not_restricted). On a test-mode site without a Stripe connection the key also becomes the site's Stripe connection: one key for checks, fixes (only after the human approves each) and test runs. The key's checklist: Customers: Write, Products: Read, Prices: Read, Coupons: Read, Subscriptions: Write, Test clocks: Write, Customer portal: Write, Checkout Sessions: Write, Payment Links: Write, Webhook Endpoints: Write. Replaces an existing key. Next: createTestRun.
|
|
2899
2899
|
*
|
|
2900
2900
|
* @param site Unique identifier of the site (site_…).
|
|
2901
2901
|
* @see POST /v1/sites/{site}/test_credentials (operation `createTestCredential`, scope `test_runs:write`)
|
|
@@ -266,7 +266,7 @@ export type GoLive = {
|
|
|
266
266
|
/** The steps, in order. */
|
|
267
267
|
steps: Array<{
|
|
268
268
|
/** Stable step key. */
|
|
269
|
-
key: "verify_domain" | "stripe_terms_url" | "live_stripe_key" | "live_checkout" | "promote_site";
|
|
269
|
+
key: "verify_domain" | "stripe_terms_url" | "live_stripe_key" | "live_portal_cancel" | "live_checkout" | "deactivate_old_live_link" | "promote_site";
|
|
270
270
|
/** Who takes the step: person (only the owner can: DNS, the Stripe Dashboard, live keys) or agent (a code change). */
|
|
271
271
|
who: "person" | "agent";
|
|
272
272
|
/** The step in plain words. */
|
|
@@ -410,7 +410,7 @@ export interface SetupSession {
|
|
|
410
410
|
}>;
|
|
411
411
|
/** Stripe test mode for lifecycle test runs. */
|
|
412
412
|
stripe: {
|
|
413
|
-
/** Whether the human ticked “Let your agent store a Stripe test-mode key” on the approval page (device login or OAuth connection). False: the agent may not store one (createTestCredential answers test_key_declined); the human adds it in the dashboard. Sessions started with a key the human made in the dashboard: true. */
|
|
413
|
+
/** Whether the human ticked the box “Let your agent store a Stripe test-mode restricted key for this project” (agent sign-in) or “Let this app store a Stripe test-mode restricted key for your sites” (app connection) (checkbox id consent-stripe-test-key) on the approval page (device login or OAuth connection). False: the agent may not store one (createTestCredential answers test_key_declined); the human adds it in the dashboard. Sessions started with a key the human made in the dashboard: true. */
|
|
414
414
|
test_key_consent: boolean;
|
|
415
415
|
/** Hint of the restricted test key the CLI found (never the key). */
|
|
416
416
|
test_key_hint: string | null;
|
|
@@ -478,8 +478,10 @@ export interface SetupSession {
|
|
|
478
478
|
}>;
|
|
479
479
|
/** Latest verdict of the test-mode site. */
|
|
480
480
|
compliance: {
|
|
481
|
-
/** When it was evaluated. Unix timestamp in seconds. */
|
|
481
|
+
/** When it was evaluated (Unix seconds; a time, not a count). Unix timestamp in seconds. */
|
|
482
482
|
evaluated: number;
|
|
483
|
+
/** The same time as evaluated, in ISO 8601. */
|
|
484
|
+
evaluated_at: string;
|
|
483
485
|
/**
|
|
484
486
|
* Deprecated: open failing findings (per check). Read `label` (counted in tasks) and `todo` instead.
|
|
485
487
|
* @deprecated
|
|
@@ -603,8 +605,8 @@ export interface SetupSessionUpdate {
|
|
|
603
605
|
/** Where the subscribe / pay buttons are rendered. */
|
|
604
606
|
pay_buttons?: Array<SetupCodeRef>;
|
|
605
607
|
};
|
|
606
|
-
/** File the snippet tag was added to. */
|
|
607
|
-
snippet_installed_in?: string
|
|
608
|
+
/** File the snippet tag was added to, or a list of files (e.g. ["app/layout.tsx", "app/account/layout.tsx"]). */
|
|
609
|
+
snippet_installed_in?: string | Array<string>;
|
|
608
610
|
/** File the API keys were written to (never committed). */
|
|
609
611
|
env_written?: string;
|
|
610
612
|
/** Live-mode site (site_…) you created with the live key, so the checklist tracks its domain verification. */
|
|
@@ -676,6 +678,58 @@ export interface SetupVerification {
|
|
|
676
678
|
reason: string | null;
|
|
677
679
|
} | null;
|
|
678
680
|
next_action: SetupNextAction;
|
|
681
|
+
/** The same as setup_session.steps, at the top level: the setup checklist, in order. */
|
|
682
|
+
steps: Array<SetupStep>;
|
|
683
|
+
/** The same as setup_session.compliance, at the top level: the site's status label and to-do list after this re-check (null before the first evaluation). */
|
|
684
|
+
compliance: {
|
|
685
|
+
/** When it was evaluated (Unix seconds; a time, not a count). Unix timestamp in seconds. */
|
|
686
|
+
evaluated: number;
|
|
687
|
+
/** The same time as evaluated, in ISO 8601. */
|
|
688
|
+
evaluated_at: string;
|
|
689
|
+
/**
|
|
690
|
+
* Deprecated: open failing findings (per check). Read `label` (counted in tasks) and `todo` instead.
|
|
691
|
+
* @deprecated
|
|
692
|
+
*/
|
|
693
|
+
failing: number;
|
|
694
|
+
/**
|
|
695
|
+
* Deprecated: open needs-review findings (per check). Read `label` (counted in tasks) and `todo` instead.
|
|
696
|
+
* @deprecated
|
|
697
|
+
*/
|
|
698
|
+
needs_review: number;
|
|
699
|
+
/** The site roll-up label, the same everywhere (dashboard, plan, emails): "2 fixes needed · 1 your call", "Checks pass · 2 live checks pending". */
|
|
700
|
+
label: string | null;
|
|
701
|
+
/** The site roll-up status: needs_fix, your_call, incomplete, compliant or not_checked. */
|
|
702
|
+
status: string | null;
|
|
703
|
+
/**
|
|
704
|
+
* Deprecated: open findings (evidence). The to-do list is `todo` (the compliance plan's ordered open tasks).
|
|
705
|
+
* @deprecated
|
|
706
|
+
*/
|
|
707
|
+
top_findings: Array<{
|
|
708
|
+
/** Unique identifier of the finding (fnd_…). */
|
|
709
|
+
id: string;
|
|
710
|
+
/** Check id. */
|
|
711
|
+
check_id: string;
|
|
712
|
+
/** fail or needs_review. */
|
|
713
|
+
status: string;
|
|
714
|
+
/** critical, high, medium or low. */
|
|
715
|
+
severity: string;
|
|
716
|
+
/** What is wrong. */
|
|
717
|
+
title: string;
|
|
718
|
+
}>;
|
|
719
|
+
/** The to-do list: the compliance plan's ordered open required tasks (same titles, order and counts as the dashboard, MCP get_site_status and the summary email). */
|
|
720
|
+
todo?: Array<{
|
|
721
|
+
/** Plan task id (task_…); its findings are the evidence. */
|
|
722
|
+
task: string;
|
|
723
|
+
/** Task key. */
|
|
724
|
+
key: string;
|
|
725
|
+
/** Task title, the same as in the plan. */
|
|
726
|
+
title: string;
|
|
727
|
+
/** The status the site roll-up counts the task under. */
|
|
728
|
+
status: "needs_fix" | "not_set_up" | "your_call" | "not_checked";
|
|
729
|
+
/** Needs a fix, Not set up yet, Your call or Not checked yet. */
|
|
730
|
+
label: string;
|
|
731
|
+
}>;
|
|
732
|
+
} | null;
|
|
679
733
|
setup_session: SetupSession;
|
|
680
734
|
}
|
|
681
735
|
/** Account default retention (sites without their own setting use it). */
|
|
@@ -1196,8 +1250,8 @@ export interface SiteTestAccount {
|
|
|
1196
1250
|
login_url: string;
|
|
1197
1251
|
/** Test account email. */
|
|
1198
1252
|
email: string;
|
|
1199
|
-
/** Test account password (write-only; encrypted at rest). */
|
|
1200
|
-
password
|
|
1253
|
+
/** Test account password (write-only; encrypted at rest). Leave it out for an email-only login (no password field); the stored password is kept when one was saved before. */
|
|
1254
|
+
password?: string;
|
|
1201
1255
|
/** Custom login steps. */
|
|
1202
1256
|
login_steps?: Array<ScanStep>;
|
|
1203
1257
|
/** 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). (Replaces reset_url, now a deprecated alias.) */
|
|
@@ -1790,8 +1844,10 @@ export interface CompliancePlan {
|
|
|
1790
1844
|
livemode: boolean;
|
|
1791
1845
|
/** The site. */
|
|
1792
1846
|
site: string;
|
|
1793
|
-
/** 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). */
|
|
1847
|
+
/** 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). The value "compliant" is kept so published SDKs keep working; prefer checks_status ("checks_pass") and show status_label to people: never tell anyone the site "is compliant". */
|
|
1794
1848
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
1849
|
+
/** The same as status, with "checks_pass" in place of the older value "compliant" (every required check passes or only waits for a live check: an automated assessment, not a legal determination). Read this one in new code. */
|
|
1850
|
+
checks_status?: "action_required" | "verifying" | "checks_pass" | "blocked";
|
|
1795
1851
|
/** The plan status in words to show a person, from the same counts as the summary ("1 fix needed · 2 to set up", "1 decision for you"; else action_required "Fixes needed", blocked "Your call"), "Checks still running (N)" while checks are still running (verifying), compliant "Checks pass"; while an agent works the site and everything left waits for a deploy or the owner (next_action done_for_now): "Waiting on deploy and you" or "Waiting on deploy". Show this, never the machine value (`compliant` is a status name, not a legal conclusion). */
|
|
1796
1852
|
status_label?: string;
|
|
1797
1853
|
/** The evaluation the plan was built from (null before the first check). */
|
|
@@ -1947,8 +2003,8 @@ export interface Verification {
|
|
|
1947
2003
|
task: string | null;
|
|
1948
2004
|
/** One task or the whole site. */
|
|
1949
2005
|
scope: "task" | "site";
|
|
1950
|
-
/** pending (waiting for the confirming scan / re-evaluation), passed (Checkbox observed the expected result: every check passes or does not apply), passed_with_gaps (nothing observed fails, but some checks could not be observed: observed missing_data — not verified), passed_with_notes (nothing observed fails and the task counts as passing, but a check is still needs_review on a part that is not yours to change, such as Stripe's own page layout: see checks), not_checked (a task whose checks could only not be observed yet: nothing to change in the code; next_action says what evidence to provide), pending_live_check (an email whose content passes but that Checkbox has not seen sent for a real event yet: nothing to change; it completes on the first real send or a proof run),
|
|
1951
|
-
status: "pending" | "passed" | "passed_with_gaps" | "passed_with_notes" | "not_checked" | "pending_live_check" | "failed" | "superseded";
|
|
2006
|
+
/** pending (waiting for the confirming scan / re-evaluation), passed (Checkbox observed the expected result: every check passes or does not apply), passed_with_gaps (nothing observed fails, but some checks could not be observed: observed missing_data — not verified), passed_with_notes (nothing observed fails and the task counts as passing, but a check is still needs_review on a part that is not yours to change, such as Stripe's own page layout: see checks), not_checked (a task whose checks could only not be observed yet: nothing to change in the code; next_action says what evidence to provide), pending_live_check (an email whose content passes but that Checkbox has not seen sent for a real event yet: nothing to change; it completes on the first real send or a proof run), needs_review (nothing observed fails, but a check is still undecided, e.g. a cancellation not tried yet or a styling estimate: not done; next_action says what decides it), failed (a check was observed failing: see diff), superseded (this verification did not pass, but newer evidence, such as a test run or a later evaluation, settled the task since: see superseded and follow next_action; nothing to change for it). */
|
|
2007
|
+
status: "pending" | "passed" | "passed_with_gaps" | "passed_with_notes" | "not_checked" | "pending_live_check" | "needs_review" | "failed" | "superseded";
|
|
1952
2008
|
/** Set when newer evidence settled the task after this verification finished (status superseded). */
|
|
1953
2009
|
superseded?: {
|
|
1954
2010
|
/** The task's status in the current plan. */
|
|
@@ -2848,13 +2904,13 @@ export interface DisclosureCheckParams {
|
|
|
2848
2904
|
trial_days?: number;
|
|
2849
2905
|
/** Intro / first-period price in major units ("$34.50 for your first box, then $69 every 2 weeks"). Or give `intro_amount` in minor units. */
|
|
2850
2906
|
intro_price?: number | string;
|
|
2851
|
-
/** Intro / first-period price in minor units. */
|
|
2907
|
+
/** Intro / first-period price in minor units (999 = $9.99), like `amount`. Units never mix: price / intro_price are major units, amount / intro_amount / intro_amount_off are minor units; with `price` in major units, a value under 100 that reads like major units is refused with both ways to send it. */
|
|
2852
2908
|
intro_amount?: number;
|
|
2853
2909
|
/** How many billing periods the intro price lasts (default 1). */
|
|
2854
2910
|
intro_periods?: number;
|
|
2855
2911
|
/** Intro discount as a percentage off the recurring price (a Stripe coupon's percent_off: 20 for "20% off your first month"). Lasts `intro_periods` billing periods. Give one of intro_price / intro_amount, intro_percent_off or intro_amount_off. */
|
|
2856
2912
|
intro_percent_off?: number;
|
|
2857
|
-
/** Intro discount as an amount off in minor units (a Stripe coupon's amount_off: 200 for $2.00 off). Lasts `intro_periods` billing periods. */
|
|
2913
|
+
/** Intro discount as an amount off in minor units (a Stripe coupon's amount_off: 200 for $2.00 off), like `amount`, even when the price is sent as `price` in major units. Lasts `intro_periods` billing periods. */
|
|
2858
2914
|
intro_amount_off?: number;
|
|
2859
2915
|
/** https URL where subscribers cancel online (used in generated text; a {{cancel_url}} placeholder otherwise). */
|
|
2860
2916
|
cancel_url?: string;
|
|
@@ -2894,6 +2950,8 @@ export interface DisclosureCheckParams {
|
|
|
2894
2950
|
/** The form cannot be submitted without ticking it (default true). */
|
|
2895
2951
|
required?: boolean;
|
|
2896
2952
|
};
|
|
2953
|
+
/** Where the shopper pays: own_page (a form on this page), stripe_checkout or payment_link (a Stripe-hosted page that collects consent, so no checkbox is needed next to this text; consent is then left to that page and checked with checkStripeCheckoutSession / checkStripePaymentLink). With site, the site's checkout type is used when absent (declared, or Stripe Checkout when the site has a registered Stripe Checkout config). */
|
|
2954
|
+
checkout_type?: "own_page" | "stripe_checkout" | "payment_link";
|
|
2897
2955
|
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
2898
2956
|
as_of?: string;
|
|
2899
2957
|
/** Round 23: a site of yours (site_…): the disclosure is judged against the plan it states among the site's plans (the connected Stripe Prices win over plans typed in setup), with the site's merchant name, cancellation URL and jurisdictions, as verifyTask judges it. Plan fields you send are replaced by the plan's. "none" judges only what you send. */
|
|
@@ -3007,13 +3065,13 @@ export interface CheckPlanTerms {
|
|
|
3007
3065
|
trial_days?: number;
|
|
3008
3066
|
/** Intro / first-period price in major units ("$34.50 for your first box, then $69 every 2 weeks"). Or give `intro_amount` in minor units. */
|
|
3009
3067
|
intro_price?: number | string;
|
|
3010
|
-
/** Intro / first-period price in minor units. */
|
|
3068
|
+
/** Intro / first-period price in minor units (999 = $9.99), like `amount`. Units never mix: price / intro_price are major units, amount / intro_amount / intro_amount_off are minor units; with `price` in major units, a value under 100 that reads like major units is refused with both ways to send it. */
|
|
3011
3069
|
intro_amount?: number;
|
|
3012
3070
|
/** How many billing periods the intro price lasts (default 1). */
|
|
3013
3071
|
intro_periods?: number;
|
|
3014
3072
|
/** Intro discount as a percentage off the recurring price (a Stripe coupon's percent_off: 20 for "20% off your first month"). Lasts `intro_periods` billing periods. Give one of intro_price / intro_amount, intro_percent_off or intro_amount_off. */
|
|
3015
3073
|
intro_percent_off?: number;
|
|
3016
|
-
/** Intro discount as an amount off in minor units (a Stripe coupon's amount_off: 200 for $2.00 off). Lasts `intro_periods` billing periods. */
|
|
3074
|
+
/** Intro discount as an amount off in minor units (a Stripe coupon's amount_off: 200 for $2.00 off), like `amount`, even when the price is sent as `price` in major units. Lasts `intro_periods` billing periods. */
|
|
3017
3075
|
intro_amount_off?: number;
|
|
3018
3076
|
/** https URL where subscribers cancel online (used in generated text; a {{cancel_url}} placeholder otherwise). */
|
|
3019
3077
|
cancel_url?: string;
|
|
@@ -4479,7 +4537,7 @@ export interface TestRun {
|
|
|
4479
4537
|
type: "stripe" | "generic";
|
|
4480
4538
|
/** 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. */
|
|
4481
4539
|
mode: "mirror" | "real_checkout" | null;
|
|
4482
|
-
/** succeeded means the run finished every step and no step failed (steps may still have warnings to review); incomplete means no step failed, but a step could not finish what it set out to observe (for example the online cancellation could not be completed): not a pass; failed means it stopped early, or finished with a failed step (see failure and steps[].fix). */
|
|
4540
|
+
/** succeeded means the run finished every step and no step failed (steps may still have warnings to review); incomplete means no step failed, but a step could not finish what it set out to observe (for example the online cancellation could not be completed, or a required email never arrived): not a pass; failed means it stopped early, or finished with a failed step (see failure and steps[].fix). */
|
|
4483
4541
|
status: "queued" | "running" | "succeeded" | "incomplete" | "failed" | "canceled";
|
|
4484
4542
|
/** The status in plain words, counting steps: "Finished with 6 warnings to review", "Finished with 1 failed step", "Finished: every observed step passed". succeeded with warnings is not a clean pass. */
|
|
4485
4543
|
status_label: string;
|
|
@@ -4512,6 +4570,10 @@ export interface TestRun {
|
|
|
4512
4570
|
started: number | null;
|
|
4513
4571
|
/** When it finished. Unix timestamp in seconds. */
|
|
4514
4572
|
finished: number | null;
|
|
4573
|
+
/** The same as finished (the name verifications use): when the run finished; null while it runs. Unix timestamp in seconds. */
|
|
4574
|
+
completed: number | null;
|
|
4575
|
+
/** How long the run took, from started (or created) to finished, in seconds; null while it runs. */
|
|
4576
|
+
duration_seconds: number | null;
|
|
4515
4577
|
/** Lifecycle steps in order. */
|
|
4516
4578
|
steps: Array<TestRunStep>;
|
|
4517
4579
|
/** Why the run stopped (failed / canceled runs). */
|
|
@@ -4813,7 +4875,7 @@ export interface CompliancePlanSummary {
|
|
|
4813
4875
|
livemode: boolean;
|
|
4814
4876
|
/** The site. */
|
|
4815
4877
|
site: string;
|
|
4816
|
-
/** 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). */
|
|
4878
|
+
/** 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). The value "compliant" is kept so published SDKs keep working; prefer checks_status ("checks_pass") and show status_label to people: never tell anyone the site "is compliant". */
|
|
4817
4879
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
4818
4880
|
/** The plan status in words to show a person, from the same counts as the summary ("1 fix needed · 2 to set up", "1 decision for you"; else action_required "Fixes needed", blocked "Your call"), "Checks still running (N)" while checks are still running (verifying), compliant "Checks pass"; while an agent works the site and everything left waits for a deploy or the owner (next_action done_for_now): "Waiting on deploy and you" or "Waiting on deploy". Show this, never the machine value (`compliant` is a status name, not a legal conclusion). */
|
|
4819
4881
|
status_label?: string;
|
|
@@ -5600,7 +5662,7 @@ export declare const ERROR_CODES: {
|
|
|
5600
5662
|
readonly test_key_declined: {
|
|
5601
5663
|
readonly status: 403;
|
|
5602
5664
|
readonly type: "permission_error";
|
|
5603
|
-
readonly description: "The owner did not tick “Let your agent store a Stripe test-mode key
|
|
5665
|
+
readonly description: "The owner did not tick “Let your agent store a Stripe test-mode restricted key for this project” (agent sign-in, device login) or “Let this app store a Stripe test-mode restricted key for your sites” (app connection, OAuth) on the approval page (checkbox id consent-stripe-test-key). Nothing was stored. next_action.url is a one-click allow page for this agent or app (dashboard /allow-stripe-test-key, signed in, no new sign-in); or the human adds the key themselves in the dashboard.";
|
|
5604
5666
|
};
|
|
5605
5667
|
readonly test_key_rejected: {
|
|
5606
5668
|
readonly status: 400;
|
package/dist/generated/types.js
CHANGED
|
@@ -21,7 +21,7 @@ export const ERROR_CODES = {
|
|
|
21
21
|
test_key_missing: { status: 400, type: "invalid_request_error", description: "A Stripe test run needs a Stripe TEST-mode key stored for the site: the agent stores the restricted test key (rk_test_…) with createTestCredential, or a person adds it in the dashboard." },
|
|
22
22
|
test_key_not_test_mode: { status: 400, type: "invalid_request_error", description: "The billing key is a live-mode (or malformed) key. Agents only store TEST-mode restricted keys (rk_test_…); a human adds live keys in the Checkbox dashboard." },
|
|
23
23
|
test_key_not_restricted: { status: 400, type: "invalid_request_error", description: "The key is a full Stripe secret key (sk_test_… or sk_live_…), which is refused on every connect path (createTestCredential, connectBillingPlatform, the dashboard). Use a restricted key (rk_test_…) with the permissions on Checkbox's key checklist instead; `message` lists them." },
|
|
24
|
-
test_key_declined: { status: 403, type: "permission_error", description: "The owner did not tick “Let your agent store a Stripe test-mode key
|
|
24
|
+
test_key_declined: { status: 403, type: "permission_error", description: "The owner did not tick “Let your agent store a Stripe test-mode restricted key for this project” (agent sign-in, device login) or “Let this app store a Stripe test-mode restricted key for your sites” (app connection, OAuth) on the approval page (checkbox id consent-stripe-test-key). Nothing was stored. next_action.url is a one-click allow page for this agent or app (dashboard /allow-stripe-test-key, signed in, no new sign-in); or the human adds the key themselves in the dashboard." },
|
|
25
25
|
test_key_rejected: { status: 400, type: "invalid_request_error", description: "Stripe rejected the test-mode key or it lacks a permission test runs need; `message` names it." },
|
|
26
26
|
authorization_pending: { status: 400, type: "invalid_request_error", description: "Device login: the human has not approved yet. Keep polling createDeviceToken every `interval` seconds." },
|
|
27
27
|
slow_down: { status: 400, type: "rate_limit_error", description: "Device login: polling too fast. Add 5 seconds to the interval and keep polling." },
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Version of this SDK (kept equal to packages/sdk-node/package.json "version"; a test checks it). */
|
|
2
|
-
export declare const SDK_VERSION = "0.2.
|
|
2
|
+
export declare const SDK_VERSION = "0.2.7";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Version of this SDK (kept equal to packages/sdk-node/package.json "version"; a test checks it). */
|
|
2
|
-
export const SDK_VERSION = '0.2.
|
|
2
|
+
export const SDK_VERSION = '0.2.7';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkbox-site/node",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Checkbox Node.js SDK: auto-renewal law and subscription compliance checks (FTC ROSCA, California ARL, New York and other state laws) for Stripe Checkout and other subscription checkouts. Zero dependencies. Published to npm as @checkbox-site/node.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"subscription",
|