cyberdesk 2.2.7 → 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.
- package/dist/client/types.gen.d.ts +246 -0
- package/dist/index.d.ts +62 -10
- package/dist/index.js +170 -153
- package/package.json +1 -1
|
@@ -934,6 +934,12 @@ export type ListMachinesV1MachinesGetResponses = {
|
|
|
934
934
|
export type ListMachinesV1MachinesGetResponse = ListMachinesV1MachinesGetResponses[keyof ListMachinesV1MachinesGetResponses];
|
|
935
935
|
export type CreateMachineV1MachinesPostData = {
|
|
936
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
|
+
};
|
|
937
943
|
path?: never;
|
|
938
944
|
query?: never;
|
|
939
945
|
url: '/v1/machines';
|
|
@@ -954,6 +960,12 @@ export type CreateMachineV1MachinesPostResponses = {
|
|
|
954
960
|
export type CreateMachineV1MachinesPostResponse = CreateMachineV1MachinesPostResponses[keyof CreateMachineV1MachinesPostResponses];
|
|
955
961
|
export type DeleteMachineV1MachinesMachineIdDeleteData = {
|
|
956
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
|
+
};
|
|
957
969
|
path: {
|
|
958
970
|
machine_id: string;
|
|
959
971
|
};
|
|
@@ -998,6 +1010,12 @@ export type GetMachineV1MachinesMachineIdGetResponses = {
|
|
|
998
1010
|
export type GetMachineV1MachinesMachineIdGetResponse = GetMachineV1MachinesMachineIdGetResponses[keyof GetMachineV1MachinesMachineIdGetResponses];
|
|
999
1011
|
export type UpdateMachineV1MachinesMachineIdPatchData = {
|
|
1000
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
|
+
};
|
|
1001
1019
|
path: {
|
|
1002
1020
|
machine_id: string;
|
|
1003
1021
|
};
|
|
@@ -1042,6 +1060,12 @@ export type GetMachinePoolsV1MachinesMachineIdPoolsGetResponses = {
|
|
|
1042
1060
|
export type GetMachinePoolsV1MachinesMachineIdPoolsGetResponse = GetMachinePoolsV1MachinesMachineIdPoolsGetResponses[keyof GetMachinePoolsV1MachinesMachineIdPoolsGetResponses];
|
|
1043
1061
|
export type UpdateMachinePoolsV1MachinesMachineIdPoolsPutData = {
|
|
1044
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
|
+
};
|
|
1045
1069
|
path: {
|
|
1046
1070
|
machine_id: string;
|
|
1047
1071
|
};
|
|
@@ -1087,6 +1111,12 @@ export type ListPoolsV1PoolsGetResponses = {
|
|
|
1087
1111
|
export type ListPoolsV1PoolsGetResponse = ListPoolsV1PoolsGetResponses[keyof ListPoolsV1PoolsGetResponses];
|
|
1088
1112
|
export type CreatePoolV1PoolsPostData = {
|
|
1089
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
|
+
};
|
|
1090
1120
|
path?: never;
|
|
1091
1121
|
query?: never;
|
|
1092
1122
|
url: '/v1/pools';
|
|
@@ -1107,6 +1137,12 @@ export type CreatePoolV1PoolsPostResponses = {
|
|
|
1107
1137
|
export type CreatePoolV1PoolsPostResponse = CreatePoolV1PoolsPostResponses[keyof CreatePoolV1PoolsPostResponses];
|
|
1108
1138
|
export type DeletePoolV1PoolsPoolIdDeleteData = {
|
|
1109
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
|
+
};
|
|
1110
1146
|
path: {
|
|
1111
1147
|
pool_id: string;
|
|
1112
1148
|
};
|
|
@@ -1156,6 +1192,12 @@ export type GetPoolV1PoolsPoolIdGetResponses = {
|
|
|
1156
1192
|
export type GetPoolV1PoolsPoolIdGetResponse = GetPoolV1PoolsPoolIdGetResponses[keyof GetPoolV1PoolsPoolIdGetResponses];
|
|
1157
1193
|
export type UpdatePoolV1PoolsPoolIdPatchData = {
|
|
1158
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
|
+
};
|
|
1159
1201
|
path: {
|
|
1160
1202
|
pool_id: string;
|
|
1161
1203
|
};
|
|
@@ -1178,6 +1220,12 @@ export type UpdatePoolV1PoolsPoolIdPatchResponses = {
|
|
|
1178
1220
|
export type UpdatePoolV1PoolsPoolIdPatchResponse = UpdatePoolV1PoolsPoolIdPatchResponses[keyof UpdatePoolV1PoolsPoolIdPatchResponses];
|
|
1179
1221
|
export type RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteData = {
|
|
1180
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
|
+
};
|
|
1181
1229
|
path: {
|
|
1182
1230
|
pool_id: string;
|
|
1183
1231
|
};
|
|
@@ -1200,6 +1248,12 @@ export type RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponses = {
|
|
|
1200
1248
|
export type RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponse = RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponses[keyof RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteResponses];
|
|
1201
1249
|
export type AddMachinesToPoolV1PoolsPoolIdMachinesPostData = {
|
|
1202
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
|
+
};
|
|
1203
1257
|
path: {
|
|
1204
1258
|
pool_id: string;
|
|
1205
1259
|
};
|
|
@@ -1261,6 +1315,12 @@ export type ListWorkflowsV1WorkflowsGetResponses = {
|
|
|
1261
1315
|
export type ListWorkflowsV1WorkflowsGetResponse = ListWorkflowsV1WorkflowsGetResponses[keyof ListWorkflowsV1WorkflowsGetResponses];
|
|
1262
1316
|
export type CreateWorkflowV1WorkflowsPostData = {
|
|
1263
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
|
+
};
|
|
1264
1324
|
path?: never;
|
|
1265
1325
|
query?: never;
|
|
1266
1326
|
url: '/v1/workflows';
|
|
@@ -1281,6 +1341,12 @@ export type CreateWorkflowV1WorkflowsPostResponses = {
|
|
|
1281
1341
|
export type CreateWorkflowV1WorkflowsPostResponse = CreateWorkflowV1WorkflowsPostResponses[keyof CreateWorkflowV1WorkflowsPostResponses];
|
|
1282
1342
|
export type DeleteWorkflowV1WorkflowsWorkflowIdDeleteData = {
|
|
1283
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
|
+
};
|
|
1284
1350
|
path: {
|
|
1285
1351
|
workflow_id: string;
|
|
1286
1352
|
};
|
|
@@ -1325,6 +1391,12 @@ export type GetWorkflowV1WorkflowsWorkflowIdGetResponses = {
|
|
|
1325
1391
|
export type GetWorkflowV1WorkflowsWorkflowIdGetResponse = GetWorkflowV1WorkflowsWorkflowIdGetResponses[keyof GetWorkflowV1WorkflowsWorkflowIdGetResponses];
|
|
1326
1392
|
export type UpdateWorkflowV1WorkflowsWorkflowIdPatchData = {
|
|
1327
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
|
+
};
|
|
1328
1400
|
path: {
|
|
1329
1401
|
workflow_id: string;
|
|
1330
1402
|
};
|
|
@@ -1422,6 +1494,12 @@ export type ListRunsV1RunsGetResponses = {
|
|
|
1422
1494
|
export type ListRunsV1RunsGetResponse = ListRunsV1RunsGetResponses[keyof ListRunsV1RunsGetResponses];
|
|
1423
1495
|
export type CreateRunV1RunsPostData = {
|
|
1424
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
|
+
};
|
|
1425
1503
|
path?: never;
|
|
1426
1504
|
query?: never;
|
|
1427
1505
|
url: '/v1/runs';
|
|
@@ -1442,6 +1520,12 @@ export type CreateRunV1RunsPostResponses = {
|
|
|
1442
1520
|
export type CreateRunV1RunsPostResponse = CreateRunV1RunsPostResponses[keyof CreateRunV1RunsPostResponses];
|
|
1443
1521
|
export type DeleteRunV1RunsRunIdDeleteData = {
|
|
1444
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
|
+
};
|
|
1445
1529
|
path: {
|
|
1446
1530
|
run_id: string;
|
|
1447
1531
|
};
|
|
@@ -1486,6 +1570,12 @@ export type GetRunV1RunsRunIdGetResponses = {
|
|
|
1486
1570
|
export type GetRunV1RunsRunIdGetResponse = GetRunV1RunsRunIdGetResponses[keyof GetRunV1RunsRunIdGetResponses];
|
|
1487
1571
|
export type UpdateRunV1RunsRunIdPatchData = {
|
|
1488
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
|
+
};
|
|
1489
1579
|
path: {
|
|
1490
1580
|
run_id: string;
|
|
1491
1581
|
};
|
|
@@ -1508,6 +1598,12 @@ export type UpdateRunV1RunsRunIdPatchResponses = {
|
|
|
1508
1598
|
export type UpdateRunV1RunsRunIdPatchResponse = UpdateRunV1RunsRunIdPatchResponses[keyof UpdateRunV1RunsRunIdPatchResponses];
|
|
1509
1599
|
export type CreateRunChainV1RunsChainPostData = {
|
|
1510
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
|
+
};
|
|
1511
1607
|
path?: never;
|
|
1512
1608
|
query?: never;
|
|
1513
1609
|
url: '/v1/runs/chain';
|
|
@@ -1528,6 +1624,12 @@ export type CreateRunChainV1RunsChainPostResponses = {
|
|
|
1528
1624
|
export type CreateRunChainV1RunsChainPostResponse = CreateRunChainV1RunsChainPostResponses[keyof CreateRunChainV1RunsChainPostResponses];
|
|
1529
1625
|
export type BulkCreateRunsV1RunsBulkPostData = {
|
|
1530
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
|
+
};
|
|
1531
1633
|
path?: never;
|
|
1532
1634
|
query?: never;
|
|
1533
1635
|
url: '/v1/runs/bulk';
|
|
@@ -1548,6 +1650,12 @@ export type BulkCreateRunsV1RunsBulkPostResponses = {
|
|
|
1548
1650
|
export type BulkCreateRunsV1RunsBulkPostResponse = BulkCreateRunsV1RunsBulkPostResponses[keyof BulkCreateRunsV1RunsBulkPostResponses];
|
|
1549
1651
|
export type RetryRunV1RunsRunIdRetryPostData = {
|
|
1550
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
|
+
};
|
|
1551
1659
|
path: {
|
|
1552
1660
|
run_id: string;
|
|
1553
1661
|
};
|
|
@@ -1601,6 +1709,12 @@ export type ListRunAttachmentsV1RunAttachmentsGetResponses = {
|
|
|
1601
1709
|
export type ListRunAttachmentsV1RunAttachmentsGetResponse = ListRunAttachmentsV1RunAttachmentsGetResponses[keyof ListRunAttachmentsV1RunAttachmentsGetResponses];
|
|
1602
1710
|
export type CreateRunAttachmentV1RunAttachmentsPostData = {
|
|
1603
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
|
+
};
|
|
1604
1718
|
path?: never;
|
|
1605
1719
|
query?: never;
|
|
1606
1720
|
url: '/v1/run-attachments';
|
|
@@ -1621,6 +1735,12 @@ export type CreateRunAttachmentV1RunAttachmentsPostResponses = {
|
|
|
1621
1735
|
export type CreateRunAttachmentV1RunAttachmentsPostResponse = CreateRunAttachmentV1RunAttachmentsPostResponses[keyof CreateRunAttachmentV1RunAttachmentsPostResponses];
|
|
1622
1736
|
export type DeleteRunAttachmentV1RunAttachmentsAttachmentIdDeleteData = {
|
|
1623
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
|
+
};
|
|
1624
1744
|
path: {
|
|
1625
1745
|
attachment_id: string;
|
|
1626
1746
|
};
|
|
@@ -1665,6 +1785,12 @@ export type GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponses = {
|
|
|
1665
1785
|
export type GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponse = GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponses[keyof GetRunAttachmentV1RunAttachmentsAttachmentIdGetResponses];
|
|
1666
1786
|
export type UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutData = {
|
|
1667
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
|
+
};
|
|
1668
1794
|
path: {
|
|
1669
1795
|
attachment_id: string;
|
|
1670
1796
|
};
|
|
@@ -1767,6 +1893,12 @@ export type ListConnectionsV1ConnectionsGetResponses = {
|
|
|
1767
1893
|
export type ListConnectionsV1ConnectionsGetResponse = ListConnectionsV1ConnectionsGetResponses[keyof ListConnectionsV1ConnectionsGetResponses];
|
|
1768
1894
|
export type CreateConnectionV1ConnectionsPostData = {
|
|
1769
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
|
+
};
|
|
1770
1902
|
path?: never;
|
|
1771
1903
|
query?: never;
|
|
1772
1904
|
url: '/v1/connections';
|
|
@@ -1787,6 +1919,12 @@ export type CreateConnectionV1ConnectionsPostResponses = {
|
|
|
1787
1919
|
export type CreateConnectionV1ConnectionsPostResponse = CreateConnectionV1ConnectionsPostResponses[keyof CreateConnectionV1ConnectionsPostResponses];
|
|
1788
1920
|
export type DeleteConnectionV1ConnectionsConnectionIdDeleteData = {
|
|
1789
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
|
+
};
|
|
1790
1928
|
path: {
|
|
1791
1929
|
connection_id: string;
|
|
1792
1930
|
};
|
|
@@ -1831,6 +1969,12 @@ export type GetConnectionV1ConnectionsConnectionIdGetResponses = {
|
|
|
1831
1969
|
export type GetConnectionV1ConnectionsConnectionIdGetResponse = GetConnectionV1ConnectionsConnectionIdGetResponses[keyof GetConnectionV1ConnectionsConnectionIdGetResponses];
|
|
1832
1970
|
export type UpdateConnectionV1ConnectionsConnectionIdPatchData = {
|
|
1833
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
|
+
};
|
|
1834
1978
|
path: {
|
|
1835
1979
|
connection_id: string;
|
|
1836
1980
|
};
|
|
@@ -1888,6 +2032,12 @@ export type ListRequestLogsV1RequestLogsGetResponses = {
|
|
|
1888
2032
|
export type ListRequestLogsV1RequestLogsGetResponse = ListRequestLogsV1RequestLogsGetResponses[keyof ListRequestLogsV1RequestLogsGetResponses];
|
|
1889
2033
|
export type CreateRequestLogV1RequestLogsPostData = {
|
|
1890
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
|
+
};
|
|
1891
2041
|
path?: never;
|
|
1892
2042
|
query?: never;
|
|
1893
2043
|
url: '/v1/request-logs';
|
|
@@ -1908,6 +2058,12 @@ export type CreateRequestLogV1RequestLogsPostResponses = {
|
|
|
1908
2058
|
export type CreateRequestLogV1RequestLogsPostResponse = CreateRequestLogV1RequestLogsPostResponses[keyof CreateRequestLogV1RequestLogsPostResponses];
|
|
1909
2059
|
export type DeleteRequestLogV1RequestLogsLogIdDeleteData = {
|
|
1910
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
|
+
};
|
|
1911
2067
|
path: {
|
|
1912
2068
|
log_id: string;
|
|
1913
2069
|
};
|
|
@@ -1952,6 +2108,12 @@ export type GetRequestLogV1RequestLogsLogIdGetResponses = {
|
|
|
1952
2108
|
export type GetRequestLogV1RequestLogsLogIdGetResponse = GetRequestLogV1RequestLogsLogIdGetResponses[keyof GetRequestLogV1RequestLogsLogIdGetResponses];
|
|
1953
2109
|
export type UpdateRequestLogV1RequestLogsLogIdPatchData = {
|
|
1954
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
|
+
};
|
|
1955
2117
|
path: {
|
|
1956
2118
|
log_id: string;
|
|
1957
2119
|
};
|
|
@@ -2021,6 +2183,12 @@ export type ListTrajectoriesV1TrajectoriesGetResponses = {
|
|
|
2021
2183
|
export type ListTrajectoriesV1TrajectoriesGetResponse = ListTrajectoriesV1TrajectoriesGetResponses[keyof ListTrajectoriesV1TrajectoriesGetResponses];
|
|
2022
2184
|
export type CreateTrajectoryV1TrajectoriesPostData = {
|
|
2023
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
|
+
};
|
|
2024
2192
|
path?: never;
|
|
2025
2193
|
query?: never;
|
|
2026
2194
|
url: '/v1/trajectories';
|
|
@@ -2041,6 +2209,12 @@ export type CreateTrajectoryV1TrajectoriesPostResponses = {
|
|
|
2041
2209
|
export type CreateTrajectoryV1TrajectoriesPostResponse = CreateTrajectoryV1TrajectoriesPostResponses[keyof CreateTrajectoryV1TrajectoriesPostResponses];
|
|
2042
2210
|
export type DeleteTrajectoryV1TrajectoriesTrajectoryIdDeleteData = {
|
|
2043
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
|
+
};
|
|
2044
2218
|
path: {
|
|
2045
2219
|
trajectory_id: string;
|
|
2046
2220
|
};
|
|
@@ -2085,6 +2259,12 @@ export type GetTrajectoryV1TrajectoriesTrajectoryIdGetResponses = {
|
|
|
2085
2259
|
export type GetTrajectoryV1TrajectoriesTrajectoryIdGetResponse = GetTrajectoryV1TrajectoriesTrajectoryIdGetResponses[keyof GetTrajectoryV1TrajectoriesTrajectoryIdGetResponses];
|
|
2086
2260
|
export type UpdateTrajectoryV1TrajectoriesTrajectoryIdPatchData = {
|
|
2087
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
|
+
};
|
|
2088
2268
|
path: {
|
|
2089
2269
|
trajectory_id: string;
|
|
2090
2270
|
};
|
|
@@ -2172,6 +2352,12 @@ export type GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponses
|
|
|
2172
2352
|
export type GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponse = GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponses[keyof GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetResponses];
|
|
2173
2353
|
export type KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostData = {
|
|
2174
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
|
+
};
|
|
2175
2361
|
path: {
|
|
2176
2362
|
machine_id: string;
|
|
2177
2363
|
};
|
|
@@ -2194,6 +2380,12 @@ export type KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponses = {
|
|
|
2194
2380
|
export type KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponse = KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponses[keyof KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostResponses];
|
|
2195
2381
|
export type KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostData = {
|
|
2196
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
|
+
};
|
|
2197
2389
|
path: {
|
|
2198
2390
|
machine_id: string;
|
|
2199
2391
|
};
|
|
@@ -2216,6 +2408,12 @@ export type KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponses = {
|
|
|
2216
2408
|
export type KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponse = KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponses[keyof KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostResponses];
|
|
2217
2409
|
export type CopyToClipboardV1ComputerMachineIdCopyToClipboardPostData = {
|
|
2218
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
|
+
};
|
|
2219
2417
|
path: {
|
|
2220
2418
|
machine_id: string;
|
|
2221
2419
|
};
|
|
@@ -2262,6 +2460,12 @@ export type GetMousePositionV1ComputerMachineIdInputMousePositionGetResponses =
|
|
|
2262
2460
|
export type GetMousePositionV1ComputerMachineIdInputMousePositionGetResponse = GetMousePositionV1ComputerMachineIdInputMousePositionGetResponses[keyof GetMousePositionV1ComputerMachineIdInputMousePositionGetResponses];
|
|
2263
2461
|
export type MouseMoveV1ComputerMachineIdInputMouseMovePostData = {
|
|
2264
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
|
+
};
|
|
2265
2469
|
path: {
|
|
2266
2470
|
machine_id: string;
|
|
2267
2471
|
};
|
|
@@ -2284,6 +2488,12 @@ export type MouseMoveV1ComputerMachineIdInputMouseMovePostResponses = {
|
|
|
2284
2488
|
export type MouseMoveV1ComputerMachineIdInputMouseMovePostResponse = MouseMoveV1ComputerMachineIdInputMouseMovePostResponses[keyof MouseMoveV1ComputerMachineIdInputMouseMovePostResponses];
|
|
2285
2489
|
export type MouseClickV1ComputerMachineIdInputMouseClickPostData = {
|
|
2286
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
|
+
};
|
|
2287
2497
|
path: {
|
|
2288
2498
|
machine_id: string;
|
|
2289
2499
|
};
|
|
@@ -2306,6 +2516,12 @@ export type MouseClickV1ComputerMachineIdInputMouseClickPostResponses = {
|
|
|
2306
2516
|
export type MouseClickV1ComputerMachineIdInputMouseClickPostResponse = MouseClickV1ComputerMachineIdInputMouseClickPostResponses[keyof MouseClickV1ComputerMachineIdInputMouseClickPostResponses];
|
|
2307
2517
|
export type MouseScrollV1ComputerMachineIdInputMouseScrollPostData = {
|
|
2308
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
|
+
};
|
|
2309
2525
|
path: {
|
|
2310
2526
|
machine_id: string;
|
|
2311
2527
|
};
|
|
@@ -2328,6 +2544,12 @@ export type MouseScrollV1ComputerMachineIdInputMouseScrollPostResponses = {
|
|
|
2328
2544
|
export type MouseScrollV1ComputerMachineIdInputMouseScrollPostResponse = MouseScrollV1ComputerMachineIdInputMouseScrollPostResponses[keyof MouseScrollV1ComputerMachineIdInputMouseScrollPostResponses];
|
|
2329
2545
|
export type MouseDragV1ComputerMachineIdInputMouseDragPostData = {
|
|
2330
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
|
+
};
|
|
2331
2553
|
path: {
|
|
2332
2554
|
machine_id: string;
|
|
2333
2555
|
};
|
|
@@ -2402,6 +2624,12 @@ export type FsReadV1ComputerMachineIdFsReadGetResponses = {
|
|
|
2402
2624
|
export type FsReadV1ComputerMachineIdFsReadGetResponse = FsReadV1ComputerMachineIdFsReadGetResponses[keyof FsReadV1ComputerMachineIdFsReadGetResponses];
|
|
2403
2625
|
export type FsWriteV1ComputerMachineIdFsWritePostData = {
|
|
2404
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
|
+
};
|
|
2405
2633
|
path: {
|
|
2406
2634
|
machine_id: string;
|
|
2407
2635
|
};
|
|
@@ -2426,6 +2654,12 @@ export type FsWriteV1ComputerMachineIdFsWritePostResponses = {
|
|
|
2426
2654
|
export type FsWriteV1ComputerMachineIdFsWritePostResponse = FsWriteV1ComputerMachineIdFsWritePostResponses[keyof FsWriteV1ComputerMachineIdFsWritePostResponses];
|
|
2427
2655
|
export type PowershellExecV1ComputerMachineIdShellPowershellExecPostData = {
|
|
2428
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
|
+
};
|
|
2429
2663
|
path: {
|
|
2430
2664
|
machine_id: string;
|
|
2431
2665
|
};
|
|
@@ -2450,6 +2684,12 @@ export type PowershellExecV1ComputerMachineIdShellPowershellExecPostResponses =
|
|
|
2450
2684
|
export type PowershellExecV1ComputerMachineIdShellPowershellExecPostResponse = PowershellExecV1ComputerMachineIdShellPowershellExecPostResponses[keyof PowershellExecV1ComputerMachineIdShellPowershellExecPostResponses];
|
|
2451
2685
|
export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData = {
|
|
2452
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
|
+
};
|
|
2453
2693
|
path: {
|
|
2454
2694
|
machine_id: string;
|
|
2455
2695
|
};
|
|
@@ -2474,6 +2714,12 @@ export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostRespon
|
|
|
2474
2714
|
export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponse = PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponses[keyof PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponses];
|
|
2475
2715
|
export type DummyTestEndpointV1TestPostData = {
|
|
2476
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
|
+
};
|
|
2477
2723
|
path?: never;
|
|
2478
2724
|
query?: never;
|
|
2479
2725
|
url: '/v1/test';
|
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
|
|
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
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
//
|
|
114
|
-
|
|
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
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
//
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
223
|
+
* @returns Configured HTTP client
|
|
216
224
|
*/
|
|
217
225
|
function createApiClient(apiKey, baseUrl = DEFAULT_API_BASE_URL, options = {}) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const
|
|
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:
|
|
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) {
|