ApiLogicServer 15.0.22__py3-none-any.whl → 15.0.23__py3-none-any.whl
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.
- api_logic_server_cli/api_logic_server.py +2 -2
- api_logic_server_cli/api_logic_server_info.yaml +2 -2
- api_logic_server_cli/genai/genai_admin_app.py +20 -9
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-config-prompt.md +18 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-json-api-model-prompt.md +89 -0
- {apilogicserver-15.0.22.dist-info → apilogicserver-15.0.23.dist-info}/METADATA +1 -1
- {apilogicserver-15.0.22.dist-info → apilogicserver-15.0.23.dist-info}/RECORD +11 -9
- {apilogicserver-15.0.22.dist-info → apilogicserver-15.0.23.dist-info}/WHEEL +0 -0
- {apilogicserver-15.0.22.dist-info → apilogicserver-15.0.23.dist-info}/entry_points.txt +0 -0
- {apilogicserver-15.0.22.dist-info → apilogicserver-15.0.23.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-15.0.22.dist-info → apilogicserver-15.0.23.dist-info}/top_level.txt +0 -0
|
@@ -12,10 +12,10 @@ ApiLogicServer CLI: given a database url, create [and run] customizable ApiLogic
|
|
|
12
12
|
Called from api_logic_server_cli.py, by instantiating the ProjectRun object.
|
|
13
13
|
'''
|
|
14
14
|
|
|
15
|
-
__version__ = "15.00.
|
|
15
|
+
__version__ = "15.00.23" # last public release: 15.00.22 (15.00.12)
|
|
16
16
|
recent_changes = \
|
|
17
17
|
f'\n\nRecent Changes:\n' +\
|
|
18
|
-
"\t06/
|
|
18
|
+
"\t06/23/2024 - 15.00.23: Tech Preview: als genai-app w/ sra provider+model, import fix, bug [96] \n"\
|
|
19
19
|
"\t06/10/2024 - 15.00.12: MCP Security, win fixes for readme, graphics quotes \n"\
|
|
20
20
|
"\t06/08/2024 - 15.00.10: MCP, optional shortening of stacktrace lines, bugfix[92] \n"\
|
|
21
21
|
"\t05/16/2024 - 14.05.00: safrs 3.1.7, running mcp preview \n"\
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
last_created_date: June
|
|
1
|
+
last_created_date: June 23, 2025 06:19:07
|
|
2
2
|
last_created_project_name: ../../../servers/basic_demo
|
|
3
|
-
last_created_version: 15.00.
|
|
3
|
+
last_created_version: 15.00.22
|
|
@@ -43,10 +43,17 @@ class GenAIAdminApp:
|
|
|
43
43
|
|
|
44
44
|
self.api_version = genai_version
|
|
45
45
|
self.project_root = project.project_directory_path
|
|
46
|
+
self.app_templates_path = genai_svcs.get_manager_path(use_env=True).joinpath('system/genai/app_templates')
|
|
47
|
+
|
|
46
48
|
self.dbml_path = self.project_root / "docs/db.dbml"
|
|
47
|
-
self.admin_yaml_path = self.project_root / f"ui/admin/{schema}"
|
|
48
49
|
self.discovery_path = self.project_root / "docs/mcp_learning/mcp_discovery.json"
|
|
49
50
|
|
|
51
|
+
self.admin_yaml_path = self.project_root / f"ui/admin/{schema}"
|
|
52
|
+
self.admin_config_prompt_path = self.app_templates_path / f"app_learning/Admin-config-prompt.md"
|
|
53
|
+
self.admin_json_api_model_prompt_path = self.app_templates_path / f"app_learning/Admin-json-api-model-prompt.md"
|
|
54
|
+
assert self.admin_config_prompt_path.exists(), "sys err - self.admin_config_prompt_path"
|
|
55
|
+
assert self.admin_json_api_model_prompt_path.exists(), "sys err - self.admin_json_api_model_prompt_path"
|
|
56
|
+
|
|
50
57
|
self.ui_project_path = self.project_root / f"ui/{app_name}"
|
|
51
58
|
self.ui_src_path = self.ui_project_path / "src"
|
|
52
59
|
|
|
@@ -60,13 +67,17 @@ class GenAIAdminApp:
|
|
|
60
67
|
|
|
61
68
|
# self.schema = utils.read_file(self.dbml_path)
|
|
62
69
|
self.schema_yaml = utils.read_file(self.admin_yaml_path)
|
|
63
|
-
self.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
self.resources
|
|
67
|
-
|
|
68
|
-
self.
|
|
69
|
-
|
|
70
|
+
self.schema_dict = yaml.safe_load(self.schema_yaml)
|
|
71
|
+
self.admin_config_prompt = utils.read_file(self.admin_config_prompt_path)
|
|
72
|
+
self.admin_json_api_model_prompt = utils.read_file(self.admin_json_api_model_prompt_path)
|
|
73
|
+
config_prompt_parts = self.admin_config_prompt.split('<resources></resources>')
|
|
74
|
+
self.resources = self.schema_dict['resources']
|
|
75
|
+
# convert self.resources dict to text lines
|
|
76
|
+
self.resource_lines = json.dumps(self.resources, indent=4)
|
|
77
|
+
resources_dict = "\n".join([f"- {name}: {details}" for name, details in self.resources.items()])
|
|
78
|
+
config_prompt = config_prompt_parts[0] + "\n<resources>\n" + self.resource_lines + config_prompt_parts[1]
|
|
79
|
+
self.schema = config_prompt + self.admin_json_api_model_prompt
|
|
80
|
+
self.schema_lines = self.schema.split('\n') # for debug
|
|
70
81
|
|
|
71
82
|
shutil.copytree(self.react_admin_template_path, self.ui_project_path, dirs_exist_ok=True)
|
|
72
83
|
|
|
@@ -111,7 +122,7 @@ class GenAIAdminApp:
|
|
|
111
122
|
return "\n".join(result_lines)
|
|
112
123
|
|
|
113
124
|
|
|
114
|
-
for each_resource_name, each_resource in self.
|
|
125
|
+
for each_resource_name, each_resource in self.resources.items():
|
|
115
126
|
# image moves app gen time from 70 -> 130 secs
|
|
116
127
|
example_image_content_unused = [
|
|
117
128
|
{
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Backend JSONAPI endpoint metadata is described in the following <resources> section , each key is a resource collection endpoint name.
|
|
2
|
+
The tab_groups attribute describes the resource relationships, with fks being the foreign keys of the related resource.
|
|
3
|
+
user_key tells which attribute should be shown when referencing the resource. for example, if the user_key is "name", the resource should be be shown by its "name" in the UI, while its reference should be by its "id".
|
|
4
|
+
|
|
5
|
+
<resources></resources>
|
|
6
|
+
|
|
7
|
+
Most of the time, the resource name key will be the same as the type,
|
|
8
|
+
so you can use an instance type to get the resource configuration.
|
|
9
|
+
|
|
10
|
+
ignore SPAPage and SPASection resources.
|
|
11
|
+
|
|
12
|
+
This resource configuration can be used when importing the Config getConf() function in the react code, for example:
|
|
13
|
+
|
|
14
|
+
<javascriptCode>
|
|
15
|
+
import { getConf } from '../../Config';
|
|
16
|
+
const conf = getConf();
|
|
17
|
+
const resources = conf.resources;
|
|
18
|
+
</javascriptCode>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
This JSONAPI is fetched using the react-admin dataProvider (useDataprovider hook).
|
|
2
|
+
All resources have a "type" and "id" attributes (according to the JSONAPI specification).
|
|
3
|
+
|
|
4
|
+
Besides the regular parameters, the dataProvider is extended to interpret the "include" meta parameter to retrieve included relationships.
|
|
5
|
+
|
|
6
|
+
<javascriptCode>
|
|
7
|
+
dataProvider.getList(resourceName, {
|
|
8
|
+
pagination: { page: 1, perPage: 10 },
|
|
9
|
+
meta: { include: ["relationship_name"]}
|
|
10
|
+
})
|
|
11
|
+
</javascriptCode>
|
|
12
|
+
|
|
13
|
+
attributes are inlined in the instance:
|
|
14
|
+
for example, if the resource is "some_resource" and the attribute is "name", then 'some_resource.name' will be the attribute value.
|
|
15
|
+
|
|
16
|
+
included relationships are inlined in the instance:
|
|
17
|
+
for example, if the resource is "some_resource" and the relationship is "relationship_name", the included data will be in the instance "relationship_name" key (some_resource.relationship_name).
|
|
18
|
+
So:
|
|
19
|
+
some_resource.relationship_name.id will be the id of the included (toone) relationship.
|
|
20
|
+
some_resource.relationship_name will be an array of included (tomany) relationships.
|
|
21
|
+
|
|
22
|
+
instances have a "relationships" key, which contains a dictionary of the relationships, for example,
|
|
23
|
+
following is the response for a resource with a tomany relationship named "tomany_relationships_name"
|
|
24
|
+
<json>
|
|
25
|
+
{
|
|
26
|
+
"tomany_relationships_name": {
|
|
27
|
+
"data": [
|
|
28
|
+
{
|
|
29
|
+
"id": "1",
|
|
30
|
+
"type": "Transaction"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"meta": {
|
|
34
|
+
"count": 1,
|
|
35
|
+
"limit": 5,
|
|
36
|
+
"total": 1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"toone_relationsip_name": {
|
|
40
|
+
"data": {
|
|
41
|
+
"id": "1",
|
|
42
|
+
"type": "Customer"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</json>
|
|
47
|
+
|
|
48
|
+
The actual relationship data is in the "data" key of the relationship.
|
|
49
|
+
for example, the 'instance.tomany_relationships_name' will be an array of the instances data of the related resource:
|
|
50
|
+
<json>
|
|
51
|
+
[
|
|
52
|
+
{
|
|
53
|
+
"id": "1",
|
|
54
|
+
"ja_type": "Transaction",
|
|
55
|
+
"attributes": {
|
|
56
|
+
"Type": "withdrawal",
|
|
57
|
+
"account_id": 1,
|
|
58
|
+
"amount": 500,
|
|
59
|
+
"description": "Grocery Shopping",
|
|
60
|
+
"transaction_date": "2022-03-01"
|
|
61
|
+
},
|
|
62
|
+
"Type": "withdrawal",
|
|
63
|
+
"account_id": 1,
|
|
64
|
+
"amount": 500,
|
|
65
|
+
"description": "Grocery Shopping",
|
|
66
|
+
"transaction_date": "2022-03-01",
|
|
67
|
+
"relationships": {
|
|
68
|
+
"account": {
|
|
69
|
+
"data": null
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"account": null
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
</json>
|
|
76
|
+
|
|
77
|
+
similarly, the 'instance.toone_relationship_name' will be the instance data of the related resource:
|
|
78
|
+
<json>
|
|
79
|
+
{
|
|
80
|
+
"id": "1",
|
|
81
|
+
"credit_limit": 10000,
|
|
82
|
+
"first_name": "Alice",
|
|
83
|
+
"last_name": "Brown",
|
|
84
|
+
}
|
|
85
|
+
</json>
|
|
86
|
+
if a toone relationship is empty, it's value will be null.
|
|
87
|
+
|
|
88
|
+
if you want to fetch all related resources, you can use the 'meta: { include: ["+all"]}' parameter in the dataProvider.getList call.
|
|
89
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
api_logic_server_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
api_logic_server_cli/api_logic_server.py,sha256=
|
|
3
|
-
api_logic_server_cli/api_logic_server_info.yaml,sha256=
|
|
2
|
+
api_logic_server_cli/api_logic_server.py,sha256=fU5lBs9fB7FoO7xp4haYugQK_k8Wa25SxEtlHlvUqls,96379
|
|
3
|
+
api_logic_server_cli/api_logic_server_info.yaml,sha256=Rmy2DSMNBLtlV9PP_hqmn2FojD2AAinPVOfnTbwu6oE,128
|
|
4
4
|
api_logic_server_cli/cli.py,sha256=bSc3sj9df94pIx0HyRYKOojOv3M360UNQgieJAgg9IM,85002
|
|
5
5
|
api_logic_server_cli/cli_args_base.py,sha256=lr27KkOB7_WpZwTs7LgiK8LKDIHMKQkoZCTnE99BFxw,3280
|
|
6
6
|
api_logic_server_cli/cli_args_project.py,sha256=I5no_fGRV_ZsK3SuttVDAaQYI4Q5zCjx6LojGkM024w,4645
|
|
@@ -476,7 +476,7 @@ api_logic_server_cli/genai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
476
476
|
api_logic_server_cli/genai/client.py,sha256=36gyz-dqxj4dJj1SGtO9NZsy9-cfnf4d7uahHimwqHk,772
|
|
477
477
|
api_logic_server_cli/genai/genai.py,sha256=rt4XW_xmo-D5fLD8DQBHMjrU7Teflw43S8lR-tJd4KU,47014
|
|
478
478
|
api_logic_server_cli/genai/genai_admin_app copy.py,sha256=d1E6kNVhq-xqhUh2j52V4cOTJxEiZgWhja1_kLJXKX8,4665
|
|
479
|
-
api_logic_server_cli/genai/genai_admin_app.py,sha256=
|
|
479
|
+
api_logic_server_cli/genai/genai_admin_app.py,sha256=Za05GVi_lQHW5n6D_jPcJQ4f4A_MUqOBLODmDXGno7Y,9603
|
|
480
480
|
api_logic_server_cli/genai/genai_fatal_excp.py,sha256=1FmDVcXVRqmG0JMVZ7l4KqMOdpff3KGZ2LPAGtw304Q,179
|
|
481
481
|
api_logic_server_cli/genai/genai_graphics.py,sha256=9ao0os6rUKY5u2caeLtgyDsNEuVQXq4KcKV575fNC58,20610
|
|
482
482
|
api_logic_server_cli/genai/genai_logic_builder.py,sha256=u_89UtrALIfcMtW6p0SZ78lCmwRqerA5igyY2hDvjlk,26150
|
|
@@ -1212,6 +1212,8 @@ api_logic_server_cli/prototypes/manager/system/app_model_editor/venv_setup/venv.
|
|
|
1212
1212
|
api_logic_server_cli/prototypes/manager/system/genai/.DS_Store,sha256=ndrcwHjeXXcVbvjdiQNuyCtmI6m-kvDLoEnr0fFJsuY,6148
|
|
1213
1213
|
api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Resource-Learning-Prompt.md,sha256=VzsqOAnN6cOCWmPtVObNy9VgptJIy88sfOFIa5bgcqw,3562
|
|
1214
1214
|
api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-js-Learning-Prompt.md,sha256=75FA3txqJ1viIyqt9O6nGpi17As7aSgVyUJ1rImriKc,2054
|
|
1215
|
+
api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-config-prompt.md,sha256=fyP8X1q9tM3i6bTVioa7ieM_aTUfk4GPo08aOWZ60-0,932
|
|
1216
|
+
api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-json-api-model-prompt.md,sha256=5Zp9q_lpY225qceQ3UhF4Fyd-85hDKkD-r3BWYmcs6Y,2890
|
|
1215
1217
|
api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/notes.md,sha256=0m0eGWrmznV8s6Z0pegSrceGHXs6pmdnMUK5gaHijVk,187
|
|
1216
1218
|
api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/z-unused-Admin-App-Learning-Prompt.md,sha256=umbU4-AQ42dTshT3m3bmBpu2omYb1eYfT40VCDsuVmc,5297
|
|
1217
1219
|
api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/.DS_Store,sha256=AnV79PLm6F_E6PkLoTv-GaJZpUGP_xdRkNEqrAYGYuE,6148
|
|
@@ -2272,9 +2274,9 @@ api_logic_server_cli/tools/mini_skel/database/system/SAFRSBaseX.py,sha256=p8C7AF
|
|
|
2272
2274
|
api_logic_server_cli/tools/mini_skel/database/system/TestDataBase.py,sha256=U02SYqThsbY5g3DX7XGaiMxjZBuOpzvtPS6RfI1WQFg,371
|
|
2273
2275
|
api_logic_server_cli/tools/mini_skel/logic/declare_logic.py,sha256=fTrlHyqMeZsw_TyEXFa1VlYBL7fzjZab5ONSXO7aApo,175
|
|
2274
2276
|
api_logic_server_cli/tools/mini_skel/logic/load_verify_rules.py,sha256=Rr5bySJpYCZmNPF2h-phcPJ53nAOPcT_ohZpCD93-a0,7530
|
|
2275
|
-
apilogicserver-15.0.
|
|
2276
|
-
apilogicserver-15.0.
|
|
2277
|
-
apilogicserver-15.0.
|
|
2278
|
-
apilogicserver-15.0.
|
|
2279
|
-
apilogicserver-15.0.
|
|
2280
|
-
apilogicserver-15.0.
|
|
2277
|
+
apilogicserver-15.0.23.dist-info/licenses/LICENSE,sha256=67BS7VC-Z8GpaR3wijngQJkHWV04qJrwQArVgn9ldoI,1485
|
|
2278
|
+
apilogicserver-15.0.23.dist-info/METADATA,sha256=eg8g5J_kp79GVy4Ss0BHev7r7zz_5kdQTienVcNYsYU,6553
|
|
2279
|
+
apilogicserver-15.0.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
2280
|
+
apilogicserver-15.0.23.dist-info/entry_points.txt,sha256=KiLloZJ3c_RW-nIDqBtoE0WEsQTnZ3dELwHLWi23LMA,103
|
|
2281
|
+
apilogicserver-15.0.23.dist-info/top_level.txt,sha256=-r0AT_GEApleihg-jIh0OMvzzc0BO1RuhhOpE91H5qI,21
|
|
2282
|
+
apilogicserver-15.0.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|