pkg-sdk-test 0.0.14
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/dist/cjs/BaseClient.d.ts +41 -0
- package/dist/cjs/BaseClient.js +77 -0
- package/dist/cjs/Client.d.ts +29 -0
- package/dist/cjs/Client.js +88 -0
- package/dist/cjs/api/errors/BadRequestError.d.ts +6 -0
- package/dist/cjs/api/errors/BadRequestError.js +54 -0
- package/dist/cjs/api/errors/InternalServerError.d.ts +6 -0
- package/dist/cjs/api/errors/InternalServerError.js +54 -0
- package/dist/cjs/api/errors/NotFoundError.d.ts +6 -0
- package/dist/cjs/api/errors/NotFoundError.js +54 -0
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +6 -0
- package/dist/cjs/api/errors/UnauthorizedError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +4 -0
- package/dist/cjs/api/errors/index.js +20 -0
- package/dist/cjs/api/index.d.ts +3 -0
- package/dist/cjs/api/index.js +19 -0
- package/dist/cjs/api/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/index.js +44 -0
- package/dist/cjs/api/resources/payments/client/Client.d.ts +92 -0
- package/dist/cjs/api/resources/payments/client/Client.js +362 -0
- package/dist/cjs/api/resources/payments/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/client/index.js +17 -0
- package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.ts +17 -0
- package/dist/cjs/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.ts +13 -0
- package/dist/cjs/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsPaymentIdRequest.d.ts +10 -0
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsPaymentIdRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/payments/client/requests/GetV1PaymentsRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdCancelRequest.d.ts +10 -0
- package/dist/cjs/api/resources/payments/client/requests/PostV1PaymentsPaymentIdCancelRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/payments/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/payments/exports.d.ts +2 -0
- package/dist/cjs/api/resources/payments/exports.js +21 -0
- package/dist/cjs/api/resources/payments/index.d.ts +2 -0
- package/dist/cjs/api/resources/payments/index.js +18 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.ts +2 -0
- package/dist/cjs/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.js +3 -0
- package/dist/cjs/api/resources/payments/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/index.js +17 -0
- package/dist/cjs/api/resources/staticWallets/client/Client.d.ts +105 -0
- package/dist/cjs/api/resources/staticWallets/client/Client.js +442 -0
- package/dist/cjs/api/resources/staticWallets/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/staticWallets/client/index.js +17 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.ts +11 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.ts +15 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.ts +13 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/DeleteV1StaticWalletsStaticWalletIdRequest.d.ts +10 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/DeleteV1StaticWalletsStaticWalletIdRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdRequest.d.ts +10 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdRequest.js +3 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/index.d.ts +6 -0
- package/dist/cjs/api/resources/staticWallets/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/staticWallets/exports.d.ts +2 -0
- package/dist/cjs/api/resources/staticWallets/exports.js +21 -0
- package/dist/cjs/api/resources/staticWallets/index.d.ts +1 -0
- package/dist/cjs/api/resources/staticWallets/index.js +17 -0
- package/dist/cjs/api/types/ControllerErrorResponse.d.ts +5 -0
- package/dist/cjs/api/types/ControllerErrorResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayListPaymentsResponse.d.ts +6 -0
- package/dist/cjs/api/types/CryptopayListPaymentsResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayListStaticDepositsResponse.d.ts +6 -0
- package/dist/cjs/api/types/CryptopayListStaticDepositsResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayListStaticWalletsResponse.d.ts +6 -0
- package/dist/cjs/api/types/CryptopayListStaticWalletsResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayPaymentResponse.d.ts +28 -0
- package/dist/cjs/api/types/CryptopayPaymentResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayPaymentStatusEnum.d.ts +7 -0
- package/dist/cjs/api/types/CryptopayPaymentStatusEnum.js +10 -0
- package/dist/cjs/api/types/CryptopayPaymentSubStatusEnum.d.ts +16 -0
- package/dist/cjs/api/types/CryptopayPaymentSubStatusEnum.js +19 -0
- package/dist/cjs/api/types/CryptopayPublicPaymentResponse.d.ts +18 -0
- package/dist/cjs/api/types/CryptopayPublicPaymentResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayPublicRedirect.d.ts +4 -0
- package/dist/cjs/api/types/CryptopayPublicRedirect.js +3 -0
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.d.ts +5 -0
- package/dist/cjs/api/types/CryptopayRedirectConfigDto.js +3 -0
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.d.ts +20 -0
- package/dist/cjs/api/types/CryptopayStaticDepositResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayStaticWalletResponse.d.ts +12 -0
- package/dist/cjs/api/types/CryptopayStaticWalletResponse.js +3 -0
- package/dist/cjs/api/types/CryptopayTransactionResponse.d.ts +6 -0
- package/dist/cjs/api/types/CryptopayTransactionResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +13 -0
- package/dist/cjs/api/types/index.js +29 -0
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +20 -0
- package/dist/cjs/auth/HeaderAuthProvider.js +80 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +8 -0
- package/dist/cjs/core/auth/AuthProvider.js +9 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +33 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +11 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +17 -0
- package/dist/cjs/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/cjs/core/fetcher/APIResponse.js +2 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/cjs/core/fetcher/BinaryResponse.js +17 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +56 -0
- package/dist/cjs/core/fetcher/Fetcher.js +327 -0
- package/dist/cjs/core/fetcher/Headers.d.ts +2 -0
- package/dist/cjs/core/fetcher/Headers.js +84 -0
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/cjs/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/cjs/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/cjs/core/fetcher/RawResponse.js +44 -0
- package/dist/cjs/core/fetcher/Supplier.d.ts +4 -0
- package/dist/cjs/core/fetcher/Supplier.js +22 -0
- package/dist/cjs/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/cjs/core/fetcher/createRequestUrl.js +8 -0
- package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +45 -0
- package/dist/cjs/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/cjs/core/fetcher/getFetchFn.js +17 -0
- package/dist/cjs/core/fetcher/getHeader.d.ts +1 -0
- package/dist/cjs/core/fetcher/getHeader.js +11 -0
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/cjs/core/fetcher/getRequestBody.js +27 -0
- package/dist/cjs/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +80 -0
- package/dist/cjs/core/fetcher/index.d.ts +13 -0
- package/dist/cjs/core/fetcher/index.js +19 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -0
- package/dist/cjs/core/fetcher/makeRequest.js +61 -0
- package/dist/cjs/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/cjs/core/fetcher/requestWithRetries.js +70 -0
- package/dist/cjs/core/fetcher/signals.d.ts +5 -0
- package/dist/cjs/core/fetcher/signals.js +32 -0
- package/dist/cjs/core/headers.d.ts +2 -0
- package/dist/cjs/core/headers.js +31 -0
- package/dist/cjs/core/index.d.ts +6 -0
- package/dist/cjs/core/index.js +45 -0
- package/dist/cjs/core/json.d.ts +15 -0
- package/dist/cjs/core/json.js +24 -0
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/runtime/index.d.ts +1 -0
- package/dist/cjs/core/runtime/index.js +5 -0
- package/dist/cjs/core/runtime/runtime.d.ts +9 -0
- package/dist/cjs/core/runtime/runtime.js +104 -0
- package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
- package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
- package/dist/cjs/core/url/encodePathParam.js +21 -0
- package/dist/cjs/core/url/index.d.ts +4 -0
- package/dist/cjs/core/url/index.js +11 -0
- package/dist/cjs/core/url/join.d.ts +1 -0
- package/dist/cjs/core/url/join.js +68 -0
- package/dist/cjs/core/url/qs.d.ts +7 -0
- package/dist/cjs/core/url/qs.js +76 -0
- package/dist/cjs/errors/SuwardApiError.d.ts +14 -0
- package/dist/cjs/errors/SuwardApiError.js +35 -0
- package/dist/cjs/errors/SuwardApiTimeoutError.d.ts +6 -0
- package/dist/cjs/errors/SuwardApiTimeoutError.js +18 -0
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +68 -0
- package/dist/cjs/errors/index.d.ts +2 -0
- package/dist/cjs/errors/index.js +7 -0
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +46 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +4 -0
- package/dist/esm/BaseClient.d.mts +41 -0
- package/dist/esm/BaseClient.mjs +40 -0
- package/dist/esm/Client.d.mts +29 -0
- package/dist/esm/Client.mjs +51 -0
- package/dist/esm/api/errors/BadRequestError.d.mts +6 -0
- package/dist/esm/api/errors/BadRequestError.mjs +17 -0
- package/dist/esm/api/errors/InternalServerError.d.mts +6 -0
- package/dist/esm/api/errors/InternalServerError.mjs +17 -0
- package/dist/esm/api/errors/NotFoundError.d.mts +6 -0
- package/dist/esm/api/errors/NotFoundError.mjs +17 -0
- package/dist/esm/api/errors/UnauthorizedError.d.mts +6 -0
- package/dist/esm/api/errors/UnauthorizedError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +4 -0
- package/dist/esm/api/errors/index.mjs +4 -0
- package/dist/esm/api/index.d.mts +3 -0
- package/dist/esm/api/index.mjs +3 -0
- package/dist/esm/api/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/index.mjs +5 -0
- package/dist/esm/api/resources/payments/client/Client.d.mts +92 -0
- package/dist/esm/api/resources/payments/client/Client.mjs +325 -0
- package/dist/esm/api/resources/payments/client/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/client/index.mjs +1 -0
- package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.d.mts +17 -0
- package/dist/esm/api/resources/payments/client/requests/CryptopayCreatePaymentRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.d.mts +13 -0
- package/dist/esm/api/resources/payments/client/requests/CryptopaySimulatePaymentRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsPaymentIdRequest.d.mts +10 -0
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsPaymentIdRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.d.mts +12 -0
- package/dist/esm/api/resources/payments/client/requests/GetV1PaymentsRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdCancelRequest.d.mts +10 -0
- package/dist/esm/api/resources/payments/client/requests/PostV1PaymentsPaymentIdCancelRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/payments/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/payments/exports.d.mts +2 -0
- package/dist/esm/api/resources/payments/exports.mjs +3 -0
- package/dist/esm/api/resources/payments/index.d.mts +2 -0
- package/dist/esm/api/resources/payments/index.mjs +2 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.d.mts +2 -0
- package/dist/esm/api/resources/payments/types/GetV1PaymentsPaymentIdResponse.mjs +2 -0
- package/dist/esm/api/resources/payments/types/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/client/Client.d.mts +105 -0
- package/dist/esm/api/resources/staticWallets/client/Client.mjs +405 -0
- package/dist/esm/api/resources/staticWallets/client/index.d.mts +1 -0
- package/dist/esm/api/resources/staticWallets/client/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.d.mts +11 -0
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayCreateStaticWalletRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.d.mts +15 -0
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopaySimulateStaticDepositRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.d.mts +13 -0
- package/dist/esm/api/resources/staticWallets/client/requests/CryptopayUpdateStaticWalletRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/DeleteV1StaticWalletsStaticWalletIdRequest.d.mts +10 -0
- package/dist/esm/api/resources/staticWallets/client/requests/DeleteV1StaticWalletsStaticWalletIdRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.d.mts +10 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdDepositsRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdRequest.d.mts +10 -0
- package/dist/esm/api/resources/staticWallets/client/requests/GetV1StaticWalletsStaticWalletIdRequest.mjs +2 -0
- package/dist/esm/api/resources/staticWallets/client/requests/index.d.mts +6 -0
- package/dist/esm/api/resources/staticWallets/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/staticWallets/exports.d.mts +2 -0
- package/dist/esm/api/resources/staticWallets/exports.mjs +3 -0
- package/dist/esm/api/resources/staticWallets/index.d.mts +1 -0
- package/dist/esm/api/resources/staticWallets/index.mjs +1 -0
- package/dist/esm/api/types/ControllerErrorResponse.d.mts +5 -0
- package/dist/esm/api/types/ControllerErrorResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayListPaymentsResponse.d.mts +6 -0
- package/dist/esm/api/types/CryptopayListPaymentsResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayListStaticDepositsResponse.d.mts +6 -0
- package/dist/esm/api/types/CryptopayListStaticDepositsResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayListStaticWalletsResponse.d.mts +6 -0
- package/dist/esm/api/types/CryptopayListStaticWalletsResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayPaymentResponse.d.mts +28 -0
- package/dist/esm/api/types/CryptopayPaymentResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayPaymentStatusEnum.d.mts +7 -0
- package/dist/esm/api/types/CryptopayPaymentStatusEnum.mjs +7 -0
- package/dist/esm/api/types/CryptopayPaymentSubStatusEnum.d.mts +16 -0
- package/dist/esm/api/types/CryptopayPaymentSubStatusEnum.mjs +16 -0
- package/dist/esm/api/types/CryptopayPublicPaymentResponse.d.mts +18 -0
- package/dist/esm/api/types/CryptopayPublicPaymentResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayPublicRedirect.d.mts +4 -0
- package/dist/esm/api/types/CryptopayPublicRedirect.mjs +2 -0
- package/dist/esm/api/types/CryptopayRedirectConfigDto.d.mts +5 -0
- package/dist/esm/api/types/CryptopayRedirectConfigDto.mjs +2 -0
- package/dist/esm/api/types/CryptopayStaticDepositResponse.d.mts +20 -0
- package/dist/esm/api/types/CryptopayStaticDepositResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayStaticWalletResponse.d.mts +12 -0
- package/dist/esm/api/types/CryptopayStaticWalletResponse.mjs +2 -0
- package/dist/esm/api/types/CryptopayTransactionResponse.d.mts +6 -0
- package/dist/esm/api/types/CryptopayTransactionResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +13 -0
- package/dist/esm/api/types/index.mjs +13 -0
- package/dist/esm/auth/HeaderAuthProvider.d.mts +20 -0
- package/dist/esm/auth/HeaderAuthProvider.mjs +43 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +8 -0
- package/dist/esm/core/auth/AuthProvider.mjs +6 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +30 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +4 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/APIResponse.d.mts +20 -0
- package/dist/esm/core/fetcher/APIResponse.mjs +1 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +19 -0
- package/dist/esm/core/fetcher/BinaryResponse.mjs +14 -0
- package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
- package/dist/esm/core/fetcher/EndpointMetadata.mjs +1 -0
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +56 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +323 -0
- package/dist/esm/core/fetcher/Headers.d.mts +2 -0
- package/dist/esm/core/fetcher/Headers.mjs +82 -0
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +58 -0
- package/dist/esm/core/fetcher/HttpResponsePromise.mjs +99 -0
- package/dist/esm/core/fetcher/RawResponse.d.mts +29 -0
- package/dist/esm/core/fetcher/RawResponse.mjs +40 -0
- package/dist/esm/core/fetcher/Supplier.d.mts +4 -0
- package/dist/esm/core/fetcher/Supplier.mjs +19 -0
- package/dist/esm/core/fetcher/createRequestUrl.d.mts +1 -0
- package/dist/esm/core/fetcher/createRequestUrl.mjs +5 -0
- package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +1 -0
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +42 -0
- package/dist/esm/core/fetcher/getFetchFn.d.mts +1 -0
- package/dist/esm/core/fetcher/getFetchFn.mjs +14 -0
- package/dist/esm/core/fetcher/getHeader.d.mts +1 -0
- package/dist/esm/core/fetcher/getHeader.mjs +8 -0
- package/dist/esm/core/fetcher/getRequestBody.d.mts +7 -0
- package/dist/esm/core/fetcher/getRequestBody.mjs +24 -0
- package/dist/esm/core/fetcher/getResponseBody.d.mts +1 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +77 -0
- package/dist/esm/core/fetcher/index.d.mts +13 -0
- package/dist/esm/core/fetcher/index.mjs +7 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -0
- package/dist/esm/core/fetcher/makeRequest.mjs +55 -0
- package/dist/esm/core/fetcher/requestWithRetries.d.mts +1 -0
- package/dist/esm/core/fetcher/requestWithRetries.mjs +67 -0
- package/dist/esm/core/fetcher/signals.d.mts +5 -0
- package/dist/esm/core/fetcher/signals.mjs +28 -0
- package/dist/esm/core/headers.d.mts +2 -0
- package/dist/esm/core/headers.mjs +27 -0
- package/dist/esm/core/index.d.mts +6 -0
- package/dist/esm/core/index.mjs +6 -0
- package/dist/esm/core/json.d.mts +15 -0
- package/dist/esm/core/json.mjs +19 -0
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/runtime/index.d.mts +1 -0
- package/dist/esm/core/runtime/index.mjs +1 -0
- package/dist/esm/core/runtime/runtime.d.mts +9 -0
- package/dist/esm/core/runtime/runtime.mjs +101 -0
- package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
- package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
- package/dist/esm/core/url/encodePathParam.d.mts +1 -0
- package/dist/esm/core/url/encodePathParam.mjs +18 -0
- package/dist/esm/core/url/index.d.mts +4 -0
- package/dist/esm/core/url/index.mjs +4 -0
- package/dist/esm/core/url/join.d.mts +1 -0
- package/dist/esm/core/url/join.mjs +65 -0
- package/dist/esm/core/url/qs.d.mts +7 -0
- package/dist/esm/core/url/qs.mjs +73 -0
- package/dist/esm/errors/SuwardApiError.d.mts +14 -0
- package/dist/esm/errors/SuwardApiError.mjs +31 -0
- package/dist/esm/errors/SuwardApiTimeoutError.d.mts +6 -0
- package/dist/esm/errors/SuwardApiTimeoutError.mjs +14 -0
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +32 -0
- package/dist/esm/errors/index.d.mts +2 -0
- package/dist/esm/errors/index.mjs +2 -0
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +5 -0
- package/dist/esm/index.mjs +4 -0
- package/dist/esm/version.d.mts +1 -0
- package/dist/esm/version.mjs +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.handleNonStatusCodeError = handleNonStatusCodeError;
|
|
38
|
+
const errors = __importStar(require("./index.js"));
|
|
39
|
+
function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
40
|
+
switch (error.reason) {
|
|
41
|
+
case "non-json":
|
|
42
|
+
throw new errors.SuwardApiError({
|
|
43
|
+
statusCode: error.statusCode,
|
|
44
|
+
body: error.rawBody,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
case "body-is-null":
|
|
48
|
+
throw new errors.SuwardApiError({
|
|
49
|
+
statusCode: error.statusCode,
|
|
50
|
+
rawResponse: rawResponse,
|
|
51
|
+
});
|
|
52
|
+
case "timeout":
|
|
53
|
+
throw new errors.SuwardApiTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
54
|
+
cause: error.cause,
|
|
55
|
+
});
|
|
56
|
+
case "unknown":
|
|
57
|
+
throw new errors.SuwardApiError({
|
|
58
|
+
message: error.errorMessage,
|
|
59
|
+
rawResponse: rawResponse,
|
|
60
|
+
cause: error.cause,
|
|
61
|
+
});
|
|
62
|
+
default:
|
|
63
|
+
throw new errors.SuwardApiError({
|
|
64
|
+
message: "Unknown error",
|
|
65
|
+
rawResponse: rawResponse,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuwardApiTimeoutError = exports.SuwardApiError = void 0;
|
|
4
|
+
var SuwardApiError_js_1 = require("./SuwardApiError.js");
|
|
5
|
+
Object.defineProperty(exports, "SuwardApiError", { enumerable: true, get: function () { return SuwardApiError_js_1.SuwardApiError; } });
|
|
6
|
+
var SuwardApiTimeoutError_js_1 = require("./SuwardApiTimeoutError.js");
|
|
7
|
+
Object.defineProperty(exports, "SuwardApiTimeoutError", { enumerable: true, get: function () { return SuwardApiTimeoutError_js_1.SuwardApiTimeoutError; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/exports.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./core/exports.js"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * as SuwardApi from "./api/index.js";
|
|
2
|
+
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
3
|
+
export { SuwardApiClient } from "./Client.js";
|
|
4
|
+
export { SuwardApiError, SuwardApiTimeoutError } from "./errors/index.js";
|
|
5
|
+
export * from "./exports.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.SuwardApiTimeoutError = exports.SuwardApiError = exports.SuwardApiClient = exports.SuwardApi = void 0;
|
|
40
|
+
exports.SuwardApi = __importStar(require("./api/index.js"));
|
|
41
|
+
var Client_js_1 = require("./Client.js");
|
|
42
|
+
Object.defineProperty(exports, "SuwardApiClient", { enumerable: true, get: function () { return Client_js_1.SuwardApiClient; } });
|
|
43
|
+
var index_js_1 = require("./errors/index.js");
|
|
44
|
+
Object.defineProperty(exports, "SuwardApiError", { enumerable: true, get: function () { return index_js_1.SuwardApiError; } });
|
|
45
|
+
Object.defineProperty(exports, "SuwardApiTimeoutError", { enumerable: true, get: function () { return index_js_1.SuwardApiTimeoutError; } });
|
|
46
|
+
__exportStar(require("./exports.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "0.0.14";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
|
|
2
|
+
import * as core from "./core/index.mjs";
|
|
3
|
+
export type AuthOption = false | core.AuthProvider["getAuthRequest"] | core.AuthProvider | HeaderAuthProvider.AuthOptions;
|
|
4
|
+
export type BaseClientOptions = {
|
|
5
|
+
environment: core.Supplier<string>;
|
|
6
|
+
/** Specify a custom URL to connect the client to. */
|
|
7
|
+
baseUrl?: core.Supplier<string>;
|
|
8
|
+
/** Additional headers to include in requests. */
|
|
9
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
|
+
/** The default maximum time to wait for a response in seconds. */
|
|
11
|
+
timeoutInSeconds?: number;
|
|
12
|
+
/** The default number of times to retry the request. Defaults to 2. */
|
|
13
|
+
maxRetries?: number;
|
|
14
|
+
/** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
|
|
15
|
+
fetch?: typeof fetch;
|
|
16
|
+
/** Configure logging for the client. */
|
|
17
|
+
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
18
|
+
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
|
|
19
|
+
auth?: AuthOption;
|
|
20
|
+
} & HeaderAuthProvider.AuthOptions;
|
|
21
|
+
export interface BaseRequestOptions {
|
|
22
|
+
/** The maximum time to wait for a response in seconds. */
|
|
23
|
+
timeoutInSeconds?: number;
|
|
24
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
25
|
+
maxRetries?: number;
|
|
26
|
+
/** A hook to abort the request. */
|
|
27
|
+
abortSignal?: AbortSignal;
|
|
28
|
+
/** Additional query string parameters to include in the request. */
|
|
29
|
+
queryParams?: Record<string, unknown>;
|
|
30
|
+
/** Additional headers to include in the request. */
|
|
31
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
32
|
+
}
|
|
33
|
+
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
34
|
+
logging: core.logging.Logger;
|
|
35
|
+
authProvider?: core.AuthProvider;
|
|
36
|
+
};
|
|
37
|
+
export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> = NormalizedClientOptions<T> & {
|
|
38
|
+
authProvider: core.AuthProvider;
|
|
39
|
+
};
|
|
40
|
+
export declare function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptions<T>;
|
|
41
|
+
export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
|
|
3
|
+
import { mergeHeaders } from "./core/headers.mjs";
|
|
4
|
+
import * as core from "./core/index.mjs";
|
|
5
|
+
export function normalizeClientOptions(options) {
|
|
6
|
+
const headers = mergeHeaders({
|
|
7
|
+
"X-Fern-Language": "JavaScript",
|
|
8
|
+
"X-Fern-SDK-Name": "@suward/sdk",
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.14",
|
|
10
|
+
"User-Agent": "@suward/sdk/0.0.14",
|
|
11
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
|
+
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
14
|
+
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
15
|
+
}
|
|
16
|
+
export function normalizeClientOptionsWithAuth(options) {
|
|
17
|
+
var _a;
|
|
18
|
+
const normalized = normalizeClientOptions(options);
|
|
19
|
+
if (options.auth === false) {
|
|
20
|
+
normalized.authProvider = new core.NoOpAuthProvider();
|
|
21
|
+
return normalized;
|
|
22
|
+
}
|
|
23
|
+
if (options.auth != null) {
|
|
24
|
+
if (typeof options.auth === "function") {
|
|
25
|
+
normalized.authProvider = { getAuthRequest: options.auth };
|
|
26
|
+
return normalized;
|
|
27
|
+
}
|
|
28
|
+
if (core.isAuthProvider(options.auth)) {
|
|
29
|
+
normalized.authProvider = options.auth;
|
|
30
|
+
return normalized;
|
|
31
|
+
}
|
|
32
|
+
Object.assign(normalized, options.auth);
|
|
33
|
+
}
|
|
34
|
+
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
35
|
+
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new HeaderAuthProvider(normalizedWithNoOpAuthProvider));
|
|
36
|
+
return normalized;
|
|
37
|
+
}
|
|
38
|
+
function withNoOpAuthProvider(options) {
|
|
39
|
+
return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
|
|
40
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PaymentsClient } from "./api/resources/payments/client/Client.mjs";
|
|
2
|
+
import { StaticWalletsClient } from "./api/resources/staticWallets/client/Client.mjs";
|
|
3
|
+
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
4
|
+
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
5
|
+
import * as core from "./core/index.mjs";
|
|
6
|
+
export declare namespace SuwardApiClient {
|
|
7
|
+
type Options = BaseClientOptions;
|
|
8
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare class SuwardApiClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<SuwardApiClient.Options>;
|
|
13
|
+
protected _payments: PaymentsClient | undefined;
|
|
14
|
+
protected _staticWallets: StaticWalletsClient | undefined;
|
|
15
|
+
constructor(options: SuwardApiClient.Options);
|
|
16
|
+
get payments(): PaymentsClient;
|
|
17
|
+
get staticWallets(): StaticWalletsClient;
|
|
18
|
+
/**
|
|
19
|
+
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
20
|
+
* This is useful for making requests to endpoints not yet supported in the SDK.
|
|
21
|
+
* The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
|
|
22
|
+
*
|
|
23
|
+
* @param {Request | string | URL} input - The URL, path, or Request object.
|
|
24
|
+
* @param {RequestInit} init - Standard fetch RequestInit options.
|
|
25
|
+
* @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
|
|
26
|
+
* @returns {Promise<Response>} A standard Response object.
|
|
27
|
+
*/
|
|
28
|
+
fetch(input: Request | string | URL, init?: RequestInit, requestOptions?: core.PassthroughRequest.RequestOptions): Promise<Response>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { PaymentsClient } from "./api/resources/payments/client/Client.mjs";
|
|
12
|
+
import { StaticWalletsClient } from "./api/resources/staticWallets/client/Client.mjs";
|
|
13
|
+
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
14
|
+
import * as core from "./core/index.mjs";
|
|
15
|
+
export class SuwardApiClient {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
18
|
+
}
|
|
19
|
+
get payments() {
|
|
20
|
+
var _a;
|
|
21
|
+
return ((_a = this._payments) !== null && _a !== void 0 ? _a : (this._payments = new PaymentsClient(this._options)));
|
|
22
|
+
}
|
|
23
|
+
get staticWallets() {
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = this._staticWallets) !== null && _a !== void 0 ? _a : (this._staticWallets = new StaticWalletsClient(this._options)));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
29
|
+
* This is useful for making requests to endpoints not yet supported in the SDK.
|
|
30
|
+
* The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
|
|
31
|
+
*
|
|
32
|
+
* @param {Request | string | URL} input - The URL, path, or Request object.
|
|
33
|
+
* @param {RequestInit} init - Standard fetch RequestInit options.
|
|
34
|
+
* @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
|
|
35
|
+
* @returns {Promise<Response>} A standard Response object.
|
|
36
|
+
*/
|
|
37
|
+
fetch(input, init, requestOptions) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a;
|
|
40
|
+
return core.makePassthroughRequest(input, init, {
|
|
41
|
+
baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : this._options.environment,
|
|
42
|
+
headers: this._options.headers,
|
|
43
|
+
timeoutInSeconds: this._options.timeoutInSeconds,
|
|
44
|
+
maxRetries: this._options.maxRetries,
|
|
45
|
+
fetch: this._options.fetch,
|
|
46
|
+
logging: this._options.logging,
|
|
47
|
+
getAuthHeaders: () => __awaiter(this, void 0, void 0, function* () { return (yield this._options.authProvider.getAuthRequest()).headers; }),
|
|
48
|
+
}, requestOptions);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as SuwardApi from "../index.mjs";
|
|
4
|
+
export declare class BadRequestError extends errors.SuwardApiError {
|
|
5
|
+
constructor(body: SuwardApi.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class BadRequestError extends errors.SuwardApiError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "BadRequestError",
|
|
7
|
+
statusCode: 400,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = "BadRequestError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as SuwardApi from "../index.mjs";
|
|
4
|
+
export declare class InternalServerError extends errors.SuwardApiError {
|
|
5
|
+
constructor(body: SuwardApi.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class InternalServerError extends errors.SuwardApiError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "InternalServerError",
|
|
7
|
+
statusCode: 500,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = "InternalServerError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as SuwardApi from "../index.mjs";
|
|
4
|
+
export declare class NotFoundError extends errors.SuwardApiError {
|
|
5
|
+
constructor(body: SuwardApi.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class NotFoundError extends errors.SuwardApiError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "NotFoundError",
|
|
7
|
+
statusCode: 404,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = "NotFoundError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as SuwardApi from "../index.mjs";
|
|
4
|
+
export declare class UnauthorizedError extends errors.SuwardApiError {
|
|
5
|
+
constructor(body: SuwardApi.ControllerErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class UnauthorizedError extends errors.SuwardApiError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "UnauthorizedError",
|
|
7
|
+
statusCode: 401,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = "UnauthorizedError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./payments/client/requests/index.mjs";
|
|
2
|
+
export * as payments from "./payments/index.mjs";
|
|
3
|
+
export * from "./payments/types/index.mjs";
|
|
4
|
+
export * from "./staticWallets/client/requests/index.mjs";
|
|
5
|
+
export * as staticWallets from "./staticWallets/index.mjs";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./payments/client/requests/index.mjs";
|
|
2
|
+
export * as payments from "./payments/index.mjs";
|
|
3
|
+
export * from "./payments/types/index.mjs";
|
|
4
|
+
export * from "./staticWallets/client/requests/index.mjs";
|
|
5
|
+
export * as staticWallets from "./staticWallets/index.mjs";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as SuwardApi from "../../../index.mjs";
|
|
5
|
+
export declare namespace PaymentsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class PaymentsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<PaymentsClient.Options>;
|
|
12
|
+
constructor(options: PaymentsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* List payments for a project
|
|
15
|
+
*
|
|
16
|
+
* @param {SuwardApi.GetV1PaymentsRequest} request
|
|
17
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link SuwardApi.BadRequestError}
|
|
20
|
+
* @throws {@link SuwardApi.UnauthorizedError}
|
|
21
|
+
* @throws {@link SuwardApi.InternalServerError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.payments.listPayments()
|
|
25
|
+
*/
|
|
26
|
+
listPayments(request?: SuwardApi.GetV1PaymentsRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardApi.CryptopayListPaymentsResponse>;
|
|
27
|
+
private __listPayments;
|
|
28
|
+
/**
|
|
29
|
+
* Create a new payment
|
|
30
|
+
*
|
|
31
|
+
* @param {SuwardApi.CryptopayCreatePaymentRequest} request
|
|
32
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
|
+
*
|
|
34
|
+
* @throws {@link SuwardApi.BadRequestError}
|
|
35
|
+
* @throws {@link SuwardApi.UnauthorizedError}
|
|
36
|
+
* @throws {@link SuwardApi.InternalServerError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.payments.createPayment()
|
|
40
|
+
*/
|
|
41
|
+
createPayment(request?: SuwardApi.CryptopayCreatePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardApi.CryptopayPaymentResponse>;
|
|
42
|
+
private __createPayment;
|
|
43
|
+
/**
|
|
44
|
+
* Returns full payment details when called with an API key (merchant view).
|
|
45
|
+
* Returns limited payment details when called without an API key (customer view).
|
|
46
|
+
*
|
|
47
|
+
* @param {SuwardApi.GetV1PaymentsPaymentIdRequest} request
|
|
48
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
49
|
+
*
|
|
50
|
+
* @throws {@link SuwardApi.InternalServerError}
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* await client.payments.getPayment({
|
|
54
|
+
* paymentId: "paymentId"
|
|
55
|
+
* })
|
|
56
|
+
*/
|
|
57
|
+
getPayment(request: SuwardApi.GetV1PaymentsPaymentIdRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardApi.GetV1PaymentsPaymentIdResponse>;
|
|
58
|
+
private __getPayment;
|
|
59
|
+
/**
|
|
60
|
+
* Cancel a payment
|
|
61
|
+
*
|
|
62
|
+
* @param {SuwardApi.PostV1PaymentsPaymentIdCancelRequest} request
|
|
63
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link SuwardApi.UnauthorizedError}
|
|
66
|
+
* @throws {@link SuwardApi.InternalServerError}
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.payments.cancelPayment({
|
|
70
|
+
* paymentId: "paymentId"
|
|
71
|
+
* })
|
|
72
|
+
*/
|
|
73
|
+
cancelPayment(request: SuwardApi.PostV1PaymentsPaymentIdCancelRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardApi.CryptopayPaymentResponse>;
|
|
74
|
+
private __cancelPayment;
|
|
75
|
+
/**
|
|
76
|
+
* Simulate payment status change (test mode only)
|
|
77
|
+
*
|
|
78
|
+
* @param {SuwardApi.CryptopaySimulatePaymentRequest} request
|
|
79
|
+
* @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
|
+
*
|
|
81
|
+
* @throws {@link SuwardApi.BadRequestError}
|
|
82
|
+
* @throws {@link SuwardApi.UnauthorizedError}
|
|
83
|
+
* @throws {@link SuwardApi.InternalServerError}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* await client.payments.simulatePayment({
|
|
87
|
+
* paymentId: "paymentId"
|
|
88
|
+
* })
|
|
89
|
+
*/
|
|
90
|
+
simulatePayment(request: SuwardApi.CryptopaySimulatePaymentRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<SuwardApi.CryptopayPaymentResponse>;
|
|
91
|
+
private __simulatePayment;
|
|
92
|
+
}
|