rw-sdk 2.8.1.post0__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.
Files changed (43) hide show
  1. rw_sdk/__init__.py +60 -0
  2. rw_sdk/_error_codes.py +479 -0
  3. rw_sdk/_meta.py +2427 -0
  4. rw_sdk/_resource.py +137 -0
  5. rw_sdk/_resources_mixin.py +128 -0
  6. rw_sdk/_types.py +91 -0
  7. rw_sdk/_version.py +3 -0
  8. rw_sdk/client.py +350 -0
  9. rw_sdk/errors.py +185 -0
  10. rw_sdk/models.py +6135 -0
  11. rw_sdk/py.typed +0 -0
  12. rw_sdk/resources/__init__.py +89 -0
  13. rw_sdk/resources/api_tokens.py +187 -0
  14. rw_sdk/resources/auth.py +236 -0
  15. rw_sdk/resources/bandwidth_stats.py +354 -0
  16. rw_sdk/resources/config_profiles.py +285 -0
  17. rw_sdk/resources/external_squads.py +286 -0
  18. rw_sdk/resources/hosts.py +501 -0
  19. rw_sdk/resources/hosts_bulk.py +280 -0
  20. rw_sdk/resources/hwid.py +410 -0
  21. rw_sdk/resources/infra_billing.py +500 -0
  22. rw_sdk/resources/internal_squads.py +290 -0
  23. rw_sdk/resources/ip_control.py +186 -0
  24. rw_sdk/resources/keygen.py +43 -0
  25. rw_sdk/resources/metadata.py +155 -0
  26. rw_sdk/resources/node_plugins.py +468 -0
  27. rw_sdk/resources/nodes.py +627 -0
  28. rw_sdk/resources/passkeys.py +212 -0
  29. rw_sdk/resources/settings.py +117 -0
  30. rw_sdk/resources/snippets.py +137 -0
  31. rw_sdk/resources/sub.py +102 -0
  32. rw_sdk/resources/subscription_page_configs.py +242 -0
  33. rw_sdk/resources/subscription_request_history.py +168 -0
  34. rw_sdk/resources/subscription_settings.py +136 -0
  35. rw_sdk/resources/subscription_template.py +229 -0
  36. rw_sdk/resources/subscriptions.py +319 -0
  37. rw_sdk/resources/system.py +278 -0
  38. rw_sdk/resources/users.py +1032 -0
  39. rw_sdk/resources/users_bulk.py +405 -0
  40. rw_sdk-2.8.1.post0.dist-info/METADATA +347 -0
  41. rw_sdk-2.8.1.post0.dist-info/RECORD +43 -0
  42. rw_sdk-2.8.1.post0.dist-info/WHEEL +4 -0
  43. rw_sdk-2.8.1.post0.dist-info/licenses/LICENSE +21 -0
