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.
Files changed (169) hide show
  1. package/README.md +15 -7
  2. package/bin/mcp-server.js +422 -87
  3. package/bin/mcp-server.js.map +20 -15
  4. package/dist/commonjs/funcs/inline-passkey-complete.d.ts +20 -0
  5. package/dist/commonjs/funcs/inline-passkey-complete.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/inline-passkey-complete.js +116 -0
  7. package/dist/commonjs/funcs/inline-passkey-complete.js.map +1 -0
  8. package/dist/commonjs/funcs/inline-passkey-get-options.d.ts +20 -0
  9. package/dist/commonjs/funcs/inline-passkey-get-options.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/inline-passkey-get-options.js +116 -0
  11. package/dist/commonjs/funcs/inline-passkey-get-options.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +20 -4
  13. package/dist/commonjs/lib/config.d.ts.map +1 -1
  14. package/dist/commonjs/lib/config.js +22 -18
  15. package/dist/commonjs/lib/config.js.map +1 -1
  16. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
  17. package/dist/commonjs/mcp-server/cli/start/command.js +4 -3
  18. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
  19. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +1 -1
  20. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
  21. package/dist/commonjs/mcp-server/cli/start/impl.js +2 -2
  22. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  23. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  24. package/dist/commonjs/mcp-server/server.d.ts +1 -1
  25. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  26. package/dist/commonjs/mcp-server/server.js +2 -2
  27. package/dist/commonjs/mcp-server/server.js.map +1 -1
  28. package/dist/commonjs/models/error-body.d.ts +6 -1
  29. package/dist/commonjs/models/error-body.d.ts.map +1 -1
  30. package/dist/commonjs/models/error-body.js +2 -0
  31. package/dist/commonjs/models/error-body.js.map +1 -1
  32. package/dist/commonjs/models/gate-human-verified-event.d.ts +93 -0
  33. package/dist/commonjs/models/gate-human-verified-event.d.ts.map +1 -0
  34. package/dist/commonjs/models/gate-human-verified-event.js +119 -0
  35. package/dist/commonjs/models/gate-human-verified-event.js.map +1 -0
  36. package/dist/commonjs/models/index.d.ts +3 -0
  37. package/dist/commonjs/models/index.d.ts.map +1 -1
  38. package/dist/commonjs/models/index.js +3 -0
  39. package/dist/commonjs/models/index.js.map +1 -1
  40. package/dist/commonjs/models/inline-passkey-assertion.d.ts +66 -0
  41. package/dist/commonjs/models/inline-passkey-assertion.d.ts.map +1 -0
  42. package/dist/commonjs/models/inline-passkey-assertion.js +98 -0
  43. package/dist/commonjs/models/inline-passkey-assertion.js.map +1 -0
  44. package/dist/commonjs/models/inline-passkey-request-options.d.ts +78 -0
  45. package/dist/commonjs/models/inline-passkey-request-options.d.ts.map +1 -0
  46. package/dist/commonjs/models/inline-passkey-request-options.js +107 -0
  47. package/dist/commonjs/models/inline-passkey-request-options.js.map +1 -0
  48. package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts +7 -1
  49. package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts.map +1 -1
  50. package/dist/commonjs/models/operations/gates-api-actions-request-status.js.map +1 -1
  51. package/dist/commonjs/models/operations/gates-api-actions-request.d.ts +1 -1
  52. package/dist/commonjs/models/operations/index.d.ts +2 -0
  53. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  54. package/dist/commonjs/models/operations/index.js +2 -0
  55. package/dist/commonjs/models/operations/index.js.map +1 -1
  56. package/dist/commonjs/models/operations/request-passkey-complete.d.ts +107 -0
  57. package/dist/commonjs/models/operations/request-passkey-complete.d.ts.map +1 -0
  58. package/dist/commonjs/models/operations/request-passkey-complete.js +141 -0
  59. package/dist/commonjs/models/operations/request-passkey-complete.js.map +1 -0
  60. package/dist/commonjs/models/operations/request-passkey-options.d.ts +178 -0
  61. package/dist/commonjs/models/operations/request-passkey-options.d.ts.map +1 -0
  62. package/dist/commonjs/models/operations/request-passkey-options.js +193 -0
  63. package/dist/commonjs/models/operations/request-passkey-options.js.map +1 -0
  64. package/dist/commonjs/models/operations/verification-get-status.d.ts +47 -20
  65. package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
  66. package/dist/commonjs/models/operations/verification-get-status.js +38 -17
  67. package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
  68. package/dist/commonjs/sdk/inline-passkey.d.ts +23 -0
  69. package/dist/commonjs/sdk/inline-passkey.d.ts.map +1 -0
  70. package/dist/commonjs/sdk/inline-passkey.js +36 -0
  71. package/dist/commonjs/sdk/inline-passkey.js.map +1 -0
  72. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  73. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  74. package/dist/commonjs/sdk/sdk.js +5 -0
  75. package/dist/commonjs/sdk/sdk.js.map +1 -1
  76. package/dist/esm/funcs/inline-passkey-complete.d.ts +20 -0
  77. package/dist/esm/funcs/inline-passkey-complete.d.ts.map +1 -0
  78. package/dist/esm/funcs/inline-passkey-complete.js +80 -0
  79. package/dist/esm/funcs/inline-passkey-complete.js.map +1 -0
  80. package/dist/esm/funcs/inline-passkey-get-options.d.ts +20 -0
  81. package/dist/esm/funcs/inline-passkey-get-options.d.ts.map +1 -0
  82. package/dist/esm/funcs/inline-passkey-get-options.js +80 -0
  83. package/dist/esm/funcs/inline-passkey-get-options.js.map +1 -0
  84. package/dist/esm/lib/config.d.ts +20 -4
  85. package/dist/esm/lib/config.d.ts.map +1 -1
  86. package/dist/esm/lib/config.js +21 -17
  87. package/dist/esm/lib/config.js.map +1 -1
  88. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
  89. package/dist/esm/mcp-server/cli/start/command.js +5 -4
  90. package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
  91. package/dist/esm/mcp-server/cli/start/impl.d.ts +1 -1
  92. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
  93. package/dist/esm/mcp-server/cli/start/impl.js +2 -2
  94. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  95. package/dist/esm/mcp-server/mcp-server.js +1 -1
  96. package/dist/esm/mcp-server/server.d.ts +1 -1
  97. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  98. package/dist/esm/mcp-server/server.js +2 -2
  99. package/dist/esm/mcp-server/server.js.map +1 -1
  100. package/dist/esm/models/error-body.d.ts +6 -1
  101. package/dist/esm/models/error-body.d.ts.map +1 -1
  102. package/dist/esm/models/error-body.js +2 -0
  103. package/dist/esm/models/error-body.js.map +1 -1
  104. package/dist/esm/models/gate-human-verified-event.d.ts +93 -0
  105. package/dist/esm/models/gate-human-verified-event.d.ts.map +1 -0
  106. package/dist/esm/models/gate-human-verified-event.js +81 -0
  107. package/dist/esm/models/gate-human-verified-event.js.map +1 -0
  108. package/dist/esm/models/index.d.ts +3 -0
  109. package/dist/esm/models/index.d.ts.map +1 -1
  110. package/dist/esm/models/index.js +3 -0
  111. package/dist/esm/models/index.js.map +1 -1
  112. package/dist/esm/models/inline-passkey-assertion.d.ts +66 -0
  113. package/dist/esm/models/inline-passkey-assertion.d.ts.map +1 -0
  114. package/dist/esm/models/inline-passkey-assertion.js +58 -0
  115. package/dist/esm/models/inline-passkey-assertion.js.map +1 -0
  116. package/dist/esm/models/inline-passkey-request-options.d.ts +78 -0
  117. package/dist/esm/models/inline-passkey-request-options.d.ts.map +1 -0
  118. package/dist/esm/models/inline-passkey-request-options.js +67 -0
  119. package/dist/esm/models/inline-passkey-request-options.js.map +1 -0
  120. package/dist/esm/models/operations/gates-api-actions-request-status.d.ts +7 -1
  121. package/dist/esm/models/operations/gates-api-actions-request-status.d.ts.map +1 -1
  122. package/dist/esm/models/operations/gates-api-actions-request-status.js.map +1 -1
  123. package/dist/esm/models/operations/gates-api-actions-request.d.ts +1 -1
  124. package/dist/esm/models/operations/index.d.ts +2 -0
  125. package/dist/esm/models/operations/index.d.ts.map +1 -1
  126. package/dist/esm/models/operations/index.js +2 -0
  127. package/dist/esm/models/operations/index.js.map +1 -1
  128. package/dist/esm/models/operations/request-passkey-complete.d.ts +107 -0
  129. package/dist/esm/models/operations/request-passkey-complete.d.ts.map +1 -0
  130. package/dist/esm/models/operations/request-passkey-complete.js +97 -0
  131. package/dist/esm/models/operations/request-passkey-complete.js.map +1 -0
  132. package/dist/esm/models/operations/request-passkey-options.d.ts +178 -0
  133. package/dist/esm/models/operations/request-passkey-options.d.ts.map +1 -0
  134. package/dist/esm/models/operations/request-passkey-options.js +149 -0
  135. package/dist/esm/models/operations/request-passkey-options.js.map +1 -0
  136. package/dist/esm/models/operations/verification-get-status.d.ts +47 -20
  137. package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
  138. package/dist/esm/models/operations/verification-get-status.js +37 -16
  139. package/dist/esm/models/operations/verification-get-status.js.map +1 -1
  140. package/dist/esm/sdk/inline-passkey.d.ts +23 -0
  141. package/dist/esm/sdk/inline-passkey.d.ts.map +1 -0
  142. package/dist/esm/sdk/inline-passkey.js +32 -0
  143. package/dist/esm/sdk/inline-passkey.js.map +1 -0
  144. package/dist/esm/sdk/sdk.d.ts +3 -0
  145. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  146. package/dist/esm/sdk/sdk.js +5 -0
  147. package/dist/esm/sdk/sdk.js.map +1 -1
  148. package/jsr.json +1 -1
  149. package/package.json +1 -1
  150. package/src/funcs/inline-passkey-complete.ts +172 -0
  151. package/src/funcs/inline-passkey-get-options.ts +172 -0
  152. package/src/lib/config.ts +22 -18
  153. package/src/mcp-server/cli/start/command.ts +5 -4
  154. package/src/mcp-server/cli/start/impl.ts +3 -3
  155. package/src/mcp-server/mcp-server.ts +1 -1
  156. package/src/mcp-server/server.ts +3 -3
  157. package/src/models/error-body.ts +8 -1
  158. package/src/models/gate-human-verified-event.ts +181 -0
  159. package/src/models/index.ts +3 -0
  160. package/src/models/inline-passkey-assertion.ts +147 -0
  161. package/src/models/inline-passkey-request-options.ts +175 -0
  162. package/src/models/operations/gates-api-actions-request-status.ts +7 -1
  163. package/src/models/operations/gates-api-actions-request.ts +1 -1
  164. package/src/models/operations/index.ts +2 -0
  165. package/src/models/operations/request-passkey-complete.ts +272 -0
  166. package/src/models/operations/request-passkey-options.ts +372 -0
  167. package/src/models/operations/verification-get-status.ts +85 -34
  168. package/src/sdk/inline-passkey.ts +49 -0
  169. package/src/sdk/sdk.ts +6 -0
