botshield-sdk 4.0.1 → 4.0.3
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 -5
- package/bin/mcp-server.js +15 -13
- package/bin/mcp-server.js.map +19 -19
- package/dist/commonjs/funcs/census-confirm-link.d.ts +1 -1
- package/dist/commonjs/funcs/census-confirm-link.js +1 -1
- package/dist/commonjs/funcs/census-send-by-number.d.ts +1 -1
- package/dist/commonjs/funcs/census-send-by-number.js +1 -1
- package/dist/commonjs/funcs/census-verify-token.d.ts +1 -1
- package/dist/commonjs/funcs/census-verify-token.js +1 -1
- package/dist/commonjs/funcs/verification-get-status.d.ts +1 -1
- package/dist/commonjs/funcs/verification-get-status.js +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -12
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +3 -13
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/bot-shield-action.d.ts +7 -7
- package/dist/commonjs/models/bot-shield-action.js +1 -1
- package/dist/commonjs/models/error-body.d.ts +1 -1
- package/dist/commonjs/models/operations/actions-propose.d.ts +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-create.d.ts +2 -2
- package/dist/commonjs/models/operations/gates-api-actions-list.d.ts +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-request.d.ts +2 -2
- package/dist/commonjs/models/operations/gates-api-actions-set-state.d.ts +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-update.d.ts +2 -2
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +2 -2
- package/dist/commonjs/models/operations/sdk-send-by-number.d.ts +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts +7 -7
- package/dist/commonjs/models/operations/secured-accounts-list.d.ts +5 -0
- package/dist/commonjs/models/operations/secured-accounts-list.d.ts.map +1 -1
- package/dist/commonjs/models/operations/secured-accounts-list.js +2 -0
- package/dist/commonjs/models/operations/secured-accounts-list.js.map +1 -1
- package/dist/commonjs/models/operations/secured-accounts-status.d.ts +5 -0
- package/dist/commonjs/models/operations/secured-accounts-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/secured-accounts-status.js +2 -0
- package/dist/commonjs/models/operations/secured-accounts-status.js.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.d.ts +6 -6
- package/dist/commonjs/models/operations/verification-get-status.js +1 -1
- package/dist/commonjs/sdk/census.d.ts +3 -3
- package/dist/commonjs/sdk/census.js +3 -3
- package/dist/commonjs/sdk/verification.d.ts +1 -1
- package/dist/commonjs/sdk/verification.js +1 -1
- package/dist/esm/funcs/census-confirm-link.d.ts +1 -1
- package/dist/esm/funcs/census-confirm-link.js +1 -1
- package/dist/esm/funcs/census-send-by-number.d.ts +1 -1
- package/dist/esm/funcs/census-send-by-number.js +1 -1
- package/dist/esm/funcs/census-verify-token.d.ts +1 -1
- package/dist/esm/funcs/census-verify-token.js +1 -1
- package/dist/esm/funcs/verification-get-status.d.ts +1 -1
- package/dist/esm/funcs/verification-get-status.js +1 -1
- package/dist/esm/lib/config.d.ts +2 -12
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +2 -12
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/bot-shield-action.d.ts +7 -7
- package/dist/esm/models/bot-shield-action.js +1 -1
- package/dist/esm/models/error-body.d.ts +1 -1
- package/dist/esm/models/operations/actions-propose.d.ts +1 -1
- package/dist/esm/models/operations/gates-api-actions-create.d.ts +2 -2
- package/dist/esm/models/operations/gates-api-actions-list.d.ts +1 -1
- package/dist/esm/models/operations/gates-api-actions-request.d.ts +2 -2
- package/dist/esm/models/operations/gates-api-actions-set-state.d.ts +1 -1
- package/dist/esm/models/operations/gates-api-actions-update.d.ts +2 -2
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts +2 -2
- package/dist/esm/models/operations/sdk-send-by-number.d.ts +1 -1
- package/dist/esm/models/operations/sdk-verify-token.d.ts +7 -7
- package/dist/esm/models/operations/secured-accounts-list.d.ts +5 -0
- package/dist/esm/models/operations/secured-accounts-list.d.ts.map +1 -1
- package/dist/esm/models/operations/secured-accounts-list.js +2 -0
- package/dist/esm/models/operations/secured-accounts-list.js.map +1 -1
- package/dist/esm/models/operations/secured-accounts-status.d.ts +5 -0
- package/dist/esm/models/operations/secured-accounts-status.d.ts.map +1 -1
- package/dist/esm/models/operations/secured-accounts-status.js +2 -0
- package/dist/esm/models/operations/secured-accounts-status.js.map +1 -1
- package/dist/esm/models/operations/verification-get-status.d.ts +6 -6
- package/dist/esm/models/operations/verification-get-status.js +1 -1
- package/dist/esm/sdk/census.d.ts +3 -3
- package/dist/esm/sdk/census.js +3 -3
- package/dist/esm/sdk/verification.d.ts +1 -1
- package/dist/esm/sdk/verification.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/census-confirm-link.ts +1 -1
- package/src/funcs/census-send-by-number.ts +1 -1
- package/src/funcs/census-verify-token.ts +1 -1
- package/src/funcs/verification-get-status.ts +1 -1
- package/src/lib/config.ts +2 -12
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/bot-shield-action.ts +7 -7
- package/src/models/error-body.ts +1 -1
- package/src/models/operations/actions-propose.ts +1 -1
- package/src/models/operations/gates-api-actions-create.ts +2 -2
- package/src/models/operations/gates-api-actions-list.ts +1 -1
- package/src/models/operations/gates-api-actions-request.ts +2 -2
- package/src/models/operations/gates-api-actions-set-state.ts +1 -1
- package/src/models/operations/gates-api-actions-update.ts +2 -2
- package/src/models/operations/sdk-create-verification-link.ts +2 -2
- package/src/models/operations/sdk-send-by-number.ts +1 -1
- package/src/models/operations/sdk-verify-token.ts +7 -7
- package/src/models/operations/secured-accounts-list.ts +7 -0
- package/src/models/operations/secured-accounts-status.ts +7 -0
- package/src/models/operations/verification-get-status.ts +6 -6
- package/src/sdk/census.ts +3 -3
- package/src/sdk/verification.ts +1 -1
|
@@ -32,7 +32,7 @@ export type BotShieldActionEnvironment = OpenEnum<
|
|
|
32
32
|
>;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* `action` (a BotShield Action), `recovery` (your one Recovery Action: only your customer starts it, from the Recover Account with BotShield button) or `signin` (your one Sign-on Action: only signin/request starts it). Recovery and Sign-on Actions are placed in the Console; no `act`, server ask, send by number or staff send reaches them (`action_is_recovery` / `action_is_signin`). `action` on an engine before 4.0.
|
|
36
36
|
*/
|
|
37
37
|
export const BotShieldActionKind = {
|
|
38
38
|
Action: "action",
|
|
@@ -40,7 +40,7 @@ export const BotShieldActionKind = {
|
|
|
40
40
|
Signin: "signin",
|
|
41
41
|
} as const;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* `action` (a BotShield Action), `recovery` (your one Recovery Action: only your customer starts it, from the Recover Account with BotShield button) or `signin` (your one Sign-on Action: only signin/request starts it). Recovery and Sign-on Actions are placed in the Console; no `act`, server ask, send by number or staff send reaches them (`action_is_recovery` / `action_is_signin`). `action` on an engine before 4.0.
|
|
44
44
|
*/
|
|
45
45
|
export type BotShieldActionKind = OpenEnum<typeof BotShieldActionKind>;
|
|
46
46
|
|
|
@@ -73,23 +73,23 @@ export type BotShieldAction = {
|
|
|
73
73
|
*/
|
|
74
74
|
staffCanSend?: boolean | undefined;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* `action` (a BotShield Action), `recovery` (your one Recovery Action: only your customer starts it, from the Recover Account with BotShield button) or `signin` (your one Sign-on Action: only signin/request starts it). Recovery and Sign-on Actions are placed in the Console; no `act`, server ask, send by number or staff send reaches them (`action_is_recovery` / `action_is_signin`). `action` on an engine before 4.0.
|
|
77
77
|
*/
|
|
78
78
|
kind?: BotShieldActionKind | undefined;
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* On a Sign-on Action, whether BotShield's own QR may finish a sign-in (default off: your page's passkey only). Always false on other kinds.
|
|
81
81
|
*/
|
|
82
82
|
signinQr?: boolean | undefined;
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* A Recovery Action's new landing address while it waits to take effect (24 hours in Production; every admin is told). `where_url` is the address in effect until then.
|
|
85
85
|
*/
|
|
86
86
|
pendingWhereUrl?: string | null | undefined;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* When `pending_where_url` takes effect.
|
|
89
89
|
*/
|
|
90
90
|
pendingWhereUrlAt?: Date | null | undefined;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
92
|
+
* High-value. It starts only from your customer's signed-in session (your server naming the account by your own reference); by phone number or by staff it is refused (`action_requires_signed_in`). Set with `highValue` on create or update.
|
|
93
93
|
*/
|
|
94
94
|
highValue?: boolean | undefined;
|
|
95
95
|
};
|
package/src/models/error-body.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type ErrorBody = {
|
|
|
36
36
|
message: string;
|
|
37
37
|
statusCode: number;
|
|
38
38
|
/**
|
|
39
|
-
* `ttl_below_floor`, `ttl_above_ceiling`, `trust_layer_rejected`, `trust_layer_unavailable`, `gate_required`, `alias_retired`, `RATE_LIMITED`, `inline_not_for_age_gate`, `act_label_has_link`, and in
|
|
39
|
+
* `ttl_below_floor`, `ttl_above_ceiling`, `trust_layer_rejected`, `trust_layer_unavailable`, `gate_required`, `alias_retired`, `RATE_LIMITED`, `inline_not_for_age_gate`, `act_label_has_link`, and in `link_requires_server_session`, `account_override_refused`, `action_is_recovery`, `action_is_signin`, `invalid_key`, `recovery_code_invalid`, `handle_invalid`, `signin_not_set_up`, `not_verified`, `account_paused`, `signin_unknown`, `signin_pending`, `signin_refused`, `signin_expired`, `signin_used`, `signin_wrong_account`, `unavailable`.
|
|
40
40
|
*/
|
|
41
41
|
code?: string | undefined;
|
|
42
42
|
minTtlSeconds?: number | undefined;
|
|
@@ -62,7 +62,7 @@ export type ActionsProposeRequest = {
|
|
|
62
62
|
*/
|
|
63
63
|
userEmail?: string | undefined;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* The person's phone number, in place of `opaque_id` / `botshield_user_id` / `user_email` (never together with them). Used for one lookup, then dropped: never stored, logged or sent in a webhook. The answer is the same whether or not anyone holds the number. Show the returned `match_number` to the person; they pick it in the app before approving. A person not yet linked to your company gets an introduction first, never the card; the ask is held and becomes the card if they allow. An ask nobody answers reads `queued`, then `expired`. Production needs a verified business.
|
|
66
66
|
*/
|
|
67
67
|
phoneNumber?: string | undefined;
|
|
68
68
|
action: ActionsProposeAction;
|
|
@@ -32,7 +32,7 @@ export type GatesApiActionsCreateRequest = {
|
|
|
32
32
|
*/
|
|
33
33
|
staffCanSend?: boolean | undefined;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* High-value. It starts only from your customer's signed-in session (your server naming the account by your own reference). It is refused by phone number and for staff sends (`action_requires_signed_in`).
|
|
36
36
|
*/
|
|
37
37
|
highValue?: boolean | undefined;
|
|
38
38
|
};
|
|
@@ -53,7 +53,7 @@ export type GatesApiActionsCreateData = {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* The placed action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_key_taken` (409), `not_migrated` (503 — `staffCanSend` is not available yet), `internal` (500).
|
|
56
|
+
* The placed action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_key_taken` (409), `not_migrated` (503 — `staffCanSend` is not available yet), `internal` (500). Each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
|
|
57
57
|
*/
|
|
58
58
|
export type GatesApiActionsCreateResponse = {
|
|
59
59
|
data: GatesApiActionsCreateData;
|
|
@@ -27,7 +27,7 @@ export type GatesApiActionsListData = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Actions. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `internal` (500). Each action carries `staff_can_send`.
|
|
30
|
+
* Actions. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `internal` (500). Each action carries `staff_can_send`. Each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
|
|
31
31
|
*/
|
|
32
32
|
export type GatesApiActionsListResponse = {
|
|
33
33
|
data: GatesApiActionsListData;
|
|
@@ -43,7 +43,7 @@ export type GatesApiActionsRequestRequest = {
|
|
|
43
43
|
*/
|
|
44
44
|
partnerUserRef?: string | undefined;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* The person's phone number, in place of `partner_user_ref` (exactly one of the two). Used for one lookup, then dropped: never stored, logged or sent in a webhook. The answer is the same whether or not anyone holds the number. Show the returned `match_number` to the person; they pick it in the app before approving. A person not yet linked to your company gets an introduction first, never the card; the ask is held and becomes the card if they allow. An ask nobody answers reads `queued`, then `expired`. Production needs a verified business.
|
|
47
47
|
*/
|
|
48
48
|
phoneNumber?: string | undefined;
|
|
49
49
|
/**
|
|
@@ -90,7 +90,7 @@ export type GatesApiActionsRequestData = {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
* Queued. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401), `gates_scope_required` (403), `org_not_found` (404), `action_invalid` (400), `action_not_found` (404), `action_off` (404), `agent_not_found` (404), `not_linked` (409 — the person isn't linked to your company), `details_invalid` (400), `agent_removed_by_person` (409 — the person removed this agent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone, so they must confirm this account with BotShield again from your signed-in page before anything can be sent to them; nothing is counted or sent), `request_id_reused` (409 — also when the same request_id is sent with other terms), `too_many_open_requests` (429 — this person already has 5 of your requests waiting; carries `retry_after_seconds`), `daily_request_limit` (429 — 50 requests to this person in 24 hours; carries `retry_after_seconds`), `request_limit_unavailable` (503 — the request could not be counted, so it was not sent; retry), `one_addressee_required` (400 — send exactly one of partner_user_ref and phone_number), `phone_invalid` (400), `org_not_verified` (403 — by phone number in production), `send_rate_limited` (429 — asks by phone number per key per hour), `unanswered_limit_reached` (429 — too many unanswered asks by phone number in 24 hours), `unavailable` (503), `internal` (500).
|
|
93
|
+
* Queued. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401), `gates_scope_required` (403), `org_not_found` (404), `action_invalid` (400), `action_not_found` (404), `action_off` (404), `agent_not_found` (404), `not_linked` (409 — the person isn't linked to your company), `details_invalid` (400), `agent_removed_by_person` (409 — the person removed this agent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone, so they must confirm this account with BotShield again from your signed-in page before anything can be sent to them; nothing is counted or sent), `request_id_reused` (409 — also when the same request_id is sent with other terms), `too_many_open_requests` (429 — this person already has 5 of your requests waiting; carries `retry_after_seconds`), `daily_request_limit` (429 — 50 requests to this person in 24 hours; carries `retry_after_seconds`), `request_limit_unavailable` (503 — the request could not be counted, so it was not sent; retry), `one_addressee_required` (400 — send exactly one of partner_user_ref and phone_number), `phone_invalid` (400), `org_not_verified` (403 — by phone number in production), `send_rate_limited` (429 — asks by phone number per key per hour), `unanswered_limit_reached` (429 — too many unanswered asks by phone number in 24 hours), `unavailable` (503), `internal` (500). `action_is_recovery` / `action_is_signin` (404 — that act is your Recovery Action or Sign-on Action, which no request starts).
|
|
94
94
|
*/
|
|
95
95
|
export type GatesApiActionsRequestResponse = {
|
|
96
96
|
data: GatesApiActionsRequestData;
|
|
@@ -47,7 +47,7 @@ export type GatesApiActionsSetStateData = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_not_found` (404), `internal` (500). Each action carries `staff_can_send`.
|
|
50
|
+
* The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_not_found` (404), `internal` (500). Each action carries `staff_can_send`. Each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
|
|
51
51
|
*/
|
|
52
52
|
export type GatesApiActionsSetStateResponse = {
|
|
53
53
|
data: GatesApiActionsSetStateData;
|
|
@@ -28,7 +28,7 @@ export type GatesApiActionsUpdateRequest = {
|
|
|
28
28
|
*/
|
|
29
29
|
staffCanSend?: boolean | undefined;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* High-value. It starts only from your customer's signed-in session (your server naming the account by your own reference). It is refused by phone number and for staff sends (`action_requires_signed_in`).
|
|
32
32
|
*/
|
|
33
33
|
highValue?: boolean | undefined;
|
|
34
34
|
};
|
|
@@ -49,7 +49,7 @@ export type GatesApiActionsUpdateData = {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
* The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `nothing_to_change` (400), `action_not_found` (404), `not_migrated` (503), `internal` (500).
|
|
52
|
+
* The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `nothing_to_change` (400), `action_not_found` (404), `not_migrated` (503), `internal` (500). Each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
|
|
53
53
|
*/
|
|
54
54
|
export type GatesApiActionsUpdateResponse = {
|
|
55
55
|
data: GatesApiActionsUpdateData;
|
|
@@ -192,7 +192,7 @@ export type SDKCreateVerificationLinkNotarizeFallbackReason = OpenEnum<
|
|
|
192
192
|
export type SDKCreateVerificationLinkDataData = {
|
|
193
193
|
requestId: string;
|
|
194
194
|
/**
|
|
195
|
-
*
|
|
195
|
+
* Only on a request started with your site key (`pk_…`, a page's grant). The one secret that reads this request's answer: send it as `X-BotShield-Request-Secret` to verification/status, which returns the finished tokens only with it. Returned once, here; BotShield keeps only its hash. A request your server started with its secret key has none (its tokens go to that key).
|
|
196
196
|
*/
|
|
197
197
|
readSecret?: string | undefined;
|
|
198
198
|
deepLink: string;
|
|
@@ -262,7 +262,7 @@ export type SDKCreateVerificationLinkData = {
|
|
|
262
262
|
};
|
|
263
263
|
|
|
264
264
|
/**
|
|
265
|
-
* Verification link created. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes for this operation: 400 (partner not found / gate not active), 401, 403 (gate not in the token allowlist), 409 (pending request already exists — call revoke-verification). BotShield Actions and linking codes (`data.error.code`): `act_label_without_act` (400), `act_label_has_link` (400 — `act_label` may not contain a link, a domain or a URI scheme), `action_not_a_gate` (400), `action_invalid` (400 — act malformed), `action_not_found` (400 — no action with that key here), `action_off` (409), `action_requires_user_ref` (400), `link_requires_user_ref` (400 — the gate's policy is `link: required` and no partner_user_ref was sent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone; only the link ceremony (`notarize`) can be started for this partner_user_ref until they confirm the account again from your signed-in page). A development key over its limit: `RATE_LIMITED`.
|
|
265
|
+
* Verification link created. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes for this operation: 400 (partner not found / gate not active), 401, 403 (gate not in the token allowlist), 409 (pending request already exists — call revoke-verification). BotShield Actions and linking codes (`data.error.code`): `act_label_without_act` (400), `act_label_has_link` (400 — `act_label` may not contain a link, a domain or a URI scheme), `action_not_a_gate` (400), `action_invalid` (400 — act malformed), `action_not_found` (400 — no action with that key here), `action_off` (409), `action_requires_user_ref` (400), `link_requires_user_ref` (400 — the gate's policy is `link: required` and no partner_user_ref was sent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone; only the link ceremony (`notarize`) can be started for this partner_user_ref until they confirm the account again from your signed-in page). A development key over its limit: `RATE_LIMITED`. `link_requires_server_session` (403 — a request on a site-key grant that would write a NEW link: a `notarize` ceremony, or an `act` on an account not linked here yet; open the session from your server with your secret key, naming the signed-in customer), `account_override_refused` (403 — `partner_user_ref` names a different account from the one the session names), `action_is_recovery` / `action_is_signin` (400 — that `act` is your Recovery Action or your Sign-on Action, which no request starts), and 503 when BotShield could not tell whether the account is already linked (nothing was written; retry).
|
|
266
266
|
*/
|
|
267
267
|
export type SDKCreateVerificationLinkResponse = {
|
|
268
268
|
data: SDKCreateVerificationLinkData;
|
|
@@ -57,7 +57,7 @@ export type SDKSendByNumberData = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Result. NOTE: handler errors arrive here (HTTP 200) as data.error — codes: secret_key_required · invalid_key · phone_invalid · action_invalid · action_not_found · action_off · act_label_has_link · org_not_verified · send_rate_limited · unanswered_limit_reached · unavailable.
|
|
60
|
+
* Result. NOTE: handler errors arrive here (HTTP 200) as data.error — codes: secret_key_required · invalid_key · phone_invalid · action_invalid · action_not_found · action_off · act_label_has_link · org_not_verified · send_rate_limited · unanswered_limit_reached · unavailable. Action_is_recovery · action_is_signin (400 — your Recovery Action and Sign-on Action are never sent).
|
|
61
61
|
*/
|
|
62
62
|
export type SDKSendByNumberResponse = {
|
|
63
63
|
data?: SDKSendByNumberData | undefined;
|
|
@@ -27,11 +27,11 @@ export type SDKVerifyTokenRequest = {
|
|
|
27
27
|
*/
|
|
28
28
|
audience?: string | undefined;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* With your secret key, on a token whose link is pending, this confirms the link (same as sdk/confirm-link). The answer's `link` says whether it went live.
|
|
31
31
|
*/
|
|
32
32
|
partnerUserRef?: string | undefined;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* The request YOUR server made for this attempt. When given, a token for any other request is refused (`valid: false`, `code: request_mismatch`) and is not spent.
|
|
35
35
|
*/
|
|
36
36
|
expectedRequestId?: string | undefined;
|
|
37
37
|
};
|
|
@@ -116,11 +116,11 @@ export type Claims = {
|
|
|
116
116
|
*/
|
|
117
117
|
environment?: SDKVerifyTokenEnvironment | null | undefined;
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Present for 72 hours after this verified account was recovered with Recover Account with BotShield: when it was recovered. Only when `trusted` is true.
|
|
120
120
|
*/
|
|
121
121
|
recoveredAt?: Date | undefined;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* Where the link stood for this token: `pending`, `live`, `expired` or `refused`. Absent on a plain check.
|
|
124
124
|
*/
|
|
125
125
|
linkState?: string | undefined;
|
|
126
126
|
};
|
|
@@ -145,7 +145,7 @@ export const SDKVerifyTokenState = {
|
|
|
145
145
|
export type SDKVerifyTokenState = OpenEnum<typeof SDKVerifyTokenState>;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
*
|
|
148
|
+
* Present only on a token whose link waited for your server. `pending`: not confirmed (send your secret key and `partner_user_ref`, or call sdk/confirm-link). `live` with `confirmed: true`: this check confirmed it. `not_live`: the confirm was refused (`code`).
|
|
149
149
|
*/
|
|
150
150
|
export type SDKVerifyTokenLink = {
|
|
151
151
|
state?: SDKVerifyTokenState | undefined;
|
|
@@ -166,7 +166,7 @@ export type SDKVerifyTokenDataData = {
|
|
|
166
166
|
*/
|
|
167
167
|
reason?: string | undefined;
|
|
168
168
|
/**
|
|
169
|
-
*
|
|
169
|
+
* On some refusals (`valid: false`), a code beside `reason`: `secret_key_required` (called without your secret key; the token was not spent), `request_mismatch` (the token is for another request than `expected_request_id`; not spent).
|
|
170
170
|
*/
|
|
171
171
|
code?: string | undefined;
|
|
172
172
|
/**
|
|
@@ -183,7 +183,7 @@ export type SDKVerifyTokenDataData = {
|
|
|
183
183
|
*/
|
|
184
184
|
verdict?: SDKVerifyTokenVerdict | undefined;
|
|
185
185
|
/**
|
|
186
|
-
*
|
|
186
|
+
* Present only on a token whose link waited for your server. `pending`: not confirmed (send your secret key and `partner_user_ref`, or call sdk/confirm-link). `live` with `confirmed: true`: this check confirmed it. `not_live`: the confirm was refused (`code`).
|
|
187
187
|
*/
|
|
188
188
|
link?: SDKVerifyTokenLink | undefined;
|
|
189
189
|
};
|
|
@@ -94,6 +94,10 @@ export type Row = {
|
|
|
94
94
|
* The Link with BotShield ID surface the account was secured through; null when it was secured at a Gate.
|
|
95
95
|
*/
|
|
96
96
|
surfaceId: string | null;
|
|
97
|
+
/**
|
|
98
|
+
* True while the person's number changed without approval from another phone: this account answers nothing (refusals say account_reconfirm_required) until your signed-in link ceremony completes again. Never true for an unlinked account.
|
|
99
|
+
*/
|
|
100
|
+
paused: boolean;
|
|
97
101
|
};
|
|
98
102
|
|
|
99
103
|
/**
|
|
@@ -304,6 +308,7 @@ export const Row$inboundSchema: z.ZodType<Row, z.ZodTypeDef, unknown> = z
|
|
|
304
308
|
SecuredAccountsListUnlinkReason$inboundSchema,
|
|
305
309
|
),
|
|
306
310
|
surface_id: types.nullable(types.string()),
|
|
311
|
+
paused: types.boolean(),
|
|
307
312
|
}).transform((v) => {
|
|
308
313
|
return remap$(v, {
|
|
309
314
|
"secured_at": "securedAt",
|
|
@@ -322,6 +327,7 @@ export type Row$Outbound = {
|
|
|
322
327
|
unlinked_by: string | null;
|
|
323
328
|
unlink_reason: string | null;
|
|
324
329
|
surface_id: string | null;
|
|
330
|
+
paused: boolean;
|
|
325
331
|
};
|
|
326
332
|
|
|
327
333
|
/** @internal */
|
|
@@ -334,6 +340,7 @@ export const Row$outboundSchema: z.ZodType<Row$Outbound, z.ZodTypeDef, Row> = z
|
|
|
334
340
|
unlinkedBy: z.nullable(UnlinkedBy$outboundSchema),
|
|
335
341
|
unlinkReason: z.nullable(SecuredAccountsListUnlinkReason$outboundSchema),
|
|
336
342
|
surfaceId: z.nullable(z.string()),
|
|
343
|
+
paused: z.boolean(),
|
|
337
344
|
}).transform((v) => {
|
|
338
345
|
return remap$(v, {
|
|
339
346
|
securedAt: "secured_at",
|
|
@@ -38,6 +38,10 @@ export type SecuredAccountsStatusDataData = {
|
|
|
38
38
|
* When recent presence lapses (in the past when `stale`); null when `none`.
|
|
39
39
|
*/
|
|
40
40
|
freshUntil: Date | null;
|
|
41
|
+
/**
|
|
42
|
+
* True while the person's number changed without approval from another phone: this account answers nothing (refusals say account_reconfirm_required) until your signed-in link ceremony completes again. null when it can't be read; false when there is no live account.
|
|
43
|
+
*/
|
|
44
|
+
paused?: boolean | null | undefined;
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
export type SecuredAccountsStatusData = {
|
|
@@ -174,6 +178,7 @@ export const SecuredAccountsStatusDataData$inboundSchema: z.ZodType<
|
|
|
174
178
|
> = z.object({
|
|
175
179
|
state: SecuredAccountsStatusState$inboundSchema,
|
|
176
180
|
fresh_until: types.nullable(types.date()),
|
|
181
|
+
paused: z.nullable(types.boolean()).optional(),
|
|
177
182
|
}).transform((v) => {
|
|
178
183
|
return remap$(v, {
|
|
179
184
|
"fresh_until": "freshUntil",
|
|
@@ -183,6 +188,7 @@ export const SecuredAccountsStatusDataData$inboundSchema: z.ZodType<
|
|
|
183
188
|
export type SecuredAccountsStatusDataData$Outbound = {
|
|
184
189
|
state: string;
|
|
185
190
|
fresh_until: string | null;
|
|
191
|
+
paused?: boolean | null | undefined;
|
|
186
192
|
};
|
|
187
193
|
|
|
188
194
|
/** @internal */
|
|
@@ -193,6 +199,7 @@ export const SecuredAccountsStatusDataData$outboundSchema: z.ZodType<
|
|
|
193
199
|
> = z.object({
|
|
194
200
|
state: SecuredAccountsStatusState$outboundSchema,
|
|
195
201
|
freshUntil: z.nullable(z.date().transform(v => v.toISOString())),
|
|
202
|
+
paused: z.nullable(z.boolean()).optional(),
|
|
196
203
|
}).transform((v) => {
|
|
197
204
|
return remap$(v, {
|
|
198
205
|
freshUntil: "fresh_until",
|
|
@@ -20,7 +20,7 @@ export type VerificationGetStatusSecurity = {
|
|
|
20
20
|
export type VerificationGetStatusRequest = {
|
|
21
21
|
requestId: string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* The `read_secret` create-verification-link returned for a request started with your site key. Without it such a request's `verification_token` / `signed_token` are never returned. A request your server started reads them with your secret key (`Authorization: Bearer bs_…`) instead. A passkey sign-in's answer is never returned here (use signin/confirm).
|
|
24
24
|
*/
|
|
25
25
|
xBotShieldRequestSecret?: string | undefined;
|
|
26
26
|
};
|
|
@@ -172,7 +172,7 @@ export type VerificationGetStatusGateType = OpenEnum<
|
|
|
172
172
|
>;
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
|
-
*
|
|
175
|
+
* Where the link stands on this request. Null on a plain check and on a link from before 4.0. A pass whose link is not live carries no destination.
|
|
176
176
|
*/
|
|
177
177
|
export const LinkState = {
|
|
178
178
|
Pending: "pending",
|
|
@@ -181,7 +181,7 @@ export const LinkState = {
|
|
|
181
181
|
Refused: "refused",
|
|
182
182
|
} as const;
|
|
183
183
|
/**
|
|
184
|
-
*
|
|
184
|
+
* Where the link stands on this request. Null on a plain check and on a link from before 4.0. A pass whose link is not live carries no destination.
|
|
185
185
|
*/
|
|
186
186
|
export type LinkState = OpenEnum<typeof LinkState>;
|
|
187
187
|
|
|
@@ -270,15 +270,15 @@ export type VerificationGetStatusData = {
|
|
|
270
270
|
*/
|
|
271
271
|
ageSource?: string | null | undefined;
|
|
272
272
|
/**
|
|
273
|
-
*
|
|
273
|
+
* Where the link stands on this request. Null on a plain check and on a link from before 4.0. A pass whose link is not live carries no destination.
|
|
274
274
|
*/
|
|
275
275
|
linkState?: LinkState | null | undefined;
|
|
276
276
|
/**
|
|
277
|
-
*
|
|
277
|
+
* When a pending link expires (24 hours after the tap). Null unless `link_state` is `pending`.
|
|
278
278
|
*/
|
|
279
279
|
linkExpiresAt?: Date | null | undefined;
|
|
280
280
|
/**
|
|
281
|
-
*
|
|
281
|
+
* `link_pending` while the link waits for your server.
|
|
282
282
|
*/
|
|
283
283
|
linkCode?: string | undefined;
|
|
284
284
|
linkMessage?: string | undefined;
|
package/src/sdk/census.ts
CHANGED
|
@@ -61,7 +61,7 @@ export class Census extends ClientSDK {
|
|
|
61
61
|
* Validate a verification token
|
|
62
62
|
*
|
|
63
63
|
* @remarks
|
|
64
|
-
* Validates a BotShield attestation JWT — the primary server-side check. Attestations are ES256-signed; the public key is published at /.well-known/jwks.json (kid in the header), so you may also verify locally with any JWT library. Claims are anonymous by construction: the token attests the event, never the person. Each attestation is for one organization (aud = its organization_id; pass `audience` to enforce it) and one check: a repeat check is refused (`valid: false`, `replayed: true`). Check it once, on your server. Each token names its `kind` (`verification` or `action`) and the `environment` it was issued in. A token of any other kind is refused, and when you call with your secret key (`Authorization: Bearer bs_…`) a token from the other environment is refused (a development token never passes a production check). A refused token is not spent.
|
|
64
|
+
* Validates a BotShield attestation JWT — the primary server-side check. Attestations are ES256-signed; the public key is published at /.well-known/jwks.json (kid in the header), so you may also verify locally with any JWT library. Claims are anonymous by construction: the token attests the event, never the person. Each attestation is for one organization (aud = its organization_id; pass `audience` to enforce it) and one check: a repeat check is refused (`valid: false`, `replayed: true`). Check it once, on your server. Each token names its `kind` (`verification` or `action`) and the `environment` it was issued in. A token of any other kind is refused, and when you call with your secret key (`Authorization: Bearer bs_…`) a token from the other environment is refused (a development token never passes a production check). A refused token is not spent. The check needs your secret key (`Authorization: Bearer bs_…`); without it the answer is `valid: false, code: secret_key_required` and the token is not spent. Send `expected_request_id` (the request your server made) and a token for any other request is refused (`code: request_mismatch`), unspent. A passkey sign-in's token is refused here: redeem a sign-in with signin/confirm.
|
|
65
65
|
*/
|
|
66
66
|
async verifyToken(
|
|
67
67
|
security: operations.SDKVerifyTokenSecurity,
|
|
@@ -168,7 +168,7 @@ export class Census extends ClientSDK {
|
|
|
168
168
|
* Confirm a pending link
|
|
169
169
|
*
|
|
170
170
|
* @remarks
|
|
171
|
-
*
|
|
171
|
+
* On a key with “Pending until your server confirms” on, a link waits after the person's tap (account.link_pending). Confirm it from your server with your SECRET key, sending the account your own session shows. The same account makes the link live (account.link_live, account.secured) and returns the finished token on this response only. Another account is refused and the waiting link is dropped. A link not confirmed within 24 hours expires. You can also confirm by passing `partner_user_ref` to sdk/verify-token with your secret key.
|
|
172
172
|
*/
|
|
173
173
|
async confirmLink(
|
|
174
174
|
security: operations.SDKConfirmLinkSecurity,
|
|
@@ -187,7 +187,7 @@ export class Census extends ClientSDK {
|
|
|
187
187
|
* Send a request to verify by phone number
|
|
188
188
|
*
|
|
189
189
|
* @remarks
|
|
190
|
-
*
|
|
190
|
+
* From your server, with your SECRET key, send a request to verify to the person whose BotShield ID carries this phone number. BotShield keeps none of your customer data: the number is used once and is not stored, logged or returned. The answer is the same whether or not anyone holds the number: status `sent`, the request id, its expiry and a two-digit `match_number` — show it to your customer; they pick it in the BotShield app before their passkey. Outcomes arrive as webhooks (or verification/status with this key): verified, declined, or expired. A person who has not linked your company first sees an introduction from you; your request can be answered only after they allow it. Production sends need a verified business. Limits: a cap per key per hour and on unanswered sends per company.
|
|
191
191
|
*/
|
|
192
192
|
async sendByNumber(
|
|
193
193
|
security: operations.SDKSendByNumberSecurity,
|
package/src/sdk/verification.ts
CHANGED
|
@@ -12,7 +12,7 @@ export class Verification extends ClientSDK {
|
|
|
12
12
|
* Check verification status
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Poll a verification request. Carries the signed attestation on completion and NO identity — no user_email, partner_user_id, auth_mode, or botshield_user_id ever cross this boundary. Called without a key, it is rate-limited per client address (a page polling every 2 seconds stays well inside it); over the limit the call is refused with HTTP 403 and `errors[0].code = "RATE_LIMITED"`.
|
|
15
|
+
* Poll a verification request. Carries the signed attestation on completion and NO identity — no user_email, partner_user_id, auth_mode, or botshield_user_id ever cross this boundary. Called without a key, it is rate-limited per client address (a page polling every 2 seconds stays well inside it); over the limit the call is refused with HTTP 403 and `errors[0].code = "RATE_LIMITED"`. Knowing the request id is not enough to read the finished tokens. A request started with a site key returns them only with its `read_secret` (`X-BotShield-Request-Secret`); a request your server started, only to your secret key. A passkey sign-in's tokens are never returned here.
|
|
16
16
|
*/
|
|
17
17
|
async getStatus(
|
|
18
18
|
security: operations.VerificationGetStatusSecurity,
|