cyberdesk 0.2.0 → 0.2.1

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.
@@ -1,5 +1,5 @@
1
1
  import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
2
- import type { GetV1DesktopIdData, GetV1DesktopIdError, PostV1DesktopData, PostV1DesktopError, PostV1DesktopIdStopData, PostV1DesktopIdStopError, PostV1DesktopIdComputerActionData, PostV1DesktopIdComputerActionError, PostV1DesktopIdBashActionData, PostV1DesktopIdBashActionError } from './types.gen';
2
+ import type { GetV1DesktopByIdData, GetV1DesktopByIdError, PostV1DesktopData, PostV1DesktopError, PostV1DesktopByIdStopData, PostV1DesktopByIdStopError, PostV1DesktopByIdComputerActionData, PostV1DesktopByIdComputerActionError, PostV1DesktopByIdBashActionData, PostV1DesktopByIdBashActionError } 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
@@ -17,13 +17,13 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
17
17
  * Get details of a specific desktop instance
18
18
  * Returns the ID, status, creation timestamp, and timeout timestamp for a given desktop instance.
19
19
  */
20
- export declare const getV1DesktopId: <ThrowOnError extends boolean = false>(options: Options<GetV1DesktopIdData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
20
+ export declare const getV1DesktopById: <ThrowOnError extends boolean = false>(options: Options<GetV1DesktopByIdData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
21
21
  id: string;
22
22
  status: "pending" | "running" | "terminated" | "error";
23
23
  stream_url: string;
24
24
  created_at: string;
25
25
  timeout_at: string;
26
- }, GetV1DesktopIdError, ThrowOnError>;
26
+ }, GetV1DesktopByIdError, ThrowOnError>;
27
27
  /**
28
28
  * Create a new virtual desktop instance
29
29
  * Creates a new virtual desktop instance and returns its ID and stream URL
@@ -36,24 +36,24 @@ export declare const postV1Desktop: <ThrowOnError extends boolean = false>(optio
36
36
  * Stop a running desktop instance
37
37
  * Stops a running desktop instance and cleans up resources
38
38
  */
39
- export declare const postV1DesktopIdStop: <ThrowOnError extends boolean = false>(options: Options<PostV1DesktopIdStopData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
39
+ export declare const postV1DesktopByIdStop: <ThrowOnError extends boolean = false>(options: Options<PostV1DesktopByIdStopData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
40
40
  status: "pending" | "running" | "terminated" | "error";
41
- }, PostV1DesktopIdStopError, ThrowOnError>;
41
+ }, PostV1DesktopByIdStopError, ThrowOnError>;
42
42
  /**
43
43
  * Perform an action on the desktop
44
44
  * Executes a computer action such as mouse clicks, keyboard input, or screenshots on the desktop
45
45
  */
46
- export declare const postV1DesktopIdComputerAction: <ThrowOnError extends boolean = false>(options: Options<PostV1DesktopIdComputerActionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
46
+ export declare const postV1DesktopByIdComputerAction: <ThrowOnError extends boolean = false>(options: Options<PostV1DesktopByIdComputerActionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
47
47
  output?: string;
48
48
  error?: string;
49
49
  base64_image?: string;
50
- }, PostV1DesktopIdComputerActionError, ThrowOnError>;
50
+ }, PostV1DesktopByIdComputerActionError, ThrowOnError>;
51
51
  /**
52
52
  * Execute a bash command on the desktop
53
53
  * Runs a bash command on the desktop and returns the command output
54
54
  */
55
- export declare const postV1DesktopIdBashAction: <ThrowOnError extends boolean = false>(options: Options<PostV1DesktopIdBashActionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
55
+ export declare const postV1DesktopByIdBashAction: <ThrowOnError extends boolean = false>(options: Options<PostV1DesktopByIdBashActionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
56
56
  output?: string;
57
57
  error?: string;
58
58
  base64_image?: string;
59
- }, PostV1DesktopIdBashActionError, ThrowOnError>;
59
+ }, PostV1DesktopByIdBashActionError, ThrowOnError>;
@@ -1,17 +1,17 @@
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.postV1DesktopIdBashAction = exports.postV1DesktopIdComputerAction = exports.postV1DesktopIdStop = exports.postV1Desktop = exports.getV1DesktopId = void 0;
4
+ exports.postV1DesktopByIdBashAction = exports.postV1DesktopByIdComputerAction = exports.postV1DesktopByIdStop = exports.postV1Desktop = exports.getV1DesktopById = void 0;
5
5
  const client_gen_1 = require("./client.gen");
