@checkbox-site/node 0.1.1 → 0.2.1
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 +87 -2
- package/dist/generated/operations.d.ts +208 -28
- package/dist/generated/operations.js +185 -24
- package/dist/generated/types.d.ts +971 -169
- package/dist/generated/types.js +13 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +11 -2
package/dist/generated/types.js
CHANGED
|
@@ -6,7 +6,7 @@ export const API_VERSION = "2026-10-30";
|
|
|
6
6
|
/** Every API version the server knows, oldest first. */
|
|
7
7
|
export const API_VERSIONS = ["2026-10-30"];
|
|
8
8
|
/** Every webhook event type. */
|
|
9
|
-
export const WEBHOOK_EVENT_TYPES = ["plan.updated", "task.verified", "notice.due", "notice.overdue", "receipt.created", "test_run.completed", "test_run.failed", "site.
|
|
9
|
+
export const WEBHOOK_EVENT_TYPES = ["plan.updated", "task.verified", "notice.due", "notice.overdue", "receipt.created", "test_run.completed", "test_run.failed", "site.compliance_changed", "finding.created", "finding.resolved", "scan.completed", "scan.failed", "law.changed", "certificate.issued", "certificate.lapsed", "certificate.revoked", "notice.sent", "consent.created", "site.checks_passed", "site.compliant"];
|
|
10
10
|
// ---- Errors ----------------------------------------------------------------------------------------------------
|
|
11
11
|
/** Stable error codes (`error.code`), with HTTP status, type and meaning. Codes are never renamed. */
|
|
12
12
|
export const ERROR_CODES = {
|
|
@@ -18,8 +18,10 @@ export const ERROR_CODES = {
|
|
|
18
18
|
api_version_invalid: { status: 400, type: "invalid_request_error", description: "The Checkbox-Version header names an unknown API version." },
|
|
19
19
|
idempotency_key_invalid: { status: 400, type: "idempotency_error", description: "The Idempotency-Key header is empty or longer than 255 characters." },
|
|
20
20
|
idempotency_key_reused: { status: 400, type: "idempotency_error", description: "The Idempotency-Key was already used with different parameters within 24 hours." },
|
|
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 (createTestCredential
|
|
22
|
-
test_key_not_test_mode: { status: 400, type: "invalid_request_error", description: "The billing key is a live-mode (or malformed) key
|
|
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
|
+
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
|
+
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 allow the agent to use the project's Stripe TEST key when approving the setup; only a person can add it, in the dashboard." },
|
|
23
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." },
|
|
24
26
|
authorization_pending: { status: 400, type: "invalid_request_error", description: "Device login: the human has not approved yet. Keep polling createDeviceToken every `interval` seconds." },
|
|
25
27
|
slow_down: { status: 400, type: "rate_limit_error", description: "Device login: polling too fast. Add 5 seconds to the interval and keep polling." },
|
|
@@ -34,17 +36,23 @@ export const ERROR_CODES = {
|
|
|
34
36
|
insufficient_role: { status: 403, type: "permission_error", description: "The key (or the person who created it) does not have a role that allows this action." },
|
|
35
37
|
account_not_activated: { status: 403, type: "permission_error", description: "Live mode needs an activated account: verify the domain of one of your sites (or use a test key)." },
|
|
36
38
|
test_mode_domain_unverified: { status: 403, type: "permission_error", description: "Test mode only scans, monitors, fetches and test-runs localhost or domains the account has verified; verify the domain (createDomainVerification) or send the HTML instead." },
|
|
37
|
-
test_mode_scan_budget_exhausted: { status: 429, type: "rate_limit_error", description: "No longer returned
|
|
39
|
+
test_mode_scan_budget_exhausted: { status: 429, type: "rate_limit_error", description: "No longer returned: test mode has no scan budget for unverified domains any more, they are refused with test_mode_domain_unverified. Kept so older clients still recognise the code." },
|
|
38
40
|
domain_not_verified: { status: 403, type: "permission_error", description: "Checkbox only scans, monitors, fetches and test-runs websites the account has verified (DNS TXT record or /.well-known file): every target host (site, checkout, account and policy URLs) must be on a verified domain. `next_action` says which domain to verify." },
|
|
41
|
+
live_key_requires_dashboard: { status: 403, type: "permission_error", description: "A live-mode Stripe key (rk_live_ / sk_live_) cannot be connected through the API or by an AI agent: only a person signed in to the Checkbox dashboard can connect one (and never on a test-mode site). Agents store restricted TEST keys (rk_test_…)." },
|
|
39
42
|
account_suspended: { status: 403, type: "permission_error", description: "The account was suspended by Checkbox staff; contact support." },
|
|
40
43
|
resource_missing: { status: 404, type: "invalid_request_error", description: "No object with this id exists in this mode of the account." },
|
|
41
44
|
route_not_found: { status: 404, type: "invalid_request_error", description: "No such endpoint. See /v1/openapi.json for the list." },
|
|
42
45
|
resource_conflict: { status: 409, type: "invalid_request_error", description: "The object is in a state that does not allow this action." },
|
|
43
46
|
scan_already_queued: { status: 409, type: "invalid_request_error", description: "A scan of this site is already queued or running." },
|
|
44
47
|
consent_reference_locked: { status: 409, type: "invalid_request_error", description: "The consent already carries a different customer_reference; references are set once and never changed." },
|
|
48
|
+
billing_account_mismatch: { status: 409, type: "invalid_request_error", description: "The key's Stripe account looks like another site's (the site's prices or Payment Links are not in it, or it is already connected in another workspace), so nothing was stored or evaluated. Ask the human the question in `message`; retry with confirm_account_mismatch: true only if they say yes, else use this site's own key. `problems` lists what did not match." },
|
|
45
49
|
test_run_in_progress: { status: 409, type: "invalid_request_error", description: "The site already has a queued or running test run; wait for it (retrieveTestRun) or cancel it (cancelTestRun)." },
|
|
50
|
+
legal_hold_active: { status: 409, type: "invalid_request_error", description: "A legal hold is on for the account or the site: deleting data and shortening retention are refused until it is turned off (updateAccount / updateSite legal_hold)." },
|
|
46
51
|
idempotency_key_in_use: { status: 409, type: "idempotency_error", description: "A request with this Idempotency-Key is still being processed; retry shortly." },
|
|
52
|
+
shopify_not_connected: { status: 409, type: "invalid_request_error", description: "The site's Shopify store is not connected through the Checkbox Shopify app, so Checkbox cannot publish to the app block. Only the merchant can connect it: install the Checkbox app from the Shopify admin and click \"Connect to Checkbox\" (`next_action` has the exact step)." },
|
|
47
53
|
resource_archived: { status: 410, type: "invalid_request_error", description: "The object is archived; restore it before changing it." },
|
|
54
|
+
terms_incomplete: { status: 422, type: "invalid_request_error", description: "Checkbox cannot write the exact, verified renewal terms yet: plan facts are missing (price, interval, trial, cancellation URL or merchant name). `problems` lists them; `next_action` names the call that sets them." },
|
|
55
|
+
fix_verification_failed: { status: 422, type: "invalid_request_error", description: "The generated disclosure did not pass every sign-up check of the rules engine, so nothing was published. The message names the failing checks." },
|
|
48
56
|
body_too_large: { status: 413, type: "invalid_request_error", description: "The request body is too large." },
|
|
49
57
|
content_type_unsupported: { status: 415, type: "invalid_request_error", description: "Send JSON bodies with Content-Type: application/json." },
|
|
50
58
|
site_limit_reached: { status: 403, type: "invalid_request_error", description: "The account reached its fair-use site limit (default 25); contact support to raise it." },
|
|
@@ -52,6 +60,7 @@ export const ERROR_CODES = {
|
|
|
52
60
|
plan_required: { status: 402, type: "invalid_request_error", description: "Only when billing is enabled on this deployment: the feature needs a paid plan." },
|
|
53
61
|
rate_limit_exceeded: { status: 429, type: "rate_limit_error", description: "Too many requests; slow down and retry after the Retry-After header." },
|
|
54
62
|
receipts_disabled: { status: 403, type: "permission_error", description: "Consent receipts are turned off for this account (updateReceiptSettings enabled=true turns them on)." },
|
|
63
|
+
platform_error: { status: 502, type: "api_error", description: "The merchant's platform (e.g. Shopify) refused or failed the change; nothing was recorded as applied. Retry later; `message` has the platform's answer." },
|
|
55
64
|
feature_unavailable: { status: 503, type: "api_error", description: "The feature is not configured on this deployment (for example the database migration is missing)." },
|
|
56
65
|
internal_error: { status: 500, type: "api_error", description: "Something went wrong on Checkbox's side. Retrying with the same Idempotency-Key is safe." },
|
|
57
66
|
};
|
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
|
+
export declare const SDK_VERSION = "0.2.1";
|
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
|
+
export const SDK_VERSION = '0.2.1';
|
package/package.json
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkbox-site/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Checkbox Node.js SDK: automatic-renewal-law compliance (ROSCA, California ARL, New York and other state laws) for subscription businesses. Zero dependencies. Published to npm as @checkbox-site/node.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"subscription",
|
|
7
|
+
"subscription-compliance",
|
|
7
8
|
"auto-renewal",
|
|
8
9
|
"automatic-renewal",
|
|
9
10
|
"compliance",
|
|
10
11
|
"rosca",
|
|
11
12
|
"click-to-cancel",
|
|
12
13
|
"california-arl",
|
|
14
|
+
"auto-renewal-law",
|
|
15
|
+
"auto-renewal-compliance",
|
|
16
|
+
"subscription-cancellation",
|
|
17
|
+
"renewal-reminder",
|
|
18
|
+
"stripe-subscriptions",
|
|
19
|
+
"ftc",
|
|
20
|
+
"negative-option",
|
|
13
21
|
"stripe",
|
|
14
22
|
"stripe-checkout",
|
|
15
23
|
"checkout",
|
|
16
|
-
"cancellation"
|
|
24
|
+
"cancellation",
|
|
25
|
+
"mcp"
|
|
17
26
|
],
|
|
18
27
|
"license": "MIT",
|
|
19
28
|
"author": "Checkbox <support@checkbox.site>",
|