botshield-sdk 2.0.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -46
- package/bin/mcp-server.js +596 -468
- package/bin/mcp-server.js.map +32 -29
- package/dist/commonjs/funcs/actions-propose-action.d.ts +1 -1
- package/dist/commonjs/funcs/actions-propose-action.js +1 -1
- package/dist/commonjs/funcs/census-get-partner-config.js +2 -78
- package/dist/commonjs/funcs/census-get-partner-config.js.map +1 -1
- package/dist/commonjs/funcs/census-verify-token.d.ts +1 -1
- package/dist/commonjs/funcs/census-verify-token.js +1 -79
- package/dist/commonjs/funcs/census-verify-token.js.map +1 -1
- package/dist/commonjs/funcs/secured-accounts-get-status.d.ts +18 -0
- package/dist/commonjs/funcs/secured-accounts-get-status.d.ts.map +1 -0
- package/dist/commonjs/funcs/secured-accounts-get-status.js +126 -0
- package/dist/commonjs/funcs/secured-accounts-get-status.js.map +1 -0
- package/dist/commonjs/funcs/secured-accounts-list.d.ts +18 -0
- package/dist/commonjs/funcs/secured-accounts-list.d.ts.map +1 -0
- package/dist/commonjs/funcs/secured-accounts-list.js +129 -0
- package/dist/commonjs/funcs/secured-accounts-list.js.map +1 -0
- package/dist/commonjs/funcs/secured-accounts-revoke.d.ts +18 -0
- package/dist/commonjs/funcs/secured-accounts-revoke.d.ts.map +1 -0
- package/dist/commonjs/funcs/secured-accounts-revoke.js +123 -0
- package/dist/commonjs/funcs/secured-accounts-revoke.js.map +1 -0
- package/dist/commonjs/funcs/verification-get-status.js +0 -78
- package/dist/commonjs/funcs/verification-get-status.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +0 -91
- package/dist/commonjs/lib/security.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 +0 -104
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +0 -13
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.js +0 -26
- 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.js +1 -1
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.js +1 -17
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.js +1 -17
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/actions-propose-action.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/actions-propose-action.js +1 -17
- package/dist/commonjs/mcp-server/tools/actions-propose-action.js.map +1 -1
- package/dist/commonjs/models/error-body.d.ts +43 -8
- package/dist/commonjs/models/error-body.d.ts.map +1 -1
- package/dist/commonjs/models/error-body.js +51 -1
- package/dist/commonjs/models/error-body.js.map +1 -1
- package/dist/commonjs/models/operations/actions-cancel.d.ts +1 -1
- package/dist/commonjs/models/operations/actions-check-status.d.ts +6 -6
- package/dist/commonjs/models/operations/actions-check-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/actions-check-status.js +6 -6
- package/dist/commonjs/models/operations/actions-check-status.js.map +1 -1
- package/dist/commonjs/models/operations/actions-propose.d.ts +1 -1
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-session.d.ts +44 -10
- package/dist/commonjs/models/operations/sdk-create-session.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-session.js +32 -11
- package/dist/commonjs/models/operations/sdk-create-session.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +96 -2
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.js +58 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts +23 -27
- package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-get-partner-config.js +18 -26
- package/dist/commonjs/models/operations/sdk-get-partner-config.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-logout.d.ts +1 -1
- package/dist/commonjs/models/operations/sdk-revoke-verification.d.ts +14 -4
- package/dist/commonjs/models/operations/sdk-revoke-verification.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-revoke-verification.js +4 -2
- package/dist/commonjs/models/operations/sdk-revoke-verification.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-store-signal.d.ts +1 -1
- package/dist/commonjs/models/operations/sdk-validate-signal.d.ts +6 -6
- package/dist/commonjs/models/operations/sdk-validate-signal.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-validate-signal.js +6 -6
- package/dist/commonjs/models/operations/sdk-validate-signal.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts +78 -27
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.js +51 -27
- package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/commonjs/models/operations/secured-accounts-list.d.ts +212 -0
- package/dist/commonjs/models/operations/secured-accounts-list.d.ts.map +1 -0
- package/dist/commonjs/models/operations/secured-accounts-list.js +254 -0
- package/dist/commonjs/models/operations/secured-accounts-list.js.map +1 -0
- package/dist/commonjs/models/operations/secured-accounts-revoke.d.ts +130 -0
- package/dist/commonjs/models/operations/secured-accounts-revoke.d.ts.map +1 -0
- package/dist/commonjs/models/operations/secured-accounts-revoke.js +185 -0
- package/dist/commonjs/models/operations/secured-accounts-revoke.js.map +1 -0
- package/dist/commonjs/models/operations/secured-accounts-status.d.ts +97 -0
- package/dist/commonjs/models/operations/secured-accounts-status.d.ts.map +1 -0
- package/dist/commonjs/models/operations/secured-accounts-status.js +163 -0
- package/dist/commonjs/models/operations/secured-accounts-status.js.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts +47 -30
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.js +30 -28
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +0 -26
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +0 -26
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/sdk/actions.d.ts +1 -1
- package/dist/commonjs/sdk/actions.js +1 -1
- package/dist/commonjs/sdk/census.d.ts +1 -1
- package/dist/commonjs/sdk/census.js +1 -1
- 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/commonjs/sdk/secured-accounts.d.ts +26 -0
- package/dist/commonjs/sdk/secured-accounts.d.ts.map +1 -0
- package/dist/commonjs/sdk/secured-accounts.js +42 -0
- package/dist/commonjs/sdk/secured-accounts.js.map +1 -0
- package/dist/esm/funcs/actions-propose-action.d.ts +1 -1
- package/dist/esm/funcs/actions-propose-action.js +1 -1
- package/dist/esm/funcs/census-get-partner-config.js +2 -78
- package/dist/esm/funcs/census-get-partner-config.js.map +1 -1
- package/dist/esm/funcs/census-verify-token.d.ts +1 -1
- package/dist/esm/funcs/census-verify-token.js +1 -79
- package/dist/esm/funcs/census-verify-token.js.map +1 -1
- package/dist/esm/funcs/secured-accounts-get-status.d.ts +18 -0
- package/dist/esm/funcs/secured-accounts-get-status.d.ts.map +1 -0
- package/dist/esm/funcs/secured-accounts-get-status.js +90 -0
- package/dist/esm/funcs/secured-accounts-get-status.js.map +1 -0
- package/dist/esm/funcs/secured-accounts-list.d.ts +18 -0
- package/dist/esm/funcs/secured-accounts-list.d.ts.map +1 -0
- package/dist/esm/funcs/secured-accounts-list.js +93 -0
- package/dist/esm/funcs/secured-accounts-list.js.map +1 -0
- package/dist/esm/funcs/secured-accounts-revoke.d.ts +18 -0
- package/dist/esm/funcs/secured-accounts-revoke.d.ts.map +1 -0
- package/dist/esm/funcs/secured-accounts-revoke.js +87 -0
- package/dist/esm/funcs/secured-accounts-revoke.js.map +1 -0
- package/dist/esm/funcs/verification-get-status.js +0 -78
- package/dist/esm/funcs/verification-get-status.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +0 -91
- package/dist/esm/lib/security.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 +0 -104
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts +0 -13
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.js +0 -26
- 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.js +1 -1
- package/dist/esm/mcp-server/tools/actions-cancel-action.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/actions-cancel-action.js +1 -17
- package/dist/esm/mcp-server/tools/actions-cancel-action.js.map +1 -1
- package/dist/esm/mcp-server/tools/actions-check-action-status.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/actions-check-action-status.js +1 -17
- package/dist/esm/mcp-server/tools/actions-check-action-status.js.map +1 -1
- package/dist/esm/mcp-server/tools/actions-propose-action.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/actions-propose-action.js +1 -17
- package/dist/esm/mcp-server/tools/actions-propose-action.js.map +1 -1
- package/dist/esm/models/error-body.d.ts +43 -8
- package/dist/esm/models/error-body.d.ts.map +1 -1
- package/dist/esm/models/error-body.js +48 -0
- package/dist/esm/models/error-body.js.map +1 -1
- package/dist/esm/models/operations/actions-cancel.d.ts +1 -1
- package/dist/esm/models/operations/actions-check-status.d.ts +6 -6
- package/dist/esm/models/operations/actions-check-status.d.ts.map +1 -1
- package/dist/esm/models/operations/actions-check-status.js +5 -5
- package/dist/esm/models/operations/actions-check-status.js.map +1 -1
- package/dist/esm/models/operations/actions-propose.d.ts +1 -1
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/sdk-create-session.d.ts +44 -10
- package/dist/esm/models/operations/sdk-create-session.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-create-session.js +29 -8
- package/dist/esm/models/operations/sdk-create-session.js.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts +96 -2
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.js +57 -0
- package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/esm/models/operations/sdk-get-partner-config.d.ts +23 -27
- package/dist/esm/models/operations/sdk-get-partner-config.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-get-partner-config.js +18 -26
- package/dist/esm/models/operations/sdk-get-partner-config.js.map +1 -1
- package/dist/esm/models/operations/sdk-logout.d.ts +1 -1
- package/dist/esm/models/operations/sdk-revoke-verification.d.ts +14 -4
- package/dist/esm/models/operations/sdk-revoke-verification.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-revoke-verification.js +4 -2
- package/dist/esm/models/operations/sdk-revoke-verification.js.map +1 -1
- package/dist/esm/models/operations/sdk-store-signal.d.ts +1 -1
- package/dist/esm/models/operations/sdk-validate-signal.d.ts +6 -6
- package/dist/esm/models/operations/sdk-validate-signal.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-validate-signal.js +5 -5
- package/dist/esm/models/operations/sdk-validate-signal.js.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.d.ts +78 -27
- package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.js +50 -26
- package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/esm/models/operations/secured-accounts-list.d.ts +212 -0
- package/dist/esm/models/operations/secured-accounts-list.d.ts.map +1 -0
- package/dist/esm/models/operations/secured-accounts-list.js +206 -0
- package/dist/esm/models/operations/secured-accounts-list.js.map +1 -0
- package/dist/esm/models/operations/secured-accounts-revoke.d.ts +130 -0
- package/dist/esm/models/operations/secured-accounts-revoke.d.ts.map +1 -0
- package/dist/esm/models/operations/secured-accounts-revoke.js +139 -0
- package/dist/esm/models/operations/secured-accounts-revoke.js.map +1 -0
- package/dist/esm/models/operations/secured-accounts-status.d.ts +97 -0
- package/dist/esm/models/operations/secured-accounts-status.d.ts.map +1 -0
- package/dist/esm/models/operations/secured-accounts-status.js +117 -0
- package/dist/esm/models/operations/secured-accounts-status.js.map +1 -0
- package/dist/esm/models/operations/verification-get-status.d.ts +47 -30
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/esm/models/operations/verification-get-status.js +29 -27
- package/dist/esm/models/operations/verification-get-status.js.map +1 -1
- package/dist/esm/models/security.d.ts +0 -26
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +0 -26
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/sdk/actions.d.ts +1 -1
- package/dist/esm/sdk/actions.js +1 -1
- package/dist/esm/sdk/census.d.ts +1 -1
- package/dist/esm/sdk/census.js +1 -1
- 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/dist/esm/sdk/secured-accounts.d.ts +26 -0
- package/dist/esm/sdk/secured-accounts.d.ts.map +1 -0
- package/dist/esm/sdk/secured-accounts.js +38 -0
- package/dist/esm/sdk/secured-accounts.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/actions-propose-action.ts +1 -1
- package/src/funcs/census-get-partner-config.ts +2 -91
- package/src/funcs/census-verify-token.ts +1 -92
- package/src/funcs/secured-accounts-get-status.ts +189 -0
- package/src/funcs/secured-accounts-list.ts +194 -0
- package/src/funcs/secured-accounts-revoke.ts +185 -0
- package/src/funcs/verification-get-status.ts +0 -91
- package/src/lib/config.ts +2 -2
- package/src/lib/security.ts +0 -91
- package/src/mcp-server/cli/start/command.ts +0 -104
- package/src/mcp-server/cli/start/impl.ts +0 -39
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/actions-cancel-action.ts +1 -17
- package/src/mcp-server/tools/actions-check-action-status.ts +1 -17
- package/src/mcp-server/tools/actions-propose-action.ts +1 -17
- package/src/models/error-body.ts +95 -8
- package/src/models/operations/actions-cancel.ts +1 -1
- package/src/models/operations/actions-check-status.ts +18 -10
- package/src/models/operations/actions-propose.ts +1 -1
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/sdk-create-session.ts +78 -20
- package/src/models/operations/sdk-create-verification-link.ts +157 -2
- package/src/models/operations/sdk-get-partner-config.ts +41 -53
- package/src/models/operations/sdk-logout.ts +1 -1
- package/src/models/operations/sdk-revoke-verification.ts +18 -6
- package/src/models/operations/sdk-store-signal.ts +1 -1
- package/src/models/operations/sdk-validate-signal.ts +16 -10
- package/src/models/operations/sdk-verify-token.ts +119 -53
- package/src/models/operations/secured-accounts-list.ts +507 -0
- package/src/models/operations/secured-accounts-revoke.ts +359 -0
- package/src/models/operations/secured-accounts-status.ts +296 -0
- package/src/models/operations/verification-get-status.ts +73 -56
- package/src/models/security.ts +0 -52
- package/src/sdk/actions.ts +1 -1
- package/src/sdk/census.ts +1 -1
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/secured-accounts.ts +69 -0
|
@@ -0,0 +1,359 @@
|
|
|
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 SecuredAccountsRevokeSecurity = {
|
|
16
|
+
apiKeyAuth: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Default `platform`.
|
|
21
|
+
*/
|
|
22
|
+
export const SecuredAccountsRevokeReason = {
|
|
23
|
+
Platform: "platform",
|
|
24
|
+
CredentialChanged: "credential_changed",
|
|
25
|
+
} as const;
|
|
26
|
+
/**
|
|
27
|
+
* Default `platform`.
|
|
28
|
+
*/
|
|
29
|
+
export type SecuredAccountsRevokeReason = ClosedEnum<
|
|
30
|
+
typeof SecuredAccountsRevokeReason
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export type SecuredAccountsRevokeRequest = {
|
|
34
|
+
/**
|
|
35
|
+
* Your stable user id for the account (the same `platform_user_ref` you passed when it was secured). Hashed server-side; never stored or returned. Send this OR `handle`.
|
|
36
|
+
*/
|
|
37
|
+
platformUserRef?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The Secured Account handle — your per-platform reference for the person, the same value carried on `account.secured` / `account.unlinked`. Send this OR `platform_user_ref`.
|
|
40
|
+
*/
|
|
41
|
+
handle?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Default `platform`.
|
|
44
|
+
*/
|
|
45
|
+
reason?: SecuredAccountsRevokeReason | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const SecuredAccountsRevokeUnlinkReason = {
|
|
49
|
+
CredentialChanged: "credential_changed",
|
|
50
|
+
Platform: "platform",
|
|
51
|
+
} as const;
|
|
52
|
+
export type SecuredAccountsRevokeUnlinkReason = OpenEnum<
|
|
53
|
+
typeof SecuredAccountsRevokeUnlinkReason
|
|
54
|
+
>;
|
|
55
|
+
|
|
56
|
+
export type SecuredAccountsRevokeDataData = {
|
|
57
|
+
success: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* false when no active Secured Account matched (idempotent).
|
|
60
|
+
*/
|
|
61
|
+
revoked: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The revoked account's handle; null when nothing was revoked.
|
|
64
|
+
*/
|
|
65
|
+
handle: string | null;
|
|
66
|
+
unlinkedAt: Date | null;
|
|
67
|
+
unlinkReason: SecuredAccountsRevokeUnlinkReason | null;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type SecuredAccountsRevokeData = {
|
|
71
|
+
data?: SecuredAccountsRevokeDataData | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Handler error. Arrives inside `data.error` with HTTP 200. Check for it before reading the result.
|
|
74
|
+
*/
|
|
75
|
+
error?: models.ErrorBody | undefined;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Result. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `api_key_required` / `invalid_api_key` (401), `partner_not_found` (403), `ref_or_handle_required` / `invalid_platform_user_ref` / `invalid_handle` / `invalid_reason` (400), `revoke_failed` (500).
|
|
80
|
+
*/
|
|
81
|
+
export type SecuredAccountsRevokeResponse = {
|
|
82
|
+
data: SecuredAccountsRevokeData;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const SecuredAccountsRevokeSecurity$inboundSchema: z.ZodType<
|
|
87
|
+
SecuredAccountsRevokeSecurity,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
unknown
|
|
90
|
+
> = z.object({
|
|
91
|
+
ApiKeyAuth: types.string(),
|
|
92
|
+
}).transform((v) => {
|
|
93
|
+
return remap$(v, {
|
|
94
|
+
"ApiKeyAuth": "apiKeyAuth",
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
/** @internal */
|
|
98
|
+
export type SecuredAccountsRevokeSecurity$Outbound = {
|
|
99
|
+
ApiKeyAuth: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** @internal */
|
|
103
|
+
export const SecuredAccountsRevokeSecurity$outboundSchema: z.ZodType<
|
|
104
|
+
SecuredAccountsRevokeSecurity$Outbound,
|
|
105
|
+
z.ZodTypeDef,
|
|
106
|
+
SecuredAccountsRevokeSecurity
|
|
107
|
+
> = z.object({
|
|
108
|
+
apiKeyAuth: z.string(),
|
|
109
|
+
}).transform((v) => {
|
|
110
|
+
return remap$(v, {
|
|
111
|
+
apiKeyAuth: "ApiKeyAuth",
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
export function securedAccountsRevokeSecurityToJSON(
|
|
116
|
+
securedAccountsRevokeSecurity: SecuredAccountsRevokeSecurity,
|
|
117
|
+
): string {
|
|
118
|
+
return JSON.stringify(
|
|
119
|
+
SecuredAccountsRevokeSecurity$outboundSchema.parse(
|
|
120
|
+
securedAccountsRevokeSecurity,
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
export function securedAccountsRevokeSecurityFromJSON(
|
|
125
|
+
jsonString: string,
|
|
126
|
+
): SafeParseResult<SecuredAccountsRevokeSecurity, SDKValidationError> {
|
|
127
|
+
return safeParse(
|
|
128
|
+
jsonString,
|
|
129
|
+
(x) => SecuredAccountsRevokeSecurity$inboundSchema.parse(JSON.parse(x)),
|
|
130
|
+
`Failed to parse 'SecuredAccountsRevokeSecurity' from JSON`,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** @internal */
|
|
135
|
+
export const SecuredAccountsRevokeReason$inboundSchema: z.ZodNativeEnum<
|
|
136
|
+
typeof SecuredAccountsRevokeReason
|
|
137
|
+
> = z.nativeEnum(SecuredAccountsRevokeReason);
|
|
138
|
+
/** @internal */
|
|
139
|
+
export const SecuredAccountsRevokeReason$outboundSchema: z.ZodNativeEnum<
|
|
140
|
+
typeof SecuredAccountsRevokeReason
|
|
141
|
+
> = SecuredAccountsRevokeReason$inboundSchema;
|
|
142
|
+
|
|
143
|
+
/** @internal */
|
|
144
|
+
export const SecuredAccountsRevokeRequest$inboundSchema: z.ZodType<
|
|
145
|
+
SecuredAccountsRevokeRequest,
|
|
146
|
+
z.ZodTypeDef,
|
|
147
|
+
unknown
|
|
148
|
+
> = z.object({
|
|
149
|
+
platform_user_ref: types.optional(types.string()),
|
|
150
|
+
handle: types.optional(types.string()),
|
|
151
|
+
reason: types.optional(SecuredAccountsRevokeReason$inboundSchema),
|
|
152
|
+
}).transform((v) => {
|
|
153
|
+
return remap$(v, {
|
|
154
|
+
"platform_user_ref": "platformUserRef",
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
/** @internal */
|
|
158
|
+
export type SecuredAccountsRevokeRequest$Outbound = {
|
|
159
|
+
platform_user_ref?: string | undefined;
|
|
160
|
+
handle?: string | undefined;
|
|
161
|
+
reason?: string | undefined;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/** @internal */
|
|
165
|
+
export const SecuredAccountsRevokeRequest$outboundSchema: z.ZodType<
|
|
166
|
+
SecuredAccountsRevokeRequest$Outbound,
|
|
167
|
+
z.ZodTypeDef,
|
|
168
|
+
SecuredAccountsRevokeRequest
|
|
169
|
+
> = z.object({
|
|
170
|
+
platformUserRef: z.string().optional(),
|
|
171
|
+
handle: z.string().optional(),
|
|
172
|
+
reason: SecuredAccountsRevokeReason$outboundSchema.optional(),
|
|
173
|
+
}).transform((v) => {
|
|
174
|
+
return remap$(v, {
|
|
175
|
+
platformUserRef: "platform_user_ref",
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
export function securedAccountsRevokeRequestToJSON(
|
|
180
|
+
securedAccountsRevokeRequest: SecuredAccountsRevokeRequest,
|
|
181
|
+
): string {
|
|
182
|
+
return JSON.stringify(
|
|
183
|
+
SecuredAccountsRevokeRequest$outboundSchema.parse(
|
|
184
|
+
securedAccountsRevokeRequest,
|
|
185
|
+
),
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
export function securedAccountsRevokeRequestFromJSON(
|
|
189
|
+
jsonString: string,
|
|
190
|
+
): SafeParseResult<SecuredAccountsRevokeRequest, SDKValidationError> {
|
|
191
|
+
return safeParse(
|
|
192
|
+
jsonString,
|
|
193
|
+
(x) => SecuredAccountsRevokeRequest$inboundSchema.parse(JSON.parse(x)),
|
|
194
|
+
`Failed to parse 'SecuredAccountsRevokeRequest' from JSON`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** @internal */
|
|
199
|
+
export const SecuredAccountsRevokeUnlinkReason$inboundSchema: z.ZodType<
|
|
200
|
+
SecuredAccountsRevokeUnlinkReason,
|
|
201
|
+
z.ZodTypeDef,
|
|
202
|
+
unknown
|
|
203
|
+
> = openEnums.inboundSchema(SecuredAccountsRevokeUnlinkReason);
|
|
204
|
+
/** @internal */
|
|
205
|
+
export const SecuredAccountsRevokeUnlinkReason$outboundSchema: z.ZodType<
|
|
206
|
+
string,
|
|
207
|
+
z.ZodTypeDef,
|
|
208
|
+
SecuredAccountsRevokeUnlinkReason
|
|
209
|
+
> = openEnums.outboundSchema(SecuredAccountsRevokeUnlinkReason);
|
|
210
|
+
|
|
211
|
+
/** @internal */
|
|
212
|
+
export const SecuredAccountsRevokeDataData$inboundSchema: z.ZodType<
|
|
213
|
+
SecuredAccountsRevokeDataData,
|
|
214
|
+
z.ZodTypeDef,
|
|
215
|
+
unknown
|
|
216
|
+
> = z.object({
|
|
217
|
+
success: types.boolean(),
|
|
218
|
+
revoked: types.boolean(),
|
|
219
|
+
handle: types.nullable(types.string()),
|
|
220
|
+
unlinked_at: types.nullable(types.date()),
|
|
221
|
+
unlink_reason: types.nullable(
|
|
222
|
+
SecuredAccountsRevokeUnlinkReason$inboundSchema,
|
|
223
|
+
),
|
|
224
|
+
}).transform((v) => {
|
|
225
|
+
return remap$(v, {
|
|
226
|
+
"unlinked_at": "unlinkedAt",
|
|
227
|
+
"unlink_reason": "unlinkReason",
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
/** @internal */
|
|
231
|
+
export type SecuredAccountsRevokeDataData$Outbound = {
|
|
232
|
+
success: boolean;
|
|
233
|
+
revoked: boolean;
|
|
234
|
+
handle: string | null;
|
|
235
|
+
unlinked_at: string | null;
|
|
236
|
+
unlink_reason: string | null;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
/** @internal */
|
|
240
|
+
export const SecuredAccountsRevokeDataData$outboundSchema: z.ZodType<
|
|
241
|
+
SecuredAccountsRevokeDataData$Outbound,
|
|
242
|
+
z.ZodTypeDef,
|
|
243
|
+
SecuredAccountsRevokeDataData
|
|
244
|
+
> = z.object({
|
|
245
|
+
success: z.boolean(),
|
|
246
|
+
revoked: z.boolean(),
|
|
247
|
+
handle: z.nullable(z.string()),
|
|
248
|
+
unlinkedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
249
|
+
unlinkReason: z.nullable(SecuredAccountsRevokeUnlinkReason$outboundSchema),
|
|
250
|
+
}).transform((v) => {
|
|
251
|
+
return remap$(v, {
|
|
252
|
+
unlinkedAt: "unlinked_at",
|
|
253
|
+
unlinkReason: "unlink_reason",
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
export function securedAccountsRevokeDataDataToJSON(
|
|
258
|
+
securedAccountsRevokeDataData: SecuredAccountsRevokeDataData,
|
|
259
|
+
): string {
|
|
260
|
+
return JSON.stringify(
|
|
261
|
+
SecuredAccountsRevokeDataData$outboundSchema.parse(
|
|
262
|
+
securedAccountsRevokeDataData,
|
|
263
|
+
),
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
export function securedAccountsRevokeDataDataFromJSON(
|
|
267
|
+
jsonString: string,
|
|
268
|
+
): SafeParseResult<SecuredAccountsRevokeDataData, SDKValidationError> {
|
|
269
|
+
return safeParse(
|
|
270
|
+
jsonString,
|
|
271
|
+
(x) => SecuredAccountsRevokeDataData$inboundSchema.parse(JSON.parse(x)),
|
|
272
|
+
`Failed to parse 'SecuredAccountsRevokeDataData' from JSON`,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** @internal */
|
|
277
|
+
export const SecuredAccountsRevokeData$inboundSchema: z.ZodType<
|
|
278
|
+
SecuredAccountsRevokeData,
|
|
279
|
+
z.ZodTypeDef,
|
|
280
|
+
unknown
|
|
281
|
+
> = z.object({
|
|
282
|
+
data: types.optional(
|
|
283
|
+
z.lazy(() => SecuredAccountsRevokeDataData$inboundSchema),
|
|
284
|
+
),
|
|
285
|
+
error: types.optional(models.ErrorBody$inboundSchema),
|
|
286
|
+
});
|
|
287
|
+
/** @internal */
|
|
288
|
+
export type SecuredAccountsRevokeData$Outbound = {
|
|
289
|
+
data?: SecuredAccountsRevokeDataData$Outbound | undefined;
|
|
290
|
+
error?: models.ErrorBody$Outbound | undefined;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/** @internal */
|
|
294
|
+
export const SecuredAccountsRevokeData$outboundSchema: z.ZodType<
|
|
295
|
+
SecuredAccountsRevokeData$Outbound,
|
|
296
|
+
z.ZodTypeDef,
|
|
297
|
+
SecuredAccountsRevokeData
|
|
298
|
+
> = z.object({
|
|
299
|
+
data: z.lazy(() => SecuredAccountsRevokeDataData$outboundSchema).optional(),
|
|
300
|
+
error: models.ErrorBody$outboundSchema.optional(),
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
export function securedAccountsRevokeDataToJSON(
|
|
304
|
+
securedAccountsRevokeData: SecuredAccountsRevokeData,
|
|
305
|
+
): string {
|
|
306
|
+
return JSON.stringify(
|
|
307
|
+
SecuredAccountsRevokeData$outboundSchema.parse(securedAccountsRevokeData),
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
export function securedAccountsRevokeDataFromJSON(
|
|
311
|
+
jsonString: string,
|
|
312
|
+
): SafeParseResult<SecuredAccountsRevokeData, SDKValidationError> {
|
|
313
|
+
return safeParse(
|
|
314
|
+
jsonString,
|
|
315
|
+
(x) => SecuredAccountsRevokeData$inboundSchema.parse(JSON.parse(x)),
|
|
316
|
+
`Failed to parse 'SecuredAccountsRevokeData' from JSON`,
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** @internal */
|
|
321
|
+
export const SecuredAccountsRevokeResponse$inboundSchema: z.ZodType<
|
|
322
|
+
SecuredAccountsRevokeResponse,
|
|
323
|
+
z.ZodTypeDef,
|
|
324
|
+
unknown
|
|
325
|
+
> = z.object({
|
|
326
|
+
data: z.lazy(() => SecuredAccountsRevokeData$inboundSchema),
|
|
327
|
+
});
|
|
328
|
+
/** @internal */
|
|
329
|
+
export type SecuredAccountsRevokeResponse$Outbound = {
|
|
330
|
+
data: SecuredAccountsRevokeData$Outbound;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
/** @internal */
|
|
334
|
+
export const SecuredAccountsRevokeResponse$outboundSchema: z.ZodType<
|
|
335
|
+
SecuredAccountsRevokeResponse$Outbound,
|
|
336
|
+
z.ZodTypeDef,
|
|
337
|
+
SecuredAccountsRevokeResponse
|
|
338
|
+
> = z.object({
|
|
339
|
+
data: z.lazy(() => SecuredAccountsRevokeData$outboundSchema),
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
export function securedAccountsRevokeResponseToJSON(
|
|
343
|
+
securedAccountsRevokeResponse: SecuredAccountsRevokeResponse,
|
|
344
|
+
): string {
|
|
345
|
+
return JSON.stringify(
|
|
346
|
+
SecuredAccountsRevokeResponse$outboundSchema.parse(
|
|
347
|
+
securedAccountsRevokeResponse,
|
|
348
|
+
),
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
export function securedAccountsRevokeResponseFromJSON(
|
|
352
|
+
jsonString: string,
|
|
353
|
+
): SafeParseResult<SecuredAccountsRevokeResponse, SDKValidationError> {
|
|
354
|
+
return safeParse(
|
|
355
|
+
jsonString,
|
|
356
|
+
(x) => SecuredAccountsRevokeResponse$inboundSchema.parse(JSON.parse(x)),
|
|
357
|
+
`Failed to parse 'SecuredAccountsRevokeResponse' from JSON`,
|
|
358
|
+
);
|
|
359
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
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 SecuredAccountsStatusSecurity = {
|
|
16
|
+
apiKeyAuth: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type SecuredAccountsStatusRequest = {
|
|
20
|
+
/**
|
|
21
|
+
* Your stable user id for the account (the same `platform_user_ref` you passed when it was secured). Hashed server-side; never stored or returned. Must be a stable id, not an email address.
|
|
22
|
+
*/
|
|
23
|
+
platformUserRef: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const State = {
|
|
27
|
+
None: "none",
|
|
28
|
+
Fresh: "fresh",
|
|
29
|
+
Stale: "stale",
|
|
30
|
+
} as const;
|
|
31
|
+
export type State = OpenEnum<typeof State>;
|
|
32
|
+
|
|
33
|
+
export type SecuredAccountsStatusDataData = {
|
|
34
|
+
state: State;
|
|
35
|
+
/**
|
|
36
|
+
* When recent presence lapses (in the past when `stale`); null when `none`.
|
|
37
|
+
*/
|
|
38
|
+
freshUntil: Date | null;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type SecuredAccountsStatusData = {
|
|
42
|
+
data?: SecuredAccountsStatusDataData | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Handler error. Arrives inside `data.error` with HTTP 200. Check for it before reading the result.
|
|
45
|
+
*/
|
|
46
|
+
error?: models.ErrorBody | undefined;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Current state. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `api_key_required` / `invalid_api_key` (401), `partner_not_found` (403), `presence_requires_user_ref` / `notarize_ref_must_be_stable` (400), `presence_unavailable` (503, retry).
|
|
51
|
+
*/
|
|
52
|
+
export type SecuredAccountsStatusResponse = {
|
|
53
|
+
data: SecuredAccountsStatusData;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const SecuredAccountsStatusSecurity$inboundSchema: z.ZodType<
|
|
58
|
+
SecuredAccountsStatusSecurity,
|
|
59
|
+
z.ZodTypeDef,
|
|
60
|
+
unknown
|
|
61
|
+
> = z.object({
|
|
62
|
+
ApiKeyAuth: types.string(),
|
|
63
|
+
}).transform((v) => {
|
|
64
|
+
return remap$(v, {
|
|
65
|
+
"ApiKeyAuth": "apiKeyAuth",
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type SecuredAccountsStatusSecurity$Outbound = {
|
|
70
|
+
ApiKeyAuth: string;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const SecuredAccountsStatusSecurity$outboundSchema: z.ZodType<
|
|
75
|
+
SecuredAccountsStatusSecurity$Outbound,
|
|
76
|
+
z.ZodTypeDef,
|
|
77
|
+
SecuredAccountsStatusSecurity
|
|
78
|
+
> = z.object({
|
|
79
|
+
apiKeyAuth: z.string(),
|
|
80
|
+
}).transform((v) => {
|
|
81
|
+
return remap$(v, {
|
|
82
|
+
apiKeyAuth: "ApiKeyAuth",
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export function securedAccountsStatusSecurityToJSON(
|
|
87
|
+
securedAccountsStatusSecurity: SecuredAccountsStatusSecurity,
|
|
88
|
+
): string {
|
|
89
|
+
return JSON.stringify(
|
|
90
|
+
SecuredAccountsStatusSecurity$outboundSchema.parse(
|
|
91
|
+
securedAccountsStatusSecurity,
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
export function securedAccountsStatusSecurityFromJSON(
|
|
96
|
+
jsonString: string,
|
|
97
|
+
): SafeParseResult<SecuredAccountsStatusSecurity, SDKValidationError> {
|
|
98
|
+
return safeParse(
|
|
99
|
+
jsonString,
|
|
100
|
+
(x) => SecuredAccountsStatusSecurity$inboundSchema.parse(JSON.parse(x)),
|
|
101
|
+
`Failed to parse 'SecuredAccountsStatusSecurity' from JSON`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const SecuredAccountsStatusRequest$inboundSchema: z.ZodType<
|
|
107
|
+
SecuredAccountsStatusRequest,
|
|
108
|
+
z.ZodTypeDef,
|
|
109
|
+
unknown
|
|
110
|
+
> = z.object({
|
|
111
|
+
platform_user_ref: types.string(),
|
|
112
|
+
}).transform((v) => {
|
|
113
|
+
return remap$(v, {
|
|
114
|
+
"platform_user_ref": "platformUserRef",
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
/** @internal */
|
|
118
|
+
export type SecuredAccountsStatusRequest$Outbound = {
|
|
119
|
+
platform_user_ref: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export const SecuredAccountsStatusRequest$outboundSchema: z.ZodType<
|
|
124
|
+
SecuredAccountsStatusRequest$Outbound,
|
|
125
|
+
z.ZodTypeDef,
|
|
126
|
+
SecuredAccountsStatusRequest
|
|
127
|
+
> = z.object({
|
|
128
|
+
platformUserRef: z.string(),
|
|
129
|
+
}).transform((v) => {
|
|
130
|
+
return remap$(v, {
|
|
131
|
+
platformUserRef: "platform_user_ref",
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export function securedAccountsStatusRequestToJSON(
|
|
136
|
+
securedAccountsStatusRequest: SecuredAccountsStatusRequest,
|
|
137
|
+
): string {
|
|
138
|
+
return JSON.stringify(
|
|
139
|
+
SecuredAccountsStatusRequest$outboundSchema.parse(
|
|
140
|
+
securedAccountsStatusRequest,
|
|
141
|
+
),
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
export function securedAccountsStatusRequestFromJSON(
|
|
145
|
+
jsonString: string,
|
|
146
|
+
): SafeParseResult<SecuredAccountsStatusRequest, SDKValidationError> {
|
|
147
|
+
return safeParse(
|
|
148
|
+
jsonString,
|
|
149
|
+
(x) => SecuredAccountsStatusRequest$inboundSchema.parse(JSON.parse(x)),
|
|
150
|
+
`Failed to parse 'SecuredAccountsStatusRequest' from JSON`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** @internal */
|
|
155
|
+
export const State$inboundSchema: z.ZodType<State, z.ZodTypeDef, unknown> =
|
|
156
|
+
openEnums.inboundSchema(State);
|
|
157
|
+
/** @internal */
|
|
158
|
+
export const State$outboundSchema: z.ZodType<string, z.ZodTypeDef, State> =
|
|
159
|
+
openEnums.outboundSchema(State);
|
|
160
|
+
|
|
161
|
+
/** @internal */
|
|
162
|
+
export const SecuredAccountsStatusDataData$inboundSchema: z.ZodType<
|
|
163
|
+
SecuredAccountsStatusDataData,
|
|
164
|
+
z.ZodTypeDef,
|
|
165
|
+
unknown
|
|
166
|
+
> = z.object({
|
|
167
|
+
state: State$inboundSchema,
|
|
168
|
+
fresh_until: types.nullable(types.date()),
|
|
169
|
+
}).transform((v) => {
|
|
170
|
+
return remap$(v, {
|
|
171
|
+
"fresh_until": "freshUntil",
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
/** @internal */
|
|
175
|
+
export type SecuredAccountsStatusDataData$Outbound = {
|
|
176
|
+
state: string;
|
|
177
|
+
fresh_until: string | null;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** @internal */
|
|
181
|
+
export const SecuredAccountsStatusDataData$outboundSchema: z.ZodType<
|
|
182
|
+
SecuredAccountsStatusDataData$Outbound,
|
|
183
|
+
z.ZodTypeDef,
|
|
184
|
+
SecuredAccountsStatusDataData
|
|
185
|
+
> = z.object({
|
|
186
|
+
state: State$outboundSchema,
|
|
187
|
+
freshUntil: z.nullable(z.date().transform(v => v.toISOString())),
|
|
188
|
+
}).transform((v) => {
|
|
189
|
+
return remap$(v, {
|
|
190
|
+
freshUntil: "fresh_until",
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
export function securedAccountsStatusDataDataToJSON(
|
|
195
|
+
securedAccountsStatusDataData: SecuredAccountsStatusDataData,
|
|
196
|
+
): string {
|
|
197
|
+
return JSON.stringify(
|
|
198
|
+
SecuredAccountsStatusDataData$outboundSchema.parse(
|
|
199
|
+
securedAccountsStatusDataData,
|
|
200
|
+
),
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
export function securedAccountsStatusDataDataFromJSON(
|
|
204
|
+
jsonString: string,
|
|
205
|
+
): SafeParseResult<SecuredAccountsStatusDataData, SDKValidationError> {
|
|
206
|
+
return safeParse(
|
|
207
|
+
jsonString,
|
|
208
|
+
(x) => SecuredAccountsStatusDataData$inboundSchema.parse(JSON.parse(x)),
|
|
209
|
+
`Failed to parse 'SecuredAccountsStatusDataData' from JSON`,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** @internal */
|
|
214
|
+
export const SecuredAccountsStatusData$inboundSchema: z.ZodType<
|
|
215
|
+
SecuredAccountsStatusData,
|
|
216
|
+
z.ZodTypeDef,
|
|
217
|
+
unknown
|
|
218
|
+
> = z.object({
|
|
219
|
+
data: types.optional(
|
|
220
|
+
z.lazy(() => SecuredAccountsStatusDataData$inboundSchema),
|
|
221
|
+
),
|
|
222
|
+
error: types.optional(models.ErrorBody$inboundSchema),
|
|
223
|
+
});
|
|
224
|
+
/** @internal */
|
|
225
|
+
export type SecuredAccountsStatusData$Outbound = {
|
|
226
|
+
data?: SecuredAccountsStatusDataData$Outbound | undefined;
|
|
227
|
+
error?: models.ErrorBody$Outbound | undefined;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/** @internal */
|
|
231
|
+
export const SecuredAccountsStatusData$outboundSchema: z.ZodType<
|
|
232
|
+
SecuredAccountsStatusData$Outbound,
|
|
233
|
+
z.ZodTypeDef,
|
|
234
|
+
SecuredAccountsStatusData
|
|
235
|
+
> = z.object({
|
|
236
|
+
data: z.lazy(() => SecuredAccountsStatusDataData$outboundSchema).optional(),
|
|
237
|
+
error: models.ErrorBody$outboundSchema.optional(),
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
export function securedAccountsStatusDataToJSON(
|
|
241
|
+
securedAccountsStatusData: SecuredAccountsStatusData,
|
|
242
|
+
): string {
|
|
243
|
+
return JSON.stringify(
|
|
244
|
+
SecuredAccountsStatusData$outboundSchema.parse(securedAccountsStatusData),
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
export function securedAccountsStatusDataFromJSON(
|
|
248
|
+
jsonString: string,
|
|
249
|
+
): SafeParseResult<SecuredAccountsStatusData, SDKValidationError> {
|
|
250
|
+
return safeParse(
|
|
251
|
+
jsonString,
|
|
252
|
+
(x) => SecuredAccountsStatusData$inboundSchema.parse(JSON.parse(x)),
|
|
253
|
+
`Failed to parse 'SecuredAccountsStatusData' from JSON`,
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** @internal */
|
|
258
|
+
export const SecuredAccountsStatusResponse$inboundSchema: z.ZodType<
|
|
259
|
+
SecuredAccountsStatusResponse,
|
|
260
|
+
z.ZodTypeDef,
|
|
261
|
+
unknown
|
|
262
|
+
> = z.object({
|
|
263
|
+
data: z.lazy(() => SecuredAccountsStatusData$inboundSchema),
|
|
264
|
+
});
|
|
265
|
+
/** @internal */
|
|
266
|
+
export type SecuredAccountsStatusResponse$Outbound = {
|
|
267
|
+
data: SecuredAccountsStatusData$Outbound;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/** @internal */
|
|
271
|
+
export const SecuredAccountsStatusResponse$outboundSchema: z.ZodType<
|
|
272
|
+
SecuredAccountsStatusResponse$Outbound,
|
|
273
|
+
z.ZodTypeDef,
|
|
274
|
+
SecuredAccountsStatusResponse
|
|
275
|
+
> = z.object({
|
|
276
|
+
data: z.lazy(() => SecuredAccountsStatusData$outboundSchema),
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
export function securedAccountsStatusResponseToJSON(
|
|
280
|
+
securedAccountsStatusResponse: SecuredAccountsStatusResponse,
|
|
281
|
+
): string {
|
|
282
|
+
return JSON.stringify(
|
|
283
|
+
SecuredAccountsStatusResponse$outboundSchema.parse(
|
|
284
|
+
securedAccountsStatusResponse,
|
|
285
|
+
),
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
export function securedAccountsStatusResponseFromJSON(
|
|
289
|
+
jsonString: string,
|
|
290
|
+
): SafeParseResult<SecuredAccountsStatusResponse, SDKValidationError> {
|
|
291
|
+
return safeParse(
|
|
292
|
+
jsonString,
|
|
293
|
+
(x) => SecuredAccountsStatusResponse$inboundSchema.parse(JSON.parse(x)),
|
|
294
|
+
`Failed to parse 'SecuredAccountsStatusResponse' from JSON`,
|
|
295
|
+
);
|
|
296
|
+
}
|