cmdop 0.1.24__py3-none-any.whl → 0.1.26__py3-none-any.whl
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.
- cmdop/__init__.py +9 -4
- cmdop/_generated/rpc_messages/browser_pb2.py +138 -138
- cmdop/_generated/rpc_messages/browser_pb2.pyi +6 -2
- cmdop/api/generated/machines/__init__.py +1 -1
- cmdop/api/generated/machines/enums.py +0 -112
- cmdop/api/generated/machines/machines__api__machine_sharing/client.py +21 -6
- cmdop/api/generated/machines/machines__api__machine_sharing/models.py +46 -19
- cmdop/api/generated/machines/machines__api__machine_sharing/sync_client.py +20 -5
- cmdop/api/generated/machines/machines__api__machines/client.py +90 -25
- cmdop/api/generated/machines/machines__api__machines/models.py +143 -125
- cmdop/api/generated/machines/machines__api__machines/sync_client.py +84 -19
- cmdop/api/generated/machines/schema.json +72 -0
- cmdop/api/generated/system/__init__.py +1 -1
- cmdop/api/generated/system/enums.py +0 -52
- cmdop/api/generated/system/schema.json +54 -0
- cmdop/api/generated/system/system__api__oauth/client.py +42 -12
- cmdop/api/generated/system/system__api__oauth/models.py +111 -85
- cmdop/api/generated/system/system__api__oauth/sync_client.py +38 -8
- cmdop/api/generated/system/system__api__system/client.py +98 -23
- cmdop/api/generated/system/system__api__system/models.py +83 -83
- cmdop/api/generated/system/system__api__system/sync_client.py +94 -19
- cmdop/api/generated/workspaces/__init__.py +1 -1
- cmdop/api/generated/workspaces/enums.py +0 -137
- cmdop/api/generated/workspaces/schema.json +47 -0
- cmdop/api/generated/workspaces/workspaces__api__workspaces/client.py +156 -41
- cmdop/api/generated/workspaces/workspaces__api__workspaces/models.py +126 -85
- cmdop/api/generated/workspaces/workspaces__api__workspaces/sync_client.py +145 -29
- cmdop/helpers/__init__.py +0 -4
- cmdop/helpers/network_analyzer.py +28 -9
- cmdop/services/browser/capabilities/visual.py +1 -1
- cmdop/services/browser/service/sync.py +4 -0
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/METADATA +24 -14
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/RECORD +35 -37
- cmdop/helpers/cleaner.py +0 -53
- cmdop/helpers/formatting.py +0 -15
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/WHEEL +0 -0
- {cmdop-0.1.24.dist-info → cmdop-0.1.26.dist-info}/licenses/LICENSE +0 -0
|
@@ -19,6 +19,15 @@
|
|
|
19
19
|
"operationId": "machines_logs_list",
|
|
20
20
|
"description": "ViewSet for MachineLog operations.\n\nRead-only except for creation. Logs are created by agents.",
|
|
21
21
|
"parameters": [
|
|
22
|
+
{
|
|
23
|
+
"name": "ordering",
|
|
24
|
+
"required": false,
|
|
25
|
+
"in": "query",
|
|
26
|
+
"description": "Which field to use when ordering the results.",
|
|
27
|
+
"schema": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
22
31
|
{
|
|
23
32
|
"name": "page",
|
|
24
33
|
"required": false,
|
|
@@ -36,6 +45,15 @@
|
|
|
36
45
|
"schema": {
|
|
37
46
|
"type": "integer"
|
|
38
47
|
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "search",
|
|
51
|
+
"required": false,
|
|
52
|
+
"in": "query",
|
|
53
|
+
"description": "A search term.",
|
|
54
|
+
"schema": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
39
57
|
}
|
|
40
58
|
],
|
|
41
59
|
"tags": [
|
|
@@ -150,6 +168,15 @@
|
|
|
150
168
|
"operationId": "machines_machines_list",
|
|
151
169
|
"description": "ViewSet for Machine operations.\n\nProvides CRUD operations for remote machines with monitoring capabilities.",
|
|
152
170
|
"parameters": [
|
|
171
|
+
{
|
|
172
|
+
"name": "ordering",
|
|
173
|
+
"required": false,
|
|
174
|
+
"in": "query",
|
|
175
|
+
"description": "Which field to use when ordering the results.",
|
|
176
|
+
"schema": {
|
|
177
|
+
"type": "string"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
153
180
|
{
|
|
154
181
|
"name": "page",
|
|
155
182
|
"required": false,
|
|
@@ -167,6 +194,15 @@
|
|
|
167
194
|
"schema": {
|
|
168
195
|
"type": "integer"
|
|
169
196
|
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "search",
|
|
200
|
+
"required": false,
|
|
201
|
+
"in": "query",
|
|
202
|
+
"description": "A search term.",
|
|
203
|
+
"schema": {
|
|
204
|
+
"type": "string"
|
|
205
|
+
}
|
|
170
206
|
}
|
|
171
207
|
],
|
|
172
208
|
"tags": [
|
|
@@ -451,6 +487,15 @@
|
|
|
451
487
|
},
|
|
452
488
|
"description": "Limit results (default: 50)"
|
|
453
489
|
},
|
|
490
|
+
{
|
|
491
|
+
"name": "ordering",
|
|
492
|
+
"required": false,
|
|
493
|
+
"in": "query",
|
|
494
|
+
"description": "Which field to use when ordering the results.",
|
|
495
|
+
"schema": {
|
|
496
|
+
"type": "string"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
454
499
|
{
|
|
455
500
|
"name": "page",
|
|
456
501
|
"required": false,
|
|
@@ -468,6 +513,15 @@
|
|
|
468
513
|
"schema": {
|
|
469
514
|
"type": "integer"
|
|
470
515
|
}
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"name": "search",
|
|
519
|
+
"required": false,
|
|
520
|
+
"in": "query",
|
|
521
|
+
"description": "A search term.",
|
|
522
|
+
"schema": {
|
|
523
|
+
"type": "string"
|
|
524
|
+
}
|
|
471
525
|
}
|
|
472
526
|
],
|
|
473
527
|
"tags": [
|
|
@@ -639,6 +693,15 @@
|
|
|
639
693
|
"description": "A UUID string identifying this Machine.",
|
|
640
694
|
"required": true
|
|
641
695
|
},
|
|
696
|
+
{
|
|
697
|
+
"name": "ordering",
|
|
698
|
+
"required": false,
|
|
699
|
+
"in": "query",
|
|
700
|
+
"description": "Which field to use when ordering the results.",
|
|
701
|
+
"schema": {
|
|
702
|
+
"type": "string"
|
|
703
|
+
}
|
|
704
|
+
},
|
|
642
705
|
{
|
|
643
706
|
"name": "page",
|
|
644
707
|
"required": false,
|
|
@@ -656,6 +719,15 @@
|
|
|
656
719
|
"schema": {
|
|
657
720
|
"type": "integer"
|
|
658
721
|
}
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"name": "search",
|
|
725
|
+
"required": false,
|
|
726
|
+
"in": "query",
|
|
727
|
+
"description": "A search term.",
|
|
728
|
+
"schema": {
|
|
729
|
+
"type": "string"
|
|
730
|
+
}
|
|
659
731
|
}
|
|
660
732
|
],
|
|
661
733
|
"tags": [
|
|
@@ -37,7 +37,7 @@ from .system__api__oauth import SystemOauthAPI
|
|
|
37
37
|
from .system__api__system import SystemSystemAPI
|
|
38
38
|
from . import enums
|
|
39
39
|
# NOTE: Individual enum imports commented out due to invalid Python syntax with dotted names
|
|
40
|
-
# from .enums import Alert.type,
|
|
40
|
+
# from .enums import Alert.type, DeviceAuthorizeRequest.action, TokenError.error, TokenRequestRequest.grant_type, TokenRevokeRequest.token_type_hint
|
|
41
41
|
|
|
42
42
|
TOKEN_KEY = "auth_token"
|
|
43
43
|
REFRESH_TOKEN_KEY = "refresh_token"
|
|
@@ -21,45 +21,6 @@ class AlertType(StrEnum):
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class AlertCreateType(StrEnum):
|
|
25
|
-
"""
|
|
26
|
-
* `machine_offline` - Machine Offline
|
|
27
|
-
* `task_failed` - Task Failed
|
|
28
|
-
* `schedule_error` - Schedule Error
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
MACHINE_OFFLINE = "machine_offline"
|
|
32
|
-
TASK_FAILED = "task_failed"
|
|
33
|
-
SCHEDULE_ERROR = "schedule_error"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class AlertCreateRequestType(StrEnum):
|
|
38
|
-
"""
|
|
39
|
-
* `machine_offline` - Machine Offline
|
|
40
|
-
* `task_failed` - Task Failed
|
|
41
|
-
* `schedule_error` - Schedule Error
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
MACHINE_OFFLINE = "machine_offline"
|
|
45
|
-
TASK_FAILED = "task_failed"
|
|
46
|
-
SCHEDULE_ERROR = "schedule_error"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class AlertRequestType(StrEnum):
|
|
51
|
-
"""
|
|
52
|
-
* `machine_offline` - Machine Offline
|
|
53
|
-
* `task_failed` - Task Failed
|
|
54
|
-
* `schedule_error` - Schedule Error
|
|
55
|
-
"""
|
|
56
|
-
|
|
57
|
-
MACHINE_OFFLINE = "machine_offline"
|
|
58
|
-
TASK_FAILED = "task_failed"
|
|
59
|
-
SCHEDULE_ERROR = "schedule_error"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
24
|
class DeviceAuthorizeRequestAction(StrEnum):
|
|
64
25
|
"""
|
|
65
26
|
User decision: approve or deny
|
|
@@ -72,19 +33,6 @@ class DeviceAuthorizeRequestAction(StrEnum):
|
|
|
72
33
|
|
|
73
34
|
|
|
74
35
|
|
|
75
|
-
class PatchedAlertRequestType(StrEnum):
|
|
76
|
-
"""
|
|
77
|
-
* `machine_offline` - Machine Offline
|
|
78
|
-
* `task_failed` - Task Failed
|
|
79
|
-
* `schedule_error` - Schedule Error
|
|
80
|
-
"""
|
|
81
|
-
|
|
82
|
-
MACHINE_OFFLINE = "machine_offline"
|
|
83
|
-
TASK_FAILED = "task_failed"
|
|
84
|
-
SCHEDULE_ERROR = "schedule_error"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
36
|
class TokenErrorError(StrEnum):
|
|
89
37
|
"""
|
|
90
38
|
OAuth error code
|
|
@@ -19,6 +19,15 @@
|
|
|
19
19
|
"operationId": "system_alerts_list",
|
|
20
20
|
"description": "List alerts with filters.",
|
|
21
21
|
"parameters": [
|
|
22
|
+
{
|
|
23
|
+
"name": "ordering",
|
|
24
|
+
"required": false,
|
|
25
|
+
"in": "query",
|
|
26
|
+
"description": "Which field to use when ordering the results.",
|
|
27
|
+
"schema": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
22
31
|
{
|
|
23
32
|
"name": "page",
|
|
24
33
|
"required": false,
|
|
@@ -45,6 +54,15 @@
|
|
|
45
54
|
},
|
|
46
55
|
"description": "Filter by read status"
|
|
47
56
|
},
|
|
57
|
+
{
|
|
58
|
+
"name": "search",
|
|
59
|
+
"required": false,
|
|
60
|
+
"in": "query",
|
|
61
|
+
"description": "A search term.",
|
|
62
|
+
"schema": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
48
66
|
{
|
|
49
67
|
"in": "query",
|
|
50
68
|
"name": "type",
|
|
@@ -388,6 +406,15 @@
|
|
|
388
406
|
"operationId": "system_api_keys_list",
|
|
389
407
|
"description": "List API keys with filters.",
|
|
390
408
|
"parameters": [
|
|
409
|
+
{
|
|
410
|
+
"name": "ordering",
|
|
411
|
+
"required": false,
|
|
412
|
+
"in": "query",
|
|
413
|
+
"description": "Which field to use when ordering the results.",
|
|
414
|
+
"schema": {
|
|
415
|
+
"type": "string"
|
|
416
|
+
}
|
|
417
|
+
},
|
|
391
418
|
{
|
|
392
419
|
"name": "page",
|
|
393
420
|
"required": false,
|
|
@@ -406,6 +433,15 @@
|
|
|
406
433
|
"type": "integer"
|
|
407
434
|
}
|
|
408
435
|
},
|
|
436
|
+
{
|
|
437
|
+
"name": "search",
|
|
438
|
+
"required": false,
|
|
439
|
+
"in": "query",
|
|
440
|
+
"description": "A search term.",
|
|
441
|
+
"schema": {
|
|
442
|
+
"type": "string"
|
|
443
|
+
}
|
|
444
|
+
},
|
|
409
445
|
{
|
|
410
446
|
"in": "query",
|
|
411
447
|
"name": "workspace",
|
|
@@ -906,6 +942,15 @@
|
|
|
906
942
|
"description": "List all CLI tokens for authenticated user.",
|
|
907
943
|
"summary": "List user tokens",
|
|
908
944
|
"parameters": [
|
|
945
|
+
{
|
|
946
|
+
"name": "ordering",
|
|
947
|
+
"required": false,
|
|
948
|
+
"in": "query",
|
|
949
|
+
"description": "Which field to use when ordering the results.",
|
|
950
|
+
"schema": {
|
|
951
|
+
"type": "string"
|
|
952
|
+
}
|
|
953
|
+
},
|
|
909
954
|
{
|
|
910
955
|
"name": "page",
|
|
911
956
|
"required": false,
|
|
@@ -923,6 +968,15 @@
|
|
|
923
968
|
"schema": {
|
|
924
969
|
"type": "integer"
|
|
925
970
|
}
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"name": "search",
|
|
974
|
+
"required": false,
|
|
975
|
+
"in": "query",
|
|
976
|
+
"description": "A search term.",
|
|
977
|
+
"schema": {
|
|
978
|
+
"type": "string"
|
|
979
|
+
}
|
|
926
980
|
}
|
|
927
981
|
],
|
|
928
982
|
"tags": [
|
|
@@ -20,8 +20,13 @@ class SystemOauthAPI:
|
|
|
20
20
|
authentication).
|
|
21
21
|
"""
|
|
22
22
|
url = "/api/system/oauth/authorize/"
|
|
23
|
-
response = await self._client.post(url, json=data.model_dump())
|
|
24
|
-
response.
|
|
23
|
+
response = await self._client.post(url, json=data.model_dump(exclude_unset=True))
|
|
24
|
+
if not response.is_success:
|
|
25
|
+
try:
|
|
26
|
+
error_body = response.json()
|
|
27
|
+
except Exception:
|
|
28
|
+
error_body = response.text
|
|
29
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
25
30
|
return DeviceAuthorizeResponse.model_validate(response.json())
|
|
26
31
|
|
|
27
32
|
|
|
@@ -32,8 +37,13 @@ class SystemOauthAPI:
|
|
|
32
37
|
CLI initiates OAuth flow by requesting a device code and user code.
|
|
33
38
|
"""
|
|
34
39
|
url = "/api/system/oauth/device/"
|
|
35
|
-
response = await self._client.post(url, json=data.model_dump())
|
|
36
|
-
response.
|
|
40
|
+
response = await self._client.post(url, json=data.model_dump(exclude_unset=True))
|
|
41
|
+
if not response.is_success:
|
|
42
|
+
try:
|
|
43
|
+
error_body = response.json()
|
|
44
|
+
except Exception:
|
|
45
|
+
error_body = response.text
|
|
46
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
37
47
|
return DeviceCodeResponse.model_validate(response.json())
|
|
38
48
|
|
|
39
49
|
|
|
@@ -44,8 +54,13 @@ class SystemOauthAPI:
|
|
|
44
54
|
Revoke access token or refresh token.
|
|
45
55
|
"""
|
|
46
56
|
url = "/api/system/oauth/revoke/"
|
|
47
|
-
response = await self._client.post(url, json=data.model_dump())
|
|
48
|
-
response.
|
|
57
|
+
response = await self._client.post(url, json=data.model_dump(exclude_unset=True))
|
|
58
|
+
if not response.is_success:
|
|
59
|
+
try:
|
|
60
|
+
error_body = response.json()
|
|
61
|
+
except Exception:
|
|
62
|
+
error_body = response.text
|
|
63
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
49
64
|
return None
|
|
50
65
|
|
|
51
66
|
|
|
@@ -56,8 +71,13 @@ class SystemOauthAPI:
|
|
|
56
71
|
CLI polls for token (device flow) or refreshes expired token.
|
|
57
72
|
"""
|
|
58
73
|
url = "/api/system/oauth/token/"
|
|
59
|
-
response = await self._client.post(url, json=data.model_dump())
|
|
60
|
-
response.
|
|
74
|
+
response = await self._client.post(url, json=data.model_dump(exclude_unset=True))
|
|
75
|
+
if not response.is_success:
|
|
76
|
+
try:
|
|
77
|
+
error_body = response.json()
|
|
78
|
+
except Exception:
|
|
79
|
+
error_body = response.text
|
|
80
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
61
81
|
return TokenResponse.model_validate(response.json())
|
|
62
82
|
|
|
63
83
|
|
|
@@ -69,19 +89,29 @@ class SystemOauthAPI:
|
|
|
69
89
|
"""
|
|
70
90
|
url = "/api/system/oauth/token/info/"
|
|
71
91
|
response = await self._client.get(url)
|
|
72
|
-
response.
|
|
92
|
+
if not response.is_success:
|
|
93
|
+
try:
|
|
94
|
+
error_body = response.json()
|
|
95
|
+
except Exception:
|
|
96
|
+
error_body = response.text
|
|
97
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
73
98
|
return TokenInfo.model_validate(response.json())
|
|
74
99
|
|
|
75
100
|
|
|
76
|
-
async def system_oauth_tokens_list(self, page: int | None = None, page_size: int | None = None) -> list[PaginatedTokenListList]:
|
|
101
|
+
async def system_oauth_tokens_list(self, ordering: str | None = None, page: int | None = None, page_size: int | None = None, search: str | None = None) -> list[PaginatedTokenListList]:
|
|
77
102
|
"""
|
|
78
103
|
List user tokens
|
|
79
104
|
|
|
80
105
|
List all CLI tokens for authenticated user.
|
|
81
106
|
"""
|
|
82
107
|
url = "/api/system/oauth/tokens/"
|
|
83
|
-
response = await self._client.get(url, params={"page": page if page is not None else None, "page_size": page_size if page_size is not None else None})
|
|
84
|
-
response.
|
|
108
|
+
response = await self._client.get(url, params={"ordering": ordering if ordering is not None else None, "page": page if page is not None else None, "page_size": page_size if page_size is not None else None, "search": search if search is not None else None})
|
|
109
|
+
if not response.is_success:
|
|
110
|
+
try:
|
|
111
|
+
error_body = response.json()
|
|
112
|
+
except Exception:
|
|
113
|
+
error_body = response.text
|
|
114
|
+
raise httpx.HTTPStatusError(f"{response.status_code}: {error_body}", request=response.request, response=response)
|
|
85
115
|
return PaginatedTokenListList.model_validate(response.json())
|
|
86
116
|
|
|
87
117
|
|