@reduck-ai/sdk 1.1.21 → 2.0.0

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 (57) hide show
  1. package/README.md +105 -202
  2. package/dist/client.d.ts +11 -20
  3. package/dist/client.js +19 -107
  4. package/dist/generated/client/client.gen.d.ts +2 -0
  5. package/dist/generated/client/client.gen.js +216 -0
  6. package/dist/generated/client/index.d.ts +10 -0
  7. package/dist/generated/client/index.js +6 -0
  8. package/dist/generated/client/types.gen.d.ts +120 -0
  9. package/dist/generated/client/types.gen.js +2 -0
  10. package/dist/generated/client/utils.gen.d.ts +37 -0
  11. package/dist/generated/client/utils.gen.js +228 -0
  12. package/dist/generated/client.gen.d.ts +12 -0
  13. package/dist/generated/client.gen.js +3 -0
  14. package/dist/generated/core/auth.gen.d.ts +25 -0
  15. package/dist/generated/core/auth.gen.js +14 -0
  16. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  17. package/dist/generated/core/bodySerializer.gen.js +57 -0
  18. package/dist/generated/core/params.gen.d.ts +43 -0
  19. package/dist/generated/core/params.gen.js +109 -0
  20. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  21. package/dist/generated/core/pathSerializer.gen.js +106 -0
  22. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  23. package/dist/generated/core/queryKeySerializer.gen.js +92 -0
  24. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  25. package/dist/generated/core/serverSentEvents.gen.js +132 -0
  26. package/dist/generated/core/types.gen.d.ts +83 -0
  27. package/dist/generated/core/types.gen.js +2 -0
  28. package/dist/generated/core/utils.gen.d.ts +19 -0
  29. package/dist/generated/core/utils.gen.js +87 -0
  30. package/dist/generated/index.d.ts +2 -0
  31. package/dist/generated/index.js +3 -0
  32. package/dist/generated/sdk.gen.d.ts +471 -0
  33. package/dist/generated/sdk.gen.js +862 -0
  34. package/dist/generated/types.gen.d.ts +5489 -0
  35. package/dist/generated/types.gen.js +56 -0
  36. package/dist/index.d.ts +3 -5
  37. package/dist/index.js +4 -4
  38. package/openapi.json +16668 -0
  39. package/package.json +23 -25
  40. package/dist/build-env.generated.d.ts +0 -3
  41. package/dist/build-env.generated.js +0 -4
  42. package/dist/device.d.ts +0 -3
  43. package/dist/device.js +0 -7
  44. package/dist/errors.d.ts +0 -9
  45. package/dist/errors.js +0 -21
  46. package/dist/method.d.ts +0 -3
  47. package/dist/method.js +0 -23
  48. package/dist/run.d.ts +0 -12
  49. package/dist/run.js +0 -73
  50. package/dist/schemas.d.ts +0 -597
  51. package/dist/schemas.js +0 -106
  52. package/dist/session.d.ts +0 -3
  53. package/dist/session.js +0 -14
  54. package/dist/site.d.ts +0 -3
  55. package/dist/site.js +0 -21
  56. package/dist/types.d.ts +0 -43
  57. package/dist/types.js +0 -8