@@ -22,7 +22,7 @@ interface StartCommandFlags {
22
22
  readonly "agent-key-auth"?: string | undefined;
23
23
  readonly "agent-key-auth1"?: string | undefined;
24
24
  readonly "server-url"?: string;
25
- readonly "server-index"?: SDKOptions["serverIdx"];
25
+ readonly server?: SDKOptions["server"];
26
26
  readonly "log-level": ConsoleLoggerLevel;
27
27
  readonly env?: [string, string][];
28
28
  }
@@ -56,7 +56,7 @@ async function startStdio(flags: StartCommandFlags) {
56
56
  agentKeyAuth1: flags["agent-key-auth1"] ?? "",
57
57
  },
58
58
  serverURL: flags["server-url"],
59
- serverIdx: flags["server-index"],
59
+ server: flags.server,
60
60
  });
61
61
  await server.connect(transport);
62
62
 
@@ -80,7 +80,7 @@ async function startSSE(flags: StartCommandFlags) {
80
80
  agentKeyAuth1: flags["agent-key-auth1"] ?? "",
81
81
  },
82
82
  serverURL: flags["server-url"],
83
- serverIdx: flags["server-index"],
83
+ server: flags.server,
84
84
  });
85
85
  let transport: SSEServerTransport | undefined;
