@eigenpal/sdk 0.25.14 → 1.0.0-rc.2

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 (73) hide show
  1. package/README.md +27 -105
  2. package/dist/client.d.ts +164 -0
  3. package/dist/client.js +234 -0
  4. package/dist/core.d.ts +82 -0
  5. package/dist/core.js +311 -0
  6. package/dist/errors.d.ts +64 -0
  7. package/dist/errors.js +132 -0
  8. package/dist/generated/operations.gen.d.ts +336 -0
  9. package/dist/generated/operations.gen.js +135 -0
  10. package/dist/generated/public.gen.d.ts +2 -0
  11. package/dist/generated/public.gen.js +2 -0
  12. package/dist/generated/resources.gen.d.ts +490 -0
  13. package/dist/generated/resources.gen.js +659 -0
  14. package/dist/generated/types.gen.d.ts +2457 -0
  15. package/dist/generated/types.gen.js +2 -0
  16. package/dist/index.d.ts +20 -0
  17. package/dist/index.js +15 -0
  18. package/dist/lib/fetch-body.d.ts +23 -0
  19. package/dist/lib/fetch-body.js +66 -0
  20. package/dist/lib/files.d.ts +134 -0
  21. package/dist/lib/files.js +296 -0
  22. package/dist/lib/upload-app-chunked.d.ts +36 -0
  23. package/dist/lib/upload-app-chunked.js +94 -0
  24. package/dist/lib/upload-limits.d.ts +32 -0
  25. package/dist/lib/upload-limits.js +60 -0
  26. package/dist/lib/upload-presigned-multipart.d.ts +74 -0
  27. package/dist/lib/upload-presigned-multipart.js +212 -0
  28. package/dist/page.d.ts +30 -0
  29. package/dist/page.js +38 -0
  30. package/dist/resources.d.ts +85 -0
  31. package/dist/resources.js +247 -0
  32. package/dist/telemetry.d.ts +20 -0
  33. package/{src/telemetry.ts → dist/telemetry.js} +26 -31
  34. package/dist/upload-file.d.ts +31 -0
  35. package/dist/upload-file.js +286 -0
  36. package/{src/upload.ts → dist/upload.d.ts} +4 -4
  37. package/dist/upload.js +12 -0
  38. package/package.json +19 -15
  39. package/src/client.ts +0 -656
  40. package/src/errors.ts +0 -130
  41. package/src/generated/client/client.gen.ts +0 -277
  42. package/src/generated/client/index.ts +0 -27
  43. package/src/generated/client/types.gen.ts +0 -218
  44. package/src/generated/client/utils.gen.ts +0 -316
  45. package/src/generated/client.gen.ts +0 -18
  46. package/src/generated/core/auth.gen.ts +0 -48
  47. package/src/generated/core/bodySerializer.gen.ts +0 -82
  48. package/src/generated/core/params.gen.ts +0 -178
  49. package/src/generated/core/pathSerializer.gen.ts +0 -171
  50. package/src/generated/core/queryKeySerializer.gen.ts +0 -117
  51. package/src/generated/core/serverSentEvents.gen.ts +0 -242
  52. package/src/generated/core/types.gen.ts +0 -110
  53. package/src/generated/core/utils.gen.ts +0 -140
  54. package/src/generated/index.ts +0 -4
  55. package/src/generated/sdk.gen.ts +0 -1361
  56. package/src/generated/types.gen.ts +0 -9282
  57. package/src/index.ts +0 -120
  58. package/src/lib/fetch-body.ts +0 -92
  59. package/src/lib/files.ts +0 -390
  60. package/src/lib/upload-app-chunked.ts +0 -121
  61. package/src/lib/upload-limits.ts +0 -72
  62. package/src/lib/upload-presigned-multipart.ts +0 -285
  63. package/src/resources/auth.ts +0 -18
  64. package/src/resources/automations.ts +0 -830
  65. package/src/resources/dataset-review-requests.ts +0 -38
  66. package/src/resources/email-servers.ts +0 -95
  67. package/src/resources/files.ts +0 -592
  68. package/src/resources/folders.ts +0 -77
  69. package/src/resources/human-reviews.ts +0 -106
  70. package/src/resources/models.ts +0 -37
  71. package/src/resources/runs.ts +0 -350
  72. package/src/resources/templates.ts +0 -153
  73. package/src/runtime-config.ts +0 -14
