ApiLogicServer 15.0.20__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 +41 -13
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Resource-Learning-Prompt.md +119 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-js-Learning-Prompt.md +71 -0
- 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
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/{Admin-App-Learning-Prompt.md → z-unused-Admin-App-Learning-Prompt.md} +33 -24
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/package.json +3 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/Config.js +527 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/app_loader.js +24 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/.eslintrc +5 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/.yarnrc.yml +4 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/default-settings.js +25 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/default-settings.ts +25 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/errors.js +116 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/errors.ts +116 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/index.test.tsx +7 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/index.tsx +11 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/ra-jsonapi-client.js +577 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/ra-jsonapi-client.ts +577 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/resourceLookup.js +124 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/resourceLookup.ts +124 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/styles.module.css +9 -0
- {apilogicserver-15.0.20.dist-info → apilogicserver-15.0.23.dist-info}/METADATA +1 -1
- {apilogicserver-15.0.20.dist-info → apilogicserver-15.0.23.dist-info}/RECORD +30 -12
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/dataProvider.js +0 -110
- {apilogicserver-15.0.20.dist-info → apilogicserver-15.0.23.dist-info}/WHEEL +0 -0
- {apilogicserver-15.0.20.dist-info → apilogicserver-15.0.23.dist-info}/entry_points.txt +0 -0
- {apilogicserver-15.0.20.dist-info → apilogicserver-15.0.23.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-15.0.20.dist-info → apilogicserver-15.0.23.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { HttpError, useNotify } from "react-admin";
|
|
2
|
+
|
|
3
|
+
export class NotImplementedError extends Error {
|
|
4
|
+
constructor(message: string) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.message = message;
|
|
7
|
+
this.name = "NotImplementedError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class SafrsHttpError extends HttpError {
|
|
12
|
+
constructor(message: string, status: number, body: any) {
|
|
13
|
+
super(message, status, body);
|
|
14
|
+
this.name = "SafrsHttpError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const safrsErrorHandler: HttpErrorHandler = (
|
|
19
|
+
httpError: HttpError
|
|
20
|
+
): HttpError => {
|
|
21
|
+
/* Example Safrs Error message
|
|
22
|
+
{
|
|
23
|
+
"errors": [
|
|
24
|
+
{
|
|
25
|
+
"title": "Request forbidden -- authorization will not help",
|
|
26
|
+
"detail": "",
|
|
27
|
+
"code": "403"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
} */
|
|
31
|
+
interface err {
|
|
32
|
+
title?: string;
|
|
33
|
+
detail?: string;
|
|
34
|
+
code?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
Example Safrs Error message
|
|
39
|
+
{"errors": [
|
|
40
|
+
{
|
|
41
|
+
"title": "Generic Error: Invalid Relationship 'REL'",
|
|
42
|
+
"detail": "Generic Error: Invalid Relationship 'REL'",
|
|
43
|
+
"code": "400"}]
|
|
44
|
+
}
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
const errors: { errors: err[] } = httpError.body || httpError.message?.body; // JSON.parse(httpError.body.stringify);
|
|
48
|
+
console.warn("safrsErrorHandler", httpError)
|
|
49
|
+
console.warn("safrsErrorHandler errors", errors)
|
|
50
|
+
console.warn("safrsErrorHandler body, status", httpError.body, httpError.status);
|
|
51
|
+
console.warn("safrsErrorHandler2", errors);
|
|
52
|
+
if (errors?.errors?.length > 0) {
|
|
53
|
+
console.warn(`Data error ${errors.errors[0].title}`);
|
|
54
|
+
|
|
55
|
+
return new SafrsHttpError(
|
|
56
|
+
errors.errors[0].title || errors.errors[0].detail || "Unknown Error",
|
|
57
|
+
httpError.status,
|
|
58
|
+
errors.errors[0].code
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.log("safrsErrorHandler - not a safrs error", errors);
|
|
63
|
+
|
|
64
|
+
if(httpError.status === 403){
|
|
65
|
+
return new SafrsHttpError(
|
|
66
|
+
"Request forbidden -- authorization will not help",
|
|
67
|
+
httpError.status,
|
|
68
|
+
""
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if(httpError.status === 422 || httpError.status === 422){
|
|
73
|
+
// Change 422 to 403 to prevent the make react-admin redirect to the login page
|
|
74
|
+
return new SafrsHttpError(
|
|
75
|
+
"422 - Request forbidden -- auth error " +JSON.stringify(httpError.body),
|
|
76
|
+
403,
|
|
77
|
+
""
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if(httpError.status === 401){
|
|
82
|
+
// Change 422 to 403 to prevent the make react-admin redirect to the login page
|
|
83
|
+
return new SafrsHttpError(
|
|
84
|
+
"401 - Unauthorized " +JSON.stringify(httpError.body),
|
|
85
|
+
401,
|
|
86
|
+
""
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if(httpError.status === 600){
|
|
91
|
+
// Custom WG error message when the backend is starting up but not ready yet
|
|
92
|
+
return new SafrsHttpError(
|
|
93
|
+
httpError.body.message,
|
|
94
|
+
600,
|
|
95
|
+
httpError.body
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if(httpError.body){
|
|
100
|
+
return new SafrsHttpError(
|
|
101
|
+
httpError.body.message,
|
|
102
|
+
httpError.status,
|
|
103
|
+
httpError.body
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return new SafrsHttpError(
|
|
108
|
+
"Unknown Error..",
|
|
109
|
+
httpError.status,
|
|
110
|
+
"")
|
|
111
|
+
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export interface HttpErrorHandler {
|
|
115
|
+
(httpError: HttpError): HttpError;
|
|
116
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { HttpError, useNotify } from "react-admin";
|
|
2
|
+
|
|
3
|
+
export class NotImplementedError extends Error {
|
|
4
|
+
constructor(message: string) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.message = message;
|
|
7
|
+
this.name = "NotImplementedError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class SafrsHttpError extends HttpError {
|
|
12
|
+
constructor(message: string, status: number, body: any) {
|
|
13
|
+
super(message, status, body);
|
|
14
|
+
this.name = "SafrsHttpError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const safrsErrorHandler: HttpErrorHandler = (
|
|
19
|
+
httpError: HttpError
|
|
20
|
+
): HttpError => {
|
|
21
|
+
/* Example Safrs Error message
|
|
22
|
+
{
|
|
23
|
+
"errors": [
|
|
24
|
+
{
|
|
25
|
+
"title": "Request forbidden -- authorization will not help",
|
|
26
|
+
"detail": "",
|
|
27
|
+
"code": "403"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
} */
|
|
31
|
+
interface err {
|
|
32
|
+
title?: string;
|
|
33
|
+
detail?: string;
|
|
34
|
+
code?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
Example Safrs Error message
|
|
39
|
+
{"errors": [
|
|
40
|
+
{
|
|
41
|
+
"title": "Generic Error: Invalid Relationship 'REL'",
|
|
42
|
+
"detail": "Generic Error: Invalid Relationship 'REL'",
|
|
43
|
+
"code": "400"}]
|
|
44
|
+
}
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
const errors: { errors: err[] } = httpError.body || httpError.message?.body; // JSON.parse(httpError.body.stringify);
|
|
48
|
+
console.warn("safrsErrorHandler", httpError)
|
|
49
|
+
console.warn("safrsErrorHandler errors", errors)
|
|
50
|
+
console.warn("safrsErrorHandler body, status", httpError.body, httpError.status);
|
|
51
|
+
console.warn("safrsErrorHandler2", errors);
|
|
52
|
+
if (errors?.errors?.length > 0) {
|
|
53
|
+
console.warn(`Data error ${errors.errors[0].title}`);
|
|
54
|
+
|
|
55
|
+
return new SafrsHttpError(
|
|
56
|
+
errors.errors[0].title || errors.errors[0].detail || "Unknown Error",
|
|
57
|
+
httpError.status,
|
|
58
|
+
errors.errors[0].code
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.log("safrsErrorHandler - not a safrs error", errors);
|
|
63
|
+
|
|
64
|
+
if(httpError.status === 403){
|
|
65
|
+
return new SafrsHttpError(
|
|
66
|
+
"Request forbidden -- authorization will not help",
|
|
67
|
+
httpError.status,
|
|
68
|
+
""
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if(httpError.status === 422 || httpError.status === 422){
|
|
73
|
+
// Change 422 to 403 to prevent the make react-admin redirect to the login page
|
|
74
|
+
return new SafrsHttpError(
|
|
75
|
+
"422 - Request forbidden -- auth error " +JSON.stringify(httpError.body),
|
|
76
|
+
403,
|
|
77
|
+
""
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if(httpError.status === 401){
|
|
82
|
+
// Change 422 to 403 to prevent the make react-admin redirect to the login page
|
|
83
|
+
return new SafrsHttpError(
|
|
84
|
+
"401 - Unauthorized " +JSON.stringify(httpError.body),
|
|
85
|
+
401,
|
|
86
|
+
""
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if(httpError.status === 600){
|
|
91
|
+
// Custom WG error message when the backend is starting up but not ready yet
|
|
92
|
+
return new SafrsHttpError(
|
|
93
|
+
httpError.body.message,
|
|
94
|
+
600,
|
|
95
|
+
httpError.body
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if(httpError.body){
|
|
100
|
+
return new SafrsHttpError(
|
|
101
|
+
httpError.body.message,
|
|
102
|
+
httpError.status,
|
|
103
|
+
httpError.body
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return new SafrsHttpError(
|
|
108
|
+
"Unknown Error..",
|
|
109
|
+
httpError.status,
|
|
110
|
+
"")
|
|
111
|
+
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export interface HttpErrorHandler {
|
|
115
|
+
(httpError: HttpError): HttpError;
|
|
116
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// import styles from './styles.module.css'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const ExampleComponent = ({ text }: Props) => {
|
|
9
|
+
// return <div className={styles.test}>Example Component: {text}</div>
|
|
10
|
+
return <div>Example Component: {text}</div>;
|
|
11
|
+
};
|