flask-shopify-utils 0.3.2__tar.gz → 0.3.3__tar.gz

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 (17) hide show
  1. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/PKG-INFO +3 -3
  2. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/pyproject.toml +1 -1
  3. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/src/flask_shopify_utils/__init__.py +4 -3
  4. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/src/flask_shopify_utils/model.py +1 -1
  5. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/.gitignore +0 -0
  6. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/LICENSE +0 -0
  7. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/README.md +0 -0
  8. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/src/flask_shopify_utils/cli/__init__.py +0 -0
  9. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/src/flask_shopify_utils/cli/main.py +0 -0
  10. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/src/flask_shopify_utils/utils.py +0 -0
  11. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/tests/conftest.py +0 -0
  12. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/tests/test_alpha.py +0 -0
  13. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/tests/test_cli_main.py +0 -0
  14. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/tests/test_default_routes.py +0 -0
  15. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/tests/test_gdpr_routes.py +0 -0
  16. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/tests/test_graphql_cli.py +0 -0
  17. {flask_shopify_utils-0.3.2 → flask_shopify_utils-0.3.3}/tests/test_ui_routes.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: flask-shopify-utils
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: A Flask extension for Shopify app development
5
5
  Project-URL: Homepage, https://github.com/leocxy/flask-shopify-utils
6
6
  Project-URL: Bug Tracker, https://github.com/leocxy/flask-shopify-utils/issues
@@ -33,7 +33,7 @@ Provides-Extra: dev
33
33
  Requires-Dist: build<2; extra == 'dev'
34
34
  Requires-Dist: flake8<8; extra == 'dev'
35
35
  Requires-Dist: pytest<9; extra == 'dev'
36
- Requires-Dist: twine<7; extra == 'dev'
36
+ Requires-Dist: twine==7.0.0; extra == 'dev'
37
37
  Description-Content-Type: text/markdown
38
38
 
39
39
  # Flask-Shopify-Utils
@@ -46,7 +46,7 @@ lazy-dog = "flask_shopify_utils.cli.main:copy_files"
46
46
  [project.optional-dependencies]
47
47
  dev = [
48
48
  "pytest < 9",
49
- "twine < 7",
49
+ "twine == 7.0.0",
50
50
  "flake8 < 8",
51
51
  "build < 2"
52
52
  ]
@@ -30,7 +30,7 @@ from cerberus.validator import Validator
30
30
  from pytz import timezone
31
31
  from flask_shopify_utils.utils import get_version, GraphQLClient
32
32
 
33
- __version__ = '0.3.2'
33
+ __version__ = '0.3.3'
34
34
 
35
35
  current_time_func = None
36
36
  sqlalchemy_instance = None
@@ -946,11 +946,10 @@ class ShopifyUtil:
946
946
  version = get_version(version)
947
947
  try:
948
948
  cond = Store.deleted_at.is_(None)
949
- store = self.db.query(Store).filter_by(key=g.store_key).filter(cond).first()
949
+ store = self.db.query(Store).filter_by(id=store_id).filter(cond).first()
950
950
  if not store:
951
951
  raise ClickException('Store[{}] does not exists!'.format(store_id))
952
952
  except Exception as e:
953
- print(e)
954
953
  raise ClickException('Can`t fetch Store data from database!')
955
954
  url = 'https://{}/admin/api/{}/graphql'.format(store.key, version)
956
955
  endpoint = HTTPEndpoint(url, {'X-Shopify-Access-Token': store.token})
@@ -958,6 +957,8 @@ class ShopifyUtil:
958
957
  include_description=False,
959
958
  include_deprecated=with_deprecated,
960
959
  ))
960
+ if 'errors' in data.keys():
961
+ raise ClickException('GraphQL Schema fetch failed! {}'.format(data['errors']))
961
962
  json_file = 'schema.json'
962
963
  with open(json_file, 'w') as f:
963
964
  dump(data, f, indent=4, sort_keys=True, default=str)
@@ -83,7 +83,7 @@ class Webhook(db.Model, BasicMethod):
83
83
  webhook_id = db.Column(db.BigInteger, comment="Webhook ID")
84
84
  target = db.Column(db.String(24), comment='Action Target')
85
85
  action = db.Column(db.String(24), comment='Action')
86
- data = db.Column(db.Text(64000), comment='JSON string -> 64kb medium text for MYSQL/MariaDB')
86
+ data = db.Column(db.Text)
87
87
  remark = db.Column(db.Text)
88
88
  status = db.Column(db.SmallInteger, default=0)
89
89
  created_at = db.Column(db.DateTime, default=current_time)