🚀New lib version [CI SKIP]

This commit is contained in:
2023-02-02 09:42:58 +00:00
parent b3676087f2
commit fa42e1085f
220 changed files with 551 additions and 554 deletions

View File

@@ -1,4 +1,4 @@
export declare type ApiRequestOptions = {
export type ApiRequestOptions = {
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
readonly path: string;
readonly cookies?: Record<string, any>;

View File

@@ -1,4 +1,4 @@
export declare type ApiResult = {
export type ApiResult = {
readonly url: string;
readonly ok: boolean;
readonly status: number;

View File

@@ -1,6 +1,6 @@
declare type Resolver<T> = () => Promise<T>;
declare type Headers = Record<string, string>;
declare type Config = {
type Resolver<T> = () => Promise<T>;
type Headers = Record<string, string>;
type Config = {
BASE: string;
VERSION: string;
WITH_CREDENTIALS: boolean;

View File

@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.OpenAPI = void 0;
exports.OpenAPI = {
BASE: '',
VERSION: '0.11.1',
VERSION: '0.12.0',
WITH_CREDENTIALS: false,
TOKEN: undefined,
USERNAME: undefined,

View File

@@ -3,7 +3,7 @@ import type { ApiResult } from './ApiResult';
/**
* Request using fetch client
* @param options The request options from the the service
* @returns ApiResult
* @result ApiResult
* @throws ApiError
*/
export declare function request(options: ApiRequestOptions): Promise<ApiResult>;

View File

@@ -111,9 +111,6 @@ async function sendRequest(options, url) {
headers: await getHeaders(options),
body: getRequestBody(options),
};
if (OpenAPI_1.OpenAPI.WITH_CREDENTIALS) {
request.credentials = 'include';
}
return await fetch(url, request);
}
function getResponseHeader(response, responseHeader) {
@@ -165,7 +162,7 @@ function catchErrors(options, result) {
/**
* Request using fetch client
* @param options The request options from the the service
* @returns ApiResult
* @result ApiResult
* @throws ApiError
*/
async function request(options) {