Skip to content

Commit cc01bf9

Browse files
committed
Added more meta.
1 parent 998902e commit cc01bf9

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/templates/core/ApiQuery.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{{>header}}
22

3-
export type ApiQuery<T> = {
3+
export type ApiQuery<T, R> = {
44
readonly path: string;
5+
readonly method: string;
6+
readonly name: string;
7+
readonly inputs: string[];
8+
params?: R
59
};

src/templates/exportService.hbs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ import { request as __request } from '../core/request';
3737
providedIn: 'root',
3838
})
3939
{{/equals}}
40+
41+
{{#each operations}}
42+
export type {{{name}}}Input = {
43+
{{#each parameters}}
44+
{{{name}}}{{>isRequired}}: {{>type}}
45+
{{/each}}
46+
}
47+
{{/each}}
48+
4049
export class {{{name}}}{{{@root.postfix}}} {
4150
{{#if @root.exportClient}}
4251

@@ -49,8 +58,15 @@ export class {{{name}}}{{{@root.postfix}}} {
4958
{{/if}}
5059

5160
{{#each operations}}
52-
static {{{name}}}Options: ApiQuery<{{>result}}> = {
61+
static {{{name}}}Options: ApiQuery<{{>result}}, {{{name}}}Input> = {
5362
path: '{{path}}',
63+
method: '{{method}}',
64+
name: '{{name}}',
65+
inputs: [
66+
{{#each parameters}}
67+
'{{{name}}}',
68+
{{/each}}
69+
]
5470
}
5571
/**
5672
{{#if deprecated}}

0 commit comments

Comments
 (0)