espercli 0.0.14__tar.gz → 0.0.16__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 (72) hide show
  1. {espercli-0.0.14 → espercli-0.0.16}/CHANGELOG.md +9 -0
  2. {espercli-0.0.14/espercli.egg-info → espercli-0.0.16}/PKG-INFO +44 -7
  3. espercli-0.0.14/PKG-INFO → espercli-0.0.16/README.md +43 -18
  4. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/application/application.py +10 -2
  5. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/application/version.py +87 -23
  6. {espercli-0.0.14 → espercli-0.0.16}/esper/core/version.py +1 -1
  7. espercli-0.0.14/README.md → espercli-0.0.16/espercli.egg-info/PKG-INFO +55 -3
  8. {espercli-0.0.14 → espercli-0.0.16}/espercli.egg-info/SOURCES.txt +1 -3
  9. espercli-0.0.16/espercli.egg-info/entry_points.txt +2 -0
  10. {espercli-0.0.14 → espercli-0.0.16}/espercli.egg-info/requires.txt +2 -2
  11. {espercli-0.0.14 → espercli-0.0.16}/requirements.txt +4 -4
  12. {espercli-0.0.14 → espercli-0.0.16}/setup.py +3 -3
  13. espercli-0.0.14/espercli.egg-info/entry_points.txt +0 -4
  14. espercli-0.0.14/tests/test_configure.py +0 -89
  15. espercli-0.0.14/tests/test_main.py +0 -16
  16. {espercli-0.0.14 → espercli-0.0.16}/LICENSE +0 -0
  17. {espercli-0.0.14 → espercli-0.0.16}/LICENSE.md +0 -0
  18. {espercli-0.0.14 → espercli-0.0.16}/MANIFEST.in +0 -0
  19. {espercli-0.0.14 → espercli-0.0.16}/esper/__init__.py +0 -0
  20. {espercli-0.0.14 → espercli-0.0.16}/esper/bootstrap.py +0 -0
  21. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/__init__.py +0 -0
  22. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/application/__init__.py +0 -0
  23. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/base.py +0 -0
  24. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/commandsV2/__init__.py +0 -0
  25. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/commandsV2/commandsV2.py +0 -0
  26. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/configure.py +0 -0
  27. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/content/__init__.py +0 -0
  28. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/content/content.py +0 -0
  29. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/device/__init__.py +0 -0
  30. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/device/command.py +0 -0
  31. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/device/device.py +0 -0
  32. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/device/group_command.py +0 -0
  33. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/device/install.py +0 -0
  34. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/device/status.py +0 -0
  35. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/enterprise/__init__.py +0 -0
  36. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/enterprise/enterprise.py +0 -0
  37. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/enterprise/group.py +0 -0
  38. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/enums.py +0 -0
  39. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/pipeline/__init__.py +0 -0
  40. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/pipeline/execute.py +0 -0
  41. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/pipeline/operation.py +0 -0
  42. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/pipeline/pipeline.py +0 -0
  43. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/pipeline/stage.py +0 -0
  44. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/secureadb/__init__.py +0 -0
  45. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/secureadb/secureadb.py +0 -0
  46. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/telemetry/__init__.py +0 -0
  47. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/telemetry/telemetry.py +0 -0
  48. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/token/__init__.py +0 -0
  49. {espercli-0.0.14 → espercli-0.0.16}/esper/controllers/token/token.py +0 -0
  50. {espercli-0.0.14 → espercli-0.0.16}/esper/core/__init__.py +0 -0
  51. {espercli-0.0.14 → espercli-0.0.16}/esper/core/exc.py +0 -0
  52. {espercli-0.0.14 → espercli-0.0.16}/esper/core/output_handler.py +0 -0
  53. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/__init__.py +0 -0
  54. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/api_client.py +0 -0
  55. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/certs.py +0 -0
  56. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/db_wrapper.py +0 -0
  57. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/forwarder.py +0 -0
  58. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/mediator.py +0 -0
  59. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/pipeline_api.py +0 -0
  60. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/relay.py +0 -0
  61. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/remoteadb_api.py +0 -0
  62. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/telemetry_api.py +0 -0
  63. {espercli-0.0.14 → espercli-0.0.16}/esper/ext/utils.py +0 -0
  64. {espercli-0.0.14 → espercli-0.0.16}/esper/main.py +0 -0
  65. {espercli-0.0.14 → espercli-0.0.16}/esper/plugins/__init__.py +0 -0
  66. {espercli-0.0.14 → espercli-0.0.16}/esper/templates/__init__.py +0 -0
  67. {espercli-0.0.14 → espercli-0.0.16}/esper/templates/command1.jinja2 +0 -0
  68. {espercli-0.0.14 → espercli-0.0.16}/esper/templates/creds.jinja2 +0 -0
  69. {espercli-0.0.14 → espercli-0.0.16}/espercli.egg-info/dependency_links.txt +0 -0
  70. {espercli-0.0.14 → espercli-0.0.16}/espercli.egg-info/top_level.txt +0 -0
  71. {espercli-0.0.14 → espercli-0.0.16}/requirements-dev.txt +0 -0
  72. {espercli-0.0.14 → espercli-0.0.16}/setup.cfg +0 -0
