lib-shopware6-api-base 2.1.7__tar.gz → 2.1.8__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 (64) hide show
  1. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/README_template.rst +1 -1
  2. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/installation.rst +1 -2
  3. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/tested_under.rst +1 -1
  4. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.github/workflows/python-package.yml +5 -5
  5. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/CHANGES.rst +5 -0
  6. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/LICENSE +1 -1
  7. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/PKG-INFO +45 -13
  8. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/README.rst +43 -11
  9. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/__init__conf__.py +2 -2
  10. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/lib_shopware6_api_base.py +49 -20
  11. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/lib_shopware6_api_base_criteria.py +10 -9
  12. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base.egg-info/PKG-INFO +46 -14
  13. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base.egg-info/requires.txt +1 -1
  14. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/pyproject.toml +3 -3
  15. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/requirements.txt +1 -1
  16. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/lib_bash_functions.sh +1 -1
  17. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.3rd_party_stubs/readme.txt +0 -0
  18. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.coveragerc +0 -0
  19. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/acknowledgment.rst +0 -0
  20. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/badges.rst +0 -0
  21. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/commandline_help.rst +0 -0
  22. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/contribute.rst +0 -0
  23. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/description.rst +0 -0
  24. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/index.rst +0 -0
  25. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/installation_via_makefile.rst +0 -0
  26. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/installation_via_pypi.rst +0 -0
  27. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/licence_mit.rst +0 -0
  28. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/try_in_jupyter.rst +0 -0
  29. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.docs/usage.rst +0 -0
  30. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.flake8 +0 -0
  31. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.github/workflows/codeql-analysis.yml +0 -0
  32. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/.gitignore +0 -0
  33. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/CODE_OF_CONDUCT.md +0 -0
  34. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/CONTRIBUTING.md +0 -0
  35. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/ISSUE_TEMPLATE.md +0 -0
  36. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/MANIFEST.in +0 -0
  37. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/Makefile +0 -0
  38. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/PULL_REQUEST_TEMPLATE.md +0 -0
  39. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/conftest.py +0 -0
  40. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/.gitignore +0 -0
  41. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/__init__.py +0 -0
  42. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/conf_shopware6_api_base_classes.py +0 -0
  43. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/conf_shopware6_api_base_docker_testcontainer.py +0 -0
  44. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/lib_shopware6_api_base_cli.py +0 -0
  45. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/lib_shopware6_api_base_criteria_aggregation.py +0 -0
  46. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/lib_shopware6_api_base_criteria_filter.py +0 -0
  47. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/lib_shopware6_api_base_criteria_sorting.py +0 -0
  48. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/lib_shopware6_api_base_helpers.py +0 -0
  49. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base/py.typed +0 -0
  50. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base.egg-info/SOURCES.txt +0 -0
  51. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base.egg-info/dependency_links.txt +0 -0
  52. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base.egg-info/entry_points.txt +0 -0
  53. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base.egg-info/top_level.txt +0 -0
  54. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/lib_shopware6_api_base.ipynb +0 -0
  55. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/requirements_test.txt +0 -0
  56. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/setup.cfg +0 -0
  57. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/run_clean.sh +0 -0
  58. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/run_pytest.sh +0 -0
  59. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/run_testloop.sh +0 -0
  60. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/run_testloop_pytest_and_mypy_only_no_setup.sh +0 -0
  61. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/run_testloop_windows.cmd +0 -0
  62. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/shellcheck.sh +0 -0
  63. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/local_testscripts/testing_tools.py +0 -0
  64. {lib_shopware6_api_base-2.1.7 → lib_shopware6_api_base-2.1.8}/tests/test_cli.py +0 -0
@@ -2,7 +2,7 @@ lib_shopware6_api_base
2
2
  ======================
3
3
 
4
4
 
5
- Version v2.1.7 as of 2023-10-18 see `Changelog`_
5
+ Version v2.1.8 as of 2024-09-29 see `Changelog`_
6
6
 
7
7
 
8
8
  .. include:: ./badges.rst
@@ -1,10 +1,9 @@
1
- - Before You start, its highly recommended to update pip and setup tools:
1
+ - Before You start, its highly recommended to update pip:
2
2
 
3
3
 
4
4
  .. code-block::
5
5
 
6
6
  python -m pip --upgrade pip
7
- python -m pip --upgrade setuptools
8
7
 
9
8
 
10
9
  .. include:: ./installation_via_pypi.rst
@@ -1,3 +1,3 @@
1
- tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12-dev, pypy-3.9, pypy-3.10 - architectures: amd64
1
+ tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12, pypy-3.9, pypy-3.10 - architectures: amd64
2
2
 
3
3
  `100% code coverage <https://codeclimate.com/github/bitranox/lib_shopware6_api_base/test_coverage>`_, flake8 style checking ,mypy static type checking ,tested under `Linux <https://github.com/bitranox/lib_shopware6_api_base/actions/workflows/python-package.yml>`_, automatic daily builds and monitoring
@@ -50,7 +50,7 @@ jobs:
50
50
 
51
51
  # MYPY tests
