@solidxai/core-ui 0.1.12-beta.7 → 0.1.12-beta.8
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.
- package/dist/components/auth/AuthLayout.d.ts.map +1 -1
- package/dist/components/auth/AuthLayout.js +19 -17
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +59 -34
- package/dist/components/common/BackendReconnectIndicator.d.ts +6 -0
- package/dist/components/common/BackendReconnectIndicator.d.ts.map +1 -0
- package/dist/components/common/BackendReconnectIndicator.js +25 -0
- package/dist/components/common/BackendReconnectIndicator.js.map +1 -0
- package/dist/components/common/BackendReconnectIndicator.tsx +45 -0
- package/dist/components/common/SettingsComponent.d.ts.map +1 -1
- package/dist/components/common/SettingsComponent.js +7 -3
- package/dist/components/common/SettingsComponent.js.map +1 -1
- package/dist/components/common/SettingsComponent.module.css +144 -12
- package/dist/components/common/SettingsComponent.tsx +22 -3
- package/dist/components/common/SolidAdmin.d.ts.map +1 -1
- package/dist/components/common/SolidAdmin.js +7 -2
- package/dist/components/common/SolidAdmin.js.map +1 -1
- package/dist/components/common/SolidAdmin.tsx +7 -2
- package/dist/components/common/SolidBreadcrumb.d.ts.map +1 -1
- package/dist/components/common/SolidBreadcrumb.js +1 -6
- package/dist/components/common/SolidBreadcrumb.js.map +1 -1
- package/dist/components/common/SolidBreadcrumb.tsx +1 -8
- package/dist/components/common/SolidMaterialSymbol.d.ts +10 -0
- package/dist/components/common/SolidMaterialSymbol.d.ts.map +1 -0
- package/dist/components/common/SolidMaterialSymbol.js +69 -0
- package/dist/components/common/SolidMaterialSymbol.js.map +1 -0
- package/dist/components/common/SolidMaterialSymbol.tsx +96 -0
- package/dist/components/common/SolidToastProvider.d.ts.map +1 -1
- package/dist/components/common/SolidToastProvider.js +14 -1
- package/dist/components/common/SolidToastProvider.js.map +1 -1
- package/dist/components/common/SolidToastProvider.tsx +19 -1
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.module.css +3 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +3 -2
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +14 -18
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js +43 -16
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +24 -2
- package/dist/components/core/form/SolidFormFooter.js +1 -1
- package/dist/components/core/form/SolidFormFooter.js.map +1 -1
- package/dist/components/core/form/SolidFormFooter.tsx +1 -1
- package/dist/components/core/form/SolidFormLayouts.js +1 -1
- package/dist/components/core/form/SolidFormLayouts.js.map +1 -1
- package/dist/components/core/form/SolidFormLayouts.tsx +2 -2
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +120 -56
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +63 -50
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +115 -37
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +36 -35
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +67 -4
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.tsx +89 -7
- package/dist/components/core/form/fields/mediaFieldUtils.d.ts +3 -0
- package/dist/components/core/form/fields/mediaFieldUtils.d.ts.map +1 -0
- package/dist/components/core/form/fields/mediaFieldUtils.js +30 -0
- package/dist/components/core/form/fields/mediaFieldUtils.js.map +1 -0
- package/dist/components/core/form/fields/mediaFieldUtils.ts +45 -0
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js +1 -1
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js.map +1 -1
- package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.tsx +3 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +22 -23
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +13 -7
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.d.ts.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js +16 -11
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +32 -18
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.d.ts.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.js +3 -1
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.js.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +11 -5
- package/dist/components/core/list/SolidDataTable.d.ts.map +1 -1
- package/dist/components/core/list/SolidDataTable.js +3 -2
- package/dist/components/core/list/SolidDataTable.js.map +1 -1
- package/dist/components/core/list/SolidDataTable.tsx +3 -2
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +11 -5
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +15 -8
- package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.js +1 -0
- package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.tsx +1 -0
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +7 -2
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +7 -2
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js +4 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +5 -2
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +2 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +2 -1
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js +4 -1
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +5 -2
- package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
- package/dist/components/core/locales/SolidLocale.js +1 -1
- package/dist/components/core/locales/SolidLocale.js.map +1 -1
- package/dist/components/core/locales/SolidLocale.tsx +1 -0
- package/dist/components/core/model/CreateModel.css +26 -0
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +21 -3
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +45 -4
- package/dist/components/core/model/FieldMetaDataForm.css +82 -0
- package/dist/components/core/model/FieldMetaDataForm.d.ts +1 -0
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +246 -235
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +46 -34
- package/dist/components/core/model/FieldSelector.js +1 -1
- package/dist/components/core/model/FieldSelector.js.map +1 -1
- package/dist/components/core/model/FieldSelector.tsx +1 -1
- package/dist/components/core/model/ModelMetaData.js +1 -1
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.tsx +1 -1
- package/dist/components/core/module/CreateModule.css +55 -2
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +2 -2
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/module/CreateModule.tsx +3 -2
- package/dist/components/core/module/ModuleMetadataExplorer.css +27 -0
- package/dist/components/core/module/ModuleMetadataExplorer.d.ts.map +1 -1
- package/dist/components/core/module/ModuleMetadataExplorer.js +1 -1
- package/dist/components/core/module/ModuleMetadataExplorer.js.map +1 -1
- package/dist/components/core/module/ModuleMetadataExplorer.tsx +1 -0
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +6 -1
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +7 -1
- package/dist/components/layout/AdminHeaderActions.d.ts.map +1 -1
- package/dist/components/layout/AdminHeaderActions.js +10 -9
- package/dist/components/layout/AdminHeaderActions.js.map +1 -1
- package/dist/components/layout/AdminHeaderActions.tsx +2 -0
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +2 -1
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +12 -5
- package/dist/components/layout/SolidMenuItemIcon.d.ts +9 -0
- package/dist/components/layout/SolidMenuItemIcon.d.ts.map +1 -0
- package/dist/components/layout/SolidMenuItemIcon.js +20 -0
- package/dist/components/layout/SolidMenuItemIcon.js.map +1 -0
- package/dist/components/layout/SolidMenuItemIcon.tsx +45 -0
- package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
- package/dist/components/layout/navbar-two-menu.js +6 -7
- package/dist/components/layout/navbar-two-menu.js.map +1 -1
- package/dist/components/layout/navbar-two-menu.tsx +4 -12
- package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.js +30 -2
- package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +38 -1
- package/dist/helpers/backendHealthMonitor.d.ts +39 -0
- package/dist/helpers/backendHealthMonitor.d.ts.map +1 -0
- package/dist/helpers/backendHealthMonitor.js +255 -0
- package/dist/helpers/backendHealthMonitor.js.map +1 -0
- package/dist/helpers/backendHealthMonitor.ts +177 -0
- package/dist/helpers/helpers.d.ts +1 -0
- package/dist/helpers/helpers.d.ts.map +1 -1
- package/dist/helpers/helpers.js +9 -0
- package/dist/helpers/helpers.js.map +1 -1
- package/dist/helpers/helpers.ts +11 -1
- package/dist/helpers/menuItemIcons.d.ts +34 -0
- package/dist/helpers/menuItemIcons.d.ts.map +1 -0
- package/dist/helpers/menuItemIcons.js +144 -0
- package/dist/helpers/menuItemIcons.js.map +1 -0
- package/dist/helpers/menuItemIcons.ts +191 -0
- package/dist/helpers/relationDisplay.d.ts +3 -0
- package/dist/helpers/relationDisplay.d.ts.map +1 -0
- package/dist/helpers/relationDisplay.js +92 -0
- package/dist/helpers/relationDisplay.js.map +1 -0
- package/dist/helpers/relationDisplay.ts +101 -0
- package/dist/helpers/settingsPayload.d.ts +1 -0
- package/dist/helpers/settingsPayload.d.ts.map +1 -1
- package/dist/helpers/settingsPayload.js.map +1 -1
- package/dist/helpers/settingsPayload.ts +1 -0
- package/dist/helpers/solidIcons.d.ts +2 -0
- package/dist/helpers/solidIcons.d.ts.map +1 -1
- package/dist/helpers/solidIcons.js +8 -0
- package/dist/helpers/solidIcons.js.map +1 -1
- package/dist/helpers/solidIcons.tsx +10 -1
- package/dist/helpers/waitForBackendAvailability.d.ts +1 -0
- package/dist/helpers/waitForBackendAvailability.d.ts.map +1 -1
- package/dist/helpers/waitForBackendAvailability.js +35 -22
- package/dist/helpers/waitForBackendAvailability.js.map +1 -1
- package/dist/helpers/waitForBackendAvailability.ts +18 -12
- package/dist/http/solidHttp.d.ts.map +1 -1
- package/dist/http/solidHttp.js +10 -4
- package/dist/http/solidHttp.js.map +1 -1
- package/dist/http/solidHttp.ts +9 -4
- package/dist/redux/api/datasourceIntrospectionApi.d.ts +4 -0
- package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -1
- package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -1
- package/dist/redux/api/datasourceIntrospectionApi.ts +4 -0
- package/dist/redux/api/fetchBaseQuery.d.ts.map +1 -1
- package/dist/redux/api/fetchBaseQuery.js +9 -3
- package/dist/redux/api/fetchBaseQuery.js.map +1 -1
- package/dist/redux/api/fetchBaseQuery.tsx +9 -3
- package/dist/redux/store/StoreProvider.d.ts.map +1 -1
- package/dist/redux/store/StoreProvider.js +4 -3
- package/dist/redux/store/StoreProvider.js.map +1 -1
- package/dist/redux/store/StoreProvider.tsx +4 -3
- package/dist/resources/globals.css +341 -49
- package/dist/resources/solid-custom.css +410 -12
- package/dist/resources/solid-responsive.css +27 -16
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/AppEventListener.d.ts.map +1 -1
- package/dist/routes/AppEventListener.js +23 -0
- package/dist/routes/AppEventListener.js.map +1 -1
- package/dist/routes/AppEventListener.tsx +29 -0
- package/dist/routes/pages/admin/core/DashboardPage.module.css +12 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +306 -3
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +745 -393
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1074 -420
- package/dist/routes/pages/admin/core/DatasourcesPage.css +15 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DatasourcesPage.js +7 -188
- package/dist/routes/pages/admin/core/DatasourcesPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DatasourcesPage.tsx +3 -393
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidHttp.d.ts","sourceRoot":"","sources":["../../src/http/solidHttp.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,+BAErB,CAAC;
|
|
1
|
+
{"version":3,"file":"solidHttp.d.ts","sourceRoot":"","sources":["../../src/http/solidHttp.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,+BAErB,CAAC;AAoCH,eAAO,MAAM,QAAQ,sJAAiB,CAAC;AACvC,eAAO,MAAM,SAAS,4KAAkB,CAAC;AACzC,eAAO,MAAM,QAAQ,4KAAiB,CAAC;AACvC,eAAO,MAAM,UAAU,4KAAmB,CAAC;AAC3C,eAAO,MAAM,WAAW,sJAAoB,CAAC;AAE7C;;;;;;GAMG"}
|
package/dist/http/solidHttp.js
CHANGED
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import axios from "axios";
|
|
38
38
|
import { env } from "../adapters/env";
|
|
39
39
|
import { getSession } from "../adapters/auth";
|
|
40
|
-
import {
|
|
40
|
+
import { backendHealthMonitor } from "../helpers/backendHealthMonitor";
|
|
41
41
|
var baseURL = "".concat(env("NEXT_PUBLIC_BACKEND_API_URL"), "/api");
|
|
42
42
|
/**
|
|
43
43
|
* solidAxios is a preconfigured Axios instance with:
|
|
@@ -73,17 +73,23 @@ solidAxios.interceptors.request.use(function (config) { return __awaiter(void 0,
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}); });
|
|
76
|
-
solidAxios.interceptors.response.use(function (response) {
|
|
76
|
+
solidAxios.interceptors.response.use(function (response) {
|
|
77
|
+
backendHealthMonitor.reportSuccess();
|
|
78
|
+
return response;
|
|
79
|
+
}, function (error) {
|
|
77
80
|
var _a;
|
|
78
81
|
var status = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status;
|
|
79
82
|
var isNetwork = !status || status >= 500;
|
|
80
83
|
if (isNetwork) {
|
|
81
|
-
|
|
84
|
+
backendHealthMonitor.reportFailure({
|
|
82
85
|
status: status !== null && status !== void 0 ? status : "FETCH_ERROR",
|
|
83
|
-
message: "Unable to reach the server.
|
|
86
|
+
message: "Unable to reach the server. Reconnecting...",
|
|
84
87
|
error: error,
|
|
85
88
|
});
|
|
86
89
|
}
|
|
90
|
+
else {
|
|
91
|
+
backendHealthMonitor.reportSuccess();
|
|
92
|
+
}
|
|
87
93
|
return Promise.reject(error);
|
|
88
94
|
});
|
|
89
95
|
export var solidGet = solidAxios.get;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidHttp.js","sourceRoot":"","sources":["../../src/http/solidHttp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"solidHttp.js","sourceRoot":"","sources":["../../src/http/solidHttp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE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AL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,MAAM,CAAC;IACvC,IAAM,SAAS,GAAG,CAAC,MAAM,IAAI,MAAM,IAAI,GAAG,CAAC;IAC3C,IAAI,SAAS,EAAE;QACb,oBAAoB,CAAC,aAAa,CAAC;YACjC,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,aAAa;YAC/B,OAAO,EAAE,6CAA6C;YACtD,KAAK,OAAA;SACN,CAAC,CAAC;KACJ;SAAM;QACL,oBAAoB,CAAC,aAAa,EAAE,CAAC;KACtC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC;AACvC,MAAM,CAAC,IAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC;AACzC,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC;AACvC,MAAM,CAAC,IAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;AAC3C,MAAM,CAAC,IAAM,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC;AAE7C;;;;;;GAMG","sourcesContent":["import axios from \"axios\";\nimport { env } from \"../adapters/env\";\nimport { getSession } from \"../adapters/auth\";\nimport { backendHealthMonitor } from \"../helpers/backendHealthMonitor\";\n\nconst baseURL = `${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api`;\n\n/**\n * solidAxios is a preconfigured Axios instance with:\n * - baseURL from NEXT_PUBLIC_BACKEND_API_URL (VITE_BACKEND_API_URL in Vite)\n * - Authorization header injected from getSession()\n * - Global error event emission on network/5xx failures\n *\n * Usage:\n * import { solidAxios } from \"@solidxai/core-ui\";\n * const res = await solidAxios.get(\"/setting/wrapped\");\n */\nexport const solidAxios = axios.create({\n baseURL,\n});\n\nsolidAxios.interceptors.request.use(async (config) => {\n if (config.url && config.url.startsWith(\"/api\")) {\n const stripped = config.url.replace(/^\\/api(\\/|$)/, \"/\");\n config.url = stripped === \"\" ? \"/\" : stripped;\n }\n const session = await getSession();\n if (session?.user?.accessToken) {\n config.headers = config.headers || {};\n config.headers.Authorization = `Bearer ${session.user.accessToken}`;\n }\n return config;\n});\n\nsolidAxios.interceptors.response.use(\n (response) => {\n backendHealthMonitor.reportSuccess();\n return response;\n },\n (error) => {\n const status = error?.response?.status;\n const isNetwork = !status || status >= 500;\n if (isNetwork) {\n backendHealthMonitor.reportFailure({\n status: status ?? \"FETCH_ERROR\",\n message: \"Unable to reach the server. Reconnecting...\",\n error,\n });\n } else {\n backendHealthMonitor.reportSuccess();\n }\n return Promise.reject(error);\n }\n);\n\nexport const solidGet = solidAxios.get;\nexport const solidPost = solidAxios.post;\nexport const solidPut = solidAxios.put;\nexport const solidPatch = solidAxios.patch;\nexport const solidDelete = solidAxios.delete;\n\n/**\n * Convenience methods when you don't want to import the instance.\n *\n * Usage:\n * import { solidGet, solidPost } from \"@solidxai/core-ui\";\n * const res = await solidGet(\"/setting/wrapped\");\n */\n"]}
|
package/dist/http/solidHttp.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { env } from "../adapters/env";
|
|
3
3
|
import { getSession } from "../adapters/auth";
|
|
4
|
-
import {
|
|
4
|
+
import { backendHealthMonitor } from "../helpers/backendHealthMonitor";
|
|
5
5
|
|
|
6
6
|
const baseURL = `${env("NEXT_PUBLIC_BACKEND_API_URL")}/api`;
|
|
7
7
|
|
|
@@ -33,16 +33,21 @@ solidAxios.interceptors.request.use(async (config) => {
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
solidAxios.interceptors.response.use(
|
|
36
|
-
(response) =>
|
|
36
|
+
(response) => {
|
|
37
|
+
backendHealthMonitor.reportSuccess();
|
|
38
|
+
return response;
|
|
39
|
+
},
|
|
37
40
|
(error) => {
|
|
38
41
|
const status = error?.response?.status;
|
|
39
42
|
const isNetwork = !status || status >= 500;
|
|
40
43
|
if (isNetwork) {
|
|
41
|
-
|
|
44
|
+
backendHealthMonitor.reportFailure({
|
|
42
45
|
status: status ?? "FETCH_ERROR",
|
|
43
|
-
message: "Unable to reach the server.
|
|
46
|
+
message: "Unable to reach the server. Reconnecting...",
|
|
44
47
|
error,
|
|
45
48
|
});
|
|
49
|
+
} else {
|
|
50
|
+
backendHealthMonitor.reportSuccess();
|
|
46
51
|
}
|
|
47
52
|
return Promise.reject(error);
|
|
48
53
|
}
|
|
@@ -35,6 +35,10 @@ export type DatasourceIntrospectionTableRecord = {
|
|
|
35
35
|
suggestedUserKeyField: string;
|
|
36
36
|
columnCount: number;
|
|
37
37
|
physicalColumnCount: number;
|
|
38
|
+
hasPrimaryKey: boolean;
|
|
39
|
+
primaryKeyColumnCount: number;
|
|
40
|
+
primaryKeyColumnNames: string[];
|
|
41
|
+
mappingBlockedReason: string | null;
|
|
38
42
|
};
|
|
39
43
|
export type DatasourceIntrospectionTablesResponse = {
|
|
40
44
|
module: DatasourceIntrospectionBootstrap["module"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasourceIntrospectionApi.d.ts","sourceRoot":"","sources":["../../../src/redux/api/datasourceIntrospectionApi.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,WAAW,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,OAAO,CAAC;QACnB,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,wBAAwB,EAAE,MAAM,GAAG,aAAa,GAAG,cAAc,CAAC;IAClE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"datasourceIntrospectionApi.d.ts","sourceRoot":"","sources":["../../../src/redux/api/datasourceIntrospectionApi.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,WAAW,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,C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cAAA;gBAAO,OAAA,CAAC;oBACxB,GAAG,EAAE,4CAAqC,QAAQ,mBAAgB;oBAClE,MAAM,EAAE,MAAM;iBACf,CAAC;YAHuB,CAGvB;YACF,iBAAiB,EAAE,UAAC,QAAa,IAAK,OAAA,cAAc,CAAyC,QAAQ,CAAC,EAAhE,CAAgE;SACvG,CAAC;QACF,mCAAmC,EAAE,OAAO,CAAC,QAAQ,CAGnD;YACA,KAAK,EAAE,UAAC,EAAwB;oBAAtB,QAAQ,cAAA,EAAE,UAAU,gBAAA;gBAAO,OAAA,CAAC;oBACpC,GAAG,EAAE,4CAAqC,QAAQ,mBAAgB;oBAClE,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,EAAE,UAAU,YAAA,EAAE;iBACrB,CAAC;YAJmC,CAInC;YACF,iBAAiB,EAAE,UAAC,QAAa,IAAK,OAAA,cAAc,CAAyC,QAAQ,CAAC,EAAhE,CAAgE;SACvG,CAAC;KACH,CAAC,EAxFsB,CAwFtB;CACH,CAAC,CAAC;AAEH,MAAM,CACJ,IAAA,2CAA2C,GAQzC,0BAA0B,4CARe,EAC3C,wCAAwC,GAOtC,0BAA0B,yCAPY,EACxC,6CAA6C,GAM3C,0BAA0B,8CANiB,EAC7C,gDAAgD,GAK9C,0BAA0B,iDALoB,EAChD,8CAA8C,GAI5C,0BAA0B,+CAJkB,EAC9C,0DAA0D,GAGxD,0BAA0B,2DAH8B,EAC1D,8CAA8C,GAE5C,0BAA0B,+CAFkB,EAC9C,8CAA8C,GAC5C,0BAA0B,+CADkB,CACjB","sourcesContent":["import { createApi } from \"@reduxjs/toolkit/query/react\";\nimport { baseQueryWithAuth } from \"./fetchBaseQuery\";\n\nexport type DatasourceIntrospectionBootstrap = {\n module: {\n id: number;\n name: string;\n displayName: string;\n description: string;\n defaultDataSource: string;\n };\n datasources: Array<{\n name: string;\n displayName: string;\n type: string;\n envPrefix: string;\n isDefault: boolean;\n synchronize: boolean | null;\n host: string;\n port: number | null;\n database: string;\n }>;\n recommendedDatasourceName: string | null;\n};\n\nexport type DatasourceIntrospectionTableRecord = {\n schema: string | null;\n tableName: string;\n mapped: boolean;\n mappedModelId: number | null;\n mappedModelSingularName: string | null;\n mappedModelDisplayName: string | null;\n mappedModuleId: number | null;\n mappedModuleName: string | null;\n mappedModuleDisplayName: string | null;\n suggestedLegacyTableType: \"none\" | \"existing_id\" | \"generated_id\";\n suggestedBaseClassName: string;\n suggestedIdColumnName: string | null;\n suggestedUserKeyField: string;\n columnCount: number;\n physicalColumnCount: number;\n};\n\nexport type DatasourceIntrospectionTablesResponse = {\n module: DatasourceIntrospectionBootstrap[\"module\"];\n datasource: DatasourceIntrospectionBootstrap[\"datasources\"][number];\n synchronizeBlocked: boolean;\n synchronizeMessage: string | null;\n records: DatasourceIntrospectionTableRecord[];\n meta: {\n totalRecords: number;\n };\n};\n\nexport type DatasourceIntrospectionTableDetail = {\n module: DatasourceIntrospectionBootstrap[\"module\"];\n datasource: DatasourceIntrospectionBootstrap[\"datasources\"][number];\n table: DatasourceIntrospectionTableRecord;\n columns: Array<{\n columnName: string;\n fieldName: string;\n displayName: string;\n dataType: string;\n solidFieldType: string;\n ormType: string;\n nullable: boolean;\n defaultValue: string | null;\n characterMaximumLength: number | null;\n numericPrecision: number | null;\n numericScale: number | null;\n ordinalPosition: number | null;\n isAutoGenerated: boolean;\n isPrimaryKey: boolean;\n handledBySuperclass: boolean;\n superclassFieldName: string | null;\n }>;\n rawDdl: {\n statement: string | null;\n available: boolean;\n note: string | null;\n };\n userKeyCandidates: Array<{\n name: string;\n label: string;\n score: number;\n reason: string;\n isDefault: boolean;\n }>;\n suggestedMetadata: {\n singularName: string;\n pluralName: string;\n displayName: string;\n tableName: string;\n schema: string | null;\n dataSource: string;\n dataSourceType: string;\n legacyTableType: \"none\" | \"existing_id\" | \"generated_id\";\n baseClassName: string;\n userKeyField: string;\n synchronize: false;\n };\n};\n\nexport type DatasourceIntrospectionMappingColumn = {\n columnName: string;\n fieldName: string;\n displayName: string;\n dataType: string;\n solidFieldType: string;\n ormType: string;\n nullable: boolean;\n defaultValue: string | null;\n characterMaximumLength: number | null;\n numericPrecision: number | null;\n numericScale: number | null;\n ordinalPosition: number | null;\n isAutoGenerated: boolean;\n handledBySuperclass: boolean;\n superclassFieldName: string | null;\n fieldId: number | null;\n include: boolean;\n matched: boolean;\n isPrimaryKey: boolean;\n fieldConfig?: Record<string, any> | null;\n};\n\nexport type DatasourceIntrospectionMappingRequest = {\n mapped: boolean;\n modelId: number | null;\n singularName: string;\n pluralName: string;\n displayName: string;\n description: string;\n tableName: string;\n schema: string | null;\n dataSource: string;\n dataSourceType: string;\n legacyTableType: \"none\" | \"existing_id\" | \"generated_id\";\n baseClassName: string;\n userKeyField: string;\n enableAuditTracking: boolean;\n enableSoftDelete: boolean;\n draftPublishWorkflow: boolean;\n internationalisation: boolean;\n plannedMigrationTimestamp?: number | null;\n columns: DatasourceIntrospectionMappingColumn[];\n reviewedModel?: Record<string, any>;\n};\n\nexport type DatasourceIntrospectionMappingPreview = {\n operation: \"create\" | \"update\";\n mappedModelId: number | null;\n metadataJson: {\n filePath: string;\n model: Record<string, any>;\n };\n migration: {\n willGenerate: boolean;\n filePath: string | null;\n fileName: string | null;\n className: string | null;\n timestamp: number | null;\n content: string | null;\n note: string;\n missingSystemColumns: string[];\n };\n summary: {\n includedColumnNames: string[];\n removedColumnNames: string[];\n missingSystemColumns: string[];\n generatedSystemColumnCount: number;\n };\n};\n\nexport type DatasourceIntrospectionApplyResponse = DatasourceIntrospectionMappingPreview & {\n modelId: number | null;\n};\n\nexport type DatasourceIntrospectionCreateMigrationResponse = {\n modelId: number | null;\n operation: \"create\" | \"update\";\n datasourceFile: {\n filePath: string;\n created: boolean;\n updated: boolean;\n entityRegistered: boolean;\n migrationGlobRegistered: boolean;\n };\n migration: DatasourceIntrospectionMappingPreview[\"migration\"] & {\n written: boolean;\n };\n summary: DatasourceIntrospectionMappingPreview[\"summary\"];\n};\n\nexport type DatasourceIntrospectionCommandResponse = {\n moduleId: number;\n datasource?: string;\n command?: string;\n output: string;\n message: string;\n};\n\nfunction unwrapEnvelope<T = any>(payload: any): T {\n let current = payload;\n\n while (\n current\n && typeof current === \"object\"\n && \"data\" in current\n && current.data !== undefined\n ) {\n current = current.data;\n }\n\n return current as T;\n}\n\nexport const datasourceIntrospectionApi = createApi({\n reducerPath: \"datasourceIntrospectionApi\",\n baseQuery: baseQueryWithAuth,\n tagTypes: [\"DatasourceIntrospection\"],\n endpoints: (builder) => ({\n getDatasourceIntrospectionBootstrap: builder.query<DatasourceIntrospectionBootstrap, number>({\n query: (moduleId) => `/datasource-introspection/modules/${moduleId}/bootstrap`,\n providesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionBootstrap>(response),\n }),\n getDatasourceIntrospectionTables: builder.query<\n DatasourceIntrospectionTablesResponse,\n { moduleId: number; datasource: string }\n >({\n query: ({ moduleId, datasource }) =>\n `/datasource-introspection/modules/${moduleId}/tables?datasource=${encodeURIComponent(datasource)}`,\n providesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionTablesResponse>(response),\n }),\n getDatasourceIntrospectionTableDetail: builder.query<\n DatasourceIntrospectionTableDetail,\n { moduleId: number; datasource: string; table: string; schema?: string | null }\n >({\n query: ({ moduleId, datasource, table, schema }) => {\n const searchParams = new URLSearchParams();\n searchParams.set(\"datasource\", datasource);\n searchParams.set(\"table\", table);\n if (schema) {\n searchParams.set(\"schema\", schema);\n }\n\n return `/datasource-introspection/modules/${moduleId}/table-detail?${searchParams.toString()}`;\n },\n providesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionTableDetail>(response),\n }),\n previewDatasourceIntrospectionMapping: builder.mutation<\n DatasourceIntrospectionMappingPreview,\n { moduleId: number; payload: DatasourceIntrospectionMappingRequest }\n >({\n query: ({ moduleId, payload }) => ({\n url: `/datasource-introspection/modules/${moduleId}/mapping-preview`,\n method: \"POST\",\n body: payload,\n }),\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionMappingPreview>(response),\n }),\n applyDatasourceIntrospectionMapping: builder.mutation<\n DatasourceIntrospectionApplyResponse,\n { moduleId: number; payload: DatasourceIntrospectionMappingRequest }\n >({\n query: ({ moduleId, payload }) => ({\n url: `/datasource-introspection/modules/${moduleId}/apply-mapping`,\n method: \"POST\",\n body: payload,\n }),\n invalidatesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionApplyResponse>(response),\n }),\n createDatasourceIntrospectionMigrationArtifacts: builder.mutation<\n DatasourceIntrospectionCreateMigrationResponse,\n { moduleId: number; payload: DatasourceIntrospectionMappingRequest }\n >({\n query: ({ moduleId, payload }) => ({\n url: `/datasource-introspection/modules/${moduleId}/create-migration-artifacts`,\n method: \"POST\",\n body: payload,\n }),\n invalidatesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionCreateMigrationResponse>(response),\n }),\n generateDatasourceIntrospectionCode: builder.mutation<\n DatasourceIntrospectionCommandResponse,\n { moduleId: number }\n >({\n query: ({ moduleId }) => ({\n url: `/datasource-introspection/modules/${moduleId}/generate-code`,\n method: \"POST\",\n }),\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionCommandResponse>(response),\n }),\n runDatasourceIntrospectionMigration: builder.mutation<\n DatasourceIntrospectionCommandResponse,\n { moduleId: number; datasource: string }\n >({\n query: ({ moduleId, datasource }) => ({\n url: `/datasource-introspection/modules/${moduleId}/run-migration`,\n method: \"POST\",\n body: { datasource },\n }),\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionCommandResponse>(response),\n }),\n }),\n});\n\nexport const {\n useGetDatasourceIntrospectionBootstrapQuery,\n useGetDatasourceIntrospectionTablesQuery,\n useGetDatasourceIntrospectionTableDetailQuery,\n usePreviewDatasourceIntrospectionMappingMutation,\n useApplyDatasourceIntrospectionMappingMutation,\n useCreateDatasourceIntrospectionMigrationArtifactsMutation,\n useGenerateDatasourceIntrospectionCodeMutation,\n useRunDatasourceIntrospectionMigrationMutation,\n} = datasourceIntrospectionApi;\n"]}
|
|
1
|
+
{"version":3,"file":"datasourceIntrospectionApi.js","sourceRoot":"","sources":["../../../src/redux/api/datasourceIntrospectionApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA6MrD,SAAS,cAAc,CAAU,OAAY;IAC3C,IAAI,OAAO,GAAG,OAAO,CAAC;IAEtB,OACE,OAAO;WACJ,OAAO,OAAO,KAAK,QAAQ;WAC3B,MAAM,IAAI,OAAO;WACjB,OAAO,CAAC,IAAI,KAAK,SAAS,EAC7B;QACA,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;KACxB;IAED,OAAO,OAAY,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,IAAM,0BAA0B,GAAG,SAAS,CAAC;IAClD,WAAW,EAAE,4BAA4B;IACzC,SAAS,EAAE,iBAAiB;IAC5B,QAAQ,EAAE,CAAC,yBAAyB,CAAC;IACrC,SAAS,EAAE,UAAC,OAAO,IAAK,OAAA,CAAC;QACvB,mCAAmC,EAAE,OAAO,CAAC,KAAK,CAA2C;YAC3F,KAAK,EAAE,UAAC,QAAQ,IAAK,OAAA,4CAAqC,QAAQ,eAAY,EAAzD,CAAyD;YAC9E,YAAY,EAAE,CAAC,yBAAyB,CAAC;YACzC,iBAAiB,EAAE,UAAC,QAAa,IAAK,OAAA,cAAc,CAAmC,QAAQ,CAAC,EAA1D,CAA0D;SACjG,CAAC;QACF,gCAAgC,EAAE,OAAO,CAAC,KAAK,CAG7C;YACA,KAAK,EAAE,UAAC,EAAwB;oBAAtB,QAAQ,cAAA,EAAE,UAAU,gBAAA;gBAC5B,OAAA,4CAAqC,QAAQ,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AE,MAAM;oBACd,IAAI,EAAE,EAAE,UAAU,YAAA,EAAE;iBACrB,CAAC;YAJmC,CAInC;YACF,iBAAiB,EAAE,UAAC,QAAa,IAAK,OAAA,cAAc,CAAyC,QAAQ,CAAC,EAAhE,CAAgE;SACvG,CAAC;KACH,CAAC,EAxFsB,CAwFtB;CACH,CAAC,CAAC;AAEH,MAAM,CACJ,IAAA,2CAA2C,GAQzC,0BAA0B,4CARe,EAC3C,wCAAwC,GAOtC,0BAA0B,yCAPY,EACxC,6CAA6C,GAM3C,0BAA0B,8CANiB,EAC7C,gDAAgD,GAK9C,0BAA0B,iDALoB,EAChD,8CAA8C,GAI5C,0BAA0B,+CAJkB,EAC9C,0DAA0D,GAGxD,0BAA0B,2DAH8B,EAC1D,8CAA8C,GAE5C,0BAA0B,+CAFkB,EAC9C,8CAA8C,GAC5C,0BAA0B,+CADkB,CACjB","sourcesContent":["import { createApi } from \"@reduxjs/toolkit/query/react\";\nimport { baseQueryWithAuth } from \"./fetchBaseQuery\";\n\nexport type DatasourceIntrospectionBootstrap = {\n module: {\n id: number;\n name: string;\n displayName: string;\n description: string;\n defaultDataSource: string;\n };\n datasources: Array<{\n name: string;\n displayName: string;\n type: string;\n envPrefix: string;\n isDefault: boolean;\n synchronize: boolean | null;\n host: string;\n port: number | null;\n database: string;\n }>;\n recommendedDatasourceName: string | null;\n};\n\nexport type DatasourceIntrospectionTableRecord = {\n schema: string | null;\n tableName: string;\n mapped: boolean;\n mappedModelId: number | null;\n mappedModelSingularName: string | null;\n mappedModelDisplayName: string | null;\n mappedModuleId: number | null;\n mappedModuleName: string | null;\n mappedModuleDisplayName: string | null;\n suggestedLegacyTableType: \"none\" | \"existing_id\" | \"generated_id\";\n suggestedBaseClassName: string;\n suggestedIdColumnName: string | null;\n suggestedUserKeyField: string;\n columnCount: number;\n physicalColumnCount: number;\n hasPrimaryKey: boolean;\n primaryKeyColumnCount: number;\n primaryKeyColumnNames: string[];\n mappingBlockedReason: string | null;\n};\n\nexport type DatasourceIntrospectionTablesResponse = {\n module: DatasourceIntrospectionBootstrap[\"module\"];\n datasource: DatasourceIntrospectionBootstrap[\"datasources\"][number];\n synchronizeBlocked: boolean;\n synchronizeMessage: string | null;\n records: DatasourceIntrospectionTableRecord[];\n meta: {\n totalRecords: number;\n };\n};\n\nexport type DatasourceIntrospectionTableDetail = {\n module: DatasourceIntrospectionBootstrap[\"module\"];\n datasource: DatasourceIntrospectionBootstrap[\"datasources\"][number];\n table: DatasourceIntrospectionTableRecord;\n columns: Array<{\n columnName: string;\n fieldName: string;\n displayName: string;\n dataType: string;\n solidFieldType: string;\n ormType: string;\n nullable: boolean;\n defaultValue: string | null;\n characterMaximumLength: number | null;\n numericPrecision: number | null;\n numericScale: number | null;\n ordinalPosition: number | null;\n isAutoGenerated: boolean;\n isPrimaryKey: boolean;\n handledBySuperclass: boolean;\n superclassFieldName: string | null;\n }>;\n rawDdl: {\n statement: string | null;\n available: boolean;\n note: string | null;\n };\n userKeyCandidates: Array<{\n name: string;\n label: string;\n score: number;\n reason: string;\n isDefault: boolean;\n }>;\n suggestedMetadata: {\n singularName: string;\n pluralName: string;\n displayName: string;\n tableName: string;\n schema: string | null;\n dataSource: string;\n dataSourceType: string;\n legacyTableType: \"none\" | \"existing_id\" | \"generated_id\";\n baseClassName: string;\n userKeyField: string;\n synchronize: false;\n };\n};\n\nexport type DatasourceIntrospectionMappingColumn = {\n columnName: string;\n fieldName: string;\n displayName: string;\n dataType: string;\n solidFieldType: string;\n ormType: string;\n nullable: boolean;\n defaultValue: string | null;\n characterMaximumLength: number | null;\n numericPrecision: number | null;\n numericScale: number | null;\n ordinalPosition: number | null;\n isAutoGenerated: boolean;\n handledBySuperclass: boolean;\n superclassFieldName: string | null;\n fieldId: number | null;\n include: boolean;\n matched: boolean;\n isPrimaryKey: boolean;\n fieldConfig?: Record<string, any> | null;\n};\n\nexport type DatasourceIntrospectionMappingRequest = {\n mapped: boolean;\n modelId: number | null;\n singularName: string;\n pluralName: string;\n displayName: string;\n description: string;\n tableName: string;\n schema: string | null;\n dataSource: string;\n dataSourceType: string;\n legacyTableType: \"none\" | \"existing_id\" | \"generated_id\";\n baseClassName: string;\n userKeyField: string;\n enableAuditTracking: boolean;\n enableSoftDelete: boolean;\n draftPublishWorkflow: boolean;\n internationalisation: boolean;\n plannedMigrationTimestamp?: number | null;\n columns: DatasourceIntrospectionMappingColumn[];\n reviewedModel?: Record<string, any>;\n};\n\nexport type DatasourceIntrospectionMappingPreview = {\n operation: \"create\" | \"update\";\n mappedModelId: number | null;\n metadataJson: {\n filePath: string;\n model: Record<string, any>;\n };\n migration: {\n willGenerate: boolean;\n filePath: string | null;\n fileName: string | null;\n className: string | null;\n timestamp: number | null;\n content: string | null;\n note: string;\n missingSystemColumns: string[];\n };\n summary: {\n includedColumnNames: string[];\n removedColumnNames: string[];\n missingSystemColumns: string[];\n generatedSystemColumnCount: number;\n };\n};\n\nexport type DatasourceIntrospectionApplyResponse = DatasourceIntrospectionMappingPreview & {\n modelId: number | null;\n};\n\nexport type DatasourceIntrospectionCreateMigrationResponse = {\n modelId: number | null;\n operation: \"create\" | \"update\";\n datasourceFile: {\n filePath: string;\n created: boolean;\n updated: boolean;\n entityRegistered: boolean;\n migrationGlobRegistered: boolean;\n };\n migration: DatasourceIntrospectionMappingPreview[\"migration\"] & {\n written: boolean;\n };\n summary: DatasourceIntrospectionMappingPreview[\"summary\"];\n};\n\nexport type DatasourceIntrospectionCommandResponse = {\n moduleId: number;\n datasource?: string;\n command?: string;\n output: string;\n message: string;\n};\n\nfunction unwrapEnvelope<T = any>(payload: any): T {\n let current = payload;\n\n while (\n current\n && typeof current === \"object\"\n && \"data\" in current\n && current.data !== undefined\n ) {\n current = current.data;\n }\n\n return current as T;\n}\n\nexport const datasourceIntrospectionApi = createApi({\n reducerPath: \"datasourceIntrospectionApi\",\n baseQuery: baseQueryWithAuth,\n tagTypes: [\"DatasourceIntrospection\"],\n endpoints: (builder) => ({\n getDatasourceIntrospectionBootstrap: builder.query<DatasourceIntrospectionBootstrap, number>({\n query: (moduleId) => `/datasource-introspection/modules/${moduleId}/bootstrap`,\n providesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionBootstrap>(response),\n }),\n getDatasourceIntrospectionTables: builder.query<\n DatasourceIntrospectionTablesResponse,\n { moduleId: number; datasource: string }\n >({\n query: ({ moduleId, datasource }) =>\n `/datasource-introspection/modules/${moduleId}/tables?datasource=${encodeURIComponent(datasource)}`,\n providesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionTablesResponse>(response),\n }),\n getDatasourceIntrospectionTableDetail: builder.query<\n DatasourceIntrospectionTableDetail,\n { moduleId: number; datasource: string; table: string; schema?: string | null }\n >({\n query: ({ moduleId, datasource, table, schema }) => {\n const searchParams = new URLSearchParams();\n searchParams.set(\"datasource\", datasource);\n searchParams.set(\"table\", table);\n if (schema) {\n searchParams.set(\"schema\", schema);\n }\n\n return `/datasource-introspection/modules/${moduleId}/table-detail?${searchParams.toString()}`;\n },\n providesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionTableDetail>(response),\n }),\n previewDatasourceIntrospectionMapping: builder.mutation<\n DatasourceIntrospectionMappingPreview,\n { moduleId: number; payload: DatasourceIntrospectionMappingRequest }\n >({\n query: ({ moduleId, payload }) => ({\n url: `/datasource-introspection/modules/${moduleId}/mapping-preview`,\n method: \"POST\",\n body: payload,\n }),\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionMappingPreview>(response),\n }),\n applyDatasourceIntrospectionMapping: builder.mutation<\n DatasourceIntrospectionApplyResponse,\n { moduleId: number; payload: DatasourceIntrospectionMappingRequest }\n >({\n query: ({ moduleId, payload }) => ({\n url: `/datasource-introspection/modules/${moduleId}/apply-mapping`,\n method: \"POST\",\n body: payload,\n }),\n invalidatesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionApplyResponse>(response),\n }),\n createDatasourceIntrospectionMigrationArtifacts: builder.mutation<\n DatasourceIntrospectionCreateMigrationResponse,\n { moduleId: number; payload: DatasourceIntrospectionMappingRequest }\n >({\n query: ({ moduleId, payload }) => ({\n url: `/datasource-introspection/modules/${moduleId}/create-migration-artifacts`,\n method: \"POST\",\n body: payload,\n }),\n invalidatesTags: [\"DatasourceIntrospection\"],\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionCreateMigrationResponse>(response),\n }),\n generateDatasourceIntrospectionCode: builder.mutation<\n DatasourceIntrospectionCommandResponse,\n { moduleId: number }\n >({\n query: ({ moduleId }) => ({\n url: `/datasource-introspection/modules/${moduleId}/generate-code`,\n method: \"POST\",\n }),\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionCommandResponse>(response),\n }),\n runDatasourceIntrospectionMigration: builder.mutation<\n DatasourceIntrospectionCommandResponse,\n { moduleId: number; datasource: string }\n >({\n query: ({ moduleId, datasource }) => ({\n url: `/datasource-introspection/modules/${moduleId}/run-migration`,\n method: \"POST\",\n body: { datasource },\n }),\n transformResponse: (response: any) => unwrapEnvelope<DatasourceIntrospectionCommandResponse>(response),\n }),\n }),\n});\n\nexport const {\n useGetDatasourceIntrospectionBootstrapQuery,\n useGetDatasourceIntrospectionTablesQuery,\n useGetDatasourceIntrospectionTableDetailQuery,\n usePreviewDatasourceIntrospectionMappingMutation,\n useApplyDatasourceIntrospectionMappingMutation,\n useCreateDatasourceIntrospectionMigrationArtifactsMutation,\n useGenerateDatasourceIntrospectionCodeMutation,\n useRunDatasourceIntrospectionMigrationMutation,\n} = datasourceIntrospectionApi;\n"]}
|
|
@@ -39,6 +39,10 @@ export type DatasourceIntrospectionTableRecord = {
|
|
|
39
39
|
suggestedUserKeyField: string;
|
|
40
40
|
columnCount: number;
|
|
41
41
|
physicalColumnCount: number;
|
|
42
|
+
hasPrimaryKey: boolean;
|
|
43
|
+
primaryKeyColumnCount: number;
|
|
44
|
+
primaryKeyColumnNames: string[];
|
|
45
|
+
mappingBlockedReason: string | null;
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
export type DatasourceIntrospectionTablesResponse = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchBaseQuery.d.ts","sourceRoot":"","sources":["../../../src/redux/api/fetchBaseQuery.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAiCpH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CACzC,MAAM,GAAG,SAAS,EAClB,OAAO,EACP,mBAAmB,EACnB,EAAE,EACF,kBAAkB,
|
|
1
|
+
{"version":3,"file":"fetchBaseQuery.d.ts","sourceRoot":"","sources":["../../../src/redux/api/fetchBaseQuery.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAiCpH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CACzC,MAAM,GAAG,SAAS,EAClB,OAAO,EACP,mBAAmB,EACnB,EAAE,EACF,kBAAkB,CA+BnB,CAAC"}
|
|
@@ -37,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import { fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
|
38
38
|
import { getSession } from "../../adapters/auth/index";
|
|
39
39
|
import { env } from "../../adapters/env";
|
|
40
|
-
import {
|
|
40
|
+
import { backendHealthMonitor } from "../../helpers/backendHealthMonitor";
|
|
41
41
|
// Base URL for the API endpoints
|
|
42
42
|
var baseUrl = "".concat(env("NEXT_PUBLIC_BACKEND_API_URL"), "/api");
|
|
43
43
|
// logger.debug(`fetchBaseQuery resolved baseUrl to ${baseUrl}`);
|
|
@@ -75,18 +75,24 @@ export var baseQueryWithAuth = function (args, api, extraOptions) { return __awa
|
|
|
75
75
|
case 0: return [4 /*yield*/, rawBaseQuery(args, api, extraOptions)];
|
|
76
76
|
case 1:
|
|
77
77
|
result = _a.sent();
|
|
78
|
+
if (!result.error) {
|
|
79
|
+
backendHealthMonitor.reportSuccess();
|
|
80
|
+
}
|
|
78
81
|
if (result.error) {
|
|
79
82
|
status_1 = result.error.status;
|
|
80
83
|
isNetwork = status_1 === "FETCH_ERROR" ||
|
|
81
84
|
status_1 === "PARSING_ERROR" ||
|
|
82
85
|
(typeof status_1 === "number" && status_1 >= 500);
|
|
83
86
|
if (isNetwork) {
|
|
84
|
-
|
|
87
|
+
backendHealthMonitor.reportFailure({
|
|
85
88
|
status: status_1,
|
|
86
|
-
message: "Unable to reach the server.
|
|
89
|
+
message: "Unable to reach the server. Reconnecting...",
|
|
87
90
|
error: result.error,
|
|
88
91
|
});
|
|
89
92
|
}
|
|
93
|
+
else {
|
|
94
|
+
backendHealthMonitor.reportSuccess();
|
|
95
|
+
}
|
|
90
96
|
}
|
|
91
97
|
return [2 /*return*/, result];
|
|
92
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchBaseQuery.js","sourceRoot":"","sources":["../../../src/redux/api/fetchBaseQuery.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"fetchBaseQuery.js","sourceRoot":"","sources":["../../../src/redux/api/fetchBaseQuery.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,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CAAC,KAAa,CAAC,MAAM,CAAC;oBACtC,SAAS,GACb,QAAM,KAAK,aAAa;wBACxB,QAAM,KAAK,eAAe;wBAC1B,CAAC,OAAO,QAAM,KAAK,QAAQ,IAAI,QAAM,IAAI,GAAG,CAAC,CAAC;oBAEhD,IAAI,SAAS,EAAE;wBACb,oBAAoB,CAAC,aAAa,CAAC;4BACjC,MAAM,UAAA;4BACN,OAAO,EAAE,6CAA6C;4BACtD,KAAK,EAAE,MAAM,CAAC,KAAK;yBACpB,CAAC,CAAC;qBACJ;yBAAM;wBACL,oBAAoB,CAAC,aAAa,EAAE,CAAC;qBACtC;iBACF;gBAED,sBAAO,MAAM,EAAC;;;KACf,CAAC","sourcesContent":["import { fetchBaseQuery } from \"@reduxjs/toolkit/query/react\";\nimport type { BaseQueryFn, FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta } from \"@reduxjs/toolkit/query/react\";\nimport { getSession } from \"../../adapters/auth/index\";\nimport { env } from \"../../adapters/env\";\nimport { logger } from \"../../helpers/logger\";\nimport { backendHealthMonitor } from \"../../helpers/backendHealthMonitor\";\n\n// Base URL for the API endpoints\nconst baseUrl = `${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api`;\n// logger.debug(`fetchBaseQuery resolved baseUrl to ${baseUrl}`);\n\n\nconst rawBaseQuery = fetchBaseQuery({\n baseUrl,\n prepareHeaders: async (headers) => {\n // Fetch session data\n const session = await getSession();\n if (session?.user?.accessToken) {\n // Add access token to headers\n headers.set('authorization', `Bearer ${session?.user?.accessToken}`);\n }\n\n if (session?.user?.accessToken) {\n headers.set(\"authorization\", `Bearer ${session.user.accessToken}`);\n // logger.debug(\"[prepareHeaders] set auth header\");\n } else {\n // logger.debug(\"[prepareHeaders] no access token\");\n }\n\n // logger.debug(\"[prepareHeaders] end\");\n return headers;\n },\n});\n\nexport const baseQueryWithAuth: BaseQueryFn<\n string | FetchArgs,\n unknown,\n FetchBaseQueryError,\n {},\n FetchBaseQueryMeta\n> = async (\n args,\n api,\n extraOptions\n) => {\n const result = await rawBaseQuery(args, api, extraOptions);\n\n if (!result.error) {\n backendHealthMonitor.reportSuccess();\n }\n\n if (result.error) {\n const status = (result.error as any).status;\n const isNetwork =\n status === \"FETCH_ERROR\" ||\n status === \"PARSING_ERROR\" ||\n (typeof status === \"number\" && status >= 500);\n\n if (isNetwork) {\n backendHealthMonitor.reportFailure({\n status,\n message: \"Unable to reach the server. Reconnecting...\",\n error: result.error,\n });\n } else {\n backendHealthMonitor.reportSuccess();\n }\n }\n\n return result;\n};\n"]}
|
|
@@ -3,7 +3,7 @@ import type { BaseQueryFn, FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta }
|
|
|
3
3
|
import { getSession } from "../../adapters/auth/index";
|
|
4
4
|
import { env } from "../../adapters/env";
|
|
5
5
|
import { logger } from "../../helpers/logger";
|
|
6
|
-
import {
|
|
6
|
+
import { backendHealthMonitor } from "../../helpers/backendHealthMonitor";
|
|
7
7
|
|
|
8
8
|
// Base URL for the API endpoints
|
|
9
9
|
const baseUrl = `${env("NEXT_PUBLIC_BACKEND_API_URL")}/api`;
|
|
@@ -45,6 +45,10 @@ export const baseQueryWithAuth: BaseQueryFn<
|
|
|
45
45
|
) => {
|
|
46
46
|
const result = await rawBaseQuery(args, api, extraOptions);
|
|
47
47
|
|
|
48
|
+
if (!result.error) {
|
|
49
|
+
backendHealthMonitor.reportSuccess();
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
if (result.error) {
|
|
49
53
|
const status = (result.error as any).status;
|
|
50
54
|
const isNetwork =
|
|
@@ -53,11 +57,13 @@ export const baseQueryWithAuth: BaseQueryFn<
|
|
|
53
57
|
(typeof status === "number" && status >= 500);
|
|
54
58
|
|
|
55
59
|
if (isNetwork) {
|
|
56
|
-
|
|
60
|
+
backendHealthMonitor.reportFailure({
|
|
57
61
|
status,
|
|
58
|
-
message: "Unable to reach the server.
|
|
62
|
+
message: "Unable to reach the server. Reconnecting...",
|
|
59
63
|
error: result.error,
|
|
60
64
|
});
|
|
65
|
+
} else {
|
|
66
|
+
backendHealthMonitor.reportSuccess();
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreProvider.d.ts","sourceRoot":"","sources":["../../../src/redux/store/StoreProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AAYvE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC3E,WAAW,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;CAClF,
|
|
1
|
+
{"version":3,"file":"StoreProvider.d.ts","sourceRoot":"","sources":["../../../src/redux/store/StoreProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AAYvE,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC3E,WAAW,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;CAClF,2CAqCA"}
|
|
@@ -38,7 +38,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
38
38
|
import { useEffect, useMemo, useState } from "react";
|
|
39
39
|
import { Provider } from "react-redux";
|
|
40
40
|
import { createSolidStore } from "./createSolidStore";
|
|
41
|
-
import {
|
|
41
|
+
import { backendHealthMonitor } from "../../helpers/backendHealthMonitor";
|
|
42
42
|
import { solidGet } from "../../http/solidHttp";
|
|
43
43
|
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
44
44
|
function fetchEntities() {
|
|
@@ -66,13 +66,14 @@ export function StoreProvider(_a) {
|
|
|
66
66
|
.then(function (entities) {
|
|
67
67
|
if (!mounted)
|
|
68
68
|
return;
|
|
69
|
+
backendHealthMonitor.reportSuccess();
|
|
69
70
|
setStore(createSolidStore({ entities: entities, reducers: reducers, middlewares: middlewares }));
|
|
70
71
|
})
|
|
71
72
|
.catch(function () {
|
|
72
73
|
if (!mounted)
|
|
73
74
|
return;
|
|
74
|
-
|
|
75
|
-
message: "Unable to reach the server.
|
|
75
|
+
backendHealthMonitor.reportFailure({
|
|
76
|
+
message: "Unable to reach the server. Reconnecting...",
|
|
76
77
|
});
|
|
77
78
|
setStore(createSolidStore({ entities: [], reducers: reducers, middlewares: middlewares }));
|
|
78
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreProvider.js","sourceRoot":"","sources":["../../../src/redux/store/StoreProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StoreProvider.js","sourceRoot":"","sources":["../../../src/redux/store/StoreProvider.tsx"],"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W,aAAA,EAAE,CAAC,CAAC,CAAC;QAClE,CAAC,CAAC;aACD,KAAK,CAAC;YACL,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,oBAAoB,CAAC,aAAa,CAAC;gBACjC,OAAO,EAAE,6CAA6C;aACvD,CAAC,CAAC;YACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,UAAA,EAAE,WAAW,aAAA,EAAE,CAAC,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEL,OAAO;YACL,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAE5B,IAAM,OAAO,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,CACL,KAAC,iBAAiB,IAChB,KAAK,EAAC,qBAAqB,EAC3B,WAAW,EAAC,wEAAwE,GACpF,CACH,CAAC;SACH;QACD,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAY,CAAC;IACvD,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtB,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { Provider } from \"react-redux\";\nimport { createSolidStore, type SolidStore } from \"./createSolidStore\";\nimport { backendHealthMonitor } from \"../../helpers/backendHealthMonitor\";\nimport { solidGet } from \"../../http/solidHttp\";\nimport { SolidLoadingState } from \"../../components/common/SolidLoadingState\";\n\nasync function fetchEntities(): Promise<string[]> {\n const response = await solidGet(\"/model-metadata/public\");\n const data = response?.data;\n const records = data?.data?.records || [];\n return records.map((r: { singularName: string }) => r.singularName);\n}\n\nexport function StoreProvider({\n children,\n reducers,\n middlewares,\n}: {\n children: ReactNode;\n reducers?: NonNullable<Parameters<typeof createSolidStore>[0]>[\"reducers\"];\n middlewares?: NonNullable<Parameters<typeof createSolidStore>[0]>[\"middlewares\"];\n}) {\n const [store, setStore] = useState<SolidStore | null>(null);\n\n useEffect(() => {\n let mounted = true;\n fetchEntities()\n .then((entities) => {\n if (!mounted) return;\n backendHealthMonitor.reportSuccess();\n setStore(createSolidStore({ entities, reducers, middlewares }));\n })\n .catch(() => {\n if (!mounted) return;\n backendHealthMonitor.reportFailure({\n message: \"Unable to reach the server. Reconnecting...\",\n });\n setStore(createSolidStore({ entities: [], reducers, middlewares }));\n });\n\n return () => {\n mounted = false;\n };\n }, [reducers, middlewares]);\n\n const content = useMemo(() => {\n if (!store) {\n return (\n <SolidLoadingState\n title=\"Preparing workspace\"\n description=\"We are loading the application shell and getting your workspace ready.\"\n />\n );\n }\n return <Provider store={store}>{children}</Provider>;\n }, [store, children]);\n\n return content;\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from "react";
|
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { Provider } from "react-redux";
|
|
4
4
|
import { createSolidStore, type SolidStore } from "./createSolidStore";
|
|
5
|
-
import {
|
|
5
|
+
import { backendHealthMonitor } from "../../helpers/backendHealthMonitor";
|
|
6
6
|
import { solidGet } from "../../http/solidHttp";
|
|
7
7
|
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
8
8
|
|
|
@@ -29,12 +29,13 @@ export function StoreProvider({
|
|
|
29
29
|
fetchEntities()
|
|
30
30
|
.then((entities) => {
|
|
31
31
|
if (!mounted) return;
|
|
32
|
+
backendHealthMonitor.reportSuccess();
|
|
32
33
|
setStore(createSolidStore({ entities, reducers, middlewares }));
|
|
33
34
|
})
|
|
34
35
|
.catch(() => {
|
|
35
36
|
if (!mounted) return;
|
|
36
|
-
|
|
37
|
-
message: "Unable to reach the server.
|
|
37
|
+
backendHealthMonitor.reportFailure({
|
|
38
|
+
message: "Unable to reach the server. Reconnecting...",
|
|
38
39
|
});
|
|
39
40
|
setStore(createSolidStore({ entities: [], reducers, middlewares }));
|
|
40
41
|
});
|