@uniformdev/automations-sdk 20.50.2-alpha.109
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/LICENSE.txt +2 -0
- package/dist/ai/index.d.mts +108 -0
- package/dist/ai/index.mjs +78 -0
- package/dist/api/index.d.mts +707 -0
- package/dist/api/index.mjs +102 -0
- package/dist/chunk-I6KKUHEY.mjs +15 -0
- package/dist/chunk-TWKWPWN3.mjs +10 -0
- package/dist/formatAutomationWebhookUrl-CD1HQmu6.d.mts +10 -0
- package/dist/index.d.mts +272 -0
- package/dist/index.mjs +55 -0
- package/dist/schemas/index.d.mts +64 -0
- package/dist/schemas/index.mjs +21 -0
- package/package.json +66 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
export { f as formatAutomationWebhookUrl } from '../formatAutomationWebhookUrl-CD1HQmu6.mjs';
|
|
2
|
+
import { ApiClient, ClientOptions } from '@uniformdev/context/api';
|
|
3
|
+
|
|
4
|
+
interface paths$2 {
|
|
5
|
+
"/api/v1/automation-run-logs": {
|
|
6
|
+
parameters: {
|
|
7
|
+
query?: never;
|
|
8
|
+
header?: never;
|
|
9
|
+
path?: never;
|
|
10
|
+
cookie?: never;
|
|
11
|
+
};
|
|
12
|
+
/** @description Returns the log entries for a single automation run. */
|
|
13
|
+
get: {
|
|
14
|
+
parameters: {
|
|
15
|
+
query: {
|
|
16
|
+
/** @description The project ID. */
|
|
17
|
+
projectId: string;
|
|
18
|
+
/** @description The automation run ID. */
|
|
19
|
+
runId: string;
|
|
20
|
+
};
|
|
21
|
+
header?: never;
|
|
22
|
+
path?: never;
|
|
23
|
+
cookie?: never;
|
|
24
|
+
};
|
|
25
|
+
requestBody?: never;
|
|
26
|
+
responses: {
|
|
27
|
+
/** @description 200 response */
|
|
28
|
+
200: {
|
|
29
|
+
headers: {
|
|
30
|
+
[name: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
content: {
|
|
33
|
+
"application/json": {
|
|
34
|
+
/** @description Log entries for the run. */
|
|
35
|
+
logs: {
|
|
36
|
+
/**
|
|
37
|
+
* @description Severity of the log entry.
|
|
38
|
+
* @enum {string}
|
|
39
|
+
*/
|
|
40
|
+
level: "info" | "warning" | "error";
|
|
41
|
+
/** @description Log message text. */
|
|
42
|
+
message: string;
|
|
43
|
+
/**
|
|
44
|
+
* Format: date-time
|
|
45
|
+
* @description When the log entry was recorded.
|
|
46
|
+
*/
|
|
47
|
+
createdAt: string;
|
|
48
|
+
/** @description Unique identifier for the log entry. */
|
|
49
|
+
id: string;
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
400: components$2["responses"]["BadRequestError"];
|
|
55
|
+
401: components$2["responses"]["UnauthorizedError"];
|
|
56
|
+
403: components$2["responses"]["ForbiddenError"];
|
|
57
|
+
/** @description Run not found in this project. */
|
|
58
|
+
404: {
|
|
59
|
+
headers: {
|
|
60
|
+
[name: string]: unknown;
|
|
61
|
+
};
|
|
62
|
+
content?: never;
|
|
63
|
+
};
|
|
64
|
+
429: components$2["responses"]["RateLimitError"];
|
|
65
|
+
500: components$2["responses"]["InternalServerError"];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
put?: never;
|
|
69
|
+
post?: never;
|
|
70
|
+
delete?: never;
|
|
71
|
+
/** @description Handles preflight requests. This endpoint allows CORS. */
|
|
72
|
+
options: {
|
|
73
|
+
parameters: {
|
|
74
|
+
query?: never;
|
|
75
|
+
header?: never;
|
|
76
|
+
path?: never;
|
|
77
|
+
cookie?: never;
|
|
78
|
+
};
|
|
79
|
+
requestBody?: never;
|
|
80
|
+
responses: {
|
|
81
|
+
/** @description ok */
|
|
82
|
+
204: {
|
|
83
|
+
headers: {
|
|
84
|
+
[name: string]: unknown;
|
|
85
|
+
};
|
|
86
|
+
content?: never;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
head?: never;
|
|
91
|
+
patch?: never;
|
|
92
|
+
trace?: never;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
interface components$2 {
|
|
96
|
+
schemas: {
|
|
97
|
+
Error: {
|
|
98
|
+
/** @description Error message(s) that occurred while processing the request */
|
|
99
|
+
errorMessage?: string[] | string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
responses: {
|
|
103
|
+
/** @description Request input validation failed */
|
|
104
|
+
BadRequestError: {
|
|
105
|
+
headers: {
|
|
106
|
+
[name: string]: unknown;
|
|
107
|
+
};
|
|
108
|
+
content: {
|
|
109
|
+
"application/json": components$2["schemas"]["Error"];
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
/** @description API key or token was not valid */
|
|
113
|
+
UnauthorizedError: {
|
|
114
|
+
headers: {
|
|
115
|
+
[name: string]: unknown;
|
|
116
|
+
};
|
|
117
|
+
content: {
|
|
118
|
+
"application/json": components$2["schemas"]["Error"];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
/** @description Permission was denied */
|
|
122
|
+
ForbiddenError: {
|
|
123
|
+
headers: {
|
|
124
|
+
[name: string]: unknown;
|
|
125
|
+
};
|
|
126
|
+
content: {
|
|
127
|
+
"application/json": components$2["schemas"]["Error"];
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
/** @description Too many requests in allowed time period */
|
|
131
|
+
RateLimitError: {
|
|
132
|
+
headers: {
|
|
133
|
+
[name: string]: unknown;
|
|
134
|
+
};
|
|
135
|
+
content?: never;
|
|
136
|
+
};
|
|
137
|
+
/** @description Execution error occurred */
|
|
138
|
+
InternalServerError: {
|
|
139
|
+
headers: {
|
|
140
|
+
[name: string]: unknown;
|
|
141
|
+
};
|
|
142
|
+
content?: never;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
parameters: never;
|
|
146
|
+
requestBodies: never;
|
|
147
|
+
headers: never;
|
|
148
|
+
pathItems: never;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface paths$1 {
|
|
152
|
+
"/api/v1/automation-runs": {
|
|
153
|
+
parameters: {
|
|
154
|
+
query?: never;
|
|
155
|
+
header?: never;
|
|
156
|
+
path?: never;
|
|
157
|
+
cookie?: never;
|
|
158
|
+
};
|
|
159
|
+
/** @description Lists automation runs for a project, optionally filtered by automation and status. */
|
|
160
|
+
get: {
|
|
161
|
+
parameters: {
|
|
162
|
+
query: {
|
|
163
|
+
/** @description The project ID. */
|
|
164
|
+
projectId: string;
|
|
165
|
+
/** @description Filter to runs of a single automation. */
|
|
166
|
+
publicId?: string;
|
|
167
|
+
/** @description Comma-separated list of statuses to include. Statuses: running, success, rejected, unauthorized, failure, timeout, cycleAborted. */
|
|
168
|
+
status?: string;
|
|
169
|
+
/** @description Number of records to skip. */
|
|
170
|
+
offset?: number | null;
|
|
171
|
+
/** @description Maximum number of records to return. */
|
|
172
|
+
limit?: number;
|
|
173
|
+
};
|
|
174
|
+
header?: never;
|
|
175
|
+
path?: never;
|
|
176
|
+
cookie?: never;
|
|
177
|
+
};
|
|
178
|
+
requestBody?: never;
|
|
179
|
+
responses: {
|
|
180
|
+
/** @description 200 response */
|
|
181
|
+
200: {
|
|
182
|
+
headers: {
|
|
183
|
+
[name: string]: unknown;
|
|
184
|
+
};
|
|
185
|
+
content: {
|
|
186
|
+
"application/json": {
|
|
187
|
+
/** @description Matching automation runs. */
|
|
188
|
+
runs: {
|
|
189
|
+
/** @description Unique identifier for the run. */
|
|
190
|
+
id: string;
|
|
191
|
+
/** @description Public ID of the automation that was run. */
|
|
192
|
+
publicId: string;
|
|
193
|
+
/** @description Name of the automation at run time. */
|
|
194
|
+
name: string;
|
|
195
|
+
/**
|
|
196
|
+
* @description Terminal or in-progress status of an automation run.
|
|
197
|
+
* @enum {string}
|
|
198
|
+
*/
|
|
199
|
+
status: "running" | "success" | "rejected" | "unauthorized" | "failure" | "timeout" | "cycleAborted";
|
|
200
|
+
/** @description Input payload passed to the handler, or null for scheduled runs without input. */
|
|
201
|
+
input?: unknown;
|
|
202
|
+
/**
|
|
203
|
+
* Format: date-time
|
|
204
|
+
* @description When the run started.
|
|
205
|
+
*/
|
|
206
|
+
startedAt: string;
|
|
207
|
+
/**
|
|
208
|
+
* Format: date-time
|
|
209
|
+
* @description When the run finished, or null while still running.
|
|
210
|
+
*/
|
|
211
|
+
completedAt: string | null;
|
|
212
|
+
/** @description Run duration in milliseconds, or null while still running. */
|
|
213
|
+
latencyMs: number | null;
|
|
214
|
+
}[];
|
|
215
|
+
/** @description Total number of runs matching the filter. */
|
|
216
|
+
totalCount: number;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
400: components$1["responses"]["BadRequestError"];
|
|
221
|
+
401: components$1["responses"]["UnauthorizedError"];
|
|
222
|
+
403: components$1["responses"]["ForbiddenError"];
|
|
223
|
+
429: components$1["responses"]["RateLimitError"];
|
|
224
|
+
500: components$1["responses"]["InternalServerError"];
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
put?: never;
|
|
228
|
+
post?: never;
|
|
229
|
+
delete?: never;
|
|
230
|
+
/** @description Handles preflight requests. This endpoint allows CORS. */
|
|
231
|
+
options: {
|
|
232
|
+
parameters: {
|
|
233
|
+
query?: never;
|
|
234
|
+
header?: never;
|
|
235
|
+
path?: never;
|
|
236
|
+
cookie?: never;
|
|
237
|
+
};
|
|
238
|
+
requestBody?: never;
|
|
239
|
+
responses: {
|
|
240
|
+
/** @description ok */
|
|
241
|
+
204: {
|
|
242
|
+
headers: {
|
|
243
|
+
[name: string]: unknown;
|
|
244
|
+
};
|
|
245
|
+
content?: never;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
head?: never;
|
|
250
|
+
patch?: never;
|
|
251
|
+
trace?: never;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
interface components$1 {
|
|
255
|
+
schemas: {
|
|
256
|
+
Error: {
|
|
257
|
+
/** @description Error message(s) that occurred while processing the request */
|
|
258
|
+
errorMessage?: string[] | string;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
responses: {
|
|
262
|
+
/** @description Request input validation failed */
|
|
263
|
+
BadRequestError: {
|
|
264
|
+
headers: {
|
|
265
|
+
[name: string]: unknown;
|
|
266
|
+
};
|
|
267
|
+
content: {
|
|
268
|
+
"application/json": components$1["schemas"]["Error"];
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
/** @description API key or token was not valid */
|
|
272
|
+
UnauthorizedError: {
|
|
273
|
+
headers: {
|
|
274
|
+
[name: string]: unknown;
|
|
275
|
+
};
|
|
276
|
+
content: {
|
|
277
|
+
"application/json": components$1["schemas"]["Error"];
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
/** @description Permission was denied */
|
|
281
|
+
ForbiddenError: {
|
|
282
|
+
headers: {
|
|
283
|
+
[name: string]: unknown;
|
|
284
|
+
};
|
|
285
|
+
content: {
|
|
286
|
+
"application/json": components$1["schemas"]["Error"];
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
/** @description Too many requests in allowed time period */
|
|
290
|
+
RateLimitError: {
|
|
291
|
+
headers: {
|
|
292
|
+
[name: string]: unknown;
|
|
293
|
+
};
|
|
294
|
+
content?: never;
|
|
295
|
+
};
|
|
296
|
+
/** @description Execution error occurred */
|
|
297
|
+
InternalServerError: {
|
|
298
|
+
headers: {
|
|
299
|
+
[name: string]: unknown;
|
|
300
|
+
};
|
|
301
|
+
content?: never;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
parameters: never;
|
|
305
|
+
requestBodies: never;
|
|
306
|
+
headers: never;
|
|
307
|
+
pathItems: never;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
interface paths {
|
|
311
|
+
"/api/v1/automations": {
|
|
312
|
+
parameters: {
|
|
313
|
+
query?: never;
|
|
314
|
+
header?: never;
|
|
315
|
+
path?: never;
|
|
316
|
+
cookie?: never;
|
|
317
|
+
};
|
|
318
|
+
/** @description Lists the automations for a project. */
|
|
319
|
+
get: {
|
|
320
|
+
parameters: {
|
|
321
|
+
query: {
|
|
322
|
+
/** @description The project ID. */
|
|
323
|
+
projectId: string;
|
|
324
|
+
};
|
|
325
|
+
header?: never;
|
|
326
|
+
path?: never;
|
|
327
|
+
cookie?: never;
|
|
328
|
+
};
|
|
329
|
+
requestBody?: never;
|
|
330
|
+
responses: {
|
|
331
|
+
/** @description 200 response */
|
|
332
|
+
200: {
|
|
333
|
+
headers: {
|
|
334
|
+
[name: string]: unknown;
|
|
335
|
+
};
|
|
336
|
+
content: {
|
|
337
|
+
"application/json": {
|
|
338
|
+
/** @description Automations configured for the project. */
|
|
339
|
+
automations: {
|
|
340
|
+
/** @description Stable public identifier for the automation. */
|
|
341
|
+
publicId: string;
|
|
342
|
+
/** @description Display name of the automation. */
|
|
343
|
+
name: string;
|
|
344
|
+
/** @description Optional description. */
|
|
345
|
+
description: string | null;
|
|
346
|
+
/** @description How the automation is triggered. */
|
|
347
|
+
trigger: {
|
|
348
|
+
/**
|
|
349
|
+
* @description The internal webhook event name that triggers this automation.
|
|
350
|
+
* @enum {string}
|
|
351
|
+
*/
|
|
352
|
+
type: "asset.deleted" | "asset.published" | "composition.changed" | "composition.deleted" | "composition.published" | "composition.release.changed" | "composition.release.deleted" | "composition.release.published" | "composition.release.restored" | "entry.changed" | "entry.deleted" | "entry.published" | "entry.release.changed" | "entry.release.deleted" | "entry.release.published" | "entry.release.restored" | "manifest.published" | "projectmap.delete" | "projectmap.node.delete" | "projectmap.node.insert" | "projectmap.node.update" | "projectmap.update" | "redirect.delete" | "redirect.insert" | "redirect.update" | "release.changed" | "release.deleted" | "release.launch_started" | "release.launched" | "workflow.transition";
|
|
353
|
+
} | {
|
|
354
|
+
/** @enum {string} */
|
|
355
|
+
type: "schedule";
|
|
356
|
+
/** @description RFC 5545 recurrence rule for when the automation runs. */
|
|
357
|
+
rrule: string;
|
|
358
|
+
/** @description IANA timezone used to evaluate the recurrence rule. */
|
|
359
|
+
timezone: string;
|
|
360
|
+
} | {
|
|
361
|
+
/** @enum {string} */
|
|
362
|
+
type: "incomingWebhook";
|
|
363
|
+
} | {
|
|
364
|
+
/** @enum {string} */
|
|
365
|
+
type: "aiTool";
|
|
366
|
+
/** @description JSON Schema describing the AI tool arguments. */
|
|
367
|
+
inputSchema: {
|
|
368
|
+
[key: string]: unknown;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
/** @description Whether the automation is enabled. */
|
|
372
|
+
enabled: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Format: date-time
|
|
375
|
+
* @description Next scheduled run time, or null when not applicable.
|
|
376
|
+
*/
|
|
377
|
+
nextRunAt: string | null;
|
|
378
|
+
/**
|
|
379
|
+
* Format: date-time
|
|
380
|
+
* @description When the automation code was last deployed.
|
|
381
|
+
*/
|
|
382
|
+
lastDeployedAt: string;
|
|
383
|
+
/** @description User ID of the last deployer. */
|
|
384
|
+
lastDeployedBy: string;
|
|
385
|
+
/**
|
|
386
|
+
* Format: date-time
|
|
387
|
+
* @description When the automation was first created.
|
|
388
|
+
*/
|
|
389
|
+
createdAt: string;
|
|
390
|
+
/** @description User ID of the creator. */
|
|
391
|
+
createdBy: string;
|
|
392
|
+
/** @description Machine identity for the automation, or null if it has none. */
|
|
393
|
+
identity: {
|
|
394
|
+
/** @description Role IDs granted to the automation identity, keyed by project (site) ID. */
|
|
395
|
+
projects: {
|
|
396
|
+
[key: string]: string[];
|
|
397
|
+
};
|
|
398
|
+
} | null;
|
|
399
|
+
}[];
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
400: components["responses"]["BadRequestError"];
|
|
404
|
+
401: components["responses"]["UnauthorizedError"];
|
|
405
|
+
403: components["responses"]["ForbiddenError"];
|
|
406
|
+
429: components["responses"]["RateLimitError"];
|
|
407
|
+
500: components["responses"]["InternalServerError"];
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
/** @description Deploys (creates or updates) an automation. */
|
|
411
|
+
put: {
|
|
412
|
+
parameters: {
|
|
413
|
+
query?: never;
|
|
414
|
+
header?: never;
|
|
415
|
+
path?: never;
|
|
416
|
+
cookie?: never;
|
|
417
|
+
};
|
|
418
|
+
requestBody: {
|
|
419
|
+
content: {
|
|
420
|
+
"application/json": {
|
|
421
|
+
/** @description The project ID. */
|
|
422
|
+
projectId: string;
|
|
423
|
+
/** @description Stable public identifier for the automation. */
|
|
424
|
+
publicId: string;
|
|
425
|
+
/** @description Display name of the automation. */
|
|
426
|
+
name: string;
|
|
427
|
+
/** @description For automations triggered as an AI tool, this is used to determine when an LLM should call the automation. For other triggers, this is for your reference and optional. */
|
|
428
|
+
description?: string;
|
|
429
|
+
/** @description How the automation is triggered. */
|
|
430
|
+
trigger: {
|
|
431
|
+
/**
|
|
432
|
+
* @description The internal webhook event name that triggers this automation.
|
|
433
|
+
* @enum {string}
|
|
434
|
+
*/
|
|
435
|
+
type: "asset.deleted" | "asset.published" | "composition.changed" | "composition.deleted" | "composition.published" | "composition.release.changed" | "composition.release.deleted" | "composition.release.published" | "composition.release.restored" | "entry.changed" | "entry.deleted" | "entry.published" | "entry.release.changed" | "entry.release.deleted" | "entry.release.published" | "entry.release.restored" | "manifest.published" | "projectmap.delete" | "projectmap.node.delete" | "projectmap.node.insert" | "projectmap.node.update" | "projectmap.update" | "redirect.delete" | "redirect.insert" | "redirect.update" | "release.changed" | "release.deleted" | "release.launch_started" | "release.launched" | "workflow.transition";
|
|
436
|
+
} | {
|
|
437
|
+
/** @enum {string} */
|
|
438
|
+
type: "schedule";
|
|
439
|
+
/** @description RFC 5545 recurrence rule for when the automation runs. */
|
|
440
|
+
rrule: string;
|
|
441
|
+
/** @description IANA timezone used to evaluate the recurrence rule. */
|
|
442
|
+
timezone: string;
|
|
443
|
+
} | {
|
|
444
|
+
/** @enum {string} */
|
|
445
|
+
type: "incomingWebhook";
|
|
446
|
+
} | {
|
|
447
|
+
/** @enum {string} */
|
|
448
|
+
type: "aiTool";
|
|
449
|
+
/** @description JSON Schema describing the AI tool arguments. */
|
|
450
|
+
inputSchema: {
|
|
451
|
+
[key: string]: unknown;
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
/** @description Role grants for the automation identity. The caller must hold each requested role (or be a team admin). When omitted, the automation will not receive Uniform API access credentials. */
|
|
455
|
+
permissions?: {
|
|
456
|
+
/** @description Role grant(s) on the project the automation is deployed to. */
|
|
457
|
+
role: string | string[];
|
|
458
|
+
/** @description Additional project role grants keyed by project ID for cross-project access within the same team. */
|
|
459
|
+
projects?: {
|
|
460
|
+
[key: string]: string | string[];
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
/** @description Bundled JavaScript module for the automation handler. */
|
|
464
|
+
code: string;
|
|
465
|
+
/** @description Target date for runtime compatibility. Runtime changes after this date may not apply to this automation. */
|
|
466
|
+
compatibilityDate?: string;
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
responses: {
|
|
471
|
+
/** @description Deploy successful */
|
|
472
|
+
204: {
|
|
473
|
+
headers: {
|
|
474
|
+
[name: string]: unknown;
|
|
475
|
+
};
|
|
476
|
+
content?: never;
|
|
477
|
+
};
|
|
478
|
+
400: components["responses"]["BadRequestError"];
|
|
479
|
+
401: components["responses"]["UnauthorizedError"];
|
|
480
|
+
403: components["responses"]["ForbiddenError"];
|
|
481
|
+
429: components["responses"]["RateLimitError"];
|
|
482
|
+
500: components["responses"]["InternalServerError"];
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
post?: never;
|
|
486
|
+
/** @description Deletes an automation and its run history. */
|
|
487
|
+
delete: {
|
|
488
|
+
parameters: {
|
|
489
|
+
query?: never;
|
|
490
|
+
header?: never;
|
|
491
|
+
path?: never;
|
|
492
|
+
cookie?: never;
|
|
493
|
+
};
|
|
494
|
+
requestBody: {
|
|
495
|
+
content: {
|
|
496
|
+
"application/json": {
|
|
497
|
+
/** @description The project ID. */
|
|
498
|
+
projectId: string;
|
|
499
|
+
/** @description The automation public ID. */
|
|
500
|
+
publicId: string;
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
responses: {
|
|
505
|
+
/** @description Delete successful */
|
|
506
|
+
204: {
|
|
507
|
+
headers: {
|
|
508
|
+
[name: string]: unknown;
|
|
509
|
+
};
|
|
510
|
+
content?: never;
|
|
511
|
+
};
|
|
512
|
+
400: components["responses"]["BadRequestError"];
|
|
513
|
+
401: components["responses"]["UnauthorizedError"];
|
|
514
|
+
403: components["responses"]["ForbiddenError"];
|
|
515
|
+
/** @description Automation not found */
|
|
516
|
+
404: {
|
|
517
|
+
headers: {
|
|
518
|
+
[name: string]: unknown;
|
|
519
|
+
};
|
|
520
|
+
content?: never;
|
|
521
|
+
};
|
|
522
|
+
429: components["responses"]["RateLimitError"];
|
|
523
|
+
500: components["responses"]["InternalServerError"];
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
/** @description Handles preflight requests. This endpoint allows CORS. */
|
|
527
|
+
options: {
|
|
528
|
+
parameters: {
|
|
529
|
+
query?: never;
|
|
530
|
+
header?: never;
|
|
531
|
+
path?: never;
|
|
532
|
+
cookie?: never;
|
|
533
|
+
};
|
|
534
|
+
requestBody?: never;
|
|
535
|
+
responses: {
|
|
536
|
+
/** @description ok */
|
|
537
|
+
204: {
|
|
538
|
+
headers: {
|
|
539
|
+
[name: string]: unknown;
|
|
540
|
+
};
|
|
541
|
+
content?: never;
|
|
542
|
+
};
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
head?: never;
|
|
546
|
+
/** @description Toggles the enabled state of an automation. Disabled automations do not run when their trigger occurs. */
|
|
547
|
+
patch: {
|
|
548
|
+
parameters: {
|
|
549
|
+
query?: never;
|
|
550
|
+
header?: never;
|
|
551
|
+
path?: never;
|
|
552
|
+
cookie?: never;
|
|
553
|
+
};
|
|
554
|
+
requestBody: {
|
|
555
|
+
content: {
|
|
556
|
+
"application/json": {
|
|
557
|
+
/** @description The project ID. */
|
|
558
|
+
projectId: string;
|
|
559
|
+
/** @description The automation public ID. */
|
|
560
|
+
publicId: string;
|
|
561
|
+
/** @description Whether the automation should be enabled. */
|
|
562
|
+
enabled: boolean;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
};
|
|
566
|
+
responses: {
|
|
567
|
+
/** @description Toggle successful */
|
|
568
|
+
204: {
|
|
569
|
+
headers: {
|
|
570
|
+
[name: string]: unknown;
|
|
571
|
+
};
|
|
572
|
+
content?: never;
|
|
573
|
+
};
|
|
574
|
+
400: components["responses"]["BadRequestError"];
|
|
575
|
+
401: components["responses"]["UnauthorizedError"];
|
|
576
|
+
403: components["responses"]["ForbiddenError"];
|
|
577
|
+
/** @description Automation not found */
|
|
578
|
+
404: {
|
|
579
|
+
headers: {
|
|
580
|
+
[name: string]: unknown;
|
|
581
|
+
};
|
|
582
|
+
content?: never;
|
|
583
|
+
};
|
|
584
|
+
429: components["responses"]["RateLimitError"];
|
|
585
|
+
500: components["responses"]["InternalServerError"];
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
trace?: never;
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
interface components {
|
|
592
|
+
schemas: {
|
|
593
|
+
Error: {
|
|
594
|
+
/** @description Error message(s) that occurred while processing the request */
|
|
595
|
+
errorMessage?: string[] | string;
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
responses: {
|
|
599
|
+
/** @description Request input validation failed */
|
|
600
|
+
BadRequestError: {
|
|
601
|
+
headers: {
|
|
602
|
+
[name: string]: unknown;
|
|
603
|
+
};
|
|
604
|
+
content: {
|
|
605
|
+
"application/json": components["schemas"]["Error"];
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
/** @description API key or token was not valid */
|
|
609
|
+
UnauthorizedError: {
|
|
610
|
+
headers: {
|
|
611
|
+
[name: string]: unknown;
|
|
612
|
+
};
|
|
613
|
+
content: {
|
|
614
|
+
"application/json": components["schemas"]["Error"];
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
/** @description Permission was denied */
|
|
618
|
+
ForbiddenError: {
|
|
619
|
+
headers: {
|
|
620
|
+
[name: string]: unknown;
|
|
621
|
+
};
|
|
622
|
+
content: {
|
|
623
|
+
"application/json": components["schemas"]["Error"];
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
/** @description Too many requests in allowed time period */
|
|
627
|
+
RateLimitError: {
|
|
628
|
+
headers: {
|
|
629
|
+
[name: string]: unknown;
|
|
630
|
+
};
|
|
631
|
+
content?: never;
|
|
632
|
+
};
|
|
633
|
+
/** @description Execution error occurred */
|
|
634
|
+
InternalServerError: {
|
|
635
|
+
headers: {
|
|
636
|
+
[name: string]: unknown;
|
|
637
|
+
};
|
|
638
|
+
content?: never;
|
|
639
|
+
};
|
|
640
|
+
};
|
|
641
|
+
parameters: never;
|
|
642
|
+
requestBodies: never;
|
|
643
|
+
headers: never;
|
|
644
|
+
pathItems: never;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
type AutomationsListResponse = paths['/api/v1/automations']['get']['responses']['200']['content']['application/json'];
|
|
648
|
+
type AutomationSummary = AutomationsListResponse['automations'][number];
|
|
649
|
+
type AutomationTriggerType = AutomationSummary['trigger']['type'];
|
|
650
|
+
type AutomationsDeployBody = paths['/api/v1/automations']['put']['requestBody']['content']['application/json'];
|
|
651
|
+
/** Deploy input without the project ID, which the client injects from its options. */
|
|
652
|
+
type AutomationsDeployInput = Omit<AutomationsDeployBody, 'projectId'>;
|
|
653
|
+
type AutomationRunsListResponse = paths$1['/api/v1/automation-runs']['get']['responses']['200']['content']['application/json'];
|
|
654
|
+
type AutomationRunSummary = AutomationRunsListResponse['runs'][number];
|
|
655
|
+
type AutomationRunStatus = AutomationRunSummary['status'];
|
|
656
|
+
type AutomationRunLogEntry = paths$2['/api/v1/automation-run-logs']['get']['responses']['200']['content']['application/json']['logs'][number];
|
|
657
|
+
|
|
658
|
+
type AutomationsClientOptions = Omit<ClientOptions, 'projectId'> & {
|
|
659
|
+
projectId: string;
|
|
660
|
+
};
|
|
661
|
+
/**
|
|
662
|
+
* Project-scoped client for the Uniform Automations API. Project ID is passed
|
|
663
|
+
* explicitly in the body (writes) or query (reads) on each request.
|
|
664
|
+
*/
|
|
665
|
+
declare class AutomationsClient extends ApiClient<AutomationsClientOptions> {
|
|
666
|
+
#private;
|
|
667
|
+
/**
|
|
668
|
+
* Lists the automations configured for a project.
|
|
669
|
+
*/
|
|
670
|
+
list(): Promise<AutomationsListResponse>;
|
|
671
|
+
/**
|
|
672
|
+
* Deploys (creates or updates) a single automation.
|
|
673
|
+
*
|
|
674
|
+
* @param input - The automation definition + bundled code.
|
|
675
|
+
*/
|
|
676
|
+
deploy(input: AutomationsDeployInput): Promise<void>;
|
|
677
|
+
/**
|
|
678
|
+
* Toggles the enabled state of an automation.
|
|
679
|
+
*
|
|
680
|
+
* @param publicId - The automation public ID.
|
|
681
|
+
* @param enabled - The desired enabled state.
|
|
682
|
+
*/
|
|
683
|
+
setEnabled(publicId: string, enabled: boolean): Promise<void>;
|
|
684
|
+
/**
|
|
685
|
+
* Deletes an automation.
|
|
686
|
+
*
|
|
687
|
+
* @param publicId - The automation public ID.
|
|
688
|
+
*/
|
|
689
|
+
remove(publicId: string): Promise<void>;
|
|
690
|
+
/**
|
|
691
|
+
* Lists automation runs for the project, optionally filtered by automation and status.
|
|
692
|
+
*/
|
|
693
|
+
listRuns(options?: {
|
|
694
|
+
publicId?: string;
|
|
695
|
+
statuses?: AutomationRunStatus[];
|
|
696
|
+
offset?: number;
|
|
697
|
+
limit?: number;
|
|
698
|
+
}): Promise<AutomationRunsListResponse>;
|
|
699
|
+
/**
|
|
700
|
+
* Returns the log entries for a single automation run.
|
|
701
|
+
*
|
|
702
|
+
* @param runId - The automation run ID.
|
|
703
|
+
*/
|
|
704
|
+
listRunLogs(runId: string): Promise<AutomationRunLogEntry[]>;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export { type AutomationRunLogEntry, type AutomationRunStatus, type AutomationRunSummary, type AutomationRunsListResponse, type AutomationSummary, type AutomationTriggerType, AutomationsClient, type AutomationsClientOptions, type AutomationsDeployBody, type AutomationsDeployInput, type AutomationsListResponse };
|