86
86
  const controller = new AbortController();
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "2.2.1",
22
+ currentVersion: "2.3.0",
23
23
  },
24
24
  });
25
25
 
@@ -23,17 +23,17 @@ export function createMCPServer(deps: {
23
23
  scopes?: MCPScope[] | undefined;
24
24
  serverURL?: string | undefined;
25
25
  security?: SDKOptions["security"] | undefined;
26
- serverIdx?: SDKOptions["serverIdx"] | undefined;
26
+ server?: SDKOptions["server"] | undefined;
27
27
  }) {
28
28
  const server = new McpServer({
29
29
  name: "BotShield",
30
- version: "2.2.1",
30
+ version: "2.3.0",
31
31
  });
32
32
 
33
33
  const client = new BotShieldCore({
34
34
  security: deps.security,
35
35
  serverURL: deps.serverURL,
36
- serverIdx: deps.serverIdx,
36
+ server: deps.server,
37
37
  });
38
38
 
39
39
  const scopes = new Set(deps.scopes);
@@ -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`.
39
+ * `ttl_below_floor`, `ttl_above_ceiling`, `trust_layer_rejected`, `trust_layer_unavailable`, `gate_required`, `alias_retired`, `RATE_LIMITED`, `inline_not_for_age_gate`.
40
40
  */
41
41
  code?: string | undefined;
42
42
  minTtlSeconds?: number | undefined;
@@ -49,6 +49,10 @@ export type ErrorBody = {
49
49
  retryIn?: number | undefined;
50
50
  limits?: Limits | undefined;
51
51
  upgradeUrl?: string | undefined;
52
+ /**
53
+ * inline_not_for_age_gate only: the app hand-off for this request.
54
+ */
55
+ url?: string | undefined;
52
56
  };
53
57
 
54
58
  /** @internal */
@@ -156,6 +160,7 @@ export const ErrorBody$inboundSchema: z.ZodType<
156
160
  retry_in: types.optional(types.number()),
157
161
  limits: types.optional(z.lazy(() => Limits$inboundSchema)),
158
162
  upgrade_url: types.optional(types.string()),
163
+ url: types.optional(types.string()),
159
164
  }).transform((v) => {
160
165
  return remap$(v, {
161
166
  "min_ttl_seconds": "minTtlSeconds",
@@ -180,6 +185,7 @@ export type ErrorBody$Outbound = {
180
185
  retry_in?: number | undefined;
181
186
  limits?: Limits$Outbound | undefined;
182
187
  upgrade_url?: string | undefined;
188
+ url?: string | undefined;
183
189
  };
184
190
 
185
191
  /** @internal */
@@ -201,6 +207,7 @@ export const ErrorBody$outboundSchema: z.ZodType<
201
207
  retryIn: z.number().int().optional(),
202
208
  limits: z.lazy(() => Limits$outboundSchema).optional(),
203
209
  upgradeUrl: z.string().optional(),
210
+ url: z.string().optional(),
204
211
  }).transform((v) => {
205
212
  return remap$(v, {
206
213
  minTtlSeconds: "min_ttl_seconds",
@@ -0,0 +1,181 @@
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 { ClosedEnum } from "../types/enums.js";
9
+ import { Result as SafeParseResult } from "../types/fp.js";
10
+ import * as types from "../types/primitives.js";
11
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
12
+
13
+ export const GateHumanVerifiedEventType = {
14
+ GateHumanVerified: "gate.human_verified",
15
+ } as const;
16
+ export type GateHumanVerifiedEventType = ClosedEnum<
17
+ typeof GateHumanVerifiedEventType
18
+ >;
19
+
20
+ export const Verdict = {
21
+ Pass: "pass",
22
+ } as const;
23
+ export type Verdict = ClosedEnum<typeof Verdict>;
24
+
25
+ export const GateHumanVerifiedEventEnvironment = {
26
+ Development: "development",
27
+ Production: "production",
28
+ } as const;
29
+ export type GateHumanVerifiedEventEnvironment = ClosedEnum<
30
+ typeof GateHumanVerifiedEventEnvironment
31
+ >;
32
+
33
+ /**
34
+ * Webhook `gate.human_verified` (delivered by Svix to your endpoint). Identity-free. Sent once per request when a live human is proven — from the BotShield app or the inline passkey lane alike. Not modeled as an OpenAPI `webhooks` entry: the Speakeasy plan in use skips webhooks (business tier).
35
+ */
36
+ export type GateHumanVerifiedEvent = {
37
+ type: GateHumanVerifiedEventType;
38
+ /**
39
+ * Equals request_id.
40
+ */
41
+ eventId: string;
42
+ requestId: string;
43
+ verifiedAt: Date;
44
+ verdict: Verdict;
45
+ /**
46
+ * An active Secured Account binding exists for (your platform, partner_user_ref) after this ceremony.
47
+ */
48
+ trusted: boolean;
49
+ /**
50
+ * THIS ceremony created the binding.
51
+ */
52
+ firstTime: boolean;
53
+ /**
54
+ * The opaque per-platform handle, when the person has a Secured Account here.
55
+ */
56
+ handle?: string | undefined;
57
+ environment: GateHumanVerifiedEventEnvironment;
58
+ /**
59
+ * Omitted when unknown.
60
+ */
61
+ product?: string | undefined;
62
+ /**
63
+ * BotShield Actions: the act this tap confirmed, verbatim — the same value as the token's `act` claim. Present only on an action request.
64
+ */
65
+ act?: string | undefined;
66
+ /**
67
+ * Your own metadata from create-session / create-verification-link, BotShield's internal keys removed. Omitted when empty.
68
+ */
69
+ metadata?: { [k: string]: any } | undefined;
70
+ };
71
+
72
+ /** @internal */
73
+ export const GateHumanVerifiedEventType$inboundSchema: z.ZodNativeEnum<
74
+ typeof GateHumanVerifiedEventType
75
+ > = z.nativeEnum(GateHumanVerifiedEventType);
76
+ /** @internal */
77
+ export const GateHumanVerifiedEventType$outboundSchema: z.ZodNativeEnum<
78
+ typeof GateHumanVerifiedEventType
79
+ > = GateHumanVerifiedEventType$inboundSchema;
80
+
81
+ /** @internal */
82
+ export const Verdict$inboundSchema: z.ZodNativeEnum<typeof Verdict> = z
83
+ .nativeEnum(Verdict);
84
+ /** @internal */
85
+ export const Verdict$outboundSchema: z.ZodNativeEnum<typeof Verdict> =
86
+ Verdict$inboundSchema;
87
+
88
+ /** @internal */
89
+ export const GateHumanVerifiedEventEnvironment$inboundSchema: z.ZodNativeEnum<
90
+ typeof GateHumanVerifiedEventEnvironment
91
+ > = z.nativeEnum(GateHumanVerifiedEventEnvironment);
92
+ /** @internal */
93
+ export const GateHumanVerifiedEventEnvironment$outboundSchema: z.ZodNativeEnum<
94
+ typeof GateHumanVerifiedEventEnvironment
95
+ > = GateHumanVerifiedEventEnvironment$inboundSchema;
96
+
97
+ /** @internal */
98
+ export const GateHumanVerifiedEvent$inboundSchema: z.ZodType<
99
+ GateHumanVerifiedEvent,
100
+ z.ZodTypeDef,
101
+ unknown
102
+ > = z.object({
103
+ type: GateHumanVerifiedEventType$inboundSchema,
104
+ event_id: types.string(),
105
+ request_id: types.string(),
106
+ verified_at: types.date(),
107
+ verdict: Verdict$inboundSchema,
108
+ trusted: types.boolean(),
109
+ first_time: types.boolean(),
110
+ handle: types.optional(types.string()),
111
+ environment: GateHumanVerifiedEventEnvironment$inboundSchema,
112
+ product: types.optional(types.string()),
113
+ act: types.optional(types.string()),
114
+ metadata: types.optional(z.record(z.any())),
115
+ }).transform((v) => {
116
+ return remap$(v, {
117
+ "event_id": "eventId",
118
+ "request_id": "requestId",
119
+ "verified_at": "verifiedAt",
120
+ "first_time": "firstTime",
121
+ });
122
+ });
123
+ /** @internal */
124
+ export type GateHumanVerifiedEvent$Outbound = {
125
+ type: string;
126
+ event_id: string;
127
+ request_id: string;
128
+ verified_at: string;
129
+ verdict: string;
130
+ trusted: boolean;
131
+ first_time: boolean;
132
+ handle?: string | undefined;
133
+ environment: string;
134
+ product?: string | undefined;
135
+ act?: string | undefined;
136
+ metadata?: { [k: string]: any } | undefined;
137
+ };
138
+
139
+ /** @internal */
140
+ export const GateHumanVerifiedEvent$outboundSchema: z.ZodType<
141
+ GateHumanVerifiedEvent$Outbound,
142
+ z.ZodTypeDef,
143
+ GateHumanVerifiedEvent
144
+ > = z.object({
145
+ type: GateHumanVerifiedEventType$outboundSchema,
146
+ eventId: z.string(),
147
+ requestId: z.string(),
148
+ verifiedAt: z.date().transform(v => v.toISOString()),
149
+ verdict: Verdict$outboundSchema,
150
+ trusted: z.boolean(),
151
+ firstTime: z.boolean(),
152
+ handle: z.string().optional(),
153
+ environment: GateHumanVerifiedEventEnvironment$outboundSchema,
154
+ product: z.string().optional(),
155
+ act: z.string().optional(),
156
+ metadata: z.record(z.any()).optional(),
157
+ }).transform((v) => {
158
+ return remap$(v, {
159
+ eventId: "event_id",
160
+ requestId: "request_id",
161
+ verifiedAt: "verified_at",
162
+ firstTime: "first_time",
163
+ });
164
+ });
165
+
166
+ export function gateHumanVerifiedEventToJSON(
167
+ gateHumanVerifiedEvent: GateHumanVerifiedEvent,
168
+ ): string {
169
+ return JSON.stringify(
170
+ GateHumanVerifiedEvent$outboundSchema.parse(gateHumanVerifiedEvent),
171
+ );
172
+ }
173
+ export function gateHumanVerifiedEventFromJSON(
174
+ jsonString: string,
175
+ ): SafeParseResult<GateHumanVerifiedEvent, SDKValidationError> {
176
+ return safeParse(
177
+ jsonString,
178
+ (x) => GateHumanVerifiedEvent$inboundSchema.parse(JSON.parse(x)),
179
+ `Failed to parse 'GateHumanVerifiedEvent' from JSON`,
180
+ );
181
+ }
@@ -5,10 +5,13 @@
5
5
  export * from "./bot-shield-action.js";
6
6
  export * from "./error-body.js";
7
7
  export * from "./error-response.js";
8
+ export * from "./gate-human-verified-event.js";
8
9
  export * from "./gate-policy-doc.js";
9
10
  export * from "./gate-schedule.js";
10
11
  export * from "./gate.js";
11
12
  export * from "./gates-api-error.js";
13
+ export * from "./inline-passkey-assertion.js";
14
+ export * from "./inline-passkey-request-options.js";
12
15
  export * from "./invalid-input-error.js";
13
16
  export * from "./passes-per-person.js";
14
17
  export * from "./security.js";
@@ -0,0 +1,147 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import * as types from "../types/primitives.js";
10
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
11
+
12
+ export const InlinePasskeyAssertionType = {
13
+ PublicKey: "public-key",
14
+ } as const;
15
+ export type InlinePasskeyAssertionType = ClosedEnum<
16
+ typeof InlinePasskeyAssertionType
17
+ >;
18
+
19
+ export type ResponseT = {
20
+ clientDataJSON: string;
21
+ authenticatorData: string;
22
+ signature: string;
23
+ userHandle?: string | undefined;
24
+ [additionalProperties: string]: unknown;
25
+ };
26
+
27
+ /**
28
+ * WebAuthn AuthenticationResponseJSON (base64url strings) — the result of navigator.credentials.get(), serialized (e.g. PublicKeyCredential.toJSON() or @simplewebauthn/browser startAuthentication()).
29
+ */
30
+ export type InlinePasskeyAssertion = {
31
+ id: string;
32
+ rawId: string;
33
+ type: InlinePasskeyAssertionType;
34
+ authenticatorAttachment?: string | undefined;
35
+ clientExtensionResults?: { [k: string]: any } | undefined;
36
+ response: ResponseT;
37
+ [additionalProperties: string]: unknown;
38
+ };
39
+
40
+ /** @internal */
41
+ export const InlinePasskeyAssertionType$inboundSchema: z.ZodNativeEnum<
42
+ typeof InlinePasskeyAssertionType
43
+ > = z.nativeEnum(InlinePasskeyAssertionType);
44
+ /** @internal */
45
+ export const InlinePasskeyAssertionType$outboundSchema: z.ZodNativeEnum<
46
+ typeof InlinePasskeyAssertionType
47
+ > = InlinePasskeyAssertionType$inboundSchema;
48
+
49
+ /** @internal */
50
+ export const ResponseT$inboundSchema: z.ZodType<
51
+ ResponseT,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = z.object({
55
+ clientDataJSON: types.string(),
56
+ authenticatorData: types.string(),
57
+ signature: types.string(),
58
+ userHandle: types.optional(types.string()),
59
+ }).catchall(z.any());
60
+ /** @internal */
61
+ export type ResponseT$Outbound = {
62
+ clientDataJSON: string;
63
+ authenticatorData: string;
64
+ signature: string;
65
+ userHandle?: string | undefined;
66
+ [additionalProperties: string]: unknown;
67
+ };
68
+
69
+ /** @internal */
70
+ export const ResponseT$outboundSchema: z.ZodType<
71
+ ResponseT$Outbound,
72
+ z.ZodTypeDef,
73
+ ResponseT
74
+ > = z.object({
75
+ clientDataJSON: z.string(),
76
+ authenticatorData: z.string(),
77
+ signature: z.string(),
78
+ userHandle: z.string().optional(),
79
+ }).catchall(z.any());
80
+
81
+ export function responseToJSON(responseT: ResponseT): string {
82
+ return JSON.stringify(ResponseT$outboundSchema.parse(responseT));
83
+ }
84
+ export function responseFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<ResponseT, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => ResponseT$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'ResponseT' from JSON`,
91
+ );
92
+ }
93
+
94
+ /** @internal */
95
+ export const InlinePasskeyAssertion$inboundSchema: z.ZodType<
96
+ InlinePasskeyAssertion,
97
+ z.ZodTypeDef,
98
+ unknown
99
+ > = z.object({
100
+ id: types.string(),
101
+ rawId: types.string(),
102
+ type: InlinePasskeyAssertionType$inboundSchema,
103
+ authenticatorAttachment: types.optional(types.string()),
104
+ clientExtensionResults: types.optional(z.record(z.any())),
105
+ response: z.lazy(() => ResponseT$inboundSchema),
106
+ }).catchall(z.any());
107
+ /** @internal */
108
+ export type InlinePasskeyAssertion$Outbound = {
109
+ id: string;
110
+ rawId: string;
111
+ type: string;
112
+ authenticatorAttachment?: string | undefined;
113
+ clientExtensionResults?: { [k: string]: any } | undefined;
114
+ response: ResponseT$Outbound;
115
+ [additionalProperties: string]: unknown;
116
+ };
117
+
118
+ /** @internal */
119
+ export const InlinePasskeyAssertion$outboundSchema: z.ZodType<
120
+ InlinePasskeyAssertion$Outbound,
121
+ z.ZodTypeDef,
122
+ InlinePasskeyAssertion
123
+ > = z.object({
124
+ id: z.string(),
125
+ rawId: z.string(),
126
+ type: InlinePasskeyAssertionType$outboundSchema,
127
+ authenticatorAttachment: z.string().optional(),
128
+ clientExtensionResults: z.record(z.any()).optional(),
129
+ response: z.lazy(() => ResponseT$outboundSchema),
130
+ }).catchall(z.any());
131
+
132
+ export function inlinePasskeyAssertionToJSON(
133
+ inlinePasskeyAssertion: InlinePasskeyAssertion,
134
+ ): string {
135
+ return JSON.stringify(
136
+ InlinePasskeyAssertion$outboundSchema.parse(inlinePasskeyAssertion),
137
+ );
138
+ }
139
+ export function inlinePasskeyAssertionFromJSON(
140
+ jsonString: string,
141
+ ): SafeParseResult<InlinePasskeyAssertion, SDKValidationError> {
142
+ return safeParse(
143
+ jsonString,
144
+ (x) => InlinePasskeyAssertion$inboundSchema.parse(JSON.parse(x)),
145
+ `Failed to parse 'InlinePasskeyAssertion' from JSON`,
146
+ );
147
+ }
@@ -0,0 +1,175 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import * as openEnums from "../types/enums.js";
8
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
9
+ import { Result as SafeParseResult } from "../types/fp.js";
10
+ import * as types from "../types/primitives.js";
11
+ import { SDKValidationError } from "./errors/sdk-validation-error.js";
12
+
13
+ export const InlinePasskeyRequestOptionsType = {
14
+ PublicKey: "public-key",
15
+ } as const;
16
+ export type InlinePasskeyRequestOptionsType = ClosedEnum<
17
+ typeof InlinePasskeyRequestOptionsType
18
+ >;
19
+
20
+ export type AllowCredential = {
21
+ /**
22
+ * base64url credential id
23
+ */
24
+ id: string;
25
+ type: InlinePasskeyRequestOptionsType;
26
+ transports?: Array<string> | undefined;
27
+ };
28
+
29
+ export const UserVerification = {
30
+ Required: "required",
31
+ Preferred: "preferred",
32
+ Discouraged: "discouraged",
33
+ } as const;
34
+ export type UserVerification = OpenEnum<typeof UserVerification>;
35
+
36
+ /**
37
+ * WebAuthn PublicKeyCredentialRequestOptionsJSON (base64url strings). rpId is botshield.ai; userVerification is always `required`.
38
+ */
39
+ export type InlinePasskeyRequestOptions = {
40
+ /**
41
+ * base64url
42
+ */
43
+ challenge: string;
44
+ allowCredentials?: Array<AllowCredential> | undefined;
45
+ timeout?: number | undefined;
46
+ userVerification?: UserVerification | undefined;
47
+ rpId?: string | undefined;
48
+ extensions?: { [k: string]: any } | undefined;
49
+ [additionalProperties: string]: unknown;
50
+ };
51
+
52
+ /** @internal */
53
+ export const InlinePasskeyRequestOptionsType$inboundSchema: z.ZodNativeEnum<
54
+ typeof InlinePasskeyRequestOptionsType
55
+ > = z.nativeEnum(InlinePasskeyRequestOptionsType);
56
+ /** @internal */
57
+ export const InlinePasskeyRequestOptionsType$outboundSchema: z.ZodNativeEnum<
58
+ typeof InlinePasskeyRequestOptionsType
59
+ > = InlinePasskeyRequestOptionsType$inboundSchema;
60
+
61
+ /** @internal */
62
+ export const AllowCredential$inboundSchema: z.ZodType<
63
+ AllowCredential,
64
+ z.ZodTypeDef,
65
+ unknown
66
+ > = z.object({
67
+ id: types.string(),
68
+ type: InlinePasskeyRequestOptionsType$inboundSchema,
69
+ transports: types.optional(z.array(types.string())),
70
+ });
71
+ /** @internal */
72
+ export type AllowCredential$Outbound = {
73
+ id: string;
74
+ type: string;
75
+ transports?: Array<string> | undefined;
76
+ };
77
+
78
+ /** @internal */
79
+ export const AllowCredential$outboundSchema: z.ZodType<
80
+ AllowCredential$Outbound,
81
+ z.ZodTypeDef,
82
+ AllowCredential
83
+ > = z.object({
84
+ id: z.string(),
85
+ type: InlinePasskeyRequestOptionsType$outboundSchema,
86
+ transports: z.array(z.string()).optional(),
87
+ });
88
+
89
+ export function allowCredentialToJSON(
90
+ allowCredential: AllowCredential,
91
+ ): string {
92
+ return JSON.stringify(AllowCredential$outboundSchema.parse(allowCredential));
93
+ }
94
+ export function allowCredentialFromJSON(
95
+ jsonString: string,
96
+ ): SafeParseResult<AllowCredential, SDKValidationError> {
97
+ return safeParse(
98
+ jsonString,
99
+ (x) => AllowCredential$inboundSchema.parse(JSON.parse(x)),
100
+ `Failed to parse 'AllowCredential' from JSON`,
101
+ );
102
+ }
103
+
104
+ /** @internal */
105
+ export const UserVerification$inboundSchema: z.ZodType<
106
+ UserVerification,
107
+ z.ZodTypeDef,
108
+ unknown
109
+ > = openEnums.inboundSchema(UserVerification);
110
+ /** @internal */
111
+ export const UserVerification$outboundSchema: z.ZodType<
112
+ string,
113
+ z.ZodTypeDef,
114
+ UserVerification
115
+ > = openEnums.outboundSchema(UserVerification);
116
+
117
+ /** @internal */
118
+ export const InlinePasskeyRequestOptions$inboundSchema: z.ZodType<
119
+ InlinePasskeyRequestOptions,
120
+ z.ZodTypeDef,
121
+ unknown
122
+ > = z.object({
123
+ challenge: types.string(),
124
+ allowCredentials: types.optional(
125
+ z.array(z.lazy(() => AllowCredential$inboundSchema)),
126
+ ),
127
+ timeout: types.optional(types.number()),
128
+ userVerification: types.optional(UserVerification$inboundSchema),
129
+ rpId: types.optional(types.string()),
130
+ extensions: types.optional(z.record(z.any())),
131
+ }).catchall(z.any());
132
+ /** @internal */
133
+ export type InlinePasskeyRequestOptions$Outbound = {
134
+ challenge: string;
135
+ allowCredentials?: Array<AllowCredential$Outbound> | undefined;
136
+ timeout?: number | undefined;
137
+ userVerification?: string | undefined;
138
+ rpId?: string | undefined;
139
+ extensions?: { [k: string]: any } | undefined;
140
+ [additionalProperties: string]: unknown;
141
+ };
142
+
143
+ /** @internal */
144
+ export const InlinePasskeyRequestOptions$outboundSchema: z.ZodType<
145
+ InlinePasskeyRequestOptions$Outbound,
146
+ z.ZodTypeDef,
147
+ InlinePasskeyRequestOptions
148
+ > = z.object({
149
+ challenge: z.string(),
150
+ allowCredentials: z.array(z.lazy(() => AllowCredential$outboundSchema))
151
+ .optional(),
152
+ timeout: z.number().int().optional(),
153
+ userVerification: UserVerification$outboundSchema.optional(),
154
+ rpId: z.string().optional(),
155
+ extensions: z.record(z.any()).optional(),
156
+ }).catchall(z.any());
157
+
158
+ export function inlinePasskeyRequestOptionsToJSON(
159
+ inlinePasskeyRequestOptions: InlinePasskeyRequestOptions,
160
+ ): string {
161
+ return JSON.stringify(
162
+ InlinePasskeyRequestOptions$outboundSchema.parse(
163
+ inlinePasskeyRequestOptions,
164
+ ),
165
+ );
166
+ }
167
+ export function inlinePasskeyRequestOptionsFromJSON(
168
+ jsonString: string,
169
+ ): SafeParseResult<InlinePasskeyRequestOptions, SDKValidationError> {
170
+ return safeParse(
171
+ jsonString,
172
+ (x) => InlinePasskeyRequestOptions$inboundSchema.parse(JSON.parse(x)),
173
+ `Failed to parse 'InlinePasskeyRequestOptions' from JSON`,
174
+ );
175
+ }
@@ -37,11 +37,17 @@ export type GatesApiActionsRequestStatusDataData = {
37
37
  status: GatesApiActionsRequestStatusStatus;
38
38
  act: string;
39
39
  expiresAt: Date;
40
+ /**
41
+ * When the person answered; null while queued.
42
+ */
40
43
  resolvedAt?: Date | null | undefined;
41
44
  /**
42
45
  * Present once approved, until the collection window closes.
43
46
  */
44
47
  token?: string | null | undefined;
48
+ /**
49
+ * Seconds left to collect `token`; 0 once the collection window has closed (then `token` is null).
50
+ */
45
51
  tokenExpiresIn?: number | undefined;
46
52
  };