52
52
  MYPY_DO_TESTS: "True"
53
- MYPY_OPTIONS: "--follow-imports=normal --ignore-missing-imports --implicit-reexport --install-types --no-warn-unused-ignores --non-interactive --strict"
53
+ MYPY_OPTIONS: "--follow-imports=normal --ignore-missing-imports --install-types --no-warn-unused-ignores --non-interactive --strict"
54
54
  MYPYPATH: "./.3rd_party_stubs"
55
55
 
56
56
  # coverage
@@ -70,7 +70,7 @@ jobs:
70
70
  CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
71
71
  # make PyPi API token available in Environment
72
72
  PYPI_UPLOAD_API_TOKEN: ${{ secrets.PYPI_UPLOAD_API_TOKEN }}
73
-
73
+ # additional Environment Variables:
74
74
 
75
75
  strategy:
76
76
  matrix:
@@ -124,7 +124,7 @@ jobs:
124
124
  DO_CLI_TEST: "True"
125
125
 
126
126
  - os: ubuntu-latest
127
- python-version: "3.12-dev"
127
+ python-version: "3.12"
128
128
  env:
129
129
  BUILD_DOCS: "True"
130
130
  BUILD: "True"
@@ -161,11 +161,11 @@ jobs:
161
161
 
162
162
  steps:
163
163
  # see : https://github.com/actions/checkout
164
- - uses: actions/checkout@v3
164
+ - uses: actions/checkout@v4
165
165
 
166
166
  - name: Setting up Python ${{ matrix.python-version }}
167
167
  # see: https://github.com/actions/setup-python
168
- uses: actions/setup-python@v4
168
+ uses: actions/setup-python@v5
169
169
  with:
170
170
  python-version: ${{ matrix.python-version }}
171
171
 
@@ -5,6 +5,11 @@ Changelog
5
5
  - new MINOR version for added functionality in a backwards compatible manner
6
6
  - new PATCH version for backwards compatible bug fixes
7
7
 
8
+ v2.1.8
9
+ ---------
10
+ 2024-09-29:
11
+ - add example for /search/order via post request
12
+
8
13
  v2.1.7
9
14
  ---------
10
15
  2023-10-18:
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 1990-2023 Robert Nowotny
3
+ Copyright (c) 1990-2024 Robert Nowotny
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lib_shopware6_api_base
3
- Version: 2.1.7
3
+ Version: 2.1.8
4
4
  Summary: python3 base API client for shopware6
5
5
  Author-email: Robert Nowotny <bitranox@gmail.com>
6
6
  License: MIT
@@ -24,7 +24,7 @@ Requires-Dist: click
24
24
  Requires-Dist: lib_detect_testenv
25
25
  Requires-Dist: oauthlib
26
26
  Requires-Dist: requests
27
- Requires-Dist: requests_oauthlib
27
+ Requires-Dist: requests-oauthlib
28
28
  Provides-Extra: test
29
29
  Requires-Dist: black; extra == "test"
30
30
  Requires-Dist: codecov; extra == "test"
@@ -41,7 +41,7 @@ lib_shopware6_api_base
41
41
  ======================
42
42
 
43
43
 
44
- Version v2.1.7 as of 2023-10-18 see `Changelog`_
44
+ Version v2.1.8 as of 2024-09-29 see `Changelog`_
45
45
 
46
46
  |build_badge| |codeql| |license| |pypi|
47
47
  |pypi-downloads| |black| |codecov| |cc_maintain| |cc_issues| |cc_coverage| |snyk|
@@ -109,7 +109,7 @@ automated tests, Github Actions, Documentation, Badges, etc. are managed with `P
109
109
 
110
110
  Python version required: 3.8.0 or newer
111
111
 
112
- tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12-dev, pypy-3.9, pypy-3.10 - architectures: amd64
112
+ tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12, pypy-3.9, pypy-3.10 - architectures: amd64
113
113
 
114
114
  `100% code coverage <https://codeclimate.com/github/bitranox/lib_shopware6_api_base/test_coverage>`_, flake8 style checking ,mypy static type checking ,tested under `Linux <https://github.com/bitranox/lib_shopware6_api_base/actions/workflows/python-package.yml>`_, automatic daily builds and monitoring
115
115
 
@@ -610,8 +610,6 @@ Admin API
610
610
  >>> my_payload=Criteria()
611
611
  >>> my_response_dict = my_api_client.request_get_paginated(request_url='product', payload=my_payload, junk_size=10)
612
612
  >>> assert 5 < len(my_response_dict['data'])
