From 30cb7e8eed29bb3b79f68c8b82973da5356bb765 Mon Sep 17 00:00:00 2001 From: Andrew Min Date: Mon, 22 Apr 2024 15:52:03 -0400 Subject: [PATCH] fix server tests --- packages/sdk-server/package.json | 3 +- packages/sdk-server/scripts/codegen.js | 2 + .../src/__generated__/sdk-client-base.ts | 1188 +++++++---------- .../src/__generated__/sdk_api_types.ts | 541 ++------ .../sdk-server/src/__tests__/request-test.ts | 15 +- 5 files changed, 623 insertions(+), 1126 deletions(-) diff --git a/packages/sdk-server/package.json b/packages/sdk-server/package.json index 5a5415546..ebfbd3723 100644 --- a/packages/sdk-server/package.json +++ b/packages/sdk-server/package.json @@ -41,7 +41,8 @@ "version": "node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').name + '@' + require('./package.json').version) + ';'\" > src/__generated__/version.ts", "build": "rollup -c", "clean": "rimraf ./dist ./.cache", - "typecheck": "tsc -p tsconfig.typecheck.json" + "typecheck": "tsc -p tsconfig.typecheck.json", + "test": "jest" }, "dependencies": { "cross-fetch": "^3.1.5", diff --git a/packages/sdk-server/scripts/codegen.js b/packages/sdk-server/scripts/codegen.js index ce504c8c2..97b829078 100644 --- a/packages/sdk-server/scripts/codegen.js +++ b/packages/sdk-server/scripts/codegen.js @@ -248,6 +248,8 @@ const generateSDKClientFromSwagger = async (swaggerSpec, targetPath) => { imports.push('import type * as SdkApiTypes from "./sdk_api_types";'); + imports.push('import { fetch } from "../universal";'); + codeBuffer.push(` export class TurnkeySDKClientBase { config: TurnkeySDKClientConfig; diff --git a/packages/sdk-server/src/__generated__/sdk-client-base.ts b/packages/sdk-server/src/__generated__/sdk-client-base.ts index cb379ef5b..5e927a83b 100644 --- a/packages/sdk-server/src/__generated__/sdk-client-base.ts +++ b/packages/sdk-server/src/__generated__/sdk-client-base.ts @@ -1,16 +1,14 @@ /* @generated by codegen. DO NOT EDIT BY HAND */ -import { - GrpcStatus, - TurnkeyRequestError, - ActivityResponse, - TurnkeySDKClientConfig, -} from "../__types__/base"; +import { GrpcStatus, TurnkeyRequestError, ActivityResponse, TurnkeySDKClientConfig } from "../__types__/base"; import { VERSION } from "../__generated__/version"; import type * as SdkApiTypes from "./sdk_api_types"; +import { fetch } from "../universal"; + + export class TurnkeySDKClientBase { config: TurnkeySDKClientConfig; @@ -30,10 +28,10 @@ export class TurnkeySDKClientBase { method: "POST", headers: { [stamp.stampHeaderName]: stamp.stampHeaderValue, - "X-Client-Version": VERSION, + "X-Client-Version": VERSION }, body: stringifiedBody, - redirect: "follow", + redirect: "follow" }); if (!response.ok) { @@ -57,13 +55,9 @@ export class TurnkeySDKClientBase { resultKey: string ): Promise { const POLLING_DURATION = this.config.activityPoller?.duration ?? 1000; - const delay = (ms: number) => - new Promise((resolve) => setTimeout(resolve, ms)); + const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); - const responseData = (await this.request( - url, - body - )) as ActivityResponse; + const responseData = await this.request(url, body) as ActivityResponse; const activityId = responseData["activity"]["id"]; const activityStatus = responseData["activity"]["status"]; @@ -72,14 +66,14 @@ export class TurnkeySDKClientBase { ...responseData["activity"]["result"][`${resultKey}`], activity: { id: activityId, - status: activityStatus, - }, + status: activityStatus + } } as TResponseType; } const pollStatus = async (): Promise => { const pollBody = { activityId: activityId }; - const pollData = (await this.getActivity(pollBody)) as ActivityResponse; + const pollData = await this.getActivity(pollBody) as ActivityResponse; const activityStatus = pollData["activity"]["status"]; if (activityStatus === "ACTIVITY_STATUS_PENDING") { @@ -90,11 +84,11 @@ export class TurnkeySDKClientBase { ...pollData["activity"]["result"][`${resultKey}`], activity: { id: activityId, - status: activityStatus, - }, + status: activityStatus + } } as TResponseType; } - }; + } return await pollStatus(); } @@ -103,875 +97,653 @@ export class TurnkeySDKClientBase { url: string, body: TBodyType ): Promise { - const data = (await this.request(url, body)) as ActivityResponse; + const data = await this.request(url, body) as ActivityResponse; const activityId = data["activity"]["id"]; const activityStatus = data["activity"]["status"]; return { ...data["activity"]["result"], activity: { id: activityId, - status: activityStatus, - }, + status: activityStatus + } } as TResponseType; } - getActivity = async ( - input: SdkApiTypes.TGetActivityBody - ): Promise => { + + + + getActivity = async (input: SdkApiTypes.TGetActivityBody): Promise => { return this.request("/public/v1/query/get_activity", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - getApiKey = async ( - input: SdkApiTypes.TGetApiKeyBody - ): Promise => { + + getApiKey = async (input: SdkApiTypes.TGetApiKeyBody): Promise => { return this.request("/public/v1/query/get_api_key", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - getApiKeys = async ( - input: SdkApiTypes.TGetApiKeysBody = {} - ): Promise => { + + getApiKeys = async (input: SdkApiTypes.TGetApiKeysBody = {}): Promise => { return this.request("/public/v1/query/get_api_keys", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - getAuthenticator = async ( - input: SdkApiTypes.TGetAuthenticatorBody - ): Promise => { + + getAuthenticator = async (input: SdkApiTypes.TGetAuthenticatorBody): Promise => { return this.request("/public/v1/query/get_authenticator", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getAuthenticators = async ( - input: SdkApiTypes.TGetAuthenticatorsBody - ): Promise => { + getAuthenticators = async (input: SdkApiTypes.TGetAuthenticatorsBody): Promise => { return this.request("/public/v1/query/get_authenticators", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getOrganization = async ( - input: SdkApiTypes.TGetOrganizationBody = {} - ): Promise => { + getOrganization = async (input: SdkApiTypes.TGetOrganizationBody = {}): Promise => { return this.request("/public/v1/query/get_organization", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getPolicy = async ( - input: SdkApiTypes.TGetPolicyBody - ): Promise => { + getPolicy = async (input: SdkApiTypes.TGetPolicyBody): Promise => { return this.request("/public/v1/query/get_policy", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getPrivateKey = async ( - input: SdkApiTypes.TGetPrivateKeyBody - ): Promise => { + getPrivateKey = async (input: SdkApiTypes.TGetPrivateKeyBody): Promise => { return this.request("/public/v1/query/get_private_key", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - getUser = async ( - input: SdkApiTypes.TGetUserBody - ): Promise => { + + getUser = async (input: SdkApiTypes.TGetUserBody): Promise => { return this.request("/public/v1/query/get_user", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - getWallet = async ( - input: SdkApiTypes.TGetWalletBody - ): Promise => { + + getWallet = async (input: SdkApiTypes.TGetWalletBody): Promise => { return this.request("/public/v1/query/get_wallet", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - getActivities = async ( - input: SdkApiTypes.TGetActivitiesBody = {} - ): Promise => { + + getActivities = async (input: SdkApiTypes.TGetActivitiesBody = {}): Promise => { return this.request("/public/v1/query/list_activities", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getPolicies = async ( - input: SdkApiTypes.TGetPoliciesBody = {} - ): Promise => { + getPolicies = async (input: SdkApiTypes.TGetPoliciesBody = {}): Promise => { return this.request("/public/v1/query/list_policies", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - listPrivateKeyTags = async ( - input: SdkApiTypes.TListPrivateKeyTagsBody - ): Promise => { + listPrivateKeyTags = async (input: SdkApiTypes.TListPrivateKeyTagsBody): Promise => { return this.request("/public/v1/query/list_private_key_tags", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getPrivateKeys = async ( - input: SdkApiTypes.TGetPrivateKeysBody = {} - ): Promise => { + getPrivateKeys = async (input: SdkApiTypes.TGetPrivateKeysBody = {}): Promise => { return this.request("/public/v1/query/list_private_keys", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getSubOrgIds = async ( - input: SdkApiTypes.TGetSubOrgIdsBody = {} - ): Promise => { + getSubOrgIds = async (input: SdkApiTypes.TGetSubOrgIdsBody = {}): Promise => { return this.request("/public/v1/query/list_suborgs", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - listUserTags = async ( - input: SdkApiTypes.TListUserTagsBody = {} - ): Promise => { + listUserTags = async (input: SdkApiTypes.TListUserTagsBody = {}): Promise => { return this.request("/public/v1/query/list_user_tags", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getUsers = async ( - input: SdkApiTypes.TGetUsersBody = {} - ): Promise => { + getUsers = async (input: SdkApiTypes.TGetUsersBody = {}): Promise => { return this.request("/public/v1/query/list_users", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getWalletAccounts = async ( - input: SdkApiTypes.TGetWalletAccountsBody - ): Promise => { + getWalletAccounts = async (input: SdkApiTypes.TGetWalletAccountsBody): Promise => { return this.request("/public/v1/query/list_wallet_accounts", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } + - getWallets = async ( - input: SdkApiTypes.TGetWalletsBody = {} - ): Promise => { + getWallets = async (input: SdkApiTypes.TGetWalletsBody = {}): Promise => { return this.request("/public/v1/query/list_wallets", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - getWhoami = async ( - input: SdkApiTypes.TGetWhoamiBody = {} - ): Promise => { + + getWhoami = async (input: SdkApiTypes.TGetWhoamiBody = {}): Promise => { return this.request("/public/v1/query/whoami", { ...input, - organizationId: input.organizationId ?? this.config.organizationId, + organizationId: input.organizationId ?? this.config.organizationId }); - }; + } - approveActivity = async ( - input: SdkApiTypes.TApproveActivityBody - ): Promise => { - const { organizationId, timestampMs, ...rest } = input; - return this.activityDecision("/public/v1/submit/approve_activity", { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_APPROVE_ACTIVITY", - }); - }; - createApiKeys = async ( - input: SdkApiTypes.TCreateApiKeysBody - ): Promise => { + approveActivity = async (input: SdkApiTypes.TApproveActivityBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_api_keys", + return this.activityDecision("/public/v1/submit/approve_activity", { parameters: rest, organizationId: organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_API_KEYS", - }, - "createApiKeysResult" - ); - }; + type: "ACTIVITY_TYPE_APPROVE_ACTIVITY" + }); + } - createApiOnlyUsers = async ( - input: SdkApiTypes.TCreateApiOnlyUsersBody - ): Promise => { + + createApiKeys = async (input: SdkApiTypes.TCreateApiKeysBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_api_only_users", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", - }, - "createApiOnlyUsersResult" - ); - }; + return this.command("/public/v1/submit/create_api_keys", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_API_KEYS" + }, "createApiKeysResult"); + } + - createAuthenticators = async ( - input: SdkApiTypes.TCreateAuthenticatorsBody - ): Promise => { + createApiOnlyUsers = async (input: SdkApiTypes.TCreateApiOnlyUsersBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_authenticators", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", - }, - "createAuthenticatorsResult" - ); - }; + return this.command("/public/v1/submit/create_api_only_users", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS" + }, "createApiOnlyUsersResult"); + } - createInvitations = async ( - input: SdkApiTypes.TCreateInvitationsBody - ): Promise => { + + createAuthenticators = async (input: SdkApiTypes.TCreateAuthenticatorsBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_invitations", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_INVITATIONS", - }, - "createInvitationsResult" - ); - }; + return this.command("/public/v1/submit/create_authenticators", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2" + }, "createAuthenticatorsResult"); + } + - createPolicies = async ( - input: SdkApiTypes.TCreatePoliciesBody - ): Promise => { + createInvitations = async (input: SdkApiTypes.TCreateInvitationsBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_policies", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_POLICIES", - }, - "createPoliciesResult" - ); - }; + return this.command("/public/v1/submit/create_invitations", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_INVITATIONS" + }, "createInvitationsResult"); + } + - createPolicy = async ( - input: SdkApiTypes.TCreatePolicyBody - ): Promise => { + createPolicies = async (input: SdkApiTypes.TCreatePoliciesBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_policy", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_POLICY_V3", - }, - "createPolicyResult" - ); - }; + return this.command("/public/v1/submit/create_policies", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_POLICIES" + }, "createPoliciesResult"); + } - createPrivateKeyTag = async ( - input: SdkApiTypes.TCreatePrivateKeyTagBody - ): Promise => { + + createPolicy = async (input: SdkApiTypes.TCreatePolicyBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_private_key_tag", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", - }, - "createPrivateKeyTagResult" - ); - }; + return this.command("/public/v1/submit/create_policy", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_POLICY_V3" + }, "createPolicyResult"); + } + - createPrivateKeys = async ( - input: SdkApiTypes.TCreatePrivateKeysBody - ): Promise => { + createPrivateKeyTag = async (input: SdkApiTypes.TCreatePrivateKeyTagBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_private_keys", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", - }, - "createPrivateKeysResultV2" - ); - }; + return this.command("/public/v1/submit/create_private_key_tag", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG" + }, "createPrivateKeyTagResult"); + } - createReadOnlySession = async ( - input: SdkApiTypes.TCreateReadOnlySessionBody - ): Promise => { + + createPrivateKeys = async (input: SdkApiTypes.TCreatePrivateKeysBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_read_only_session", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION", - }, - "createReadOnlySessionResult" - ); - }; + return this.command("/public/v1/submit/create_private_keys", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2" + }, "createPrivateKeysResultV2"); + } + - createSubOrganization = async ( - input: SdkApiTypes.TCreateSubOrganizationBody - ): Promise => { + createReadOnlySession = async (input: SdkApiTypes.TCreateReadOnlySessionBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_sub_organization", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4", - }, - "createSubOrganizationResultV4" - ); - }; + return this.command("/public/v1/submit/create_read_only_session", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION" + }, "createReadOnlySessionResult"); + } + - createUserTag = async ( - input: SdkApiTypes.TCreateUserTagBody - ): Promise => { + createSubOrganization = async (input: SdkApiTypes.TCreateSubOrganizationBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_user_tag", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_USER_TAG", - }, - "createUserTagResult" - ); - }; + return this.command("/public/v1/submit/create_sub_organization", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4" + }, "createSubOrganizationResultV4"); + } - createUsers = async ( - input: SdkApiTypes.TCreateUsersBody - ): Promise => { + + createUserTag = async (input: SdkApiTypes.TCreateUserTagBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_users", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_USERS_V2", - }, - "createUsersResult" - ); - }; + return this.command("/public/v1/submit/create_user_tag", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_USER_TAG" + }, "createUserTagResult"); + } + - createWallet = async ( - input: SdkApiTypes.TCreateWalletBody - ): Promise => { + createUsers = async (input: SdkApiTypes.TCreateUsersBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_wallet", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_WALLET", - }, - "createWalletResult" - ); - }; + return this.command("/public/v1/submit/create_users", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_USERS_V2" + }, "createUsersResult"); + } + - createWalletAccounts = async ( - input: SdkApiTypes.TCreateWalletAccountsBody - ): Promise => { + createWallet = async (input: SdkApiTypes.TCreateWalletBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/create_wallet_accounts", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS", - }, - "createWalletAccountsResult" - ); - }; + return this.command("/public/v1/submit/create_wallet", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_WALLET" + }, "createWalletResult"); + } + - deleteApiKeys = async ( - input: SdkApiTypes.TDeleteApiKeysBody - ): Promise => { + createWalletAccounts = async (input: SdkApiTypes.TCreateWalletAccountsBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/delete_api_keys", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_DELETE_API_KEYS", - }, - "deleteApiKeysResult" - ); - }; + return this.command("/public/v1/submit/create_wallet_accounts", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS" + }, "createWalletAccountsResult"); + } + - deleteAuthenticators = async ( - input: SdkApiTypes.TDeleteAuthenticatorsBody - ): Promise => { + deleteApiKeys = async (input: SdkApiTypes.TDeleteApiKeysBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/delete_authenticators", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_DELETE_AUTHENTICATORS", - }, - "deleteAuthenticatorsResult" - ); - }; + return this.command("/public/v1/submit/delete_api_keys", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_DELETE_API_KEYS" + }, "deleteApiKeysResult"); + } - deleteInvitation = async ( - input: SdkApiTypes.TDeleteInvitationBody - ): Promise => { + + deleteAuthenticators = async (input: SdkApiTypes.TDeleteAuthenticatorsBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/delete_invitation", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_DELETE_INVITATION", - }, - "deleteInvitationResult" - ); - }; + return this.command("/public/v1/submit/delete_authenticators", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_DELETE_AUTHENTICATORS" + }, "deleteAuthenticatorsResult"); + } + - deletePolicy = async ( - input: SdkApiTypes.TDeletePolicyBody - ): Promise => { + deleteInvitation = async (input: SdkApiTypes.TDeleteInvitationBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/delete_policy", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_DELETE_POLICY", - }, - "deletePolicyResult" - ); - }; + return this.command("/public/v1/submit/delete_invitation", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_DELETE_INVITATION" + }, "deleteInvitationResult"); + } + - deletePrivateKeyTags = async ( - input: SdkApiTypes.TDeletePrivateKeyTagsBody - ): Promise => { + deletePolicy = async (input: SdkApiTypes.TDeletePolicyBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/delete_private_key_tags", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS", - }, - "deletePrivateKeyTagsResult" - ); - }; + return this.command("/public/v1/submit/delete_policy", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_DELETE_POLICY" + }, "deletePolicyResult"); + } - deleteUserTags = async ( - input: SdkApiTypes.TDeleteUserTagsBody - ): Promise => { + + deletePrivateKeyTags = async (input: SdkApiTypes.TDeletePrivateKeyTagsBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/delete_user_tags", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_DELETE_USER_TAGS", - }, - "deleteUserTagsResult" - ); - }; + return this.command("/public/v1/submit/delete_private_key_tags", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS" + }, "deletePrivateKeyTagsResult"); + } + - deleteUsers = async ( - input: SdkApiTypes.TDeleteUsersBody - ): Promise => { + deleteUserTags = async (input: SdkApiTypes.TDeleteUserTagsBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/delete_users", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_DELETE_USERS", - }, - "deleteUsersResult" - ); - }; + return this.command("/public/v1/submit/delete_user_tags", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_DELETE_USER_TAGS" + }, "deleteUserTagsResult"); + } - emailAuth = async ( - input: SdkApiTypes.TEmailAuthBody - ): Promise => { + + deleteUsers = async (input: SdkApiTypes.TDeleteUsersBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/email_auth", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_EMAIL_AUTH", - }, - "emailAuthResult" - ); - }; + return this.command("/public/v1/submit/delete_users", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_DELETE_USERS" + }, "deleteUsersResult"); + } + - exportPrivateKey = async ( - input: SdkApiTypes.TExportPrivateKeyBody - ): Promise => { + emailAuth = async (input: SdkApiTypes.TEmailAuthBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/export_private_key", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY", - }, - "exportPrivateKeyResult" - ); - }; + return this.command("/public/v1/submit/email_auth", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_EMAIL_AUTH" + }, "emailAuthResult"); + } + - exportWallet = async ( - input: SdkApiTypes.TExportWalletBody - ): Promise => { + exportPrivateKey = async (input: SdkApiTypes.TExportPrivateKeyBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/export_wallet", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_EXPORT_WALLET", - }, - "exportWalletResult" - ); - }; + return this.command("/public/v1/submit/export_private_key", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY" + }, "exportPrivateKeyResult"); + } - exportWalletAccount = async ( - input: SdkApiTypes.TExportWalletAccountBody - ): Promise => { + + exportWallet = async (input: SdkApiTypes.TExportWalletBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/export_wallet_account", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT", - }, - "exportWalletAccountResult" - ); - }; + return this.command("/public/v1/submit/export_wallet", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_EXPORT_WALLET" + }, "exportWalletResult"); + } + - importPrivateKey = async ( - input: SdkApiTypes.TImportPrivateKeyBody - ): Promise => { + exportWalletAccount = async (input: SdkApiTypes.TExportWalletAccountBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/import_private_key", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY", - }, - "importPrivateKeyResult" - ); - }; + return this.command("/public/v1/submit/export_wallet_account", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT" + }, "exportWalletAccountResult"); + } - importWallet = async ( - input: SdkApiTypes.TImportWalletBody - ): Promise => { + + importPrivateKey = async (input: SdkApiTypes.TImportPrivateKeyBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/import_wallet", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_IMPORT_WALLET", - }, - "importWalletResult" - ); - }; + return this.command("/public/v1/submit/import_private_key", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" + }, "importPrivateKeyResult"); + } + - initImportPrivateKey = async ( - input: SdkApiTypes.TInitImportPrivateKeyBody - ): Promise => { + importWallet = async (input: SdkApiTypes.TImportWalletBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/init_import_private_key", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY", - }, - "initImportPrivateKeyResult" - ); - }; + return this.command("/public/v1/submit/import_wallet", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_IMPORT_WALLET" + }, "importWalletResult"); + } + - initImportWallet = async ( - input: SdkApiTypes.TInitImportWalletBody - ): Promise => { + initImportPrivateKey = async (input: SdkApiTypes.TInitImportPrivateKeyBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/init_import_wallet", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_INIT_IMPORT_WALLET", - }, - "initImportWalletResult" - ); - }; + return this.command("/public/v1/submit/init_import_private_key", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" + }, "initImportPrivateKeyResult"); + } - initUserEmailRecovery = async ( - input: SdkApiTypes.TInitUserEmailRecoveryBody - ): Promise => { + + initImportWallet = async (input: SdkApiTypes.TInitImportWalletBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/init_user_email_recovery", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY", - }, - "initUserEmailRecoveryResult" - ); - }; + return this.command("/public/v1/submit/init_import_wallet", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_INIT_IMPORT_WALLET" + }, "initImportWalletResult"); + } - recoverUser = async ( - input: SdkApiTypes.TRecoverUserBody - ): Promise => { + + initUserEmailRecovery = async (input: SdkApiTypes.TInitUserEmailRecoveryBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/recover_user", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_RECOVER_USER", - }, - "recoverUserResult" - ); - }; + return this.command("/public/v1/submit/init_user_email_recovery", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY" + }, "initUserEmailRecoveryResult"); + } - rejectActivity = async ( - input: SdkApiTypes.TRejectActivityBody - ): Promise => { + + recoverUser = async (input: SdkApiTypes.TRecoverUserBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.activityDecision("/public/v1/submit/reject_activity", { + return this.command("/public/v1/submit/recover_user", { parameters: rest, organizationId: organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_REJECT_ACTIVITY", - }); - }; + type: "ACTIVITY_TYPE_RECOVER_USER" + }, "recoverUserResult"); + } + - removeOrganizationFeature = async ( - input: SdkApiTypes.TRemoveOrganizationFeatureBody - ): Promise => { + rejectActivity = async (input: SdkApiTypes.TRejectActivityBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/remove_organization_feature", + return this.activityDecision("/public/v1/submit/reject_activity", { parameters: rest, organizationId: organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE", - }, - "removeOrganizationFeatureResult" - ); - }; + type: "ACTIVITY_TYPE_REJECT_ACTIVITY" + }); + } + - setOrganizationFeature = async ( - input: SdkApiTypes.TSetOrganizationFeatureBody - ): Promise => { + removeOrganizationFeature = async (input: SdkApiTypes.TRemoveOrganizationFeatureBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/set_organization_feature", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE", - }, - "setOrganizationFeatureResult" - ); - }; + return this.command("/public/v1/submit/remove_organization_feature", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE" + }, "removeOrganizationFeatureResult"); + } - signRawPayload = async ( - input: SdkApiTypes.TSignRawPayloadBody - ): Promise => { + + setOrganizationFeature = async (input: SdkApiTypes.TSetOrganizationFeatureBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/sign_raw_payload", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", - }, - "signRawPayloadResult" - ); - }; + return this.command("/public/v1/submit/set_organization_feature", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE" + }, "setOrganizationFeatureResult"); + } - signRawPayloads = async ( - input: SdkApiTypes.TSignRawPayloadsBody - ): Promise => { + + signRawPayload = async (input: SdkApiTypes.TSignRawPayloadBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/sign_raw_payloads", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS", - }, - "signRawPayloadsResult" - ); - }; + return this.command("/public/v1/submit/sign_raw_payload", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2" + }, "signRawPayloadResult"); + } + - signTransaction = async ( - input: SdkApiTypes.TSignTransactionBody - ): Promise => { + signRawPayloads = async (input: SdkApiTypes.TSignRawPayloadsBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/sign_transaction", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", - }, - "signTransactionResult" - ); - }; + return this.command("/public/v1/submit/sign_raw_payloads", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS" + }, "signRawPayloadsResult"); + } + - updatePolicy = async ( - input: SdkApiTypes.TUpdatePolicyBody - ): Promise => { + signTransaction = async (input: SdkApiTypes.TSignTransactionBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/update_policy", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_UPDATE_POLICY", - }, - "updatePolicyResult" - ); - }; + return this.command("/public/v1/submit/sign_transaction", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2" + }, "signTransactionResult"); + } + - updatePrivateKeyTag = async ( - input: SdkApiTypes.TUpdatePrivateKeyTagBody - ): Promise => { + updatePolicy = async (input: SdkApiTypes.TUpdatePolicyBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/update_private_key_tag", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG", - }, - "updatePrivateKeyTagResult" - ); - }; + return this.command("/public/v1/submit/update_policy", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_UPDATE_POLICY" + }, "updatePolicyResult"); + } - updateRootQuorum = async ( - input: SdkApiTypes.TUpdateRootQuorumBody - ): Promise => { + + updatePrivateKeyTag = async (input: SdkApiTypes.TUpdatePrivateKeyTagBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/update_root_quorum", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM", - }, - "updateRootQuorumResult" - ); - }; + return this.command("/public/v1/submit/update_private_key_tag", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG" + }, "updatePrivateKeyTagResult"); + } - updateUser = async ( - input: SdkApiTypes.TUpdateUserBody - ): Promise => { + + updateRootQuorum = async (input: SdkApiTypes.TUpdateRootQuorumBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/update_user", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_UPDATE_USER", - }, - "updateUserResult" - ); - }; + return this.command("/public/v1/submit/update_root_quorum", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM" + }, "updateRootQuorumResult"); + } + - updateUserTag = async ( - input: SdkApiTypes.TUpdateUserTagBody - ): Promise => { + updateUser = async (input: SdkApiTypes.TUpdateUserBody): Promise => { const { organizationId, timestampMs, ...rest } = input; - return this.command( - "/public/v1/submit/update_user_tag", - { - parameters: rest, - organizationId: organizationId ?? this.config.organizationId, - timestampMs: timestampMs ?? String(Date.now()), - type: "ACTIVITY_TYPE_UPDATE_USER_TAG", - }, - "updateUserTagResult" - ); - }; -} + return this.command("/public/v1/submit/update_user", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_UPDATE_USER" + }, "updateUserResult"); + } + + + updateUserTag = async (input: SdkApiTypes.TUpdateUserTagBody): Promise => { + const { organizationId, timestampMs, ...rest } = input; + return this.command("/public/v1/submit/update_user_tag", { + parameters: rest, + organizationId: organizationId ?? this.config.organizationId, + timestampMs: timestampMs ?? String(Date.now()), + type: "ACTIVITY_TYPE_UPDATE_USER_TAG" + }, "updateUserTagResult"); + } + +} \ No newline at end of file diff --git a/packages/sdk-server/src/__generated__/sdk_api_types.ts b/packages/sdk-server/src/__generated__/sdk_api_types.ts index 98ddec16a..af33c6a55 100644 --- a/packages/sdk-server/src/__generated__/sdk_api_types.ts +++ b/packages/sdk-server/src/__generated__/sdk_api_types.ts @@ -2,665 +2,384 @@ import type { operations } from "../__inputs__/public_api.types"; -import type { - queryOverrideParams, - commandOverrideParams, - ActivityMetadata, -} from "../__types__/base"; +import type { queryOverrideParams, commandOverrideParams, ActivityMetadata } from "../__types__/base"; -export type TGetActivityResponse = - operations["PublicApiService_GetActivity"]["responses"]["200"]["schema"]; +export type TGetActivityResponse = operations["PublicApiService_GetActivity"]["responses"]["200"]["schema"]; export type TGetActivityInput = { body: TGetActivityBody }; -export type TGetActivityBody = Omit< - operations["PublicApiService_GetActivity"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetActivityBody = Omit & queryOverrideParams; -export type TGetApiKeyResponse = - operations["PublicApiService_GetApiKey"]["responses"]["200"]["schema"]; +export type TGetApiKeyResponse = operations["PublicApiService_GetApiKey"]["responses"]["200"]["schema"]; export type TGetApiKeyInput = { body: TGetApiKeyBody }; -export type TGetApiKeyBody = Omit< - operations["PublicApiService_GetApiKey"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetApiKeyBody = Omit & queryOverrideParams; -export type TGetApiKeysResponse = - operations["PublicApiService_GetApiKeys"]["responses"]["200"]["schema"]; +export type TGetApiKeysResponse = operations["PublicApiService_GetApiKeys"]["responses"]["200"]["schema"]; export type TGetApiKeysInput = { body: TGetApiKeysBody }; -export type TGetApiKeysBody = Omit< - operations["PublicApiService_GetApiKeys"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetApiKeysBody = Omit & queryOverrideParams; -export type TGetAuthenticatorResponse = - operations["PublicApiService_GetAuthenticator"]["responses"]["200"]["schema"]; +export type TGetAuthenticatorResponse = operations["PublicApiService_GetAuthenticator"]["responses"]["200"]["schema"]; export type TGetAuthenticatorInput = { body: TGetAuthenticatorBody }; -export type TGetAuthenticatorBody = Omit< - operations["PublicApiService_GetAuthenticator"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetAuthenticatorBody = Omit & queryOverrideParams; -export type TGetAuthenticatorsResponse = - operations["PublicApiService_GetAuthenticators"]["responses"]["200"]["schema"]; +export type TGetAuthenticatorsResponse = operations["PublicApiService_GetAuthenticators"]["responses"]["200"]["schema"]; export type TGetAuthenticatorsInput = { body: TGetAuthenticatorsBody }; -export type TGetAuthenticatorsBody = Omit< - operations["PublicApiService_GetAuthenticators"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetAuthenticatorsBody = Omit & queryOverrideParams; -export type TGetOrganizationResponse = - operations["PublicApiService_GetOrganization"]["responses"]["200"]["schema"]; +export type TGetOrganizationResponse = operations["PublicApiService_GetOrganization"]["responses"]["200"]["schema"]; export type TGetOrganizationInput = { body: TGetOrganizationBody }; -export type TGetOrganizationBody = Omit< - operations["PublicApiService_GetOrganization"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetOrganizationBody = Omit & queryOverrideParams; -export type TGetPolicyResponse = - operations["PublicApiService_GetPolicy"]["responses"]["200"]["schema"]; +export type TGetPolicyResponse = operations["PublicApiService_GetPolicy"]["responses"]["200"]["schema"]; export type TGetPolicyInput = { body: TGetPolicyBody }; -export type TGetPolicyBody = Omit< - operations["PublicApiService_GetPolicy"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetPolicyBody = Omit & queryOverrideParams; -export type TGetPrivateKeyResponse = - operations["PublicApiService_GetPrivateKey"]["responses"]["200"]["schema"]; +export type TGetPrivateKeyResponse = operations["PublicApiService_GetPrivateKey"]["responses"]["200"]["schema"]; export type TGetPrivateKeyInput = { body: TGetPrivateKeyBody }; -export type TGetPrivateKeyBody = Omit< - operations["PublicApiService_GetPrivateKey"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetPrivateKeyBody = Omit & queryOverrideParams; -export type TGetUserResponse = - operations["PublicApiService_GetUser"]["responses"]["200"]["schema"]; +export type TGetUserResponse = operations["PublicApiService_GetUser"]["responses"]["200"]["schema"]; export type TGetUserInput = { body: TGetUserBody }; -export type TGetUserBody = Omit< - operations["PublicApiService_GetUser"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetUserBody = Omit & queryOverrideParams; -export type TGetWalletResponse = - operations["PublicApiService_GetWallet"]["responses"]["200"]["schema"]; +export type TGetWalletResponse = operations["PublicApiService_GetWallet"]["responses"]["200"]["schema"]; export type TGetWalletInput = { body: TGetWalletBody }; -export type TGetWalletBody = Omit< - operations["PublicApiService_GetWallet"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetWalletBody = Omit & queryOverrideParams; -export type TGetActivitiesResponse = - operations["PublicApiService_GetActivities"]["responses"]["200"]["schema"]; +export type TGetActivitiesResponse = operations["PublicApiService_GetActivities"]["responses"]["200"]["schema"]; export type TGetActivitiesInput = { body: TGetActivitiesBody }; -export type TGetActivitiesBody = Omit< - operations["PublicApiService_GetActivities"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetActivitiesBody = Omit & queryOverrideParams; -export type TGetPoliciesResponse = - operations["PublicApiService_GetPolicies"]["responses"]["200"]["schema"]; +export type TGetPoliciesResponse = operations["PublicApiService_GetPolicies"]["responses"]["200"]["schema"]; export type TGetPoliciesInput = { body: TGetPoliciesBody }; -export type TGetPoliciesBody = Omit< - operations["PublicApiService_GetPolicies"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetPoliciesBody = Omit & queryOverrideParams; -export type TListPrivateKeyTagsResponse = - operations["PublicApiService_ListPrivateKeyTags"]["responses"]["200"]["schema"]; +export type TListPrivateKeyTagsResponse = operations["PublicApiService_ListPrivateKeyTags"]["responses"]["200"]["schema"]; export type TListPrivateKeyTagsInput = { body: TListPrivateKeyTagsBody }; -export type TListPrivateKeyTagsBody = Omit< - operations["PublicApiService_ListPrivateKeyTags"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TListPrivateKeyTagsBody = Omit & queryOverrideParams; -export type TGetPrivateKeysResponse = - operations["PublicApiService_GetPrivateKeys"]["responses"]["200"]["schema"]; +export type TGetPrivateKeysResponse = operations["PublicApiService_GetPrivateKeys"]["responses"]["200"]["schema"]; export type TGetPrivateKeysInput = { body: TGetPrivateKeysBody }; -export type TGetPrivateKeysBody = Omit< - operations["PublicApiService_GetPrivateKeys"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetPrivateKeysBody = Omit & queryOverrideParams; -export type TGetSubOrgIdsResponse = - operations["PublicApiService_GetSubOrgIds"]["responses"]["200"]["schema"]; +export type TGetSubOrgIdsResponse = operations["PublicApiService_GetSubOrgIds"]["responses"]["200"]["schema"]; export type TGetSubOrgIdsInput = { body: TGetSubOrgIdsBody }; -export type TGetSubOrgIdsBody = Omit< - operations["PublicApiService_GetSubOrgIds"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetSubOrgIdsBody = Omit & queryOverrideParams; -export type TListUserTagsResponse = - operations["PublicApiService_ListUserTags"]["responses"]["200"]["schema"]; +export type TListUserTagsResponse = operations["PublicApiService_ListUserTags"]["responses"]["200"]["schema"]; export type TListUserTagsInput = { body: TListUserTagsBody }; -export type TListUserTagsBody = Omit< - operations["PublicApiService_ListUserTags"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TListUserTagsBody = Omit & queryOverrideParams; -export type TGetUsersResponse = - operations["PublicApiService_GetUsers"]["responses"]["200"]["schema"]; +export type TGetUsersResponse = operations["PublicApiService_GetUsers"]["responses"]["200"]["schema"]; export type TGetUsersInput = { body: TGetUsersBody }; -export type TGetUsersBody = Omit< - operations["PublicApiService_GetUsers"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetUsersBody = Omit & queryOverrideParams; -export type TGetWalletAccountsResponse = - operations["PublicApiService_GetWalletAccounts"]["responses"]["200"]["schema"]; +export type TGetWalletAccountsResponse = operations["PublicApiService_GetWalletAccounts"]["responses"]["200"]["schema"]; export type TGetWalletAccountsInput = { body: TGetWalletAccountsBody }; -export type TGetWalletAccountsBody = Omit< - operations["PublicApiService_GetWalletAccounts"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetWalletAccountsBody = Omit & queryOverrideParams; -export type TGetWalletsResponse = - operations["PublicApiService_GetWallets"]["responses"]["200"]["schema"]; +export type TGetWalletsResponse = operations["PublicApiService_GetWallets"]["responses"]["200"]["schema"]; export type TGetWalletsInput = { body: TGetWalletsBody }; -export type TGetWalletsBody = Omit< - operations["PublicApiService_GetWallets"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetWalletsBody = Omit & queryOverrideParams; -export type TGetWhoamiResponse = - operations["PublicApiService_GetWhoami"]["responses"]["200"]["schema"]; +export type TGetWhoamiResponse = operations["PublicApiService_GetWhoami"]["responses"]["200"]["schema"]; export type TGetWhoamiInput = { body: TGetWhoamiBody }; -export type TGetWhoamiBody = Omit< - operations["PublicApiService_GetWhoami"]["parameters"]["body"]["body"], - "organizationId" -> & - queryOverrideParams; +export type TGetWhoamiBody = Omit & queryOverrideParams; -export type TApproveActivityResponse = - operations["PublicApiService_ApproveActivity"]["responses"]["200"]["schema"]["activity"]["result"] & - ActivityMetadata; +export type TApproveActivityResponse = operations["PublicApiService_ApproveActivity"]["responses"]["200"]["schema"]["activity"]["result"] & ActivityMetadata; export type TApproveActivityInput = { body: TApproveActivityBody }; -export type TApproveActivityBody = - operations["PublicApiService_ApproveActivity"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TApproveActivityBody = operations["PublicApiService_ApproveActivity"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateApiKeysResponse = - operations["PublicApiService_CreateApiKeys"]["responses"]["200"]["schema"]["activity"]["result"]["createApiKeysResult"] & - ActivityMetadata; +export type TCreateApiKeysResponse = operations["PublicApiService_CreateApiKeys"]["responses"]["200"]["schema"]["activity"]["result"]["createApiKeysResult"] & ActivityMetadata; export type TCreateApiKeysInput = { body: TCreateApiKeysBody }; -export type TCreateApiKeysBody = - operations["PublicApiService_CreateApiKeys"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateApiKeysBody = operations["PublicApiService_CreateApiKeys"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateApiOnlyUsersResponse = - operations["PublicApiService_CreateApiOnlyUsers"]["responses"]["200"]["schema"]["activity"]["result"]["createApiOnlyUsersResult"] & - ActivityMetadata; +export type TCreateApiOnlyUsersResponse = operations["PublicApiService_CreateApiOnlyUsers"]["responses"]["200"]["schema"]["activity"]["result"]["createApiOnlyUsersResult"] & ActivityMetadata; export type TCreateApiOnlyUsersInput = { body: TCreateApiOnlyUsersBody }; -export type TCreateApiOnlyUsersBody = - operations["PublicApiService_CreateApiOnlyUsers"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateApiOnlyUsersBody = operations["PublicApiService_CreateApiOnlyUsers"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateAuthenticatorsResponse = - operations["PublicApiService_CreateAuthenticators"]["responses"]["200"]["schema"]["activity"]["result"]["createAuthenticatorsResult"] & - ActivityMetadata; +export type TCreateAuthenticatorsResponse = operations["PublicApiService_CreateAuthenticators"]["responses"]["200"]["schema"]["activity"]["result"]["createAuthenticatorsResult"] & ActivityMetadata; export type TCreateAuthenticatorsInput = { body: TCreateAuthenticatorsBody }; -export type TCreateAuthenticatorsBody = - operations["PublicApiService_CreateAuthenticators"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateAuthenticatorsBody = operations["PublicApiService_CreateAuthenticators"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateInvitationsResponse = - operations["PublicApiService_CreateInvitations"]["responses"]["200"]["schema"]["activity"]["result"]["createInvitationsResult"] & - ActivityMetadata; +export type TCreateInvitationsResponse = operations["PublicApiService_CreateInvitations"]["responses"]["200"]["schema"]["activity"]["result"]["createInvitationsResult"] & ActivityMetadata; export type TCreateInvitationsInput = { body: TCreateInvitationsBody }; -export type TCreateInvitationsBody = - operations["PublicApiService_CreateInvitations"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateInvitationsBody = operations["PublicApiService_CreateInvitations"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreatePoliciesResponse = - operations["PublicApiService_CreatePolicies"]["responses"]["200"]["schema"]["activity"]["result"]["createPoliciesResult"] & - ActivityMetadata; +export type TCreatePoliciesResponse = operations["PublicApiService_CreatePolicies"]["responses"]["200"]["schema"]["activity"]["result"]["createPoliciesResult"] & ActivityMetadata; export type TCreatePoliciesInput = { body: TCreatePoliciesBody }; -export type TCreatePoliciesBody = - operations["PublicApiService_CreatePolicies"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreatePoliciesBody = operations["PublicApiService_CreatePolicies"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreatePolicyResponse = - operations["PublicApiService_CreatePolicy"]["responses"]["200"]["schema"]["activity"]["result"]["createPolicyResult"] & - ActivityMetadata; +export type TCreatePolicyResponse = operations["PublicApiService_CreatePolicy"]["responses"]["200"]["schema"]["activity"]["result"]["createPolicyResult"] & ActivityMetadata; export type TCreatePolicyInput = { body: TCreatePolicyBody }; -export type TCreatePolicyBody = - operations["PublicApiService_CreatePolicy"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreatePolicyBody = operations["PublicApiService_CreatePolicy"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreatePrivateKeyTagResponse = - operations["PublicApiService_CreatePrivateKeyTag"]["responses"]["200"]["schema"]["activity"]["result"]["createPrivateKeyTagResult"] & - ActivityMetadata; +export type TCreatePrivateKeyTagResponse = operations["PublicApiService_CreatePrivateKeyTag"]["responses"]["200"]["schema"]["activity"]["result"]["createPrivateKeyTagResult"] & ActivityMetadata; export type TCreatePrivateKeyTagInput = { body: TCreatePrivateKeyTagBody }; -export type TCreatePrivateKeyTagBody = - operations["PublicApiService_CreatePrivateKeyTag"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreatePrivateKeyTagBody = operations["PublicApiService_CreatePrivateKeyTag"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreatePrivateKeysResponse = - operations["PublicApiService_CreatePrivateKeys"]["responses"]["200"]["schema"]["activity"]["result"]["createPrivateKeysResultV2"] & - ActivityMetadata; +export type TCreatePrivateKeysResponse = operations["PublicApiService_CreatePrivateKeys"]["responses"]["200"]["schema"]["activity"]["result"]["createPrivateKeysResultV2"] & ActivityMetadata; export type TCreatePrivateKeysInput = { body: TCreatePrivateKeysBody }; -export type TCreatePrivateKeysBody = - operations["PublicApiService_CreatePrivateKeys"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreatePrivateKeysBody = operations["PublicApiService_CreatePrivateKeys"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateReadOnlySessionResponse = - operations["PublicApiService_CreateReadOnlySession"]["responses"]["200"]["schema"]["activity"]["result"]["createReadOnlySessionResult"] & - ActivityMetadata; +export type TCreateReadOnlySessionResponse = operations["PublicApiService_CreateReadOnlySession"]["responses"]["200"]["schema"]["activity"]["result"]["createReadOnlySessionResult"] & ActivityMetadata; export type TCreateReadOnlySessionInput = { body: TCreateReadOnlySessionBody }; -export type TCreateReadOnlySessionBody = - operations["PublicApiService_CreateReadOnlySession"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateReadOnlySessionBody = operations["PublicApiService_CreateReadOnlySession"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateSubOrganizationResponse = - operations["PublicApiService_CreateSubOrganization"]["responses"]["200"]["schema"]["activity"]["result"]["createSubOrganizationResultV4"] & - ActivityMetadata; +export type TCreateSubOrganizationResponse = operations["PublicApiService_CreateSubOrganization"]["responses"]["200"]["schema"]["activity"]["result"]["createSubOrganizationResultV4"] & ActivityMetadata; export type TCreateSubOrganizationInput = { body: TCreateSubOrganizationBody }; -export type TCreateSubOrganizationBody = - operations["PublicApiService_CreateSubOrganization"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateSubOrganizationBody = operations["PublicApiService_CreateSubOrganization"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateUserTagResponse = - operations["PublicApiService_CreateUserTag"]["responses"]["200"]["schema"]["activity"]["result"]["createUserTagResult"] & - ActivityMetadata; +export type TCreateUserTagResponse = operations["PublicApiService_CreateUserTag"]["responses"]["200"]["schema"]["activity"]["result"]["createUserTagResult"] & ActivityMetadata; export type TCreateUserTagInput = { body: TCreateUserTagBody }; -export type TCreateUserTagBody = - operations["PublicApiService_CreateUserTag"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateUserTagBody = operations["PublicApiService_CreateUserTag"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateUsersResponse = - operations["PublicApiService_CreateUsers"]["responses"]["200"]["schema"]["activity"]["result"]["createUsersResult"] & - ActivityMetadata; +export type TCreateUsersResponse = operations["PublicApiService_CreateUsers"]["responses"]["200"]["schema"]["activity"]["result"]["createUsersResult"] & ActivityMetadata; export type TCreateUsersInput = { body: TCreateUsersBody }; -export type TCreateUsersBody = - operations["PublicApiService_CreateUsers"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateUsersBody = operations["PublicApiService_CreateUsers"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateWalletResponse = - operations["PublicApiService_CreateWallet"]["responses"]["200"]["schema"]["activity"]["result"]["createWalletResult"] & - ActivityMetadata; +export type TCreateWalletResponse = operations["PublicApiService_CreateWallet"]["responses"]["200"]["schema"]["activity"]["result"]["createWalletResult"] & ActivityMetadata; export type TCreateWalletInput = { body: TCreateWalletBody }; -export type TCreateWalletBody = - operations["PublicApiService_CreateWallet"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateWalletBody = operations["PublicApiService_CreateWallet"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TCreateWalletAccountsResponse = - operations["PublicApiService_CreateWalletAccounts"]["responses"]["200"]["schema"]["activity"]["result"]["createWalletAccountsResult"] & - ActivityMetadata; +export type TCreateWalletAccountsResponse = operations["PublicApiService_CreateWalletAccounts"]["responses"]["200"]["schema"]["activity"]["result"]["createWalletAccountsResult"] & ActivityMetadata; export type TCreateWalletAccountsInput = { body: TCreateWalletAccountsBody }; -export type TCreateWalletAccountsBody = - operations["PublicApiService_CreateWalletAccounts"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TCreateWalletAccountsBody = operations["PublicApiService_CreateWalletAccounts"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TDeleteApiKeysResponse = - operations["PublicApiService_DeleteApiKeys"]["responses"]["200"]["schema"]["activity"]["result"]["deleteApiKeysResult"] & - ActivityMetadata; +export type TDeleteApiKeysResponse = operations["PublicApiService_DeleteApiKeys"]["responses"]["200"]["schema"]["activity"]["result"]["deleteApiKeysResult"] & ActivityMetadata; export type TDeleteApiKeysInput = { body: TDeleteApiKeysBody }; -export type TDeleteApiKeysBody = - operations["PublicApiService_DeleteApiKeys"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TDeleteApiKeysBody = operations["PublicApiService_DeleteApiKeys"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TDeleteAuthenticatorsResponse = - operations["PublicApiService_DeleteAuthenticators"]["responses"]["200"]["schema"]["activity"]["result"]["deleteAuthenticatorsResult"] & - ActivityMetadata; +export type TDeleteAuthenticatorsResponse = operations["PublicApiService_DeleteAuthenticators"]["responses"]["200"]["schema"]["activity"]["result"]["deleteAuthenticatorsResult"] & ActivityMetadata; export type TDeleteAuthenticatorsInput = { body: TDeleteAuthenticatorsBody }; -export type TDeleteAuthenticatorsBody = - operations["PublicApiService_DeleteAuthenticators"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TDeleteAuthenticatorsBody = operations["PublicApiService_DeleteAuthenticators"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TDeleteInvitationResponse = - operations["PublicApiService_DeleteInvitation"]["responses"]["200"]["schema"]["activity"]["result"]["deleteInvitationResult"] & - ActivityMetadata; +export type TDeleteInvitationResponse = operations["PublicApiService_DeleteInvitation"]["responses"]["200"]["schema"]["activity"]["result"]["deleteInvitationResult"] & ActivityMetadata; export type TDeleteInvitationInput = { body: TDeleteInvitationBody }; -export type TDeleteInvitationBody = - operations["PublicApiService_DeleteInvitation"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TDeleteInvitationBody = operations["PublicApiService_DeleteInvitation"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TDeletePolicyResponse = - operations["PublicApiService_DeletePolicy"]["responses"]["200"]["schema"]["activity"]["result"]["deletePolicyResult"] & - ActivityMetadata; +export type TDeletePolicyResponse = operations["PublicApiService_DeletePolicy"]["responses"]["200"]["schema"]["activity"]["result"]["deletePolicyResult"] & ActivityMetadata; export type TDeletePolicyInput = { body: TDeletePolicyBody }; -export type TDeletePolicyBody = - operations["PublicApiService_DeletePolicy"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TDeletePolicyBody = operations["PublicApiService_DeletePolicy"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TDeletePrivateKeyTagsResponse = - operations["PublicApiService_DeletePrivateKeyTags"]["responses"]["200"]["schema"]["activity"]["result"]["deletePrivateKeyTagsResult"] & - ActivityMetadata; +export type TDeletePrivateKeyTagsResponse = operations["PublicApiService_DeletePrivateKeyTags"]["responses"]["200"]["schema"]["activity"]["result"]["deletePrivateKeyTagsResult"] & ActivityMetadata; export type TDeletePrivateKeyTagsInput = { body: TDeletePrivateKeyTagsBody }; -export type TDeletePrivateKeyTagsBody = - operations["PublicApiService_DeletePrivateKeyTags"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TDeletePrivateKeyTagsBody = operations["PublicApiService_DeletePrivateKeyTags"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TDeleteUserTagsResponse = - operations["PublicApiService_DeleteUserTags"]["responses"]["200"]["schema"]["activity"]["result"]["deleteUserTagsResult"] & - ActivityMetadata; +export type TDeleteUserTagsResponse = operations["PublicApiService_DeleteUserTags"]["responses"]["200"]["schema"]["activity"]["result"]["deleteUserTagsResult"] & ActivityMetadata; export type TDeleteUserTagsInput = { body: TDeleteUserTagsBody }; -export type TDeleteUserTagsBody = - operations["PublicApiService_DeleteUserTags"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TDeleteUserTagsBody = operations["PublicApiService_DeleteUserTags"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TDeleteUsersResponse = - operations["PublicApiService_DeleteUsers"]["responses"]["200"]["schema"]["activity"]["result"]["deleteUsersResult"] & - ActivityMetadata; +export type TDeleteUsersResponse = operations["PublicApiService_DeleteUsers"]["responses"]["200"]["schema"]["activity"]["result"]["deleteUsersResult"] & ActivityMetadata; export type TDeleteUsersInput = { body: TDeleteUsersBody }; -export type TDeleteUsersBody = - operations["PublicApiService_DeleteUsers"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TDeleteUsersBody = operations["PublicApiService_DeleteUsers"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TEmailAuthResponse = - operations["PublicApiService_EmailAuth"]["responses"]["200"]["schema"]["activity"]["result"]["emailAuthResult"] & - ActivityMetadata; +export type TEmailAuthResponse = operations["PublicApiService_EmailAuth"]["responses"]["200"]["schema"]["activity"]["result"]["emailAuthResult"] & ActivityMetadata; export type TEmailAuthInput = { body: TEmailAuthBody }; -export type TEmailAuthBody = - operations["PublicApiService_EmailAuth"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TEmailAuthBody = operations["PublicApiService_EmailAuth"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TExportPrivateKeyResponse = - operations["PublicApiService_ExportPrivateKey"]["responses"]["200"]["schema"]["activity"]["result"]["exportPrivateKeyResult"] & - ActivityMetadata; +export type TExportPrivateKeyResponse = operations["PublicApiService_ExportPrivateKey"]["responses"]["200"]["schema"]["activity"]["result"]["exportPrivateKeyResult"] & ActivityMetadata; export type TExportPrivateKeyInput = { body: TExportPrivateKeyBody }; -export type TExportPrivateKeyBody = - operations["PublicApiService_ExportPrivateKey"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TExportPrivateKeyBody = operations["PublicApiService_ExportPrivateKey"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TExportWalletResponse = - operations["PublicApiService_ExportWallet"]["responses"]["200"]["schema"]["activity"]["result"]["exportWalletResult"] & - ActivityMetadata; +export type TExportWalletResponse = operations["PublicApiService_ExportWallet"]["responses"]["200"]["schema"]["activity"]["result"]["exportWalletResult"] & ActivityMetadata; export type TExportWalletInput = { body: TExportWalletBody }; -export type TExportWalletBody = - operations["PublicApiService_ExportWallet"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TExportWalletBody = operations["PublicApiService_ExportWallet"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TExportWalletAccountResponse = - operations["PublicApiService_ExportWalletAccount"]["responses"]["200"]["schema"]["activity"]["result"]["exportWalletAccountResult"] & - ActivityMetadata; +export type TExportWalletAccountResponse = operations["PublicApiService_ExportWalletAccount"]["responses"]["200"]["schema"]["activity"]["result"]["exportWalletAccountResult"] & ActivityMetadata; export type TExportWalletAccountInput = { body: TExportWalletAccountBody }; -export type TExportWalletAccountBody = - operations["PublicApiService_ExportWalletAccount"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TExportWalletAccountBody = operations["PublicApiService_ExportWalletAccount"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TImportPrivateKeyResponse = - operations["PublicApiService_ImportPrivateKey"]["responses"]["200"]["schema"]["activity"]["result"]["importPrivateKeyResult"] & - ActivityMetadata; +export type TImportPrivateKeyResponse = operations["PublicApiService_ImportPrivateKey"]["responses"]["200"]["schema"]["activity"]["result"]["importPrivateKeyResult"] & ActivityMetadata; export type TImportPrivateKeyInput = { body: TImportPrivateKeyBody }; -export type TImportPrivateKeyBody = - operations["PublicApiService_ImportPrivateKey"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TImportPrivateKeyBody = operations["PublicApiService_ImportPrivateKey"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TImportWalletResponse = - operations["PublicApiService_ImportWallet"]["responses"]["200"]["schema"]["activity"]["result"]["importWalletResult"] & - ActivityMetadata; +export type TImportWalletResponse = operations["PublicApiService_ImportWallet"]["responses"]["200"]["schema"]["activity"]["result"]["importWalletResult"] & ActivityMetadata; export type TImportWalletInput = { body: TImportWalletBody }; -export type TImportWalletBody = - operations["PublicApiService_ImportWallet"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TImportWalletBody = operations["PublicApiService_ImportWallet"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TInitImportPrivateKeyResponse = - operations["PublicApiService_InitImportPrivateKey"]["responses"]["200"]["schema"]["activity"]["result"]["initImportPrivateKeyResult"] & - ActivityMetadata; +export type TInitImportPrivateKeyResponse = operations["PublicApiService_InitImportPrivateKey"]["responses"]["200"]["schema"]["activity"]["result"]["initImportPrivateKeyResult"] & ActivityMetadata; export type TInitImportPrivateKeyInput = { body: TInitImportPrivateKeyBody }; -export type TInitImportPrivateKeyBody = - operations["PublicApiService_InitImportPrivateKey"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TInitImportPrivateKeyBody = operations["PublicApiService_InitImportPrivateKey"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TInitImportWalletResponse = - operations["PublicApiService_InitImportWallet"]["responses"]["200"]["schema"]["activity"]["result"]["initImportWalletResult"] & - ActivityMetadata; +export type TInitImportWalletResponse = operations["PublicApiService_InitImportWallet"]["responses"]["200"]["schema"]["activity"]["result"]["initImportWalletResult"] & ActivityMetadata; export type TInitImportWalletInput = { body: TInitImportWalletBody }; -export type TInitImportWalletBody = - operations["PublicApiService_InitImportWallet"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TInitImportWalletBody = operations["PublicApiService_InitImportWallet"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TInitUserEmailRecoveryResponse = - operations["PublicApiService_InitUserEmailRecovery"]["responses"]["200"]["schema"]["activity"]["result"]["initUserEmailRecoveryResult"] & - ActivityMetadata; +export type TInitUserEmailRecoveryResponse = operations["PublicApiService_InitUserEmailRecovery"]["responses"]["200"]["schema"]["activity"]["result"]["initUserEmailRecoveryResult"] & ActivityMetadata; export type TInitUserEmailRecoveryInput = { body: TInitUserEmailRecoveryBody }; -export type TInitUserEmailRecoveryBody = - operations["PublicApiService_InitUserEmailRecovery"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TInitUserEmailRecoveryBody = operations["PublicApiService_InitUserEmailRecovery"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TRecoverUserResponse = - operations["PublicApiService_RecoverUser"]["responses"]["200"]["schema"]["activity"]["result"]["recoverUserResult"] & - ActivityMetadata; +export type TRecoverUserResponse = operations["PublicApiService_RecoverUser"]["responses"]["200"]["schema"]["activity"]["result"]["recoverUserResult"] & ActivityMetadata; export type TRecoverUserInput = { body: TRecoverUserBody }; -export type TRecoverUserBody = - operations["PublicApiService_RecoverUser"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TRecoverUserBody = operations["PublicApiService_RecoverUser"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TRejectActivityResponse = - operations["PublicApiService_RejectActivity"]["responses"]["200"]["schema"]["activity"]["result"] & - ActivityMetadata; +export type TRejectActivityResponse = operations["PublicApiService_RejectActivity"]["responses"]["200"]["schema"]["activity"]["result"] & ActivityMetadata; export type TRejectActivityInput = { body: TRejectActivityBody }; -export type TRejectActivityBody = - operations["PublicApiService_RejectActivity"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TRejectActivityBody = operations["PublicApiService_RejectActivity"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TRemoveOrganizationFeatureResponse = - operations["PublicApiService_RemoveOrganizationFeature"]["responses"]["200"]["schema"]["activity"]["result"]["removeOrganizationFeatureResult"] & - ActivityMetadata; +export type TRemoveOrganizationFeatureResponse = operations["PublicApiService_RemoveOrganizationFeature"]["responses"]["200"]["schema"]["activity"]["result"]["removeOrganizationFeatureResult"] & ActivityMetadata; -export type TRemoveOrganizationFeatureInput = { - body: TRemoveOrganizationFeatureBody; -}; +export type TRemoveOrganizationFeatureInput = { body: TRemoveOrganizationFeatureBody }; -export type TRemoveOrganizationFeatureBody = - operations["PublicApiService_RemoveOrganizationFeature"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TRemoveOrganizationFeatureBody = operations["PublicApiService_RemoveOrganizationFeature"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TSetOrganizationFeatureResponse = - operations["PublicApiService_SetOrganizationFeature"]["responses"]["200"]["schema"]["activity"]["result"]["setOrganizationFeatureResult"] & - ActivityMetadata; +export type TSetOrganizationFeatureResponse = operations["PublicApiService_SetOrganizationFeature"]["responses"]["200"]["schema"]["activity"]["result"]["setOrganizationFeatureResult"] & ActivityMetadata; -export type TSetOrganizationFeatureInput = { - body: TSetOrganizationFeatureBody; -}; +export type TSetOrganizationFeatureInput = { body: TSetOrganizationFeatureBody }; -export type TSetOrganizationFeatureBody = - operations["PublicApiService_SetOrganizationFeature"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TSetOrganizationFeatureBody = operations["PublicApiService_SetOrganizationFeature"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TSignRawPayloadResponse = - operations["PublicApiService_SignRawPayload"]["responses"]["200"]["schema"]["activity"]["result"]["signRawPayloadResult"] & - ActivityMetadata; +export type TSignRawPayloadResponse = operations["PublicApiService_SignRawPayload"]["responses"]["200"]["schema"]["activity"]["result"]["signRawPayloadResult"] & ActivityMetadata; export type TSignRawPayloadInput = { body: TSignRawPayloadBody }; -export type TSignRawPayloadBody = - operations["PublicApiService_SignRawPayload"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TSignRawPayloadBody = operations["PublicApiService_SignRawPayload"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TSignRawPayloadsResponse = - operations["PublicApiService_SignRawPayloads"]["responses"]["200"]["schema"]["activity"]["result"]["signRawPayloadsResult"] & - ActivityMetadata; +export type TSignRawPayloadsResponse = operations["PublicApiService_SignRawPayloads"]["responses"]["200"]["schema"]["activity"]["result"]["signRawPayloadsResult"] & ActivityMetadata; export type TSignRawPayloadsInput = { body: TSignRawPayloadsBody }; -export type TSignRawPayloadsBody = - operations["PublicApiService_SignRawPayloads"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TSignRawPayloadsBody = operations["PublicApiService_SignRawPayloads"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TSignTransactionResponse = - operations["PublicApiService_SignTransaction"]["responses"]["200"]["schema"]["activity"]["result"]["signTransactionResult"] & - ActivityMetadata; +export type TSignTransactionResponse = operations["PublicApiService_SignTransaction"]["responses"]["200"]["schema"]["activity"]["result"]["signTransactionResult"] & ActivityMetadata; export type TSignTransactionInput = { body: TSignTransactionBody }; -export type TSignTransactionBody = - operations["PublicApiService_SignTransaction"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TSignTransactionBody = operations["PublicApiService_SignTransaction"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TUpdatePolicyResponse = - operations["PublicApiService_UpdatePolicy"]["responses"]["200"]["schema"]["activity"]["result"]["updatePolicyResult"] & - ActivityMetadata; +export type TUpdatePolicyResponse = operations["PublicApiService_UpdatePolicy"]["responses"]["200"]["schema"]["activity"]["result"]["updatePolicyResult"] & ActivityMetadata; export type TUpdatePolicyInput = { body: TUpdatePolicyBody }; -export type TUpdatePolicyBody = - operations["PublicApiService_UpdatePolicy"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TUpdatePolicyBody = operations["PublicApiService_UpdatePolicy"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TUpdatePrivateKeyTagResponse = - operations["PublicApiService_UpdatePrivateKeyTag"]["responses"]["200"]["schema"]["activity"]["result"]["updatePrivateKeyTagResult"] & - ActivityMetadata; +export type TUpdatePrivateKeyTagResponse = operations["PublicApiService_UpdatePrivateKeyTag"]["responses"]["200"]["schema"]["activity"]["result"]["updatePrivateKeyTagResult"] & ActivityMetadata; export type TUpdatePrivateKeyTagInput = { body: TUpdatePrivateKeyTagBody }; -export type TUpdatePrivateKeyTagBody = - operations["PublicApiService_UpdatePrivateKeyTag"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TUpdatePrivateKeyTagBody = operations["PublicApiService_UpdatePrivateKeyTag"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TUpdateRootQuorumResponse = - operations["PublicApiService_UpdateRootQuorum"]["responses"]["200"]["schema"]["activity"]["result"]["updateRootQuorumResult"] & - ActivityMetadata; +export type TUpdateRootQuorumResponse = operations["PublicApiService_UpdateRootQuorum"]["responses"]["200"]["schema"]["activity"]["result"]["updateRootQuorumResult"] & ActivityMetadata; export type TUpdateRootQuorumInput = { body: TUpdateRootQuorumBody }; -export type TUpdateRootQuorumBody = - operations["PublicApiService_UpdateRootQuorum"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TUpdateRootQuorumBody = operations["PublicApiService_UpdateRootQuorum"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TUpdateUserResponse = - operations["PublicApiService_UpdateUser"]["responses"]["200"]["schema"]["activity"]["result"]["updateUserResult"] & - ActivityMetadata; +export type TUpdateUserResponse = operations["PublicApiService_UpdateUser"]["responses"]["200"]["schema"]["activity"]["result"]["updateUserResult"] & ActivityMetadata; export type TUpdateUserInput = { body: TUpdateUserBody }; -export type TUpdateUserBody = - operations["PublicApiService_UpdateUser"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TUpdateUserBody = operations["PublicApiService_UpdateUser"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TUpdateUserTagResponse = - operations["PublicApiService_UpdateUserTag"]["responses"]["200"]["schema"]["activity"]["result"]["updateUserTagResult"] & - ActivityMetadata; +export type TUpdateUserTagResponse = operations["PublicApiService_UpdateUserTag"]["responses"]["200"]["schema"]["activity"]["result"]["updateUserTagResult"] & ActivityMetadata; export type TUpdateUserTagInput = { body: TUpdateUserTagBody }; -export type TUpdateUserTagBody = - operations["PublicApiService_UpdateUserTag"]["parameters"]["body"]["body"]["parameters"] & - commandOverrideParams; +export type TUpdateUserTagBody = operations["PublicApiService_UpdateUserTag"]["parameters"]["body"]["body"]["parameters"] & commandOverrideParams; -export type TNOOPCodegenAnchorResponse = - operations["PublicApiService_NOOPCodegenAnchor"]["responses"]["200"]["schema"]; +export type TNOOPCodegenAnchorResponse = operations["PublicApiService_NOOPCodegenAnchor"]["responses"]["200"]["schema"]; \ No newline at end of file diff --git a/packages/sdk-server/src/__tests__/request-test.ts b/packages/sdk-server/src/__tests__/request-test.ts index 96b87603b..97116d4ed 100644 --- a/packages/sdk-server/src/__tests__/request-test.ts +++ b/packages/sdk-server/src/__tests__/request-test.ts @@ -1,8 +1,7 @@ +import { fetch } from "../universal"; import { test, expect, jest } from "@jest/globals"; - -import { readFixture } from "../__fixtures__/shared"; import { TurnkeyServerSDK } from "../index"; -import { fetch } from "../universal"; +import { readFixture } from "../__fixtures__/shared"; jest.mock("cross-fetch"); @@ -25,9 +24,13 @@ test("requests are stamped after client creation", async () => { mockedFetch.mockReturnValue(Promise.resolve(response)); - await turnkeyServerClient.api().getWhoami({ - organizationId: "89881fc7-6ff3-4b43-b962-916698f8ff58", - }); + try { + await turnkeyServerClient.api().getWhoami({ + organizationId: "89881fc7-6ff3-4b43-b962-916698f8ff58", + }); + } catch (err: any) { + console.log('caught err', err); + } expect(fetch).toHaveBeenCalledTimes(1);