-
Notifications
You must be signed in to change notification settings - Fork 2
/
FlowService.ts
244 lines (233 loc) · 5.81 KB
/
FlowService.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Flow } from '../models/Flow.ts';
import type { OpenFlow } from '../models/OpenFlow.ts';
import type { OpenFlowWPath } from '../models/OpenFlowWPath.ts';
import type { CancelablePromise } from '../core/CancelablePromise.ts';
import { OpenAPI } from '../core/OpenAPI.ts';
import { request as __request } from '../core/request.ts';
export class FlowService {
/**
* list all available hub flows
* @returns any hub flows list
* @throws ApiError
*/
public static listHubFlows(): CancelablePromise<{
flows?: Array<{
id: number;
flow_id: number;
summary: string;
apps: Array<string>;
approved: boolean;
votes: number;
}>;
}> {
return __request(OpenAPI, {
method: 'GET',
url: '/flows/hub/list',
});
}
/**
* get hub flow by id
* @returns any flow
* @throws ApiError
*/
public static getHubFlowById({
id,
}: {
id: number,
}): CancelablePromise<{
flow?: OpenFlow;
}> {
return __request(OpenAPI, {
method: 'GET',
url: '/flows/hub/get/{id}',
path: {
'id': id,
},
});
}
/**
* list all available flows
* @returns Flow All available flow
* @throws ApiError
*/
public static listFlows({
workspace,
page,
perPage,
orderDesc,
createdBy,
pathStart,
pathExact,
showArchived,
}: {
workspace: string,
/**
* which page to return (start at 1, default 1)
*/
page?: number,
/**
* number of items to return for a given page (default 30, max 100)
*/
perPage?: number,
/**
* order by desc order (default true)
*/
orderDesc?: boolean,
/**
* mask to filter exact matching user creator
*/
createdBy?: string,
/**
* mask to filter matching starting path
*/
pathStart?: string,
/**
* mask to filter exact matching path
*/
pathExact?: string,
/**
* (default false)
* show also the archived files.
* when multiple archived hash share the same path, only the ones with the latest create_at
* are displayed.
*
*/
showArchived?: boolean,
}): CancelablePromise<Array<Flow>> {
return __request(OpenAPI, {
method: 'GET',
url: '/w/{workspace}/flows/list',
path: {
'workspace': workspace,
},
query: {
'page': page,
'per_page': perPage,
'order_desc': orderDesc,
'created_by': createdBy,
'path_start': pathStart,
'path_exact': pathExact,
'show_archived': showArchived,
},
});
}
/**
* get flow by path
* @returns Flow flow details
* @throws ApiError
*/
public static getFlowByPath({
workspace,
path,
}: {
workspace: string,
path: string,
}): CancelablePromise<Flow> {
return __request(OpenAPI, {
method: 'GET',
url: '/w/{workspace}/flows/get/{path}',
path: {
'workspace': workspace,
'path': path,
},
});
}
/**
* exists flow by path
* @returns boolean flow details
* @throws ApiError
*/
public static existsFlowByPath({
workspace,
path,
}: {
workspace: string,
path: string,
}): CancelablePromise<boolean> {
return __request(OpenAPI, {
method: 'GET',
url: '/w/{workspace}/flows/exists/{path}',
path: {
'workspace': workspace,
'path': path,
},
});
}
/**
* create flow
* @returns string flow created
* @throws ApiError
*/
public static createFlow({
workspace,
requestBody,
}: {
workspace: string,
/**
* Partially filled flow
*/
requestBody: OpenFlowWPath,
}): CancelablePromise<string> {
return __request(OpenAPI, {
method: 'POST',
url: '/w/{workspace}/flows/create',
path: {
'workspace': workspace,
},
body: requestBody,
mediaType: 'application/json',
});
}
/**
* update flow
* @returns string flow updated
* @throws ApiError
*/
public static updateFlow({
workspace,
path,
requestBody,
}: {
workspace: string,
path: string,
/**
* Partially filled flow
*/
requestBody: OpenFlowWPath,
}): CancelablePromise<string> {
return __request(OpenAPI, {
method: 'POST',
url: '/w/{workspace}/flows/update/{path}',
path: {
'workspace': workspace,
'path': path,
},
body: requestBody,
mediaType: 'application/json',
});
}
/**
* archive flow by path
* @returns string flow archived
* @throws ApiError
*/
public static archiveFlowByPath({
workspace,
path,
}: {
workspace: string,
path: string,
}): CancelablePromise<string> {
return __request(OpenAPI, {
method: 'POST',
url: '/w/{workspace}/flows/archive/{path}',
path: {
'workspace': workspace,
'path': path,
},
});
}
}