@@ -0,0 +1,862 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from './client.gen.js';
3
+ /**
4
+ * List all app images
5
+ *
6
+ * Every installable app you can reach: your own, your projects', and the public catalogue. `catalogue_only=true` is the catalogue alone.
7
+ */
8
+ export const listAllAppImages = (options) => (options?.client ?? client).get({
9
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
10
+ url: '/api/app-images',
11
+ ...options
12
+ });
13
+ /**
14
+ * List app images
15
+ *
16
+ * The installable apps owned by one handle, private ones included. Members only — another scope's public ones are reachable through the catalogue instead.
17
+ */
18
+ export const listAppImages = (options) => (options.client ?? client).get({
19
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
20
+ url: '/api/app-images/{handle}',
21
+ ...options
22
+ });
23
+ /**
24
+ * Create app image
25
+ *
26
+ * Create an installable app in the scope of one handle. It starts private and with no release, so nothing can be installed from it until one is deployed.
27
+ */
28
+ export const createAppImage = (options) => (options.client ?? client).post({
29
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
30
+ url: '/api/app-images/{handle}',
31
+ ...options,
32
+ headers: {
33
+ 'Content-Type': 'application/json',
34
+ ...options.headers
35
+ }
36
+ });
37
+ /**
38
+ * Get app image
39
+ *
40
+ * Read one installable app, with the install contract of the release it currently serves.
41
+ */
42
+ export const getAppImage = (options) => (options.client ?? client).get({
43
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
44
+ url: '/api/app-images/{handle}/{slug}',
45
+ ...options
46
+ });
47
+ /**
48
+ * Update app image
49
+ *
50
+ * Update an installable app's name, its texts, or whether it is in the public catalogue. The slug is the address and cannot be changed.
51
+ */
52
+ export const updateAppImage = (options) => (options.client ?? client).patch({
53
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
54
+ url: '/api/app-images/{handle}/{slug}',
55
+ ...options,
56
+ headers: {
57
+ 'Content-Type': 'application/json',
58
+ ...options.headers
59
+ }
60
+ });
61
+ /**
62
+ * Archive app image
63
+ *
64
+ * Withdraw an installable app. Apps already installed from it keep running; what stops is new installs, new releases, and being listed anywhere.
65
+ */
66
+ export const archiveAppImage = (options) => (options.client ?? client).delete({
67
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
68
+ url: '/api/app-images/{handle}/{slug}/archive',
69
+ ...options
70
+ });
71
+ /**
72
+ * Restore app image
73
+ *
74
+ * Put a withdrawn app back. Nothing was destroyed, so this restores it entire.
75
+ */
76
+ export const restoreAppImage = (options) => (options.client ?? client).post({
77
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
78
+ url: '/api/app-images/{handle}/{slug}/archive',
79
+ ...options
80
+ });
81
+ /**
82
+ * List app image releases
83
+ *
84
+ * An installable app's deploy history, newest first.
85
+ */
86
+ export const listAppImageReleases = (options) => (options.client ?? client).get({
87
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
88
+ url: '/api/app-images/{handle}/{slug}/releases',
89
+ ...options
90
+ });
91
+ /**
92
+ * Start app image release
93
+ *
94
+ * Begin a deploy: reserve the release number and answer with a presigned upload per file. The bytes go straight to storage rather than through this API, and nothing serves the release until you publish it.
95
+ */
96
+ export const startAppImageRelease = (options) => (options.client ?? client).post({
97
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
98
+ url: '/api/app-images/{handle}/{slug}/releases',
99
+ ...options,
100
+ headers: {
101
+ 'Content-Type': 'application/json',
102
+ ...options.headers
103
+ }
104
+ });
105
+ /**
106
+ * Get app image release
107
+ *
108
+ * Read one release by its number: the files it shipped, the hosts it may reach, its authored settings and its install contract.
109
+ */
110
+ export const getAppImageRelease = (options) => (options.client ?? client).get({
111
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
112
+ url: '/api/app-images/{handle}/{slug}/releases/{release_number}',
113
+ ...options
114
+ });
115
+ /**
116
+ * Publish app image release
117
+ *
118
+ * Finish a deploy: check every file arrived, then serve it. Every app installed from this image picks it up on its next load. Publishing twice answers the same way, so a lost response can be retried.
119
+ */
120
+ export const publishAppImageRelease = (options) => (options.client ?? client).post({
121
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
122
+ url: '/api/app-images/{handle}/{slug}/releases/{release_number}/publish',
123
+ ...options
124
+ });
125
+ /**
126
+ * Rollback app image
127
+ *
128
+ * Serve one of the earlier releases, by number. Releases are immutable and never removed, so this is reversible by rolling forward to the number you came from — and it reaches every installed app at once.
129
+ */
130
+ export const rollbackAppImage = (options) => (options.client ?? client).post({
131
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
132
+ url: '/api/app-images/{handle}/{slug}/rollback',
133
+ ...options,
134
+ headers: {
135
+ 'Content-Type': 'application/json',
136
+ ...options.headers
137
+ }
138
+ });
139
+ /**
140
+ * List all apps
141
+ *
142
+ * List every app you can reach, newest first: your own, plus those owned by a project you belong to.
143
+ */
144
+ export const listAllApps = (options) => (options?.client ?? client).get({
145
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
146
+ url: '/api/apps',
147
+ ...options
148
+ });
149
+ /**
150
+ * List apps
151
+ *
152
+ * List the apps owned by one handle, newest first.
153
+ */
154
+ export const listApps = (options) => (options.client ?? client).get({
155
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
156
+ url: '/api/apps/{handle}',
157
+ ...options
158
+ });
159
+ /**
160
+ * Create app
161
+ *
162
+ * Install an app from an image, in the scope of one handle. It is a fresh instance — its own database, its own blobs, its own secret values — and it serves whatever release that image points at, now and after every later deploy.
163
+ */
164
+ export const createApp = (options) => (options.client ?? client).post({
165
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
166
+ url: '/api/apps/{handle}',
167
+ ...options,
168
+ headers: {
169
+ 'Content-Type': 'application/json',
170
+ ...options.headers
171
+ }
172
+ });
173
+ /**
174
+ * Uninstall app
175
+ *
176
+ * Uninstall an app: its records, its files and its secrets go with it.
177
+ */
178
+ export const uninstallApp = (options) => (options.client ?? client).delete({
179
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
180
+ url: '/api/apps/{handle}/{app_id}',
181
+ ...options
182
+ });
183
+ /**
184
+ * Get app
185
+ *
186
+ * Read one app, including the release it is serving.
187
+ */
188
+ export const getApp = (options) => (options.client ?? client).get({
189
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
190
+ url: '/api/apps/{handle}/{app_id}',
191
+ ...options
192
+ });
193
+ /**
194
+ * Update app
195
+ *
196
+ * Rename an app. That is the whole of what an install owns: what the app says about itself belongs to the image it came from, and who may open it is the scope it lives in.
197
+ */
198
+ export const updateApp = (options) => (options.client ?? client).patch({
199
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
200
+ url: '/api/apps/{handle}/{app_id}',
201
+ ...options,
202
+ headers: {
203
+ 'Content-Type': 'application/json',
204
+ ...options.headers
205
+ }
206
+ });
207
+ /**
208
+ * Get app secrets
209
+ *
210
+ * List an app's secrets by name. Values are write-only: no endpoint ever gives one back.
211
+ */
212
+ export const getAppSecrets = (options) => (options.client ?? client).get({
213
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
214
+ url: '/api/apps/{handle}/{app_id}/secrets',
215
+ ...options
216
+ });
217
+ /**
218
+ * Update app secrets
219
+ *
220
+ * Set or unset an app's secrets, several at a time.
221
+ */
222
+ export const updateAppSecrets = (options) => (options.client ?? client).patch({
223
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
224
+ url: '/api/apps/{handle}/{app_id}/secrets',
225
+ ...options,
226
+ headers: {
227
+ 'Content-Type': 'application/json',
228
+ ...options.headers
229
+ }
230
+ });
231
+ /**
232
+ * Get app tools
233
+ *
234
+ * The tasks this app offers an agent, as its running release declares them under `tools` in its manifest: each one's name, what it does, and JSON Schemas for its arguments and its answer. An app serving an older release than its image answers what THAT release ships, because those are the tasks actually there to launch. An empty list is an answer — this app offers none. `skill` is the release's `SKILL.md`, its author's account of how to combine the tools for a purpose, or null when it ships none.
235
+ */
236
+ export const getAppTools = (options) => (options.client ?? client).get({
237
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
238
+ url: '/api/apps/{handle}/{app_id}/tools',
239
+ ...options
240
+ });
241
+ /**
242
+ * List app updates
243
+ *
244
+ * Every version of the app you installed, newest first, saying what this install did with each: `installed` for one it runs, `pending` for one it has not reached, `failed` when a version's schema change could not be applied and the install stayed where it was. An app has no versions of its own — it follows what it was installed from — so this is that history read through one install.
245
+ */
246
+ export const listAppUpdates = (options) => (options.client ?? client).get({
247
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
248
+ url: '/api/apps/{handle}/{app_id}/updates',
249
+ ...options
250
+ });
251
+ /**
252
+ * List connectors
253
+ *
254
+ * List your connectors for one profile (your own account when `profile` is omitted), by website. Summaries only: cookies are never part of a listing.
255
+ */
256
+ export const listConnectors = (options) => (options?.client ?? client).get({
257
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
258
+ url: '/api/connectors',
259
+ ...options
260
+ });
261
+ /**
262
+ * Create connector
263
+ *
264
+ * Store a new connector for a website, beside any the site already holds for that profile. Every cookie has to belong to that host. A connector gets its account only from a probe script, so a second connector for the same site and profile needs a label to tell it apart.
265
+ */
266
+ export const createConnector = (options) => (options.client ?? client).post({
267
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
268
+ url: '/api/connectors',
269
+ ...options,
270
+ headers: {
271
+ 'Content-Type': 'application/json',
272
+ ...options.headers
273
+ }
274
+ });
275
+ /**
276
+ * Delete connector by id
277
+ *
278
+ * Delete one connector, by id, and the cookies it holds.
279
+ */
280
+ export const deleteConnectorById = (options) => (options.client ?? client).delete({
281
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
282
+ url: '/api/connectors/by-id/{id}',
283
+ ...options
284
+ });
285
+ /**
286
+ * Patch connector
287
+ *
288
+ * Rename a connector, or remove its label.
289
+ */
290
+ export const patchConnector = (options) => (options.client ?? client).patch({
291
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
292
+ url: '/api/connectors/by-id/{id}',
293
+ ...options,
294
+ headers: {
295
+ 'Content-Type': 'application/json',
296
+ ...options.headers
297
+ }
298
+ });
299
+ /**
300
+ * Put connector by id
301
+ *
302
+ * Replace one connector's cookies, by id. This is how a run writes the cookies it refreshed back to the connector it used.
303
+ */
304
+ export const putConnectorById = (options) => (options.client ?? client).put({
305
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
306
+ url: '/api/connectors/by-id/{id}',
307
+ ...options,
308
+ headers: {
309
+ 'Content-Type': 'application/json',
310
+ ...options.headers
311
+ }
312
+ });
313
+ /**
314
+ * Start connector login
315
+ *
316
+ * Open a Reduck cloud browser at a site's sign-in page for a PERSON to sign into. Returns `signInUrl`, a Reduck page that shows the live browser — hand it to whoever holds the account on that site. When they sign in, the connector for each host is stored on its own; poll `getConnectorLogin` to see it land. Use this when there is no Reduck extension to upload cookies from. `hosts` defaults to the login URL's own site. The browser is created when the page is opened and lives ~10 minutes from then. With `profile`, the connectors are stored for that end-user; `endUserLink` then also answers `endUserUrl`, a page the end-user signs in on without a Reduck account. An end-user's sign-in never answers what they typed.
317
+ */
318
+ export const startConnectorLogin = (options) => (options.client ?? client).post({
319
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
320
+ url: '/api/connectors/login',
321
+ ...options,
322
+ headers: {
323
+ 'Content-Type': 'application/json',
324
+ ...options.headers
325
+ }
326
+ });
327
+ /**
328
+ * Get connector login
329
+ *
330
+ * How a sign-in started by `startConnectorLogin` is going: `waiting` (browser open, not signed in yet), `stored` (cookies saved, may still be refreshing), `done` (finished), `failed` (ended with nothing saved). `hosts` says how many cookies each site has so far.
331
+ */
332
+ export const getConnectorLogin = (options) => (options.client ?? client).get({
333
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
334
+ url: '/api/connectors/login/{login_id}',
335
+ ...options
336
+ });
337
+ /**
338
+ * Finish connector login
339
+ *
340
+ * End a sign-in now instead of waiting out its window: harvest whatever cookies are there, store them, release the browser. Returns the final state. A sign-in also ends on its own when the person is done or the window closes, so this is only a shortcut.
341
+ */
342
+ export const finishConnectorLogin = (options) => (options.client ?? client).post({
343
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
344
+ url: '/api/connectors/login/{login_id}/finish',
345
+ ...options
346
+ });
347
+ /**
348
+ * List connector profiles
349
+ *
350
+ * List the end-user profiles you hold connectors for, with how many each has. Your own account's connectors are not a profile and are not listed.
351
+ */
352
+ export const listConnectorProfiles = (options) => (options?.client ?? client).get({
353
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
354
+ url: '/api/connectors/profiles',
355
+ ...options
356
+ });
357
+ /**
358
+ * Delete connector
359
+ *
360
+ * Delete the connector you name on a host, and the cookies it holds. With no name, the site's only connector for the profile.
361
+ */
362
+ export const deleteConnector = (options) => (options.client ?? client).delete({
363
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
364
+ url: '/api/connectors/{host}',
365
+ ...options
366
+ });
367
+ /**
368
+ * Get connector
369
+ *
370
+ * Fetch the connector for a host, cookies included, ready for a run to inject. A host with no connector of its own is served by its nearest parent's, and a host with neither is a 404. When the site holds several connectors for the profile, name one with `account` or `label` (an empty `label` for the one without a label).
371
+ */
372
+ export const getConnector = (options) => (options.client ?? client).get({
373
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
374
+ url: '/api/connectors/{host}',
375
+ ...options
376
+ });
377
+ /**
378
+ * Put connector
379
+ *
380
+ * Replace the cookies of the connector you name on a host, creating it when none matches. With no name, the site's only connector for the profile is replaced, or created when there is none. Every cookie has to belong to that host. This is how the extension uploads a site's cookies.
381
+ */
382
+ export const putConnector = (options) => (options.client ?? client).put({
383
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
384
+ url: '/api/connectors/{host}',
385
+ ...options,
386
+ headers: {
387
+ 'Content-Type': 'application/json',
388
+ ...options.headers
389
+ }
390
+ });
391
+ /**
392
+ * List devices
393
+ *
394
+ * List the devices registered to your account.
395
+ */
396
+ export const listDevices = (options) => (options?.client ?? client).get({
397
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
398
+ url: '/api/devices',
399
+ ...options
400
+ });
401
+ /**
402
+ * Update device
403
+ *
404
+ * Update one of your devices. A new concurrency budget applies to the runs that start after the change. Runs that are already in progress continue.
405
+ */
406
+ export const updateDevice = (options) => (options.client ?? client).patch({
407
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
408
+ url: '/api/devices/{device_id}',
409
+ ...options,
410
+ headers: {
411
+ 'Content-Type': 'application/json',
412
+ ...options.headers
413
+ }
414
+ });
415
+ /**
416
+ * Get me
417
+ *
418
+ * Identify the account these credentials belong to, and the projects it can act in. Its handle is null until the account picks a username, and its personal scope cannot be addressed until it does.
419
+ */
420
+ export const getMe = (options) => (options?.client ?? client).get({
421
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
422
+ url: '/api/me',
423
+ ...options
424
+ });
425
+ /**
426
+ * Get ping
427
+ *
428
+ * Liveness probe: always answers `{ message: "pong" }`. Open endpoint; no authentication.
429
+ */
430
+ export const getPing = (options) => (options?.client ?? client).get({ url: '/api/ping', ...options });
431
+ /**
432
+ * List runs
433
+ *
434
+ * List your automation runs, most recent first.
435
+ */
436
+ export const listRuns = (options) => (options?.client ?? client).get({
437
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
438
+ url: '/api/runs',
439
+ ...options
440
+ });
441
+ /**
442
+ * Run scripts
443
+ *
444
+ * Run a batch of scripts, at the same time in a browser each, or one after the other in the same browser.
445
+ */
446
+ export const runScripts = (options) => (options.client ?? client).post({
447
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
448
+ url: '/api/runs',
449
+ ...options,
450
+ headers: {
451
+ 'Content-Type': 'application/json',
452
+ ...options.headers
453
+ }
454
+ });
455
+ /**
456
+ * Batch delete runs
457
+ *
458
+ * Delete up to 100 runs by id in one call. An id it cannot delete is reported as skipped instead of failing the whole batch.
459
+ */
460
+ export const batchDeleteRuns = (options) => (options.client ?? client).post({
461
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
462
+ url: '/api/runs/delete',
463
+ ...options,
464
+ headers: {
465
+ 'Content-Type': 'application/json',
466
+ ...options.headers
467
+ }
468
+ });
469
+ /**
470
+ * Delete run
471
+ *
472
+ * Delete a finished run and the trace it recorded.
473
+ */
474
+ export const deleteRun = (options) => (options.client ?? client).delete({
475
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
476
+ url: '/api/runs/{run_id}',
477
+ ...options
478
+ });
479
+ /**
480
+ * Get run
481
+ *
482
+ * Fetch one of your runs by id.
483
+ */
484
+ export const getRun = (options) => (options.client ?? client).get({
485
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
486
+ url: '/api/runs/{run_id}',
487
+ ...options
488
+ });
489
+ /**
490
+ * Get run trace
491
+ *
492
+ * Fetch the trace a run recorded.
493
+ */
494
+ export const getRunTrace = (options) => (options.client ?? client).get({
495
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
496
+ url: '/api/runs/{run_id}/trace',
497
+ ...options
498
+ });
499
+ /**
500
+ * List all scripts
501
+ *
502
+ * List all scripts. Authenticated callers get a cross-owner list across their own scripts, member projects, and the official catalogue. Anonymous callers get the official catalogue only.
503
+ */
504
+ export const listAllScripts = (options) => (options?.client ?? client).get({
505
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
506
+ url: '/api/scripts',
507
+ ...options
508
+ });
509
+ /**
510
+ * List scripts
511
+ *
512
+ * List the scripts owned by one handle. The owner, and any member of the project when the handle names one, sees every script under it; everyone else sees only that owner's public scripts.
513
+ */
514
+ export const listScripts = (options) => (options.client ?? client).get({
515
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
516
+ url: '/api/scripts/{handle}',
517
+ ...options
518
+ });
519
+ /**
520
+ * Create script
521
+ *
522
+ * Create a script under an owner handle, together with its first version, in one call. A first version that is not a draft and is TypeScript must pass the type check, or the script is not created.
523
+ */
524
+ export const createScript = (options) => (options.client ?? client).post({
525
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
526
+ url: '/api/scripts/{handle}',
527
+ ...options,
528
+ headers: {
529
+ 'Content-Type': 'application/json',
530
+ ...options.headers
531
+ }
532
+ });
533
+ /**
534
+ * Get script lib
535
+ *
536
+ * Read a host's lib: the TypeScript an owner's scripts import as `lib:<host>`, from any host. Returns its latest version (the one every import loads) with its code, and the owner's scripts that import it. Readable by whoever can read the owner's scripts on the host; an official owner's source is limited to its members.
537
+ */
538
+ export const getScriptLib = (options) => (options.client ?? client).get({
539
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
540
+ url: '/api/scripts/{handle}/{host}/lib',
541
+ ...options
542
+ });
543
+ /**
544
+ * List script lib versions
545
+ *
546
+ * List a host's lib versions, newest first, with their notes. Read a version on its own to get its code.
547
+ */
548
+ export const listScriptLibVersions = (options) => (options.client ?? client).get({
549
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
550
+ url: '/api/scripts/{handle}/{host}/lib/versions',
551
+ ...options
552
+ });
553
+ /**
554
+ * Publish script lib version
555
+ *
556
+ * Publish the next version of a host's lib, creating the lib with its first version. The version must pass the type check of a library. A version never changes once published. It becomes the latest, the one every import loads, only when promoted, except a lib's first version, which is the latest at once. The owner can, and so can a project member allowed to update its scripts.
557
+ */
558
+ export const publishScriptLibVersion = (options) => (options.client ?? client).post({
559
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
560
+ url: '/api/scripts/{handle}/{host}/lib/versions',
561
+ ...options,
562
+ headers: {
563
+ 'Content-Type': 'application/json',
564
+ ...options.headers
565
+ }
566
+ });
567
+ /**
568
+ * Get script lib version
569
+ *
570
+ * Read one version of a host's lib, its code included; with `diff`, the changes from another version.
571
+ */
572
+ export const getScriptLibVersion = (options) => (options.client ?? client).get({
573
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
574
+ url: '/api/scripts/{handle}/{host}/lib/versions/{version}',
575
+ ...options
576
+ });
577
+ /**
578
+ * Promote script lib version
579
+ *
580
+ * Make a version of a host's lib the latest: every script of the owner that imports `lib:<host>` loads it from its next run. Promoting an older version is the rollback. The version must pass the type check of a library. The owner can, and so can a project member allowed to update its scripts.
581
+ */
582
+ export const promoteScriptLibVersion = (options) => (options.client ?? client).post({
583
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
584
+ url: '/api/scripts/{handle}/{host}/lib/versions/{version}/promote',
585
+ ...options
586
+ });
587
+ /**
588
+ * Delete host readme
589
+ *
590
+ * Delete a host's README. The owner can, and so can a project member allowed to update its scripts.
591
+ */
592
+ export const deleteHostReadme = (options) => (options.client ?? client).delete({
593
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
594
+ url: '/api/scripts/{handle}/{host}/readme',
595
+ ...options
596
+ });
597
+ /**
598
+ * Get host readme
599
+ *
600
+ * Read the README for a host: the notes an owner shares across every script they own for that site, like rate limits, login quirks, or ordering rules. Anyone can read it while that owner has a public, unarchived script on the host; otherwise only the owner, or a member of the project that owns it.
601
+ */
602
+ export const getHostReadme = (options) => (options.client ?? client).get({
603
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
604
+ url: '/api/scripts/{handle}/{host}/readme',
605
+ ...options
606
+ });
607
+ /**
608
+ * Set host readme
609
+ *
610
+ * Write the README for a host, the guidance shared across every script that owner has for the site. Calling it again replaces the previous text. The owner can, and so can a project member allowed to update its scripts.
611
+ */
612
+ export const setHostReadme = (options) => (options.client ?? client).put({
613
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
614
+ url: '/api/scripts/{handle}/{host}/readme',
615
+ ...options,
616
+ headers: {
617
+ 'Content-Type': 'application/json',
618
+ ...options.headers
619
+ }
620
+ });
621
+ /**
622
+ * Get script
623
+ *
624
+ * Read one script by its canonical identity, including the version it currently runs. A public script is readable by anyone, signed in or not; a private one only by its owner, or a member of the project that owns it.
625
+ */
626
+ export const getScript = (options) => (options.client ?? client).get({
627
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
628
+ url: '/api/scripts/{handle}/{host}/{slug}',
629
+ ...options
630
+ });
631
+ /**
632
+ * Patch script
633
+ *
634
+ * Update a script's editable metadata.
635
+ */
636
+ export const patchScript = (options) => (options.client ?? client).patch({
637
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
638
+ url: '/api/scripts/{handle}/{host}/{slug}',
639
+ ...options,
640
+ headers: {
641
+ 'Content-Type': 'application/json',
642
+ ...options.headers
643
+ }
644
+ });
645
+ /**
646
+ * Archive script
647
+ *
648
+ * Archive a script. It vanishes from the cross-owner listing, though a listing scoped to its owner still shows it unless you filter archived ones out. Archiving never frees its host and slug, so no other script can take that identity while it exists, and a public one stays readable by its own.
649
+ */
650
+ export const archiveScript = (options) => (options.client ?? client).post({
651
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
652
+ url: '/api/scripts/{handle}/{host}/{slug}/archive',
653
+ ...options
654
+ });
655
+ /**
656
+ * List script evals
657
+ *
658
+ * List a script's evals, each with the verdict of its latest run, or of its latest run on `version_id`.
659
+ */
660
+ export const listScriptEvals = (options) => (options.client ?? client).get({
661
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
662
+ url: '/api/scripts/{handle}/{host}/{slug}/evals',
663
+ ...options
664
+ });
665
+ /**
666
+ * Add script evals
667
+ *
668
+ * Add evals to a script: frozen args on a browser setup, with an optional check of the output. An eval that exists is answered as it is, active again.
669
+ */
670
+ export const addScriptEvals = (options) => (options.client ?? client).post({
671
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
672
+ url: '/api/scripts/{handle}/{host}/{slug}/evals',
673
+ ...options,
674
+ headers: {
675
+ 'Content-Type': 'application/json',
676
+ ...options.headers
677
+ }
678
+ });
679
+ /**
680
+ * Set script evals active
681
+ *
682
+ * Switch evals on or off. An inactive eval is kept with its history, but it is not run and does not gate a promote.
683
+ */
684
+ export const setScriptEvalsActive = (options) => (options.client ?? client).post({
685
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
686
+ url: '/api/scripts/{handle}/{host}/{slug}/evals/active',
687
+ ...options,
688
+ headers: {
689
+ 'Content-Type': 'application/json',
690
+ ...options.headers
691
+ }
692
+ });
693
+ /**
694
+ * Record script eval runs
695
+ *
696
+ * Link runs to the evals they executed, with each verdict once the run has ended, so they count for a promote. Each run must be your own run of this script, on the eval's browser. The first verdict recorded for a run stays.
697
+ */
698
+ export const recordScriptEvalRuns = (options) => (options.client ?? client).post({
699
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
700
+ url: '/api/scripts/{handle}/{host}/{slug}/evals/runs',
701
+ ...options,
702
+ headers: {
703
+ 'Content-Type': 'application/json',
704
+ ...options.headers
705
+ }
706
+ });
707
+ /**
708
+ * Publish script
709
+ *
710
+ * Publish a script, making it readable by anyone.
711
+ */
712
+ export const publishScript = (options) => (options.client ?? client).post({
713
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
714
+ url: '/api/scripts/{handle}/{host}/{slug}/publish',
715
+ ...options
716
+ });
717
+ /**
718
+ * Restore script
719
+ *
720
+ * Restore an archived script.
721
+ */
722
+ export const restoreScript = (options) => (options.client ?? client).post({
723
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
724
+ url: '/api/scripts/{handle}/{host}/{slug}/restore',
725
+ ...options
726
+ });
727
+ /**
728
+ * List script runs
729
+ *
730
+ * List your runs of a script, most recent first. A script that you never ran gives an empty list.
731
+ */
732
+ export const listScriptRuns = (options) => (options.client ?? client).get({
733
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
734
+ url: '/api/scripts/{handle}/{host}/{slug}/runs',
735
+ ...options
736
+ });
737
+ /**
738
+ * Run script
739
+ *
740
+ * Run a script in a managed browser or in your own paired browser.
741
+ */
742
+ export const runScript = (options) => (options.client ?? client).post({
743
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
744
+ url: '/api/scripts/{handle}/{host}/{slug}/runs',
745
+ ...options,
746
+ headers: {
747
+ 'Content-Type': 'application/json',
748
+ ...options.headers
749
+ }
750
+ });
751
+ /**
752
+ * List script transfer targets
753
+ *
754
+ * List the scopes this script could move into: your personal scope, plus the projects where you may create scripts.
755
+ */
756
+ export const listScriptTransferTargets = (options) => (options.client ?? client).get({
757
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
758
+ url: '/api/scripts/{handle}/{host}/{slug}/transfer',
759
+ ...options
760
+ });
761
+ /**
762
+ * Transfer script
763
+ *
764
+ * Move a script to another scope: your personal one, or a project where you may create scripts.
765
+ */
766
+ export const transferScript = (options) => (options.client ?? client).post({
767
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
768
+ url: '/api/scripts/{handle}/{host}/{slug}/transfer',
769
+ ...options,
770
+ headers: {
771
+ 'Content-Type': 'application/json',
772
+ ...options.headers
773
+ }
774
+ });
775
+ /**
776
+ * Unpublish script
777
+ *
778
+ * Unpublish a script, making it private again. Works on an archived script too.
779
+ */
780
+ export const unpublishScript = (options) => (options.client ?? client).post({
781
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
782
+ url: '/api/scripts/{handle}/{host}/{slug}/unpublish',
783
+ ...options
784
+ });
785
+ /**
786
+ * List script versions
787
+ *
788
+ * List a script's versions, newest first. Read a version on its own to get its code.
789
+ */
790
+ export const listScriptVersions = (options) => (options.client ?? client).get({
791
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
792
+ url: '/api/scripts/{handle}/{host}/{slug}/versions',
793
+ ...options
794
+ });
795
+ /**
796
+ * Create draft script version
797
+ *
798
+ * Add a version to a script as a draft: it does not become the version the script runs until you promote it.
799
+ */
800
+ export const createDraftScriptVersion = (options) => (options.client ?? client).post({
801
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
802
+ url: '/api/scripts/{handle}/{host}/{slug}/versions',
803
+ ...options,
804
+ headers: {
805
+ 'Content-Type': 'application/json',
806
+ ...options.headers
807
+ }
808
+ });
809
+ /**
810
+ * Delete draft script version
811
+ *
812
+ * Discard a draft version.
813
+ */
814
+ export const deleteDraftScriptVersion = (options) => (options.client ?? client).delete({
815
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
816
+ url: '/api/scripts/{handle}/{host}/{slug}/versions/{version_id}',
817
+ ...options
818
+ });
819
+ /**
820
+ * Get script version
821
+ *
822
+ * Read one version of a script, its code and its contract included.
823
+ */
824
+ export const getScriptVersion = (options) => (options.client ?? client).get({
825
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
826
+ url: '/api/scripts/{handle}/{host}/{slug}/versions/{version_id}',
827
+ ...options
828
+ });
829
+ /**
830
+ * Patch draft script version
831
+ *
832
+ * Update a draft version.
833
+ */
834
+ export const patchDraftScriptVersion = (options) => (options.client ?? client).patch({
835
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
836
+ url: '/api/scripts/{handle}/{host}/{slug}/versions/{version_id}',
837
+ ...options,
838
+ headers: {
839
+ 'Content-Type': 'application/json',
840
+ ...options.headers
841
+ }
842
+ });
843
+ /**
844
+ * Promote script version
845
+ *
846
+ * Make a version the one the script runs, which is also how you roll back to an older one. A draft stops being a draft. A TypeScript draft must pass the type check first.
847
+ */
848
+ export const promoteScriptVersion = (options) => (options.client ?? client).post({
849
+ security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-API-Key', type: 'apiKey' }],
850
+ url: '/api/scripts/{handle}/{host}/{slug}/versions/{version_id}/promote',
851
+ ...options,
852
+ headers: {
853
+ 'Content-Type': 'application/json',
854
+ ...options.headers
855
+ }
856
+ });
857
+ /**
858
+ * Get version
859
+ *
860
+ * Get the current Reduck CLI version. Open endpoint; no authentication.
861
+ */
862
+ export const getVersion = (options) => (options?.client ?? client).get({ url: '/api/version', ...options });