cyberdesk 2.2.6 → 2.2.8

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 { HealthCheckV1HealthGetData, DatabaseHealthCheckV1HealthDbGetData, ListMachinesV1MachinesGetData, CreateMachineV1MachinesPostData, DeleteMachineV1MachinesMachineIdDeleteData, GetMachineV1MachinesMachineIdGetData, UpdateMachineV1MachinesMachineIdPatchData, GetMachinePoolsV1MachinesMachineIdPoolsGetData, UpdateMachinePoolsV1MachinesMachineIdPoolsPutData, ListPoolsV1PoolsGetData, CreatePoolV1PoolsPostData, DeletePoolV1PoolsPoolIdDeleteData, GetPoolV1PoolsPoolIdGetData, UpdatePoolV1PoolsPoolIdPatchData, RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteData, AddMachinesToPoolV1PoolsPoolIdMachinesPostData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, CreateRunChainV1RunsChainPostData, BulkCreateRunsV1RunsBulkPostData, RetryRunV1RunsRunIdRetryPostData, 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, CopyToClipboardV1ComputerMachineIdCopyToClipboardPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, MouseScrollV1ComputerMachineIdInputMouseScrollPostData, MouseDragV1ComputerMachineIdInputMouseDragPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, DummyTestEndpointV1TestPostData, DbPingInternalDebugDbPingGetData, RootGetData, HealthHealthGetData, HealthDbHealthDbGetData } from './types.gen';
2
+ import type { HealthCheckV1HealthGetData, DatabaseHealthCheckV1HealthDbGetData, ListMachinesV1MachinesGetData, CreateMachineV1MachinesPostData, DeleteMachineV1MachinesMachineIdDeleteData, GetMachineV1MachinesMachineIdGetData, UpdateMachineV1MachinesMachineIdPatchData, GetMachinePoolsV1MachinesMachineIdPoolsGetData, UpdateMachinePoolsV1MachinesMachineIdPoolsPutData, ListPoolsV1PoolsGetData, CreatePoolV1PoolsPostData, DeletePoolV1PoolsPoolIdDeleteData, GetPoolV1PoolsPoolIdGetData, UpdatePoolV1PoolsPoolIdPatchData, RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteData, AddMachinesToPoolV1PoolsPoolIdMachinesPostData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, CreateRunChainV1RunsChainPostData, BulkCreateRunsV1RunsBulkPostData, RetryRunV1RunsRunIdRetryPostData, 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, CopyToClipboardV1ComputerMachineIdCopyToClipboardPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, MouseScrollV1ComputerMachineIdInputMouseScrollPostData, MouseDragV1ComputerMachineIdInputMouseDragPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, DummyTestEndpointV1TestPostData, DbPingInternalDebugDbPingGetData, RootGetData, HealthLiveHealthLiveGetData, HealthReadyHealthReadyGetData, HealthHealthGetData, HealthDbHealthDbGetData } 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
@@ -529,13 +529,28 @@ export declare const dbPingInternalDebugDbPingGet: <ThrowOnError extends boolean
529
529
  * Root endpoint with service information
530
530
  */
