Skip to content

Commit 40ea526

Browse files
committed
add codegen
1 parent 9ce611b commit 40ea526

24 files changed

+887
-11
lines changed

generated-api/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wwwroot/*.js
2+
node_modules
3+
typings
4+
dist

generated-api/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.gitignore
2+
.npmignore
3+
.openapi-generator-ignore
4+
api.ts
5+
base.ts
6+
common.ts
7+
configuration.ts
8+
git_push.sh
9+
index.ts
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.6.0

generated-api/api.ts

+267
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* API
5+
* API
6+
*
7+
* The version of the OpenAPI document: 1.0
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
import type { Configuration } from './configuration';
17+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18+
import globalAxios from 'axios';
19+
// Some imports not used depending on template conditions
20+
// @ts-ignore
21+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22+
import type { RequestArgs } from './base';
23+
// @ts-ignore
24+
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
25+
26+
/**
27+
*
28+
* @export
29+
* @interface CreateBotzoneDto
30+
*/
31+
export interface CreateBotzoneDto {
32+
/**
33+
*
34+
* @type {string}
35+
* @memberof CreateBotzoneDto
36+
*/
37+
'example': string;
38+
/**
39+
*
40+
* @type {number}
41+
* @memberof CreateBotzoneDto
42+
*/
43+
'this_is_a_test': number;
44+
}
45+
46+
/**
47+
* DefaultApi - axios parameter creator
48+
* @export
49+
*/
50+
export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) {
51+
return {
52+
/**
53+
*
54+
* @param {*} [options] Override http request option.
55+
* @throws {RequiredError}
56+
*/
57+
appControllerGetHello: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
58+
const localVarPath = `/`;
59+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
60+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
61+
let baseOptions;
62+
if (configuration) {
63+
baseOptions = configuration.baseOptions;
64+
}
65+
66+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
67+
const localVarHeaderParameter = {} as any;
68+
const localVarQueryParameter = {} as any;
69+
70+
71+
72+
setSearchParams(localVarUrlObj, localVarQueryParameter);
73+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
74+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
75+
76+
return {
77+
url: toPathString(localVarUrlObj),
78+
options: localVarRequestOptions,
79+
};
80+
},
81+
/**
82+
*
83+
* @param {*} [options] Override http request option.
84+
* @throws {RequiredError}
85+
*/
86+
appControllerPostHello: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
87+
const localVarPath = `/`;
88+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
89+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
90+
let baseOptions;
91+
if (configuration) {
92+
baseOptions = configuration.baseOptions;
93+
}
94+
95+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
96+
const localVarHeaderParameter = {} as any;
97+
const localVarQueryParameter = {} as any;
98+
99+
100+
101+
setSearchParams(localVarUrlObj, localVarQueryParameter);
102+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
103+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
104+
105+
return {
106+
url: toPathString(localVarUrlObj),
107+
options: localVarRequestOptions,
108+
};
109+
},
110+
/**
111+
*
112+
* @param {CreateBotzoneDto} createBotzoneDto
113+
* @param {*} [options] Override http request option.
114+
* @throws {RequiredError}
115+
*/
116+
botzoneControllerCreate: async (createBotzoneDto: CreateBotzoneDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
117+
// verify required parameter 'createBotzoneDto' is not null or undefined
118+
assertParamExists('botzoneControllerCreate', 'createBotzoneDto', createBotzoneDto)
119+
const localVarPath = `/botzone/create`;
120+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
121+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
122+
let baseOptions;
123+
if (configuration) {
124+
baseOptions = configuration.baseOptions;
125+
}
126+
127+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
128+
const localVarHeaderParameter = {} as any;
129+
const localVarQueryParameter = {} as any;
130+
131+
132+
133+
localVarHeaderParameter['Content-Type'] = 'application/json';
134+
135+
setSearchParams(localVarUrlObj, localVarQueryParameter);
136+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
138+
localVarRequestOptions.data = serializeDataIfNeeded(createBotzoneDto, localVarRequestOptions, configuration)
139+
140+
return {
141+
url: toPathString(localVarUrlObj),
142+
options: localVarRequestOptions,
143+
};
144+
},
145+
}
146+
};
147+
148+
/**
149+
* DefaultApi - functional programming interface
150+
* @export
151+
*/
152+
export const DefaultApiFp = function(configuration?: Configuration) {
153+
const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration)
154+
return {
155+
/**
156+
*
157+
* @param {*} [options] Override http request option.
158+
* @throws {RequiredError}
159+
*/
160+
async appControllerGetHello(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
161+
const localVarAxiosArgs = await localVarAxiosParamCreator.appControllerGetHello(options);
162+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
163+
const localVarOperationServerBasePath = operationServerMap['DefaultApi.appControllerGetHello']?.[localVarOperationServerIndex]?.url;
164+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
165+
},
166+
/**
167+
*
168+
* @param {*} [options] Override http request option.
169+
* @throws {RequiredError}
170+
*/
171+
async appControllerPostHello(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
172+
const localVarAxiosArgs = await localVarAxiosParamCreator.appControllerPostHello(options);
173+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
174+
const localVarOperationServerBasePath = operationServerMap['DefaultApi.appControllerPostHello']?.[localVarOperationServerIndex]?.url;
175+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
176+
},
177+
/**
178+
*
179+
* @param {CreateBotzoneDto} createBotzoneDto
180+
* @param {*} [options] Override http request option.
181+
* @throws {RequiredError}
182+
*/
183+
async botzoneControllerCreate(createBotzoneDto: CreateBotzoneDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<number>> {
184+
const localVarAxiosArgs = await localVarAxiosParamCreator.botzoneControllerCreate(createBotzoneDto, options);
185+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
186+
const localVarOperationServerBasePath = operationServerMap['DefaultApi.botzoneControllerCreate']?.[localVarOperationServerIndex]?.url;
187+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
188+
},
189+
}
190+
};
191+
192+
/**
193+
* DefaultApi - factory interface
194+
* @export
195+
*/
196+
export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
197+
const localVarFp = DefaultApiFp(configuration)
198+
return {
199+
/**
200+
*
201+
* @param {*} [options] Override http request option.
202+
* @throws {RequiredError}
203+
*/
204+
appControllerGetHello(options?: any): AxiosPromise<string> {
205+
return localVarFp.appControllerGetHello(options).then((request) => request(axios, basePath));
206+
},
207+
/**
208+
*
209+
* @param {*} [options] Override http request option.
210+
* @throws {RequiredError}
211+
*/
212+
appControllerPostHello(options?: any): AxiosPromise<string> {
213+
return localVarFp.appControllerPostHello(options).then((request) => request(axios, basePath));
214+
},
215+
/**
216+
*
217+
* @param {CreateBotzoneDto} createBotzoneDto
218+
* @param {*} [options] Override http request option.
219+
* @throws {RequiredError}
220+
*/
221+
botzoneControllerCreate(createBotzoneDto: CreateBotzoneDto, options?: any): AxiosPromise<number> {
222+
return localVarFp.botzoneControllerCreate(createBotzoneDto, options).then((request) => request(axios, basePath));
223+
},
224+
};
225+
};
226+
227+
/**
228+
* DefaultApi - object-oriented interface
229+
* @export
230+
* @class DefaultApi
231+
* @extends {BaseAPI}
232+
*/
233+
export class DefaultApi extends BaseAPI {
234+
/**
235+
*
236+
* @param {*} [options] Override http request option.
237+
* @throws {RequiredError}
238+
* @memberof DefaultApi
239+
*/
240+
public appControllerGetHello(options?: RawAxiosRequestConfig) {
241+
return DefaultApiFp(this.configuration).appControllerGetHello(options).then((request) => request(this.axios, this.basePath));
242+
}
243+
244+
/**
245+
*
246+
* @param {*} [options] Override http request option.
247+
* @throws {RequiredError}
248+
* @memberof DefaultApi
249+
*/
250+
public appControllerPostHello(options?: RawAxiosRequestConfig) {
251+
return DefaultApiFp(this.configuration).appControllerPostHello(options).then((request) => request(this.axios, this.basePath));
252+
}
253+
254+
/**
255+
*
256+
* @param {CreateBotzoneDto} createBotzoneDto
257+
* @param {*} [options] Override http request option.
258+
* @throws {RequiredError}
259+
* @memberof DefaultApi
260+
*/
261+
public botzoneControllerCreate(createBotzoneDto: CreateBotzoneDto, options?: RawAxiosRequestConfig) {
262+
return DefaultApiFp(this.configuration).botzoneControllerCreate(createBotzoneDto, options).then((request) => request(this.axios, this.basePath));
263+
}
264+
}
265+
266+
267+

