@checkbox-site/node 0.2.2 → 0.2.4
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 +1 -1
- package/dist/generated/operations.d.ts +3 -3
- package/dist/generated/operations.js +3 -3
- package/dist/generated/types.d.ts +10 -10
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -2
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.4";
|
|
49
49
|
static readonly API_VERSION = "2026-10-30";
|
|
50
50
|
static readonly errors: typeof errors;
|
|
51
51
|
static readonly webhooks: Webhooks;
|
|
@@ -3082,7 +3082,7 @@ export declare class ChecksResource extends Resource {
|
|
|
3082
3082
|
/**
|
|
3083
3083
|
* Check Stripe Checkout Session params.
|
|
3084
3084
|
*
|
|
3085
|
-
*
|
|
3085
|
+
* Body: `{ params, merchant }` (or `{ params, site }`). `params` is exactly the object your code gives stripe.checkout.sessions.create; `merchant` adds merchant_name, cancel_url, and price/interval when line_items use a Price id. Checkbox models the Stripe-hosted page those params render and returns findings plus `correction`: a JSON Patch (RFC 6902) and the full corrected params (custom_text.submit with the renewal terms, consent_collection.terms_of_service = "required", custom_text.terms_of_service_acceptance as the consent label), verified by the engine. Stripe's own small grey styling keeps "clear and conspicuous" at needs_review on any Stripe-hosted page; also show the terms on your page before redirecting. 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.
|
|
3086
3086
|
*
|
|
3087
3087
|
* @see POST /v1/checks/stripe_checkout_session (operation `checkStripeCheckoutSession`, scope `checks:read`)
|
|
3088
3088
|
*/
|
|
@@ -3356,7 +3356,7 @@ export declare class StripeCheckoutConfigsResource extends Resource {
|
|
|
3356
3356
|
/**
|
|
3357
3357
|
* Register the Checkout Session params your code uses.
|
|
3358
3358
|
*
|
|
3359
|
-
* 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.
|
|
3359
|
+
* Registers exactly the object your code passes to stripe.checkout.sessions.create, as `params` (that object sent alone as the body is accepted too; 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.
|
|
3360
3360
|
*
|
|
3361
3361
|
* @param site Unique identifier of the site (site_…).
|
|
3362
3362
|
* @see POST /v1/sites/{site}/stripe_checkout_configs (operation `createStripeCheckoutConfig`, scope `test_runs:write`)
|
|
@@ -3412,7 +3412,7 @@ export declare class TestRunsResource extends Resource {
|
|
|
3412
3412
|
/**
|
|
3413
3413
|
* Start a lifecycle test run.
|
|
3414
3414
|
*
|
|
3415
|
-
* 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
|
|
3415
|
+
* 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 1-2 minutes; a real_checkout run a few 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.
|
|
3416
3416
|
*
|
|
3417
3417
|
* @param site Unique identifier of the site (site_…).
|
|
3418
3418
|
* @see POST /v1/sites/{site}/test_runs (operation `createTestRun`, scope `test_runs:write`, live mode needs an activated account)
|
|
@@ -2602,7 +2602,7 @@ export class ChecksResource extends Resource {
|
|
|
2602
2602
|
/**
|
|
2603
2603
|
* Check Stripe Checkout Session params.
|
|
2604
2604
|
*
|
|
2605
|
-
*
|
|
2605
|
+
* Body: `{ params, merchant }` (or `{ params, site }`). `params` is exactly the object your code gives stripe.checkout.sessions.create; `merchant` adds merchant_name, cancel_url, and price/interval when line_items use a Price id. Checkbox models the Stripe-hosted page those params render and returns findings plus `correction`: a JSON Patch (RFC 6902) and the full corrected params (custom_text.submit with the renewal terms, consent_collection.terms_of_service = "required", custom_text.terms_of_service_acceptance as the consent label), verified by the engine. Stripe's own small grey styling keeps "clear and conspicuous" at needs_review on any Stripe-hosted page; also show the terms on your page before redirecting. 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.
|
|
2606
2606
|
*
|
|
2607
2607
|
* @see POST /v1/checks/stripe_checkout_session (operation `checkStripeCheckoutSession`, scope `checks:read`)
|
|
2608
2608
|
*/
|
|
@@ -2936,7 +2936,7 @@ export class StripeCheckoutConfigsResource extends Resource {
|
|
|
2936
2936
|
/**
|
|
2937
2937
|
* Register the Checkout Session params your code uses.
|
|
2938
2938
|
*
|
|
2939
|
-
* 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.
|
|
2939
|
+
* Registers exactly the object your code passes to stripe.checkout.sessions.create, as `params` (that object sent alone as the body is accepted too; 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.
|
|
2940
2940
|
*
|
|
2941
2941
|
* @param site Unique identifier of the site (site_…).
|
|
2942
2942
|
* @see POST /v1/sites/{site}/stripe_checkout_configs (operation `createStripeCheckoutConfig`, scope `test_runs:write`)
|
|
@@ -3006,7 +3006,7 @@ export class TestRunsResource extends Resource {
|
|
|
3006
3006
|
/**
|
|
3007
3007
|
* Start a lifecycle test run.
|
|
3008
3008
|
*
|
|
3009
|
-
* 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
|
|
3009
|
+
* 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 1-2 minutes; a real_checkout run a few 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.
|
|
3010
3010
|
*
|
|
3011
3011
|
* @param site Unique identifier of the site (site_…).
|
|
3012
3012
|
* @see POST /v1/sites/{site}/test_runs (operation `createTestRun`, scope `test_runs:write`, live mode needs an activated account)
|
|
@@ -129,7 +129,7 @@ export interface DeviceAuthorizationParams {
|
|
|
129
129
|
merchant_name?: string;
|
|
130
130
|
/** Also ask for live-mode keys (live mode activates after domain verification). */
|
|
131
131
|
live?: boolean;
|
|
132
|
-
/** A HINT of the Stripe TEST key found in the project, never the key. Format: "
|
|
132
|
+
/** A HINT of the Stripe restricted TEST key found in the project, never the key. Format: "rk_test_", the ellipsis character "…" (U+2026), then the key's last 4 characters, e.g. "rk_test_…a1b2". The human is asked once whether Checkbox may use it. Agents may store restricted test keys (rk_test_) only: an "sk_test_" hint (sent by older CLIs) is accepted and ignored, because a full secret key is refused on every path. */
|
|
133
133
|
stripe_test_key_hint?: string;
|
|
134
134
|
}
|
|
135
135
|
/** Keys issued after the human approved the device login. Returned exactly once. */
|
|
@@ -390,7 +390,7 @@ export interface SetupSession {
|
|
|
390
390
|
stripe: {
|
|
391
391
|
/** 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. */
|
|
392
392
|
test_key_consent: boolean;
|
|
393
|
-
/** Hint of the key the CLI found (never the key). */
|
|
393
|
+
/** Hint of the restricted test key the CLI found (never the key). */
|
|
394
394
|
test_key_hint: string | null;
|
|
395
395
|
/** Whether a Stripe test-mode key is stored for test runs. */
|
|
396
396
|
test_credential_stored: boolean;
|
|
@@ -402,7 +402,7 @@ export interface SetupSession {
|
|
|
402
402
|
recommended: boolean;
|
|
403
403
|
/** Why. */
|
|
404
404
|
reason: string;
|
|
405
|
-
/**
|
|
405
|
+
/** Stripe API keys page (Test mode); click "Create restricted key" there. */
|
|
406
406
|
create_url: string;
|
|
407
407
|
/** The one key checklist: every permission Checkbox uses (checks, fixes after the human approves, test runs). */
|
|
408
408
|
permissions: Array<{
|
|
@@ -419,7 +419,7 @@ export interface SetupSession {
|
|
|
419
419
|
test_run: {
|
|
420
420
|
/** Unique identifier of the test run (run_…). */
|
|
421
421
|
id: string;
|
|
422
|
-
/** queued, running, succeeded, failed or canceled. */
|
|
422
|
+
/** queued, running, succeeded, incomplete (no step failed, but a step could not finish), failed or canceled. */
|
|
423
423
|
status: string;
|
|
424
424
|
/** The result in plain words, as the test run says it ("Finished with 2 warnings to review"). succeeded with warnings is not a clean pass. */
|
|
425
425
|
status_label?: string;
|
|
@@ -1766,7 +1766,7 @@ export interface CompliancePlan {
|
|
|
1766
1766
|
site: string;
|
|
1767
1767
|
/** 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). */
|
|
1768
1768
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
1769
|
-
/** The plan status in words to show a person
|
|
1769
|
+
/** 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). */
|
|
1770
1770
|
status_label?: string;
|
|
1771
1771
|
/** The evaluation the plan was built from (null before the first check). */
|
|
1772
1772
|
evaluation: string | null;
|
|
@@ -1967,7 +1967,7 @@ export interface Verification {
|
|
|
1967
1967
|
diff: Array<VerificationCheck>;
|
|
1968
1968
|
/** Plan status after this verification (null while pending). */
|
|
1969
1969
|
plan_status: "action_required" | "verifying" | "compliant" | "blocked" | null;
|
|
1970
|
-
/** The plan status in words to show a person
|
|
1970
|
+
/** 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). */
|
|
1971
1971
|
plan_status_label?: string | null;
|
|
1972
1972
|
next_action: PlanNextAction;
|
|
1973
1973
|
/** When it was requested. Unix timestamp in seconds. */
|
|
@@ -1999,7 +1999,7 @@ export interface VerifyTaskParams {
|
|
|
1999
1999
|
plan?: string;
|
|
2000
2000
|
/** email_copy tasks: check the email against the plan with this Stripe Price id only. */
|
|
2001
2001
|
price_id?: string;
|
|
2002
|
-
/**
|
|
2002
|
+
/** Kept for compatibility: a task that is already done (or declined) is always re-checked now (Stripe re-read, registered checkout configs judged again, a fresh evaluation or a confirming scan), never answered from its last result. A task closed without anything observed passing (superseded, no longer applicable, or a person's decision) answers not_checked: nothing to verify. */
|
|
2003
2003
|
recheck?: boolean;
|
|
2004
2004
|
}
|
|
2005
2005
|
/** A page of verifications, newest first. */
|
|
@@ -4443,8 +4443,8 @@ export interface TestRun {
|
|
|
4443
4443
|
type: "stripe" | "generic";
|
|
4444
4444
|
/** 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. */
|
|
4445
4445
|
mode: "mirror" | "real_checkout" | null;
|
|
4446
|
-
/** succeeded means the run finished and no step failed (steps may still have warnings to review); failed means it stopped early, or finished with a failed step (see failure and steps[].fix). */
|
|
4447
|
-
status: "queued" | "running" | "succeeded" | "failed" | "canceled";
|
|
4446
|
+
/** 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). */
|
|
4447
|
+
status: "queued" | "running" | "succeeded" | "incomplete" | "failed" | "canceled";
|
|
4448
4448
|
/** 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. */
|
|
4449
4449
|
status_label: string;
|
|
4450
4450
|
/** Internal phase (prepare, checkout, await_ack, advance, settle, cancel, await_cancel_email, finalize, done). */
|
|
@@ -4768,7 +4768,7 @@ export interface CompliancePlanSummary {
|
|
|
4768
4768
|
site: string;
|
|
4769
4769
|
/** 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). */
|
|
4770
4770
|
status: "action_required" | "verifying" | "compliant" | "blocked";
|
|
4771
|
-
/** The plan status in words to show a person
|
|
4771
|
+
/** 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). */
|
|
4772
4772
|
status_label?: string;
|
|
4773
4773
|
/** Two or three sentences for an LLM: where the site stands and what comes next. */
|
|
4774
4774
|
summary: string;
|
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.4";
|
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.4';
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkbox-site/node",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Checkbox Node.js SDK:
|
|
3
|
+
"version": "0.2.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",
|
|
7
7
|
"subscription-compliance",
|
|
8
|
+
"subscription compliance",
|
|
8
9
|
"auto-renewal",
|
|
10
|
+
"auto renewal",
|
|
9
11
|
"autorenewal",
|
|
10
12
|
"automatic-renewal",
|
|
11
13
|
"compliance",
|