6
6
  /**
7
7
  * Get details of a specific desktop instance
8
8
  * Returns the ID, status, creation timestamp, and timeout timestamp for a given desktop instance.
9
9
  */
10
- const getV1DesktopId = (options) => {
10
+ const getV1DesktopById = (options) => {
11
11
  var _a;
12
12
  return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).get(Object.assign({ url: '/v1/desktop/{id}' }, options));
13
13
  };
14
- exports.getV1DesktopId = getV1DesktopId;
14
+ exports.getV1DesktopById = getV1DesktopById;
15
15
  /**
16
16
  * Create a new virtual desktop instance
17
17
  * Creates a new virtual desktop instance and returns its ID and stream URL
@@ -25,26 +25,26 @@ exports.postV1Desktop = postV1Desktop;
25
25
  * Stop a running desktop instance
26
26
  * Stops a running desktop instance and cleans up resources
27
27
  */
28
- const postV1DesktopIdStop = (options) => {
28
+ const postV1DesktopByIdStop = (options) => {
29
29
  var _a;
30
30
  return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).post(Object.assign({ url: '/v1/desktop/{id}/stop' }, options));
31
31
  };
32
- exports.postV1DesktopIdStop = postV1DesktopIdStop;
32
+ exports.postV1DesktopByIdStop = postV1DesktopByIdStop;
33
33
  /**
34
34
  * Perform an action on the desktop
35
35
  * Executes a computer action such as mouse clicks, keyboard input, or screenshots on the desktop
36
36
  */
