gibson-cli 0.1.2__tar.gz → 0.1.4__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 (120) hide show
  1. {gibson_cli-0.1.2/gibson_cli.egg-info → gibson_cli-0.1.4}/PKG-INFO +1 -1
  2. gibson_cli-0.1.4/gibson/api/BaseApi.py +112 -0
  3. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/api/Cli.py +21 -59
  4. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/bin/gibson.py +2 -2
  5. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Api.py +5 -6
  6. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Base.py +4 -5
  7. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/BaseCommand.py +2 -2
  8. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Build.py +2 -3
  9. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Code.py +12 -11
  10. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Conf.py +1 -1
  11. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Dev.py +2 -3
  12. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Import.py +4 -5
  13. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/List.py +2 -3
  14. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Merge.py +2 -3
  15. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Model.py +4 -5
  16. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Models.py +4 -5
  17. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Modify.py +2 -3
  18. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Module.py +2 -3
  19. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/New.py +2 -3
  20. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/OpenApi.py +2 -3
  21. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Question.py +2 -3
  22. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Remove.py +3 -4
  23. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Rename.py +3 -4
  24. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Rewrite.py +3 -3
  25. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Schema.py +4 -5
  26. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Schemas.py +4 -5
  27. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Test.py +4 -5
  28. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Tests.py +4 -5
  29. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Version.py +2 -2
  30. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/WarGames.py +2 -3
  31. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/auth/Auth.py +3 -3
  32. gibson_cli-0.1.4/gibson/command/auth/Login.py +20 -0
  33. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/auth/Logout.py +1 -1
  34. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/tests/test_command_BaseCommand.py +2 -2
  35. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/tests/test_command_Conf.py +2 -2
  36. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Dev.py +4 -4
  37. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/tests/test_conf_Dependencies.py +1 -1
  38. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/tests/test_conf_Platform.py +1 -1
  39. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/core/CommandRouter.py +34 -34
  40. gibson_cli-0.1.4/gibson/core/Completions.py +35 -0
  41. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/core/Configuration.py +24 -11
  42. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/core/Conversation.py +8 -5
  43. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/core/Env.py +2 -2
  44. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/core/Memory.py +1 -1
  45. gibson_cli-0.1.4/gibson/data/bash-completion.tmpl +96 -0
  46. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/db/tests/test_db_TableExceptions.py +1 -1
  47. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/dev/Dev.py +2 -11
  48. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/display/tests/test_display_Header.py +1 -1
  49. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/display/tests/test_display_WorkspaceFooter.py +1 -1
  50. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/display/tests/test_display_WorkspaceHeader.py +1 -1
  51. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/lang/Python.py +1 -1
  52. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/lang/tests/test_lang_Python.py +1 -1
  53. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/auth/Server.py +11 -6
  54. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/context/schema/EntityKeys.py +3 -3
  55. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/context/schema/Manager.py +2 -2
  56. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/context/schema/tests/test_code_context_schema_DataDictionary.py +1 -1
  57. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/context/schema/tests/test_code_context_schema_EntityKeys.py +4 -4
  58. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/context/schema/tests/test_code_context_schema_Manager.py +2 -2
  59. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/customization/Authenticator.py +2 -2
  60. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/customization/BaseCustomization.py +1 -1
  61. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/customization/CustomizationManager.py +2 -2
  62. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/customization/tests/test_code_customization_Authenticator.py +2 -2
  63. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/customization/tests/test_code_customization_BaseCustomization.py +2 -2
  64. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/Entity.py +2 -2
  65. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/keys/ForeignKey.py +1 -1
  66. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/keys/Index.py +1 -1
  67. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/keys/tests/test_ForeignKey.py +2 -2
  68. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/keys/tests/test_Index.py +1 -1
  69. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/keys/tests/test_IndexAttribute.py +1 -1
  70. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/testing.py +1 -1
  71. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/tests/test_Entity.py +5 -5
  72. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/tests/test_Env.py +2 -2
  73. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/tests/test_Memory.py +2 -2
  74. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/tests/test_utils.py +1 -1
  75. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson_cli.egg-info}/PKG-INFO +1 -1
  76. gibson_cli-0.1.4/gibson_cli.egg-info/SOURCES.txt +113 -0
  77. gibson_cli-0.1.4/gibson_cli.egg-info/entry_points.txt +2 -0
  78. gibson_cli-0.1.4/gibson_cli.egg-info/top_level.txt +3 -0
  79. {gibson_cli-0.1.2 → gibson_cli-0.1.4}/pyproject.toml +6 -3
  80. gibson_cli-0.1.2/api/BaseApi.py +0 -45
  81. gibson_cli-0.1.2/command/auth/Login.py +0 -20
  82. gibson_cli-0.1.2/gibson_cli.egg-info/SOURCES.txt +0 -111
  83. gibson_cli-0.1.2/gibson_cli.egg-info/entry_points.txt +0 -2
  84. gibson_cli-0.1.2/gibson_cli.egg-info/top_level.txt +0 -14
  85. {gibson_cli-0.1.2 → gibson_cli-0.1.4}/.gitignore +0 -0
  86. {gibson_cli-0.1.2 → gibson_cli-0.1.4}/.pre-commit-config.yaml +0 -0
  87. {gibson_cli-0.1.2 → gibson_cli-0.1.4}/README.md +0 -0
  88. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Count.py +0 -0
  89. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Forget.py +0 -0
  90. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Show.py +0 -0
  91. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/command/Tree.py +0 -0
  92. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Api.py +0 -0
  93. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Code.py +0 -0
  94. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Custom.py +0 -0
  95. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Datastore.py +0 -0
  96. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Dependencies.py +0 -0
  97. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Frameworks.py +0 -0
  98. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Modeler.py +0 -0
  99. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Paths.py +0 -0
  100. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Platform.py +0 -0
  101. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Project.py +0 -0
  102. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/Version.py +0 -0
  103. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/dev/Api.py +0 -0
  104. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/dev/Base.py +0 -0
  105. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/dev/Model.py +0 -0
  106. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/conf/dev/Schema.py +0 -0
  107. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/core/TimeKeeper.py +0 -0
  108. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/core/utils.py +0 -0
  109. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/data/default-ref-table.tmpl +0 -0
  110. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/data/default-table.tmpl +0 -0
  111. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/db/TableExceptions.py +0 -0
  112. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/display/Header.py +0 -0
  113. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/display/WorkspaceFooter.py +0 -0
  114. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/display/WorkspaceHeader.py +0 -0
  115. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/services/code/context/schema/DataDictionary.py +0 -0
  116. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/constraints/ReferenceConstraint.py +0 -0
  117. {gibson_cli-0.1.2 → gibson_cli-0.1.4/gibson}/structure/keys/IndexAttribute.py +0 -0
  118. {gibson_cli-0.1.2 → gibson_cli-0.1.4}/gibson_cli.egg-info/dependency_links.txt +0 -0
  119. {gibson_cli-0.1.2 → gibson_cli-0.1.4}/requirements.txt +0 -0
  120. {gibson_cli-0.1.2 → gibson_cli-0.1.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gibson-cli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
@@ -0,0 +1,112 @@
1
+ import os
2
+ import requests
3
+
4
+ from gibson.core.Configuration import Configuration
5
+
6
+
7
+ class BaseApi:
8
+ API_ENV = os.environ.get("GIBSONAI_API_ENV", "staging")
9
+ VERSION = "v1"
10
+
11
+ def __init__(self, configuration: Configuration):
12
+ self.configuration = configuration
13
+
14
+ def api_domain(self):
15
+ domains = {
16
+ "local": "http://localhost:8000",
17
+ "staging": "https://staging-api.gibsonai.com",
18
+ "production": "https://api.gibsonai.com",
19
+ }
20
+ return domains[self.API_ENV]
21
+
22
+ def app_domain(self):
23
+ domains = {
24
+ "local": "http://localhost:5173",
25
+ "staging": "https://staging-app.gibsonai.com",
26
+ "production": "https://app.gibsonai.com",
27
+ }
28
+ return domains[self.API_ENV]
29
+
30
+ def base_url(self):
31
+ return f"{self.api_domain()}/{self.VERSION}"
32
+
33
+ def client_id(self):
34
+ return {
35
+ "local": "9b0cbebd-3eb4-47be-89ac-4aa589316ff4",
36
+ "staging": "02459e16-f356-4c01-b689-59847ed04b0a",
37
+ "production": "da287371-240b-4b53-bfde-4b1581cca62a",
38
+ }[self.API_ENV]
39
+
40
+ def get(self, endpoint):
41
+ r = requests.get(self.url(endpoint), headers=self.headers())
42
+
43
+ if r.status_code == 401 and self.refresh_auth_tokens():
44
+ r = requests.get(self.url(endpoint), headers=self.headers())
45
+
46
+ self.__raise_for_status(r)
47
+
48
+ return r.json()
49
+
50
+ def headers(self):
51
+ raise NotImplementedError
52
+
53
+ def post(self, endpoint, json: dict):
54
+ r = requests.post(self.url(endpoint), headers=self.headers(), json=json)
55
+
56
+ if r.status_code == 401 and self.refresh_auth_tokens():
57
+ r = requests.post(self.url(endpoint), headers=self.headers(), json=json)
58
+
59
+ self.__raise_for_status(r)
60
+
61
+ return r
62
+
63
+ def put(self, endpoint, json: dict):
64
+ r = requests.put(self.url(endpoint), headers=self.headers(), json=json)
65
+
66
+ if r.status_code == 401 and self.refresh_auth_tokens():
67
+ r = requests.put(self.url(endpoint), headers=self.headers(), json=json)
68
+
69
+ self.__raise_for_status(r)
70
+
71
+ return r
72
+
73
+ def refresh_auth_tokens(self):
74
+ refresh_token = self.configuration.get_refresh_token()
75
+ if not refresh_token:
76
+ return False
77
+
78
+ r = requests.post(
79
+ f"{self.base_url()}/auth/token/refresh",
80
+ headers=self.headers(),
81
+ json={"refresh_token": refresh_token},
82
+ )
83
+
84
+ if r.status_code != 200:
85
+ return False
86
+
87
+ parsed = r.json()
88
+ self.configuration.set_auth_tokens(
89
+ parsed["access_token"], parsed["refresh_token"]
90
+ )
91
+ return True
92
+
93
+ def url(self, endpoint):
94
+ if self.PREFIX:
95
+ return f"{self.base_url()}/{self.PREFIX}/{endpoint}"
96
+ return f"{self.base_url()}/{endpoint}"
97
+
98
+ def __raise_for_status(self, r):
99
+ try:
100
+ r.raise_for_status()
101
+ except:
102
+ try:
103
+ message = r.json()
104
+
105
+ print("=" * 78)
106
+ print("Raw Response:\n")
107
+ print(message)
108
+ print("\n" + "=" * 78)
109
+ except requests.exceptions.JSONDecodeError:
110
+ pass
111
+
112
+ raise
@@ -1,31 +1,21 @@
1
- import os
2
- import requests
3
-
4
- from services.auth.Server import Server as AuthServer
5
- from core.Configuration import Configuration
6
- from lang.Python import Python
7
- from core.Memory import Memory
1
+ from gibson.core.Configuration import Configuration
2
+ from gibson.lang.Python import Python
3
+ from gibson.core.Memory import Memory
8
4
 
9
5
  from .BaseApi import BaseApi
10
6
 
11
7
 
12
8
  class Cli(BaseApi):
13
- API_ENV = os.environ.get("GIBSONAI_API_ENV", "staging")
14
9
  PREFIX = "cli"
15
- VERSION = "v1"
16
-
17
- def __init__(self, configuration: Configuration):
18
- super().__init__()
19
- self.configuration = configuration
20
10
 
21
11
  def code_api(self):
22
- return self._post(
12
+ return self.post(
23
13
  "code/api",
24
14
  self.__structure_context_payload(self.configuration, with_stored=True),
25
15
  ).json()
26
16
 
27
17
  def code_base(self):
28
- return self._post(
18
+ return self.post(
29
19
  "code/base",
30
20
  self.__structure_context_payload(self.configuration, with_stored=True),
31
21
  ).json()
@@ -35,25 +25,25 @@ class Cli(BaseApi):
35
25
  payload["model"] = {"name": model_name}
36
26
  payload["q"] = instructions
37
27
 
38
- return self._post("code/model/attributes", payload).json()
28
+ return self.post("code/model/attributes", payload).json()
39
29
 
40
30
  def code_models(self, entities: list):
41
31
  payload = self.__structure_context_payload(self.configuration, with_stored=True)
42
32
  payload["entities"] = entities
43
33
 
44
- return self._post("code/models", payload).json()
34
+ return self.post("code/models", payload).json()
45
35
 
46
36
  def code_schemas(self, entities: list):
47
37
  payload = self.__structure_context_payload(self.configuration, with_stored=True)
48
38
  payload["entities"] = entities
49
39
 
50
- return self._post("code/schemas", payload).json()
40
+ return self.post("code/schemas", payload).json()
51
41
 
52
42
  def code_testing(self, entities: list):
53
43
  payload = self.__structure_context_payload(self.configuration, with_stored=True)
54
44
  payload["entities"] = entities
55
45
 
56
- return self._post("code/testing", payload).json()
46
+ return self.post("code/testing", payload).json()
57
47
 
58
48
  def code_writer_entity_modifier(self, context, name, definition, instructions):
59
49
  payload = self.__structure_context_payload(self.configuration)
@@ -61,38 +51,17 @@ class Cli(BaseApi):
61
51
  payload["entity"] = {"definition": definition, "name": name}
62
52
  payload["q"] = instructions
63
53
 
64
- return self._post("code/writer/entity/modifier", payload).json()
54
+ return self.post("code/writer/entity/modifier", payload).json()
65
55
 
66
56
  def code_writer_schema_context(self):
67
- return self._post(
57
+ return self.post(
68
58
  "code/writer/schema/context",
69
59
  self.__structure_context_payload(self.configuration, with_stored=True),
70
60
  ).json()
71
61
 
72
- def get_client_id(self):
73
- return {
74
- "local": "9b0cbebd-3eb4-47be-89ac-4aa589316ff4",
75
- "staging": "02459e16-f356-4c01-b689-59847ed04b0a",
76
- "production": "da287371-240b-4b53-bfde-4b1581cca62a",
77
- }[self.API_ENV]
78
-
79
- def get_api_domain(self):
80
- return {
81
- "local": "http://localhost:8000",
82
- "staging": "https://staging-api.gibsonai.com",
83
- "production": "https://api.gibsonai.com",
84
- }[self.API_ENV]
85
-
86
- def get_app_domain(self):
87
- return {
88
- "local": "http://localhost:5173",
89
- "staging": "https://staging-app.gibsonai.com",
90
- "production": "https://app.gibsonai.com",
91
- }[self.API_ENV]
92
-
93
- def get_headers(self):
62
+ def headers(self):
94
63
  headers = {
95
- "X-Gibson-Client-ID": self.get_client_id(),
64
+ "X-Gibson-Client-ID": self.client_id(),
96
65
  "X-Gibson-API-Key": self.configuration.project.api.key,
97
66
  }
98
67
 
@@ -102,15 +71,12 @@ class Cli(BaseApi):
102
71
 
103
72
  return headers
104
73
 
105
- def get_url(self, end_point):
106
- return f"{self.get_api_domain()}/{self.VERSION}/{self.PREFIX}/{end_point}"
107
-
108
74
  def import_(self):
109
- return self._get("import")
75
+ return self.get("import")
110
76
 
111
77
  def llm_query(self, instructions, has_file, has_python, has_sql):
112
78
  project_config = self.configuration.project
113
- r = self._post(
79
+ r = self.post(
114
80
  "llm/query",
115
81
  {
116
82
  "content": {
@@ -133,14 +99,10 @@ class Cli(BaseApi):
133
99
 
134
100
  return r.json()
135
101
 
136
- def login(self):
137
- token = AuthServer(self.get_app_domain()).get_token()
138
- return token
139
-
140
102
  def modeler_entity_modify(
141
103
  self, modeler_version, project_description, entity: dict, modifications: str
142
104
  ):
143
- r = self._put(
105
+ r = self.put(
144
106
  "modeler/entity/modify",
145
107
  {
146
108
  "entity": entity,
@@ -153,7 +115,7 @@ class Cli(BaseApi):
153
115
  return r.json()
154
116
 
155
117
  def modeler_entity_remove(self, modeler_version, entities: list, entity_name):
156
- r = self._put(
118
+ r = self.put(
157
119
  "modeler/entity/remove",
158
120
  {
159
121
  "entity": {"name": entity_name},
@@ -165,7 +127,7 @@ class Cli(BaseApi):
165
127
  return r.json()
166
128
 
167
129
  def modeler_entity_rename(self, modeler_version, entities: list, current, new):
168
- r = self._put(
130
+ r = self.put(
169
131
  "modeler/entity/rename",
170
132
  {
171
133
  "entity": {"current": current, "new": new},
@@ -177,7 +139,7 @@ class Cli(BaseApi):
177
139
  return r.json()
178
140
 
179
141
  def modeler_module(self, modeler_version, project_description, module):
180
- r = self._post(
142
+ r = self.post(
181
143
  "modeler/module",
182
144
  {
183
145
  "modeler": {"version": modeler_version},
@@ -189,7 +151,7 @@ class Cli(BaseApi):
189
151
  return r.json()
190
152
 
191
153
  def modeler_openapi(self, modeler_version, contents):
192
- r = self._post(
154
+ r = self.post(
193
155
  "modeler/openapi",
194
156
  {"contents": contents, "modeler": {"version": modeler_version}},
195
157
  )
@@ -197,7 +159,7 @@ class Cli(BaseApi):
197
159
  return r.json()
198
160
 
199
161
  def modeler_reconcile(self, modeler_version, entities: list):
200
- r = self._post(
162
+ r = self.post(
201
163
  "modeler/reconcile",
202
164
  {"modeler": {"version": modeler_version}, "schema_": entities},
203
165
  )
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
- from core.CommandRouter import CommandRouter
4
- from core.Configuration import Configuration
3
+ from gibson.core.CommandRouter import CommandRouter
4
+ from gibson.core.Configuration import Configuration
5
5
 
6
6
 
7
7
  def main():
@@ -1,9 +1,8 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from services.code.customization.Authenticator import Authenticator
4
- from core.TimeKeeper import TimeKeeper
5
-
6
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.command.BaseCommand import BaseCommand
3
+ from gibson.core.TimeKeeper import TimeKeeper
4
+ from gibson.dev.Dev import Dev
5
+ from gibson.services.code.customization.Authenticator import Authenticator
7
6
 
8
7
 
9
8
  class Api(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.command.BaseCommand import BaseCommand
3
+ from gibson.core.TimeKeeper import TimeKeeper
4
+ from gibson.dev.Dev import Dev
6
5
 
7
6
 
8
7
  class Base(BaseCommand):
@@ -1,5 +1,5 @@
1
- from core.Configuration import Configuration
2
- from core.Memory import Memory
1
+ from gibson.core.Configuration import Configuration
2
+ from gibson.core.Memory import Memory
3
3
 
4
4
 
5
5
  class BaseCommand:
@@ -3,9 +3,8 @@ import sys
3
3
  from sqlalchemy import create_engine
4
4
  from sqlalchemy.orm import sessionmaker
5
5
 
6
- from db.TableExceptions import TableExceptions
7
-
8
- from .BaseCommand import BaseCommand
6
+ from gibson.command.BaseCommand import BaseCommand
7
+ from gibson.db.TableExceptions import TableExceptions
9
8
 
10
9
 
11
10
  class Build(BaseCommand):
@@ -3,17 +3,18 @@ import re
3
3
  import sys
4
4
  from string import Template
5
5
 
6
- from api.Cli import Cli
7
- from core.Configuration import Configuration
8
- from display.Header import Header
9
- from display.WorkspaceFooter import WorkspaceFooter
10
- from display.WorkspaceHeader import WorkspaceHeader
11
- from services.code.context.schema.Manager import Manager as CodeContextSchemaManager
12
- from structure.Entity import Entity
13
-
14
- from .BaseCommand import BaseCommand
15
- from .Merge import Merge
16
- from .Rewrite import Rewrite
6
+ from gibson.api.Cli import Cli
7
+ from gibson.command.BaseCommand import BaseCommand
8
+ from gibson.command.Merge import Merge
9
+ from gibson.command.Rewrite import Rewrite
10
+ from gibson.core.Configuration import Configuration
11
+ from gibson.display.Header import Header
12
+ from gibson.display.WorkspaceFooter import WorkspaceFooter
13
+ from gibson.display.WorkspaceHeader import WorkspaceHeader
14
+ from gibson.services.code.context.schema.Manager import (
15
+ Manager as CodeContextSchemaManager,
16
+ )
17
+ from gibson.structure.Entity import Entity
17
18
 
18
19
 
19
20
  class Code(BaseCommand):
@@ -1,6 +1,6 @@
1
1
  import sys
2
2
 
3
- from .BaseCommand import BaseCommand
3
+ from gibson.command.BaseCommand import BaseCommand
4
4
 
5
5
 
6
6
  class Conf(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import os
2
2
  import sys
3
3
 
4
- from lang.Python import Python
5
-
6
- from .BaseCommand import BaseCommand
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.lang.Python import Python
7
6
 
8
7
 
9
8
  class Dev(BaseCommand):
@@ -3,11 +3,10 @@ import sys
3
3
  from sqlalchemy import create_engine
4
4
  from sqlalchemy.orm import sessionmaker
5
5
 
6
- from api.Cli import Cli
7
- from db.TableExceptions import TableExceptions
8
-
9
- from .BaseCommand import BaseCommand
10
- from .Rewrite import Rewrite
6
+ from gibson.api.Cli import Cli
7
+ from gibson.command.BaseCommand import BaseCommand
8
+ from gibson.command.Rewrite import Rewrite
9
+ from gibson.db.TableExceptions import TableExceptions
11
10
 
12
11
 
13
12
  class Import(BaseCommand):
@@ -1,8 +1,7 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
6
5
 
7
6
 
8
7
  class List(BaseCommand):
@@ -1,8 +1,7 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
6
5
 
7
6
 
8
7
  class Merge(BaseCommand):
@@ -1,10 +1,9 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
- from dev.Dev import Dev
5
- from core.TimeKeeper import TimeKeeper
6
-
7
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.core.TimeKeeper import TimeKeeper
6
+ from gibson.dev.Dev import Dev
8
7
 
9
8
 
10
9
  class Model(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.command.BaseCommand import BaseCommand
3
+ from gibson.core.TimeKeeper import TimeKeeper
4
+ from gibson.dev.Dev import Dev
6
5
 
7
6
 
8
7
  class Models(BaseCommand):
@@ -1,8 +1,7 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
6
5
 
7
6
 
8
7
  class Modify(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import re
2
2
  import sys
3
3
 
4
- from api.Cli import Cli
5
-
6
- from .BaseCommand import BaseCommand
4
+ from gibson.api.Cli import Cli
5
+ from gibson.command.BaseCommand import BaseCommand
7
6
 
8
7
 
9
8
  class Module(BaseCommand):
@@ -2,9 +2,8 @@ import os
2
2
  import re
3
3
  import sys
4
4
 
5
- from api.Cli import Cli
6
-
7
- from .BaseCommand import BaseCommand
5
+ from gibson.api.Cli import Cli
6
+ from gibson.command.BaseCommand import BaseCommand
8
7
 
9
8
 
10
9
  class New(BaseCommand):
@@ -2,9 +2,8 @@ import json
2
2
  import re
3
3
  import sys
4
4
 
5
- from api.Cli import Cli
6
-
7
- from .BaseCommand import BaseCommand
5
+ from gibson.api.Cli import Cli
6
+ from gibson.command.BaseCommand import BaseCommand
8
7
 
9
8
 
10
9
  class OpenApi(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import os
2
2
  import sys
3
3
 
4
- from api.Cli import Cli
5
-
6
- from .BaseCommand import BaseCommand
4
+ from gibson.api.Cli import Cli
5
+ from gibson.command.BaseCommand import BaseCommand
7
6
 
8
7
 
9
8
  class Question(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
6
- from .Rewrite import Rewrite
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.command.Rewrite import Rewrite
7
6
 
8
7
 
9
8
  class Remove(BaseCommand):
@@ -1,9 +1,8 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
-
5
- from .BaseCommand import BaseCommand
6
- from .Rewrite import Rewrite
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.command.Rewrite import Rewrite
7
6
 
8
7
 
9
8
  class Rename(BaseCommand):
@@ -1,9 +1,9 @@
1
1
  import os
2
2
  import shutil
3
3
 
4
- from core.Configuration import Configuration
5
- from services.code.customization.CustomizationManager import CustomizationManager
6
- from core.TimeKeeper import TimeKeeper
4
+ from gibson.core.Configuration import Configuration
5
+ from gibson.core.TimeKeeper import TimeKeeper
6
+ from gibson.services.code.customization.CustomizationManager import CustomizationManager
7
7
 
8
8
  from .Api import Api
9
9
  from .Base import Base
@@ -1,10 +1,9 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
- from dev.Dev import Dev
5
- from core.TimeKeeper import TimeKeeper
6
-
7
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.command.BaseCommand import BaseCommand
5
+ from gibson.core.TimeKeeper import TimeKeeper
6
+ from gibson.dev.Dev import Dev
8
7
 
9
8
 
10
9
  class Schema(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.dev.Dev import Dev
3
+ from gibson.command.BaseCommand import BaseCommand
4
+ from gibson.core.TimeKeeper import TimeKeeper
6
5
 
7
6
 
8
7
  class Schemas(BaseCommand):
@@ -1,10 +1,9 @@
1
1
  import sys
2
2
 
3
- from api.Cli import Cli
4
- from dev.Dev import Dev
5
- from core.TimeKeeper import TimeKeeper
6
-
7
- from .BaseCommand import BaseCommand
3
+ from gibson.api.Cli import Cli
4
+ from gibson.dev.Dev import Dev
5
+ from gibson.command.BaseCommand import BaseCommand
6
+ from gibson.core.TimeKeeper import TimeKeeper
8
7
 
9
8
 
10
9
  class Test(BaseCommand):
@@ -1,8 +1,7 @@
1
- from api.Cli import Cli
2
- from dev.Dev import Dev
3
- from core.TimeKeeper import TimeKeeper
4
-
5
- from .BaseCommand import BaseCommand
1
+ from gibson.api.Cli import Cli
2
+ from gibson.dev.Dev import Dev
3
+ from gibson.command.BaseCommand import BaseCommand
4
+ from gibson.core.TimeKeeper import TimeKeeper
6
5
 
7
6
 
8
7
  class Tests(BaseCommand):