@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,246 @@
1
+ /**
2
+ * Centralized logging system for the OCP Local Environment
3
+ * Captures logs from builds, function executions, lifecycle hooks, and general operations
4
+ */
5
+ /**
6
+ * Log source types - reduced to 2 sources
7
+ */
8
+ export declare enum LogSource {
9
+ App = "app",
10
+ System = "system"
11
+ }
12
+ /**
13
+ * Log category types - specific categories for different log types
14
+ */
15
+ export declare enum LogCategory {
16
+ Build = "build",
17
+ Function = "function",
18
+ Lifecycle = "lifecycle",
19
+ Destination = "destination",
20
+ Source = "source",
21
+ Jobs = "jobs",
22
+ Notifications = "notifications",
23
+ KVStore = "kvstore",
24
+ Settings = "settings",
25
+ Secrets = "secrets",
26
+ Config = "config",
27
+ AppRunner = "app-runner"
28
+ }
29
+ /**
30
+ * Log levels
31
+ */
32
+ export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
33
+ /**
34
+ * Base context interface - common fields for all log contexts
35
+ */
36
+ export interface BaseLogContext {
37
+ id: string;
38
+ error?: any;
39
+ errorMessage?: string;
40
+ stack?: string;
41
+ [key: string]: any;
42
+ }
43
+ /**
44
+ * Empty context for categories that don't need specific context
45
+ */
46
+ export interface EmptyLogContext extends BaseLogContext {
47
+ }
48
+ /**
49
+ * Function execution context
50
+ * id = function identifier (e.g., 'my-function')
51
+ */
52
+ export interface FunctionLogContext extends BaseLogContext {
53
+ method?: string;
54
+ path?: string;
55
+ executionTime?: number;
56
+ status?: number;
57
+ }
58
+ /**
59
+ * Lifecycle execution context
60
+ * id = hook name (e.g., 'onInstall')
61
+ */
62
+ export interface LifecycleLogContext extends BaseLogContext {
63
+ executionTime?: number;
64
+ status?: number;
65
+ }
66
+ /**
67
+ * Destination execution context
68
+ * id = destination identifier (e.g., 'analytics-destination')
69
+ */
70
+ export interface DestinationLogContext extends BaseLogContext {
71
+ operation?: 'ready' | 'deliver' | 'schema';
72
+ batchSize?: number;
73
+ ready?: boolean;
74
+ retryable?: boolean;
75
+ failureReason?: string;
76
+ }
77
+ /**
78
+ * Source execution context
79
+ * id = source identifier (e.g., 'my-source')
80
+ */
81
+ export interface SourceLogContext extends BaseLogContext {
82
+ operation?: string;
83
+ error?: any;
84
+ }
85
+ /**
86
+ * Job operation context
87
+ * id = job identifier or 'unknown'
88
+ */
89
+ export interface JobLogContext extends BaseLogContext {
90
+ operation?: 'schedule' | 'execute' | 'cancel' | 'list';
91
+ status?: string;
92
+ }
93
+ /**
94
+ * Notification operation context
95
+ * id = notification identifier or 'unknown'
96
+ */
97
+ export interface NotificationLogContext extends BaseLogContext {
98
+ operation?: 'send' | 'list' | 'clear';
99
+ recipient?: string;
100
+ }
101
+ /**
102
+ * Storage operation context (kvstore, settings, secrets, config)
103
+ * id = key identifier (e.g., 'user:123') or 'unknown'
104
+ */
105
+ export interface StorageLogContext extends BaseLogContext {
106
+ store: string;
107
+ operation: 'get' | 'set' | 'delete' | 'exists' | 'list' | 'clear';
108
+ key?: string;
109
+ value?: any;
110
+ ttl?: number;
111
+ }
112
+ /**
113
+ * IPC communication context
114
+ * id = request identifier or 'unknown'
115
+ */
116
+ export interface IPCLogContext extends BaseLogContext {
117
+ messageType?: string;
118
+ connectionId?: string;
119
+ timeout?: number;
120
+ }
121
+ /**
122
+ * Process management context
123
+ * id = process identifier or 'unknown'
124
+ */
125
+ export interface ProcessLogContext extends BaseLogContext {
126
+ connectionId?: string;
127
+ operation?: string;
128
+ exitCode?: number;
129
+ signal?: string;
130
+ processId?: string;
131
+ appId?: string;
132
+ port?: number;
133
+ }
134
+ /**
135
+ * Map each category to its context type
136
+ */
137
+ export type CategoryContextMap = {
138
+ [LogCategory.Build]: EmptyLogContext;
139
+ [LogCategory.Function]: FunctionLogContext;
140
+ [LogCategory.Lifecycle]: LifecycleLogContext;
141
+ [LogCategory.Destination]: DestinationLogContext;
142
+ [LogCategory.Source]: SourceLogContext;
143
+ [LogCategory.Jobs]: JobLogContext;
144
+ [LogCategory.Notifications]: NotificationLogContext;
145
+ [LogCategory.KVStore]: StorageLogContext;
146
+ [LogCategory.Settings]: StorageLogContext;
147
+ [LogCategory.Secrets]: StorageLogContext;
148
+ [LogCategory.Config]: StorageLogContext;
149
+ [LogCategory.AppRunner]: ProcessLogContext | IPCLogContext;
150
+ };
151
+ /**
152
+ * Type-safe log entry
153
+ */
154
+ export type LogEntry<C extends LogCategory = LogCategory> = {
155
+ id: string;
156
+ timestamp: string;
157
+ source: LogSource;
158
+ category: C;
159
+ level: LogLevel;
160
+ message: string;
161
+ context?: CategoryContextMap[C];
162
+ };
163
+ export declare class LogManager {
164
+ private static instance;
165
+ private logs;
166
+ private maxLogs;
167
+ private logListeners;
168
+ private constructor();
169
+ /**
170
+ * Get the singleton instance
171
+ */
172
+ static getInstance(): LogManager;
173
+ /**
174
+ * Core log method - accepts type-safe log entries
175
+ */
176
+ log<C extends LogCategory>(entry: Omit<LogEntry<C>, 'id' | 'timestamp'>): void;
177
+ /**
178
+ * Convenience methods with type-safe contexts
179
+ */
180
+ debug<C extends LogCategory>(source: LogSource, category: C, message: string, context?: CategoryContextMap[C]): void;
181
+ info<C extends LogCategory>(source: LogSource, category: C, message: string, context?: CategoryContextMap[C]): void;
182
+ warn<C extends LogCategory>(source: LogSource, category: C, message: string, context?: CategoryContextMap[C]): void;
183
+ error<C extends LogCategory>(source: LogSource, category: C, message: string, context?: CategoryContextMap[C]): void;
184
+ /**
185
+ * Specialized convenience method for function execution
186
+ */
187
+ logFunctionExecution(functionId: string, status: 'started' | 'success' | 'error', details?: Partial<FunctionLogContext>): void;
188
+ /**
189
+ * Specialized convenience method for lifecycle execution
190
+ */
191
+ logLifecycleExecution(hookName: string, status: 'started' | 'success' | 'error', details?: Partial<LifecycleLogContext>): void;
192
+ /**
193
+ * Specialized convenience method for destination execution
194
+ */
195
+ logDestinationExecution(destinationId: string, operation: 'ready' | 'deliver' | 'schema', status: 'started' | 'success' | 'error', details?: Partial<DestinationLogContext>): void;
196
+ /**
197
+ * Specialized convenience method for build events
198
+ */
199
+ logBuildEvent(status: 'started' | 'success' | 'error', details?: any): void;
200
+ /**
201
+ * Log function output/console logs
202
+ */
203
+ logFunctionOutput(functionId: string, output: string, isError?: boolean): void;
204
+ /**
205
+ * Log build output
206
+ */
207
+ logBuildOutput(output: string, isError?: boolean): void;
208
+ /**
209
+ * Log source execution events
210
+ */
211
+ logSourceExecution(sourceId: string, operation: string, status: 'started' | 'success' | 'error', additionalContext?: any): void;
212
+ /**
213
+ * Get logs with optional filtering
214
+ */
215
+ getLogs(options?: {
216
+ limit?: number;
217
+ source?: LogSource;
218
+ level?: LogLevel;
219
+ since?: string;
220
+ category?: LogCategory;
221
+ }): LogEntry[];
222
+ /**
223
+ * Clear all logs
224
+ */
225
+ clearLogs(): void;
226
+ /**
227
+ * Add a listener for new log entries
228
+ */
229
+ addListener(listener: (log: LogEntry) => void): () => void;
230
+ /**
231
+ * Generate a unique ID for log entries
232
+ */
233
+ private generateId;
234
+ /**
235
+ * Log to console with new format
236
+ */
237
+ private logToConsole;
238
+ /**
239
+ * Get log statistics
240
+ */
241
+ getStats(): {
242
+ total: number;
243
+ bySource: Record<string, number>;
244
+ byLevel: Record<string, number>;
245
+ };
246
+ }
@@ -0,0 +1,343 @@
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 = exports.LogCategory = exports.LogSource = void 0;
8
+ // ===== TYPE DEFINITIONS =====
9
+ /**
10
+ * Log source types - reduced to 2 sources
11
+ */
12
+ var LogSource;
13
+ (function (LogSource) {
14
+ LogSource["App"] = "app";
15
+ LogSource["System"] = "system";
16
+ })(LogSource || (exports.LogSource = LogSource = {}));
17
+ /**
18
+ * Log category types - specific categories for different log types
19
+ */
20
+ var LogCategory;
21
+ (function (LogCategory) {
22
+ // Core application
23
+ LogCategory["Build"] = "build";
24
+ LogCategory["Function"] = "function";
25
+ LogCategory["Lifecycle"] = "lifecycle";
26
+ LogCategory["Destination"] = "destination";
27
+ LogCategory["Source"] = "source";
28
+ LogCategory["Jobs"] = "jobs";
29
+ LogCategory["Notifications"] = "notifications";
30
+ // System infrastructure
31
+ LogCategory["KVStore"] = "kvstore";
32
+ LogCategory["Settings"] = "settings";
33
+ LogCategory["Secrets"] = "secrets";
34
+ LogCategory["Config"] = "config";
35
+ LogCategory["AppRunner"] = "app-runner";
36
+ })(LogCategory || (exports.LogCategory = LogCategory = {}));
37
+ // ===== LOG MANAGER =====
38
+ class LogManager {
39
+ constructor() {
40
+ this.logs = [];
41
+ this.maxLogs = 1000; // Keep last 1000 logs
42
+ this.logListeners = [];
43
+ // Private constructor for singleton
44
+ }
45
+ /**
46
+ * Get the singleton instance
47
+ */
48
+ static getInstance() {
49
+ if (!this.instance) {
50
+ this.instance = new LogManager();
51
+ }
52
+ return this.instance;
53
+ }
54
+ /**
55
+ * Core log method - accepts type-safe log entries
56
+ */
57
+ log(entry) {
58
+ const logEntry = {
59
+ ...entry,
60
+ id: this.generateId(),
61
+ timestamp: new Date().toISOString()
62
+ };
63
+ this.logs.push(logEntry);
64
+ if (this.logs.length > this.maxLogs) {
65
+ this.logs = this.logs.slice(-this.maxLogs);
66
+ }
67
+ this.logListeners.forEach(listener => {
68
+ try {
69
+ listener(logEntry);
70
+ }
71
+ catch (error) {
72
+ console.error('Error notifying log listener:', error);
73
+ }
74
+ });
75
+ this.logToConsole(logEntry);
76
+ }
77
+ /**
78
+ * Convenience methods with type-safe contexts
79
+ */
80
+ debug(source, category, message, context) {
81
+ this.log({ source, category, level: 'debug', message, context });
82
+ }
83
+ info(source, category, message, context) {
84
+ this.log({ source, category, level: 'info', message, context });
85
+ }
86
+ warn(source, category, message, context) {
87
+ this.log({ source, category, level: 'warn', message, context });
88
+ }
89
+ error(source, category, message, context) {
90
+ this.log({ source, category, level: 'error', message, context });
91
+ }
92
+ /**
93
+ * Specialized convenience method for function execution
94
+ */
95
+ logFunctionExecution(functionId, status, details) {
96
+ const messages = {
97
+ started: 'Function execution started',
98
+ success: 'Function execution completed successfully',
99
+ error: 'Function execution failed'
100
+ };
101
+ this.log({
102
+ source: LogSource.App,
103
+ category: LogCategory.Function,
104
+ level: status === 'error' ? 'error' : 'info',
105
+ message: messages[status],
106
+ context: {
107
+ id: functionId,
108
+ ...details
109
+ }
110
+ });
111
+ }
112
+ /**
113
+ * Specialized convenience method for lifecycle execution
114
+ */
115
+ logLifecycleExecution(hookName, status, details) {
116
+ const messages = {
117
+ started: 'Lifecycle hook execution started',
118
+ success: 'Lifecycle hook execution completed successfully',
119
+ error: 'Lifecycle hook execution failed'
120
+ };
121
+ this.log({
122
+ source: LogSource.App,
123
+ category: LogCategory.Lifecycle,
124
+ level: status === 'error' ? 'error' : 'info',
125
+ message: messages[status],
126
+ context: {
127
+ id: hookName,
128
+ ...details
129
+ }
130
+ });
131
+ }
132
+ /**
133
+ * Specialized convenience method for destination execution
134
+ */
135
+ logDestinationExecution(destinationId, operation, status, details) {
136
+ const messages = {
137
+ started: {
138
+ ready: 'Executing ready() for destination',
139
+ deliver: 'Delivering batch to destination',
140
+ schema: 'Loading schema for destination'
141
+ },
142
+ success: {
143
+ ready: 'Destination ready() completed successfully',
144
+ deliver: 'Batch delivered successfully',
145
+ schema: 'Schema loaded successfully'
146
+ },
147
+ error: {
148
+ ready: 'Destination ready() failed',
149
+ deliver: 'Batch delivery failed',
150
+ schema: 'Schema loading failed'
151
+ }
152
+ };
153
+ this.log({
154
+ source: LogSource.System,
155
+ category: LogCategory.AppRunner,
156
+ level: status === 'error' ? 'error' : 'info',
157
+ message: messages[status][operation],
158
+ context: {
159
+ id: destinationId,
160
+ operation,
161
+ ...details
162
+ }
163
+ });
164
+ }
165
+ /**
166
+ * Specialized convenience method for build events
167
+ */
168
+ logBuildEvent(status, details) {
169
+ const messages = {
170
+ started: 'Build started',
171
+ success: 'Build completed successfully',
172
+ error: 'Build failed'
173
+ };
174
+ this.log({
175
+ source: LogSource.System,
176
+ category: LogCategory.Build,
177
+ level: status === 'error' ? 'error' : 'info',
178
+ message: messages[status],
179
+ context: {
180
+ id: 'build',
181
+ ...details
182
+ }
183
+ });
184
+ }
185
+ /**
186
+ * Log function output/console logs
187
+ */
188
+ logFunctionOutput(functionId, output, isError = false) {
189
+ const lines = output.split('\n').filter(line => line.trim());
190
+ lines.forEach(line => {
191
+ this.log({
192
+ source: LogSource.App,
193
+ category: LogCategory.Function,
194
+ level: isError ? 'error' : 'info',
195
+ message: line.trim(),
196
+ context: { id: functionId }
197
+ });
198
+ });
199
+ }
200
+ /**
201
+ * Log build output
202
+ */
203
+ logBuildOutput(output, isError = false) {
204
+ const lines = output.split('\n').filter(line => line.trim());
205
+ lines.forEach(line => {
206
+ this.log({
207
+ source: LogSource.System,
208
+ category: LogCategory.Build,
209
+ level: isError ? 'error' : 'info',
210
+ message: line.trim(),
211
+ context: { id: 'build' }
212
+ });
213
+ });
214
+ }
215
+ /**
216
+ * Log source execution events
217
+ */
218
+ logSourceExecution(sourceId, operation, status, additionalContext) {
219
+ const level = status === 'error' ? 'error' : 'info';
220
+ const message = `Source ${operation} ${status}`;
221
+ this.log({
222
+ source: LogSource.System,
223
+ category: LogCategory.Source,
224
+ level,
225
+ message,
226
+ context: {
227
+ id: sourceId,
228
+ operation,
229
+ ...additionalContext
230
+ }
231
+ });
232
+ }
233
+ /**
234
+ * Get logs with optional filtering
235
+ */
236
+ getLogs(options) {
237
+ let filteredLogs = this.logs;
238
+ // Apply filters
239
+ if (options?.source) {
240
+ filteredLogs = filteredLogs.filter(log => log.source === options.source);
241
+ }
242
+ if (options?.level) {
243
+ const levels = ['debug', 'info', 'warn', 'error'];
244
+ const minLevelIndex = levels.indexOf(options.level);
245
+ filteredLogs = filteredLogs.filter(log => levels.indexOf(log.level) >= minLevelIndex);
246
+ }
247
+ if (options?.since) {
248
+ const sinceTime = new Date(options.since).getTime();
249
+ filteredLogs = filteredLogs.filter(log => new Date(log.timestamp).getTime() >= sinceTime);
250
+ }
251
+ if (options?.category) {
252
+ filteredLogs = filteredLogs.filter(log => log.category === options.category);
253
+ }
254
+ // Apply limit
255
+ const limit = options?.limit || 100;
256
+ return filteredLogs.slice(-limit);
257
+ }
258
+ /**
259
+ * Clear all logs
260
+ */
261
+ clearLogs() {
262
+ this.logs = [];
263
+ this.info(LogSource.System, LogCategory.AppRunner, 'Logs cleared', { id: 'unknown' });
264
+ }
265
+ /**
266
+ * Add a listener for new log entries
267
+ */
268
+ addListener(listener) {
269
+ this.logListeners.push(listener);
270
+ // Return unsubscribe function
271
+ return () => {
272
+ const index = this.logListeners.indexOf(listener);
273
+ if (index > -1) {
274
+ this.logListeners.splice(index, 1);
275
+ }
276
+ };
277
+ }
278
+ /**
279
+ * Generate a unique ID for log entries
280
+ */
281
+ generateId() {
282
+ return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
283
+ }
284
+ /**
285
+ * Log to console with new format
286
+ */
287
+ logToConsole(entry) {
288
+ if (process.env.DISABLE_LOGMANAGER_CONSOLE === 'true') {
289
+ return;
290
+ }
291
+ // New format: [timestamp] - [source:category:id] - [level] - [message]
292
+ const timestamp = entry.timestamp;
293
+ const id = entry.context?.id || 'unknown';
294
+ const sourceCategoryId = `${entry.source}:${entry.category}:${id}`;
295
+ const level = entry.level;
296
+ const prefix = `[${timestamp}] - [${sourceCategoryId}] - [${level}]`;
297
+ // Escape newlines for single-line console output
298
+ const escapedMessage = entry.message
299
+ .replace(/\n/g, '\\n')
300
+ .replace(/\r/g, '\\r');
301
+ // Include context if present (excluding id since it's in the prefix)
302
+ let contextStr = '';
303
+ if (entry.context && Object.keys(entry.context).length > 0) {
304
+ const { id: _, ...contextWithoutId } = entry.context;
305
+ if (Object.keys(contextWithoutId).length > 0) {
306
+ contextStr = ` ${JSON.stringify(contextWithoutId)}`;
307
+ }
308
+ }
309
+ const fullMessage = `${prefix} - ${escapedMessage}${contextStr}`;
310
+ switch (entry.level) {
311
+ case 'error':
312
+ console.error(fullMessage);
313
+ break;
314
+ case 'warn':
315
+ console.warn(fullMessage);
316
+ break;
317
+ case 'debug':
318
+ console.debug(fullMessage);
319
+ break;
320
+ default:
321
+ console.log(fullMessage);
322
+ }
323
+ }
324
+ /**
325
+ * Get log statistics
326
+ */
327
+ getStats() {
328
+ const bySource = {};
329
+ const byLevel = {};
330
+ this.logs.forEach(log => {
331
+ bySource[log.source] = (bySource[log.source] || 0) + 1;
332
+ byLevel[log.level] = (byLevel[log.level] || 0) + 1;
333
+ });
334
+ return {
335
+ total: this.logs.length,
336
+ bySource,
337
+ byLevel
338
+ };
339
+ }
340
+ }
341
+ exports.LogManager = LogManager;
342
+ LogManager.instance = null;
343
+ //# sourceMappingURL=LogManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogManager.js","sourceRoot":"","sources":["../../../src/logging/LogManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAE/B;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,8BAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED;;GAEG;AACH,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,mBAAmB;IACnB,8BAAe,CAAA;IACf,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,gCAAiB,CAAA;IACjB,4BAAa,C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,CAAC,CAAC;YACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;YACvB,QAAQ;YACR,OAAO;SACR,CAAC;IACJ,CAAC;;AAhZH,gCAiZC;AAhZgB,mBAAQ,GAAsB,IAAI,AAA1B,CAA2B"}
@@ -0,0 +1,7 @@
1
+ import express from 'express';
2
+ import { App } from '../../types/app';
3
+ import { AppWatcher } from '../../executor/watcher';
4
+ /**
5
+ * Create API routes for destination testing
6
+ */
7
+ export declare function createDestinationRoutes(app: App, watcher?: AppWatcher): express.Router;