@se-uulm/snowballr-api-client 0.1.1-alpha.16a25a3
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/.openapi-generator/FILES +22 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/CHANGELOG.md +9 -0
- package/LICENSE +674 -0
- package/README.md +46 -0
- package/dist/apis/AuthControllerApi.d.ts +118 -0
- package/dist/apis/AuthControllerApi.js +170 -0
- package/dist/apis/ProjectsControllerApi.d.ts +102 -0
- package/dist/apis/ProjectsControllerApi.js +141 -0
- package/dist/apis/UsersControllerApi.d.ts +46 -0
- package/dist/apis/UsersControllerApi.js +61 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +21 -0
- package/dist/esm/apis/AuthControllerApi.d.ts +118 -0
- package/dist/esm/apis/AuthControllerApi.js +166 -0
- package/dist/esm/apis/ProjectsControllerApi.d.ts +102 -0
- package/dist/esm/apis/ProjectsControllerApi.js +137 -0
- package/dist/esm/apis/UsersControllerApi.d.ts +46 -0
- package/dist/esm/apis/UsersControllerApi.js +57 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +5 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/ChangePasswordRequest.d.ts +38 -0
- package/dist/esm/models/ChangePasswordRequest.js +43 -0
- package/dist/esm/models/CreateProjectRequest.d.ts +32 -0
- package/dist/esm/models/CreateProjectRequest.js +41 -0
- package/dist/esm/models/DecisionMatrixPattern.d.ts +49 -0
- package/dist/esm/models/DecisionMatrixPattern.js +53 -0
- package/dist/esm/models/DecisionMatrixPatternEntry.d.ts +47 -0
- package/dist/esm/models/DecisionMatrixPatternEntry.js +51 -0
- package/dist/esm/models/LoginRequest.d.ts +38 -0
- package/dist/esm/models/LoginRequest.js +43 -0
- package/dist/esm/models/ProjectResponse.d.ts +117 -0
- package/dist/esm/models/ProjectResponse.js +80 -0
- package/dist/esm/models/RegisterRequest.d.ts +50 -0
- package/dist/esm/models/RegisterRequest.js +47 -0
- package/dist/esm/models/ReviewDecisionMatrix.d.ts +39 -0
- package/dist/esm/models/ReviewDecisionMatrix.js +44 -0
- package/dist/esm/models/index.d.ts +8 -0
- package/dist/esm/models/index.js +10 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/ChangePasswordRequest.d.ts +38 -0
- package/dist/models/ChangePasswordRequest.js +50 -0
- package/dist/models/CreateProjectRequest.d.ts +32 -0
- package/dist/models/CreateProjectRequest.js +48 -0
- package/dist/models/DecisionMatrixPattern.d.ts +49 -0
- package/dist/models/DecisionMatrixPattern.js +61 -0
- package/dist/models/DecisionMatrixPatternEntry.d.ts +47 -0
- package/dist/models/DecisionMatrixPatternEntry.js +59 -0
- package/dist/models/LoginRequest.d.ts +38 -0
- package/dist/models/LoginRequest.js +50 -0
- package/dist/models/ProjectResponse.d.ts +117 -0
- package/dist/models/ProjectResponse.js +88 -0
- package/dist/models/RegisterRequest.d.ts +50 -0
- package/dist/models/RegisterRequest.js +54 -0
- package/dist/models/ReviewDecisionMatrix.d.ts +39 -0
- package/dist/models/ReviewDecisionMatrix.js +51 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +26 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/package.json +22 -0
- package/src/apis/AuthControllerApi.ts +283 -0
- package/src/apis/ProjectsControllerApi.ts +238 -0
- package/src/apis/UsersControllerApi.ts +92 -0
- package/src/apis/index.ts +5 -0
- package/src/index.ts +5 -0
- package/src/models/ChangePasswordRequest.ts +73 -0
- package/src/models/CreateProjectRequest.ts +65 -0
- package/src/models/DecisionMatrixPattern.ts +94 -0
- package/src/models/DecisionMatrixPatternEntry.ts +85 -0
- package/src/models/LoginRequest.ts +73 -0
- package/src/models/ProjectResponse.ts +177 -0
- package/src/models/RegisterRequest.ts +89 -0
- package/src/models/ReviewDecisionMatrix.ts +81 -0
- package/src/models/index.ts +10 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SnowballR API
|
|
3
|
+
* REST API for the SnowballR Application
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: v1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface RegisterRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface RegisterRequest {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof RegisterRequest
|
|
22
|
+
*/
|
|
23
|
+
firstName?: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof RegisterRequest
|
|
28
|
+
*/
|
|
29
|
+
lastName?: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof RegisterRequest
|
|
34
|
+
*/
|
|
35
|
+
email?: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof RegisterRequest
|
|
40
|
+
*/
|
|
41
|
+
password?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a given object implements the RegisterRequest interface.
|
|
45
|
+
*/
|
|
46
|
+
export declare function instanceOfRegisterRequest(value: object): value is RegisterRequest;
|
|
47
|
+
export declare function RegisterRequestFromJSON(json: any): RegisterRequest;
|
|
48
|
+
export declare function RegisterRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RegisterRequest;
|
|
49
|
+
export declare function RegisterRequestToJSON(json: any): RegisterRequest;
|
|
50
|
+
export declare function RegisterRequestToJSONTyped(value?: RegisterRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* SnowballR API
|
|
6
|
+
* REST API for the SnowballR Application
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: v1
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfRegisterRequest = instanceOfRegisterRequest;
|
|
17
|
+
exports.RegisterRequestFromJSON = RegisterRequestFromJSON;
|
|
18
|
+
exports.RegisterRequestFromJSONTyped = RegisterRequestFromJSONTyped;
|
|
19
|
+
exports.RegisterRequestToJSON = RegisterRequestToJSON;
|
|
20
|
+
exports.RegisterRequestToJSONTyped = RegisterRequestToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the RegisterRequest interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfRegisterRequest(value) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
function RegisterRequestFromJSON(json) {
|
|
28
|
+
return RegisterRequestFromJSONTyped(json, false);
|
|
29
|
+
}
|
|
30
|
+
function RegisterRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
31
|
+
if (json == null) {
|
|
32
|
+
return json;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
'firstName': json['firstName'] == null ? undefined : json['firstName'],
|
|
36
|
+
'lastName': json['lastName'] == null ? undefined : json['lastName'],
|
|
37
|
+
'email': json['email'] == null ? undefined : json['email'],
|
|
38
|
+
'password': json['password'] == null ? undefined : json['password'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function RegisterRequestToJSON(json) {
|
|
42
|
+
return RegisterRequestToJSONTyped(json, false);
|
|
43
|
+
}
|
|
44
|
+
function RegisterRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
45
|
+
if (value == null) {
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'firstName': value['firstName'],
|
|
50
|
+
'lastName': value['lastName'],
|
|
51
|
+
'email': value['email'],
|
|
52
|
+
'password': value['password'],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SnowballR API
|
|
3
|
+
* REST API for the SnowballR Application
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: v1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { DecisionMatrixPattern } from './DecisionMatrixPattern';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ReviewDecisionMatrix
|
|
17
|
+
*/
|
|
18
|
+
export interface ReviewDecisionMatrix {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {number}
|
|
22
|
+
* @memberof ReviewDecisionMatrix
|
|
23
|
+
*/
|
|
24
|
+
numberOfReviewers?: number;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {Array<DecisionMatrixPattern>}
|
|
28
|
+
* @memberof ReviewDecisionMatrix
|
|
29
|
+
*/
|
|
30
|
+
patterns?: Array<DecisionMatrixPattern>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if a given object implements the ReviewDecisionMatrix interface.
|
|
34
|
+
*/
|
|
35
|
+
export declare function instanceOfReviewDecisionMatrix(value: object): value is ReviewDecisionMatrix;
|
|
36
|
+
export declare function ReviewDecisionMatrixFromJSON(json: any): ReviewDecisionMatrix;
|
|
37
|
+
export declare function ReviewDecisionMatrixFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReviewDecisionMatrix;
|
|
38
|
+
export declare function ReviewDecisionMatrixToJSON(json: any): ReviewDecisionMatrix;
|
|
39
|
+
export declare function ReviewDecisionMatrixToJSONTyped(value?: ReviewDecisionMatrix | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* SnowballR API
|
|
6
|
+
* REST API for the SnowballR Application
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: v1
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfReviewDecisionMatrix = instanceOfReviewDecisionMatrix;
|
|
17
|
+
exports.ReviewDecisionMatrixFromJSON = ReviewDecisionMatrixFromJSON;
|
|
18
|
+
exports.ReviewDecisionMatrixFromJSONTyped = ReviewDecisionMatrixFromJSONTyped;
|
|
19
|
+
exports.ReviewDecisionMatrixToJSON = ReviewDecisionMatrixToJSON;
|
|
20
|
+
exports.ReviewDecisionMatrixToJSONTyped = ReviewDecisionMatrixToJSONTyped;
|
|
21
|
+
const DecisionMatrixPattern_1 = require("./DecisionMatrixPattern");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the ReviewDecisionMatrix interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfReviewDecisionMatrix(value) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function ReviewDecisionMatrixFromJSON(json) {
|
|
29
|
+
return ReviewDecisionMatrixFromJSONTyped(json, false);
|
|
30
|
+
}
|
|
31
|
+
function ReviewDecisionMatrixFromJSONTyped(json, ignoreDiscriminator) {
|
|
32
|
+
if (json == null) {
|
|
33
|
+
return json;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
'numberOfReviewers': json['numberOfReviewers'] == null ? undefined : json['numberOfReviewers'],
|
|
37
|
+
'patterns': json['patterns'] == null ? undefined : (json['patterns'].map(DecisionMatrixPattern_1.DecisionMatrixPatternFromJSON)),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function ReviewDecisionMatrixToJSON(json) {
|
|
41
|
+
return ReviewDecisionMatrixToJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
function ReviewDecisionMatrixToJSONTyped(value, ignoreDiscriminator = false) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'numberOfReviewers': value['numberOfReviewers'],
|
|
49
|
+
'patterns': value['patterns'] == null ? undefined : (value['patterns'].map(DecisionMatrixPattern_1.DecisionMatrixPatternToJSON)),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './ChangePasswordRequest';
|
|
2
|
+
export * from './CreateProjectRequest';
|
|
3
|
+
export * from './DecisionMatrixPattern';
|
|
4
|
+
export * from './DecisionMatrixPatternEntry';
|
|
5
|
+
export * from './LoginRequest';
|
|
6
|
+
export * from './ProjectResponse';
|
|
7
|
+
export * from './RegisterRequest';
|
|
8
|
+
export * from './ReviewDecisionMatrix';
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./ChangePasswordRequest"), exports);
|
|
20
|
+
__exportStar(require("./CreateProjectRequest"), exports);
|
|
21
|
+
__exportStar(require("./DecisionMatrixPattern"), exports);
|
|
22
|
+
__exportStar(require("./DecisionMatrixPatternEntry"), exports);
|
|
23
|
+
__exportStar(require("./LoginRequest"), exports);
|
|
24
|
+
__exportStar(require("./ProjectResponse"), exports);
|
|
25
|
+
__exportStar(require("./RegisterRequest"), exports);
|
|
26
|
+
__exportStar(require("./ReviewDecisionMatrix"), exports);
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SnowballR API
|
|
3
|
+
* REST API for the SnowballR Application
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: v1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BASE_PATH: string;
|
|
13
|
+
export interface ConfigurationParameters {
|
|
14
|
+
basePath?: string;
|
|
15
|
+
fetchApi?: FetchAPI;
|
|
16
|
+
middleware?: Middleware[];
|
|
17
|
+
queryParamsStringify?: (params: HTTPQuery) => string;
|
|
18
|
+
username?: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
|
|
21
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
|
|
22
|
+
headers?: HTTPHeaders;
|
|
23
|
+
credentials?: RequestCredentials;
|
|
24
|
+
}
|
|
25
|
+
export declare class Configuration {
|
|
26
|
+
private configuration;
|
|
27
|
+
constructor(configuration?: ConfigurationParameters);
|
|
28
|
+
set config(configuration: Configuration);
|
|
29
|
+
get basePath(): string;
|
|
30
|
+
get fetchApi(): FetchAPI | undefined;
|
|
31
|
+
get middleware(): Middleware[];
|
|
32
|
+
get queryParamsStringify(): (params: HTTPQuery) => string;
|
|
33
|
+
get username(): string | undefined;
|
|
34
|
+
get password(): string | undefined;
|
|
35
|
+
get apiKey(): ((name: string) => string | Promise<string>) | undefined;
|
|
36
|
+
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
|
|
37
|
+
get headers(): HTTPHeaders | undefined;
|
|
38
|
+
get credentials(): RequestCredentials | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare const DefaultConfig: Configuration;
|
|
41
|
+
/**
|
|
42
|
+
* This is the base class for all generated API classes.
|
|
43
|
+
*/
|
|
44
|
+
export declare class BaseAPI {
|
|
45
|
+
protected configuration: Configuration;
|
|
46
|
+
private static readonly jsonRegex;
|
|
47
|
+
private middleware;
|
|
48
|
+
constructor(configuration?: Configuration);
|
|
49
|
+
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
|
|
50
|
+
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
|
|
51
|
+
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
|
|
52
|
+
/**
|
|
53
|
+
* Check if the given MIME is a JSON MIME.
|
|
54
|
+
* JSON MIME examples:
|
|
55
|
+
* application/json
|
|
56
|
+
* application/json; charset=UTF8
|
|
57
|
+
* APPLICATION/JSON
|
|
58
|
+
* application/vnd.company+json
|
|
59
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
60
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
61
|
+
*/
|
|
62
|
+
protected isJsonMime(mime: string | null | undefined): boolean;
|
|
63
|
+
protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
|
|
64
|
+
private createFetchParams;
|
|
65
|
+
private fetchApi;
|
|
66
|
+
/**
|
|
67
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
68
|
+
* and then shallow cloning data members.
|
|
69
|
+
*/
|
|
70
|
+
private clone;
|
|
71
|
+
}
|
|
72
|
+
export declare class ResponseError extends Error {
|
|
73
|
+
response: Response;
|
|
74
|
+
name: "ResponseError";
|
|
75
|
+
constructor(response: Response, msg?: string);
|
|
76
|
+
}
|
|
77
|
+
export declare class FetchError extends Error {
|
|
78
|
+
cause: Error;
|
|
79
|
+
name: "FetchError";
|
|
80
|
+
constructor(cause: Error, msg?: string);
|
|
81
|
+
}
|
|
82
|
+
export declare class RequiredError extends Error {
|
|
83
|
+
field: string;
|
|
84
|
+
name: "RequiredError";
|
|
85
|
+
constructor(field: string, msg?: string);
|
|
86
|
+
}
|
|
87
|
+
export declare const COLLECTION_FORMATS: {
|
|
88
|
+
csv: string;
|
|
89
|
+
ssv: string;
|
|
90
|
+
tsv: string;
|
|
91
|
+
pipes: string;
|
|
92
|
+
};
|
|
93
|
+
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
|
94
|
+
export type Json = any;
|
|
95
|
+
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
96
|
+
export type HTTPHeaders = {
|
|
97
|
+
[key: string]: string;
|
|
98
|
+
};
|
|
99
|
+
export type HTTPQuery = {
|
|
100
|
+
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
|
|
101
|
+
};
|
|
102
|
+
export type HTTPBody = Json | FormData | URLSearchParams;
|
|
103
|
+
export type HTTPRequestInit = {
|
|
104
|
+
headers?: HTTPHeaders;
|
|
105
|
+
method: HTTPMethod;
|
|
106
|
+
credentials?: RequestCredentials;
|
|
107
|
+
body?: HTTPBody;
|
|
108
|
+
};
|
|
109
|
+
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
110
|
+
export type InitOverrideFunction = (requestContext: {
|
|
111
|
+
init: HTTPRequestInit;
|
|
112
|
+
context: RequestOpts;
|
|
113
|
+
}) => Promise<RequestInit>;
|
|
114
|
+
export interface FetchParams {
|
|
115
|
+
url: string;
|
|
116
|
+
init: RequestInit;
|
|
117
|
+
}
|
|
118
|
+
export interface RequestOpts {
|
|
119
|
+
path: string;
|
|
120
|
+
method: HTTPMethod;
|
|
121
|
+
headers: HTTPHeaders;
|
|
122
|
+
query?: HTTPQuery;
|
|
123
|
+
body?: HTTPBody;
|
|
124
|
+
}
|
|
125
|
+
export declare function querystring(params: HTTPQuery, prefix?: string): string;
|
|
126
|
+
export declare function exists(json: any, key: string): boolean;
|
|
127
|
+
export declare function mapValues(data: any, fn: (item: any) => any): {
|
|
128
|
+
[key: string]: any;
|
|
129
|
+
};
|
|
130
|
+
export declare function canConsumeForm(consumes: Consume[]): boolean;
|
|
131
|
+
export interface Consume {
|
|
132
|
+
contentType: string;
|
|
133
|
+
}
|
|
134
|
+
export interface RequestContext {
|
|
135
|
+
fetch: FetchAPI;
|
|
136
|
+
url: string;
|
|
137
|
+
init: RequestInit;
|
|
138
|
+
}
|
|
139
|
+
export interface ResponseContext {
|
|
140
|
+
fetch: FetchAPI;
|
|
141
|
+
url: string;
|
|
142
|
+
init: RequestInit;
|
|
143
|
+
response: Response;
|
|
144
|
+
}
|
|
145
|
+
export interface ErrorContext {
|
|
146
|
+
fetch: FetchAPI;
|
|
147
|
+
url: string;
|
|
148
|
+
init: RequestInit;
|
|
149
|
+
error: unknown;
|
|
150
|
+
response?: Response;
|
|
151
|
+
}
|
|
152
|
+
export interface Middleware {
|
|
153
|
+
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
154
|
+
post?(context: ResponseContext): Promise<Response | void>;
|
|
155
|
+
onError?(context: ErrorContext): Promise<Response | void>;
|
|
156
|
+
}
|
|
157
|
+
export interface ApiResponse<T> {
|
|
158
|
+
raw: Response;
|
|
159
|
+
value(): Promise<T>;
|
|
160
|
+
}
|
|
161
|
+
export interface ResponseTransformer<T> {
|
|
162
|
+
(json: any): T;
|
|
163
|
+
}
|
|
164
|
+
export declare class JSONApiResponse<T> {
|
|
165
|
+
raw: Response;
|
|
166
|
+
private transformer;
|
|
167
|
+
constructor(raw: Response, transformer?: ResponseTransformer<T>);
|
|
168
|
+
value(): Promise<T>;
|
|
169
|
+
}
|
|
170
|
+
export declare class VoidApiResponse {
|
|
171
|
+
raw: Response;
|
|
172
|
+
constructor(raw: Response);
|
|
173
|
+
value(): Promise<void>;
|
|
174
|
+
}
|
|
175
|
+
export declare class BlobApiResponse {
|
|
176
|
+
raw: Response;
|
|
177
|
+
constructor(raw: Response);
|
|
178
|
+
value(): Promise<Blob>;
|
|
179
|
+
}
|
|
180
|
+
export declare class TextApiResponse {
|
|
181
|
+
raw: Response;
|
|
182
|
+
constructor(raw: Response);
|
|
183
|
+
value(): Promise<string>;
|
|
184
|
+
}
|