@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
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,7 +18,7 @@ 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 (
|
|
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 (a person adds it in the dashboard on the site's Proof page)." },
|
|
22
22
|
test_key_not_test_mode: { status: 400, type: "invalid_request_error", description: "The billing key is a live-mode (or malformed) key; test runs only accept test-mode keys (rk_test_… / sk_test_…)." },
|
|
23
23
|
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
24
|
authorization_pending: { status: 400, type: "invalid_request_error", description: "Device login: the human has not approved yet. Keep polling createDeviceToken every `interval` seconds." },
|
|
@@ -34,7 +34,7 @@ export const ERROR_CODES = {
|
|
|
34
34
|
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
35
|
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
36
|
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
|
|
37
|
+
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
38
|
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." },
|
|
39
39
|
account_suspended: { status: 403, type: "permission_error", description: "The account was suspended by Checkbox staff; contact support." },
|
|
40
40
|
resource_missing: { status: 404, type: "invalid_request_error", description: "No object with this id exists in this mode of the account." },
|
|
@@ -43,8 +43,12 @@ export const ERROR_CODES = {
|
|
|
43
43
|
scan_already_queued: { status: 409, type: "invalid_request_error", description: "A scan of this site is already queued or running." },
|
|
44
44
|
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." },
|
|
45
45
|
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)." },
|
|
46
|
+
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
47
|
idempotency_key_in_use: { status: 409, type: "idempotency_error", description: "A request with this Idempotency-Key is still being processed; retry shortly." },
|
|
48
|
+
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
49
|
resource_archived: { status: 410, type: "invalid_request_error", description: "The object is archived; restore it before changing it." },
|
|
50
|
+
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." },
|
|
51
|
+
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
52
|
body_too_large: { status: 413, type: "invalid_request_error", description: "The request body is too large." },
|
|
49
53
|
content_type_unsupported: { status: 415, type: "invalid_request_error", description: "Send JSON bodies with Content-Type: application/json." },
|
|
50
54
|
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 +56,7 @@ export const ERROR_CODES = {
|
|
|
52
56
|
plan_required: { status: 402, type: "invalid_request_error", description: "Only when billing is enabled on this deployment: the feature needs a paid plan." },
|
|
53
57
|
rate_limit_exceeded: { status: 429, type: "rate_limit_error", description: "Too many requests; slow down and retry after the Retry-After header." },
|
|
54
58
|
receipts_disabled: { status: 403, type: "permission_error", description: "Consent receipts are turned off for this account (updateReceiptSettings enabled=true turns them on)." },
|
|
59
|
+
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
60
|
feature_unavailable: { status: 503, type: "api_error", description: "The feature is not configured on this deployment (for example the database migration is missing)." },
|
|
56
61
|
internal_error: { status: 500, type: "api_error", description: "Something went wrong on Checkbox's side. Retrying with the same Idempotency-Key is safe." },
|
|
57
62
|
};
|
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.0";
|
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.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkbox-site/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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",
|