@maxim_mazurok/gapi.client.workflowexecutions-v1 0.0.20220808
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +372 -0
- package/package.json +20 -0
- package/readme.md +68 -0
- package/tests.ts +99 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Workflow Executions API v1 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/workflows
|
|
3
|
+
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
|
4
|
+
// Nick Amoscato <https://github.com/namoscato>
|
|
5
|
+
// Declan Vong <https://github.com/declanvong>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 2.8
|
|
8
|
+
|
|
9
|
+
// IMPORTANT
|
|
10
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
11
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
12
|
+
// Generated from: https://workflowexecutions.googleapis.com/$discovery/rest?version=v1
|
|
13
|
+
// Revision: 20220808
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Workflow Executions API v1 */
|
|
19
|
+
function load(urlOrObject: "https://workflowexecutions.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "workflowexecutions", version: "v1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "workflowexecutions", version: "v1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace workflowexecutions {
|
|
26
|
+
// tslint:disable-next-line:no-empty-interface
|
|
27
|
+
interface CancelExecutionRequest {
|
|
28
|
+
}
|
|
29
|
+
interface Error {
|
|
30
|
+
/** Human-readable stack trace string. */
|
|
31
|
+
context?: string;
|
|
32
|
+
/** Error message and data returned represented as a JSON string. */
|
|
33
|
+
payload?: string;
|
|
34
|
+
/** Stack trace with detailed information of where error was generated. */
|
|
35
|
+
stackTrace?: StackTrace;
|
|
36
|
+
}
|
|
37
|
+
interface Execution {
|
|
38
|
+
/**
|
|
39
|
+
* Input parameters of the execution represented as a JSON string. The size limit is 32KB. *Note*: If you are using the REST API directly to run your workflow, you must escape any JSON
|
|
40
|
+
* string value of `argument`. Example: `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'`
|
|
41
|
+
*/
|
|
42
|
+
argument?: string;
|
|
43
|
+
/** The call logging level associated to this execution. */
|
|
44
|
+
callLogLevel?: string;
|
|
45
|
+
/** Output only. Marks the end of execution, successful or not. */
|
|
46
|
+
endTime?: string;
|
|
47
|
+
/** Output only. The error which caused the execution to finish prematurely. The value is only present if the execution's state is `FAILED` or `CANCELLED`. */
|
|
48
|
+
error?: Error;
|
|
49
|
+
/** Output only. The resource name of the execution. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} */
|
|
50
|
+
name?: string;
|
|
51
|
+
/** Output only. Output of the execution represented as a JSON string. The value can only be present if the execution's state is `SUCCEEDED`. */
|
|
52
|
+
result?: string;
|
|
53
|
+
/** Output only. Marks the beginning of execution. */
|
|
54
|
+
startTime?: string;
|
|
55
|
+
/** Output only. Current state of the execution. */
|
|
56
|
+
state?: string;
|
|
57
|
+
/** Output only. Revision of the workflow this execution is using. */
|
|
58
|
+
workflowRevisionId?: string;
|
|
59
|
+
}
|
|
60
|
+
interface ListExecutionsResponse {
|
|
61
|
+
/** The executions which match the request. */
|
|
62
|
+
executions?: Execution[];
|
|
63
|
+
/** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */
|
|
64
|
+
nextPageToken?: string;
|
|
65
|
+
}
|
|
66
|
+
interface Position {
|
|
67
|
+
/** The source code column position (of the line) the current instruction was generated from. */
|
|
68
|
+
column?: string;
|
|
69
|
+
/** The number of bytes of source code making up this stack trace element. */
|
|
70
|
+
length?: string;
|
|
71
|
+
/** The source code line number the current instruction was generated from. */
|
|
72
|
+
line?: string;
|
|
73
|
+
}
|
|
74
|
+
interface PubsubMessage {
|
|
75
|
+
/** Attributes for this message. If this field is empty, the message must contain non-empty data. This can be used to filter messages on the subscription. */
|
|
76
|
+
attributes?: { [P in string]: string };
|
|
77
|
+
/** The message data field. If this field is empty, the message must contain at least one attribute. */
|
|
78
|
+
data?: string;
|
|
79
|
+
/**
|
|
80
|
+
* ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a
|
|
81
|
+
* `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by the publisher in a `Publish` call.
|
|
82
|
+
*/
|
|
83
|
+
messageId?: string;
|
|
84
|
+
/**
|
|
85
|
+
* If non-empty, identifies related messages for which publish order should be respected. If a `Subscription` has `enable_message_ordering` set to `true`, messages published with the
|
|
86
|
+
* same non-empty `ordering_key` value will be delivered to subscribers in the order in which they are received by the Pub/Sub system. All `PubsubMessage`s published in a given
|
|
87
|
+
* `PublishRequest` must specify the same `ordering_key` value. For more information, see [ordering messages](https://cloud.google.com/pubsub/docs/ordering).
|
|
88
|
+
*/
|
|
89
|
+
orderingKey?: string;
|
|
90
|
+
/** The time at which the message was published, populated by the server when it receives the `Publish` call. It must not be populated by the publisher in a `Publish` call. */
|
|
91
|
+
publishTime?: string;
|
|
92
|
+
}
|
|
93
|
+
interface StackTrace {
|
|
94
|
+
/** An array of stack elements. */
|
|
95
|
+
elements?: StackTraceElement[];
|
|
96
|
+
}
|
|
97
|
+
interface StackTraceElement {
|
|
98
|
+
/** The source position information of the stack trace element. */
|
|
99
|
+
position?: Position;
|
|
100
|
+
/** The routine where the error occurred. */
|
|
101
|
+
routine?: string;
|
|
102
|
+
/** The step the error occurred at. */
|
|
103
|
+
step?: string;
|
|
104
|
+
}
|
|
105
|
+
interface TriggerPubsubExecutionRequest {
|
|
106
|
+
/** Required. LINT: LEGACY_NAMES The query parameter value for __GCP_CloudEventsMode, set by the Eventarc service when configuring triggers. */
|
|
107
|
+
GCPCloudEventsMode?: string;
|
|
108
|
+
/** Required. The message of the Pub/Sub push notification. */
|
|
109
|
+
message?: PubsubMessage;
|
|
110
|
+
/** Required. The subscription of the Pub/Sub push notification. Format: projects/{project}/subscriptions/{sub} */
|
|
111
|
+
subscription?: string;
|
|
112
|
+
}
|
|
113
|
+
interface ExecutionsResource {
|
|
114
|
+
/** Cancels an execution of the given name. */
|
|
115
|
+
cancel(request: {
|
|
116
|
+
/** V1 error format. */
|
|
117
|
+
"$.xgafv"?: string;
|
|
118
|
+
/** OAuth access token. */
|
|
119
|
+
access_token?: string;
|
|
120
|
+
/** Data format for response. */
|
|
121
|
+
alt?: string;
|
|
122
|
+
/** JSONP */
|
|
123
|
+
callback?: string;
|
|
124
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
125
|
+
fields?: string;
|
|
126
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
127
|
+
key?: string;
|
|
128
|
+
/** Required. Name of the execution to be cancelled. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} */
|
|
129
|
+
name: string;
|
|
130
|
+
/** OAuth 2.0 token for the current user. */
|
|
131
|
+
oauth_token?: string;
|
|
132
|
+
/** Returns response with indentations and line breaks. */
|
|
133
|
+
prettyPrint?: boolean;
|
|
134
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
135
|
+
quotaUser?: string;
|
|
136
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
137
|
+
upload_protocol?: string;
|
|
138
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
139
|
+
uploadType?: string;
|
|
140
|
+
/** Request body */
|
|
141
|
+
resource: CancelExecutionRequest;
|
|
142
|
+
}): Request<Execution>;
|
|
143
|
+
cancel(request: {
|
|
144
|
+
/** V1 error format. */
|
|
145
|
+
"$.xgafv"?: string;
|
|
146
|
+
/** OAuth access token. */
|
|
147
|
+
access_token?: string;
|
|
148
|
+
/** Data format for response. */
|
|
149
|
+
alt?: string;
|
|
150
|
+
/** JSONP */
|
|
151
|
+
callback?: string;
|
|
152
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
153
|
+
fields?: string;
|
|
154
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
155
|
+
key?: string;
|
|
156
|
+
/** Required. Name of the execution to be cancelled. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} */
|
|
157
|
+
name: string;
|
|
158
|
+
/** OAuth 2.0 token for the current user. */
|
|
159
|
+
oauth_token?: string;
|
|
160
|
+
/** Returns response with indentations and line breaks. */
|
|
161
|
+
prettyPrint?: boolean;
|
|
162
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
163
|
+
quotaUser?: string;
|
|
164
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
165
|
+
upload_protocol?: string;
|
|
166
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
167
|
+
uploadType?: string;
|
|
168
|
+
},
|
|
169
|
+
body: CancelExecutionRequest): Request<Execution>;
|
|
170
|
+
/** Creates a new execution using the latest revision of the given workflow. */
|
|
171
|
+
create(request: {
|
|
172
|
+
/** V1 error format. */
|
|
173
|
+
"$.xgafv"?: string;
|
|
174
|
+
/** OAuth access token. */
|
|
175
|
+
access_token?: string;
|
|
176
|
+
/** Data format for response. */
|
|
177
|
+
alt?: string;
|
|
178
|
+
/** JSONP */
|
|
179
|
+
callback?: string;
|
|
180
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
181
|
+
fields?: string;
|
|
182
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
183
|
+
key?: string;
|
|
184
|
+
/** OAuth 2.0 token for the current user. */
|
|
185
|
+
oauth_token?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Required. Name of the workflow for which an execution should be created. Format: projects/{project}/locations/{location}/workflows/{workflow} The latest revision of the workflow
|
|
188
|
+
* will be used.
|
|
189
|
+
*/
|
|
190
|
+
parent: string;
|
|
191
|
+
/** Returns response with indentations and line breaks. */
|
|
192
|
+
prettyPrint?: boolean;
|
|
193
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
194
|
+
quotaUser?: string;
|
|
195
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
196
|
+
upload_protocol?: string;
|
|
197
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
198
|
+
uploadType?: string;
|
|
199
|
+
/** Request body */
|
|
200
|
+
resource: Execution;
|
|
201
|
+
}): Request<Execution>;
|
|
202
|
+
create(request: {
|
|
203
|
+
/** V1 error format. */
|
|
204
|
+
"$.xgafv"?: string;
|
|
205
|
+
/** OAuth access token. */
|
|
206
|
+
access_token?: string;
|
|
207
|
+
/** Data format for response. */
|
|
208
|
+
alt?: string;
|
|
209
|
+
/** JSONP */
|
|
210
|
+
callback?: string;
|
|
211
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
212
|
+
fields?: string;
|
|
213
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
214
|
+
key?: string;
|
|
215
|
+
/** OAuth 2.0 token for the current user. */
|
|
216
|
+
oauth_token?: string;
|
|
217
|
+
/**
|
|
218
|
+
* Required. Name of the workflow for which an execution should be created. Format: projects/{project}/locations/{location}/workflows/{workflow} The latest revision of the workflow
|
|
219
|
+
* will be used.
|
|
220
|
+
*/
|
|
221
|
+
parent: string;
|
|
222
|
+
/** Returns response with indentations and line breaks. */
|
|
223
|
+
prettyPrint?: boolean;
|
|
224
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
225
|
+
quotaUser?: string;
|
|
226
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
227
|
+
upload_protocol?: string;
|
|
228
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
229
|
+
uploadType?: string;
|
|
230
|
+
},
|
|
231
|
+
body: Execution): Request<Execution>;
|
|
232
|
+
/** Returns an execution of the given name. */
|
|
233
|
+
get(request?: {
|
|
234
|
+
/** V1 error format. */
|
|
235
|
+
"$.xgafv"?: string;
|
|
236
|
+
/** OAuth access token. */
|
|
237
|
+
access_token?: string;
|
|
238
|
+
/** Data format for response. */
|
|
239
|
+
alt?: string;
|
|
240
|
+
/** JSONP */
|
|
241
|
+
callback?: string;
|
|
242
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
243
|
+
fields?: string;
|
|
244
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
245
|
+
key?: string;
|
|
246
|
+
/** Required. Name of the execution to be retrieved. Format: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} */
|
|
247
|
+
name: string;
|
|
248
|
+
/** OAuth 2.0 token for the current user. */
|
|
249
|
+
oauth_token?: string;
|
|
250
|
+
/** Returns response with indentations and line breaks. */
|
|
251
|
+
prettyPrint?: boolean;
|
|
252
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
253
|
+
quotaUser?: string;
|
|
254
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
255
|
+
upload_protocol?: string;
|
|
256
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
257
|
+
uploadType?: string;
|
|
258
|
+
/** Optional. A view defining which fields should be filled in the returned execution. The API will default to the FULL view. */
|
|
259
|
+
view?: string;
|
|
260
|
+
}): Request<Execution>;
|
|
261
|
+
/**
|
|
262
|
+
* Returns a list of executions which belong to the workflow with the given name. The method returns executions of all workflow revisions. Returned executions are ordered by their
|
|
263
|
+
* start time (newest first).
|
|
264
|
+
*/
|
|
265
|
+
list(request?: {
|
|
266
|
+
/** V1 error format. */
|
|
267
|
+
"$.xgafv"?: string;
|
|
268
|
+
/** OAuth access token. */
|
|
269
|
+
access_token?: string;
|
|
270
|
+
/** Data format for response. */
|
|
271
|
+
alt?: string;
|
|
272
|
+
/** JSONP */
|
|
273
|
+
callback?: string;
|
|
274
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
275
|
+
fields?: string;
|
|
276
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
277
|
+
key?: string;
|
|
278
|
+
/** OAuth 2.0 token for the current user. */
|
|
279
|
+
oauth_token?: string;
|
|
280
|
+
/**
|
|
281
|
+
* Maximum number of executions to return per call. Max supported value depends on the selected Execution view: it's 10000 for BASIC and 100 for FULL. The default value used if the
|
|
282
|
+
* field is not specified is 100, regardless of the selected view. Values greater than the max value will be coerced down to it.
|
|
283
|
+
*/
|
|
284
|
+
pageSize?: number;
|
|
285
|
+
/**
|
|
286
|
+
* A page token, received from a previous `ListExecutions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListExecutions`
|
|
287
|
+
* must match the call that provided the page token.
|
|
288
|
+
*/
|
|
289
|
+
pageToken?: string;
|
|
290
|
+
/** Required. Name of the workflow for which the executions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow} */
|
|
291
|
+
parent: string;
|
|
292
|
+
/** Returns response with indentations and line breaks. */
|
|
293
|
+
prettyPrint?: boolean;
|
|
294
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
295
|
+
quotaUser?: string;
|
|
296
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
297
|
+
upload_protocol?: string;
|
|
298
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
299
|
+
uploadType?: string;
|
|
300
|
+
/** Optional. A view defining which fields should be filled in the returned executions. The API will default to the BASIC view. */
|
|
301
|
+
view?: string;
|
|
302
|
+
}): Request<ListExecutionsResponse>;
|
|
303
|
+
}
|
|
304
|
+
interface WorkflowsResource {
|
|
305
|
+
/** Triggers a new execution using the latest revision of the given workflow by a Pub/Sub push notification. */
|
|
306
|
+
triggerPubsubExecution(request: {
|
|
307
|
+
/** V1 error format. */
|
|
308
|
+
"$.xgafv"?: string;
|
|
309
|
+
/** OAuth access token. */
|
|
310
|
+
access_token?: string;
|
|
311
|
+
/** Data format for response. */
|
|
312
|
+
alt?: string;
|
|
313
|
+
/** JSONP */
|
|
314
|
+
callback?: string;
|
|
315
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
316
|
+
fields?: string;
|
|
317
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
318
|
+
key?: string;
|
|
319
|
+
/** OAuth 2.0 token for the current user. */
|
|
320
|
+
oauth_token?: string;
|
|
321
|
+
/** Returns response with indentations and line breaks. */
|
|
322
|
+
prettyPrint?: boolean;
|
|
323
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
324
|
+
quotaUser?: string;
|
|
325
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
326
|
+
upload_protocol?: string;
|
|
327
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
328
|
+
uploadType?: string;
|
|
329
|
+
/** Required. Name of the workflow for which an execution should be created. Format: projects/{project}/locations/{location}/workflows/{workflow} */
|
|
330
|
+
workflow: string;
|
|
331
|
+
/** Request body */
|
|
332
|
+
resource: TriggerPubsubExecutionRequest;
|
|
333
|
+
}): Request<Execution>;
|
|
334
|
+
triggerPubsubExecution(request: {
|
|
335
|
+
/** V1 error format. */
|
|
336
|
+
"$.xgafv"?: string;
|
|
337
|
+
/** OAuth access token. */
|
|
338
|
+
access_token?: string;
|
|
339
|
+
/** Data format for response. */
|
|
340
|
+
alt?: string;
|
|
341
|
+
/** JSONP */
|
|
342
|
+
callback?: string;
|
|
343
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
344
|
+
fields?: string;
|
|
345
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
346
|
+
key?: string;
|
|
347
|
+
/** OAuth 2.0 token for the current user. */
|
|
348
|
+
oauth_token?: string;
|
|
349
|
+
/** Returns response with indentations and line breaks. */
|
|
350
|
+
prettyPrint?: boolean;
|
|
351
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
352
|
+
quotaUser?: string;
|
|
353
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
354
|
+
upload_protocol?: string;
|
|
355
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
356
|
+
uploadType?: string;
|
|
357
|
+
/** Required. Name of the workflow for which an execution should be created. Format: projects/{project}/locations/{location}/workflows/{workflow} */
|
|
358
|
+
workflow: string;
|
|
359
|
+
},
|
|
360
|
+
body: TriggerPubsubExecutionRequest): Request<Execution>;
|
|
361
|
+
executions: ExecutionsResource;
|
|
362
|
+
}
|
|
363
|
+
interface LocationsResource {
|
|
364
|
+
workflows: WorkflowsResource;
|
|
365
|
+
}
|
|
366
|
+
interface ProjectsResource {
|
|
367
|
+
locations: LocationsResource;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const projects: ProjectsResource;
|
|
371
|
+
}
|
|
372
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.workflowexecutions-v1",
|
|
3
|
+
"version": "0.0.20220808",
|
|
4
|
+
"description": "TypeScript typings for Workflow Executions API v1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# TypeScript typings for Workflow Executions API v1
|
|
2
|
+
|
|
3
|
+
Execute workflows created with Workflows API.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/workflows).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Workflow Executions API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.workflowexecutions-v1 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://workflowexecutions.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.workflowexecutions
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('workflowexecutions', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.workflowexecutions
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
50
|
+
],
|
|
51
|
+
immediate = true;
|
|
52
|
+
// ...
|
|
53
|
+
|
|
54
|
+
gapi.auth.authorize(
|
|
55
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
56
|
+
authResult => {
|
|
57
|
+
if (authResult && !authResult.error) {
|
|
58
|
+
/* handle successful authorization */
|
|
59
|
+
} else {
|
|
60
|
+
/* handle authorization error */
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After that you can use Workflow Executions API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.workflowexecutions-v1 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220808
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://workflowexecutions.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.workflowexecutions */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
+
];
|
|
21
|
+
const immediate = false;
|
|
22
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
23
|
+
if (authResult && !authResult.error) {
|
|
24
|
+
/** handle successful authorization */
|
|
25
|
+
run();
|
|
26
|
+
} else {
|
|
27
|
+
/** handle authorization error */
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
/** Triggers a new execution using the latest revision of the given workflow by a Pub/Sub push notification. */
|
|
33
|
+
await gapi.client.workflowexecutions.projects.locations.workflows.triggerPubsubExecution({
|
|
34
|
+
workflow: "Test string",
|
|
35
|
+
}, {
|
|
36
|
+
GCPCloudEventsMode: "Test string",
|
|
37
|
+
message: {
|
|
38
|
+
attributes: {
|
|
39
|
+
A: "Test string"
|
|
40
|
+
},
|
|
41
|
+
data: "Test string",
|
|
42
|
+
messageId: "Test string",
|
|
43
|
+
orderingKey: "Test string",
|
|
44
|
+
publishTime: "Test string",
|
|
45
|
+
},
|
|
46
|
+
subscription: "Test string",
|
|
47
|
+
});
|
|
48
|
+
/** Cancels an execution of the given name. */
|
|
49
|
+
await gapi.client.workflowexecutions.projects.locations.workflows.executions.cancel({
|
|
50
|
+
name: "Test string",
|
|
51
|
+
}, {
|
|
52
|
+
});
|
|
53
|
+
/** Creates a new execution using the latest revision of the given workflow. */
|
|
54
|
+
await gapi.client.workflowexecutions.projects.locations.workflows.executions.create({
|
|
55
|
+
parent: "Test string",
|
|
56
|
+
}, {
|
|
57
|
+
argument: "Test string",
|
|
58
|
+
callLogLevel: "Test string",
|
|
59
|
+
endTime: "Test string",
|
|
60
|
+
error: {
|
|
61
|
+
context: "Test string",
|
|
62
|
+
payload: "Test string",
|
|
63
|
+
stackTrace: {
|
|
64
|
+
elements: [
|
|
65
|
+
{
|
|
66
|
+
position: {
|
|
67
|
+
column: "Test string",
|
|
68
|
+
length: "Test string",
|
|
69
|
+
line: "Test string",
|
|
70
|
+
},
|
|
71
|
+
routine: "Test string",
|
|
72
|
+
step: "Test string",
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
name: "Test string",
|
|
78
|
+
result: "Test string",
|
|
79
|
+
startTime: "Test string",
|
|
80
|
+
state: "Test string",
|
|
81
|
+
workflowRevisionId: "Test string",
|
|
82
|
+
});
|
|
83
|
+
/** Returns an execution of the given name. */
|
|
84
|
+
await gapi.client.workflowexecutions.projects.locations.workflows.executions.get({
|
|
85
|
+
name: "Test string",
|
|
86
|
+
view: "Test string",
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* Returns a list of executions which belong to the workflow with the given name. The method returns executions of all workflow revisions. Returned executions are ordered by their start
|
|
90
|
+
* time (newest first).
|
|
91
|
+
*/
|
|
92
|
+
await gapi.client.workflowexecutions.projects.locations.workflows.executions.list({
|
|
93
|
+
pageSize: 42,
|
|
94
|
+
pageToken: "Test string",
|
|
95
|
+
parent: "Test string",
|
|
96
|
+
view: "Test string",
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": ["es6", "dom"],
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"baseUrl": "../",
|
|
9
|
+
"typeRoots": [
|
|
10
|
+
"../"
|
|
11
|
+
],
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"strictFunctionTypes": true
|
|
16
|
+
},
|
|
17
|
+
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
+
}
|