jvcli 2.0.5__tar.gz → 2.0.7__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 (65) hide show
  1. {jvcli-2.0.5/jvcli.egg-info → jvcli-2.0.7}/PKG-INFO +1 -1
  2. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/__init__.py +1 -1
  3. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/api.py +23 -5
  4. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/lib/utils.py +2 -1
  5. {jvcli-2.0.5 → jvcli-2.0.7/jvcli.egg-info}/PKG-INFO +1 -1
  6. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_api.py +60 -6
  7. {jvcli-2.0.5 → jvcli-2.0.7}/LICENSE +0 -0
  8. {jvcli-2.0.5 → jvcli-2.0.7}/MANIFEST.in +0 -0
  9. {jvcli-2.0.5 → jvcli-2.0.7}/README.md +0 -0
  10. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/auth.py +0 -0
  11. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/cli.py +0 -0
  12. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/__init__.py +0 -0
  13. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/app.py +0 -0
  14. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/lib/__init__.py +0 -0
  15. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/lib/page.py +0 -0
  16. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/lib/widgets.py +0 -0
  17. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/pages/__init__.py +0 -0
  18. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/pages/analytics_page.py +0 -0
  19. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/pages/chat_page.py +0 -0
  20. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/pages/dashboard_page.py +0 -0
  21. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/client/pages/graph_page.py +0 -0
  22. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/__init__.py +0 -0
  23. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/auth.py +0 -0
  24. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/client.py +0 -0
  25. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/create.py +0 -0
  26. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/download.py +0 -0
  27. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/info.py +0 -0
  28. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/publish.py +0 -0
  29. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/startproject.py +0 -0
  30. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/studio.py +0 -0
  31. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/commands/update.py +0 -0
  32. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/studio/assets/index-BtFItD2q.js +0 -0
  33. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/studio/assets/index-CIEsu-TC.css +0 -0
  34. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/studio/index.html +0 -0
  35. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/studio/jac_logo.png +0 -0
  36. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/studio/tauri.svg +0 -0
  37. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/studio/vite.svg +0 -0
  38. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/action_info.yaml +0 -0
  39. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/agent_descriptor.yaml +0 -0
  40. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/agent_info.yaml +0 -0
  41. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/agent_knowledge.yaml +0 -0
  42. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/agent_memory.yaml +0 -0
  43. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/project/env.example +0 -0
  44. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/project/globals.jac +0 -0
  45. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/2.0.0/project/main.jac +0 -0
  46. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/CHANGELOG.md +0 -0
  47. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/templates/README.md +0 -0
  48. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli/utils.py +0 -0
  49. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli.egg-info/SOURCES.txt +0 -0
  50. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli.egg-info/dependency_links.txt +0 -0
  51. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli.egg-info/entry_points.txt +0 -0
  52. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli.egg-info/requires.txt +0 -0
  53. {jvcli-2.0.5 → jvcli-2.0.7}/jvcli.egg-info/top_level.txt +0 -0
  54. {jvcli-2.0.5 → jvcli-2.0.7}/setup.cfg +0 -0
  55. {jvcli-2.0.5 → jvcli-2.0.7}/setup.py +0 -0
  56. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_auth.py +0 -0
  57. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_cli.py +0 -0
  58. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_create.py +0 -0
  59. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_download.py +0 -0
  60. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_info.py +0 -0
  61. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_publish.py +0 -0
  62. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_startproject.py +0 -0
  63. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_studio.py +0 -0
  64. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_update.py +0 -0
  65. {jvcli-2.0.5 → jvcli-2.0.7}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jvcli
3
- Version: 2.0.5
3
+ Version: 2.0.7
4
4
  Summary: CLI tool for Jivas Package Repository
5
5
  Home-page: https://github.com/TrueSelph/jvcli
6
6
  Author: TrueSelph Inc.
@@ -4,5 +4,5 @@ jvcli package initialization.
4
4
  This package provides the CLI tool for Jivas Package Repository.