@@ -21,3 +21,12 @@ Updated dependencies
21
21
  ## 0.0.14
22
22
 
23
23
  - Add support for new device states
24
+
25
+ ## 0.0.15
26
+
27
+ - Added App version format changes (includes version_name and version_code)
28
+ - Added `legacy_format {true/false}` cmd arg for app version format chnages
29
+
30
+ ## 0.0.16
31
+
32
+ - Updated requirements.txt (esperclient==0.1.3)
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: espercli
3
- Version: 0.0.14
3
+ Version: 0.0.16
4
4
  Summary: Esper CLI is Command line tool for the Esper APIs
5
5
  Home-page: https://github.com/esper-io/esper-cli/
6
6
  Author: Esper
7
7
  Author-email: developer@esper.io
8
8
  License: Apache 2.0
9
- Platform: UNKNOWN
10
9
  Description-Content-Type: text/markdown
11
10
  License-File: LICENSE
12
11
  License-File: LICENSE.md
@@ -19,8 +18,8 @@ This package provides a unified command line interface to the Esper API Services
19
18
  Current stable release versions are
20
19
 
21
20
  API version: 1.0.0
22
- SDK version: 0.1.2
23
- CLI version: 0.0.14
21
+ SDK version: 0.1.3
22
+ CLI version: 0.0.16
24
23
 
25
24
  ## Requirements
26
25
 
@@ -782,7 +781,7 @@ category
782
781
  content_rating 0.0
783
782
  compatibility
784
783
  ```
785
- Below example listing versions of current active app,
784
+ Below example listing versions of current active app (default legacy format),
786
785
  ```sh
787
786
  $ espercli version list
788
787
  Total Number of Versions: 1
@@ -791,6 +790,15 @@ ID VERSION CODE BUILD NUMBER SIZE IN
791
790
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
792
791
  ```
793
792
 
793
+ To use the new standardized format with `VERSION NAME` instead of `BUILD NUMBER`:
794
+ ```sh
795
+ $ espercli version list --legacy-format false
796
+ Total Number of Versions: 1
797
+
798
+ ID VERSION NAME VERSION CODE SIZE IN MB RELEASE TRACK INSTALLED COUNT
799
+ 54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 30204 9.36421 1
800
+ ```
801
+
794
802
  #### 7. unset-active
795
803
  The unset-active sub command used to unset the current active application.
796
804
  ```sh
@@ -822,9 +830,11 @@ $ espercli version list [OPTIONS]
822
830
  | --app, -a | | Application id (UUID) |
823
831
  | --code, -c | | Filter by version code |
824
832
  | --number, -n | | Filter by build number |
833
+ | --legacy-format, -lf |true | Use legacy format, choices are [true, false] |
825
834
  | --json, -j | | Render result in JSON format |
826
835
 
827
836
  ##### Example
837
+ **Default behavior (legacy format):**
828
838
  ```sh
829
839
  $ espercli version list -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72
830
840
  Total Number of Versions: 1
@@ -832,6 +842,16 @@ Total Number of Versions: 1
832
842
  ID VERSION CODE BUILD NUMBER SIZE IN MB RELEASE TRACK INSTALLED COUNT
833
843
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
834
844
  ```
845
+
846
+ **New standardized format (with --legacy-format false):**
847
+ ```sh
848
+ $ espercli version list -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 --legacy-format false
849
+ Total Number of Versions: 1
850
+
851
+ ID VERSION NAME VERSION CODE SIZE IN MB RELEASE TRACK INSTALLED COUNT
852
+ 54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 30204 9.36421 1
853
+ ```
854
+
835
855
  For list of versions if active application is set,
836
856
  ```sh
837
857
  $ espercli version list
@@ -841,6 +861,8 @@ ID VERSION CODE BUILD NUMBER SIZE IN
841
861
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
842
862
  ```
843
863
 
864
+ > **Note:** By default, the CLI uses legacy format (`--legacy-format true`) which displays `BUILD NUMBER` column. Use `--legacy-format false` to get the new standardized format with `VERSION NAME` column. The new format uses `version_name` (human-readable) and `version_code` (internal identifier) instead of the legacy `build_number` and `version_code` system.
865
+
844
866
  #### 2. show
845
867
  Show application version information, here version id (UUID) is required to show version information.
846
868
  ```sh
@@ -851,9 +873,11 @@ $ espercli version show [OPTIONS] [version-id]
851
873
  | Name, shorthand | Default| Description|
852
874
  | ------------- |:------:|:----------|
853
875
  | --app, -a | | Application id (UUID) |
876
+ | --legacy-format, -lf |true | Use legacy format, choices are [true, false] |
854
877
  | --json, -j | | Render result in JSON format |
855
878
 
856
879
  ##### Example
880
+ **Default behavior (legacy format):**
857
881
  ```sh
858
882
  $ espercli version show -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 54436edb-9b43-4e2c-8107-2c6fa90e2a9e
859
883
 
@@ -866,6 +890,21 @@ release_track
866
890
  installed_count 1
