@optimizely/ocp-local-env 1.0.0-beta.8 → 1.0.1
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/README.md +18 -133
- package/dist/package.json +17 -9
- package/dist/public/bundle.fa87c838198caf8c051a.js +3 -0
- package/dist/public/{bundle.0a495807b6ef336cb500.js.LICENSE.txt → bundle.fa87c838198caf8c051a.js.LICENSE.txt} +13 -3
- package/dist/public/bundle.fa87c838198caf8c051a.js.map +1 -0
- package/dist/public/index.html +1 -1
- package/dist/src/cli.js +2 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/executor/FunctionExecutor.js +8 -5
- package/dist/src/executor/FunctionExecutor.js.map +1 -1
- package/dist/src/executor/JobExecutor.js +0 -17
- package/dist/src/executor/JobExecutor.js.map +1 -1
- package/dist/src/executor/LifecycleExecutor.js +11 -2
- package/dist/src/executor/LifecycleExecutor.js.map +1 -1
- package/dist/src/executor/watcher.d.ts +6 -0
- package/dist/src/executor/watcher.js +45 -0
- package/dist/src/executor/watcher.js.map +1 -1
- package/dist/src/local_engine/LocalJobApi.d.ts +31 -2
- package/dist/src/local_engine/LocalJobApi.js +42 -17
- package/dist/src/local_engine/LocalJobApi.js.map +1 -1
- package/dist/src/local_engine/LocalNotifier.d.ts +3 -2
- package/dist/src/local_engine/LocalNotifier.js +7 -0
- package/dist/src/local_engine/LocalNotifier.js.map +1 -1
- package/dist/src/local_engine/LocalSourceApi.d.ts +40 -0
- package/dist/src/local_engine/LocalSourceApi.js +69 -0
- package/dist/src/local_engine/LocalSourceApi.js.map +1 -0
- package/dist/src/local_engine/local-engine-child-base.d.ts +0 -12
- package/dist/src/local_engine/local-engine-child-base.js +0 -127
- package/dist/src/local_engine/local-engine-child-base.js.map +1 -1
- package/dist/src/local_engine/local-engine-client.d.ts +19 -29
- package/dist/src/local_engine/local-engine-client.js +45 -94
- package/dist/src/local_engine/local-engine-client.js.map +1 -1
- package/dist/src/local_engine/local-engine-types.d.ts +13 -50
- package/dist/src/local_engine/local-engine-unified.d.ts +6 -13
- package/dist/src/local_engine/local-engine-unified.js +108 -222
- package/dist/src/local_engine/local-engine-unified.js.map +1 -1
- package/dist/src/local_engine/localSDKConfig.d.ts +6 -0
- package/dist/src/local_engine/localSDKConfig.js +66 -1
- package/dist/src/local_engine/localSDKConfig.js.map +1 -1
- package/dist/src/local_engine/storage/BaseKVStoreWrapper.d.ts +1 -2
- package/dist/src/local_engine/storage/BaseKVStoreWrapper.js.map +1 -1
- package/dist/src/local_engine/storage/LocalConfigStore.d.ts +7 -13
- package/dist/src/local_engine/storage/LocalConfigStore.js +9 -31
- package/dist/src/local_engine/storage/LocalConfigStore.js.map +1 -1
- package/dist/src/local_engine/storage/LocalKVStore.d.ts +4 -0
- package/dist/src/local_engine/storage/LocalKVStore.js +23 -0
- package/dist/src/local_engine/storage/LocalKVStore.js.map +1 -1
- package/dist/src/local_engine/storage/LocalSettingsStore.d.ts +7 -1
- package/dist/src/local_engine/storage/LocalSettingsStore.js +46 -4
- package/dist/src/local_engine/storage/LocalSettingsStore.js.map +1 -1
- package/dist/src/local_engine/storage/SourceDataStore.d.ts +16 -14
- package/dist/src/local_engine/storage/SourceDataStore.js +57 -57
- package/dist/src/local_engine/storage/SourceDataStore.js.map +1 -1
- package/dist/src/local_engine/utils.d.ts +2 -0
- package/dist/src/local_engine/utils.js +4 -2
- package/dist/src/local_engine/utils.js.map +1 -1
- package/dist/src/server/api/deploy.d.ts +20 -0
- package/dist/src/server/api/deploy.js +399 -0
- package/dist/src/server/api/deploy.js.map +1 -0
- package/dist/src/server/api/destinations.js +1 -1
- package/dist/src/server/api/destinations.js.map +1 -1
- package/dist/src/server/api/env.d.ts +2 -0
- package/dist/src/server/api/env.js +28 -0
- package/dist/src/server/api/env.js.map +1 -0
- package/dist/src/server/api/functions.js +13 -12
- package/dist/src/server/api/functions.js.map +1 -1
- package/dist/src/server/api/opalTools.d.ts +4 -0
- package/dist/src/server/api/opalTools.js +81 -0
- package/dist/src/server/api/opalTools.js.map +1 -0
- package/dist/src/server/api/schema.d.ts +6 -0
- package/dist/src/server/api/schema.js +95 -0
- package/dist/src/server/api/schema.js.map +1 -0
- package/dist/src/server/api/sources.d.ts +1 -2
- package/dist/src/server/api/sources.js +16 -275
- package/dist/src/server/api/sources.js.map +1 -1
- package/dist/src/server/api/v1.js +67 -70
- package/dist/src/server/api/v1.js.map +1 -1
- package/dist/src/server/api.d.ts +4 -0
- package/dist/src/server/api.js +133 -11
- package/dist/src/server/api.js.map +1 -1
- package/dist/src/server/app-discovery.js +37 -4
- package/dist/src/server/app-discovery.js.map +1 -1
- package/dist/src/server/app-env.d.ts +21 -0
- package/dist/src/server/app-env.js +122 -0
- package/dist/src/server/app-env.js.map +1 -0
- package/dist/src/server/browserFocus.d.ts +5 -0
- package/dist/src/server/browserFocus.js +39 -0
- package/dist/src/server/browserFocus.js.map +1 -0
- package/dist/src/server/config.d.ts +3 -0
- package/dist/src/server/config.js +7 -0
- package/dist/src/server/config.js.map +1 -1
- package/dist/src/server/mockDataGenerator.d.ts +1 -2
- package/dist/src/server/mockDataGenerator.js +77 -35
- package/dist/src/server/mockDataGenerator.js.map +1 -1
- package/dist/src/server/mockToolDataGenerator.d.ts +12 -0
- package/dist/src/server/mockToolDataGenerator.js +393 -0
- package/dist/src/server/mockToolDataGenerator.js.map +1 -0
- package/dist/src/server.js +152 -168
- package/dist/src/server.js.map +1 -1
- package/dist/src/types/app.d.ts +1 -3
- package/dist/src/types/app.js.map +1 -1
- package/dist/src/ui/components/App.js +311 -50
- package/dist/src/ui/components/App.js.map +1 -1
- package/dist/src/ui/components/DeployModal.d.ts +16 -0
- package/dist/src/ui/components/DeployModal.js +75 -0
- package/dist/src/ui/components/DeployModal.js.map +1 -0
- package/dist/src/ui/components/DestinationBatchEditor.d.ts +9 -1
- package/dist/src/ui/components/DestinationBatchEditor.js +30 -16
- package/dist/src/ui/components/DestinationBatchEditor.js.map +1 -1
- package/dist/src/ui/components/DestinationsView.js +5 -1
- package/dist/src/ui/components/DestinationsView.js.map +1 -1
- package/dist/src/ui/components/EntityNotAvailable.d.ts +15 -0
- package/dist/src/ui/components/EntityNotAvailable.js +27 -0
- package/dist/src/ui/components/EntityNotAvailable.js.map +1 -0
- package/dist/src/ui/components/EnvViewer.d.ts +8 -0
- package/dist/src/ui/components/EnvViewer.js +35 -0
- package/dist/src/ui/components/EnvViewer.js.map +1 -0
- package/dist/src/ui/components/FunctionsView.d.ts +2 -6
- package/dist/src/ui/components/FunctionsView.js +106 -124
- package/dist/src/ui/components/FunctionsView.js.map +1 -1
- package/dist/src/ui/components/JobsView.js +28 -5
- package/dist/src/ui/components/JobsView.js.map +1 -1
- package/dist/src/ui/components/KVStoreViewer.js +5 -5
- package/dist/src/ui/components/KVStoreViewer.js.map +1 -1
- package/dist/src/ui/components/KeyValueEditor.d.ts +15 -0
- package/dist/src/ui/components/KeyValueEditor.js +12 -0
- package/dist/src/ui/components/KeyValueEditor.js.map +1 -0
- package/dist/src/ui/components/NotificationViewer.d.ts +2 -11
- package/dist/src/ui/components/NotificationViewer.js +69 -15
- package/dist/src/ui/components/NotificationViewer.js.map +1 -1
- package/dist/src/ui/components/OdpSchemaView.d.ts +3 -0
- package/dist/src/ui/components/OdpSchemaView.js +58 -0
- package/dist/src/ui/components/OdpSchemaView.js.map +1 -0
- package/dist/src/ui/components/OpalToolsView.d.ts +9 -0
- package/dist/src/ui/components/OpalToolsView.js +399 -0
- package/dist/src/ui/components/OpalToolsView.js.map +1 -0
- package/dist/src/ui/components/ResponseViewer.d.ts +39 -0
- package/dist/src/ui/components/ResponseViewer.js +43 -0
- package/dist/src/ui/components/ResponseViewer.js.map +1 -0
- package/dist/src/ui/components/SecretsStoreViewer.js +3 -2
- package/dist/src/ui/components/SecretsStoreViewer.js.map +1 -1
- package/dist/src/ui/components/SettingsStoreViewer.js +3 -2
- package/dist/src/ui/components/SettingsStoreViewer.js.map +1 -1
- package/dist/src/ui/components/SourceEmittedDataPanel.d.ts +8 -0
- package/dist/src/ui/components/SourceEmittedDataPanel.js +103 -0
- package/dist/src/ui/components/SourceEmittedDataPanel.js.map +1 -0
- package/dist/src/ui/components/SourcesView.js +4 -8
- package/dist/src/ui/components/SourcesView.js.map +1 -1
- package/dist/src/ui/components/StoreViewer.js +2 -1
- package/dist/src/ui/components/StoreViewer.js.map +1 -1
- package/dist/src/ui/components/TabbedConsole.d.ts +11 -0
- package/dist/src/ui/components/TabbedConsole.js +134 -44
- package/dist/src/ui/components/TabbedConsole.js.map +1 -1
- package/dist/src/ui/components/ToolSettingsView.d.ts +7 -0
- package/dist/src/ui/components/ToolSettingsView.js +25 -0
- package/dist/src/ui/components/ToolSettingsView.js.map +1 -0
- package/dist/src/ui/components/common/EyeIcon.js +2 -1
- package/dist/src/ui/components/common/EyeIcon.js.map +1 -1
- package/dist/src/ui/hooks/useKeyValuePairs.d.ts +52 -0
- package/dist/src/ui/hooks/useKeyValuePairs.js +66 -0
- package/dist/src/ui/hooks/useKeyValuePairs.js.map +1 -0
- package/dist/src/ui/index.js +4 -2
- package/dist/src/ui/index.js.map +1 -1
- package/dist/src/ui/store/formStateSlice.d.ts +71 -0
- package/dist/src/ui/store/formStateSlice.js +159 -0
- package/dist/src/ui/store/formStateSlice.js.map +1 -0
- package/dist/src/ui/store/hooks.d.ts +6 -0
- package/dist/src/ui/store/hooks.js +8 -0
- package/dist/src/ui/store/hooks.js.map +1 -0
- package/dist/src/ui/store/index.d.ts +11 -0
- package/dist/src/ui/store/index.js +107 -0
- package/dist/src/ui/store/index.js.map +1 -0
- package/dist/src/ui/types/common.d.ts +33 -0
- package/dist/src/ui/types/common.js +6 -0
- package/dist/src/ui/types/common.js.map +1 -0
- package/package.json +17 -9
- package/dist/public/bundle.0a495807b6ef336cb500.js +0 -3
- package/dist/public/bundle.0a495807b6ef336cb500.js.map +0 -1
- package/dist/src/executor/SourceExecutor.d.ts +0 -32
- package/dist/src/executor/SourceExecutor.js +0 -163
- package/dist/src/executor/SourceExecutor.js.map +0 -1
- package/dist/src/local_engine/storage/SourceJobExecutionStore.d.ts +0 -25
- package/dist/src/local_engine/storage/SourceJobExecutionStore.js +0 -61
- package/dist/src/local_engine/storage/SourceJobExecutionStore.js.map +0 -1
- package/dist/src/ui/components/SourceDataViewer.d.ts +0 -8
- package/dist/src/ui/components/SourceDataViewer.js +0 -84
- package/dist/src/ui/components/SourceDataViewer.js.map +0 -1
- package/dist/src/ui/components/SourceJobsSection.d.ts +0 -8
- package/dist/src/ui/components/SourceJobsSection.js +0 -99
- package/dist/src/ui/components/SourceJobsSection.js.map +0 -1
- package/dist/src/ui/components/SourceLifecycleSection.d.ts +0 -7
- package/dist/src/ui/components/SourceLifecycleSection.js +0 -58
- package/dist/src/ui/components/SourceLifecycleSection.js.map +0 -1
- package/dist/src/ui/components/SourceWebhookEditor.d.ts +0 -8
- package/dist/src/ui/components/SourceWebhookEditor.js +0 -168
- package/dist/src/ui/components/SourceWebhookEditor.js.map +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createOpalToolRoutes = createOpalToolRoutes;
|
|
7
|
+
const express_1 = __importDefault(require("express"));
|
|
8
|
+
const LogManager_1 = require("../../logging/LogManager");
|
|
9
|
+
const mockToolDataGenerator_1 = require("../mockToolDataGenerator");
|
|
10
|
+
const config_1 = require("../config");
|
|
11
|
+
function createOpalToolRoutes(app, configStore) {
|
|
12
|
+
const router = express_1.default.Router();
|
|
13
|
+
const logger = LogManager_1.LogManager.getInstance();
|
|
14
|
+
// GET /opal-tools - List all Opal tool functions
|
|
15
|
+
router.get('/', (req, res) => {
|
|
16
|
+
try {
|
|
17
|
+
const functions = app.manifest.functions || {};
|
|
18
|
+
const opalToolFunctions = [];
|
|
19
|
+
const protocol = req.secure ? 'https' : 'http';
|
|
20
|
+
const host = req.get('host') || `${config_1.config.server.host}:${config_1.config.server.port}`;
|
|
21
|
+
for (const [id, funcDef] of Object.entries(functions)) {
|
|
22
|
+
if (funcDef.opal_tool === true) {
|
|
23
|
+
// Build function URL (similar to functions.ts)
|
|
24
|
+
const isGlobal = funcDef.global === true;
|
|
25
|
+
const appId = app.manifest.meta.app_id;
|
|
26
|
+
let url;
|
|
27
|
+
if (isGlobal) {
|
|
28
|
+
// Global opal tools don't need installation - URL has no GUID
|
|
29
|
+
url = `${protocol}://${host}/functions/${appId}/${id}`;
|
|
30
|
+
}
|
|
31
|
+
else if (configStore && configStore.isInstalled()) {
|
|
32
|
+
const guid = configStore.getFunctionGuid(id);
|
|
33
|
+
url = `${protocol}://${host}/functions/${appId}/${id}/${guid}`;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
url = '';
|
|
37
|
+
}
|
|
38
|
+
opalToolFunctions.push({
|
|
39
|
+
id,
|
|
40
|
+
entry_point: funcDef.entry_point,
|
|
41
|
+
description: funcDef.description || '',
|
|
42
|
+
url,
|
|
43
|
+
global: isGlobal
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
res.json({ functions: opalToolFunctions });
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Function, `Failed to list Opal tool functions: ${error}`, { id: 'opalTools' });
|
|
51
|
+
res.status(500).json({
|
|
52
|
+
error: 'Failed to list Opal tool functions',
|
|
53
|
+
details: error instanceof Error ? error.message : String(error)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
// POST /opal-tools/:functionId/tools/:toolName/generate-mock - Generate mock data for tool
|
|
58
|
+
// Note: Discovery is called directly from the UI to each function's /discovery endpoint
|
|
59
|
+
router.post('/:functionId/tools/:toolName/generate-mock', async (req, res) => {
|
|
60
|
+
const { toolName } = req.params;
|
|
61
|
+
const { parameters } = req.body; // Tool parameter definitions
|
|
62
|
+
try {
|
|
63
|
+
if (!parameters || !Array.isArray(parameters)) {
|
|
64
|
+
return res.status(400).json({
|
|
65
|
+
error: 'Tool parameters are required in request body'
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const mockData = await (0, mockToolDataGenerator_1.generateMockToolParams)(parameters);
|
|
69
|
+
res.json({ data: mockData });
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Function, `Failed to generate mock data for ${toolName}: ${error}`, { id: 'opalTools' });
|
|
73
|
+
res.status(500).json({
|
|
74
|
+
error: 'Failed to generate mock data',
|
|
75
|
+
details: error instanceof Error ? error.message : String(error)
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return router;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=opalTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opalTools.js","sourceRoot":"","sources":["../../../../src/server/api/opalTools.ts"],"names":[],"mappings":";;;;;AAsBA,oDAuFC;AA7GD,sDAAqD;AAGrD,yDAA8E;AAC9E,oEAAkE;AAClE,sCAAmC;AAiBnC,SAAgB,oBAAoB,CAClC,GAAQ,EACR,WAA8B;IAE9B,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,uBAAU,CAAC,WAAW,EAAE,CAAC;IAExC,iDAAiD;IACjD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAY,EAAE,GAAa,EAAE,EAAE;QAC9C,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC;YAC/C,MAAM,iBAAiB,GAAuB,EAAE,CAAC;YACjD,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,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QAAQ,KAAK,KAAK,EAAE,EACxD,EAAE,EAAE,EAAE,WAAW,EAAE,CACpB,CAAC;YACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,KAAK,EAAE,8BAA8B;gBACrC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.createSchemaRoutes = createSchemaRoutes;
|
|
40
|
+
const express_1 = __importDefault(require("express"));
|
|
41
|
+
const fs_1 = __importDefault(require("fs"));
|
|
42
|
+
const path_1 = __importDefault(require("path"));
|
|
43
|
+
const yaml = __importStar(require("js-yaml"));
|
|
44
|
+
/**
|
|
45
|
+
* Create API routes for ODP schema operations
|
|
46
|
+
*/
|
|
47
|
+
function createSchemaRoutes(app) {
|
|
48
|
+
const router = express_1.default.Router();
|
|
49
|
+
/**
|
|
50
|
+
* GET /schema/odp - Discover and return parsed src/schema/*.yml files
|
|
51
|
+
*/
|
|
52
|
+
router.get('/odp', (req, res) => {
|
|
53
|
+
try {
|
|
54
|
+
const schemaDir = path_1.default.join(app.path, 'src', 'schema');
|
|
55
|
+
if (!fs_1.default.existsSync(schemaDir)) {
|
|
56
|
+
return res.json({ schemas: [] });
|
|
57
|
+
}
|
|
58
|
+
const files = fs_1.default.readdirSync(schemaDir)
|
|
59
|
+
.filter(f => f.endsWith('.yml') || f.endsWith('.yaml'))
|
|
60
|
+
.sort();
|
|
61
|
+
const schemas = files.map(filename => {
|
|
62
|
+
const filePath = path_1.default.join(schemaDir, filename);
|
|
63
|
+
const content = fs_1.default.readFileSync(filePath, 'utf8');
|
|
64
|
+
try {
|
|
65
|
+
const parsed = yaml.load(content);
|
|
66
|
+
return {
|
|
67
|
+
filename,
|
|
68
|
+
filePath: `src/schema/${filename}`,
|
|
69
|
+
parsed,
|
|
70
|
+
raw: content,
|
|
71
|
+
error: null,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catch (parseError) {
|
|
75
|
+
return {
|
|
76
|
+
filename,
|
|
77
|
+
filePath: `src/schema/${filename}`,
|
|
78
|
+
parsed: null,
|
|
79
|
+
raw: content,
|
|
80
|
+
error: parseError instanceof Error ? parseError.message : String(parseError),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
res.json({ schemas });
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
res.status(500).json({
|
|
88
|
+
error: 'Failed to discover schema files',
|
|
89
|
+
details: error instanceof Error ? error.message : String(error),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return router;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/server/api/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,gDAmDC;AA5DD,sDAAqD;AACrD,4CAAoB;AACpB,gDAAwB;AACxB,8CAAgC;AAGhC;;GAEG;AACH,SAAgB,kBAAkB,CAAC,GAAQ;IACzC,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAY,EAAE,GAAa,EAAE,EAAE;QACjD,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;YAEvD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC9B,OAAO,GAAG,CAAC,IAAI,C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AAE,iCAAiC;gBACxC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { App } from '../../types/app';
|
|
3
|
-
import { LocalConfigStore } from '../../local_engine/storage/LocalConfigStore';
|
|
4
3
|
/**
|
|
5
4
|
* Create API routes for source testing
|
|
6
5
|
*/
|
|
7
|
-
export declare function createSourceRoutes(app: App, appRootDir: string
|
|
6
|
+
export declare function createSourceRoutes(app: App, appRootDir: string): express.Router;
|
|
@@ -6,11 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.createSourceRoutes = createSourceRoutes;
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const LogManager_1 = require("../../logging/LogManager");
|
|
9
|
-
const SourceExecutor_1 = require("../../executor/SourceExecutor");
|
|
10
9
|
const local_engine_client_1 = require("../../local_engine/local-engine-client");
|
|
11
|
-
const mockDataGenerator_1 = require("../mockDataGenerator");
|
|
12
10
|
const SourceDataStore_1 = require("../../local_engine/storage/SourceDataStore");
|
|
13
|
-
const SourceJobExecutionStore_1 = require("../../local_engine/storage/SourceJobExecutionStore");
|
|
14
11
|
const config_1 = require("../config");
|
|
15
12
|
const logger = LogManager_1.LogManager.getInstance();
|
|
16
13
|
/**
|
|
@@ -28,33 +25,21 @@ function createAppConfig(app) {
|
|
|
28
25
|
/**
|
|
29
26
|
* Create API routes for source testing
|
|
30
27
|
*/
|
|
31
|
-
function createSourceRoutes(app, appRootDir
|
|
28
|
+
function createSourceRoutes(app, appRootDir) {
|
|
32
29
|
const router = express_1.default.Router();
|
|
33
|
-
const sourceExecutor = new SourceExecutor_1.SourceExecutor(app, configStore);
|
|
34
30
|
const localEngineClient = local_engine_client_1.LocalEngineClient.getInstance();
|
|
35
|
-
const sourceDataStore =
|
|
36
|
-
const sourceJobExecutionStore = new SourceJobExecutionStore_1.SourceJobExecutionStore(appRootDir);
|
|
31
|
+
const sourceDataStore = SourceDataStore_1.SourceDataStore.getInstance(appRootDir);
|
|
37
32
|
/**
|
|
38
33
|
* GET /sources - List all sources from app manifest
|
|
39
34
|
*/
|
|
40
35
|
router.get('/', (req, res) => {
|
|
41
36
|
try {
|
|
42
|
-
const protocol = req.protocol;
|
|
43
|
-
const host = req.get('host') || `${config_1.config.server.host}:${config_1.config.server.port}`;
|
|
44
37
|
const sources = app.manifest.sources || {};
|
|
45
|
-
const sourceList = Object.keys(sources).map(id => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
id,
|
|
51
|
-
description: sources[id].description,
|
|
52
|
-
entry_point: sources[id].function?.entry_point,
|
|
53
|
-
schema: sources[id].schema,
|
|
54
|
-
jobs: sources[id].jobs,
|
|
55
|
-
webhookUrl
|
|
56
|
-
};
|
|
57
|
-
});
|
|
38
|
+
const sourceList = Object.keys(sources).map(id => ({
|
|
39
|
+
id,
|
|
40
|
+
description: sources[id].description,
|
|
41
|
+
schema: sources[id].schema,
|
|
42
|
+
}));
|
|
58
43
|
res.json({ sources: sourceList });
|
|
59
44
|
}
|
|
60
45
|
catch (error) {
|
|
@@ -94,257 +79,16 @@ function createSourceRoutes(app, appRootDir, configStore) {
|
|
|
94
79
|
}
|
|
95
80
|
});
|
|
96
81
|
/**
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
router.post('/:sourceId/create', async (req, res) => {
|
|
100
|
-
try {
|
|
101
|
-
const { sourceId } = req.params;
|
|
102
|
-
const sources = app.manifest.sources || {};
|
|
103
|
-
if (!sources[sourceId]) {
|
|
104
|
-
return res.status(404).json({ error: `Source ${sourceId} not found` });
|
|
105
|
-
}
|
|
106
|
-
const result = await sourceExecutor.executeSourceCreate(sourceId);
|
|
107
|
-
res.json({ result });
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
const sourceId = req.params.sourceId;
|
|
111
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to execute source create', {
|
|
112
|
-
id: sourceId,
|
|
113
|
-
operation: 'create',
|
|
114
|
-
error
|
|
115
|
-
});
|
|
116
|
-
res.status(500).json({
|
|
117
|
-
error: 'Failed to execute source create',
|
|
118
|
-
details: error instanceof Error ? error.message : String(error)
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
/**
|
|
123
|
-
* POST /sources/:sourceId/update - Trigger onSourceUpdate lifecycle
|
|
124
|
-
*/
|
|
125
|
-
router.post('/:sourceId/update', async (req, res) => {
|
|
126
|
-
try {
|
|
127
|
-
const { sourceId } = req.params;
|
|
128
|
-
const sources = app.manifest.sources || {};
|
|
129
|
-
if (!sources[sourceId]) {
|
|
130
|
-
return res.status(404).json({ error: `Source ${sourceId} not found` });
|
|
131
|
-
}
|
|
132
|
-
const result = await sourceExecutor.executeSourceUpdate(sourceId);
|
|
133
|
-
res.json({ result });
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
const sourceId = req.params.sourceId;
|
|
137
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to execute source update', {
|
|
138
|
-
id: sourceId,
|
|
139
|
-
operation: 'update',
|
|
140
|
-
error
|
|
141
|
-
});
|
|
142
|
-
res.status(500).json({
|
|
143
|
-
error: 'Failed to execute source update',
|
|
144
|
-
details: error instanceof Error ? error.message : String(error)
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
/**
|
|
149
|
-
* POST /sources/:sourceId/delete - Trigger onSourceDelete lifecycle
|
|
150
|
-
*/
|
|
151
|
-
router.post('/:sourceId/delete', async (req, res) => {
|
|
152
|
-
try {
|
|
153
|
-
const { sourceId } = req.params;
|
|
154
|
-
const sources = app.manifest.sources || {};
|
|
155
|
-
if (!sources[sourceId]) {
|
|
156
|
-
return res.status(404).json({ error: `Source ${sourceId} not found` });
|
|
157
|
-
}
|
|
158
|
-
const result = await sourceExecutor.executeSourceDelete(sourceId);
|
|
159
|
-
res.json({ result });
|
|
160
|
-
}
|
|
161
|
-
catch (error) {
|
|
162
|
-
const sourceId = req.params.sourceId;
|
|
163
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to execute source delete', {
|
|
164
|
-
id: sourceId,
|
|
165
|
-
operation: 'delete',
|
|
166
|
-
error
|
|
167
|
-
});
|
|
168
|
-
res.status(500).json({
|
|
169
|
-
error: 'Failed to execute source delete',
|
|
170
|
-
details: error instanceof Error ? error.message : String(error)
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
/**
|
|
175
|
-
* POST /sources/:sourceId/enable - Trigger onSourceEnable lifecycle
|
|
176
|
-
*/
|
|
177
|
-
router.post('/:sourceId/enable', async (req, res) => {
|
|
178
|
-
try {
|
|
179
|
-
const { sourceId } = req.params;
|
|
180
|
-
const sources = app.manifest.sources || {};
|
|
181
|
-
if (!sources[sourceId]) {
|
|
182
|
-
return res.status(404).json({ error: `Source ${sourceId} not found` });
|
|
183
|
-
}
|
|
184
|
-
const result = await sourceExecutor.executeSourceEnable(sourceId);
|
|
185
|
-
res.json({ result });
|
|
186
|
-
}
|
|
187
|
-
catch (error) {
|
|
188
|
-
const sourceId = req.params.sourceId;
|
|
189
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to execute source enable', {
|
|
190
|
-
id: sourceId,
|
|
191
|
-
operation: 'enable',
|
|
192
|
-
error
|
|
193
|
-
});
|
|
194
|
-
res.status(500).json({
|
|
195
|
-
error: 'Failed to execute source enable',
|
|
196
|
-
details: error instanceof Error ? error.message : String(error)
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
/**
|
|
201
|
-
* POST /sources/:sourceId/pause - Trigger onSourcePause lifecycle
|
|
202
|
-
*/
|
|
203
|
-
router.post('/:sourceId/pause', async (req, res) => {
|
|
204
|
-
try {
|
|
205
|
-
const { sourceId } = req.params;
|
|
206
|
-
const sources = app.manifest.sources || {};
|
|
207
|
-
if (!sources[sourceId]) {
|
|
208
|
-
return res.status(404).json({ error: `Source ${sourceId} not found` });
|
|
209
|
-
}
|
|
210
|
-
const result = await sourceExecutor.executeSourcePause(sourceId);
|
|
211
|
-
res.json({ result });
|
|
212
|
-
}
|
|
213
|
-
catch (error) {
|
|
214
|
-
const sourceId = req.params.sourceId;
|
|
215
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to execute source pause', {
|
|
216
|
-
id: sourceId,
|
|
217
|
-
operation: 'pause',
|
|
218
|
-
error
|
|
219
|
-
});
|
|
220
|
-
res.status(500).json({
|
|
221
|
-
error: 'Failed to execute source pause',
|
|
222
|
-
details: error instanceof Error ? error.message : String(error)
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
/**
|
|
227
|
-
* POST /sources/:sourceId/jobs/:jobId - Execute source job
|
|
82
|
+
* GET /sources/data - Retrieve all emitted source data from SourceDataStore
|
|
228
83
|
*/
|
|
229
|
-
router.
|
|
84
|
+
router.get('/data', (req, res) => {
|
|
230
85
|
try {
|
|
231
|
-
const {
|
|
232
|
-
|
|
233
|
-
const sources = app.manifest.sources || {};
|
|
234
|
-
if (!sources[sourceId]) {
|
|
235
|
-
return res.status(404).json({ error: `Source ${sourceId} not found` });
|
|
236
|
-
}
|
|
237
|
-
const jobs = sources[sourceId].jobs || {};
|
|
238
|
-
if (!jobs[jobId]) {
|
|
239
|
-
return res.status(404).json({ error: `Job ${jobId} not found in source ${sourceId}` });
|
|
240
|
-
}
|
|
241
|
-
const result = await sourceExecutor.executeSourceJob({
|
|
242
|
-
sourceId,
|
|
243
|
-
jobId,
|
|
244
|
-
parameters
|
|
245
|
-
});
|
|
246
|
-
res.json({ result });
|
|
247
|
-
}
|
|
248
|
-
catch (error) {
|
|
249
|
-
const { sourceId, jobId } = req.params;
|
|
250
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to execute source job', {
|
|
251
|
-
id: sourceId,
|
|
252
|
-
operation: 'job',
|
|
253
|
-
error
|
|
254
|
-
});
|
|
255
|
-
res.status(500).json({
|
|
256
|
-
error: 'Failed to execute source job',
|
|
257
|
-
details: error instanceof Error ? error.message : String(error)
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
/**
|
|
262
|
-
* GET /sources/:sourceId/jobs/:jobId/executions - Get job execution history
|
|
263
|
-
*/
|
|
264
|
-
router.get('/:sourceId/jobs/:jobId/executions', (req, res) => {
|
|
265
|
-
try {
|
|
266
|
-
const { sourceId, jobId } = req.params;
|
|
267
|
-
const executions = sourceJobExecutionStore.getExecutions(sourceId, jobId);
|
|
268
|
-
res.json({ executions });
|
|
269
|
-
}
|
|
270
|
-
catch (error) {
|
|
271
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to fetch job executions', {
|
|
272
|
-
id: req.params.sourceId,
|
|
273
|
-
operation: 'job-executions',
|
|
274
|
-
error
|
|
275
|
-
});
|
|
276
|
-
res.status(500).json({
|
|
277
|
-
error: 'Failed to fetch job executions',
|
|
278
|
-
details: error instanceof Error ? error.message : String(error)
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
/**
|
|
283
|
-
* GET /sources/:sourceId/job-executions - Get all job executions for source
|
|
284
|
-
*/
|
|
285
|
-
router.get('/:sourceId/job-executions', (req, res) => {
|
|
286
|
-
try {
|
|
287
|
-
const { sourceId } = req.params;
|
|
288
|
-
const executions = sourceJobExecutionStore.getExecutions(sourceId);
|
|
289
|
-
res.json({ executions });
|
|
290
|
-
}
|
|
291
|
-
catch (error) {
|
|
292
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to fetch all job executions', {
|
|
293
|
-
id: req.params.sourceId,
|
|
294
|
-
operation: 'all-job-executions',
|
|
295
|
-
error
|
|
296
|
-
});
|
|
297
|
-
res.status(500).json({
|
|
298
|
-
error: 'Failed to fetch all job executions',
|
|
299
|
-
details: error instanceof Error ? error.message : String(error)
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
/**
|
|
304
|
-
* POST /sources/:sourceId/generate-mock - Generate mock webhook data
|
|
305
|
-
*/
|
|
306
|
-
router.post('/:sourceId/generate-mock', async (req, res) => {
|
|
307
|
-
try {
|
|
308
|
-
const { sourceId } = req.params;
|
|
309
|
-
const sources = app.manifest.sources || {};
|
|
310
|
-
if (!sources[sourceId]) {
|
|
311
|
-
return res.status(404).json({ error: `Source ${sourceId} not found` });
|
|
312
|
-
}
|
|
313
|
-
// Get schema via IPC
|
|
314
|
-
const schema = await localEngineClient.executeSourceSchema(sourceId, createAppConfig(app));
|
|
315
|
-
// Reuse destination mock generator
|
|
316
|
-
const mockBatch = (0, mockDataGenerator_1.generateMockBatch)(schema, 1);
|
|
317
|
-
// Extract just the items for webhook payload
|
|
318
|
-
res.json({ data: mockBatch.items[0] });
|
|
319
|
-
}
|
|
320
|
-
catch (error) {
|
|
321
|
-
const sourceId = req.params.sourceId;
|
|
322
|
-
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to generate mock data', {
|
|
323
|
-
id: sourceId,
|
|
324
|
-
operation: 'generate-mock',
|
|
325
|
-
error
|
|
326
|
-
});
|
|
327
|
-
res.status(500).json({
|
|
328
|
-
error: 'Failed to generate mock data',
|
|
329
|
-
details: error instanceof Error ? error.message : String(error)
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
/**
|
|
334
|
-
* GET /sources/:sourceId/data - Retrieve pushed data from SourceDataStore
|
|
335
|
-
* Query params: limit (number), context ('webhook' | 'job')
|
|
336
|
-
*/
|
|
337
|
-
router.get('/:sourceId/data', (req, res) => {
|
|
338
|
-
try {
|
|
339
|
-
const { sourceId } = req.params;
|
|
340
|
-
const limit = req.query.limit ? parseInt(req.query.limit, 10) : undefined;
|
|
341
|
-
const context = req.query.context;
|
|
342
|
-
const data = sourceDataStore.getData(sourceId, context, limit);
|
|
343
|
-
res.json({ data });
|
|
86
|
+
const { entries, totalEmitted } = sourceDataStore.getData();
|
|
87
|
+
res.json({ entries, totalEmitted });
|
|
344
88
|
}
|
|
345
89
|
catch (error) {
|
|
346
90
|
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to fetch source data', {
|
|
347
|
-
id:
|
|
91
|
+
id: 'all',
|
|
348
92
|
operation: 'data',
|
|
349
93
|
error
|
|
350
94
|
});
|
|
@@ -355,19 +99,16 @@ function createSourceRoutes(app, appRootDir, configStore) {
|
|
|
355
99
|
}
|
|
356
100
|
});
|
|
357
101
|
/**
|
|
358
|
-
* DELETE /sources
|
|
359
|
-
* Query params: context ('webhook' | 'job') - optional, clears all if not specified
|
|
102
|
+
* DELETE /sources/data - Clear all emitted source data
|
|
360
103
|
*/
|
|
361
|
-
router.delete('
|
|
104
|
+
router.delete('/data', (req, res) => {
|
|
362
105
|
try {
|
|
363
|
-
|
|
364
|
-
const context = req.query.context;
|
|
365
|
-
sourceDataStore.clear(sourceId, context);
|
|
106
|
+
sourceDataStore.clear();
|
|
366
107
|
res.json({ success: true });
|
|
367
108
|
}
|
|
368
109
|
catch (error) {
|
|
369
110
|
logger.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Source, 'Failed to clear source data', {
|
|
370
|
-
id:
|
|
111
|
+
id: 'all',
|
|
371
112
|
operation: 'clear-data',
|
|
372
113
|
error
|
|
373
114
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../../../../src/server/api/sources.ts"],"names":[],"mappings":";;;;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