@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.
Files changed (244) hide show
  1. package/README.md +51 -0
  2. package/dist/package.json +112 -0
  3. package/dist/public/bundle.82dc5d29fffb9f205051.js +3 -0
  4. package/dist/public/bundle.82dc5d29fffb9f205051.js.LICENSE.txt +92 -0
  5. package/dist/public/bundle.82dc5d29fffb9f205051.js.map +1 -0
  6. package/dist/public/index.html +1 -0
  7. package/dist/src/cli.d.ts +2 -0
  8. package/dist/src/cli.js +115 -0
  9. package/dist/src/cli.js.map +1 -0
  10. package/dist/src/executor/DestinationExecutor.d.ts +19 -0
  11. package/dist/src/executor/DestinationExecutor.js +72 -0
  12. package/dist/src/executor/DestinationExecutor.js.map +1 -0
  13. package/dist/src/executor/FunctionExecutor.d.ts +67 -0
  14. package/dist/src/executor/FunctionExecutor.js +189 -0
  15. package/dist/src/executor/FunctionExecutor.js.map +1 -0
  16. package/dist/src/executor/JobExecutor.d.ts +79 -0
  17. package/dist/src/executor/JobExecutor.js +215 -0
  18. package/dist/src/executor/JobExecutor.js.map +1 -0
  19. package/dist/src/executor/LifecycleExecutor.d.ts +64 -0
  20. package/dist/src/executor/LifecycleExecutor.js +167 -0
  21. package/dist/src/executor/LifecycleExecutor.js.map +1 -0
  22. package/dist/src/executor/SourceExecutor.d.ts +32 -0
  23. package/dist/src/executor/SourceExecutor.js +163 -0
  24. package/dist/src/executor/SourceExecutor.js.map +1 -0
  25. package/dist/src/executor/watcher.d.ts +62 -0
  26. package/dist/src/executor/watcher.js +213 -0
  27. package/dist/src/executor/watcher.js.map +1 -0
  28. package/dist/src/functions/hello.d.ts +4 -0
  29. package/dist/src/functions/hello.js +8 -0
  30. package/dist/src/functions/hello.js.map +1 -0
  31. package/dist/src/index.d.ts +1 -0
  32. package/dist/src/index.js +9 -0
  33. package/dist/src/index.js.map +1 -0
  34. package/dist/src/jobs/dailyJob.d.ts +4 -0
  35. package/dist/src/jobs/dailyJob.js +8 -0
  36. package/dist/src/jobs/dailyJob.js.map +1 -0
  37. package/dist/src/local_engine/LocalFunctionApi.d.ts +17 -0
  38. package/dist/src/local_engine/LocalFunctionApi.js +54 -0
  39. package/dist/src/local_engine/LocalFunctionApi.js.map +1 -0
  40. package/dist/src/local_engine/LocalJobApi.d.ts +67 -0
  41. package/dist/src/local_engine/LocalJobApi.js +205 -0
  42. package/dist/src/local_engine/LocalJobApi.js.map +1 -0
  43. package/dist/src/local_engine/LocalNotifier.d.ts +9 -0
  44. package/dist/src/local_engine/LocalNotifier.js +26 -0
  45. package/dist/src/local_engine/LocalNotifier.js.map +1 -0
  46. package/dist/src/local_engine/local-engine-child-base.d.ts +110 -0
  47. package/dist/src/local_engine/local-engine-child-base.js +607 -0
  48. package/dist/src/local_engine/local-engine-child-base.js.map +1 -0
  49. package/dist/src/local_engine/local-engine-client.d.ts +161 -0
  50. package/dist/src/local_engine/local-engine-client.js +888 -0
  51. package/dist/src/local_engine/local-engine-client.js.map +1 -0
  52. package/dist/src/local_engine/local-engine-types.d.ts +245 -0
  53. package/dist/src/local_engine/local-engine-types.js +6 -0
  54. package/dist/src/local_engine/local-engine-types.js.map +1 -0
  55. package/dist/src/local_engine/local-engine-unified.d.ts +71 -0
  56. package/dist/src/local_engine/local-engine-unified.js +723 -0
  57. package/dist/src/local_engine/local-engine-unified.js.map +1 -0
  58. package/dist/src/local_engine/local-engine-utils.d.ts +68 -0
  59. package/dist/src/local_engine/local-engine-utils.js +219 -0
  60. package/dist/src/local_engine/local-engine-utils.js.map +1 -0
  61. package/dist/src/local_engine/localSDKConfig.d.ts +40 -0
  62. package/dist/src/local_engine/localSDKConfig.js +247 -0
  63. package/dist/src/local_engine/localSDKConfig.js.map +1 -0
  64. package/dist/src/local_engine/storage/BaseKVStoreWrapper.d.ts +37 -0
  65. package/dist/src/local_engine/storage/BaseKVStoreWrapper.js +110 -0
  66. package/dist/src/local_engine/storage/BaseKVStoreWrapper.js.map +1 -0
  67. package/dist/src/local_engine/storage/LocalConfigStore.d.ts +74 -0
  68. package/dist/src/local_engine/storage/LocalConfigStore.js +178 -0
  69. package/dist/src/local_engine/storage/LocalConfigStore.js.map +1 -0
  70. package/dist/src/local_engine/storage/LocalJobStore.d.ts +111 -0
  71. package/dist/src/local_engine/storage/LocalJobStore.js +249 -0
  72. package/dist/src/local_engine/storage/LocalJobStore.js.map +1 -0
  73. package/dist/src/local_engine/storage/LocalKVStore.d.ts +106 -0
  74. package/dist/src/local_engine/storage/LocalKVStore.js +1061 -0
  75. package/dist/src/local_engine/storage/LocalKVStore.js.map +1 -0
  76. package/dist/src/local_engine/storage/LocalNotificationStore.d.ts +28 -0
  77. package/dist/src/local_engine/storage/LocalNotificationStore.js +149 -0
  78. package/dist/src/local_engine/storage/LocalNotificationStore.js.map +1 -0
  79. package/dist/src/local_engine/storage/LocalSecretsStore.d.ts +115 -0
  80. package/dist/src/local_engine/storage/LocalSecretsStore.js +350 -0
  81. package/dist/src/local_engine/storage/LocalSecretsStore.js.map +1 -0
  82. package/dist/src/local_engine/storage/LocalSecretsStoreWrapper.d.ts +19 -0
  83. package/dist/src/local_engine/storage/LocalSecretsStoreWrapper.js +52 -0
  84. package/dist/src/local_engine/storage/LocalSecretsStoreWrapper.js.map +1 -0
  85. package/dist/src/local_engine/storage/LocalSettingsStore.d.ts +168 -0
  86. package/dist/src/local_engine/storage/LocalSettingsStore.js +509 -0
  87. package/dist/src/local_engine/storage/LocalSettingsStore.js.map +1 -0
  88. package/dist/src/local_engine/storage/LocalSettingsStoreWrapper.d.ts +15 -0
  89. package/dist/src/local_engine/storage/LocalSettingsStoreWrapper.js +28 -0
  90. package/dist/src/local_engine/storage/LocalSettingsStoreWrapper.js.map +1 -0
  91. package/dist/src/local_engine/storage/NumberSet.d.ts +21 -0
  92. package/dist/src/local_engine/storage/NumberSet.js +32 -0
  93. package/dist/src/local_engine/storage/NumberSet.js.map +1 -0
  94. package/dist/src/local_engine/storage/SourceDataStore.d.ts +23 -0
  95. package/dist/src/local_engine/storage/SourceDataStore.js +83 -0
  96. package/dist/src/local_engine/storage/SourceDataStore.js.map +1 -0
  97. package/dist/src/local_engine/storage/SourceJobExecutionStore.d.ts +25 -0
  98. package/dist/src/local_engine/storage/SourceJobExecutionStore.js +61 -0
  99. package/dist/src/local_engine/storage/SourceJobExecutionStore.js.map +1 -0
  100. package/dist/src/local_engine/storage/StringSet.d.ts +21 -0
  101. package/dist/src/local_engine/storage/StringSet.js +32 -0
  102. package/dist/src/local_engine/storage/StringSet.js.map +1 -0
  103. package/dist/src/local_engine/types.d.ts +53 -0
  104. package/dist/src/local_engine/types.js +6 -0
  105. package/dist/src/local_engine/types.js.map +1 -0
  106. package/dist/src/local_engine/utils.d.ts +33 -0
  107. package/dist/src/local_engine/utils.js +143 -0
  108. package/dist/src/local_engine/utils.js.map +1 -0
  109. package/dist/src/logging/LogManager.d.ts +246 -0
  110. package/dist/src/logging/LogManager.js +343 -0
  111. package/dist/src/logging/LogManager.js.map +1 -0
  112. package/dist/src/server/api/destinations.d.ts +7 -0
  113. package/dist/src/server/api/destinations.js +170 -0
  114. package/dist/src/server/api/destinations.js.map +1 -0
  115. package/dist/src/server/api/functions.d.ts +7 -0
  116. package/dist/src/server/api/functions.js +80 -0
  117. package/dist/src/server/api/functions.js.map +1 -0
  118. package/dist/src/server/api/jobs.d.ts +10 -0
  119. package/dist/src/server/api/jobs.js +244 -0
  120. package/dist/src/server/api/jobs.js.map +1 -0
  121. package/dist/src/server/api/settings.d.ts +6 -0
  122. package/dist/src/server/api/settings.js +116 -0
  123. package/dist/src/server/api/settings.js.map +1 -0
  124. package/dist/src/server/api/sources.d.ts +7 -0
  125. package/dist/src/server/api/sources.js +382 -0
  126. package/dist/src/server/api/sources.js.map +1 -0
  127. package/dist/src/server/api/stores.d.ts +2 -0
  128. package/dist/src/server/api/stores.js +341 -0
  129. package/dist/src/server/api/stores.js.map +1 -0
  130. package/dist/src/server/api/v1.d.ts +10 -0
  131. package/dist/src/server/api/v1.js +718 -0
  132. package/dist/src/server/api/v1.js.map +1 -0
  133. package/dist/src/server/api.d.ts +8 -0
  134. package/dist/src/server/api.js +217 -0
  135. package/dist/src/server/api.js.map +1 -0
  136. package/dist/src/server/app-discovery.d.ts +5 -0
  137. package/dist/src/server/app-discovery.js +113 -0
  138. package/dist/src/server/app-discovery.js.map +1 -0
  139. package/dist/src/server/config.d.ts +26 -0
  140. package/dist/src/server/config.js +112 -0
  141. package/dist/src/server/config.js.map +1 -0
  142. package/dist/src/server/mockDataGenerator.d.ts +1 -0
  143. package/dist/src/server/mockDataGenerator.js +154 -0
  144. package/dist/src/server/mockDataGenerator.js.map +1 -0
  145. package/dist/src/server/websocket.d.ts +0 -0
  146. package/dist/src/server/websocket.js +2 -0
  147. package/dist/src/server/websocket.js.map +1 -0
  148. package/dist/src/server.d.ts +2 -0
  149. package/dist/src/server.js +735 -0
  150. package/dist/src/server.js.map +1 -0
  151. package/dist/src/types/app.d.ts +154 -0
  152. package/dist/src/types/app.js +24 -0
  153. package/dist/src/types/app.js.map +1 -0
  154. package/dist/src/types/kvstore.d.ts +320 -0
  155. package/dist/src/types/kvstore.js +5 -0
  156. package/dist/src/types/kvstore.js.map +1 -0
  157. package/dist/src/ui/components/App.d.ts +6 -0
  158. package/dist/src/ui/components/App.js +432 -0
  159. package/dist/src/ui/components/App.js.map +1 -0
  160. package/dist/src/ui/components/DestinationBatchEditor.d.ts +7 -0
  161. package/dist/src/ui/components/DestinationBatchEditor.js +160 -0
  162. package/dist/src/ui/components/DestinationBatchEditor.js.map +1 -0
  163. package/dist/src/ui/components/DestinationSchemaViewer.d.ts +7 -0
  164. package/dist/src/ui/components/DestinationSchemaViewer.js +61 -0
  165. package/dist/src/ui/components/DestinationSchemaViewer.js.map +1 -0
  166. package/dist/src/ui/components/DestinationsView.d.ts +14 -0
  167. package/dist/src/ui/components/DestinationsView.js +68 -0
  168. package/dist/src/ui/components/DestinationsView.js.map +1 -0
  169. package/dist/src/ui/components/FunctionsView.d.ts +13 -0
  170. package/dist/src/ui/components/FunctionsView.js +288 -0
  171. package/dist/src/ui/components/FunctionsView.js.map +1 -0
  172. package/dist/src/ui/components/JobsView.d.ts +13 -0
  173. package/dist/src/ui/components/JobsView.js +320 -0
  174. package/dist/src/ui/components/JobsView.js.map +1 -0
  175. package/dist/src/ui/components/KVStoreViewer.d.ts +11 -0
  176. package/dist/src/ui/components/KVStoreViewer.js +168 -0
  177. package/dist/src/ui/components/KVStoreViewer.js.map +1 -0
  178. package/dist/src/ui/components/MetadataModal.d.ts +14 -0
  179. package/dist/src/ui/components/MetadataModal.js +28 -0
  180. package/dist/src/ui/components/MetadataModal.js.map +1 -0
  181. package/dist/src/ui/components/MetadataModal.test.d.ts +1 -0
  182. package/dist/src/ui/components/MetadataModal.test.js +143 -0
  183. package/dist/src/ui/components/MetadataModal.test.js.map +1 -0
  184. package/dist/src/ui/components/NotificationViewer.d.ts +16 -0
  185. package/dist/src/ui/components/NotificationViewer.js +69 -0
  186. package/dist/src/ui/components/NotificationViewer.js.map +1 -0
  187. package/dist/src/ui/components/SecretsStoreViewer.d.ts +11 -0
  188. package/dist/src/ui/components/SecretsStoreViewer.js +179 -0
  189. package/dist/src/ui/components/SecretsStoreViewer.js.map +1 -0
  190. package/dist/src/ui/components/SettingsStoreViewer.d.ts +24 -0
  191. package/dist/src/ui/components/SettingsStoreViewer.js +132 -0
  192. package/dist/src/ui/components/SettingsStoreViewer.js.map +1 -0
  193. package/dist/src/ui/components/SourceDataViewer.d.ts +8 -0
  194. package/dist/src/ui/components/SourceDataViewer.js +84 -0
  195. package/dist/src/ui/components/SourceDataViewer.js.map +1 -0
  196. package/dist/src/ui/components/SourceJobsSection.d.ts +8 -0
  197. package/dist/src/ui/components/SourceJobsSection.js +99 -0
  198. package/dist/src/ui/components/SourceJobsSection.js.map +1 -0
  199. package/dist/src/ui/components/SourceLifecycleSection.d.ts +7 -0
  200. package/dist/src/ui/components/SourceLifecycleSection.js +58 -0
  201. package/dist/src/ui/components/SourceLifecycleSection.js.map +1 -0
  202. package/dist/src/ui/components/SourceSchemaViewer.d.ts +7 -0
  203. package/dist/src/ui/components/SourceSchemaViewer.js +65 -0
  204. package/dist/src/ui/components/SourceSchemaViewer.js.map +1 -0
  205. package/dist/src/ui/components/SourceWebhookEditor.d.ts +8 -0
  206. package/dist/src/ui/components/SourceWebhookEditor.js +181 -0
  207. package/dist/src/ui/components/SourceWebhookEditor.js.map +1 -0
  208. package/dist/src/ui/components/SourcesView.d.ts +14 -0
  209. package/dist/src/ui/components/SourcesView.js +74 -0
  210. package/dist/src/ui/components/SourcesView.js.map +1 -0
  211. package/dist/src/ui/components/StoreViewer.d.ts +16 -0
  212. package/dist/src/ui/components/StoreViewer.js +86 -0
  213. package/dist/src/ui/components/StoreViewer.js.map +1 -0
  214. package/dist/src/ui/components/TabbedConsole.d.ts +17 -0
  215. package/dist/src/ui/components/TabbedConsole.js +163 -0
  216. package/dist/src/ui/components/TabbedConsole.js.map +1 -0
  217. package/dist/src/ui/components/common/DataTree.d.ts +15 -0
  218. package/dist/src/ui/components/common/DataTree.js +95 -0
  219. package/dist/src/ui/components/common/DataTree.js.map +1 -0
  220. package/dist/src/ui/components/common/EyeIcon.d.ts +11 -0
  221. package/dist/src/ui/components/common/EyeIcon.js +11 -0
  222. package/dist/src/ui/components/common/EyeIcon.js.map +1 -0
  223. package/dist/src/ui/hooks/useEntityNavigation.d.ts +72 -0
  224. package/dist/src/ui/hooks/useEntityNavigation.js +150 -0
  225. package/dist/src/ui/hooks/useEntityNavigation.js.map +1 -0
  226. package/dist/src/ui/hooks/useQueryParams.d.ts +6 -0
  227. package/dist/src/ui/hooks/useQueryParams.js +39 -0
  228. package/dist/src/ui/hooks/useQueryParams.js.map +1 -0
  229. package/dist/src/ui/index.d.ts +1 -0
  230. package/dist/src/ui/index.js +23 -0
  231. package/dist/src/ui/index.js.map +1 -0
  232. package/dist/src/ui/store/formStateSlice.d.ts +54 -0
  233. package/dist/src/ui/store/formStateSlice.js +94 -0
  234. package/dist/src/ui/store/formStateSlice.js.map +1 -0
  235. package/dist/src/ui/store/hooks.d.ts +6 -0
  236. package/dist/src/ui/store/hooks.js +8 -0
  237. package/dist/src/ui/store/hooks.js.map +1 -0
  238. package/dist/src/ui/store/index.d.ts +11 -0
  239. package/dist/src/ui/store/index.js +107 -0
  240. package/dist/src/ui/store/index.js.map +1 -0
  241. package/dist/src/utils/functionEndpoints.d.ts +24 -0
  242. package/dist/src/utils/functionEndpoints.js +45 -0
  243. package/dist/src/utils/functionEndpoints.js.map +1 -0
  244. package/package.json +112 -0
