@optimizely/ocp-local-env 1.0.0-beta.10
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 +51 -0
- package/dist/package.json +112 -0
- package/dist/public/bundle.82dc5d29fffb9f205051.js +3 -0
- package/dist/public/bundle.82dc5d29fffb9f205051.js.LICENSE.txt +92 -0
- package/dist/public/bundle.82dc5d29fffb9f205051.js.map +1 -0
- package/dist/public/index.html +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +115 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/executor/DestinationExecutor.d.ts +19 -0
- package/dist/src/executor/DestinationExecutor.js +72 -0
- package/dist/src/executor/DestinationExecutor.js.map +1 -0
- package/dist/src/executor/FunctionExecutor.d.ts +67 -0
- package/dist/src/executor/FunctionExecutor.js +189 -0
- package/dist/src/executor/FunctionExecutor.js.map +1 -0
- package/dist/src/executor/JobExecutor.d.ts +79 -0
- package/dist/src/executor/JobExecutor.js +215 -0
- package/dist/src/executor/JobExecutor.js.map +1 -0
- package/dist/src/executor/LifecycleExecutor.d.ts +64 -0
- package/dist/src/executor/LifecycleExecutor.js +167 -0
- package/dist/src/executor/LifecycleExecutor.js.map +1 -0
- package/dist/src/executor/SourceExecutor.d.ts +32 -0
- package/dist/src/executor/SourceExecutor.js +163 -0
- package/dist/src/executor/SourceExecutor.js.map +1 -0
- package/dist/src/executor/watcher.d.ts +62 -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/LocalFunctionApi.d.ts +17 -0
- package/dist/src/local_engine/LocalFunctionApi.js +54 -0
- package/dist/src/local_engine/LocalFunctionApi.js.map +1 -0
- package/dist/src/local_engine/LocalJobApi.d.ts +67 -0
- package/dist/src/local_engine/LocalJobApi.js +205 -0
- package/dist/src/local_engine/LocalJobApi.js.map +1 -0
- package/dist/src/local_engine/LocalNotifier.d.ts +9 -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 +110 -0
- package/dist/src/local_engine/local-engine-child-base.js +607 -0
- package/dist/src/local_engine/local-engine-child-base.js.map +1 -0
- package/dist/src/local_engine/local-engine-client.d.ts +161 -0
- package/dist/src/local_engine/local-engine-client.js +888 -0
- package/dist/src/local_engine/local-engine-client.js.map +1 -0
- package/dist/src/local_engine/local-engine-types.d.ts +245 -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 +71 -0
- package/dist/src/local_engine/local-engine-unified.js +723 -0
- package/dist/src/local_engine/local-engine-unified.js.map +1 -0
- package/dist/src/local_engine/local-engine-utils.d.ts +68 -0
- package/dist/src/local_engine/local-engine-utils.js +219 -0
- package/dist/src/local_engine/local-engine-utils.js.map +1 -0
- package/dist/src/local_engine/localSDKConfig.d.ts +40 -0
- package/dist/src/local_engine/localSDKConfig.js +247 -0
- package/dist/src/local_engine/localSDKConfig.js.map +1 -0
- package/dist/src/local_engine/storage/BaseKVStoreWrapper.d.ts +37 -0
- package/dist/src/local_engine/storage/BaseKVStoreWrapper.js +110 -0
- package/dist/src/local_engine/storage/BaseKVStoreWrapper.js.map +1 -0
- package/dist/src/local_engine/storage/LocalConfigStore.d.ts +74 -0
- package/dist/src/local_engine/storage/LocalConfigStore.js +178 -0
- package/dist/src/local_engine/storage/LocalConfigStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalJobStore.d.ts +111 -0
- package/dist/src/local_engine/storage/LocalJobStore.js +249 -0
- package/dist/src/local_engine/storage/LocalJobStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalKVStore.d.ts +106 -0
- package/dist/src/local_engine/storage/LocalKVStore.js +1061 -0
- package/dist/src/local_engine/storage/LocalKVStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalNotificationStore.d.ts +28 -0
- package/dist/src/local_engine/storage/LocalNotificationStore.js +149 -0
- package/dist/src/local_engine/storage/LocalNotificationStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalSecretsStore.d.ts +115 -0
- package/dist/src/local_engine/storage/LocalSecretsStore.js +350 -0
- package/dist/src/local_engine/storage/LocalSecretsStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalSecretsStoreWrapper.d.ts +19 -0
- package/dist/src/local_engine/storage/LocalSecretsStoreWrapper.js +52 -0
- package/dist/src/local_engine/storage/LocalSecretsStoreWrapper.js.map +1 -0
- package/dist/src/local_engine/storage/LocalSettingsStore.d.ts +168 -0
- package/dist/src/local_engine/storage/LocalSettingsStore.js +509 -0
- package/dist/src/local_engine/storage/LocalSettingsStore.js.map +1 -0
- package/dist/src/local_engine/storage/LocalSettingsStoreWrapper.d.ts +15 -0
- package/dist/src/local_engine/storage/LocalSettingsStoreWrapper.js +28 -0
- package/dist/src/local_engine/storage/LocalSettingsStoreWrapper.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/SourceDataStore.d.ts +23 -0
- package/dist/src/local_engine/storage/SourceDataStore.js +83 -0
- package/dist/src/local_engine/storage/SourceDataStore.js.map +1 -0
- package/dist/src/local_engine/storage/SourceJobExecutionStore.d.ts +25 -0
- package/dist/src/local_engine/storage/SourceJobExecutionStore.js +61 -0
- package/dist/src/local_engine/storage/SourceJobExecutionStore.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 +53 -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 +33 -0
- package/dist/src/local_engine/utils.js +143 -0
- package/dist/src/local_engine/utils.js.map +1 -0
- package/dist/src/logging/LogManager.d.ts +246 -0
- package/dist/src/logging/LogManager.js +343 -0
- package/dist/src/logging/LogManager.js.map +1 -0
- package/dist/src/server/api/destinations.d.ts +7 -0
- package/dist/src/server/api/destinations.js +170 -0
- package/dist/src/server/api/destinations.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 +10 -0
- package/dist/src/server/api/jobs.js +244 -0
- package/dist/src/server/api/jobs.js.map +1 -0
- package/dist/src/server/api/settings.d.ts +6 -0
- package/dist/src/server/api/settings.js +116 -0
- package/dist/src/server/api/settings.js.map +1 -0
- package/dist/src/server/api/sources.d.ts +7 -0
- package/dist/src/server/api/sources.js +382 -0
- package/dist/src/server/api/sources.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 +718 -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 +217 -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 +113 -0
- package/dist/src/server/app-discovery.js.map +1 -0
- package/dist/src/server/config.d.ts +26 -0
- package/dist/src/server/config.js +112 -0
- package/dist/src/server/config.js.map +1 -0
- package/dist/src/server/mockDataGenerator.d.ts +1 -0
- package/dist/src/server/mockDataGenerator.js +154 -0
- package/dist/src/server/mockDataGenerator.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 +735 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/types/app.d.ts +154 -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 +432 -0
- package/dist/src/ui/components/App.js.map +1 -0
- package/dist/src/ui/components/DestinationBatchEditor.d.ts +7 -0
- package/dist/src/ui/components/DestinationBatchEditor.js +160 -0
- package/dist/src/ui/components/DestinationBatchEditor.js.map +1 -0
- package/dist/src/ui/components/DestinationSchemaViewer.d.ts +7 -0
- package/dist/src/ui/components/DestinationSchemaViewer.js +61 -0
- package/dist/src/ui/components/DestinationSchemaViewer.js.map +1 -0
- package/dist/src/ui/components/DestinationsView.d.ts +14 -0
- package/dist/src/ui/components/DestinationsView.js +68 -0
- package/dist/src/ui/components/DestinationsView.js.map +1 -0
- package/dist/src/ui/components/FunctionsView.d.ts +13 -0
- package/dist/src/ui/components/FunctionsView.js +288 -0
- package/dist/src/ui/components/FunctionsView.js.map +1 -0
- package/dist/src/ui/components/JobsView.d.ts +13 -0
- package/dist/src/ui/components/JobsView.js +320 -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/MetadataModal.d.ts +14 -0
- package/dist/src/ui/components/MetadataModal.js +28 -0
- package/dist/src/ui/components/MetadataModal.js.map +1 -0
- package/dist/src/ui/components/MetadataModal.test.d.ts +1 -0
- package/dist/src/ui/components/MetadataModal.test.js +143 -0
- package/dist/src/ui/components/MetadataModal.test.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/SourceDataViewer.d.ts +8 -0
- package/dist/src/ui/components/SourceDataViewer.js +84 -0
- package/dist/src/ui/components/SourceDataViewer.js.map +1 -0
- package/dist/src/ui/components/SourceJobsSection.d.ts +8 -0
- package/dist/src/ui/components/SourceJobsSection.js +99 -0
- package/dist/src/ui/components/SourceJobsSection.js.map +1 -0
- package/dist/src/ui/components/SourceLifecycleSection.d.ts +7 -0
- package/dist/src/ui/components/SourceLifecycleSection.js +58 -0
- package/dist/src/ui/components/SourceLifecycleSection.js.map +1 -0
- package/dist/src/ui/components/SourceSchemaViewer.d.ts +7 -0
- package/dist/src/ui/components/SourceSchemaViewer.js +65 -0
- package/dist/src/ui/components/SourceSchemaViewer.js.map +1 -0
- package/dist/src/ui/components/SourceWebhookEditor.d.ts +8 -0
- package/dist/src/ui/components/SourceWebhookEditor.js +181 -0
- package/dist/src/ui/components/SourceWebhookEditor.js.map +1 -0
- package/dist/src/ui/components/SourcesView.d.ts +14 -0
- package/dist/src/ui/components/SourcesView.js +74 -0
- package/dist/src/ui/components/SourcesView.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 +17 -0
- package/dist/src/ui/components/TabbedConsole.js +163 -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/hooks/useEntityNavigation.d.ts +72 -0
- package/dist/src/ui/hooks/useEntityNavigation.js +150 -0
- package/dist/src/ui/hooks/useEntityNavigation.js.map +1 -0
- package/dist/src/ui/hooks/useQueryParams.d.ts +6 -0
- package/dist/src/ui/hooks/useQueryParams.js +39 -0
- package/dist/src/ui/hooks/useQueryParams.js.map +1 -0
- package/dist/src/ui/index.d.ts +1 -0
- package/dist/src/ui/index.js +23 -0
- package/dist/src/ui/index.js.map +1 -0
- package/dist/src/ui/store/formStateSlice.d.ts +54 -0
- package/dist/src/ui/store/formStateSlice.js +94 -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/utils/functionEndpoints.d.ts +24 -0
- package/dist/src/utils/functionEndpoints.js +45 -0
- package/dist/src/utils/functionEndpoints.js.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,509 @@
|
|
|
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.LocalSettingsStore = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
10
|
+
const LogManager_1 = require("../../logging/LogManager");
|
|
11
|
+
/**
|
|
12
|
+
* Default settings - empty object
|
|
13
|
+
*/
|
|
14
|
+
const DEFAULT_SETTINGS = {};
|
|
15
|
+
/**
|
|
16
|
+
* Local settings store that manages app settings in .ocp-local/settings.json
|
|
17
|
+
* Implements singleton pattern to ensure consistent state across wrapper and API
|
|
18
|
+
*/
|
|
19
|
+
class LocalSettingsStore {
|
|
20
|
+
constructor(appRootDir) {
|
|
21
|
+
this.logManager = LogManager_1.LogManager.getInstance();
|
|
22
|
+
this.settingsYmlSections = [];
|
|
23
|
+
this.settingsSchema = {};
|
|
24
|
+
this.appRootDir = appRootDir;
|
|
25
|
+
this.configDirPath = path_1.default.join(appRootDir, '.ocp-local');
|
|
26
|
+
this.settingsPath = path_1.default.join(this.configDirPath, 'settings.json');
|
|
27
|
+
this.parseSettingsYml();
|
|
28
|
+
// Initialize settings file if it doesn't exist
|
|
29
|
+
this.ensureSettingsFileExists();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get or create a singleton instance for the given app directory
|
|
33
|
+
*/
|
|
34
|
+
static getInstance(appRootDir) {
|
|
35
|
+
const normalizedPath = path_1.default.resolve(appRootDir);
|
|
36
|
+
if (!this.instances.has(normalizedPath)) {
|
|
37
|
+
this.instances.set(normalizedPath, new LocalSettingsStore(normalizedPath));
|
|
38
|
+
}
|
|
39
|
+
return this.instances.get(normalizedPath);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Clear singleton instance for the given app directory (useful for testing)
|
|
43
|
+
*/
|
|
44
|
+
static clearInstance(appRootDir) {
|
|
45
|
+
const normalizedPath = path_1.default.resolve(appRootDir);
|
|
46
|
+
this.instances.delete(normalizedPath);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Clear all singleton instances (useful for testing)
|
|
50
|
+
*/
|
|
51
|
+
static clearAllInstances() {
|
|
52
|
+
this.instances.clear();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Parse settings.yml file to extract sections and field schemas
|
|
56
|
+
*/
|
|
57
|
+
parseSettingsYml() {
|
|
58
|
+
try {
|
|
59
|
+
const settingsYmlPath = path_1.default.join(this.appRootDir, 'forms', 'settings.yml');
|
|
60
|
+
if (!fs_1.default.existsSync(settingsYmlPath)) {
|
|
61
|
+
this.logManager.warn(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `No settings.yml found at ${settingsYmlPath}, using default sections`, {
|
|
62
|
+
id: 'settings.yml',
|
|
63
|
+
store: 'LocalSettingsStore',
|
|
64
|
+
operation: 'get'
|
|
65
|
+
});
|
|
66
|
+
// Set default sections and empty schema when no settings.yml exists
|
|
67
|
+
this.settingsYmlSections = ['general', 'authentication', 'configuration'];
|
|
68
|
+
this.settingsSchema = {};
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const yamlContent = fs_1.default.readFileSync(settingsYmlPath, 'utf-8');
|
|
72
|
+
const parsed = js_yaml_1.default.load(yamlContent);
|
|
73
|
+
if (!parsed || typeof parsed !== 'object') {
|
|
74
|
+
this.logManager.warn(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, 'Invalid settings.yml format', {
|
|
75
|
+
id: 'settings.yml',
|
|
76
|
+
store: 'LocalSettingsStore',
|
|
77
|
+
operation: 'get'
|
|
78
|
+
});
|
|
79
|
+
this.settingsYmlSections = [];
|
|
80
|
+
this.settingsSchema = {};
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
// Extract sections and build schema
|
|
84
|
+
const sections = [];
|
|
85
|
+
const schema = {};
|
|
86
|
+
// Handle different settings.yml formats
|
|
87
|
+
if (parsed.sections && Array.isArray(parsed.sections)) {
|
|
88
|
+
// Format 1: sections array with field definitions
|
|
89
|
+
parsed.sections.forEach((section) => {
|
|
90
|
+
if (typeof section === 'object' && (section.key || section.name)) {
|
|
91
|
+
const sectionName = section.key || section.name;
|
|
92
|
+
sections.push(sectionName);
|
|
93
|
+
schema[sectionName] = this.parseFieldsSchema(section.fields || section.elements || []);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else if (parsed.properties && typeof parsed.properties === 'object') {
|
|
98
|
+
// Format 2: JSON Schema style with properties
|
|
99
|
+
Object.entries(parsed.properties).forEach(([sectionName, sectionDef]) => {
|
|
100
|
+
sections.push(sectionName);
|
|
101
|
+
if (sectionDef.properties) {
|
|
102
|
+
schema[sectionName] = this.parseJsonSchemaFields(sectionDef.properties);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
schema[sectionName] = {};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
// Format 3: Direct section objects or sections as object keys
|
|
111
|
+
if (parsed.sections && typeof parsed.sections === 'object') {
|
|
112
|
+
// sections as object with keys
|
|
113
|
+
Object.keys(parsed.sections).forEach(sectionName => {
|
|
114
|
+
sections.push(sectionName);
|
|
115
|
+
const sectionDef = parsed.sections[sectionName];
|
|
116
|
+
if (sectionDef && typeof sectionDef === 'object' && sectionDef.fields) {
|
|
117
|
+
schema[sectionName] = this.parseFieldsSchema(sectionDef.fields);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
schema[sectionName] = {};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
// Look for top-level keys that might be sections
|
|
126
|
+
Object.entries(parsed).forEach(([key, value]) => {
|
|
127
|
+
// Skip metadata keys
|
|
128
|
+
if (!['version', 'title', 'description', 'type', 'schema'].includes(key.toLowerCase())) {
|
|
129
|
+
sections.push(key);
|
|
130
|
+
if (value && typeof value === 'object' && value.fields) {
|
|
131
|
+
schema[key] = this.parseFieldsSchema(value.fields);
|
|
132
|
+
}
|
|
133
|
+
else if (value && typeof value === 'object') {
|
|
134
|
+
// Assume direct field definitions
|
|
135
|
+
schema[key] = this.parseJsonSchemaFields(value);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
schema[key] = {};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
this.settingsYmlSections = sections;
|
|
145
|
+
this.settingsSchema = schema;
|
|
146
|
+
this.logManager.info(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `Found sections in settings.yml: ${sections.join(', ')}`, {
|
|
147
|
+
id: 'settings.yml',
|
|
148
|
+
store: 'LocalSettingsStore',
|
|
149
|
+
operation: 'get'
|
|
150
|
+
});
|
|
151
|
+
this.logManager.info(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `Parsed schema for ${Object.keys(schema).length} sections`, {
|
|
152
|
+
id: 'settings.yml',
|
|
153
|
+
store: 'LocalSettingsStore',
|
|
154
|
+
operation: 'get'
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
this.logManager.warn(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, 'Error parsing settings.yml', {
|
|
159
|
+
id: 'settings.yml',
|
|
160
|
+
store: 'LocalSettingsStore',
|
|
161
|
+
operation: 'get',
|
|
162
|
+
error
|
|
163
|
+
});
|
|
164
|
+
this.settingsYmlSections = [];
|
|
165
|
+
this.settingsSchema = {};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Parse field schema from settings.yml fields array
|
|
170
|
+
*/
|
|
171
|
+
parseFieldsSchema(fields) {
|
|
172
|
+
const schema = {};
|
|
173
|
+
if (!Array.isArray(fields))
|
|
174
|
+
return schema;
|
|
175
|
+
fields.forEach((field) => {
|
|
176
|
+
if (field && typeof field === 'object' && (field.name || field.key)) {
|
|
177
|
+
const fieldName = field.name || field.key;
|
|
178
|
+
schema[fieldName] = {
|
|
179
|
+
type: field.type || 'string',
|
|
180
|
+
secret: field.secret === true || field.type === 'secret',
|
|
181
|
+
required: field.required === true,
|
|
182
|
+
description: field.description || field.label,
|
|
183
|
+
default: field.default
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
return schema;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Parse field schema from JSON Schema style properties
|
|
191
|
+
*/
|
|
192
|
+
parseJsonSchemaFields(properties) {
|
|
193
|
+
const schema = {};
|
|
194
|
+
if (!properties || typeof properties !== 'object')
|
|
195
|
+
return schema;
|
|
196
|
+
Object.entries(properties).forEach(([fieldName, fieldDef]) => {
|
|
197
|
+
if (fieldDef && typeof fieldDef === 'object') {
|
|
198
|
+
schema[fieldName] = {
|
|
199
|
+
type: fieldDef.type || 'string',
|
|
200
|
+
secret: fieldDef.secret === true || fieldDef.format === 'password' || fieldName.toLowerCase().includes('password') || fieldName.toLowerCase().includes('secret'),
|
|
201
|
+
required: fieldDef.required === true,
|
|
202
|
+
description: fieldDef.description || fieldDef.title,
|
|
203
|
+
default: fieldDef.default
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return schema;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Create default settings structure based on sections from settings.yml
|
|
211
|
+
*/
|
|
212
|
+
createDefaultSettings() {
|
|
213
|
+
const defaultSettings = {};
|
|
214
|
+
// Create an empty object for each section found in settings.yml
|
|
215
|
+
this.settingsYmlSections.forEach(section => {
|
|
216
|
+
defaultSettings[section] = {};
|
|
217
|
+
});
|
|
218
|
+
return defaultSettings;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Ensure settings file exists with default structure
|
|
222
|
+
*/
|
|
223
|
+
ensureSettingsFileExists() {
|
|
224
|
+
try {
|
|
225
|
+
// Ensure the .ocp-local directory exists
|
|
226
|
+
if (!fs_1.default.existsSync(this.configDirPath)) {
|
|
227
|
+
fs_1.default.mkdirSync(this.configDirPath, { recursive: true });
|
|
228
|
+
}
|
|
229
|
+
// Create default settings file if it doesn't exist
|
|
230
|
+
if (!fs_1.default.existsSync(this.settingsPath)) {
|
|
231
|
+
const defaultSettings = this.createDefaultSettings();
|
|
232
|
+
this.saveSettingsToDisk(defaultSettings);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
this.logManager.warn(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `Failed to ensure settings file exists at ${this.settingsPath}`, {
|
|
237
|
+
id: 'settings',
|
|
238
|
+
store: 'LocalSettingsStore',
|
|
239
|
+
operation: 'set',
|
|
240
|
+
error
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Load settings from disk every time
|
|
246
|
+
*/
|
|
247
|
+
loadSettingsFromDisk() {
|
|
248
|
+
try {
|
|
249
|
+
if (fs_1.default.existsSync(this.settingsPath)) {
|
|
250
|
+
const settingsData = fs_1.default.readFileSync(this.settingsPath, 'utf-8');
|
|
251
|
+
const existingSettings = JSON.parse(settingsData);
|
|
252
|
+
// Merge with section-based defaults to ensure all sections exist
|
|
253
|
+
const defaultSettings = this.createDefaultSettings();
|
|
254
|
+
return { ...defaultSettings, ...existingSettings };
|
|
255
|
+
}
|
|
256
|
+
// Return default settings if file doesn't exist
|
|
257
|
+
return this.createDefaultSettings();
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
this.logManager.warn(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `Failed to load settings from ${this.settingsPath}`, {
|
|
261
|
+
id: 'settings',
|
|
262
|
+
store: 'LocalSettingsStore',
|
|
263
|
+
operation: 'get',
|
|
264
|
+
error
|
|
265
|
+
});
|
|
266
|
+
return this.createDefaultSettings();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Save settings to disk
|
|
271
|
+
*/
|
|
272
|
+
saveSettingsToDisk(settings) {
|
|
273
|
+
try {
|
|
274
|
+
// Ensure the .ocp-local directory exists
|
|
275
|
+
if (!fs_1.default.existsSync(this.configDirPath)) {
|
|
276
|
+
fs_1.default.mkdirSync(this.configDirPath, { recursive: true });
|
|
277
|
+
}
|
|
278
|
+
// Write settings to file
|
|
279
|
+
fs_1.default.writeFileSync(this.settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
this.logManager.error(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `Failed to save settings to ${this.settingsPath}`, {
|
|
283
|
+
id: 'settings',
|
|
284
|
+
store: 'LocalSettingsStore',
|
|
285
|
+
operation: 'set',
|
|
286
|
+
error
|
|
287
|
+
});
|
|
288
|
+
throw error;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Get all current settings
|
|
293
|
+
*/
|
|
294
|
+
getSettings() {
|
|
295
|
+
const settings = this.loadSettingsFromDisk();
|
|
296
|
+
return { ...settings };
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Get settings as JSON string for API response
|
|
300
|
+
*/
|
|
301
|
+
getSettingsAsJson() {
|
|
302
|
+
const settings = this.loadSettingsFromDisk();
|
|
303
|
+
return JSON.stringify(settings);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Get a specific setting value
|
|
307
|
+
*/
|
|
308
|
+
getSetting(key) {
|
|
309
|
+
const settings = this.loadSettingsFromDisk();
|
|
310
|
+
return settings[key];
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Set a specific setting value
|
|
314
|
+
*/
|
|
315
|
+
setSetting(key, value) {
|
|
316
|
+
const settings = this.loadSettingsFromDisk();
|
|
317
|
+
settings[key] = value;
|
|
318
|
+
this.saveSettingsToDisk(settings);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Update multiple settings at once
|
|
322
|
+
*/
|
|
323
|
+
updateSettings(newSettings) {
|
|
324
|
+
const settings = this.loadSettingsFromDisk();
|
|
325
|
+
const updatedSettings = { ...settings, ...newSettings };
|
|
326
|
+
this.saveSettingsToDisk(updatedSettings);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Update settings from JSON string
|
|
330
|
+
*/
|
|
331
|
+
updateSettingsFromJson(jsonString) {
|
|
332
|
+
try {
|
|
333
|
+
const parsedSettings = JSON.parse(jsonString);
|
|
334
|
+
this.updateSettings(parsedSettings);
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
throw new Error(`Invalid JSON provided: ${error instanceof Error ? error.message : String(error)}`);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Clear all settings (reset to empty)
|
|
342
|
+
*/
|
|
343
|
+
clearSettings() {
|
|
344
|
+
const defaultSettings = this.createDefaultSettings();
|
|
345
|
+
this.saveSettingsToDisk(defaultSettings);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Check if settings are empty
|
|
349
|
+
*/
|
|
350
|
+
isEmpty() {
|
|
351
|
+
const settings = this.loadSettingsFromDisk();
|
|
352
|
+
return Object.keys(settings).length === 0;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Remove a specific setting
|
|
356
|
+
*/
|
|
357
|
+
removeSetting(key) {
|
|
358
|
+
const settings = this.loadSettingsFromDisk();
|
|
359
|
+
if (key in settings) {
|
|
360
|
+
delete settings[key];
|
|
361
|
+
this.saveSettingsToDisk(settings);
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Get the list of sections parsed from settings.yml
|
|
368
|
+
*/
|
|
369
|
+
getSections() {
|
|
370
|
+
return [...this.settingsYmlSections];
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Get settings for a specific section
|
|
374
|
+
*/
|
|
375
|
+
getSectionSettings(sectionName) {
|
|
376
|
+
const settings = this.loadSettingsFromDisk();
|
|
377
|
+
return settings[sectionName] || {};
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Update settings for a specific section.
|
|
381
|
+
* Preserves original values for secret fields when redacted values are submitted.
|
|
382
|
+
*/
|
|
383
|
+
updateSectionSettings(sectionName, sectionSettings) {
|
|
384
|
+
this.logManager.info(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `Updating section "${sectionName}" with settings`, {
|
|
385
|
+
id: sectionName,
|
|
386
|
+
store: 'LocalSettingsStore',
|
|
387
|
+
operation: 'set'
|
|
388
|
+
});
|
|
389
|
+
const settings = this.loadSettingsFromDisk();
|
|
390
|
+
const currentSectionSettings = settings[sectionName] || {};
|
|
391
|
+
const sectionSchema = this.settingsSchema[sectionName] || {};
|
|
392
|
+
// Process incoming settings, preserving original values for redacted secrets
|
|
393
|
+
const mergedSettings = { ...currentSectionSettings };
|
|
394
|
+
Object.entries(sectionSettings).forEach(([fieldName, value]) => {
|
|
395
|
+
const fieldSchema = sectionSchema[fieldName];
|
|
396
|
+
const isRedactedValue = value && typeof value === 'object' && value.redacted === true;
|
|
397
|
+
// If this is a secret field and the value is redacted, keep the original
|
|
398
|
+
if (fieldSchema?.secret && isRedactedValue) {
|
|
399
|
+
// Don't update - keep existing value in mergedSettings
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
// Otherwise, update the field
|
|
403
|
+
mergedSettings[fieldName] = value;
|
|
404
|
+
});
|
|
405
|
+
settings[sectionName] = mergedSettings;
|
|
406
|
+
this.logManager.info(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, `Section "${sectionName}" updated`, {
|
|
407
|
+
id: sectionName,
|
|
408
|
+
store: 'LocalSettingsStore',
|
|
409
|
+
operation: 'set'
|
|
410
|
+
});
|
|
411
|
+
this.saveSettingsToDisk(settings);
|
|
412
|
+
this.logManager.info(LogManager_1.LogSource.System, LogManager_1.LogCategory.Settings, 'Settings saved to disk', {
|
|
413
|
+
id: sectionName,
|
|
414
|
+
store: 'LocalSettingsStore',
|
|
415
|
+
operation: 'set'
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Get the parsed settings schema from settings.yml
|
|
420
|
+
*/
|
|
421
|
+
getSettingsSchema() {
|
|
422
|
+
return { ...this.settingsSchema };
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Get schema for a specific section
|
|
426
|
+
*/
|
|
427
|
+
getSectionSchema(sectionName) {
|
|
428
|
+
return { ...this.settingsSchema[sectionName] || {} };
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Get settings for a section with metadata about each field
|
|
432
|
+
*/
|
|
433
|
+
getSectionSettingsWithMetadata(sectionName) {
|
|
434
|
+
const localSettings = this.loadSettingsFromDisk();
|
|
435
|
+
const sectionSettings = localSettings[sectionName] || {};
|
|
436
|
+
const sectionSchema = this.settingsSchema[sectionName] || {};
|
|
437
|
+
const result = {};
|
|
438
|
+
// Process all fields from schema (including those not in local settings)
|
|
439
|
+
Object.entries(sectionSchema).forEach(([fieldName, fieldSchema]) => {
|
|
440
|
+
const hasLocalValue = fieldName in sectionSettings;
|
|
441
|
+
const value = hasLocalValue ? sectionSettings[fieldName] : (fieldSchema.default || '');
|
|
442
|
+
result[fieldName] = {
|
|
443
|
+
value,
|
|
444
|
+
isSecret: fieldSchema.secret || false,
|
|
445
|
+
isFromYml: true,
|
|
446
|
+
hasLocalValue,
|
|
447
|
+
fieldSchema
|
|
448
|
+
};
|
|
449
|
+
});
|
|
450
|
+
// Process fields that exist in local settings but not in schema
|
|
451
|
+
Object.entries(sectionSettings).forEach(([fieldName, value]) => {
|
|
452
|
+
if (!(fieldName in sectionSchema)) {
|
|
453
|
+
result[fieldName] = {
|
|
454
|
+
value,
|
|
455
|
+
isSecret: false, // Assume non-secret if not defined in schema
|
|
456
|
+
isFromYml: false,
|
|
457
|
+
hasLocalValue: true,
|
|
458
|
+
fieldSchema: undefined
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
return result;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Get all settings with metadata organized by section
|
|
466
|
+
*/
|
|
467
|
+
getAllSettingsWithMetadata() {
|
|
468
|
+
const result = {};
|
|
469
|
+
// Get all sections from both schema and local settings
|
|
470
|
+
const allSections = new Set([
|
|
471
|
+
...Object.keys(this.settingsSchema),
|
|
472
|
+
...this.settingsYmlSections,
|
|
473
|
+
...Object.keys(this.loadSettingsFromDisk())
|
|
474
|
+
]);
|
|
475
|
+
allSections.forEach(sectionName => {
|
|
476
|
+
result[sectionName] = this.getSectionSettingsWithMetadata(sectionName);
|
|
477
|
+
});
|
|
478
|
+
return result;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Get form data with secret fields redacted (matches OCP behavior)
|
|
482
|
+
* Secret fields with non-null, non-empty values are replaced with {redacted: true}
|
|
483
|
+
*/
|
|
484
|
+
getRedactedFormData() {
|
|
485
|
+
const settings = this.loadSettingsFromDisk();
|
|
486
|
+
const redactedSettings = {};
|
|
487
|
+
// Process each section
|
|
488
|
+
this.settingsYmlSections.forEach((sectionName) => {
|
|
489
|
+
const sectionSettings = settings[sectionName] || {};
|
|
490
|
+
const sectionSchema = this.settingsSchema[sectionName] || {};
|
|
491
|
+
const redactedSection = { ...sectionSettings };
|
|
492
|
+
// Check each field in the schema
|
|
493
|
+
Object.entries(sectionSchema).forEach(([fieldName, fieldSchema]) => {
|
|
494
|
+
if (fieldSchema.secret) {
|
|
495
|
+
const value = sectionSettings[fieldName];
|
|
496
|
+
// Redact if value is non-null and non-empty string
|
|
497
|
+
if (value !== null && value !== undefined && value !== "") {
|
|
498
|
+
redactedSection[fieldName] = { redacted: true };
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
redactedSettings[sectionName] = redactedSection;
|
|
503
|
+
});
|
|
504
|
+
return redactedSettings;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
exports.LocalSettingsStore = LocalSettingsStore;
|
|
508
|
+
LocalSettingsStore.instances = new Map();
|
|
509
|
+
//# sourceMappingURL=LocalSettingsStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalSettingsStore.js","sourceRoot":"","sources":["../../../../src/local_engine/storage/LocalSettingsStore.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,sDAA2B;AAC3B,yDAA8E;AA6C9E;;GAEG;AACH,MAAM,gBAAgB,GAAqB,EAAE,CAAC;AAE9C;;;GAGG;AACH,MAAa,kBAAkB;IAU7B,YAAoB,UAAkB;QAR9B,eAAU,GAAG,uBAAU,CAAC,WAAW,EAAE,CAAC;QAKtC,wBAAmB,GAAa,EAAE,CAAC;QACnC,mBAAc,GAAmB,EAAE,CAAC;QAG1C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QACnE,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,+CAA+C;QAC/C,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,WAAW,CAAC,UAAkB;QAC1C,MAAM,cAAc,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7E,CAAC;QAED,OAAO,IAAI,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,eAAe,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,OAAO,gBAAgB,CAAC;IAC1B,CAAC;;AAniBH,gDAoiBC;AAniBgB,4BAAS,GAAoC,IAAI,GAAG,EAAE,AAA7C,CAA8C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LogCategory } from '../../logging/LogManager';
|
|
2
|
+
import { BaseKVStoreWrapper } from './BaseKVStoreWrapper';
|
|
3
|
+
import { LocalSettingsStore } from './LocalSettingsStore';
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper to make LocalSettingsStore compatible with BaseKVStore interface
|
|
6
|
+
*/
|
|
7
|
+
export declare class LocalSettingsStoreWrapper extends BaseKVStoreWrapper {
|
|
8
|
+
private settingsStore;
|
|
9
|
+
protected readonly storeName = "LocalSettingsStore";
|
|
10
|
+
protected readonly logCategory = LogCategory.Settings;
|
|
11
|
+
constructor(settingsStore: LocalSettingsStore);
|
|
12
|
+
protected getSectionData(key: string): Record<string, any>;
|
|
13
|
+
protected updateSectionData(key: string, value: any): void;
|
|
14
|
+
protected hasSectionData(key: string): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalSettingsStoreWrapper = void 0;
|
|
4
|
+
const LogManager_1 = require("../../logging/LogManager");
|
|
5
|
+
const BaseKVStoreWrapper_1 = require("./BaseKVStoreWrapper");
|
|
6
|
+
/**
|
|
7
|
+
* Wrapper to make LocalSettingsStore compatible with BaseKVStore interface
|
|
8
|
+
*/
|
|
9
|
+
class LocalSettingsStoreWrapper extends BaseKVStoreWrapper_1.BaseKVStoreWrapper {
|
|
10
|
+
constructor(settingsStore) {
|
|
11
|
+
super();
|
|
12
|
+
this.settingsStore = settingsStore;
|
|
13
|
+
this.storeName = 'LocalSettingsStore';
|
|
14
|
+
this.logCategory = LogManager_1.LogCategory.Settings;
|
|
15
|
+
}
|
|
16
|
+
getSectionData(key) {
|
|
17
|
+
return this.settingsStore.getSectionSettings(key) || {};
|
|
18
|
+
}
|
|
19
|
+
updateSectionData(key, value) {
|
|
20
|
+
this.settingsStore.updateSectionSettings(key, value);
|
|
21
|
+
}
|
|
22
|
+
hasSectionData(key) {
|
|
23
|
+
const data = this.settingsStore.getSectionSettings(key);
|
|
24
|
+
return Object.keys(data || {}).length > 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.LocalSettingsStoreWrapper = LocalSettingsStoreWrapper;
|
|
28
|
+
//# sourceMappingURL=LocalSettingsStoreWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalSettingsStoreWrapper.js","sourceRoot":"","sources":["../../../../src/local_engine/storage/LocalSettingsStoreWrapper.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AACvD,6DAA0D;AAG1D;;GAEG;AACH,MAAa,yBAA0B,SAAQ,uCAAkB;IAI/D,YAAoB,aAAiC;QACnD,KAAK,EAAE,CAAC;QADU,kBAAa,GAAb,aAAa,CAAoB;QAHlC,cAAS,GAAG,oBAAoB,CAAC;QACjC,gBAAW,GAAG,wBAAW,CAAC,QAAQ,CAAC;IAItD,CAAC;IAES,cAAc,CAAC,GAAW;QAClC,OAAO,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC1D,CAAC;IAES,iBAAiB,CAAC,GAAW,EAAE,KAAU;QACjD,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACvD,CAAC;IAES,cAAc,CAAC,GAAW;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5C,CAAC;CACF;AApBD,8DAoBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberSet - A Set implementation specifically for numbers
|
|
3
|
+
* Extends the built-in Set class to provide type-safe operations for numeric values
|
|
4
|
+
*/
|
|
5
|
+
export declare class NumberSet extends Set<number> {
|
|
6
|
+
constructor(values?: Iterable<number>);
|
|
7
|
+
/**
|
|
8
|
+
* Convert to JSON representation for serialization
|
|
9
|
+
*/
|
|
10
|
+
toJSON(): {
|
|
11
|
+
_type: string;
|
|
12
|
+
values: number[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Create NumberSet from JSON representation
|
|
16
|
+
*/
|
|
17
|
+
static fromJSON(json: {
|
|
18
|
+
_type: string;
|
|
19
|
+
values: number[];
|
|
20
|
+
}): NumberSet;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NumberSet = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* NumberSet - A Set implementation specifically for numbers
|
|
6
|
+
* Extends the built-in Set class to provide type-safe operations for numeric values
|
|
7
|
+
*/
|
|
8
|
+
class NumberSet extends Set {
|
|
9
|
+
constructor(values) {
|
|
10
|
+
super(values);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert to JSON representation for serialization
|
|
14
|
+
*/
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
_type: 'NumberSet',
|
|
18
|
+
values: Array.from(this)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create NumberSet from JSON representation
|
|
23
|
+
*/
|
|
24
|
+
static fromJSON(json) {
|
|
25
|
+
if (json._type !== 'NumberSet') {
|
|
26
|
+
throw new Error('Invalid NumberSet JSON representation');
|
|
27
|
+
}
|
|
28
|
+
return new NumberSet(json.values);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.NumberSet = NumberSet;
|
|
32
|
+
//# sourceMappingURL=NumberSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberSet.js","sourceRoot":"","sources":["../../../../src/local_engine/storage/NumberSet.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,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF;AAxBD,8BAwBC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type SourceDataContext = 'webhook' | 'job';
|
|
2
|
+
export interface SourceDataEntry {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
data: any;
|
|
5
|
+
context: SourceDataContext;
|
|
6
|
+
metadata?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export interface SourceDataFile {
|
|
9
|
+
sourceId: string;
|
|
10
|
+
entries: SourceDataEntry[];
|
|
11
|
+
}
|
|
12
|
+
export declare class SourceDataStore {
|
|
13
|
+
private storageDir;
|
|
14
|
+
private maxEntries;
|
|
15
|
+
constructor(appRootDir: string);
|
|
16
|
+
private ensureStorageDir;
|
|
17
|
+
private getFilePath;
|
|
18
|
+
private readFile;
|
|
19
|
+
private writeFile;
|
|
20
|
+
push(sourceId: string, data: any, context: SourceDataContext, metadata?: Record<string, any>): void;
|
|
21
|
+
getData(sourceId: string, context?: SourceDataContext, limit?: number): SourceDataEntry[];
|
|
22
|
+
clear(sourceId: string, context?: SourceDataContext): void;
|
|
23
|
+
}
|