botshield-sdk 2.2.1 → 2.3.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 +15 -7
- package/bin/mcp-server.js +422 -87
- package/bin/mcp-server.js.map +20 -15
- package/dist/commonjs/funcs/inline-passkey-complete.d.ts +20 -0
- package/dist/commonjs/funcs/inline-passkey-complete.d.ts.map +1 -0
- package/dist/commonjs/funcs/inline-passkey-complete.js +116 -0
- package/dist/commonjs/funcs/inline-passkey-complete.js.map +1 -0
- package/dist/commonjs/funcs/inline-passkey-get-options.d.ts +20 -0
- package/dist/commonjs/funcs/inline-passkey-get-options.d.ts.map +1 -0
- package/dist/commonjs/funcs/inline-passkey-get-options.js +116 -0
- package/dist/commonjs/funcs/inline-passkey-get-options.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +20 -4
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +22 -18
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/command.js +4 -3
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.js +2 -2
- package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +2 -2
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/models/error-body.d.ts +6 -1
- package/dist/commonjs/models/error-body.d.ts.map +1 -1
- package/dist/commonjs/models/error-body.js +2 -0
- package/dist/commonjs/models/error-body.js.map +1 -1
- package/dist/commonjs/models/gate-human-verified-event.d.ts +93 -0
- package/dist/commonjs/models/gate-human-verified-event.d.ts.map +1 -0
- package/dist/commonjs/models/gate-human-verified-event.js +119 -0
- package/dist/commonjs/models/gate-human-verified-event.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +3 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +3 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/inline-passkey-assertion.d.ts +66 -0
- package/dist/commonjs/models/inline-passkey-assertion.d.ts.map +1 -0
- package/dist/commonjs/models/inline-passkey-assertion.js +98 -0
- package/dist/commonjs/models/inline-passkey-assertion.js.map +1 -0
- package/dist/commonjs/models/inline-passkey-request-options.d.ts +78 -0
- package/dist/commonjs/models/inline-passkey-request-options.d.ts.map +1 -0
- package/dist/commonjs/models/inline-passkey-request-options.js +107 -0
- package/dist/commonjs/models/inline-passkey-request-options.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts +7 -1
- package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-request-status.js.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-request.d.ts +1 -1
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/request-passkey-complete.d.ts +107 -0
- package/dist/commonjs/models/operations/request-passkey-complete.d.ts.map +1 -0
- package/dist/commonjs/models/operations/request-passkey-complete.js +141 -0
- package/dist/commonjs/models/operations/request-passkey-complete.js.map +1 -0
- package/dist/commonjs/models/operations/request-passkey-options.d.ts +178 -0
- package/dist/commonjs/models/operations/request-passkey-options.d.ts.map +1 -0
- package/dist/commonjs/models/operations/request-passkey-options.js +193 -0
- package/dist/commonjs/models/operations/request-passkey-options.js.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts +47 -20
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.js +38 -17
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
- package/dist/commonjs/sdk/inline-passkey.d.ts +23 -0
- package/dist/commonjs/sdk/inline-passkey.d.ts.map +1 -0
- package/dist/commonjs/sdk/inline-passkey.js +36 -0
- package/dist/commonjs/sdk/inline-passkey.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +5 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/inline-passkey-complete.d.ts +20 -0
- package/dist/esm/funcs/inline-passkey-complete.d.ts.map +1 -0
- package/dist/esm/funcs/inline-passkey-complete.js +80 -0
- package/dist/esm/funcs/inline-passkey-complete.js.map +1 -0
- package/dist/esm/funcs/inline-passkey-get-options.d.ts +20 -0
- package/dist/esm/funcs/inline-passkey-get-options.d.ts.map +1 -0
- package/dist/esm/funcs/inline-passkey-get-options.js +80 -0
- package/dist/esm/funcs/inline-passkey-get-options.js.map +1 -0
- package/dist/esm/lib/config.d.ts +20 -4
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +21 -17
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/command.js +5 -4
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts +1 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.js +2 -2
- package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +2 -2
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/models/error-body.d.ts +6 -1
- package/dist/esm/models/error-body.d.ts.map +1 -1
- package/dist/esm/models/error-body.js +2 -0
- package/dist/esm/models/error-body.js.map +1 -1
- package/dist/esm/models/gate-human-verified-event.d.ts +93 -0
- package/dist/esm/models/gate-human-verified-event.d.ts.map +1 -0
- package/dist/esm/models/gate-human-verified-event.js +81 -0
- package/dist/esm/models/gate-human-verified-event.js.map +1 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +3 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/inline-passkey-assertion.d.ts +66 -0
- package/dist/esm/models/inline-passkey-assertion.d.ts.map +1 -0
- package/dist/esm/models/inline-passkey-assertion.js +58 -0
- package/dist/esm/models/inline-passkey-assertion.js.map +1 -0
- package/dist/esm/models/inline-passkey-request-options.d.ts +78 -0
- package/dist/esm/models/inline-passkey-request-options.d.ts.map +1 -0
- package/dist/esm/models/inline-passkey-request-options.js +67 -0
- package/dist/esm/models/inline-passkey-request-options.js.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.d.ts +7 -1
- package/dist/esm/models/operations/gates-api-actions-request-status.d.ts.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-request-status.js.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-request.d.ts +1 -1
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/request-passkey-complete.d.ts +107 -0
- package/dist/esm/models/operations/request-passkey-complete.d.ts.map +1 -0
- package/dist/esm/models/operations/request-passkey-complete.js +97 -0
- package/dist/esm/models/operations/request-passkey-complete.js.map +1 -0
- package/dist/esm/models/operations/request-passkey-options.d.ts +178 -0
- package/dist/esm/models/operations/request-passkey-options.d.ts.map +1 -0
- package/dist/esm/models/operations/request-passkey-options.js +149 -0
- package/dist/esm/models/operations/request-passkey-options.js.map +1 -0
- package/dist/esm/models/operations/verification-get-status.d.ts +47 -20
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/esm/models/operations/verification-get-status.js +37 -16
- package/dist/esm/models/operations/verification-get-status.js.map +1 -1
- package/dist/esm/sdk/inline-passkey.d.ts +23 -0
- package/dist/esm/sdk/inline-passkey.d.ts.map +1 -0
- package/dist/esm/sdk/inline-passkey.js +32 -0
- package/dist/esm/sdk/inline-passkey.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +5 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/inline-passkey-complete.ts +172 -0
- package/src/funcs/inline-passkey-get-options.ts +172 -0
- package/src/lib/config.ts +22 -18
- package/src/mcp-server/cli/start/command.ts +5 -4
- package/src/mcp-server/cli/start/impl.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -3
- package/src/models/error-body.ts +8 -1
- package/src/models/gate-human-verified-event.ts +181 -0
- package/src/models/index.ts +3 -0
- package/src/models/inline-passkey-assertion.ts +147 -0
- package/src/models/inline-passkey-request-options.ts +175 -0
- package/src/models/operations/gates-api-actions-request-status.ts +7 -1
- package/src/models/operations/gates-api-actions-request.ts +1 -1
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/request-passkey-complete.ts +272 -0
- package/src/models/operations/request-passkey-options.ts +372 -0
- package/src/models/operations/verification-get-status.ts +85 -34
- package/src/sdk/inline-passkey.ts +49 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
11
|
+
import * as types from "../../types/primitives.js";
|
|
12
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
13
|
+
import * as models from "../index.js";
|
|
14
|
+
|
|
15
|
+
export type RequestPasskeyCompleteRequest = {
|
|
16
|
+
requestId: string;
|
|
17
|
+
/**
|
|
18
|
+
* From passkey-options.
|
|
19
|
+
*/
|
|
20
|
+
challengeId: string;
|
|
21
|
+
/**
|
|
22
|
+
* WebAuthn AuthenticationResponseJSON (base64url strings) — the result of navigator.credentials.get(), serialized (e.g. PublicKeyCredential.toJSON() or @simplewebauthn/browser startAuthentication()).
|
|
23
|
+
*/
|
|
24
|
+
response: models.InlinePasskeyAssertion;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* `verified`: done. `wrong_identity`: the passkey used belongs to a different BotShield ID than the one this request is for (no code). `expired`: the challenge or the request expired — call passkey-options again (or create a new request). `failed`: see `code`.
|
|
29
|
+
*/
|
|
30
|
+
export const RequestPasskeyCompleteOutcome = {
|
|
31
|
+
Verified: "verified",
|
|
32
|
+
WrongIdentity: "wrong_identity",
|
|
33
|
+
Expired: "expired",
|
|
34
|
+
Failed: "failed",
|
|
35
|
+
} as const;
|
|
36
|
+
/**
|
|
37
|
+
* `verified`: done. `wrong_identity`: the passkey used belongs to a different BotShield ID than the one this request is for (no code). `expired`: the challenge or the request expired — call passkey-options again (or create a new request). `failed`: see `code`.
|
|
38
|
+
*/
|
|
39
|
+
export type RequestPasskeyCompleteOutcome = OpenEnum<
|
|
40
|
+
typeof RequestPasskeyCompleteOutcome
|
|
41
|
+
>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The outcome only — no session, no BotShield ID, no token. On `verified` the completion has already run exactly as in the app (token minted, webhook sent — including `act` on an action request); collect the result as you already do.
|
|
45
|
+
*/
|
|
46
|
+
export type RequestPasskeyCompleteDataData = {
|
|
47
|
+
/**
|
|
48
|
+
* `verified`: done. `wrong_identity`: the passkey used belongs to a different BotShield ID than the one this request is for (no code). `expired`: the challenge or the request expired — call passkey-options again (or create a new request). `failed`: see `code`.
|
|
49
|
+
*/
|
|
50
|
+
outcome: RequestPasskeyCompleteOutcome;
|
|
51
|
+
/**
|
|
52
|
+
* A non-identifying reason you may branch on. Lane codes: `challenge_expired` (expired — unknown, used or stale challenge_id), `request_expired` (expired), `unknown_request`, `request_closed`, `link_changed` (the request no longer resolves to the person the challenge was issued for), `assertion_invalid`, `user_not_verified` (UV is required), `completion_failed`. Completion refusals (same as the app ceremony): `ceremony_user_mismatch`, `already_trusted`, `rebind_requires_prior_id`, `gate_not_open`, `link_requires_user_ref`, `signup_required`, `real_days_not_met`, `pass_limit_reached`, `action_off` (the BotShield Action was turned off), `action_requires_user_ref`. Treat unknown codes as `failed`.
|
|
53
|
+
*/
|
|
54
|
+
code?: string | undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type RequestPasskeyCompleteData = {
|
|
58
|
+
/**
|
|
59
|
+
* The outcome only — no session, no BotShield ID, no token. On `verified` the completion has already run exactly as in the app (token minted, webhook sent — including `act` on an action request); collect the result as you already do.
|
|
60
|
+
*/
|
|
61
|
+
data?: RequestPasskeyCompleteDataData | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Handler error. Arrives inside `data.error` with HTTP 200. Check for it before reading the result.
|
|
64
|
+
*/
|
|
65
|
+
error?: models.ErrorBody | undefined;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The outcome at `data.data`. Handler errors arrive here too (HTTP 200) as `data.error`: `inline_not_for_age_gate` (400): the request is an Age Gate. This lane is for one named account; send the person to `data.error.url` (the app hand-off), where the age assertion is read.
|
|
70
|
+
*/
|
|
71
|
+
export type RequestPasskeyCompleteResponse = {
|
|
72
|
+
data: RequestPasskeyCompleteData;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const RequestPasskeyCompleteRequest$inboundSchema: z.ZodType<
|
|
77
|
+
RequestPasskeyCompleteRequest,
|
|
78
|
+
z.ZodTypeDef,
|
|
79
|
+
unknown
|
|
80
|
+
> = z.object({
|
|
81
|
+
request_id: types.string(),
|
|
82
|
+
challenge_id: types.string(),
|
|
83
|
+
response: models.InlinePasskeyAssertion$inboundSchema,
|
|
84
|
+
}).transform((v) => {
|
|
85
|
+
return remap$(v, {
|
|
86
|
+
"request_id": "requestId",
|
|
87
|
+
"challenge_id": "challengeId",
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
/** @internal */
|
|
91
|
+
export type RequestPasskeyCompleteRequest$Outbound = {
|
|
92
|
+
request_id: string;
|
|
93
|
+
challenge_id: string;
|
|
94
|
+
response: models.InlinePasskeyAssertion$Outbound;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** @internal */
|
|
98
|
+
export const RequestPasskeyCompleteRequest$outboundSchema: z.ZodType<
|
|
99
|
+
RequestPasskeyCompleteRequest$Outbound,
|
|
100
|
+
z.ZodTypeDef,
|
|
101
|
+
RequestPasskeyCompleteRequest
|
|
102
|
+
> = z.object({
|
|
103
|
+
requestId: z.string(),
|
|
104
|
+
challengeId: z.string(),
|
|
105
|
+
response: models.InlinePasskeyAssertion$outboundSchema,
|
|
106
|
+
}).transform((v) => {
|
|
107
|
+
return remap$(v, {
|
|
108
|
+
requestId: "request_id",
|
|
109
|
+
challengeId: "challenge_id",
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export function requestPasskeyCompleteRequestToJSON(
|
|
114
|
+
requestPasskeyCompleteRequest: RequestPasskeyCompleteRequest,
|
|
115
|
+
): string {
|
|
116
|
+
return JSON.stringify(
|
|
117
|
+
RequestPasskeyCompleteRequest$outboundSchema.parse(
|
|
118
|
+
requestPasskeyCompleteRequest,
|
|
119
|
+
),
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
export function requestPasskeyCompleteRequestFromJSON(
|
|
123
|
+
jsonString: string,
|
|
124
|
+
): SafeParseResult<RequestPasskeyCompleteRequest, SDKValidationError> {
|
|
125
|
+
return safeParse(
|
|
126
|
+
jsonString,
|
|
127
|
+
(x) => RequestPasskeyCompleteRequest$inboundSchema.parse(JSON.parse(x)),
|
|
128
|
+
`Failed to parse 'RequestPasskeyCompleteRequest' from JSON`,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** @internal */
|
|
133
|
+
export const RequestPasskeyCompleteOutcome$inboundSchema: z.ZodType<
|
|
134
|
+
RequestPasskeyCompleteOutcome,
|
|
135
|
+
z.ZodTypeDef,
|
|
136
|
+
unknown
|
|
137
|
+
> = openEnums.inboundSchema(RequestPasskeyCompleteOutcome);
|
|
138
|
+
/** @internal */
|
|
139
|
+
export const RequestPasskeyCompleteOutcome$outboundSchema: z.ZodType<
|
|
140
|
+
string,
|
|
141
|
+
z.ZodTypeDef,
|
|
142
|
+
RequestPasskeyCompleteOutcome
|
|
143
|
+
> = openEnums.outboundSchema(RequestPasskeyCompleteOutcome);
|
|
144
|
+
|
|
145
|
+
/** @internal */
|
|
146
|
+
export const RequestPasskeyCompleteDataData$inboundSchema: z.ZodType<
|
|
147
|
+
RequestPasskeyCompleteDataData,
|
|
148
|
+
z.ZodTypeDef,
|
|
149
|
+
unknown
|
|
150
|
+
> = z.object({
|
|
151
|
+
outcome: RequestPasskeyCompleteOutcome$inboundSchema,
|
|
152
|
+
code: types.optional(types.string()),
|
|
153
|
+
});
|
|
154
|
+
/** @internal */
|
|
155
|
+
export type RequestPasskeyCompleteDataData$Outbound = {
|
|
156
|
+
outcome: string;
|
|
157
|
+
code?: string | undefined;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** @internal */
|
|
161
|
+
export const RequestPasskeyCompleteDataData$outboundSchema: z.ZodType<
|
|
162
|
+
RequestPasskeyCompleteDataData$Outbound,
|
|
163
|
+
z.ZodTypeDef,
|
|
164
|
+
RequestPasskeyCompleteDataData
|
|
165
|
+
> = z.object({
|
|
166
|
+
outcome: RequestPasskeyCompleteOutcome$outboundSchema,
|
|
167
|
+
code: z.string().optional(),
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export function requestPasskeyCompleteDataDataToJSON(
|
|
171
|
+
requestPasskeyCompleteDataData: RequestPasskeyCompleteDataData,
|
|
172
|
+
): string {
|
|
173
|
+
return JSON.stringify(
|
|
174
|
+
RequestPasskeyCompleteDataData$outboundSchema.parse(
|
|
175
|
+
requestPasskeyCompleteDataData,
|
|
176
|
+
),
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
export function requestPasskeyCompleteDataDataFromJSON(
|
|
180
|
+
jsonString: string,
|
|
181
|
+
): SafeParseResult<RequestPasskeyCompleteDataData, SDKValidationError> {
|
|
182
|
+
return safeParse(
|
|
183
|
+
jsonString,
|
|
184
|
+
(x) => RequestPasskeyCompleteDataData$inboundSchema.parse(JSON.parse(x)),
|
|
185
|
+
`Failed to parse 'RequestPasskeyCompleteDataData' from JSON`,
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** @internal */
|
|
190
|
+
export const RequestPasskeyCompleteData$inboundSchema: z.ZodType<
|
|
191
|
+
RequestPasskeyCompleteData,
|
|
192
|
+
z.ZodTypeDef,
|
|
193
|
+
unknown
|
|
194
|
+
> = z.object({
|
|
195
|
+
data: types.optional(
|
|
196
|
+
z.lazy(() => RequestPasskeyCompleteDataData$inboundSchema),
|
|
197
|
+
),
|
|
198
|
+
error: types.optional(models.ErrorBody$inboundSchema),
|
|
199
|
+
});
|
|
200
|
+
/** @internal */
|
|
201
|
+
export type RequestPasskeyCompleteData$Outbound = {
|
|
202
|
+
data?: RequestPasskeyCompleteDataData$Outbound | undefined;
|
|
203
|
+
error?: models.ErrorBody$Outbound | undefined;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/** @internal */
|
|
207
|
+
export const RequestPasskeyCompleteData$outboundSchema: z.ZodType<
|
|
208
|
+
RequestPasskeyCompleteData$Outbound,
|
|
209
|
+
z.ZodTypeDef,
|
|
210
|
+
RequestPasskeyCompleteData
|
|
211
|
+
> = z.object({
|
|
212
|
+
data: z.lazy(() => RequestPasskeyCompleteDataData$outboundSchema).optional(),
|
|
213
|
+
error: models.ErrorBody$outboundSchema.optional(),
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
export function requestPasskeyCompleteDataToJSON(
|
|
217
|
+
requestPasskeyCompleteData: RequestPasskeyCompleteData,
|
|
218
|
+
): string {
|
|
219
|
+
return JSON.stringify(
|
|
220
|
+
RequestPasskeyCompleteData$outboundSchema.parse(requestPasskeyCompleteData),
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
export function requestPasskeyCompleteDataFromJSON(
|
|
224
|
+
jsonString: string,
|
|
225
|
+
): SafeParseResult<RequestPasskeyCompleteData, SDKValidationError> {
|
|
226
|
+
return safeParse(
|
|
227
|
+
jsonString,
|
|
228
|
+
(x) => RequestPasskeyCompleteData$inboundSchema.parse(JSON.parse(x)),
|
|
229
|
+
`Failed to parse 'RequestPasskeyCompleteData' from JSON`,
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** @internal */
|
|
234
|
+
export const RequestPasskeyCompleteResponse$inboundSchema: z.ZodType<
|
|
235
|
+
RequestPasskeyCompleteResponse,
|
|
236
|
+
z.ZodTypeDef,
|
|
237
|
+
unknown
|
|
238
|
+
> = z.object({
|
|
239
|
+
data: z.lazy(() => RequestPasskeyCompleteData$inboundSchema),
|
|
240
|
+
});
|
|
241
|
+
/** @internal */
|
|
242
|
+
export type RequestPasskeyCompleteResponse$Outbound = {
|
|
243
|
+
data: RequestPasskeyCompleteData$Outbound;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/** @internal */
|
|
247
|
+
export const RequestPasskeyCompleteResponse$outboundSchema: z.ZodType<
|
|
248
|
+
RequestPasskeyCompleteResponse$Outbound,
|
|
249
|
+
z.ZodTypeDef,
|
|
250
|
+
RequestPasskeyCompleteResponse
|
|
251
|
+
> = z.object({
|
|
252
|
+
data: z.lazy(() => RequestPasskeyCompleteData$outboundSchema),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
export function requestPasskeyCompleteResponseToJSON(
|
|
256
|
+
requestPasskeyCompleteResponse: RequestPasskeyCompleteResponse,
|
|
257
|
+
): string {
|
|
258
|
+
return JSON.stringify(
|
|
259
|
+
RequestPasskeyCompleteResponse$outboundSchema.parse(
|
|
260
|
+
requestPasskeyCompleteResponse,
|
|
261
|
+
),
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
export function requestPasskeyCompleteResponseFromJSON(
|
|
265
|
+
jsonString: string,
|
|
266
|
+
): SafeParseResult<RequestPasskeyCompleteResponse, SDKValidationError> {
|
|
267
|
+
return safeParse(
|
|
268
|
+
jsonString,
|
|
269
|
+
(x) => RequestPasskeyCompleteResponse$inboundSchema.parse(JSON.parse(x)),
|
|
270
|
+
`Failed to parse 'RequestPasskeyCompleteResponse' from JSON`,
|
|
271
|
+
);
|
|
272
|
+
}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { ClosedEnum, OpenEnum } from "../../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
11
|
+
import * as types from "../../types/primitives.js";
|
|
12
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
13
|
+
import * as models from "../index.js";
|
|
14
|
+
|
|
15
|
+
export type RequestPasskeyOptionsRequest = {
|
|
16
|
+
/**
|
|
17
|
+
* From create-verification-link (server to server). Must be pending and unexpired.
|
|
18
|
+
*/
|
|
19
|
+
requestId: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Present instead of `options` when the inline passkey can't run for this request.
|
|
24
|
+
*/
|
|
25
|
+
export const Fallback = {
|
|
26
|
+
App: "app",
|
|
27
|
+
} as const;
|
|
28
|
+
/**
|
|
29
|
+
* Present instead of `options` when the inline passkey can't run for this request.
|
|
30
|
+
*/
|
|
31
|
+
export type Fallback = ClosedEnum<typeof Fallback>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Why `fallback` was returned. `not_linked`: the request's partner_user_ref has no active link (or the request carries none). `no_passkey`: the linked person has no passkey.
|
|
35
|
+
*/
|
|
36
|
+
export const RequestPasskeyOptionsReason = {
|
|
37
|
+
NotLinked: "not_linked",
|
|
38
|
+
NoPasskey: "no_passkey",
|
|
39
|
+
} as const;
|
|
40
|
+
/**
|
|
41
|
+
* Why `fallback` was returned. `not_linked`: the request's partner_user_ref has no active link (or the request carries none). `no_passkey`: the linked person has no passkey.
|
|
42
|
+
*/
|
|
43
|
+
export type RequestPasskeyOptionsReason = OpenEnum<
|
|
44
|
+
typeof RequestPasskeyOptionsReason
|
|
45
|
+
>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Closed request only.
|
|
49
|
+
*/
|
|
50
|
+
export const RequestPasskeyOptionsOutcome = {
|
|
51
|
+
Expired: "expired",
|
|
52
|
+
Failed: "failed",
|
|
53
|
+
} as const;
|
|
54
|
+
/**
|
|
55
|
+
* Closed request only.
|
|
56
|
+
*/
|
|
57
|
+
export type RequestPasskeyOptionsOutcome = OpenEnum<
|
|
58
|
+
typeof RequestPasskeyOptionsOutcome
|
|
59
|
+
>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Closed request only. `unknown_request` (outcome failed), `request_closed` (failed — no longer pending), `request_expired` (expired).
|
|
63
|
+
*/
|
|
64
|
+
export const Code = {
|
|
65
|
+
UnknownRequest: "unknown_request",
|
|
66
|
+
RequestClosed: "request_closed",
|
|
67
|
+
RequestExpired: "request_expired",
|
|
68
|
+
} as const;
|
|
69
|
+
/**
|
|
70
|
+
* Closed request only. `unknown_request` (outcome failed), `request_closed` (failed — no longer pending), `request_expired` (expired).
|
|
71
|
+
*/
|
|
72
|
+
export type Code = OpenEnum<typeof Code>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Exactly one of three shapes. **Passkey**: `options` + `challenge_id` — run `navigator.credentials.get({ publicKey: options })` (or the native equivalent on rpId botshield.ai) and send the result to passkey-complete. **Fallback**: `fallback: "app"` — the request has no linked person (`not_linked`) or that person has no passkey (`no_passkey`); open `url` (the app hand-off). **Closed**: `outcome` + `code` — the request is unknown, closed or expired. Every passkey/fallback answer carries `url` and `setup_url` so you can offer both when this device holds none of the listed passkeys.
|
|
76
|
+
*/
|
|
77
|
+
export type DataApp = {
|
|
78
|
+
/**
|
|
79
|
+
* WebAuthn PublicKeyCredentialRequestOptionsJSON (base64url strings). rpId is botshield.ai; userVerification is always `required`.
|
|
80
|
+
*/
|
|
81
|
+
options?: models.InlinePasskeyRequestOptions | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Send back with passkey-complete. Single use.
|
|
84
|
+
*/
|
|
85
|
+
challengeId?: string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The challenge expires 5 minutes after it is issued.
|
|
88
|
+
*/
|
|
89
|
+
expiresAt?: Date | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Present instead of `options` when the inline passkey can't run for this request.
|
|
92
|
+
*/
|
|
93
|
+
fallback?: Fallback | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Why `fallback` was returned. `not_linked`: the request's partner_user_ref has no active link (or the request carries none). `no_passkey`: the linked person has no passkey.
|
|
96
|
+
*/
|
|
97
|
+
reason?: RequestPasskeyOptionsReason | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* The app hand-off for this request (the same /verify URL create-verification-link returns as web_url).
|
|
100
|
+
*/
|
|
101
|
+
url?: string | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Where the person adds a BotShield passkey (Settings → Passkey). Render "Set up a passkey in BotShield" from this; never hardcode a BotShield URL.
|
|
104
|
+
*/
|
|
105
|
+
setupUrl?: string | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Closed request only.
|
|
108
|
+
*/
|
|
109
|
+
outcome?: RequestPasskeyOptionsOutcome | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Closed request only. `unknown_request` (outcome failed), `request_closed` (failed — no longer pending), `request_expired` (expired).
|
|
112
|
+
*/
|
|
113
|
+
code?: Code | undefined;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type RequestPasskeyOptionsData = {
|
|
117
|
+
/**
|
|
118
|
+
* Exactly one of three shapes. **Passkey**: `options` + `challenge_id` — run `navigator.credentials.get({ publicKey: options })` (or the native equivalent on rpId botshield.ai) and send the result to passkey-complete. **Fallback**: `fallback: "app"` — the request has no linked person (`not_linked`) or that person has no passkey (`no_passkey`); open `url` (the app hand-off). **Closed**: `outcome` + `code` — the request is unknown, closed or expired. Every passkey/fallback answer carries `url` and `setup_url` so you can offer both when this device holds none of the listed passkeys.
|
|
119
|
+
*/
|
|
120
|
+
data?: DataApp | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Handler error. Arrives inside `data.error` with HTTP 200. Check for it before reading the result.
|
|
123
|
+
*/
|
|
124
|
+
error?: models.ErrorBody | undefined;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Passkey options, the app fallback, or a closed-request outcome at `data.data`. Handler errors arrive here too (HTTP 200) as `data.error`: `inline_not_for_age_gate` (400): the request is an Age Gate. This lane is for one named account; send the person to `data.error.url` (the app hand-off), where the age assertion is read. A 500-class `data.error` ("Could not start the passkey") means retry.
|
|
129
|
+
*/
|
|
130
|
+
export type RequestPasskeyOptionsResponse = {
|
|
131
|
+
data: RequestPasskeyOptionsData;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** @internal */
|
|
135
|
+
export const RequestPasskeyOptionsRequest$inboundSchema: z.ZodType<
|
|
136
|
+
RequestPasskeyOptionsRequest,
|
|
137
|
+
z.ZodTypeDef,
|
|
138
|
+
unknown
|
|
139
|
+
> = z.object({
|
|
140
|
+
request_id: types.string(),
|
|
141
|
+
}).transform((v) => {
|
|
142
|
+
return remap$(v, {
|
|
143
|
+
"request_id": "requestId",
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
/** @internal */
|
|
147
|
+
export type RequestPasskeyOptionsRequest$Outbound = {
|
|
148
|
+
request_id: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/** @internal */
|
|
152
|
+
export const RequestPasskeyOptionsRequest$outboundSchema: z.ZodType<
|
|
153
|
+
RequestPasskeyOptionsRequest$Outbound,
|
|
154
|
+
z.ZodTypeDef,
|
|
155
|
+
RequestPasskeyOptionsRequest
|
|
156
|
+
> = z.object({
|
|
157
|
+
requestId: z.string(),
|
|
158
|
+
}).transform((v) => {
|
|
159
|
+
return remap$(v, {
|
|
160
|
+
requestId: "request_id",
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export function requestPasskeyOptionsRequestToJSON(
|
|
165
|
+
requestPasskeyOptionsRequest: RequestPasskeyOptionsRequest,
|
|
166
|
+
): string {
|
|
167
|
+
return JSON.stringify(
|
|
168
|
+
RequestPasskeyOptionsRequest$outboundSchema.parse(
|
|
169
|
+
requestPasskeyOptionsRequest,
|
|
170
|
+
),
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
export function requestPasskeyOptionsRequestFromJSON(
|
|
174
|
+
jsonString: string,
|
|
175
|
+
): SafeParseResult<RequestPasskeyOptionsRequest, SDKValidationError> {
|
|
176
|
+
return safeParse(
|
|
177
|
+
jsonString,
|
|
178
|
+
(x) => RequestPasskeyOptionsRequest$inboundSchema.parse(JSON.parse(x)),
|
|
179
|
+
`Failed to parse 'RequestPasskeyOptionsRequest' from JSON`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** @internal */
|
|
184
|
+
export const Fallback$inboundSchema: z.ZodNativeEnum<typeof Fallback> = z
|
|
185
|
+
.nativeEnum(Fallback);
|
|
186
|
+
/** @internal */
|
|
187
|
+
export const Fallback$outboundSchema: z.ZodNativeEnum<typeof Fallback> =
|
|
188
|
+
Fallback$inboundSchema;
|
|
189
|
+
|
|
190
|
+
/** @internal */
|
|
191
|
+
export const RequestPasskeyOptionsReason$inboundSchema: z.ZodType<
|
|
192
|
+
RequestPasskeyOptionsReason,
|
|
193
|
+
z.ZodTypeDef,
|
|
194
|
+
unknown
|
|
195
|
+
> = openEnums.inboundSchema(RequestPasskeyOptionsReason);
|
|
196
|
+
/** @internal */
|
|
197
|
+
export const RequestPasskeyOptionsReason$outboundSchema: z.ZodType<
|
|
198
|
+
string,
|
|
199
|
+
z.ZodTypeDef,
|
|
200
|
+
RequestPasskeyOptionsReason
|
|
201
|
+
> = openEnums.outboundSchema(RequestPasskeyOptionsReason);
|
|
202
|
+
|
|
203
|
+
/** @internal */
|
|
204
|
+
export const RequestPasskeyOptionsOutcome$inboundSchema: z.ZodType<
|
|
205
|
+
RequestPasskeyOptionsOutcome,
|
|
206
|
+
z.ZodTypeDef,
|
|
207
|
+
unknown
|
|
208
|
+
> = openEnums.inboundSchema(RequestPasskeyOptionsOutcome);
|
|
209
|
+
/** @internal */
|
|
210
|
+
export const RequestPasskeyOptionsOutcome$outboundSchema: z.ZodType<
|
|
211
|
+
string,
|
|
212
|
+
z.ZodTypeDef,
|
|
213
|
+
RequestPasskeyOptionsOutcome
|
|
214
|
+
> = openEnums.outboundSchema(RequestPasskeyOptionsOutcome);
|
|
215
|
+
|
|
216
|
+
/** @internal */
|
|
217
|
+
export const Code$inboundSchema: z.ZodType<Code, z.ZodTypeDef, unknown> =
|
|
218
|
+
openEnums.inboundSchema(Code);
|
|
219
|
+
/** @internal */
|
|
220
|
+
export const Code$outboundSchema: z.ZodType<string, z.ZodTypeDef, Code> =
|
|
221
|
+
openEnums.outboundSchema(Code);
|
|
222
|
+
|
|
223
|
+
/** @internal */
|
|
224
|
+
export const DataApp$inboundSchema: z.ZodType<DataApp, z.ZodTypeDef, unknown> =
|
|
225
|
+
z.object({
|
|
226
|
+
options: types.optional(models.InlinePasskeyRequestOptions$inboundSchema),
|
|
227
|
+
challenge_id: types.optional(types.string()),
|
|
228
|
+
expires_at: types.optional(types.date()),
|
|
229
|
+
fallback: types.optional(Fallback$inboundSchema),
|
|
230
|
+
reason: types.optional(RequestPasskeyOptionsReason$inboundSchema),
|
|
231
|
+
url: types.optional(types.string()),
|
|
232
|
+
setup_url: types.optional(types.string()),
|
|
233
|
+
outcome: types.optional(RequestPasskeyOptionsOutcome$inboundSchema),
|
|
234
|
+
code: types.optional(Code$inboundSchema),
|
|
235
|
+
}).transform((v) => {
|
|
236
|
+
return remap$(v, {
|
|
237
|
+
"challenge_id": "challengeId",
|
|
238
|
+
"expires_at": "expiresAt",
|
|
239
|
+
"setup_url": "setupUrl",
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
/** @internal */
|
|
243
|
+
export type DataApp$Outbound = {
|
|
244
|
+
options?: models.InlinePasskeyRequestOptions$Outbound | undefined;
|
|
245
|
+
challenge_id?: string | undefined;
|
|
246
|
+
expires_at?: string | undefined;
|
|
247
|
+
fallback?: string | undefined;
|
|
248
|
+
reason?: string | undefined;
|
|
249
|
+
url?: string | undefined;
|
|
250
|
+
setup_url?: string | undefined;
|
|
251
|
+
outcome?: string | undefined;
|
|
252
|
+
code?: string | undefined;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
/** @internal */
|
|
256
|
+
export const DataApp$outboundSchema: z.ZodType<
|
|
257
|
+
DataApp$Outbound,
|
|
258
|
+
z.ZodTypeDef,
|
|
259
|
+
DataApp
|
|
260
|
+
> = z.object({
|
|
261
|
+
options: models.InlinePasskeyRequestOptions$outboundSchema.optional(),
|
|
262
|
+
challengeId: z.string().optional(),
|
|
263
|
+
expiresAt: z.date().transform(v => v.toISOString()).optional(),
|
|
264
|
+
fallback: Fallback$outboundSchema.optional(),
|
|
265
|
+
reason: RequestPasskeyOptionsReason$outboundSchema.optional(),
|
|
266
|
+
url: z.string().optional(),
|
|
267
|
+
setupUrl: z.string().optional(),
|
|
268
|
+
outcome: RequestPasskeyOptionsOutcome$outboundSchema.optional(),
|
|
269
|
+
code: Code$outboundSchema.optional(),
|
|
270
|
+
}).transform((v) => {
|
|
271
|
+
return remap$(v, {
|
|
272
|
+
challengeId: "challenge_id",
|
|
273
|
+
expiresAt: "expires_at",
|
|
274
|
+
setupUrl: "setup_url",
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
export function dataAppToJSON(dataApp: DataApp): string {
|
|
279
|
+
return JSON.stringify(DataApp$outboundSchema.parse(dataApp));
|
|
280
|
+
}
|
|
281
|
+
export function dataAppFromJSON(
|
|
282
|
+
jsonString: string,
|
|
283
|
+
): SafeParseResult<DataApp, SDKValidationError> {
|
|
284
|
+
return safeParse(
|
|
285
|
+
jsonString,
|
|
286
|
+
(x) => DataApp$inboundSchema.parse(JSON.parse(x)),
|
|
287
|
+
`Failed to parse 'DataApp' from JSON`,
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** @internal */
|
|
292
|
+
export const RequestPasskeyOptionsData$inboundSchema: z.ZodType<
|
|
293
|
+
RequestPasskeyOptionsData,
|
|
294
|
+
z.ZodTypeDef,
|
|
295
|
+
unknown
|
|
296
|
+
> = z.object({
|
|
297
|
+
data: types.optional(z.lazy(() => DataApp$inboundSchema)),
|
|
298
|
+
error: types.optional(models.ErrorBody$inboundSchema),
|
|
299
|
+
});
|
|
300
|
+
/** @internal */
|
|
301
|
+
export type RequestPasskeyOptionsData$Outbound = {
|
|
302
|
+
data?: DataApp$Outbound | undefined;
|
|
303
|
+
error?: models.ErrorBody$Outbound | undefined;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
/** @internal */
|
|
307
|
+
export const RequestPasskeyOptionsData$outboundSchema: z.ZodType<
|
|
308
|
+
RequestPasskeyOptionsData$Outbound,
|
|
309
|
+
z.ZodTypeDef,
|
|
310
|
+
RequestPasskeyOptionsData
|
|
311
|
+
> = z.object({
|
|
312
|
+
data: z.lazy(() => DataApp$outboundSchema).optional(),
|
|
313
|
+
error: models.ErrorBody$outboundSchema.optional(),
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
export function requestPasskeyOptionsDataToJSON(
|
|
317
|
+
requestPasskeyOptionsData: RequestPasskeyOptionsData,
|
|
318
|
+
): string {
|
|
319
|
+
return JSON.stringify(
|
|
320
|
+
RequestPasskeyOptionsData$outboundSchema.parse(requestPasskeyOptionsData),
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
export function requestPasskeyOptionsDataFromJSON(
|
|
324
|
+
jsonString: string,
|
|
325
|
+
): SafeParseResult<RequestPasskeyOptionsData, SDKValidationError> {
|
|
326
|
+
return safeParse(
|
|
327
|
+
jsonString,
|
|
328
|
+
(x) => RequestPasskeyOptionsData$inboundSchema.parse(JSON.parse(x)),
|
|
329
|
+
`Failed to parse 'RequestPasskeyOptionsData' from JSON`,
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/** @internal */
|
|
334
|
+
export const RequestPasskeyOptionsResponse$inboundSchema: z.ZodType<
|
|
335
|
+
RequestPasskeyOptionsResponse,
|
|
336
|
+
z.ZodTypeDef,
|
|
337
|
+
unknown
|
|
338
|
+
> = z.object({
|
|
339
|
+
data: z.lazy(() => RequestPasskeyOptionsData$inboundSchema),
|
|
340
|
+
});
|
|
341
|
+
/** @internal */
|
|
342
|
+
export type RequestPasskeyOptionsResponse$Outbound = {
|
|
343
|
+
data: RequestPasskeyOptionsData$Outbound;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/** @internal */
|
|
347
|
+
export const RequestPasskeyOptionsResponse$outboundSchema: z.ZodType<
|
|
348
|
+
RequestPasskeyOptionsResponse$Outbound,
|
|
349
|
+
z.ZodTypeDef,
|
|
350
|
+
RequestPasskeyOptionsResponse
|
|
351
|
+
> = z.object({
|
|
352
|
+
data: z.lazy(() => RequestPasskeyOptionsData$outboundSchema),
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
export function requestPasskeyOptionsResponseToJSON(
|
|
356
|
+
requestPasskeyOptionsResponse: RequestPasskeyOptionsResponse,
|
|
357
|
+
): string {
|
|
358
|
+
return JSON.stringify(
|
|
359
|
+
RequestPasskeyOptionsResponse$outboundSchema.parse(
|
|
360
|
+
requestPasskeyOptionsResponse,
|
|
361
|
+
),
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
export function requestPasskeyOptionsResponseFromJSON(
|
|
365
|
+
jsonString: string,
|
|
366
|
+
): SafeParseResult<RequestPasskeyOptionsResponse, SDKValidationError> {
|
|
367
|
+
return safeParse(
|
|
368
|
+
jsonString,
|
|
369
|
+
(x) => RequestPasskeyOptionsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
370
|
+
`Failed to parse 'RequestPasskeyOptionsResponse' from JSON`,
|
|
371
|
+
);
|
|
372
|
+
}
|