Skip to content

Commit 5d86123

Browse files
committed
fic: Replace imports of Axios library
1 parent 716718b commit 5d86123

File tree

8 files changed

+12
-8
lines changed

8 files changed

+12
-8
lines changed

templates/base/http-clients/axios-http-client.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const { apiConfig, generateResponses, config } = it;
33
%>
44

5-
import type { AxiosInstance, AxiosRequestConfig, HeadersDefaults, ResponseType } from "axios";
5+
import type { AxiosInstance, AxiosRequestConfig, HeadersDefaults, ResponseType, AxiosResponse } from "axios";
66
import axios from "axios";
77

88
export type QueryParamsType = Record<string | number, any>;

templates/default/api.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const descriptionLines = _.compact([
2626
2727
%>
2828

29-
<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
29+
<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import type { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
3030

3131
<% if (descriptionLines.length) { %>
3232
/**

templates/modular/api.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const routes = route.routes;
66
const dataContracts = _.map(modelTypes, "name");
77
%>
88

9-
<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
9+
<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import type { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
1010

1111
import { HttpClient, RequestParams, ContentType, HttpResponse } from "./<%~ config.fileNames.httpClient %>";
1212
<% if (dataContracts.length) { %>

tests/spec/axios/expected.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,8 @@ export interface UserUpdate {
19071907

19081908
export type Users = User[];
19091909

1910-
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1910+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1911+
import axios from "axios";
19111912

19121913
export type QueryParamsType = Record<string | number, any>;
19131914

tests/spec/axios/schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,8 @@ export interface UserUpdate {
19071907

19081908
export type Users = User[];
19091909

1910-
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1910+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1911+
import axios from "axios";
19111912

19121913
export type QueryParamsType = Record<string | number, any>;
19131914

tests/spec/axiosSingleHttpClient/expected.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,8 @@ export interface UserUpdate {
19071907

19081908
export type Users = User[];
19091909

1910-
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1910+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1911+
import axios from "axios";
19111912

19121913
export type QueryParamsType = Record<string | number, any>;
19131914

tests/spec/axiosSingleHttpClient/schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,8 @@ export interface UserUpdate {
19071907

19081908
export type Users = User[];
19091909

1910-
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1910+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from "axios";
1911+
import axios from "axios";
19111912

19121913
export type QueryParamsType = Record<string | number, any>;
19131914

tests/spec/jsAxios/schema.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ export interface UserUpdate {
17811781
name?: string;
17821782
}
17831783
export declare type Users = User[];
1784-
import { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
1784+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
17851785
export declare type QueryParamsType = Record<string | number, any>;
17861786
export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
17871787
/** set parameter to `true` for call `securityWorker` for this request */

0 commit comments

Comments
 (0)