Skip to content

Commit a7d3bb6

Browse files
committed
feat: remove @export and more
1 parent 045a9c1 commit a7d3bb6

7 files changed

Lines changed: 8 additions & 92 deletions

File tree

modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import type { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}';
3030
/**
3131
* {{classname}} - axios parameter creator{{#description}}
3232
* {{&description}}{{/description}}
33-
* @export
3433
*/
3534
export const {{classname}}AxiosParamCreator = function (configuration?: Configuration) {
3635
return {
@@ -245,7 +244,6 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur
245244
/**
246245
* {{classname}} - functional programming interface{{#description}}
247246
* {{{.}}}{{/description}}
248-
* @export
249247
*/
250248
export const {{classname}}Fp = function(configuration?: Configuration) {
251249
const localVarAxiosParamCreator = {{classname}}AxiosParamCreator(configuration)
@@ -276,7 +274,6 @@ export const {{classname}}Fp = function(configuration?: Configuration) {
276274
/**
277275
* {{classname}} - factory interface{{#description}}
278276
* {{&description}}{{/description}}
279-
* @export
280277
*/
281278
export const {{classname}}Factory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
282279
const localVarFp = {{classname}}Fp(configuration)
@@ -319,8 +316,6 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas
319316
/**
320317
* {{classname}} - interface{{#description}}
321318
* {{&description}}{{/description}}
322-
* @export
323-
* @interface {{classname}}
324319
*/
325320
export interface {{classname}}Interface {
326321
{{#operation}}
@@ -360,8 +355,6 @@ export interface {{classname}}Interface {
360355
{{#allParams.0}}
361356
/**
362357
* Request parameters for {{nickname}} operation in {{classname}}.
363-
* @export
364-
* @interface {{classname}}{{operationIdCamelCase}}Request
365358
*/
366359
export interface {{classname}}{{operationIdCamelCase}}Request {
367360
{{#allParams}}
@@ -383,9 +376,6 @@ export interface {{classname}}{{operationIdCamelCase}}Request {
383376
/**
384377
* {{classname}} - object-oriented interface{{#description}}
385378
* {{{.}}}{{/description}}
386-
* @export
387-
* @class {{classname}}
388-
* @extends {BaseAPI}
389379
*/
390380
{{#withInterfaces}}
391381
export class {{classname}} extends BaseAPI implements {{classname}}Interface {
@@ -436,10 +426,6 @@ export class {{classname}} extends BaseAPI {
436426
{{#allParams}}
437427
{{#isEnum}}
438428
{{#stringEnums}}
439-
/**
440-
* @export
441-
* @enum {string}
442-
*/
443429
export enum {{operationIdCamelCase}}{{enumName}} {
444430
{{#allowableValues}}
445431
{{#enumVars}}
@@ -449,9 +435,6 @@ export enum {{operationIdCamelCase}}{{enumName}} {
449435
}
450436
{{/stringEnums}}
451437
{{^stringEnums}}
452-
/**
453-
* @export
454-
*/
455438
export const {{operationIdCamelCase}}{{enumName}} = {
456439
{{#allowableValues}}
457440
{{#enumVars}}

modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,18 @@ import globalAxios from 'axios';
1010

1111
export const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, "");
1212

13-
/**
14-
*
15-
* @export
16-
*/
1713
export const COLLECTION_FORMATS = {
1814
csv: ",",
1915
ssv: " ",
2016
tsv: "\t",
2117
pipes: "|",
2218
};
2319

24-
/**
25-
*
26-
* @export
27-
* @interface RequestArgs
28-
*/
2920
export interface RequestArgs {
3021
url: string;
3122
options: RawAxiosRequestConfig;
3223
}
3324

34-
/**
35-
*
36-
* @export
37-
* @class BaseAPI
38-
*/
3925
export class BaseAPI {
4026
protected configuration: Configuration | undefined;
4127
@@ -47,12 +33,6 @@ export class BaseAPI {
4733
}
4834
};
4935

50-
/**
51-
*
52-
* @export
53-
* @class RequiredError
54-
* @extends {Error}
55-
*/
5636
export class RequiredError extends Error {
5737
constructor(public field: string, msg?: string) {
5838
super(msg);
@@ -67,10 +47,6 @@ interface ServerMap {
6747
}[];
6848
}
6949

70-
/**
71-
*
72-
* @export
73-
*/
7450
export const operationServerMap: ServerMap = {
7551
{{#apiInfo}}
7652
{{#apis}}

modules/openapi-generator/src/main/resources/typescript-axios/common.mustache

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,18 @@ import { RequiredError } from "./base";
1010
import { URL, URLSearchParams } from 'url';
1111
{{/withNodeImports}}
1212

13-
/**
14-
*
15-
* @export
16-
*/
1713
export const DUMMY_BASE_URL = 'https://example.com'
1814

1915
/**
2016
*
2117
* @throws {RequiredError}
22-
* @export
2318
*/
2419
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
2520
if (paramValue === null || paramValue === undefined) {
2621
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
2722
}
2823
}
2924

30-
/**
31-
*
32-
* @export
33-
*/
3425
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
3526
if (configuration && configuration.apiKey) {
3627
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
@@ -40,20 +31,12 @@ export const setApiKeyToObject = async function (object: any, keyParamName: stri
4031
}
4132
}
4233

43-
/**
44-
*
45-
* @export
46-
*/
4734
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
4835
if (configuration && (configuration.username || configuration.password)) {
4936
object["auth"] = { username: configuration.username, password: configuration.password };
5037
}
5138
}
5239

53-
/**
54-
*
55-
* @export
56-
*/
5740
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
5841
if (configuration && configuration.accessToken) {
5942
const accessToken = typeof configuration.accessToken === 'function'
@@ -63,10 +46,6 @@ export const setBearerAuthToObject = async function (object: any, configuration?
6346
}
6447
}
6548

66-
/**
67-
*
68-
* @export
69-
*/
7049
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
7150
if (configuration && configuration.accessToken) {
7251
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
@@ -81,37 +60,29 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an
8160
if (typeof parameter === "object") {
8261
if (Array.isArray(parameter)) {
8362
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
84-
}
63+
}
8564
else {
86-
Object.keys(parameter).forEach(currentKey =>
65+
Object.keys(parameter).forEach(currentKey =>
8766
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
8867
);
8968
}
90-
}
69+
}
9170
else {
9271
if (urlSearchParams.has(key)) {
9372
urlSearchParams.append(key, parameter);
94-
}
73+
}
9574
else {
9675
urlSearchParams.set(key, parameter);
9776
}
9877
}
9978
}
10079

101-
/**
102-
*
103-
* @export
104-
*/
10580
export const setSearchParams = function (url: URL, ...objects: any[]) {
10681
const searchParams = new URLSearchParams(url.search);
10782
setFlattenedQueryParams(searchParams, objects);
10883
url.search = searchParams.toString();
10984
}
11085

111-
/**
112-
*
113-
* @export
114-
*/
11586
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
11687
const nonString = typeof value !== 'string';
11788
const needsSerialization = nonString && configuration && configuration.isJsonMime
@@ -122,18 +93,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any,
12293
: (value || "");
12394
}
12495

125-
/**
126-
*
127-
* @export
128-
*/
12996
export const toPathString = function (url: URL) {
13097
return url.pathname + url.search + url.hash
13198
}
13299

133-
/**
134-
*
135-
* @export
136-
*/
137100
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
138101
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
139102
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* @type {{classname}}{{#description}}
33
* {{{.}}}{{/description}}
4-
* @export
54
*/
65
export type {{classname}} = {{#allOf}}{{{.}}}{{^-last}} & {{/-last}}{{/allOf}};

modules/openapi-generator/src/main/resources/typescript-axios/modelEnum.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
{{#description}}
12
/**
23
* {{{description}}}
3-
* @export
4-
* @enum {{=<% %>=}}{<%&dataType%>}<%={{ }}=%>
54
*/
5+
{{/description}}
66
{{#isBoolean}}
77
export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}
88
{{/isBoolean}}

modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
{{#description}}
12
/**
23
* {{{description}}}
3-
* @export
4-
* @interface {{classname}}
54
*/
5+
{{/description}}
66
export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
77
{{#additionalPropertiesType}}
88
[key: string]: {{{additionalPropertiesType}}}{{#additionalPropertiesIsAnyType}}{{#hasVars}} | any{{/hasVars}}{{/additionalPropertiesIsAnyType}};
@@ -24,10 +24,6 @@ export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
2424
{{#vars}}
2525
{{#isEnum}}
2626
{{#stringEnums}}
27-
/**
28-
* @export
29-
* @enum {string}
30-
*/
3127
export enum {{enumName}} {
3228
{{#allowableValues}}
3329
{{#enumVars}}

modules/openapi-generator/src/main/resources/typescript-axios/modelOneOf.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* @type {{classname}}{{#description}}
33
* {{{.}}}{{/description}}
4-
* @export
54
*/
65
export type {{classname}} = {{#discriminator}}{{!
76

0 commit comments

Comments
 (0)