nuxt-observe 0.0.2

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 (435) hide show
  1. package/README.md +92 -0
  2. package/dist/module.d.mts +7 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +393 -0
  5. package/dist/runtime/app/assets/css/main.css +1 -0
  6. package/dist/runtime/app/components/ObserveActivityFeed.d.vue.ts +13 -0
  7. package/dist/runtime/app/components/ObserveActivityFeed.vue +77 -0
  8. package/dist/runtime/app/components/ObserveActivityFeed.vue.d.ts +13 -0
  9. package/dist/runtime/app/components/ObserveActivityTable.d.vue.ts +30 -0
  10. package/dist/runtime/app/components/ObserveActivityTable.vue +187 -0
  11. package/dist/runtime/app/components/ObserveActivityTable.vue.d.ts +30 -0
  12. package/dist/runtime/app/components/ObserveCan.d.vue.ts +27 -0
  13. package/dist/runtime/app/components/ObserveCan.vue +16 -0
  14. package/dist/runtime/app/components/ObserveCan.vue.d.ts +27 -0
  15. package/dist/runtime/app/components/ObserveErrorsTable.d.vue.ts +19 -0
  16. package/dist/runtime/app/components/ObserveErrorsTable.vue +105 -0
  17. package/dist/runtime/app/components/ObserveErrorsTable.vue.d.ts +19 -0
  18. package/dist/runtime/app/components/ObserveHealthHero.d.vue.ts +16 -0
  19. package/dist/runtime/app/components/ObserveHealthHero.vue +114 -0
  20. package/dist/runtime/app/components/ObserveHealthHero.vue.d.ts +16 -0
  21. package/dist/runtime/app/components/ObserveJourneySearch.d.vue.ts +13 -0
  22. package/dist/runtime/app/components/ObserveJourneySearch.vue +55 -0
  23. package/dist/runtime/app/components/ObserveJourneySearch.vue.d.ts +13 -0
  24. package/dist/runtime/app/components/ObserveJourneyTimeline.d.vue.ts +14 -0
  25. package/dist/runtime/app/components/ObserveJourneyTimeline.vue +119 -0
  26. package/dist/runtime/app/components/ObserveJourneyTimeline.vue.d.ts +14 -0
  27. package/dist/runtime/app/components/ObserveLogDetail.d.vue.ts +12 -0
  28. package/dist/runtime/app/components/ObserveLogDetail.vue +187 -0
  29. package/dist/runtime/app/components/ObserveLogDetail.vue.d.ts +12 -0
  30. package/dist/runtime/app/components/ObserveLogLevelBadge.d.vue.ts +10 -0
  31. package/dist/runtime/app/components/ObserveLogLevelBadge.vue +29 -0
  32. package/dist/runtime/app/components/ObserveLogLevelBadge.vue.d.ts +10 -0
  33. package/dist/runtime/app/components/ObserveLogsFilterBar.d.vue.ts +20 -0
  34. package/dist/runtime/app/components/ObserveLogsFilterBar.vue +134 -0
  35. package/dist/runtime/app/components/ObserveLogsFilterBar.vue.d.ts +20 -0
  36. package/dist/runtime/app/components/ObserveLogsTable.d.vue.ts +20 -0
  37. package/dist/runtime/app/components/ObserveLogsTable.vue +92 -0
  38. package/dist/runtime/app/components/ObserveLogsTable.vue.d.ts +20 -0
  39. package/dist/runtime/app/components/ObservePeriodSelector.d.vue.ts +3 -0
  40. package/dist/runtime/app/components/ObservePeriodSelector.vue +22 -0
  41. package/dist/runtime/app/components/ObservePeriodSelector.vue.d.ts +3 -0
  42. package/dist/runtime/app/components/ObserveRegressionAlert.d.vue.ts +12 -0
  43. package/dist/runtime/app/components/ObserveRegressionAlert.vue +27 -0
  44. package/dist/runtime/app/components/ObserveRegressionAlert.vue.d.ts +12 -0
  45. package/dist/runtime/app/components/ObserveServiceSwitcher.d.vue.ts +3 -0
  46. package/dist/runtime/app/components/ObserveServiceSwitcher.vue +49 -0
  47. package/dist/runtime/app/components/ObserveServiceSwitcher.vue.d.ts +3 -0
  48. package/dist/runtime/app/components/ObserveServicesTable.d.vue.ts +15 -0
  49. package/dist/runtime/app/components/ObserveServicesTable.vue +109 -0
  50. package/dist/runtime/app/components/ObserveServicesTable.vue.d.ts +15 -0
  51. package/dist/runtime/app/components/ObserveStatCard.d.vue.ts +14 -0
  52. package/dist/runtime/app/components/ObserveStatCard.vue +34 -0
  53. package/dist/runtime/app/components/ObserveStatCard.vue.d.ts +14 -0
  54. package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.d.vue.ts +15 -0
  55. package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue +170 -0
  56. package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue.d.ts +15 -0
  57. package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.d.vue.ts +17 -0
  58. package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue +208 -0
  59. package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue.d.ts +17 -0
  60. package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.d.vue.ts +14 -0
  61. package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue +208 -0
  62. package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue.d.ts +14 -0
  63. package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.d.vue.ts +14 -0
  64. package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue +190 -0
  65. package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue.d.ts +14 -0
  66. package/dist/runtime/app/components/charts/ObserveVolumeChart.client.d.vue.ts +16 -0
  67. package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue +199 -0
  68. package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue.d.ts +16 -0
  69. package/dist/runtime/app/components/charts/chart-core.d.ts +64 -0
  70. package/dist/runtime/app/components/charts/chart-core.js +136 -0
  71. package/dist/runtime/app/components/settings/ObserveApiKeyPanel.d.vue.ts +8 -0
  72. package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue +145 -0
  73. package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue.d.ts +8 -0
  74. package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.d.vue.ts +19 -0
  75. package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue +106 -0
  76. package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue.d.ts +19 -0
  77. package/dist/runtime/app/components/settings/ObserveAssignmentEditor.d.vue.ts +12 -0
  78. package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue +67 -0
  79. package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue.d.ts +12 -0
  80. package/dist/runtime/app/components/settings/ObserveGroupFormModal.d.vue.ts +18 -0
  81. package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue +60 -0
  82. package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue.d.ts +18 -0
  83. package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.d.vue.ts +20 -0
  84. package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue +21 -0
  85. package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue.d.ts +20 -0
  86. package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.d.vue.ts +15 -0
  87. package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue +63 -0
  88. package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue.d.ts +15 -0
  89. package/dist/runtime/app/components/settings/ObserveServiceEditForm.d.vue.ts +38 -0
  90. package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue +216 -0
  91. package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue.d.ts +38 -0
  92. package/dist/runtime/app/components/settings/ObserveServiceFormModal.d.vue.ts +37 -0
  93. package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue +192 -0
  94. package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue.d.ts +37 -0
  95. package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.d.vue.ts +11 -0
  96. package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue +18 -0
  97. package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue.d.ts +11 -0
  98. package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.d.vue.ts +19 -0
  99. package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue +132 -0
  100. package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue.d.ts +19 -0
  101. package/dist/runtime/app/components/settings/ObserveUserFormModal.d.vue.ts +27 -0
  102. package/dist/runtime/app/components/settings/ObserveUserFormModal.vue +108 -0
  103. package/dist/runtime/app/components/settings/ObserveUserFormModal.vue.d.ts +27 -0
  104. package/dist/runtime/app/components/settings/ObserveVersionTrackingField.d.vue.ts +17 -0
  105. package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue +20 -0
  106. package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue.d.ts +17 -0
  107. package/dist/runtime/app/composables/useObserveAbility.d.ts +15 -0
  108. package/dist/runtime/app/composables/useObserveAbility.js +20 -0
  109. package/dist/runtime/app/composables/useObserveActivity.d.ts +22 -0
  110. package/dist/runtime/app/composables/useObserveActivity.js +44 -0
  111. package/dist/runtime/app/composables/useObserveApiKeys.d.ts +15 -0
  112. package/dist/runtime/app/composables/useObserveApiKeys.js +19 -0
  113. package/dist/runtime/app/composables/useObserveAssignments.d.ts +19 -0
  114. package/dist/runtime/app/composables/useObserveAssignments.js +16 -0
  115. package/dist/runtime/app/composables/useObserveErrors.d.ts +33 -0
  116. package/dist/runtime/app/composables/useObserveErrors.js +85 -0
  117. package/dist/runtime/app/composables/useObserveGroups.d.ts +27 -0
  118. package/dist/runtime/app/composables/useObserveGroups.js +33 -0
  119. package/dist/runtime/app/composables/useObserveJourney.d.ts +19 -0
  120. package/dist/runtime/app/composables/useObserveJourney.js +19 -0
  121. package/dist/runtime/app/composables/useObserveLogFacets.d.ts +11 -0
  122. package/dist/runtime/app/composables/useObserveLogFacets.js +21 -0
  123. package/dist/runtime/app/composables/useObserveLogs.d.ts +28 -0
  124. package/dist/runtime/app/composables/useObserveLogs.js +100 -0
  125. package/dist/runtime/app/composables/useObserveMigrations.d.ts +17 -0
  126. package/dist/runtime/app/composables/useObserveMigrations.js +49 -0
  127. package/dist/runtime/app/composables/useObserveOverview.d.ts +14 -0
  128. package/dist/runtime/app/composables/useObserveOverview.js +23 -0
  129. package/dist/runtime/app/composables/useObservePeriod.d.ts +11 -0
  130. package/dist/runtime/app/composables/useObservePeriod.js +18 -0
  131. package/dist/runtime/app/composables/useObserveRollout.d.ts +20 -0
  132. package/dist/runtime/app/composables/useObserveRollout.js +55 -0
  133. package/dist/runtime/app/composables/useObserveScope.d.ts +13 -0
  134. package/dist/runtime/app/composables/useObserveScope.js +17 -0
  135. package/dist/runtime/app/composables/useObserveServices.d.ts +26 -0
  136. package/dist/runtime/app/composables/useObserveServices.js +33 -0
  137. package/dist/runtime/app/composables/useObserveStats.d.ts +14 -0
  138. package/dist/runtime/app/composables/useObserveStats.js +23 -0
  139. package/dist/runtime/app/composables/useObserveUsers.d.ts +29 -0
  140. package/dist/runtime/app/composables/useObserveUsers.js +33 -0
  141. package/dist/runtime/app/layouts/observe.d.vue.ts +13 -0
  142. package/dist/runtime/app/layouts/observe.vue +138 -0
  143. package/dist/runtime/app/layouts/observe.vue.d.ts +13 -0
  144. package/dist/runtime/app/middleware/observe-auth.global.d.ts +9 -0
  145. package/dist/runtime/app/middleware/observe-auth.global.js +8 -0
  146. package/dist/runtime/app/pages/activity.d.vue.ts +3 -0
  147. package/dist/runtime/app/pages/activity.vue +54 -0
  148. package/dist/runtime/app/pages/activity.vue.d.ts +3 -0
  149. package/dist/runtime/app/pages/error-detail.d.vue.ts +3 -0
  150. package/dist/runtime/app/pages/error-detail.vue +190 -0
  151. package/dist/runtime/app/pages/error-detail.vue.d.ts +3 -0
  152. package/dist/runtime/app/pages/errors.d.vue.ts +3 -0
  153. package/dist/runtime/app/pages/errors.vue +47 -0
  154. package/dist/runtime/app/pages/errors.vue.d.ts +3 -0
  155. package/dist/runtime/app/pages/journey.d.vue.ts +3 -0
  156. package/dist/runtime/app/pages/journey.vue +96 -0
  157. package/dist/runtime/app/pages/journey.vue.d.ts +3 -0
  158. package/dist/runtime/app/pages/log-detail.d.vue.ts +3 -0
  159. package/dist/runtime/app/pages/log-detail.vue +35 -0
  160. package/dist/runtime/app/pages/log-detail.vue.d.ts +3 -0
  161. package/dist/runtime/app/pages/login.d.vue.ts +3 -0
  162. package/dist/runtime/app/pages/login.vue +69 -0
  163. package/dist/runtime/app/pages/login.vue.d.ts +3 -0
  164. package/dist/runtime/app/pages/logs.d.vue.ts +3 -0
  165. package/dist/runtime/app/pages/logs.vue +36 -0
  166. package/dist/runtime/app/pages/logs.vue.d.ts +3 -0
  167. package/dist/runtime/app/pages/metrics.d.vue.ts +3 -0
  168. package/dist/runtime/app/pages/metrics.vue +68 -0
  169. package/dist/runtime/app/pages/metrics.vue.d.ts +3 -0
  170. package/dist/runtime/app/pages/overview.d.vue.ts +3 -0
  171. package/dist/runtime/app/pages/overview.vue +65 -0
  172. package/dist/runtime/app/pages/overview.vue.d.ts +3 -0
  173. package/dist/runtime/app/pages/rollout.d.vue.ts +3 -0
  174. package/dist/runtime/app/pages/rollout.vue +188 -0
  175. package/dist/runtime/app/pages/rollout.vue.d.ts +3 -0
  176. package/dist/runtime/app/pages/settings/group-detail.d.vue.ts +3 -0
  177. package/dist/runtime/app/pages/settings/group-detail.vue +149 -0
  178. package/dist/runtime/app/pages/settings/group-detail.vue.d.ts +3 -0
  179. package/dist/runtime/app/pages/settings/groups.d.vue.ts +3 -0
  180. package/dist/runtime/app/pages/settings/groups.vue +107 -0
  181. package/dist/runtime/app/pages/settings/groups.vue.d.ts +3 -0
  182. package/dist/runtime/app/pages/settings/index.d.vue.ts +3 -0
  183. package/dist/runtime/app/pages/settings/index.vue +47 -0
  184. package/dist/runtime/app/pages/settings/index.vue.d.ts +3 -0
  185. package/dist/runtime/app/pages/settings/migrations.d.vue.ts +3 -0
  186. package/dist/runtime/app/pages/settings/migrations.vue +275 -0
  187. package/dist/runtime/app/pages/settings/migrations.vue.d.ts +3 -0
  188. package/dist/runtime/app/pages/settings/service-detail.d.vue.ts +3 -0
  189. package/dist/runtime/app/pages/settings/service-detail.vue +133 -0
  190. package/dist/runtime/app/pages/settings/service-detail.vue.d.ts +3 -0
  191. package/dist/runtime/app/pages/settings/services.d.vue.ts +3 -0
  192. package/dist/runtime/app/pages/settings/services.vue +66 -0
  193. package/dist/runtime/app/pages/settings/services.vue.d.ts +3 -0
  194. package/dist/runtime/app/pages/settings/users/[id].d.vue.ts +3 -0
  195. package/dist/runtime/app/pages/settings/users/[id].vue +243 -0
  196. package/dist/runtime/app/pages/settings/users/[id].vue.d.ts +3 -0
  197. package/dist/runtime/app/pages/settings/users/index.d.vue.ts +3 -0
  198. package/dist/runtime/app/pages/settings/users/index.vue +129 -0
  199. package/dist/runtime/app/pages/settings/users/index.vue.d.ts +3 -0
  200. package/dist/runtime/options.d.ts +1 -0
  201. package/dist/runtime/options.js +1 -0
  202. package/dist/runtime/server/api/observe/activity.get.d.ts +3 -0
  203. package/dist/runtime/server/api/observe/activity.get.js +30 -0
  204. package/dist/runtime/server/api/observe/auth/login.post.d.ts +4 -0
  205. package/dist/runtime/server/api/observe/auth/login.post.js +13 -0
  206. package/dist/runtime/server/api/observe/auth/logout.post.d.ts +4 -0
  207. package/dist/runtime/server/api/observe/auth/logout.post.js +6 -0
  208. package/dist/runtime/server/api/observe/auth/me.get.d.ts +2 -0
  209. package/dist/runtime/server/api/observe/auth/me.get.js +3 -0
  210. package/dist/runtime/server/api/observe/errors/[fingerprint].get.d.ts +3 -0
  211. package/dist/runtime/server/api/observe/errors/[fingerprint].get.js +56 -0
  212. package/dist/runtime/server/api/observe/errors/index.get.d.ts +3 -0
  213. package/dist/runtime/server/api/observe/errors/index.get.js +41 -0
  214. package/dist/runtime/server/api/observe/facets.get.d.ts +8 -0
  215. package/dist/runtime/server/api/observe/facets.get.js +12 -0
  216. package/dist/runtime/server/api/observe/groups/[id]/assignments.put.d.ts +3 -0
  217. package/dist/runtime/server/api/observe/groups/[id]/assignments.put.js +12 -0
  218. package/dist/runtime/server/api/observe/groups/[id]/services.put.d.ts +5 -0
  219. package/dist/runtime/server/api/observe/groups/[id]/services.put.js +13 -0
  220. package/dist/runtime/server/api/observe/groups/[id].delete.d.ts +5 -0
  221. package/dist/runtime/server/api/observe/groups/[id].delete.js +11 -0
  222. package/dist/runtime/server/api/observe/groups/[id].get.d.ts +6 -0
  223. package/dist/runtime/server/api/observe/groups/[id].get.js +14 -0
  224. package/dist/runtime/server/api/observe/groups/[id].patch.d.ts +3 -0
  225. package/dist/runtime/server/api/observe/groups/[id].patch.js +12 -0
  226. package/dist/runtime/server/api/observe/groups/index.get.d.ts +3 -0
  227. package/dist/runtime/server/api/observe/groups/index.get.js +7 -0
  228. package/dist/runtime/server/api/observe/groups/index.post.d.ts +3 -0
  229. package/dist/runtime/server/api/observe/groups/index.post.js +11 -0
  230. package/dist/runtime/server/api/observe/health.get.d.ts +6 -0
  231. package/dist/runtime/server/api/observe/health.get.js +10 -0
  232. package/dist/runtime/server/api/observe/ingest/frogger.d.ts +5 -0
  233. package/dist/runtime/server/api/observe/ingest/frogger.js +42 -0
  234. package/dist/runtime/server/api/observe/ingest.d.ts +5 -0
  235. package/dist/runtime/server/api/observe/ingest.js +38 -0
  236. package/dist/runtime/server/api/observe/journey.get.d.ts +9 -0
  237. package/dist/runtime/server/api/observe/journey.get.js +31 -0
  238. package/dist/runtime/server/api/observe/logs/[id].get.d.ts +3 -0
  239. package/dist/runtime/server/api/observe/logs/[id].get.js +19 -0
  240. package/dist/runtime/server/api/observe/logs.get.d.ts +3 -0
  241. package/dist/runtime/server/api/observe/logs.get.js +54 -0
  242. package/dist/runtime/server/api/observe/migrations/index.get.d.ts +9 -0
  243. package/dist/runtime/server/api/observe/migrations/index.get.js +14 -0
  244. package/dist/runtime/server/api/observe/migrations/run.post.d.ts +13 -0
  245. package/dist/runtime/server/api/observe/migrations/run.post.js +35 -0
  246. package/dist/runtime/server/api/observe/overview.get.d.ts +3 -0
  247. package/dist/runtime/server/api/observe/overview.get.js +19 -0
  248. package/dist/runtime/server/api/observe/rollout/compare.get.d.ts +3 -0
  249. package/dist/runtime/server/api/observe/rollout/compare.get.js +24 -0
  250. package/dist/runtime/server/api/observe/rollout/regressions.get.d.ts +3 -0
  251. package/dist/runtime/server/api/observe/rollout/regressions.get.js +31 -0
  252. package/dist/runtime/server/api/observe/rollout/versions.get.d.ts +3 -0
  253. package/dist/runtime/server/api/observe/rollout/versions.get.js +20 -0
  254. package/dist/runtime/server/api/observe/services/[id]/assignments.put.d.ts +7 -0
  255. package/dist/runtime/server/api/observe/services/[id]/assignments.put.js +12 -0
  256. package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.d.ts +4 -0
  257. package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.js +14 -0
  258. package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.d.ts +4 -0
  259. package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.js +14 -0
  260. package/dist/runtime/server/api/observe/services/[id]/keys/index.get.d.ts +3 -0
  261. package/dist/runtime/server/api/observe/services/[id]/keys/index.get.js +10 -0
  262. package/dist/runtime/server/api/observe/services/[id]/keys/index.post.d.ts +3 -0
  263. package/dist/runtime/server/api/observe/services/[id]/keys/index.post.js +11 -0
  264. package/dist/runtime/server/api/observe/services/[id]/restore.post.d.ts +4 -0
  265. package/dist/runtime/server/api/observe/services/[id]/restore.post.js +11 -0
  266. package/dist/runtime/server/api/observe/services/[id].delete.d.ts +11 -0
  267. package/dist/runtime/server/api/observe/services/[id].delete.js +11 -0
  268. package/dist/runtime/server/api/observe/services/[id].get.d.ts +3 -0
  269. package/dist/runtime/server/api/observe/services/[id].get.js +12 -0
  270. package/dist/runtime/server/api/observe/services/[id].patch.d.ts +3 -0
  271. package/dist/runtime/server/api/observe/services/[id].patch.js +13 -0
  272. package/dist/runtime/server/api/observe/services/index.get.d.ts +3 -0
  273. package/dist/runtime/server/api/observe/services/index.get.js +7 -0
  274. package/dist/runtime/server/api/observe/services/index.post.d.ts +3 -0
  275. package/dist/runtime/server/api/observe/services/index.post.js +16 -0
  276. package/dist/runtime/server/api/observe/stats.get.d.ts +3 -0
  277. package/dist/runtime/server/api/observe/stats.get.js +28 -0
  278. package/dist/runtime/server/api/observe/users/[id]/assignments.put.d.ts +3 -0
  279. package/dist/runtime/server/api/observe/users/[id]/assignments.put.js +14 -0
  280. package/dist/runtime/server/api/observe/users/[id].delete.d.ts +4 -0
  281. package/dist/runtime/server/api/observe/users/[id].delete.js +15 -0
  282. package/dist/runtime/server/api/observe/users/[id].get.d.ts +3 -0
  283. package/dist/runtime/server/api/observe/users/[id].get.js +11 -0
  284. package/dist/runtime/server/api/observe/users/[id].patch.d.ts +3 -0
  285. package/dist/runtime/server/api/observe/users/[id].patch.js +25 -0
  286. package/dist/runtime/server/api/observe/users/index.get.d.ts +8 -0
  287. package/dist/runtime/server/api/observe/users/index.get.js +7 -0
  288. package/dist/runtime/server/api/observe/users/index.post.d.ts +3 -0
  289. package/dist/runtime/server/api/observe/users/index.post.js +29 -0
  290. package/dist/runtime/server/auth/authorization.d.ts +7 -0
  291. package/dist/runtime/server/auth/authorization.js +5 -0
  292. package/dist/runtime/server/auth/provider.d.ts +17 -0
  293. package/dist/runtime/server/auth/provider.js +44 -0
  294. package/dist/runtime/server/auth/providers/config-provider.d.ts +18 -0
  295. package/dist/runtime/server/auth/providers/config-provider.js +54 -0
  296. package/dist/runtime/server/auth/providers/db-provider.d.ts +16 -0
  297. package/dist/runtime/server/auth/providers/db-provider.js +42 -0
  298. package/dist/runtime/server/auth/providers/jwt-provider.d.ts +24 -0
  299. package/dist/runtime/server/auth/providers/jwt-provider.js +72 -0
  300. package/dist/runtime/server/migrations/0001-services-kind.d.ts +8 -0
  301. package/dist/runtime/server/migrations/0001-services-kind.js +14 -0
  302. package/dist/runtime/server/migrations/0002-services-type.d.ts +7 -0
  303. package/dist/runtime/server/migrations/0002-services-type.js +14 -0
  304. package/dist/runtime/server/migrations/0003-services-deleted-at.d.ts +6 -0
  305. package/dist/runtime/server/migrations/0003-services-deleted-at.js +14 -0
  306. package/dist/runtime/server/migrations/0004-logs-error-fingerprint.d.ts +11 -0
  307. package/dist/runtime/server/migrations/0004-logs-error-fingerprint.js +15 -0
  308. package/dist/runtime/server/migrations/0005-users-columns.d.ts +9 -0
  309. package/dist/runtime/server/migrations/0005-users-columns.js +25 -0
  310. package/dist/runtime/server/migrations/index.d.ts +13 -0
  311. package/dist/runtime/server/migrations/index.js +13 -0
  312. package/dist/runtime/server/migrations/types.d.ts +15 -0
  313. package/dist/runtime/server/migrations/types.js +0 -0
  314. package/dist/runtime/server/plugins/observe-migrate.server.d.ts +2 -0
  315. package/dist/runtime/server/plugins/observe-migrate.server.js +18 -0
  316. package/dist/runtime/server/tasks/backfill-fingerprints.d.ts +11 -0
  317. package/dist/runtime/server/tasks/backfill-fingerprints.js +41 -0
  318. package/dist/runtime/server/tasks/purge.d.ts +5 -0
  319. package/dist/runtime/server/tasks/purge.js +12 -0
  320. package/dist/runtime/server/tsconfig.json +3 -0
  321. package/dist/runtime/server/utils/activity-query.d.ts +28 -0
  322. package/dist/runtime/server/utils/activity-query.js +70 -0
  323. package/dist/runtime/server/utils/api-keys.d.ts +48 -0
  324. package/dist/runtime/server/utils/api-keys.js +67 -0
  325. package/dist/runtime/server/utils/authz.d.ts +50 -0
  326. package/dist/runtime/server/utils/authz.js +60 -0
  327. package/dist/runtime/server/utils/db/users.d.ts +91 -0
  328. package/dist/runtime/server/utils/db/users.js +128 -0
  329. package/dist/runtime/server/utils/db.d.ts +10 -0
  330. package/dist/runtime/server/utils/db.js +5 -0
  331. package/dist/runtime/server/utils/frogger-adapter.d.ts +40 -0
  332. package/dist/runtime/server/utils/frogger-adapter.js +97 -0
  333. package/dist/runtime/server/utils/groups.d.ts +35 -0
  334. package/dist/runtime/server/utils/groups.js +59 -0
  335. package/dist/runtime/server/utils/ingest-cors.d.ts +23 -0
  336. package/dist/runtime/server/utils/ingest-cors.js +27 -0
  337. package/dist/runtime/server/utils/journey.d.ts +20 -0
  338. package/dist/runtime/server/utils/journey.js +44 -0
  339. package/dist/runtime/server/utils/logs.d.ts +50 -0
  340. package/dist/runtime/server/utils/logs.js +154 -0
  341. package/dist/runtime/server/utils/loop-guard.d.ts +11 -0
  342. package/dist/runtime/server/utils/loop-guard.js +11 -0
  343. package/dist/runtime/server/utils/migrate.d.ts +21 -0
  344. package/dist/runtime/server/utils/migrate.js +144 -0
  345. package/dist/runtime/server/utils/migration-runner.d.ts +42 -0
  346. package/dist/runtime/server/utils/migration-runner.js +129 -0
  347. package/dist/runtime/server/utils/observe-errors.d.ts +58 -0
  348. package/dist/runtime/server/utils/observe-errors.js +206 -0
  349. package/dist/runtime/server/utils/overview.d.ts +20 -0
  350. package/dist/runtime/server/utils/overview.js +119 -0
  351. package/dist/runtime/server/utils/provisioning.d.ts +62 -0
  352. package/dist/runtime/server/utils/provisioning.js +299 -0
  353. package/dist/runtime/server/utils/rate-limit.d.ts +11 -0
  354. package/dist/runtime/server/utils/rate-limit.js +22 -0
  355. package/dist/runtime/server/utils/require-observe-session.d.ts +15 -0
  356. package/dist/runtime/server/utils/require-observe-session.js +25 -0
  357. package/dist/runtime/server/utils/rollout.d.ts +19 -0
  358. package/dist/runtime/server/utils/rollout.js +56 -0
  359. package/dist/runtime/server/utils/scope.d.ts +14 -0
  360. package/dist/runtime/server/utils/scope.js +28 -0
  361. package/dist/runtime/server/utils/seed.d.ts +18 -0
  362. package/dist/runtime/server/utils/seed.js +70 -0
  363. package/dist/runtime/server/utils/services.d.ts +91 -0
  364. package/dist/runtime/server/utils/services.js +142 -0
  365. package/dist/runtime/server/utils/stats-query.d.ts +40 -0
  366. package/dist/runtime/server/utils/stats-query.js +104 -0
  367. package/dist/runtime/shared/auth/roles.d.ts +34 -0
  368. package/dist/runtime/shared/auth/roles.js +6 -0
  369. package/dist/runtime/shared/auth/schema.d.ts +85 -0
  370. package/dist/runtime/shared/auth/schema.js +41 -0
  371. package/dist/runtime/shared/auth/types.d.ts +68 -0
  372. package/dist/runtime/shared/auth/types.js +0 -0
  373. package/dist/runtime/shared/rbac/capabilities.d.ts +46 -0
  374. package/dist/runtime/shared/rbac/capabilities.js +48 -0
  375. package/dist/runtime/shared/schema/activity.d.ts +77 -0
  376. package/dist/runtime/shared/schema/activity.js +22 -0
  377. package/dist/runtime/shared/schema/adapters/frogger.d.ts +52 -0
  378. package/dist/runtime/shared/schema/adapters/frogger.js +17 -0
  379. package/dist/runtime/shared/schema/batch.d.ts +33 -0
  380. package/dist/runtime/shared/schema/batch.js +9 -0
  381. package/dist/runtime/shared/schema/error-fingerprint.d.ts +53 -0
  382. package/dist/runtime/shared/schema/error-fingerprint.js +47 -0
  383. package/dist/runtime/shared/schema/errors-query.d.ts +136 -0
  384. package/dist/runtime/shared/schema/errors-query.js +47 -0
  385. package/dist/runtime/shared/schema/event.d.ts +48 -0
  386. package/dist/runtime/shared/schema/event.js +41 -0
  387. package/dist/runtime/shared/schema/frogger-map.d.ts +62 -0
  388. package/dist/runtime/shared/schema/frogger-map.js +30 -0
  389. package/dist/runtime/shared/schema/index.d.ts +17 -0
  390. package/dist/runtime/shared/schema/index.js +17 -0
  391. package/dist/runtime/shared/schema/journey.d.ts +99 -0
  392. package/dist/runtime/shared/schema/journey.js +96 -0
  393. package/dist/runtime/shared/schema/levels.d.ts +37 -0
  394. package/dist/runtime/shared/schema/levels.js +72 -0
  395. package/dist/runtime/shared/schema/log-row.d.ts +31 -0
  396. package/dist/runtime/shared/schema/log-row.js +0 -0
  397. package/dist/runtime/shared/schema/logs-query.d.ts +91 -0
  398. package/dist/runtime/shared/schema/logs-query.js +72 -0
  399. package/dist/runtime/shared/schema/migrations.d.ts +34 -0
  400. package/dist/runtime/shared/schema/migrations.js +0 -0
  401. package/dist/runtime/shared/schema/overview.d.ts +78 -0
  402. package/dist/runtime/shared/schema/overview.js +9 -0
  403. package/dist/runtime/shared/schema/provisioning.d.ts +230 -0
  404. package/dist/runtime/shared/schema/provisioning.js +52 -0
  405. package/dist/runtime/shared/schema/registry.d.ts +115 -0
  406. package/dist/runtime/shared/schema/registry.js +27 -0
  407. package/dist/runtime/shared/schema/rollout.d.ts +103 -0
  408. package/dist/runtime/shared/schema/rollout.js +66 -0
  409. package/dist/runtime/shared/schema/stats.d.ts +64 -0
  410. package/dist/runtime/shared/schema/stats.js +15 -0
  411. package/dist/runtime/shared/schema/tiers.d.ts +5 -0
  412. package/dist/runtime/shared/schema/tiers.js +9 -0
  413. package/dist/runtime/shared/types/module-options.d.ts +119 -0
  414. package/dist/runtime/shared/types/module-options.js +13 -0
  415. package/dist/runtime/shared/types/storage.d.ts +31 -0
  416. package/dist/runtime/shared/types/storage.js +0 -0
  417. package/dist/runtime/shared/utils/format-relative.d.ts +7 -0
  418. package/dist/runtime/shared/utils/format-relative.js +11 -0
  419. package/dist/runtime/shared/utils/frogger-snippet.d.ts +19 -0
  420. package/dist/runtime/shared/utils/frogger-snippet.js +33 -0
  421. package/dist/runtime/shared/utils/observe-config.d.ts +9 -0
  422. package/dist/runtime/shared/utils/observe-config.js +17 -0
  423. package/dist/runtime/shared/utils/period.d.ts +13 -0
  424. package/dist/runtime/shared/utils/period.js +15 -0
  425. package/dist/runtime/shared/utils/slug.d.ts +1 -0
  426. package/dist/runtime/shared/utils/slug.js +5 -0
  427. package/dist/runtime/shared/utils/uuid.d.ts +187 -0
  428. package/dist/runtime/shared/utils/uuid.js +345 -0
  429. package/dist/runtime/types/nuxt-auth-utils-imports.d.ts +25 -0
  430. package/dist/runtime/types/observe-app-imports.d.ts +20 -0
  431. package/dist/runtime/types/session.d.ts +17 -0
  432. package/dist/schema.d.mts +1318 -0
  433. package/dist/schema.mjs +629 -0
  434. package/dist/types.d.mts +3 -0
  435. package/package.json +93 -0