@@ -0,0 +1,659 @@
1
+ // Generated by scripts/sdk-gen from openapi.json and the CLI command table. Do not edit.
2
+ export class AutomationsResource {
3
+ core;
4
+ constructor(core, impls) {
5
+ this.core = core;
6
+ void impls;
7
+ }
8
+ /**
9
+ * The automations of the project and their state against live.
10
+ *
11
+ * CLI: `eigenpal automations list` · Route: `GET /v1/automations`
12
+ *
13
+ * Answers a page; iterate it (`for await`) for every item.
14
+ */
15
+ list(options = {}) {
16
+ return this.core.page('automations.list', {
17
+ query: {
18
+ search: options.search,
19
+ kind: options.kind,
20
+ limit: options.limit,
21
+ cursor: options.cursor,
22
+ },
23
+ project: options.project,
24
+ signal: options.signal,
25
+ }, { project: 'query', list: { key: 'data', paging: 'cursor' } });
26
+ }
27
+ /**
28
+ * An automation: inputs, output schema, variables, dataset and a ready run command.
29
+ *
30
+ * CLI: `eigenpal automations get <automation>[@live]` · Route: `GET /v1/automations/{id}`
31
+ */
32
+ get(automation, options = {}) {
33
+ return this.core.request('automations.get', {
34
+ path: { id: automation },
35
+ signal: options.signal,
36
+ });
37
+ }
38
+ }
39
+ export class RunsResource {
40
+ core;
41
+ constructor(core, impls) {
42
+ this.core = core;
43
+ void impls;
44
+ }
45
+ /**
46
+ * List runs, newest first.
47
+ *
48
+ * CLI: `eigenpal runs list` · Route: `GET /v1/runs`
49
+ *
50
+ * Answers a page; iterate it (`for await`) for every item.
51
+ */
52
+ list(options = {}) {
53
+ return this.core.page('runs.list', {
54
+ query: {
55
+ tag: options.tag,
56
+ kind: options.kind,
57
+ automation: options.automation,
58
+ state: options.state,
59
+ trigger: options.trigger,
60
+ triggeredBy: options.triggeredBy,
61
+ batchId: options.batchId,
62
+ exampleId: options.exampleId,
63
+ exampleIdContains: options.exampleIdContains,
64
+ hasExample: options.hasExample,
65
+ createdAfter: options.createdAfter,
66
+ createdBefore: options.createdBefore,
67
+ completedAfter: options.completedAfter,
68
+ completedBefore: options.completedBefore,
69
+ limit: options.limit,
70
+ ids: options.ids,
71
+ experiments: options.experiments,
72
+ reviewStatus: options.reviewStatus,
73
+ reviewVerdict: options.reviewVerdict,
74
+ hasReview: options.hasReview,
75
+ noReview: options.noReview,
76
+ hasCorrections: options.hasCorrections,
77
+ reviewNoteContains: options.reviewNoteContains,
78
+ reviewCreatedAfter: options.reviewCreatedAfter,
79
+ reviewCreatedBefore: options.reviewCreatedBefore,
80
+ reviewUpdatedAfter: options.reviewUpdatedAfter,
81
+ reviewUpdatedBefore: options.reviewUpdatedBefore,
82
+ reviewClosedAfter: options.reviewClosedAfter,
83
+ reviewClosedBefore: options.reviewClosedBefore,
84
+ sinceLastClosed: options.sinceLastClosed,
85
+ sampleRate: options.sampleRate,
86
+ cursor: options.cursor,
87
+ },
88
+ project: options.project,
89
+ signal: options.signal,
90
+ }, { project: 'query', list: { key: 'data', paging: 'cursor' } });
91
+ }
92
+ /**
93
+ * A run: its status, output, error and a step summary.
94
+ *
95
+ * CLI: `eigenpal runs get <run>` · Route: `GET /v1/runs/{id}`
96
+ *
97
+ * Waits with `wait: true` (`timeoutMs`, default 30 minutes).
98
+ */
99
+ get(run, options = {}) {
100
+ return this.core.request('runs.get', { path: { id: run }, query: { expand: options.expand }, signal: options.signal }, {
101
+ wait: {
102
+ enabled: options.wait ?? false,
103
+ poll: 'runs.get',
104
+ field: 'state',
105
+ final: ['succeeded', 'failed', 'cancelled', 'waiting'],
106
+ timeoutMs: options.timeoutMs,
107
+ },
108
+ });
109
+ }
110
+ /**
111
+ * Cancel a queued, running or waiting run.
112
+ *
113
+ * CLI: `eigenpal runs cancel <run>` · Route: `POST /v1/runs/{id}/cancel`
114
+ */
115
+ cancel(run, options = {}) {
116
+ return this.core.request('runs.cancel', {
117
+ path: { id: run },
118
+ signal: options.signal,
119
+ });
120
+ }
121
+ /**
122
+ * Run the same input again, on what is live or another version.
123
+ *
124
+ * CLI: `eigenpal runs rerun <run>[@<version|range|live|original>]` · Route: `POST /v1/runs/{id}/rerun`
125
+ *
126
+ * Waits by default (`timeoutMs`, default 30 minutes).
127
+ */
128
+ rerun(run, options = {}) {
129
+ return this.core.request('runs.rerun', { path: { id: run }, query: { version: options.version }, signal: options.signal }, {
130
+ wait: {
131
+ enabled: options.wait ?? true,
132
+ poll: 'runs.get',
133
+ field: 'state',
134
+ final: ['succeeded', 'failed', 'cancelled', 'waiting'],
135
+ timeoutMs: options.timeoutMs,
136
+ },
137
+ });
138
+ }
139
+ }
140
+ export class ExperimentsResource {
141
+ core;
142
+ constructor(core, impls) {
143
+ this.core = core;
144
+ void impls;
145
+ }
146
+ /**
147
+ * List experiments (runs of a dataset), newest first.
148
+ *
149
+ * CLI: `eigenpal experiments list` · Route: `GET /v1/automations/{id}/experiments`
150
+ *
151
+ * Answers a page; iterate it (`for await`) for every item.
152
+ */
153
+ list(automation, options = {}) {
154
+ return this.core.page('automations.experiments.list', {
155
+ path: { id: automation },
156
+ query: {
157
+ limit: options.limit,
158
+ createdAfter: options.createdAfter,
159
+ createdBefore: options.createdBefore,
160
+ tag: options.tag,
161
+ cursor: options.cursor,
162
+ },
163
+ signal: options.signal,
164
+ }, { list: { key: 'data', paging: 'cursor' } });
165
+ }
166
+ }
167
+ export class ReleasesResource {
168
+ core;
169
+ constructor(core, impls) {
170
+ this.core = core;
171
+ void impls;
172
+ }
173
+ /**
174
+ * The releases of the project, newest first, with where each is live.
175
+ *
176
+ * CLI: `eigenpal releases list` · Route: `GET /v1/projects/{id}/releases`
177
+ *
178
+ * Answers a page; iterate it (`for await`) for every item.
179
+ */
180
+ list(options = {}) {
181
+ return this.core.page('projects.releases.list', { project: options.project, signal: options.signal }, { project: 'path', list: { key: 'data', paging: 'none' } });
182
+ }
183
+ /**
184
+ * A release: the commit, build, notes, automations and where it is live.
185
+ *
186
+ * CLI: `eigenpal releases get <version>` · Route: `GET /v1/projects/{id}/releases/{version}`
187
+ */
188
+ get(version, options = {}) {
189
+ return this.core.request('projects.releases.get', { path: { version: version }, project: options.project, signal: options.signal }, { project: 'path' });
190
+ }
191
+ /**
192
+ * Withdraw a release so it is no longer promoted; what is live stays live.
193
+ *
194
+ * CLI: `eigenpal releases withdraw <version>` · Route: `POST /v1/projects/{id}/releases/{version}/withdraw`
195
+ */
196
+ withdraw(version, options = {}) {
197
+ return this.core.request('projects.releases.withdraw', { path: { version: version }, project: options.project, signal: options.signal }, { project: 'path' });
198
+ }
199
+ /**
200
+ * Restore a withdrawn release.
201
+ *
202
+ * CLI: `eigenpal releases restore <version>` · Route: `POST /v1/projects/{id}/releases/{version}/restore`
203
+ */
204
+ restore(version, options = {}) {
205
+ return this.core.request('projects.releases.restore', { path: { version: version }, project: options.project, signal: options.signal }, { project: 'path' });
206
+ }
207
+ }
208
+ export class DatasetsReviewsResource {
209
+ core;
210
+ constructor(core, impls) {
211
+ this.core = core;
212
+ void impls;
213
+ }
214
+ /**
215
+ * Ask a person to check the ground truth of dataset examples in Studio. The request covers the whole dataset shape; --focus marks only uncertain fields.
216
+ *
217
+ * CLI: `eigenpal datasets reviews create <automation>` · Route: `POST /v1/automations/{id}/dataset-review-requests`
218
+ */
219
+ create(automation, options) {
220
+ return this.core.request('automations.datasetReviewRequests.create', {
221
+ path: { id: automation },
222
+ body: {
223
+ title: options.title,
224
+ instructions: options.instructions,
225
+ focusFields: options.focusFields,
226
+ ignoredFields: options.ignoredFields,
227
+ itemNotes: options.itemNotes,
228
+ exampleNames: options.exampleNames,
229
+ status: options.status,
230
+ },
231
+ signal: options.signal,
232
+ });
233
+ }
234
+ /**
235
+ * List dataset review requests, newest first.
236
+ *
237
+ * CLI: `eigenpal datasets reviews list` · Route: `GET /v1/dataset-review-requests`
238
+ *
239
+ * Answers a page; iterate it (`for await`) for every item.
240
+ */
241
+ list(options = {}) {
242
+ return this.core.page('datasetReviewRequests.list', {
243
+ query: { status: options.status, limit: options.limit, cursor: options.cursor },
244
+ project: options.project,
245
+ signal: options.signal,
246
+ }, { project: 'query', list: { key: 'data', paging: 'cursor' } });
247
+ }
248
+ }
249
+ export class DatasetsResource {
250
+ core;
251
+ reviews;
252
+ constructor(core, impls) {
253
+ this.core = core;
254
+ this.reviews = new impls.DatasetsReviewsResource(core, impls);
255
+ }
256
+ }
257
+ export class ReviewsResource {
258
+ core;
259
+ constructor(core, impls) {
260
+ this.core = core;
261
+ void impls;
262
+ }
263
+ /**
264
+ * Runs that wait for a person to review them, oldest first.
265
+ *
266
+ * CLI: `eigenpal reviews list` · Route: `GET /v1/reviews`
267
+ *
268
+ * Answers a page; iterate it (`for await`) for every item.
269
+ */
270
+ list(options = {}) {
271
+ return this.core.page('humanReviews.list', {
272
+ query: {
273
+ automationId: options.automationId,
274
+ waitingBefore: options.waitingBefore,
275
+ limit: options.limit,
276
+ cursor: options.cursor,
277
+ },
278
+ project: options.project,
279
+ signal: options.signal,
280
+ }, { project: 'query', list: { key: 'data', paging: 'cursor' } });
281
+ }
282
+ /**
283
+ * A review task: what it asks, its fields and its files.
284
+ *
285
+ * CLI: `eigenpal reviews get <task>` · Route: `GET /v1/reviews/{taskId}`
286
+ */
287
+ get(task, options = {}) {
288
+ return this.core.request('humanReviews.get', {
289
+ path: { taskId: task },
290
+ signal: options.signal,
291
+ });
292
+ }
293
+ /**
294
+ * Set one field of a review task. Does not approve it.
295
+ *
296
+ * CLI: `eigenpal reviews set <task> <path> <value>` · Route: `PUT /v1/reviews/{taskId}/fields`
297
+ */
298
+ set(task, path, value, options) {
299
+ return this.core.request('humanReviews.confirmField', {
300
+ path: { taskId: task },
301
+ body: {
302
+ path: path,
303
+ value: value,
304
+ expectedVersion: options.expectedVersion,
305
+ idempotencyKey: options.idempotencyKey,
306
+ confirmed: options.confirmed,
307
+ },
308
+ signal: options.signal,
309
+ });
310
+ }
311
+ /**
312
+ * Approve a review task so its run continues. A human gate: only when you were asked to.
313
+ *
314
+ * CLI: `eigenpal reviews approve <task>` · Route: `POST /v1/reviews/{taskId}/approve`
315
+ */
316
+ approve(task, options) {
317
+ return this.core.request('humanReviews.approve', {
318
+ path: { taskId: task },
319
+ body: { expectedVersion: options.expectedVersion },
320
+ signal: options.signal,
321
+ });
322
+ }
323
+ /**
324
+ * Reject a review task; its run ends as failed.
325
+ *
326
+ * CLI: `eigenpal reviews reject <task>` · Route: `POST /v1/reviews/{taskId}/reject`
327
+ */
328
+ reject(task, options) {
329
+ return this.core.request('humanReviews.reject', {
330
+ path: { taskId: task },
331
+ body: {
332
+ expectedVersion: options.expectedVersion,
333
+ idempotencyKey: options.idempotencyKey,
334
+ reason: options.reason,
335
+ },
336
+ signal: options.signal,
337
+ });
338
+ }
339
+ /**
340
+ * Download a file of a review task.
341
+ *
342
+ * CLI: `eigenpal reviews download <task> <file>` · Route: `GET /v1/reviews/{taskId}/files/{fileId}/content`
343
+ */
344
+ download(task, file, options = {}) {
345
+ return this.core.request('humanReviews.files.content.get', { path: { taskId: task, fileId: file }, signal: options.signal }, { binary: true });
346
+ }
347
+ }
348
+ export class VariablesResource {
349
+ core;
350
+ constructor(core, impls) {
351
+ this.core = core;
352
+ void impls;
353
+ }
354
+ /**
355
+ * The organization's variables and each project's own. Secret values are never shown.
356
+ *
357
+ * CLI: `eigenpal variables list` · Route: `GET /v1/variables`
358
+ *
359
+ * Answers a page; iterate it (`for await`) for every item.
360
+ */
361
+ list(options = {}) {
362
+ return this.core.page('variables.list', { query: { scope: options.scope }, project: options.project, signal: options.signal }, { project: 'query', list: { key: 'data', paging: 'none' } });
363
+ }
364
+ /**
365
+ * Create or replace a variable. A secret value comes from @file or - (stdin), never from the command line, and is never printed.
366
+ *
367
+ * CLI: `eigenpal variables set <NAME> [value|@file|-]` · Route: `PUT /v1/variables/{name}`
368
+ */
369
+ set(name, options) {
370
+ return this.core.request('variables.set', {
371
+ path: { name: name },
372
+ body: {
373
+ value: options.value,
374
+ secret: options.secret,
375
+ type: options.type,
376
+ description: options.description,
377
+ },
378
+ project: options.project,
379
+ signal: options.signal,
380
+ }, { project: 'body' });
381
+ }
382
+ /**
383
+ * Delete a variable.
384
+ *
385
+ * CLI: `eigenpal variables delete <NAME>` · Route: `DELETE /v1/variables/{name}`
386
+ */
387
+ delete(name, options = {}) {
388
+ return this.core.request('variables.delete', { path: { name: name }, project: options.project, signal: options.signal }, { project: 'query' });
389
+ }
390
+ }
391
+ export class ProjectsResource {
392
+ core;
393
+ constructor(core, impls) {
394
+ this.core = core;
395
+ void impls;
396
+ }
397
+ /**
398
+ * The projects you can open.
399
+ *
400
+ * CLI: `eigenpal projects list` · Route: `GET /v1/projects`
401
+ *
402
+ * Answers a page; iterate it (`for await`) for every item.
403
+ */
404
+ list(options = {}) {
405
+ return this.core.page('projects.list', { query: { archived: options.archived }, signal: options.signal }, { list: { key: 'data', paging: 'none' } });
406
+ }
407
+ }
408
+ export class ModelsResource {
409
+ core;
410
+ constructor(core, impls) {
411
+ this.core = core;
412
+ void impls;
413
+ }
414
+ /**
415
+ * The models this server offers, with their capabilities.
416
+ *
417
+ * CLI: `eigenpal models list` · Route: `GET /v1/models`
418
+ *
419
+ * Answers a page; iterate it (`for await`) for every item.
420
+ */
421
+ list(options = {}) {
422
+ return this.core.page('models.list', { query: { capability: options.capability }, signal: options.signal }, { list: { key: 'data', paging: 'none' } });
423
+ }
424
+ }
425
+ export class TemplatesResource {
426
+ core;
427
+ constructor(core, impls) {
428
+ this.core = core;
429
+ void impls;
430
+ }
431
+ /**
432
+ * The document templates (DOCX, XLSX) of the organization.
433
+ *
434
+ * CLI: `eigenpal templates list` · Route: `GET /v1/templates`
435
+ *
436
+ * Answers a page; iterate it (`for await`) for every item.
437
+ */
438
+ list(options = {}) {
439
+ return this.core.page('templates.list', { query: { limit: options.limit, cursor: options.cursor }, signal: options.signal }, { list: { key: 'data', paging: 'cursor' } });
440
+ }
441
+ /**
442
+ * A template: its name, format, fields and where it is used.
443
+ *
444
+ * CLI: `eigenpal templates get <template>` · Route: `GET /v1/templates/{id}`
445
+ */
446
+ get(template, options = {}) {
447
+ return this.core.request('templates.get', {
448
+ path: { id: template },
449
+ signal: options.signal,
450
+ });
451
+ }
452
+ /**
453
+ * Download a template file.
454
+ *
455
+ * CLI: `eigenpal templates download <template>` · Route: `GET /v1/templates/{id}/content`
456
+ */
457
+ download(template, options = {}) {
458
+ return this.core.request('templates.content.get', { path: { id: template }, query: { revisionId: options.revisionId }, signal: options.signal }, { binary: true });
459
+ }
460
+ /**
461
+ * Delete a template.
462
+ *
463
+ * CLI: `eigenpal templates delete <template>` · Route: `DELETE /v1/templates/{id}`
464
+ */
465
+ delete(template, options = {}) {
466
+ return this.core.request('templates.delete', {
467
+ path: { id: template },
468
+ signal: options.signal,
469
+ });
470
+ }
471
+ }
472
+ export class EmailServersResource {
473
+ core;
474
+ constructor(core, impls) {
475
+ this.core = core;
476
+ void impls;
477
+ }
478
+ /**
479
+ * The email servers automations can read from and send through.
480
+ *
481
+ * CLI: `eigenpal email-servers list` · Route: `GET /v1/email-servers`
482
+ *
483
+ * Answers a page; iterate it (`for await`) for every item.
484
+ */
485
+ list(options = {}) {
486
+ return this.core.page('emailServers.list', { query: { limit: options.limit, cursor: options.cursor }, signal: options.signal }, { list: { key: 'data', paging: 'cursor' } });
487
+ }
488
+ /**
489
+ * An email server and its settings, without secrets.
490
+ *
491
+ * CLI: `eigenpal email-servers get <server>` · Route: `GET /v1/email-servers/{id}`
492
+ */
493
+ get(server, options = {}) {
494
+ return this.core.request('emailServers.get', {
495
+ path: { id: server },
496
+ signal: options.signal,
497
+ });
498
+ }
499
+ /**
500
+ * Send a test message through an email server to check that it works.
501
+ *
502
+ * CLI: `eigenpal email-servers test <server>` · Route: `POST /v1/email-servers/{id}/test`
503
+ */
504
+ test(server, options) {
505
+ return this.core.request('emailServers.test', {
506
+ path: { id: server },
507
+ body: { to: options.to },
508
+ signal: options.signal,
509
+ });
510
+ }
511
+ /**
512
+ * Delete an email server.
513
+ *
514
+ * CLI: `eigenpal email-servers delete <server>` · Route: `DELETE /v1/email-servers/{id}`
515
+ */
516
+ delete(server, options = {}) {
517
+ return this.core.request('emailServers.delete', {
518
+ path: { id: server },
519
+ signal: options.signal,
520
+ });
521
+ }
522
+ }
523
+ export class RoutesResource {
524
+ core;
525
+ constructor(core, impls) {
526
+ this.core = core;
527
+ void impls;
528
+ }
529
+ /**
530
+ * Promotion routes: where projects live in each environment.
531
+ *
532
+ * CLI: `eigenpal routes list` · Route: `GET /v1/promotion/routes`
533
+ *
534
+ * Answers a page; iterate it (`for await`) for every item.
535
+ */
536
+ list(options = {}) {
537
+ return this.core.page('promotion.routes.list', { signal: options.signal }, { list: { key: 'data', paging: 'none' } });
538
+ }
539
+ /**
540
+ * A route: the repository, branch and folder of each environment.
541
+ *
542
+ * CLI: `eigenpal routes get <route>` · Route: `GET /v1/promotion/routes/{name}`
543
+ */
544
+ get(route, options = {}) {
545
+ return this.core.request('promotion.routes.get', {
546
+ path: { name: route },
547
+ signal: options.signal,
548
+ });
549
+ }
550
+ /**
551
+ * Create or replace a route from one JSON document.
552
+ *
553
+ * CLI: `eigenpal routes set <name>` · Route: `PUT /v1/promotion/routes/{name}`
554
+ */
555
+ set(name, options) {
556
+ return this.core.request('promotion.routes.put', {
557
+ path: { name: name },
558
+ query: { dryRun: options.dryRun },
559
+ body: { environments: options.environments },
560
+ signal: options.signal,
561
+ });
562
+ }
563
+ /**
564
+ * Delete a route added in the app.
565
+ *
566
+ * CLI: `eigenpal routes delete <route>` · Route: `DELETE /v1/promotion/routes/{name}`
567
+ */
568
+ delete(route, options = {}) {
569
+ return this.core.request('promotion.routes.delete', {
570
+ path: { name: route },
571
+ query: { dryRun: options.dryRun },
572
+ signal: options.signal,
573
+ });
574
+ }
575
+ }
576
+ export class FilesResource {
577
+ core;
578
+ constructor(core, impls) {
579
+ this.core = core;
580
+ void impls;
581
+ }
582
+ /**
583
+ * Get file metadata
584
+ *
585
+ * Reads an uploaded file record (size, type, expiry).
586
+ *
587
+ * Route: `GET /v1/files/{id}`
588
+ */
589
+ get(file, options = {}) {
590
+ return this.core.request('files.get', { path: { id: file }, signal: options.signal });
591
+ }
592
+ /**
593
+ * Download file content
594
+ *
595
+ * Reads the bytes of an uploaded file.
596
+ *
597
+ * Route: `GET /v1/files/{id}/content`
598
+ */
599
+ download(file, options = {}) {
600
+ return this.core.request('files.content.get', { path: { id: file }, signal: options.signal }, { binary: true });
601
+ }
602
+ /**
603
+ * Delete file
604
+ *
605
+ * Removes an uploaded file before it expires.
606
+ *
607
+ * Route: `DELETE /v1/files/{id}`
608
+ */
609
+ delete(file, options = {}) {
610
+ return this.core.request('files.delete', {
611
+ path: { id: file },
612
+ signal: options.signal,
613
+ });
614
+ }
615
+ }
616
+ export class EigenPalClientBase {
617
+ core;
618
+ automations;
619
+ runs;
620
+ experiments;
621
+ releases;
622
+ datasets;
623
+ reviews;
624
+ variables;
625
+ projects;
626
+ models;
627
+ templates;
628
+ emailServers;
629
+ routes;
630
+ files;
631
+ constructor(core, impls) {
632
+ this.core = core;
633
+ this.automations = new AutomationsResource(core, impls);
634
+ this.runs = new impls.RunsResource(core, impls);
635
+ this.experiments = new impls.ExperimentsResource(core, impls);
636
+ this.releases = new ReleasesResource(core, impls);
637
+ this.datasets = new DatasetsResource(core, impls);
638
+ this.reviews = new ReviewsResource(core, impls);
639
+ this.variables = new VariablesResource(core, impls);
640
+ this.projects = new ProjectsResource(core, impls);
641
+ this.models = new ModelsResource(core, impls);
642
+ this.templates = new impls.TemplatesResource(core, impls);
643
+ this.emailServers = new impls.EmailServersResource(core, impls);
644
+ this.routes = new RoutesResource(core, impls);
645
+ this.files = new impls.FilesResource(core, impls);
646
+ }
647
+ /**
648
+ * Who and where you are, what differs from live, and each environment.
649
+ *
650
+ * CLI: `eigenpal status` · Route: `GET /v1/projects/{id}/status`
651
+ */
652
+ status(options = {}) {
653
+ return this.core.request('projects.status', {
654
+ query: { environments: options.environments },
655
+ project: options.project,
656
+ signal: options.signal,
657
+ }, { project: 'path' });
658
+ }
659
+ }