rw_sdk/__init__.py ADDED
@@ -0,0 +1,60 @@
1
+ """rw-sdk — a full Python client for the Remnawave panel API.
2
+
3
+ from rw_sdk import Remnawave
4
+
5
+ with Remnawave("https://panel.example.com", token="...") as rw:
6
+ for user in rw.users.iter_all():
7
+ print(user.username, user.status)
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from . import errors, models
13
+ from ._meta import API_VERSION, ENDPOINTS
14
+ from ._types import NOT_GIVEN, NotGiven, RawSubscription
15
+ from ._version import __version__
16
+ from .client import BYPASS_HTTPS_RESTRICTION_HEADERS, AsyncRemnawave, Remnawave
17
+ from .errors import (
18
+ APIConnectionError,
19
+ APIStatusError,
20
+ APITimeoutError,
21
+ AuthenticationError,
22
+ BadRequestError,
23
+ ConflictError,
24
+ ErrorCode,
25
+ InternalServerError,
26
+ NotFoundError,
27
+ PermissionDeniedError,
28
+ ProxyRestrictionError,
29
+ RateLimitError,
30
+ RemnawaveError,
31
+ ValidationError,
32
+ )
33
+
34
+ __all__ = [
35
+ "Remnawave",
36
+ "AsyncRemnawave",
37
+ "API_VERSION",
38
+ "ENDPOINTS",
39
+ "NOT_GIVEN",
40
+ "NotGiven",
41
+ "RawSubscription",
42
+ "BYPASS_HTTPS_RESTRICTION_HEADERS",
43
+ "errors",
44
+ "models",
45
+ "RemnawaveError",
46
+ "APIConnectionError",
47
+ "APITimeoutError",
48
+ "APIStatusError",
49
+ "BadRequestError",
50
+ "ValidationError",
51
+ "AuthenticationError",
52
+ "PermissionDeniedError",
53
+ "NotFoundError",
54
+ "ConflictError",
55
+ "RateLimitError",
56
+ "InternalServerError",
57
+ "ProxyRestrictionError",
58
+ "ErrorCode",
59
+ "__version__",
60
+ ]
rw_sdk/_error_codes.py ADDED
@@ -0,0 +1,479 @@
1
+ """Generated by codegen/generate.py — do not edit by hand."""
2
+
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+
8
+
9
+ class ErrorCode(str, Enum):
10
+ """`errorCode` values returned by the panel (libs/contract/constants/errors).
11
+
12
+ Compare against :attr:`rw_sdk.errors.APIStatusError.error`.
13
+ """
14
+
15
+ INTERNAL_SERVER_ERROR = 'A001'
16
+ LOGIN_ERROR = 'A002'
17
+ UNAUTHORIZED = 'A003'
18
+ FORBIDDEN_ROLE_ERROR = 'A004'
19
+ CREATE_API_TOKEN_ERROR = 'A005'
20
+ DELETE_API_TOKEN_ERROR = 'A006'
21
+ REQUESTED_TOKEN_NOT_FOUND = 'A007'
22
+ FIND_ALL_API_TOKENS_ERROR = 'A008'
23
+ GET_PUBLIC_KEY_ERROR = 'A009'
24
+ ENABLE_NODE_ERROR = 'A010'
25
+ NODE_NOT_FOUND = 'A011'
26
+ CONFIG_NOT_FOUND = 'A012'
27
+ UPDATE_CONFIG_ERROR = 'A013'
28
+ GET_CONFIG_ERROR = 'A014'
29
+ DELETE_MANY_INBOUNDS_ERROR = 'A015'
30
+ CREATE_MANY_INBOUNDS_ERROR = 'A016'
31
+ FIND_ALL_INBOUNDS_ERROR = 'A017'
32
+ CREATE_USER_ERROR = 'A018'
33
+ USER_USERNAME_ALREADY_EXISTS = 'A019'
34
+ USER_SHORT_UUID_ALREADY_EXISTS = 'A020'
35
+ USER_SUBSCRIPTION_UUID_ALREADY_EXISTS = 'A021'
36
+ CREATE_USER_WITH_INBOUNDS_ERROR = 'A022'
37
+ CANT_GET_CREATED_USER_WITH_INBOUNDS = 'A023'
38
+ GET_ALL_USERS_ERROR = 'A024'
39
+ USER_NOT_FOUND = 'A025'
40
+ GET_USER_BY_ERROR = 'A026'
41
+ REVOKE_USER_SUBSCRIPTION_ERROR = 'A027'
42
+ DISABLE_USER_ERROR = 'A028'
43
+ USER_ALREADY_DISABLED = 'A029'
44
+ USER_ALREADY_ENABLED = 'A030'
45
+ ENABLE_USER_ERROR = 'A031'
46
+ CREATE_NODE_ERROR = 'A032'
47
+ NODE_NAME_ALREADY_EXISTS = 'A033'
48
+ NODE_ADDRESS_ALREADY_EXISTS = 'A034'
49
+ NODE_ERROR_WITH_MSG = 'N001'
50
+ NODE_ERROR_500_WITH_MSG = 'N002'
51
+ RESTART_NODE_ERROR = 'A035'
52
+ GET_CONFIG_WITH_USERS_ERROR = 'A036'
53
+ DELETE_USER_ERROR = 'A037'
54
+ UPDATE_NODE_ERROR = 'A038'
55
+ UPDATE_USER_ERROR = 'A039'
56
+ INCREMENT_USED_TRAFFIC_ERROR = 'A040'
57
+ GET_ALL_NODES_ERROR = 'A041'
58
+ GET_ONE_NODE_ERROR = 'A042'
59
+ DELETE_NODE_ERROR = 'A043'
60
+ CREATE_HOST_ERROR = 'A044'
61
+ HOST_REMARK_ALREADY_EXISTS = 'A045'
62
+ HOST_NOT_FOUND = 'A046'
63
+ DELETE_HOST_ERROR = 'A047'
64
+ GET_USER_STATS_ERROR = 'A048'
65
+ UPDATE_USER_WITH_INBOUNDS_ERROR = 'A049'
66
+ GET_ALL_HOSTS_ERROR = 'A050'
67
+ REORDER_HOSTS_ERROR = 'A051'
68
+ UPDATE_HOST_ERROR = 'A052'
69
+ CREATE_CONFIG_ERROR = 'A053'
70
+ ENABLED_NODES_NOT_FOUND = 'A054'
71
+ GET_NODES_USAGE_BY_RANGE_ERROR = 'A055'
72
+ RESET_USER_TRAFFIC_ERROR = 'A056'
73
+ REORDER_NODES_ERROR = 'A057'
74
+ GET_ALL_INBOUNDS_ERROR = 'A058'
75
+ BULK_DELETE_USERS_BY_STATUS_ERROR = 'A059'
76
+ UPDATE_INBOUND_ERROR = 'A060'
77
+ CONFIG_VALIDATION_ERROR = 'A061'
78
+ USERS_NOT_FOUND = 'A062'
79
+ GET_USER_BY_UNIQUE_FIELDS_NOT_FOUND = 'A063'
80
+ UPDATE_EXCEEDED_TRAFFIC_USERS_ERROR = 'A064'
81
+ ADMIN_NOT_FOUND = 'A065'
82
+ CREATE_ADMIN_ERROR = 'A066'
83
+ GET_AUTH_STATUS_ERROR = 'A067'
84
+ FORBIDDEN = 'A068'
85
+ DISABLE_NODE_ERROR = 'A069'
86
+ GET_ONE_HOST_ERROR = 'A070'
87
+ SUBSCRIPTION_SETTINGS_NOT_FOUND = 'A071'
88
+ GET_SUBSCRIPTION_SETTINGS_ERROR = 'A072'
89
+ UPDATE_SUBSCRIPTION_SETTINGS_ERROR = 'A073'
90
+ ADD_INBOUND_TO_USERS_ERROR = 'A074'
91
+ REMOVE_INBOUND_FROM_USERS_ERROR = 'A075'
92
+ INBOUND_NOT_FOUND = 'A076'
93
+ ADD_INBOUND_TO_NODES_ERROR = 'A077'
94
+ REMOVE_INBOUND_FROM_NODES_ERROR = 'A078'
95
+ DELETE_HOSTS_ERROR = 'A079'
96
+ BULK_ENABLE_HOSTS_ERROR = 'A080'
97
+ BULK_DISABLE_HOSTS_ERROR = 'A081'
98
+ BULK_DELETE_USERS_BY_UUID_ERROR = 'A084'
99
+ BULK_REVOKE_USERS_SUBSCRIPTION_ERROR = 'A085'
100
+ BULK_RESET_USER_TRAFFIC_ERROR = 'A086'
101
+ BULK_UPDATE_USERS_ERROR = 'A087'
102
+ BULK_ADD_INBOUNDS_TO_USERS_ERROR = 'A088'
103
+ BULK_UPDATE_ALL_USERS_ERROR = 'A089'
104
+ KEYPAIR_CREATION_ERROR = 'A090'
105
+ GET_USER_USAGE_BY_RANGE_ERROR = 'A091'
106
+ KEYPAIR_NOT_FOUND = 'A092'
107
+ ACTIVATE_ALL_INBOUNDS_ERROR = 'A093'
108
+ GET_NODES_USER_USAGE_BY_RANGE_ERROR = 'A094'
109
+ CREATE_HWID_USER_DEVICE_ERROR = 'A096'
110
+ CHECK_HWID_EXISTS_ERROR = 'A097'
111
+ USER_HWID_DEVICE_ALREADY_EXISTS = 'A098'
112
+ USER_HWID_DEVICE_LIMIT_REACHED = 'A099'
113
+ GET_USER_HWID_DEVICES_ERROR = 'A100'
114
+ DELETE_HWID_USER_DEVICE_ERROR = 'A101'
115
+ UPSERT_HWID_USER_DEVICE_ERROR = 'A102'
116
+ GET_ALL_TAGS_ERROR = 'A103'
117
+ GETTING_ALL_SUBSCRIPTIONS_ERROR = 'A104'
118
+ TRIGGER_THRESHOLD_NOTIFICATION_ERROR = 'A105'
119
+ BULK_DELETE_BY_STATUS_ERROR = 'A106'
120
+ CLEAN_OLD_USAGE_RECORDS_ERROR = 'A107'
121
+ VACUUM_TABLE_ERROR = 'A108'
122
+ GET_CONFIG_PROFILES_ERROR = 'A109'
123
+ GET_CONFIG_PROFILE_BY_UUID_ERROR = 'A110'
124
+ CONFIG_PROFILE_NOT_FOUND = 'A111'
125
+ CREATE_CONFIG_PROFILE_ERROR = 'A112'
126
+ INBOUNDS_WITH_SAME_TAG_ALREADY_EXISTS = 'A113'
127
+ CONFIG_PROFILE_NAME_ALREADY_EXISTS = 'A114'
128
+ GET_INBOUNDS_BY_PROFILE_UUID_ERROR = 'A115'
129
+ GET_INTERNAL_SQUADS_ERROR = 'A116'
130
+ GET_INTERNAL_SQUAD_BY_UUID_ERROR = 'A117'
131
+ INTERNAL_SQUAD_NOT_FOUND = 'A118'
132
+ CREATE_INTERNAL_SQUAD_ERROR = 'A119'
133
+ INTERNAL_SQUAD_NAME_ALREADY_EXISTS = 'A120'
134
+ UPDATE_INTERNAL_SQUAD_ERROR = 'A121'
135
+ DELETE_INTERNAL_SQUAD_ERROR = 'A122'
136
+ CREATE_USER_WITH_INTERNAL_SQUAD_ERROR = 'A123'
137
+ CONFIG_PROFILE_INBOUND_NOT_FOUND_IN_SPECIFIED_PROFILE = 'A124'
138
+ GET_USER_ACCESSIBLE_NODES_ERROR = 'A125'
139
+ GET_INFRA_PROVIDERS_ERROR = 'A126'
140
+ GET_INFRA_PROVIDER_BY_UUID_ERROR = 'A127'
141
+ INFRA_PROVIDER_NOT_FOUND = 'A128'
142
+ DELETE_INFRA_PROVIDER_BY_UUID_ERROR = 'A129'
143
+ CREATE_INFRA_PROVIDER_ERROR = 'A130'
144
+ UPDATE_INFRA_PROVIDER_ERROR = 'A131'
145
+ CREATE_INFRA_BILLING_HISTORY_RECORD_ERROR = 'A132'
146
+ GET_INFRA_BILLING_HISTORY_RECORDS_ERROR = 'A133'
147
+ DELETE_INFRA_BILLING_HISTORY_RECORD_BY_UUID_ERROR = 'A134'
148
+ GET_BILLING_NODES_ERROR = 'A135'
149
+ UPDATE_INFRA_BILLING_NODE_ERROR = 'A136'
150
+ CREATE_INFRA_BILLING_NODE_ERROR = 'A137'
151
+ DELETE_INFRA_BILLING_NODE_BY_UUID_ERROR = 'A138'
152
+ GET_BILLING_NODES_FOR_NOTIFICATIONS_ERROR = 'A139'
153
+ ADD_USERS_TO_INTERNAL_SQUAD_ERROR = 'A140'
154
+ INTERNAL_SQUAD_BULK_ACTIONS_ERROR = 'A141'
155
+ REMOVE_USERS_FROM_INTERNAL_SQUAD_ERROR = 'A142'
156
+ DELETE_CONFIG_PROFILE_BY_UUID_ERROR = 'A143'
157
+ RESERVED_INTERNAL_SQUAD_NAME = 'A144'
158
+ RESERVED_CONFIG_PROFILE_NAME = 'A145'
159
+ UPDATE_CONFIG_PROFILE_ERROR = 'A146'
160
+ OAUTH2_PROVIDER_NOT_FOUND = 'A147'
161
+ OAUTH2_AUTHORIZE_ERROR = 'A148'
162
+ NODE_IS_DISABLED = 'A149'
163
+ SYNC_ACTIVE_PROFILE_ERROR = 'A150'
164
+ GET_ALL_HOST_TAGS_ERROR = 'A151'
165
+ NAME_OR_CONFIG_REQUIRED = 'A152'
166
+ NAME_OR_INBOUNDS_REQUIRED = 'A153'
167
+ GET_INTERNAL_SQUAD_ACCESSIBLE_NODES_ERROR = 'A154'
168
+ DELETE_HWID_USER_DEVICES_ERROR = 'A155'
169
+ CREATE_USER_SUBSCRIPTION_REQUEST_HISTORY_ERROR = 'A156'
170
+ GET_USER_SUBSCRIPTION_REQUEST_HISTORY_ERROR = 'A157'
171
+ GET_ALL_HWID_DEVICES_ERROR = 'A158'
172
+ GET_HWID_DEVICES_STATS_ERROR = 'A159'
173
+ GET_USER_SUBSCRIPTION_REQUEST_HISTORY_STATS_ERROR = 'A160'
174
+ GET_SNIPPETS_ERROR = 'A161'
175
+ SNIPPET_NOT_FOUND = 'A162'
176
+ DELETE_SNIPPET_BY_NAME_ERROR = 'A163'
177
+ SNIPPET_NAME_ALREADY_EXISTS = 'A164'
178
+ UPDATE_SNIPPET_ERROR = 'A165'
179
+ SNIPPET_CANNOT_BE_EMPTY = 'A166'
180
+ SNIPPET_CANNOT_CONTAIN_EMPTY_OBJECTS = 'A167'
181
+ GET_ALL_SUBSCRIPTION_TEMPLATES_ERROR = 'A168'
182
+ GET_SUBSCRIPTION_TEMPLATE_BY_UUID_ERROR = 'A169'
183
+ SUBSCRIPTION_TEMPLATE_NOT_FOUND = 'A170'
184
+ UPDATE_SUBSCRIPTION_TEMPLATE_ERROR = 'A171'
185
+ RESERVED_TEMPLATE_NAME = 'A172'
186
+ TEMPLATE_JSON_NOT_ALLOWED_FOR_YAML_TEMPLATE = 'A173'
187
+ TEMPLATE_YAML_NOT_ALLOWED_FOR_JSON_TEMPLATE = 'A174'
188
+ TEMPLATE_JSON_AND_YAML_CANNOT_BE_UPDATED_SIMULTANEOUSLY = 'A175'
189
+ TEMPLATE_NAME_ALREADY_EXISTS_FOR_THIS_TYPE = 'A176'
190
+ DELETE_SUBSCRIPTION_TEMPLATE_ERROR = 'A177'
191
+ RESERVED_TEMPLATE_CANNOT_BE_DELETED = 'A178'
192
+ CREATE_SUBSCRIPTION_TEMPLATE_ERROR = 'A179'
193
+ TEMPLATE_TYPE_NOT_ALLOWED = 'A180'
194
+ GET_EXTERNAL_SQUADS_ERROR = 'A181'
195
+ EXTERNAL_SQUAD_NOT_FOUND = 'A182'
196
+ CREATE_EXTERNAL_SQUAD_ERROR = 'A183'
197
+ UPDATE_EXTERNAL_SQUAD_ERROR = 'A184'
198
+ DELETE_EXTERNAL_SQUAD_ERROR = 'A185'
199
+ ADD_USERS_TO_EXTERNAL_SQUAD_ERROR = 'A186'
200
+ REMOVE_USERS_FROM_EXTERNAL_SQUAD_ERROR = 'A187'
201
+ GET_EXTERNAL_SQUAD_BY_UUID_ERROR = 'A188'
202
+ EXTERNAL_SQUAD_NAME_ALREADY_EXISTS = 'A189'
203
+ NAME_OR_TEMPLATES_REQUIRED = 'A190'
204
+ PASSKEY_NOT_FOUND = 'A191'
205
+ GET_REMNAAWAVE_SETTINGS_ERROR = 'A192'
206
+ UPDATE_REMNAAWAVE_SETTINGS_ERROR = 'A193'
207
+ PASSKEYS_NOT_CONFIGURED = 'A194'
208
+ PASSKEYS_NOT_ENABLED = 'A195'
209
+ GENERATE_PASSKEY_REGISTRATION_OPTIONS = 'A196'
210
+ VERIFY_PASSKEY_REGISTRATION_ERROR = 'A197'
211
+ GET_ACTIVE_PASSKEYS_ERROR = 'A198'
212
+ DELETE_PASSKEY_ERROR = 'A199'
213
+ GET_COMPUTED_CONFIG_PROFILE_BY_UUID_ERROR = 'A200'
214
+ RESET_NODE_TRAFFIC_ERROR = 'A201'
215
+ UPDATE_PASSKEY_ERROR = 'A202'
216
+ GENERIC_REORDER_ERROR = 'A203'
217
+ HWID_DEVICE_NOT_FOUND = 'A204'
218
+ BULK_EXTEND_EXPIRATION_DATE_ERROR = 'A205'
219
+ SUBSCRIPTION_PAGE_CONFIG_NOT_FOUND = 'A206'
220
+ GET_SUBSCRIPTION_PAGE_CONFIG_BY_UUID_ERROR = 'A207'
221
+ GET_ALL_SUBSCRIPTION_PAGE_CONFIGS_ERROR = 'A208'
222
+ RESERVED_CONFIG_NAME = 'A209'
223
+ CONFIG_NAME_ALREADY_EXISTS = 'A210'
224
+ UPDATE_SUBSCRIPTION_PAGE_CONFIG_ERROR = 'A211'
225
+ RESERVED_SUBPAGE_CONFIG_CANT_BE_DELETED = 'A212'
226
+ DELETE_SUBSCRIPTION_PAGE_CONFIG_ERROR = 'A213'
227
+ CREATE_SUBSCRIPTION_PAGE_CONFIG_ERROR = 'A214'
228
+ INVALID_SUBSCRIPTION_PAGE_CONFIG = 'A215'
229
+ INVALID_REMNAWAVE_INJECTOR = 'A216'
230
+ JOB_CREATION_FAILED = 'A217'
231
+ JOB_RESULT_FETCH_FAILED = 'A218'
232
+ CONNECTED_NODES_NOT_FOUND = 'A219'
233
+ NODE_PLUGIN_NOT_FOUND = 'A220'
234
+ GET_NODE_PLUGIN_BY_UUID_ERROR = 'A221'
235
+ INVALID_NODE_PLUGIN_CONFIG = 'A222'
236
+ NODE_PLUGIN_NAME_ALREADY_EXISTS = 'A223'
237
+ UPDATE_NODE_PLUGIN_ERROR = 'A224'
238
+ CREATE_NODE_PLUGIN_ERROR = 'A225'
239
+ METADATA_NOT_FOUND = 'A226'
240
+ GET_TORRENT_BLOCKER_REPORTS_ERROR = 'A227'
241
+ UPDATE_HOSTS_ERROR = 'A228'
242
+ INVALID_API_TOKEN_SCOPE = 'A229'
243
+ CREATE_INFRA_BILLING_NODE_MISSING_TARGET = 'A230'
244
+
245
+
246
+ MESSAGES = {
247
+ 'A001': ('Server error', 500),
248
+ 'A002': ('Login error', 500),
249
+ 'A003': ('Unauthorized', 401),
250
+ 'A004': ('Forbidden role error', 403),
251
+ 'A005': ('Create API token error', 500),
252
+ 'A006': ('Delete API token error', 500),
253
+ 'A007': ('Requested token not found', 404),
254
+ 'A008': ('Find all API tokens error', 500),
255
+ 'A009': ('Get public key error', 500),
256
+ 'A010': ('Enable node error', 500),
257
+ 'A011': ('Node not found', 404),
258
+ 'A012': ('Configuration not found', 404),
259
+ 'A013': ('Error updating configuration', 500),
260
+ 'A014': ('Error retrieving configuration', 500),
261
+ 'A015': ('Delete many inbounds error', 500),
262
+ 'A016': ('Create many inbounds error', 500),
263
+ 'A017': ('Find all inbounds error', 500),
264
+ 'A018': ('Failed to create user', 500),
265
+ 'A019': ('User username already exists', 400),
266
+ 'A020': ('User short UUID already exists', 400),
267
+ 'A021': ('User subscription UUID already exists', 400),
268
+ 'A022': ('User creation successful, but inbound creation failed. User not created.', 500),
269
+ 'A023': ('User creation successful, but failed to get created user with inbounds.', 500),
270
+ 'A024': ('Get all users error', 500),
271
+ 'A025': ('User not found', 404),
272
+ 'A026': ('Get user by error', 500),
273
+ 'A027': ('Revoke user subscription error', 500),
274
+ 'A028': ('Disable user error', 500),
275
+ 'A029': ('User already disabled', 400),
276
+ 'A030': ('User already enabled', 400),
277
+ 'A031': ('Enable user error', 500),
278
+ 'A032': ('Create node error', 500),
279
+ 'A033': ('Node name already exists', 400),
280
+ 'A034': ('Node address already exists', 400),
281
+ 'N001': ('', 500),
282
+ 'N002': ('', 500),
283
+ 'A035': ('Restart node error', 500),
284
+ 'A036': ('Get config with users error', 500),
285
+ 'A037': ('Delete user error', 500),
286
+ 'A038': ('Update node error', 500),
287
+ 'A039': ('Update user error', 500),
288
+ 'A040': ('Increment used traffic error', 500),
289
+ 'A041': ('Get all nodes error', 500),
290
+ 'A042': ('Get one node error', 500),
291
+ 'A043': ('Delete node error', 500),
292
+ 'A044': ('Create host error', 500),
293
+ 'A045': ('Host remark already exists', 400),
294
+ 'A046': ('Host not found', 404),
295
+ 'A047': ('Delete host error', 500),
296
+ 'A048': ('Get user stats error', 500),
297
+ 'A049': ('Update user with inbounds error', 500),
298
+ 'A050': ('Get all hosts error', 500),
299
+ 'A051': ('Reorder hosts error', 500),
300
+ 'A052': ('Update host error', 500),
301
+ 'A053': ('Create config error', 500),
302
+ 'A054': ('Enabled nodes not found', 409),
303
+ 'A055': ('Get nodes usage by range error', 500),
304
+ 'A056': ('Reset user traffic error', 500),
305
+ 'A057': ('Reorder nodes error', 500),
306
+ 'A058': ('Get all inbounds error', 500),
307
+ 'A059': ('Bulk delete users by status error', 500),
308
+ 'A060': ('Update inbound error', 500),
309
+ 'A061': ('Config validation error', 500),
310
+ 'A062': ('Users not found', 404),
311
+ 'A063': ('User with specified params not found', 404),
312
+ 'A064': ('Update exceeded traffic users error', 500),
313
+ 'A065': ('Admin not found', 404),
314
+ 'A066': ('Create admin error', 500),
315
+ 'A067': ('Get auth status error', 500),
316
+ 'A068': ('Forbidden', 403),
317
+ 'A069': ('Disable node error', 500),
318
+ 'A070': ('Get one host error', 500),
319
+ 'A071': ('Subscription settings not found', 404),
320
+ 'A072': ('Get subscription settings error', 500),
321
+ 'A073': ('Update subscription settings error', 500),
322
+ 'A074': ('Add inbound to users error', 500),
323
+ 'A075': ('Remove inbound from users error', 500),
324
+ 'A076': ('Inbound not found', 404),
325
+ 'A077': ('Add inbound to nodes error', 500),
326
+ 'A078': ('Remove inbound from nodes error', 500),
327
+ 'A079': ('Delete hosts error', 500),
328
+ 'A080': ('Bulk enable hosts error', 500),
329
+ 'A081': ('Bulk disable hosts error', 500),
330
+ 'A084': ('Bulk delete users by UUID error', 500),
331
+ 'A085': ('Bulk revoke users subscription error', 500),
332
+ 'A086': ('Bulk reset user traffic error', 500),
333
+ 'A087': ('Bulk update users error', 500),
334
+ 'A088': ('Bulk add inbounds to users error', 500),
335
+ 'A089': ('Bulk update all users error', 500),
336
+ 'A089': ('LIMITED and EXPIRED statuses are not allowed to be set manually.', 400),
337
+ 'A090': ('Keypair creation error', 500),
338
+ 'A091': ('Get user usage by range error', 500),
339
+ 'A092': ('Keypair not found. Restart app.', 500),
340
+ 'A093': ('Activate all inbounds error', 500),
341
+ 'A094': ('Get nodes user usage by range error', 500),
342
+ 'A096': ('Create hwid user device error', 500),
343
+ 'A097': ('Check hwid exists error', 500),
344
+ 'A098': ('User hwid device already exists', 400),
345
+ 'A099': ('User hwid device limit reached', 400),
346
+ 'A100': ('Get user hwid devices error', 500),
347
+ 'A101': ('Delete hwid user device error', 500),
348
+ 'A102': ('Upsert hwid user device error', 500),
349
+ 'A103': ('Get all tags error', 500),
350
+ 'A104': ('Getting all subscriptions error', 500),
351
+ 'A105': ('Trigger threshold notification error', 500),
352
+ 'A106': ('Bulk delete by status error', 500),
353
+ 'A107': ('Clean old usage records error', 500),
354
+ 'A108': ('Vacuum table error', 500),
355
+ 'A109': ('Get config profiles error', 500),
356
+ 'A110': ('Get config profile by UUID error', 500),
357
+ 'A111': ('Config profile not found', 404),
358
+ 'A112': ('Create config profile error', 500),
359
+ 'A113': ('Inbounds with same tag already exists in database. Inbound tags must be unique.', 409),
360
+ 'A114': ('Config profile name already exists in database. Config profile names must be unique.', 409),
361
+ 'A115': ('Get inbounds by profile UUID error', 500),
362
+ 'A116': ('Get internal squads error', 500),
363
+ 'A117': ('Get internal squad by UUID error', 500),
364
+ 'A118': ('Internal squad not found', 404),
365
+ 'A119': ('Create internal squad error', 500),
366
+ 'A120': ('Internal squad name already exists', 409),
367
+ 'A121': ('Update internal squad error', 500),
368
+ 'A122': ('Delete internal squad error', 500),
369
+ 'A123': ('Create user with internal squad error', 500),
370
+ 'A124': ('Config profile inbound not found in specified profile', 404),
371
+ 'A125': ('Get user accessible nodes error', 500),
372
+ 'A126': ('Get infra providers error', 500),
373
+ 'A127': ('Get infra provider by UUID error', 500),
374
+ 'A128': ('Infra provider not found', 404),
375
+ 'A129': ('Delete infra provider by UUID error', 500),
376
+ 'A130': ('Create infra provider error', 500),
377
+ 'A131': ('Update infra provider error', 500),
378
+ 'A132': ('Create infra billing history record error', 500),
379
+ 'A133': ('Get infra billing history records error', 500),
380
+ 'A134': ('Delete infra billing history record by UUID error', 500),
381
+ 'A135': ('Get billing nodes error', 500),
382
+ 'A136': ('Update infra billing node error', 500),
383
+ 'A137': ('Create infra billing node error', 500),
384
+ 'A138': ('Delete infra billing node by UUID error', 500),
385
+ 'A139': ('Get billing nodes for notifications error', 500),
386
+ 'A140': ('Add users to internal squad error', 500),
387
+ 'A141': ('Internal squad bulk actions error', 500),
388
+ 'A142': ('Remove users from internal squad error', 500),
389
+ 'A143': ('Delete config profile by UUID error', 500),
390
+ 'A144': ('This name is reserved by Remnawave. Please use a different name.', 400),
391
+ 'A145': ('This name is reserved by Remnawave. Please use a different name.', 400),
392
+ 'A146': ('Update config profile error', 500),
393
+ 'A147': ('OAuth2 provider not found', 404),
394
+ 'A148': ('OAuth2 authorize error', 500),
395
+ 'A149': ('Node is disabled', 400),
396
+ 'A150': ('Sync active profile error', 500),
397
+ 'A151': ('Get all host tags error', 500),
398
+ 'A152': ('Name or config is required', 400),
399
+ 'A153': ('Name or inbounds is required', 400),
400
+ 'A154': ('Get internal squad accessible nodes error', 500),
401
+ 'A155': ('Delete hwid user devices error', 500),
402
+ 'A156': ('Create user subscription request history error', 500),
403
+ 'A157': ('Get user subscription request history error', 500),
404
+ 'A158': ('Get all hwid devices error', 500),
405
+ 'A159': ('Get hwid devices stats error', 500),
406
+ 'A160': ('Get user subscription request history stats error', 500),
407
+ 'A161': ('Get snippets error', 500),
408
+ 'A162': ('Snippet not found', 404),
409
+ 'A163': ('Delete snippet by name error', 500),
410
+ 'A164': ('Snippet name already exists', 400),
411
+ 'A165': ('Update snippet error', 500),
412
+ 'A166': ('Snippet cannot be empty', 400),
413
+ 'A167': ('Snippet cannot contain empty objects', 400),
414
+ 'A168': ('Get all subscription templates error', 500),
415
+ 'A169': ('Get subscription template by UUID error', 500),
416
+ 'A170': ('Subscription template not found', 404),
417
+ 'A171': ('Update subscription template error', 500),
418
+ 'A172': ('This name is reserved. Please use a different name.', 400),
419
+ 'A173': ('Template JSON is not allowed for YAML template', 400),
420
+ 'A174': ('Template YAML is not allowed for JSON template', 400),
421
+ 'A175': ('Template JSON and YAML cannot be updated simultaneously', 400),
422
+ 'A176': ('Template name already exists for this type', 400),
423
+ 'A177': ('Delete subscription template error', 500),
424
+ 'A178': ('Reserved template cannot be deleted', 400),
425
+ 'A179': ('Create subscription template error', 500),
426
+ 'A180': ('Template type not allowed', 400),
427
+ 'A181': ('Get external squads error', 500),
428
+ 'A182': ('External squad not found', 404),
429
+ 'A183': ('Create external squad error', 500),
430
+ 'A184': ('Update external squad error', 500),
431
+ 'A185': ('Delete external squad error', 500),
432
+ 'A186': ('Add users to external squad error', 500),
433
+ 'A187': ('Remove users from external squad error', 500),
434
+ 'A188': ('Get external squad by UUID error', 500),
435
+ 'A189': ('External squad name already exists', 400),
436
+ 'A190': ('Name or templates are required', 400),
437
+ 'A191': ('Passkey not found', 404),
438
+ 'A192': ('Get Remnawave settings error', 500),
439
+ 'A193': ('Update Remnawave settings error', 500),
440
+ 'A194': ('Passkeys not configured', 400),
441
+ 'A195': ('Passkeys not enabled. Please enable it first.', 400),
442
+ 'A196': ('Generate passkey registration options error', 500),
443
+ 'A197': ('Verify passkey registration error', 500),
444
+ 'A198': ('Get active passkeys error', 500),
445
+ 'A199': ('Delete passkey error', 500),
446
+ 'A199': ('Validate Remnawave settings error', 500),
447
+ 'A200': ('Get computed config profile by UUID error', 500),
448
+ 'A201': ('Reset node traffic error', 500),
449
+ 'A202': ('Update passkey error', 500),
450
+ 'A203': ('Generic reorder error', 500),
451
+ 'A204': ('HWID device not found', 404),
452
+ 'A205': ('Bulk extend expiration date error', 500),
453
+ 'A206': ('Subscription page config not found', 404),
454
+ 'A207': ('Get subscription page config by UUID error', 500),
455
+ 'A208': ('Get all subscription page configs error', 500),
456
+ 'A209': ('Reserved config name', 400),
457
+ 'A210': ('Config name already exists', 400),
458
+ 'A211': ('Update subscription page config error', 500),
459
+ 'A212': ('Reserved subpage config cannot be deleted', 400),
460
+ 'A213': ('Delete subscription page config error', 500),
461
+ 'A214': ('Create subscription page config error', 500),
462
+ 'A215': ('Invalid subscription page config', 400),
463
+ 'A216': ('Invalid Remnawave injector', 400),
464
+ 'A217': ('Job creation failed', 500),
465
+ 'A218': ('Job result fetch failed or job not found', 404),
466
+ 'A219': ('Connected nodes not found', 404),
467
+ 'A219': ('Get all node plugins error', 500),
468
+ 'A220': ('Node plugin not found', 404),
469
+ 'A221': ('Get node plugin by UUID error', 500),
470
+ 'A222': ('Invalid node plugin config', 400),
471
+ 'A223': ('Node plugin name already exists', 400),
472
+ 'A224': ('Update node plugin error', 500),
473
+ 'A225': ('Create node plugin error', 500),
474
+ 'A226': ('Metadata not found', 404),
475
+ 'A227': ('Get torrent blocker reports error', 500),
476
+ 'A228': ('Update hosts error', 500),
477
+ 'A229': ('One or more provided API token scopes are invalid', 400),
478
+ 'A230': ('Either nodeUuid or name must be provided', 400),
479
+ }