11import * as fs from 'fs'
22import * as path from 'path'
3- import { ISwaggerOptions } from "../baseInterfaces" ;
4- import { abpGenericTypeDefinition , universalGenericTypeDefinition } from './genericTypeDefinitionTemplate' ;
5- import { trimString } from '../utils' ;
3+ import { ISwaggerOptions } from '../baseInterfaces'
4+ import { abpGenericTypeDefinition , universalGenericTypeDefinition } from './genericTypeDefinitionTemplate'
65
76export function serviceHeader ( options : ISwaggerOptions ) {
87 const classTransformerImport = options . useClassTransformer
98 ? `import { Expose, Transform, Type, plainToClass } from 'class-transformer';
10- ` : '' ;
9+ `
10+ : ''
1111 return `/** Generate by swagger-axios-codegen */
1212 /* eslint-disable */
1313 // @ts-nocheck
@@ -16,9 +16,23 @@ export function serviceHeader(options: ISwaggerOptions) {
1616 ${ classTransformerImport }
1717
1818 export interface IRequestOptions extends AxiosRequestConfig {
19- /** only in axios interceptor config*/
20- loading?:boolean;
21- showError?:boolean;
19+ /**
20+ * show loading status
21+ */
22+ loading?: boolean;
23+ /**
24+ * display error message
25+ */
26+ showError?: boolean;
27+ /**
28+ * data security, extended fields are encrypted using the specified algorithm
29+ */
30+ security?: Record<string, 'md5' | 'sha1' | 'aes' | 'des'>;
31+ /**
32+ * indicates whether Authorization credentials are required for the request
33+ * @default true
34+ */
35+ withAuthorization?: boolean;
2236 }
2337
2438 export interface IRequestConfig {
@@ -38,27 +52,41 @@ export function serviceHeader(options: ISwaggerOptions) {
3852 }
3953
4054 ${ requestHeader ( ) }
41- ` ;
55+ `
4256}
4357
4458export function disableLint ( ) {
4559 return `/** Generate by swagger-axios-codegen */
4660 // @ts-nocheck
4761/* eslint-disable */
4862
49- ` }
50-
63+ `
64+ }
5165
5266export function customerServiceHeader ( options : ISwaggerOptions ) {
53-
5467 return `/** Generate by swagger-axios-codegen */
5568 // @ts-nocheck
5669 /* eslint-disable */
57- export interface IRequestOptions {
58- headers?: any;
59- /** only in axios interceptor config*/
60- loading:boolean;
61- showError:boolean;
70+ import axiosStatic, { AxiosInstance, AxiosRequestConfig } from 'axios';
71+
72+ export interface IRequestOptions extends AxiosRequestConfig {
73+ /**
74+ * show loading status
75+ */
76+ loading?: boolean;
77+ /**
78+ * display error message
79+ */
80+ showError?: boolean;
81+ /**
82+ * data security, extended fields are encrypted using the specified algorithm
83+ */
84+ security?: Record<string, 'md5' | 'sha1' | 'aes' | 'des'>;
85+ /**
86+ * indicates whether Authorization credentials are required for the request
87+ * @default true
88+ */
89+ withAuthorization?: boolean;
6290 }
6391
6492 export interface IRequestPromise<T=any> extends Promise<IRequestResponse<T>> {}
0 commit comments