canonicalwebteam.store-api 4.9.0__py3-none-any.whl → 4.11.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.
- canonicalwebteam/store_api/stores/charmstore.py +2 -2
- canonicalwebteam/store_api/stores/snapstore.py +48 -0
- {canonicalwebteam_store_api-4.9.0.dist-info → canonicalwebteam_store_api-4.11.0.dist-info}/METADATA +1 -1
- canonicalwebteam_store_api-4.11.0.dist-info/RECORD +12 -0
- {canonicalwebteam_store_api-4.9.0.dist-info → canonicalwebteam_store_api-4.11.0.dist-info}/WHEEL +1 -1
- canonicalwebteam_store_api-4.9.0.dist-info/RECORD +0 -12
- {canonicalwebteam_store_api-4.9.0.dist-info → canonicalwebteam_store_api-4.11.0.dist-info}/LICENSE +0 -0
|
@@ -352,7 +352,7 @@ class CharmPublisher(Publisher):
|
|
|
352
352
|
headers=self._get_authorization_header(publisher_auth),
|
|
353
353
|
json={"token": token},
|
|
354
354
|
)
|
|
355
|
-
return
|
|
355
|
+
return response
|
|
356
356
|
|
|
357
357
|
def reject_invite(self, publisher_auth, name, token):
|
|
358
358
|
"""
|
|
@@ -365,7 +365,7 @@ class CharmPublisher(Publisher):
|
|
|
365
365
|
headers=self._get_authorization_header(publisher_auth),
|
|
366
366
|
json={"token": token},
|
|
367
367
|
)
|
|
368
|
-
return
|
|
368
|
+
return response
|
|
369
369
|
|
|
370
370
|
def create_track(self, publisher_auth, charm_name, track_name):
|
|
371
371
|
"""
|
|
@@ -216,6 +216,17 @@ class SnapPublisher(Publisher):
|
|
|
216
216
|
)
|
|
217
217
|
return self.process_response(response)
|
|
218
218
|
|
|
219
|
+
def create_track(self, session, snap_name, track_name):
|
|
220
|
+
"""
|
|
221
|
+
Create a track for a snap base on the snap's guardrail pattern.
|
|
222
|
+
"""
|
|
223
|
+
response = self.session.post(
|
|
224
|
+
url=self.get_publisherwg_endpoint_url(f"snap/{snap_name}/tracks"),
|
|
225
|
+
headers=self._get_publisherwg_authorization_header(session),
|
|
226
|
+
json=[{"name": track_name}],
|
|
227
|
+
)
|
|
228
|
+
return response
|
|
229
|
+
|
|
219
230
|
|
|
220
231
|
class SnapStoreAdmin(SnapPublisher):
|
|
221
232
|
def get_endpoint_url(self, endpoint, api_version=2):
|
|
@@ -464,3 +475,40 @@ class SnapStoreAdmin(SnapPublisher):
|
|
|
464
475
|
)
|
|
465
476
|
|
|
466
477
|
return self.process_response(response)
|
|
478
|
+
|
|
479
|
+
# FEATURED SNAPS AUTOMATION
|
|
480
|
+
def delete_featured_snaps(self, session, snaps):
|
|
481
|
+
headers = self._get_publisherwg_authorization_header(session)
|
|
482
|
+
url = self.get_publisherwg_endpoint_url("snap/featured")
|
|
483
|
+
response = self.session.delete(
|
|
484
|
+
url=url,
|
|
485
|
+
headers=headers,
|
|
486
|
+
json=snaps,
|
|
487
|
+
)
|
|
488
|
+
return response
|
|
489
|
+
|
|
490
|
+
def update_featured_snaps(self, session, snaps):
|
|
491
|
+
headers = self._get_publisherwg_authorization_header(session)
|
|
492
|
+
url = self.get_publisherwg_endpoint_url("snap/featured")
|
|
493
|
+
response = self.session.put(
|
|
494
|
+
url=url,
|
|
495
|
+
headers=headers,
|
|
496
|
+
json=snaps,
|
|
497
|
+
)
|
|
498
|
+
return response
|
|
499
|
+
|
|
500
|
+
def get_featured_snaps(self, session, api_version=1):
|
|
501
|
+
url = "https://api.staging.snapcraft.io/api/v1/snaps/search"
|
|
502
|
+
headers = self.config[api_version].get("headers")
|
|
503
|
+
|
|
504
|
+
params = {
|
|
505
|
+
"scope": "wide",
|
|
506
|
+
"arch": "wide",
|
|
507
|
+
"confinement": "strict,classic,devmode",
|
|
508
|
+
"fields": "snap_id",
|
|
509
|
+
"section": "featured",
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
return self.process_response(
|
|
513
|
+
self.session.get(url, params=params, headers=headers)
|
|
514
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
canonicalwebteam/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
|
|
2
|
+
canonicalwebteam/store_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
canonicalwebteam/store_api/exceptions.py,sha256=A49LRhiEIfXNB2zC-zNcZEcdh0ugw6G7fBbXbs-BWxA,1517
|
|
4
|
+
canonicalwebteam/store_api/publisher.py,sha256=c3zvfp8tbplsju5MLb2Zc5uCldj8fiHcbX1ZD0o9Cfo,10632
|
|
5
|
+
canonicalwebteam/store_api/store.py,sha256=dyz3afMF_mTr3k6oAx5pBU0U8zRLIFYYgO-BUa62mj4,6249
|
|
6
|
+
canonicalwebteam/store_api/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
canonicalwebteam/store_api/stores/charmstore.py,sha256=ffAaL9WkTkwG1S1DypU2pzqTME_u7bU78UUJwEiDI6A,11533
|
|
8
|
+
canonicalwebteam/store_api/stores/snapstore.py,sha256=spvxciOc_nifHFmsS7q6wNNhXj3UtFUEjVDwaEicrQQ,16458
|
|
9
|
+
canonicalwebteam_store_api-4.11.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
10
|
+
canonicalwebteam_store_api-4.11.0.dist-info/METADATA,sha256=PpsG39-MhT0cRdlJATILBfFzdlOFKh0De40ivaG3luk,2265
|
|
11
|
+
canonicalwebteam_store_api-4.11.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
12
|
+
canonicalwebteam_store_api-4.11.0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
canonicalwebteam/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
|
|
2
|
-
canonicalwebteam/store_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
canonicalwebteam/store_api/exceptions.py,sha256=A49LRhiEIfXNB2zC-zNcZEcdh0ugw6G7fBbXbs-BWxA,1517
|
|
4
|
-
canonicalwebteam/store_api/publisher.py,sha256=c3zvfp8tbplsju5MLb2Zc5uCldj8fiHcbX1ZD0o9Cfo,10632
|
|
5
|
-
canonicalwebteam/store_api/store.py,sha256=dyz3afMF_mTr3k6oAx5pBU0U8zRLIFYYgO-BUa62mj4,6249
|
|
6
|
-
canonicalwebteam/store_api/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
canonicalwebteam/store_api/stores/charmstore.py,sha256=4p4CRvmEzaRonFZipgtPdVKf4qMdDky3H2sJUg1yDvk,11579
|
|
8
|
-
canonicalwebteam/store_api/stores/snapstore.py,sha256=WQ8PgwrnLAq3MSlNklNDXqPAZy3PCHVoiF55kEKKOoo,14824
|
|
9
|
-
canonicalwebteam_store_api-4.9.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
10
|
-
canonicalwebteam_store_api-4.9.0.dist-info/METADATA,sha256=AARBtiIuSBeI959Wp6xQRKvqUMvwH3CqD6y9U_q0l2Q,2264
|
|
11
|
-
canonicalwebteam_store_api-4.9.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
12
|
-
canonicalwebteam_store_api-4.9.0.dist-info/RECORD,,
|
{canonicalwebteam_store_api-4.9.0.dist-info → canonicalwebteam_store_api-4.11.0.dist-info}/LICENSE
RENAMED
|
File without changes
|