@breign/client 1.0.178 → 1.0.180

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.
Files changed (47) hide show
  1. package/dist/apis/ScheduledTasksApi.d.ts +116 -1
  2. package/dist/apis/ScheduledTasksApi.js +286 -0
  3. package/dist/models/AutomationDayCountUio.d.ts +44 -0
  4. package/dist/models/AutomationDayCountUio.js +58 -0
  5. package/dist/models/AutomationLastRunUio.d.ts +51 -0
  6. package/dist/models/AutomationLastRunUio.js +63 -0
  7. package/dist/models/AutomationListUio.d.ts +46 -0
  8. package/dist/models/AutomationListUio.js +60 -0
  9. package/dist/models/AutomationRunDeliveryUio.d.ts +60 -0
  10. package/dist/models/AutomationRunDeliveryUio.js +72 -0
  11. package/dist/models/AutomationRunListUio.d.ts +39 -0
  12. package/dist/models/AutomationRunListUio.js +55 -0
  13. package/dist/models/AutomationRunOutcomeUio.d.ts +26 -0
  14. package/dist/models/AutomationRunOutcomeUio.js +52 -0
  15. package/dist/models/AutomationRunSourceUio.d.ts +108 -0
  16. package/dist/models/AutomationRunSourceUio.js +82 -0
  17. package/dist/models/AutomationRunUio.d.ts +126 -0
  18. package/dist/models/AutomationRunUio.js +114 -0
  19. package/dist/models/AutomationStatsUio.d.ts +62 -0
  20. package/dist/models/AutomationStatsUio.js +70 -0
  21. package/dist/models/AutomationSummaryUio.d.ts +137 -0
  22. package/dist/models/AutomationSummaryUio.js +126 -0
  23. package/dist/models/AutomationTriggerKindUio.d.ts +26 -0
  24. package/dist/models/AutomationTriggerKindUio.js +52 -0
  25. package/dist/models/ScheduledTaskCreateUio.d.ts +1 -1
  26. package/dist/models/ScheduledTaskRunTriggerUio.d.ts +37 -12
  27. package/dist/models/ScheduledTaskRunTriggerUio.js +21 -34
  28. package/dist/models/ScheduledTaskUio.d.ts +8 -1
  29. package/dist/models/ScheduledTaskUio.js +3 -0
  30. package/dist/models/TaskTriggerUio.d.ts +8 -1
  31. package/dist/models/TaskTriggerUio.js +4 -1
  32. package/dist/models/WebhookEndpointUio.d.ts +82 -0
  33. package/dist/models/WebhookEndpointUio.js +84 -0
  34. package/dist/models/WebhookEndpointUpdateUio.d.ts +46 -0
  35. package/dist/models/WebhookEndpointUpdateUio.js +58 -0
  36. package/dist/models/WebhookEventListUio.d.ts +33 -0
  37. package/dist/models/WebhookEventListUio.js +51 -0
  38. package/dist/models/WebhookEventUio.d.ts +87 -0
  39. package/dist/models/WebhookEventUio.js +87 -0
  40. package/dist/models/WebhookTestRequestUio.d.ts +38 -0
  41. package/dist/models/WebhookTestRequestUio.js +50 -0
  42. package/dist/models/WebhookTestResponseUio.d.ts +32 -0
  43. package/dist/models/WebhookTestResponseUio.js +50 -0
  44. package/dist/models/index.d.ts +17 -0
  45. package/dist/models/index.js +17 -0
  46. package/dist/openapi.json +1121 -154
  47. 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 { AutomationListUio, AutomationRunListUio, AutomationRunOutcomeUio, AutomationTriggerKindUio, 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,17 +33,44 @@ 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;
39
43
  to: Date;
40
44
  }
45
+ export interface ListOrganizationAutomationRunsRequest {
46
+ organizationId: string;
47
+ agentId?: string;
48
+ taskId?: string;
49
+ trigger?: AutomationTriggerKindUio;
50
+ status?: AutomationRunOutcomeUio;
51
+ before?: Date;
52
+ limit?: number;
53
+ }
54
+ export interface ListOrganizationAutomationsRequest {
55
+ organizationId: string;
56
+ agentId?: string;
57
+ trigger?: AutomationTriggerKindUio;
58
+ status?: string;
59
+ q?: string;
60
+ limit?: number;
61
+ offset?: number;
62
+ }
41
63
  export interface ListScheduledTaskRunsRequest {
42
64
  agentId: string;
43
65
  taskId: string;
44
66
  limit?: number;
45
67
  before?: Date;
46
68
  }
