Skip to content

Commit

Permalink
Merge pull request #23 from stateless-solutions/cleanup-fix
Browse files Browse the repository at this point in the history
fix: manager return
  • Loading branch information
crisog authored Feb 2, 2024
2 parents e9651b9 + 00f5038 commit 0ff888c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "stateless-sdk"
version = "0.0.9-beta" # Keep this in sync with __version__ in stateless/main.py
version = "0.0.9-beta1" # Keep this in sync with __version__ in stateless/main.py
authors = [{name = "blockjoe", email = "[email protected]"}]
description = "A CLI for interacting with the Stateless Gateway"
dependencies = [
Expand Down
3 changes: 2 additions & 1 deletion stateless/cli/commands/api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def _get_api_keys(offset=0, limit=10):

@staticmethod
def _select_api_key(prompt_message):
api_keys = APIKeysManager._get_api_keys()
response = APIKeysManager._get_api_keys()
api_keys = response["items"]
choices = [(key["name"], key["id"]) for key in api_keys]
questions = [
inquirer.List(
Expand Down
3 changes: 2 additions & 1 deletion stateless/cli/commands/buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def _get_buckets(offset=0, limit=10):

@staticmethod
def _select_bucket(prompt_message):
buckets = BucketsManager._get_buckets()
response = BucketsManager._get_buckets()
buckets = response["items"]
choices = [(bucket["name"], bucket["id"]) for bucket in buckets]
questions = [
inquirer.List(
Expand Down
8 changes: 5 additions & 3 deletions stateless/cli/commands/entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ def _get_regions():

@staticmethod
def _select_entrypoint(prompt_message):
response = EntrypointsManager._get_offerings()
offerings = response["items"]
entrypoints = [
(item["url"], item["id"]) for item in EntrypointsManager._get_offerings()
(item["url"], item["id"]) for item in offerings
]
questions = [
inquirer.List(
Expand All @@ -65,7 +67,7 @@ def entrypoint_create(config_file: Optional[str] = Option(None, "--config-file",
else:
offerings = [
(item["chain"]["name"], item["id"])
for item in EntrypointsManager._get_offerings()
for item in EntrypointsManager._get_offerings()["items"]
]
regions = [
(item["name"], item["id"]) for item in EntrypointsManager._get_regions()
Expand Down Expand Up @@ -213,7 +215,7 @@ def entrypoint_list(
provider_guard()
offerings = [
(item["chain"]["name"], item["id"])
for item in EntrypointsManager._get_offerings()
for item in EntrypointsManager._get_offerings()["items"]
]
questions = [
inquirer.List(
Expand Down
4 changes: 2 additions & 2 deletions stateless/cli/commands/offerings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _get_offerings(chain_id: Optional[int] = None, offset=0, limit=10):
def _select_offering(prompt_message, chain_id=None):
offerings = [
(f"{item['chain']['name']} - {item['provider']['name']}", item["id"])
for item in OfferingsManager._get_offerings(chain_id)
for item in OfferingsManager._get_offerings(chain_id)["items"]
]
questions = [
inquirer.List(
Expand All @@ -44,7 +44,7 @@ def _select_offering(prompt_message, chain_id=None):

@staticmethod
def _select_offerings(prompt_message, chain_id=None, selected_offerings=None):
offerings = OfferingsManager._get_offerings(chain_id)
offerings = OfferingsManager._get_offerings(chain_id)["items"]
choices = [
(
"{}".format(offering["provider"]["name"]),
Expand Down
2 changes: 1 addition & 1 deletion stateless/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BaseManager:
def make_paginated_request(route: str, offset=0, limit=10, params={}):
params = {"offset": offset, "limit": limit, **params}
response = make_request_with_api_key("GET", route, params=params)
return response.json()["items"]
return response.json()

@staticmethod
def _print_table(items, columns):
Expand Down
2 changes: 1 addition & 1 deletion stateless/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
|_____/ \__\__,_|\__\___|_|\___||___/___/ \_____|______|_____|
""" # noqa: W291

__version__ = "0.0.9-beta" # Keep this in sync with pyproject.toml
__version__ = "0.0.9-beta1" # Keep this in sync with pyproject.toml


def version_callback(value: bool):
Expand Down

0 comments on commit 0ff888c

Please sign in to comment.