cyberdesk 1.0.0 → 1.2.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/README.md CHANGED
@@ -1,105 +1,96 @@
1
- # cyberdesk
1
+ # Cyberdesk TypeScript SDK
2
2
 
3
- [![npm version](https://badge.fury.io/js/cyberdesk.svg)](https://badge.fury.io/js/cyberdesk)
4
-
5
- The official TypeScript SDK for Cyberdesk.
3
+ The official TypeScript SDK for Cyberdesk, providing type-safe access to all Cyberdesk APIs.
6
4
 
7
5
  ## Installation
8
6
 
9
7
  ```bash
10
8
  npm install cyberdesk
11
- # or
12
- yarn add cyberdesk
13
- # or
14
- pnpm add cyberdesk
15
9
  ```
16
10
 
17
- ## Usage
18
-
19
- First, create a Cyberdesk client instance with your API key:
11
+ ## Quick Start
20
12
 
21
13
  ```typescript
22
14
  import { createCyberdeskClient } from 'cyberdesk';
23
15
 
24
- const cyberdesk = createCyberdeskClient({
25
- apiKey: 'YOUR_API_KEY',
26
- // Optionally, you can override the baseUrl or provide a custom fetch implementation
27
- });
28
- ```
29
-
30
- ### Launch a Desktop
16
+ // Initialize client with your API key
17
+ const client = createCyberdeskClient('your-api-key');
31
18
 
32
- ```typescript
33
- const launchResult = await cyberdesk.launchDesktop({
34
- body: { timeout_ms: 10000 } // Optional: set a timeout for the desktop session
19
+ // List machines with full type safety
20
+ const { data } = await client.machines.list({
21
+ status: 'connected', // Typed enum
22
+ limit: 10
35
23
  });
36
24
 
37
- if (launchResult.error) {
38
- throw new Error('Failed to launch desktop: ' + launchResult.error.error);
39
- }
40
-
41
- const desktopId = launchResult.id;
42
- console.log('Launched desktop with ID:', desktopId);
43
- ```
44
-
45
- ### Get Desktop Info
46
-
47
- ```typescript
48
- const info = await cyberdesk.getDesktop({
49
- path: { id: desktopId }
25
+ // Create a workflow
26
+ const workflow = await client.workflows.create({
27
+ main_prompt: "Automate my tasks",
28
+ cleanup_prompt: "Clean up afterwards"
50
29
  });
51
30
 
52
- if ('error' in info) {
53
- throw new Error('Failed to get desktop info: ' + info.error);
54
- }
55
-
56
- console.log('Desktop info:', info);
31
+ // All responses are fully typed!
32
+ console.log(data?.items); // MachineResponse[]
57
33
  ```
58
34
 
59
- ### Perform a Computer Action (e.g., Mouse Click)
35
+ ## Custom Base URL
60
36
 
61
37
  ```typescript
62
- const actionResult = await cyberdesk.executeComputerAction({
63
- path: { id: desktopId },
64
- body: {
65
- type: 'click_mouse',
66
- x: 100,
67
- y: 150
68
- }
69
- });
70
-
71
- if (actionResult.error) {
72
- throw new Error('Action failed: ' + actionResult.error);
73
- }
74
-
75
- console.log('Action result:', actionResult);
38
+ const client = createCyberdeskClient('your-api-key', 'https://your-api.example.com');
76
39
  ```
77
40
 
78
- ### Run a Bash Command
79
-
80
- ```typescript
81
- const bashResult = await cyberdesk.executeBashAction({
82
- path: { id: desktopId },
83
- body: {
84
- command: 'echo Hello, world!'
85
- }
86
- });
87
-
88
- if (bashResult.error) {
89
- throw new Error('Bash command failed: ' + bashResult.error);
90
- }
91
-
92
- console.log('Bash output:', bashResult.output);
93
- ```
41
+ ## Available Methods
42
+
43
+ ### Machines
44
+ - `client.machines.list(params?)` - List machines
45
+ - `client.machines.create(data)` - Create machine
46
+ - `client.machines.get(machineId)` - Get machine
47
+ - `client.machines.update(machineId, data)` - Update machine
48
+ - `client.machines.delete(machineId)` - Delete machine
49
+
50
+ ### Workflows
51
+ - `client.workflows.list(params?)` - List workflows
52
+ - `client.workflows.create(data)` - Create workflow
53
+ - `client.workflows.get(workflowId)` - Get workflow
54
+ - `client.workflows.update(workflowId, data)` - Update workflow
55
+ - `client.workflows.delete(workflowId)` - Delete workflow
56
+
57
+ ### Runs
58
+ - `client.runs.list(params?)` - List runs
59
+ - `client.runs.create(data)` - Create run
60
+ - `client.runs.get(runId)` - Get run
61
+ - `client.runs.update(runId, data)` - Update run
62
+ - `client.runs.delete(runId)` - Delete run
63
+
64
+ ### Trajectories
65
+ - `client.trajectories.list(params?)` - List trajectories
66
+ - `client.trajectories.create(data)` - Create trajectory
67
+ - `client.trajectories.get(trajectoryId)` - Get trajectory
68
+ - `client.trajectories.update(trajectoryId, data)` - Update trajectory
69
+ - `client.trajectories.delete(trajectoryId)` - Delete trajectory
70
+ - `client.trajectories.getLatestForWorkflow(workflowId)` - Get latest trajectory for workflow
71
+
72
+ ### Connections
73
+ - `client.connections.list(params?)` - List connections
74
+ - `client.connections.create(data)` - Create connection
94
75
 
95
76
  ## TypeScript Support
96
77
 
97
- All request parameter types and the `CyberdeskSDK` type are exported for convenience:
78
+ This SDK is built with TypeScript and provides full type safety:
98
79
 
99
80
  ```typescript
100
- import type { LaunchDesktopParams, CyberdeskSDK } from 'cyberdesk';
81
+ import {
82
+ createCyberdeskClient,
83
+ type MachineResponse,
84
+ type WorkflowResponse
85
+ } from 'cyberdesk';
86
+
87
+ const client = createCyberdeskClient('your-api-key');
88
+
89
+ // All parameters and responses are fully typed
90
+ const machines: { data?: PaginatedResponseMachineResponse } =
91
+ await client.machines.list();
101
92
  ```
102
93
 
103
94
  ## License
104
95
 
105
- [MIT](LICENSE)
96
+ MIT
@@ -37,7 +37,7 @@ export declare const databaseHealthCheckV1HealthDbGet: <ThrowOnError extends boo
37
37
  *
38
38
  * Supports pagination and filtering by status.
39
39
  */
40
- export declare const listMachinesV1MachinesGet: <ThrowOnError extends boolean = false>(options?: Options<ListMachinesV1MachinesGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
40
+ export declare const listMachinesV1MachinesGet: <ThrowOnError extends boolean = false>(options?: Options<ListMachinesV1MachinesGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponseMachineResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
41
41
  /**
42
42
  * Create Machine
43
43
  * Create a new machine.
@@ -74,7 +74,7 @@ export declare const updateMachineV1MachinesMachineIdPatch: <ThrowOnError extend
74
74
  *
75
75
  * Supports pagination and returns workflows ordered by updated_at descending.
76
76
  */
77
- export declare const listWorkflowsV1WorkflowsGet: <ThrowOnError extends boolean = false>(options?: Options<ListWorkflowsV1WorkflowsGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
77
+ export declare const listWorkflowsV1WorkflowsGet: <ThrowOnError extends boolean = false>(options?: Options<ListWorkflowsV1WorkflowsGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponseWorkflowResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
78
78
  /**
79
79
  * Create Workflow
80
80
  * Create a new workflow.
@@ -123,7 +123,7 @@ export declare const getWorkflowVersionsV1WorkflowsWorkflowIdVersionsGet: <Throw
123
123
  * Supports pagination and filtering by workflow, machine, and status.
124
124
  * Returns runs with their associated workflow and machine data.
125
125
  */
126
- export declare const listRunsV1RunsGet: <ThrowOnError extends boolean = false>(options?: Options<ListRunsV1RunsGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
126
+ export declare const listRunsV1RunsGet: <ThrowOnError extends boolean = false>(options?: Options<ListRunsV1RunsGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponseRunResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
127
127
  /**
128
128
  * Create Run
129
129
  * Create a new run.
@@ -164,7 +164,7 @@ export declare const updateRunV1RunsRunIdPatch: <ThrowOnError extends boolean =
164
164
  * Supports pagination and filtering by machine and status.
165
165
  * Returns connections with their associated machine data.
166
166
  */
167
- export declare const listConnectionsV1ConnectionsGet: <ThrowOnError extends boolean = false>(options?: Options<ListConnectionsV1ConnectionsGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
167
+ export declare const listConnectionsV1ConnectionsGet: <ThrowOnError extends boolean = false>(options?: Options<ListConnectionsV1ConnectionsGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponseConnectionResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
168
168
  /**
169
169
  * Create Connection
170
170
  * Create a new connection (typically done by the WebSocket handler).
@@ -239,7 +239,7 @@ export declare const updateRequestLogV1RequestLogsLogIdPatch: <ThrowOnError exte
239
239
  * Supports pagination and filtering by workflow.
240
240
  * Returns trajectories with their associated workflow data.
241
241
  */
242
- export declare const listTrajectoriesV1TrajectoriesGet: <ThrowOnError extends boolean = false>(options?: Options<ListTrajectoriesV1TrajectoriesGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
242
+ export declare const listTrajectoriesV1TrajectoriesGet: <ThrowOnError extends boolean = false>(options?: Options<ListTrajectoriesV1TrajectoriesGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").PaginatedResponseTrajectoryResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
243
243
  /**
244
244
  * Create Trajectory
245
245
  * Create a new trajectory for a workflow.
@@ -22,14 +22,6 @@ export type ConnectionResponse = {
22
22
  status: ConnectionStatus;
23
23
  };
24
24
  export type ConnectionStatus = 'connected' | 'disconnected' | 'error';
25
- /**
26
- * Schema for updating a connection
27
- */
28
- export type ConnectionUpdate = {
29
- status?: ConnectionStatus | null;
30
- last_ping?: string | null;
31
- disconnected_at?: string | null;
32
- };
33
25
  export type DisplayDimensions = {
34
26
  width: number;
35
27
  height: number;
@@ -104,6 +96,36 @@ export type PaginatedResponse = {
104
96
  skip: number;
105
97
  limit: number;
106
98
  };
99
+ export type PaginatedResponseConnectionResponse = {
100
+ items: Array<ConnectionResponse>;
101
+ total: number;
102
+ skip: number;
103
+ limit: number;
104
+ };
105
+ export type PaginatedResponseMachineResponse = {
106
+ items: Array<MachineResponse>;
107
+ total: number;
108
+ skip: number;
109
+ limit: number;
110
+ };
111
+ export type PaginatedResponseRunResponse = {
112
+ items: Array<RunResponse>;
113
+ total: number;
114
+ skip: number;
115
+ limit: number;
116
+ };
117
+ export type PaginatedResponseTrajectoryResponse = {
118
+ items: Array<TrajectoryResponse>;
119
+ total: number;
120
+ skip: number;
121
+ limit: number;
122
+ };
123
+ export type PaginatedResponseWorkflowResponse = {
124
+ items: Array<WorkflowResponse>;
125
+ total: number;
126
+ skip: number;
127
+ limit: number;
128
+ };
107
129
  /**
108
130
  * Schema for creating a request log
109
131
  */
@@ -160,7 +182,7 @@ export type RunCreate = {
160
182
  */
161
183
  export type RunResponse = {
162
184
  workflow_id: string;
163
- machine_id: string;
185
+ machine_id: string | null;
164
186
  id: string;
165
187
  user_id: string;
166
188
  status: RunStatus;
@@ -306,7 +328,7 @@ export type ListMachinesV1MachinesGetResponses = {
306
328
  /**
307
329
  * Successful Response
308
330
  */
309
- 200: PaginatedResponse;
331
+ 200: PaginatedResponseMachineResponse;
310
332
  };
311
333
  export type ListMachinesV1MachinesGetResponse = ListMachinesV1MachinesGetResponses[keyof ListMachinesV1MachinesGetResponses];
312
334
  export type CreateMachineV1MachinesPostData = {
@@ -415,7 +437,7 @@ export type ListWorkflowsV1WorkflowsGetResponses = {
415
437
  /**
416
438
  * Successful Response
417
439
  */
418
- 200: PaginatedResponse;
440
+ 200: PaginatedResponseWorkflowResponse;
419
441
  };
420
442
  export type ListWorkflowsV1WorkflowsGetResponse = ListWorkflowsV1WorkflowsGetResponses[keyof ListWorkflowsV1WorkflowsGetResponses];
421
443
  export type CreateWorkflowV1WorkflowsPostData = {
@@ -560,7 +582,7 @@ export type ListRunsV1RunsGetResponses = {
560
582
  /**
561
583
  * Successful Response
562
584
  */
563
- 200: PaginatedResponse;
585
+ 200: PaginatedResponseRunResponse;
564
586
  };
565
587
  export type ListRunsV1RunsGetResponse = ListRunsV1RunsGetResponses[keyof ListRunsV1RunsGetResponses];
566
588
  export type CreateRunV1RunsPostData = {
@@ -677,7 +699,7 @@ export type ListConnectionsV1ConnectionsGetResponses = {
677
699
  /**
678
700
  * Successful Response
679
701
  */
680
- 200: PaginatedResponse;
702
+ 200: PaginatedResponseConnectionResponse;
681
703
  };
682
704
  export type ListConnectionsV1ConnectionsGetResponse = ListConnectionsV1ConnectionsGetResponses[keyof ListConnectionsV1ConnectionsGetResponses];
683
705
  export type CreateConnectionV1ConnectionsPostData = {
@@ -745,7 +767,7 @@ export type GetConnectionV1ConnectionsConnectionIdGetResponses = {
745
767
  };
746
768
  export type GetConnectionV1ConnectionsConnectionIdGetResponse = GetConnectionV1ConnectionsConnectionIdGetResponses[keyof GetConnectionV1ConnectionsConnectionIdGetResponses];
747
769
  export type UpdateConnectionV1ConnectionsConnectionIdPatchData = {
748
- body: ConnectionUpdate;
770
+ body: ConnectionCreate;
749
771
  path: {
750
772
  connection_id: string;
751
773
  };
@@ -911,7 +933,7 @@ export type ListTrajectoriesV1TrajectoriesGetResponses = {
911
933
  /**
912
934
  * Successful Response
913
935
  */
914
- 200: PaginatedResponse;
936
+ 200: PaginatedResponseTrajectoryResponse;
915
937
  };
916
938
  export type ListTrajectoriesV1TrajectoriesGetResponse = ListTrajectoriesV1TrajectoriesGetResponses[keyof ListTrajectoriesV1TrajectoriesGetResponses];
917
939
  export type CreateTrajectoryV1TrajectoriesPostData = {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,155 @@
1
+ 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 ConnectionCreate, type TrajectoryCreate, type MachineUpdate, type WorkflowUpdate, type RunUpdate, type TrajectoryUpdate } from './client/types.gen';
1
2
  export * from './client/types.gen';
2
3
  export * from './client/sdk.gen';
3
4
  export * from './client/client.gen';
5
+ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string): {
6
+ machines: {
7
+ list: (params?: {
8
+ skip?: number;
9
+ limit?: number;
10
+ status?: MachineStatus;
11
+ }) => Promise<{
12
+ data?: PaginatedResponseMachineResponse;
13
+ error?: any;
14
+ }>;
15
+ create: (data: MachineCreate) => Promise<{
16
+ data?: MachineResponse;
17
+ error?: any;
18
+ }>;
19
+ get: (machineId: string) => Promise<{
20
+ data?: MachineResponse;
21
+ error?: any;
22
+ }>;
23
+ update: (machineId: string, data: MachineUpdate) => Promise<{
24
+ data?: MachineResponse;
25
+ error?: any;
26
+ }>;
27
+ delete: (machineId: string) => Promise<({
28
+ data: undefined;
29
+ error: import("./client/types.gen").HttpValidationError;
30
+ } | {
31
+ data: void;
32
+ error: undefined;
33
+ }) & {
34
+ request: Request;
35
+ response: Response;
36
+ }>;
37
+ };
38
+ workflows: {
39
+ list: (params?: {
40
+ skip?: number;
41
+ limit?: number;
42
+ }) => Promise<{
43
+ data?: PaginatedResponseWorkflowResponse;
44
+ error?: any;
45
+ }>;
46
+ create: (data: WorkflowCreate) => Promise<{
47
+ data?: WorkflowResponse;
48
+ error?: any;
49
+ }>;
50
+ get: (workflowId: string) => Promise<{
51
+ data?: WorkflowResponse;
52
+ error?: any;
53
+ }>;
54
+ update: (workflowId: string, data: WorkflowUpdate) => Promise<{
55
+ data?: WorkflowResponse;
56
+ error?: any;
57
+ }>;
58
+ delete: (workflowId: string) => Promise<({
59
+ data: undefined;
60
+ error: import("./client/types.gen").HttpValidationError;
61
+ } | {
62
+ data: void;
63
+ error: undefined;
64
+ }) & {
65
+ request: Request;
66
+ response: Response;
67
+ }>;
68
+ };
69
+ runs: {
70
+ list: (params?: {
71
+ skip?: number;
72
+ limit?: number;
73
+ status?: RunStatus;
74
+ workflow_id?: string;
75
+ machine_id?: string;
76
+ }) => Promise<{
77
+ data?: PaginatedResponseRunResponse;
78
+ error?: any;
79
+ }>;
80
+ create: (data: RunCreate) => Promise<{
81
+ data?: RunResponse;
82
+ error?: any;
83
+ }>;
84
+ get: (runId: string) => Promise<{
85
+ data?: RunResponse;
86
+ error?: any;
87
+ }>;
88
+ update: (runId: string, data: RunUpdate) => Promise<{
89
+ data?: RunResponse;
90
+ error?: any;
91
+ }>;
92
+ delete: (runId: string) => Promise<({
93
+ data: undefined;
94
+ error: import("./client/types.gen").HttpValidationError;
95
+ } | {
96
+ data: void;
97
+ error: undefined;
98
+ }) & {
99
+ request: Request;
100
+ response: Response;
101
+ }>;
102
+ };
103
+ connections: {
104
+ list: (params?: {
105
+ skip?: number;
106
+ limit?: number;
107
+ machine_id?: string;
108
+ status?: ConnectionStatus;
109
+ }) => Promise<{
110
+ data?: PaginatedResponseConnectionResponse;
111
+ error?: any;
112
+ }>;
113
+ create: (data: ConnectionCreate) => Promise<{
114
+ data?: ConnectionResponse;
115
+ error?: any;
116
+ }>;
117
+ };
118
+ trajectories: {
119
+ list: (params?: {
120
+ skip?: number;
121
+ limit?: number;
122
+ workflow_id?: string;
123
+ }) => Promise<{
124
+ data?: PaginatedResponseTrajectoryResponse;
125
+ error?: any;
126
+ }>;
127
+ create: (data: TrajectoryCreate) => Promise<{
128
+ data?: TrajectoryResponse;
129
+ error?: any;
130
+ }>;
131
+ get: (trajectoryId: string) => Promise<{
132
+ data?: TrajectoryResponse;
133
+ error?: any;
134
+ }>;
135
+ update: (trajectoryId: string, data: TrajectoryUpdate) => Promise<{
136
+ data?: TrajectoryResponse;
137
+ error?: any;
138
+ }>;
139
+ delete: (trajectoryId: string) => Promise<({
140
+ data: undefined;
141
+ error: import("./client/types.gen").HttpValidationError;
142
+ } | {
143
+ data: void;
144
+ error: undefined;
145
+ }) & {
146
+ request: Request;
147
+ response: Response;
148
+ }>;
149
+ getLatestForWorkflow: (workflowId: string) => Promise<{
150
+ data?: TrajectoryResponse;
151
+ error?: any;
152
+ }>;
153
+ };
154
+ };
155
+ export type { MachineResponse, WorkflowResponse, RunResponse, ConnectionResponse, TrajectoryResponse, PaginatedResponseMachineResponse, PaginatedResponseWorkflowResponse, PaginatedResponseRunResponse, PaginatedResponseConnectionResponse, PaginatedResponseTrajectoryResponse, };
package/dist/index.js CHANGED
@@ -13,10 +13,197 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
16
25
  Object.defineProperty(exports, "__esModule", { value: true });
17
- // Export all generated types
26
+ exports.createCyberdeskClient = createCyberdeskClient;
27
+ const client_fetch_1 = require("@hey-api/client-fetch");
28
+ // Import SDK methods from sdk.gen
29
+ const sdk_gen_1 = require("./client/sdk.gen");
30
+ // Export all generated types and methods for direct use
18
31
  __exportStar(require("./client/types.gen"), exports);
19
- // Export all generated SDK methods
20
32
  __exportStar(require("./client/sdk.gen"), exports);
21
- // Export the client for manual configuration if needed
22
33
  __exportStar(require("./client/client.gen"), exports);
34
+ // Configuration
35
+ const DEFAULT_API_BASE_URL = "https://api.cyberdesk.io";
36
+ // Create configured client with API key and connection reuse
37
+ function createApiClient(apiKey, baseUrl = DEFAULT_API_BASE_URL) {
38
+ return (0, client_fetch_1.createClient)({
39
+ baseUrl,
40
+ headers: {
41
+ 'Content-Type': 'application/json',
42
+ 'Authorization': `Bearer ${apiKey}`,
43
+ 'Connection': 'keep-alive',
44
+ },
45
+ });
46
+ }
47
+ // Create API client with your API key
48
+ function createCyberdeskClient(apiKey, baseUrl) {
49
+ const client = createApiClient(apiKey, baseUrl);
50
+ return {
51
+ // Machine endpoints
52
+ machines: {
53
+ list: (params) => __awaiter(this, void 0, void 0, function* () {
54
+ return (0, sdk_gen_1.listMachinesV1MachinesGet)({
55
+ client,
56
+ query: params,
57
+ });
58
+ }),
59
+ create: (data) => __awaiter(this, void 0, void 0, function* () {
60
+ return (0, sdk_gen_1.createMachineV1MachinesPost)({
61
+ client,
62
+ body: data,
63
+ });
64
+ }),
65
+ get: (machineId) => __awaiter(this, void 0, void 0, function* () {
66
+ return (0, sdk_gen_1.getMachineV1MachinesMachineIdGet)({
67
+ client,
68
+ path: { machine_id: machineId },
69
+ });
70
+ }),
71
+ update: (machineId, data) => __awaiter(this, void 0, void 0, function* () {
72
+ return (0, sdk_gen_1.updateMachineV1MachinesMachineIdPatch)({
73
+ client,
74
+ path: { machine_id: machineId },
75
+ body: data,
76
+ });
77
+ }),
78
+ delete: (machineId) => __awaiter(this, void 0, void 0, function* () {
79
+ return (0, sdk_gen_1.deleteMachineV1MachinesMachineIdDelete)({
80
+ client,
81
+ path: { machine_id: machineId },
82
+ });
83
+ }),
84
+ },
85
+ // Workflow endpoints
86
+ workflows: {
87
+ list: (params) => __awaiter(this, void 0, void 0, function* () {
88
+ return (0, sdk_gen_1.listWorkflowsV1WorkflowsGet)({
89
+ client,
90
+ query: params,
91
+ });
92
+ }),
93
+ create: (data) => __awaiter(this, void 0, void 0, function* () {
94
+ return (0, sdk_gen_1.createWorkflowV1WorkflowsPost)({
95
+ client,
96
+ body: data,
97
+ });
98
+ }),
99
+ get: (workflowId) => __awaiter(this, void 0, void 0, function* () {
100
+ return (0, sdk_gen_1.getWorkflowV1WorkflowsWorkflowIdGet)({
101
+ client,
102
+ path: { workflow_id: workflowId },
103
+ });
104
+ }),
105
+ update: (workflowId, data) => __awaiter(this, void 0, void 0, function* () {
106
+ return (0, sdk_gen_1.updateWorkflowV1WorkflowsWorkflowIdPatch)({
107
+ client,
108
+ path: { workflow_id: workflowId },
109
+ body: data,
110
+ });
111
+ }),
112
+ delete: (workflowId) => __awaiter(this, void 0, void 0, function* () {
113
+ return (0, sdk_gen_1.deleteWorkflowV1WorkflowsWorkflowIdDelete)({
114
+ client,
115
+ path: { workflow_id: workflowId },
116
+ });
117
+ }),
118
+ },
119
+ // Run endpoints
120
+ runs: {
121
+ list: (params) => __awaiter(this, void 0, void 0, function* () {
122
+ return (0, sdk_gen_1.listRunsV1RunsGet)({
123
+ client,
124
+ query: params,
125
+ });
126
+ }),
127
+ create: (data) => __awaiter(this, void 0, void 0, function* () {
128
+ return (0, sdk_gen_1.createRunV1RunsPost)({
129
+ client,
130
+ body: data,
131
+ });
132
+ }),
133
+ get: (runId) => __awaiter(this, void 0, void 0, function* () {
134
+ return (0, sdk_gen_1.getRunV1RunsRunIdGet)({
135
+ client,
136
+ path: { run_id: runId },
137
+ });
138
+ }),
139
+ update: (runId, data) => __awaiter(this, void 0, void 0, function* () {
140
+ return (0, sdk_gen_1.updateRunV1RunsRunIdPatch)({
141
+ client,
142
+ path: { run_id: runId },
143
+ body: data,
144
+ });
145
+ }),
146
+ delete: (runId) => __awaiter(this, void 0, void 0, function* () {
147
+ return (0, sdk_gen_1.deleteRunV1RunsRunIdDelete)({
148
+ client,
149
+ path: { run_id: runId },
150
+ });
151
+ }),
152
+ },
153
+ // Connection endpoints
154
+ connections: {
155
+ list: (params) => __awaiter(this, void 0, void 0, function* () {
156
+ return (0, sdk_gen_1.listConnectionsV1ConnectionsGet)({
157
+ client,
158
+ query: params,
159
+ });
160
+ }),
161
+ create: (data) => __awaiter(this, void 0, void 0, function* () {
162
+ return (0, sdk_gen_1.createConnectionV1ConnectionsPost)({
163
+ client,
164
+ body: data,
165
+ });
166
+ }),
167
+ },
168
+ // Trajectory endpoints
169
+ trajectories: {
170
+ list: (params) => __awaiter(this, void 0, void 0, function* () {
171
+ return (0, sdk_gen_1.listTrajectoriesV1TrajectoriesGet)({
172
+ client,
173
+ query: params,
174
+ });
175
+ }),
176
+ create: (data) => __awaiter(this, void 0, void 0, function* () {
177
+ return (0, sdk_gen_1.createTrajectoryV1TrajectoriesPost)({
178
+ client,
179
+ body: data,
180
+ });
181
+ }),
182
+ get: (trajectoryId) => __awaiter(this, void 0, void 0, function* () {
183
+ return (0, sdk_gen_1.getTrajectoryV1TrajectoriesTrajectoryIdGet)({
184
+ client,
185
+ path: { trajectory_id: trajectoryId },
186
+ });
187
+ }),
188
+ update: (trajectoryId, data) => __awaiter(this, void 0, void 0, function* () {
189
+ return (0, sdk_gen_1.updateTrajectoryV1TrajectoriesTrajectoryIdPatch)({
190
+ client,
191
+ path: { trajectory_id: trajectoryId },
192
+ body: data,
193
+ });
194
+ }),
195
+ delete: (trajectoryId) => __awaiter(this, void 0, void 0, function* () {
196
+ return (0, sdk_gen_1.deleteTrajectoryV1TrajectoriesTrajectoryIdDelete)({
197
+ client,
198
+ path: { trajectory_id: trajectoryId },
199
+ });
200
+ }),
201
+ getLatestForWorkflow: (workflowId) => __awaiter(this, void 0, void 0, function* () {
202
+ return (0, sdk_gen_1.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet)({
203
+ client,
204
+ path: { workflow_id: workflowId },
205
+ });
206
+ }),
207
+ },
208
+ };
209
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberdesk",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "The official TypeScript SDK for Cyberdesk",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",