531
531
  export declare const rootGet: <ThrowOnError extends boolean = false>(options?: Options<RootGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
532
+ /**
533
+ * Health Live
534
+ * Liveness probe - Is the process alive?
535
+ * Always returns 200 if the server can respond.
536
+ * Use this for: Kubernetes liveness probes, basic "is it up" checks.
537
+ */
538
+ export declare const healthLiveHealthLiveGet: <ThrowOnError extends boolean = false>(options?: Options<HealthLiveHealthLiveGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
539
+ /**
540
+ * Health Ready
541
+ * Readiness probe - Can the service handle requests?
542
+ * Checks all critical dependencies with timeouts.
543
+ * Use this for: Load balancer health checks, Better Stack monitoring.
544
+ * Returns 503 if any critical dependency is down.
545
+ */
546
+ export declare const healthReadyHealthReadyGet: <ThrowOnError extends boolean = false>(options?: Options<HealthReadyHealthReadyGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
532
547
  /**
533
548
  * Health
549
+ * Backward compatible health check - redirects to readiness check.
534
550
  */
535
- export declare const healthHealthGet: <ThrowOnError extends boolean = false>(options?: Options<HealthHealthGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
536
- [key: string]: unknown;
537
- }, unknown, ThrowOnError>;
551
+ export declare const healthHealthGet: <ThrowOnError extends boolean = false>(options?: Options<HealthHealthGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
538
552
  /**
539
553
  * Health Db
554
+ * Legacy endpoint - checks database only.
540
555
  */
541
556
  export declare const healthDbHealthDbGet: <ThrowOnError extends boolean = false>(options?: Options<HealthDbHealthDbGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
@@ -2,7 +2,7 @@
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  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.retryRunV1RunsRunIdRetryPost = exports.bulkCreateRunsV1RunsBulkPost = exports.createRunChainV1RunsChainPost = exports.updateRunV1RunsRunIdPatch = exports.getRunV1RunsRunIdGet = exports.deleteRunV1RunsRunIdDelete = exports.createRunV1RunsPost = exports.listRunsV1RunsGet = exports.getWorkflowVersionsV1WorkflowsWorkflowIdVersionsGet = exports.updateWorkflowV1WorkflowsWorkflowIdPatch = exports.getWorkflowV1WorkflowsWorkflowIdGet = exports.deleteWorkflowV1WorkflowsWorkflowIdDelete = exports.createWorkflowV1WorkflowsPost = exports.listWorkflowsV1WorkflowsGet = exports.addMachinesToPoolV1PoolsPoolIdMachinesPost = exports.removeMachinesFromPoolV1PoolsPoolIdMachinesDelete = exports.updatePoolV1PoolsPoolIdPatch = exports.getPoolV1PoolsPoolIdGet = exports.deletePoolV1PoolsPoolIdDelete = exports.createPoolV1PoolsPost = exports.listPoolsV1PoolsGet = exports.updateMachinePoolsV1MachinesMachineIdPoolsPut = exports.getMachinePoolsV1MachinesMachineIdPoolsGet = exports.updateMachineV1MachinesMachineIdPatch = exports.getMachineV1MachinesMachineIdGet = exports.deleteMachineV1MachinesMachineIdDelete = exports.createMachineV1MachinesPost = exports.listMachinesV1MachinesGet = exports.databaseHealthCheckV1HealthDbGet = exports.healthCheckV1HealthGet = void 0;
5
- exports.healthDbHealthDbGet = exports.healthHealthGet = exports.rootGet = exports.dbPingInternalDebugDbPingGet = exports.dummyTestEndpointV1TestPost = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = exports.fsWriteV1ComputerMachineIdFsWritePost = exports.fsReadV1ComputerMachineIdFsReadGet = exports.fsListV1ComputerMachineIdFsListGet = exports.mouseDragV1ComputerMachineIdInputMouseDragPost = exports.mouseScrollV1ComputerMachineIdInputMouseScrollPost = exports.mouseClickV1ComputerMachineIdInputMouseClickPost = exports.mouseMoveV1ComputerMachineIdInputMouseMovePost = exports.getMousePositionV1ComputerMachineIdInputMousePositionGet = exports.copyToClipboardV1ComputerMachineIdCopyToClipboardPost = exports.keyboardKeyV1ComputerMachineIdInputKeyboardKeyPost = exports.keyboardTypeV1ComputerMachineIdInputKeyboardTypePost = exports.getDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGet = exports.getScreenshotV1ComputerMachineIdDisplayScreenshotGet = exports.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet = exports.updateTrajectoryV1TrajectoriesTrajectoryIdPatch = exports.getTrajectoryV1TrajectoriesTrajectoryIdGet = void 0;
5
+ exports.healthDbHealthDbGet = exports.healthHealthGet = exports.healthReadyHealthReadyGet = exports.healthLiveHealthLiveGet = exports.rootGet = exports.dbPingInternalDebugDbPingGet = exports.dummyTestEndpointV1TestPost = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = exports.fsWriteV1ComputerMachineIdFsWritePost = exports.fsReadV1ComputerMachineIdFsReadGet = exports.fsListV1ComputerMachineIdFsListGet = exports.mouseDragV1ComputerMachineIdInputMouseDragPost = exports.mouseScrollV1ComputerMachineIdInputMouseScrollPost = exports.mouseClickV1ComputerMachineIdInputMouseClickPost = exports.mouseMoveV1ComputerMachineIdInputMouseMovePost = exports.getMousePositionV1ComputerMachineIdInputMousePositionGet = exports.copyToClipboardV1ComputerMachineIdCopyToClipboardPost = exports.keyboardKeyV1ComputerMachineIdInputKeyboardKeyPost = exports.keyboardTypeV1ComputerMachineIdInputKeyboardTypePost = exports.getDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGet = exports.getScreenshotV1ComputerMachineIdDisplayScreenshotGet = exports.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet = exports.updateTrajectoryV1TrajectoriesTrajectoryIdPatch = exports.getTrajectoryV1TrajectoriesTrajectoryIdGet = void 0;
6
6
  const client_gen_1 = require("./client.gen");
7
7
  /**
8
8
  * Health Check
@@ -1121,8 +1121,32 @@ const rootGet = (options) => {
1121
1121
  return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).get(Object.assign({ url: '/' }, options));
1122
1122
  };
1123
1123
  exports.rootGet = rootGet;
1124
+ /**
1125
+ * Health Live
1126
+ * Liveness probe - Is the process alive?
1127
+ * Always returns 200 if the server can respond.
1128
+ * Use this for: Kubernetes liveness probes, basic "is it up" checks.
1129
+ */
1130
+ const healthLiveHealthLiveGet = (options) => {
1131
+ var _a;
1132
+ return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).get(Object.assign({ url: '/health/live' }, options));
1133
+ };
1134
+ exports.healthLiveHealthLiveGet = healthLiveHealthLiveGet;
1135
+ /**
1136
+ * Health Ready
1137
+ * Readiness probe - Can the service handle requests?
1138
+ * Checks all critical dependencies with timeouts.
1139
+ * Use this for: Load balancer health checks, Better Stack monitoring.
1140
+ * Returns 503 if any critical dependency is down.
1141
+ */
1142
+ const healthReadyHealthReadyGet = (options) => {
1143
+ var _a;
1144
+ return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).get(Object.assign({ url: '/health/ready' }, options));
1145
+ };
1146
+ exports.healthReadyHealthReadyGet = healthReadyHealthReadyGet;
1124
1147
  /**
1125
1148
  * Health
1149
+ * Backward compatible health check - redirects to readiness check.
1126
1150
  */
1127
1151
  const healthHealthGet = (options) => {
1128
1152
  var _a;
@@ -1131,6 +1155,7 @@ const healthHealthGet = (options) => {
1131
1155
  exports.healthHealthGet = healthHealthGet;
1132
1156
  /**
1133
1157
  * Health Db
1158
+ * Legacy endpoint - checks database only.
1134
1159
  */
1135
1160
  const healthDbHealthDbGet = (options) => {
1136
1161
  var _a;
@@ -9,10 +9,10 @@ export type ChainStep = {
9
9
  */
10
10
  session_alias?: string | null;
11
11
  /**
12
- * Step-specific inputs; values must be string or {$ref: 'alias.outputs.path'}
12
+ * Step-specific inputs; values can be strings, objects, arrays, or {$ref: 'alias.outputs.path'} references
13
13
  */
14
14
  inputs?: {
15
- [key: string]: string | RefValue;
15
+ [key: string]: unknown;
16
16
  } | null;
17
17
  /**
18
18
  * Step-specific sensitive inputs (supports nested objects) that override or extend shared_sensitive_inputs
@@ -187,7 +187,7 @@ export type MachineUpdate = {
187
187
  is_available?: boolean | null;
188
188
  last_seen?: string | null;
189
189
  /**
190
- * Set to null to clear reservation; server will cancel queued/running session runs and clear
190
+ * Set to null to clear reservation; server will cancel any scheduling/running run on this machine, clear reservation, mark machine available, and trigger matching
191
191
  */
192
192
  reserved_session_id?: string | null;
193
193
  /**
@@ -371,13 +371,6 @@ export type PowerShellSessionRequest = {
371
371
  */
372
372
  session_id?: string | null;
373
373
  };
374
- /**
375
- * Reference to a prior step's output within the same session.
376
- * The wire shape is {"$ref": "alias.outputs.path"}.
377
- */
378
- export type RefValue = {
379
- $ref: string;
380
- };
381
374
  /**
382
375
  * Schema for creating a request log
383
376
  */
@@ -941,6 +934,12 @@ export type ListMachinesV1MachinesGetResponses = {
941
934
  export type ListMachinesV1MachinesGetResponse = ListMachinesV1MachinesGetResponses[keyof ListMachinesV1MachinesGetResponses];
942
935
  export type CreateMachineV1MachinesPostData = {
943
936
  body: MachineCreate;
937
+ headers?: {
938
+ /**
939
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
940
+ */
941
+ 'Idempotency-Key'?: string;
942
+ };
944
943
  path?: never;
945
944
  query?: never;
946
945
  url: '/v1/machines';
@@ -961,6 +960,12 @@ export type CreateMachineV1MachinesPostResponses = {
961
960
  export type CreateMachineV1MachinesPostResponse = CreateMachineV1MachinesPostResponses[keyof CreateMachineV1MachinesPostResponses];
962
961
  export type DeleteMachineV1MachinesMachineIdDeleteData = {
963
962
  body?: never;
963
+ headers?: {
964
+ /**
965
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
966
+ */
967
+ 'Idempotency-Key'?: string;
968
+ };
964
969
  path: {
965
970
  machine_id: string;
966
971
  };
@@ -1005,6 +1010,12 @@ export type GetMachineV1MachinesMachineIdGetResponses = {
1005
1010
  export type GetMachineV1MachinesMachineIdGetResponse = GetMachineV1MachinesMachineIdGetResponses[keyof GetMachineV1MachinesMachineIdGetResponses];
1006
1011
  export type UpdateMachineV1MachinesMachineIdPatchData = {
1007
1012
  body: MachineUpdate;
1013
+ headers?: {
1014
+ /**
1015
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1016
+ */
1017
+ 'Idempotency-Key'?: string;
1018
+ };
1008
1019
  path: {
1009
1020
  machine_id: string;
1010
1021
  };
@@ -1049,6 +1060,12 @@ export type GetMachinePoolsV1MachinesMachineIdPoolsGetResponses = {
1049
1060
  export type GetMachinePoolsV1MachinesMachineIdPoolsGetResponse = GetMachinePoolsV1MachinesMachineIdPoolsGetResponses[keyof GetMachinePoolsV1MachinesMachineIdPoolsGetResponses];
1050
1061
  export type UpdateMachinePoolsV1MachinesMachineIdPoolsPutData = {
1051
1062
  body: MachinePoolUpdate;
1063
+ headers?: {
1064
+ /**
1065
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1066
+ */
1067
+ 'Idempotency-Key'?: string;
1068
+ };
1052
1069
  path: {
1053
1070
  machine_id: string;
1054
1071
  };
@@ -1094,6 +1111,12 @@ export type ListPoolsV1PoolsGetResponses = {
1094
1111
  export type ListPoolsV1PoolsGetResponse = ListPoolsV1PoolsGetResponses[keyof ListPoolsV1PoolsGetResponses];
1095
1112
  export type CreatePoolV1PoolsPostData = {
1096
1113
  body: PoolCreate;
1114
+ headers?: {
1115
+ /**
1116
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1117
+ */
1118
+ 'Idempotency-Key'?: string;
1119
+ };
1097
1120
  path?: never;
1098
1121
  query?: never;
1099
1122
  url: '/v1/pools';
@@ -1114,6 +1137,12 @@ export type CreatePoolV1PoolsPostResponses = {
1114
1137
  export type CreatePoolV1PoolsPostResponse = CreatePoolV1PoolsPostResponses[keyof CreatePoolV1PoolsPostResponses];
1115
1138
  export type DeletePoolV1PoolsPoolIdDeleteData = {
1116
1139
  body?: never;
1140
+ headers?: {
1141
+ /**
1142
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1143
+ */
1144
+ 'Idempotency-Key'?: string;
1145
+ };
1117
1146
  path: {
1118
1147
  pool_id: string;
1119
1148
  };
@@ -1163,6 +1192,12 @@ export type GetPoolV1PoolsPoolIdGetResponses = {
1163
1192
  export type GetPoolV1PoolsPoolIdGetResponse = GetPoolV1PoolsPoolIdGetResponses[keyof GetPoolV1PoolsPoolIdGetResponses];
1164
1193
  export type UpdatePoolV1PoolsPoolIdPatchData = {
1165
1194
  body: PoolUpdate;
1195
+ headers?: {
1196
+ /**
1197
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1198
+ */
1199
+ 'Idempotency-Key'?: string;
1200
+ };
1166
1201
  path: {
1167
1202
  pool_id: string;
1168
1203
  };
@@ -1185,6 +1220,12 @@ export type UpdatePoolV1PoolsPoolIdPatchResponses = {
1185
1220
  export type UpdatePoolV1PoolsPoolIdPatchResponse = UpdatePoolV1PoolsPoolIdPatchResponses[keyof UpdatePoolV1PoolsPoolIdPatchResponses];
1186
1221
  export type RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteData = {
1187
1222
  body: MachinePoolAssignment;
1223
+ headers?: {
1224
+ /**
1225
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1226
+ */
1227
+ 'Idempotency-Key'?: string;
1228
+ };
1188
1229
  path: {
1189
1230
  pool_id: string;
1190
1231
  };
@@ -1207,6 +1248,12 @@ export type RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponses = {
1207
1248
  export type RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponse = RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponses[keyof RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponses];
1208
1249
  export type AddMachinesToPoolV1PoolsPoolIdMachinesPostData = {
1209
1250
  body: MachinePoolAssignment;
1251
+ headers?: {
1252
+ /**
1253
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1254
+ */
1255
+ 'Idempotency-Key'?: string;
1256
+ };
1210
1257
  path: {
1211
1258
  pool_id: string;
1212
1259
  };
@@ -1268,6 +1315,12 @@ export type ListWorkflowsV1WorkflowsGetResponses = {
1268
1315
  export type ListWorkflowsV1WorkflowsGetResponse = ListWorkflowsV1WorkflowsGetResponses[keyof ListWorkflowsV1WorkflowsGetResponses];
1269
1316
  export type CreateWorkflowV1WorkflowsPostData = {
1270
1317
  body: WorkflowCreate;
1318
+ headers?: {
1319
+ /**
1320
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1321
+ */
1322
+ 'Idempotency-Key'?: string;
1323
+ };
1271
1324
  path?: never;
1272
1325
  query?: never;
1273
1326
  url: '/v1/workflows';
@@ -1288,6 +1341,12 @@ export type CreateWorkflowV1WorkflowsPostResponses = {
1288
1341
  export type CreateWorkflowV1WorkflowsPostResponse = CreateWorkflowV1WorkflowsPostResponses[keyof CreateWorkflowV1WorkflowsPostResponses];
1289
1342
  export type DeleteWorkflowV1WorkflowsWorkflowIdDeleteData = {
1290
1343
  body?: never;
1344
+ headers?: {
1345
+ /**
1346
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1347
+ */
1348
+ 'Idempotency-Key'?: string;
1349
+ };
1291
1350
  path: {
1292
1351
  workflow_id: string;
1293
1352
  };
@@ -1332,6 +1391,12 @@ export type GetWorkflowV1WorkflowsWorkflowIdGetResponses = {
1332
1391
  export type GetWorkflowV1WorkflowsWorkflowIdGetResponse = GetWorkflowV1WorkflowsWorkflowIdGetResponses[keyof GetWorkflowV1WorkflowsWorkflowIdGetResponses];
1333
1392
  export type UpdateWorkflowV1WorkflowsWorkflowIdPatchData = {
1334
1393
  body: WorkflowUpdate;
1394
+ headers?: {
1395
+ /**
1396
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1397
+ */
1398
+ 'Idempotency-Key'?: string;
1399
+ };
1335
1400
  path: {
1336
1401
  workflow_id: string;
1337
1402
  };
@@ -1429,6 +1494,12 @@ export type ListRunsV1RunsGetResponses = {
1429
1494
  export type ListRunsV1RunsGetResponse = ListRunsV1RunsGetResponses[keyof ListRunsV1RunsGetResponses];
1430
1495
  export type CreateRunV1RunsPostData = {
1431
1496
  body: RunCreate;
1497
+ headers?: {
1498
+ /**
1499
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1500
+ */
1501
+ 'Idempotency-Key'?: string;
1502
+ };
1432
1503
  path?: never;
1433
1504
  query?: never;
1434
1505
  url: '/v1/runs';
@@ -1449,6 +1520,12 @@ export type CreateRunV1RunsPostResponses = {
1449
1520
  export type CreateRunV1RunsPostResponse = CreateRunV1RunsPostResponses[keyof CreateRunV1RunsPostResponses];
1450
1521
  export type DeleteRunV1RunsRunIdDeleteData = {
1451
1522
  body?: never;
1523
+ headers?: {
1524
+ /**
1525
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1526
+ */
1527
+ 'Idempotency-Key'?: string;
1528
+ };
1452
1529
  path: {
1453
1530
  run_id: string;
1454
1531
  };
@@ -1493,6 +1570,12 @@ export type GetRunV1RunsRunIdGetResponses = {
1493
1570
  export type GetRunV1RunsRunIdGetResponse = GetRunV1RunsRunIdGetResponses[keyof GetRunV1RunsRunIdGetResponses];
1494
1571
  export type UpdateRunV1RunsRunIdPatchData = {
1495
1572
  body: RunUpdate;
1573
+ headers?: {
1574
+ /**
1575
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1576
+ */
1577
+ 'Idempotency-Key'?: string;
1578
+ };
1496
1579
  path: {
1497
1580
  run_id: string;
1498
1581
  };
@@ -1515,6 +1598,12 @@ export type UpdateRunV1RunsRunIdPatchResponses = {
1515
1598
  export type UpdateRunV1RunsRunIdPatchResponse = UpdateRunV1RunsRunIdPatchResponses[keyof UpdateRunV1RunsRunIdPatchResponses];
1516
1599
  export type CreateRunChainV1RunsChainPostData = {
1517
1600
  body: WorkflowChainCreate;
1601
+ headers?: {
1602
+ /**
1603
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1604
+ */
1605
+ 'Idempotency-Key'?: string;
1606
+ };
1518
1607
  path?: never;
1519
1608
  query?: never;
1520
1609
  url: '/v1/runs/chain';
@@ -1535,6 +1624,12 @@ export type CreateRunChainV1RunsChainPostResponses = {
1535
1624
  export type CreateRunChainV1RunsChainPostResponse = CreateRunChainV1RunsChainPostResponses[keyof CreateRunChainV1RunsChainPostResponses];
1536
1625
  export type BulkCreateRunsV1RunsBulkPostData = {
1537
1626
  body: RunBulkCreate;
1627
+ headers?: {
1628
+ /**
1629
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1630
+ */
1631
+ 'Idempotency-Key'?: string;
1632
+ };
1538
1633
  path?: never;
1539
1634
  query?: never;
1540
1635
  url: '/v1/runs/bulk';
@@ -1555,6 +1650,12 @@ export type BulkCreateRunsV1RunsBulkPostResponses = {
1555
1650
  export type BulkCreateRunsV1RunsBulkPostResponse = BulkCreateRunsV1RunsBulkPostResponses[keyof BulkCreateRunsV1RunsBulkPostResponses];
1556
1651
  export type RetryRunV1RunsRunIdRetryPostData = {
1557
1652
  body: RunRetry;
1653
+ headers?: {
1654
+ /**
1655
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1656
+ */
1657
+ 'Idempotency-Key'?: string;
1658
+ };
1558
1659
  path: {
1559
1660
  run_id: string;
1560
1661
  };
@@ -1608,6 +1709,12 @@ export type ListRunAttachmentsV1RunAttachmentsGetResponses = {
1608
1709
  export type ListRunAttachmentsV1RunAttachmentsGetResponse = ListRunAttachmentsV1RunAttachmentsGetResponses[keyof ListRunAttachmentsV1RunAttachmentsGetResponses];
1609
1710
  export type CreateRunAttachmentV1RunAttachmentsPostData = {
1610
1711
  body: RunAttachmentCreate;
1712
+ headers?: {
1713
+ /**
1714
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1715
+ */
1716
+ 'Idempotency-Key'?: string;
1717
+ };
1611
1718
  path?: never;
1612
1719
  query?: never;
1613
1720
  url: '/v1/run-attachments';
@@ -1628,6 +1735,12 @@ export type CreateRunAttachmentV1RunAttachmentsPostResponses = {
1628
1735
  export type CreateRunAttachmentV1RunAttachmentsPostResponse = CreateRunAttachmentV1RunAttachmentsPostResponses[keyof CreateRunAttachmentV1RunAttachmentsPostResponses];
1629
1736
  export type DeleteRunAttachmentV1RunAttachmentsAttachmentIdDeleteData = {
1630
1737
  body?: never;
1738
+ headers?: {
1739
+ /**
1740
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1741
+ */
1742
+ 'Idempotency-Key'?: string;
1743
+ };
1631
1744
  path: {
1632
1745
  attachment_id: string;
1633
1746
  };
@@ -1672,6 +1785,12 @@ export type GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponses = {
1672
1785
  export type GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponse = GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponses[keyof GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponses];
1673
1786
  export type UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutData = {
1674
1787
  body: RunAttachmentUpdate;
1788
+ headers?: {
1789
+ /**
1790
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1791
+ */
1792
+ 'Idempotency-Key'?: string;
1793
+ };
1675
1794
  path: {
1676
1795
  attachment_id: string;
1677
1796
  };
@@ -1774,6 +1893,12 @@ export type ListConnectionsV1ConnectionsGetResponses = {
1774
1893
  export type ListConnectionsV1ConnectionsGetResponse = ListConnectionsV1ConnectionsGetResponses[keyof ListConnectionsV1ConnectionsGetResponses];
1775
1894
  export type CreateConnectionV1ConnectionsPostData = {
1776
1895
  body: ConnectionCreate;
1896
+ headers?: {
1897
+ /**
1898
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1899
+ */
1900
+ 'Idempotency-Key'?: string;
1901
+ };
1777
1902
  path?: never;
1778
1903
  query?: never;
1779
1904
  url: '/v1/connections';
@@ -1794,6 +1919,12 @@ export type CreateConnectionV1ConnectionsPostResponses = {
1794
1919
  export type CreateConnectionV1ConnectionsPostResponse = CreateConnectionV1ConnectionsPostResponses[keyof CreateConnectionV1ConnectionsPostResponses];
1795
1920
  export type DeleteConnectionV1ConnectionsConnectionIdDeleteData = {
1796
1921
  body?: never;
1922
+ headers?: {
1923
+ /**
1924
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1925
+ */
1926
+ 'Idempotency-Key'?: string;
1927
+ };
1797
1928
  path: {
1798
1929
  connection_id: string;
1799
1930
  };
@@ -1838,6 +1969,12 @@ export type GetConnectionV1ConnectionsConnectionIdGetResponses = {
1838
1969
  export type GetConnectionV1ConnectionsConnectionIdGetResponse = GetConnectionV1ConnectionsConnectionIdGetResponses[keyof GetConnectionV1ConnectionsConnectionIdGetResponses];
1839
1970
  export type UpdateConnectionV1ConnectionsConnectionIdPatchData = {
1840
1971
  body: ConnectionCreate;
1972
+ headers?: {
1973
+ /**
1974
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
1975
+ */
1976
+ 'Idempotency-Key'?: string;
1977
+ };
1841
1978
  path: {
1842
1979
  connection_id: string;
1843
1980
  };
@@ -1895,6 +2032,12 @@ export type ListRequestLogsV1RequestLogsGetResponses = {
1895
2032
  export type ListRequestLogsV1RequestLogsGetResponse = ListRequestLogsV1RequestLogsGetResponses[keyof ListRequestLogsV1RequestLogsGetResponses];
1896
2033
  export type CreateRequestLogV1RequestLogsPostData = {
1897
2034
  body: RequestLogCreate;
2035
+ headers?: {
2036
+ /**
2037
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2038
+ */
2039
+ 'Idempotency-Key'?: string;
2040
+ };
1898
2041
  path?: never;
1899
2042
  query?: never;
1900
2043
  url: '/v1/request-logs';
@@ -1915,6 +2058,12 @@ export type CreateRequestLogV1RequestLogsPostResponses = {
1915
2058
  export type CreateRequestLogV1RequestLogsPostResponse = CreateRequestLogV1RequestLogsPostResponses[keyof CreateRequestLogV1RequestLogsPostResponses];
1916
2059
  export type DeleteRequestLogV1RequestLogsLogIdDeleteData = {
1917
2060
  body?: never;
2061
+ headers?: {
2062
+ /**
2063
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2064
+ */
2065
+ 'Idempotency-Key'?: string;
2066
+ };
1918
2067
  path: {
1919
2068
  log_id: string;
1920
2069
  };
@@ -1959,6 +2108,12 @@ export type GetRequestLogV1RequestLogsLogIdGetResponses = {
1959
2108
  export type GetRequestLogV1RequestLogsLogIdGetResponse = GetRequestLogV1RequestLogsLogIdGetResponses[keyof GetRequestLogV1RequestLogsLogIdGetResponses];
1960
2109
  export type UpdateRequestLogV1RequestLogsLogIdPatchData = {
1961
2110
  body: RequestLogUpdate;
2111
+ headers?: {
2112
+ /**
2113
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2114
+ */
2115
+ 'Idempotency-Key'?: string;
2116
+ };
1962
2117
  path: {
1963
2118
  log_id: string;
1964
2119
  };
@@ -2028,6 +2183,12 @@ export type ListTrajectoriesV1TrajectoriesGetResponses = {
2028
2183
  export type ListTrajectoriesV1TrajectoriesGetResponse = ListTrajectoriesV1TrajectoriesGetResponses[keyof ListTrajectoriesV1TrajectoriesGetResponses];
2029
2184
  export type CreateTrajectoryV1TrajectoriesPostData = {
2030
2185
  body: TrajectoryCreate;
2186
+ headers?: {
2187
+ /**
2188
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2189
+ */
2190
+ 'Idempotency-Key'?: string;
2191
+ };
2031
2192
  path?: never;
2032
2193
  query?: never;
2033
2194
  url: '/v1/trajectories';
@@ -2048,6 +2209,12 @@ export type CreateTrajectoryV1TrajectoriesPostResponses = {
2048
2209
  export type CreateTrajectoryV1TrajectoriesPostResponse = CreateTrajectoryV1TrajectoriesPostResponses[keyof CreateTrajectoryV1TrajectoriesPostResponses];
2049
2210
  export type DeleteTrajectoryV1TrajectoriesTrajectoryIdDeleteData = {
2050
2211
  body?: never;
2212
+ headers?: {
2213
+ /**
2214
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2215
+ */
2216
+ 'Idempotency-Key'?: string;
2217
+ };
2051
2218
  path: {
2052
2219
  trajectory_id: string;
2053
2220
  };
@@ -2092,6 +2259,12 @@ export type GetTrajectoryV1TrajectoriesTrajectoryIdGetResponses = {
2092
2259
  export type GetTrajectoryV1TrajectoriesTrajectoryIdGetResponse = GetTrajectoryV1TrajectoriesTrajectoryIdGetResponses[keyof GetTrajectoryV1TrajectoriesTrajectoryIdGetResponses];
2093
2260
  export type UpdateTrajectoryV1TrajectoriesTrajectoryIdPatchData = {
2094
2261
  body: TrajectoryUpdate;
2262
+ headers?: {
2263
+ /**
2264
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2265
+ */
2266
+ 'Idempotency-Key'?: string;
2267
+ };
2095
2268
  path: {
2096
2269
  trajectory_id: string;
2097
2270
  };
@@ -2179,6 +2352,12 @@ export type GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponses
2179
2352
  export type GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponse = GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponses[keyof GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponses];
2180
2353
  export type KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostData = {
2181
2354
  body: KeyboardTypeRequest;
2355
+ headers?: {
2356
+ /**
2357
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2358
+ */
2359
+ 'Idempotency-Key'?: string;
2360
+ };
2182
2361
  path: {
2183
2362
  machine_id: string;
2184
2363
  };
@@ -2201,6 +2380,12 @@ export type KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponses = {
2201
2380
  export type KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponse = KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponses[keyof KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponses];
2202
2381
  export type KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostData = {
2203
2382
  body: KeyboardKeyRequest;
2383
+ headers?: {
2384
+ /**
2385
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2386
+ */
2387
+ 'Idempotency-Key'?: string;
2388
+ };
2204
2389
  path: {
2205
2390
  machine_id: string;
2206
2391
  };
@@ -2223,6 +2408,12 @@ export type KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponses = {
2223
2408
  export type KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponse = KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponses[keyof KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponses];
2224
2409
  export type CopyToClipboardV1ComputerMachineIdCopyToClipboardPostData = {
2225
2410
  body: CopyToClipboardRequest;
2411
+ headers?: {
2412
+ /**
2413
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2414
+ */
2415
+ 'Idempotency-Key'?: string;
2416
+ };
2226
2417
  path: {
2227
2418
  machine_id: string;
2228
2419
  };
@@ -2269,6 +2460,12 @@ export type GetMousePositionV1ComputerMachineIdInputMousePositionGetResponses =
2269
2460
  export type GetMousePositionV1ComputerMachineIdInputMousePositionGetResponse = GetMousePositionV1ComputerMachineIdInputMousePositionGetResponses[keyof GetMousePositionV1ComputerMachineIdInputMousePositionGetResponses];
2270
2461
  export type MouseMoveV1ComputerMachineIdInputMouseMovePostData = {
2271
2462
  body: MouseMoveRequest;
2463
+ headers?: {
2464
+ /**
2465
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2466
+ */
2467
+ 'Idempotency-Key'?: string;
2468
+ };
2272
2469
  path: {
2273
2470
  machine_id: string;
2274
2471
  };
@@ -2291,6 +2488,12 @@ export type MouseMoveV1ComputerMachineIdInputMouseMovePostResponses = {
2291
2488
  export type MouseMoveV1ComputerMachineIdInputMouseMovePostResponse = MouseMoveV1ComputerMachineIdInputMouseMovePostResponses[keyof MouseMoveV1ComputerMachineIdInputMouseMovePostResponses];
2292
2489
  export type MouseClickV1ComputerMachineIdInputMouseClickPostData = {
2293
2490
  body: MouseClickRequest;
2491
+ headers?: {
2492
+ /**
2493
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2494
+ */
2495
+ 'Idempotency-Key'?: string;
2496
+ };
2294
2497
  path: {
2295
2498
  machine_id: string;
2296
2499
  };
@@ -2313,6 +2516,12 @@ export type MouseClickV1ComputerMachineIdInputMouseClickPostResponses = {
2313
2516
  export type MouseClickV1ComputerMachineIdInputMouseClickPostResponse = MouseClickV1ComputerMachineIdInputMouseClickPostResponses[keyof MouseClickV1ComputerMachineIdInputMouseClickPostResponses];
2314
2517
  export type MouseScrollV1ComputerMachineIdInputMouseScrollPostData = {
2315
2518
  body: MouseScrollRequest;
2519
+ headers?: {
2520
+ /**
2521
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2522
+ */
2523
+ 'Idempotency-Key'?: string;
2524
+ };
2316
2525
  path: {
2317
2526
  machine_id: string;
2318
2527
  };
@@ -2335,6 +2544,12 @@ export type MouseScrollV1ComputerMachineIdInputMouseScrollPostResponses = {
2335
2544
  export type MouseScrollV1ComputerMachineIdInputMouseScrollPostResponse = MouseScrollV1ComputerMachineIdInputMouseScrollPostResponses[keyof MouseScrollV1ComputerMachineIdInputMouseScrollPostResponses];
2336
2545
  export type MouseDragV1ComputerMachineIdInputMouseDragPostData = {
2337
2546
  body: MouseDragRequest;
2547
+ headers?: {
2548
+ /**
2549
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2550
+ */
2551
+ 'Idempotency-Key'?: string;
2552
+ };
2338
2553
  path: {
2339
2554
  machine_id: string;
2340
2555
  };
@@ -2409,6 +2624,12 @@ export type FsReadV1ComputerMachineIdFsReadGetResponses = {
2409
2624
  export type FsReadV1ComputerMachineIdFsReadGetResponse = FsReadV1ComputerMachineIdFsReadGetResponses[keyof FsReadV1ComputerMachineIdFsReadGetResponses];
2410
2625
  export type FsWriteV1ComputerMachineIdFsWritePostData = {
2411
2626
  body: FileWriteRequest;
2627
+ headers?: {
2628
+ /**
2629
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2630
+ */
2631
+ 'Idempotency-Key'?: string;
2632
+ };
2412
2633
  path: {
2413
2634
  machine_id: string;
2414
2635
  };
@@ -2433,6 +2654,12 @@ export type FsWriteV1ComputerMachineIdFsWritePostResponses = {
2433
2654
  export type FsWriteV1ComputerMachineIdFsWritePostResponse = FsWriteV1ComputerMachineIdFsWritePostResponses[keyof FsWriteV1ComputerMachineIdFsWritePostResponses];
2434
2655
  export type PowershellExecV1ComputerMachineIdShellPowershellExecPostData = {
2435
2656
  body: PowerShellExecRequest;
2657
+ headers?: {
2658
+ /**
2659
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2660
+ */
2661
+ 'Idempotency-Key'?: string;
2662
+ };
2436
2663
  path: {
2437
2664
  machine_id: string;
2438
2665
  };
@@ -2457,6 +2684,12 @@ export type PowershellExecV1ComputerMachineIdShellPowershellExecPostResponses =
2457
2684
  export type PowershellExecV1ComputerMachineIdShellPowershellExecPostResponse = PowershellExecV1ComputerMachineIdShellPowershellExecPostResponses[keyof PowershellExecV1ComputerMachineIdShellPowershellExecPostResponses];
2458
2685
  export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData = {
2459
2686
  body: PowerShellSessionRequest;
2687
+ headers?: {
2688
+ /**
2689
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2690
+ */
2691
+ 'Idempotency-Key'?: string;
2692
+ };
2460
2693
  path: {
2461
2694
  machine_id: string;
2462
2695
  };
@@ -2481,6 +2714,12 @@ export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostRespon
2481
2714
  export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponse = PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponses[keyof PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponses];
2482
2715
  export type DummyTestEndpointV1TestPostData = {
2483
2716
  body?: never;
2717
+ headers?: {
2718
+ /**
2719
+ * Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.
2720
+ */
2721
+ 'Idempotency-Key'?: string;
2722
+ };
2484
2723
  path?: never;
2485
2724
  query?: never;
2486
2725
  url: '/v1/test';
@@ -2518,6 +2757,30 @@ export type RootGetResponses = {
2518
2757
  */
2519
2758
  200: unknown;
2520
2759
  };
2760
+ export type HealthLiveHealthLiveGetData = {
2761
+ body?: never;
2762
+ path?: never;
2763
+ query?: never;
2764
+ url: '/health/live';
2765
+ };
2766
+ export type HealthLiveHealthLiveGetResponses = {
2767
+ /**
2768
+ * Successful Response
2769
+ */
2770
+ 200: unknown;
2771
+ };
2772
+ export type HealthReadyHealthReadyGetData = {
2773
+ body?: never;
2774
+ path?: never;
2775
+ query?: never;
2776
+ url: '/health/ready';
2777
+ };
2778
+ export type HealthReadyHealthReadyGetResponses = {
2779
+ /**
2780
+ * Successful Response
2781
+ */
2782
+ 200: unknown;
2783
+ };
2521
2784
  export type HealthHealthGetData = {
2522
2785
  body?: never;
2523
2786
  path?: never;
@@ -2528,11 +2791,8 @@ export type HealthHealthGetResponses = {
2528
2791
  /**
2529
2792
  * Successful Response
2530
2793
  */
2531
- 200: {
2532
- [key: string]: unknown;
2533
- };
2794
+ 200: unknown;
2534
2795
  };
2535
- export type HealthHealthGetResponse = HealthHealthGetResponses[keyof HealthHealthGetResponses];
2536
2796
  export type HealthDbHealthDbGetData = {
2537
2797
  body?: never;
2538
2798
  path?: never;
package/dist/index.d.ts CHANGED
@@ -30,13 +30,72 @@ export * from './client/types.gen';
30
30
  export * from './client/sdk.gen';
31
31
  export * from './client/client.gen';
32
32
  /**
33
- * Client options for configuring retry behavior and other settings
33
+ * Client options for configuring the SDK
34
34
  */
35
35
  export interface CyberdeskClientOptions {
36
- /** Maximum number of retry attempts (default: 2, meaning 3 total attempts) */
37
- maxRetries?: number;
38
36
  /** Custom fetch implementation (for testing or advanced use cases) */
39
37
  fetch?: typeof fetch;
38
+ /** Retry configuration for transient failures (network errors, 5xx, 429, etc.). */
39
+ retry?: CyberdeskRetryOptions;
40
+ /** Idempotency configuration (auto-adds Idempotency-Key for write requests). */
41
+ idempotency?: CyberdeskIdempotencyOptions;
42
+ }
43
+ export interface CyberdeskRetryOptions {
44
+ /**
45
+ * Number of retries after the initial attempt.
46
+ * Total attempts = 1 + maxRetries.
47
+ *
48
+ * Default: 3
49
+ */
50
+ maxRetries?: number;
51
+ /**
52
+ * Per-attempt timeout in milliseconds.
53
+ *
54
+ * Default: 30000 (30s)
55
+ */
56
+ timeoutMs?: number;
57
+ /**
58
+ * Initial backoff delay in milliseconds (before exponential growth + jitter).
59
+ *
60
+ * Default: 250ms
61
+ */
62
+ minDelayMs?: number;
63
+ /**
64
+ * Maximum backoff delay in milliseconds.
65
+ *
66
+ * Default: 8000ms
67
+ */
68
+ maxDelayMs?: number;
69
+ /**
70
+ * Called before a retry is scheduled (useful for logging/metrics).
71
+ */
72
+ onRetry?: (info: {
73
+ attempt: number;
74
+ maxRetries: number;
75
+ delayMs: number;
76
+ reason: 'timeout' | 'network_error' | 'http_status';
77
+ status?: number;
78
+ }) => void;
79
+ }
80
+ export interface CyberdeskIdempotencyOptions {
81
+ /**
82
+ * Enable automatic idempotency keys for write requests (POST/PUT/PATCH/DELETE).
83
+ *
84
+ * Default: true
85
+ */
86
+ enabled?: boolean;
87
+ /**
88
+ * Header name to use.
89
+ *
90
+ * Default: 'Idempotency-Key'
91
+ */
92
+ headerName?: string;
93
+ /**
94
+ * Custom generator for idempotency keys.
95
+ *
96
+ * Default: crypto.randomUUID() (with fallback)
97
+ */
98
+ generateKey?: () => string;
40
99
  }
41
100
  /**
42
101
  * Create a Cyberdesk API client
@@ -44,7 +103,6 @@ export interface CyberdeskClientOptions {
44
103
  * @param apiKey - Your Cyberdesk API key
45
104
  * @param baseUrl - Optional API base URL (defaults to https://api.cyberdesk.io)
46
105
  * @param options - Optional client configuration
47
- * @param options.maxRetries - Maximum retry attempts for failed requests (default: 2)
48
106
  * @returns Configured client with all API endpoints
49
107
  *
50
108
  * @example
@@ -52,12 +110,6 @@ export interface CyberdeskClientOptions {
52
110
  * // Basic usage
53
111
  * const client = createCyberdeskClient('your-api-key');
54
112
  * const machines = await client.machines.list();
55
- *
56
- * // With custom retry configuration
57
- * const client = createCyberdeskClient('your-api-key', undefined, { maxRetries: 3 });
58
- *
59
- * // Disable retries
60
- * const client = createCyberdeskClient('your-api-key', undefined, { maxRetries: 0 });
61
113
  * ```
62
114
  */
63
115
  export declare function createCyberdeskClient(apiKey: string, baseUrl?: string, options?: CyberdeskClientOptions): {
package/dist/index.js CHANGED
@@ -52,172 +52,196 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.createCyberdeskClient = createCyberdeskClient;
54
54
  const client_fetch_1 = require("@hey-api/client-fetch");
55
- // ============================================================================
56
- // Retry Configuration (Stripe SDK-style)
57
- // ============================================================================
58
- /** Default number of retry attempts (2 retries = 3 total attempts, like Stripe) */
59
- const DEFAULT_MAX_RETRIES = 2;
60
- /** Initial retry delay in milliseconds */
61
- const INITIAL_RETRY_DELAY_MS = 500;
62
- /** Maximum retry delay in milliseconds */
63
- const MAX_RETRY_DELAY_MS = 5000;
64
- /** HTTP status codes that should trigger a retry */
65
- const RETRYABLE_STATUS_CODES = new Set([
66
- 408, // Request Timeout
67
- 409, // Conflict (can be retried with idempotency)
68
- 429, // Too Many Requests
69
- 500, // Internal Server Error
70
- 502, // Bad Gateway
71
- 503, // Service Unavailable
72
- 504, // Gateway Timeout
73
- ]);
74
- /**
75
- * Determines if an error is a retryable network error
76
- *
77
- * Note: AbortError (from AbortController.abort()) is NOT retried because:
78
- * - It indicates intentional cancellation by the caller
79
- * - The abort signal remains aborted, so retries would fail immediately
80
- * - Retrying would waste attempts and delay error propagation
81
- */
82
- function isNetworkError(error) {
83
- // AbortError means intentional cancellation - don't retry
84
- if (error instanceof DOMException && error.name === 'AbortError') {
85
- return false;
86
- }
87
- if (error instanceof TypeError) {
88
- const message = error.message.toLowerCase();
89
- return (message.includes('fetch') ||
90
- message.includes('network') ||
91
- message.includes('failed') ||
92
- message.includes('timeout'));
93
- }
94
- return false;
95
- }
96
- /**
97
- * Determines if a response status code should trigger a retry
98
- */
99
- function shouldRetryResponse(response) {
100
- return RETRYABLE_STATUS_CODES.has(response.status);
55
+ // Import SDK methods from sdk.gen
56
+ const sdk_gen_1 = require("./client/sdk.gen");
57
+ // Export all generated types and methods for direct use
58
+ __exportStar(require("./client/types.gen"), exports);
59
+ __exportStar(require("./client/sdk.gen"), exports);
60
+ __exportStar(require("./client/client.gen"), exports);
61
+ // Configuration
62
+ /** Default API base URL for Cyberdesk Cloud API */
63
+ const DEFAULT_API_BASE_URL = "https://api.cyberdesk.io";
64
+ function sleep(ms) {
65
+ return new Promise((resolve) => setTimeout(resolve, ms));
101
66
  }
102
- /**
103
- * Calculate delay for exponential backoff with full jitter (Stripe-style)
104
- *
105
- * Formula: min(cap, random(0, base * 2^attempt))
106
- * This provides better distribution than adding jitter to exponential backoff
107
- */
108
- function calculateRetryDelay(attempt, retryAfterMs) {
109
- if (retryAfterMs && retryAfterMs > 0) {
110
- // Respect server's Retry-After header, but cap it
111
- return Math.min(retryAfterMs, MAX_RETRY_DELAY_MS);
67
+ function defaultGenerateIdempotencyKey() {
68
+ // Browser + modern Node runtimes
69
+ const anyCrypto = globalThis.crypto;
70
+ if (anyCrypto && typeof anyCrypto.randomUUID === 'function') {
71
+ return anyCrypto.randomUUID();
112
72
  }
113
- // Full jitter exponential backoff
114
- const exponentialDelay = INITIAL_RETRY_DELAY_MS * Math.pow(2, attempt);
115
- const maxDelay = Math.min(exponentialDelay, MAX_RETRY_DELAY_MS);
116
- return Math.random() * maxDelay;
73
+ // Fallback: not a UUID but sufficiently unique for idempotency keys
74
+ return `${Date.now()}-${Math.random().toString(16).slice(2)}-${Math.random().toString(16).slice(2)}`;
117
75
  }
118
- /**
119
- * Parse Retry-After header value to milliseconds
120
- */
121
- function parseRetryAfter(response) {
122
- const retryAfter = response.headers.get('Retry-After');
76
+ function parseRetryAfterMs(retryAfter) {
123
77
  if (!retryAfter)
124
- return undefined;
125
- // Try parsing as seconds (integer)
126
- const seconds = parseInt(retryAfter, 10);
127
- if (!isNaN(seconds)) {
78
+ return null;
79
+ const trimmed = retryAfter.trim();
80
+ if (!trimmed)
81
+ return null;
82
+ // Seconds
83
+ if (/^\d+$/.test(trimmed)) {
84
+ const seconds = Number(trimmed);
85
+ if (!Number.isFinite(seconds) || seconds < 0)
86
+ return null;
128
87
  return seconds * 1000;
129
88
  }
130
- // Try parsing as HTTP date
131
- const date = Date.parse(retryAfter);
132
- if (!isNaN(date)) {
133
- return Math.max(0, date - Date.now());
134
- }
135
- return undefined;
89
+ // HTTP date
90
+ const dateMs = Date.parse(trimmed);
91
+ if (Number.isNaN(dateMs))
92
+ return null;
93
+ const delta = dateMs - Date.now();
94
+ return delta > 0 ? delta : 0;
136
95
  }
137
- /**
138
- * Sleep for a specified duration
139
- */
140
- function sleep(ms) {
141
- return new Promise(resolve => setTimeout(resolve, ms));
96
+ function isWriteMethod(method) {
97
+ const m = method.toUpperCase();
98
+ return m === 'POST' || m === 'PUT' || m === 'PATCH' || m === 'DELETE';
142
99
  }
143
- /**
144
- * Creates a fetch wrapper with automatic retry logic
145
- *
146
- * Implements Stripe-style retry behavior:
147
- * - Retries on network errors (connection failures, timeouts)
148
- * - Retries on 5xx server errors and 429 (rate limit)
149
- * - Does NOT retry on 4xx client errors (except 408, 409, 429)
150
- * - Uses exponential backoff with full jitter
151
- * - Respects Retry-After headers
152
- */
153
- function createRetryFetch(maxRetries = DEFAULT_MAX_RETRIES) {
154
- return function retryFetch(input, init) {
155
- return __awaiter(this, void 0, void 0, function* () {
156
- let lastError;
157
- let lastResponse;
158
- for (let attempt = 0; attempt <= maxRetries; attempt++) {
159
- try {
160
- // Use globalThis.fetch directly bound to avoid "Illegal invocation"
161
- const response = yield globalThis.fetch(input, init);
162
- // Success - return immediately
163
- if (!shouldRetryResponse(response)) {
164
- return response;
165
- }
166
- // Store response for potential retry
167
- lastResponse = response;
168
- // Don't retry on last attempt
169
- if (attempt === maxRetries) {
170
- return response;
171
- }
172
- // Calculate delay with Retry-After header support
173
- const retryAfterMs = parseRetryAfter(response);
174
- const delay = calculateRetryDelay(attempt, retryAfterMs);
175
- yield sleep(delay);
100
+ function isRetryableStatus(status, response) {
101
+ var _a;
102
+ // Standard transient statuses
103
+ if (status === 408 || status === 429 || status === 500 || status === 502 || status === 503 || status === 504) {
104
+ return true;
105
+ }
106
+ // Special-case: idempotency in progress (API returns 409 + Retry-After + Idempotency-Status)
107
+ if (status === 409 && response) {
108
+ const idemStatus = (_a = response.headers.get('Idempotency-Status')) === null || _a === void 0 ? void 0 : _a.toLowerCase();
109
+ if (idemStatus === 'in_progress')
110
+ return true;
111
+ }
112
+ return false;
113
+ }
114
+ function createRetryingFetch(baseFetch, opts) {
115
+ return (input, init) => __awaiter(this, void 0, void 0, function* () {
116
+ var _a, _b, _c, _d, _e;
117
+ const retry = opts.retry;
118
+ const idempotency = opts.idempotency;
119
+ const baseMethod = ((_a = init === null || init === void 0 ? void 0 : init.method) !== null && _a !== void 0 ? _a : (input instanceof Request ? input.method : 'GET')).toUpperCase();
120
+ const shouldAddIdempotency = idempotency.enabled && isWriteMethod(baseMethod);
121
+ // Build merged headers once, and reuse across attempts
122
+ const headers = new Headers();
123
+ if (input instanceof Request) {
124
+ input.headers.forEach((v, k) => headers.set(k, v));
125
+ }
126
+ if (init === null || init === void 0 ? void 0 : init.headers) {
127
+ new Headers(init.headers).forEach((v, k) => headers.set(k, v));
128
+ }
129
+ let idempotencyKey = null;
130
+ if (shouldAddIdempotency) {
131
+ const headerName = idempotency.headerName || 'Idempotency-Key';
132
+ if (!headers.has(headerName)) {
133
+ idempotencyKey = idempotency.generateKey();
134
+ headers.set(headerName, idempotencyKey);
135
+ }
136
+ }
137
+ // If we cannot ensure idempotency for a write request, do not retry by default (unsafe).
138
+ const writeRequestWithoutIdempotency = isWriteMethod(baseMethod) && !(idempotencyKey || headers.has(idempotency.headerName || 'Idempotency-Key'));
139
+ const maxRetries = Math.max(0, retry.maxRetries);
140
+ const totalAttempts = 1 + maxRetries;
141
+ let lastError;
142
+ for (let attempt = 0; attempt < totalAttempts; attempt++) {
143
+ // Per-attempt timeout
144
+ const controller = new AbortController();
145
+ const timeout = setTimeout(() => controller.abort(), retry.timeoutMs);
146
+ // Respect caller-provided AbortSignal, if any
147
+ const parentSignal = (_b = init === null || init === void 0 ? void 0 : init.signal) !== null && _b !== void 0 ? _b : (input instanceof Request ? input.signal : undefined);
148
+ if (parentSignal) {
149
+ if (parentSignal.aborted) {
150
+ clearTimeout(timeout);
151
+ throw new DOMException('The operation was aborted.', 'AbortError');
176
152
  }
177
- catch (error) {
178
- lastError = error;
179
- // Only retry on network errors
180
- if (!isNetworkError(error)) {
181
- throw error;
182
- }
183
- // Don't retry on last attempt
184
- if (attempt === maxRetries) {
185
- throw error;
186
- }
187
- const delay = calculateRetryDelay(attempt);
188
- yield sleep(delay);
153
+ const onAbort = () => controller.abort();
154
+ parentSignal.addEventListener('abort', onAbort, { once: true });
155
+ // Best-effort cleanup handled below when fetch resolves/rejects
156
+ }
157
+ try {
158
+ // Use a fresh Request object each attempt when possible (avoids body reuse issues).
159
+ const attemptInput = input instanceof Request ? input.clone() : input;
160
+ const attemptInit = Object.assign(Object.assign({}, init), { method: baseMethod, headers, signal: controller.signal });
161
+ const response = yield baseFetch(attemptInput, attemptInit);
162
+ clearTimeout(timeout);
163
+ if (!isRetryableStatus(response.status, response) || attempt === maxRetries) {
164
+ return response;
189
165
  }
166
+ if (writeRequestWithoutIdempotency) {
167
+ return response;
168
+ }
169
+ const retryAfterMs = parseRetryAfterMs(response.headers.get('Retry-After'));
170
+ const expBackoff = Math.min(retry.maxDelayMs, retry.minDelayMs * Math.pow(2, attempt));
171
+ const jittered = Math.floor(Math.random() * expBackoff);
172
+ const delayMs = Math.max(0, Math.min(retry.maxDelayMs, retryAfterMs !== null && retryAfterMs !== void 0 ? retryAfterMs : jittered));
173
+ (_c = retry.onRetry) === null || _c === void 0 ? void 0 : _c.call(retry, {
174
+ attempt,
175
+ maxRetries,
176
+ delayMs,
177
+ reason: 'http_status',
178
+ status: response.status,
179
+ });
180
+ yield sleep(delayMs);
181
+ continue;
190
182
  }
191
- // This should never be reached, but TypeScript needs it
192
- if (lastResponse) {
193
- return lastResponse;
183
+ catch (err) {
184
+ clearTimeout(timeout);
185
+ // If caller aborted, don't retry
186
+ const isAbort = (err instanceof DOMException && err.name === 'AbortError') ||
187
+ (typeof err === 'object' && err !== null && err.name === 'AbortError');
188
+ if (isAbort) {
189
+ // If our timeout triggered, we can retry; if caller aborted, we should not.
190
+ const callerAborted = (parentSignal === null || parentSignal === void 0 ? void 0 : parentSignal.aborted) === true;
191
+ if (callerAborted || attempt === maxRetries || writeRequestWithoutIdempotency) {
192
+ throw err;
193
+ }
194
+ const expBackoff = Math.min(retry.maxDelayMs, retry.minDelayMs * Math.pow(2, attempt));
195
+ const delayMs = Math.floor(Math.random() * expBackoff);
196
+ (_d = retry.onRetry) === null || _d === void 0 ? void 0 : _d.call(retry, { attempt, maxRetries, delayMs, reason: 'timeout' });
197
+ yield sleep(delayMs);
198
+ lastError = err;
199
+ continue;
200
+ }
201
+ if (attempt === maxRetries || writeRequestWithoutIdempotency) {
202
+ throw err;
203
+ }
204
+ const expBackoff = Math.min(retry.maxDelayMs, retry.minDelayMs * Math.pow(2, attempt));
205
+ const delayMs = Math.floor(Math.random() * expBackoff);
206
+ (_e = retry.onRetry) === null || _e === void 0 ? void 0 : _e.call(retry, { attempt, maxRetries, delayMs, reason: 'network_error' });
207
+ yield sleep(delayMs);
208
+ lastError = err;
209
+ continue;
194
210
  }
195
- throw lastError;
196
- });
197
- };
211
+ }
212
+ // Should be unreachable; keep TypeScript happy
213
+ throw lastError !== null && lastError !== void 0 ? lastError : new Error('Request failed');
214
+ });
198
215
  }
199
- // Import SDK methods from sdk.gen
200
- const sdk_gen_1 = require("./client/sdk.gen");
201
- // Export all generated types and methods for direct use
202
- __exportStar(require("./client/types.gen"), exports);
203
- __exportStar(require("./client/sdk.gen"), exports);
204
- __exportStar(require("./client/client.gen"), exports);
205
- // Configuration
206
- /** Default API base URL for Cyberdesk Cloud API */
207
- const DEFAULT_API_BASE_URL = "https://api.cyberdesk.io";
208
216
  /**
209
- * Create a configured HTTP client with authentication and automatic retries
217
+ * Create a configured HTTP client with authentication
210
218
  *
211
219
  * @internal
212
220
  * @param apiKey - Your Cyberdesk API key
213
221
  * @param baseUrl - API base URL
214
222
  * @param options - Client configuration options
215
- * @returns Configured HTTP client with retry logic
223
+ * @returns Configured HTTP client
216
224
  */
217
225
  function createApiClient(apiKey, baseUrl = DEFAULT_API_BASE_URL, options = {}) {
218
- const { maxRetries = DEFAULT_MAX_RETRIES, fetch: customFetch } = options;
219
- // Use custom fetch if provided, otherwise create retry-enabled fetch
220
- const fetchWithRetry = customFetch !== null && customFetch !== void 0 ? customFetch : createRetryFetch(maxRetries);
226
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
227
+ const { fetch: customFetch } = options;
228
+ const baseFetch = customFetch !== null && customFetch !== void 0 ? customFetch : fetch;
229
+ const retryOptions = {
230
+ maxRetries: (_b = (_a = options.retry) === null || _a === void 0 ? void 0 : _a.maxRetries) !== null && _b !== void 0 ? _b : 3,
231
+ timeoutMs: (_d = (_c = options.retry) === null || _c === void 0 ? void 0 : _c.timeoutMs) !== null && _d !== void 0 ? _d : 30000,
232
+ minDelayMs: (_f = (_e = options.retry) === null || _e === void 0 ? void 0 : _e.minDelayMs) !== null && _f !== void 0 ? _f : 250,
233
+ maxDelayMs: (_h = (_g = options.retry) === null || _g === void 0 ? void 0 : _g.maxDelayMs) !== null && _h !== void 0 ? _h : 8000,
234
+ onRetry: (_j = options.retry) === null || _j === void 0 ? void 0 : _j.onRetry,
235
+ };
236
+ const idempotencyOptions = {
237
+ enabled: (_l = (_k = options.idempotency) === null || _k === void 0 ? void 0 : _k.enabled) !== null && _l !== void 0 ? _l : true,
238
+ headerName: (_o = (_m = options.idempotency) === null || _m === void 0 ? void 0 : _m.headerName) !== null && _o !== void 0 ? _o : 'Idempotency-Key',
239
+ generateKey: (_q = (_p = options.idempotency) === null || _p === void 0 ? void 0 : _p.generateKey) !== null && _q !== void 0 ? _q : defaultGenerateIdempotencyKey,
240
+ };
241
+ const wrappedFetch = createRetryingFetch(baseFetch, {
242
+ retry: retryOptions,
243
+ idempotency: idempotencyOptions,
244
+ });
221
245
  return (0, client_fetch_1.createClient)({
222
246
  baseUrl,
223
247
  headers: {
@@ -225,7 +249,7 @@ function createApiClient(apiKey, baseUrl = DEFAULT_API_BASE_URL, options = {}) {
225
249
  'Authorization': `Bearer ${apiKey}`,
226
250
  'Connection': 'keep-alive',
227
251
  },
228
- fetch: fetchWithRetry,
252
+ fetch: wrappedFetch,
229
253
  });
230
254
  }
231
255
  // Helpers
@@ -240,7 +264,6 @@ function toIsoUtc(value) {
240
264
  * @param apiKey - Your Cyberdesk API key
241
265
  * @param baseUrl - Optional API base URL (defaults to https://api.cyberdesk.io)
242
266
  * @param options - Optional client configuration
243
- * @param options.maxRetries - Maximum retry attempts for failed requests (default: 2)
244
267
  * @returns Configured client with all API endpoints
245
268
  *
246
269
  * @example
@@ -248,12 +271,6 @@ function toIsoUtc(value) {
248
271
  * // Basic usage
249
272
  * const client = createCyberdeskClient('your-api-key');
250
273
  * const machines = await client.machines.list();
251
- *
252
- * // With custom retry configuration
253
- * const client = createCyberdeskClient('your-api-key', undefined, { maxRetries: 3 });
254
- *
255
- * // Disable retries
256
- * const client = createCyberdeskClient('your-api-key', undefined, { maxRetries: 0 });
257
274
  * ```
258
275
  */
259
276
  function createCyberdeskClient(apiKey, baseUrl, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberdesk",
3
- "version": "2.2.6",
3
+ "version": "2.2.8",
4
4
  "description": "The official TypeScript SDK for Cyberdesk",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",