File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 6
6
"scripts" : {
7
7
"test" : " echo \" Error: no test specified\" && exit 1" ,
8
8
"generate.spec.node" : " ./node_modules/.bin/openapi --input openapi.yaml --output ./src/api --useOptions --useUnionTypes --client node" ,
9
- "generate.spec.browser" : " ./node_modules/.bin/openapi --input openapi.yaml --output ./src/api --useOptions -- useUnionTypes --client xhr" ,
9
+ "generate.spec.browser" : " ./node_modules/.bin/openapi --input openapi.yaml --output ./src/api --useUnionTypes --client xhr" ,
10
10
"webpack" : " npm run generate.spec.browser && npx webpack --mode=development && npx webpack --mode=production && npm run generate.spec.node"
11
11
},
12
12
"keywords" : [],
Original file line number Diff line number Diff line change 1
1
import Docupilot from './docupilot' ;
2
2
3
3
import * as _API from './api' ;
4
+ import { ApiRequestOptions } from './api/core/ApiRequestOptions' ;
4
5
5
6
class _Docupilot extends Docupilot {
6
7
readonly AuthTokensService = _API . AuthTokensService ;
@@ -15,6 +16,13 @@ class _Docupilot extends Docupilot {
15
16
readonly TemplateDeliveryService = _API . TemplateDeliveryService ;
16
17
readonly TemplatesService = _API . TemplatesService ;
17
18
readonly UsersService = _API . UsersService ;
19
+
20
+ configureHeadersInterceptor ( getHeaders : ( ) => Record < string , string > ) {
21
+ _API . OpenAPI . HEADERS = async ( options : ApiRequestOptions ) => {
22
+ const headers = getHeaders ( ) ;
23
+ return Object . assign ( { } , options . headers || { } , headers ) ;
24
+ } ;
25
+ }
18
26
}
19
27
20
28
export const client = new _Docupilot ( ) ;
You can’t perform that action at this time.
0 commit comments