37
- const postV1DesktopIdComputerAction = (options) => {
37
+ const postV1DesktopByIdComputerAction = (options) => {
38
38
  var _a;
39
39
  return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).post(Object.assign(Object.assign({ url: '/v1/desktop/{id}/computer-action' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
40
40
  };
41
- exports.postV1DesktopIdComputerAction = postV1DesktopIdComputerAction;
41
+ exports.postV1DesktopByIdComputerAction = postV1DesktopByIdComputerAction;
42
42
  /**
43
43
  * Execute a bash command on the desktop
44
44
  * Runs a bash command on the desktop and returns the command output
45
45
  */
46
- const postV1DesktopIdBashAction = (options) => {
46
+ const postV1DesktopByIdBashAction = (options) => {
47
47
  var _a;
48
48
  return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).post(Object.assign(Object.assign({ url: '/v1/desktop/{id}/bash-action' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
49
49
  };
50
- exports.postV1DesktopIdBashAction = postV1DesktopIdBashAction;
50
+ exports.postV1DesktopByIdBashAction = postV1DesktopByIdBashAction;
@@ -1,4 +1,4 @@
1
- export type GetV1DesktopIdData = {
1
+ export type GetV1DesktopByIdData = {
2
2
  body?: never;
3
3
  headers: {
4
4
  /**
@@ -13,9 +13,9 @@ export type GetV1DesktopIdData = {
13
13
  id: string;
14
14
  };
15
15
  query?: never;
16
- url: '/v1/desktop/:id';
16
+ url: '/v1/desktop/{id}';
17
17
  };
18
- export type GetV1DesktopIdErrors = {
18
+ export type GetV1DesktopByIdErrors = {
19
19
  /**
20
20
  * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
21
21
  */
@@ -97,8 +97,8 @@ export type GetV1DesktopIdErrors = {
97
97
  error: string;
98
98
  };
99
99
  };
100
- export type GetV1DesktopIdError = GetV1DesktopIdErrors[keyof GetV1DesktopIdErrors];
101
- export type GetV1DesktopIdResponses = {
100
+ export type GetV1DesktopByIdError = GetV1DesktopByIdErrors[keyof GetV1DesktopByIdErrors];
101
+ export type GetV1DesktopByIdResponses = {
102
102
  /**
103
103
  * Desktop instance details retrieved successfully
104
104
  */
@@ -125,7 +125,7 @@ export type GetV1DesktopIdResponses = {
125
125
  timeout_at: string;
126
126
  };
127
127
  };
128
- export type GetV1DesktopIdResponse = GetV1DesktopIdResponses[keyof GetV1DesktopIdResponses];
128
+ export type GetV1DesktopByIdResponse = GetV1DesktopByIdResponses[keyof GetV1DesktopByIdResponses];
129
129
  export type PostV1DesktopData = {
130
130
  body?: {
131
131
  /**
@@ -242,7 +242,7 @@ export type PostV1DesktopResponses = {
242
242
  };
243
243
  };
244
244
  export type PostV1DesktopResponse = PostV1DesktopResponses[keyof PostV1DesktopResponses];
245
- export type PostV1DesktopIdStopData = {
245
+ export type PostV1DesktopByIdStopData = {
246
246
  body?: never;
247
247
  headers: {
248
248
  /**
@@ -257,9 +257,9 @@ export type PostV1DesktopIdStopData = {
257
257
  id: string;
258
258
  };
259
259
  query?: never;
260
- url: '/v1/desktop/:id/stop';
260
+ url: '/v1/desktop/{id}/stop';
261
261
  };
262
- export type PostV1DesktopIdStopErrors = {
262
+ export type PostV1DesktopByIdStopErrors = {
263
263
  /**
264
264
  * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
265
265
  */
@@ -341,8 +341,8 @@ export type PostV1DesktopIdStopErrors = {
341
341
  error: string;
342
342
  };
343
343
  };
344
- export type PostV1DesktopIdStopError = PostV1DesktopIdStopErrors[keyof PostV1DesktopIdStopErrors];
345
- export type PostV1DesktopIdStopResponses = {
344
+ export type PostV1DesktopByIdStopError = PostV1DesktopByIdStopErrors[keyof PostV1DesktopByIdStopErrors];
345
+ export type PostV1DesktopByIdStopResponses = {
346
346
  /**
347
347
  * Desktop stopped successfully
348
348
  */
@@ -353,8 +353,8 @@ export type PostV1DesktopIdStopResponses = {
353
353
  status: 'pending' | 'running' | 'terminated' | 'error';
354
354
  };
355
355
  };
356
- export type PostV1DesktopIdStopResponse = PostV1DesktopIdStopResponses[keyof PostV1DesktopIdStopResponses];
357
- export type PostV1DesktopIdComputerActionData = {
356
+ export type PostV1DesktopByIdStopResponse = PostV1DesktopByIdStopResponses[keyof PostV1DesktopByIdStopResponses];
357
+ export type PostV1DesktopByIdComputerActionData = {
358
358
  body?: {
359
359
  /**
360
360
  * Perform a mouse action: click, press (down), or release (up). Defaults to a single left click at the current position.
@@ -489,9 +489,9 @@ export type PostV1DesktopIdComputerActionData = {
489
489
  id: string;
490
490
  };
491
491
  query?: never;
492
- url: '/v1/desktop/:id/computer-action';
492
+ url: '/v1/desktop/{id}/computer-action';
493
493
  };
494
- export type PostV1DesktopIdComputerActionErrors = {
494
+ export type PostV1DesktopByIdComputerActionErrors = {
495
495
  /**
496
496
  * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
497
497
  */
@@ -573,8 +573,8 @@ export type PostV1DesktopIdComputerActionErrors = {
573
573
  error: string;
574
574
  };
575
575
  };
576
- export type PostV1DesktopIdComputerActionError = PostV1DesktopIdComputerActionErrors[keyof PostV1DesktopIdComputerActionErrors];
577
- export type PostV1DesktopIdComputerActionResponses = {
576
+ export type PostV1DesktopByIdComputerActionError = PostV1DesktopByIdComputerActionErrors[keyof PostV1DesktopByIdComputerActionErrors];
577
+ export type PostV1DesktopByIdComputerActionResponses = {
578
578
  /**
579
579
  * Action executed successfully. Response may contain output or image data depending on the action.
580
580
  */
@@ -593,8 +593,8 @@ export type PostV1DesktopIdComputerActionResponses = {
593
593
  base64_image?: string;
594
594
  };
595
595
  };
596
- export type PostV1DesktopIdComputerActionResponse = PostV1DesktopIdComputerActionResponses[keyof PostV1DesktopIdComputerActionResponses];
597
- export type PostV1DesktopIdBashActionData = {
596
+ export type PostV1DesktopByIdComputerActionResponse = PostV1DesktopByIdComputerActionResponses[keyof PostV1DesktopByIdComputerActionResponses];
597
+ export type PostV1DesktopByIdBashActionData = {
598
598
  body?: {
599
599
  /**
600
600
  * Bash command to execute
@@ -614,9 +614,9 @@ export type PostV1DesktopIdBashActionData = {
614
614
  id: string;
615
615
  };
616
616
  query?: never;
617
- url: '/v1/desktop/:id/bash-action';
617
+ url: '/v1/desktop/{id}/bash-action';
618
618
  };
619
- export type PostV1DesktopIdBashActionErrors = {
619
+ export type PostV1DesktopByIdBashActionErrors = {
620
620
  /**
621
621
  * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
622
622
  */
@@ -698,8 +698,8 @@ export type PostV1DesktopIdBashActionErrors = {
698
698
  error: string;
699
699
  };
700
700
  };
701
- export type PostV1DesktopIdBashActionError = PostV1DesktopIdBashActionErrors[keyof PostV1DesktopIdBashActionErrors];
702
- export type PostV1DesktopIdBashActionResponses = {
701
+ export type PostV1DesktopByIdBashActionError = PostV1DesktopByIdBashActionErrors[keyof PostV1DesktopByIdBashActionErrors];
702
+ export type PostV1DesktopByIdBashActionResponses = {
703
703
  /**
704
704
  * Command executed successfully. Response contains command output.
705
705
  */
@@ -718,7 +718,7 @@ export type PostV1DesktopIdBashActionResponses = {
718
718
  base64_image?: string;
719
719
  };
720
720
  };
721
- export type PostV1DesktopIdBashActionResponse = PostV1DesktopIdBashActionResponses[keyof PostV1DesktopIdBashActionResponses];
721
+ export type PostV1DesktopByIdBashActionResponse = PostV1DesktopByIdBashActionResponses[keyof PostV1DesktopByIdBashActionResponses];
722
722
  export type ClientOptions = {
723
723
  baseUrl: 'https://api.cyberdesk.io' | (string & {});
724
724
  };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type Options as ClientOptions } from '@hey-api/client-fetch';
2
2
  import * as apiMethods from './client/sdk.gen';
3
- import { type GetV1DesktopIdData, type PostV1DesktopData, type PostV1DesktopIdStopData, type PostV1DesktopIdComputerActionData, type PostV1DesktopIdBashActionData } from './client/types.gen';
3
+ import { GetV1DesktopByIdData, PostV1DesktopData, PostV1DesktopByIdStopData, PostV1DesktopByIdComputerActionData, PostV1DesktopByIdBashActionData } from './client/types.gen';
4
4
  type FetchFn = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
5
5
  /**
6
6
  * Configuration options for the Cyberdesk SDK client.
@@ -15,17 +15,17 @@ export interface CyberdeskClientOptions {
15
15
  /** Optional: Provide additional default options for the underlying client (e.g., timeout, keepalive). */
16
16
  clientOptions?: Partial<ClientOptions>;
17
17
  }
18
- export type GetDesktopParams = Omit<GetV1DesktopIdData, 'headers' | 'url'>;
18
+ export type GetDesktopParams = Omit<GetV1DesktopByIdData, 'headers' | 'url'>;
19
19
  export type LaunchDesktopParams = Omit<PostV1DesktopData, 'headers' | 'url'>;
20
- export type TerminateDesktopParams = Omit<PostV1DesktopIdStopData, 'headers' | 'url'>;
21
- export type ExecuteComputerActionParams = Omit<PostV1DesktopIdComputerActionData, 'headers' | 'url'>;
22
- export type ExecuteBashActionParams = Omit<PostV1DesktopIdBashActionData, 'headers' | 'url'>;
20
+ export type TerminateDesktopParams = Omit<PostV1DesktopByIdStopData, 'headers' | 'url'>;
21
+ export type ExecuteComputerActionParams = Omit<PostV1DesktopByIdComputerActionData, 'headers' | 'url'>;
22
+ export type ExecuteBashActionParams = Omit<PostV1DesktopByIdBashActionData, 'headers' | 'url'>;
23
23
  export type CyberdeskSDK = {
24
- getDesktop: (opts: GetDesktopParams) => ReturnType<typeof apiMethods.getV1DesktopId>;
24
+ getDesktop: (opts: GetDesktopParams) => ReturnType<typeof apiMethods.getV1DesktopById>;
25
25
  launchDesktop: (opts: LaunchDesktopParams) => ReturnType<typeof apiMethods.postV1Desktop>;
26
- terminateDesktop: (opts: TerminateDesktopParams) => ReturnType<typeof apiMethods.postV1DesktopIdStop>;
27
- executeComputerAction: (opts: ExecuteComputerActionParams) => ReturnType<typeof apiMethods.postV1DesktopIdComputerAction>;
28
- executeBashAction: (opts: ExecuteBashActionParams) => ReturnType<typeof apiMethods.postV1DesktopIdBashAction>;
26
+ terminateDesktop: (opts: TerminateDesktopParams) => ReturnType<typeof apiMethods.postV1DesktopByIdStop>;
27
+ executeComputerAction: (opts: ExecuteComputerActionParams) => ReturnType<typeof apiMethods.postV1DesktopByIdComputerAction>;
28
+ executeBashAction: (opts: ExecuteBashActionParams) => ReturnType<typeof apiMethods.postV1DesktopByIdBashAction>;
29
29
  };
30
30
  /**
31
31
  * Creates a Cyberdesk SDK instance configured with your API key.
package/dist/index.js CHANGED
@@ -55,10 +55,10 @@ function createCyberdeskClient(options) {
55
55
  const configuredClient = (0, client_fetch_1.createClient)(finalClientOptions);
56
56
  // Return an object where each method is pre-configured with the client instance
57
57
  return {
58
- getDesktop: (opts) => apiMethods.getV1DesktopId(Object.assign(Object.assign({}, opts), { client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
58
+ getDesktop: (opts) => apiMethods.getV1DesktopById(Object.assign(Object.assign({}, opts), { client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
59
59
  launchDesktop: (opts) => apiMethods.postV1Desktop(Object.assign(Object.assign({}, opts), { client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
60
- terminateDesktop: (opts) => apiMethods.postV1DesktopIdStop(Object.assign(Object.assign({}, opts), { path: Object.assign(Object.assign({}, opts.path), { id: opts.path.id }), client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
61
- executeComputerAction: (opts) => apiMethods.postV1DesktopIdComputerAction(Object.assign(Object.assign({}, opts), { client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
62
- executeBashAction: (opts) => apiMethods.postV1DesktopIdBashAction(Object.assign(Object.assign({}, opts), { client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
60
+ terminateDesktop: (opts) => apiMethods.postV1DesktopByIdStop(Object.assign(Object.assign({}, opts), { path: Object.assign(Object.assign({}, opts.path), { id: opts.path.id }), client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
61
+ executeComputerAction: (opts) => apiMethods.postV1DesktopByIdComputerAction(Object.assign(Object.assign({}, opts), { client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
62
+ executeBashAction: (opts) => apiMethods.postV1DesktopByIdBashAction(Object.assign(Object.assign({}, opts), { client: configuredClient, headers: Object.assign(Object.assign({}, mergedHeaders), opts.headers) })),
63
63
  };
64
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberdesk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "The official TypeScript SDK for Cyberdesk",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "README.md"
11
11
  ],
12
12
  "scripts": {
13
- "generate": "openapi-ts && node scripts/fix-routes.js",
13
+ "generate": "openapi-ts",
14
14
  "build": "npm run generate && tsc",
15
15
  "prepublishOnly": "npm run build"
16
16
  },