@civitai/client 0.1.9-beta.9 → 0.2.0-beta.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 +0 -0
- package/dist/client/CivitaiClient.d.ts +2 -1
- package/dist/client/CivitaiClient.js +13 -13
- package/dist/generated/client/client.d.ts +2 -0
- package/dist/generated/client/client.js +145 -0
- package/dist/generated/client/index.d.ts +22 -0
- package/dist/generated/client/index.js +4 -0
- package/dist/generated/client/types.d.ts +185 -0
- package/dist/generated/client/utils.d.ts +72 -0
- package/dist/generated/client/utils.js +285 -0
- package/dist/generated/client.gen.d.ts +14 -0
- package/dist/generated/client.gen.js +3 -0
- package/dist/generated/core/auth.d.ts +21 -0
- package/dist/generated/core/auth.js +13 -0
- package/dist/generated/core/bodySerializer.d.ts +17 -0
- package/dist/generated/core/bodySerializer.js +53 -0
- package/dist/generated/core/params.d.ts +38 -0
- package/dist/generated/core/params.js +88 -0
- package/dist/generated/core/pathSerializer.d.ts +49 -0
- package/dist/generated/core/pathSerializer.js +105 -0
- package/dist/generated/core/types.d.ts +89 -0
- package/dist/generated/core/types.js +1 -0
- package/dist/generated/index.d.ts +1 -2
- package/dist/generated/index.js +2 -6
- package/dist/generated/schemas.gen.d.ts +2083 -2028
- package/dist/generated/schemas.gen.js +2093 -2031
- package/dist/generated/sdk.gen.d.ts +370 -0
- package/dist/generated/sdk.gen.js +472 -0
- package/dist/generated/services.gen.d.ts +88 -90
- package/dist/generated/services.gen.js +100 -147
- package/dist/generated/types.gen.d.ts +1545 -1982
- package/dist/generated/types.gen.js +70 -134
- package/dist/index.js +3 -6
- package/dist/utils/Air.js +2 -6
- package/dist/utils/TimeSpan.js +24 -28
- package/dist/utils/handleError.d.ts +2 -0
- package/dist/utils/handleError.js +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +4 -6
- package/dist/utils/patch-json.js +19 -8
- package/dist/utils/types.d.ts +3 -0
- package/dist/utils/types.js +1 -0
- package/package.json +5 -3
- package/dist/client/RequestsClient.d.ts +0 -0
- package/dist/client/RequestsClient.js +0 -58
- package/dist/generated/GeneratedClient.d.ts +0 -22
- package/dist/generated/GeneratedClient.js +0 -40
- package/dist/generated/core/ApiError.d.ts +0 -10
- package/dist/generated/core/ApiError.js +0 -15
- package/dist/generated/core/ApiRequestOptions.d.ts +0 -13
- package/dist/generated/core/ApiRequestOptions.js +0 -2
- package/dist/generated/core/ApiResult.d.ts +0 -7
- package/dist/generated/core/ApiResult.js +0 -2
- package/dist/generated/core/AxiosHttpRequest.d.ts +0 -14
- package/dist/generated/core/AxiosHttpRequest.js +0 -20
- package/dist/generated/core/BaseHttpRequest.d.ts +0 -8
- package/dist/generated/core/BaseHttpRequest.js +0 -9
- package/dist/generated/core/CancelablePromise.d.ts +0 -37
- package/dist/generated/core/CancelablePromise.js +0 -93
- package/dist/generated/core/FetchHttpRequest.d.ts +0 -14
- package/dist/generated/core/FetchHttpRequest.js +0 -20
- package/dist/generated/core/OpenAPI.d.ts +0 -27
- package/dist/generated/core/OpenAPI.js +0 -33
- package/dist/generated/core/request.d.ts +0 -49
- package/dist/generated/core/request.js +0 -325
- package/dist/generated/enums.gen.d.ts +0 -97
- package/dist/generated/enums.gen.js +0 -101
- package/dist/utils/CivitaiClientError.d.ts +0 -0
- package/dist/utils/CivitaiClientError.js +0 -4
- package/dist/utils/CivitaiError.d.ts +0 -5
- package/dist/utils/CivitaiError.js +0 -13
- package/dist/utils/createClient.js +0 -119
- /package/dist/{utils/createClient.d.ts → generated/client/types.js} +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GeneratedClient = void 0;
|
|
4
|
-
const OpenAPI_1 = require("./core/OpenAPI");
|
|
5
|
-
const FetchHttpRequest_1 = require("./core/FetchHttpRequest");
|
|
6
|
-
const services_gen_1 = require("./services.gen");
|
|
7
|
-
const services_gen_2 = require("./services.gen");
|
|
8
|
-
const services_gen_3 = require("./services.gen");
|
|
9
|
-
const services_gen_4 = require("./services.gen");
|
|
10
|
-
const services_gen_5 = require("./services.gen");
|
|
11
|
-
const services_gen_6 = require("./services.gen");
|
|
12
|
-
const services_gen_7 = require("./services.gen");
|
|
13
|
-
class GeneratedClient {
|
|
14
|
-
constructor(config, HttpRequest = FetchHttpRequest_1.FetchHttpRequest) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
16
|
-
this.request = new HttpRequest({
|
|
17
|
-
BASE: (_a = config === null || config === void 0 ? void 0 : config.BASE) !== null && _a !== void 0 ? _a : '',
|
|
18
|
-
VERSION: (_b = config === null || config === void 0 ? void 0 : config.VERSION) !== null && _b !== void 0 ? _b : '2',
|
|
19
|
-
WITH_CREDENTIALS: (_c = config === null || config === void 0 ? void 0 : config.WITH_CREDENTIALS) !== null && _c !== void 0 ? _c : false,
|
|
20
|
-
CREDENTIALS: (_d = config === null || config === void 0 ? void 0 : config.CREDENTIALS) !== null && _d !== void 0 ? _d : 'include',
|
|
21
|
-
TOKEN: config === null || config === void 0 ? void 0 : config.TOKEN,
|
|
22
|
-
USERNAME: config === null || config === void 0 ? void 0 : config.USERNAME,
|
|
23
|
-
PASSWORD: config === null || config === void 0 ? void 0 : config.PASSWORD,
|
|
24
|
-
HEADERS: config === null || config === void 0 ? void 0 : config.HEADERS,
|
|
25
|
-
ENCODE_PATH: config === null || config === void 0 ? void 0 : config.ENCODE_PATH,
|
|
26
|
-
interceptors: {
|
|
27
|
-
request: (_f = (_e = config === null || config === void 0 ? void 0 : config.interceptors) === null || _e === void 0 ? void 0 : _e.request) !== null && _f !== void 0 ? _f : new OpenAPI_1.Interceptors(),
|
|
28
|
-
response: (_h = (_g = config === null || config === void 0 ? void 0 : config.interceptors) === null || _g === void 0 ? void 0 : _g.response) !== null && _h !== void 0 ? _h : new OpenAPI_1.Interceptors(),
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
this.blobs = new services_gen_1.BlobsService(this.request);
|
|
32
|
-
this.configurations = new services_gen_2.ConfigurationsService(this.request);
|
|
33
|
-
this.resources = new services_gen_3.ResourcesService(this.request);
|
|
34
|
-
this.workerJobs = new services_gen_4.WorkerJobsService(this.request);
|
|
35
|
-
this.workers = new services_gen_5.WorkersService(this.request);
|
|
36
|
-
this.workflows = new services_gen_6.WorkflowsService(this.request);
|
|
37
|
-
this.workflowSteps = new services_gen_7.WorkflowStepsService(this.request);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.GeneratedClient = GeneratedClient;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import type { ApiResult } from './ApiResult';
|
|
3
|
-
export declare class ApiError extends Error {
|
|
4
|
-
readonly url: string;
|
|
5
|
-
readonly status: number;
|
|
6
|
-
readonly statusText: string;
|
|
7
|
-
readonly body: unknown;
|
|
8
|
-
readonly request: ApiRequestOptions;
|
|
9
|
-
constructor(request: ApiRequestOptions, response: ApiResult, message: string);
|
|
10
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiError = void 0;
|
|
4
|
-
class ApiError extends Error {
|
|
5
|
-
constructor(request, response, message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'ApiError';
|
|
8
|
-
this.url = response.url;
|
|
9
|
-
this.status = response.status;
|
|
10
|
-
this.statusText = response.statusText;
|
|
11
|
-
this.body = response.body;
|
|
12
|
-
this.request = request;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.ApiError = ApiError;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type ApiRequestOptions = {
|
|
2
|
-
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
3
|
-
readonly url: string;
|
|
4
|
-
readonly path?: Record<string, unknown>;
|
|
5
|
-
readonly cookies?: Record<string, unknown>;
|
|
6
|
-
readonly headers?: Record<string, unknown>;
|
|
7
|
-
readonly query?: Record<string, unknown>;
|
|
8
|
-
readonly formData?: Record<string, unknown>;
|
|
9
|
-
readonly body?: any;
|
|
10
|
-
readonly mediaType?: string;
|
|
11
|
-
readonly responseHeader?: string;
|
|
12
|
-
readonly errors?: Record<number, string>;
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import { BaseHttpRequest } from './BaseHttpRequest';
|
|
3
|
-
import type { CancelablePromise } from './CancelablePromise';
|
|
4
|
-
import type { OpenAPIConfig } from './OpenAPI';
|
|
5
|
-
export declare class AxiosHttpRequest extends BaseHttpRequest {
|
|
6
|
-
constructor(config: OpenAPIConfig);
|
|
7
|
-
/**
|
|
8
|
-
* Request method
|
|
9
|
-
* @param options The request options from the service
|
|
10
|
-
* @returns CancelablePromise<T>
|
|
11
|
-
* @throws ApiError
|
|
12
|
-
*/
|
|
13
|
-
request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AxiosHttpRequest = void 0;
|
|
4
|
-
const BaseHttpRequest_1 = require("./BaseHttpRequest");
|
|
5
|
-
const request_1 = require("./request");
|
|
6
|
-
class AxiosHttpRequest extends BaseHttpRequest_1.BaseHttpRequest {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
super(config);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Request method
|
|
12
|
-
* @param options The request options from the service
|
|
13
|
-
* @returns CancelablePromise<T>
|
|
14
|
-
* @throws ApiError
|
|
15
|
-
*/
|
|
16
|
-
request(options) {
|
|
17
|
-
return (0, request_1.request)(this.config, options);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.AxiosHttpRequest = AxiosHttpRequest;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import type { CancelablePromise } from './CancelablePromise';
|
|
3
|
-
import type { OpenAPIConfig } from './OpenAPI';
|
|
4
|
-
export declare abstract class BaseHttpRequest {
|
|
5
|
-
readonly config: OpenAPIConfig;
|
|
6
|
-
constructor(config: OpenAPIConfig);
|
|
7
|
-
abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
|
8
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare class CancelError extends Error {
|
|
2
|
-
constructor(message: string);
|
|
3
|
-
get isCancelled(): boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface OnCancel {
|
|
6
|
-
readonly isResolved: boolean;
|
|
7
|
-
readonly isRejected: boolean;
|
|
8
|
-
readonly isCancelled: boolean;
|
|
9
|
-
(cancelHandler: () => void): void;
|
|
10
|
-
}
|
|
11
|
-
export declare class CancelablePromise<T> implements Promise<T> {
|
|
12
|
-
private _isResolved;
|
|
13
|
-
private _isRejected;
|
|
14
|
-
private _isCancelled;
|
|
15
|
-
readonly cancelHandlers: (() => void)[];
|
|
16
|
-
readonly promise: Promise<T>;
|
|
17
|
-
private _resolve?;
|
|
18
|
-
private _reject?;
|
|
19
|
-
constructor(
|
|
20
|
-
executor: (
|
|
21
|
-
resolve: (value: T | PromiseLike<T>) => void,
|
|
22
|
-
reject: (reason?: unknown) => void,
|
|
23
|
-
onCancel: OnCancel
|
|
24
|
-
) => void
|
|
25
|
-
);
|
|
26
|
-
get [Symbol.toStringTag](): string;
|
|
27
|
-
then<TResult1 = T, TResult2 = never>(
|
|
28
|
-
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
|
29
|
-
onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null
|
|
30
|
-
): Promise<TResult1 | TResult2>;
|
|
31
|
-
catch<TResult = never>(
|
|
32
|
-
onRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null
|
|
33
|
-
): Promise<T | TResult>;
|
|
34
|
-
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
35
|
-
cancel(): void;
|
|
36
|
-
get isCancelled(): boolean;
|
|
37
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CancelablePromise = exports.CancelError = void 0;
|
|
4
|
-
class CancelError extends Error {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'CancelError';
|
|
8
|
-
}
|
|
9
|
-
get isCancelled() {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.CancelError = CancelError;
|
|
14
|
-
class CancelablePromise {
|
|
15
|
-
constructor(executor) {
|
|
16
|
-
this._isResolved = false;
|
|
17
|
-
this._isRejected = false;
|
|
18
|
-
this._isCancelled = false;
|
|
19
|
-
this.cancelHandlers = [];
|
|
20
|
-
this.promise = new Promise((resolve, reject) => {
|
|
21
|
-
this._resolve = resolve;
|
|
22
|
-
this._reject = reject;
|
|
23
|
-
const onResolve = (value) => {
|
|
24
|
-
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
this._isResolved = true;
|
|
28
|
-
if (this._resolve)
|
|
29
|
-
this._resolve(value);
|
|
30
|
-
};
|
|
31
|
-
const onReject = (reason) => {
|
|
32
|
-
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
this._isRejected = true;
|
|
36
|
-
if (this._reject)
|
|
37
|
-
this._reject(reason);
|
|
38
|
-
};
|
|
39
|
-
const onCancel = (cancelHandler) => {
|
|
40
|
-
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
this.cancelHandlers.push(cancelHandler);
|
|
44
|
-
};
|
|
45
|
-
Object.defineProperty(onCancel, 'isResolved', {
|
|
46
|
-
get: () => this._isResolved,
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(onCancel, 'isRejected', {
|
|
49
|
-
get: () => this._isRejected,
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(onCancel, 'isCancelled', {
|
|
52
|
-
get: () => this._isCancelled,
|
|
53
|
-
});
|
|
54
|
-
return executor(onResolve, onReject, onCancel);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
get [Symbol.toStringTag]() {
|
|
58
|
-
return 'Cancellable Promise';
|
|
59
|
-
}
|
|
60
|
-
then(onFulfilled, onRejected) {
|
|
61
|
-
return this.promise.then(onFulfilled, onRejected);
|
|
62
|
-
}
|
|
63
|
-
catch(onRejected) {
|
|
64
|
-
return this.promise.catch(onRejected);
|
|
65
|
-
}
|
|
66
|
-
finally(onFinally) {
|
|
67
|
-
return this.promise.finally(onFinally);
|
|
68
|
-
}
|
|
69
|
-
cancel() {
|
|
70
|
-
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
this._isCancelled = true;
|
|
74
|
-
if (this.cancelHandlers.length) {
|
|
75
|
-
try {
|
|
76
|
-
for (const cancelHandler of this.cancelHandlers) {
|
|
77
|
-
cancelHandler();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
console.warn('Cancellation threw an error', error);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
this.cancelHandlers.length = 0;
|
|
86
|
-
if (this._reject)
|
|
87
|
-
this._reject(new CancelError('Request aborted'));
|
|
88
|
-
}
|
|
89
|
-
get isCancelled() {
|
|
90
|
-
return this._isCancelled;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.CancelablePromise = CancelablePromise;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import { BaseHttpRequest } from './BaseHttpRequest';
|
|
3
|
-
import type { CancelablePromise } from './CancelablePromise';
|
|
4
|
-
import type { OpenAPIConfig } from './OpenAPI';
|
|
5
|
-
export declare class FetchHttpRequest extends BaseHttpRequest {
|
|
6
|
-
constructor(config: OpenAPIConfig);
|
|
7
|
-
/**
|
|
8
|
-
* Request method
|
|
9
|
-
* @param options The request options from the service
|
|
10
|
-
* @returns CancelablePromise<T>
|
|
11
|
-
* @throws ApiError
|
|
12
|
-
*/
|
|
13
|
-
request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FetchHttpRequest = void 0;
|
|
4
|
-
const BaseHttpRequest_1 = require("./BaseHttpRequest");
|
|
5
|
-
const request_1 = require("./request");
|
|
6
|
-
class FetchHttpRequest extends BaseHttpRequest_1.BaseHttpRequest {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
super(config);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Request method
|
|
12
|
-
* @param options The request options from the service
|
|
13
|
-
* @returns CancelablePromise<T>
|
|
14
|
-
* @throws ApiError
|
|
15
|
-
*/
|
|
16
|
-
request(options) {
|
|
17
|
-
return (0, request_1.request)(this.config, options);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.FetchHttpRequest = FetchHttpRequest;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
type Headers = Record<string, string>;
|
|
3
|
-
type Middleware<T> = (value: T) => T | Promise<T>;
|
|
4
|
-
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
5
|
-
export declare class Interceptors<T> {
|
|
6
|
-
_fns: Middleware<T>[];
|
|
7
|
-
constructor();
|
|
8
|
-
eject(fn: Middleware<T>): void;
|
|
9
|
-
use(fn: Middleware<T>): void;
|
|
10
|
-
}
|
|
11
|
-
export type OpenAPIConfig = {
|
|
12
|
-
BASE: string;
|
|
13
|
-
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
14
|
-
ENCODE_PATH?: ((path: string) => string) | undefined;
|
|
15
|
-
HEADERS?: Headers | Resolver<Headers> | undefined;
|
|
16
|
-
PASSWORD?: string | Resolver<string> | undefined;
|
|
17
|
-
TOKEN?: string | Resolver<string> | undefined;
|
|
18
|
-
USERNAME?: string | Resolver<string> | undefined;
|
|
19
|
-
VERSION: string;
|
|
20
|
-
WITH_CREDENTIALS: boolean;
|
|
21
|
-
interceptors: {
|
|
22
|
-
request: Interceptors<RequestInit>;
|
|
23
|
-
response: Interceptors<Response>;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export declare const OpenAPI: OpenAPIConfig;
|
|
27
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpenAPI = exports.Interceptors = void 0;
|
|
4
|
-
class Interceptors {
|
|
5
|
-
constructor() {
|
|
6
|
-
this._fns = [];
|
|
7
|
-
}
|
|
8
|
-
eject(fn) {
|
|
9
|
-
const index = this._fns.indexOf(fn);
|
|
10
|
-
if (index !== -1) {
|
|
11
|
-
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
use(fn) {
|
|
15
|
-
this._fns = [...this._fns, fn];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.Interceptors = Interceptors;
|
|
19
|
-
exports.OpenAPI = {
|
|
20
|
-
BASE: '',
|
|
21
|
-
CREDENTIALS: 'include',
|
|
22
|
-
ENCODE_PATH: undefined,
|
|
23
|
-
HEADERS: undefined,
|
|
24
|
-
PASSWORD: undefined,
|
|
25
|
-
TOKEN: undefined,
|
|
26
|
-
USERNAME: undefined,
|
|
27
|
-
VERSION: '2',
|
|
28
|
-
WITH_CREDENTIALS: false,
|
|
29
|
-
interceptors: {
|
|
30
|
-
request: new Interceptors(),
|
|
31
|
-
response: new Interceptors(),
|
|
32
|
-
},
|
|
33
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import type { ApiResult } from './ApiResult';
|
|
3
|
-
import { CancelablePromise } from './CancelablePromise';
|
|
4
|
-
import type { OnCancel } from './CancelablePromise';
|
|
5
|
-
import type { OpenAPIConfig } from './OpenAPI';
|
|
6
|
-
export declare const isString: (value: unknown) => value is string;
|
|
7
|
-
export declare const isStringWithValue: (value: unknown) => value is string;
|
|
8
|
-
export declare const isBlob: (value: any) => value is Blob;
|
|
9
|
-
export declare const isFormData: (value: unknown) => value is FormData;
|
|
10
|
-
export declare const base64: (str: string) => string;
|
|
11
|
-
export declare const getQueryString: (params: Record<string, unknown>) => string;
|
|
12
|
-
export declare const getFormData: (options: ApiRequestOptions) => FormData | undefined;
|
|
13
|
-
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
14
|
-
export declare const resolve: <T>(
|
|
15
|
-
options: ApiRequestOptions,
|
|
16
|
-
resolver?: T | Resolver<T>
|
|
17
|
-
) => Promise<T | undefined>;
|
|
18
|
-
export declare const getHeaders: (
|
|
19
|
-
config: OpenAPIConfig,
|
|
20
|
-
options: ApiRequestOptions
|
|
21
|
-
) => Promise<Headers>;
|
|
22
|
-
export declare const getRequestBody: (options: ApiRequestOptions) => unknown;
|
|
23
|
-
export declare const sendRequest: (
|
|
24
|
-
config: OpenAPIConfig,
|
|
25
|
-
options: ApiRequestOptions,
|
|
26
|
-
url: string,
|
|
27
|
-
body: any,
|
|
28
|
-
formData: FormData | undefined,
|
|
29
|
-
headers: Headers,
|
|
30
|
-
onCancel: OnCancel
|
|
31
|
-
) => Promise<Response>;
|
|
32
|
-
export declare const getResponseHeader: (
|
|
33
|
-
response: Response,
|
|
34
|
-
responseHeader?: string
|
|
35
|
-
) => string | undefined;
|
|
36
|
-
export declare const getResponseBody: (response: Response) => Promise<unknown>;
|
|
37
|
-
export declare const catchErrorCodes: (options: ApiRequestOptions, result: ApiResult) => void;
|
|
38
|
-
/**
|
|
39
|
-
* Request method
|
|
40
|
-
* @param config The OpenAPI configuration object
|
|
41
|
-
* @param options The request options from the service
|
|
42
|
-
* @returns CancelablePromise<T>
|
|
43
|
-
* @throws ApiError
|
|
44
|
-
*/
|
|
45
|
-
export declare const request: <T>(
|
|
46
|
-
config: OpenAPIConfig,
|
|
47
|
-
options: ApiRequestOptions
|
|
48
|
-
) => CancelablePromise<T>;
|
|
49
|
-
export {};
|