69
+ export interface ListScheduledTaskWebhookEventsRequest {
70
+ agentId: string;
71
+ taskId: string;
72
+ limit?: number;
73
+ }
47
74
  export interface ListScheduledTasksRequest {
48
75
  agentId: string;
49
76
  status?: ListScheduledTasksStatusEnum;
@@ -51,6 +78,19 @@ export interface ListScheduledTasksRequest {
51
78
  limit?: number;
52
79
  before?: Date;
53
80
  }
81
+ export interface RegenerateScheduledTaskWebhookUrlRequest {
82
+ agentId: string;
83
+ taskId: string;
84
+ }
85
+ export interface RotateScheduledTaskWebhookSecretRequest {
86
+ agentId: string;
87
+ taskId: string;
88
+ }
89
+ export interface TestScheduledTaskWebhookRequest {
90
+ agentId: string;
91
+ taskId: string;
92
+ webhookTestRequestUio?: WebhookTestRequestUio;
93
+ }
54
94
  export interface ToggleScheduledTaskStatusRequest {
55
95
  agentId: string;
56
96
  taskId: string;
@@ -65,6 +105,11 @@ export interface UpdateScheduledTaskRequest {
65
105
  taskId: string;
66
106
  scheduledTaskCreateUio: ScheduledTaskCreateUio;
67
107
  }
108
+ export interface UpdateScheduledTaskWebhookRequest {
109
+ agentId: string;
110
+ taskId: string;
111
+ webhookEndpointUpdateUio: WebhookEndpointUpdateUio;
112
+ }
68
113
  /**
69
114
  *
70
115
  */
@@ -109,6 +154,14 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
109
154
  * The external event that triggered a run (« Déclenché par »)
110
155
  */
111
156
  getScheduledTaskRunTrigger(agentId: string, taskId: string, runId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskRunTriggerUio>;
157
+ /**
158
+ * The webhook of an automation triggered by a webhook
159
+ */
160
+ getScheduledTaskWebhookRaw(requestParameters: GetScheduledTaskWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
161
+ /**
162
+ * The webhook of an automation triggered by a webhook
163
+ */
164
+ getScheduledTaskWebhook(agentId: string, taskId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
112
165
  /**
113
166
  * List all runs for an agent\'s scheduled tasks within a date range
114
167
  */
@@ -117,6 +170,26 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
117
170
  * List all runs for an agent\'s scheduled tasks within a date range
118
171
  */
119
172
  listAgentScheduledTaskRuns(agentId: string, from: Date, to: Date, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskRunListUio>;
173
+ /**
174
+ * Most recent first. Every member of the organization can read them.
175
+ * The runs of the automations of the organization, or of one of its agents
176
+ */
177
+ listOrganizationAutomationRunsRaw(requestParameters: ListOrganizationAutomationRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutomationRunListUio>>;
178
+ /**
179
+ * Most recent first. Every member of the organization can read them.
180
+ * The runs of the automations of the organization, or of one of its agents
181
+ */
182
+ listOrganizationAutomationRuns(organizationId: string, agentId?: string, taskId?: string, trigger?: AutomationTriggerKindUio, status?: AutomationRunOutcomeUio, before?: Date, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutomationRunListUio>;
183
+ /**
184
+ * Every member of the organization can read them, as they can read its agents.
185
+ * The automations of the organization, or of one of its agents
186
+ */
187
+ listOrganizationAutomationsRaw(requestParameters: ListOrganizationAutomationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutomationListUio>>;
188
+ /**
189
+ * Every member of the organization can read them, as they can read its agents.
190
+ * The automations of the organization, or of one of its agents
191
+ */
192
+ listOrganizationAutomations(organizationId: string, agentId?: string, trigger?: AutomationTriggerKindUio, status?: string, q?: string, limit?: number, offset?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutomationListUio>;
120
193
  /**
121
194
  * List runs for a scheduled task
122
195
  */
@@ -125,6 +198,14 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
125
198
  * List runs for a scheduled task
126
199
  */
127
200
  listScheduledTaskRuns(agentId: string, taskId: string, limit?: number, before?: Date, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskRunListUio>;
201
+ /**
202
+ * The latest calls received on the webhook
203
+ */
204
+ listScheduledTaskWebhookEventsRaw(requestParameters: ListScheduledTaskWebhookEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEventListUio>>;
205
+ /**
206
+ * The latest calls received on the webhook
207
+ */
208
+ listScheduledTaskWebhookEvents(agentId: string, taskId: string, limit?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEventListUio>;
128
209
  /**
129
210
  * List scheduled tasks for an agent
130
211
  */
@@ -133,6 +214,32 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
133
214
  * List scheduled tasks for an agent
134
215
  */
135
216
  listScheduledTasks(agentId: string, status?: ListScheduledTasksStatusEnum, q?: string, limit?: number, before?: Date, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskListUio>;
217
+ /**
218
+ * Give the webhook a new URL (the old one answers 404)
219
+ */
220
+ regenerateScheduledTaskWebhookUrlRaw(requestParameters: RegenerateScheduledTaskWebhookUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
221
+ /**
222
+ * Give the webhook a new URL (the old one answers 404)
223
+ */
224
+ regenerateScheduledTaskWebhookUrl(agentId: string, taskId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
225
+ /**
226
+ * Rotate the webhook secret (the old one stops working)
227
+ */
228
+ rotateScheduledTaskWebhookSecretRaw(requestParameters: RotateScheduledTaskWebhookSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
229
+ /**
230
+ * Rotate the webhook secret (the old one stops working)
231
+ */
232
+ rotateScheduledTaskWebhookSecret(agentId: string, taskId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
233
+ /**
234
+ * The call goes through the same ingestion as a real one, and the agent runs for real.
235
+ * Send a test call to the webhook, signed by the server
236
+ */
237
+ testScheduledTaskWebhookRaw(requestParameters: TestScheduledTaskWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookTestResponseUio>>;
238
+ /**
239
+ * The call goes through the same ingestion as a real one, and the agent runs for real.
240
+ * Send a test call to the webhook, signed by the server
241
+ */
242
+ testScheduledTaskWebhook(agentId: string, taskId: string, webhookTestRequestUio?: WebhookTestRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookTestResponseUio>;
136
243
  /**
137
244
  * Toggle scheduled task status (active/paused)
138
245
  */
@@ -157,6 +264,14 @@ export declare class ScheduledTasksApi extends runtime.BaseAPI {
157
264
  * Update a scheduled task
158
265
  */
159
266
  updateScheduledTask(agentId: string, taskId: string, scheduledTaskCreateUio: ScheduledTaskCreateUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScheduledTaskUio>;
267
+ /**
268
+ * Disable the webhook or change its service user
269
+ */
270
+ updateScheduledTaskWebhookRaw(requestParameters: UpdateScheduledTaskWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointUio>>;
271
+ /**
272
+ * Disable the webhook or change its service user
273
+ */
274
+ updateScheduledTaskWebhook(agentId: string, taskId: string, webhookEndpointUpdateUio: WebhookEndpointUpdateUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointUio>;
160
275
  }
161
276
  /**
162
277
  * @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
  */
@@ -249,6 +279,100 @@ class ScheduledTasksApi extends runtime.BaseAPI {
249
279
  const response = await this.listAgentScheduledTaskRunsRaw({ agentId: agentId, from: from, to: to }, initOverrides);
250
280
  return await response.value();
251
281
  }
282
+ /**
283
+ * Most recent first. Every member of the organization can read them.
284
+ * The runs of the automations of the organization, or of one of its agents
285
+ */
286
+ async listOrganizationAutomationRunsRaw(requestParameters, initOverrides) {
287
+ if (requestParameters['organizationId'] == null) {
288
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling listOrganizationAutomationRuns().');
289
+ }
290
+ const queryParameters = {};
291
+ if (requestParameters['agentId'] != null) {
292
+ queryParameters['agentId'] = requestParameters['agentId'];
293
+ }
294
+ if (requestParameters['taskId'] != null) {
295
+ queryParameters['taskId'] = requestParameters['taskId'];
296
+ }
297
+ if (requestParameters['trigger'] != null) {
298
+ queryParameters['trigger'] = requestParameters['trigger'];
299
+ }
300
+ if (requestParameters['status'] != null) {
301
+ queryParameters['status'] = requestParameters['status'];
302
+ }
303
+ if (requestParameters['before'] != null) {
304
+ queryParameters['before'] = requestParameters['before'].toISOString();
305
+ }
306
+ if (requestParameters['limit'] != null) {
307
+ queryParameters['limit'] = requestParameters['limit'];
308
+ }
309
+ const headerParameters = {};
310
+ if (this.configuration && this.configuration.apiKey) {
311
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
312
+ }
313
+ const response = await this.request({
314
+ path: `/organizations/{organizationId}/automation-runs`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
315
+ method: 'GET',
316
+ headers: headerParameters,
317
+ query: queryParameters,
318
+ }, initOverrides);
319
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AutomationRunListUioFromJSON)(jsonValue));
320
+ }
321
+ /**
322
+ * Most recent first. Every member of the organization can read them.
323
+ * The runs of the automations of the organization, or of one of its agents
324
+ */
325
+ async listOrganizationAutomationRuns(organizationId, agentId, taskId, trigger, status, before, limit, initOverrides) {
326
+ const response = await this.listOrganizationAutomationRunsRaw({ organizationId: organizationId, agentId: agentId, taskId: taskId, trigger: trigger, status: status, before: before, limit: limit }, initOverrides);
327
+ return await response.value();
328
+ }
329
+ /**
330
+ * Every member of the organization can read them, as they can read its agents.
331
+ * The automations of the organization, or of one of its agents
332
+ */
333
+ async listOrganizationAutomationsRaw(requestParameters, initOverrides) {
334
+ if (requestParameters['organizationId'] == null) {
335
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling listOrganizationAutomations().');
336
+ }
337
+ const queryParameters = {};
338
+ if (requestParameters['agentId'] != null) {
339
+ queryParameters['agentId'] = requestParameters['agentId'];
340
+ }
341
+ if (requestParameters['trigger'] != null) {
342
+ queryParameters['trigger'] = requestParameters['trigger'];
343
+ }
344
+ if (requestParameters['status'] != null) {
345
+ queryParameters['status'] = requestParameters['status'];
346
+ }
347
+ if (requestParameters['q'] != null) {
348
+ queryParameters['q'] = requestParameters['q'];
349
+ }
350
+ if (requestParameters['limit'] != null) {
351
+ queryParameters['limit'] = requestParameters['limit'];
352
+ }
353
+ if (requestParameters['offset'] != null) {
354
+ queryParameters['offset'] = requestParameters['offset'];
355
+ }
356
+ const headerParameters = {};
357
+ if (this.configuration && this.configuration.apiKey) {
358
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
359
+ }
360
+ const response = await this.request({
361
+ path: `/organizations/{organizationId}/automations`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
362
+ method: 'GET',
363
+ headers: headerParameters,
364
+ query: queryParameters,
365
+ }, initOverrides);
366
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AutomationListUioFromJSON)(jsonValue));
367
+ }
368
+ /**
369
+ * Every member of the organization can read them, as they can read its agents.
370
+ * The automations of the organization, or of one of its agents
371
+ */
372
+ async listOrganizationAutomations(organizationId, agentId, trigger, status, q, limit, offset, initOverrides) {
373
+ const response = await this.listOrganizationAutomationsRaw({ organizationId: organizationId, agentId: agentId, trigger: trigger, status: status, q: q, limit: limit, offset: offset }, initOverrides);
374
+ return await response.value();
375
+ }
252
376
  /**
253
377
  * List runs for a scheduled task
254
378
  */
@@ -285,6 +409,39 @@ class ScheduledTasksApi extends runtime.BaseAPI {
285
409
  const response = await this.listScheduledTaskRunsRaw({ agentId: agentId, taskId: taskId, limit: limit, before: before }, initOverrides);
286
410
  return await response.value();
287
411
  }
412
+ /**
413
+ * The latest calls received on the webhook
414
+ */
415
+ async listScheduledTaskWebhookEventsRaw(requestParameters, initOverrides) {
416
+ if (requestParameters['agentId'] == null) {
417
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling listScheduledTaskWebhookEvents().');
418
+ }
419
+ if (requestParameters['taskId'] == null) {
420
+ throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling listScheduledTaskWebhookEvents().');
421
+ }
422
+ const queryParameters = {};
423
+ if (requestParameters['limit'] != null) {
424
+ queryParameters['limit'] = requestParameters['limit'];
425
+ }
426
+ const headerParameters = {};
427
+ if (this.configuration && this.configuration.apiKey) {
428
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
429
+ }
430
+ const response = await this.request({
431
+ path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/events`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
432
+ method: 'GET',
433
+ headers: headerParameters,
434
+ query: queryParameters,
435
+ }, initOverrides);
436
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEventListUioFromJSON)(jsonValue));
437
+ }
438
+ /**
439
+ * The latest calls received on the webhook
440
+ */
441
+ async listScheduledTaskWebhookEvents(agentId, taskId, limit, initOverrides) {
442
+ const response = await this.listScheduledTaskWebhookEventsRaw({ agentId: agentId, taskId: taskId, limit: limit }, initOverrides);
443
+ return await response.value();
444
+ }
288
445
  /**
289
446
  * List scheduled tasks for an agent
290
447
  */
@@ -324,6 +481,100 @@ class ScheduledTasksApi extends runtime.BaseAPI {
324
481
  const response = await this.listScheduledTasksRaw({ agentId: agentId, status: status, q: q, limit: limit, before: before }, initOverrides);
325
482
  return await response.value();
326
483
  }
484
+ /**
485
+ * Give the webhook a new URL (the old one answers 404)
486
+ */
487
+ async regenerateScheduledTaskWebhookUrlRaw(requestParameters, initOverrides) {
488
+ if (requestParameters['agentId'] == null) {
489
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling regenerateScheduledTaskWebhookUrl().');
490
+ }
491
+ if (requestParameters['taskId'] == null) {
492
+ throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling regenerateScheduledTaskWebhookUrl().');
493
+ }
494
+ const queryParameters = {};
495
+ const headerParameters = {};
496
+ if (this.configuration && this.configuration.apiKey) {
497
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
498
+ }
499
+ const response = await this.request({
500
+ path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/regenerate-url`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
501
+ method: 'POST',
502
+ headers: headerParameters,
503
+ query: queryParameters,
504
+ }, initOverrides);
505
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointUioFromJSON)(jsonValue));
506
+ }
507
+ /**
508
+ * Give the webhook a new URL (the old one answers 404)
509
+ */
510
+ async regenerateScheduledTaskWebhookUrl(agentId, taskId, initOverrides) {
511
+ const response = await this.regenerateScheduledTaskWebhookUrlRaw({ agentId: agentId, taskId: taskId }, initOverrides);
512
+ return await response.value();
513
+ }
514
+ /**
515
+ * Rotate the webhook secret (the old one stops working)
516
+ */
517
+ async rotateScheduledTaskWebhookSecretRaw(requestParameters, initOverrides) {
518
+ if (requestParameters['agentId'] == null) {
519
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling rotateScheduledTaskWebhookSecret().');
520
+ }
521
+ if (requestParameters['taskId'] == null) {
522
+ throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling rotateScheduledTaskWebhookSecret().');
523
+ }
524
+ const queryParameters = {};
525
+ const headerParameters = {};
526
+ if (this.configuration && this.configuration.apiKey) {
527
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
528
+ }
529
+ const response = await this.request({
530
+ path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/rotate-secret`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
531
+ method: 'POST',
532
+ headers: headerParameters,
533
+ query: queryParameters,
534
+ }, initOverrides);
535
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointUioFromJSON)(jsonValue));
536
+ }
537
+ /**
538
+ * Rotate the webhook secret (the old one stops working)
539
+ */
540
+ async rotateScheduledTaskWebhookSecret(agentId, taskId, initOverrides) {
541
+ const response = await this.rotateScheduledTaskWebhookSecretRaw({ agentId: agentId, taskId: taskId }, initOverrides);
542
+ return await response.value();
543
+ }
544
+ /**
545
+ * The call goes through the same ingestion as a real one, and the agent runs for real.
546
+ * Send a test call to the webhook, signed by the server
547
+ */
548
+ async testScheduledTaskWebhookRaw(requestParameters, initOverrides) {
549
+ if (requestParameters['agentId'] == null) {
550
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling testScheduledTaskWebhook().');
551
+ }
552
+ if (requestParameters['taskId'] == null) {
553
+ throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling testScheduledTaskWebhook().');
554
+ }
555
+ const queryParameters = {};
556
+ const headerParameters = {};
557
+ headerParameters['Content-Type'] = 'application/json';
558
+ if (this.configuration && this.configuration.apiKey) {
559
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
560
+ }
561
+ const response = await this.request({
562
+ path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook/test`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
563
+ method: 'POST',
564
+ headers: headerParameters,
565
+ query: queryParameters,
566
+ body: (0, index_1.WebhookTestRequestUioToJSON)(requestParameters['webhookTestRequestUio']),
567
+ }, initOverrides);
568
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookTestResponseUioFromJSON)(jsonValue));
569
+ }
570
+ /**
571
+ * The call goes through the same ingestion as a real one, and the agent runs for real.
572
+ * Send a test call to the webhook, signed by the server
573
+ */
574
+ async testScheduledTaskWebhook(agentId, taskId, webhookTestRequestUio, initOverrides) {
575
+ const response = await this.testScheduledTaskWebhookRaw({ agentId: agentId, taskId: taskId, webhookTestRequestUio: webhookTestRequestUio }, initOverrides);
576
+ return await response.value();
577
+ }
327
578
  /**
328
579
  * Toggle scheduled task status (active/paused)
329
580
  */
@@ -424,6 +675,41 @@ class ScheduledTasksApi extends runtime.BaseAPI {
424
675
  const response = await this.updateScheduledTaskRaw({ agentId: agentId, taskId: taskId, scheduledTaskCreateUio: scheduledTaskCreateUio }, initOverrides);
425
676
  return await response.value();
426
677
  }
678
+ /**
679
+ * Disable the webhook or change its service user
680
+ */
681
+ async updateScheduledTaskWebhookRaw(requestParameters, initOverrides) {
682
+ if (requestParameters['agentId'] == null) {
683
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling updateScheduledTaskWebhook().');
684
+ }
685
+ if (requestParameters['taskId'] == null) {
686
+ throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling updateScheduledTaskWebhook().');
687
+ }
688
+ if (requestParameters['webhookEndpointUpdateUio'] == null) {
689
+ throw new runtime.RequiredError('webhookEndpointUpdateUio', 'Required parameter "webhookEndpointUpdateUio" was null or undefined when calling updateScheduledTaskWebhook().');
690
+ }
691
+ const queryParameters = {};
692
+ const headerParameters = {};
693
+ headerParameters['Content-Type'] = 'application/json';
694
+ if (this.configuration && this.configuration.apiKey) {
695
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
696
+ }
697
+ const response = await this.request({
698
+ path: `/agents/{agentId}/scheduled-tasks/{taskId}/webhook`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))).replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId']))),
699
+ method: 'PATCH',
700
+ headers: headerParameters,
701
+ query: queryParameters,
702
+ body: (0, index_1.WebhookEndpointUpdateUioToJSON)(requestParameters['webhookEndpointUpdateUio']),
703
+ }, initOverrides);
704
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointUioFromJSON)(jsonValue));
705
+ }
706
+ /**
707
+ * Disable the webhook or change its service user
708
+ */
709
+ async updateScheduledTaskWebhook(agentId, taskId, webhookEndpointUpdateUio, initOverrides) {
710
+ const response = await this.updateScheduledTaskWebhookRaw({ agentId: agentId, taskId: taskId, webhookEndpointUpdateUio: webhookEndpointUpdateUio }, initOverrides);
711
+ return await response.value();
712
+ }
427
713
  }
428
714
  exports.ScheduledTasksApi = ScheduledTasksApi;
429
715
  /**
@@ -0,0 +1,44 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AutomationDayCountUio
16
+ */
17
+ export interface AutomationDayCountUio {
18
+ /**
19
+ * UTC day, YYYY-MM-DD.
20
+ * @type {string}
21
+ * @memberof AutomationDayCountUio
22
+ */
23
+ date: string;
24
+ /**
25
+ *
26
+ * @type {number}
27
+ * @memberof AutomationDayCountUio
28
+ */
29
+ success: number;
30
+ /**
31
+ *
32
+ * @type {number}
33
+ * @memberof AutomationDayCountUio
34
+ */
35
+ error: number;
36
+ }
37
+ /**
38
+ * Check if a given object implements the AutomationDayCountUio interface.
39
+ */
40
+ export declare function instanceOfAutomationDayCountUio(value: object): value is AutomationDayCountUio;
41
+ export declare function AutomationDayCountUioFromJSON(json: any): AutomationDayCountUio;
42
+ export declare function AutomationDayCountUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutomationDayCountUio;
43
+ export declare function AutomationDayCountUioToJSON(json: any): AutomationDayCountUio;
44
+ export declare function AutomationDayCountUioToJSONTyped(value?: AutomationDayCountUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfAutomationDayCountUio = instanceOfAutomationDayCountUio;
17
+ exports.AutomationDayCountUioFromJSON = AutomationDayCountUioFromJSON;
18
+ exports.AutomationDayCountUioFromJSONTyped = AutomationDayCountUioFromJSONTyped;
19
+ exports.AutomationDayCountUioToJSON = AutomationDayCountUioToJSON;
20
+ exports.AutomationDayCountUioToJSONTyped = AutomationDayCountUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the AutomationDayCountUio interface.
23
+ */
24
+ function instanceOfAutomationDayCountUio(value) {
25
+ if (!('date' in value) || value['date'] === undefined)
26
+ return false;
27
+ if (!('success' in value) || value['success'] === undefined)
28
+ return false;
29
+ if (!('error' in value) || value['error'] === undefined)
30
+ return false;
31
+ return true;
32
+ }
33
+ function AutomationDayCountUioFromJSON(json) {
34
+ return AutomationDayCountUioFromJSONTyped(json, false);
35
+ }
36
+ function AutomationDayCountUioFromJSONTyped(json, ignoreDiscriminator) {
37
+ if (json == null) {
38
+ return json;
39
+ }
40
+ return {
41
+ 'date': json['date'],
42
+ 'success': json['success'],
43
+ 'error': json['error'],
44
+ };
45
+ }
46
+ function AutomationDayCountUioToJSON(json) {
47
+ return AutomationDayCountUioToJSONTyped(json, false);
48
+ }
49
+ function AutomationDayCountUioToJSONTyped(value, ignoreDiscriminator = false) {
50
+ if (value == null) {
51
+ return value;
52
+ }
53
+ return {
54
+ 'date': value['date'],
55
+ 'success': value['success'],
56
+ 'error': value['error'],
57
+ };
58
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { AutomationRunOutcomeUio } from './AutomationRunOutcomeUio';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface AutomationLastRunUio
17
+ */
18
+ export interface AutomationLastRunUio {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof AutomationLastRunUio
23
+ */
24
+ id: string;
25
+ /**
26
+ *
27
+ * @type {AutomationRunOutcomeUio}
28
+ * @memberof AutomationLastRunUio
29
+ */
30
+ status: AutomationRunOutcomeUio;
31
+ /**
32
+ *
33
+ * @type {Date}
34
+ * @memberof AutomationLastRunUio
35
+ */
36
+ triggeredAt: Date;
37
+ /**
38
+ *
39
+ * @type {Date}
40
+ * @memberof AutomationLastRunUio
41
+ */
42
+ finishedAt: Date | null;
43
+ }
44
+ /**
45
+ * Check if a given object implements the AutomationLastRunUio interface.
46
+ */
47
+ export declare function instanceOfAutomationLastRunUio(value: object): value is AutomationLastRunUio;
48
+ export declare function AutomationLastRunUioFromJSON(json: any): AutomationLastRunUio;
49
+ export declare function AutomationLastRunUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutomationLastRunUio;
50
+ export declare function AutomationLastRunUioToJSON(json: any): AutomationLastRunUio;
51
+ export declare function AutomationLastRunUioToJSONTyped(value?: AutomationLastRunUio | null, ignoreDiscriminator?: boolean): any;