generated-api/base.ts

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* API
5+
* API
6+
*
7+
* The version of the OpenAPI document: 1.0
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
import type { Configuration } from './configuration';
17+
// Some imports not used depending on template conditions
18+
// @ts-ignore
19+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
20+
import globalAxios from 'axios';
21+
22+
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
23+
24+
/**
25+
*
26+
* @export
27+
*/
28+
export const COLLECTION_FORMATS = {
29+
csv: ",",
30+
ssv: " ",
31+
tsv: "\t",
32+
pipes: "|",
33+
};
34+
35+
/**
36+
*
37+
* @export
38+
* @interface RequestArgs
39+
*/
40+
export interface RequestArgs {
41+
url: string;
42+
options: RawAxiosRequestConfig;
43+
}
44+
45+
/**
46+
*
47+
* @export
48+
* @class BaseAPI
49+
*/
50+
export class BaseAPI {
51+
protected configuration: Configuration | undefined;
52+
53+
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
54+
if (configuration) {
55+
this.configuration = configuration;
56+
this.basePath = configuration.basePath ?? basePath;
57+
}
58+
}
59+
};
60+
61+
/**
62+
*
63+
* @export
64+
* @class RequiredError
65+
* @extends {Error}
66+
*/
67+
export class RequiredError extends Error {
68+
constructor(public field: string, msg?: string) {
69+
super(msg);
70+
this.name = "RequiredError"
71+
}
72+
}
73+
74+
interface ServerMap {
75+
[key: string]: {
76+
url: string,
77+
description: string,
78+
}[];
79+
}
80+
81+
/**
82+
*
83+
* @export
84+
*/
85+
export const operationServerMap: ServerMap = {
86+
}

0 commit comments

Comments
 (0)