867
891
  ```
868
892
 
893
+ **New standardized format (with --legacy-format false):**
894
+ ```sh
895
+ $ espercli version show -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 54436edb-9b43-4e2c-8107-2c6fa90e2a9e --legacy-format false
896
+
897
+ TITLE DETAILS
898
+ id 54436edb-9b43-4e2c-8107-2c6fa90e2a9e
899
+ version_name 6.4.5
900
+ version_code 30204
901
+ size_in_mb 9.36421394348145
902
+ release_track
903
+ installed_count 1
904
+ ```
905
+
906
+ > **Note:** By default, the CLI uses legacy format (`--legacy-format true`) which displays `build_number`. Use `--legacy-format false` to get the new standardized format with `version_name` (human-readable version string) and `version_code` (internal unique identifier).
907
+
869
908
  #### 3. delete
870
909
  Delete sub command used to delete particular application version. Here, version id (UUID) is required to delete version. Application will be also deleted if application contains one version and unset active application if it is set as active
871
910
  ```sh
@@ -2423,5 +2462,3 @@ Created On 2020-10-21 14:07:27.601095+00:00
2423
2462
  We are always in active development and we try our best to keep our documentation up to date. However, if you end up ahead of time you can check our latest documentation on [Github](https://github.com/esper-io/esper-cli).
2424
2463
 
2425
2464
  If you face any issue with CLI usage, we recommend you to reach out to [Esper Dev Support](https://docs.esper.io/home/support.html)
2426
-
2427
-
@@ -1,16 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: espercli
3
- Version: 0.0.14
4
- Summary: Esper CLI is Command line tool for the Esper APIs
5
- Home-page: https://github.com/esper-io/esper-cli/
6
- Author: Esper
7
- Author-email: developer@esper.io
8
- License: Apache 2.0
9
- Platform: UNKNOWN
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE
12
- License-File: LICENSE.md
13
-
14
1
  # Esper CLI
15
2
  [![Build Status](https://travis-ci.com/esper-io/esper-cli.svg?branch=master)](https://travis-ci.com/esper-io/esper-cli) [![Gitter](https://badges.gitter.im/esper-dev/esper-cli.svg)](https://gitter.im/esper-dev/esper-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
16
3
 
@@ -19,8 +6,8 @@ This package provides a unified command line interface to the Esper API Services
19
6
  Current stable release versions are
20
7
 
21
8
  API version: 1.0.0
22
- SDK version: 0.1.2
23
- CLI version: 0.0.14
9
+ SDK version: 0.1.3
10
+ CLI version: 0.0.16
24
11
 
25
12
  ## Requirements
26
13
 
@@ -782,7 +769,7 @@ category
782
769
  content_rating 0.0
783
770
  compatibility
784
771
  ```
785
- Below example listing versions of current active app,
772
+ Below example listing versions of current active app (default legacy format),
786
773
  ```sh
787
774
  $ espercli version list
788
775
  Total Number of Versions: 1
@@ -791,6 +778,15 @@ ID VERSION CODE BUILD NUMBER SIZE IN
791
778
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
792
779
  ```
793
780
 
781
+ To use the new standardized format with `VERSION NAME` instead of `BUILD NUMBER`:
782
+ ```sh
783
+ $ espercli version list --legacy-format false
784
+ Total Number of Versions: 1
785
+
786
+ ID VERSION NAME VERSION CODE SIZE IN MB RELEASE TRACK INSTALLED COUNT
787
+ 54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 30204 9.36421 1
788
+ ```
789
+
794
790
  #### 7. unset-active
795
791
  The unset-active sub command used to unset the current active application.
796
792
  ```sh
@@ -822,9 +818,11 @@ $ espercli version list [OPTIONS]
822
818
  | --app, -a | | Application id (UUID) |
823
819
  | --code, -c | | Filter by version code |
824
820
  | --number, -n | | Filter by build number |
821
+ | --legacy-format, -lf |true | Use legacy format, choices are [true, false] |
825
822
  | --json, -j | | Render result in JSON format |
826
823
 
827
824
  ##### Example
825
+ **Default behavior (legacy format):**
828
826
  ```sh
829
827
  $ espercli version list -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72
830
828
  Total Number of Versions: 1
@@ -832,6 +830,16 @@ Total Number of Versions: 1
832
830
  ID VERSION CODE BUILD NUMBER SIZE IN MB RELEASE TRACK INSTALLED COUNT
833
831
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
834
832
  ```
833
+
834
+ **New standardized format (with --legacy-format false):**
835
+ ```sh
836
+ $ espercli version list -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 --legacy-format false
837
+ Total Number of Versions: 1
838
+
839
+ ID VERSION NAME VERSION CODE SIZE IN MB RELEASE TRACK INSTALLED COUNT
840
+ 54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 30204 9.36421 1
841
+ ```
842
+
835
843
  For list of versions if active application is set,
836
844
  ```sh
837
845
  $ espercli version list
@@ -841,6 +849,8 @@ ID VERSION CODE BUILD NUMBER SIZE IN
841
849
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
842
850
  ```
843
851
 
852
+ > **Note:** By default, the CLI uses legacy format (`--legacy-format true`) which displays `BUILD NUMBER` column. Use `--legacy-format false` to get the new standardized format with `VERSION NAME` column. The new format uses `version_name` (human-readable) and `version_code` (internal identifier) instead of the legacy `build_number` and `version_code` system.
853
+
844
854
  #### 2. show
845
855
  Show application version information, here version id (UUID) is required to show version information.
846
856
  ```sh
@@ -851,9 +861,11 @@ $ espercli version show [OPTIONS] [version-id]
851
861
  | Name, shorthand | Default| Description|
852
862
  | ------------- |:------:|:----------|
853
863
  | --app, -a | | Application id (UUID) |
864
+ | --legacy-format, -lf |true | Use legacy format, choices are [true, false] |
854
865
  | --json, -j | | Render result in JSON format |
855
866
 
856
867
  ##### Example
868
+ **Default behavior (legacy format):**
857
869
  ```sh
858
870
  $ espercli version show -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 54436edb-9b43-4e2c-8107-2c6fa90e2a9e
859
871
 
@@ -866,6 +878,21 @@ release_track
866
878
  installed_count 1
867
879
  ```
868
880
 
881
+ **New standardized format (with --legacy-format false):**
882
+ ```sh
883
+ $ espercli version show -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 54436edb-9b43-4e2c-8107-2c6fa90e2a9e --legacy-format false
884
+
885
+ TITLE DETAILS
886
+ id 54436edb-9b43-4e2c-8107-2c6fa90e2a9e
887
+ version_name 6.4.5
888
+ version_code 30204
889
+ size_in_mb 9.36421394348145
890
+ release_track
891
+ installed_count 1
892
+ ```
893
+
894
+ > **Note:** By default, the CLI uses legacy format (`--legacy-format true`) which displays `build_number`. Use `--legacy-format false` to get the new standardized format with `version_name` (human-readable version string) and `version_code` (internal unique identifier).
895
+
869
896
  #### 3. delete
870
897
  Delete sub command used to delete particular application version. Here, version id (UUID) is required to delete version. Application will be also deleted if application contains one version and unset active application if it is set as active
871
898
  ```sh
@@ -2423,5 +2450,3 @@ Created On 2020-10-21 14:07:27.601095+00:00
2423
2450
  We are always in active development and we try our best to keep our documentation up to date. However, if you end up ahead of time you can check our latest documentation on [Github](https://github.com/esper-io/esper-cli).
2424
2451
 
2425
2452
  If you face any issue with CLI usage, we recommend you to reach out to [Esper Dev Support](https://docs.esper.io/home/support.html)
2426
-
2427
-
@@ -219,7 +219,11 @@ class Application(Controller):
219
219
  version = application.versions[0]
220
220
  renderable.append({title: 'version_id', details: version.id})
221
221
  renderable.append({title: 'version_code', details: version.version_code})
222
- renderable.append({title: 'build_number', details: version.build_number})
222
+ # Show version_name if available (new format), otherwise fallback to build_number (legacy format)
223
+ if hasattr(version, 'version_name') and version.version_name:
224
+ renderable.append({title: 'version_name', details: version.version_name})
225
+ elif hasattr(version, 'build_number') and version.build_number:
226
+ renderable.append({title: 'build_number', details: version.build_number})
223
227
 
224
228
  self.app.render(renderable, format=OutputFormat.TABULATED.value, headers="keys", tablefmt="plain")
225
229
  else:
@@ -228,7 +232,11 @@ class Application(Controller):
228
232
  version = application.versions[0]
229
233
  renderable['version_id'] = version.id
230
234
  renderable['version_code'] = version.version_code
231
- renderable['build_number'] = version.build_number
235
+ # Show version_name if available (new format), otherwise fallback to build_number (legacy format)
236
+ if hasattr(version, 'version_name') and version.version_name:
237
+ renderable['version_name'] = version.version_name
238
+ elif hasattr(version, 'build_number') and version.build_number:
239
+ renderable['build_number'] = version.build_number
232
240
 
233
241
  self.app.render(renderable, format=OutputFormat.JSON.value)
234
242
 
@@ -37,6 +37,12 @@ class ApplicationVersion(Controller):
37
37
  {'help': 'Build number',
38
38
  'action': 'store',
39
39
  'dest': 'build_number'}),
40
+ (['-lf', '--legacy-format'],
41
+ {'help': 'Use legacy format, choices are [true, false]',
42
+ 'action': 'store',
43
+ 'choices': ['true', 'false'],
44
+ 'default': 'true',
45
+ 'dest': 'legacy_format'}),
40
46
  (['-l', '--limit'],
41
47
  {'help': 'Number of results to return per page',
42
48
  'action': 'store',
@@ -75,6 +81,10 @@ class ApplicationVersion(Controller):
75
81
  build_number = self.app.pargs.build_number
76
82
  limit = self.app.pargs.limit
77
83
  offset = self.app.pargs.offset
84
+
85
+ # Get legacy_format flag and convert to boolean
86
+ legacy_format_str = getattr(self.app.pargs, 'legacy_format', 'true')
87
+ legacy_format = (legacy_format_str == 'true')
78
88
 
79
89
  kwargs = {}
80
90
  if version_code:
@@ -86,7 +96,7 @@ class ApplicationVersion(Controller):
86
96
  try:
87
97
  # Find application versions in an enterprise
88
98
  response = application_client.get_app_versions(application_id, enterprise_id, limit=limit, offset=offset,
89
- **kwargs)
99
+ legacy_format=legacy_format, **kwargs)
90
100
  except ApiException as e:
91
101
  self.app.log.error(f"[version-list] Failed to list applications: {e}")
92
102
  self.app.render(f"ERROR: {parse_error_message(self.app, e)}\n")
@@ -96,44 +106,80 @@ class ApplicationVersion(Controller):
96
106
  if not self.app.pargs.json:
97
107
  versions = []
98
108
 
99
- label = {
100
- 'id': "ID",
101
- 'version_code': "VERSION CODE",
102
- 'build_number': "BUILD NUMBER",
103
- 'size_in_mb': "SIZE IN MB",
104
- 'release_track': "RELEASE TRACK",
105
- 'installed_count': "INSTALLED COUNT",
106
- }
109
+ # Determine which columns to show based on legacy_format
110
+ if legacy_format:
111
+ # Legacy format: show BUILD NUMBER
112
+ label = {
113
+ 'id': "ID",
114
+ 'version_code': "VERSION CODE",
115
+ 'build_number': "BUILD NUMBER",
116
+ 'size_in_mb': "SIZE IN MB",
117
+ 'release_track': "RELEASE TRACK",
118
+ 'installed_count': "INSTALLED COUNT",
119
+ }
120
+ else:
121
+ # New format: show VERSION NAME
122
+ label = {
123
+ 'id': "ID",
124
+ 'version_name': "VERSION NAME",
125
+ 'version_code': "VERSION CODE",
126
+ 'size_in_mb': "SIZE IN MB",
127
+ 'release_track': "RELEASE TRACK",
128
+ 'installed_count': "INSTALLED COUNT",
129
+ }
107
130
 
108
131
  for version in response.results:
109
- versions.append(
110
- {
132
+ if legacy_format:
133
+ # Legacy format: use build_number
134
+ version_dict = {
111
135
  label['id']: version.id,
112
136
  label['version_code']: version.version_code,
113
- label['build_number']: version.build_number,
137
+ label['build_number']: version.build_number if hasattr(version, 'build_number') and version.build_number else '',
114
138
  label['size_in_mb']: version.size_in_mb,
115
139
  label['release_track']: version.release_track,
116
140
  label['installed_count']: version.installed_count if version.installed_count else 0
117
141
  }
118
- )
142
+ else:
143
+ # New format: use version_name
144
+ version_dict = {
145
+ label['id']: version.id,
146
+ label['version_name']: version.version_name if hasattr(version, 'version_name') and version.version_name else '',
147
+ label['version_code']: version.version_code,
148
+ label['size_in_mb']: version.size_in_mb,
149
+ label['release_track']: version.release_track,
150
+ label['installed_count']: version.installed_count if version.installed_count else 0
151
+ }
152
+ versions.append(version_dict)
119
153
  self.app.render(versions, format=OutputFormat.TABULATED.value, headers="keys", tablefmt="plain")
120
154
  else:
121
155
  versions = []
122
156
  for version in response.results:
123
- versions.append(
124
- {
157
+ if legacy_format:
158
+ # Legacy format: include build_number
159
+ version_dict = {
125
160
  'id': version.id,
126
161
  'version_code': version.version_code,
127
- 'build_number': version.build_number,
162
+ 'build_number': version.build_number if hasattr(version, 'build_number') and version.build_number else None,
128
163
  'size_in_mb': version.size_in_mb,
129
164
  'release_track': version.release_track,
130
165
  'installed_count': version.installed_count if version.installed_count else 0
131
166
  }
132
- )
167
+ else:
168
+ # New format: include version_name
169
+ version_dict = {
170
+ 'id': version.id,
171
+ 'version_name': version.version_name if hasattr(version, 'version_name') and version.version_name else None,
172
+ 'version_code': version.version_code,
173
+ 'size_in_mb': version.size_in_mb,
174
+ 'release_track': version.release_track,
175
+ 'installed_count': version.installed_count if version.installed_count else 0
176
+ }
177
+ versions.append(version_dict)
133
178
  self.app.render(versions, format=OutputFormat.JSON.value)
134
179
 
135
- def _version_basic_response(self, version, format=OutputFormat.TABULATED):
136
- valid_keys = ['id', 'version_code', 'build_number', 'size_in_mb', 'release_track']
180
+ def _version_basic_response(self, version, format=OutputFormat.TABULATED, legacy_format=True):
181
+ # Include both version_name and build_number in valid_keys for flexibility
182
+ valid_keys = ['id', 'version_code', 'version_name', 'build_number', 'size_in_mb', 'release_track']
137
183
 
138
184
  if format == OutputFormat.JSON:
139
185
  renderable = {k: v for k, v in version.to_dict().items() if k in valid_keys}
@@ -142,7 +188,15 @@ class ApplicationVersion(Controller):
142
188
  else:
143
189
  title = "TITLE"
144
190
  details = "DETAILS"
145
- renderable = [{title: k, details: v} for k, v in version.to_dict().items() if k in valid_keys]
191
+ # Filter based on legacy_format
192
+ if legacy_format:
193
+ # Legacy format: prioritize build_number
194
+ filtered_dict = {k: v for k, v in version.to_dict().items() if k in valid_keys and k != 'version_name'}
195
+ else:
196
+ # New format: prioritize version_name
197
+ filtered_dict = {k: v for k, v in version.to_dict().items() if k in valid_keys and k != 'build_number'}
198
+
199
+ renderable = [{title: k, details: v} for k, v in filtered_dict.items()]
146
200
 
147
201
  if version:
148
202
  renderable.append(
@@ -163,6 +217,12 @@ class ApplicationVersion(Controller):
163
217
  {'help': 'Application id',
164
218
  'action': 'store',
165
219
  'dest': 'application'}),
220
+ (['-lf', '--legacy-format'],
221
+ {'help': 'Use legacy format, choices are [true, false]',
222
+ 'action': 'store',
223
+ 'choices': ['true', 'false'],
224
+ 'default': 'true',
225
+ 'dest': 'legacy_format'}),
166
226
  (['-j', '--json'],
167
227
  {'help': 'Render result in Json format',
168
228
  'action': 'store_true',
@@ -188,18 +248,22 @@ class ApplicationVersion(Controller):
188
248
 
189
249
  application_id = application.get('id')
190
250
 
251
+ # Get legacy_format flag and convert to boolean
252
+ legacy_format_str = getattr(self.app.pargs, 'legacy_format', 'true')
253
+ legacy_format = (legacy_format_str == 'true')
254
+
191
255
  try:
192
- response = application_client.get_app_version(version_id, application_id, enterprise_id)
256
+ response = application_client.get_app_version(version_id, application_id, enterprise_id, legacy_format=legacy_format)
193
257
  except ApiException as e:
194
258
  self.app.log.error(f"[version-show] Failed to show details of an version: {e}")
195
259
  self.app.render(f"ERROR: {parse_error_message(self.app, e)}\n")
196
260
  return
197
261
 
198
262
  if not self.app.pargs.json:
199
- renderable = self._version_basic_response(response)
263
+ renderable = self._version_basic_response(response, format=OutputFormat.TABULATED, legacy_format=legacy_format)
200
264
  self.app.render(renderable, format=OutputFormat.TABULATED.value, headers="keys", tablefmt="plain")
201
265
  else:
202
- renderable = self._version_basic_response(response, OutputFormat.JSON)
266
+ renderable = self._version_basic_response(response, format=OutputFormat.JSON, legacy_format=legacy_format)
203
267
  self.app.render(renderable, format=OutputFormat.JSON.value)
204
268
 
205
269
  @ex(
@@ -1,6 +1,6 @@
1
1
  from cement.utils.version import get_version as cement_get_version
2
2
 
3
- VERSION = (0, 0, 14, 'final', 0)
3
+ VERSION = (0, 0, 16, 'final', 0)
4
4
 
5
5
 
6
6
  def get_version(version=VERSION):
@@ -1,3 +1,15 @@
1
+ Metadata-Version: 2.1
2
+ Name: espercli
3
+ Version: 0.0.16
4
+ Summary: Esper CLI is Command line tool for the Esper APIs
5
+ Home-page: https://github.com/esper-io/esper-cli/
6
+ Author: Esper
7
+ Author-email: developer@esper.io
8
+ License: Apache 2.0
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ License-File: LICENSE.md
12
+
1
13
  # Esper CLI
2
14
  [![Build Status](https://travis-ci.com/esper-io/esper-cli.svg?branch=master)](https://travis-ci.com/esper-io/esper-cli) [![Gitter](https://badges.gitter.im/esper-dev/esper-cli.svg)](https://gitter.im/esper-dev/esper-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3
15
 
@@ -6,8 +18,8 @@ This package provides a unified command line interface to the Esper API Services
6
18
  Current stable release versions are
7
19
 
8
20
  API version: 1.0.0
9
- SDK version: 0.1.2
10
- CLI version: 0.0.14
21
+ SDK version: 0.1.3
22
+ CLI version: 0.0.16
11
23
 
12
24
  ## Requirements
13
25
 
@@ -769,7 +781,7 @@ category
769
781
  content_rating 0.0
770
782
  compatibility
771
783
  ```
772
- Below example listing versions of current active app,
784
+ Below example listing versions of current active app (default legacy format),
773
785
  ```sh
774
786
  $ espercli version list
775
787
  Total Number of Versions: 1
@@ -778,6 +790,15 @@ ID VERSION CODE BUILD NUMBER SIZE IN
778
790
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
779
791
  ```
780
792
 
793
+ To use the new standardized format with `VERSION NAME` instead of `BUILD NUMBER`:
794
+ ```sh
795
+ $ espercli version list --legacy-format false
796
+ Total Number of Versions: 1
797
+
798
+ ID VERSION NAME VERSION CODE SIZE IN MB RELEASE TRACK INSTALLED COUNT
799
+ 54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 30204 9.36421 1
800
+ ```
801
+
781
802
  #### 7. unset-active
782
803
  The unset-active sub command used to unset the current active application.
783
804
  ```sh
@@ -809,9 +830,11 @@ $ espercli version list [OPTIONS]
809
830
  | --app, -a | | Application id (UUID) |
810
831
  | --code, -c | | Filter by version code |
811
832
  | --number, -n | | Filter by build number |
833
+ | --legacy-format, -lf |true | Use legacy format, choices are [true, false] |
812
834
  | --json, -j | | Render result in JSON format |
813
835
 
814
836
  ##### Example
837
+ **Default behavior (legacy format):**
815
838
  ```sh
816
839
  $ espercli version list -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72
817
840
  Total Number of Versions: 1
@@ -819,6 +842,16 @@ Total Number of Versions: 1
819
842
  ID VERSION CODE BUILD NUMBER SIZE IN MB RELEASE TRACK INSTALLED COUNT
820
843
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
821
844
  ```
845
+
846
+ **New standardized format (with --legacy-format false):**
847
+ ```sh
848
+ $ espercli version list -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 --legacy-format false
849
+ Total Number of Versions: 1
850
+
851
+ ID VERSION NAME VERSION CODE SIZE IN MB RELEASE TRACK INSTALLED COUNT
852
+ 54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 30204 9.36421 1
853
+ ```
854
+
822
855
  For list of versions if active application is set,
823
856
  ```sh
824
857
  $ espercli version list
@@ -828,6 +861,8 @@ ID VERSION CODE BUILD NUMBER SIZE IN
828
861
  54436edb-9b43-4e2c-8107-2c6fa90e2a9e 6.4.5 189 9.36421 1
829
862
  ```
830
863
 
864
+ > **Note:** By default, the CLI uses legacy format (`--legacy-format true`) which displays `BUILD NUMBER` column. Use `--legacy-format false` to get the new standardized format with `VERSION NAME` column. The new format uses `version_name` (human-readable) and `version_code` (internal identifier) instead of the legacy `build_number` and `version_code` system.
865
+
831
866
  #### 2. show
832
867
  Show application version information, here version id (UUID) is required to show version information.
833
868
  ```sh
@@ -838,9 +873,11 @@ $ espercli version show [OPTIONS] [version-id]
838
873
  | Name, shorthand | Default| Description|
839
874
  | ------------- |:------:|:----------|
840
875
  | --app, -a | | Application id (UUID) |
876
+ | --legacy-format, -lf |true | Use legacy format, choices are [true, false] |
841
877
  | --json, -j | | Render result in JSON format |
842
878
 
843
879
  ##### Example
880
+ **Default behavior (legacy format):**
844
881
  ```sh
845
882
  $ espercli version show -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 54436edb-9b43-4e2c-8107-2c6fa90e2a9e
846
883
 
@@ -853,6 +890,21 @@ release_track
853
890
  installed_count 1
854
891
  ```
855
892
 
893
+ **New standardized format (with --legacy-format false):**
894
+ ```sh
895
+ $ espercli version show -a 630dbfab-7d85-4f81-9f3b-ffb038b0df72 54436edb-9b43-4e2c-8107-2c6fa90e2a9e --legacy-format false
896
+
897
+ TITLE DETAILS
898
+ id 54436edb-9b43-4e2c-8107-2c6fa90e2a9e
899
+ version_name 6.4.5
900
+ version_code 30204
901
+ size_in_mb 9.36421394348145
902
+ release_track
903
+ installed_count 1
904
+ ```
905
+
906
+ > **Note:** By default, the CLI uses legacy format (`--legacy-format true`) which displays `build_number`. Use `--legacy-format false` to get the new standardized format with `version_name` (human-readable version string) and `version_code` (internal unique identifier).
907
+
856
908
  #### 3. delete
857
909
  Delete sub command used to delete particular application version. Here, version id (UUID) is required to delete version. Application will be also deleted if application contains one version and unset active application if it is set as active
858
910
  ```sh
@@ -65,6 +65,4 @@ espercli.egg-info/SOURCES.txt
65
65
  espercli.egg-info/dependency_links.txt
66
66
  espercli.egg-info/entry_points.txt
67
67
  espercli.egg-info/requires.txt
68
- espercli.egg-info/top_level.txt
69
- tests/test_configure.py
70
- tests/test_main.py
68
+ espercli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ espercli = esper.main:main
@@ -1,10 +1,10 @@
1
- pip==21.1
1
+ pip==23.3
2
2
  wheel
3
3
  cement==3.0.2
4
4
  clint>=0.5.1
5
5
  colorlog>=4.0.2
6
6
  crayons>=0.2.0
7
- esperclient>=0.1.2
7
+ esperclient>=0.1.3
8
8
  jinja2>=2.10.1
9
9
  pyyaml>=5.4
10
10
  requests==2.32.2
@@ -2,15 +2,15 @@ cement==3.0.2
2
2
  clint==0.5.1
3
3
  colorlog==4.0.2
4
4
  crayons==0.2.0
5
- esperclient==0.1.2
6
- jinja2==2.11.3
5
+ esperclient==0.1.3
6
+ jinja2==3.1.6
7
7
  pyyaml==6.0.1
8
8
  requests==2.32.0
9
9
  tabulate==0.8.3
10
10
  tinydb==3.13.0
11
- tqdm==4.32.1
11
+ tqdm==4.66.3
12
12
  markupsafe==2.0.1
13
- cryptography==42.0.8
13
+ cryptography==44.0.1
14
14
 
15
15
  # For Secure ADB
16
16
  pyOpenSSL==24.1.0
@@ -2,7 +2,7 @@
2
2
  from setuptools import setup, find_packages
3
3
 
4
4
 
5
- VERSION = "0.0.14"
5
+ VERSION = "0.0.16"
6
6
 
7
7
  f = open('README.md', 'r', encoding='utf-8', errors='ignore')
8
8
  LONG_DESCRIPTION = f.read()
@@ -26,13 +26,13 @@ setup(
26
26
  espercli = esper.main:main
27
27
  """,
28
28
  install_requires=[
29
- 'pip==21.1',
29
+ 'pip==23.3',
30
30
  'wheel',
31
31
  'cement==3.0.2',
32
32
  'clint>=0.5.1',
33
33
  'colorlog>=4.0.2',
34
34
  'crayons>=0.2.0',
35
- 'esperclient>=0.1.2',
35
+ 'esperclient>=0.1.3',
36
36
  'jinja2>=2.10.1',
37
37
  'pyyaml>=5.4',
38
38
  'requests==2.32.2',
@@ -1,4 +0,0 @@
1
-
2
- [console_scripts]
3
- espercli = esper.main:main
4
-
@@ -1,89 +0,0 @@
1
- from unittest import TestCase
2
-
3
- from _pytest.monkeypatch import MonkeyPatch
4
- from clint.textui import prompt
5
-
6
- from esper.main import EsperTest
7
- from tests.utils import get_esper_credentials, teardown, set_configure
8
-
9
-
10
- class EnterpriseTest(TestCase):
11
- def setUp(self) -> None:
12
- self.monkeypatch = MonkeyPatch()
13
-
14
- def tearDown(self) -> None:
15
- teardown()
16
-
17
- def test_configure_valid_credential(self):
18
- credentials = get_esper_credentials()
19
-
20
- def get_api_key(p):
21
- return credentials.get('key')
22
-
23
- def get_environment(p):
24
- return credentials.get('environment')
25
-
26
- self.monkeypatch.setattr(prompt, 'query', get_api_key)
27
- self.monkeypatch.setattr('builtins.input', get_environment)
28
-
29
- argv = ['configure']
30
- with EsperTest(argv=argv) as app:
31
- app.run()
32
-
33
- data, output = app.last_rendered
34
-
35
- assert data[0]["DETAILS"] == credentials.get('environment')
36
- assert data[1]["DETAILS"] == credentials.get('key')
37
-
38
- def test_configure_invalid_credential(self):
39
- credentials = get_esper_credentials()
40
-
41
- def get_api_key(p):
42
- return 'wrongapikey'
43
-
44
- def get_environment(p):
45
- return credentials.get('environment')
46
-
47
- self.monkeypatch.setattr(prompt, 'query', get_api_key)
48
- self.monkeypatch.setattr('builtins.input', get_environment)
49
-
50
- argv = ['configure']
51
- with EsperTest(argv=argv) as app:
52
- app.run()
53
-
54
- data, output = app.last_rendered
55
- assert data == "You are not authorized, invalid API Key."
56
-
57
- def test_set_configure(self):
58
- credentials = get_esper_credentials()
59
-
60
- def get_api_key(p):
61
- return credentials.get('key')
62
-
63
- def get_environment(p):
64
- return credentials.get('environment')
65
-
66
- self.monkeypatch.setattr(prompt, 'query', get_api_key)
67
- self.monkeypatch.setattr('builtins.input', get_environment)
68
-
69
- argv = ['configure', '--set']
70
- with EsperTest(argv=argv) as app:
71
- app.run()
72
-
73
- data, output = app.last_rendered
74
-
75
- assert data[0]["DETAILS"] == credentials.get('environment')
76
- assert data[1]["DETAILS"] == credentials.get('key')
77
-
78
- def test_show_configure(self):
79
- set_configure(self.monkeypatch)
80
-
81
- argv = ['configure']
82
- with EsperTest(argv=argv) as app:
83
- app.run()
84
-
85
- data, output = app.last_rendered
86
-
87
- credentials = get_esper_credentials()
88
- assert data[0]["DETAILS"] == credentials.get('environment')
89
- assert data[1]["DETAILS"] == credentials.get('key')
@@ -1,16 +0,0 @@
1
- from esper.main import EsperTest
2
-
3
-
4
- def test_esper():
5
- # test esper without any subcommands or arguments
6
- with EsperTest() as app:
7
- app.run()
8
- assert app.exit_code == 0
9
-
10
-
11
- def test_esper_debug():
12
- # test that debug mode is functional
13
- argv = ['--debug']
14
- with EsperTest(argv=argv) as app:
15
- app.run()
16
- assert app.debug is True
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes