File tree 7 files changed +53
-21
lines changed
7 files changed +53
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import type { Model } from './Model' ;
2
2
3
3
export interface OperationParameter extends Model {
4
- in : 'path' | 'query' | 'header' | 'formData' | 'body' | 'cookie' ;
4
+ in : 'path' | 'query' | 'header' | 'formData' | 'body' | 'cookie' | 'param' ;
5
5
prop : string ;
6
6
mediaType : string | null ;
7
7
}
Original file line number Diff line number Diff line change @@ -70,6 +70,27 @@ export const getOperation = (
70
70
} ) ;
71
71
}
72
72
73
+ operation . parameters . push ( {
74
+ name : 'context' ,
75
+ type : 'TweedBaseContext' ,
76
+ in : 'param' ,
77
+ base : 'TweedBaseContext' ,
78
+ description : 'Tweed context for context propagation' ,
79
+ export : 'generic' ,
80
+ isDefinition : false ,
81
+ isNullable : false ,
82
+ isReadOnly : false ,
83
+ isRequired : true ,
84
+ link : null ,
85
+ mediaType : null ,
86
+ prop : '' ,
87
+ properties : [ ] ,
88
+ enum : [ ] ,
89
+ enums : [ ] ,
90
+ imports : [ ] ,
91
+ template : null ,
92
+ } ) ;
93
+
73
94
operation . parameters = operation . parameters . sort ( sortByRequired ) ;
74
95
75
96
return operation ;
Original file line number Diff line number Diff line change @@ -82,6 +82,26 @@ export const getOperation = (
82
82
}
83
83
84
84
operation . parameters = operation . parameters . sort ( sortByRequired ) ;
85
+ operation . parameters . push ( {
86
+ name : 'context' ,
87
+ type : 'TweedBaseContext' ,
88
+ in : 'param' ,
89
+ base : 'TweedBaseContext' ,
90
+ description : 'Tweed context for context propagation' ,
91
+ export : 'generic' ,
92
+ isDefinition : false ,
93
+ isNullable : false ,
94
+ isReadOnly : false ,
95
+ isRequired : true ,
96
+ link : null ,
97
+ mediaType : null ,
98
+ prop : '' ,
99
+ properties : [ ] ,
100
+ enum : [ ] ,
101
+ enums : [ ] ,
102
+ imports : [ ] ,
103
+ template : null ,
104
+ } ) ;
85
105
86
106
return operation ;
87
107
} ;
Original file line number Diff line number Diff line change 1
1
{{> header }}
2
- import { TweedBaseContext } from "@paytweed/context";
2
+
3
+
4
+ import { TweedBaseContext } from '@paytweed/context';
3
5
4
6
export type ApiRequestOptions = {
5
7
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
6
8
readonly url: string;
7
- readonly context: TweedContext
9
+ readonly context: TweedBaseContext
8
10
readonly path?: Record<string , any>;
9
11
readonly cookies?: Record<string , any>;
10
12
readonly headers?: Record<string , any>;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
8
8
import type { OpenAPIConfig } from './OpenAPI';
9
9
{{ else }}
10
10
import type { ApiRequestOptions } from './ApiRequestOptions';
11
- import type { CancelablePromise } from './CancelablePromise ';
11
+ import { AxiosResponse } from '@paytweed/http-client ';
12
12
import type { OpenAPIConfig } from './OpenAPI';
13
13
{{ /equals }}
14
14
@@ -26,6 +26,6 @@ export abstract class BaseHttpRequest {
26
26
{{ #equals @root.httpClient ' angular' }}
27
27
public abstract request<T >(options: ApiRequestOptions): Observable<T >;
28
28
{{ else }}
29
- public abstract request<T >(options: ApiRequestOptions): CancelablePromise< T >;
29
+ public abstract request<T >(options: ApiRequestOptions): Promise< AxiosResponse <T> >;
30
30
{{ /equals }}
31
31
}
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ import type { {{{this}}} } from '../models/{{{this}}}';
18
18
19
19
{{ /if }}
20
20
{{ #notEquals @root.httpClient ' angular' }}
21
- import type { CancelablePromise } from '../core/CancelablePromise';
21
+ import { AxiosResponse } from '@paytweed/http-client';
22
+ import { TweedBaseContext } from '@paytweed/context';
22
23
{{ /notEquals }}
23
24
{{ #if @root.exportClient }}
24
25
{{ #equals @root.httpClient ' angular' }}
@@ -75,20 +76,21 @@ export class {{{name}}}{{{@root.postfix}}} {
75
76
public {{{ name }}} ({{> parameters }} ): Observable<{{ >result}}> {
76
77
return this.httpRequest.request({
77
78
{{ else }}
78
- public {{{ name }}} ({{> parameters }} ): CancelablePromise< {{ >result}}> {
79
+ public {{{ name }}} ({{> parameters }} ): Promise< AxiosResponse < {{> result }} > > {
79
80
return this.httpRequest.request({
80
81
{{ /equals }}
81
82
{{ else }}
82
83
{{ #equals @root.httpClient ' angular' }}
83
84
public {{{ name }}} ({{> parameters }} ): Observable<{{ >result}}> {
84
85
return __request(OpenAPI, this.http, {
85
86
{{ else }}
86
- public static {{{ name }}} ({{> parameters }} ): CancelablePromise< {{ >result}}> {
87
+ public static {{{ name }}} ({{> parameters }} ): Promise< AxiosResponse < {{> result }} > > {
87
88
return __request(OpenAPI, {
88
89
{{ /equals }}
89
90
{{ /if }}
90
91
method: '{{{ method }}} ',
91
92
url: '{{{ path }}} ',
93
+ context,
92
94
{{ #if parametersPath }}
93
95
path: {
94
96
{{ #each parametersPath }}
You can’t perform that action at this time.
0 commit comments