@checkbox-site/node 0.2.6 → 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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -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. */
|
|
@@ -680,6 +680,56 @@ export interface SetupVerification {
|
|
|
680
680
|
next_action: SetupNextAction;
|
|
681
681
|
/** The same as setup_session.steps, at the top level: the setup checklist, in order. */
|
|
682
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;
|
|
683
733
|
setup_session: SetupSession;
|
|
684
734
|
}
|
|
685
735
|
/** Account default retention (sites without their own setting use it). */
|
|
@@ -1200,8 +1250,8 @@ export interface SiteTestAccount {
|
|
|
1200
1250
|
login_url: string;
|
|
1201
1251
|
/** Test account email. */
|
|
1202
1252
|
email: string;
|
|
1203
|
-
/** Test account password (write-only; encrypted at rest). */
|
|
1204
|
-
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;
|
|
1205
1255
|
/** Custom login steps. */
|
|
1206
1256
|
login_steps?: Array<ScanStep>;
|
|
1207
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.) */
|
|
@@ -2854,13 +2904,13 @@ export interface DisclosureCheckParams {
|
|
|
2854
2904
|
trial_days?: number;
|
|
2855
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. */
|
|
2856
2906
|
intro_price?: number | string;
|
|
2857
|
-
/** 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. */
|
|
2858
2908
|
intro_amount?: number;
|
|
2859
2909
|
/** How many billing periods the intro price lasts (default 1). */
|
|
2860
2910
|
intro_periods?: number;
|
|
2861
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. */
|
|
2862
2912
|
intro_percent_off?: number;
|
|
2863
|
-
/** 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. */
|
|
2864
2914
|
intro_amount_off?: number;
|
|
2865
2915
|
/** https URL where subscribers cancel online (used in generated text; a {{cancel_url}} placeholder otherwise). */
|
|
2866
2916
|
cancel_url?: string;
|
|
@@ -2900,6 +2950,8 @@ export interface DisclosureCheckParams {
|
|
|
2900
2950
|
/** The form cannot be submitted without ticking it (default true). */
|
|
2901
2951
|
required?: boolean;
|
|
2902
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";
|
|
2903
2955
|
/** Evaluate the law as of this date (YYYY-MM-DD, default today). */
|
|
2904
2956
|
as_of?: string;
|
|
2905
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. */
|
|
@@ -3013,13 +3065,13 @@ export interface CheckPlanTerms {
|
|
|
3013
3065
|
trial_days?: number;
|
|
3014
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. */
|
|
3015
3067
|
intro_price?: number | string;
|
|
3016
|
-
/** 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. */
|
|
3017
3069
|
intro_amount?: number;
|
|
3018
3070
|
/** How many billing periods the intro price lasts (default 1). */
|
|
3019
3071
|
intro_periods?: number;
|
|
3020
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. */
|
|
3021
3073
|
intro_percent_off?: number;
|
|
3022
|
-
/** 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. */
|
|
3023
3075
|
intro_amount_off?: number;
|
|
3024
3076
|
/** https URL where subscribers cancel online (used in generated text; a {{cancel_url}} placeholder otherwise). */
|
|
3025
3077
|
cancel_url?: string;
|
|
@@ -5610,7 +5662,7 @@ export declare const ERROR_CODES: {
|
|
|
5610
5662
|
readonly test_key_declined: {
|
|
5611
5663
|
readonly status: 403;
|
|
5612
5664
|
readonly type: "permission_error";
|
|
5613
|
-
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.
|
|
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.";
|
|
5614
5666
|
};
|
|
5615
5667
|
readonly test_key_rejected: {
|
|
5616
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 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.
|
|
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",
|