cyberdesk 1.9.0 → 1.11.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.
- package/dist/client/sdk.gen.d.ts +25 -2
- package/dist/client/sdk.gen.js +44 -3
- package/dist/client/types.gen.d.ts +93 -1
- package/dist/index.d.ts +347 -2
- package/dist/index.js +359 -3
- package/package.json +1 -1
package/dist/client/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { HealthCheckV1HealthGetData, DatabaseHealthCheckV1HealthDbGetData, ListMachinesV1MachinesGetData, CreateMachineV1MachinesPostData, DeleteMachineV1MachinesMachineIdDeleteData, GetMachineV1MachinesMachineIdGetData, UpdateMachineV1MachinesMachineIdPatchData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, ListRunAttachmentsV1RunAttachmentsGetData, CreateRunAttachmentV1RunAttachmentsPostData, DeleteRunAttachmentV1RunAttachmentsAttachmentIdDeleteData, GetRunAttachmentV1RunAttachmentsAttachmentIdGetData, UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutData, DownloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGetData, ListConnectionsV1ConnectionsGetData, CreateConnectionV1ConnectionsPostData, DeleteConnectionV1ConnectionsConnectionIdDeleteData, GetConnectionV1ConnectionsConnectionIdGetData, UpdateConnectionV1ConnectionsConnectionIdPatchData, ListRequestLogsV1RequestLogsGetData, CreateRequestLogV1RequestLogsPostData, DeleteRequestLogV1RequestLogsLogIdDeleteData, GetRequestLogV1RequestLogsLogIdGetData, UpdateRequestLogV1RequestLogsLogIdPatchData, ListTrajectoriesV1TrajectoriesGetData, CreateTrajectoryV1TrajectoriesPostData, DeleteTrajectoryV1TrajectoriesTrajectoryIdDeleteData, GetTrajectoryV1TrajectoriesTrajectoryIdGetData, UpdateTrajectoryV1TrajectoriesTrajectoryIdPatchData, GetLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGetData, GetScreenshotV1ComputerMachineIdDisplayScreenshotGetData, GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetData, KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostData, KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, DummyTestEndpointV1TestPostData, RootGetData } from './types.gen';
|
|
2
|
+
import type { HealthCheckV1HealthGetData, DatabaseHealthCheckV1HealthDbGetData, ListMachinesV1MachinesGetData, CreateMachineV1MachinesPostData, DeleteMachineV1MachinesMachineIdDeleteData, GetMachineV1MachinesMachineIdGetData, UpdateMachineV1MachinesMachineIdPatchData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, BulkCreateRunsV1RunsBulkPostData, ListRunAttachmentsV1RunAttachmentsGetData, CreateRunAttachmentV1RunAttachmentsPostData, DeleteRunAttachmentV1RunAttachmentsAttachmentIdDeleteData, GetRunAttachmentV1RunAttachmentsAttachmentIdGetData, UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutData, GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetData, DownloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGetData, ListConnectionsV1ConnectionsGetData, CreateConnectionV1ConnectionsPostData, DeleteConnectionV1ConnectionsConnectionIdDeleteData, GetConnectionV1ConnectionsConnectionIdGetData, UpdateConnectionV1ConnectionsConnectionIdPatchData, ListRequestLogsV1RequestLogsGetData, CreateRequestLogV1RequestLogsPostData, DeleteRequestLogV1RequestLogsLogIdDeleteData, GetRequestLogV1RequestLogsLogIdGetData, UpdateRequestLogV1RequestLogsLogIdPatchData, ListTrajectoriesV1TrajectoriesGetData, CreateTrajectoryV1TrajectoriesPostData, DeleteTrajectoryV1TrajectoriesTrajectoryIdDeleteData, GetTrajectoryV1TrajectoriesTrajectoryIdGetData, UpdateTrajectoryV1TrajectoriesTrajectoryIdPatchData, GetLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGetData, GetScreenshotV1ComputerMachineIdDisplayScreenshotGetData, GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetData, KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostData, KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, DummyTestEndpointV1TestPostData, RootGetData } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -157,6 +157,18 @@ export declare const getRunV1RunsRunIdGet: <ThrowOnError extends boolean = false
|
|
|
157
157
|
* The run must belong to the authenticated user.
|
|
158
158
|
*/
|
|
159
159
|
export declare const updateRunV1RunsRunIdPatch: <ThrowOnError extends boolean = false>(options: Options<UpdateRunV1RunsRunIdPatchData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").RunResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
160
|
+
/**
|
|
161
|
+
* Bulk Create Runs
|
|
162
|
+
* Create multiple runs with the same configuration.
|
|
163
|
+
*
|
|
164
|
+
* This endpoint creates multiple runs efficiently:
|
|
165
|
+
* - All runs are created in a single database transaction
|
|
166
|
+
* - Temporal workflows are started asynchronously
|
|
167
|
+
* - Returns immediately with created run details
|
|
168
|
+
*
|
|
169
|
+
* Maximum 1000 runs can be created in a single request.
|
|
170
|
+
*/
|
|
171
|
+
export declare const bulkCreateRunsV1RunsBulkPost: <ThrowOnError extends boolean = false>(options: Options<BulkCreateRunsV1RunsBulkPostData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").RunBulkCreateResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
160
172
|
/**
|
|
161
173
|
* List Run Attachments
|
|
162
174
|
* List all run attachments for the authenticated user.
|
|
@@ -193,11 +205,22 @@ export declare const getRunAttachmentV1RunAttachmentsAttachmentIdGet: <ThrowOnEr
|
|
|
193
205
|
* Currently only supports updating the expiration date.
|
|
194
206
|
*/
|
|
195
207
|
export declare const updateRunAttachmentV1RunAttachmentsAttachmentIdPut: <ThrowOnError extends boolean = false>(options: Options<UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").RunAttachmentResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
208
|
+
/**
|
|
209
|
+
* Get Run Attachment Download Url
|
|
210
|
+
* Get a signed download URL for a run attachment file.
|
|
211
|
+
*
|
|
212
|
+
* Returns a signed URL that triggers automatic download when accessed.
|
|
213
|
+
*
|
|
214
|
+
* Args:
|
|
215
|
+
* attachment_id: The ID of the attachment to download
|
|
216
|
+
* expires_in: URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
|
|
217
|
+
*/
|
|
218
|
+
export declare const getRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGet: <ThrowOnError extends boolean = false>(options: Options<GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").RunAttachmentDownloadUrlResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
196
219
|
/**
|
|
197
220
|
* Download Run Attachment
|
|
198
221
|
* Download a run attachment file.
|
|
199
222
|
*
|
|
200
|
-
* Returns the file content as a streaming response.
|
|
223
|
+
* Returns the raw file content as a streaming response.
|
|
201
224
|
*/
|
|
202
225
|
export declare const downloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGet: <ThrowOnError extends boolean = false>(options: Options<DownloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
203
226
|
/**
|
package/dist/client/sdk.gen.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.rootGet = exports.dummyTestEndpointV1TestPost = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = void 0;
|
|
4
|
+
exports.fsListV1ComputerMachineIdFsListGet = exports.mouseClickV1ComputerMachineIdInputMouseClickPost = exports.mouseMoveV1ComputerMachineIdInputMouseMovePost = exports.getMousePositionV1ComputerMachineIdInputMousePositionGet = exports.keyboardKeyV1ComputerMachineIdInputKeyboardKeyPost = exports.keyboardTypeV1ComputerMachineIdInputKeyboardTypePost = exports.getDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGet = exports.getScreenshotV1ComputerMachineIdDisplayScreenshotGet = exports.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet = exports.updateTrajectoryV1TrajectoriesTrajectoryIdPatch = exports.getTrajectoryV1TrajectoriesTrajectoryIdGet = exports.deleteTrajectoryV1TrajectoriesTrajectoryIdDelete = exports.createTrajectoryV1TrajectoriesPost = exports.listTrajectoriesV1TrajectoriesGet = exports.updateRequestLogV1RequestLogsLogIdPatch = exports.getRequestLogV1RequestLogsLogIdGet = exports.deleteRequestLogV1RequestLogsLogIdDelete = exports.createRequestLogV1RequestLogsPost = exports.listRequestLogsV1RequestLogsGet = exports.updateConnectionV1ConnectionsConnectionIdPatch = exports.getConnectionV1ConnectionsConnectionIdGet = exports.deleteConnectionV1ConnectionsConnectionIdDelete = exports.createConnectionV1ConnectionsPost = exports.listConnectionsV1ConnectionsGet = exports.downloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGet = exports.getRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGet = exports.updateRunAttachmentV1RunAttachmentsAttachmentIdPut = exports.getRunAttachmentV1RunAttachmentsAttachmentIdGet = exports.deleteRunAttachmentV1RunAttachmentsAttachmentIdDelete = exports.createRunAttachmentV1RunAttachmentsPost = exports.listRunAttachmentsV1RunAttachmentsGet = exports.bulkCreateRunsV1RunsBulkPost = exports.updateRunV1RunsRunIdPatch = exports.getRunV1RunsRunIdGet = exports.deleteRunV1RunsRunIdDelete = exports.createRunV1RunsPost = exports.listRunsV1RunsGet = exports.getWorkflowVersionsV1WorkflowsWorkflowIdVersionsGet = exports.updateWorkflowV1WorkflowsWorkflowIdPatch = exports.getWorkflowV1WorkflowsWorkflowIdGet = exports.deleteWorkflowV1WorkflowsWorkflowIdDelete = exports.createWorkflowV1WorkflowsPost = exports.listWorkflowsV1WorkflowsGet = exports.updateMachineV1MachinesMachineIdPatch = exports.getMachineV1MachinesMachineIdGet = exports.deleteMachineV1MachinesMachineIdDelete = exports.createMachineV1MachinesPost = exports.listMachinesV1MachinesGet = exports.databaseHealthCheckV1HealthDbGet = exports.healthCheckV1HealthGet = void 0;
|
|
5
|
+
exports.rootGet = exports.dummyTestEndpointV1TestPost = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = exports.fsWriteV1ComputerMachineIdFsWritePost = exports.fsReadV1ComputerMachineIdFsReadGet = void 0;
|
|
6
6
|
const client_gen_1 = require("./client.gen");
|
|
7
7
|
/**
|
|
8
8
|
* Health Check
|
|
@@ -294,6 +294,27 @@ const updateRunV1RunsRunIdPatch = (options) => {
|
|
|
294
294
|
], url: '/v1/runs/{run_id}' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
|
|
295
295
|
};
|
|
296
296
|
exports.updateRunV1RunsRunIdPatch = updateRunV1RunsRunIdPatch;
|
|
297
|
+
/**
|
|
298
|
+
* Bulk Create Runs
|
|
299
|
+
* Create multiple runs with the same configuration.
|
|
300
|
+
*
|
|
301
|
+
* This endpoint creates multiple runs efficiently:
|
|
302
|
+
* - All runs are created in a single database transaction
|
|
303
|
+
* - Temporal workflows are started asynchronously
|
|
304
|
+
* - Returns immediately with created run details
|
|
305
|
+
*
|
|
306
|
+
* Maximum 1000 runs can be created in a single request.
|
|
307
|
+
*/
|
|
308
|
+
const bulkCreateRunsV1RunsBulkPost = (options) => {
|
|
309
|
+
var _a;
|
|
310
|
+
return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).post(Object.assign(Object.assign({ security: [
|
|
311
|
+
{
|
|
312
|
+
scheme: 'bearer',
|
|
313
|
+
type: 'http'
|
|
314
|
+
}
|
|
315
|
+
], url: '/v1/runs/bulk' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
|
|
316
|
+
};
|
|
317
|
+
exports.bulkCreateRunsV1RunsBulkPost = bulkCreateRunsV1RunsBulkPost;
|
|
297
318
|
/**
|
|
298
319
|
* List Run Attachments
|
|
299
320
|
* List all run attachments for the authenticated user.
|
|
@@ -375,11 +396,31 @@ const updateRunAttachmentV1RunAttachmentsAttachmentIdPut = (options) => {
|
|
|
375
396
|
], url: '/v1/run-attachments/{attachment_id}' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
|
|
376
397
|
};
|
|
377
398
|
exports.updateRunAttachmentV1RunAttachmentsAttachmentIdPut = updateRunAttachmentV1RunAttachmentsAttachmentIdPut;
|
|
399
|
+
/**
|
|
400
|
+
* Get Run Attachment Download Url
|
|
401
|
+
* Get a signed download URL for a run attachment file.
|
|
402
|
+
*
|
|
403
|
+
* Returns a signed URL that triggers automatic download when accessed.
|
|
404
|
+
*
|
|
405
|
+
* Args:
|
|
406
|
+
* attachment_id: The ID of the attachment to download
|
|
407
|
+
* expires_in: URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
|
|
408
|
+
*/
|
|
409
|
+
const getRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGet = (options) => {
|
|
410
|
+
var _a;
|
|
411
|
+
return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).get(Object.assign({ security: [
|
|
412
|
+
{
|
|
413
|
+
scheme: 'bearer',
|
|
414
|
+
type: 'http'
|
|
415
|
+
}
|
|
416
|
+
], url: '/v1/run-attachments/{attachment_id}/download-url' }, options));
|
|
417
|
+
};
|
|
418
|
+
exports.getRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGet = getRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGet;
|
|
378
419
|
/**
|
|
379
420
|
* Download Run Attachment
|
|
380
421
|
* Download a run attachment file.
|
|
381
422
|
*
|
|
382
|
-
* Returns the file content as a streaming response.
|
|
423
|
+
* Returns the raw file content as a streaming response.
|
|
383
424
|
*/
|
|
384
425
|
const downloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGet = (options) => {
|
|
385
426
|
var _a;
|
|
@@ -256,6 +256,19 @@ export type RunAttachmentCreate = {
|
|
|
256
256
|
cleanup_imports_after_run?: boolean;
|
|
257
257
|
expires_at?: string | null;
|
|
258
258
|
};
|
|
259
|
+
/**
|
|
260
|
+
* Response schema for run attachment download URL
|
|
261
|
+
*/
|
|
262
|
+
export type RunAttachmentDownloadUrlResponse = {
|
|
263
|
+
/**
|
|
264
|
+
* Signed URL for downloading the attachment
|
|
265
|
+
*/
|
|
266
|
+
url: string;
|
|
267
|
+
/**
|
|
268
|
+
* Seconds until the URL expires
|
|
269
|
+
*/
|
|
270
|
+
expires_in: number;
|
|
271
|
+
};
|
|
259
272
|
/**
|
|
260
273
|
* Run attachment response schema
|
|
261
274
|
*/
|
|
@@ -279,6 +292,38 @@ export type RunAttachmentResponse = {
|
|
|
279
292
|
export type RunAttachmentUpdate = {
|
|
280
293
|
expires_at?: string | null;
|
|
281
294
|
};
|
|
295
|
+
/**
|
|
296
|
+
* Schema for bulk creating runs
|
|
297
|
+
*/
|
|
298
|
+
export type RunBulkCreate = {
|
|
299
|
+
workflow_id: string;
|
|
300
|
+
/**
|
|
301
|
+
* Machine ID. If not provided, an available machine will be automatically selected.
|
|
302
|
+
*/
|
|
303
|
+
machine_id?: string | null;
|
|
304
|
+
/**
|
|
305
|
+
* Input values for workflow variables
|
|
306
|
+
*/
|
|
307
|
+
input_values?: {
|
|
308
|
+
[key: string]: unknown;
|
|
309
|
+
} | null;
|
|
310
|
+
/**
|
|
311
|
+
* Files to upload to the machine
|
|
312
|
+
*/
|
|
313
|
+
file_inputs?: Array<FileInput> | null;
|
|
314
|
+
/**
|
|
315
|
+
* Number of runs to create (max 1000)
|
|
316
|
+
*/
|
|
317
|
+
count: number;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Response for bulk run creation
|
|
321
|
+
*/
|
|
322
|
+
export type RunBulkCreateResponse = {
|
|
323
|
+
created_runs: Array<RunResponse>;
|
|
324
|
+
failed_count?: number;
|
|
325
|
+
errors?: Array<string>;
|
|
326
|
+
};
|
|
282
327
|
/**
|
|
283
328
|
* Schema for creating a run
|
|
284
329
|
*/
|
|
@@ -849,6 +894,26 @@ export type UpdateRunV1RunsRunIdPatchResponses = {
|
|
|
849
894
|
200: RunResponse;
|
|
850
895
|
};
|
|
851
896
|
export type UpdateRunV1RunsRunIdPatchResponse = UpdateRunV1RunsRunIdPatchResponses[keyof UpdateRunV1RunsRunIdPatchResponses];
|
|
897
|
+
export type BulkCreateRunsV1RunsBulkPostData = {
|
|
898
|
+
body: RunBulkCreate;
|
|
899
|
+
path?: never;
|
|
900
|
+
query?: never;
|
|
901
|
+
url: '/v1/runs/bulk';
|
|
902
|
+
};
|
|
903
|
+
export type BulkCreateRunsV1RunsBulkPostErrors = {
|
|
904
|
+
/**
|
|
905
|
+
* Validation Error
|
|
906
|
+
*/
|
|
907
|
+
422: HttpValidationError;
|
|
908
|
+
};
|
|
909
|
+
export type BulkCreateRunsV1RunsBulkPostError = BulkCreateRunsV1RunsBulkPostErrors[keyof BulkCreateRunsV1RunsBulkPostErrors];
|
|
910
|
+
export type BulkCreateRunsV1RunsBulkPostResponses = {
|
|
911
|
+
/**
|
|
912
|
+
* Successful Response
|
|
913
|
+
*/
|
|
914
|
+
201: RunBulkCreateResponse;
|
|
915
|
+
};
|
|
916
|
+
export type BulkCreateRunsV1RunsBulkPostResponse = BulkCreateRunsV1RunsBulkPostResponses[keyof BulkCreateRunsV1RunsBulkPostResponses];
|
|
852
917
|
export type ListRunAttachmentsV1RunAttachmentsGetData = {
|
|
853
918
|
body?: never;
|
|
854
919
|
path?: never;
|
|
@@ -966,6 +1031,33 @@ export type UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutResponses = {
|
|
|
966
1031
|
200: RunAttachmentResponse;
|
|
967
1032
|
};
|
|
968
1033
|
export type UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutResponse = UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutResponses[keyof UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutResponses];
|
|
1034
|
+
export type GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetData = {
|
|
1035
|
+
body?: never;
|
|
1036
|
+
path: {
|
|
1037
|
+
attachment_id: string;
|
|
1038
|
+
};
|
|
1039
|
+
query?: {
|
|
1040
|
+
/**
|
|
1041
|
+
* URL expiration time in seconds (10-3600)
|
|
1042
|
+
*/
|
|
1043
|
+
expires_in?: number;
|
|
1044
|
+
};
|
|
1045
|
+
url: '/v1/run-attachments/{attachment_id}/download-url';
|
|
1046
|
+
};
|
|
1047
|
+
export type GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetErrors = {
|
|
1048
|
+
/**
|
|
1049
|
+
* Validation Error
|
|
1050
|
+
*/
|
|
1051
|
+
422: HttpValidationError;
|
|
1052
|
+
};
|
|
1053
|
+
export type GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetError = GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetErrors[keyof GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetErrors];
|
|
1054
|
+
export type GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetResponses = {
|
|
1055
|
+
/**
|
|
1056
|
+
* Successful Response
|
|
1057
|
+
*/
|
|
1058
|
+
200: RunAttachmentDownloadUrlResponse;
|
|
1059
|
+
};
|
|
1060
|
+
export type GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetResponse = GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetResponses[keyof GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetResponses];
|
|
969
1061
|
export type DownloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGetData = {
|
|
970
1062
|
body?: never;
|
|
971
1063
|
path: {
|
|
@@ -1665,5 +1757,5 @@ export type RootGetResponses = {
|
|
|
1665
1757
|
200: unknown;
|
|
1666
1758
|
};
|
|
1667
1759
|
export type ClientOptions = {
|
|
1668
|
-
baseUrl: 'https://api.cyberdesk.io' | (string & {});
|
|
1760
|
+
baseUrl: 'https://api.cyberdesk.io' | 'https://cyberdesk-api-dev.fly.dev' | (string & {});
|
|
1669
1761
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Cyberdesk TypeScript SDK
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive SDK for interacting with the Cyberdesk Cloud API.
|
|
5
|
+
* Provides typed methods for managing machines, workflows, runs, and more.
|
|
6
|
+
*
|
|
7
|
+
* @module cyberdesk
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { createCyberdeskClient } from 'cyberdesk';
|
|
11
|
+
*
|
|
12
|
+
* const client = createCyberdeskClient('your-api-key');
|
|
13
|
+
*
|
|
14
|
+
* // List machines
|
|
15
|
+
* const { data: machines } = await client.machines.list();
|
|
16
|
+
*
|
|
17
|
+
* // Create and run a workflow
|
|
18
|
+
* const { data: workflow } = await client.workflows.create({
|
|
19
|
+
* name: 'My Workflow',
|
|
20
|
+
* main_prompt: 'Perform this task...'
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* const { data: run } = await client.runs.create({
|
|
24
|
+
* workflow_id: workflow.id
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
import { type MachineResponse, type WorkflowResponse, type RunResponse, type ConnectionResponse, type TrajectoryResponse, type PaginatedResponseMachineResponse, type PaginatedResponseWorkflowResponse, type PaginatedResponseRunResponse, type PaginatedResponseConnectionResponse, type PaginatedResponseTrajectoryResponse, type MachineStatus, type RunStatus, type ConnectionStatus, type MachineCreate, type WorkflowCreate, type RunCreate, type RunBulkCreate, type RunBulkCreateResponse, type FileInput, type ConnectionCreate, type TrajectoryCreate, type MachineUpdate, type WorkflowUpdate, type RunUpdate, type TrajectoryUpdate, type RunAttachmentCreate, type RunAttachmentUpdate, type RunAttachmentResponse, type RunAttachmentDownloadUrlResponse, type AttachmentType, type PaginatedResponseRunAttachmentResponse } from './client/types.gen';
|
|
2
29
|
export * from './client/types.gen';
|
|
3
30
|
export * from './client/sdk.gen';
|
|
4
31
|
export * from './client/client.gen';
|
|
32
|
+
/**
|
|
33
|
+
* Create a Cyberdesk API client
|
|
34
|
+
*
|
|
35
|
+
* @param apiKey - Your Cyberdesk API key
|
|
36
|
+
* @param baseUrl - Optional API base URL (defaults to https://api.cyberdesk.io)
|
|
37
|
+
* @returns Configured client with all API endpoints
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const client = createCyberdeskClient('your-api-key');
|
|
42
|
+
* const machines = await client.machines.list();
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
5
45
|
export declare function createCyberdeskClient(apiKey: string, baseUrl?: string): {
|
|
6
46
|
machines: {
|
|
47
|
+
/**
|
|
48
|
+
* List machines with optional filtering
|
|
49
|
+
*
|
|
50
|
+
* @param params - Optional query parameters
|
|
51
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
52
|
+
* @param params.limit - Maximum number of items to return
|
|
53
|
+
* @param params.status - Filter by machine status
|
|
54
|
+
* @returns Paginated list of machines
|
|
55
|
+
*/
|
|
7
56
|
list: (params?: {
|
|
8
57
|
skip?: number;
|
|
9
58
|
limit?: number;
|
|
@@ -12,18 +61,42 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
12
61
|
data?: PaginatedResponseMachineResponse;
|
|
13
62
|
error?: any;
|
|
14
63
|
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a new machine
|
|
66
|
+
*
|
|
67
|
+
* @param data - Machine configuration
|
|
68
|
+
* @returns Created machine details
|
|
69
|
+
*/
|
|
15
70
|
create: (data: MachineCreate) => Promise<{
|
|
16
71
|
data?: MachineResponse;
|
|
17
72
|
error?: any;
|
|
18
73
|
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Get a specific machine by ID
|
|
76
|
+
*
|
|
77
|
+
* @param machineId - The ID of the machine
|
|
78
|
+
* @returns Machine details
|
|
79
|
+
*/
|
|
19
80
|
get: (machineId: string) => Promise<{
|
|
20
81
|
data?: MachineResponse;
|
|
21
82
|
error?: any;
|
|
22
83
|
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Update a machine
|
|
86
|
+
*
|
|
87
|
+
* @param machineId - The ID of the machine to update
|
|
88
|
+
* @param data - Update data (name, status, availability, etc.)
|
|
89
|
+
* @returns Updated machine details
|
|
90
|
+
*/
|
|
23
91
|
update: (machineId: string, data: MachineUpdate) => Promise<{
|
|
24
92
|
data?: MachineResponse;
|
|
25
93
|
error?: any;
|
|
26
94
|
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Delete a machine
|
|
97
|
+
*
|
|
98
|
+
* @param machineId - The ID of the machine to delete
|
|
99
|
+
*/
|
|
27
100
|
delete: (machineId: string) => Promise<({
|
|
28
101
|
data: undefined;
|
|
29
102
|
error: import("./client/types.gen").HttpValidationError;
|
|
@@ -36,6 +109,14 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
36
109
|
}>;
|
|
37
110
|
};
|
|
38
111
|
workflows: {
|
|
112
|
+
/**
|
|
113
|
+
* List workflows
|
|
114
|
+
*
|
|
115
|
+
* @param params - Optional query parameters
|
|
116
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
117
|
+
* @param params.limit - Maximum number of items to return
|
|
118
|
+
* @returns Paginated list of workflows
|
|
119
|
+
*/
|
|
39
120
|
list: (params?: {
|
|
40
121
|
skip?: number;
|
|
41
122
|
limit?: number;
|
|
@@ -43,18 +124,51 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
43
124
|
data?: PaginatedResponseWorkflowResponse;
|
|
44
125
|
error?: any;
|
|
45
126
|
}>;
|
|
127
|
+
/**
|
|
128
|
+
* Create a new workflow
|
|
129
|
+
*
|
|
130
|
+
* @param data - Workflow configuration including name and main prompt
|
|
131
|
+
* @returns Created workflow details
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* const workflow = await client.workflows.create({
|
|
136
|
+
* name: 'My Workflow',
|
|
137
|
+
* main_prompt: 'Perform this task...',
|
|
138
|
+
* includes_file_exports: true
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
46
142
|
create: (data: WorkflowCreate) => Promise<{
|
|
47
143
|
data?: WorkflowResponse;
|
|
48
144
|
error?: any;
|
|
49
145
|
}>;
|
|
146
|
+
/**
|
|
147
|
+
* Get a specific workflow by ID
|
|
148
|
+
*
|
|
149
|
+
* @param workflowId - The ID of the workflow
|
|
150
|
+
* @returns Workflow details
|
|
151
|
+
*/
|
|
50
152
|
get: (workflowId: string) => Promise<{
|
|
51
153
|
data?: WorkflowResponse;
|
|
52
154
|
error?: any;
|
|
53
155
|
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Update a workflow
|
|
158
|
+
*
|
|
159
|
+
* @param workflowId - The ID of the workflow to update
|
|
160
|
+
* @param data - Update data (name, main_prompt, output_schema, etc.)
|
|
161
|
+
* @returns Updated workflow details
|
|
162
|
+
*/
|
|
54
163
|
update: (workflowId: string, data: WorkflowUpdate) => Promise<{
|
|
55
164
|
data?: WorkflowResponse;
|
|
56
165
|
error?: any;
|
|
57
166
|
}>;
|
|
167
|
+
/**
|
|
168
|
+
* Delete a workflow
|
|
169
|
+
*
|
|
170
|
+
* @param workflowId - The ID of the workflow to delete
|
|
171
|
+
*/
|
|
58
172
|
delete: (workflowId: string) => Promise<({
|
|
59
173
|
data: undefined;
|
|
60
174
|
error: import("./client/types.gen").HttpValidationError;
|
|
@@ -67,6 +181,17 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
67
181
|
}>;
|
|
68
182
|
};
|
|
69
183
|
runs: {
|
|
184
|
+
/**
|
|
185
|
+
* List runs with optional filtering
|
|
186
|
+
*
|
|
187
|
+
* @param params - Optional query parameters
|
|
188
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
189
|
+
* @param params.limit - Maximum number of items to return
|
|
190
|
+
* @param params.status - Filter by run status (scheduling, running, success, cancelled, error)
|
|
191
|
+
* @param params.workflow_id - Filter by workflow ID
|
|
192
|
+
* @param params.machine_id - Filter by machine ID
|
|
193
|
+
* @returns Paginated list of runs
|
|
194
|
+
*/
|
|
70
195
|
list: (params?: {
|
|
71
196
|
skip?: number;
|
|
72
197
|
limit?: number;
|
|
@@ -77,18 +202,100 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
77
202
|
data?: PaginatedResponseRunResponse;
|
|
78
203
|
error?: any;
|
|
79
204
|
}>;
|
|
205
|
+
/**
|
|
206
|
+
* Create a new run
|
|
207
|
+
*
|
|
208
|
+
* @param data - Run configuration
|
|
209
|
+
* @param data.workflow_id - The workflow to run
|
|
210
|
+
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
211
|
+
* @param data.input_values - Optional input values for workflow variables
|
|
212
|
+
* @param data.file_inputs - Optional files to upload to the machine
|
|
213
|
+
* @returns Created run details
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const run = await client.runs.create({
|
|
218
|
+
* workflow_id: 'workflow-id',
|
|
219
|
+
* input_values: { prompt: 'Hello' },
|
|
220
|
+
* file_inputs: [{
|
|
221
|
+
* filename: 'data.txt',
|
|
222
|
+
* content: 'base64-encoded-content',
|
|
223
|
+
* target_path: '~/CyberdeskTransfers/',
|
|
224
|
+
* cleanup_imports_after_run: true
|
|
225
|
+
* }]
|
|
226
|
+
* });
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
80
229
|
create: (data: RunCreate) => Promise<{
|
|
81
230
|
data?: RunResponse;
|
|
82
231
|
error?: any;
|
|
83
232
|
}>;
|
|
233
|
+
/**
|
|
234
|
+
* Create multiple runs with the same configuration
|
|
235
|
+
*
|
|
236
|
+
* This method efficiently creates multiple runs in bulk:
|
|
237
|
+
* - All runs are created in a single database transaction
|
|
238
|
+
* - Temporal workflows are started asynchronously
|
|
239
|
+
* - Returns immediately with created run details
|
|
240
|
+
*
|
|
241
|
+
* @param data - Bulk run configuration
|
|
242
|
+
* @param data.count - Number of runs to create (1-1000)
|
|
243
|
+
* @param data.workflow_id - The workflow to run
|
|
244
|
+
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
245
|
+
* @param data.input_values - Optional input values for workflow variables
|
|
246
|
+
* @param data.file_inputs - Optional files to upload to the machine
|
|
247
|
+
* @returns Details about created runs and any failures
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* const result = await client.runs.bulkCreate({
|
|
252
|
+
* count: 100,
|
|
253
|
+
* workflow_id: 'workflow-id',
|
|
254
|
+
* input_values: { prompt: 'Bulk task' },
|
|
255
|
+
* file_inputs: [{
|
|
256
|
+
* filename: 'data.txt',
|
|
257
|
+
* content: 'base64-encoded-content',
|
|
258
|
+
* target_path: '~/CyberdeskTransfers/',
|
|
259
|
+
* cleanup_imports_after_run: true
|
|
260
|
+
* }]
|
|
261
|
+
* });
|
|
262
|
+
*
|
|
263
|
+
* if (result.data) {
|
|
264
|
+
* console.log(`Created ${result.data.created_runs.length} runs`);
|
|
265
|
+
* console.log(`Failed: ${result.data.failed_count}`);
|
|
266
|
+
* }
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
bulkCreate: (data: RunBulkCreate) => Promise<{
|
|
270
|
+
data?: RunBulkCreateResponse;
|
|
271
|
+
error?: any;
|
|
272
|
+
}>;
|
|
273
|
+
/**
|
|
274
|
+
* Get a specific run by ID
|
|
275
|
+
*
|
|
276
|
+
* @param runId - The ID of the run
|
|
277
|
+
* @returns Run details including status, output, and attachments
|
|
278
|
+
*/
|
|
84
279
|
get: (runId: string) => Promise<{
|
|
85
280
|
data?: RunResponse;
|
|
86
281
|
error?: any;
|
|
87
282
|
}>;
|
|
283
|
+
/**
|
|
284
|
+
* Update a run
|
|
285
|
+
*
|
|
286
|
+
* @param runId - The ID of the run to update
|
|
287
|
+
* @param data - Update data (status, output_data, error messages, etc.)
|
|
288
|
+
* @returns Updated run details
|
|
289
|
+
*/
|
|
88
290
|
update: (runId: string, data: RunUpdate) => Promise<{
|
|
89
291
|
data?: RunResponse;
|
|
90
292
|
error?: any;
|
|
91
293
|
}>;
|
|
294
|
+
/**
|
|
295
|
+
* Delete a run
|
|
296
|
+
*
|
|
297
|
+
* @param runId - The ID of the run to delete
|
|
298
|
+
*/
|
|
92
299
|
delete: (runId: string) => Promise<({
|
|
93
300
|
data: undefined;
|
|
94
301
|
error: import("./client/types.gen").HttpValidationError;
|
|
@@ -101,6 +308,16 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
101
308
|
}>;
|
|
102
309
|
};
|
|
103
310
|
connections: {
|
|
311
|
+
/**
|
|
312
|
+
* List connections with optional filtering
|
|
313
|
+
*
|
|
314
|
+
* @param params - Optional query parameters
|
|
315
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
316
|
+
* @param params.limit - Maximum number of items to return
|
|
317
|
+
* @param params.machine_id - Filter by machine ID
|
|
318
|
+
* @param params.status - Filter by connection status
|
|
319
|
+
* @returns Paginated list of connections
|
|
320
|
+
*/
|
|
104
321
|
list: (params?: {
|
|
105
322
|
skip?: number;
|
|
106
323
|
limit?: number;
|
|
@@ -110,12 +327,27 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
110
327
|
data?: PaginatedResponseConnectionResponse;
|
|
111
328
|
error?: any;
|
|
112
329
|
}>;
|
|
330
|
+
/**
|
|
331
|
+
* Create a new connection
|
|
332
|
+
*
|
|
333
|
+
* @param data - Connection data including machine ID and websocket info
|
|
334
|
+
* @returns Created connection details
|
|
335
|
+
*/
|
|
113
336
|
create: (data: ConnectionCreate) => Promise<{
|
|
114
337
|
data?: ConnectionResponse;
|
|
115
338
|
error?: any;
|
|
116
339
|
}>;
|
|
117
340
|
};
|
|
118
341
|
trajectories: {
|
|
342
|
+
/**
|
|
343
|
+
* List trajectories with optional filtering
|
|
344
|
+
*
|
|
345
|
+
* @param params - Optional query parameters
|
|
346
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
347
|
+
* @param params.limit - Maximum number of items to return
|
|
348
|
+
* @param params.workflow_id - Filter by workflow ID
|
|
349
|
+
* @returns Paginated list of trajectories
|
|
350
|
+
*/
|
|
119
351
|
list: (params?: {
|
|
120
352
|
skip?: number;
|
|
121
353
|
limit?: number;
|
|
@@ -124,18 +356,48 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
124
356
|
data?: PaginatedResponseTrajectoryResponse;
|
|
125
357
|
error?: any;
|
|
126
358
|
}>;
|
|
359
|
+
/**
|
|
360
|
+
* Create a new trajectory
|
|
361
|
+
*
|
|
362
|
+
* A trajectory represents a recorded sequence of actions for a workflow.
|
|
363
|
+
*
|
|
364
|
+
* @param data - Trajectory data
|
|
365
|
+
* @param data.workflow_id - The workflow this trajectory belongs to
|
|
366
|
+
* @param data.trajectory_data - Array of recorded actions
|
|
367
|
+
* @param data.dimensions - Display dimensions when trajectory was recorded
|
|
368
|
+
* @param data.original_input_values - Input values used during recording
|
|
369
|
+
* @returns Created trajectory details
|
|
370
|
+
*/
|
|
127
371
|
create: (data: TrajectoryCreate) => Promise<{
|
|
128
372
|
data?: TrajectoryResponse;
|
|
129
373
|
error?: any;
|
|
130
374
|
}>;
|
|
375
|
+
/**
|
|
376
|
+
* Get a specific trajectory by ID
|
|
377
|
+
*
|
|
378
|
+
* @param trajectoryId - The ID of the trajectory
|
|
379
|
+
* @returns Trajectory details including recorded actions
|
|
380
|
+
*/
|
|
131
381
|
get: (trajectoryId: string) => Promise<{
|
|
132
382
|
data?: TrajectoryResponse;
|
|
133
383
|
error?: any;
|
|
134
384
|
}>;
|
|
385
|
+
/**
|
|
386
|
+
* Update a trajectory
|
|
387
|
+
*
|
|
388
|
+
* @param trajectoryId - The ID of the trajectory to update
|
|
389
|
+
* @param data - Update data (trajectory_data)
|
|
390
|
+
* @returns Updated trajectory details
|
|
391
|
+
*/
|
|
135
392
|
update: (trajectoryId: string, data: TrajectoryUpdate) => Promise<{
|
|
136
393
|
data?: TrajectoryResponse;
|
|
137
394
|
error?: any;
|
|
138
395
|
}>;
|
|
396
|
+
/**
|
|
397
|
+
* Delete a trajectory
|
|
398
|
+
*
|
|
399
|
+
* @param trajectoryId - The ID of the trajectory to delete
|
|
400
|
+
*/
|
|
139
401
|
delete: (trajectoryId: string) => Promise<({
|
|
140
402
|
data: undefined;
|
|
141
403
|
error: import("./client/types.gen").HttpValidationError;
|
|
@@ -146,12 +408,31 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
146
408
|
request: Request;
|
|
147
409
|
response: Response;
|
|
148
410
|
}>;
|
|
411
|
+
/**
|
|
412
|
+
* Get the latest trajectory for a workflow
|
|
413
|
+
*
|
|
414
|
+
* Returns the most recently created trajectory for the specified workflow.
|
|
415
|
+
* Useful for replaying the latest recorded actions.
|
|
416
|
+
*
|
|
417
|
+
* @param workflowId - The ID of the workflow
|
|
418
|
+
* @returns Latest trajectory for the workflow, or null if none exists
|
|
419
|
+
*/
|
|
149
420
|
getLatestForWorkflow: (workflowId: string) => Promise<{
|
|
150
421
|
data?: TrajectoryResponse;
|
|
151
422
|
error?: any;
|
|
152
423
|
}>;
|
|
153
424
|
};
|
|
154
425
|
run_attachments: {
|
|
426
|
+
/**
|
|
427
|
+
* List run attachments with optional filtering
|
|
428
|
+
*
|
|
429
|
+
* @param params - Optional query parameters
|
|
430
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
431
|
+
* @param params.limit - Maximum number of items to return
|
|
432
|
+
* @param params.run_id - Filter by run ID
|
|
433
|
+
* @param params.attachment_type - Filter by attachment type (input/output)
|
|
434
|
+
* @returns Paginated list of run attachments
|
|
435
|
+
*/
|
|
155
436
|
list: (params?: {
|
|
156
437
|
skip?: number;
|
|
157
438
|
limit?: number;
|
|
@@ -161,22 +442,86 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
161
442
|
data?: PaginatedResponseRunAttachmentResponse;
|
|
162
443
|
error?: any;
|
|
163
444
|
}>;
|
|
445
|
+
/**
|
|
446
|
+
* Create a new run attachment
|
|
447
|
+
*
|
|
448
|
+
* @param data - Attachment data including file content as base64
|
|
449
|
+
* @returns Created attachment details
|
|
450
|
+
*/
|
|
164
451
|
create: (data: RunAttachmentCreate) => Promise<{
|
|
165
452
|
data?: RunAttachmentResponse;
|
|
166
453
|
error?: any;
|
|
167
454
|
}>;
|
|
455
|
+
/**
|
|
456
|
+
* Get run attachment details
|
|
457
|
+
*
|
|
458
|
+
* @param attachmentId - The ID of the attachment
|
|
459
|
+
* @returns Attachment metadata
|
|
460
|
+
*/
|
|
168
461
|
get: (attachmentId: string) => Promise<{
|
|
169
462
|
data?: RunAttachmentResponse;
|
|
170
463
|
error?: any;
|
|
171
464
|
}>;
|
|
465
|
+
/**
|
|
466
|
+
* Get a signed download URL for a run attachment
|
|
467
|
+
*
|
|
468
|
+
* The returned URL will trigger an automatic download when accessed in a browser.
|
|
469
|
+
*
|
|
470
|
+
* @param attachmentId - The ID of the attachment
|
|
471
|
+
* @param expiresIn - URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
|
|
472
|
+
* @returns Object containing the signed URL and expiration time
|
|
473
|
+
*
|
|
474
|
+
* @example
|
|
475
|
+
* ```typescript
|
|
476
|
+
* const { data } = await client.run_attachments.getDownloadUrl('attachment-id', 600);
|
|
477
|
+
* if (data) {
|
|
478
|
+
* console.log(`Download URL: ${data.url}`);
|
|
479
|
+
* console.log(`Expires in: ${data.expires_in} seconds`);
|
|
480
|
+
* }
|
|
481
|
+
* ```
|
|
482
|
+
*/
|
|
483
|
+
getDownloadUrl: (attachmentId: string, expiresIn?: number) => Promise<{
|
|
484
|
+
data?: RunAttachmentDownloadUrlResponse;
|
|
485
|
+
error?: any;
|
|
486
|
+
}>;
|
|
487
|
+
/**
|
|
488
|
+
* Download a run attachment file directly
|
|
489
|
+
*
|
|
490
|
+
* This method returns the raw file content. For a download URL instead,
|
|
491
|
+
* use `getDownloadUrl()`.
|
|
492
|
+
*
|
|
493
|
+
* @param attachmentId - The ID of the attachment to download
|
|
494
|
+
* @returns Raw file data
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```typescript
|
|
498
|
+
* const { data } = await client.run_attachments.download('attachment-id');
|
|
499
|
+
* if (data) {
|
|
500
|
+
* // Handle raw file bytes
|
|
501
|
+
* const blob = new Blob([data]);
|
|
502
|
+
* }
|
|
503
|
+
* ```
|
|
504
|
+
*/
|
|
172
505
|
download: (attachmentId: string) => Promise<{
|
|
173
506
|
data?: any;
|
|
174
507
|
error?: any;
|
|
175
508
|
}>;
|
|
509
|
+
/**
|
|
510
|
+
* Update a run attachment (e.g., set expiration)
|
|
511
|
+
*
|
|
512
|
+
* @param attachmentId - The ID of the attachment to update
|
|
513
|
+
* @param data - Update data
|
|
514
|
+
* @returns Updated attachment details
|
|
515
|
+
*/
|
|
176
516
|
update: (attachmentId: string, data: RunAttachmentUpdate) => Promise<{
|
|
177
517
|
data?: RunAttachmentResponse;
|
|
178
518
|
error?: any;
|
|
179
519
|
}>;
|
|
520
|
+
/**
|
|
521
|
+
* Delete a run attachment
|
|
522
|
+
*
|
|
523
|
+
* @param attachmentId - The ID of the attachment to delete
|
|
524
|
+
*/
|
|
180
525
|
delete: (attachmentId: string) => Promise<({
|
|
181
526
|
data: undefined;
|
|
182
527
|
error: import("./client/types.gen").HttpValidationError;
|
|
@@ -189,4 +534,4 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
189
534
|
}>;
|
|
190
535
|
};
|
|
191
536
|
};
|
|
192
|
-
export type { MachineResponse, WorkflowResponse, RunResponse, ConnectionResponse, TrajectoryResponse, RunAttachmentResponse, FileInput, AttachmentType, PaginatedResponseMachineResponse, PaginatedResponseWorkflowResponse, PaginatedResponseRunResponse, PaginatedResponseConnectionResponse, PaginatedResponseTrajectoryResponse, PaginatedResponseRunAttachmentResponse, };
|
|
537
|
+
export type { MachineResponse, WorkflowResponse, RunResponse, RunBulkCreate, RunBulkCreateResponse, ConnectionResponse, TrajectoryResponse, RunAttachmentResponse, RunAttachmentDownloadUrlResponse, FileInput, AttachmentType, PaginatedResponseMachineResponse, PaginatedResponseWorkflowResponse, PaginatedResponseRunResponse, PaginatedResponseConnectionResponse, PaginatedResponseTrajectoryResponse, PaginatedResponseRunAttachmentResponse, };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Cyberdesk TypeScript SDK
|
|
4
|
+
*
|
|
5
|
+
* A comprehensive SDK for interacting with the Cyberdesk Cloud API.
|
|
6
|
+
* Provides typed methods for managing machines, workflows, runs, and more.
|
|
7
|
+
*
|
|
8
|
+
* @module cyberdesk
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { createCyberdeskClient } from 'cyberdesk';
|
|
12
|
+
*
|
|
13
|
+
* const client = createCyberdeskClient('your-api-key');
|
|
14
|
+
*
|
|
15
|
+
* // List machines
|
|
16
|
+
* const { data: machines } = await client.machines.list();
|
|
17
|
+
*
|
|
18
|
+
* // Create and run a workflow
|
|
19
|
+
* const { data: workflow } = await client.workflows.create({
|
|
20
|
+
* name: 'My Workflow',
|
|
21
|
+
* main_prompt: 'Perform this task...'
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const { data: run } = await client.runs.create({
|
|
25
|
+
* workflow_id: workflow.id
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
2
29
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
30
|
if (k2 === undefined) k2 = k;
|
|
4
31
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -32,8 +59,16 @@ __exportStar(require("./client/types.gen"), exports);
|
|
|
32
59
|
__exportStar(require("./client/sdk.gen"), exports);
|
|
33
60
|
__exportStar(require("./client/client.gen"), exports);
|
|
34
61
|
// Configuration
|
|
62
|
+
/** Default API base URL for Cyberdesk Cloud API */
|
|
35
63
|
const DEFAULT_API_BASE_URL = "https://api.cyberdesk.io";
|
|
36
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Create a configured HTTP client with authentication
|
|
66
|
+
*
|
|
67
|
+
* @internal
|
|
68
|
+
* @param apiKey - Your Cyberdesk API key
|
|
69
|
+
* @param baseUrl - API base URL
|
|
70
|
+
* @returns Configured HTTP client
|
|
71
|
+
*/
|
|
37
72
|
function createApiClient(apiKey, baseUrl = DEFAULT_API_BASE_URL) {
|
|
38
73
|
return (0, client_fetch_1.createClient)({
|
|
39
74
|
baseUrl,
|
|
@@ -44,30 +79,70 @@ function createApiClient(apiKey, baseUrl = DEFAULT_API_BASE_URL) {
|
|
|
44
79
|
},
|
|
45
80
|
});
|
|
46
81
|
}
|
|
47
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Create a Cyberdesk API client
|
|
84
|
+
*
|
|
85
|
+
* @param apiKey - Your Cyberdesk API key
|
|
86
|
+
* @param baseUrl - Optional API base URL (defaults to https://api.cyberdesk.io)
|
|
87
|
+
* @returns Configured client with all API endpoints
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const client = createCyberdeskClient('your-api-key');
|
|
92
|
+
* const machines = await client.machines.list();
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
48
95
|
function createCyberdeskClient(apiKey, baseUrl) {
|
|
49
96
|
const client = createApiClient(apiKey, baseUrl);
|
|
50
97
|
return {
|
|
51
98
|
// Machine endpoints
|
|
52
99
|
machines: {
|
|
100
|
+
/**
|
|
101
|
+
* List machines with optional filtering
|
|
102
|
+
*
|
|
103
|
+
* @param params - Optional query parameters
|
|
104
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
105
|
+
* @param params.limit - Maximum number of items to return
|
|
106
|
+
* @param params.status - Filter by machine status
|
|
107
|
+
* @returns Paginated list of machines
|
|
108
|
+
*/
|
|
53
109
|
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
54
110
|
return (0, sdk_gen_1.listMachinesV1MachinesGet)({
|
|
55
111
|
client,
|
|
56
112
|
query: params,
|
|
57
113
|
});
|
|
58
114
|
}),
|
|
115
|
+
/**
|
|
116
|
+
* Create a new machine
|
|
117
|
+
*
|
|
118
|
+
* @param data - Machine configuration
|
|
119
|
+
* @returns Created machine details
|
|
120
|
+
*/
|
|
59
121
|
create: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
60
122
|
return (0, sdk_gen_1.createMachineV1MachinesPost)({
|
|
61
123
|
client,
|
|
62
124
|
body: data,
|
|
63
125
|
});
|
|
64
126
|
}),
|
|
127
|
+
/**
|
|
128
|
+
* Get a specific machine by ID
|
|
129
|
+
*
|
|
130
|
+
* @param machineId - The ID of the machine
|
|
131
|
+
* @returns Machine details
|
|
132
|
+
*/
|
|
65
133
|
get: (machineId) => __awaiter(this, void 0, void 0, function* () {
|
|
66
134
|
return (0, sdk_gen_1.getMachineV1MachinesMachineIdGet)({
|
|
67
135
|
client,
|
|
68
136
|
path: { machine_id: machineId },
|
|
69
137
|
});
|
|
70
138
|
}),
|
|
139
|
+
/**
|
|
140
|
+
* Update a machine
|
|
141
|
+
*
|
|
142
|
+
* @param machineId - The ID of the machine to update
|
|
143
|
+
* @param data - Update data (name, status, availability, etc.)
|
|
144
|
+
* @returns Updated machine details
|
|
145
|
+
*/
|
|
71
146
|
update: (machineId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
72
147
|
return (0, sdk_gen_1.updateMachineV1MachinesMachineIdPatch)({
|
|
73
148
|
client,
|
|
@@ -75,6 +150,11 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
75
150
|
body: data,
|
|
76
151
|
});
|
|
77
152
|
}),
|
|
153
|
+
/**
|
|
154
|
+
* Delete a machine
|
|
155
|
+
*
|
|
156
|
+
* @param machineId - The ID of the machine to delete
|
|
157
|
+
*/
|
|
78
158
|
delete: (machineId) => __awaiter(this, void 0, void 0, function* () {
|
|
79
159
|
return (0, sdk_gen_1.deleteMachineV1MachinesMachineIdDelete)({
|
|
80
160
|
client,
|
|
@@ -84,24 +164,60 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
84
164
|
},
|
|
85
165
|
// Workflow endpoints
|
|
86
166
|
workflows: {
|
|
167
|
+
/**
|
|
168
|
+
* List workflows
|
|
169
|
+
*
|
|
170
|
+
* @param params - Optional query parameters
|
|
171
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
172
|
+
* @param params.limit - Maximum number of items to return
|
|
173
|
+
* @returns Paginated list of workflows
|
|
174
|
+
*/
|
|
87
175
|
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
88
176
|
return (0, sdk_gen_1.listWorkflowsV1WorkflowsGet)({
|
|
89
177
|
client,
|
|
90
178
|
query: params,
|
|
91
179
|
});
|
|
92
180
|
}),
|
|
181
|
+
/**
|
|
182
|
+
* Create a new workflow
|
|
183
|
+
*
|
|
184
|
+
* @param data - Workflow configuration including name and main prompt
|
|
185
|
+
* @returns Created workflow details
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* const workflow = await client.workflows.create({
|
|
190
|
+
* name: 'My Workflow',
|
|
191
|
+
* main_prompt: 'Perform this task...',
|
|
192
|
+
* includes_file_exports: true
|
|
193
|
+
* });
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
93
196
|
create: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
94
197
|
return (0, sdk_gen_1.createWorkflowV1WorkflowsPost)({
|
|
95
198
|
client,
|
|
96
199
|
body: data,
|
|
97
200
|
});
|
|
98
201
|
}),
|
|
202
|
+
/**
|
|
203
|
+
* Get a specific workflow by ID
|
|
204
|
+
*
|
|
205
|
+
* @param workflowId - The ID of the workflow
|
|
206
|
+
* @returns Workflow details
|
|
207
|
+
*/
|
|
99
208
|
get: (workflowId) => __awaiter(this, void 0, void 0, function* () {
|
|
100
209
|
return (0, sdk_gen_1.getWorkflowV1WorkflowsWorkflowIdGet)({
|
|
101
210
|
client,
|
|
102
211
|
path: { workflow_id: workflowId },
|
|
103
212
|
});
|
|
104
213
|
}),
|
|
214
|
+
/**
|
|
215
|
+
* Update a workflow
|
|
216
|
+
*
|
|
217
|
+
* @param workflowId - The ID of the workflow to update
|
|
218
|
+
* @param data - Update data (name, main_prompt, output_schema, etc.)
|
|
219
|
+
* @returns Updated workflow details
|
|
220
|
+
*/
|
|
105
221
|
update: (workflowId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
106
222
|
return (0, sdk_gen_1.updateWorkflowV1WorkflowsWorkflowIdPatch)({
|
|
107
223
|
client,
|
|
@@ -109,6 +225,11 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
109
225
|
body: data,
|
|
110
226
|
});
|
|
111
227
|
}),
|
|
228
|
+
/**
|
|
229
|
+
* Delete a workflow
|
|
230
|
+
*
|
|
231
|
+
* @param workflowId - The ID of the workflow to delete
|
|
232
|
+
*/
|
|
112
233
|
delete: (workflowId) => __awaiter(this, void 0, void 0, function* () {
|
|
113
234
|
return (0, sdk_gen_1.deleteWorkflowV1WorkflowsWorkflowIdDelete)({
|
|
114
235
|
client,
|
|
@@ -118,24 +239,114 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
118
239
|
},
|
|
119
240
|
// Run endpoints
|
|
120
241
|
runs: {
|
|
242
|
+
/**
|
|
243
|
+
* List runs with optional filtering
|
|
244
|
+
*
|
|
245
|
+
* @param params - Optional query parameters
|
|
246
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
247
|
+
* @param params.limit - Maximum number of items to return
|
|
248
|
+
* @param params.status - Filter by run status (scheduling, running, success, cancelled, error)
|
|
249
|
+
* @param params.workflow_id - Filter by workflow ID
|
|
250
|
+
* @param params.machine_id - Filter by machine ID
|
|
251
|
+
* @returns Paginated list of runs
|
|
252
|
+
*/
|
|
121
253
|
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
122
254
|
return (0, sdk_gen_1.listRunsV1RunsGet)({
|
|
123
255
|
client,
|
|
124
256
|
query: params,
|
|
125
257
|
});
|
|
126
258
|
}),
|
|
259
|
+
/**
|
|
260
|
+
* Create a new run
|
|
261
|
+
*
|
|
262
|
+
* @param data - Run configuration
|
|
263
|
+
* @param data.workflow_id - The workflow to run
|
|
264
|
+
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
265
|
+
* @param data.input_values - Optional input values for workflow variables
|
|
266
|
+
* @param data.file_inputs - Optional files to upload to the machine
|
|
267
|
+
* @returns Created run details
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```typescript
|
|
271
|
+
* const run = await client.runs.create({
|
|
272
|
+
* workflow_id: 'workflow-id',
|
|
273
|
+
* input_values: { prompt: 'Hello' },
|
|
274
|
+
* file_inputs: [{
|
|
275
|
+
* filename: 'data.txt',
|
|
276
|
+
* content: 'base64-encoded-content',
|
|
277
|
+
* target_path: '~/CyberdeskTransfers/',
|
|
278
|
+
* cleanup_imports_after_run: true
|
|
279
|
+
* }]
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
127
283
|
create: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
128
284
|
return (0, sdk_gen_1.createRunV1RunsPost)({
|
|
129
285
|
client,
|
|
130
286
|
body: data,
|
|
131
287
|
});
|
|
132
288
|
}),
|
|
289
|
+
/**
|
|
290
|
+
* Create multiple runs with the same configuration
|
|
291
|
+
*
|
|
292
|
+
* This method efficiently creates multiple runs in bulk:
|
|
293
|
+
* - All runs are created in a single database transaction
|
|
294
|
+
* - Temporal workflows are started asynchronously
|
|
295
|
+
* - Returns immediately with created run details
|
|
296
|
+
*
|
|
297
|
+
* @param data - Bulk run configuration
|
|
298
|
+
* @param data.count - Number of runs to create (1-1000)
|
|
299
|
+
* @param data.workflow_id - The workflow to run
|
|
300
|
+
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
301
|
+
* @param data.input_values - Optional input values for workflow variables
|
|
302
|
+
* @param data.file_inputs - Optional files to upload to the machine
|
|
303
|
+
* @returns Details about created runs and any failures
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```typescript
|
|
307
|
+
* const result = await client.runs.bulkCreate({
|
|
308
|
+
* count: 100,
|
|
309
|
+
* workflow_id: 'workflow-id',
|
|
310
|
+
* input_values: { prompt: 'Bulk task' },
|
|
311
|
+
* file_inputs: [{
|
|
312
|
+
* filename: 'data.txt',
|
|
313
|
+
* content: 'base64-encoded-content',
|
|
314
|
+
* target_path: '~/CyberdeskTransfers/',
|
|
315
|
+
* cleanup_imports_after_run: true
|
|
316
|
+
* }]
|
|
317
|
+
* });
|
|
318
|
+
*
|
|
319
|
+
* if (result.data) {
|
|
320
|
+
* console.log(`Created ${result.data.created_runs.length} runs`);
|
|
321
|
+
* console.log(`Failed: ${result.data.failed_count}`);
|
|
322
|
+
* }
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
bulkCreate: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
326
|
+
return (0, sdk_gen_1.bulkCreateRunsV1RunsBulkPost)({
|
|
327
|
+
client,
|
|
328
|
+
body: data,
|
|
329
|
+
});
|
|
330
|
+
}),
|
|
331
|
+
/**
|
|
332
|
+
* Get a specific run by ID
|
|
333
|
+
*
|
|
334
|
+
* @param runId - The ID of the run
|
|
335
|
+
* @returns Run details including status, output, and attachments
|
|
336
|
+
*/
|
|
133
337
|
get: (runId) => __awaiter(this, void 0, void 0, function* () {
|
|
134
338
|
return (0, sdk_gen_1.getRunV1RunsRunIdGet)({
|
|
135
339
|
client,
|
|
136
340
|
path: { run_id: runId },
|
|
137
341
|
});
|
|
138
342
|
}),
|
|
343
|
+
/**
|
|
344
|
+
* Update a run
|
|
345
|
+
*
|
|
346
|
+
* @param runId - The ID of the run to update
|
|
347
|
+
* @param data - Update data (status, output_data, error messages, etc.)
|
|
348
|
+
* @returns Updated run details
|
|
349
|
+
*/
|
|
139
350
|
update: (runId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
140
351
|
return (0, sdk_gen_1.updateRunV1RunsRunIdPatch)({
|
|
141
352
|
client,
|
|
@@ -143,6 +354,11 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
143
354
|
body: data,
|
|
144
355
|
});
|
|
145
356
|
}),
|
|
357
|
+
/**
|
|
358
|
+
* Delete a run
|
|
359
|
+
*
|
|
360
|
+
* @param runId - The ID of the run to delete
|
|
361
|
+
*/
|
|
146
362
|
delete: (runId) => __awaiter(this, void 0, void 0, function* () {
|
|
147
363
|
return (0, sdk_gen_1.deleteRunV1RunsRunIdDelete)({
|
|
148
364
|
client,
|
|
@@ -152,12 +368,28 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
152
368
|
},
|
|
153
369
|
// Connection endpoints
|
|
154
370
|
connections: {
|
|
371
|
+
/**
|
|
372
|
+
* List connections with optional filtering
|
|
373
|
+
*
|
|
374
|
+
* @param params - Optional query parameters
|
|
375
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
376
|
+
* @param params.limit - Maximum number of items to return
|
|
377
|
+
* @param params.machine_id - Filter by machine ID
|
|
378
|
+
* @param params.status - Filter by connection status
|
|
379
|
+
* @returns Paginated list of connections
|
|
380
|
+
*/
|
|
155
381
|
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
156
382
|
return (0, sdk_gen_1.listConnectionsV1ConnectionsGet)({
|
|
157
383
|
client,
|
|
158
384
|
query: params,
|
|
159
385
|
});
|
|
160
386
|
}),
|
|
387
|
+
/**
|
|
388
|
+
* Create a new connection
|
|
389
|
+
*
|
|
390
|
+
* @param data - Connection data including machine ID and websocket info
|
|
391
|
+
* @returns Created connection details
|
|
392
|
+
*/
|
|
161
393
|
create: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
162
394
|
return (0, sdk_gen_1.createConnectionV1ConnectionsPost)({
|
|
163
395
|
client,
|
|
@@ -167,24 +399,58 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
167
399
|
},
|
|
168
400
|
// Trajectory endpoints
|
|
169
401
|
trajectories: {
|
|
402
|
+
/**
|
|
403
|
+
* List trajectories with optional filtering
|
|
404
|
+
*
|
|
405
|
+
* @param params - Optional query parameters
|
|
406
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
407
|
+
* @param params.limit - Maximum number of items to return
|
|
408
|
+
* @param params.workflow_id - Filter by workflow ID
|
|
409
|
+
* @returns Paginated list of trajectories
|
|
410
|
+
*/
|
|
170
411
|
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
171
412
|
return (0, sdk_gen_1.listTrajectoriesV1TrajectoriesGet)({
|
|
172
413
|
client,
|
|
173
414
|
query: params,
|
|
174
415
|
});
|
|
175
416
|
}),
|
|
417
|
+
/**
|
|
418
|
+
* Create a new trajectory
|
|
419
|
+
*
|
|
420
|
+
* A trajectory represents a recorded sequence of actions for a workflow.
|
|
421
|
+
*
|
|
422
|
+
* @param data - Trajectory data
|
|
423
|
+
* @param data.workflow_id - The workflow this trajectory belongs to
|
|
424
|
+
* @param data.trajectory_data - Array of recorded actions
|
|
425
|
+
* @param data.dimensions - Display dimensions when trajectory was recorded
|
|
426
|
+
* @param data.original_input_values - Input values used during recording
|
|
427
|
+
* @returns Created trajectory details
|
|
428
|
+
*/
|
|
176
429
|
create: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
177
430
|
return (0, sdk_gen_1.createTrajectoryV1TrajectoriesPost)({
|
|
178
431
|
client,
|
|
179
432
|
body: data,
|
|
180
433
|
});
|
|
181
434
|
}),
|
|
435
|
+
/**
|
|
436
|
+
* Get a specific trajectory by ID
|
|
437
|
+
*
|
|
438
|
+
* @param trajectoryId - The ID of the trajectory
|
|
439
|
+
* @returns Trajectory details including recorded actions
|
|
440
|
+
*/
|
|
182
441
|
get: (trajectoryId) => __awaiter(this, void 0, void 0, function* () {
|
|
183
442
|
return (0, sdk_gen_1.getTrajectoryV1TrajectoriesTrajectoryIdGet)({
|
|
184
443
|
client,
|
|
185
444
|
path: { trajectory_id: trajectoryId },
|
|
186
445
|
});
|
|
187
446
|
}),
|
|
447
|
+
/**
|
|
448
|
+
* Update a trajectory
|
|
449
|
+
*
|
|
450
|
+
* @param trajectoryId - The ID of the trajectory to update
|
|
451
|
+
* @param data - Update data (trajectory_data)
|
|
452
|
+
* @returns Updated trajectory details
|
|
453
|
+
*/
|
|
188
454
|
update: (trajectoryId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
189
455
|
return (0, sdk_gen_1.updateTrajectoryV1TrajectoriesTrajectoryIdPatch)({
|
|
190
456
|
client,
|
|
@@ -192,12 +458,26 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
192
458
|
body: data,
|
|
193
459
|
});
|
|
194
460
|
}),
|
|
461
|
+
/**
|
|
462
|
+
* Delete a trajectory
|
|
463
|
+
*
|
|
464
|
+
* @param trajectoryId - The ID of the trajectory to delete
|
|
465
|
+
*/
|
|
195
466
|
delete: (trajectoryId) => __awaiter(this, void 0, void 0, function* () {
|
|
196
467
|
return (0, sdk_gen_1.deleteTrajectoryV1TrajectoriesTrajectoryIdDelete)({
|
|
197
468
|
client,
|
|
198
469
|
path: { trajectory_id: trajectoryId },
|
|
199
470
|
});
|
|
200
471
|
}),
|
|
472
|
+
/**
|
|
473
|
+
* Get the latest trajectory for a workflow
|
|
474
|
+
*
|
|
475
|
+
* Returns the most recently created trajectory for the specified workflow.
|
|
476
|
+
* Useful for replaying the latest recorded actions.
|
|
477
|
+
*
|
|
478
|
+
* @param workflowId - The ID of the workflow
|
|
479
|
+
* @returns Latest trajectory for the workflow, or null if none exists
|
|
480
|
+
*/
|
|
201
481
|
getLatestForWorkflow: (workflowId) => __awaiter(this, void 0, void 0, function* () {
|
|
202
482
|
return (0, sdk_gen_1.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet)({
|
|
203
483
|
client,
|
|
@@ -207,31 +487,102 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
207
487
|
},
|
|
208
488
|
// Run Attachment endpoints
|
|
209
489
|
run_attachments: {
|
|
490
|
+
/**
|
|
491
|
+
* List run attachments with optional filtering
|
|
492
|
+
*
|
|
493
|
+
* @param params - Optional query parameters
|
|
494
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
495
|
+
* @param params.limit - Maximum number of items to return
|
|
496
|
+
* @param params.run_id - Filter by run ID
|
|
497
|
+
* @param params.attachment_type - Filter by attachment type (input/output)
|
|
498
|
+
* @returns Paginated list of run attachments
|
|
499
|
+
*/
|
|
210
500
|
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
211
501
|
return (0, sdk_gen_1.listRunAttachmentsV1RunAttachmentsGet)({
|
|
212
502
|
client,
|
|
213
503
|
query: params,
|
|
214
504
|
});
|
|
215
505
|
}),
|
|
506
|
+
/**
|
|
507
|
+
* Create a new run attachment
|
|
508
|
+
*
|
|
509
|
+
* @param data - Attachment data including file content as base64
|
|
510
|
+
* @returns Created attachment details
|
|
511
|
+
*/
|
|
216
512
|
create: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
217
513
|
return (0, sdk_gen_1.createRunAttachmentV1RunAttachmentsPost)({
|
|
218
514
|
client,
|
|
219
515
|
body: data,
|
|
220
516
|
});
|
|
221
517
|
}),
|
|
518
|
+
/**
|
|
519
|
+
* Get run attachment details
|
|
520
|
+
*
|
|
521
|
+
* @param attachmentId - The ID of the attachment
|
|
522
|
+
* @returns Attachment metadata
|
|
523
|
+
*/
|
|
222
524
|
get: (attachmentId) => __awaiter(this, void 0, void 0, function* () {
|
|
223
525
|
return (0, sdk_gen_1.getRunAttachmentV1RunAttachmentsAttachmentIdGet)({
|
|
224
526
|
client,
|
|
225
527
|
path: { attachment_id: attachmentId },
|
|
226
528
|
});
|
|
227
529
|
}),
|
|
530
|
+
/**
|
|
531
|
+
* Get a signed download URL for a run attachment
|
|
532
|
+
*
|
|
533
|
+
* The returned URL will trigger an automatic download when accessed in a browser.
|
|
534
|
+
*
|
|
535
|
+
* @param attachmentId - The ID of the attachment
|
|
536
|
+
* @param expiresIn - URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
|
|
537
|
+
* @returns Object containing the signed URL and expiration time
|
|
538
|
+
*
|
|
539
|
+
* @example
|
|
540
|
+
* ```typescript
|
|
541
|
+
* const { data } = await client.run_attachments.getDownloadUrl('attachment-id', 600);
|
|
542
|
+
* if (data) {
|
|
543
|
+
* console.log(`Download URL: ${data.url}`);
|
|
544
|
+
* console.log(`Expires in: ${data.expires_in} seconds`);
|
|
545
|
+
* }
|
|
546
|
+
* ```
|
|
547
|
+
*/
|
|
548
|
+
getDownloadUrl: (attachmentId, expiresIn) => __awaiter(this, void 0, void 0, function* () {
|
|
549
|
+
return (0, sdk_gen_1.getRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGet)({
|
|
550
|
+
client,
|
|
551
|
+
path: { attachment_id: attachmentId },
|
|
552
|
+
query: expiresIn ? { expires_in: expiresIn } : undefined,
|
|
553
|
+
});
|
|
554
|
+
}),
|
|
555
|
+
/**
|
|
556
|
+
* Download a run attachment file directly
|
|
557
|
+
*
|
|
558
|
+
* This method returns the raw file content. For a download URL instead,
|
|
559
|
+
* use `getDownloadUrl()`.
|
|
560
|
+
*
|
|
561
|
+
* @param attachmentId - The ID of the attachment to download
|
|
562
|
+
* @returns Raw file data
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
* ```typescript
|
|
566
|
+
* const { data } = await client.run_attachments.download('attachment-id');
|
|
567
|
+
* if (data) {
|
|
568
|
+
* // Handle raw file bytes
|
|
569
|
+
* const blob = new Blob([data]);
|
|
570
|
+
* }
|
|
571
|
+
* ```
|
|
572
|
+
*/
|
|
228
573
|
download: (attachmentId) => __awaiter(this, void 0, void 0, function* () {
|
|
229
|
-
// Note: This endpoint returns a download URL redirect or file data
|
|
230
574
|
return (0, sdk_gen_1.downloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGet)({
|
|
231
575
|
client,
|
|
232
576
|
path: { attachment_id: attachmentId },
|
|
233
577
|
});
|
|
234
578
|
}),
|
|
579
|
+
/**
|
|
580
|
+
* Update a run attachment (e.g., set expiration)
|
|
581
|
+
*
|
|
582
|
+
* @param attachmentId - The ID of the attachment to update
|
|
583
|
+
* @param data - Update data
|
|
584
|
+
* @returns Updated attachment details
|
|
585
|
+
*/
|
|
235
586
|
update: (attachmentId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
236
587
|
return (0, sdk_gen_1.updateRunAttachmentV1RunAttachmentsAttachmentIdPut)({
|
|
237
588
|
client,
|
|
@@ -239,6 +590,11 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
239
590
|
body: data,
|
|
240
591
|
});
|
|
241
592
|
}),
|
|
593
|
+
/**
|
|
594
|
+
* Delete a run attachment
|
|
595
|
+
*
|
|
596
|
+
* @param attachmentId - The ID of the attachment to delete
|
|
597
|
+
*/
|
|
242
598
|
delete: (attachmentId) => __awaiter(this, void 0, void 0, function* () {
|
|
243
599
|
return (0, sdk_gen_1.deleteRunAttachmentV1RunAttachmentsAttachmentIdDelete)({
|
|
244
600
|
client,
|