anycubic-cloud-client 0.1.0__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.
- anycubic_cloud_client/__init__.py +253 -0
- anycubic_cloud_client/agora.py +790 -0
- anycubic_cloud_client/agora_sdp.py +436 -0
- anycubic_cloud_client/client.py +1471 -0
- anycubic_cloud_client/credentials.py +89 -0
- anycubic_cloud_client/errors.py +144 -0
- anycubic_cloud_client/firmware.py +119 -0
- anycubic_cloud_client/messages.py +650 -0
- anycubic_cloud_client/models.py +1217 -0
- anycubic_cloud_client/mqtt.py +549 -0
- anycubic_cloud_client/mqtt_identity.py +223 -0
- anycubic_cloud_client/orders.py +390 -0
- anycubic_cloud_client/printing.py +295 -0
- anycubic_cloud_client/py.typed +0 -0
- anycubic_cloud_client/regions.py +157 -0
- anycubic_cloud_client/signing.py +118 -0
- anycubic_cloud_client/tokens.py +377 -0
- anycubic_cloud_client-0.1.0.dist-info/METADATA +217 -0
- anycubic_cloud_client-0.1.0.dist-info/RECORD +21 -0
- anycubic_cloud_client-0.1.0.dist-info/WHEEL +4 -0
- anycubic_cloud_client-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"""Async client for the Anycubic cloud.
|
|
2
|
+
|
|
3
|
+
This library contains none of Anycubic's credentials: the caller passes them
|
|
4
|
+
in a :class:`CloudSecrets`. Typical use::
|
|
5
|
+
|
|
6
|
+
secrets = CloudSecrets(app_id=..., app_secret=..., client_id_web=...,
|
|
7
|
+
client_id_app=..., mqtt_ca_pem=...,
|
|
8
|
+
mqtt_client_cert_pem=..., mqtt_client_key_pem=...)
|
|
9
|
+
cloud = AnycubicCloudClient.from_entry(
|
|
10
|
+
session, secrets, token=pasted_token, auth_mode=AuthMode.SLICER,
|
|
11
|
+
region=Region.INTERNATIONAL, store=saved_token_store,
|
|
12
|
+
)
|
|
13
|
+
account = await cloud.check()
|
|
14
|
+
printers = await cloud.get_printers()
|
|
15
|
+
|
|
16
|
+
See ``docs/PROTOCOL.md`` for the protocol and ``docs/INTEGRATION-SPEC.md``
|
|
17
|
+
for the requirements this implements.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from .agora import AgoraCameraSession, choose_server, open_camera_session
|
|
23
|
+
from .client import (
|
|
24
|
+
AnycubicCloudClient,
|
|
25
|
+
ApiResponse,
|
|
26
|
+
PrintStartResult,
|
|
27
|
+
SignInResult,
|
|
28
|
+
sign_in_any,
|
|
29
|
+
sign_in_order,
|
|
30
|
+
validate_print_settings,
|
|
31
|
+
)
|
|
32
|
+
from .credentials import CloudSecrets
|
|
33
|
+
from .errors import (
|
|
34
|
+
AgoraError,
|
|
35
|
+
AnycubicCloudError,
|
|
36
|
+
CloudFileNotFoundError,
|
|
37
|
+
CredentialsRejectedError,
|
|
38
|
+
GcodeMetadataError,
|
|
39
|
+
MqttAuthError,
|
|
40
|
+
MqttConnectionError,
|
|
41
|
+
MqttError,
|
|
42
|
+
MqttNotAllowedError,
|
|
43
|
+
MqttNotConnectedError,
|
|
44
|
+
NoCameraCredentialsError,
|
|
45
|
+
OrderRefusedError,
|
|
46
|
+
PrinterRemovedError,
|
|
47
|
+
RejectReason,
|
|
48
|
+
RenameFailedError,
|
|
49
|
+
SecretsInvalidError,
|
|
50
|
+
ServiceUnavailableError,
|
|
51
|
+
SlotMappingError,
|
|
52
|
+
StorageFullError,
|
|
53
|
+
UnexpectedResponseError,
|
|
54
|
+
UploadError,
|
|
55
|
+
)
|
|
56
|
+
from .firmware import FirmwareProgress
|
|
57
|
+
from .messages import (
|
|
58
|
+
AceLoadedSlotUpdate,
|
|
59
|
+
AxisMoveUpdate,
|
|
60
|
+
BindingUpdate,
|
|
61
|
+
CloudMessage,
|
|
62
|
+
ExternalHolderUpdate,
|
|
63
|
+
Fault,
|
|
64
|
+
FileDeletedUpdate,
|
|
65
|
+
FileListUpdate,
|
|
66
|
+
FirmwareReport,
|
|
67
|
+
FirmwareStep,
|
|
68
|
+
JobStatus,
|
|
69
|
+
OnlineUpdate,
|
|
70
|
+
PrinterEvent,
|
|
71
|
+
PrintUpdate,
|
|
72
|
+
WorkStatus,
|
|
73
|
+
WorkStatusUpdate,
|
|
74
|
+
parse_cloud_message,
|
|
75
|
+
)
|
|
76
|
+
from .models import (
|
|
77
|
+
Account,
|
|
78
|
+
AceSlotInfo,
|
|
79
|
+
AceUnit,
|
|
80
|
+
CameraCredentials,
|
|
81
|
+
CloudFile,
|
|
82
|
+
DryingStatus,
|
|
83
|
+
ExternalHolder,
|
|
84
|
+
FeedStatus,
|
|
85
|
+
FirmwareInfo,
|
|
86
|
+
Function,
|
|
87
|
+
GcodeInfo,
|
|
88
|
+
Job,
|
|
89
|
+
JobDetail,
|
|
90
|
+
JobSettings,
|
|
91
|
+
PaintInfo,
|
|
92
|
+
PrinterDetail,
|
|
93
|
+
PrinterFile,
|
|
94
|
+
PrinterModel,
|
|
95
|
+
PrinterSummary,
|
|
96
|
+
SliceParam,
|
|
97
|
+
SpeedModeOption,
|
|
98
|
+
StorageQuota,
|
|
99
|
+
TempLimits,
|
|
100
|
+
select_latest_job,
|
|
101
|
+
)
|
|
102
|
+
from .mqtt import CloudMqttClient
|
|
103
|
+
from .mqtt_identity import (
|
|
104
|
+
MqttIdentity,
|
|
105
|
+
build_identity,
|
|
106
|
+
mqtt_client_id,
|
|
107
|
+
parse_topic,
|
|
108
|
+
printer_topics,
|
|
109
|
+
redact_topic,
|
|
110
|
+
user_topics,
|
|
111
|
+
)
|
|
112
|
+
from .orders import (
|
|
113
|
+
Axis,
|
|
114
|
+
FeedType,
|
|
115
|
+
FileSource,
|
|
116
|
+
MoveType,
|
|
117
|
+
Order,
|
|
118
|
+
OrderShape,
|
|
119
|
+
build_order_body,
|
|
120
|
+
)
|
|
121
|
+
from .printing import (
|
|
122
|
+
GcodeColor,
|
|
123
|
+
SlotAssignment,
|
|
124
|
+
TaskSettings,
|
|
125
|
+
build_slot_mapping,
|
|
126
|
+
gcode_colors,
|
|
127
|
+
parse_gcode_header,
|
|
128
|
+
)
|
|
129
|
+
from .regions import AuthMode, Region, RegionEndpoints
|
|
130
|
+
from .tokens import (
|
|
131
|
+
SignatureCheck,
|
|
132
|
+
SignatureStatus,
|
|
133
|
+
TokenClaims,
|
|
134
|
+
TokenState,
|
|
135
|
+
decode_claims,
|
|
136
|
+
extract_token,
|
|
137
|
+
store_is_stale,
|
|
138
|
+
trim_signature,
|
|
139
|
+
verify_token_signature,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
__version__ = "0.1.0"
|
|
143
|
+
|
|
144
|
+
__all__ = [
|
|
145
|
+
"Account",
|
|
146
|
+
"AceLoadedSlotUpdate",
|
|
147
|
+
"AceSlotInfo",
|
|
148
|
+
"AceUnit",
|
|
149
|
+
"AgoraCameraSession",
|
|
150
|
+
"AgoraError",
|
|
151
|
+
"AnycubicCloudClient",
|
|
152
|
+
"AnycubicCloudError",
|
|
153
|
+
"ApiResponse",
|
|
154
|
+
"AuthMode",
|
|
155
|
+
"Axis",
|
|
156
|
+
"AxisMoveUpdate",
|
|
157
|
+
"BindingUpdate",
|
|
158
|
+
"CameraCredentials",
|
|
159
|
+
"CloudFile",
|
|
160
|
+
"CloudFileNotFoundError",
|
|
161
|
+
"CloudMessage",
|
|
162
|
+
"CloudMqttClient",
|
|
163
|
+
"CloudSecrets",
|
|
164
|
+
"CredentialsRejectedError",
|
|
165
|
+
"DryingStatus",
|
|
166
|
+
"ExternalHolder",
|
|
167
|
+
"ExternalHolderUpdate",
|
|
168
|
+
"Fault",
|
|
169
|
+
"FeedStatus",
|
|
170
|
+
"FeedType",
|
|
171
|
+
"FileDeletedUpdate",
|
|
172
|
+
"FileListUpdate",
|
|
173
|
+
"FileSource",
|
|
174
|
+
"FirmwareInfo",
|
|
175
|
+
"FirmwareProgress",
|
|
176
|
+
"FirmwareReport",
|
|
177
|
+
"FirmwareStep",
|
|
178
|
+
"Function",
|
|
179
|
+
"GcodeColor",
|
|
180
|
+
"GcodeInfo",
|
|
181
|
+
"GcodeMetadataError",
|
|
182
|
+
"Job",
|
|
183
|
+
"JobDetail",
|
|
184
|
+
"JobSettings",
|
|
185
|
+
"JobStatus",
|
|
186
|
+
"MoveType",
|
|
187
|
+
"MqttAuthError",
|
|
188
|
+
"MqttConnectionError",
|
|
189
|
+
"MqttError",
|
|
190
|
+
"MqttIdentity",
|
|
191
|
+
"MqttNotAllowedError",
|
|
192
|
+
"MqttNotConnectedError",
|
|
193
|
+
"NoCameraCredentialsError",
|
|
194
|
+
"OnlineUpdate",
|
|
195
|
+
"Order",
|
|
196
|
+
"OrderRefusedError",
|
|
197
|
+
"OrderShape",
|
|
198
|
+
"PaintInfo",
|
|
199
|
+
"PrintStartResult",
|
|
200
|
+
"PrintUpdate",
|
|
201
|
+
"PrinterDetail",
|
|
202
|
+
"PrinterEvent",
|
|
203
|
+
"PrinterFile",
|
|
204
|
+
"PrinterModel",
|
|
205
|
+
"PrinterRemovedError",
|
|
206
|
+
"PrinterSummary",
|
|
207
|
+
"Region",
|
|
208
|
+
"RegionEndpoints",
|
|
209
|
+
"RejectReason",
|
|
210
|
+
"RenameFailedError",
|
|
211
|
+
"SecretsInvalidError",
|
|
212
|
+
"ServiceUnavailableError",
|
|
213
|
+
"SignInResult",
|
|
214
|
+
"SignatureCheck",
|
|
215
|
+
"SignatureStatus",
|
|
216
|
+
"SliceParam",
|
|
217
|
+
"SlotAssignment",
|
|
218
|
+
"SlotMappingError",
|
|
219
|
+
"SpeedModeOption",
|
|
220
|
+
"StorageFullError",
|
|
221
|
+
"StorageQuota",
|
|
222
|
+
"TaskSettings",
|
|
223
|
+
"TempLimits",
|
|
224
|
+
"TokenClaims",
|
|
225
|
+
"TokenState",
|
|
226
|
+
"UnexpectedResponseError",
|
|
227
|
+
"UploadError",
|
|
228
|
+
"WorkStatus",
|
|
229
|
+
"WorkStatusUpdate",
|
|
230
|
+
"__version__",
|
|
231
|
+
"build_identity",
|
|
232
|
+
"build_order_body",
|
|
233
|
+
"build_slot_mapping",
|
|
234
|
+
"choose_server",
|
|
235
|
+
"decode_claims",
|
|
236
|
+
"extract_token",
|
|
237
|
+
"gcode_colors",
|
|
238
|
+
"mqtt_client_id",
|
|
239
|
+
"open_camera_session",
|
|
240
|
+
"parse_cloud_message",
|
|
241
|
+
"parse_gcode_header",
|
|
242
|
+
"parse_topic",
|
|
243
|
+
"printer_topics",
|
|
244
|
+
"redact_topic",
|
|
245
|
+
"select_latest_job",
|
|
246
|
+
"sign_in_any",
|
|
247
|
+
"sign_in_order",
|
|
248
|
+
"store_is_stale",
|
|
249
|
+
"trim_signature",
|
|
250
|
+
"user_topics",
|
|
251
|
+
"validate_print_settings",
|
|
252
|
+
"verify_token_signature",
|
|
253
|
+
]
|