5
5
  """
6
6
 
7
- __version__ = "2.0.5"
7
+ __version__ = "2.0.7"
8
8
  __supported__jivas__versions__ = ["2.0.0"]
@@ -57,13 +57,20 @@ class RegistryAPI:
57
57
 
58
58
  @staticmethod
59
59
  def get_package_info(
60
- name: str, version: str = "", token: Optional[str] = None
60
+ name: str,
61
+ version: str = "",
62
+ token: Optional[str] = None,
63
+ api_key: Optional[str] = None,
61
64
  ) -> dict:
62
65
  """Get action info.yaml content as json"""
63
66
  endpoint = "info"
64
67
 
65
68
  try:
66
- headers = {"Authorization": f"Bearer {token}"} if token else None
69
+ headers = {"Authorization": f"Bearer {token}"} if token else {}
70
+
71
+ if api_key:
72
+ headers["x-api-key"] = api_key
73
+
67
74
  data = {
68
75
  "name": name,
69
76
  "version": "" if version == "latest" else version,
@@ -91,12 +98,16 @@ class RegistryAPI:
91
98
  info: bool = False,
92
99
  suppress_error: bool = False,
93
100
  token: Optional[str] = None,
101
+ api_key: Optional[str] = None,
94
102
  ) -> dict:
95
103
  """Download a Jivas Package."""
96
104
  endpoint = "download"
97
105
 
98
106
  try:
99
- headers = {"Authorization": f"Bearer {token}"} if token else None
107
+ headers = {"Authorization": f"Bearer {token}"} if token else {}
108
+
109
+ if api_key:
110
+ headers["x-api-key"] = api_key
100
111
 
101
112
  data = {
102
113
  "name": name,
@@ -124,13 +135,20 @@ class RegistryAPI:
124
135
 
125
136
  @staticmethod
126
137
  def get_action_info(
127
- name: str, version: str = "", token: Optional[str] = None
138
+ name: str,
139
+ version: str = "",
140
+ token: Optional[str] = None,
141
+ api_key: Optional[str] = None,
128
142
  ) -> dict:
129
143
  """Get action info.yaml content as json"""
130
144
  endpoint = "info"
131
145
 
132
146
  try:
133
- headers = {"Authorization": f"Bearer {token}"} if token else None
147
+ headers = {"Authorization": f"Bearer {token}"} if token else {}
148
+
149
+ if api_key:
150
+ headers["x-api-key"] = api_key
151
+
134
152
  data = {
135
153
  "name": name,
136
154
  "version": "" if version == "latest" else version,
@@ -211,8 +211,9 @@ def call_action_walker_exec(
211
211
  if args:
212
212
  data["args"] = json.dumps(args)
213
213
 
214
+ file_list = []
215
+
214
216
  if files:
215
- file_list = []
216
217
 
217
218
  for file in files:
218
219
  file_list.append(("attachments", (file[0], file[1], file[2])))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jvcli
3
- Version: 2.0.5
3
+ Version: 2.0.7
4
4
  Summary: CLI tool for Jivas Package Repository
5
5
  Home-page: https://github.com/TrueSelph/jvcli
6
6
  Author: TrueSelph Inc.
@@ -197,7 +197,7 @@ class TestRegistryAPI:
197
197
  mock_requests.assert_called_once_with(
198
198
  RegistryAPI.url + "info",
199
199
  params={"name": "test-pkg", "version": "1.0.0"},
200
- headers=None,
200
+ headers={},
201
201
  )
202
202
  mock_secho.assert_called_once_with(
203
203
  "Error retrieving action: Network error", fg="red"
@@ -246,7 +246,7 @@ class TestRegistryAPI:
246
246
  mock_requests.assert_called_once_with(
247
247
  RegistryAPI.url + "download",
248
248
  params={"name": "test-package", "info": "false", "version": "1.0.0"},
249
- headers=None,
249
+ headers={},
250
250
  )
251
251
  mock_secho.assert_called_once_with(
252
252
  "Error downloading package: Network error", fg="red"
@@ -272,7 +272,7 @@ class TestRegistryAPI:
272
272
  mock_requests.assert_called_once_with(
273
273
  f"{RegistryAPI.url}info",
274
274
  params={"name": "test-action", "version": ""},
275
- headers=None,
275
+ headers={},
276
276
  )
277
277
  assert result == {"name": "test-action", "description": "Test action"}
278
278
 
@@ -291,7 +291,7 @@ class TestRegistryAPI:
291
291
  mock_requests.assert_called_once_with(
292
292
  f"{RegistryAPI.url}info",
293
293
  params={"name": "test-action", "version": ""},
294
- headers=None,
294
+ headers={},
295
295
  )
296
296
  mock_secho.assert_called_once_with(
297
297
  "Error retrieving action: Network error", fg="red"
@@ -316,7 +316,7 @@ class TestRegistryAPI:
316
316
  mock_requests.assert_called_once_with(
317
317
  f"{RegistryAPI.url}info",
318
318
  params={"name": "test-action", "version": ""},
319
- headers=None,
319
+ headers={},
320
320
  )
321
321
  mock_secho.assert_called_once_with(
322
322
  "Error retrieving action: Not Found", fg="red"
@@ -742,7 +742,7 @@ class TestRegistryAPI:
742
742
  mock_get.assert_called_once_with(
743
743
  RegistryAPI.url + "download",
744
744
  params={"name": test_name, "info": "false", "version": test_version},
745
- headers=None,
745
+ headers={},
746
746
  )
747
747
  assert result == {}
748
748
 
@@ -947,3 +947,57 @@ class TestRegistryAPI:
947
947
 
948
948
  # Assert
949
949
  assert result == {}
950
+
951
+ def test_package_download_with_api_key(self, mocker: MockerFixture) -> None:
952
+ """Test downloading package with API key."""
953
+ # Arrange
954
+ mock_response = mocker.Mock()
955
+ mock_response.status_code = 200
956
+ mock_response.json.return_value = {"package": "content"}
957
+
958
+ mock_get = mocker.patch("requests.get", return_value=mock_response)
959
+
960
+ test_name = "test-action"
961
+ test_api_key = "test-api-key" # pragma: allowlist secret
962
+
963
+ # Act
964
+ result = RegistryAPI.download_package(name=test_name, api_key=test_api_key)
965
+
966
+ # Assert
967
+ mock_get.assert_called_once_with(
968
+ f"{RegistryAPI.url}download",
969
+ params={"name": test_name, "info": "false", "version": ""},
970
+ headers={"x-api-key": test_api_key},
971
+ )
972
+ assert result == {"package": "content"}
973
+
974
+ def test_package_info_with_api_key(self, mocker: MockerFixture) -> None:
975
+ """Test getting package info with API key."""
976
+ # Arrange
977
+ mock_response = mocker.Mock()
978
+ mock_response.status_code = 200
979
+ mock_response.json.return_value = {
980
+ "name": "test-action",
981
+ "version": "1.0.0",
982
+ "description": "Test action",
983
+ }
984
+
985
+ mock_get = mocker.patch("requests.get", return_value=mock_response)
986
+
987
+ test_name = "test-action"
988
+ test_api_key = "test-api-key" # pragma: allowlist secret
989
+
990
+ # Act
991
+ result = RegistryAPI.get_package_info(name=test_name, api_key=test_api_key)
992
+
993
+ # Assert
994
+ mock_get.assert_called_once_with(
995
+ f"{RegistryAPI.url}info",
996
+ params={"name": test_name, "version": ""},
997
+ headers={"x-api-key": test_api_key},
998
+ )
999
+ assert result == {
1000
+ "name": "test-action",
1001
+ "version": "1.0.0",
1002
+ "description": "Test action",
1003
+ }
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
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
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
File without changes
File without changes
File without changes
File without changes
File without changes