Skip to content

Commit f8372b6

Browse files
committed
feat: remove @export and more
1 parent d06ed32 commit f8372b6

7 files changed

Lines changed: 4 additions & 88 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
@@ -31,7 +31,6 @@ import type { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}{{imp
3131
/**
3232
* {{classname}} - axios parameter creator{{#description}}
3333
* {{&description}}{{/description}}
34-
* @export
3534
*/
3635
export const {{classname}}AxiosParamCreator = function (configuration?: Configuration) {
3736
return {
@@ -246,7 +245,6 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur
246245
/**
247246
* {{classname}} - functional programming interface{{#description}}
248247
* {{{.}}}{{/description}}
249-
* @export
250248
*/
251249
export const {{classname}}Fp = function(configuration?: Configuration) {
252250
const localVarAxiosParamCreator = {{classname}}AxiosParamCreator(configuration)
@@ -277,7 +275,6 @@ export const {{classname}}Fp = function(configuration?: Configuration) {
277275
/**
278276
* {{classname}} - factory interface{{#description}}
279277
* {{&description}}{{/description}}
280-
* @export
281278
*/
282279
export const {{classname}}Factory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
283280
const localVarFp = {{classname}}Fp(configuration)
@@ -320,8 +317,6 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas
320317
/**
321318
* {{classname}} - interface{{#description}}
322319
* {{&description}}{{/description}}
323-
* @export
324-
* @interface {{classname}}
325320
*/
326321
export interface {{classname}}Interface {
327322
{{#operation}}
@@ -361,8 +356,6 @@ export interface {{classname}}Interface {
361356
{{#allParams.0}}
362357
/**
363358
* Request parameters for {{nickname}} operation in {{classname}}.
364-
* @export
365-
* @interface {{classname}}{{operationIdCamelCase}}Request
366359
*/
367360
export interface {{classname}}{{operationIdCamelCase}}Request {
368361
{{#allParams}}
@@ -384,9 +377,6 @@ export interface {{classname}}{{operationIdCamelCase}}Request {
384377
/**
385378
* {{classname}} - object-oriented interface{{#description}}
386379
* {{{.}}}{{/description}}
387-
* @export
388-
* @class {{classname}}
389-
* @extends {BaseAPI}
390380
*/
391381
{{#withInterfaces}}
392382
export class {{classname}} extends BaseAPI implements {{classname}}Interface {
@@ -437,10 +427,6 @@ export class {{classname}} extends BaseAPI {
437427
{{#allParams}}
438428
{{#isEnum}}
439429
{{#stringEnums}}
440-
/**
441-
* @export
442-
* @enum {string}
443-
*/
444430
export enum {{operationIdCamelCase}}{{enumName}} {
445431
{{#allowableValues}}
446432
{{#enumVars}}
@@ -450,9 +436,6 @@ export enum {{operationIdCamelCase}}{{enumName}} {
450436
}
451437
{{/stringEnums}}
452438
{{^stringEnums}}
453-
/**
454-
* @export
455-
*/
456439
export const {{operationIdCamelCase}}{{enumName}} = {
457440
{{#allowableValues}}
458441
{{#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
@@ -11,32 +11,18 @@ import globalAxios from 'axios';
1111

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

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

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

35-
/**
36-
*
37-
* @export
38-
* @class BaseAPI
39-
*/
4026
export class BaseAPI {
4127
protected configuration: Configuration | undefined;
4228
@@ -48,12 +34,6 @@ export class BaseAPI {
4834
}
4935
};
5036

51-
/**
52-
*
53-
* @export
54-
* @class RequiredError
55-
* @extends {Error}
56-
*/
5737
export class RequiredError extends Error {
5838
constructor(public field: string, msg?: string) {
5939
super(msg);
@@ -68,10 +48,6 @@ interface ServerMap {
6848
}[];
6949
}
7050

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

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

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,18 @@ import { RequiredError } from "./base{{importFileExtension}}";
1111
import { URL, URLSearchParams } from 'url';
1212
{{/withNodeImports}}
1313

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

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

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

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

54-
/**
55-
*
56-
* @export
57-
*/
5841
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
5942
if (configuration && configuration.accessToken) {
6043
const accessToken = typeof configuration.accessToken === 'function'
@@ -64,10 +47,6 @@ export const setBearerAuthToObject = async function (object: any, configuration?
6447
}
6548
}
6649

67-
/**
68-
*
69-
* @export
70-
*/
7150
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
7251
if (configuration && configuration.accessToken) {
7352
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
@@ -99,20 +78,12 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an
9978
}
10079
}
10180

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

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

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

134-
/**
135-
*
136-
* @export
137-
*/
138101
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
139102
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
140103
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)