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.
- package/README.md +92 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +393 -0
- package/dist/runtime/app/assets/css/main.css +1 -0
- package/dist/runtime/app/components/ObserveActivityFeed.d.vue.ts +13 -0
- package/dist/runtime/app/components/ObserveActivityFeed.vue +77 -0
- package/dist/runtime/app/components/ObserveActivityFeed.vue.d.ts +13 -0
- package/dist/runtime/app/components/ObserveActivityTable.d.vue.ts +30 -0
- package/dist/runtime/app/components/ObserveActivityTable.vue +187 -0
- package/dist/runtime/app/components/ObserveActivityTable.vue.d.ts +30 -0
- package/dist/runtime/app/components/ObserveCan.d.vue.ts +27 -0
- package/dist/runtime/app/components/ObserveCan.vue +16 -0
- package/dist/runtime/app/components/ObserveCan.vue.d.ts +27 -0
- package/dist/runtime/app/components/ObserveErrorsTable.d.vue.ts +19 -0
- package/dist/runtime/app/components/ObserveErrorsTable.vue +105 -0
- package/dist/runtime/app/components/ObserveErrorsTable.vue.d.ts +19 -0
- package/dist/runtime/app/components/ObserveHealthHero.d.vue.ts +16 -0
- package/dist/runtime/app/components/ObserveHealthHero.vue +114 -0
- package/dist/runtime/app/components/ObserveHealthHero.vue.d.ts +16 -0
- package/dist/runtime/app/components/ObserveJourneySearch.d.vue.ts +13 -0
- package/dist/runtime/app/components/ObserveJourneySearch.vue +55 -0
- package/dist/runtime/app/components/ObserveJourneySearch.vue.d.ts +13 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.d.vue.ts +14 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.vue +119 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.vue.d.ts +14 -0
- package/dist/runtime/app/components/ObserveLogDetail.d.vue.ts +12 -0
- package/dist/runtime/app/components/ObserveLogDetail.vue +187 -0
- package/dist/runtime/app/components/ObserveLogDetail.vue.d.ts +12 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.d.vue.ts +10 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.vue +29 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.vue.d.ts +10 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.d.vue.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.vue +134 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.vue.d.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsTable.d.vue.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsTable.vue +92 -0
- package/dist/runtime/app/components/ObserveLogsTable.vue.d.ts +20 -0
- package/dist/runtime/app/components/ObservePeriodSelector.d.vue.ts +3 -0
- package/dist/runtime/app/components/ObservePeriodSelector.vue +22 -0
- package/dist/runtime/app/components/ObservePeriodSelector.vue.d.ts +3 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.d.vue.ts +12 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.vue +27 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.vue.d.ts +12 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.d.vue.ts +3 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.vue +49 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.vue.d.ts +3 -0
- package/dist/runtime/app/components/ObserveServicesTable.d.vue.ts +15 -0
- package/dist/runtime/app/components/ObserveServicesTable.vue +109 -0
- package/dist/runtime/app/components/ObserveServicesTable.vue.d.ts +15 -0
- package/dist/runtime/app/components/ObserveStatCard.d.vue.ts +14 -0
- package/dist/runtime/app/components/ObserveStatCard.vue +34 -0
- package/dist/runtime/app/components/ObserveStatCard.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.d.vue.ts +15 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue +170 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue.d.ts +15 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.d.vue.ts +17 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue +208 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue.d.ts +17 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.d.vue.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue +208 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.d.vue.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue +190 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.d.vue.ts +16 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue +199 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue.d.ts +16 -0
- package/dist/runtime/app/components/charts/chart-core.d.ts +64 -0
- package/dist/runtime/app/components/charts/chart-core.js +136 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.d.vue.ts +8 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue +145 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue.d.ts +8 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.d.vue.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue +106 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue.d.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.d.vue.ts +12 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue +67 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue.d.ts +12 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.d.vue.ts +18 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue +60 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue.d.ts +18 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.d.vue.ts +20 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue +21 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue.d.ts +20 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.d.vue.ts +15 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue +63 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue.d.ts +15 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.d.vue.ts +38 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue +216 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue.d.ts +38 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.d.vue.ts +37 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue +192 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue.d.ts +37 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.d.vue.ts +11 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue +18 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue.d.ts +11 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.d.vue.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue +132 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue.d.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.d.vue.ts +27 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.vue +108 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.vue.d.ts +27 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.d.vue.ts +17 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue +20 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue.d.ts +17 -0
- package/dist/runtime/app/composables/useObserveAbility.d.ts +15 -0
- package/dist/runtime/app/composables/useObserveAbility.js +20 -0
- package/dist/runtime/app/composables/useObserveActivity.d.ts +22 -0
- package/dist/runtime/app/composables/useObserveActivity.js +44 -0
- package/dist/runtime/app/composables/useObserveApiKeys.d.ts +15 -0
- package/dist/runtime/app/composables/useObserveApiKeys.js +19 -0
- package/dist/runtime/app/composables/useObserveAssignments.d.ts +19 -0
- package/dist/runtime/app/composables/useObserveAssignments.js +16 -0
- package/dist/runtime/app/composables/useObserveErrors.d.ts +33 -0
- package/dist/runtime/app/composables/useObserveErrors.js +85 -0
- package/dist/runtime/app/composables/useObserveGroups.d.ts +27 -0
- package/dist/runtime/app/composables/useObserveGroups.js +33 -0
- package/dist/runtime/app/composables/useObserveJourney.d.ts +19 -0
- package/dist/runtime/app/composables/useObserveJourney.js +19 -0
- package/dist/runtime/app/composables/useObserveLogFacets.d.ts +11 -0
- package/dist/runtime/app/composables/useObserveLogFacets.js +21 -0
- package/dist/runtime/app/composables/useObserveLogs.d.ts +28 -0
- package/dist/runtime/app/composables/useObserveLogs.js +100 -0
- package/dist/runtime/app/composables/useObserveMigrations.d.ts +17 -0
- package/dist/runtime/app/composables/useObserveMigrations.js +49 -0
- package/dist/runtime/app/composables/useObserveOverview.d.ts +14 -0
- package/dist/runtime/app/composables/useObserveOverview.js +23 -0
- package/dist/runtime/app/composables/useObservePeriod.d.ts +11 -0
- package/dist/runtime/app/composables/useObservePeriod.js +18 -0
- package/dist/runtime/app/composables/useObserveRollout.d.ts +20 -0
- package/dist/runtime/app/composables/useObserveRollout.js +55 -0
- package/dist/runtime/app/composables/useObserveScope.d.ts +13 -0
- package/dist/runtime/app/composables/useObserveScope.js +17 -0
- package/dist/runtime/app/composables/useObserveServices.d.ts +26 -0
- package/dist/runtime/app/composables/useObserveServices.js +33 -0
- package/dist/runtime/app/composables/useObserveStats.d.ts +14 -0
- package/dist/runtime/app/composables/useObserveStats.js +23 -0
- package/dist/runtime/app/composables/useObserveUsers.d.ts +29 -0
- package/dist/runtime/app/composables/useObserveUsers.js +33 -0
- package/dist/runtime/app/layouts/observe.d.vue.ts +13 -0
- package/dist/runtime/app/layouts/observe.vue +138 -0
- package/dist/runtime/app/layouts/observe.vue.d.ts +13 -0
- package/dist/runtime/app/middleware/observe-auth.global.d.ts +9 -0
- package/dist/runtime/app/middleware/observe-auth.global.js +8 -0
- package/dist/runtime/app/pages/activity.d.vue.ts +3 -0
- package/dist/runtime/app/pages/activity.vue +54 -0
- package/dist/runtime/app/pages/activity.vue.d.ts +3 -0
- package/dist/runtime/app/pages/error-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/error-detail.vue +190 -0
- package/dist/runtime/app/pages/error-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/errors.d.vue.ts +3 -0
- package/dist/runtime/app/pages/errors.vue +47 -0
- package/dist/runtime/app/pages/errors.vue.d.ts +3 -0
- package/dist/runtime/app/pages/journey.d.vue.ts +3 -0
- package/dist/runtime/app/pages/journey.vue +96 -0
- package/dist/runtime/app/pages/journey.vue.d.ts +3 -0
- package/dist/runtime/app/pages/log-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/log-detail.vue +35 -0
- package/dist/runtime/app/pages/log-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/login.d.vue.ts +3 -0
- package/dist/runtime/app/pages/login.vue +69 -0
- package/dist/runtime/app/pages/login.vue.d.ts +3 -0
- package/dist/runtime/app/pages/logs.d.vue.ts +3 -0
- package/dist/runtime/app/pages/logs.vue +36 -0
- package/dist/runtime/app/pages/logs.vue.d.ts +3 -0
- package/dist/runtime/app/pages/metrics.d.vue.ts +3 -0
- package/dist/runtime/app/pages/metrics.vue +68 -0
- package/dist/runtime/app/pages/metrics.vue.d.ts +3 -0
- package/dist/runtime/app/pages/overview.d.vue.ts +3 -0
- package/dist/runtime/app/pages/overview.vue +65 -0
- package/dist/runtime/app/pages/overview.vue.d.ts +3 -0
- package/dist/runtime/app/pages/rollout.d.vue.ts +3 -0
- package/dist/runtime/app/pages/rollout.vue +188 -0
- package/dist/runtime/app/pages/rollout.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/group-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/group-detail.vue +149 -0
- package/dist/runtime/app/pages/settings/group-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/groups.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/groups.vue +107 -0
- package/dist/runtime/app/pages/settings/groups.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/index.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/index.vue +47 -0
- package/dist/runtime/app/pages/settings/index.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/migrations.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/migrations.vue +275 -0
- package/dist/runtime/app/pages/settings/migrations.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/service-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/service-detail.vue +133 -0
- package/dist/runtime/app/pages/settings/service-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/services.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/services.vue +66 -0
- package/dist/runtime/app/pages/settings/services.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/users/[id].d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/users/[id].vue +243 -0
- package/dist/runtime/app/pages/settings/users/[id].vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/users/index.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/users/index.vue +129 -0
- package/dist/runtime/app/pages/settings/users/index.vue.d.ts +3 -0
- package/dist/runtime/options.d.ts +1 -0
- package/dist/runtime/options.js +1 -0
- package/dist/runtime/server/api/observe/activity.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/activity.get.js +30 -0
- package/dist/runtime/server/api/observe/auth/login.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/auth/login.post.js +13 -0
- package/dist/runtime/server/api/observe/auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/auth/logout.post.js +6 -0
- package/dist/runtime/server/api/observe/auth/me.get.d.ts +2 -0
- package/dist/runtime/server/api/observe/auth/me.get.js +3 -0
- package/dist/runtime/server/api/observe/errors/[fingerprint].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/errors/[fingerprint].get.js +56 -0
- package/dist/runtime/server/api/observe/errors/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/errors/index.get.js +41 -0
- package/dist/runtime/server/api/observe/facets.get.d.ts +8 -0
- package/dist/runtime/server/api/observe/facets.get.js +12 -0
- package/dist/runtime/server/api/observe/groups/[id]/assignments.put.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/[id]/assignments.put.js +12 -0
- package/dist/runtime/server/api/observe/groups/[id]/services.put.d.ts +5 -0
- package/dist/runtime/server/api/observe/groups/[id]/services.put.js +13 -0
- package/dist/runtime/server/api/observe/groups/[id].delete.d.ts +5 -0
- package/dist/runtime/server/api/observe/groups/[id].delete.js +11 -0
- package/dist/runtime/server/api/observe/groups/[id].get.d.ts +6 -0
- package/dist/runtime/server/api/observe/groups/[id].get.js +14 -0
- package/dist/runtime/server/api/observe/groups/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/[id].patch.js +12 -0
- package/dist/runtime/server/api/observe/groups/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/index.get.js +7 -0
- package/dist/runtime/server/api/observe/groups/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/index.post.js +11 -0
- package/dist/runtime/server/api/observe/health.get.d.ts +6 -0
- package/dist/runtime/server/api/observe/health.get.js +10 -0
- package/dist/runtime/server/api/observe/ingest/frogger.d.ts +5 -0
- package/dist/runtime/server/api/observe/ingest/frogger.js +42 -0
- package/dist/runtime/server/api/observe/ingest.d.ts +5 -0
- package/dist/runtime/server/api/observe/ingest.js +38 -0
- package/dist/runtime/server/api/observe/journey.get.d.ts +9 -0
- package/dist/runtime/server/api/observe/journey.get.js +31 -0
- package/dist/runtime/server/api/observe/logs/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/logs/[id].get.js +19 -0
- package/dist/runtime/server/api/observe/logs.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/logs.get.js +54 -0
- package/dist/runtime/server/api/observe/migrations/index.get.d.ts +9 -0
- package/dist/runtime/server/api/observe/migrations/index.get.js +14 -0
- package/dist/runtime/server/api/observe/migrations/run.post.d.ts +13 -0
- package/dist/runtime/server/api/observe/migrations/run.post.js +35 -0
- package/dist/runtime/server/api/observe/overview.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/overview.get.js +19 -0
- package/dist/runtime/server/api/observe/rollout/compare.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/compare.get.js +24 -0
- package/dist/runtime/server/api/observe/rollout/regressions.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/regressions.get.js +31 -0
- package/dist/runtime/server/api/observe/rollout/versions.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/versions.get.js +20 -0
- package/dist/runtime/server/api/observe/services/[id]/assignments.put.d.ts +7 -0
- package/dist/runtime/server/api/observe/services/[id]/assignments.put.js +12 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.js +14 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.js +14 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.get.js +10 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.post.js +11 -0
- package/dist/runtime/server/api/observe/services/[id]/restore.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/restore.post.js +11 -0
- package/dist/runtime/server/api/observe/services/[id].delete.d.ts +11 -0
- package/dist/runtime/server/api/observe/services/[id].delete.js +11 -0
- package/dist/runtime/server/api/observe/services/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id].get.js +12 -0
- package/dist/runtime/server/api/observe/services/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id].patch.js +13 -0
- package/dist/runtime/server/api/observe/services/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/index.get.js +7 -0
- package/dist/runtime/server/api/observe/services/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/index.post.js +16 -0
- package/dist/runtime/server/api/observe/stats.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/stats.get.js +28 -0
- package/dist/runtime/server/api/observe/users/[id]/assignments.put.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id]/assignments.put.js +14 -0
- package/dist/runtime/server/api/observe/users/[id].delete.d.ts +4 -0
- package/dist/runtime/server/api/observe/users/[id].delete.js +15 -0
- package/dist/runtime/server/api/observe/users/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id].get.js +11 -0
- package/dist/runtime/server/api/observe/users/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id].patch.js +25 -0
- package/dist/runtime/server/api/observe/users/index.get.d.ts +8 -0
- package/dist/runtime/server/api/observe/users/index.get.js +7 -0
- package/dist/runtime/server/api/observe/users/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/index.post.js +29 -0
- package/dist/runtime/server/auth/authorization.d.ts +7 -0
- package/dist/runtime/server/auth/authorization.js +5 -0
- package/dist/runtime/server/auth/provider.d.ts +17 -0
- package/dist/runtime/server/auth/provider.js +44 -0
- package/dist/runtime/server/auth/providers/config-provider.d.ts +18 -0
- package/dist/runtime/server/auth/providers/config-provider.js +54 -0
- package/dist/runtime/server/auth/providers/db-provider.d.ts +16 -0
- package/dist/runtime/server/auth/providers/db-provider.js +42 -0
- package/dist/runtime/server/auth/providers/jwt-provider.d.ts +24 -0
- package/dist/runtime/server/auth/providers/jwt-provider.js +72 -0
- package/dist/runtime/server/migrations/0001-services-kind.d.ts +8 -0
- package/dist/runtime/server/migrations/0001-services-kind.js +14 -0
- package/dist/runtime/server/migrations/0002-services-type.d.ts +7 -0
- package/dist/runtime/server/migrations/0002-services-type.js +14 -0
- package/dist/runtime/server/migrations/0003-services-deleted-at.d.ts +6 -0
- package/dist/runtime/server/migrations/0003-services-deleted-at.js +14 -0
- package/dist/runtime/server/migrations/0004-logs-error-fingerprint.d.ts +11 -0
- package/dist/runtime/server/migrations/0004-logs-error-fingerprint.js +15 -0
- package/dist/runtime/server/migrations/0005-users-columns.d.ts +9 -0
- package/dist/runtime/server/migrations/0005-users-columns.js +25 -0
- package/dist/runtime/server/migrations/index.d.ts +13 -0
- package/dist/runtime/server/migrations/index.js +13 -0
- package/dist/runtime/server/migrations/types.d.ts +15 -0
- package/dist/runtime/server/migrations/types.js +0 -0
- package/dist/runtime/server/plugins/observe-migrate.server.d.ts +2 -0
- package/dist/runtime/server/plugins/observe-migrate.server.js +18 -0
- package/dist/runtime/server/tasks/backfill-fingerprints.d.ts +11 -0
- package/dist/runtime/server/tasks/backfill-fingerprints.js +41 -0
- package/dist/runtime/server/tasks/purge.d.ts +5 -0
- package/dist/runtime/server/tasks/purge.js +12 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/activity-query.d.ts +28 -0
- package/dist/runtime/server/utils/activity-query.js +70 -0
- package/dist/runtime/server/utils/api-keys.d.ts +48 -0
- package/dist/runtime/server/utils/api-keys.js +67 -0
- package/dist/runtime/server/utils/authz.d.ts +50 -0
- package/dist/runtime/server/utils/authz.js +60 -0
- package/dist/runtime/server/utils/db/users.d.ts +91 -0
- package/dist/runtime/server/utils/db/users.js +128 -0
- package/dist/runtime/server/utils/db.d.ts +10 -0
- package/dist/runtime/server/utils/db.js +5 -0
- package/dist/runtime/server/utils/frogger-adapter.d.ts +40 -0
- package/dist/runtime/server/utils/frogger-adapter.js +97 -0
- package/dist/runtime/server/utils/groups.d.ts +35 -0
- package/dist/runtime/server/utils/groups.js +59 -0
- package/dist/runtime/server/utils/ingest-cors.d.ts +23 -0
- package/dist/runtime/server/utils/ingest-cors.js +27 -0
- package/dist/runtime/server/utils/journey.d.ts +20 -0
- package/dist/runtime/server/utils/journey.js +44 -0
- package/dist/runtime/server/utils/logs.d.ts +50 -0
- package/dist/runtime/server/utils/logs.js +154 -0
- package/dist/runtime/server/utils/loop-guard.d.ts +11 -0
- package/dist/runtime/server/utils/loop-guard.js +11 -0
- package/dist/runtime/server/utils/migrate.d.ts +21 -0
- package/dist/runtime/server/utils/migrate.js +144 -0
- package/dist/runtime/server/utils/migration-runner.d.ts +42 -0
- package/dist/runtime/server/utils/migration-runner.js +129 -0
- package/dist/runtime/server/utils/observe-errors.d.ts +58 -0
- package/dist/runtime/server/utils/observe-errors.js +206 -0
- package/dist/runtime/server/utils/overview.d.ts +20 -0
- package/dist/runtime/server/utils/overview.js +119 -0
- package/dist/runtime/server/utils/provisioning.d.ts +62 -0
- package/dist/runtime/server/utils/provisioning.js +299 -0
- package/dist/runtime/server/utils/rate-limit.d.ts +11 -0
- package/dist/runtime/server/utils/rate-limit.js +22 -0
- package/dist/runtime/server/utils/require-observe-session.d.ts +15 -0
- package/dist/runtime/server/utils/require-observe-session.js +25 -0
- package/dist/runtime/server/utils/rollout.d.ts +19 -0
- package/dist/runtime/server/utils/rollout.js +56 -0
- package/dist/runtime/server/utils/scope.d.ts +14 -0
- package/dist/runtime/server/utils/scope.js +28 -0
- package/dist/runtime/server/utils/seed.d.ts +18 -0
- package/dist/runtime/server/utils/seed.js +70 -0
- package/dist/runtime/server/utils/services.d.ts +91 -0
- package/dist/runtime/server/utils/services.js +142 -0
- package/dist/runtime/server/utils/stats-query.d.ts +40 -0
- package/dist/runtime/server/utils/stats-query.js +104 -0
- package/dist/runtime/shared/auth/roles.d.ts +34 -0
- package/dist/runtime/shared/auth/roles.js +6 -0
- package/dist/runtime/shared/auth/schema.d.ts +85 -0
- package/dist/runtime/shared/auth/schema.js +41 -0
- package/dist/runtime/shared/auth/types.d.ts +68 -0
- package/dist/runtime/shared/auth/types.js +0 -0
- package/dist/runtime/shared/rbac/capabilities.d.ts +46 -0
- package/dist/runtime/shared/rbac/capabilities.js +48 -0
- package/dist/runtime/shared/schema/activity.d.ts +77 -0
- package/dist/runtime/shared/schema/activity.js +22 -0
- package/dist/runtime/shared/schema/adapters/frogger.d.ts +52 -0
- package/dist/runtime/shared/schema/adapters/frogger.js +17 -0
- package/dist/runtime/shared/schema/batch.d.ts +33 -0
- package/dist/runtime/shared/schema/batch.js +9 -0
- package/dist/runtime/shared/schema/error-fingerprint.d.ts +53 -0
- package/dist/runtime/shared/schema/error-fingerprint.js +47 -0
- package/dist/runtime/shared/schema/errors-query.d.ts +136 -0
- package/dist/runtime/shared/schema/errors-query.js +47 -0
- package/dist/runtime/shared/schema/event.d.ts +48 -0
- package/dist/runtime/shared/schema/event.js +41 -0
- package/dist/runtime/shared/schema/frogger-map.d.ts +62 -0
- package/dist/runtime/shared/schema/frogger-map.js +30 -0
- package/dist/runtime/shared/schema/index.d.ts +17 -0
- package/dist/runtime/shared/schema/index.js +17 -0
- package/dist/runtime/shared/schema/journey.d.ts +99 -0
- package/dist/runtime/shared/schema/journey.js +96 -0
- package/dist/runtime/shared/schema/levels.d.ts +37 -0
- package/dist/runtime/shared/schema/levels.js +72 -0
- package/dist/runtime/shared/schema/log-row.d.ts +31 -0
- package/dist/runtime/shared/schema/log-row.js +0 -0
- package/dist/runtime/shared/schema/logs-query.d.ts +91 -0
- package/dist/runtime/shared/schema/logs-query.js +72 -0
- package/dist/runtime/shared/schema/migrations.d.ts +34 -0
- package/dist/runtime/shared/schema/migrations.js +0 -0
- package/dist/runtime/shared/schema/overview.d.ts +78 -0
- package/dist/runtime/shared/schema/overview.js +9 -0
- package/dist/runtime/shared/schema/provisioning.d.ts +230 -0
- package/dist/runtime/shared/schema/provisioning.js +52 -0
- package/dist/runtime/shared/schema/registry.d.ts +115 -0
- package/dist/runtime/shared/schema/registry.js +27 -0
- package/dist/runtime/shared/schema/rollout.d.ts +103 -0
- package/dist/runtime/shared/schema/rollout.js +66 -0
- package/dist/runtime/shared/schema/stats.d.ts +64 -0
- package/dist/runtime/shared/schema/stats.js +15 -0
- package/dist/runtime/shared/schema/tiers.d.ts +5 -0
- package/dist/runtime/shared/schema/tiers.js +9 -0
- package/dist/runtime/shared/types/module-options.d.ts +119 -0
- package/dist/runtime/shared/types/module-options.js +13 -0
- package/dist/runtime/shared/types/storage.d.ts +31 -0
- package/dist/runtime/shared/types/storage.js +0 -0
- package/dist/runtime/shared/utils/format-relative.d.ts +7 -0
- package/dist/runtime/shared/utils/format-relative.js +11 -0
- package/dist/runtime/shared/utils/frogger-snippet.d.ts +19 -0
- package/dist/runtime/shared/utils/frogger-snippet.js +33 -0
- package/dist/runtime/shared/utils/observe-config.d.ts +9 -0
- package/dist/runtime/shared/utils/observe-config.js +17 -0
- package/dist/runtime/shared/utils/period.d.ts +13 -0
- package/dist/runtime/shared/utils/period.js +15 -0
- package/dist/runtime/shared/utils/slug.d.ts +1 -0
- package/dist/runtime/shared/utils/slug.js +5 -0
- package/dist/runtime/shared/utils/uuid.d.ts +187 -0
- package/dist/runtime/shared/utils/uuid.js +345 -0
- package/dist/runtime/types/nuxt-auth-utils-imports.d.ts +25 -0
- package/dist/runtime/types/observe-app-imports.d.ts +20 -0
- package/dist/runtime/types/session.d.ts +17 -0
- package/dist/schema.d.mts +1318 -0
- package/dist/schema.mjs +629 -0
- package/dist/types.d.mts +3 -0
- package/package.json +93 -0
|
@@ -0,0 +1,1318 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Canonical severity: 0..5, lower = more severe (preserves frogger `lvl` 1:1). */
|
|
4
|
+
declare const CANONICAL_LEVELS: {
|
|
5
|
+
readonly 0: "error";
|
|
6
|
+
readonly 1: "warn";
|
|
7
|
+
readonly 2: "notice";
|
|
8
|
+
readonly 3: "info";
|
|
9
|
+
readonly 4: "debug";
|
|
10
|
+
readonly 5: "trace";
|
|
11
|
+
};
|
|
12
|
+
type CanonicalLevel = keyof typeof CANONICAL_LEVELS;
|
|
13
|
+
type CanonicalLevelName = (typeof CANONICAL_LEVELS)[CanonicalLevel];
|
|
14
|
+
/** zod: an int strictly in 0..5. Sentinels are NOT valid stored levels. */
|
|
15
|
+
declare const zLevel: z.ZodNumber;
|
|
16
|
+
/** frogger numeric `lvl` -> canonical level. 1:1 for 0..5; sentinels handled in parseLevel(). */
|
|
17
|
+
declare const FROGGER_LEVEL_MAP: Record<number, CanonicalLevel>;
|
|
18
|
+
/** frogger `type` string / any known level name -> canonical level (mirrors frogger LEVEL_TO_NUMBER). */
|
|
19
|
+
declare const NAME_TO_LEVEL: Record<string, CanonicalLevel>;
|
|
20
|
+
/**
|
|
21
|
+
* syslog severity (0=Emergency..7=Debug) -> canonical. Same orientation (lower=severe).
|
|
22
|
+
* Note: syslog Notice(5) maps cleanly to canonical notice(2).
|
|
23
|
+
*/
|
|
24
|
+
declare const SYSLOG_TO_CANONICAL: Record<number, CanonicalLevel>;
|
|
25
|
+
/**
|
|
26
|
+
* OTel severityNumber (1..24) -> canonical. INVERTED orientation: OTel is higher=severe
|
|
27
|
+
* while this scale is lower=severe, so this is a hand-authored range table, not arithmetic.
|
|
28
|
+
* No OTel range maps to notice(2); that level is frogger-specific.
|
|
29
|
+
* TRACE 1-4 -> 5 · DEBUG 5-8 -> 4 · INFO 9-12 -> 3 · WARN 13-16 -> 1 · ERROR 17-20 -> 0 · FATAL 21-24 -> 0
|
|
30
|
+
*/
|
|
31
|
+
declare function otelSeverityToCanonical(severityNumber: number): CanonicalLevel;
|
|
32
|
+
declare function levelName(n: number): CanonicalLevelName | 'unknown';
|
|
33
|
+
/**
|
|
34
|
+
* Normalise an incoming frogger numeric `lvl` OR a level name into canonical 0..5.
|
|
35
|
+
* verbose(999) -> 5 (clamp). silent(-999) -> null (drop, never store).
|
|
36
|
+
* Out-of-range or unknown -> null (caller decides: reject or default).
|
|
37
|
+
*/
|
|
38
|
+
declare function parseLevel(input: number | string): CanonicalLevel | null;
|
|
39
|
+
|
|
40
|
+
declare const zErrorInfo: z.ZodObject<{
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
message: z.ZodString;
|
|
43
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
44
|
+
code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
declare const zTraceContext: z.ZodObject<{
|
|
47
|
+
traceId: z.ZodString;
|
|
48
|
+
spanId: z.ZodString;
|
|
49
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
declare const zSource: z.ZodObject<{
|
|
52
|
+
app: z.ZodString;
|
|
53
|
+
version: z.ZodOptional<z.ZodString>;
|
|
54
|
+
env: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
declare const zCanonicalEvent: z.ZodObject<{
|
|
57
|
+
time: z.ZodNumber;
|
|
58
|
+
level: z.ZodNumber;
|
|
59
|
+
message: z.ZodString;
|
|
60
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
message: z.ZodString;
|
|
63
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
64
|
+
code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
traceId: z.ZodString;
|
|
68
|
+
spanId: z.ZodString;
|
|
69
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
app: z.ZodString;
|
|
73
|
+
version: z.ZodOptional<z.ZodString>;
|
|
74
|
+
env: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
session: z.ZodOptional<z.ZodString>;
|
|
77
|
+
user: z.ZodOptional<z.ZodString>;
|
|
78
|
+
route: z.ZodOptional<z.ZodString>;
|
|
79
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
80
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
type ErrorInfo = z.infer<typeof zErrorInfo>;
|
|
84
|
+
type TraceContextInfo = z.infer<typeof zTraceContext>;
|
|
85
|
+
type EventSource = z.infer<typeof zSource>;
|
|
86
|
+
type CanonicalEvent = z.infer<typeof zCanonicalEvent>;
|
|
87
|
+
|
|
88
|
+
declare const MAX_BATCH_EVENTS = 500;
|
|
89
|
+
declare const zCanonicalBatch: z.ZodObject<{
|
|
90
|
+
events: z.ZodArray<z.ZodObject<{
|
|
91
|
+
time: z.ZodNumber;
|
|
92
|
+
level: z.ZodNumber;
|
|
93
|
+
message: z.ZodString;
|
|
94
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
name: z.ZodString;
|
|
96
|
+
message: z.ZodString;
|
|
97
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
98
|
+
code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
traceId: z.ZodString;
|
|
102
|
+
spanId: z.ZodString;
|
|
103
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
app: z.ZodString;
|
|
107
|
+
version: z.ZodOptional<z.ZodString>;
|
|
108
|
+
env: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
session: z.ZodOptional<z.ZodString>;
|
|
111
|
+
user: z.ZodOptional<z.ZodString>;
|
|
112
|
+
route: z.ZodOptional<z.ZodString>;
|
|
113
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
114
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
115
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
type CanonicalBatch = z.infer<typeof zCanonicalBatch>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Flat DB projection of a CanonicalEvent (one table row).
|
|
123
|
+
* `id` and `received_at` are ingest-assigned (NOT from the event).
|
|
124
|
+
* `app` is non-optional: the CP4 adapter guarantees it before insert
|
|
125
|
+
* (from batch app.name / log source.name), even though event.source is optional.
|
|
126
|
+
*/
|
|
127
|
+
interface LogRow {
|
|
128
|
+
id: string;
|
|
129
|
+
time: number;
|
|
130
|
+
received_at: number;
|
|
131
|
+
level: number;
|
|
132
|
+
message: string;
|
|
133
|
+
error_name?: string;
|
|
134
|
+
error_message?: string;
|
|
135
|
+
error_stack?: string;
|
|
136
|
+
error_code?: string;
|
|
137
|
+
error_fingerprint?: string;
|
|
138
|
+
app: string;
|
|
139
|
+
version?: string;
|
|
140
|
+
env?: string;
|
|
141
|
+
service_id?: string;
|
|
142
|
+
session?: string;
|
|
143
|
+
user?: string;
|
|
144
|
+
route?: string;
|
|
145
|
+
feature?: string;
|
|
146
|
+
trace_id?: string;
|
|
147
|
+
span_id?: string;
|
|
148
|
+
parent_id?: string;
|
|
149
|
+
tags?: string;
|
|
150
|
+
ctx?: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare const PROGRESSIVE_TIERS: readonly ["stream", "grouping", "journey", "activity", "rollout"];
|
|
154
|
+
type Tier = (typeof PROGRESSIVE_TIERS)[number];
|
|
155
|
+
/** Which tiers a given event satisfies. `stream` is always included for a valid event. */
|
|
156
|
+
declare function classifyTiers(event: CanonicalEvent): Tier[];
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Documented frogger -> canonical field map. Data + JSDoc ONLY. CP1 writes no
|
|
160
|
+
* transform. This is the reference the CP4 ingest adapter implements against.
|
|
161
|
+
* Grounded in frogger's log.ts, batch.ts, trace-headers.ts, normalize-log-args.ts,
|
|
162
|
+
* global-error.server.ts.
|
|
163
|
+
*
|
|
164
|
+
* ## Error derivation (adapter implements in CP4)
|
|
165
|
+
* frogger lifts errors into `ctx` in two shapes:
|
|
166
|
+
* - normalize-log-args serializeError() writes ctx.error = { name, message, stack }.
|
|
167
|
+
* - global-error.server writes fields flat onto ctx (message, name, stack, cause,
|
|
168
|
+
* and for H3Error: statusCode, statusMessage, data).
|
|
169
|
+
* Resolution order:
|
|
170
|
+
* - error.name <- ctx.error.name ?? ctx.name
|
|
171
|
+
* - error.message <- ctx.error.message ?? ctx.message
|
|
172
|
+
* - error.stack <- ctx.error.stack ?? ctx.stack
|
|
173
|
+
* - error.code <- ctx.error.code ?? ctx.code ?? ctx.statusCode
|
|
174
|
+
* Emit `error` only if at least name+message (or message) resolve.
|
|
175
|
+
*
|
|
176
|
+
* ## Gap fields: ctx-key convention (frozen for CP4 + CP15)
|
|
177
|
+
* frogger emits no native session/user/route/feature; they are read from
|
|
178
|
+
* ctx.session / ctx.user / ctx.route / ctx.feature.
|
|
179
|
+
*
|
|
180
|
+
* ## Caveats
|
|
181
|
+
* - source.env is frogger EXECUTION context (ssr/csr/client/server), NOT deploy
|
|
182
|
+
* env. Mapped verbatim; deploy env rides in tags/ctx until a dedicated field exists.
|
|
183
|
+
* - Dropped fields: `type` (redundant with numeric lvl) and `trace.flags`
|
|
184
|
+
* (canonical omits). Both optionally preservable via ctx (froggerType / traceFlags).
|
|
185
|
+
* - frogger client transport sends no API-key header (bare $fetch); CP4 ingest must
|
|
186
|
+
* accept ?key= on the query string. CP1 designs no ingest.
|
|
187
|
+
*/
|
|
188
|
+
/** Every frogger LoggerObject/LoggerObjectBatch key -> canonical destination (or documented drop). */
|
|
189
|
+
declare const FROGGER_FIELD_MAP: {
|
|
190
|
+
readonly log: {
|
|
191
|
+
readonly time: "time";
|
|
192
|
+
readonly lvl: "level";
|
|
193
|
+
readonly type: "(dropped: redundant with lvl)";
|
|
194
|
+
readonly msg: "message";
|
|
195
|
+
readonly ctx: "ctx (+ derived: error/session/user/route/feature)";
|
|
196
|
+
readonly tags: "tags";
|
|
197
|
+
readonly env: "source.env";
|
|
198
|
+
readonly 'source.name': "source.app";
|
|
199
|
+
readonly 'source.version': "source.version";
|
|
200
|
+
readonly 'trace.traceId': "trace.traceId";
|
|
201
|
+
readonly 'trace.spanId': "trace.spanId";
|
|
202
|
+
readonly 'trace.parentId': "trace.parentId";
|
|
203
|
+
readonly 'trace.flags': "(dropped: canonical omits flags)";
|
|
204
|
+
};
|
|
205
|
+
readonly batch: {
|
|
206
|
+
readonly logs: "events";
|
|
207
|
+
readonly 'app.name': "source.app";
|
|
208
|
+
readonly 'app.version': "source.version";
|
|
209
|
+
readonly meta: "meta (passthrough)";
|
|
210
|
+
};
|
|
211
|
+
readonly ctxDerived: {
|
|
212
|
+
readonly 'ctx.error': "error";
|
|
213
|
+
readonly 'ctx.session': "session";
|
|
214
|
+
readonly 'ctx.user': "user";
|
|
215
|
+
readonly 'ctx.route': "route";
|
|
216
|
+
readonly 'ctx.feature': "feature";
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
type FroggerFieldMap = typeof FROGGER_FIELD_MAP;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Permissive wire schema for a frogger LoggerObjectBatch. Deliberately does NOT
|
|
223
|
+
* hex-validate trace (the canonical zTraceContext does; the adapter demotes an
|
|
224
|
+
* invalid trace into ctx instead of 400-ing the batch) and passes unknown
|
|
225
|
+
* ctx/meta keys through. zod-only: keeps the `nuxt-observe/schema` subpath pure.
|
|
226
|
+
*/
|
|
227
|
+
declare const zFroggerLog: z.ZodObject<{
|
|
228
|
+
time: z.ZodNumber;
|
|
229
|
+
lvl: z.ZodNumber;
|
|
230
|
+
type: z.ZodOptional<z.ZodString>;
|
|
231
|
+
msg: z.ZodString;
|
|
232
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
233
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
env: z.ZodOptional<z.ZodString>;
|
|
235
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
237
|
+
version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
241
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
242
|
+
parentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
}, z.core.$loose>;
|
|
245
|
+
declare const zFroggerBatch: z.ZodObject<{
|
|
246
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
247
|
+
time: z.ZodNumber;
|
|
248
|
+
lvl: z.ZodNumber;
|
|
249
|
+
type: z.ZodOptional<z.ZodString>;
|
|
250
|
+
msg: z.ZodString;
|
|
251
|
+
ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
252
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
253
|
+
env: z.ZodOptional<z.ZodString>;
|
|
254
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
256
|
+
version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
257
|
+
}, z.core.$strip>>;
|
|
258
|
+
trace: z.ZodOptional<z.ZodObject<{
|
|
259
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
260
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
261
|
+
parentId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
262
|
+
}, z.core.$strip>>;
|
|
263
|
+
}, z.core.$loose>>;
|
|
264
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
265
|
+
name: z.ZodOptional<z.ZodString>;
|
|
266
|
+
version: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, z.core.$strip>>;
|
|
268
|
+
meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
269
|
+
}, z.core.$loose>;
|
|
270
|
+
type FroggerLogInput = z.infer<typeof zFroggerLog>;
|
|
271
|
+
type FroggerBatchInput = z.infer<typeof zFroggerBatch>;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Config-seed contracts for the service registry. Pure zod + local only: this
|
|
275
|
+
* file is part of the `nuxt-observe/schema` subpath and must never import
|
|
276
|
+
* node:crypto, #imports, or any server util.
|
|
277
|
+
*/
|
|
278
|
+
declare const zServiceSeed: z.ZodPipe<z.ZodObject<{
|
|
279
|
+
slug: z.ZodString;
|
|
280
|
+
name: z.ZodString;
|
|
281
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
282
|
+
service: "service";
|
|
283
|
+
website: "website";
|
|
284
|
+
webapp: "webapp";
|
|
285
|
+
api: "api";
|
|
286
|
+
worker: "worker";
|
|
287
|
+
mobile: "mobile";
|
|
288
|
+
other: "other";
|
|
289
|
+
}>>;
|
|
290
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
291
|
+
server: "server";
|
|
292
|
+
browser: "browser";
|
|
293
|
+
}>>;
|
|
294
|
+
appNames: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
295
|
+
allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
296
|
+
env: z.ZodOptional<z.ZodString>;
|
|
297
|
+
versionTracking: z.ZodOptional<z.ZodBoolean>;
|
|
298
|
+
currentVersion: z.ZodOptional<z.ZodString>;
|
|
299
|
+
group: z.ZodOptional<z.ZodString>;
|
|
300
|
+
key: z.ZodOptional<z.ZodString>;
|
|
301
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
302
|
+
slug: string;
|
|
303
|
+
name: string;
|
|
304
|
+
type: "service" | "website" | "webapp" | "api" | "worker" | "mobile" | "other";
|
|
305
|
+
kind: "server" | "browser";
|
|
306
|
+
appNames: string[];
|
|
307
|
+
allowedOrigins: string[];
|
|
308
|
+
env?: string | undefined;
|
|
309
|
+
versionTracking?: boolean | undefined;
|
|
310
|
+
currentVersion?: string | undefined;
|
|
311
|
+
group?: string | undefined;
|
|
312
|
+
key?: string | undefined;
|
|
313
|
+
}, {
|
|
314
|
+
slug: string;
|
|
315
|
+
name: string;
|
|
316
|
+
type: "service" | "website" | "webapp" | "api" | "worker" | "mobile" | "other";
|
|
317
|
+
kind: "server" | "browser";
|
|
318
|
+
appNames: string[];
|
|
319
|
+
allowedOrigins: string[];
|
|
320
|
+
env?: string | undefined;
|
|
321
|
+
versionTracking?: boolean | undefined;
|
|
322
|
+
currentVersion?: string | undefined;
|
|
323
|
+
group?: string | undefined;
|
|
324
|
+
key?: string | undefined;
|
|
325
|
+
}>>;
|
|
326
|
+
declare const zGroupSeed: z.ZodObject<{
|
|
327
|
+
slug: z.ZodString;
|
|
328
|
+
name: z.ZodString;
|
|
329
|
+
}, z.core.$strip>;
|
|
330
|
+
declare const zObserveSeedConfig: z.ZodObject<{
|
|
331
|
+
services: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
332
|
+
slug: z.ZodString;
|
|
333
|
+
name: z.ZodString;
|
|
334
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
335
|
+
service: "service";
|
|
336
|
+
website: "website";
|
|
337
|
+
webapp: "webapp";
|
|
338
|
+
api: "api";
|
|
339
|
+
worker: "worker";
|
|
340
|
+
mobile: "mobile";
|
|
341
|
+
other: "other";
|
|
342
|
+
}>>;
|
|
343
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
344
|
+
server: "server";
|
|
345
|
+
browser: "browser";
|
|
346
|
+
}>>;
|
|
347
|
+
appNames: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
348
|
+
allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
349
|
+
env: z.ZodOptional<z.ZodString>;
|
|
350
|
+
versionTracking: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
+
currentVersion: z.ZodOptional<z.ZodString>;
|
|
352
|
+
group: z.ZodOptional<z.ZodString>;
|
|
353
|
+
key: z.ZodOptional<z.ZodString>;
|
|
354
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
355
|
+
slug: string;
|
|
356
|
+
name: string;
|
|
357
|
+
type: "service" | "website" | "webapp" | "api" | "worker" | "mobile" | "other";
|
|
358
|
+
kind: "server" | "browser";
|
|
359
|
+
appNames: string[];
|
|
360
|
+
allowedOrigins: string[];
|
|
361
|
+
env?: string | undefined;
|
|
362
|
+
versionTracking?: boolean | undefined;
|
|
363
|
+
currentVersion?: string | undefined;
|
|
364
|
+
group?: string | undefined;
|
|
365
|
+
key?: string | undefined;
|
|
366
|
+
}, {
|
|
367
|
+
slug: string;
|
|
368
|
+
name: string;
|
|
369
|
+
type: "service" | "website" | "webapp" | "api" | "worker" | "mobile" | "other";
|
|
370
|
+
kind: "server" | "browser";
|
|
371
|
+
appNames: string[];
|
|
372
|
+
allowedOrigins: string[];
|
|
373
|
+
env?: string | undefined;
|
|
374
|
+
versionTracking?: boolean | undefined;
|
|
375
|
+
currentVersion?: string | undefined;
|
|
376
|
+
group?: string | undefined;
|
|
377
|
+
key?: string | undefined;
|
|
378
|
+
}>>>>;
|
|
379
|
+
groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
380
|
+
slug: z.ZodString;
|
|
381
|
+
name: z.ZodString;
|
|
382
|
+
}, z.core.$strip>>>;
|
|
383
|
+
}, z.core.$strip>;
|
|
384
|
+
type ServiceSeed = z.input<typeof zServiceSeed>;
|
|
385
|
+
type GroupSeed = z.input<typeof zGroupSeed>;
|
|
386
|
+
type ObserveSeedConfig = z.input<typeof zObserveSeedConfig>;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Provisioning contracts (CP11). Pure zod + local only: this file loads in the
|
|
390
|
+
* browser UForm, the Nitro routes, and node unit tests, so it must never import
|
|
391
|
+
* #imports, node:crypto, or any server util (same rule as registry.ts).
|
|
392
|
+
*
|
|
393
|
+
* `type` is orthogonal to `kind`: `kind` (server|browser) drives dynamic CORS,
|
|
394
|
+
* `type` is a descriptive UI-only category (badge + icon + filter metadata).
|
|
395
|
+
*/
|
|
396
|
+
declare const SERVICE_TYPES: readonly ["website", "webapp", "api", "service", "worker", "mobile", "other"];
|
|
397
|
+
type ServiceType = (typeof SERVICE_TYPES)[number];
|
|
398
|
+
declare const serviceTypeSchema: z.ZodEnum<{
|
|
399
|
+
service: "service";
|
|
400
|
+
website: "website";
|
|
401
|
+
webapp: "webapp";
|
|
402
|
+
api: "api";
|
|
403
|
+
worker: "worker";
|
|
404
|
+
mobile: "mobile";
|
|
405
|
+
other: "other";
|
|
406
|
+
}>;
|
|
407
|
+
declare const SERVICE_KINDS: readonly ["server", "browser"];
|
|
408
|
+
type ServiceKind = (typeof SERVICE_KINDS)[number];
|
|
409
|
+
declare const serviceKindSchema: z.ZodEnum<{
|
|
410
|
+
server: "server";
|
|
411
|
+
browser: "browser";
|
|
412
|
+
}>;
|
|
413
|
+
/**
|
|
414
|
+
* Presentation map for the `type` axis: one source of truth for the USelectMenu
|
|
415
|
+
* options, the table badge, and the detail header. lucide names follow the repo's
|
|
416
|
+
* `i-lucide-*` convention. An unknown/hand-edited `type` falls back to `other`
|
|
417
|
+
* at render time (see serviceTypeMeta).
|
|
418
|
+
*/
|
|
419
|
+
declare const SERVICE_TYPE_META: {
|
|
420
|
+
readonly website: {
|
|
421
|
+
readonly label: "Website";
|
|
422
|
+
readonly icon: "i-lucide-globe";
|
|
423
|
+
};
|
|
424
|
+
readonly webapp: {
|
|
425
|
+
readonly label: "Web app";
|
|
426
|
+
readonly icon: "i-lucide-app-window";
|
|
427
|
+
};
|
|
428
|
+
readonly api: {
|
|
429
|
+
readonly label: "API";
|
|
430
|
+
readonly icon: "i-lucide-webhook";
|
|
431
|
+
};
|
|
432
|
+
readonly service: {
|
|
433
|
+
readonly label: "Service";
|
|
434
|
+
readonly icon: "i-lucide-server";
|
|
435
|
+
};
|
|
436
|
+
readonly worker: {
|
|
437
|
+
readonly label: "Worker";
|
|
438
|
+
readonly icon: "i-lucide-cog";
|
|
439
|
+
};
|
|
440
|
+
readonly mobile: {
|
|
441
|
+
readonly label: "Mobile";
|
|
442
|
+
readonly icon: "i-lucide-smartphone";
|
|
443
|
+
};
|
|
444
|
+
readonly other: {
|
|
445
|
+
readonly label: "Other";
|
|
446
|
+
readonly icon: "i-lucide-box";
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
/** Lenient lookup: any unrecognised value renders as `other` rather than throwing. */
|
|
450
|
+
declare function serviceTypeMeta(type: string): {
|
|
451
|
+
label: string;
|
|
452
|
+
icon: string;
|
|
453
|
+
};
|
|
454
|
+
declare const serviceCreateSchema: z.ZodObject<{
|
|
455
|
+
name: z.ZodString;
|
|
456
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
457
|
+
service: "service";
|
|
458
|
+
website: "website";
|
|
459
|
+
webapp: "webapp";
|
|
460
|
+
api: "api";
|
|
461
|
+
worker: "worker";
|
|
462
|
+
mobile: "mobile";
|
|
463
|
+
other: "other";
|
|
464
|
+
}>>;
|
|
465
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
466
|
+
server: "server";
|
|
467
|
+
browser: "browser";
|
|
468
|
+
}>>;
|
|
469
|
+
appNames: z.ZodArray<z.ZodString>;
|
|
470
|
+
allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
471
|
+
env: z.ZodOptional<z.ZodString>;
|
|
472
|
+
versionTracking: z.ZodOptional<z.ZodBoolean>;
|
|
473
|
+
}, z.core.$strip>;
|
|
474
|
+
declare const serviceUpdateSchema: z.ZodObject<{
|
|
475
|
+
name: z.ZodOptional<z.ZodString>;
|
|
476
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
477
|
+
service: "service";
|
|
478
|
+
website: "website";
|
|
479
|
+
webapp: "webapp";
|
|
480
|
+
api: "api";
|
|
481
|
+
worker: "worker";
|
|
482
|
+
mobile: "mobile";
|
|
483
|
+
other: "other";
|
|
484
|
+
}>>;
|
|
485
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
486
|
+
server: "server";
|
|
487
|
+
browser: "browser";
|
|
488
|
+
}>>;
|
|
489
|
+
appNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
490
|
+
allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
491
|
+
env: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
492
|
+
groupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
493
|
+
versionTracking: z.ZodOptional<z.ZodBoolean>;
|
|
494
|
+
currentVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
495
|
+
}, z.core.$strip>;
|
|
496
|
+
declare const keyCreateSchema: z.ZodObject<{
|
|
497
|
+
label: z.ZodString;
|
|
498
|
+
}, z.core.$strip>;
|
|
499
|
+
declare const groupCreateSchema: z.ZodObject<{
|
|
500
|
+
name: z.ZodString;
|
|
501
|
+
}, z.core.$strip>;
|
|
502
|
+
declare const groupUpdateSchema: z.ZodObject<{
|
|
503
|
+
name: z.ZodString;
|
|
504
|
+
}, z.core.$strip>;
|
|
505
|
+
declare const groupMembershipSchema: z.ZodObject<{
|
|
506
|
+
serviceIds: z.ZodArray<z.ZodString>;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
declare const assignmentSchema: z.ZodObject<{
|
|
509
|
+
userIds: z.ZodArray<z.ZodString>;
|
|
510
|
+
}, z.core.$strip>;
|
|
511
|
+
declare const serviceIdParams: z.ZodObject<{
|
|
512
|
+
id: z.ZodString;
|
|
513
|
+
}, z.core.$strip>;
|
|
514
|
+
declare const keyIdParams: z.ZodObject<{
|
|
515
|
+
id: z.ZodString;
|
|
516
|
+
keyId: z.ZodString;
|
|
517
|
+
}, z.core.$strip>;
|
|
518
|
+
declare const groupIdParams: z.ZodObject<{
|
|
519
|
+
id: z.ZodString;
|
|
520
|
+
}, z.core.$strip>;
|
|
521
|
+
type ServiceCreate = z.infer<typeof serviceCreateSchema>;
|
|
522
|
+
type ServiceUpdate = z.infer<typeof serviceUpdateSchema>;
|
|
523
|
+
type KeyCreate = z.infer<typeof keyCreateSchema>;
|
|
524
|
+
type GroupCreate = z.infer<typeof groupCreateSchema>;
|
|
525
|
+
type GroupMembership = z.infer<typeof groupMembershipSchema>;
|
|
526
|
+
/**
|
|
527
|
+
* Wire shapes the composables type against. Kept here (framework-free) so the
|
|
528
|
+
* client and the routes never drift on field names.
|
|
529
|
+
*/
|
|
530
|
+
interface ServiceListItem {
|
|
531
|
+
id: string;
|
|
532
|
+
slug: string;
|
|
533
|
+
name: string;
|
|
534
|
+
type: ServiceType;
|
|
535
|
+
kind: ServiceKind;
|
|
536
|
+
env: string | null;
|
|
537
|
+
groupId: string | null;
|
|
538
|
+
versionTracking: boolean;
|
|
539
|
+
currentVersion: string | null;
|
|
540
|
+
keyCount: number;
|
|
541
|
+
managedByConfig: boolean;
|
|
542
|
+
deletedAt: number | null;
|
|
543
|
+
/** epoch ms at which a soft-deleted service is eligible for permanent purge, else null. */
|
|
544
|
+
purgeAt: number | null;
|
|
545
|
+
}
|
|
546
|
+
interface ServiceDetail extends ServiceListItem {
|
|
547
|
+
appNames: string[];
|
|
548
|
+
allowedOrigins: string[];
|
|
549
|
+
group: {
|
|
550
|
+
id: string;
|
|
551
|
+
slug: string;
|
|
552
|
+
name: string;
|
|
553
|
+
} | null;
|
|
554
|
+
}
|
|
555
|
+
interface KeyMeta {
|
|
556
|
+
id: string;
|
|
557
|
+
keyPrefix: string;
|
|
558
|
+
label: string | null;
|
|
559
|
+
createdAt: number;
|
|
560
|
+
revokedAt: number | null;
|
|
561
|
+
lastUsedAt: number | null;
|
|
562
|
+
}
|
|
563
|
+
interface MintedKey {
|
|
564
|
+
key: string;
|
|
565
|
+
prefix: string;
|
|
566
|
+
ingestUrl: string;
|
|
567
|
+
snippet: {
|
|
568
|
+
rawUrl: string;
|
|
569
|
+
serverPluginSnippet: string;
|
|
570
|
+
configSnippet: string;
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
interface GroupListItem {
|
|
574
|
+
id: string;
|
|
575
|
+
slug: string;
|
|
576
|
+
name: string;
|
|
577
|
+
serviceCount: number;
|
|
578
|
+
}
|
|
579
|
+
interface UserPick {
|
|
580
|
+
id: string;
|
|
581
|
+
name: string;
|
|
582
|
+
role: string;
|
|
583
|
+
assignment: {
|
|
584
|
+
services: string[];
|
|
585
|
+
groups: string[];
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Full DB-backed user (CP16), for the edit page. `services`/`groups` carry ids + per-scope
|
|
590
|
+
* role (the assignment editor edits by id); `assignment` carries slugs for display parity
|
|
591
|
+
* with UserPick. `disabled` is a boolean on the wire (0/1 in the row).
|
|
592
|
+
*/
|
|
593
|
+
interface UserDetail {
|
|
594
|
+
id: string;
|
|
595
|
+
username: string;
|
|
596
|
+
displayName: string | null;
|
|
597
|
+
name: string;
|
|
598
|
+
role: string;
|
|
599
|
+
disabled: boolean;
|
|
600
|
+
source: string;
|
|
601
|
+
hasPassword: boolean;
|
|
602
|
+
createdAt: number;
|
|
603
|
+
updatedAt: number | null;
|
|
604
|
+
assignment: {
|
|
605
|
+
services: string[];
|
|
606
|
+
groups: string[];
|
|
607
|
+
};
|
|
608
|
+
services: Array<{
|
|
609
|
+
serviceId: string;
|
|
610
|
+
role: string;
|
|
611
|
+
}>;
|
|
612
|
+
groups: Array<{
|
|
613
|
+
groupId: string;
|
|
614
|
+
role: string;
|
|
615
|
+
}>;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Contract for GET /api/observe/overview (CP7): the query the client may send and
|
|
620
|
+
* the response shape both sides type against. Framework-free (zod only) so it loads
|
|
621
|
+
* in node-env unit tests, the Nitro handler, and the browser composable alike.
|
|
622
|
+
*/
|
|
623
|
+
declare const overviewQuerySchema: z.ZodObject<{
|
|
624
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
625
|
+
"15m": "15m";
|
|
626
|
+
"1h": "1h";
|
|
627
|
+
"24h": "24h";
|
|
628
|
+
"7d": "7d";
|
|
629
|
+
"30d": "30d";
|
|
630
|
+
}>>;
|
|
631
|
+
service: z.ZodOptional<z.ZodString>;
|
|
632
|
+
group: z.ZodOptional<z.ZodString>;
|
|
633
|
+
}, z.core.$strip>;
|
|
634
|
+
type OverviewQuery = z.infer<typeof overviewQuerySchema>;
|
|
635
|
+
interface OverviewStats {
|
|
636
|
+
totalEvents: number;
|
|
637
|
+
errorCount: number;
|
|
638
|
+
/** errorCount / totalEvents, 0 when totalEvents === 0 */
|
|
639
|
+
errorRate: number;
|
|
640
|
+
warnCount: number;
|
|
641
|
+
activeServices: number;
|
|
642
|
+
activeVersions: number;
|
|
643
|
+
latestError?: {
|
|
644
|
+
time: number;
|
|
645
|
+
message: string;
|
|
646
|
+
name?: string;
|
|
647
|
+
/** human slug, falling back to the raw `app` column when service_id did not join */
|
|
648
|
+
service: string;
|
|
649
|
+
route?: string;
|
|
650
|
+
traceId?: string;
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
interface OverviewServiceRollup {
|
|
654
|
+
id: string;
|
|
655
|
+
slug: string;
|
|
656
|
+
name: string;
|
|
657
|
+
env?: string;
|
|
658
|
+
totalEvents: number;
|
|
659
|
+
errorCount: number;
|
|
660
|
+
errorRate: number;
|
|
661
|
+
warnCount: number;
|
|
662
|
+
lastSeen: number;
|
|
663
|
+
versions: string[];
|
|
664
|
+
}
|
|
665
|
+
interface OverviewActivityItem {
|
|
666
|
+
time: number;
|
|
667
|
+
level: number;
|
|
668
|
+
message: string;
|
|
669
|
+
/** human slug, falling back to the raw `app` column when service_id did not join */
|
|
670
|
+
service: string;
|
|
671
|
+
route?: string;
|
|
672
|
+
session?: string;
|
|
673
|
+
user?: string;
|
|
674
|
+
traceId?: string;
|
|
675
|
+
errorName?: string;
|
|
676
|
+
}
|
|
677
|
+
interface OverviewResponse {
|
|
678
|
+
period: {
|
|
679
|
+
from: number;
|
|
680
|
+
to: number;
|
|
681
|
+
label: string;
|
|
682
|
+
};
|
|
683
|
+
/** isAll=true for admin ('*'); serviceIds is [] then, not the full id list */
|
|
684
|
+
scope: {
|
|
685
|
+
serviceIds: string[];
|
|
686
|
+
isAll: boolean;
|
|
687
|
+
};
|
|
688
|
+
stats: OverviewStats;
|
|
689
|
+
services: OverviewServiceRollup[];
|
|
690
|
+
/** newest first, LIMIT 50 */
|
|
691
|
+
activity: OverviewActivityItem[];
|
|
692
|
+
}
|
|
693
|
+
/** The db-derived slice getOverview() assembles; the handler adds period + scope. */
|
|
694
|
+
type OverviewData = Pick<OverviewResponse, 'stats' | 'services' | 'activity'>;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Contract for GET /api/observe/stats (CP8): the bucketed time-series the charts
|
|
698
|
+
* render. Framework-free (zod only) so it loads in node-env unit tests, the Nitro
|
|
699
|
+
* handler, and the browser composable alike.
|
|
700
|
+
*/
|
|
701
|
+
declare const statsQuerySchema: z.ZodObject<{
|
|
702
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
703
|
+
"15m": "15m";
|
|
704
|
+
"1h": "1h";
|
|
705
|
+
"24h": "24h";
|
|
706
|
+
"7d": "7d";
|
|
707
|
+
"30d": "30d";
|
|
708
|
+
}>>;
|
|
709
|
+
service: z.ZodOptional<z.ZodString>;
|
|
710
|
+
group: z.ZodOptional<z.ZodString>;
|
|
711
|
+
version: z.ZodOptional<z.ZodString>;
|
|
712
|
+
level: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
713
|
+
bucketMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
714
|
+
}, z.core.$strip>;
|
|
715
|
+
type StatsQuery = z.infer<typeof statsQuerySchema>;
|
|
716
|
+
/** Legend entry for the per-service breakdown; the folded tail is { id: 'other', slug: 'other', name: 'Other' }. */
|
|
717
|
+
interface StatsSeriesMeta {
|
|
718
|
+
id: string;
|
|
719
|
+
slug: string;
|
|
720
|
+
name: string;
|
|
721
|
+
}
|
|
722
|
+
interface StatsBucket {
|
|
723
|
+
/** bucket start, ms epoch, aligned to floor(time / bucketMs) * bucketMs */
|
|
724
|
+
t: number;
|
|
725
|
+
count: number;
|
|
726
|
+
/** level = 0 */
|
|
727
|
+
errorCount: number;
|
|
728
|
+
/** level = 1 */
|
|
729
|
+
warnCount: number;
|
|
730
|
+
/** serviceId (or 'other') -> count; only top-N + 'other' keys present */
|
|
731
|
+
byService: Record<string, number>;
|
|
732
|
+
}
|
|
733
|
+
interface StatsResponse {
|
|
734
|
+
period: {
|
|
735
|
+
from: number;
|
|
736
|
+
to: number;
|
|
737
|
+
label: string;
|
|
738
|
+
};
|
|
739
|
+
/** isAll=true for admin ('*'); serviceIds is [] then, not the full id list */
|
|
740
|
+
scope: {
|
|
741
|
+
serviceIds: string[];
|
|
742
|
+
isAll: boolean;
|
|
743
|
+
};
|
|
744
|
+
bucketMs: number;
|
|
745
|
+
/** zero-filled, contiguous, ascending by t */
|
|
746
|
+
buckets: StatsBucket[];
|
|
747
|
+
/** legend for the breakdown chart: top-N by volume desc, + 'other' when folded */
|
|
748
|
+
services: StatsSeriesMeta[];
|
|
749
|
+
totals: {
|
|
750
|
+
count: number;
|
|
751
|
+
errorCount: number;
|
|
752
|
+
warnCount: number;
|
|
753
|
+
/** errorCount / count * 100, 0 when count === 0 */
|
|
754
|
+
errorRatePct: number;
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
/** The db-derived slice getStats() assembles; the handler adds period + scope + bucketMs. */
|
|
758
|
+
type StatsData = Pick<StatsResponse, 'buckets' | 'services' | 'totals'>;
|
|
759
|
+
|
|
760
|
+
declare const logsQuerySchema: z.ZodObject<{
|
|
761
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
762
|
+
"15m": "15m";
|
|
763
|
+
"1h": "1h";
|
|
764
|
+
"24h": "24h";
|
|
765
|
+
"7d": "7d";
|
|
766
|
+
"30d": "30d";
|
|
767
|
+
}>>;
|
|
768
|
+
service: z.ZodOptional<z.ZodString>;
|
|
769
|
+
group: z.ZodOptional<z.ZodString>;
|
|
770
|
+
levels: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<number[], string>>, z.ZodArray<z.ZodNumber>>>;
|
|
771
|
+
versions: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>, z.ZodArray<z.ZodString>>>;
|
|
772
|
+
route: z.ZodOptional<z.ZodString>;
|
|
773
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
774
|
+
q: z.ZodOptional<z.ZodString>;
|
|
775
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
776
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
777
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
778
|
+
}, z.core.$strip>;
|
|
779
|
+
type LogsQuery = z.infer<typeof logsQuerySchema>;
|
|
780
|
+
/** The facets endpoint narrows its version list by the same scope slugs. */
|
|
781
|
+
declare const logsFacetsQuerySchema: z.ZodObject<{
|
|
782
|
+
service: z.ZodOptional<z.ZodString>;
|
|
783
|
+
group: z.ZodOptional<z.ZodString>;
|
|
784
|
+
}, z.core.$strip>;
|
|
785
|
+
type LogsFacetsQuery = z.infer<typeof logsFacetsQuerySchema>;
|
|
786
|
+
interface LogListItem {
|
|
787
|
+
id: string;
|
|
788
|
+
time: number;
|
|
789
|
+
level: number;
|
|
790
|
+
message: string;
|
|
791
|
+
app: string;
|
|
792
|
+
version: string | null;
|
|
793
|
+
env: string | null;
|
|
794
|
+
service_id: string | null;
|
|
795
|
+
route: string | null;
|
|
796
|
+
feature: string | null;
|
|
797
|
+
error_name: string | null;
|
|
798
|
+
trace_id: string | null;
|
|
799
|
+
}
|
|
800
|
+
interface LogDetail {
|
|
801
|
+
id: string;
|
|
802
|
+
time: number;
|
|
803
|
+
received_at: number;
|
|
804
|
+
level: number;
|
|
805
|
+
message: string;
|
|
806
|
+
app: string;
|
|
807
|
+
version: string | null;
|
|
808
|
+
env: string | null;
|
|
809
|
+
service_id: string | null;
|
|
810
|
+
session: string | null;
|
|
811
|
+
user: string | null;
|
|
812
|
+
route: string | null;
|
|
813
|
+
feature: string | null;
|
|
814
|
+
error: {
|
|
815
|
+
name?: string;
|
|
816
|
+
message?: string;
|
|
817
|
+
stack?: string;
|
|
818
|
+
code?: string;
|
|
819
|
+
} | null;
|
|
820
|
+
trace: {
|
|
821
|
+
traceId?: string;
|
|
822
|
+
spanId?: string;
|
|
823
|
+
parentId?: string;
|
|
824
|
+
} | null;
|
|
825
|
+
tags: string[] | null;
|
|
826
|
+
ctx: Record<string, unknown> | null;
|
|
827
|
+
}
|
|
828
|
+
interface LogListResponse {
|
|
829
|
+
period: {
|
|
830
|
+
from: number;
|
|
831
|
+
to: number;
|
|
832
|
+
label: string;
|
|
833
|
+
};
|
|
834
|
+
rows: LogListItem[];
|
|
835
|
+
total: number;
|
|
836
|
+
limit: number;
|
|
837
|
+
offset: number;
|
|
838
|
+
}
|
|
839
|
+
interface LogsFacetsResponse {
|
|
840
|
+
versions: string[];
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Reassembles error/trace objects from the flat error and trace columns (null when
|
|
844
|
+
* every part is absent), JSON-parses tags/ctx inside a guard (malformed JSON -> null,
|
|
845
|
+
* never a 500), and passes `user` through (the SELECT alias already restored it).
|
|
846
|
+
* Pure, so it unit-tests in node env.
|
|
847
|
+
*/
|
|
848
|
+
declare function rowToDetail(row: LogRow): LogDetail;
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Contract for GET /api/observe/activity (CP10): the ranked "top endpoints/features
|
|
852
|
+
* being hit" list. A GROUP BY over the canonical route/feature columns of `logs`,
|
|
853
|
+
* scoped and time-bounded exactly like /stats. Framework-free (zod only) so it loads
|
|
854
|
+
* in node-env unit tests, the Nitro handler, and the browser composable alike.
|
|
855
|
+
*/
|
|
856
|
+
declare const ACTIVITY_DIMENSIONS: readonly ["auto", "route", "feature"];
|
|
857
|
+
type ActivityDimension = (typeof ACTIVITY_DIMENSIONS)[number];
|
|
858
|
+
declare const ACTIVITY_SORTS: readonly ["count", "errors", "errorRate", "lastSeen"];
|
|
859
|
+
type ActivitySort = (typeof ACTIVITY_SORTS)[number];
|
|
860
|
+
declare const activityQuerySchema: z.ZodObject<{
|
|
861
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
862
|
+
"15m": "15m";
|
|
863
|
+
"1h": "1h";
|
|
864
|
+
"24h": "24h";
|
|
865
|
+
"7d": "7d";
|
|
866
|
+
"30d": "30d";
|
|
867
|
+
}>>;
|
|
868
|
+
service: z.ZodOptional<z.ZodString>;
|
|
869
|
+
group: z.ZodOptional<z.ZodString>;
|
|
870
|
+
dimension: z.ZodDefault<z.ZodEnum<{
|
|
871
|
+
route: "route";
|
|
872
|
+
feature: "feature";
|
|
873
|
+
auto: "auto";
|
|
874
|
+
}>>;
|
|
875
|
+
env: z.ZodOptional<z.ZodString>;
|
|
876
|
+
level: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
877
|
+
q: z.ZodOptional<z.ZodString>;
|
|
878
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
879
|
+
count: "count";
|
|
880
|
+
errors: "errors";
|
|
881
|
+
errorRate: "errorRate";
|
|
882
|
+
lastSeen: "lastSeen";
|
|
883
|
+
}>>;
|
|
884
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
885
|
+
}, z.core.$strip>;
|
|
886
|
+
type ActivityQuery = z.infer<typeof activityQuerySchema>;
|
|
887
|
+
interface ActivityItem {
|
|
888
|
+
key: string;
|
|
889
|
+
/** which column the key came from; resolved per item in 'auto' (route wins) */
|
|
890
|
+
dim: 'route' | 'feature';
|
|
891
|
+
count: number;
|
|
892
|
+
/** rows with level = 0 (CP10 D1: same predicate as overview/stats) */
|
|
893
|
+
errors: number;
|
|
894
|
+
/** 0..1, computed server-side from the integer sums */
|
|
895
|
+
errorRate: number;
|
|
896
|
+
/** MAX(time), ms epoch */
|
|
897
|
+
lastSeen: number;
|
|
898
|
+
/** MIN(time), ms epoch */
|
|
899
|
+
firstSeen: number;
|
|
900
|
+
}
|
|
901
|
+
/** The db-derived slice getActivity() assembles; the handler adds the envelope. */
|
|
902
|
+
interface ActivityData {
|
|
903
|
+
items: ActivityItem[];
|
|
904
|
+
/** rows in scope+window+filters, keyed or not */
|
|
905
|
+
total: number;
|
|
906
|
+
/** rows carrying the selected dimension */
|
|
907
|
+
withKey: number;
|
|
908
|
+
/** total > 0 && withKey === 0: events exist but none carry the dimension (CP15 emit gap) */
|
|
909
|
+
degraded: boolean;
|
|
910
|
+
}
|
|
911
|
+
interface ActivityResponse extends ActivityData {
|
|
912
|
+
dimension: ActivityDimension;
|
|
913
|
+
period: {
|
|
914
|
+
from: number;
|
|
915
|
+
to: number;
|
|
916
|
+
label: string;
|
|
917
|
+
};
|
|
918
|
+
/** isAll=true for admin ('*'); serviceIds is [] then, not the full id list */
|
|
919
|
+
scope: {
|
|
920
|
+
serviceIds: string[];
|
|
921
|
+
isAll: boolean;
|
|
922
|
+
};
|
|
923
|
+
sort: ActivitySort;
|
|
924
|
+
limit: number;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Mirrored from frogger trace-headers.ts:63-79 (frogger is a read-only companion,
|
|
929
|
+
* not a dependency): rejects the all-zero id that the W3C spec forbids but the
|
|
930
|
+
* canonical zTraceContext regex alone would accept.
|
|
931
|
+
*/
|
|
932
|
+
declare function isValidTraceId(traceId: unknown): traceId is string;
|
|
933
|
+
declare const journeyQuerySchema: z.ZodObject<{
|
|
934
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
935
|
+
session: z.ZodOptional<z.ZodString>;
|
|
936
|
+
user: z.ZodOptional<z.ZodString>;
|
|
937
|
+
from: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
938
|
+
to: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
939
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
940
|
+
}, z.core.$strip>;
|
|
941
|
+
type JourneyQuery = z.infer<typeof journeyQuerySchema>;
|
|
942
|
+
type JourneyMode = 'trace' | 'session' | 'user';
|
|
943
|
+
/** Resolve which mode a validated query is in (exactly one selector guaranteed by the refine). */
|
|
944
|
+
declare function journeyMode(q: JourneyQuery): {
|
|
945
|
+
mode: JourneyMode;
|
|
946
|
+
key: string;
|
|
947
|
+
};
|
|
948
|
+
/** The selector param name each mode maps to on the wire (trace -> traceId). */
|
|
949
|
+
declare const MODE_PARAM: Record<JourneyMode, 'traceId' | 'session' | 'user'>;
|
|
950
|
+
interface JourneyEvent {
|
|
951
|
+
id: string;
|
|
952
|
+
time: number;
|
|
953
|
+
offsetMs: number;
|
|
954
|
+
level: number;
|
|
955
|
+
message: string;
|
|
956
|
+
app: string;
|
|
957
|
+
version: string | null;
|
|
958
|
+
service_id: string | null;
|
|
959
|
+
route: string | null;
|
|
960
|
+
feature: string | null;
|
|
961
|
+
session: string | null;
|
|
962
|
+
error: {
|
|
963
|
+
name?: string;
|
|
964
|
+
message?: string;
|
|
965
|
+
code?: string;
|
|
966
|
+
} | null;
|
|
967
|
+
traceId: string | null;
|
|
968
|
+
spanId: string | null;
|
|
969
|
+
parentId: string | null;
|
|
970
|
+
hasTrace: boolean;
|
|
971
|
+
hasParent: boolean;
|
|
972
|
+
}
|
|
973
|
+
interface JourneyStats {
|
|
974
|
+
count: number;
|
|
975
|
+
start: number | null;
|
|
976
|
+
end: number | null;
|
|
977
|
+
durationMs: number;
|
|
978
|
+
services: string[];
|
|
979
|
+
levels: Record<string, number>;
|
|
980
|
+
}
|
|
981
|
+
type JourneyReason = 'empty' | 'missing-correlation' | 'dangling-parent' | 'truncated';
|
|
982
|
+
interface JourneyResponse {
|
|
983
|
+
mode: JourneyMode;
|
|
984
|
+
key: string;
|
|
985
|
+
partial: boolean;
|
|
986
|
+
reasons: JourneyReason[];
|
|
987
|
+
stats: JourneyStats;
|
|
988
|
+
events: JourneyEvent[];
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Aggregate over an already-ordered journey. Pure (uses only the levels.ts name
|
|
992
|
+
* map), so it unit-tests in node env alongside buildSpanTree/detectPartial.
|
|
993
|
+
*/
|
|
994
|
+
declare function computeJourneyStats(events: JourneyEvent[]): JourneyStats;
|
|
995
|
+
/**
|
|
996
|
+
* Flags the ways a journey can be an incomplete picture, so the page can signal
|
|
997
|
+
* it honestly rather than look broken. `hitLimit` is passed in (the DB layer
|
|
998
|
+
* knows whether the row count reached the scan cap).
|
|
999
|
+
*/
|
|
1000
|
+
declare function detectPartial(events: JourneyEvent[], hitLimit: boolean): {
|
|
1001
|
+
partial: boolean;
|
|
1002
|
+
reasons: JourneyReason[];
|
|
1003
|
+
};
|
|
1004
|
+
interface SpanNode {
|
|
1005
|
+
event: JourneyEvent;
|
|
1006
|
+
children: SpanNode[];
|
|
1007
|
+
depth: number;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Links parentId -> spanId into a forest for the trace-mode waterfall. Session/
|
|
1011
|
+
* user modes render a flat chronological list instead and do NOT call this.
|
|
1012
|
+
*
|
|
1013
|
+
* Edge cases: an event with no spanId becomes its own root; a dangling parentId
|
|
1014
|
+
* (parent not in the set) promotes the node to a root lane; a parentId cycle
|
|
1015
|
+
* cannot form a tree because a child is only ever attached to a parent already
|
|
1016
|
+
* in `bySpan` and no node is re-parented after placement; a duplicate spanId
|
|
1017
|
+
* (retries) is last-writer-wins in the map, which is acceptable here.
|
|
1018
|
+
*/
|
|
1019
|
+
declare function buildSpanTree(events: JourneyEvent[]): SpanNode[];
|
|
1020
|
+
/** Depth-first flatten of the span forest into render rows, tree order preserved. */
|
|
1021
|
+
declare function flattenSpanTree(roots: SpanNode[]): Array<{
|
|
1022
|
+
event: JourneyEvent;
|
|
1023
|
+
depth: number;
|
|
1024
|
+
}>;
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Contract for GET /api/observe/rollout/{versions,compare,regressions} (CP13): the
|
|
1028
|
+
* per-version rollout view. Framework-free (zod only + pure fns) so it loads in
|
|
1029
|
+
* node-env unit tests, the Nitro handlers, and the browser composable alike. The DB
|
|
1030
|
+
* query builders live in server/utils/rollout.ts; everything here is pure, matching
|
|
1031
|
+
* the CP12 precedent of keeping node-testable algorithms in shared/schema/*.
|
|
1032
|
+
*
|
|
1033
|
+
* NULL `version` is folded under the '(unversioned)' sentinel everywhere (SQL COALESCE
|
|
1034
|
+
* on the query side, and this constant on the algorithm side) so a NULL never fragments
|
|
1035
|
+
* or vanishes from a GROUP BY.
|
|
1036
|
+
*/
|
|
1037
|
+
declare const UNVERSIONED = "(unversioned)";
|
|
1038
|
+
declare const rolloutQuerySchema: z.ZodObject<{
|
|
1039
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
1040
|
+
"15m": "15m";
|
|
1041
|
+
"1h": "1h";
|
|
1042
|
+
"24h": "24h";
|
|
1043
|
+
"7d": "7d";
|
|
1044
|
+
"30d": "30d";
|
|
1045
|
+
}>>;
|
|
1046
|
+
service: z.ZodOptional<z.ZodString>;
|
|
1047
|
+
group: z.ZodOptional<z.ZodString>;
|
|
1048
|
+
env: z.ZodOptional<z.ZodString>;
|
|
1049
|
+
bucketMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
1050
|
+
}, z.core.$strip>;
|
|
1051
|
+
type RolloutQuery = z.infer<typeof rolloutQuerySchema>;
|
|
1052
|
+
interface VersionStat {
|
|
1053
|
+
/** '(unversioned)' for NULL */
|
|
1054
|
+
version: string;
|
|
1055
|
+
total: number;
|
|
1056
|
+
/** level = 0 count */
|
|
1057
|
+
errors: number;
|
|
1058
|
+
/** errors / total, 0 when total === 0 */
|
|
1059
|
+
errorRate: number;
|
|
1060
|
+
/** MIN(time) */
|
|
1061
|
+
firstSeen: number;
|
|
1062
|
+
/** MAX(time) */
|
|
1063
|
+
lastSeen: number;
|
|
1064
|
+
}
|
|
1065
|
+
interface VersionSeries {
|
|
1066
|
+
version: string;
|
|
1067
|
+
/** per-bucket event count, aligned to `buckets`, zero-filled */
|
|
1068
|
+
volume: number[];
|
|
1069
|
+
/** per-bucket errors/total, aligned to `buckets`, 0 for empty buckets */
|
|
1070
|
+
errorRate: number[];
|
|
1071
|
+
}
|
|
1072
|
+
interface VersionCompare {
|
|
1073
|
+
/** contiguous ascending bucket start times, ms epoch */
|
|
1074
|
+
buckets: number[];
|
|
1075
|
+
/** one series per distinct version, volume-desc then version-asc for stable ordering */
|
|
1076
|
+
series: VersionSeries[];
|
|
1077
|
+
}
|
|
1078
|
+
/** Flat grouped row from the CP8-shaped bucketed query, pre-pivot. */
|
|
1079
|
+
interface VersionSeriesRow {
|
|
1080
|
+
b: number;
|
|
1081
|
+
version: string;
|
|
1082
|
+
total: number;
|
|
1083
|
+
errors: number | null;
|
|
1084
|
+
}
|
|
1085
|
+
interface RegressionConfig {
|
|
1086
|
+
/** ignore any version below this sample size */
|
|
1087
|
+
minEvents: number;
|
|
1088
|
+
/** absolute error-rate increase threshold (e.g. 0.05) */
|
|
1089
|
+
errorRateDelta: number;
|
|
1090
|
+
/** relative threshold (e.g. 1.5x baseline) */
|
|
1091
|
+
errorRateMultiplier: number;
|
|
1092
|
+
/** candidate must be first-seen within this of `now`; omit to skip the freshness gate */
|
|
1093
|
+
baselineWindowMs?: number;
|
|
1094
|
+
}
|
|
1095
|
+
interface RegressionFinding {
|
|
1096
|
+
version: string;
|
|
1097
|
+
errorRate: number;
|
|
1098
|
+
baselineVersion: string | null;
|
|
1099
|
+
baselineErrorRate: number;
|
|
1100
|
+
/** candidate.errorRate - baseline.errorRate */
|
|
1101
|
+
delta: number;
|
|
1102
|
+
/** candidate.errorRate / baseline.errorRate (Infinity when baseline has zero errors) */
|
|
1103
|
+
ratio: number;
|
|
1104
|
+
/** candidate.total */
|
|
1105
|
+
sampleSize: number;
|
|
1106
|
+
severity: 'warn' | 'critical';
|
|
1107
|
+
}
|
|
1108
|
+
interface RegressionResponse {
|
|
1109
|
+
/** false when the single ?service has version_tracking = 0 */
|
|
1110
|
+
trackingEnabled: boolean;
|
|
1111
|
+
findings: RegressionFinding[];
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Pivot flat {b, version, total, errors} rows into a chart-ready {buckets, series}.
|
|
1115
|
+
* Pure + DB-free: the bucket-index math mirrors zeroFilledBuckets (floor(time/bucketMs))
|
|
1116
|
+
* but is inlined so this stays free of any server import. Every series is the same
|
|
1117
|
+
* length and aligns to the shared `buckets` x-axis; gaps are zero-filled.
|
|
1118
|
+
*/
|
|
1119
|
+
declare function pivotVersionSeries(rows: VersionSeriesRow[], from: number, to: number, bucketMs: number): VersionCompare;
|
|
1120
|
+
/**
|
|
1121
|
+
* Deterministic baseline-vs-candidate regression flag. Pure: `now` is injected so
|
|
1122
|
+
* tests are stable and no wall-clock read happens inside. The candidate is the
|
|
1123
|
+
* newest-by-firstSeen versioned build; the baseline is the highest-volume build that
|
|
1124
|
+
* appeared strictly earlier. A spike is flagged only when the candidate clears BOTH
|
|
1125
|
+
* the absolute delta and the relative multiplier over that baseline.
|
|
1126
|
+
*/
|
|
1127
|
+
declare function detectRegressions(stats: VersionStat[], config: RegressionConfig, now: number): RegressionFinding[];
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Stable error fingerprinting (CP14): a deterministic hash of the normalized
|
|
1131
|
+
* stack top-frames + templatized message + code + name. Co-located under
|
|
1132
|
+
* shared/schema/ next to journey.ts / logs-query.ts (pure fns + types beside the
|
|
1133
|
+
* barrel). The ONLY input is the first-class CanonicalEvent.error object.
|
|
1134
|
+
*
|
|
1135
|
+
* `node:crypto` makes this server-only in practice (ingest, backfill, tests are
|
|
1136
|
+
* all node). It is re-exported from #observe/schema, but Vite tree-shakes an
|
|
1137
|
+
* uncalled value export, so no client bundle pulls in `node:crypto` as long as
|
|
1138
|
+
* no client code CALLS fingerprintError (CP14-HANDOFF R1).
|
|
1139
|
+
*/
|
|
1140
|
+
interface FingerprintResult {
|
|
1141
|
+
/** `v1:` + 16 lowercase hex */
|
|
1142
|
+
fingerprint: string;
|
|
1143
|
+
/** algorithm version, always 'v1' here */
|
|
1144
|
+
version: string;
|
|
1145
|
+
normalizedMessage: string;
|
|
1146
|
+
/** the normalized top-N frames actually used (empty when no usable stack) */
|
|
1147
|
+
frames: string[];
|
|
1148
|
+
}
|
|
1149
|
+
interface ErrorLike {
|
|
1150
|
+
name?: string;
|
|
1151
|
+
message?: string;
|
|
1152
|
+
stack?: string;
|
|
1153
|
+
code?: string | number;
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Collapse dynamic values in a message to fixed placeholders so two occurrences of
|
|
1157
|
+
* the same logical error (different ids/numbers/paths) hash identically. Applied in
|
|
1158
|
+
* order: timestamps, then uuids, then long hex blobs, then urls/paths, then quoted
|
|
1159
|
+
* literals, then bare numbers. The order matters (a timestamp contains digits a bare
|
|
1160
|
+
* number rule would otherwise shred first).
|
|
1161
|
+
*/
|
|
1162
|
+
declare function normalizeMessage(message: string): string;
|
|
1163
|
+
/**
|
|
1164
|
+
* Reduce one V8 stack frame to a stable `func (basename)` (or just `basename`) token:
|
|
1165
|
+
* keep the function name + the file basename, drop `:line:col`, collapse a bundle chunk
|
|
1166
|
+
* hash (`app.ab12cd.js` -> `app.js`), and drop anonymous / eval / native frames. Returns
|
|
1167
|
+
* null for a line that is not a usable frame.
|
|
1168
|
+
*/
|
|
1169
|
+
declare function normalizeFrame(line: string): string | null;
|
|
1170
|
+
/** Top-N usable frames from a raw stack; [] when absent or fully unusable. */
|
|
1171
|
+
declare function normalizeStack(stack: string | undefined, topFrames: number): string[];
|
|
1172
|
+
/**
|
|
1173
|
+
* Compute a stable fingerprint for an error. The hash input is, in this exact field
|
|
1174
|
+
* order: `name | code | normalizedMessage | frames.join('\n')`, sha1-hexed, first 16
|
|
1175
|
+
* chars, prefixed `v1:`. When the stack is absent or yields no usable frames, the
|
|
1176
|
+
* fingerprint falls back to name + code + normalizedMessage only (frames = []), which
|
|
1177
|
+
* is still deterministic.
|
|
1178
|
+
*/
|
|
1179
|
+
declare function fingerprintError(err: ErrorLike, opts?: {
|
|
1180
|
+
topFrames?: number;
|
|
1181
|
+
}): FingerprintResult;
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* Contract for the error dashboard (CP14): the query schemas behind
|
|
1185
|
+
* GET /api/observe/errors + /errors/:fingerprint, the wire shapes, and the pure
|
|
1186
|
+
* query-time regression heuristic. Framework-free (zod v4 only + pure fns) so it
|
|
1187
|
+
* loads in node-env unit tests, the Nitro handlers, and the browser composable
|
|
1188
|
+
* alike, mirroring logs-query.ts / rollout.ts. The fingerprint hash itself lives in
|
|
1189
|
+
* error-fingerprint.ts (server-only, node:crypto); nothing here imports it.
|
|
1190
|
+
*/
|
|
1191
|
+
declare const NULL_VERSION = "(unversioned)";
|
|
1192
|
+
/** How the grouped list is ordered; each maps to a fixed, never-interpolated column. */
|
|
1193
|
+
declare const ERROR_SORTS: readonly ["recent", "count", "first"];
|
|
1194
|
+
type ErrorSort = (typeof ERROR_SORTS)[number];
|
|
1195
|
+
declare const errorsQuerySchema: z.ZodObject<{
|
|
1196
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
1197
|
+
"15m": "15m";
|
|
1198
|
+
"1h": "1h";
|
|
1199
|
+
"24h": "24h";
|
|
1200
|
+
"7d": "7d";
|
|
1201
|
+
"30d": "30d";
|
|
1202
|
+
}>>;
|
|
1203
|
+
service: z.ZodOptional<z.ZodString>;
|
|
1204
|
+
group: z.ZodOptional<z.ZodString>;
|
|
1205
|
+
app: z.ZodOptional<z.ZodString>;
|
|
1206
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1207
|
+
env: z.ZodOptional<z.ZodString>;
|
|
1208
|
+
level: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
1209
|
+
q: z.ZodOptional<z.ZodString>;
|
|
1210
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
1211
|
+
count: "count";
|
|
1212
|
+
recent: "recent";
|
|
1213
|
+
first: "first";
|
|
1214
|
+
}>>;
|
|
1215
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1216
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1217
|
+
}, z.core.$strip>;
|
|
1218
|
+
type ErrorsQuery = z.infer<typeof errorsQuerySchema>;
|
|
1219
|
+
/** The drill-down route: same window/scope selectors plus the occurrences pager. */
|
|
1220
|
+
declare const errorDetailQuerySchema: z.ZodObject<{
|
|
1221
|
+
period: z.ZodDefault<z.ZodEnum<{
|
|
1222
|
+
"15m": "15m";
|
|
1223
|
+
"1h": "1h";
|
|
1224
|
+
"24h": "24h";
|
|
1225
|
+
"7d": "7d";
|
|
1226
|
+
"30d": "30d";
|
|
1227
|
+
}>>;
|
|
1228
|
+
service: z.ZodOptional<z.ZodString>;
|
|
1229
|
+
group: z.ZodOptional<z.ZodString>;
|
|
1230
|
+
bucketMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
1231
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1232
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1233
|
+
}, z.core.$strip>;
|
|
1234
|
+
type ErrorDetailQuery = z.infer<typeof errorDetailQuerySchema>;
|
|
1235
|
+
interface ErrorGroup {
|
|
1236
|
+
fingerprint: string;
|
|
1237
|
+
count: number;
|
|
1238
|
+
firstSeen: number;
|
|
1239
|
+
lastSeen: number;
|
|
1240
|
+
/** MIN(level): 0 = error is MOST severe, so a group's headline is its minimum level */
|
|
1241
|
+
worstLevel: number;
|
|
1242
|
+
/** COUNT(DISTINCT app) */
|
|
1243
|
+
serviceCount: number;
|
|
1244
|
+
/** distinct source apps, split from GROUP_CONCAT */
|
|
1245
|
+
apps: string[];
|
|
1246
|
+
/** distinct versions, split from GROUP_CONCAT */
|
|
1247
|
+
versions: string[];
|
|
1248
|
+
/** representative name/message from the latest occurrence (null when never set) */
|
|
1249
|
+
name: string | null;
|
|
1250
|
+
message: string | null;
|
|
1251
|
+
/** query-time gap-heuristic flag (CP14 §6); never stored */
|
|
1252
|
+
regressed: boolean;
|
|
1253
|
+
}
|
|
1254
|
+
interface ErrorGroupsResponse {
|
|
1255
|
+
period: {
|
|
1256
|
+
from: number;
|
|
1257
|
+
to: number;
|
|
1258
|
+
label: string;
|
|
1259
|
+
};
|
|
1260
|
+
groups: ErrorGroup[];
|
|
1261
|
+
total: number;
|
|
1262
|
+
limit: number;
|
|
1263
|
+
offset: number;
|
|
1264
|
+
}
|
|
1265
|
+
interface ErrorVersionBreakdown {
|
|
1266
|
+
/** '(unversioned)' for NULL */
|
|
1267
|
+
version: string;
|
|
1268
|
+
count: number;
|
|
1269
|
+
}
|
|
1270
|
+
interface ErrorServiceBreakdown {
|
|
1271
|
+
serviceId: string | null;
|
|
1272
|
+
slug: string | null;
|
|
1273
|
+
name: string | null;
|
|
1274
|
+
count: number;
|
|
1275
|
+
}
|
|
1276
|
+
interface ErrorGroupHeader extends ErrorGroup {
|
|
1277
|
+
/** representative error code from the latest occurrence */
|
|
1278
|
+
code: string | null;
|
|
1279
|
+
}
|
|
1280
|
+
interface ErrorGroupDetailResponse {
|
|
1281
|
+
period: {
|
|
1282
|
+
from: number;
|
|
1283
|
+
to: number;
|
|
1284
|
+
label: string;
|
|
1285
|
+
};
|
|
1286
|
+
header: ErrorGroupHeader;
|
|
1287
|
+
bucketMs: number;
|
|
1288
|
+
/** zero-filled occurrences-over-time, StatsBucket-shaped so it feeds ObserveVolumeChart */
|
|
1289
|
+
series: StatsBucket[];
|
|
1290
|
+
versions: ErrorVersionBreakdown[];
|
|
1291
|
+
services: ErrorServiceBreakdown[];
|
|
1292
|
+
occurrences: LogListItem[];
|
|
1293
|
+
occurrencesTotal: number;
|
|
1294
|
+
limit: number;
|
|
1295
|
+
offset: number;
|
|
1296
|
+
}
|
|
1297
|
+
interface RegressionThresholds {
|
|
1298
|
+
/** a group is "active now" when its lastSeen is within this of `now` (default 24h) */
|
|
1299
|
+
activeWindowMs: number;
|
|
1300
|
+
/** the silent gap before the active window that qualifies as a regression (default 72h) */
|
|
1301
|
+
regressionGapMs: number;
|
|
1302
|
+
}
|
|
1303
|
+
declare const DEFAULT_REGRESSION_THRESHOLDS: RegressionThresholds;
|
|
1304
|
+
/**
|
|
1305
|
+
* Query-time regression flag (CP14 §6), pure over the conditional aggregates the group
|
|
1306
|
+
* query returns. A group is regressed when it is active now AND it returned after a
|
|
1307
|
+
* silent gap. A brand-new error has no `prevBeforeActive` and so can never false-positive.
|
|
1308
|
+
*/
|
|
1309
|
+
declare function isRegressed(row: {
|
|
1310
|
+
lastSeen: number;
|
|
1311
|
+
firstInActive: number | null;
|
|
1312
|
+
prevBeforeActive: number | null;
|
|
1313
|
+
}, thresholds: RegressionThresholds, now: number): boolean;
|
|
1314
|
+
/** Split a SQLite GROUP_CONCAT(DISTINCT ...) result into a clean array (NULLs already dropped). */
|
|
1315
|
+
declare function splitConcat(value: string | null | undefined): string[];
|
|
1316
|
+
|
|
1317
|
+
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 };
|
|
1318
|
+
export type { ActivityData, ActivityDimension, ActivityItem, ActivityQuery, ActivityResponse, ActivitySort, CanonicalBatch, CanonicalEvent, CanonicalLevel, CanonicalLevelName, ErrorDetailQuery, ErrorGroup, ErrorGroupDetailResponse, ErrorGroupHeader, ErrorGroupsResponse, ErrorInfo, ErrorLike, ErrorServiceBreakdown, ErrorSort, ErrorVersionBreakdown, ErrorsQuery, EventSource, FingerprintResult, FroggerBatchInput, FroggerFieldMap, FroggerLogInput, GroupCreate, GroupListItem, GroupMembership, GroupSeed, JourneyEvent, JourneyMode, JourneyQuery, JourneyReason, JourneyResponse, JourneyStats, KeyCreate, KeyMeta, LogDetail, LogListItem, LogListResponse, LogRow, LogsFacetsQuery, LogsFacetsResponse, LogsQuery, MintedKey, ObserveSeedConfig, OverviewActivityItem, OverviewData, OverviewQuery, OverviewResponse, OverviewServiceRollup, OverviewStats, RegressionConfig, RegressionFinding, RegressionResponse, RegressionThresholds, RolloutQuery, ServiceCreate, ServiceDetail, ServiceKind, ServiceListItem, ServiceSeed, ServiceType, ServiceUpdate, SpanNode, StatsBucket, StatsData, StatsQuery, StatsResponse, StatsSeriesMeta, Tier, TraceContextInfo, UserDetail, UserPick, VersionCompare, VersionSeries, VersionSeriesRow, VersionStat };
|