wallee
Version:
TypeScript/JavaScript client for wallee
52 lines (51 loc) • 2.38 kB
TypeScript
/**
* Wallee AG TypeScript SDK
*
* This library allows to interact with the Wallee AG payment service.
*
* Copyright owner: Wallee AG
* Website: https://en.wallee.com
* Developer email: ecosystem-team@wallee.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as runtime from '../runtime';
/**
* Utility class for service-related functionality.
*
* The `ServiceUtils` class provides a collection of helper methods that simplify
* common tasks involved in making HTTP requests, handling configurations, and
* managing service-specific logic.
*
* This class is designed to be stateless, offering static methods that can be
* reused throughout the application without the need for instantiation.
*/
export declare class ServiceApiUtils {
/**
* Adjusts the request signal by applying a timeout and handling overrides.
* This function modifies the request configuration by integrating a timeout signal.
* @param initOverrides - Optional request initialization overrides.
* This can be an object of type `RequestInit`
* or a function that returns a modified `RequestInit`.
* @param requestTimeoutInSeconds - The timeout duration in seconds for the request. Defaults to 25 seconds.
* @returns A promise that resolves to a `RequestInit` object with the adjusted signal.
* @throws Will throw an error if the request cannot be configured properly.
*
* @example
* ```typescript
* const resolvedInitOverrides = await adjustRequestSignal({ method: 'GET' }, 30);
* console.log(resolvedInitOverrides.signal); // Output: AbortSignal with a timeout of 30 seconds
* ```
*/
static adjustRequestSignalAsync(initOverrides?: RequestInit | runtime.InitOverrideFunction, requestTimeoutInSeconds?: number): Promise<RequestInit>;
}