Skip to content

Commit 2867ba3

Browse files
authored
SWI-6691 Update to v7.10.0 (#51)
* SWI-6691 Update to v7.10.0 * remove old template and regenerate
1 parent 4c43e0f commit 2867ba3

File tree

7 files changed

+114
-590
lines changed

7 files changed

+114
-590
lines changed

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.9.0
1+
7.10.0

base.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import globalAxios from 'axios';
2121

2222
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
2323

24-
globalAxios.defaults.headers.common['User-Agent'] = "OpenAPI-Generator/1.0.0-dev/typescript-axios";
25-
2624
/**
2725
*
2826
* @export

configuration.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ export class Configuration {
8989
this.accessToken = param.accessToken;
9090
this.basePath = param.basePath;
9191
this.serverIndex = param.serverIndex;
92-
this.baseOptions = param.baseOptions;
92+
this.baseOptions = {
93+
...param.baseOptions,
94+
headers: {
95+
...param.baseOptions?.headers,
96+
'User-Agent': "OpenAPI-Generator/1.0.0-dev/typescript-axios"
97+
}
98+
};
9399
this.formDataCtor = param.formDataCtor;
94100
}
95101

custom_templates/apiInner.mustache

Lines changed: 0 additions & 467 deletions
This file was deleted.

custom_templates/baseApi.mustache

Lines changed: 0 additions & 118 deletions
This file was deleted.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
{{>licenseInfo}}
4+
5+
export interface ConfigurationParameters {
6+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
7+
username?: string;
8+
password?: string;
9+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
10+
basePath?: string;
11+
serverIndex?: number;
12+
baseOptions?: any;
13+
formDataCtor?: new () => any;
14+
}
15+
16+
export class Configuration {
17+
/**
18+
* parameter for apiKey security
19+
* @param name security name
20+
* @memberof Configuration
21+
*/
22+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
23+
/**
24+
* parameter for basic security
25+
*
26+
* @type {string}
27+
* @memberof Configuration
28+
*/
29+
username?: string;
30+
/**
31+
* parameter for basic security
32+
*
33+
* @type {string}
34+
* @memberof Configuration
35+
*/
36+
password?: string;
37+
/**
38+
* parameter for oauth2 security
39+
* @param name security name
40+
* @param scopes oauth2 scope
41+
* @memberof Configuration
42+
*/
43+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
44+
/**
45+
* override base path
46+
*
47+
* @type {string}
48+
* @memberof Configuration
49+
*/
50+
basePath?: string;
51+
/**
52+
* override server index
53+
*
54+
* @type {number}
55+
* @memberof Configuration
56+
*/
57+
serverIndex?: number;
58+
/**
59+
* base options for axios calls
60+
*
61+
* @type {any}
62+
* @memberof Configuration
63+
*/
64+
baseOptions?: any;
65+
/**
66+
* The FormData constructor that will be used to create multipart form data
67+
* requests. You can inject this here so that execution environments that
68+
* do not support the FormData class can still run the generated client.
69+
*
70+
* @type {new () => FormData}
71+
*/
72+
formDataCtor?: new () => any;
73+
74+
constructor(param: ConfigurationParameters = {}) {
75+
this.apiKey = param.apiKey;
76+
this.username = param.username;
77+
this.password = param.password;
78+
this.accessToken = param.accessToken;
79+
this.basePath = param.basePath;
80+
this.serverIndex = param.serverIndex;
81+
this.baseOptions = {
82+
...param.baseOptions,
83+
headers: {
84+
...param.baseOptions?.headers,
85+
'User-Agent': "OpenAPI-Generator{{#npmVersion}}/{{npmVersion}}{{/npmVersion}}/typescript-axios"
86+
}
87+
};
88+
this.formDataCtor = param.formDataCtor;
89+
}
90+
91+
/**
92+
* Check if the given MIME is a JSON MIME.
93+
* JSON MIME examples:
94+
* application/json
95+
* application/json; charset=UTF8
96+
* APPLICATION/JSON
97+
* application/vnd.company+json
98+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
99+
* @return True if the given MIME is JSON, false otherwise.
100+
*/
101+
public isJsonMime(mime: string): boolean {
102+
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
103+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
104+
}
105+
}

openapitools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
33
"spaces": 2,
44
"generator-cli": {
5-
"version": "7.9.0"
5+
"version": "7.10.0"
66
}
77
}

0 commit comments

Comments
 (0)