@breign/client 1.0.178 → 1.0.179
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/dist/apis/ScheduledTasksApi.d.ts +78 -1
- package/dist/apis/ScheduledTasksApi.js +192 -0
- package/dist/models/ScheduledTaskCreateUio.d.ts +1 -1
- package/dist/models/ScheduledTaskRunTriggerUio.d.ts +37 -12
- package/dist/models/ScheduledTaskRunTriggerUio.js +21 -34
- package/dist/models/ScheduledTaskUio.d.ts +8 -1
- package/dist/models/ScheduledTaskUio.js +3 -0
- package/dist/models/TaskTriggerUio.d.ts +8 -1
- package/dist/models/TaskTriggerUio.js +4 -1
- package/dist/models/WebhookEndpointUio.d.ts +82 -0
- package/dist/models/WebhookEndpointUio.js +84 -0
- package/dist/models/WebhookEndpointUpdateUio.d.ts +46 -0
- package/dist/models/WebhookEndpointUpdateUio.js +58 -0
- package/dist/models/WebhookEventListUio.d.ts +33 -0
- package/dist/models/WebhookEventListUio.js +51 -0
- package/dist/models/WebhookEventUio.d.ts +87 -0
- package/dist/models/WebhookEventUio.js +87 -0
- package/dist/models/WebhookTestRequestUio.d.ts +38 -0
- package/dist/models/WebhookTestRequestUio.js +50 -0
- package/dist/models/WebhookTestResponseUio.d.ts +32 -0
- package/dist/models/WebhookTestResponseUio.js +50 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/dist/openapi.json +481 -7
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ScheduledTaskCreateUio, ScheduledTaskListUio, ScheduledTaskManualRunResponseUio, ScheduledTaskRunListUio, ScheduledTaskRunTriggerUio, ScheduledTaskRunUio, ScheduledTaskStatusResponseUio, ScheduledTaskStatusToggleUio, ScheduledTaskUio } from '../models/index';
|
|
13
|
+
import type { ScheduledTaskCreateUio, ScheduledTaskListUio, ScheduledTaskManualRunResponseUio, ScheduledTaskRunListUio, ScheduledTaskRunTriggerUio, ScheduledTaskRunUio, ScheduledTaskStatusResponseUio, ScheduledTaskStatusToggleUio, ScheduledTaskUio, WebhookEndpointUio, WebhookEndpointUpdateUio, WebhookEventListUio, WebhookTestRequestUio, WebhookTestResponseUio } from '../models/index';
|
|
14
14
|
export interface CreateScheduledTaskRequest {
|
|
15
15
|
agentId: string;
|
|
16
16
|
scheduledTaskCreateUio: ScheduledTaskCreateUio;
|
|
@@ -33,6 +33,10 @@ export interface GetScheduledTaskRunTriggerRequest {
|
|
|
33
33
|
taskId: string;
|
|
34
34
|
runId: string;
|
|
35
35
|
}
|
|
36
|
+
export interface GetScheduledTaskWebhookRequest {
|
|
37
|
+
agentId: string;
|
|
38
|
+
taskId: string;
|
|
39
|
+
}
|
|
36
40
|
export interface ListAgentScheduledTaskRunsRequest {
|
|
37
41
|
agentId: string;
|
|
38
42
|
from: Date;
|
|
@@ -44,6 +48,11 @@ export interface ListScheduledTaskRunsRequest {
|
|
|
44
48
|
limit?: number;
|
|
45
49
|
before?: Date;
|
|
46
50
|
}
|
|
51
|
+
export interface ListScheduledTaskWebhookEventsRequest {
|
|
52
|
+
agentId: string;
|
|
53
|
+
taskId: string;
|
|
54
|
+
limit?: number;
|
|
55
|
+
}
|
|
47
56
|
export interface ListScheduledTasksRequest {
|
|
48
57
|
agentId: string;
|
|
49
58
|
status?: ListScheduledTasksStatusEnum;
|
|
@@ -51,6 +60,19 @@ export interface ListScheduledTasksRequest {
|
|
|
51
60
|
limit?: number;
|
|
52
61
|
before?: Date;
|
|
53
62
|
}
|
|
63
|
+
export interface RegenerateScheduledTaskWebhookUrlRequest {
|
|
64
|
+
agentId: string;
|
|
65
|
+
taskId: string;
|
|
66
|
+
}
|
|
67
|
+
export interface RotateScheduledTaskWebhookSecretRequest {
|
|
68
|
+
agentId: string;
|
|
69
|
+
taskId: string;
|
|
70
|
+
}
|
|
71
|
+
export interface TestScheduledTaskWebhookRequest {
|
|
72
|
+
agentId: string;
|
|
73
|
+
taskId: string;
|
|
74
|
+
webhookTestRequestUio?: WebhookTestRequestUio;
|
|
75
|
+
}
|
|
54
76
|
export interface ToggleScheduledTaskStatusRequest {
|
|
55
77
|
agentId: string;
|
|
56
78
|
taskId: string;
|
|
@@ -65,6 +87,11 @@ export interface UpdateScheduledTaskRequest {
|
|
|
65
87
|
taskId: string;
|
|
66
88
|
scheduledTaskCreateUio: ScheduledTaskCreateUio;
|
|
67
89
|
}
|
|
90
|
+
export interface UpdateScheduledTaskWebhookRequest {
|
|
91
|
+
agentId: string;
|
|
92
|
+
taskId: string;
|
|
93
|
+
webhookEndpointUpdateUio: WebhookEndpointUpdateUio;
|
|
94
|
+
}
|
|
68
95
|
/**
|
|
69
96
|
*
|
|
70
97
|
*/
|
|
@@ -109,6 +136,14 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
109
136
|
* The external event that triggered a run (« Déclenché par »)
|
|
110
137
|
*/
|
|
111
138
|
getScheduledTaskRunTrigger(agentId: string, taskId: string, runId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskRunTriggerUio>;
|
|
139
|
+
/**
|
|
140
|
+
* The webhook of an automation triggered by a webhook
|
|
141
|
+
*/
|
|
142
|
+
getScheduledTaskWebhookRaw(requestParameters: GetScheduledTaskWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
|
|
143
|
+
/**
|
|
144
|
+
* The webhook of an automation triggered by a webhook
|
|
145
|
+
*/
|
|
146
|
+
getScheduledTaskWebhook(agentId: string, taskId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
|
|
112
147
|
/**
|
|
113
148
|
* List all runs for an agent\'s scheduled tasks within a date range
|
|
114
149
|
*/
|
|
@@ -125,6 +160,14 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
125
160
|
* List runs for a scheduled task
|
|
126
161
|
*/
|
|
127
162
|
listScheduledTaskRuns(agentId: string, taskId: string, limit?: number, before?: Date, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskRunListUio>;
|
|
163
|
+
/**
|
|
164
|
+
* The latest calls received on the webhook
|
|
165
|
+
*/
|
|
166
|
+
listScheduledTaskWebhookEventsRaw(requestParameters: ListScheduledTaskWebhookEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEventListUio>>;
|
|
167
|
+
/**
|
|
168
|
+
* The latest calls received on the webhook
|
|
169
|
+
*/
|
|
170
|
+
listScheduledTaskWebhookEvents(agentId: string, taskId: string, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEventListUio>;
|
|
128
171
|
/**
|
|
129
172
|
* List scheduled tasks for an agent
|
|
130
173
|
*/
|
|
@@ -133,6 +176,32 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
133
176
|
* List scheduled tasks for an agent
|
|
134
177
|
*/
|
|
135
178
|
listScheduledTasks(agentId: string, status?: ListScheduledTasksStatusEnum, q?: string, limit?: number, before?: Date, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskListUio>;
|
|
179
|
+
/**
|
|
180
|
+
* Give the webhook a new URL (the old one answers 404)
|
|
181
|
+
*/
|
|
182
|
+
regenerateScheduledTaskWebhookUrlRaw(requestParameters: RegenerateScheduledTaskWebhookUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
|
|
183
|
+
/**
|
|
184
|
+
* Give the webhook a new URL (the old one answers 404)
|
|
185
|
+
*/
|
|
186
|
+
regenerateScheduledTaskWebhookUrl(agentId: string, taskId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
|
|
187
|
+
/**
|
|
188
|
+
* Rotate the webhook secret (the old one stops working)
|
|
189
|
+
*/
|
|
190
|
+
rotateScheduledTaskWebhookSecretRaw(requestParameters: RotateScheduledTaskWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
|
|
191
|
+
/**
|
|
192
|
+
* Rotate the webhook secret (the old one stops working)
|
|
193
|
+
*/
|
|
194
|
+
rotateScheduledTaskWebhookSecret(agentId: string, taskId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
|
|
195
|
+
/**
|
|
196
|
+
* The call goes through the same ingestion as a real one, and the agent runs for real.
|
|
197
|
+
* Send a test call to the webhook, signed by the server
|
|
198
|
+
*/
|
|
199
|
+
testScheduledTaskWebhookRaw(requestParameters: TestScheduledTaskWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookTestResponseUio>>;
|
|
200
|
+
/**
|
|
201
|
+
* The call goes through the same ingestion as a real one, and the agent runs for real.
|
|
202
|
+
* Send a test call to the webhook, signed by the server
|
|
203
|
+
*/
|
|
204
|
+
testScheduledTaskWebhook(agentId: string, taskId: string, webhookTestRequestUio?: WebhookTestRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookTestResponseUio>;
|
|
136
205
|
/**
|
|
137
206
|
* Toggle scheduled task status (active/paused)
|
|
138
207
|
*/
|
|
@@ -157,6 +226,14 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
157
226
|
* Update a scheduled task
|
|
158
227
|
*/
|
|
159
228
|
updateScheduledTask(agentId: string, taskId: string, scheduledTaskCreateUio: ScheduledTaskCreateUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskUio>;
|
|
229
|
+
/**
|
|
230
|
+
* Disable the webhook or change its service user
|
|
231
|
+
*/
|
|
232
|
+
updateScheduledTaskWebhookRaw(requestParameters: UpdateScheduledTaskWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
|
|
233
|
+
/**
|
|
234
|
+
* Disable the webhook or change its service user
|
|
235
|
+
*/
|
|
236
|
+
updateScheduledTaskWebhook(agentId: string, taskId: string, webhookEndpointUpdateUio: WebhookEndpointUpdateUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
|
|
160
237
|
}
|
|
161
238
|
/**
|
|
162
239
|
* @export
|
|
@@ -210,6 +210,36 @@ class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
210
210
|
const response = await this.getScheduledTaskRunTriggerRaw({ agentId: agentId, taskId: taskId, runId: runId }, initOverrides);
|
|
211
211
|
return await response.value();
|
|
212
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* The webhook of an automation triggered by a webhook
|
|
215
|
+
*/
|
|
216
|
+
async getScheduledTaskWebhookRaw(requestParameters, initOverrides) {
|
|
217
|
+
if (requestParameters['agentId'] == null) {
|
|
218
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling getScheduledTaskWebhook().');
|
|
219
|
+
}
|
|
220
|
+
if (requestParameters['taskId'] == null) {
|
|
221
|
+
throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling getScheduledTaskWebhook().');
|
|
222
|
+
}
|
|
223
|
+
const queryParameters = {};
|
|
224
|
+
const headerParameters = {};
|
|
225
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
226
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
227
|
+
}
|
|
228
|
+
const response = await this.request({
|
|
229
|
+
path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
|
|
230
|
+
method: 'GET',
|
|
231
|
+
headers: headerParameters,
|
|
232
|
+
query: queryParameters,
|
|
233
|
+
}, initOverrides);
|
|
234
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointUioFromJSON)(jsonValue));
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* The webhook of an automation triggered by a webhook
|
|
238
|
+
*/
|
|
239
|
+
async getScheduledTaskWebhook(agentId, taskId, initOverrides) {
|
|
240
|
+
const response = await this.getScheduledTaskWebhookRaw({ agentId: agentId, taskId: taskId }, initOverrides);
|
|
241
|
+
return await response.value();
|
|
242
|
+
}
|
|
213
243
|
/**
|
|
214
244
|
* List all runs for an agent\'s scheduled tasks within a date range
|
|
215
245
|
*/
|
|
@@ -285,6 +315,39 @@ class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
285
315
|
const response = await this.listScheduledTaskRunsRaw({ agentId: agentId, taskId: taskId, limit: limit, before: before }, initOverrides);
|
|
286
316
|
return await response.value();
|
|
287
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* The latest calls received on the webhook
|
|
320
|
+
*/
|
|
321
|
+
async listScheduledTaskWebhookEventsRaw(requestParameters, initOverrides) {
|
|
322
|
+
if (requestParameters['agentId'] == null) {
|
|
323
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling listScheduledTaskWebhookEvents().');
|
|
324
|
+
}
|
|
325
|
+
if (requestParameters['taskId'] == null) {
|
|
326
|
+
throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling listScheduledTaskWebhookEvents().');
|
|
327
|
+
}
|
|
328
|
+
const queryParameters = {};
|
|
329
|
+
if (requestParameters['limit'] != null) {
|
|
330
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
331
|
+
}
|
|
332
|
+
const headerParameters = {};
|
|
333
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
334
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
335
|
+
}
|
|
336
|
+
const response = await this.request({
|
|
337
|
+
path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/events`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
|
|
338
|
+
method: 'GET',
|
|
339
|
+
headers: headerParameters,
|
|
340
|
+
query: queryParameters,
|
|
341
|
+
}, initOverrides);
|
|
342
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEventListUioFromJSON)(jsonValue));
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* The latest calls received on the webhook
|
|
346
|
+
*/
|
|
347
|
+
async listScheduledTaskWebhookEvents(agentId, taskId, limit, initOverrides) {
|
|
348
|
+
const response = await this.listScheduledTaskWebhookEventsRaw({ agentId: agentId, taskId: taskId, limit: limit }, initOverrides);
|
|
349
|
+
return await response.value();
|
|
350
|
+
}
|
|
288
351
|
/**
|
|
289
352
|
* List scheduled tasks for an agent
|
|
290
353
|
*/
|
|
@@ -324,6 +387,100 @@ class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
324
387
|
const response = await this.listScheduledTasksRaw({ agentId: agentId, status: status, q: q, limit: limit, before: before }, initOverrides);
|
|
325
388
|
return await response.value();
|
|
326
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* Give the webhook a new URL (the old one answers 404)
|
|
392
|
+
*/
|
|
393
|
+
async regenerateScheduledTaskWebhookUrlRaw(requestParameters, initOverrides) {
|
|
394
|
+
if (requestParameters['agentId'] == null) {
|
|
395
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling regenerateScheduledTaskWebhookUrl().');
|
|
396
|
+
}
|
|
397
|
+
if (requestParameters['taskId'] == null) {
|
|
398
|
+
throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling regenerateScheduledTaskWebhookUrl().');
|
|
399
|
+
}
|
|
400
|
+
const queryParameters = {};
|
|
401
|
+
const headerParameters = {};
|
|
402
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
403
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
404
|
+
}
|
|
405
|
+
const response = await this.request({
|
|
406
|
+
path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/regenerate-url`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
|
|
407
|
+
method: 'POST',
|
|
408
|
+
headers: headerParameters,
|
|
409
|
+
query: queryParameters,
|
|
410
|
+
}, initOverrides);
|
|
411
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointUioFromJSON)(jsonValue));
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Give the webhook a new URL (the old one answers 404)
|
|
415
|
+
*/
|
|
416
|
+
async regenerateScheduledTaskWebhookUrl(agentId, taskId, initOverrides) {
|
|
417
|
+
const response = await this.regenerateScheduledTaskWebhookUrlRaw({ agentId: agentId, taskId: taskId }, initOverrides);
|
|
418
|
+
return await response.value();
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Rotate the webhook secret (the old one stops working)
|
|
422
|
+
*/
|
|
423
|
+
async rotateScheduledTaskWebhookSecretRaw(requestParameters, initOverrides) {
|
|
424
|
+
if (requestParameters['agentId'] == null) {
|
|
425
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling rotateScheduledTaskWebhookSecret().');
|
|
426
|
+
}
|
|
427
|
+
if (requestParameters['taskId'] == null) {
|
|
428
|
+
throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling rotateScheduledTaskWebhookSecret().');
|
|
429
|
+
}
|
|
430
|
+
const queryParameters = {};
|
|
431
|
+
const headerParameters = {};
|
|
432
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
433
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
434
|
+
}
|
|
435
|
+
const response = await this.request({
|
|
436
|
+
path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/rotate-secret`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
|
|
437
|
+
method: 'POST',
|
|
438
|
+
headers: headerParameters,
|
|
439
|
+
query: queryParameters,
|
|
440
|
+
}, initOverrides);
|
|
441
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointUioFromJSON)(jsonValue));
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Rotate the webhook secret (the old one stops working)
|
|
445
|
+
*/
|
|
446
|
+
async rotateScheduledTaskWebhookSecret(agentId, taskId, initOverrides) {
|
|
447
|
+
const response = await this.rotateScheduledTaskWebhookSecretRaw({ agentId: agentId, taskId: taskId }, initOverrides);
|
|
448
|
+
return await response.value();
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* The call goes through the same ingestion as a real one, and the agent runs for real.
|
|
452
|
+
* Send a test call to the webhook, signed by the server
|
|
453
|
+
*/
|
|
454
|
+
async testScheduledTaskWebhookRaw(requestParameters, initOverrides) {
|
|
455
|
+
if (requestParameters['agentId'] == null) {
|
|
456
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling testScheduledTaskWebhook().');
|
|
457
|
+
}
|
|
458
|
+
if (requestParameters['taskId'] == null) {
|
|
459
|
+
throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling testScheduledTaskWebhook().');
|
|
460
|
+
}
|
|
461
|
+
const queryParameters = {};
|
|
462
|
+
const headerParameters = {};
|
|
463
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
464
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
465
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
466
|
+
}
|
|
467
|
+
const response = await this.request({
|
|
468
|
+
path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/test`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
|
|
469
|
+
method: 'POST',
|
|
470
|
+
headers: headerParameters,
|
|
471
|
+
query: queryParameters,
|
|
472
|
+
body: (0, index_1.WebhookTestRequestUioToJSON)(requestParameters['webhookTestRequestUio']),
|
|
473
|
+
}, initOverrides);
|
|
474
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookTestResponseUioFromJSON)(jsonValue));
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* The call goes through the same ingestion as a real one, and the agent runs for real.
|
|
478
|
+
* Send a test call to the webhook, signed by the server
|
|
479
|
+
*/
|
|
480
|
+
async testScheduledTaskWebhook(agentId, taskId, webhookTestRequestUio, initOverrides) {
|
|
481
|
+
const response = await this.testScheduledTaskWebhookRaw({ agentId: agentId, taskId: taskId, webhookTestRequestUio: webhookTestRequestUio }, initOverrides);
|
|
482
|
+
return await response.value();
|
|
483
|
+
}
|
|
327
484
|
/**
|
|
328
485
|
* Toggle scheduled task status (active/paused)
|
|
329
486
|
*/
|
|
@@ -424,6 +581,41 @@ class ScheduledTasksApi extends runtime.BaseAPI {
|
|
|
424
581
|
const response = await this.updateScheduledTaskRaw({ agentId: agentId, taskId: taskId, scheduledTaskCreateUio: scheduledTaskCreateUio }, initOverrides);
|
|
425
582
|
return await response.value();
|
|
426
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* Disable the webhook or change its service user
|
|
586
|
+
*/
|
|
587
|
+
async updateScheduledTaskWebhookRaw(requestParameters, initOverrides) {
|
|
588
|
+
if (requestParameters['agentId'] == null) {
|
|
589
|
+
throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling updateScheduledTaskWebhook().');
|
|
590
|
+
}
|
|
591
|
+
if (requestParameters['taskId'] == null) {
|
|
592
|
+
throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling updateScheduledTaskWebhook().');
|
|
593
|
+
}
|
|
594
|
+
if (requestParameters['webhookEndpointUpdateUio'] == null) {
|
|
595
|
+
throw new runtime.RequiredError('webhookEndpointUpdateUio', 'Required parameter "webhookEndpointUpdateUio" was null or undefined when calling updateScheduledTaskWebhook().');
|
|
596
|
+
}
|
|
597
|
+
const queryParameters = {};
|
|
598
|
+
const headerParameters = {};
|
|
599
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
600
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
601
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
602
|
+
}
|
|
603
|
+
const response = await this.request({
|
|
604
|
+
path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
|
|
605
|
+
method: 'PATCH',
|
|
606
|
+
headers: headerParameters,
|
|
607
|
+
query: queryParameters,
|
|
608
|
+
body: (0, index_1.WebhookEndpointUpdateUioToJSON)(requestParameters['webhookEndpointUpdateUio']),
|
|
609
|
+
}, initOverrides);
|
|
610
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointUioFromJSON)(jsonValue));
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Disable the webhook or change its service user
|
|
614
|
+
*/
|
|
615
|
+
async updateScheduledTaskWebhook(agentId, taskId, webhookEndpointUpdateUio, initOverrides) {
|
|
616
|
+
const response = await this.updateScheduledTaskWebhookRaw({ agentId: agentId, taskId: taskId, webhookEndpointUpdateUio: webhookEndpointUpdateUio }, initOverrides);
|
|
617
|
+
return await response.value();
|
|
618
|
+
}
|
|
427
619
|
}
|
|
428
620
|
exports.ScheduledTasksApi = ScheduledTasksApi;
|
|
429
621
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type { TaskScheduleUio } from './TaskScheduleUio';
|
|
13
13
|
import type { TaskTriggerUio } from './TaskTriggerUio';
|
|
14
14
|
/**
|
|
15
|
-
* `schedule` is required unless `trigger.type` is `event` (then `mode` must be `recurring`).
|
|
15
|
+
* `schedule` is required unless `trigger.type` is `event` or `webhook` (then `mode` must be `recurring`). A `webhook` trigger creates the webhook, returned in `webhook` with its secret (shown once).
|
|
16
16
|
* @export
|
|
17
17
|
* @interface ScheduledTaskCreateUio
|
|
18
18
|
*/
|
|
@@ -13,7 +13,7 @@ import type { ExternalEventRoutingUio } from './ExternalEventRoutingUio';
|
|
|
13
13
|
import type { ScheduledTaskRunTriggerAuthorUio } from './ScheduledTaskRunTriggerAuthorUio';
|
|
14
14
|
import type { ExternalEventStatusUio } from './ExternalEventStatusUio';
|
|
15
15
|
/**
|
|
16
|
-
* The
|
|
16
|
+
* The external event that triggered a run: a GitLab mention (`source: gitlab`, GitLab fields set) or a webhook call (`source: webhook`: `thread`, `contentType`, `payload`).
|
|
17
17
|
* @export
|
|
18
18
|
* @interface ScheduledTaskRunTriggerUio
|
|
19
19
|
*/
|
|
@@ -30,6 +30,30 @@ export interface ScheduledTaskRunTriggerUio {
|
|
|
30
30
|
* @memberof ScheduledTaskRunTriggerUio
|
|
31
31
|
*/
|
|
32
32
|
source: ScheduledTaskRunTriggerUioSourceEnum;
|
|
33
|
+
/**
|
|
34
|
+
* webhook only — the `X-Breign-Thread` of the call.
|
|
35
|
+
* @type {string}
|
|
36
|
+
* @memberof ScheduledTaskRunTriggerUio
|
|
37
|
+
*/
|
|
38
|
+
thread?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* webhook only.
|
|
41
|
+
* @type {string}
|
|
42
|
+
* @memberof ScheduledTaskRunTriggerUio
|
|
43
|
+
*/
|
|
44
|
+
contentType?: string;
|
|
45
|
+
/**
|
|
46
|
+
* webhook only — the body received (untrusted caller data), or its start as text.
|
|
47
|
+
* @type {any}
|
|
48
|
+
* @memberof ScheduledTaskRunTriggerUio
|
|
49
|
+
*/
|
|
50
|
+
payload?: any | null;
|
|
51
|
+
/**
|
|
52
|
+
* webhook only.
|
|
53
|
+
* @type {boolean}
|
|
54
|
+
* @memberof ScheduledTaskRunTriggerUio
|
|
55
|
+
*/
|
|
56
|
+
payloadTruncated?: boolean;
|
|
33
57
|
/**
|
|
34
58
|
*
|
|
35
59
|
* @type {ExternalEventStatusUio}
|
|
@@ -47,67 +71,67 @@ export interface ScheduledTaskRunTriggerUio {
|
|
|
47
71
|
* @type {string}
|
|
48
72
|
* @memberof ScheduledTaskRunTriggerUio
|
|
49
73
|
*/
|
|
50
|
-
projectPath
|
|
74
|
+
projectPath?: string;
|
|
51
75
|
/**
|
|
52
76
|
*
|
|
53
77
|
* @type {string}
|
|
54
78
|
* @memberof ScheduledTaskRunTriggerUio
|
|
55
79
|
*/
|
|
56
|
-
targetType
|
|
80
|
+
targetType?: ScheduledTaskRunTriggerUioTargetTypeEnum;
|
|
57
81
|
/**
|
|
58
82
|
*
|
|
59
83
|
* @type {number}
|
|
60
84
|
* @memberof ScheduledTaskRunTriggerUio
|
|
61
85
|
*/
|
|
62
|
-
targetIid
|
|
86
|
+
targetIid?: number | null;
|
|
63
87
|
/**
|
|
64
88
|
*
|
|
65
89
|
* @type {string}
|
|
66
90
|
* @memberof ScheduledTaskRunTriggerUio
|
|
67
91
|
*/
|
|
68
|
-
targetTitle
|
|
92
|
+
targetTitle?: string | null;
|
|
69
93
|
/**
|
|
70
94
|
*
|
|
71
95
|
* @type {string}
|
|
72
96
|
* @memberof ScheduledTaskRunTriggerUio
|
|
73
97
|
*/
|
|
74
|
-
targetUrl
|
|
98
|
+
targetUrl?: string | null;
|
|
75
99
|
/**
|
|
76
100
|
*
|
|
77
101
|
* @type {string}
|
|
78
102
|
* @memberof ScheduledTaskRunTriggerUio
|
|
79
103
|
*/
|
|
80
|
-
noteUrl
|
|
104
|
+
noteUrl?: string | null;
|
|
81
105
|
/**
|
|
82
106
|
*
|
|
83
107
|
* @type {ScheduledTaskRunTriggerAuthorUio}
|
|
84
108
|
* @memberof ScheduledTaskRunTriggerUio
|
|
85
109
|
*/
|
|
86
|
-
author
|
|
110
|
+
author?: ScheduledTaskRunTriggerAuthorUio;
|
|
87
111
|
/**
|
|
88
112
|
* The comment text (untrusted user content).
|
|
89
113
|
* @type {string}
|
|
90
114
|
* @memberof ScheduledTaskRunTriggerUio
|
|
91
115
|
*/
|
|
92
|
-
body
|
|
116
|
+
body?: string;
|
|
93
117
|
/**
|
|
94
118
|
*
|
|
95
119
|
* @type {string}
|
|
96
120
|
* @memberof ScheduledTaskRunTriggerUio
|
|
97
121
|
*/
|
|
98
|
-
botUsername
|
|
122
|
+
botUsername?: string | null;
|
|
99
123
|
/**
|
|
100
124
|
*
|
|
101
125
|
* @type {ExternalEventRoutingUio}
|
|
102
126
|
* @memberof ScheduledTaskRunTriggerUio
|
|
103
127
|
*/
|
|
104
|
-
routing
|
|
128
|
+
routing?: ExternalEventRoutingUio | null;
|
|
105
129
|
/**
|
|
106
130
|
*
|
|
107
131
|
* @type {string}
|
|
108
132
|
* @memberof ScheduledTaskRunTriggerUio
|
|
109
133
|
*/
|
|
110
|
-
replyUrl
|
|
134
|
+
replyUrl?: string | null;
|
|
111
135
|
/**
|
|
112
136
|
*
|
|
113
137
|
* @type {string}
|
|
@@ -120,6 +144,7 @@ export interface ScheduledTaskRunTriggerUio {
|
|
|
120
144
|
*/
|
|
121
145
|
export declare const ScheduledTaskRunTriggerUioSourceEnum: {
|
|
122
146
|
readonly Gitlab: "gitlab";
|
|
147
|
+
readonly Webhook: "webhook";
|
|
123
148
|
};
|
|
124
149
|
export type ScheduledTaskRunTriggerUioSourceEnum = typeof ScheduledTaskRunTriggerUioSourceEnum[keyof typeof ScheduledTaskRunTriggerUioSourceEnum];
|
|
125
150
|
/**
|
|
@@ -26,7 +26,8 @@ const ExternalEventStatusUio_1 = require("./ExternalEventStatusUio");
|
|
|
26
26
|
* @export
|
|
27
27
|
*/
|
|
28
28
|
exports.ScheduledTaskRunTriggerUioSourceEnum = {
|
|
29
|
-
Gitlab: 'gitlab'
|
|
29
|
+
Gitlab: 'gitlab',
|
|
30
|
+
Webhook: 'webhook'
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
32
33
|
* @export
|
|
@@ -49,28 +50,6 @@ function instanceOfScheduledTaskRunTriggerUio(value) {
|
|
|
49
50
|
return false;
|
|
50
51
|
if (!('receivedAt' in value) || value['receivedAt'] === undefined)
|
|
51
52
|
return false;
|
|
52
|
-
if (!('projectPath' in value) || value['projectPath'] === undefined)
|
|
53
|
-
return false;
|
|
54
|
-
if (!('targetType' in value) || value['targetType'] === undefined)
|
|
55
|
-
return false;
|
|
56
|
-
if (!('targetIid' in value) || value['targetIid'] === undefined)
|
|
57
|
-
return false;
|
|
58
|
-
if (!('targetTitle' in value) || value['targetTitle'] === undefined)
|
|
59
|
-
return false;
|
|
60
|
-
if (!('targetUrl' in value) || value['targetUrl'] === undefined)
|
|
61
|
-
return false;
|
|
62
|
-
if (!('noteUrl' in value) || value['noteUrl'] === undefined)
|
|
63
|
-
return false;
|
|
64
|
-
if (!('author' in value) || value['author'] === undefined)
|
|
65
|
-
return false;
|
|
66
|
-
if (!('body' in value) || value['body'] === undefined)
|
|
67
|
-
return false;
|
|
68
|
-
if (!('botUsername' in value) || value['botUsername'] === undefined)
|
|
69
|
-
return false;
|
|
70
|
-
if (!('routing' in value) || value['routing'] === undefined)
|
|
71
|
-
return false;
|
|
72
|
-
if (!('replyUrl' in value) || value['replyUrl'] === undefined)
|
|
73
|
-
return false;
|
|
74
53
|
if (!('conversationId' in value) || value['conversationId'] === undefined)
|
|
75
54
|
return false;
|
|
76
55
|
return true;
|
|
@@ -85,19 +64,23 @@ function ScheduledTaskRunTriggerUioFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
85
64
|
return {
|
|
86
65
|
'eventId': json['eventId'],
|
|
87
66
|
'source': json['source'],
|
|
67
|
+
'thread': json['thread'] == null ? undefined : json['thread'],
|
|
68
|
+
'contentType': json['contentType'] == null ? undefined : json['contentType'],
|
|
69
|
+
'payload': json['payload'] == null ? undefined : json['payload'],
|
|
70
|
+
'payloadTruncated': json['payloadTruncated'] == null ? undefined : json['payloadTruncated'],
|
|
88
71
|
'status': (0, ExternalEventStatusUio_1.ExternalEventStatusUioFromJSON)(json['status']),
|
|
89
72
|
'receivedAt': (new Date(json['receivedAt'])),
|
|
90
|
-
'projectPath': json['projectPath'],
|
|
91
|
-
'targetType': json['targetType'],
|
|
92
|
-
'targetIid': json['targetIid'],
|
|
93
|
-
'targetTitle': json['targetTitle'],
|
|
94
|
-
'targetUrl': json['targetUrl'],
|
|
95
|
-
'noteUrl': json['noteUrl'],
|
|
96
|
-
'author': (0, ScheduledTaskRunTriggerAuthorUio_1.ScheduledTaskRunTriggerAuthorUioFromJSON)(json['author']),
|
|
97
|
-
'body': json['body'],
|
|
98
|
-
'botUsername': json['botUsername'],
|
|
99
|
-
'routing': (0, ExternalEventRoutingUio_1.ExternalEventRoutingUioFromJSON)(json['routing']),
|
|
100
|
-
'replyUrl': json['replyUrl'],
|
|
73
|
+
'projectPath': json['projectPath'] == null ? undefined : json['projectPath'],
|
|
74
|
+
'targetType': json['targetType'] == null ? undefined : json['targetType'],
|
|
75
|
+
'targetIid': json['targetIid'] == null ? undefined : json['targetIid'],
|
|
76
|
+
'targetTitle': json['targetTitle'] == null ? undefined : json['targetTitle'],
|
|
77
|
+
'targetUrl': json['targetUrl'] == null ? undefined : json['targetUrl'],
|
|
78
|
+
'noteUrl': json['noteUrl'] == null ? undefined : json['noteUrl'],
|
|
79
|
+
'author': json['author'] == null ? undefined : (0, ScheduledTaskRunTriggerAuthorUio_1.ScheduledTaskRunTriggerAuthorUioFromJSON)(json['author']),
|
|
80
|
+
'body': json['body'] == null ? undefined : json['body'],
|
|
81
|
+
'botUsername': json['botUsername'] == null ? undefined : json['botUsername'],
|
|
82
|
+
'routing': json['routing'] == null ? undefined : (0, ExternalEventRoutingUio_1.ExternalEventRoutingUioFromJSON)(json['routing']),
|
|
83
|
+
'replyUrl': json['replyUrl'] == null ? undefined : json['replyUrl'],
|
|
101
84
|
'conversationId': json['conversationId'],
|
|
102
85
|
};
|
|
103
86
|
}
|
|
@@ -111,6 +94,10 @@ function ScheduledTaskRunTriggerUioToJSONTyped(value, ignoreDiscriminator = fals
|
|
|
111
94
|
return {
|
|
112
95
|
'eventId': value['eventId'],
|
|
113
96
|
'source': value['source'],
|
|
97
|
+
'thread': value['thread'],
|
|
98
|
+
'contentType': value['contentType'],
|
|
99
|
+
'payload': value['payload'],
|
|
100
|
+
'payloadTruncated': value['payloadTruncated'],
|
|
114
101
|
'status': (0, ExternalEventStatusUio_1.ExternalEventStatusUioToJSON)(value['status']),
|
|
115
102
|
'receivedAt': ((value['receivedAt']).toISOString()),
|
|
116
103
|
'projectPath': value['projectPath'],
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { TaskScheduleUio } from './TaskScheduleUio';
|
|
13
|
+
import type { WebhookEndpointUio } from './WebhookEndpointUio';
|
|
13
14
|
import type { TaskTriggerUio } from './TaskTriggerUio';
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
@@ -60,7 +61,7 @@ export interface ScheduledTaskUio {
|
|
|
60
61
|
*/
|
|
61
62
|
status: ScheduledTaskUioStatusEnum;
|
|
62
63
|
/**
|
|
63
|
-
* null for an automation triggered by an event.
|
|
64
|
+
* null for an automation triggered by an event or a webhook.
|
|
64
65
|
* @type {TaskScheduleUio}
|
|
65
66
|
* @memberof ScheduledTaskUio
|
|
66
67
|
*/
|
|
@@ -71,6 +72,12 @@ export interface ScheduledTaskUio {
|
|
|
71
72
|
* @memberof ScheduledTaskUio
|
|
72
73
|
*/
|
|
73
74
|
trigger?: TaskTriggerUio;
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @type {WebhookEndpointUio}
|
|
78
|
+
* @memberof ScheduledTaskUio
|
|
79
|
+
*/
|
|
80
|
+
webhook?: WebhookEndpointUio;
|
|
74
81
|
/**
|
|
75
82
|
*
|
|
76
83
|
* @type {string}
|
|
@@ -20,6 +20,7 @@ exports.ScheduledTaskUioFromJSONTyped = ScheduledTaskUioFromJSONTyped;
|
|
|
20
20
|
exports.ScheduledTaskUioToJSON = ScheduledTaskUioToJSON;
|
|
21
21
|
exports.ScheduledTaskUioToJSONTyped = ScheduledTaskUioToJSONTyped;
|
|
22
22
|
const TaskScheduleUio_1 = require("./TaskScheduleUio");
|
|
23
|
+
const WebhookEndpointUio_1 = require("./WebhookEndpointUio");
|
|
23
24
|
const TaskTriggerUio_1 = require("./TaskTriggerUio");
|
|
24
25
|
/**
|
|
25
26
|
* @export
|
|
@@ -85,6 +86,7 @@ function ScheduledTaskUioFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
85
86
|
'status': json['status'],
|
|
86
87
|
'schedule': (0, TaskScheduleUio_1.TaskScheduleUioFromJSON)(json['schedule']),
|
|
87
88
|
'trigger': json['trigger'] == null ? undefined : (0, TaskTriggerUio_1.TaskTriggerUioFromJSON)(json['trigger']),
|
|
89
|
+
'webhook': json['webhook'] == null ? undefined : (0, WebhookEndpointUio_1.WebhookEndpointUioFromJSON)(json['webhook']),
|
|
88
90
|
'cronExpression': json['cronExpression'],
|
|
89
91
|
'timezone': json['timezone'],
|
|
90
92
|
'lang': json['lang'],
|
|
@@ -113,6 +115,7 @@ function ScheduledTaskUioToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
113
115
|
'status': value['status'],
|
|
114
116
|
'schedule': (0, TaskScheduleUio_1.TaskScheduleUioToJSON)(value['schedule']),
|
|
115
117
|
'trigger': (0, TaskTriggerUio_1.TaskTriggerUioToJSON)(value['trigger']),
|
|
118
|
+
'webhook': (0, WebhookEndpointUio_1.WebhookEndpointUioToJSON)(value['webhook']),
|
|
116
119
|
'cronExpression': value['cronExpression'],
|
|
117
120
|
'timezone': value['timezone'],
|
|
118
121
|
'lang': value['lang'],
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { TaskTriggerReplyUio } from './TaskTriggerReplyUio';
|
|
13
13
|
/**
|
|
14
|
-
* What starts the automation. `schedule` (default): its schedule. `event`: a mention of one of the bot accounts in GitLab, in the given kinds of objects and projects (empty: all projects; `groupe/projet` or `groupe/*`).
|
|
14
|
+
* What starts the automation. `schedule` (default): its schedule. `event`: a mention of one of the bot accounts in GitLab, in the given kinds of objects and projects (empty: all projects; `groupe/projet` or `groupe/*`). `webhook`: a call to its webhook (see `ScheduledTask.webhook`); the result goes to `callbackUrl`.
|
|
15
15
|
* @export
|
|
16
16
|
* @interface TaskTriggerUio
|
|
17
17
|
*/
|
|
@@ -22,6 +22,12 @@ export interface TaskTriggerUio {
|
|
|
22
22
|
* @memberof TaskTriggerUio
|
|
23
23
|
*/
|
|
24
24
|
type: TaskTriggerUioTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
* `webhook` only, on create or update: the member the conversations run as (default: the caller; another member requires an organization admin). Not stored on the task.
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof TaskTriggerUio
|
|
29
|
+
*/
|
|
30
|
+
runAsUserId?: string;
|
|
25
31
|
/**
|
|
26
32
|
*
|
|
27
33
|
* @type {string}
|
|
@@ -59,6 +65,7 @@ export interface TaskTriggerUio {
|
|
|
59
65
|
export declare const TaskTriggerUioTypeEnum: {
|
|
60
66
|
readonly Schedule: "schedule";
|
|
61
67
|
readonly Event: "event";
|
|
68
|
+
readonly Webhook: "webhook";
|
|
62
69
|
};
|
|
63
70
|
export type TaskTriggerUioTypeEnum = typeof TaskTriggerUioTypeEnum[keyof typeof TaskTriggerUioTypeEnum];
|
|
64
71
|
/**
|