613
-
614
-
615
613
  """
616
614
 
617
615
  - Admin API PATCH
@@ -715,6 +713,36 @@ Admin API
715
713
  >>> my_response_dict = my_api_client.request_post_paginated(request_url=my_url, payload=my_payload, junk_size=3)
716
714
  >>> assert 4 == len(my_response_dict['data'])
717
715
 
716
+ >>> # search for orders
717
+ >>> # test https://github.com/bitranox/lib_shopware6_api_base/issues/11
718
+ >>> import pprint
719
+ >>> date_from = '2024-09-29T00:00:00.000Z'
720
+ >>> date_to = '2024-09-29T23:59:59.999Z'
721
+ >>> my_criteria = Criteria()
722
+ >>> my_criteria.filter.append(RangeFilter(field="orderDate", parameters = {'gte': date_from, 'lte': date_to}))
723
+ >>> my_criteria.filter.append(MultiFilter('or', [
724
+ ... EqualsFilter(field='documents.documentType.technicalName', value='invoice'),
725
+ ... EqualsFilter(field='documents.documentType.technicalName', value='storno')]))
726
+ >>> pprint_attrs(my_criteria)
727
+ {'limit': None,
728
+ 'page': None,
729
+ 'filter': [{'type': 'range',
730
+ 'field': 'orderDate',
731
+ 'parameters': {'gte': '2024-09-29T00:00:00.000Z',
732
+ 'lte': '2024-09-29T23:59:59.999Z'}},
733
+ {'type': 'multi',
734
+ 'operator': 'or',
735
+ 'queries': [{'type': 'equals',
736
+ 'field': 'documents.documentType.technicalName',
737
+ 'value': 'invoice'},
738
+ {'type': 'equals',
739
+ 'field': 'documents.documentType.technicalName',
740
+ 'value': 'storno'}]}],
741
+ 'term': None,
742
+ 'total_count_mode': None}
743
+ >>> my_response_dict = my_api_client.request_post_paginated(request_url='search/order', payload=my_criteria)
744
+ >>> pprint.pprint(my_response_dict)
745
+ {'data': []}
718
746
  """
719
747
 
720
748
  - Admin API PUT
@@ -910,8 +938,8 @@ a search criteria follows the following schema:
910
938
  >>> my_criteria = Criteria()
911
939
  >>> my_criteria.ids=["012cd563cf8e4f0384eed93b5201cc98", "075fb241b769444bb72431f797fd5776", "090fcc2099794771935acf814e3fdb24"]
912
940
  >>> pprint_attrs(my_criteria)
