botshield-sdk 4.0.0 → 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 +17 -5
- package/bin/mcp-server.js +395 -22
- package/bin/mcp-server.js.map +25 -21
- 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/recovery-exchange.d.ts +18 -0
- package/dist/commonjs/funcs/recovery-exchange.d.ts.map +1 -0
- package/dist/commonjs/funcs/recovery-exchange.js +123 -0
- package/dist/commonjs/funcs/recovery-exchange.js.map +1 -0
- package/dist/commonjs/funcs/recovery-other-route.d.ts +18 -0
- package/dist/commonjs/funcs/recovery-other-route.d.ts.map +1 -0
- package/dist/commonjs/funcs/recovery-other-route.js +123 -0
- package/dist/commonjs/funcs/recovery-other-route.js.map +1 -0
- package/dist/commonjs/funcs/sign-in-confirm.d.ts +18 -0
- package/dist/commonjs/funcs/sign-in-confirm.d.ts.map +1 -0
- package/dist/commonjs/funcs/sign-in-confirm.js +123 -0
- package/dist/commonjs/funcs/sign-in-confirm.js.map +1 -0
- package/dist/commonjs/funcs/sign-in-request.d.ts +18 -0
- package/dist/commonjs/funcs/sign-in-request.d.ts.map +1 -0
- package/dist/commonjs/funcs/sign-in-request.js +123 -0
- package/dist/commonjs/funcs/sign-in-request.js.map +1 -0
- package/dist/commonjs/funcs/verification-get-status.d.ts +1 -1
- package/dist/commonjs/funcs/verification-get-status.js +2 -1
- package/dist/commonjs/funcs/verification-get-status.js.map +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 +37 -1
- package/dist/commonjs/models/bot-shield-action.d.ts.map +1 -1
- package/dist/commonjs/models/bot-shield-action.js +28 -1
- package/dist/commonjs/models/bot-shield-action.js.map +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/index.d.ts +4 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +4 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/recovery-exchange.d.ts +114 -0
- package/dist/commonjs/models/operations/recovery-exchange.d.ts.map +1 -0
- package/dist/commonjs/models/operations/recovery-exchange.js +164 -0
- package/dist/commonjs/models/operations/recovery-exchange.js.map +1 -0
- package/dist/commonjs/models/operations/recovery-other-route.d.ts +86 -0
- package/dist/commonjs/models/operations/recovery-other-route.d.ts.map +1 -0
- package/dist/commonjs/models/operations/recovery-other-route.js +145 -0
- package/dist/commonjs/models/operations/recovery-other-route.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +6 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.js +4 -0
- package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-send-by-number.d.ts +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts +19 -4
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.js +10 -0
- package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
- 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/signin-confirm.d.ts +148 -0
- package/dist/commonjs/models/operations/signin-confirm.d.ts.map +1 -0
- package/dist/commonjs/models/operations/signin-confirm.js +202 -0
- package/dist/commonjs/models/operations/signin-confirm.js.map +1 -0
- package/dist/commonjs/models/operations/signin-request.d.ts +115 -0
- package/dist/commonjs/models/operations/signin-request.d.ts.map +1 -0
- package/dist/commonjs/models/operations/signin-request.js +174 -0
- package/dist/commonjs/models/operations/signin-request.js.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts +10 -5
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.js +5 -1
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
- package/dist/commonjs/sdk/census.d.ts +3 -3
- package/dist/commonjs/sdk/census.js +3 -3
- package/dist/commonjs/sdk/recovery.d.ts +19 -0
- package/dist/commonjs/sdk/recovery.d.ts.map +1 -0
- package/dist/commonjs/sdk/recovery.js +32 -0
- package/dist/commonjs/sdk/recovery.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +6 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +10 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/sign-in.d.ts +19 -0
- package/dist/commonjs/sdk/sign-in.d.ts.map +1 -0
- package/dist/commonjs/sdk/sign-in.js +32 -0
- package/dist/commonjs/sdk/sign-in.js.map +1 -0
- 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/recovery-exchange.d.ts +18 -0
- package/dist/esm/funcs/recovery-exchange.d.ts.map +1 -0
- package/dist/esm/funcs/recovery-exchange.js +87 -0
- package/dist/esm/funcs/recovery-exchange.js.map +1 -0
- package/dist/esm/funcs/recovery-other-route.d.ts +18 -0
- package/dist/esm/funcs/recovery-other-route.d.ts.map +1 -0
- package/dist/esm/funcs/recovery-other-route.js +87 -0
- package/dist/esm/funcs/recovery-other-route.js.map +1 -0
- package/dist/esm/funcs/sign-in-confirm.d.ts +18 -0
- package/dist/esm/funcs/sign-in-confirm.d.ts.map +1 -0
- package/dist/esm/funcs/sign-in-confirm.js +87 -0
- package/dist/esm/funcs/sign-in-confirm.js.map +1 -0
- package/dist/esm/funcs/sign-in-request.d.ts +18 -0
- package/dist/esm/funcs/sign-in-request.d.ts.map +1 -0
- package/dist/esm/funcs/sign-in-request.js +87 -0
- package/dist/esm/funcs/sign-in-request.js.map +1 -0
- package/dist/esm/funcs/verification-get-status.d.ts +1 -1
- package/dist/esm/funcs/verification-get-status.js +3 -2
- package/dist/esm/funcs/verification-get-status.js.map +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 +37 -1
- package/dist/esm/models/bot-shield-action.d.ts.map +1 -1
- package/dist/esm/models/bot-shield-action.js +27 -0
- package/dist/esm/models/bot-shield-action.js.map +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/index.d.ts +4 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +4 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/recovery-exchange.d.ts +114 -0
- package/dist/esm/models/operations/recovery-exchange.d.ts.map +1 -0
- package/dist/esm/models/operations/recovery-exchange.js +118 -0
- package/dist/esm/models/operations/recovery-exchange.js.map +1 -0
- package/dist/esm/models/operations/recovery-other-route.d.ts +86 -0
- package/dist/esm/models/operations/recovery-other-route.d.ts.map +1 -0
- package/dist/esm/models/operations/recovery-other-route.js +99 -0
- package/dist/esm/models/operations/recovery-other-route.js.map +1 -0
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts +6 -1
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.js +4 -0
- package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/esm/models/operations/sdk-send-by-number.d.ts +1 -1
- package/dist/esm/models/operations/sdk-verify-token.d.ts +19 -4
- package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.js +10 -0
- package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
- 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/signin-confirm.d.ts +148 -0
- package/dist/esm/models/operations/signin-confirm.d.ts.map +1 -0
- package/dist/esm/models/operations/signin-confirm.js +156 -0
- package/dist/esm/models/operations/signin-confirm.js.map +1 -0
- package/dist/esm/models/operations/signin-request.d.ts +115 -0
- package/dist/esm/models/operations/signin-request.d.ts.map +1 -0
- package/dist/esm/models/operations/signin-request.js +128 -0
- package/dist/esm/models/operations/signin-request.js.map +1 -0
- package/dist/esm/models/operations/verification-get-status.d.ts +10 -5
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/esm/models/operations/verification-get-status.js +5 -1
- package/dist/esm/models/operations/verification-get-status.js.map +1 -1
- package/dist/esm/sdk/census.d.ts +3 -3
- package/dist/esm/sdk/census.js +3 -3
- package/dist/esm/sdk/recovery.d.ts +19 -0
- package/dist/esm/sdk/recovery.d.ts.map +1 -0
- package/dist/esm/sdk/recovery.js +28 -0
- package/dist/esm/sdk/recovery.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +6 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +10 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/sign-in.d.ts +19 -0
- package/dist/esm/sdk/sign-in.d.ts.map +1 -0
- package/dist/esm/sdk/sign-in.js +28 -0
- package/dist/esm/sdk/sign-in.js.map +1 -0
- 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/recovery-exchange.ts +184 -0
- package/src/funcs/recovery-other-route.ts +184 -0
- package/src/funcs/sign-in-confirm.ts +184 -0
- package/src/funcs/sign-in-request.ts +184 -0
- package/src/funcs/verification-get-status.ts +7 -2
- 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 +62 -1
- 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/index.ts +4 -0
- package/src/models/operations/recovery-exchange.ts +308 -0
- package/src/models/operations/recovery-other-route.ts +262 -0
- package/src/models/operations/sdk-create-verification-link.ts +10 -1
- package/src/models/operations/sdk-send-by-number.ts +1 -1
- package/src/models/operations/sdk-verify-token.ts +29 -4
- package/src/models/operations/secured-accounts-list.ts +7 -0
- package/src/models/operations/secured-accounts-status.ts +7 -0
- package/src/models/operations/signin-confirm.ts +383 -0
- package/src/models/operations/signin-request.ts +319 -0
- package/src/models/operations/verification-get-status.ts +14 -5
- package/src/sdk/census.ts +3 -3
- package/src/sdk/recovery.ts +49 -0
- package/src/sdk/sdk.ts +12 -0
- package/src/sdk/sign-in.ts +49 -0
- package/src/sdk/verification.ts +1 -1
|
@@ -31,6 +31,19 @@ export type BotShieldActionEnvironment = OpenEnum<
|
|
|
31
31
|
typeof BotShieldActionEnvironment
|
|
32
32
|
>;
|
|
33
33
|
|
|
34
|
+
/**
|
|
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
|
+
*/
|
|
37
|
+
export const BotShieldActionKind = {
|
|
38
|
+
Action: "action",
|
|
39
|
+
Recovery: "recovery",
|
|
40
|
+
Signin: "signin",
|
|
41
|
+
} as const;
|
|
42
|
+
/**
|
|
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
|
+
*/
|
|
45
|
+
export type BotShieldActionKind = OpenEnum<typeof BotShieldActionKind>;
|
|
46
|
+
|
|
34
47
|
/**
|
|
35
48
|
* A BotShield Action: one act on your own surface keyed to a passkey. Not a gate — no schedule, no levers — and it always stands on a verified account, so a tap runs the linking ceremony.
|
|
36
49
|
*/
|
|
@@ -60,7 +73,23 @@ export type BotShieldAction = {
|
|
|
60
73
|
*/
|
|
61
74
|
staffCanSend?: boolean | undefined;
|
|
62
75
|
/**
|
|
63
|
-
*
|
|
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
|
+
*/
|
|
78
|
+
kind?: BotShieldActionKind | undefined;
|
|
79
|
+
/**
|
|
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
|
+
*/
|
|
82
|
+
signinQr?: boolean | undefined;
|
|
83
|
+
/**
|
|
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
|
+
*/
|
|
86
|
+
pendingWhereUrl?: string | null | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* When `pending_where_url` takes effect.
|
|
89
|
+
*/
|
|
90
|
+
pendingWhereUrlAt?: Date | null | undefined;
|
|
91
|
+
/**
|
|
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.
|
|
64
93
|
*/
|
|
65
94
|
highValue?: boolean | undefined;
|
|
66
95
|
};
|
|
@@ -91,6 +120,19 @@ export const BotShieldActionEnvironment$outboundSchema: z.ZodType<
|
|
|
91
120
|
BotShieldActionEnvironment
|
|
92
121
|
> = openEnums.outboundSchema(BotShieldActionEnvironment);
|
|
93
122
|
|
|
123
|
+
/** @internal */
|
|
124
|
+
export const BotShieldActionKind$inboundSchema: z.ZodType<
|
|
125
|
+
BotShieldActionKind,
|
|
126
|
+
z.ZodTypeDef,
|
|
127
|
+
unknown
|
|
128
|
+
> = openEnums.inboundSchema(BotShieldActionKind);
|
|
129
|
+
/** @internal */
|
|
130
|
+
export const BotShieldActionKind$outboundSchema: z.ZodType<
|
|
131
|
+
string,
|
|
132
|
+
z.ZodTypeDef,
|
|
133
|
+
BotShieldActionKind
|
|
134
|
+
> = openEnums.outboundSchema(BotShieldActionKind);
|
|
135
|
+
|
|
94
136
|
/** @internal */
|
|
95
137
|
export const BotShieldAction$inboundSchema: z.ZodType<
|
|
96
138
|
BotShieldAction,
|
|
@@ -106,6 +148,10 @@ export const BotShieldAction$inboundSchema: z.ZodType<
|
|
|
106
148
|
placed_at: types.date(),
|
|
107
149
|
turned_off_at: types.nullable(types.date()),
|
|
108
150
|
staff_can_send: types.optional(types.boolean()),
|
|
151
|
+
kind: types.optional(BotShieldActionKind$inboundSchema),
|
|
152
|
+
signin_qr: types.optional(types.boolean()),
|
|
153
|
+
pending_where_url: z.nullable(types.string()).optional(),
|
|
154
|
+
pending_where_url_at: z.nullable(types.date()).optional(),
|
|
109
155
|
high_value: types.optional(types.boolean()),
|
|
110
156
|
}).transform((v) => {
|
|
111
157
|
return remap$(v, {
|
|
@@ -114,6 +160,9 @@ export const BotShieldAction$inboundSchema: z.ZodType<
|
|
|
114
160
|
"placed_at": "placedAt",
|
|
115
161
|
"turned_off_at": "turnedOffAt",
|
|
116
162
|
"staff_can_send": "staffCanSend",
|
|
163
|
+
"signin_qr": "signinQr",
|
|
164
|
+
"pending_where_url": "pendingWhereUrl",
|
|
165
|
+
"pending_where_url_at": "pendingWhereUrlAt",
|
|
117
166
|
"high_value": "highValue",
|
|
118
167
|
});
|
|
119
168
|
});
|
|
@@ -128,6 +177,10 @@ export type BotShieldAction$Outbound = {
|
|
|
128
177
|
placed_at: string;
|
|
129
178
|
turned_off_at: string | null;
|
|
130
179
|
staff_can_send?: boolean | undefined;
|
|
180
|
+
kind?: string | undefined;
|
|
181
|
+
signin_qr?: boolean | undefined;
|
|
182
|
+
pending_where_url?: string | null | undefined;
|
|
183
|
+
pending_where_url_at?: string | null | undefined;
|
|
131
184
|
high_value?: boolean | undefined;
|
|
132
185
|
};
|
|
133
186
|
|
|
@@ -146,6 +199,11 @@ export const BotShieldAction$outboundSchema: z.ZodType<
|
|
|
146
199
|
placedAt: z.date().transform(v => v.toISOString()),
|
|
147
200
|
turnedOffAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
148
201
|
staffCanSend: z.boolean().optional(),
|
|
202
|
+
kind: BotShieldActionKind$outboundSchema.optional(),
|
|
203
|
+
signinQr: z.boolean().optional(),
|
|
204
|
+
pendingWhereUrl: z.nullable(z.string()).optional(),
|
|
205
|
+
pendingWhereUrlAt: z.nullable(z.date().transform(v => v.toISOString()))
|
|
206
|
+
.optional(),
|
|
149
207
|
highValue: z.boolean().optional(),
|
|
150
208
|
}).transform((v) => {
|
|
151
209
|
return remap$(v, {
|
|
@@ -154,6 +212,9 @@ export const BotShieldAction$outboundSchema: z.ZodType<
|
|
|
154
212
|
placedAt: "placed_at",
|
|
155
213
|
turnedOffAt: "turned_off_at",
|
|
156
214
|
staffCanSend: "staff_can_send",
|
|
215
|
+
signinQr: "signin_qr",
|
|
216
|
+
pendingWhereUrl: "pending_where_url",
|
|
217
|
+
pendingWhereUrlAt: "pending_where_url_at",
|
|
157
218
|
highValue: "high_value",
|
|
158
219
|
});
|
|
159
220
|
});
|
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`.
|
|
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;
|
|
@@ -19,6 +19,8 @@ export * from "./gates-api-create.js";
|
|
|
19
19
|
export * from "./gates-api-extend.js";
|
|
20
20
|
export * from "./gates-api-get.js";
|
|
21
21
|
export * from "./gates-api-list.js";
|
|
22
|
+
export * from "./recovery-exchange.js";
|
|
23
|
+
export * from "./recovery-other-route.js";
|
|
22
24
|
export * from "./request-passkey-complete.js";
|
|
23
25
|
export * from "./request-passkey-options.js";
|
|
24
26
|
export * from "./sdk-confirm-link.js";
|
|
@@ -35,4 +37,6 @@ export * from "./sdk-verify-token.js";
|
|
|
35
37
|
export * from "./secured-accounts-list.js";
|
|
36
38
|
export * from "./secured-accounts-revoke.js";
|
|
37
39
|
export * from "./secured-accounts-status.js";
|
|
40
|
+
export * from "./signin-confirm.js";
|
|
41
|
+
export * from "./signin-request.js";
|
|
38
42
|
export * from "./verification-get-status.js";
|
|
@@ -0,0 +1,308 @@
|
|
|
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
|
+
import * as models from "../index.js";
|
|
13
|
+
|
|
14
|
+
export type RecoveryExchangeSecurity = {
|
|
15
|
+
apiKeyAuth: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type RecoveryExchangeRequest = {
|
|
19
|
+
/**
|
|
20
|
+
* The `botshield_recovery_code` your landing page received. Works once, for 2 minutes.
|
|
21
|
+
*/
|
|
22
|
+
code: string;
|
|
23
|
+
/**
|
|
24
|
+
* The secret your page set in this browser before the tap (its SHA-256, base64url, was the button's challenge).
|
|
25
|
+
*/
|
|
26
|
+
secret: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const RecoveryExchangeAct = {
|
|
30
|
+
Recovery: "recovery",
|
|
31
|
+
} as const;
|
|
32
|
+
export type RecoveryExchangeAct = ClosedEnum<typeof RecoveryExchangeAct>;
|
|
33
|
+
|
|
34
|
+
export type RecoveryExchangeDataData = {
|
|
35
|
+
/**
|
|
36
|
+
* Always true: this is a recovery.
|
|
37
|
+
*/
|
|
38
|
+
recovery: boolean;
|
|
39
|
+
act: RecoveryExchangeAct;
|
|
40
|
+
/**
|
|
41
|
+
* The Recovery Action's key.
|
|
42
|
+
*/
|
|
43
|
+
action: string;
|
|
44
|
+
/**
|
|
45
|
+
* The account's per-company handle (`OP_…`), as `account.secured` gave it.
|
|
46
|
+
*/
|
|
47
|
+
handle: string;
|
|
48
|
+
recoveryId: string;
|
|
49
|
+
recoveredAt: Date;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type RecoveryExchangeData = {
|
|
53
|
+
data?: RecoveryExchangeDataData | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Handler error. Arrives inside `data.error` with HTTP 200. Check for it before reading the result.
|
|
56
|
+
*/
|
|
57
|
+
error?: models.ErrorBody | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The recovery. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key; a site key `pk_…` is refused), `org_not_found` (404), `recovery_code_invalid` (400 — unknown, used, expired, another company's, or the secret did not match; the code is destroyed either way).
|
|
62
|
+
*/
|
|
63
|
+
export type RecoveryExchangeResponse = {
|
|
64
|
+
data: RecoveryExchangeData;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const RecoveryExchangeSecurity$inboundSchema: z.ZodType<
|
|
69
|
+
RecoveryExchangeSecurity,
|
|
70
|
+
z.ZodTypeDef,
|
|
71
|
+
unknown
|
|
72
|
+
> = z.object({
|
|
73
|
+
ApiKeyAuth: types.string(),
|
|
74
|
+
}).transform((v) => {
|
|
75
|
+
return remap$(v, {
|
|
76
|
+
"ApiKeyAuth": "apiKeyAuth",
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
/** @internal */
|
|
80
|
+
export type RecoveryExchangeSecurity$Outbound = {
|
|
81
|
+
ApiKeyAuth: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const RecoveryExchangeSecurity$outboundSchema: z.ZodType<
|
|
86
|
+
RecoveryExchangeSecurity$Outbound,
|
|
87
|
+
z.ZodTypeDef,
|
|
88
|
+
RecoveryExchangeSecurity
|
|
89
|
+
> = z.object({
|
|
90
|
+
apiKeyAuth: z.string(),
|
|
91
|
+
}).transform((v) => {
|
|
92
|
+
return remap$(v, {
|
|
93
|
+
apiKeyAuth: "ApiKeyAuth",
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export function recoveryExchangeSecurityToJSON(
|
|
98
|
+
recoveryExchangeSecurity: RecoveryExchangeSecurity,
|
|
99
|
+
): string {
|
|
100
|
+
return JSON.stringify(
|
|
101
|
+
RecoveryExchangeSecurity$outboundSchema.parse(recoveryExchangeSecurity),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
export function recoveryExchangeSecurityFromJSON(
|
|
105
|
+
jsonString: string,
|
|
106
|
+
): SafeParseResult<RecoveryExchangeSecurity, SDKValidationError> {
|
|
107
|
+
return safeParse(
|
|
108
|
+
jsonString,
|
|
109
|
+
(x) => RecoveryExchangeSecurity$inboundSchema.parse(JSON.parse(x)),
|
|
110
|
+
`Failed to parse 'RecoveryExchangeSecurity' from JSON`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const RecoveryExchangeRequest$inboundSchema: z.ZodType<
|
|
116
|
+
RecoveryExchangeRequest,
|
|
117
|
+
z.ZodTypeDef,
|
|
118
|
+
unknown
|
|
119
|
+
> = z.object({
|
|
120
|
+
code: types.string(),
|
|
121
|
+
secret: types.string(),
|
|
122
|
+
});
|
|
123
|
+
/** @internal */
|
|
124
|
+
export type RecoveryExchangeRequest$Outbound = {
|
|
125
|
+
code: string;
|
|
126
|
+
secret: string;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** @internal */
|
|
130
|
+
export const RecoveryExchangeRequest$outboundSchema: z.ZodType<
|
|
131
|
+
RecoveryExchangeRequest$Outbound,
|
|
132
|
+
z.ZodTypeDef,
|
|
133
|
+
RecoveryExchangeRequest
|
|
134
|
+
> = z.object({
|
|
135
|
+
code: z.string(),
|
|
136
|
+
secret: z.string(),
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export function recoveryExchangeRequestToJSON(
|
|
140
|
+
recoveryExchangeRequest: RecoveryExchangeRequest,
|
|
141
|
+
): string {
|
|
142
|
+
return JSON.stringify(
|
|
143
|
+
RecoveryExchangeRequest$outboundSchema.parse(recoveryExchangeRequest),
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
export function recoveryExchangeRequestFromJSON(
|
|
147
|
+
jsonString: string,
|
|
148
|
+
): SafeParseResult<RecoveryExchangeRequest, SDKValidationError> {
|
|
149
|
+
return safeParse(
|
|
150
|
+
jsonString,
|
|
151
|
+
(x) => RecoveryExchangeRequest$inboundSchema.parse(JSON.parse(x)),
|
|
152
|
+
`Failed to parse 'RecoveryExchangeRequest' from JSON`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** @internal */
|
|
157
|
+
export const RecoveryExchangeAct$inboundSchema: z.ZodNativeEnum<
|
|
158
|
+
typeof RecoveryExchangeAct
|
|
159
|
+
> = z.nativeEnum(RecoveryExchangeAct);
|
|
160
|
+
/** @internal */
|
|
161
|
+
export const RecoveryExchangeAct$outboundSchema: z.ZodNativeEnum<
|
|
162
|
+
typeof RecoveryExchangeAct
|
|
163
|
+
> = RecoveryExchangeAct$inboundSchema;
|
|
164
|
+
|
|
165
|
+
/** @internal */
|
|
166
|
+
export const RecoveryExchangeDataData$inboundSchema: z.ZodType<
|
|
167
|
+
RecoveryExchangeDataData,
|
|
168
|
+
z.ZodTypeDef,
|
|
169
|
+
unknown
|
|
170
|
+
> = z.object({
|
|
171
|
+
recovery: types.boolean(),
|
|
172
|
+
act: RecoveryExchangeAct$inboundSchema,
|
|
173
|
+
action: types.string(),
|
|
174
|
+
handle: types.string(),
|
|
175
|
+
recovery_id: types.string(),
|
|
176
|
+
recovered_at: types.date(),
|
|
177
|
+
}).transform((v) => {
|
|
178
|
+
return remap$(v, {
|
|
179
|
+
"recovery_id": "recoveryId",
|
|
180
|
+
"recovered_at": "recoveredAt",
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
/** @internal */
|
|
184
|
+
export type RecoveryExchangeDataData$Outbound = {
|
|
185
|
+
recovery: boolean;
|
|
186
|
+
act: string;
|
|
187
|
+
action: string;
|
|
188
|
+
handle: string;
|
|
189
|
+
recovery_id: string;
|
|
190
|
+
recovered_at: string;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/** @internal */
|
|
194
|
+
export const RecoveryExchangeDataData$outboundSchema: z.ZodType<
|
|
195
|
+
RecoveryExchangeDataData$Outbound,
|
|
196
|
+
z.ZodTypeDef,
|
|
197
|
+
RecoveryExchangeDataData
|
|
198
|
+
> = z.object({
|
|
199
|
+
recovery: z.boolean(),
|
|
200
|
+
act: RecoveryExchangeAct$outboundSchema,
|
|
201
|
+
action: z.string(),
|
|
202
|
+
handle: z.string(),
|
|
203
|
+
recoveryId: z.string(),
|
|
204
|
+
recoveredAt: z.date().transform(v => v.toISOString()),
|
|
205
|
+
}).transform((v) => {
|
|
206
|
+
return remap$(v, {
|
|
207
|
+
recoveryId: "recovery_id",
|
|
208
|
+
recoveredAt: "recovered_at",
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
export function recoveryExchangeDataDataToJSON(
|
|
213
|
+
recoveryExchangeDataData: RecoveryExchangeDataData,
|
|
214
|
+
): string {
|
|
215
|
+
return JSON.stringify(
|
|
216
|
+
RecoveryExchangeDataData$outboundSchema.parse(recoveryExchangeDataData),
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
export function recoveryExchangeDataDataFromJSON(
|
|
220
|
+
jsonString: string,
|
|
221
|
+
): SafeParseResult<RecoveryExchangeDataData, SDKValidationError> {
|
|
222
|
+
return safeParse(
|
|
223
|
+
jsonString,
|
|
224
|
+
(x) => RecoveryExchangeDataData$inboundSchema.parse(JSON.parse(x)),
|
|
225
|
+
`Failed to parse 'RecoveryExchangeDataData' from JSON`,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** @internal */
|
|
230
|
+
export const RecoveryExchangeData$inboundSchema: z.ZodType<
|
|
231
|
+
RecoveryExchangeData,
|
|
232
|
+
z.ZodTypeDef,
|
|
233
|
+
unknown
|
|
234
|
+
> = z.object({
|
|
235
|
+
data: types.optional(z.lazy(() => RecoveryExchangeDataData$inboundSchema)),
|
|
236
|
+
error: types.optional(models.ErrorBody$inboundSchema),
|
|
237
|
+
});
|
|
238
|
+
/** @internal */
|
|
239
|
+
export type RecoveryExchangeData$Outbound = {
|
|
240
|
+
data?: RecoveryExchangeDataData$Outbound | undefined;
|
|
241
|
+
error?: models.ErrorBody$Outbound | undefined;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/** @internal */
|
|
245
|
+
export const RecoveryExchangeData$outboundSchema: z.ZodType<
|
|
246
|
+
RecoveryExchangeData$Outbound,
|
|
247
|
+
z.ZodTypeDef,
|
|
248
|
+
RecoveryExchangeData
|
|
249
|
+
> = z.object({
|
|
250
|
+
data: z.lazy(() => RecoveryExchangeDataData$outboundSchema).optional(),
|
|
251
|
+
error: models.ErrorBody$outboundSchema.optional(),
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export function recoveryExchangeDataToJSON(
|
|
255
|
+
recoveryExchangeData: RecoveryExchangeData,
|
|
256
|
+
): string {
|
|
257
|
+
return JSON.stringify(
|
|
258
|
+
RecoveryExchangeData$outboundSchema.parse(recoveryExchangeData),
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
export function recoveryExchangeDataFromJSON(
|
|
262
|
+
jsonString: string,
|
|
263
|
+
): SafeParseResult<RecoveryExchangeData, SDKValidationError> {
|
|
264
|
+
return safeParse(
|
|
265
|
+
jsonString,
|
|
266
|
+
(x) => RecoveryExchangeData$inboundSchema.parse(JSON.parse(x)),
|
|
267
|
+
`Failed to parse 'RecoveryExchangeData' from JSON`,
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** @internal */
|
|
272
|
+
export const RecoveryExchangeResponse$inboundSchema: z.ZodType<
|
|
273
|
+
RecoveryExchangeResponse,
|
|
274
|
+
z.ZodTypeDef,
|
|
275
|
+
unknown
|
|
276
|
+
> = z.object({
|
|
277
|
+
data: z.lazy(() => RecoveryExchangeData$inboundSchema),
|
|
278
|
+
});
|
|
279
|
+
/** @internal */
|
|
280
|
+
export type RecoveryExchangeResponse$Outbound = {
|
|
281
|
+
data: RecoveryExchangeData$Outbound;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/** @internal */
|
|
285
|
+
export const RecoveryExchangeResponse$outboundSchema: z.ZodType<
|
|
286
|
+
RecoveryExchangeResponse$Outbound,
|
|
287
|
+
z.ZodTypeDef,
|
|
288
|
+
RecoveryExchangeResponse
|
|
289
|
+
> = z.object({
|
|
290
|
+
data: z.lazy(() => RecoveryExchangeData$outboundSchema),
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
export function recoveryExchangeResponseToJSON(
|
|
294
|
+
recoveryExchangeResponse: RecoveryExchangeResponse,
|
|
295
|
+
): string {
|
|
296
|
+
return JSON.stringify(
|
|
297
|
+
RecoveryExchangeResponse$outboundSchema.parse(recoveryExchangeResponse),
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
export function recoveryExchangeResponseFromJSON(
|
|
301
|
+
jsonString: string,
|
|
302
|
+
): SafeParseResult<RecoveryExchangeResponse, SDKValidationError> {
|
|
303
|
+
return safeParse(
|
|
304
|
+
jsonString,
|
|
305
|
+
(x) => RecoveryExchangeResponse$inboundSchema.parse(JSON.parse(x)),
|
|
306
|
+
`Failed to parse 'RecoveryExchangeResponse' from JSON`,
|
|
307
|
+
);
|
|
308
|
+
}
|