Skip to content

Commit 110577a

Browse files
committed
feat(*): change formatter to prettier
1 parent a822a56 commit 110577a

31 files changed

+20
-488
lines changed

.circleci/config.yml

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

bin/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ if (OpenAPI) {
3232
OpenAPI.generate({
3333
input: params.input,
3434
output: params.output,
35-
httpClient: params.client,
3635
clientName: params.name,
3736
useOptions: params.useOptions,
3837
useUnionTypes: params.useUnionTypes,

docs/angular-support.md

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

src/HttpClient.ts

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

src/Indent.ts

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

src/index.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
import { HttpClient } from './HttpClient';
2-
import { Indent } from './Indent';
31
import { parse as parseV2 } from './openApi/v2';
42
import { parse as parseV3 } from './openApi/v3';
53
import { getOpenApiSpec } from './utils/getOpenApiSpec';
64
import { getOpenApiVersion, OpenApiVersion } from './utils/getOpenApiVersion';
7-
import { isDefined } from './utils/isDefined';
85
import { isString } from './utils/isString';
96
import { postProcessClient } from './utils/postProcessClient';
107
import { registerHandlebarTemplates } from './utils/registerHandlebarTemplates';
118
import { writeClient } from './utils/writeClient';
129

13-
export { HttpClient } from './HttpClient';
14-
export { Indent } from './Indent';
15-
1610
export type Options = {
1711
input: string | Record<string, any>;
1812
output: string;
19-
httpClient?: HttpClient;
2013
clientName?: string;
2114
useOptions?: boolean;
2215
useUnionTypes?: boolean;
2316
exportCore?: boolean;
2417
exportServices?: boolean;
2518
exportModels?: boolean;
2619
exportSchemas?: boolean;
27-
indent?: Indent;
2820
postfix?: string;
2921
request?: string;
3022
write?: boolean;
@@ -36,43 +28,34 @@ export type Options = {
3628
* service layer, etc.
3729
* @param input The relative ___location of the OpenAPI spec
3830
* @param output The relative ___location of the output directory
39-
* @param httpClient The selected httpClient (fetch, xhr, node or axios)
4031
* @param clientName Custom client class name
4132
* @param useOptions Use options or arguments functions
4233
* @param useUnionTypes Use union types instead of enums
4334
* @param exportCore Generate core client classes
4435
* @param exportServices Generate services
4536
* @param exportModels Generate models
4637
* @param exportSchemas Generate schemas
47-
* @param indent Indentation options (4, 2 or tab)
4838
* @param postfix Service name postfix
4939
* @param request Path to custom request file
5040
* @param write Write the files to disk (true or false)
5141
*/
5242
export const generate = async ({
5343
input,
5444
output,
55-
httpClient = HttpClient.FETCH,
5645
clientName,
5746
useOptions = false,
5847
useUnionTypes = false,
5948
exportCore = true,
6049
exportServices = true,
6150
exportModels = true,
6251
exportSchemas = false,
63-
indent = Indent.SPACE_4,
6452
postfix = 'Service',
6553
request,
6654
write = true,
6755
}: Options): Promise<void> => {
68-
if (httpClient === HttpClient.ANGULAR && isDefined(clientName)) {
69-
throw new Error('Angular client does not support --name property');
70-
}
71-
7256
const openApi = isString(input) ? await getOpenApiSpec(input) : input;
7357
const openApiVersion = getOpenApiVersion(openApi);
7458
const templates = registerHandlebarTemplates({
75-
httpClient,
7659
useUnionTypes,
7760
useOptions,
7861
});
@@ -86,14 +69,12 @@ export const generate = async ({
8669
clientFinal,
8770
templates,
8871
output,
89-
httpClient,
9072
useOptions,
9173
useUnionTypes,
9274
exportCore,
9375
exportServices,
9476
exportModels,
9577
exportSchemas,
96-
indent,
9778
postfix,
9879
clientName,
9980
request
@@ -109,14 +90,12 @@ export const generate = async ({
10990
clientFinal,
11091
templates,
11192
output,
112-
httpClient,
11393
useOptions,
11494
useUnionTypes,
11595
exportCore,
11696
exportServices,
11797
exportModels,
11898
exportSchemas,
119-
indent,
12099
postfix,
121100
clientName,
122101
request
@@ -126,7 +105,4 @@ export const generate = async ({
126105
}
127106
};
128107

129-
export default {
130-
HttpClient,
131-
generate,
132-
};
108+
export default { generate };

src/utils/formatCode.spec.ts

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

src/utils/formatCode.ts

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

src/utils/formatIndentation.ts

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

src/utils/getHttpRequestName.ts

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

0 commit comments

Comments
 (0)