UNPKG

@turnkey/core

Version:

A core JavaScript web and React Native package for interfacing with Turnkey's infrastructure.

1,147 lines (1,144 loc) 140 kB
'use strict'; var http = require('@turnkey/http'); var base = require('../__types__/base.js'); var version = require('./version.js'); var sdkTypes = require('@turnkey/sdk-types'); /* @generated by codegen. DO NOT EDIT BY HAND */ class TurnkeySDKClientBase { constructor(config) { this.getActivity = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_activity", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetActivity = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_activity"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_ACTIVITY", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getApiKey = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_api_key", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetApiKey = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_key"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_API_KEY", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getApiKeys = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_api_keys", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetApiKeys = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_keys"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_API_KEYS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getAttestationDocument = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_attestation", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetAttestationDocument = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_attestation"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_ATTESTATION_DOCUMENT", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getAuthenticator = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_authenticator", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetAuthenticator = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticator"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_AUTHENTICATOR", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getAuthenticators = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_authenticators", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetAuthenticators = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticators"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_AUTHENTICATORS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getOauthProviders = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_oauth_providers", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetOauthProviders = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth_providers"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_OAUTH_PROVIDERS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getOrganization = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_organization", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetOrganization = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_ORGANIZATION", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getOrganizationConfigs = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_organization_configs", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetOrganizationConfigs = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization_configs"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_ORGANIZATION_CONFIGS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getPolicy = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_policy", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetPolicy = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_POLICY", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getPolicyEvaluations = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_policy_evaluations", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetPolicyEvaluations = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy_evaluations"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_POLICY_EVALUATIONS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getPrivateKey = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_private_key", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetPrivateKey = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_private_key"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_PRIVATE_KEY", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getSmartContractInterface = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_smart_contract_interface", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetSmartContractInterface = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_smart_contract_interface"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_SMART_CONTRACT_INTERFACE", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getUser = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_user", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetUser = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_user"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_USER", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getWallet = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_wallet", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetWallet = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_WALLET", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getWalletAccount = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/get_wallet_account", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetWalletAccount = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet_account"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_WALLET_ACCOUNT", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getActivities = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_activities", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetActivities = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_activities"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_ACTIVITIES", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getPolicies = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_policies", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetPolicies = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_policies"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_POLICIES", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.listPrivateKeyTags = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_private_key_tags", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampListPrivateKeyTags = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_key_tags"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_LIST_PRIVATE_KEY_TAGS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getPrivateKeys = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_private_keys", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetPrivateKeys = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_keys"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_PRIVATE_KEYS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getSmartContractInterfaces = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_smart_contract_interfaces", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetSmartContractInterfaces = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_smart_contract_interfaces"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_SMART_CONTRACT_INTERFACES", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getSubOrgIds = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_suborgs", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetSubOrgIds = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_suborgs"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_SUB_ORG_IDS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.listUserTags = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_user_tags", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampListUserTags = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_user_tags"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_LIST_USER_TAGS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getUsers = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_users", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetUsers = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_users"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_USERS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getVerifiedSubOrgIds = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_verified_suborgs", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetVerifiedSubOrgIds = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_verified_suborgs"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_VERIFIED_SUB_ORG_IDS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getWalletAccounts = async (input, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_wallet_accounts", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetWalletAccounts = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallet_accounts"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_WALLET_ACCOUNTS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getWallets = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/list_wallets", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetWallets = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallets"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_WALLETS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.getWhoami = async (input = {}, stampWith) => { const session = await this.storageManager?.getActiveSession(); return this.request("/public/v1/query/whoami", { ...input, organizationId: input.organizationId ?? session?.organizationId ?? this.config.organizationId, }, stampWith); }; this.stampGetWhoami = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/query/whoami"; const bodyWithType = { parameters, organizationId, type: "ACTIVITY_TYPE_GET_WHOAMI", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.approveActivity = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activityDecision("/public/v1/submit/approve_activity", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_APPROVE_ACTIVITY", }, stampWith); }; this.stampApproveActivity = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/approve_activity"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_APPROVE_ACTIVITY", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createApiKeys = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_api_keys", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_API_KEYS_V2", }, "createApiKeysResult", stampWith); }; this.stampCreateApiKeys = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_keys"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_API_KEYS_V2", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createApiOnlyUsers = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_api_only_users", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", }, "createApiOnlyUsersResult", stampWith); }; this.stampCreateApiOnlyUsers = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_only_users"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createAuthenticators = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_authenticators", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", }, "createAuthenticatorsResult", stampWith); }; this.stampCreateAuthenticators = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_authenticators"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createInvitations = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_invitations", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_INVITATIONS", }, "createInvitationsResult", stampWith); }; this.stampCreateInvitations = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_invitations"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_INVITATIONS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createOauthProviders = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_oauth_providers", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS", }, "createOauthProvidersResult", stampWith); }; this.stampCreateOauthProviders = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_oauth_providers"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createPolicies = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_policies", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_POLICIES", }, "createPoliciesResult", stampWith); }; this.stampCreatePolicies = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_policies"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_POLICIES", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createPolicy = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_policy", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_POLICY_V3", }, "createPolicyResult", stampWith); }; this.stampCreatePolicy = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_policy"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_POLICY_V3", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createPrivateKeyTag = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_private_key_tag", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", }, "createPrivateKeyTagResult", stampWith); }; this.stampCreatePrivateKeyTag = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_private_key_tag"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", }; const stringifiedBody = JSON.stringify(bodyWithType); const stamp = await activeStamper.stamp(stringifiedBody); return { body: stringifiedBody, stamp: stamp, url: fullUrl, }; }; this.createPrivateKeys = async (input, stampWith) => { const { organizationId, timestampMs, ...rest } = input; const session = await this.storageManager?.getActiveSession(); return this.activity("/public/v1/submit/create_private_keys", { parameters: rest, organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", }, "createPrivateKeysResultV2", stampWith); }; this.stampCreatePrivateKeys = async (input, stampWith) => { const activeStamper = this.getStamper(stampWith); if (!activeStamper) { return undefined; } const { organizationId, timestampMs, ...parameters } = input; const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_private_keys"; const bodyWithType = { parameters, organizationId, timestampMs: timestampMs ?? String(Date.now()), type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", }; const stringifiedBody = JSON.stringify(bodyWithType);