squarecloud-api 3.2.0__py3-none-any.whl → 3.2.1__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.
- squarecloud/app.py +13 -0
- squarecloud/cli/__init__.py +1 -1
- squarecloud/cli/app.py +99 -2
- squarecloud/client.py +27 -9
- squarecloud/data.py +49 -1
- squarecloud/errors.py +20 -3
- squarecloud/http/endpoints.py +30 -2
- squarecloud/http/http_client.py +52 -2
- {squarecloud_api-3.2.0.dist-info → squarecloud_api-3.2.1.dist-info}/METADATA +1 -1
- squarecloud_api-3.2.1.dist-info/RECORD +20 -0
- squarecloud_api-3.2.0.dist-info/RECORD +0 -20
- {squarecloud_api-3.2.0.dist-info → squarecloud_api-3.2.1.dist-info}/LICENSE +0 -0
- {squarecloud_api-3.2.0.dist-info → squarecloud_api-3.2.1.dist-info}/WHEEL +0 -0
- {squarecloud_api-3.2.0.dist-info → squarecloud_api-3.2.1.dist-info}/entry_points.txt +0 -0
squarecloud/app.py
CHANGED
|
@@ -10,6 +10,7 @@ from .data import (
|
|
|
10
10
|
AppData,
|
|
11
11
|
BackupData,
|
|
12
12
|
DeployData,
|
|
13
|
+
DomainAnalytics,
|
|
13
14
|
FileInfo,
|
|
14
15
|
LogsData,
|
|
15
16
|
StatusData,
|
|
@@ -619,3 +620,15 @@ class Application(AbstractApplication):
|
|
|
619
620
|
avoid_listener=True,
|
|
620
621
|
)
|
|
621
622
|
return webhook
|
|
623
|
+
|
|
624
|
+
async def domain_analytics(self) -> DomainAnalytics:
|
|
625
|
+
analytics: DomainAnalytics = await self.client.domain_analytics(
|
|
626
|
+
self.id, avoid_listener=True
|
|
627
|
+
)
|
|
628
|
+
return analytics
|
|
629
|
+
|
|
630
|
+
async def set_custom_domain(self, custom_domain: str):
|
|
631
|
+
response: Response = await self.client.set_custom_domain(
|
|
632
|
+
self.id, custom_domain, avoid_listener=True
|
|
633
|
+
)
|
|
634
|
+
return response
|
squarecloud/cli/__init__.py
CHANGED
squarecloud/cli/app.py
CHANGED
|
@@ -14,6 +14,8 @@ from squarecloud.cli import cli, run_async
|
|
|
14
14
|
from squarecloud.data import (
|
|
15
15
|
AppData,
|
|
16
16
|
BackupData,
|
|
17
|
+
DeployData,
|
|
18
|
+
DomainAnalytics,
|
|
17
19
|
LogsData,
|
|
18
20
|
StatusData,
|
|
19
21
|
UploadData,
|
|
@@ -88,7 +90,7 @@ async def get_app_status(ctx: Context):
|
|
|
88
90
|
|
|
89
91
|
table = Table(title='Status', header_style='purple')
|
|
90
92
|
|
|
91
|
-
status_list = status.
|
|
93
|
+
status_list = status.to_dict()
|
|
92
94
|
for s in status_list:
|
|
93
95
|
table.add_column(s.capitalize(), justify='center')
|
|
94
96
|
table.add_row(
|
|
@@ -158,7 +160,7 @@ async def app_data(ctx: Context):
|
|
|
158
160
|
data: AppData = await client.app_data(app_id)
|
|
159
161
|
table = Table(title='Status', header_style='purple')
|
|
160
162
|
|
|
161
|
-
status_list = data.
|
|
163
|
+
status_list = data.to_dict()
|
|
162
164
|
for s in status_list:
|
|
163
165
|
table.add_column(s.capitalize(), justify='center')
|
|
164
166
|
table.add_row(
|
|
@@ -329,3 +331,98 @@ async def commit(ctx: Context, file: BufferedReader):
|
|
|
329
331
|
style='green',
|
|
330
332
|
)
|
|
331
333
|
)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
@app_group.command(name='last-deploys')
|
|
337
|
+
@click.pass_context
|
|
338
|
+
@run_async
|
|
339
|
+
async def last_deploys(ctx: Context):
|
|
340
|
+
with Console().status('loading'):
|
|
341
|
+
client: Client = ctx.obj['client']
|
|
342
|
+
app_id = ctx.obj['app_id']
|
|
343
|
+
deploys: list[list[DeployData]] = await client.last_deploys(app_id)
|
|
344
|
+
if not deploys:
|
|
345
|
+
print(
|
|
346
|
+
Panel(
|
|
347
|
+
'You do not have any recent deploys for this application',
|
|
348
|
+
title='No deploys',
|
|
349
|
+
title_align='left',
|
|
350
|
+
style='red',
|
|
351
|
+
),
|
|
352
|
+
)
|
|
353
|
+
return
|
|
354
|
+
for deploy in deploys:
|
|
355
|
+
table = Table(header_style='purple')
|
|
356
|
+
|
|
357
|
+
attr_list = deploy[0].__dict__
|
|
358
|
+
for s in attr_list:
|
|
359
|
+
table.add_column(s.capitalize(), justify='center')
|
|
360
|
+
|
|
361
|
+
for d in deploy:
|
|
362
|
+
table.add_row(
|
|
363
|
+
*[str(getattr(d, attr)) for attr in attr_list],
|
|
364
|
+
style='green',
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
print(table)
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
@app_group.command(name='github-integration')
|
|
371
|
+
@click.argument('access_token', type=click.STRING)
|
|
372
|
+
@click.pass_context
|
|
373
|
+
@run_async
|
|
374
|
+
async def github_integration(ctx: Context, access_token: str):
|
|
375
|
+
with Console().status('loading'):
|
|
376
|
+
client: Client = ctx.obj['client']
|
|
377
|
+
app_id = ctx.obj['app_id']
|
|
378
|
+
webhook_url: str = await client.github_integration(
|
|
379
|
+
app_id, access_token
|
|
380
|
+
)
|
|
381
|
+
print(
|
|
382
|
+
Panel(
|
|
383
|
+
webhook_url,
|
|
384
|
+
title='Webhook url',
|
|
385
|
+
border_style='purple',
|
|
386
|
+
style='green',
|
|
387
|
+
)
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
@app_group.command(name='custom-domain')
|
|
392
|
+
@click.argument('domain', type=click.STRING)
|
|
393
|
+
@click.pass_context
|
|
394
|
+
@run_async
|
|
395
|
+
async def custom_domain(ctx: Context, domain: str):
|
|
396
|
+
with Console().status('loading'):
|
|
397
|
+
client: Client = ctx.obj['client']
|
|
398
|
+
app_id = ctx.obj['app_id']
|
|
399
|
+
await client.set_custom_domain(app_id, domain)
|
|
400
|
+
print(
|
|
401
|
+
Panel(
|
|
402
|
+
f'Domain defined to "{domain}"',
|
|
403
|
+
title='Success',
|
|
404
|
+
border_style='purple',
|
|
405
|
+
style='green',
|
|
406
|
+
)
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
@app_group.command(name='domain-analytics')
|
|
411
|
+
@click.pass_context
|
|
412
|
+
@run_async
|
|
413
|
+
async def domain_analytics(ctx: Context):
|
|
414
|
+
with Console().status('loading'):
|
|
415
|
+
client: Client = ctx.obj['client']
|
|
416
|
+
app_id = ctx.obj['app_id']
|
|
417
|
+
analytics: DomainAnalytics = await client.domain_analytics(app_id)
|
|
418
|
+
table = Table(title='Status', header_style='purple')
|
|
419
|
+
|
|
420
|
+
attr_list = analytics.to_dict()
|
|
421
|
+
for s in attr_list:
|
|
422
|
+
table.add_column(s.capitalize(), justify='center')
|
|
423
|
+
table.add_row(
|
|
424
|
+
*[str(getattr(analytics, attr)) for attr in attr_list],
|
|
425
|
+
style='green',
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
print(table)
|
squarecloud/client.py
CHANGED
|
@@ -11,6 +11,7 @@ from .data import (
|
|
|
11
11
|
AppData,
|
|
12
12
|
BackupData,
|
|
13
13
|
DeployData,
|
|
14
|
+
DomainAnalytics,
|
|
14
15
|
FileInfo,
|
|
15
16
|
LogsData,
|
|
16
17
|
StatisticsData,
|
|
@@ -92,17 +93,9 @@ def create_config_file(
|
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
class Client(AbstractClient):
|
|
95
|
-
"""A client for interacting with the SquareCloud API.
|
|
96
|
-
|
|
97
|
-
:ivar api_key: the api key for the client
|
|
98
|
-
:ivar debug: weather the debug messages is enabled
|
|
99
|
-
|
|
100
|
-
:type api_key: str
|
|
101
|
-
:type debug: bool
|
|
102
|
-
"""
|
|
96
|
+
"""A client for interacting with the SquareCloud API."""
|
|
103
97
|
|
|
104
98
|
def __init__(self, api_key: str, debug: bool = True) -> None:
|
|
105
|
-
|
|
106
99
|
"""
|
|
107
100
|
The __init__ function is called when the class is instantiated.
|
|
108
101
|
It sets up the instance of the class, and defines all of its
|
|
@@ -619,3 +612,28 @@ class Client(AbstractClient):
|
|
|
619
612
|
)
|
|
620
613
|
data = response.response
|
|
621
614
|
return data.get('webhook')
|
|
615
|
+
|
|
616
|
+
async def set_custom_domain(
|
|
617
|
+
self, app_id: str, custom_domain: str, **kwargs
|
|
618
|
+
) -> Response:
|
|
619
|
+
response: Response = await self._http.update_custom_domain(
|
|
620
|
+
app_id=app_id, custom_domain=custom_domain
|
|
621
|
+
)
|
|
622
|
+
if not kwargs.get('avoid_listener'):
|
|
623
|
+
endpoint: Endpoint = response.route.endpoint
|
|
624
|
+
await self._listener.on_request(
|
|
625
|
+
endpoint=endpoint, response=response
|
|
626
|
+
)
|
|
627
|
+
return response
|
|
628
|
+
|
|
629
|
+
async def domain_analytics(self, app_id: str, **kwargs) -> DomainAnalytics:
|
|
630
|
+
response: Response = await self._http.domain_analytics(
|
|
631
|
+
app_id=app_id,
|
|
632
|
+
)
|
|
633
|
+
if not kwargs.get('avoid_listener'):
|
|
634
|
+
endpoint: Endpoint = response.route.endpoint
|
|
635
|
+
await self._listener.on_request(
|
|
636
|
+
endpoint=endpoint, response=response
|
|
637
|
+
)
|
|
638
|
+
analytics: DomainAnalytics = DomainAnalytics(**response.response)
|
|
639
|
+
return analytics
|
squarecloud/data.py
CHANGED
|
@@ -29,6 +29,9 @@ class PlanData:
|
|
|
29
29
|
memory: Dict[str, Any]
|
|
30
30
|
duration: Dict[str, Any] | None
|
|
31
31
|
|
|
32
|
+
def to_dict(self):
|
|
33
|
+
return self.__dict__
|
|
34
|
+
|
|
32
35
|
|
|
33
36
|
# @dataclass(frozen=True)
|
|
34
37
|
class Language(TypedDict):
|
|
@@ -72,8 +75,11 @@ class StatusData:
|
|
|
72
75
|
uptime: conint(ge=0) | None = None
|
|
73
76
|
time: conint(ge=0) | None = None
|
|
74
77
|
|
|
78
|
+
def to_dict(self):
|
|
79
|
+
return self.__dict__
|
|
80
|
+
|
|
75
81
|
|
|
76
|
-
@dataclass(frozen=True
|
|
82
|
+
@dataclass(frozen=True)
|
|
77
83
|
class AppData:
|
|
78
84
|
"""
|
|
79
85
|
Application data class
|
|
@@ -112,6 +118,9 @@ class AppData:
|
|
|
112
118
|
custom: str | None = None
|
|
113
119
|
desc: str | None = None
|
|
114
120
|
|
|
121
|
+
def to_dict(self):
|
|
122
|
+
return self.__dict__
|
|
123
|
+
|
|
115
124
|
|
|
116
125
|
@dataclass(frozen=True)
|
|
117
126
|
class UserData:
|
|
@@ -134,6 +143,9 @@ class UserData:
|
|
|
134
143
|
plan: PlanData
|
|
135
144
|
email: str | None = None
|
|
136
145
|
|
|
146
|
+
def to_dict(self):
|
|
147
|
+
return self.__dict__
|
|
148
|
+
|
|
137
149
|
|
|
138
150
|
@dataclass(frozen=True)
|
|
139
151
|
class LogsData:
|
|
@@ -189,6 +201,9 @@ class LogsData:
|
|
|
189
201
|
"""
|
|
190
202
|
return isinstance(other, LogsData) and self.logs == other.logs
|
|
191
203
|
|
|
204
|
+
def to_dict(self):
|
|
205
|
+
return self.__dict__
|
|
206
|
+
|
|
192
207
|
|
|
193
208
|
@dataclass(frozen=True)
|
|
194
209
|
class BackupData:
|
|
@@ -202,6 +217,9 @@ class BackupData:
|
|
|
202
217
|
|
|
203
218
|
downloadURL: str
|
|
204
219
|
|
|
220
|
+
def to_dict(self):
|
|
221
|
+
return self.__dict__
|
|
222
|
+
|
|
205
223
|
|
|
206
224
|
@dataclass(frozen=True)
|
|
207
225
|
class UploadData:
|
|
@@ -233,6 +251,9 @@ class UploadData:
|
|
|
233
251
|
subdomain: str | None = None
|
|
234
252
|
description: str | None = None
|
|
235
253
|
|
|
254
|
+
def to_dict(self):
|
|
255
|
+
return self.__dict__
|
|
256
|
+
|
|
236
257
|
|
|
237
258
|
@dataclass(frozen=True)
|
|
238
259
|
class FileInfo:
|
|
@@ -258,6 +279,9 @@ class FileInfo:
|
|
|
258
279
|
lastModified: conint(ge=0) | float
|
|
259
280
|
path: str
|
|
260
281
|
|
|
282
|
+
def to_dict(self):
|
|
283
|
+
return self.__dict__
|
|
284
|
+
|
|
261
285
|
|
|
262
286
|
@dataclass(frozen=True)
|
|
263
287
|
class StatisticsData:
|
|
@@ -280,9 +304,33 @@ class StatisticsData:
|
|
|
280
304
|
websites: conint(ge=0)
|
|
281
305
|
ping: conint(ge=0)
|
|
282
306
|
|
|
307
|
+
def to_dict(self):
|
|
308
|
+
return self.__dict__
|
|
309
|
+
|
|
283
310
|
|
|
284
311
|
@dataclass(frozen=True)
|
|
285
312
|
class DeployData:
|
|
286
313
|
id: str
|
|
287
314
|
state: str
|
|
288
315
|
date: datetime
|
|
316
|
+
|
|
317
|
+
def to_dict(self):
|
|
318
|
+
return self.__dict__
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
@dataclass(frozen=True)
|
|
322
|
+
class DomainAnalytics:
|
|
323
|
+
hostname: str
|
|
324
|
+
total: list[Any]
|
|
325
|
+
countries: list[Any]
|
|
326
|
+
methods: list[Any]
|
|
327
|
+
referers: list[Any]
|
|
328
|
+
browsers: list[Any]
|
|
329
|
+
deviceTypes: list[Any]
|
|
330
|
+
operatingSystems: list[Any]
|
|
331
|
+
agents: list[Any]
|
|
332
|
+
hosts: list[Any]
|
|
333
|
+
paths: list[Any]
|
|
334
|
+
|
|
335
|
+
def to_dict(self):
|
|
336
|
+
return self.__dict__
|
squarecloud/errors.py
CHANGED
|
@@ -15,7 +15,7 @@ class RequestError(SquareException):
|
|
|
15
15
|
"""raised when a request fails"""
|
|
16
16
|
|
|
17
17
|
def __init__(
|
|
18
|
-
|
|
18
|
+
self, route: str, status_code: int, code: str, *args, **kwargs
|
|
19
19
|
):
|
|
20
20
|
self.route = route
|
|
21
21
|
self.status = status_code
|
|
@@ -29,7 +29,9 @@ class AuthenticationFailure(RequestError):
|
|
|
29
29
|
|
|
30
30
|
def __init__(self, *args, **kwargs):
|
|
31
31
|
super().__init__(*args, **kwargs)
|
|
32
|
-
self.message =
|
|
32
|
+
self.message = (
|
|
33
|
+
'Authentication failed: ' 'Invalid API token or access denied'
|
|
34
|
+
)
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
class NotFoundError(RequestError):
|
|
@@ -199,5 +201,20 @@ class MissingVersion(InvalidConfig):
|
|
|
199
201
|
|
|
200
202
|
|
|
201
203
|
class InvalidAccessToken(RequestError):
|
|
202
|
-
|
|
204
|
+
"""
|
|
205
|
+
raised when the GitHub access token provided by the user is invalid.
|
|
206
|
+
"""
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def __init__(self, *args, **kwargs):
|
|
210
|
+
super().__init__(*args, **kwargs)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class InvalidDomain(RequestError):
|
|
214
|
+
"""
|
|
215
|
+
raised when an invalid domain is provided
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
def __init__(self, domain: str, *args, **kwargs):
|
|
203
219
|
super().__init__(*args, **kwargs)
|
|
220
|
+
self.message = f'{domain} is a invalid custom domain'
|
squarecloud/http/endpoints.py
CHANGED
|
@@ -63,6 +63,14 @@ class Endpoint:
|
|
|
63
63
|
'METHOD': 'POST',
|
|
64
64
|
'PATH': '/apps/{app_id}/deploy/git-webhook',
|
|
65
65
|
},
|
|
66
|
+
'CUSTOM_DOMAIN': {
|
|
67
|
+
'METHOD': 'POST',
|
|
68
|
+
'PATH': '/apps/{app_id}/network/custom/{custom_domain}',
|
|
69
|
+
},
|
|
70
|
+
'DOMAIN_ANALYTICS': {
|
|
71
|
+
'METHOD': 'GET',
|
|
72
|
+
'PATH': '/apps/{app_id}/network/analytics',
|
|
73
|
+
},
|
|
66
74
|
}
|
|
67
75
|
|
|
68
76
|
def __init__(self, name: str) -> None:
|
|
@@ -242,16 +250,36 @@ class Endpoint:
|
|
|
242
250
|
@classmethod
|
|
243
251
|
def last_deploys(cls):
|
|
244
252
|
"""
|
|
245
|
-
|
|
246
|
-
|
|
253
|
+
Returns an Endpoint object that represents the
|
|
254
|
+
/apps/{app_id}/deploy/list endpoint.
|
|
247
255
|
"""
|
|
248
256
|
|
|
249
257
|
return cls('LAST_DEPLOYS')
|
|
250
258
|
|
|
251
259
|
@classmethod
|
|
252
260
|
def github_integration(cls):
|
|
261
|
+
"""
|
|
262
|
+
Returns an Endpoint object that represents the
|
|
263
|
+
/apps/{app_id}/deploy/git-webhook endpoint.
|
|
264
|
+
"""
|
|
253
265
|
return cls('GITHUB_INTEGRATION')
|
|
254
266
|
|
|
267
|
+
@classmethod
|
|
268
|
+
def domain_analytics(cls):
|
|
269
|
+
"""
|
|
270
|
+
Returns an Endpoint object that represents the
|
|
271
|
+
/apps/{app_id}/network/analytics endpoint.
|
|
272
|
+
"""
|
|
273
|
+
return cls('DOMAIN_ANALYTICS')
|
|
274
|
+
|
|
275
|
+
@classmethod
|
|
276
|
+
def custom_domain(cls):
|
|
277
|
+
"""
|
|
278
|
+
Returns an Endpoint object that represents the
|
|
279
|
+
/apps/{app_id}/network/custom/{custom_domain} endpoint.
|
|
280
|
+
"""
|
|
281
|
+
return cls('CUSTOM_DOMAIN')
|
|
282
|
+
|
|
255
283
|
|
|
256
284
|
# pylint: disable=too-few-public-methods
|
|
257
285
|
class Router:
|
squarecloud/http/http_client.py
CHANGED
|
@@ -13,6 +13,7 @@ from ..errors import (
|
|
|
13
13
|
FewMemory,
|
|
14
14
|
InvalidAccessToken,
|
|
15
15
|
InvalidDisplayName,
|
|
16
|
+
InvalidDomain,
|
|
16
17
|
InvalidMain,
|
|
17
18
|
InvalidMemory,
|
|
18
19
|
InvalidVersion,
|
|
@@ -65,7 +66,17 @@ class Response:
|
|
|
65
66
|
return f'{Response.__name__}({self.data})'
|
|
66
67
|
|
|
67
68
|
|
|
68
|
-
def
|
|
69
|
+
def _get_error(code: str) -> type[RequestError] | None:
|
|
70
|
+
"""
|
|
71
|
+
The _get_error function is a helper function that takes in an error code
|
|
72
|
+
and returns the corresponding error class.
|
|
73
|
+
This allows us to easily map errors to their respective classes,
|
|
74
|
+
which makes it easier for us to raise them when we need to.
|
|
75
|
+
|
|
76
|
+
:param code: str: Determine which error to raise
|
|
77
|
+
:return: An error class
|
|
78
|
+
:doc-author: Trelent
|
|
79
|
+
"""
|
|
69
80
|
errors = {
|
|
70
81
|
'FEW_MEMORY': FewMemory,
|
|
71
82
|
'BAD_MEMORY': BadMemory,
|
|
@@ -80,6 +91,7 @@ def _get_upload_error(code: str) -> type[RequestError] | None:
|
|
|
80
91
|
'INVALID_VERSION': InvalidVersion,
|
|
81
92
|
'MISSING_VERSION': MissingVersion,
|
|
82
93
|
'INVALID_ACCESS_TOKEN': InvalidAccessToken,
|
|
94
|
+
'REGEX_VALIDATION': InvalidDomain,
|
|
83
95
|
}
|
|
84
96
|
error_class = errors.get(code, None)
|
|
85
97
|
if error_class is None:
|
|
@@ -117,6 +129,9 @@ class HTTPClient:
|
|
|
117
129
|
headers = {'Authorization': self.api_key}
|
|
118
130
|
extra_error_kwargs: dict[str, Any] = {}
|
|
119
131
|
|
|
132
|
+
if kwargs.get('custom_domain'):
|
|
133
|
+
extra_error_kwargs['domain'] = kwargs.pop('custom_domain')
|
|
134
|
+
|
|
120
135
|
if route.endpoint in (Endpoint.commit(), Endpoint.upload()):
|
|
121
136
|
file = kwargs.pop('file')
|
|
122
137
|
extra_error_kwargs['file'] = file
|
|
@@ -161,7 +176,7 @@ class HTTPClient:
|
|
|
161
176
|
else:
|
|
162
177
|
error = RequestError
|
|
163
178
|
|
|
164
|
-
if _ :=
|
|
179
|
+
if _ := _get_error(code):
|
|
165
180
|
error = _
|
|
166
181
|
if error:
|
|
167
182
|
raise error(
|
|
@@ -424,3 +439,38 @@ class HTTPClient:
|
|
|
424
439
|
body = {'access_token': github_access_token}
|
|
425
440
|
response: Response = await self.request(route, json=body)
|
|
426
441
|
return response
|
|
442
|
+
|
|
443
|
+
async def update_custom_domain(
|
|
444
|
+
self, app_id: str, custom_domain: str
|
|
445
|
+
) -> Response:
|
|
446
|
+
"""
|
|
447
|
+
The update_custom_domain function updates the custom domain of an app.
|
|
448
|
+
|
|
449
|
+
:param self: Represent the instance of a class
|
|
450
|
+
:param app_id: str: Specify the app_id of the application to update
|
|
451
|
+
:param custom_domain: str: Set the custom domain for the app
|
|
452
|
+
:return: A response object
|
|
453
|
+
"""
|
|
454
|
+
route: Router = Router(
|
|
455
|
+
Endpoint.custom_domain(),
|
|
456
|
+
app_id=app_id,
|
|
457
|
+
custom_domain=custom_domain,
|
|
458
|
+
)
|
|
459
|
+
response: Response = await self.request(
|
|
460
|
+
route, custom_domain=custom_domain
|
|
461
|
+
)
|
|
462
|
+
return response
|
|
463
|
+
|
|
464
|
+
async def domain_analytics(self, app_id: str) -> Response:
|
|
465
|
+
"""
|
|
466
|
+
The domain_analytics function returns a list of all domains analytics
|
|
467
|
+
for the specified app.
|
|
468
|
+
|
|
469
|
+
:param self: Represent the instance of a class
|
|
470
|
+
:param app_id: str: Specify the app_id for which you want to retrieve
|
|
471
|
+
analytics
|
|
472
|
+
:return: A response object
|
|
473
|
+
"""
|
|
474
|
+
route: Router = Router(Endpoint.domain_analytics(), app_id=app_id)
|
|
475
|
+
response: Response = await self.request(route)
|
|
476
|
+
return response
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
squarecloud/__init__.py,sha256=uKyryN7qgzkPKLrJZGJYgU1rpbvdDk9fs0FMEW3i5sU,318
|
|
2
|
+
squarecloud/app.py,sha256=akvMUDBYxNoMTp7kvc6VYV2l0T4G_B0hPrkZlXzCUW4,20257
|
|
3
|
+
squarecloud/cli/__init__.py,sha256=BwLiYkf6vl5ZGtT2mouUh_WlNIW3UKY1ZTknlolpXEU,372
|
|
4
|
+
squarecloud/cli/app.py,sha256=YymPA-hUhk2vxW3JdNRgt4bRnXeYuWL7i2qnnjkYCHI,12399
|
|
5
|
+
squarecloud/cli/files.py,sha256=1V6PtpTvPjk7z4wA4LvQ2NbaYD9v74cLS2C6akbA42s,5169
|
|
6
|
+
squarecloud/cli/main.py,sha256=t5cfIWHhuiODBTCAFH-M_OOsBP9bJXsW_nPBGaTI334,5509
|
|
7
|
+
squarecloud/client.py,sha256=6xpEUMATvwje7fT-RVfLcfymaxNILqN0FOtB2kNiqpA,24405
|
|
8
|
+
squarecloud/data.py,sha256=DEgTcw6SUgKYa0Vgr8JzB6YIN0B8NFcO_eZIcaIoCRM,7879
|
|
9
|
+
squarecloud/errors.py,sha256=2GvpPxWHncRJ9UqO9NXIaL29yNl0TlWq81tjnyPXUww,6203
|
|
10
|
+
squarecloud/file.py,sha256=Uod6yvIdm4wcsBoHjs8NZ3FruJaShIMTScTOTtX5LwI,1929
|
|
11
|
+
squarecloud/http/__init__.py,sha256=LWKYcQFw9fDYawSdXDPNYnX9_dkAfM7OUj0ywJB_C5w,80
|
|
12
|
+
squarecloud/http/endpoints.py,sha256=VG_COFQ0s_xnEIRpmW3B4BLuUQ86wBEurUiN1W3jAwQ,10607
|
|
13
|
+
squarecloud/http/http_client.py,sha256=kSrEiym41HNyK56CEhUNB4ukYRt6brPGKNR20K1cs-w,16548
|
|
14
|
+
squarecloud/listeners.py,sha256=XXljCPP910xRM1HVjZgw76UMSRlGWKFhW0qB61OG_-A,6595
|
|
15
|
+
squarecloud/logs.py,sha256=cD-PGX0AnjH0UYxspIMAQQcGkunyXLLQMf5fcPdT2IA,1651
|
|
16
|
+
squarecloud_api-3.2.1.dist-info/entry_points.txt,sha256=dG0YM3xDk5p8-XiqtSF4DDQOjclbczL5Ap2tqpDDXWM,69
|
|
17
|
+
squarecloud_api-3.2.1.dist-info/LICENSE,sha256=gJkD5SS7S88g-xJBSf7rgPwzWEh3-F9RRBq3r3Qtg8E,1100
|
|
18
|
+
squarecloud_api-3.2.1.dist-info/METADATA,sha256=kgAT2AwM3yjZENum3a4Qw9b1QtNFSSQn2zAPgZRFvCI,1889
|
|
19
|
+
squarecloud_api-3.2.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
20
|
+
squarecloud_api-3.2.1.dist-info/RECORD,,
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
squarecloud/__init__.py,sha256=uKyryN7qgzkPKLrJZGJYgU1rpbvdDk9fs0FMEW3i5sU,318
|
|
2
|
-
squarecloud/app.py,sha256=WQahMUNqrcYw5p2X8Z7HlIspzOiIiV6JiGgFutsnmXI,19800
|
|
3
|
-
squarecloud/cli/__init__.py,sha256=oXw74CqDf_Xj0og6swZtCUsCoua2UpSqba_C9bkjco0,372
|
|
4
|
-
squarecloud/cli/app.py,sha256=G0q4RMiaDGMSaO8BdQgbyMzshD3N8H4SBzkM7M-YXik,9562
|
|
5
|
-
squarecloud/cli/files.py,sha256=1V6PtpTvPjk7z4wA4LvQ2NbaYD9v74cLS2C6akbA42s,5169
|
|
6
|
-
squarecloud/cli/main.py,sha256=t5cfIWHhuiODBTCAFH-M_OOsBP9bJXsW_nPBGaTI334,5509
|
|
7
|
-
squarecloud/client.py,sha256=czDJMBBlVAxzkcFWnN0por6JvYN-r6gQQgdC00m3FFA,23545
|
|
8
|
-
squarecloud/data.py,sha256=S-i5ACdC0glHlxxD7dBKL-kGB1UqZ4z3P1W6OHPrd14,6953
|
|
9
|
-
squarecloud/errors.py,sha256=TaPGtWCaNhSwRMoNZi2LqTDi_yfA9TE1p6VDlKqX-7M,5797
|
|
10
|
-
squarecloud/file.py,sha256=Uod6yvIdm4wcsBoHjs8NZ3FruJaShIMTScTOTtX5LwI,1929
|
|
11
|
-
squarecloud/http/__init__.py,sha256=LWKYcQFw9fDYawSdXDPNYnX9_dkAfM7OUj0ywJB_C5w,80
|
|
12
|
-
squarecloud/http/endpoints.py,sha256=PQ5vd0IajQYWMaUUSyVmCv045Q6YyBOB-TRVsumCm6c,9740
|
|
13
|
-
squarecloud/http/http_client.py,sha256=EknqgLUMNyLZKfyfnyQxoNT85CDRfv3ba4gyDr39-AE,14701
|
|
14
|
-
squarecloud/listeners.py,sha256=XXljCPP910xRM1HVjZgw76UMSRlGWKFhW0qB61OG_-A,6595
|
|
15
|
-
squarecloud/logs.py,sha256=cD-PGX0AnjH0UYxspIMAQQcGkunyXLLQMf5fcPdT2IA,1651
|
|
16
|
-
squarecloud_api-3.2.0.dist-info/entry_points.txt,sha256=dG0YM3xDk5p8-XiqtSF4DDQOjclbczL5Ap2tqpDDXWM,69
|
|
17
|
-
squarecloud_api-3.2.0.dist-info/LICENSE,sha256=gJkD5SS7S88g-xJBSf7rgPwzWEh3-F9RRBq3r3Qtg8E,1100
|
|
18
|
-
squarecloud_api-3.2.0.dist-info/METADATA,sha256=Xi6XJXzvSrv11tuOxvaSpGcYe-MVl8bwYK4uaQJNedU,1889
|
|
19
|
-
squarecloud_api-3.2.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
20
|
-
squarecloud_api-3.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|