@@ -0,0 +1,62 @@
1
+ import { EventEmitter } from 'events';
2
+ /**
3
+ * Watches for file changes in an OCP app and triggers rebuilds
4
+ */
5
+ export declare class AppWatcher extends EventEmitter {
6
+ private watcher;
7
+ private buildInProgress;
8
+ private appDir;
9
+ private buildCommand;
10
+ private lastBuildSuccess;
11
+ private lastBuildTimestamp;
12
+ private lastBuildError;
13
+ private buildLogs;
14
+ /**
15
+ * Creates a new file watcher for the specified app directory
16
+ */
17
+ constructor(appDir: string);
18
+ /**
19
+ * Start watching for file changes
20
+ */
21
+ start(): void;
22
+ /**
23
+ * Stop watching for file changes
24
+ */
25
+ stop(): void;
26
+ /**
27
+ * Handle a file change event
28
+ */
29
+ private handleFileChange;
30
+ /**
31
+ * Build the app using the configured build command
32
+ */
33
+ private buildApp;
34
+ /**
35
+ * Trigger a manual build of the app
36
+ */
37
+ triggerBuild(): Promise<void>;
38
+ /**
39
+ * Returns whether a build is currently in progress
40
+ */
41
+ isBuildInProgress(): boolean;
42
+ /**
43
+ * Returns whether the last build was successful
44
+ */
45
+ getLastBuildSuccess(): boolean | null;
46
+ /**
47
+ * Returns the timestamp of the last build
48
+ */
49
+ getLastBuildTimestamp(): string | null;
50
+ /**
51
+ * Returns the error message from the last failed build
52
+ */
53
+ getLastBuildError(): string | null;
54
+ /**
55
+ * Returns the most recent build logs
56
+ */
57
+ getBuildLogs(limit?: number): Array<{
58
+ type: 'stdout' | 'stderr';
59
+ data: string;
60
+ timestamp: string;
61
+ }>;
62
+ }
@@ -0,0 +1,213 @@
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.AppWatcher = void 0;
7
+ const chokidar_1 = __importDefault(require("chokidar"));
8
+ const child_process_1 = require("child_process");
9
+ const path_1 = __importDefault(require("path"));
10
+ const events_1 = require("events");
11
+ const config_1 = require("../server/config");
12
+ const LogManager_1 = require("../logging/LogManager");
13
+ /**
14
+ * Watches for file changes in an OCP app and triggers rebuilds
15
+ */
16
+ class AppWatcher extends events_1.EventEmitter {
17
+ /**
18
+ * Creates a new file watcher for the specified app directory
19
+ */
20
+ constructor(appDir) {
21
+ super();
22
+ this.watcher = null;
23
+ this.buildInProgress = false;
24
+ this.lastBuildSuccess = null;
25
+ this.lastBuildTimestamp = null;
26
+ this.lastBuildError = null;
27
+ this.buildLogs = [];
28
+ this.appDir = appDir;
29
+ this.buildCommand = config_1.config.app.buildCommand;
30
+ }
31
+ /**
32
+ * Start watching for file changes
33
+ */
34
+ start() {
35
+ const watchPaths = config_1.config.app.watchPaths.map(pattern => path_1.default.join(this.appDir, pattern));
36
+ this.watcher = chokidar_1.default.watch(watchPaths, {
37
+ ignored: config_1.config.app.ignorePaths,
38
+ persistent: true,
39
+ ignoreInitial: true
40
+ });
41
+ this.watcher.on('change', (filePath) => {
42
+ this.handleFileChange(filePath);
43
+ });
44
+ this.watcher.on('add', (filePath) => {
45
+ this.handleFileChange(filePath);
46
+ });
47
+ this.watcher.on('unlink', (filePath) => {
48
+ this.handleFileChange(filePath);
49
+ });
50
+ console.log(`Watching for file changes in ${this.appDir}`);
51
+ }
52
+ /**
53
+ * Stop watching for file changes
54
+ */
55
+ stop() {
56
+ if (this.watcher) {
57
+ this.watcher.close();
58
+ this.watcher = null;
59
+ }
60
+ }
61
+ /**
62
+ * Handle a file change event
63
+ */
64
+ async handleFileChange(filePath) {
65
+ if (this.buildInProgress) {
66
+ return;
67
+ }
68
+ // Normalize path for logging
69
+ const relativePath = path_1.default.relative(this.appDir, filePath);
70
+ console.log(`File changed: ${relativePath}`);
71
+ this.buildInProgress = true;
72
+ // Use super.emit() to satisfy TypeScript
73
+ super.emit('buildStart', { file: relativePath });
74
+ const logManager = LogManager_1.LogManager.getInstance();
75
+ logManager.logBuildEvent('started', { file: relativePath });
76
+ try {
77
+ await this.buildApp();
78
+ this.lastBuildSuccess = true;
79
+ this.lastBuildTimestamp = new Date().toISOString();
80
+ this.lastBuildError = null;
81
+ logManager.logBuildEvent('success');
82
+ super.emit('buildSuccess');
83
+ }
84
+ catch (error) {
85
+ this.lastBuildSuccess = false;
86
+ this.lastBuildTimestamp = new Date().toISOString();
87
+ this.lastBuildError = error instanceof Error ? error.message : String(error);
88
+ logManager.logBuildEvent('error', {
89
+ error: this.lastBuildError,
90
+ file: relativePath
91
+ });
92
+ super.emit('buildError', error);
93
+ }
94
+ finally {
95
+ this.buildInProgress = false;
96
+ }
97
+ }
98
+ /**
99
+ * Build the app using the configured build command
100
+ */
101
+ buildApp() {
102
+ return new Promise((resolve, reject) => {
103
+ console.log(`Building app with command: ${this.buildCommand}`);
104
+ // Split the command into parts for spawn
105
+ const [command, ...args] = this.buildCommand.split(' ');
106
+ const buildProcess = (0, child_process_1.spawn)(command, args, {
107
+ cwd: this.appDir,
108
+ stdio: 'pipe',
109
+ shell: true
110
+ });
111
+ let stdout = '';
112
+ let stderr = '';
113
+ const logManager = LogManager_1.LogManager.getInstance();
114
+ buildProcess.stdout.on('data', (data) => {
115
+ const output = data.toString();
116
+ stdout += output;
117
+ const logEntry = {
118
+ type: 'stdout',
119
+ data: output,
120
+ timestamp: new Date().toISOString()
121
+ };
122
+ this.buildLogs.push(logEntry);
123
+ super.emit('buildLog', logEntry);
124
+ // Log to centralized logging system
125
+ logManager.logBuildOutput(output.trim());
126
+ });
127
+ buildProcess.stderr.on('data', (data) => {
128
+ const output = data.toString();
129
+ stderr += output;
130
+ const logEntry = {
131
+ type: 'stderr',
132
+ data: output,
133
+ timestamp: new Date().toISOString()
134
+ };
135
+ this.buildLogs.push(logEntry);
136
+ super.emit('buildLog', logEntry);
137
+ // Log to centralized logging system
138
+ logManager.logBuildOutput(output.trim(), true);
139
+ });
140
+ buildProcess.on('close', (code) => {
141
+ if (code === 0) {
142
+ console.log('Build completed successfully');
143
+ resolve();
144
+ }
145
+ else {
146
+ const error = new Error(`Build failed with exit code ${code}.\n${stderr}`);
147
+ console.error(error);
148
+ reject(error);
149
+ }
150
+ });
151
+ });
152
+ }
153
+ /**
154
+ * Trigger a manual build of the app
155
+ */
156
+ async triggerBuild() {
157
+ if (this.buildInProgress) {
158
+ throw new Error('Build already in progress');
159
+ }
160
+ this.buildInProgress = true;
161
+ super.emit('buildStart', { file: null });
162
+ try {
163
+ await this.buildApp();
164
+ this.lastBuildSuccess = true;
165
+ this.lastBuildTimestamp = new Date().toISOString();
166
+ this.lastBuildError = null;
167
+ super.emit('buildSuccess');
168
+ }
169
+ catch (error) {
170
+ this.lastBuildSuccess = false;
171
+ this.lastBuildTimestamp = new Date().toISOString();
172
+ this.lastBuildError = error instanceof Error ? error.message : String(error);
173
+ super.emit('buildError', error);
174
+ throw error;
175
+ }
176
+ finally {
177
+ this.buildInProgress = false;
178
+ }
179
+ }
180
+ /**
181
+ * Returns whether a build is currently in progress
182
+ */
183
+ isBuildInProgress() {
184
+ return this.buildInProgress;
185
+ }
186
+ /**
187
+ * Returns whether the last build was successful
188
+ */
189
+ getLastBuildSuccess() {
190
+ return this.lastBuildSuccess;
191
+ }
192
+ /**
193
+ * Returns the timestamp of the last build
194
+ */
195
+ getLastBuildTimestamp() {
196
+ return this.lastBuildTimestamp;
197
+ }
198
+ /**
199
+ * Returns the error message from the last failed build
200
+ */
201
+ getLastBuildError() {
202
+ return this.lastBuildError;
203
+ }
204
+ /**
205
+ * Returns the most recent build logs
206
+ */
207
+ getBuildLogs(limit = 100) {
208
+ // Return the most recent logs up to the limit
209
+ return this.buildLogs.slice(-limit);
210
+ }
211
+ }
212
+ exports.AppWatcher = AppWatcher;
213
+ //# sourceMappingURL=watcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../../src/executor/watcher.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,iDAAsC;AACtC,gDAAwB;AACxB,mCAAsC;AACtC,6CAA0C;AAC1C,sDAAmD;AAEnD;;GAEG;AACH,MAAa,UAAW,SAAQ,qBAAY;IAU1C;;OAEG;IACH,YAAY,MAAc;QACxB,KAAK,EAAE,CAAC;QAbF,YAAO,GAA8B,IAAI,CAAC;QAC1C,oBAAe,GAAG,KAAK,CAAC;QAGxB,qBAAgB,GAAmB,IAAI,CAAC;QACxC,uBAAkB,GAAkB,IAAI,CAAC;QACzC,mBAAc,GAAkB,IAAI,CAAC;QACrC,cAAS,GAAwE,EAAE,CAAC;QAO1F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,eAAM,CAAC,GAAG,CAAC,YAAY,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,KAAK;QACH,MAAM,UAAU,GAAG,eAAM,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CACrD,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,kBAAQ,CAAC,KAAK,CAAC,UAAU,EAAE;YACxC,OAAO,EAAE,eAAM,CAAC,GAAG,CAAC,WAAW;YAC/B,UAAU,EAAE,IAAI;YAChB,aAAa,EAAE,IAAI;SACpB,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAgB,EAAE,E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BAAkB,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACnD,IAAI,CAAC,cAAc,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7E,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YAChC,MAAM,KAAK,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC/B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,qBAAqB;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,QAAgB,GAAG;QAC9B,8CAA8C;QAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACF;AAjOD,gCAiOC"}
@@ -0,0 +1,4 @@
1
+ declare function _exports(context: any, request: any): Promise<{
2
+ message: string;
3
+ }>;
4
+ export = _exports;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ module.exports = async function (context, request) {
3
+ const name = request.query.name || 'World';
4
+ return {
5
+ message: `Hello, ${name}!`
6
+ };
7
+ };
8
+ //# sourceMappingURL=hello.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hello.js","sourceRoot":"","sources":["../../../src/functions/hello.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG,KAAK,WAAU,OAAO,EAAE,OAAO;IAC9C,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC;IAC3C,OAAO;QACL,OAAO,EAAE,UAAU,IAAI,GAAG;KAC3B,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export { startServer } from './server';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startServer = void 0;
4
+ // Export all components for external use
5
+ var server_1 = require("./server");
6
+ Object.defineProperty(exports, "startServer", { enumerable: true, get: function () { return server_1.startServer; } });
7
+ // CLI is the main entry point when installed globally
8
+ // It's not exported as it's meant to be run directly
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAyC;AACzC,mCAAuC;AAA9B,qGAAA,WAAW,OAAA;AAEpB,sDAAsD;AACtD,qDAAqD"}
@@ -0,0 +1,4 @@
1
+ declare function _exports(context: any): Promise<{
2
+ status: string;
3
+ }>;
4
+ export = _exports;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ module.exports = async function (context) {
3
+ context.logger.info('Daily job executed at ' + new Date().toISOString());
4
+ return {
5
+ status: 'success'
6
+ };
7
+ };
8
+ //# sourceMappingURL=dailyJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dailyJob.js","sourceRoot":"","sources":["../../../src/jobs/dailyJob.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG,KAAK,WAAU,OAAO;IACrC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACzE,OAAO;QACL,MAAM,EAAE,SAAS;KAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Local implementation of FunctionApi that returns URLs pointing to the local test server
3
+ */
4
+ export declare class LocalFunctionApi {
5
+ private appPath;
6
+ private baseUrl;
7
+ private appManifest;
8
+ private configStore;
9
+ constructor(appPath: string, appManifest: any, configStore: any, baseUrl?: string);
10
+ getEndpoints(installId?: number): Promise<{
11
+ [name: string]: string;
12
+ }>;
13
+ getGlobalEndpoints(): Promise<{
14
+ [name: string]: string;
15
+ }>;
16
+ getAuthorizationGrantUrl(): string;
17
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LocalFunctionApi = void 0;
4
+ const LogManager_1 = require("../logging/LogManager");
5
+ const functionEndpoints_1 = require("../utils/functionEndpoints");
6
+ const logManager = LogManager_1.LogManager.getInstance();
7
+ /**
8
+ * Local implementation of FunctionApi that returns URLs pointing to the local test server
9
+ */
10
+ class LocalFunctionApi {
11
+ constructor(appPath, appManifest, configStore, baseUrl = 'http://localhost:3000') {
12
+ this.appPath = appPath;
13
+ this.baseUrl = baseUrl;
14
+ this.appManifest = appManifest;
15
+ this.configStore = configStore;
16
+ }
17
+ async getEndpoints(installId) {
18
+ const actualInstallId = installId || 1;
19
+ const endpoints = (0, functionEndpoints_1.buildNonGlobalFunctionEndpoints)({
20
+ baseUrl: this.baseUrl,
21
+ appId: this.appManifest.meta.app_id,
22
+ functions: this.appManifest.functions || {},
23
+ getGuid: (functionId) => this.configStore.getFunctionGuid(functionId),
24
+ });
25
+ logManager.debug(LogManager_1.LogSource.System, LogManager_1.LogCategory.AppRunner, `Generated non-global endpoints for install ${actualInstallId}: ${JSON.stringify(endpoints)}`, {
26
+ id: 'sdkconfig',
27
+ operation: 'configure'
28
+ });
29
+ return endpoints;
30
+ }
31
+ async getGlobalEndpoints() {
32
+ const endpoints = (0, functionEndpoints_1.buildGlobalFunctionEndpoints)({
33
+ baseUrl: this.baseUrl,
34
+ appId: this.appManifest.meta.app_id,
35
+ functions: this.appManifest.functions || {},
36
+ getGuid: (functionId) => this.configStore.getFunctionGuid(functionId),
37
+ });
38
+ logManager.debug(LogManager_1.LogSource.System, LogManager_1.LogCategory.AppRunner, `Generated global endpoints: ${JSON.stringify(endpoints)}`, {
39
+ id: 'sdkconfig',
40
+ operation: 'configure'
41
+ });
42
+ return endpoints;
43
+ }
44
+ getAuthorizationGrantUrl() {
45
+ const grantUrl = `${this.baseUrl}/auth/grant`;
46
+ logManager.debug(LogManager_1.LogSource.System, LogManager_1.LogCategory.AppRunner, `Generated authorization grant URL: ${grantUrl}`, {
47
+ id: 'sdkconfig',
48
+ operation: 'configure'
49
+ });
50
+ return grantUrl;
51
+ }
52
+ }
53
+ exports.LocalFunctionApi = LocalFunctionApi;
54
+ //# sourceMappingURL=LocalFunctionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalFunctionApi.js","sourceRoot":"","sources":["../../../src/local_engine/LocalFunctionApi.ts"],"names":[],"mappings":";;;AAAA,sDAA2E;AAC3E,kEAA2G;AAE3G,MAAM,UAAU,GAAG,uBAAU,CAAC,WAAW,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAa,gBAAgB;IAM3B,YAAY,OAAe,EAAE,WAAgB,EAAE,WAAgB,EAAE,UAAkB,uBAAuB;QACxG,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,SAAkB;QACnC,MAAM,eAAe,GAAG,SAAS,IAAI,CAAC,CAAC;QACvC,MAAM,SAAS,GAAG,IAAA,mDAA+B,EAAC;YAChD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM;YACnC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE;YAC3C,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW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zaiusinc/app-sdk interfaces
3
+ * These are defined locally to avoid compile-time dependency on app-sdk
4
+ */
5
+ export type ValueHash = Record<string, any>;
6
+ export declare enum JobRunStatus {
7
+ Pending = "pending",
8
+ Running = "running",
9
+ Complete = "complete",
10
+ Error = "error",
11
+ Terminated = "terminated"
12
+ }
13
+ export interface JobDetail {
14
+ jobId: string;
15
+ status: JobRunStatus;
16
+ definition: {
17
+ name: string;
18
+ parameters: ValueHash;
19
+ };
20
+ errors: string;
21
+ startedAt?: string;
22
+ completedAt?: string;
23
+ terminatedAt?: string;
24
+ }
25
+ export declare class JobApiError extends Error {
26
+ constructor(message: string);
27
+ }
28
+ export declare class JobNotFoundError extends Error {
29
+ constructor(message: string);
30
+ }
31
+ /**
32
+ * Local implementation of JobApi for ocp-local-env
33
+ * Sends IPC messages to parent process to trigger jobs
34
+ *
35
+ * NOTE: This runs in the child process (app context), not the parent process.
36
+ * It communicates with the parent via IPC to request job execution.
37
+ */
38
+ export declare class LocalJobApi {
39
+ /**
40
+ * Trigger a job execution via IPC
41
+ * @throws {JobNotFoundError} if job not found in manifest
42
+ * @throws {JobApiError} if job is already running or other failure
43
+ */
44
+ trigger(jobName: string, parameters: ValueHash): Promise<JobDetail>;
45
+ /**
46
+ * Get details of a specific job execution via IPC
47
+ * @throws {JobNotFoundError} if execution not found
48
+ */
49
+ getDetail(executionId: string): Promise<JobDetail>;
50
+ /**
51
+ * Get status of a specific job execution via IPC
52
+ * @throws {JobNotFoundError} if execution not found
53
+ */
54
+ getStatus(executionId: string): Promise<JobRunStatus>;
55
+ /**
56
+ * Generic IPC request helper
57
+ */
58
+ private sendIPCRequest;
59
+ /**
60
+ * Generate a unique request ID for IPC correlation
61
+ */
62
+ private generateRequestId;
63
+ /**
64
+ * Transform status string to JobRunStatus enum
65
+ */
66
+ private transformStatus;
67
+ }