@optimizely/ocp-local-env 1.0.0-beta.4
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 +165 -0
- package/dist/package.json +104 -0
- package/dist/public/bundle.da978bb5437cd82e6d37.js +3 -0
- package/dist/public/bundle.da978bb5437cd82e6d37.js.LICENSE.txt +49 -0
- package/dist/public/bundle.da978bb5437cd82e6d37.js.map +1 -0
- package/dist/public/index.html +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +88 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/executor/FunctionExecutor.d.ts +56 -0
- package/dist/src/executor/FunctionExecutor.js +175 -0
- package/dist/src/executor/FunctionExecutor.js.map +1 -0
- package/dist/src/executor/JobExecutor.d.ts +60 -0
- package/dist/src/executor/JobExecutor.js +203 -0
- package/dist/src/executor/JobExecutor.js.map +1 -0
- package/dist/src/executor/LifecycleExecutor.d.ts +45 -0
- package/dist/src/executor/LifecycleExecutor.js +153 -0
- package/dist/src/executor/LifecycleExecutor.js.map +1 -0
- package/dist/src/executor/watcher.d.ts +63 -0
- package/dist/src/executor/watcher.js +213 -0
- package/dist/src/executor/watcher.js.map +1 -0
- package/dist/src/functions/hello.d.ts +4 -0
- package/dist/src/functions/hello.js +8 -0
- package/dist/src/functions/hello.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/jobs/dailyJob.d.ts +4 -0
- package/dist/src/jobs/dailyJob.js +8 -0
- package/dist/src/jobs/dailyJob.js.map +1 -0
- package/dist/src/local_engine/LocalNotifier.d.ts +10 -0
- package/dist/src/local_engine/LocalNotifier.js +26 -0
- package/dist/src/local_engine/LocalNotifier.js.map +1 -0
- package/dist/src/local_engine/local-engine-child-base.d.ts +79 -0
- package/dist/src/local_engine/local-engine-child-base.js +304 -0
- package/dist/src/local_engine/local-engine-child-base.js.map +1 -0
- package/dist/src/local_engine/local-engine-client.d.ts +80 -0
- package/dist/src/local_engine/local-engine-client.js +333 -0
- package/dist/src/local_engine/local-engine-client.js.map +1 -0
- package/dist/src/local_engine/local-engine-types.d.ts +132 -0
- package/dist/src/local_engine/local-engine-types.js +6 -0
- package/dist/src/local_engine/local-engine-types.js.map +1 -0
- package/dist/src/local_engine/local-engine-unified.d.ts +40 -0
- package/dist/src/local_engine/local-engine-unified.js +406 -0
- package/dist/src/local_engine/local-engine-unified.js.map +1 -0
- package/dist/src/local_engine/local-engine-utils.d.ts +70 -0
- package/dist/src/local_engine/local-engine-utils.js +192 -0
- package/dist/src/local_engine/local-engine-utils.js.map +1 -0
- package/dist/src/local_engine/localSDKConfig.d.ts +30 -0
- package/dist/src/local_engine/localSDKConfig.js +392 -0
- package/dist/src/local_engine/localSDKConfig.js.map +1 -0
- package/dist/src/local_engine/storage/LocalConfigStore.d.ts +56 -0
- package/dist/src/local_engine/storage/LocalConfigStore.js +129 -0
- package/dist/src/local_engine/storage/LocalConfigStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalJobStore.d.ts +110 -0
- package/dist/src/local_engine/storage/LocalJobStore.js +239 -0
- package/dist/src/local_engine/storage/LocalJobStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalKVStore.d.ts +105 -0
- package/dist/src/local_engine/storage/LocalKVStore.js +1002 -0
- package/dist/src/local_engine/storage/LocalKVStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalNotificationStore.d.ts +27 -0
- package/dist/src/local_engine/storage/LocalNotificationStore.js +125 -0
- package/dist/src/local_engine/storage/LocalNotificationStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalSecretsStore.d.ts +114 -0
- package/dist/src/local_engine/storage/LocalSecretsStore.js +319 -0
- package/dist/src/local_engine/storage/LocalSecretsStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalSettingsStore.d.ts +161 -0
- package/dist/src/local_engine/storage/LocalSettingsStore.js +417 -0
- package/dist/src/local_engine/storage/LocalSettingsStore.js.map +1 -0
- package/dist/src/local_engine/storage/NumberSet.d.ts +21 -0
- package/dist/src/local_engine/storage/NumberSet.js +32 -0
- package/dist/src/local_engine/storage/NumberSet.js.map +1 -0
- package/dist/src/local_engine/storage/StringSet.d.ts +21 -0
- package/dist/src/local_engine/storage/StringSet.js +32 -0
- package/dist/src/local_engine/storage/StringSet.js.map +1 -0
- package/dist/src/local_engine/types.d.ts +52 -0
- package/dist/src/local_engine/types.js +6 -0
- package/dist/src/local_engine/types.js.map +1 -0
- package/dist/src/local_engine/utils.d.ts +31 -0
- package/dist/src/local_engine/utils.js +126 -0
- package/dist/src/local_engine/utils.js.map +1 -0
- package/dist/src/logging/LogManager.d.ts +89 -0
- package/dist/src/logging/LogManager.js +237 -0
- package/dist/src/logging/LogManager.js.map +1 -0
- package/dist/src/server/api/functions.d.ts +7 -0
- package/dist/src/server/api/functions.js +80 -0
- package/dist/src/server/api/functions.js.map +1 -0
- package/dist/src/server/api/jobs.d.ts +8 -0
- package/dist/src/server/api/jobs.js +242 -0
- package/dist/src/server/api/jobs.js.map +1 -0
- package/dist/src/server/api/lifecycle.d.ts +6 -0
- package/dist/src/server/api/lifecycle.js +73 -0
- package/dist/src/server/api/lifecycle.js.map +1 -0
- package/dist/src/server/api/settings.d.ts +6 -0
- package/dist/src/server/api/settings.js +117 -0
- package/dist/src/server/api/settings.js.map +1 -0
- package/dist/src/server/api/stores.d.ts +2 -0
- package/dist/src/server/api/stores.js +341 -0
- package/dist/src/server/api/stores.js.map +1 -0
- package/dist/src/server/api/v1.d.ts +10 -0
- package/dist/src/server/api/v1.js +711 -0
- package/dist/src/server/api/v1.js.map +1 -0
- package/dist/src/server/api.d.ts +8 -0
- package/dist/src/server/api.js +154 -0
- package/dist/src/server/api.js.map +1 -0
- package/dist/src/server/app-discovery.d.ts +5 -0
- package/dist/src/server/app-discovery.js +81 -0
- package/dist/src/server/app-discovery.js.map +1 -0
- package/dist/src/server/config.d.ts +21 -0
- package/dist/src/server/config.js +100 -0
- package/dist/src/server/config.js.map +1 -0
- package/dist/src/server/websocket.d.ts +0 -0
- package/dist/src/server/websocket.js +2 -0
- package/dist/src/server/websocket.js.map +1 -0
- package/dist/src/server.d.ts +2 -0
- package/dist/src/server.js +546 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/types/app.d.ts +155 -0
- package/dist/src/types/app.js +24 -0
- package/dist/src/types/app.js.map +1 -0
- package/dist/src/types/kvstore.d.ts +320 -0
- package/dist/src/types/kvstore.js +5 -0
- package/dist/src/types/kvstore.js.map +1 -0
- package/dist/src/ui/components/App.d.ts +6 -0
- package/dist/src/ui/components/App.js +255 -0
- package/dist/src/ui/components/App.js.map +1 -0
- package/dist/src/ui/components/FunctionsView.d.ts +6 -0
- package/dist/src/ui/components/FunctionsView.js +217 -0
- package/dist/src/ui/components/FunctionsView.js.map +1 -0
- package/dist/src/ui/components/JobsView.d.ts +6 -0
- package/dist/src/ui/components/JobsView.js +257 -0
- package/dist/src/ui/components/JobsView.js.map +1 -0
- package/dist/src/ui/components/KVStoreViewer.d.ts +11 -0
- package/dist/src/ui/components/KVStoreViewer.js +168 -0
- package/dist/src/ui/components/KVStoreViewer.js.map +1 -0
- package/dist/src/ui/components/NotificationViewer.d.ts +16 -0
- package/dist/src/ui/components/NotificationViewer.js +69 -0
- package/dist/src/ui/components/NotificationViewer.js.map +1 -0
- package/dist/src/ui/components/SecretsStoreViewer.d.ts +11 -0
- package/dist/src/ui/components/SecretsStoreViewer.js +179 -0
- package/dist/src/ui/components/SecretsStoreViewer.js.map +1 -0
- package/dist/src/ui/components/SettingsStoreViewer.d.ts +24 -0
- package/dist/src/ui/components/SettingsStoreViewer.js +132 -0
- package/dist/src/ui/components/SettingsStoreViewer.js.map +1 -0
- package/dist/src/ui/components/StoreViewer.d.ts +16 -0
- package/dist/src/ui/components/StoreViewer.js +86 -0
- package/dist/src/ui/components/StoreViewer.js.map +1 -0
- package/dist/src/ui/components/TabbedConsole.d.ts +15 -0
- package/dist/src/ui/components/TabbedConsole.js +93 -0
- package/dist/src/ui/components/TabbedConsole.js.map +1 -0
- package/dist/src/ui/components/common/DataTree.d.ts +15 -0
- package/dist/src/ui/components/common/DataTree.js +95 -0
- package/dist/src/ui/components/common/DataTree.js.map +1 -0
- package/dist/src/ui/components/common/EyeIcon.d.ts +11 -0
- package/dist/src/ui/components/common/EyeIcon.js +11 -0
- package/dist/src/ui/components/common/EyeIcon.js.map +1 -0
- package/dist/src/ui/index.d.ts +1 -0
- package/dist/src/ui/index.js +20 -0
- package/dist/src/ui/index.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StringSet - A Set implementation specifically for strings
|
|
3
|
+
* Extends the built-in Set class to provide type-safe operations for string values
|
|
4
|
+
*/
|
|
5
|
+
export declare class StringSet extends Set<string> {
|
|
6
|
+
constructor(values?: Iterable<string>);
|
|
7
|
+
/**
|
|
8
|
+
* Convert to JSON representation for serialization
|
|
9
|
+
*/
|
|
10
|
+
toJSON(): {
|
|
11
|
+
_type: string;
|
|
12
|
+
values: string[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Create StringSet from JSON representation
|
|
16
|
+
*/
|
|
17
|
+
static fromJSON(json: {
|
|
18
|
+
_type: string;
|
|
19
|
+
values: string[];
|
|
20
|
+
}): StringSet;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringSet = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* StringSet - A Set implementation specifically for strings
|
|
6
|
+
* Extends the built-in Set class to provide type-safe operations for string values
|
|
7
|
+
*/
|
|
8
|
+
class StringSet extends Set {
|
|
9
|
+
constructor(values) {
|
|
10
|
+
super(values);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert to JSON representation for serialization
|
|
14
|
+
*/
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
_type: 'StringSet',
|
|
18
|
+
values: Array.from(this)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create StringSet from JSON representation
|
|
23
|
+
*/
|
|
24
|
+
static fromJSON(json) {
|
|
25
|
+
if (json._type !== 'StringSet') {
|
|
26
|
+
throw new Error('Invalid StringSet JSON representation');
|
|
27
|
+
}
|
|
28
|
+
return new StringSet(json.values);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.StringSet = StringSet;
|
|
32
|
+
//# sourceMappingURL=StringSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringSet.js","sourceRoot":"","sources":["../../../../src/local_engine/storage/StringSet.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,SAAU,SAAQ,GAAW;IACxC,YAAY,MAAyB;QACnC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;SACzB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAyC;QACvD,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF;AAxBD,8BAwBC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for wrapper script communication
|
|
3
|
+
*/
|
|
4
|
+
export interface FunctionExecutionRequest {
|
|
5
|
+
functionId: string;
|
|
6
|
+
method: string;
|
|
7
|
+
fullpath: string;
|
|
8
|
+
path: string;
|
|
9
|
+
params: Record<string, any>;
|
|
10
|
+
headers: [string, string][];
|
|
11
|
+
body: any;
|
|
12
|
+
}
|
|
13
|
+
export interface FunctionExecutionResponse {
|
|
14
|
+
success: boolean;
|
|
15
|
+
status?: number;
|
|
16
|
+
headers?: [string, string][];
|
|
17
|
+
body?: any;
|
|
18
|
+
logs: string[];
|
|
19
|
+
error?: string;
|
|
20
|
+
stack?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface LifecycleExecutionRequest {
|
|
23
|
+
method: string;
|
|
24
|
+
params?: any;
|
|
25
|
+
scriptPath: string;
|
|
26
|
+
appDir: string;
|
|
27
|
+
}
|
|
28
|
+
export interface LifecycleExecutionResponse {
|
|
29
|
+
success: boolean;
|
|
30
|
+
logs: string[];
|
|
31
|
+
error?: string;
|
|
32
|
+
stack?: string;
|
|
33
|
+
result?: any;
|
|
34
|
+
}
|
|
35
|
+
export interface AppConfig {
|
|
36
|
+
manifest: any;
|
|
37
|
+
path: string;
|
|
38
|
+
isBuilt: boolean;
|
|
39
|
+
isValid: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface WrapperInput {
|
|
42
|
+
appConfig: AppConfig;
|
|
43
|
+
appDir: string;
|
|
44
|
+
request: FunctionExecutionRequest | LifecycleExecutionRequest;
|
|
45
|
+
}
|
|
46
|
+
export interface WrapperOutput {
|
|
47
|
+
success: boolean;
|
|
48
|
+
result?: any;
|
|
49
|
+
error?: string;
|
|
50
|
+
stack?: string;
|
|
51
|
+
logs?: string[];
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/local_engine/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface SDKComponents {
|
|
2
|
+
App: any;
|
|
3
|
+
initializeStores: any;
|
|
4
|
+
LogLevel: any;
|
|
5
|
+
setNotifier: any;
|
|
6
|
+
initializeFunctionApi?: any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Dynamically load the SDK from the app's node_modules
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadAppSDK(appPath: string): SDKComponents;
|
|
12
|
+
/**
|
|
13
|
+
* Find the correct function file path using entry_point from manifest
|
|
14
|
+
*/
|
|
15
|
+
export declare function findFunctionFile(appDir: string, functionId: string, manifest: any): string;
|
|
16
|
+
/**
|
|
17
|
+
* Find the Function class export from a module
|
|
18
|
+
*/
|
|
19
|
+
export declare function findFunctionClass(functionModule: any): any;
|
|
20
|
+
/**
|
|
21
|
+
* Find the Lifecycle class export from a module
|
|
22
|
+
*/
|
|
23
|
+
export declare function findLifecycleClass(lifecycleModule: any): any;
|
|
24
|
+
/**
|
|
25
|
+
* Parse command line arguments into structured input
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseWrapperArgs(): any;
|
|
28
|
+
/**
|
|
29
|
+
* Output result in the expected format for the parent process
|
|
30
|
+
*/
|
|
31
|
+
export declare function outputResult(result: any): void;
|
|
@@ -0,0 +1,126 @@
|
|
|
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.outputResult = exports.parseWrapperArgs = exports.findLifecycleClass = exports.findFunctionClass = exports.findFunctionFile = exports.loadAppSDK = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Shared utilities for wrapper scripts
|
|
9
|
+
*/
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
/**
|
|
13
|
+
* Dynamically load the SDK from the app's node_modules
|
|
14
|
+
*/
|
|
15
|
+
function loadAppSDK(appPath) {
|
|
16
|
+
const appSdkPath = path_1.default.join(appPath, 'node_modules', '@zaiusinc/app-sdk');
|
|
17
|
+
try {
|
|
18
|
+
const App = require(appSdkPath);
|
|
19
|
+
const { initializeStores, LogLevel, setNotifier, initializeFunctionApi } = require(appSdkPath);
|
|
20
|
+
return {
|
|
21
|
+
App,
|
|
22
|
+
initializeStores,
|
|
23
|
+
LogLevel,
|
|
24
|
+
setNotifier,
|
|
25
|
+
initializeFunctionApi
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw new Error(`Failed to load SDK from ${appSdkPath}: ${error.message}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.loadAppSDK = loadAppSDK;
|
|
33
|
+
/**
|
|
34
|
+
* Find the correct function file path using entry_point from manifest
|
|
35
|
+
*/
|
|
36
|
+
function findFunctionFile(appDir, functionId, manifest) {
|
|
37
|
+
const functions = manifest.functions || {};
|
|
38
|
+
const functionDef = functions[functionId];
|
|
39
|
+
if (!functionDef) {
|
|
40
|
+
throw new Error(`Function '${functionId}' not found in app manifest`);
|
|
41
|
+
}
|
|
42
|
+
if (!functionDef.entry_point) {
|
|
43
|
+
throw new Error(`Function '${functionId}' does not have entry_point defined in manifest`);
|
|
44
|
+
}
|
|
45
|
+
const functionPath = path_1.default.join(appDir, "dist", "functions", `${functionDef.entry_point}.js`);
|
|
46
|
+
if (!fs_1.default.existsSync(functionPath)) {
|
|
47
|
+
throw new Error(`Function file not found: ${functionPath}. Make sure the app is built and the entry_point '${functionDef.entry_point}' matches the compiled file name.`);
|
|
48
|
+
}
|
|
49
|
+
return functionPath;
|
|
50
|
+
}
|
|
51
|
+
exports.findFunctionFile = findFunctionFile;
|
|
52
|
+
/**
|
|
53
|
+
* Find the Function class export from a module
|
|
54
|
+
*/
|
|
55
|
+
function findFunctionClass(functionModule) {
|
|
56
|
+
// Look for the Function class - it could be default export or named export
|
|
57
|
+
let FunctionClass = functionModule.default || functionModule[Object.keys(functionModule)[0]];
|
|
58
|
+
if (!FunctionClass) {
|
|
59
|
+
// Try to find a class that looks like a function class
|
|
60
|
+
for (const key in functionModule) {
|
|
61
|
+
if (typeof functionModule[key] === 'function') {
|
|
62
|
+
FunctionClass = functionModule[key];
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (!FunctionClass || typeof FunctionClass !== 'function') {
|
|
68
|
+
throw new Error(`Function class not found in module. Available exports: ${Object.keys(functionModule).join(', ')}`);
|
|
69
|
+
}
|
|
70
|
+
return FunctionClass;
|
|
71
|
+
}
|
|
72
|
+
exports.findFunctionClass = findFunctionClass;
|
|
73
|
+
/**
|
|
74
|
+
* Find the Lifecycle class export from a module
|
|
75
|
+
*/
|
|
76
|
+
function findLifecycleClass(lifecycleModule) {
|
|
77
|
+
// Look for the Lifecycle class - it could be default export or named export
|
|
78
|
+
let LifecycleClass = lifecycleModule.Lifecycle || lifecycleModule.default;
|
|
79
|
+
if (!LifecycleClass) {
|
|
80
|
+
// If not found, try to find any class that looks like a lifecycle class
|
|
81
|
+
for (const key in lifecycleModule) {
|
|
82
|
+
if (typeof lifecycleModule[key] === 'function' && key.toLowerCase().includes('lifecycle')) {
|
|
83
|
+
LifecycleClass = lifecycleModule[key];
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!LifecycleClass || typeof LifecycleClass !== 'function') {
|
|
89
|
+
throw new Error(`Lifecycle class not found in module. Available exports: ${Object.keys(lifecycleModule).join(', ')}`);
|
|
90
|
+
}
|
|
91
|
+
return LifecycleClass;
|
|
92
|
+
}
|
|
93
|
+
exports.findLifecycleClass = findLifecycleClass;
|
|
94
|
+
/**
|
|
95
|
+
* Parse command line arguments into structured input
|
|
96
|
+
*/
|
|
97
|
+
function parseWrapperArgs() {
|
|
98
|
+
const args = process.argv.slice(2);
|
|
99
|
+
if (args.length === 0) {
|
|
100
|
+
throw new Error('No input provided to wrapper script');
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
return JSON.parse(args[0]);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
throw new Error(`Failed to parse wrapper input: ${error}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.parseWrapperArgs = parseWrapperArgs;
|
|
110
|
+
/**
|
|
111
|
+
* Output result in the expected format for the parent process
|
|
112
|
+
*/
|
|
113
|
+
function outputResult(result) {
|
|
114
|
+
if (result.success) {
|
|
115
|
+
console.log('SUCCESS');
|
|
116
|
+
console.log('RESULT:', JSON.stringify(result.result || null));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
console.error('FAILED:', result.error || 'Unknown error');
|
|
120
|
+
if (result.stack) {
|
|
121
|
+
console.error('STACK:', result.stack);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.outputResult = outputResult;
|
|
126
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/local_engine/utils.ts"],"names":[],"mappings":";;;;;;AAAA;;GAEG;AACH,gDAAwB;AACxB,4CAAoB;AAUpB;;GAEG;AACH,SAAgB,UAAU,CAAC,OAAe;IACxC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC;IAE3E,IAAI;QACF,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QAChC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QAE/F,OAAO;YACL,GAAG;YACH,gBAAgB;YAChB,QAAQ;YACR,WAAW;YACX,qBAAqB;SACtB,CAAC;KACH;IAAC,OAAO,KAAU,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,2BAA2B,UAAU,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;KAC5E;AACH,CAAC;AAjBD,gCAiBC;AAED;;GAEG;AACH,SAAgB,g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gB,YAAY,CAAC,MAAW;IACtC,IAAI,MAAM,CAAC,OAAO,EAAE;QAClB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC;KAC/D;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,IAAI,eAAe,CAAC,CAAC;QAC1D,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;SACvC;KACF;AACH,CAAC;AAVD,oCAUC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized logging system for the OCP Local Environment
|
|
3
|
+
* Captures logs from builds, function executions, lifecycle hooks, and general operations
|
|
4
|
+
*/
|
|
5
|
+
export interface LogEntry {
|
|
6
|
+
id: string;
|
|
7
|
+
timestamp: string;
|
|
8
|
+
source: 'build' | 'function' | 'lifecycle' | 'system' | 'error';
|
|
9
|
+
level: 'debug' | 'info' | 'warn' | 'error';
|
|
10
|
+
category?: string;
|
|
11
|
+
message: string;
|
|
12
|
+
details?: any;
|
|
13
|
+
}
|
|
14
|
+
export declare class LogManager {
|
|
15
|
+
private static instance;
|
|
16
|
+
private logs;
|
|
17
|
+
private maxLogs;
|
|
18
|
+
private logListeners;
|
|
19
|
+
private constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Get the singleton instance
|
|
22
|
+
*/
|
|
23
|
+
static getInstance(): LogManager;
|
|
24
|
+
/**
|
|
25
|
+
* Add a new log entry
|
|
26
|
+
*/
|
|
27
|
+
log(entry: Omit<LogEntry, 'id' | 'timestamp'>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Convenience methods for different log levels
|
|
30
|
+
*/
|
|
31
|
+
debug(source: LogEntry['source'], message: string, category?: string, details?: any): void;
|
|
32
|
+
info(source: LogEntry['source'], message: string, category?: string, details?: any): void;
|
|
33
|
+
warn(source: LogEntry['source'], message: string, category?: string, details?: any): void;
|
|
34
|
+
error(source: LogEntry['source'], message: string, category?: string, details?: any): void;
|
|
35
|
+
/**
|
|
36
|
+
* Get logs with optional filtering
|
|
37
|
+
*/
|
|
38
|
+
getLogs(options?: {
|
|
39
|
+
limit?: number;
|
|
40
|
+
source?: LogEntry['source'];
|
|
41
|
+
level?: LogEntry['level'];
|
|
42
|
+
since?: string;
|
|
43
|
+
category?: string;
|
|
44
|
+
}): LogEntry[];
|
|
45
|
+
/**
|
|
46
|
+
* Clear all logs
|
|
47
|
+
*/
|
|
48
|
+
clearLogs(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Add a listener for new log entries
|
|
51
|
+
*/
|
|
52
|
+
addListener(listener: (log: LogEntry) => void): () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Log function execution
|
|
55
|
+
*/
|
|
56
|
+
logFunctionExecution(functionId: string, status: 'started' | 'success' | 'error', details?: any): void;
|
|
57
|
+
/**
|
|
58
|
+
* Log function output/console logs
|
|
59
|
+
*/
|
|
60
|
+
logFunctionOutput(functionId: string, output: string, isError?: boolean): void;
|
|
61
|
+
/**
|
|
62
|
+
* Log lifecycle execution
|
|
63
|
+
*/
|
|
64
|
+
logLifecycleExecution(hookName: string, status: 'started' | 'success' | 'error', details?: any): void;
|
|
65
|
+
/**
|
|
66
|
+
* Log build events
|
|
67
|
+
*/
|
|
68
|
+
logBuildEvent(status: 'started' | 'success' | 'error', details?: any): void;
|
|
69
|
+
/**
|
|
70
|
+
* Log build output
|
|
71
|
+
*/
|
|
72
|
+
logBuildOutput(output: string, isError?: boolean): void;
|
|
73
|
+
/**
|
|
74
|
+
* Generate a unique ID for log entries
|
|
75
|
+
*/
|
|
76
|
+
private generateId;
|
|
77
|
+
/**
|
|
78
|
+
* Log to console with appropriate styling
|
|
79
|
+
*/
|
|
80
|
+
private logToConsole;
|
|
81
|
+
/**
|
|
82
|
+
* Get log statistics
|
|
83
|
+
*/
|
|
84
|
+
getStats(): {
|
|
85
|
+
total: number;
|
|
86
|
+
bySource: Record<string, number>;
|
|
87
|
+
byLevel: Record<string, number>;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Centralized logging system for the OCP Local Environment
|
|
4
|
+
* Captures logs from builds, function executions, lifecycle hooks, and general operations
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.LogManager = void 0;
|
|
8
|
+
class LogManager {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.logs = [];
|
|
11
|
+
this.maxLogs = 1000; // Keep last 1000 logs
|
|
12
|
+
this.logListeners = [];
|
|
13
|
+
// Private constructor for singleton
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get the singleton instance
|
|
17
|
+
*/
|
|
18
|
+
static getInstance() {
|
|
19
|
+
if (!this.instance) {
|
|
20
|
+
this.instance = new LogManager();
|
|
21
|
+
}
|
|
22
|
+
return this.instance;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Add a new log entry
|
|
26
|
+
*/
|
|
27
|
+
log(entry) {
|
|
28
|
+
const logEntry = {
|
|
29
|
+
...entry,
|
|
30
|
+
id: this.generateId(),
|
|
31
|
+
timestamp: new Date().toISOString()
|
|
32
|
+
};
|
|
33
|
+
this.logs.push(logEntry);
|
|
34
|
+
// Keep only the most recent logs
|
|
35
|
+
if (this.logs.length > this.maxLogs) {
|
|
36
|
+
this.logs = this.logs.slice(-this.maxLogs);
|
|
37
|
+
}
|
|
38
|
+
// Notify listeners
|
|
39
|
+
this.logListeners.forEach(listener => {
|
|
40
|
+
try {
|
|
41
|
+
listener(logEntry);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('Error notifying log listener:', error);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Also log to console for debugging
|
|
48
|
+
this.logToConsole(logEntry);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Convenience methods for different log levels
|
|
52
|
+
*/
|
|
53
|
+
debug(source, message, category, details) {
|
|
54
|
+
this.log({ source, level: 'debug', message, category, details });
|
|
55
|
+
}
|
|
56
|
+
info(source, message, category, details) {
|
|
57
|
+
this.log({ source, level: 'info', message, category, details });
|
|
58
|
+
}
|
|
59
|
+
warn(source, message, category, details) {
|
|
60
|
+
this.log({ source, level: 'warn', message, category, details });
|
|
61
|
+
}
|
|
62
|
+
error(source, message, category, details) {
|
|
63
|
+
this.log({ source, level: 'error', message, category, details });
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get logs with optional filtering
|
|
67
|
+
*/
|
|
68
|
+
getLogs(options) {
|
|
69
|
+
let filteredLogs = this.logs;
|
|
70
|
+
// Apply filters
|
|
71
|
+
if (options?.source) {
|
|
72
|
+
filteredLogs = filteredLogs.filter(log => log.source === options.source);
|
|
73
|
+
}
|
|
74
|
+
if (options?.level) {
|
|
75
|
+
const levels = ['debug', 'info', 'warn', 'error'];
|
|
76
|
+
const minLevelIndex = levels.indexOf(options.level);
|
|
77
|
+
filteredLogs = filteredLogs.filter(log => levels.indexOf(log.level) >= minLevelIndex);
|
|
78
|
+
}
|
|
79
|
+
if (options?.since) {
|
|
80
|
+
const sinceTime = new Date(options.since).getTime();
|
|
81
|
+
filteredLogs = filteredLogs.filter(log => new Date(log.timestamp).getTime() >= sinceTime);
|
|
82
|
+
}
|
|
83
|
+
if (options?.category) {
|
|
84
|
+
filteredLogs = filteredLogs.filter(log => log.category === options.category);
|
|
85
|
+
}
|
|
86
|
+
// Apply limit
|
|
87
|
+
const limit = options?.limit || 100;
|
|
88
|
+
return filteredLogs.slice(-limit);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Clear all logs
|
|
92
|
+
*/
|
|
93
|
+
clearLogs() {
|
|
94
|
+
this.logs = [];
|
|
95
|
+
this.info('system', 'Logs cleared');
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Add a listener for new log entries
|
|
99
|
+
*/
|
|
100
|
+
addListener(listener) {
|
|
101
|
+
this.logListeners.push(listener);
|
|
102
|
+
// Return unsubscribe function
|
|
103
|
+
return () => {
|
|
104
|
+
const index = this.logListeners.indexOf(listener);
|
|
105
|
+
if (index > -1) {
|
|
106
|
+
this.logListeners.splice(index, 1);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Log function execution
|
|
112
|
+
*/
|
|
113
|
+
logFunctionExecution(functionId, status, details) {
|
|
114
|
+
const messages = {
|
|
115
|
+
started: `Function execution started`,
|
|
116
|
+
success: `Function execution completed successfully`,
|
|
117
|
+
error: `Function execution failed`
|
|
118
|
+
};
|
|
119
|
+
const level = status === 'error' ? 'error' : 'info';
|
|
120
|
+
this.log({
|
|
121
|
+
source: 'function',
|
|
122
|
+
level,
|
|
123
|
+
message: messages[status],
|
|
124
|
+
category: functionId,
|
|
125
|
+
details
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Log function output/console logs
|
|
130
|
+
*/
|
|
131
|
+
logFunctionOutput(functionId, output, isError = false) {
|
|
132
|
+
// Split output into lines and log each line
|
|
133
|
+
const lines = output.split('\n').filter(line => line.trim());
|
|
134
|
+
lines.forEach(line => {
|
|
135
|
+
this.log({
|
|
136
|
+
source: 'function',
|
|
137
|
+
level: isError ? 'error' : 'info',
|
|
138
|
+
message: line.trim(),
|
|
139
|
+
category: functionId
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Log lifecycle execution
|
|
145
|
+
*/
|
|
146
|
+
logLifecycleExecution(hookName, status, details) {
|
|
147
|
+
const messages = {
|
|
148
|
+
started: `Lifecycle hook execution started`,
|
|
149
|
+
success: `Lifecycle hook execution completed successfully`,
|
|
150
|
+
error: `Lifecycle hook execution failed`
|
|
151
|
+
};
|
|
152
|
+
const level = status === 'error' ? 'error' : 'info';
|
|
153
|
+
this.log({
|
|
154
|
+
source: 'lifecycle',
|
|
155
|
+
level,
|
|
156
|
+
message: messages[status],
|
|
157
|
+
category: hookName,
|
|
158
|
+
details
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Log build events
|
|
163
|
+
*/
|
|
164
|
+
logBuildEvent(status, details) {
|
|
165
|
+
const messages = {
|
|
166
|
+
started: `Build started`,
|
|
167
|
+
success: `Build completed successfully`,
|
|
168
|
+
error: `Build failed`
|
|
169
|
+
};
|
|
170
|
+
const level = status === 'error' ? 'error' : 'info';
|
|
171
|
+
this.log({
|
|
172
|
+
source: 'build',
|
|
173
|
+
level,
|
|
174
|
+
message: messages[status],
|
|
175
|
+
details
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Log build output
|
|
180
|
+
*/
|
|
181
|
+
logBuildOutput(output, isError = false) {
|
|
182
|
+
// Split output into lines and log each line
|
|
183
|
+
const lines = output.split('\n').filter(line => line.trim());
|
|
184
|
+
lines.forEach(line => {
|
|
185
|
+
this.log({
|
|
186
|
+
source: 'build',
|
|
187
|
+
level: isError ? 'error' : 'info',
|
|
188
|
+
message: line.trim()
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Generate a unique ID for log entries
|
|
194
|
+
*/
|
|
195
|
+
generateId() {
|
|
196
|
+
return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Log to console with appropriate styling
|
|
200
|
+
*/
|
|
201
|
+
logToConsole(entry) {
|
|
202
|
+
const prefix = `[${entry.source.toUpperCase()}${entry.category ? `:${entry.category}` : ''}]`;
|
|
203
|
+
const timestamp = new Date(entry.timestamp).toLocaleTimeString();
|
|
204
|
+
switch (entry.level) {
|
|
205
|
+
case 'error':
|
|
206
|
+
console.error(`${timestamp} ${prefix} ${entry.message}`, entry.details || '');
|
|
207
|
+
break;
|
|
208
|
+
case 'warn':
|
|
209
|
+
console.warn(`${timestamp} ${prefix} ${entry.message}`, entry.details || '');
|
|
210
|
+
break;
|
|
211
|
+
case 'debug':
|
|
212
|
+
console.debug(`${timestamp} ${prefix} ${entry.message}`, entry.details || '');
|
|
213
|
+
break;
|
|
214
|
+
default:
|
|
215
|
+
console.log(`${timestamp} ${prefix} ${entry.message}`, entry.details || '');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Get log statistics
|
|
220
|
+
*/
|
|
221
|
+
getStats() {
|
|
222
|
+
const bySource = {};
|
|
223
|
+
const byLevel = {};
|
|
224
|
+
this.logs.forEach(log => {
|
|
225
|
+
bySource[log.source] = (bySource[log.source] || 0) + 1;
|
|
226
|
+
byLevel[log.level] = (byLevel[log.level] || 0) + 1;
|
|
227
|
+
});
|
|
228
|
+
return {
|
|
229
|
+
total: this.logs.length,
|
|
230
|
+
bySource,
|
|
231
|
+
byLevel
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
exports.LogManager = LogManager;
|
|
236
|
+
LogManager.instance = null;
|
|
237
|
+
//# sourceMappingURL=LogManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogManager.js","sourceRoot":"","sources":["../../../src/logging/LogManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH,MAAa,UAAU;IAMrB;QAJQ,SAAI,GAAe,EAAE,CAAC;QACtB,YAAO,GAAW,IAAI,CAAC,CAAC,sBAAsB;QAC9C,iBAAY,GAAmC,EAAE,CAAC;QAGxD,oCAAoC;IACtC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,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;YACR,OAAO;SACR,CAAC;IACJ,CAAC;;AAzRH,gCA0RC;AAzRgB,mBAAQ,GAAsB,IAAI,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { App } from '../../types/app';
|
|
3
|
+
import { LocalConfigStore } from "../../local_engine/storage/LocalConfigStore";
|
|
4
|
+
/**
|
|
5
|
+
* Create API routes for function execution
|
|
6
|
+
*/
|
|
7
|
+
export declare function createFunctionRoutes(app: App, configStore?: LocalConfigStore): express.Router;
|