@@ -0,0 +1,629 @@
1
+ import { z } from 'zod';
2
+ import { createHash } from 'node:crypto';
3
+
4
+ const CANONICAL_LEVELS = {
5
+ 0: "error",
6
+ 1: "warn",
7
+ 2: "notice",
8
+ // frogger alias: 'log'
9
+ 3: "info",
10
+ 4: "debug",
11
+ 5: "trace"
12
+ };
13
+ const zLevel = z.number().int().min(0).max(5);
14
+ const FROGGER_LEVEL_MAP = {
15
+ 0: 0,
16
+ 1: 1,
17
+ 2: 2,
18
+ 3: 3,
19
+ 4: 4,
20
+ 5: 5
21
+ };
22
+ const NAME_TO_LEVEL = {
23
+ fatal: 0,
24
+ error: 0,
25
+ warn: 1,
26
+ log: 2,
27
+ notice: 2,
28
+ info: 3,
29
+ success: 3,
30
+ fail: 3,
31
+ ready: 3,
32
+ start: 3,
33
+ debug: 4,
34
+ trace: 5
35
+ };
36
+ const SYSLOG_TO_CANONICAL = {
37
+ 0: 0,
38
+ // Emergency
39
+ 1: 0,
40
+ // Alert
41
+ 2: 0,
42
+ // Critical
43
+ 3: 0,
44
+ // Error
45
+ 4: 1,
46
+ // Warning
47
+ 5: 2,
48
+ // Notice
49
+ 6: 3,
50
+ // Informational
51
+ 7: 4
52
+ // Debug
53
+ };
54
+ function otelSeverityToCanonical(severityNumber) {
55
+ if (severityNumber >= 21) return 0;
56
+ if (severityNumber >= 17) return 0;
57
+ if (severityNumber >= 13) return 1;
58
+ if (severityNumber >= 9) return 3;
59
+ if (severityNumber >= 5) return 4;
60
+ return 5;
61
+ }
62
+ function levelName(n) {
63
+ return CANONICAL_LEVELS[n] ?? "unknown";
64
+ }
65
+ function parseLevel(input) {
66
+ if (typeof input === "string") {
67
+ const byName = NAME_TO_LEVEL[input.toLowerCase()];
68
+ return byName ?? null;
69
+ }
70
+ if (input === 999) return 5;
71
+ if (input === -999) return null;
72
+ if (Number.isInteger(input) && input >= 0 && input <= 5) return input;
73
+ return null;
74
+ }
75
+
76
+ const TRACE_ID_RE$1 = /^[0-9a-f]{32}$/;
77
+ const SPAN_ID_RE = /^[0-9a-f]{16}$/;
78
+ const zErrorInfo = z.object({
79
+ name: z.string(),
80
+ message: z.string(),
81
+ stack: z.string().optional(),
82
+ code: z.union([z.string(), z.number()]).optional()
83
+ // frogger statusCode is number; app codes may be string
84
+ });
85
+ const zTraceContext = z.object({
86
+ traceId: z.string().regex(TRACE_ID_RE$1),
87
+ spanId: z.string().regex(SPAN_ID_RE),
88
+ parentId: z.string().regex(SPAN_ID_RE).optional()
89
+ // frogger's trace.flags is intentionally dropped here; see frogger-map.ts.
90
+ });
91
+ const zSource = z.object({
92
+ app: z.string().min(1),
93
+ // required WHEN source is present
94
+ version: z.string().optional(),
95
+ env: z.string().optional()
96
+ // frogger execution context (ssr/csr/client/server); see caveat in frogger-map.ts
97
+ });
98
+ const zCanonicalEvent = z.object({
99
+ time: z.number().int().positive(),
100
+ // ms epoch
101
+ level: zLevel,
102
+ message: z.string().min(1),
103
+ error: zErrorInfo.optional(),
104
+ trace: zTraceContext.optional(),
105
+ source: zSource.optional(),
106
+ // optional so the minimal stream tier ({time,level,message}) parses
107
+ session: z.string().optional(),
108
+ user: z.string().optional(),
109
+ route: z.string().optional(),
110
+ feature: z.string().optional(),
111
+ tags: z.array(z.string()).optional(),
112
+ ctx: z.record(z.string(), z.unknown()).optional()
113
+ // zod v4: record REQUIRES (keyType, valueType)
114
+ });
115
+
116
+ const MAX_BATCH_EVENTS = 500;
117
+ const zCanonicalBatch = z.object({
118
+ events: z.array(zCanonicalEvent).max(MAX_BATCH_EVENTS),
119
+ // empty allowed: a valid no-op batch
120
+ meta: z.record(z.string(), z.unknown()).optional()
121
+ // frogger meta.{processed,processChain,source,time} passes through
122
+ });
123
+
124
+ const PROGRESSIVE_TIERS = ["stream", "grouping", "journey", "activity", "rollout"];
125
+ function classifyTiers(event) {
126
+ const tiers = ["stream"];
127
+ if (event.error) tiers.push("grouping");
128
+ if (event.trace?.traceId) tiers.push("journey");
129
+ if (event.session || event.route || event.feature) tiers.push("activity");
130
+ if (event.source?.version) tiers.push("rollout");
131
+ return tiers;
132
+ }
133
+
134
+ const FROGGER_FIELD_MAP = {
135
+ log: {
136
+ "time": "time",
137
+ "lvl": "level",
138
+ "type": "(dropped: redundant with lvl)",
139
+ "msg": "message",
140
+ "ctx": "ctx (+ derived: error/session/user/route/feature)",
141
+ "tags": "tags",
142
+ "env": "source.env",
143
+ "source.name": "source.app",
144
+ "source.version": "source.version",
145
+ "trace.traceId": "trace.traceId",
146
+ "trace.spanId": "trace.spanId",
147
+ "trace.parentId": "trace.parentId",
148
+ "trace.flags": "(dropped: canonical omits flags)"
149
+ },
150
+ batch: {
151
+ "logs": "events",
152
+ "app.name": "source.app",
153
+ "app.version": "source.version",
154
+ "meta": "meta (passthrough)"
155
+ },
156
+ ctxDerived: {
157
+ "ctx.error": "error",
158
+ "ctx.session": "session",
159
+ "ctx.user": "user",
160
+ "ctx.route": "route",
161
+ "ctx.feature": "feature"
162
+ }
163
+ };
164
+
165
+ const zFroggerLog = z.object({
166
+ time: z.number(),
167
+ lvl: z.number(),
168
+ type: z.string().optional(),
169
+ msg: z.string(),
170
+ ctx: z.record(z.string(), z.unknown()).optional(),
171
+ tags: z.array(z.string()).optional(),
172
+ env: z.string().optional(),
173
+ source: z.object({ name: z.string().optional(), version: z.string().optional() }).partial().optional(),
174
+ trace: z.object({ traceId: z.string(), spanId: z.string(), parentId: z.string().optional() }).partial().optional()
175
+ }).passthrough();
176
+ const zFroggerBatch = z.object({
177
+ logs: z.array(zFroggerLog).min(1),
178
+ app: z.object({ name: z.string(), version: z.string() }).partial().optional(),
179
+ meta: z.object({}).passthrough().optional()
180
+ }).passthrough();
181
+
182
+ const SERVICE_TYPES = ["website", "webapp", "api", "service", "worker", "mobile", "other"];
183
+ const serviceTypeSchema = z.enum(SERVICE_TYPES);
184
+ const SERVICE_KINDS = ["server", "browser"];
185
+ const serviceKindSchema = z.enum(SERVICE_KINDS);
186
+ const SERVICE_TYPE_META = {
187
+ website: { label: "Website", icon: "i-lucide-globe" },
188
+ webapp: { label: "Web app", icon: "i-lucide-app-window" },
189
+ api: { label: "API", icon: "i-lucide-webhook" },
190
+ service: { label: "Service", icon: "i-lucide-server" },
191
+ worker: { label: "Worker", icon: "i-lucide-cog" },
192
+ mobile: { label: "Mobile", icon: "i-lucide-smartphone" },
193
+ other: { label: "Other", icon: "i-lucide-box" }
194
+ };
195
+ function serviceTypeMeta(type) {
196
+ return SERVICE_TYPE_META[type] ?? SERVICE_TYPE_META.other;
197
+ }
198
+ const originSchema = z.string().refine(
199
+ (v) => v === "*" || /^https?:\/\/[^/\s]+$/.test(v),
200
+ { message: 'must be an http(s) origin (e.g. https://app.example.com) or "*"' }
201
+ );
202
+ const serviceCreateSchema = z.object({
203
+ name: z.string().min(1).max(80),
204
+ type: serviceTypeSchema.default("service"),
205
+ kind: serviceKindSchema.default("server"),
206
+ appNames: z.array(z.string().min(1)).min(1),
207
+ allowedOrigins: z.array(originSchema).default([]),
208
+ env: z.string().max(40).optional(),
209
+ versionTracking: z.boolean().optional()
210
+ }).refine((s) => !(s.allowedOrigins.length && s.kind === "server"), {
211
+ path: ["allowedOrigins"],
212
+ message: 'allowedOrigins requires kind="browser"'
213
+ });
214
+ const serviceUpdateSchema = z.object({
215
+ name: z.string().min(1).max(80).optional(),
216
+ type: serviceTypeSchema.optional(),
217
+ kind: serviceKindSchema.optional(),
218
+ appNames: z.array(z.string().min(1)).min(1).optional(),
219
+ allowedOrigins: z.array(originSchema).optional(),
220
+ env: z.string().max(40).nullable().optional(),
221
+ groupId: z.string().nullable().optional(),
222
+ versionTracking: z.boolean().optional(),
223
+ currentVersion: z.string().nullable().optional()
224
+ });
225
+ const keyCreateSchema = z.object({ label: z.string().min(1).max(60) });
226
+ const groupCreateSchema = z.object({ name: z.string().min(1).max(80) });
227
+ const groupUpdateSchema = z.object({ name: z.string().min(1).max(80) });
228
+ const groupMembershipSchema = z.object({ serviceIds: z.array(z.string().min(1)) });
229
+ const assignmentSchema = z.object({ userIds: z.array(z.string().min(1)) });
230
+ const serviceIdParams = z.object({ id: z.string().min(1) });
231
+ const keyIdParams = z.object({ id: z.string().min(1), keyId: z.string().min(1) });
232
+ const groupIdParams = z.object({ id: z.string().min(1) });
233
+
234
+ const zServiceSeed = z.object({
235
+ slug: z.string().min(1),
236
+ name: z.string().min(1),
237
+ type: serviceTypeSchema.default("service"),
238
+ kind: z.enum(["server", "browser"]).default("server"),
239
+ appNames: z.array(z.string().min(1)).default([]),
240
+ allowedOrigins: z.array(z.string().min(1)).default([]),
241
+ // browser origins, or the literal '*'
242
+ env: z.string().optional(),
243
+ versionTracking: z.boolean().optional(),
244
+ currentVersion: z.string().optional(),
245
+ group: z.string().optional(),
246
+ // group slug
247
+ key: z.string().optional()
248
+ // raw ingest key (from env); hashed at seed time, never stored raw
249
+ // Declaring allowedOrigins implies a browser source: coerce rather than hard-error for friendlier config.
250
+ }).transform((s) => s.allowedOrigins.length && s.kind === "server" ? { ...s, kind: "browser" } : s);
251
+ const zGroupSeed = z.object({
252
+ slug: z.string().min(1),
253
+ name: z.string().min(1)
254
+ });
255
+ const zObserveSeedConfig = z.object({
256
+ services: z.array(zServiceSeed).optional(),
257
+ groups: z.array(zGroupSeed).optional()
258
+ });
259
+
260
+ const PERIODS = ["15m", "1h", "24h", "7d", "30d"];
261
+
262
+ const overviewQuerySchema = z.object({
263
+ period: z.enum(PERIODS).default("24h"),
264
+ /** service slug; resolved to an id and intersected with the caller's scope */
265
+ service: z.string().optional(),
266
+ /** group slug; expanded to member service ids and intersected with the caller's scope */
267
+ group: z.string().optional()
268
+ });
269
+
270
+ const statsQuerySchema = z.object({
271
+ period: z.enum(PERIODS).default("24h"),
272
+ /** service slug; resolved to an id and intersected with the caller's scope */
273
+ service: z.string().optional(),
274
+ /** group slug; expanded to member service ids and intersected with the caller's scope */
275
+ group: z.string().optional(),
276
+ /** exact version filter (rides idx_logs_version) */
277
+ version: z.string().optional(),
278
+ /** exact-level filter, 0..5 */
279
+ level: z.coerce.number().int().min(0).max(5).optional(),
280
+ /** advanced bucket-size override in ms; rejected with 400 when it yields > 500 buckets */
281
+ bucketMs: z.coerce.number().int().positive().optional()
282
+ });
283
+
284
+ const csvLevels = z.string().transform((s) => s.split(",").map((v) => v.trim()).filter((v) => v.length > 0).map(Number)).pipe(z.array(z.number().int().min(0).max(5)).min(1).max(6)).optional();
285
+ const csvStrings = z.string().transform((s) => s.split(",").map((v) => v.trim()).filter((v) => v.length > 0)).pipe(z.array(z.string().min(1).max(100)).min(1).max(20)).optional();
286
+ const logsQuerySchema = z.object({
287
+ period: z.enum(PERIODS).default("24h"),
288
+ /** service slug; resolved to an id and intersected with the caller's scope */
289
+ service: z.string().optional(),
290
+ /** group slug; expanded to member service ids and intersected with the caller's scope */
291
+ group: z.string().optional(),
292
+ /** CSV of exact levels, e.g. "0,1" -> level IN (0,1) */
293
+ levels: csvLevels,
294
+ /** CSV of exact versions -> version IN (...) */
295
+ versions: csvStrings,
296
+ /** exact route filter, e.g. from the activity drill-through (CP10) */
297
+ route: z.string().min(1).max(200).optional(),
298
+ /** exact feature filter, e.g. from the activity drill-through (CP10) */
299
+ feature: z.string().min(1).max(200).optional(),
300
+ /** free-text message search; message LIKE %q% ESCAPE '\' */
301
+ q: z.string().trim().min(1).max(200).optional(),
302
+ /** exact trace id; when present the period window is NOT applied (see handler §3.3) */
303
+ traceId: z.string().min(1).max(64).optional(),
304
+ limit: z.coerce.number().int().min(1).max(200).default(50),
305
+ offset: z.coerce.number().int().min(0).default(0)
306
+ });
307
+ const logsFacetsQuerySchema = z.object({
308
+ service: z.string().optional(),
309
+ group: z.string().optional()
310
+ });
311
+ function parseJson(raw, guard) {
312
+ if (raw == null) return null;
313
+ try {
314
+ const parsed = JSON.parse(raw);
315
+ return guard(parsed) ? parsed : null;
316
+ } catch {
317
+ return null;
318
+ }
319
+ }
320
+ const isStringArray = (v) => Array.isArray(v) && v.every((x) => typeof x === "string");
321
+ const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
322
+ function rowToDetail(row) {
323
+ const error = row.error_name || row.error_message || row.error_stack || row.error_code ? {
324
+ ...row.error_name ? { name: row.error_name } : {},
325
+ ...row.error_message ? { message: row.error_message } : {},
326
+ ...row.error_stack ? { stack: row.error_stack } : {},
327
+ ...row.error_code ? { code: row.error_code } : {}
328
+ } : null;
329
+ const trace = row.trace_id || row.span_id || row.parent_id ? {
330
+ ...row.trace_id ? { traceId: row.trace_id } : {},
331
+ ...row.span_id ? { spanId: row.span_id } : {},
332
+ ...row.parent_id ? { parentId: row.parent_id } : {}
333
+ } : null;
334
+ return {
335
+ id: row.id,
336
+ time: row.time,
337
+ received_at: row.received_at,
338
+ level: row.level,
339
+ message: row.message,
340
+ app: row.app,
341
+ version: row.version ?? null,
342
+ env: row.env ?? null,
343
+ service_id: row.service_id ?? null,
344
+ session: row.session ?? null,
345
+ user: row.user ?? null,
346
+ route: row.route ?? null,
347
+ feature: row.feature ?? null,
348
+ error,
349
+ trace,
350
+ tags: parseJson(row.tags, isStringArray),
351
+ ctx: parseJson(row.ctx, isObject)
352
+ };
353
+ }
354
+
355
+ const ACTIVITY_DIMENSIONS = ["auto", "route", "feature"];
356
+ const ACTIVITY_SORTS = ["count", "errors", "errorRate", "lastSeen"];
357
+ const activityQuerySchema = z.object({
358
+ period: z.enum(PERIODS).default("24h"),
359
+ /** service slug; resolved to an id and intersected with the caller's scope */
360
+ service: z.string().optional(),
361
+ /** group slug; expanded to member service ids and intersected with the caller's scope */
362
+ group: z.string().optional(),
363
+ /** grouping dimension; auto = COALESCE(route, feature) */
364
+ dimension: z.enum(ACTIVITY_DIMENSIONS).default("auto"),
365
+ /** exact env filter */
366
+ env: z.string().optional(),
367
+ /** exact-level filter, 0..5 (mirrors statsQuerySchema, CP8 D3) */
368
+ level: z.coerce.number().int().min(0).max(5).optional(),
369
+ /** substring match on the key; escaped LIKE (shared escapeLike) */
370
+ q: z.string().trim().min(1).max(200).optional(),
371
+ sort: z.enum(ACTIVITY_SORTS).default("count"),
372
+ /** rejected with 400 past the ceiling, never silently clamped */
373
+ limit: z.coerce.number().int().min(1).max(200).default(50)
374
+ });
375
+
376
+ const TRACE_ID_RE = /^[0-9a-f]{32}$/;
377
+ const ALL_ZERO_TRACE = "00000000000000000000000000000000";
378
+ function isValidTraceId(traceId) {
379
+ return typeof traceId === "string" && TRACE_ID_RE.test(traceId) && traceId !== ALL_ZERO_TRACE;
380
+ }
381
+ const journeyQuerySchema = z.object({
382
+ traceId: z.string().optional(),
383
+ session: z.string().min(1).max(200).optional(),
384
+ user: z.string().min(1).max(200).optional(),
385
+ from: z.coerce.number().int().positive().optional(),
386
+ to: z.coerce.number().int().positive().optional(),
387
+ limit: z.coerce.number().int().min(1).max(5e3).default(2e3)
388
+ }).superRefine((v, ctx) => {
389
+ const present = [v.traceId, v.session, v.user].filter((x) => x !== void 0);
390
+ if (present.length !== 1) {
391
+ ctx.addIssue({ code: "custom", message: "Provide exactly one of traceId, session, or user" });
392
+ return;
393
+ }
394
+ if (v.traceId !== void 0 && !isValidTraceId(v.traceId)) {
395
+ ctx.addIssue({ code: "custom", path: ["traceId"], message: "traceId must be 32 lowercase hex, non-zero" });
396
+ }
397
+ });
398
+ function journeyMode(q) {
399
+ if (q.traceId !== void 0) return { mode: "trace", key: q.traceId };
400
+ if (q.session !== void 0) return { mode: "session", key: q.session };
401
+ return { mode: "user", key: q.user };
402
+ }
403
+ const MODE_PARAM = {
404
+ trace: "traceId",
405
+ session: "session",
406
+ user: "user"
407
+ };
408
+ function computeJourneyStats(events) {
409
+ if (events.length === 0) {
410
+ return { count: 0, start: null, end: null, durationMs: 0, services: [], levels: {} };
411
+ }
412
+ let start = events[0].time;
413
+ let end = events[0].time;
414
+ const services = [];
415
+ const seen = /* @__PURE__ */ new Set();
416
+ const levels = {};
417
+ for (const e of events) {
418
+ if (e.time < start) start = e.time;
419
+ if (e.time > end) end = e.time;
420
+ if (e.app && !seen.has(e.app)) {
421
+ seen.add(e.app);
422
+ services.push(e.app);
423
+ }
424
+ const name = levelName(e.level);
425
+ levels[name] = (levels[name] ?? 0) + 1;
426
+ }
427
+ return { count: events.length, start, end, durationMs: end - start, services, levels };
428
+ }
429
+ function detectPartial(events, hitLimit) {
430
+ const reasons = /* @__PURE__ */ new Set();
431
+ if (events.length === 0) reasons.add("empty");
432
+ const spans = new Set(events.map((e) => e.spanId).filter(Boolean));
433
+ for (const e of events) {
434
+ if (!e.hasTrace) reasons.add("missing-correlation");
435
+ if (e.parentId && !spans.has(e.parentId)) reasons.add("dangling-parent");
436
+ }
437
+ if (hitLimit) reasons.add("truncated");
438
+ return { partial: reasons.size > 0, reasons: [...reasons] };
439
+ }
440
+ function buildSpanTree(events) {
441
+ const bySpan = /* @__PURE__ */ new Map();
442
+ for (const e of events) {
443
+ if (e.spanId) bySpan.set(e.spanId, { event: e, children: [], depth: 0 });
444
+ }
445
+ const roots = [];
446
+ for (const e of events) {
447
+ const node = e.spanId ? bySpan.get(e.spanId) : { event: e, children: [], depth: 0 };
448
+ const parent = e.parentId ? bySpan.get(e.parentId) : void 0;
449
+ if (parent && parent !== node) parent.children.push(node);
450
+ else roots.push(node);
451
+ }
452
+ const walk = (n, d) => {
453
+ n.depth = d;
454
+ n.children.sort((a, b) => a.event.time - b.event.time);
455
+ n.children.forEach((c) => walk(c, d + 1));
456
+ };
457
+ roots.sort((a, b) => a.event.time - b.event.time);
458
+ roots.forEach((r) => walk(r, 0));
459
+ return roots;
460
+ }
461
+ function flattenSpanTree(roots) {
462
+ const out = [];
463
+ const walk = (n) => {
464
+ out.push({ event: n.event, depth: n.depth });
465
+ n.children.forEach(walk);
466
+ };
467
+ roots.forEach(walk);
468
+ return out;
469
+ }
470
+
471
+ const UNVERSIONED = "(unversioned)";
472
+ const rolloutQuerySchema = z.object({
473
+ period: z.enum(PERIODS).default("24h"),
474
+ /** service slug; resolved to an id and intersected with the caller's scope */
475
+ service: z.string().optional(),
476
+ /** group slug; expanded to member ids and intersected with the caller's scope */
477
+ group: z.string().optional(),
478
+ /** exact env filter on the log row (matches stats' row-level env) */
479
+ env: z.string().optional(),
480
+ /** compare-only bucket-size override in ms; rejected with 400 when it yields > 500 buckets */
481
+ bucketMs: z.coerce.number().int().positive().optional()
482
+ });
483
+ function pivotVersionSeries(rows, from, to, bucketMs) {
484
+ const bFrom = Math.floor(from / bucketMs);
485
+ const bTo = Math.floor(to / bucketMs);
486
+ const len = Math.max(0, bTo - bFrom + 1);
487
+ const buckets = [];
488
+ for (let i = 0; i < len; i++) buckets.push((bFrom + i) * bucketMs);
489
+ const byVersion = /* @__PURE__ */ new Map();
490
+ for (const row of rows) {
491
+ const idx = row.b - bFrom;
492
+ if (idx < 0 || idx >= len) continue;
493
+ let acc = byVersion.get(row.version);
494
+ if (!acc) {
495
+ acc = { volume: Array(len).fill(0), errors: Array(len).fill(0), total: 0 };
496
+ byVersion.set(row.version, acc);
497
+ }
498
+ const errors = row.errors ?? 0;
499
+ acc.volume[idx] = (acc.volume[idx] ?? 0) + row.total;
500
+ acc.errors[idx] = (acc.errors[idx] ?? 0) + errors;
501
+ acc.total += row.total;
502
+ }
503
+ const series = [...byVersion.entries()].sort((a, b) => b[1].total - a[1].total || a[0].localeCompare(b[0])).map(([version, acc]) => ({
504
+ version,
505
+ volume: acc.volume,
506
+ errorRate: acc.volume.map((v, i) => v ? acc.errors[i] / v : 0)
507
+ }));
508
+ return { buckets, series };
509
+ }
510
+ function detectRegressions(stats, config, now) {
511
+ const { minEvents, errorRateDelta, errorRateMultiplier, baselineWindowMs } = config;
512
+ const eligible = stats.filter((s) => s.version !== UNVERSIONED && s.total >= minEvents);
513
+ if (eligible.length < 2) return [];
514
+ const sorted = [...eligible].sort((a, b) => a.firstSeen - b.firstSeen);
515
+ const candidate = sorted[sorted.length - 1];
516
+ if (baselineWindowMs != null && candidate.firstSeen < now - baselineWindowMs) return [];
517
+ const earlier = sorted.filter((s) => s.firstSeen < candidate.firstSeen);
518
+ if (earlier.length === 0) return [];
519
+ const baseline = earlier.reduce((best, s) => s.total > best.total ? s : best);
520
+ const delta = candidate.errorRate - baseline.errorRate;
521
+ const ratio = baseline.errorRate === 0 ? Infinity : candidate.errorRate / baseline.errorRate;
522
+ const passesMultiplier = baseline.errorRate === 0 || candidate.errorRate >= baseline.errorRate * errorRateMultiplier;
523
+ if (delta < errorRateDelta || !passesMultiplier) return [];
524
+ return [{
525
+ version: candidate.version,
526
+ errorRate: candidate.errorRate,
527
+ baselineVersion: baseline.version,
528
+ baselineErrorRate: baseline.errorRate,
529
+ delta,
530
+ ratio,
531
+ sampleSize: candidate.total,
532
+ severity: delta >= 2 * errorRateDelta ? "critical" : "warn"
533
+ }];
534
+ }
535
+
536
+ const VERSION = "v1";
537
+ const DEFAULT_TOP_FRAMES = 3;
538
+ function normalizeMessage(message) {
539
+ return message.replace(/\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?/g, "<ts>").replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi, "<uuid>").replace(/\b[0-9a-f]{8,}\b/gi, "<hex>").replace(/\b[a-z][a-z0-9+.-]*:\/\/[^\s'"]+/gi, "<path>").replace(/(?:[a-z]:\\|\.{0,2}\/)[^\s'"]*[^\s'".,;:]/gi, "<path>").replace(/'[^']*'/g, "<str>").replace(/"[^"]*"/g, "<str>").replace(/-?\d+(?:\.\d+)?/g, "<n>").trim();
540
+ }
541
+ const ANON_RE = /<anonymous>|\beval\b|\[native code\]/i;
542
+ function normalizeFrame(line) {
543
+ const trimmed = line.trim().replace(/^at\s+/, "").replace(/^async\s+/, "");
544
+ if (!trimmed) return null;
545
+ const open = trimmed.lastIndexOf(" (");
546
+ let fn = "";
547
+ let loc = trimmed;
548
+ if (open > 0 && trimmed.endsWith(")")) {
549
+ fn = trimmed.slice(0, open).trim();
550
+ loc = trimmed.slice(open + 2, -1).trim();
551
+ }
552
+ if (loc.startsWith("node:") || /^(?:internal|native)\b/.test(loc)) return null;
553
+ if (ANON_RE.test(fn) || ANON_RE.test(loc)) return null;
554
+ loc = loc.replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]+/i, "");
555
+ loc = loc.replace(/(?::\d+)+$/, "");
556
+ const base = loc.split(/[\\/]/).pop() ?? loc;
557
+ const cleaned = base.replace(/\.[0-9a-f]{6,}(?=\.[a-z0-9]+$)/i, "");
558
+ if (!cleaned) return fn || null;
559
+ return fn ? `${fn} (${cleaned})` : cleaned;
560
+ }
561
+ function normalizeStack(stack, topFrames) {
562
+ if (!stack) return [];
563
+ const out = [];
564
+ for (const line of stack.split("\n")) {
565
+ if (!/^\s*at\s+/.test(line)) continue;
566
+ const frame = normalizeFrame(line);
567
+ if (frame) out.push(frame);
568
+ if (out.length >= topFrames) break;
569
+ }
570
+ return out;
571
+ }
572
+ function fingerprintError(err, opts = {}) {
573
+ const topFrames = opts.topFrames ?? DEFAULT_TOP_FRAMES;
574
+ const name = err.name ?? "";
575
+ const code = String(err.code ?? "");
576
+ const normalizedMessage = normalizeMessage(err.message ?? "");
577
+ const frames = normalizeStack(err.stack, topFrames);
578
+ const input = [name, code, normalizedMessage, frames.join("\n")].join("|");
579
+ const hash = createHash("sha1").update(input).digest("hex").slice(0, 16);
580
+ return { fingerprint: `${VERSION}:${hash}`, version: VERSION, normalizedMessage, frames };
581
+ }
582
+
583
+ const NULL_VERSION = "(unversioned)";
584
+ const ERROR_SORTS = ["recent", "count", "first"];
585
+ const errorsQuerySchema = z.object({
586
+ period: z.enum(PERIODS).default("24h"),
587
+ /** service slug; resolved to an id and intersected with the caller's scope */
588
+ service: z.string().optional(),
589
+ /** group slug; expanded to member service ids and intersected with the caller's scope */
590
+ group: z.string().optional(),
591
+ /** exact source-app filter */
592
+ app: z.string().min(1).max(200).optional(),
593
+ /** exact version filter */
594
+ version: z.string().min(1).max(200).optional(),
595
+ /** exact env filter */
596
+ env: z.string().min(1).max(200).optional(),
597
+ /** exact level filter, 0..5 */
598
+ level: z.coerce.number().int().min(0).max(5).optional(),
599
+ /** free-text search over the representative error message; LIKE %q% ESCAPE '\' */
600
+ q: z.string().trim().min(1).max(200).optional(),
601
+ sort: z.enum(ERROR_SORTS).default("recent"),
602
+ limit: z.coerce.number().int().min(1).max(200).default(50),
603
+ offset: z.coerce.number().int().min(0).default(0)
604
+ });
605
+ const errorDetailQuerySchema = z.object({
606
+ period: z.enum(PERIODS).default("24h"),
607
+ service: z.string().optional(),
608
+ group: z.string().optional(),
609
+ /** advanced bucket-size override in ms for the occurrences chart; > 500 buckets is a 400 */
610
+ bucketMs: z.coerce.number().int().positive().optional(),
611
+ limit: z.coerce.number().int().min(1).max(200).default(50),
612
+ offset: z.coerce.number().int().min(0).default(0)
613
+ });
614
+ const DEFAULT_REGRESSION_THRESHOLDS = {
615
+ activeWindowMs: 864e5,
616
+ // 24h
617
+ regressionGapMs: 2592e5
618
+ // 72h
619
+ };
620
+ function isRegressed(row, thresholds, now) {
621
+ const activeStart = now - thresholds.activeWindowMs;
622
+ return row.lastSeen >= activeStart && row.firstInActive != null && row.prevBeforeActive != null && row.firstInActive - row.prevBeforeActive >= thresholds.regressionGapMs;
623
+ }
624
+ function splitConcat(value) {
625
+ if (!value) return [];
626
+ return value.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
627
+ }
628
+
629
+ export { ACTIVITY_DIMENSIONS, ACTIVITY_SORTS, CANONICAL_LEVELS, DEFAULT_REGRESSION_THRESHOLDS, ERROR_SORTS, FROGGER_FIELD_MAP, FROGGER_LEVEL_MAP, MAX_BATCH_EVENTS, MODE_PARAM, NAME_TO_LEVEL, NULL_VERSION, PROGRESSIVE_TIERS, SERVICE_KINDS, SERVICE_TYPES, SERVICE_TYPE_META, SYSLOG_TO_CANONICAL, UNVERSIONED, activityQuerySchema, assignmentSchema, buildSpanTree, classifyTiers, computeJourneyStats, detectPartial, detectRegressions, errorDetailQuerySchema, errorsQuerySchema, fingerprintError, flattenSpanTree, groupCreateSchema, groupIdParams, groupMembershipSchema, groupUpdateSchema, isRegressed, isValidTraceId, journeyMode, journeyQuerySchema, keyCreateSchema, keyIdParams, levelName, logsFacetsQuerySchema, logsQuerySchema, normalizeFrame, normalizeMessage, normalizeStack, otelSeverityToCanonical, overviewQuerySchema, parseLevel, pivotVersionSeries, rolloutQuerySchema, rowToDetail, serviceCreateSchema, serviceIdParams, serviceKindSchema, serviceTypeMeta, serviceTypeSchema, serviceUpdateSchema, splitConcat, statsQuerySchema, zCanonicalBatch, zCanonicalEvent, zErrorInfo, zFroggerBatch, zFroggerLog, zGroupSeed, zLevel, zObserveSeedConfig, zServiceSeed, zSource, zTraceContext };
@@ -0,0 +1,3 @@
1
+ export { type ModuleOptions } from '../dist/runtime/shared/types/module-options.js'
2
+
3
+ export { default } from './module.mjs'