You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typescript-node: support bearer token authentication (#4633)
* Make typescript-node support bearer token authentication and add support for intercepting request
* Explicit typing of interceptors
* Update modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache
Formatting
Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>
* Build Petstore
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache
+33-11Lines changed: 33 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ import http = require('http');
7
7
import { {{classname}} } from '../{{filename}}';
8
8
{{/imports}}
9
9
10
-
import { ObjectSerializer, Authentication, VoidAuth } from '../model/models';
10
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor} from '../model/models';
11
11
{{#hasAuthMethods}}
12
-
import { HttpBasicAuth, ApiKeyAuth, OAuth } from '../model/models';
12
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
13
13
{{/hasAuthMethods}}
14
14
15
15
import { HttpError, RequestFile } from './apis';
@@ -43,9 +43,12 @@ export class {{classname}} {
43
43
'default': <Authentication>new VoidAuth(),
44
44
{{#hasAuthMethods}}
45
45
{{#authMethods}}
46
-
{{#isBasic}}
46
+
{{#isBasicBasic}}
47
47
'{{name}}': new HttpBasicAuth(),
48
-
{{/isBasic}}
48
+
{{/isBasicBasic}}
49
+
{{#isBasicBearer}}
50
+
'{{name}}': new HttpBearerAuth(),
51
+
{{/isBasicBearer}}
49
52
{{#isApiKey}}
50
53
'{{name}}': new ApiKeyAuth({{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}{{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}, '{{keyParamName}}'),
0 commit comments