@qwickapps/server 1.7.1 → 1.8.0
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/CHANGELOG.md +46 -0
- package/dist/src/core/control-panel.js +5 -5
- package/dist/src/core/control-panel.js.map +1 -1
- package/dist/src/core/gateway.d.ts.map +1 -1
- package/dist/src/core/gateway.js +117 -15
- package/dist/src/core/gateway.js.map +1 -1
- package/dist/src/core/plugin-registry.d.ts +70 -0
- package/dist/src/core/plugin-registry.d.ts.map +1 -1
- package/dist/src/core/plugin-registry.js +94 -0
- package/dist/src/core/plugin-registry.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/plugins/api-keys/api-keys-plugin.d.ts +5 -2
- package/dist/src/plugins/api-keys/api-keys-plugin.d.ts.map +1 -1
- package/dist/src/plugins/api-keys/api-keys-plugin.js +113 -19
- package/dist/src/plugins/api-keys/api-keys-plugin.js.map +1 -1
- package/dist/src/plugins/api-keys/index.d.ts +1 -5
- package/dist/src/plugins/api-keys/index.d.ts.map +1 -1
- package/dist/src/plugins/api-keys/index.js +2 -3
- package/dist/src/plugins/api-keys/index.js.map +1 -1
- package/dist/src/plugins/api-keys/stores/postgres-store.d.ts.map +1 -1
- package/dist/src/plugins/api-keys/stores/postgres-store.js +83 -65
- package/dist/src/plugins/api-keys/stores/postgres-store.js.map +1 -1
- package/dist/src/plugins/api-keys/types.d.ts +22 -4
- package/dist/src/plugins/api-keys/types.d.ts.map +1 -1
- package/dist/src/plugins/api-keys/types.js.map +1 -1
- package/dist/src/plugins/auth/index.d.ts +0 -4
- package/dist/src/plugins/auth/index.d.ts.map +1 -1
- package/dist/src/plugins/auth/index.js +2 -3
- package/dist/src/plugins/auth/index.js.map +1 -1
- package/dist/src/plugins/bans/bans-plugin.d.ts +5 -2
- package/dist/src/plugins/bans/bans-plugin.d.ts.map +1 -1
- package/dist/src/plugins/bans/bans-plugin.js +71 -25
- package/dist/src/plugins/bans/bans-plugin.js.map +1 -1
- package/dist/src/plugins/bans/index.d.ts +0 -4
- package/dist/src/plugins/bans/index.d.ts.map +1 -1
- package/dist/src/plugins/bans/index.js +2 -3
- package/dist/src/plugins/bans/index.js.map +1 -1
- package/dist/src/plugins/bans/types.d.ts +13 -6
- package/dist/src/plugins/bans/types.d.ts.map +1 -1
- package/dist/src/plugins/devices/devices-plugin.d.ts +5 -2
- package/dist/src/plugins/devices/devices-plugin.d.ts.map +1 -1
- package/dist/src/plugins/devices/devices-plugin.js +62 -26
- package/dist/src/plugins/devices/devices-plugin.js.map +1 -1
- package/dist/src/plugins/devices/index.d.ts +0 -4
- package/dist/src/plugins/devices/index.d.ts.map +1 -1
- package/dist/src/plugins/devices/index.js +2 -3
- package/dist/src/plugins/devices/index.js.map +1 -1
- package/dist/src/plugins/diagnostics-plugin.d.ts.map +1 -1
- package/dist/src/plugins/diagnostics-plugin.js +73 -0
- package/dist/src/plugins/diagnostics-plugin.js.map +1 -1
- package/dist/src/plugins/entitlements/entitlements-plugin.d.ts +5 -2
- package/dist/src/plugins/entitlements/entitlements-plugin.d.ts.map +1 -1
- package/dist/src/plugins/entitlements/entitlements-plugin.js +78 -41
- package/dist/src/plugins/entitlements/entitlements-plugin.js.map +1 -1
- package/dist/src/plugins/entitlements/index.d.ts +0 -4
- package/dist/src/plugins/entitlements/index.d.ts.map +1 -1
- package/dist/src/plugins/entitlements/index.js +2 -3
- package/dist/src/plugins/entitlements/index.js.map +1 -1
- package/dist/src/plugins/entitlements/types.d.ts +9 -2
- package/dist/src/plugins/entitlements/types.d.ts.map +1 -1
- package/dist/src/plugins/index.d.ts +1 -1
- package/dist/src/plugins/index.d.ts.map +1 -1
- package/dist/src/plugins/maintenance/SeedExecutor.d.ts +2 -0
- package/dist/src/plugins/maintenance/SeedExecutor.d.ts.map +1 -1
- package/dist/src/plugins/maintenance/SeedExecutor.js +6 -2
- package/dist/src/plugins/maintenance/SeedExecutor.js.map +1 -1
- package/dist/src/plugins/maintenance/SeedList.d.ts +2 -2
- package/dist/src/plugins/maintenance/SeedList.d.ts.map +1 -1
- package/dist/src/plugins/maintenance/SeedList.js +39 -14
- package/dist/src/plugins/maintenance/SeedList.js.map +1 -1
- package/dist/src/plugins/maintenance/SeedManagementPage.d.ts +1 -1
- package/dist/src/plugins/maintenance/SeedManagementPage.d.ts.map +1 -1
- package/dist/src/plugins/maintenance/SeedManagementPage.js +9 -5
- package/dist/src/plugins/maintenance/SeedManagementPage.js.map +1 -1
- package/dist/src/plugins/maintenance/seed-executor.d.ts +6 -4
- package/dist/src/plugins/maintenance/seed-executor.d.ts.map +1 -1
- package/dist/src/plugins/maintenance/seed-executor.js +53 -17
- package/dist/src/plugins/maintenance/seed-executor.js.map +1 -1
- package/dist/src/plugins/maintenance-plugin.d.ts +24 -0
- package/dist/src/plugins/maintenance-plugin.d.ts.map +1 -1
- package/dist/src/plugins/maintenance-plugin.js +222 -34
- package/dist/src/plugins/maintenance-plugin.js.map +1 -1
- package/dist/src/plugins/notifications/index.d.ts +0 -4
- package/dist/src/plugins/notifications/index.d.ts.map +1 -1
- package/dist/src/plugins/notifications/index.js +2 -3
- package/dist/src/plugins/notifications/index.js.map +1 -1
- package/dist/src/plugins/notifications/notifications-plugin.d.ts +5 -2
- package/dist/src/plugins/notifications/notifications-plugin.d.ts.map +1 -1
- package/dist/src/plugins/notifications/notifications-plugin.js +45 -13
- package/dist/src/plugins/notifications/notifications-plugin.js.map +1 -1
- package/dist/src/plugins/parental/index.d.ts +0 -4
- package/dist/src/plugins/parental/index.d.ts.map +1 -1
- package/dist/src/plugins/parental/index.js +2 -3
- package/dist/src/plugins/parental/index.js.map +1 -1
- package/dist/src/plugins/parental/parental-plugin.d.ts +5 -2
- package/dist/src/plugins/parental/parental-plugin.d.ts.map +1 -1
- package/dist/src/plugins/parental/parental-plugin.js +60 -24
- package/dist/src/plugins/parental/parental-plugin.js.map +1 -1
- package/dist/src/plugins/postgres-plugin.d.ts +12 -0
- package/dist/src/plugins/postgres-plugin.d.ts.map +1 -1
- package/dist/src/plugins/postgres-plugin.js +319 -5
- package/dist/src/plugins/postgres-plugin.js.map +1 -1
- package/dist/src/plugins/preferences/index.d.ts +0 -4
- package/dist/src/plugins/preferences/index.d.ts.map +1 -1
- package/dist/src/plugins/preferences/index.js +2 -3
- package/dist/src/plugins/preferences/index.js.map +1 -1
- package/dist/src/plugins/preferences/preferences-plugin.d.ts +5 -2
- package/dist/src/plugins/preferences/preferences-plugin.d.ts.map +1 -1
- package/dist/src/plugins/preferences/preferences-plugin.js +63 -19
- package/dist/src/plugins/preferences/preferences-plugin.js.map +1 -1
- package/dist/src/plugins/profiles/index.d.ts +0 -4
- package/dist/src/plugins/profiles/index.d.ts.map +1 -1
- package/dist/src/plugins/profiles/index.js +2 -3
- package/dist/src/plugins/profiles/index.js.map +1 -1
- package/dist/src/plugins/profiles/profiles-plugin.d.ts +5 -2
- package/dist/src/plugins/profiles/profiles-plugin.d.ts.map +1 -1
- package/dist/src/plugins/profiles/profiles-plugin.js +60 -26
- package/dist/src/plugins/profiles/profiles-plugin.js.map +1 -1
- package/dist/src/plugins/profiles/types.d.ts +9 -2
- package/dist/src/plugins/profiles/types.d.ts.map +1 -1
- package/dist/src/plugins/qwickbrain/index.d.ts +0 -4
- package/dist/src/plugins/qwickbrain/index.d.ts.map +1 -1
- package/dist/src/plugins/qwickbrain/index.js +2 -3
- package/dist/src/plugins/qwickbrain/index.js.map +1 -1
- package/dist/src/plugins/qwickbrain/qwickbrain-plugin.d.ts.map +1 -1
- package/dist/src/plugins/qwickbrain/qwickbrain-plugin.js +117 -0
- package/dist/src/plugins/qwickbrain/qwickbrain-plugin.js.map +1 -1
- package/dist/src/plugins/rate-limit/index.d.ts +0 -4
- package/dist/src/plugins/rate-limit/index.d.ts.map +1 -1
- package/dist/src/plugins/rate-limit/index.js +2 -3
- package/dist/src/plugins/rate-limit/index.js.map +1 -1
- package/dist/src/plugins/subscriptions/index.d.ts +0 -4
- package/dist/src/plugins/subscriptions/index.d.ts.map +1 -1
- package/dist/src/plugins/subscriptions/index.js +2 -3
- package/dist/src/plugins/subscriptions/index.js.map +1 -1
- package/dist/src/plugins/subscriptions/subscriptions-plugin.d.ts +5 -2
- package/dist/src/plugins/subscriptions/subscriptions-plugin.d.ts.map +1 -1
- package/dist/src/plugins/subscriptions/subscriptions-plugin.js +63 -29
- package/dist/src/plugins/subscriptions/subscriptions-plugin.js.map +1 -1
- package/dist/src/plugins/subscriptions/types.d.ts +8 -2
- package/dist/src/plugins/subscriptions/types.d.ts.map +1 -1
- package/dist/src/plugins/tenants/tenants-plugin.d.ts +5 -2
- package/dist/src/plugins/tenants/tenants-plugin.d.ts.map +1 -1
- package/dist/src/plugins/tenants/tenants-plugin.js +91 -58
- package/dist/src/plugins/tenants/tenants-plugin.js.map +1 -1
- package/dist/src/plugins/tenants/types.d.ts +8 -2
- package/dist/src/plugins/tenants/types.d.ts.map +1 -1
- package/dist/src/plugins/usage/index.d.ts +0 -4
- package/dist/src/plugins/usage/index.d.ts.map +1 -1
- package/dist/src/plugins/usage/index.js +2 -3
- package/dist/src/plugins/usage/index.js.map +1 -1
- package/dist/src/plugins/usage/usage-plugin.d.ts +5 -2
- package/dist/src/plugins/usage/usage-plugin.d.ts.map +1 -1
- package/dist/src/plugins/usage/usage-plugin.js +57 -23
- package/dist/src/plugins/usage/usage-plugin.js.map +1 -1
- package/dist/src/plugins/users/types.d.ts +7 -2
- package/dist/src/plugins/users/types.d.ts.map +1 -1
- package/dist/src/plugins/users/users-plugin.d.ts +5 -2
- package/dist/src/plugins/users/users-plugin.d.ts.map +1 -1
- package/dist/src/plugins/users/users-plugin.js +56 -23
- package/dist/src/plugins/users/users-plugin.js.map +1 -1
- package/dist/ui/src/components/ControlPanelApp.d.ts.map +1 -1
- package/dist/ui/src/components/ControlPanelApp.js +4 -3
- package/dist/ui/src/components/ControlPanelApp.js.map +1 -1
- package/dist/ui/src/dashboard/builtInWidgets.d.ts.map +1 -1
- package/dist/ui/src/dashboard/builtInWidgets.js +3 -1
- package/dist/ui/src/dashboard/builtInWidgets.js.map +1 -1
- package/dist/ui/src/dashboard/widgets/CMSMaintenanceWidget.d.ts.map +1 -1
- package/dist/ui/src/dashboard/widgets/CMSMaintenanceWidget.js +17 -4
- package/dist/ui/src/dashboard/widgets/CMSMaintenanceWidget.js.map +1 -1
- package/dist/ui/src/dashboard/widgets/CMSStatusWidget.d.ts.map +1 -1
- package/dist/ui/src/dashboard/widgets/CMSStatusWidget.js +5 -1
- package/dist/ui/src/dashboard/widgets/CMSStatusWidget.js.map +1 -1
- package/dist/ui/src/dashboard/widgets/CacheMaintenanceWidget.d.ts.map +1 -1
- package/dist/ui/src/dashboard/widgets/CacheMaintenanceWidget.js +4 -2
- package/dist/ui/src/dashboard/widgets/CacheMaintenanceWidget.js.map +1 -1
- package/dist/ui/src/dashboard/widgets/DatabaseOperationsWidget.d.ts +12 -0
- package/dist/ui/src/dashboard/widgets/DatabaseOperationsWidget.d.ts.map +1 -0
- package/dist/ui/src/dashboard/widgets/DatabaseOperationsWidget.js +174 -0
- package/dist/ui/src/dashboard/widgets/DatabaseOperationsWidget.js.map +1 -0
- package/dist/ui/src/dashboard/widgets/LogsMaintenanceWidget.d.ts.map +1 -1
- package/dist/ui/src/dashboard/widgets/LogsMaintenanceWidget.js +6 -3
- package/dist/ui/src/dashboard/widgets/LogsMaintenanceWidget.js.map +1 -1
- package/dist/ui/src/dashboard/widgets/SeedManagementWidget.d.ts +1 -1
- package/dist/ui/src/dashboard/widgets/SeedManagementWidget.d.ts.map +1 -1
- package/dist/ui/src/dashboard/widgets/SeedManagementWidget.js +256 -16
- package/dist/ui/src/dashboard/widgets/SeedManagementWidget.js.map +1 -1
- package/dist/ui/src/dashboard/widgets/index.d.ts +1 -0
- package/dist/ui/src/dashboard/widgets/index.d.ts.map +1 -1
- package/dist/ui/src/dashboard/widgets/index.js +1 -0
- package/dist/ui/src/dashboard/widgets/index.js.map +1 -1
- package/dist-ui/assets/index-BkGp7ZKd.js +529 -0
- package/dist-ui/assets/index-BkGp7ZKd.js.map +1 -0
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/index.js +3735 -3187
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/src/dashboard/widgets/DatabaseOperationsWidget.d.ts +11 -0
- package/dist-ui-lib/src/dashboard/widgets/SeedManagementWidget.d.ts +1 -1
- package/dist-ui-lib/src/dashboard/widgets/index.d.ts +1 -0
- package/package.json +8 -5
- package/src/core/control-panel.ts +5 -5
- package/src/core/gateway.ts +135 -15
- package/src/core/plugin-registry.ts +171 -0
- package/src/index.ts +2 -0
- package/src/plugins/api-keys/api-keys-plugin.ts +121 -20
- package/src/plugins/api-keys/index.ts +3 -5
- package/src/plugins/api-keys/stores/postgres-store.ts +90 -67
- package/src/plugins/api-keys/types.ts +23 -4
- package/src/plugins/auth/index.ts +3 -5
- package/src/plugins/bans/bans-plugin.ts +71 -26
- package/src/plugins/bans/index.ts +3 -5
- package/src/plugins/bans/types.ts +13 -6
- package/src/plugins/devices/devices-plugin.ts +62 -27
- package/src/plugins/devices/index.ts +3 -5
- package/src/plugins/diagnostics-plugin.ts +77 -0
- package/src/plugins/entitlements/entitlements-plugin.ts +81 -43
- package/src/plugins/entitlements/index.ts +3 -5
- package/src/plugins/entitlements/types.ts +9 -2
- package/src/plugins/index.ts +1 -1
- package/src/plugins/maintenance/SeedExecutor.tsx +9 -1
- package/src/plugins/maintenance/SeedList.tsx +85 -38
- package/src/plugins/maintenance/SeedManagementPage.tsx +10 -4
- package/src/plugins/maintenance/seed-executor.ts +56 -17
- package/src/plugins/maintenance-plugin.ts +267 -36
- package/src/plugins/notifications/index.ts +3 -5
- package/src/plugins/notifications/notifications-plugin.ts +48 -19
- package/src/plugins/parental/index.ts +3 -5
- package/src/plugins/parental/parental-plugin.ts +63 -25
- package/src/plugins/postgres-plugin.ts +410 -5
- package/src/plugins/preferences/index.ts +3 -5
- package/src/plugins/preferences/preferences-plugin.ts +66 -20
- package/src/plugins/profiles/index.ts +3 -5
- package/src/plugins/profiles/profiles-plugin.ts +60 -27
- package/src/plugins/profiles/types.ts +9 -2
- package/src/plugins/qwickbrain/index.ts +3 -5
- package/src/plugins/qwickbrain/qwickbrain-plugin.ts +135 -0
- package/src/plugins/rate-limit/index.ts +3 -5
- package/src/plugins/subscriptions/index.ts +3 -5
- package/src/plugins/subscriptions/subscriptions-plugin.ts +63 -30
- package/src/plugins/subscriptions/types.ts +8 -2
- package/src/plugins/tenants/tenants-plugin.ts +95 -60
- package/src/plugins/tenants/types.ts +8 -2
- package/src/plugins/usage/index.ts +3 -5
- package/src/plugins/usage/usage-plugin.ts +60 -26
- package/src/plugins/users/types.ts +7 -2
- package/src/plugins/users/users-plugin.ts +56 -24
- package/ui/src/App.tsx +3 -3
- package/ui/src/components/ControlPanelApp.tsx +4 -3
- package/ui/src/dashboard/builtInWidgets.tsx +3 -0
- package/ui/src/dashboard/widgets/CMSMaintenanceWidget.tsx +17 -4
- package/ui/src/dashboard/widgets/CMSStatusWidget.tsx +5 -1
- package/ui/src/dashboard/widgets/CacheMaintenanceWidget.tsx +4 -2
- package/ui/src/dashboard/widgets/DatabaseOperationsWidget.tsx +410 -0
- package/ui/src/dashboard/widgets/LogsMaintenanceWidget.tsx +6 -3
- package/ui/src/dashboard/widgets/SeedManagementWidget.tsx +533 -49
- package/ui/src/dashboard/widgets/index.ts +1 -0
- package/dist-ui/assets/index-8y0jDGcd.js +0 -528
- package/dist-ui/assets/index-8y0jDGcd.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedManagementPage.d.ts","sourceRoot":"","sources":["../../../../src/plugins/maintenance/SeedManagementPage.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"SeedManagementPage.d.ts","sourceRoot":"","sources":["../../../../src/plugins/maintenance/SeedManagementPage.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA0EhE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
/**
|
|
3
3
|
* Seed Management Page
|
|
4
4
|
*
|
|
5
|
-
* Main page for managing and executing seed scripts.
|
|
5
|
+
* Main page for managing and executing seed scripts and custom tasks.
|
|
6
6
|
*
|
|
7
7
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
8
|
*/
|
|
@@ -14,14 +14,18 @@ import { SeedHistory } from './SeedHistory.js';
|
|
|
14
14
|
export const SeedManagementPage = ({ apiPrefix = '/api/plugins/maintenance', }) => {
|
|
15
15
|
const [activeTab, setActiveTab] = useState('list');
|
|
16
16
|
const [selectedSeed, setSelectedSeed] = useState(null);
|
|
17
|
-
const
|
|
17
|
+
const [selectedType, setSelectedType] = useState('file');
|
|
18
|
+
const [selectedOptions, setSelectedOptions] = useState(undefined);
|
|
19
|
+
const handleExecute = (seedName, type = 'file', options) => {
|
|
18
20
|
setSelectedSeed(seedName);
|
|
21
|
+
setSelectedType(type);
|
|
22
|
+
setSelectedOptions(options);
|
|
19
23
|
setActiveTab('execute');
|
|
20
24
|
};
|
|
21
25
|
const handleExecutionComplete = () => {
|
|
22
26
|
setActiveTab('history');
|
|
23
27
|
};
|
|
24
|
-
return (_jsxs(PluginManagementPage, { title: "Seed Management", description: "Manage and execute database seed scripts", children: [_jsxs("div", { style: { marginBottom: '20px' }, children: [_jsx("button", { onClick: () => setActiveTab('list'), style: {
|
|
28
|
+
return (_jsxs(PluginManagementPage, { title: "Seed Management", description: "Manage and execute database seed scripts and custom tasks", children: [_jsxs("div", { style: { marginBottom: '20px' }, children: [_jsx("button", { onClick: () => setActiveTab('list'), style: {
|
|
25
29
|
padding: '8px 16px',
|
|
26
30
|
marginRight: '8px',
|
|
27
31
|
backgroundColor: activeTab === 'list' ? '#1976d2' : '#f5f5f5',
|
|
@@ -29,14 +33,14 @@ export const SeedManagementPage = ({ apiPrefix = '/api/plugins/maintenance', })
|
|
|
29
33
|
border: 'none',
|
|
30
34
|
borderRadius: '4px',
|
|
31
35
|
cursor: 'pointer',
|
|
32
|
-
}, children: "Available Seeds" }), _jsx("button", { onClick: () => setActiveTab('history'), style: {
|
|
36
|
+
}, children: "Available Seeds & Tasks" }), _jsx("button", { onClick: () => setActiveTab('history'), style: {
|
|
33
37
|
padding: '8px 16px',
|
|
34
38
|
backgroundColor: activeTab === 'history' ? '#1976d2' : '#f5f5f5',
|
|
35
39
|
color: activeTab === 'history' ? 'white' : 'black',
|
|
36
40
|
border: 'none',
|
|
37
41
|
borderRadius: '4px',
|
|
38
42
|
cursor: 'pointer',
|
|
39
|
-
}, children: "Execution History" })] }), activeTab === 'list' && (_jsx(SeedList, { apiPrefix: apiPrefix, onExecute: handleExecute })), activeTab === 'execute' && selectedSeed && (_jsx(SeedExecutor, { apiPrefix: apiPrefix, seedName: selectedSeed, onComplete: handleExecutionComplete, onCancel: () => setActiveTab('list') })), activeTab === 'history' && (_jsx(SeedHistory, { apiPrefix: apiPrefix }))] }));
|
|
43
|
+
}, children: "Execution History" })] }), activeTab === 'list' && (_jsx(SeedList, { apiPrefix: apiPrefix, onExecute: handleExecute })), activeTab === 'execute' && selectedSeed && (_jsx(SeedExecutor, { apiPrefix: apiPrefix, seedName: selectedSeed, seedType: selectedType, seedOptions: selectedOptions, onComplete: handleExecutionComplete, onCancel: () => setActiveTab('list') })), activeTab === 'history' && (_jsx(SeedHistory, { apiPrefix: apiPrefix }))] }));
|
|
40
44
|
};
|
|
41
45
|
export default SeedManagementPage;
|
|
42
46
|
//# sourceMappingURL=SeedManagementPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedManagementPage.js","sourceRoot":"","sources":["../../../../src/plugins/maintenance/SeedManagementPage.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQ/C,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,SAAS,GAAG,0BAA0B,GACvC,EAAE,EAAE;IACH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAM,MAAM,CAAC,CAAC;IACxD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"SeedManagementPage.js","sourceRoot":"","sources":["../../../../src/plugins/maintenance/SeedManagementPage.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQ/C,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,SAAS,GAAG,0BA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E,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,EACtC,KAAK,EAAE;4BACL,OAAO,EAAE,UAAU;4BACnB,eAAe,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;4BAChE,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;4BAClD,MAAM,EAAE,MAAM;4BACd,YAAY,EAAE,KAAK;4BACnB,MAAM,EAAE,SAAS;yBAClB,kCAGM,IACL,EAEL,SAAS,KAAK,MAAM,IAAI,CACvB,KAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAI,CAC7D,EAEA,SAAS,KAAK,SAAS,IAAI,YAAY,IAAI,CAC1C,KAAC,YAAY,IACX,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,uBAAuB,EACnC,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,GACpC,CACH,EAEA,SAAS,KAAK,SAAS,IAAI,CAC1B,KAAC,WAAW,IAAC,SAAS,EAAE,SAAS,GAAI,CACtC,IACoB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -18,11 +18,11 @@ export interface SeedExecutionResult {
|
|
|
18
18
|
/**
|
|
19
19
|
* Validate script path to prevent path traversal attacks
|
|
20
20
|
*
|
|
21
|
-
* @param
|
|
21
|
+
* @param scriptPath - Relative path to the script (e.g., "database/001.init.mjs" or "01-Setup/seed-data.mjs")
|
|
22
22
|
* @param scriptsPath - Base path for scripts directory
|
|
23
|
-
* @returns Resolved path if valid, null if invalid
|
|
23
|
+
* @returns Resolved absolute path if valid, null if invalid
|
|
24
24
|
*/
|
|
25
|
-
export declare function validateScriptPath(
|
|
25
|
+
export declare function validateScriptPath(scriptPath: string, scriptsPath: string): string | null;
|
|
26
26
|
/**
|
|
27
27
|
* Seed Executor
|
|
28
28
|
*
|
|
@@ -40,9 +40,11 @@ export declare class SeedExecutor {
|
|
|
40
40
|
*
|
|
41
41
|
* @param scriptPath - Absolute path to the script
|
|
42
42
|
* @param res - Express response object (for SSE streaming)
|
|
43
|
+
* @param databaseUrl - Optional database URL to pass to the script
|
|
44
|
+
* @param projectRoot - Optional project root directory (defaults to script's directory)
|
|
43
45
|
* @returns Promise resolving to execution result
|
|
44
46
|
*/
|
|
45
|
-
execute(scriptPath: string, res: Response): Promise<SeedExecutionResult>;
|
|
47
|
+
execute(scriptPath: string, res: Response, databaseUrl?: string, projectRoot?: string): Promise<SeedExecutionResult>;
|
|
46
48
|
/**
|
|
47
49
|
* Check if executor is currently running a process
|
|
48
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed-executor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/maintenance/seed-executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAkBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuBzF;AAUD;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAAa;IAE/B
|
|
1
|
+
{"version":3,"file":"seed-executor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/maintenance/seed-executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAkBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuBzF;AAUD;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAAa;IAE/B;;;;;;;;OAQG;IACG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAkJ1H;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,SAAS,IAAI,IAAI;CAKlB"}
|
|
@@ -15,29 +15,29 @@ const MAX_OUTPUT_SIZE = 100 * 1024;
|
|
|
15
15
|
/**
|
|
16
16
|
* Validate script path to prevent path traversal attacks
|
|
17
17
|
*
|
|
18
|
-
* @param
|
|
18
|
+
* @param scriptPath - Relative path to the script (e.g., "database/001.init.mjs" or "01-Setup/seed-data.mjs")
|
|
19
19
|
* @param scriptsPath - Base path for scripts directory
|
|
20
|
-
* @returns Resolved path if valid, null if invalid
|
|
20
|
+
* @returns Resolved absolute path if valid, null if invalid
|
|
21
21
|
*/
|
|
22
|
-
export function validateScriptPath(
|
|
23
|
-
// Only allow
|
|
24
|
-
if (
|
|
22
|
+
export function validateScriptPath(scriptPath, scriptsPath) {
|
|
23
|
+
// Only allow .mjs files
|
|
24
|
+
if (!scriptPath.endsWith('.mjs')) {
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
// Resolve paths
|
|
28
28
|
const basePath = resolve(scriptsPath);
|
|
29
|
-
const
|
|
29
|
+
const resolvedScriptPath = resolve(basePath, scriptPath);
|
|
30
30
|
// Ensure resolved path is within scriptsPath (prevent path traversal)
|
|
31
31
|
// Use relative() for platform-agnostic check (works on Windows and Unix)
|
|
32
|
-
const relativePath = relative(basePath,
|
|
32
|
+
const relativePath = relative(basePath, resolvedScriptPath);
|
|
33
33
|
if (relativePath.startsWith('..') || relativePath.includes('../') || relativePath.includes('..\\')) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
// Ensure file exists
|
|
37
|
-
if (!existsSync(
|
|
37
|
+
if (!existsSync(resolvedScriptPath)) {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return resolvedScriptPath;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Send SSE event to client
|
|
@@ -65,28 +65,61 @@ export class SeedExecutor {
|
|
|
65
65
|
*
|
|
66
66
|
* @param scriptPath - Absolute path to the script
|
|
67
67
|
* @param res - Express response object (for SSE streaming)
|
|
68
|
+
* @param databaseUrl - Optional database URL to pass to the script
|
|
69
|
+
* @param projectRoot - Optional project root directory (defaults to script's directory)
|
|
68
70
|
* @returns Promise resolving to execution result
|
|
69
71
|
*/
|
|
70
|
-
async execute(scriptPath, res) {
|
|
72
|
+
async execute(scriptPath, res, databaseUrl, projectRoot) {
|
|
71
73
|
this.startTime = Date.now();
|
|
72
74
|
this.outputBuffer = '';
|
|
73
75
|
this.errorBuffer = '';
|
|
74
76
|
this.outputSize = 0;
|
|
75
77
|
return new Promise((resolvePromise, rejectPromise) => {
|
|
76
|
-
//
|
|
77
|
-
// Use
|
|
78
|
-
|
|
78
|
+
// Determine if we need tsx (for .ts/.mts files that import TS modules)
|
|
79
|
+
// Use tsx for .mjs files too since they might import from TS source
|
|
80
|
+
const needsTsx = scriptPath.match(/\.(mjs|ts|mts)$/);
|
|
81
|
+
const execCommand = needsTsx ? 'tsx' : process.execPath;
|
|
82
|
+
const execArgs = needsTsx ? [scriptPath] : [scriptPath];
|
|
83
|
+
// Spawn process with TypeScript support if needed
|
|
84
|
+
this.child = spawn(execCommand, execArgs, {
|
|
79
85
|
env: {
|
|
86
|
+
...process.env, // Inherit all env vars for tsx to work properly
|
|
80
87
|
NODE_ENV: process.env.NODE_ENV || 'development',
|
|
81
|
-
DATABASE_URI: process.env.DATABASE_URI,
|
|
82
|
-
DATABASE_URL: process.env.DATABASE_URL,
|
|
88
|
+
DATABASE_URI: databaseUrl || process.env.DATABASE_URI,
|
|
89
|
+
DATABASE_URL: databaseUrl || process.env.DATABASE_URL,
|
|
83
90
|
PAYLOAD_PUBLIC_SERVER_URL: process.env.PAYLOAD_PUBLIC_SERVER_URL,
|
|
84
91
|
NEXT_PUBLIC_SERVER_URL: process.env.NEXT_PUBLIC_SERVER_URL,
|
|
85
92
|
API_URL: process.env.API_URL,
|
|
93
|
+
PAYLOAD_SECRET: process.env.PAYLOAD_SECRET || 'dev-secret-key-change-in-production',
|
|
86
94
|
},
|
|
87
|
-
stdio: ['
|
|
88
|
-
cwd: resolve(scriptPath, '..'), // Run from scripts directory
|
|
95
|
+
stdio: ['pipe', 'pipe', 'pipe'], // stdin: pipe, stdout: pipe, stderr: pipe
|
|
96
|
+
cwd: projectRoot || resolve(scriptPath, '..'), // Run from project root (or scripts directory if not provided)
|
|
89
97
|
});
|
|
98
|
+
// Auto-answer interactive prompts (like Drizzle's schema push confirmation)
|
|
99
|
+
// Send 'y\n' every 500ms to handle any prompts that appear
|
|
100
|
+
const stdinInterval = setInterval(() => {
|
|
101
|
+
if (this.child && this.child.stdin && !this.child.stdin.destroyed) {
|
|
102
|
+
try {
|
|
103
|
+
this.child.stdin.write('y\n');
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
// Ignore errors - stdin might be closed
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, 500);
|
|
110
|
+
// Clear interval when process exits
|
|
111
|
+
const cleanupInterval = () => {
|
|
112
|
+
clearInterval(stdinInterval);
|
|
113
|
+
// Close stdin to signal EOF
|
|
114
|
+
if (this.child && this.child.stdin && !this.child.stdin.destroyed) {
|
|
115
|
+
try {
|
|
116
|
+
this.child.stdin.end();
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
// Ignore errors
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
90
123
|
// Handle stdout
|
|
91
124
|
this.child.stdout?.on('data', (data) => {
|
|
92
125
|
const text = data.toString();
|
|
@@ -126,6 +159,7 @@ export class SeedExecutor {
|
|
|
126
159
|
});
|
|
127
160
|
// Handle process exit
|
|
128
161
|
this.child.on('exit', (code, signal) => {
|
|
162
|
+
cleanupInterval(); // Clean up stdin interval
|
|
129
163
|
const exitCode = code ?? (signal ? 1 : 0);
|
|
130
164
|
const duration = Date.now() - this.startTime;
|
|
131
165
|
// Send exit event via SSE
|
|
@@ -145,6 +179,7 @@ export class SeedExecutor {
|
|
|
145
179
|
});
|
|
146
180
|
// Handle spawn errors
|
|
147
181
|
this.child.on('error', (err) => {
|
|
182
|
+
cleanupInterval(); // Clean up stdin interval
|
|
148
183
|
sendSSEEvent(res, {
|
|
149
184
|
type: 'error',
|
|
150
185
|
data: err.message,
|
|
@@ -154,6 +189,7 @@ export class SeedExecutor {
|
|
|
154
189
|
});
|
|
155
190
|
// Handle SSE connection close - terminate child process
|
|
156
191
|
res.on('close', () => {
|
|
192
|
+
cleanupInterval(); // Clean up stdin interval
|
|
157
193
|
if (this.child && !this.child.killed) {
|
|
158
194
|
this.child.kill('SIGTERM');
|
|
159
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed-executor.js","sourceRoot":"","sources":["../../../../src/plugins/maintenance/seed-executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAwBzC;;GAEG;AACH,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB,EAAE,WAAmB;IACxE,
|
|
1
|
+
{"version":3,"file":"seed-executor.js","sourceRoot":"","sources":["../../../../src/plugins/maintenance/seed-executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAwBzC;;GAEG;AACH,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB,EAAE,WAAmB;IACxE,wBAAwB;IACxB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,MAAM,kBAAkB,GAAG,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEzD,sEAAsE;IACtE,yEAAyE;IACzE,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC5D,IAAI,YAAY,CAAC,UAAU,CAAC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AAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -9,7 +9,29 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
11
11
|
*/
|
|
12
|
+
import type { Response } from 'express';
|
|
12
13
|
import type { Plugin } from '../core/plugin-registry.js';
|
|
14
|
+
/**
|
|
15
|
+
* Custom seed task handler
|
|
16
|
+
*/
|
|
17
|
+
export interface SeedTaskHandler {
|
|
18
|
+
(options?: Record<string, any>, res?: Response): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Custom seed task definition
|
|
22
|
+
*/
|
|
23
|
+
export interface SeedTask {
|
|
24
|
+
/** Unique task identifier */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Display name */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Description of what this task does */
|
|
29
|
+
description: string;
|
|
30
|
+
/** Task handler function */
|
|
31
|
+
handler: SeedTaskHandler;
|
|
32
|
+
/** Optional task options/parameters */
|
|
33
|
+
options?: Record<string, any>;
|
|
34
|
+
}
|
|
13
35
|
export interface MaintenancePluginConfig {
|
|
14
36
|
/** Path to scripts directory (default: './scripts') */
|
|
15
37
|
scriptsPath?: string;
|
|
@@ -27,6 +49,8 @@ export interface MaintenancePluginConfig {
|
|
|
27
49
|
enableEnvManagement?: boolean;
|
|
28
50
|
/** Enable database operations (default: true) */
|
|
29
51
|
enableDatabaseOps?: boolean;
|
|
52
|
+
/** Custom seed tasks */
|
|
53
|
+
customTasks?: SeedTask[];
|
|
30
54
|
}
|
|
31
55
|
/**
|
|
32
56
|
* Create a maintenance plugin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maintenance-plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/maintenance-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"maintenance-plugin.d.ts","sourceRo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