913
- {'limit': 3,
914
- 'page': 1,
941
+ {'limit': None,
942
+ 'page': None,
915
943
  'ids': ['012cd563cf8e4f0384eed93b5201cc98',
916
944
  '075fb241b769444bb72431f797fd5776',
917
945
  '090fcc2099794771935acf814e3fdb24'],
@@ -1642,8 +1670,8 @@ Please note that as soon as You use ids, limit and page does not apply anymore !
1642
1670
  >>> my_criteria = Criteria()
1643
1671
  >>> my_criteria.ids=["012cd563cf8e4f0384eed93b5201cc98", "075fb241b769444bb72431f797fd5776", "090fcc2099794771935acf814e3fdb24"]
1644
1672
  >>> pprint_attrs(my_criteria)
1645
- {'limit': 3,
1646
- 'page': 1,
1673
+ {'limit': None,
1674
+ 'page': None,
1647
1675
  'ids': ['012cd563cf8e4f0384eed93b5201cc98',
1648
1676
  '075fb241b769444bb72431f797fd5776',
1649
1677
  '090fcc2099794771935acf814e3fdb24'],
@@ -1871,13 +1899,12 @@ Usage from Commandline
1871
1899
  Installation and Upgrade
1872
1900
  ------------------------
1873
1901
 
1874
- - Before You start, its highly recommended to update pip and setup tools:
1902
+ - Before You start, its highly recommended to update pip:
1875
1903
 
1876
1904
 
1877
1905
  .. code-block::
1878
1906
 
1879
1907
  python -m pip --upgrade pip
1880
- python -m pip --upgrade setuptools
1881
1908
 
1882
1909
  - to install the latest release from PyPi via pip (recommended):
1883
1910
 
@@ -1959,7 +1986,7 @@ following modules will be automatically installed :
1959
1986
  lib_detect_testenv
1960
1987
  oauthlib
1961
1988
  requests
1962
- requests_oauthlib
1989
+ requests-oauthlib
1963
1990
 
1964
1991
  Acknowledgements
1965
1992
  ----------------
@@ -1986,6 +2013,11 @@ Changelog
1986
2013
  - new MINOR version for added functionality in a backwards compatible manner
1987
2014
  - new PATCH version for backwards compatible bug fixes
1988
2015
 
2016
+ v2.1.8
2017
+ ---------
2018
+ 2024-09-29:
2019
+ - add example for /search/order via post request
2020
+
1989
2021
  v2.1.7
1990
2022
  ---------
1991
2023
  2023-10-18:
@@ -2,7 +2,7 @@ lib_shopware6_api_base
2
2
  ======================
3
3
 
4
4
 
5
- Version v2.1.7 as of 2023-10-18 see `Changelog`_
5
+ Version v2.1.8 as of 2024-09-29 see `Changelog`_
6
6
 
7
7
  |build_badge| |codeql| |license| |pypi|
8
8
  |pypi-downloads| |black| |codecov| |cc_maintain| |cc_issues| |cc_coverage| |snyk|
@@ -70,7 +70,7 @@ automated tests, Github Actions, Documentation, Badges, etc. are managed with `P
70
70
 
71
71
  Python version required: 3.8.0 or newer
72
72
 
73
- tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12-dev, pypy-3.9, pypy-3.10 - architectures: amd64
73
+ tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12, pypy-3.9, pypy-3.10 - architectures: amd64
74
74
 
75
75
  `100% code coverage <https://codeclimate.com/github/bitranox/lib_shopware6_api_base/test_coverage>`_, flake8 style checking ,mypy static type checking ,tested under `Linux <https://github.com/bitranox/lib_shopware6_api_base/actions/workflows/python-package.yml>`_, automatic daily builds and monitoring
76
76
 
@@ -571,8 +571,6 @@ Admin API
571
571
  >>> my_payload=Criteria()
572
572
  >>> my_response_dict = my_api_client.request_get_paginated(request_url='product', payload=my_payload, junk_size=10)
573
573
  >>> assert 5 < len(my_response_dict['data'])
574
-
575
-
576
574
  """
577
575
 
578
576
  - Admin API PATCH
@@ -676,6 +674,36 @@ Admin API
676
674
  >>> my_response_dict = my_api_client.request_post_paginated(request_url=my_url, payload=my_payload, junk_size=3)
677
675
  >>> assert 4 == len(my_response_dict['data'])
678
676
 
677
+ >>> # search for orders
678
+ >>> # test https://github.com/bitranox/lib_shopware6_api_base/issues/11
679
+ >>> import pprint
680
+ >>> date_from = '2024-09-29T00:00:00.000Z'
681
+ >>> date_to = '2024-09-29T23:59:59.999Z'
682
+ >>> my_criteria = Criteria()
683
+ >>> my_criteria.filter.append(RangeFilter(field="orderDate", parameters = {'gte': date_from, 'lte': date_to}))
684
+ >>> my_criteria.filter.append(MultiFilter('or', [
685
+ ... EqualsFilter(field='documents.documentType.technicalName', value='invoice'),
686
+ ... EqualsFilter(field='documents.documentType.technicalName', value='storno')]))
687
+ >>> pprint_attrs(my_criteria)
688
+ {'limit': None,
689
+ 'page': None,
690
+ 'filter': [{'type': 'range',
691
+ 'field': 'orderDate',
692
+ 'parameters': {'gte': '2024-09-29T00:00:00.000Z',
693
+ 'lte': '2024-09-29T23:59:59.999Z'}},
694
+ {'type': 'multi',
695
+ 'operator': 'or',
696
+ 'queries': [{'type': 'equals',
697
+ 'field': 'documents.documentType.technicalName',
698
+ 'value': 'invoice'},
699
+ {'type': 'equals',
700
+ 'field': 'documents.documentType.technicalName',
701
+ 'value': 'storno'}]}],
702
+ 'term': None,
703
+ 'total_count_mode': None}
704
+ >>> my_response_dict = my_api_client.request_post_paginated(request_url='search/order', payload=my_criteria)
705
+ >>> pprint.pprint(my_response_dict)
706
+ {'data': []}
679
707
  """
680
708
 
681
709
  - Admin API PUT
@@ -871,8 +899,8 @@ a search criteria follows the following schema:
871
899
  >>> my_criteria = Criteria()
872
900
  >>> my_criteria.ids=["012cd563cf8e4f0384eed93b5201cc98", "075fb241b769444bb72431f797fd5776", "090fcc2099794771935acf814e3fdb24"]
873
901
  >>> pprint_attrs(my_criteria)
874
- {'limit': 3,
875
- 'page': 1,
902
+ {'limit': None,
903
+ 'page': None,
876
904
  'ids': ['012cd563cf8e4f0384eed93b5201cc98',
877
905
  '075fb241b769444bb72431f797fd5776',
878
906
  '090fcc2099794771935acf814e3fdb24'],
@@ -1603,8 +1631,8 @@ Please note that as soon as You use ids, limit and page does not apply anymore !
1603
1631
  >>> my_criteria = Criteria()
1604
1632
  >>> my_criteria.ids=["012cd563cf8e4f0384eed93b5201cc98", "075fb241b769444bb72431f797fd5776", "090fcc2099794771935acf814e3fdb24"]
1605
1633
  >>> pprint_attrs(my_criteria)
1606
- {'limit': 3,
1607
- 'page': 1,
1634
+ {'limit': None,
1635
+ 'page': None,
1608
1636
  'ids': ['012cd563cf8e4f0384eed93b5201cc98',
1609
1637
  '075fb241b769444bb72431f797fd5776',
1610
1638
  '090fcc2099794771935acf814e3fdb24'],
@@ -1832,13 +1860,12 @@ Usage from Commandline
1832
1860
  Installation and Upgrade
1833
1861
  ------------------------
1834
1862
 
1835
- - Before You start, its highly recommended to update pip and setup tools:
1863
+ - Before You start, its highly recommended to update pip:
1836
1864
 
1837
1865
 
1838
1866
  .. code-block::
1839
1867
 
1840
1868
  python -m pip --upgrade pip
1841
- python -m pip --upgrade setuptools
1842
1869
 
1843
1870
  - to install the latest release from PyPi via pip (recommended):
1844
1871
 
@@ -1920,7 +1947,7 @@ following modules will be automatically installed :
1920
1947
  lib_detect_testenv
1921
1948
  oauthlib
1922
1949
  requests
1923
- requests_oauthlib
1950
+ requests-oauthlib
1924
1951
 
1925
1952
  Acknowledgements
1926
1953
  ----------------
@@ -1947,6 +1974,11 @@ Changelog
1947
1974
  - new MINOR version for added functionality in a backwards compatible manner
1948
1975
  - new PATCH version for backwards compatible bug fixes
1949
1976
 
1977
+ v2.1.8
1978
+ ---------
1979
+ 2024-09-29:
1980
+ - add example for /search/order via post request
1981
+
1950
1982
  v2.1.7
1951
1983
  ---------
1952
1984
  2023-10-18:
@@ -2,7 +2,7 @@
2
2
 
3
3
  name = 'lib_shopware6_api_base'
4
4
  title = 'python3 base API client for shopware6'
5
- version = 'v2.1.7'
5
+ version = 'v2.1.8'
6
6
  url = 'https://github.com/bitranox/lib_shopware6_api_base'
7
7
  author = 'Robert Nowotny'
8
8
  author_email = 'bitranox@gmail.com'
@@ -16,7 +16,7 @@ Info for lib_shopware6_api_base:
16
16
 
17
17
  python3 base API client for shopware6
18
18
 
19
- Version : v2.1.7
19
+ Version : v2.1.8
20
20
  Url : https://github.com/bitranox/lib_shopware6_api_base
21
21
  Author : Robert Nowotny
22
22
  Email : bitranox@gmail.com""")
@@ -313,20 +313,20 @@ class Shopware6StoreFrontClientBase(object):
313
313
  """
314
314
  if isinstance(payload, Criteria):
315
315
  payload = payload.get_dict()
316
- formatted_request_url = self._format_storefront_api_url(request_url)
316
+ storefront_api_url = self._build_storefront_api_url(endpoint=request_url)
317
317
  response: requests.Response = requests.Response()
318
318
  headers = self._get_headers(update_header_fields=update_header_fields)
319
319
 
320
320
  if http_method == "get":
321
- response = requests.request("GET", formatted_request_url, params=payload, headers=headers)
321
+ response = requests.request("GET", storefront_api_url, params=payload, headers=headers)
322
322
  elif http_method == "patch":
323
- response = requests.request("PATCH", formatted_request_url, data=json.dumps(payload), headers=headers)
323
+ response = requests.request("PATCH", storefront_api_url, data=json.dumps(payload), headers=headers)
324
324
  elif http_method == "post":
325
- response = requests.request("POST", formatted_request_url, data=json.dumps(payload), headers=headers)
325
+ response = requests.request("POST", storefront_api_url, data=json.dumps(payload), headers=headers)
326
326
  elif http_method == "put":
327
- response = requests.request("PUT", formatted_request_url, data=json.dumps(payload), headers=headers)
327
+ response = requests.request("PUT", storefront_api_url, data=json.dumps(payload), headers=headers)
328
328
  elif http_method == "delete":
329
- response = requests.request("DELETE", formatted_request_url, headers=headers)
329
+ response = requests.request("DELETE", storefront_api_url, headers=headers)
330
330
 
331
331
  try:
332
332
  response.raise_for_status()
@@ -373,24 +373,25 @@ class Shopware6StoreFrontClientBase(object):
373
373
  headers.update(update_header_fields)
374
374
  return headers
375
375
 
376
- def _format_storefront_api_url(self, request_url: str) -> str:
376
+ def _build_storefront_api_url(self, endpoint: str) -> str:
377
377
  """
378
- formatted url to make a request
378
+ Constructs a fully qualified URL for accessing the Storefront API.
379
379
 
380
- :parameter
381
- request_url: the request url, for instance "oauth/token"
382
- self.shopware_storefront_api_url: the api url, for instance https://your.shop-domain.com/store-api
380
+ Parameters:
381
+ endpoint: A string representing the specific API endpoint to be accessed, e.g., "oauth/token".
382
+ self.config.shopware_storefront_api_url: The base URL of the Storefront API, e.g., https://your.shop-domain.com/store-api.
383
383
 
384
- :returns
385
- the formatted url, like https://your.shop-domain.com/store-api/product
384
+ Returns:
385
+ A string containing the fully qualified URL to the specified API endpoint, formatted as https://your.shop-domain.com/store-api/endpoint.
386
386
 
387
+ Example:
387
388
  >>> my_api_client = Shopware6StoreFrontClientBase()
388
- >>> my_api_client._format_storefront_api_url('test')
389
+ >>> my_api_client._build_storefront_api_url('test')
389
390
  'http.../store-api/test'
390
391
 
391
392
  """
392
- request_url = request_url.lstrip("/")
393
- return f"{self.config.shopware_storefront_api_url}/{request_url}"
393
+ endpoint = endpoint.lstrip("/")
394
+ return f"{self.config.shopware_storefront_api_url}/{endpoint}"
394
395
 
395
396
 
396
397
  # admin_api{{{
@@ -511,8 +512,6 @@ class Shopware6AdminAPIClientBase(object):
511
512
  >>> my_payload=Criteria()
512
513
  >>> my_response_dict = my_api_client.request_get_paginated(request_url='product', payload=my_payload, junk_size=10)
513
514
  >>> assert 5 < len(my_response_dict['data'])
514
-
515
-
516
515
  """
517
516
  # admin_api_get_paginated}}}
518
517
  response_dict = self._request_paginated(
@@ -632,6 +631,36 @@ class Shopware6AdminAPIClientBase(object):
632
631
  >>> my_response_dict = my_api_client.request_post_paginated(request_url=my_url, payload=my_payload, junk_size=3)
633
632
  >>> assert 4 == len(my_response_dict['data'])
634
633
 
634
+ >>> # search for orders
635
+ >>> # test https://github.com/bitranox/lib_shopware6_api_base/issues/11
636
+ >>> import pprint
637
+ >>> date_from = '2024-09-29T00:00:00.000Z'
638
+ >>> date_to = '2024-09-29T23:59:59.999Z'
639
+ >>> my_criteria = Criteria()
640
+ >>> my_criteria.filter.append(RangeFilter(field="orderDate", parameters = {'gte': date_from, 'lte': date_to}))
641
+ >>> my_criteria.filter.append(MultiFilter('or', [
642
+ ... EqualsFilter(field='documents.documentType.technicalName', value='invoice'),
643
+ ... EqualsFilter(field='documents.documentType.technicalName', value='storno')]))
644
+ >>> pprint_attrs(my_criteria)
645
+ {'limit': None,
646
+ 'page': None,
647
+ 'filter': [{'type': 'range',
648
+ 'field': 'orderDate',
649
+ 'parameters': {'gte': '2024-09-29T00:00:00.000Z',
650
+ 'lte': '2024-09-29T23:59:59.999Z'}},
651
+ {'type': 'multi',
652
+ 'operator': 'or',
653
+ 'queries': [{'type': 'equals',
654
+ 'field': 'documents.documentType.technicalName',
655
+ 'value': 'invoice'},
656
+ {'type': 'equals',
657
+ 'field': 'documents.documentType.technicalName',
658
+ 'value': 'storno'}]}],
659
+ 'term': None,
660
+ 'total_count_mode': None}
661
+ >>> my_response_dict = my_api_client.request_post_paginated(request_url='search/order', payload=my_criteria)
662
+ >>> pprint.pprint(my_response_dict)
663
+ {'data': []}
635
664
  """
636
665
  # admin_api_post_paginated}}}
637
666
  response_dict = self._request_paginated(
@@ -710,8 +739,8 @@ class Shopware6AdminAPIClientBase(object):
710
739
  self, http_method: str, request_url: str, payload: PayLoad = None, junk_size: int = 100, update_header_fields: Optional[Dict[str, str]] = None
711
740
  ) -> Dict[str, Any]:
712
741
  """
713
- request the data paginated - metadata 'total' and 'totalCountMode' will be updated
714
- the paginated request reads those records in junks of junk_size=100 for performance reasons.
742
+ request the data paginated for performance reasons - metadata 'total' and 'totalCountMode' will be updated
743
+ the paginated request reads all records in junks of junk_size=100 up to "limit"
715
744
 
716
745
  payload "limit" will be respected (meaning we deliver only 'limit' results back)
717
746
  "page" will be ignored
@@ -192,8 +192,8 @@ class Criteria:
192
192
  >>> my_criteria = Criteria()
193
193
  >>> my_criteria.ids=["012cd563cf8e4f0384eed93b5201cc98", "075fb241b769444bb72431f797fd5776", "090fcc2099794771935acf814e3fdb24"]
194
194
  >>> pprint_attrs(my_criteria)
195
- {'limit': 3,
196
- 'page': 1,
195
+ {'limit': None,
196
+ 'page': None,
197
197
  'ids': ['012cd563cf8e4f0384eed93b5201cc98',
198
198
  '075fb241b769444bb72431f797fd5776',
199
199
  '090fcc2099794771935acf814e3fdb24'],
@@ -291,21 +291,22 @@ class Criteria:
291
291
 
292
292
 
293
293
  @limit.validator # noqa
294
- def on_set_limit_check_if_ids_are_set(self, attribute: attrs.Attribute, value: int) -> None: # type: ignore # noqa
295
- if value is not None and len(self.ids):
294
+ def on_set_limit_check_if_ids_are_set(self, attribute: attrs.Attribute, limit: int) -> None: # type: ignore # noqa
295
+ """
296
+ check "self.ids" if "self.limit" is set
297
+ """
298
+ if limit is not None and len(self.ids):
296
299
  raise ValueError('You can use either "limit" or "ids", but not both, see : https://github.com/bitranox/lib_shopware6_api_base#ids')
297
300
 
298
301
 
299
302
  @ids.validator # noqa
300
- def set_limit_to_ids_length(self, attribute: attrs.Attribute, value: List[str]) -> None: # type: ignore # noqa
303
+ def on_set_ids_check_if_limit_is_set(self, attribute: attrs.Attribute, ids: List[str]) -> None: # type: ignore # noqa
301
304
  """
302
- set "self.limit" and "self.page" if ids are given.
305
+ check "self.limit" if "self.ids" is set
303
306
  """
304
- if len(value):
307
+ if len(ids):
305
308
  if self.limit:
306
309
  raise ValueError('You can use either "limit" or "ids", but not both, see : https://github.com/bitranox/lib_shopware6_api_base#ids')
307
- self.limit = len(value)
308
- self.page = 1
309
310
 
310
311
  def get_dict(self) -> Dict[str, Any]:
311
312
  """ returns the data of the attrs dataclass as a dictionary.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: lib-shopware6-api-base
3
- Version: 2.1.7
2
+ Name: lib_shopware6_api_base
3
+ Version: 2.1.8
4
4
  Summary: python3 base API client for shopware6
5
5
  Author-email: Robert Nowotny <bitranox@gmail.com>
6
6
  License: MIT
@@ -24,7 +24,7 @@ Requires-Dist: click
24
24
  Requires-Dist: lib_detect_testenv
25
25
  Requires-Dist: oauthlib
26
26
  Requires-Dist: requests
27
- Requires-Dist: requests_oauthlib
27
+ Requires-Dist: requests-oauthlib
28
28
  Provides-Extra: test
29
29
  Requires-Dist: black; extra == "test"
30
30
  Requires-Dist: codecov; extra == "test"
@@ -41,7 +41,7 @@ lib_shopware6_api_base
41
41
  ======================
42
42
 
43
43
 
44
- Version v2.1.7 as of 2023-10-18 see `Changelog`_
44
+ Version v2.1.8 as of 2024-09-29 see `Changelog`_
45
45
 
46
46
  |build_badge| |codeql| |license| |pypi|
47
47
  |pypi-downloads| |black| |codecov| |cc_maintain| |cc_issues| |cc_coverage| |snyk|
@@ -109,7 +109,7 @@ automated tests, Github Actions, Documentation, Badges, etc. are managed with `P
109
109
 
110
110
  Python version required: 3.8.0 or newer
111
111
 
112
- tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12-dev, pypy-3.9, pypy-3.10 - architectures: amd64
112
+ tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12, pypy-3.9, pypy-3.10 - architectures: amd64
113
113
 
114
114
  `100% code coverage <https://codeclimate.com/github/bitranox/lib_shopware6_api_base/test_coverage>`_, flake8 style checking ,mypy static type checking ,tested under `Linux <https://github.com/bitranox/lib_shopware6_api_base/actions/workflows/python-package.yml>`_, automatic daily builds and monitoring
115
115
 
@@ -610,8 +610,6 @@ Admin API
610
610
  >>> my_payload=Criteria()
611
611
  >>> my_response_dict = my_api_client.request_get_paginated(request_url='product', payload=my_payload, junk_size=10)
612
612
  >>> assert 5 < len(my_response_dict['data'])
613
-
614
-
615
613
  """
616
614
 
617
615
  - Admin API PATCH
@@ -715,6 +713,36 @@ Admin API
715
713
  >>> my_response_dict = my_api_client.request_post_paginated(request_url=my_url, payload=my_payload, junk_size=3)
716
714
  >>> assert 4 == len(my_response_dict['data'])
717
715
 
716
+ >>> # search for orders
717
+ >>> # test https://github.com/bitranox/lib_shopware6_api_base/issues/11
718
+ >>> import pprint
719
+ >>> date_from = '2024-09-29T00:00:00.000Z'
720
+ >>> date_to = '2024-09-29T23:59:59.999Z'
721
+ >>> my_criteria = Criteria()
722
+ >>> my_criteria.filter.append(RangeFilter(field="orderDate", parameters = {'gte': date_from, 'lte': date_to}))
723
+ >>> my_criteria.filter.append(MultiFilter('or', [
724
+ ... EqualsFilter(field='documents.documentType.technicalName', value='invoice'),
725
+ ... EqualsFilter(field='documents.documentType.technicalName', value='storno')]))
726
+ >>> pprint_attrs(my_criteria)
727
+ {'limit': None,
728
+ 'page': None,
729
+ 'filter': [{'type': 'range',
730
+ 'field': 'orderDate',
731
+ 'parameters': {'gte': '2024-09-29T00:00:00.000Z',
732
+ 'lte': '2024-09-29T23:59:59.999Z'}},
733
+ {'type': 'multi',
734
+ 'operator': 'or',
735
+ 'queries': [{'type': 'equals',
736
+ 'field': 'documents.documentType.technicalName',
737
+ 'value': 'invoice'},
738
+ {'type': 'equals',
739
+ 'field': 'documents.documentType.technicalName',
740
+ 'value': 'storno'}]}],
741
+ 'term': None,
742
+ 'total_count_mode': None}
743
+ >>> my_response_dict = my_api_client.request_post_paginated(request_url='search/order', payload=my_criteria)
744
+ >>> pprint.pprint(my_response_dict)
745
+ {'data': []}
718
746
  """
719
747
 
720
748
  - Admin API PUT
@@ -910,8 +938,8 @@ a search criteria follows the following schema:
910
938
  >>> my_criteria = Criteria()
911
939
  >>> my_criteria.ids=["012cd563cf8e4f0384eed93b5201cc98", "075fb241b769444bb72431f797fd5776", "090fcc2099794771935acf814e3fdb24"]
912
940
  >>> pprint_attrs(my_criteria)
913
- {'limit': 3,
914
- 'page': 1,
941
+ {'limit': None,
942
+ 'page': None,
915
943
  'ids': ['012cd563cf8e4f0384eed93b5201cc98',
916
944
  '075fb241b769444bb72431f797fd5776',
917
945
  '090fcc2099794771935acf814e3fdb24'],
@@ -1642,8 +1670,8 @@ Please note that as soon as You use ids, limit and page does not apply anymore !
1642
1670
  >>> my_criteria = Criteria()
1643
1671
  >>> my_criteria.ids=["012cd563cf8e4f0384eed93b5201cc98", "075fb241b769444bb72431f797fd5776", "090fcc2099794771935acf814e3fdb24"]
1644
1672
  >>> pprint_attrs(my_criteria)
1645
- {'limit': 3,
1646
- 'page': 1,
1673
+ {'limit': None,
1674
+ 'page': None,
1647
1675
  'ids': ['012cd563cf8e4f0384eed93b5201cc98',
1648
1676
  '075fb241b769444bb72431f797fd5776',
1649
1677
  '090fcc2099794771935acf814e3fdb24'],
@@ -1871,13 +1899,12 @@ Usage from Commandline
1871
1899
  Installation and Upgrade
1872
1900
  ------------------------
1873
1901
 
1874
- - Before You start, its highly recommended to update pip and setup tools:
1902
+ - Before You start, its highly recommended to update pip:
1875
1903
 
1876
1904
 
1877
1905
  .. code-block::
1878
1906
 
1879
1907
  python -m pip --upgrade pip
1880
- python -m pip --upgrade setuptools
1881
1908
 
1882
1909
  - to install the latest release from PyPi via pip (recommended):
1883
1910
 
@@ -1959,7 +1986,7 @@ following modules will be automatically installed :
1959
1986
  lib_detect_testenv
1960
1987
  oauthlib
1961
1988
  requests
1962
- requests_oauthlib
1989
+ requests-oauthlib
1963
1990
 
1964
1991
  Acknowledgements
1965
1992
  ----------------
@@ -1986,6 +2013,11 @@ Changelog
1986
2013
  - new MINOR version for added functionality in a backwards compatible manner
1987
2014
  - new PATCH version for backwards compatible bug fixes
1988
2015
 
2016
+ v2.1.8
2017
+ ---------
2018
+ 2024-09-29:
2019
+ - add example for /search/order via post request
2020
+
1989
2021
  v2.1.7
1990
2022
  ---------
1991
2023
  2023-10-18:
@@ -4,7 +4,7 @@ click
4
4
  lib_detect_testenv
5
5
  oauthlib
6
6
  requests
7
- requests_oauthlib
7
+ requests-oauthlib
8
8
 
9
9
  [test]
10
10
  black
@@ -32,9 +32,9 @@ dependencies = [
32
32
  "lib_detect_testenv",
33
33
  "oauthlib",
34
34
  "requests",
35
- "requests_oauthlib",
35
+ "requests-oauthlib",
36
36
  ]
37
- version = "v2.1.7"
37
+ version = "v2.1.8"
38
38
  # seems to be not allowed anymore
39
39
  # zip-save = false
40
40
 
@@ -71,7 +71,7 @@ lib_shopware6_api_base = [
71
71
  [tool.black]
72
72
  line-length = 160
73
73
  #You should include all Python versions that you want your code to run under
74
- target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
74
+ target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
75
75
  # Note that you have to use single-quoted strings in TOML for regular expressions
76
76
  include = '\.pyi?$'
77
77
  exclude = '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)/'
@@ -5,4 +5,4 @@ cli_exit_tools
5
5
  lib_detect_testenv
6
6
  oauthlib
7
7
  requests
8
- requests_oauthlib
8
+ requests-oauthlib
@@ -147,7 +147,7 @@ function run_flake8_tests() {
147
147
 
148
148
  function run_mypy_tests() {
149
149
  my_banner "mypy tests"
150
- if ! /opt/python3/bin/python3 -m mypy "${project_root_dir}" --follow-imports=normal --ignore-missing-imports --implicit-reexport --install-types --no-warn-unused-ignores --non-interactive --strict; then
150
+ if ! /opt/python3/bin/python3 -m mypy "${project_root_dir}" --follow-imports=normal --ignore-missing-imports --install-types --no-warn-unused-ignores --non-interactive --strict; then
151
151
  my_banner_warning "mypy tests ERROR"
152
152
  beep
153
153
  sleep "${sleeptime_on_error}"