47
53
 
@@ -54,7 +60,7 @@ export type GatesApiActionsRequestStatusData = {
54
60
  };
55
61
 
56
62
  /**
57
- * The request. Errors as data.error — codes: `invalid_key`, `gates_scope_required`, `request_not_found` (404).
63
+ * The request. Errors as data.error — codes: `invalid_key` (401), `gates_scope_required` (403), `org_not_found` (404), `request_not_found` (404).
58
64
  */
59
65
  export type GatesApiActionsRequestStatusResponse = {
60
66
  data: GatesApiActionsRequestStatusData;
@@ -73,7 +73,7 @@ export type GatesApiActionsRequestData = {
73
73
  };
74
74
 
75
75
  /**
76
- * Queued. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401), `gates_scope_required` (403), `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), `request_id_reused` (409).
76
+ * 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), `request_id_reused` (409), `internal` (500).
77
77
  */
78
78
  export type GatesApiActionsRequestResponse = {
79
79
  data: GatesApiActionsRequestData;
@@ -17,6 +17,8 @@ export * from "./gates-api-create.js";
17
17
  export * from "./gates-api-extend.js";
18
18
  export * from "./gates-api-get.js";
19
19
  export * from "./gates-api-list.js";
20
+ export * from "./request-passkey-complete.js";
21
+ export * from "./request-passkey-options.js";
20
22
  export * from "./sdk-create-session.js";
21
23
  export * from "./sdk-create-verification-link.js";
22
24
  export * from "./sdk-get-partner-config.js";