@clossir-tech/ts-sdk 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -33
- package/esm/funcs/accounts-get-accounts-cash-assets.d.ts +20 -0
- package/esm/funcs/accounts-get-accounts-cash-assets.d.ts.map +1 -0
- package/esm/funcs/accounts-get-accounts-cash-assets.js +77 -0
- package/esm/funcs/accounts-get-accounts-cash-assets.js.map +1 -0
- package/esm/funcs/accounts-get-accounts-deposit-addresses.d.ts +20 -0
- package/esm/funcs/accounts-get-accounts-deposit-addresses.d.ts.map +1 -0
- package/esm/funcs/accounts-get-accounts-deposit-addresses.js +94 -0
- package/esm/funcs/accounts-get-accounts-deposit-addresses.js.map +1 -0
- package/esm/funcs/accounts-get-accounts-movable-wallets.d.ts +20 -0
- package/esm/funcs/accounts-get-accounts-movable-wallets.d.ts.map +1 -0
- package/esm/funcs/accounts-get-accounts-movable-wallets.js +94 -0
- package/esm/funcs/accounts-get-accounts-movable-wallets.js.map +1 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-approve.d.ts +20 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-approve.d.ts.map +1 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-approve.js +100 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-approve.js.map +1 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-reject.d.ts +20 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-reject.d.ts.map +1 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-reject.js +100 -0
- package/esm/funcs/approvals-post-approvals-by-approval-id-reject.js.map +1 -0
- package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.d.ts +1 -1
- package/esm/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.js +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.js.map +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.js.map +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets.d.ts +1 -1
- package/esm/funcs/assets-post-orgs-by-org-id-assets.js +1 -1
- package/esm/funcs/attestations-delete-attestations-by-id.d.ts +1 -1
- package/esm/funcs/attestations-delete-attestations-by-id.js +2 -2
- package/esm/funcs/attestations-delete-attestations-by-id.js.map +1 -1
- package/esm/funcs/attestations-post-attestations.js +1 -1
- package/esm/funcs/attestations-post-attestations.js.map +1 -1
- package/esm/funcs/commands-get-commands-by-command-id.d.ts +1 -1
- package/esm/funcs/commands-get-commands-by-command-id.js +1 -1
- package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.d.ts +1 -1
- package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js +2 -2
- package/esm/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.js.map +1 -1
- package/esm/funcs/distributions-post-orgs-by-org-id-assets-by-asset-id-distributions-by-dist-id-activate.js +2 -0
- package/esm/funcs/distributions-post-orgs-by-org-id-assets-by-asset-id-distributions-by-dist-id-activate.js.map +1 -1
- package/esm/funcs/distributions-post-orgs-by-org-id-assets-by-asset-id-distributions.js +2 -0
- package/esm/funcs/distributions-post-orgs-by-org-id-assets-by-asset-id-distributions.js.map +1 -1
- package/esm/funcs/fees-post-orgs-by-org-id-assets-by-asset-id-fees-distribute.js +3 -1
- package/esm/funcs/fees-post-orgs-by-org-id-assets-by-asset-id-fees-distribute.js.map +1 -1
- package/esm/funcs/markets-delete-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders-by-order-id.js +2 -0
- package/esm/funcs/markets-delete-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders-by-order-id.js.map +1 -1
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-deposit-hypercore.js +1 -1
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-deposit-hypercore.js.map +1 -1
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders.js +3 -1
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders.js.map +1 -1
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js +1 -1
- package/esm/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.js.map +1 -1
- package/esm/funcs/nav-post-orgs-by-org-id-assets-by-asset-id-nav-configure.js +2 -0
- package/esm/funcs/nav-post-orgs-by-org-id-assets-by-asset-id-nav-configure.js.map +1 -1
- package/esm/funcs/nav-post-orgs-by-org-id-assets-by-asset-id-nav-publish.js +2 -0
- package/esm/funcs/nav-post-orgs-by-org-id-assets-by-asset-id-nav-publish.js.map +1 -1
- package/esm/funcs/organizations-get-orgs-by-org-id-server-wallet.js +2 -0
- package/esm/funcs/organizations-get-orgs-by-org-id-server-wallet.js.map +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-issuer-register.js +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-issuer-register.js.map +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.d.ts +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js +4 -2
- package/esm/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-server-wallet.js +1 -1
- package/esm/funcs/organizations-post-orgs-by-org-id-server-wallet.js.map +1 -1
- package/esm/funcs/organizations-put-orgs-by-org-id-compliance.d.ts +1 -1
- package/esm/funcs/organizations-put-orgs-by-org-id-compliance.js +2 -4
- package/esm/funcs/organizations-put-orgs-by-org-id-compliance.js.map +1 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deprecate.js +3 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deprecate.js.map +1 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-pause.js +3 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-pause.js.map +1 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-settle.js +3 -1
- package/esm/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-settle.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/errors/get-oauth-authorize.d.ts +6 -6
- package/esm/models/errors/get-oauth-authorize.js +3 -3
- package/esm/models/errors/get-oauth-userinfo.d.ts +8 -8
- package/esm/models/errors/get-oauth-userinfo.js +4 -4
- package/esm/models/errors/get-passport-home.d.ts +2 -2
- package/esm/models/errors/get-passport-home.js +1 -1
- package/esm/models/errors/get-passport-sign-in.d.ts +2 -2
- package/esm/models/errors/get-passport-sign-in.js +1 -1
- package/esm/models/errors/index.d.ts +2 -0
- package/esm/models/errors/index.d.ts.map +1 -1
- package/esm/models/errors/index.js +2 -0
- package/esm/models/errors/index.js.map +1 -1
- package/esm/models/errors/o-auth-error-response.d.ts +2 -2
- package/esm/models/errors/o-auth-error-response.js +1 -1
- package/esm/models/errors/post-approvals-by-approval-id-approve.d.ts +41 -0
- package/esm/models/errors/post-approvals-by-approval-id-approve.d.ts.map +1 -0
- package/esm/models/errors/post-approvals-by-approval-id-approve.js +52 -0
- package/esm/models/errors/post-approvals-by-approval-id-approve.js.map +1 -0
- package/esm/models/errors/post-approvals-by-approval-id-reject.d.ts +41 -0
- package/esm/models/errors/post-approvals-by-approval-id-reject.d.ts.map +1 -0
- package/esm/models/errors/post-approvals-by-approval-id-reject.js +53 -0
- package/esm/models/errors/post-approvals-by-approval-id-reject.js.map +1 -0
- package/esm/models/errors/post-eligibility-check.d.ts +2 -2
- package/esm/models/errors/post-eligibility-check.js +1 -1
- package/esm/models/errors/post-oauth-par.d.ts +10 -10
- package/esm/models/errors/post-oauth-par.js +5 -5
- package/esm/models/errors/post-oauth-revoke.d.ts +10 -10
- package/esm/models/errors/post-oauth-revoke.js +5 -5
- package/esm/models/errors/post-oauth-token.d.ts +8 -8
- package/esm/models/errors/post-oauth-token.js +4 -4
- package/esm/models/errors/post-passport-sign-in-decision.d.ts +2 -2
- package/esm/models/errors/post-passport-sign-in-decision.js +1 -1
- package/esm/models/operations/get-accounts-cash-assets.d.ts +44 -0
- package/esm/models/operations/get-accounts-cash-assets.d.ts.map +1 -0
- package/esm/models/operations/get-accounts-cash-assets.js +30 -0
- package/esm/models/operations/get-accounts-cash-assets.js.map +1 -0
- package/esm/models/operations/get-accounts-deposit-addresses.d.ts +146 -0
- package/esm/models/operations/get-accounts-deposit-addresses.d.ts.map +1 -0
- package/esm/models/operations/get-accounts-deposit-addresses.js +117 -0
- package/esm/models/operations/get-accounts-deposit-addresses.js.map +1 -0
- package/esm/models/operations/get-accounts-movable-wallets.d.ts +104 -0
- package/esm/models/operations/get-accounts-movable-wallets.d.ts.map +1 -0
- package/esm/models/operations/get-accounts-movable-wallets.js +75 -0
- package/esm/models/operations/get-accounts-movable-wallets.js.map +1 -0
- package/esm/models/operations/get-commands-by-command-id.d.ts +105 -0
- package/esm/models/operations/get-commands-by-command-id.d.ts.map +1 -1
- package/esm/models/operations/get-commands-by-command-id.js +119 -0
- package/esm/models/operations/get-commands-by-command-id.js.map +1 -1
- package/esm/models/operations/get-login-passport-status.d.ts +3 -3
- package/esm/models/operations/get-login-passport-status.d.ts.map +1 -1
- package/esm/models/operations/get-login-passport-status.js +3 -3
- package/esm/models/operations/get-login-passport-status.js.map +1 -1
- package/esm/models/operations/get-preflight-results-by-result-id.d.ts +25 -0
- package/esm/models/operations/get-preflight-results-by-result-id.d.ts.map +1 -1
- package/esm/models/operations/get-preflight-results-by-result-id.js +11 -0
- package/esm/models/operations/get-preflight-results-by-result-id.js.map +1 -1
- package/esm/models/operations/index.d.ts +5 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +5 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/post-accounts-wallets-sync.d.ts +3 -1
- package/esm/models/operations/post-accounts-wallets-sync.d.ts.map +1 -1
- package/esm/models/operations/post-accounts-wallets-sync.js.map +1 -1
- package/esm/models/operations/post-approvals-by-approval-id-approve.d.ts +53 -0
- package/esm/models/operations/post-approvals-by-approval-id-approve.d.ts.map +1 -0
- package/esm/models/operations/post-approvals-by-approval-id-approve.js +41 -0
- package/esm/models/operations/post-approvals-by-approval-id-approve.js.map +1 -0
- package/esm/models/operations/post-approvals-by-approval-id-reject.d.ts +105 -0
- package/esm/models/operations/post-approvals-by-approval-id-reject.d.ts.map +1 -0
- package/esm/models/operations/post-approvals-by-approval-id-reject.js +71 -0
- package/esm/models/operations/post-approvals-by-approval-id-reject.js.map +1 -0
- package/esm/models/operations/post-attestations.d.ts +1 -1
- package/esm/models/operations/post-eligibility-check.d.ts +4 -4
- package/esm/models/operations/post-eligibility-check.d.ts.map +1 -1
- package/esm/models/operations/post-eligibility-check.js +4 -4
- package/esm/models/operations/post-eligibility-check.js.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders.d.ts +1 -1
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts +9 -5
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.d.ts.map +1 -1
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js +1 -1
- package/esm/models/operations/post-orgs-by-org-id-members-by-user-id-attest.js.map +1 -1
- package/esm/models/operations/post-preflight-intents.d.ts +25 -0
- package/esm/models/operations/post-preflight-intents.d.ts.map +1 -1
- package/esm/models/operations/post-preflight-intents.js +11 -0
- package/esm/models/operations/post-preflight-intents.js.map +1 -1
- package/esm/sdk/accounts.d.ts +21 -0
- package/esm/sdk/accounts.d.ts.map +1 -1
- package/esm/sdk/accounts.js +30 -0
- package/esm/sdk/accounts.js.map +1 -1
- package/esm/sdk/approvals.d.ts +14 -0
- package/esm/sdk/approvals.d.ts.map +1 -1
- package/esm/sdk/approvals.js +20 -0
- package/esm/sdk/approvals.js.map +1 -1
- package/esm/sdk/assets.d.ts +2 -2
- package/esm/sdk/assets.js +2 -2
- package/esm/sdk/attestations.d.ts +1 -1
- package/esm/sdk/attestations.js +1 -1
- package/esm/sdk/commands.d.ts +1 -1
- package/esm/sdk/commands.js +1 -1
- package/esm/sdk/compliance.d.ts +1 -1
- package/esm/sdk/compliance.js +1 -1
- package/esm/sdk/organizations.d.ts +2 -2
- package/esm/sdk/organizations.js +2 -2
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/accounts-get-accounts-cash-assets.ts +157 -0
- package/src/funcs/accounts-get-accounts-deposit-addresses.ts +193 -0
- package/src/funcs/accounts-get-accounts-movable-wallets.ts +193 -0
- package/src/funcs/approvals-post-approvals-by-approval-id-approve.ts +217 -0
- package/src/funcs/approvals-post-approvals-by-approval-id-reject.ts +217 -0
- package/src/funcs/assets-patch-orgs-by-org-id-assets-by-asset-id.ts +1 -1
- package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-allocate.ts +1 -1
- package/src/funcs/assets-post-orgs-by-org-id-assets-by-asset-id-deploy.ts +1 -1
- package/src/funcs/assets-post-orgs-by-org-id-assets.ts +1 -1
- package/src/funcs/attestations-delete-attestations-by-id.ts +2 -2
- package/src/funcs/attestations-post-attestations.ts +1 -1
- package/src/funcs/commands-get-commands-by-command-id.ts +1 -1
- package/src/funcs/compliance-post-orgs-by-org-id-assets-by-asset-id-compliance-policy.ts +2 -2
- package/src/funcs/distributions-post-orgs-by-org-id-assets-by-asset-id-distributions-by-dist-id-activate.ts +3 -0
- package/src/funcs/distributions-post-orgs-by-org-id-assets-by-asset-id-distributions.ts +3 -0
- package/src/funcs/fees-post-orgs-by-org-id-assets-by-asset-id-fees-distribute.ts +3 -0
- package/src/funcs/markets-delete-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders-by-order-id.ts +3 -0
- package/src/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-deposit-hypercore.ts +1 -1
- package/src/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders.ts +3 -0
- package/src/funcs/markets-post-orgs-by-org-id-assets-by-asset-id-markets.ts +1 -1
- package/src/funcs/nav-post-orgs-by-org-id-assets-by-asset-id-nav-configure.ts +3 -0
- package/src/funcs/nav-post-orgs-by-org-id-assets-by-asset-id-nav-publish.ts +3 -0
- package/src/funcs/organizations-get-orgs-by-org-id-server-wallet.ts +3 -0
- package/src/funcs/organizations-post-orgs-by-org-id-issuer-register.ts +1 -1
- package/src/funcs/organizations-post-orgs-by-org-id-members-by-user-id-attest.ts +4 -1
- package/src/funcs/organizations-post-orgs-by-org-id-server-wallet.ts +1 -1
- package/src/funcs/organizations-put-orgs-by-org-id-compliance.ts +6 -4
- package/src/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-deprecate.ts +3 -0
- package/src/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-pause.ts +3 -0
- package/src/funcs/vaults-post-orgs-by-org-id-assets-by-asset-id-vault-settle.ts +3 -0
- package/src/lib/config.ts +2 -2
- package/src/models/errors/get-oauth-authorize.ts +6 -6
- package/src/models/errors/get-oauth-userinfo.ts +8 -8
- package/src/models/errors/get-passport-home.ts +2 -2
- package/src/models/errors/get-passport-sign-in.ts +2 -2
- package/src/models/errors/index.ts +2 -0
- package/src/models/errors/o-auth-error-response.ts +2 -2
- package/src/models/errors/post-approvals-by-approval-id-approve.ts +85 -0
- package/src/models/errors/post-approvals-by-approval-id-reject.ts +85 -0
- package/src/models/errors/post-eligibility-check.ts +2 -2
- package/src/models/errors/post-oauth-par.ts +10 -10
- package/src/models/errors/post-oauth-revoke.ts +10 -10
- package/src/models/errors/post-oauth-token.ts +8 -8
- package/src/models/errors/post-passport-sign-in-decision.ts +2 -2
- package/src/models/operations/get-accounts-cash-assets.ts +89 -0
- package/src/models/operations/get-accounts-deposit-addresses.ts +346 -0
- package/src/models/operations/get-accounts-movable-wallets.ts +240 -0
- package/src/models/operations/get-commands-by-command-id.ts +267 -0
- package/src/models/operations/get-login-passport-status.ts +12 -6
- package/src/models/operations/get-preflight-results-by-result-id.ts +51 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/post-accounts-wallets-sync.ts +3 -1
- package/src/models/operations/post-approvals-by-approval-id-approve.ts +134 -0
- package/src/models/operations/post-approvals-by-approval-id-reject.ts +207 -0
- package/src/models/operations/post-attestations.ts +1 -1
- package/src/models/operations/post-eligibility-check.ts +11 -8
- package/src/models/operations/post-orgs-by-org-id-assets-by-asset-id-markets-by-market-id-orders.ts +1 -1
- package/src/models/operations/post-orgs-by-org-id-members-by-user-id-attest.ts +10 -6
- package/src/models/operations/post-preflight-intents.ts +47 -0
- package/src/sdk/accounts.ts +52 -0
- package/src/sdk/approvals.ts +40 -0
- package/src/sdk/assets.ts +2 -2
- package/src/sdk/attestations.ts +1 -1
- package/src/sdk/commands.ts +1 -1
- package/src/sdk/compliance.ts +1 -1
- package/src/sdk/organizations.ts +2 -2
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClossirCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKError } from "../models/errors/sdk-error.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Where the caller can receive an asset
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* One row per own wallet per chain of the asset; an organization's wallets are never listed. An issued asset is found for a member of its organization and for a caller who holds it; for anyone else it is not found. A chain the asset is not deployed on yet is a row with `deployed: false` and no address. A deployed row carries the wallet's checksummed address and `receivable`: whether the chain will accept a transfer of the asset to that wallet, read from the chain on every request. `receivable` is null when it could not be read, never true. `notReceivableReason` is given only when `receivable` is false. `inboundBridgePaused` says whether the token is paused on that chain: while it is, deposits bridged from another chain are queued, and after the token is unpaused they must be replayed; one the token refuses at replay, or that the owner drops, is not delivered. A pause does not affect a deposit sent on the chain itself and never changes `receivable`. `finalityBlocks` is null when no confirmation depth is stated for the chain. `inbound` lists up to 5 recent transfers in, newest first; when `historyStale` is true the lists may be missing transfers, and an empty list is not a statement that nothing arrived. For a cash asset every row is receivable, `inbound` is empty and `historyStale` is true. Rate limited per user (429 with Retry-After). API keys are refused.
|
|
35
|
+
*
|
|
36
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
37
|
+
*/
|
|
38
|
+
export function accountsGetAccountsDepositAddresses(
|
|
39
|
+
client: ClossirCore,
|
|
40
|
+
assetId: string,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<
|
|
43
|
+
Result<
|
|
44
|
+
operations.GetAccountsDepositAddressesResponse,
|
|
45
|
+
| errors.ProblemDetailsError
|
|
46
|
+
| SDKError
|
|
47
|
+
| ResponseValidationError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| UnexpectedClientError
|
|
53
|
+
| SDKValidationError
|
|
54
|
+
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
assetId,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: ClossirCore,
|
|
65
|
+
assetId: string,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.GetAccountsDepositAddressesResponse,
|
|
71
|
+
| errors.ProblemDetailsError
|
|
72
|
+
| SDKError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const input: operations.GetAccountsDepositAddressesRequest = {
|
|
85
|
+
assetId: assetId,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const parsed = safeParse(
|
|
89
|
+
input,
|
|
90
|
+
(value) =>
|
|
91
|
+
z.parse(
|
|
92
|
+
operations.GetAccountsDepositAddressesRequest$outboundSchema,
|
|
93
|
+
value,
|
|
94
|
+
),
|
|
95
|
+
"Input validation failed",
|
|
96
|
+
);
|
|
97
|
+
if (!parsed.ok) {
|
|
98
|
+
return [parsed, { status: "invalid" }];
|
|
99
|
+
}
|
|
100
|
+
const payload = parsed.value;
|
|
101
|
+
const body = null;
|
|
102
|
+
|
|
103
|
+
const path = pathToFunc("/accounts/deposit-addresses")();
|
|
104
|
+
|
|
105
|
+
const query = encodeFormQuery({
|
|
106
|
+
"assetId": payload.assetId,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "getAccountsDeposit-addresses",
|
|
121
|
+
oAuth2Scopes: null,
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.bearerAuth,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "GET",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
query: query,
|
|
139
|
+
body: body,
|
|
140
|
+
userAgent: client._options.userAgent,
|
|
141
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
142
|
+
}, options);
|
|
143
|
+
if (!requestRes.ok) {
|
|
144
|
+
return [requestRes, { status: "invalid" }];
|
|
145
|
+
}
|
|
146
|
+
const req = requestRes.value;
|
|
147
|
+
|
|
148
|
+
const doResult = await client._do(req, {
|
|
149
|
+
context,
|
|
150
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
151
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
152
|
+
retryConfig: context.retryConfig,
|
|
153
|
+
retryCodes: context.retryCodes,
|
|
154
|
+
});
|
|
155
|
+
if (!doResult.ok) {
|
|
156
|
+
return [doResult, { status: "request-error", request: req }];
|
|
157
|
+
}
|
|
158
|
+
const response = doResult.value;
|
|
159
|
+
|
|
160
|
+
const responseFields = {
|
|
161
|
+
HttpMeta: { Response: response, Request: req },
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const [result] = await M.match<
|
|
165
|
+
operations.GetAccountsDepositAddressesResponse,
|
|
166
|
+
| errors.ProblemDetailsError
|
|
167
|
+
| SDKError
|
|
168
|
+
| ResponseValidationError
|
|
169
|
+
| ConnectionError
|
|
170
|
+
| RequestAbortedError
|
|
171
|
+
| RequestTimeoutError
|
|
172
|
+
| InvalidRequestError
|
|
173
|
+
| UnexpectedClientError
|
|
174
|
+
| SDKValidationError
|
|
175
|
+
>(
|
|
176
|
+
M.json(200, operations.GetAccountsDepositAddressesResponse$inboundSchema),
|
|
177
|
+
M.jsonErr(
|
|
178
|
+
[401, 404, 422, 428, 429],
|
|
179
|
+
errors.ProblemDetailsError$inboundSchema,
|
|
180
|
+
{ ctype: "application/problem+json" },
|
|
181
|
+
),
|
|
182
|
+
M.jsonErr(503, errors.ProblemDetailsError$inboundSchema, {
|
|
183
|
+
ctype: "application/problem+json",
|
|
184
|
+
}),
|
|
185
|
+
M.fail("4XX"),
|
|
186
|
+
M.fail("5XX"),
|
|
187
|
+
)(response, req, { extraFields: responseFields });
|
|
188
|
+
if (!result.ok) {
|
|
189
|
+
return [result, { status: "complete", request: req, response }];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return [result, { status: "complete", request: req, response }];
|
|
193
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClossirCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKError } from "../models/errors/sdk-error.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Wallets the caller may move an asset from
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* The caller's own wallets, plus the active organization's server wallets when the caller is its admin or operator and the asset is that organization's own issued asset, with each wallet's on-chain balance per chain. An issued asset is found for a member of its organization and for a caller who holds it; for anyone else it is not found. Each wallet has one balance row per chain the asset is deployed on; an issued asset with no deployed chain answers an empty `balances` for every wallet. A balance that could not be read is null with a reason, never zero: an unreadable chain, a token address that is not valid, a failed read, or more wallets and chains than one request reads. `locked` is the part of a read balance under the asset's lockup. An absent `locked` means no lockup, not applicable (cash, organization wallets) or unknown; it is for display only, and the preflight check enforces the lockup. `visibleCount` of `totalCount` says how many of the wallets the asset could be moved from are returned. Rate limited per user (429 with Retry-After). API keys are refused.
|
|
35
|
+
*
|
|
36
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
37
|
+
*/
|
|
38
|
+
export function accountsGetAccountsMovableWallets(
|
|
39
|
+
client: ClossirCore,
|
|
40
|
+
assetId: string,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<
|
|
43
|
+
Result<
|
|
44
|
+
operations.GetAccountsMovableWalletsResponse,
|
|
45
|
+
| errors.ProblemDetailsError
|
|
46
|
+
| SDKError
|
|
47
|
+
| ResponseValidationError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| UnexpectedClientError
|
|
53
|
+
| SDKValidationError
|
|
54
|
+
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
assetId,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: ClossirCore,
|
|
65
|
+
assetId: string,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.GetAccountsMovableWalletsResponse,
|
|
71
|
+
| errors.ProblemDetailsError
|
|
72
|
+
| SDKError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const input: operations.GetAccountsMovableWalletsRequest = {
|
|
85
|
+
assetId: assetId,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const parsed = safeParse(
|
|
89
|
+
input,
|
|
90
|
+
(value) =>
|
|
91
|
+
z.parse(
|
|
92
|
+
operations.GetAccountsMovableWalletsRequest$outboundSchema,
|
|
93
|
+
value,
|
|
94
|
+
),
|
|
95
|
+
"Input validation failed",
|
|
96
|
+
);
|
|
97
|
+
if (!parsed.ok) {
|
|
98
|
+
return [parsed, { status: "invalid" }];
|
|
99
|
+
}
|
|
100
|
+
const payload = parsed.value;
|
|
101
|
+
const body = null;
|
|
102
|
+
|
|
103
|
+
const path = pathToFunc("/accounts/movable-wallets")();
|
|
104
|
+
|
|
105
|
+
const query = encodeFormQuery({
|
|
106
|
+
"assetId": payload.assetId,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "getAccountsMovable-wallets",
|
|
121
|
+
oAuth2Scopes: null,
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.bearerAuth,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "GET",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
query: query,
|
|
139
|
+
body: body,
|
|
140
|
+
userAgent: client._options.userAgent,
|
|
141
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
142
|
+
}, options);
|
|
143
|
+
if (!requestRes.ok) {
|
|
144
|
+
return [requestRes, { status: "invalid" }];
|
|
145
|
+
}
|
|
146
|
+
const req = requestRes.value;
|
|
147
|
+
|
|
148
|
+
const doResult = await client._do(req, {
|
|
149
|
+
context,
|
|
150
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
151
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
152
|
+
retryConfig: context.retryConfig,
|
|
153
|
+
retryCodes: context.retryCodes,
|
|
154
|
+
});
|
|
155
|
+
if (!doResult.ok) {
|
|
156
|
+
return [doResult, { status: "request-error", request: req }];
|
|
157
|
+
}
|
|
158
|
+
const response = doResult.value;
|
|
159
|
+
|
|
160
|
+
const responseFields = {
|
|
161
|
+
HttpMeta: { Response: response, Request: req },
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const [result] = await M.match<
|
|
165
|
+
operations.GetAccountsMovableWalletsResponse,
|
|
166
|
+
| errors.ProblemDetailsError
|
|
167
|
+
| SDKError
|
|
168
|
+
| ResponseValidationError
|
|
169
|
+
| ConnectionError
|
|
170
|
+
| RequestAbortedError
|
|
171
|
+
| RequestTimeoutError
|
|
172
|
+
| InvalidRequestError
|
|
173
|
+
| UnexpectedClientError
|
|
174
|
+
| SDKValidationError
|
|
175
|
+
>(
|
|
176
|
+
M.json(200, operations.GetAccountsMovableWalletsResponse$inboundSchema),
|
|
177
|
+
M.jsonErr(
|
|
178
|
+
[401, 404, 422, 428, 429],
|
|
179
|
+
errors.ProblemDetailsError$inboundSchema,
|
|
180
|
+
{ ctype: "application/problem+json" },
|
|
181
|
+
),
|
|
182
|
+
M.jsonErr(503, errors.ProblemDetailsError$inboundSchema, {
|
|
183
|
+
ctype: "application/problem+json",
|
|
184
|
+
}),
|
|
185
|
+
M.fail("4XX"),
|
|
186
|
+
M.fail("5XX"),
|
|
187
|
+
)(response, req, { extraFields: responseFields });
|
|
188
|
+
if (!result.ok) {
|
|
189
|
+
return [result, { status: "complete", request: req, response }];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return [result, { status: "complete", request: req, response }];
|
|
193
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClossirCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKError } from "../models/errors/sdk-error.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Approve an approval as its designated approver
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Consumes the approval and its intent and queues the transfer command in one transaction, then publishes it. Answers 202 {approvalId, status, commandId} as soon as the transaction commits, whether or not the publish succeeded: the body has no published flag, and GET /commands/:commandId is the outcome source. Body: {stepUpChallengeId?} (strict; empty is {}). A verified step-up challenge bound to this approval and this approver is required (409 stepup_required otherwise). A repeat is 409 approval_consumed. 503 approval_contention carries Retry-After and nothing committed; 500 approval_outcome_unknown means the approval may have been consumed: do not retry, read the approval. Requires a Clossir Passport client's DPoP-bound access token with a fresh DPoP proof; a caller who is not the designated approver gets the same 404 approval_not_found as an unknown id. A body over 4096 bytes is 413.
|
|
35
|
+
*
|
|
36
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
37
|
+
*/
|
|
38
|
+
export function approvalsPostApprovalsByApprovalIdApprove(
|
|
39
|
+
client: ClossirCore,
|
|
40
|
+
approvalId: string,
|
|
41
|
+
body?: operations.PostApprovalsByApprovalIdApproveRequestBody | undefined,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<
|
|
44
|
+
Result<
|
|
45
|
+
operations.PostApprovalsByApprovalIdApproveResponse,
|
|
46
|
+
| errors.ProblemDetailsError
|
|
47
|
+
| errors.OAuthErrorResponse
|
|
48
|
+
| errors.PostApprovalsByApprovalIdApproveUpdateRequiredError
|
|
49
|
+
| SDKError
|
|
50
|
+
| ResponseValidationError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| UnexpectedClientError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
>
|
|
58
|
+
> {
|
|
59
|
+
return new APIPromise($do(
|
|
60
|
+
client,
|
|
61
|
+
approvalId,
|
|
62
|
+
body,
|
|
63
|
+
options,
|
|
64
|
+
));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function $do(
|
|
68
|
+
client: ClossirCore,
|
|
69
|
+
approvalId: string,
|
|
70
|
+
body?: operations.PostApprovalsByApprovalIdApproveRequestBody | undefined,
|
|
71
|
+
options?: RequestOptions,
|
|
72
|
+
): Promise<
|
|
73
|
+
[
|
|
74
|
+
Result<
|
|
75
|
+
operations.PostApprovalsByApprovalIdApproveResponse,
|
|
76
|
+
| errors.ProblemDetailsError
|
|
77
|
+
| errors.OAuthErrorResponse
|
|
78
|
+
| errors.PostApprovalsByApprovalIdApproveUpdateRequiredError
|
|
79
|
+
| SDKError
|
|
80
|
+
| ResponseValidationError
|
|
81
|
+
| ConnectionError
|
|
82
|
+
| RequestAbortedError
|
|
83
|
+
| RequestTimeoutError
|
|
84
|
+
| InvalidRequestError
|
|
85
|
+
| UnexpectedClientError
|
|
86
|
+
| SDKValidationError
|
|
87
|
+
>,
|
|
88
|
+
APICall,
|
|
89
|
+
]
|
|
90
|
+
> {
|
|
91
|
+
const input: operations.PostApprovalsByApprovalIdApproveRequest = {
|
|
92
|
+
approvalId: approvalId,
|
|
93
|
+
body: body,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const parsed = safeParse(
|
|
97
|
+
input,
|
|
98
|
+
(value) =>
|
|
99
|
+
z.parse(
|
|
100
|
+
operations.PostApprovalsByApprovalIdApproveRequest$outboundSchema,
|
|
101
|
+
value,
|
|
102
|
+
),
|
|
103
|
+
"Input validation failed",
|
|
104
|
+
);
|
|
105
|
+
if (!parsed.ok) {
|
|
106
|
+
return [parsed, { status: "invalid" }];
|
|
107
|
+
}
|
|
108
|
+
const payload = parsed.value;
|
|
109
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
110
|
+
|
|
111
|
+
const pathParams = {
|
|
112
|
+
approvalId: encodeSimple("approvalId", payload.approvalId, {
|
|
113
|
+
explode: false,
|
|
114
|
+
charEncoding: "percent",
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
const path = pathToFunc("/approvals/{approvalId}/approve")(pathParams);
|
|
118
|
+
|
|
119
|
+
const headers = new Headers(compactMap({
|
|
120
|
+
"Content-Type": "application/json",
|
|
121
|
+
Accept: "application/json",
|
|
122
|
+
}));
|
|
123
|
+
|
|
124
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
125
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
126
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
127
|
+
|
|
128
|
+
const context = {
|
|
129
|
+
options: client._options,
|
|
130
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
131
|
+
operationID: "postApprovalsByApprovalIdApprove",
|
|
132
|
+
oAuth2Scopes: null,
|
|
133
|
+
|
|
134
|
+
resolvedSecurity: requestSecurity,
|
|
135
|
+
|
|
136
|
+
securitySource: client._options.bearerAuth,
|
|
137
|
+
retryConfig: options?.retries
|
|
138
|
+
|| client._options.retryConfig
|
|
139
|
+
|| { strategy: "none" },
|
|
140
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const requestRes = client._createRequest(context, {
|
|
144
|
+
security: requestSecurity,
|
|
145
|
+
method: "POST",
|
|
146
|
+
baseURL: options?.serverURL,
|
|
147
|
+
path: path,
|
|
148
|
+
headers: headers,
|
|
149
|
+
body: body$,
|
|
150
|
+
userAgent: client._options.userAgent,
|
|
151
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
152
|
+
}, options);
|
|
153
|
+
if (!requestRes.ok) {
|
|
154
|
+
return [requestRes, { status: "invalid" }];
|
|
155
|
+
}
|
|
156
|
+
const req = requestRes.value;
|
|
157
|
+
|
|
158
|
+
const doResult = await client._do(req, {
|
|
159
|
+
context,
|
|
160
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
161
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
162
|
+
retryConfig: context.retryConfig,
|
|
163
|
+
retryCodes: context.retryCodes,
|
|
164
|
+
});
|
|
165
|
+
if (!doResult.ok) {
|
|
166
|
+
return [doResult, { status: "request-error", request: req }];
|
|
167
|
+
}
|
|
168
|
+
const response = doResult.value;
|
|
169
|
+
|
|
170
|
+
const responseFields = {
|
|
171
|
+
HttpMeta: { Response: response, Request: req },
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const [result] = await M.match<
|
|
175
|
+
operations.PostApprovalsByApprovalIdApproveResponse,
|
|
176
|
+
| errors.ProblemDetailsError
|
|
177
|
+
| errors.OAuthErrorResponse
|
|
178
|
+
| errors.PostApprovalsByApprovalIdApproveUpdateRequiredError
|
|
179
|
+
| SDKError
|
|
180
|
+
| ResponseValidationError
|
|
181
|
+
| ConnectionError
|
|
182
|
+
| RequestAbortedError
|
|
183
|
+
| RequestTimeoutError
|
|
184
|
+
| InvalidRequestError
|
|
185
|
+
| UnexpectedClientError
|
|
186
|
+
| SDKValidationError
|
|
187
|
+
>(
|
|
188
|
+
M.json(
|
|
189
|
+
202,
|
|
190
|
+
operations.PostApprovalsByApprovalIdApproveResponse$inboundSchema,
|
|
191
|
+
),
|
|
192
|
+
M.jsonErr(401, errors.ProblemDetailsError$inboundSchema, {
|
|
193
|
+
ctype: "application/problem+json",
|
|
194
|
+
}),
|
|
195
|
+
M.jsonErr(401, errors.OAuthErrorResponse$inboundSchema),
|
|
196
|
+
M.jsonErr(
|
|
197
|
+
426,
|
|
198
|
+
errors.PostApprovalsByApprovalIdApproveUpdateRequiredError$inboundSchema,
|
|
199
|
+
),
|
|
200
|
+
M.jsonErr(
|
|
201
|
+
[400, 404, 409, 413, 428, 429],
|
|
202
|
+
errors.ProblemDetailsError$inboundSchema,
|
|
203
|
+
{ ctype: "application/problem+json" },
|
|
204
|
+
),
|
|
205
|
+
M.jsonErr([500, 503], errors.ProblemDetailsError$inboundSchema, {
|
|
206
|
+
ctype: "application/problem+json",
|
|
207
|
+
}),
|
|
208
|
+
M.jsonErr([500, 503], errors.OAuthErrorResponse$inboundSchema),
|
|
209
|
+
M.fail("4XX"),
|
|
210
|
+
M.fail("5XX"),
|
|
211
|
+
)(response, req, { extraFields: responseFields });
|
|
212
|
+
if (!result.ok) {
|
|
213
|
+
return [result, { status: "complete", request: req, response }];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return [result, { status: "complete", request: req, response }];
|
|
217
|
+
}
|