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,5 @@
|
|
|
1
|
+
import type { CanonicalEvent } from './event.js';
|
|
2
|
+
export declare const PROGRESSIVE_TIERS: readonly ["stream", "grouping", "journey", "activity", "rollout"];
|
|
3
|
+
export type Tier = (typeof PROGRESSIVE_TIERS)[number];
|
|
4
|
+
/** Which tiers a given event satisfies. `stream` is always included for a valid event. */
|
|
5
|
+
export declare function classifyTiers(event: CanonicalEvent): Tier[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const PROGRESSIVE_TIERS = ["stream", "grouping", "journey", "activity", "rollout"];
|
|
2
|
+
export function classifyTiers(event) {
|
|
3
|
+
const tiers = ["stream"];
|
|
4
|
+
if (event.error) tiers.push("grouping");
|
|
5
|
+
if (event.trace?.traceId) tiers.push("journey");
|
|
6
|
+
if (event.session || event.route || event.feature) tiers.push("activity");
|
|
7
|
+
if (event.source?.version) tiers.push("rollout");
|
|
8
|
+
return tiers;
|
|
9
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { ServiceSeed, GroupSeed } from '../schema/registry.js';
|
|
2
|
+
import type { ObserveUser } from '../auth/schema.js';
|
|
3
|
+
export interface ModuleOptions {
|
|
4
|
+
/** Dashboard mount path. @default '/observe' */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** Log/metric retention window in days. @default 30 */
|
|
7
|
+
retentionDays?: number;
|
|
8
|
+
/** SQLite storage location (relative to project root). */
|
|
9
|
+
database?: {
|
|
10
|
+
/** @default '.data/observe.sqlite3' */
|
|
11
|
+
path?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Service registry seed: upserted by slug at boot. */
|
|
14
|
+
services?: ServiceSeed[];
|
|
15
|
+
/** Group seed: upserted by slug at boot. */
|
|
16
|
+
groups?: GroupSeed[];
|
|
17
|
+
/** Ingest endpoint tuning. */
|
|
18
|
+
ingest?: {
|
|
19
|
+
/**
|
|
20
|
+
* Public base URL of this dashboard's ingest endpoint, for reverse-proxied installs
|
|
21
|
+
* where the request host differs from the URL clients should POST to. Used to build
|
|
22
|
+
* the copy-paste key snippet. Falls back to the request origin when unset.
|
|
23
|
+
*/
|
|
24
|
+
ingestBaseUrl?: string;
|
|
25
|
+
/** Max request bytes (content-length) before 413. @default 1048576 (1 MiB) */
|
|
26
|
+
maxBytes?: number;
|
|
27
|
+
/** Max events per batch before 413 (canonical cap rides zod at 500). @default 500 */
|
|
28
|
+
maxEvents?: number;
|
|
29
|
+
/**
|
|
30
|
+
* CORS policy for the public ingest routes. Per-service `kind`/`allowedOrigins`
|
|
31
|
+
* drive the origin dynamically; these values are the fallback when a request
|
|
32
|
+
* resolves no browser service. `origin` defaults to `[]` (no cross-origin grant
|
|
33
|
+
* unless a service opts in); set `'*'` to restore a global collector.
|
|
34
|
+
*/
|
|
35
|
+
cors?: {
|
|
36
|
+
origin?: string | string[];
|
|
37
|
+
methods?: string[];
|
|
38
|
+
allowHeaders?: string[];
|
|
39
|
+
maxAge?: string;
|
|
40
|
+
};
|
|
41
|
+
/** Optional per-service ingest rate limit (in-memory token bucket). Off unless set. */
|
|
42
|
+
rateLimit?: {
|
|
43
|
+
perServicePerMinute?: number;
|
|
44
|
+
burst?: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Phase-1 auth (CP5). Provider selection + config-seeded dashboard users.
|
|
49
|
+
* `users` is the single, unified user seed surface — it powers the config
|
|
50
|
+
* provider now and, in CP16, seeds the DB-provider's gated bootstrap-admin
|
|
51
|
+
* fallback (see src/runtime/shared/auth/roles.ts). There is no separate
|
|
52
|
+
* top-level `users` list.
|
|
53
|
+
*/
|
|
54
|
+
auth?: {
|
|
55
|
+
/** @default 'config' */
|
|
56
|
+
provider?: 'config' | 'db' | 'jwt';
|
|
57
|
+
/** Config-seeded users, validated with observeUserSchema at build time. */
|
|
58
|
+
users?: ObserveUser[];
|
|
59
|
+
/**
|
|
60
|
+
* External-JWT VERIFICATION config (CP16). Verify only, never issue. Secrets live in
|
|
61
|
+
* server-only runtimeConfig, backed by env (NUXT_OBSERVE_AUTH_JWT_SECRET /
|
|
62
|
+
* NUXT_OBSERVE_AUTH_JWT_PUBLIC_KEY). When `enabled`, a valid `Authorization: Bearer`
|
|
63
|
+
* token authenticates any /api/observe/* route statelessly, regardless of `provider`.
|
|
64
|
+
*/
|
|
65
|
+
jwt?: {
|
|
66
|
+
/** Turns the Bearer fallback + the `jwt` provider on. @default false */
|
|
67
|
+
enabled?: boolean;
|
|
68
|
+
/** Accepted signing algorithms. @default ['HS256'] */
|
|
69
|
+
algorithms?: Array<'HS256' | 'RS256'>;
|
|
70
|
+
/** HS256 shared secret (or via NUXT_OBSERVE_AUTH_JWT_SECRET). */
|
|
71
|
+
secret?: string;
|
|
72
|
+
/** RS256 SPKI public key (or via NUXT_OBSERVE_AUTH_JWT_PUBLIC_KEY). */
|
|
73
|
+
publicKey?: string;
|
|
74
|
+
/** RS256 remote JWKS endpoint (alternative to a static publicKey). */
|
|
75
|
+
jwksUri?: string;
|
|
76
|
+
issuer?: string;
|
|
77
|
+
audience?: string;
|
|
78
|
+
/** Clock-skew allowance, e.g. '60s'. */
|
|
79
|
+
clockTolerance?: string;
|
|
80
|
+
/** Claim carrying the role. @default 'observe_role' */
|
|
81
|
+
roleClaim?: string;
|
|
82
|
+
/** Claim carrying the subject. @default 'sub' */
|
|
83
|
+
subjectClaim?: string;
|
|
84
|
+
/** Claim carrying the { services, groups } slug assignment (token source). @default 'observe_assignment' */
|
|
85
|
+
assignmentsClaim?: string;
|
|
86
|
+
/** Maps a raw role claim value to an observe Role. Unmapped => 'viewer'. */
|
|
87
|
+
roleMap?: Record<string, 'admin' | 'manager' | 'viewer'>;
|
|
88
|
+
/** Where role/assignment come from: the token itself, or the DB identity it maps to. @default 'token' */
|
|
89
|
+
claimsSource?: 'token' | 'db';
|
|
90
|
+
};
|
|
91
|
+
/** Optional session cookie overrides passed to nuxt-auth-utils. */
|
|
92
|
+
session?: {
|
|
93
|
+
maxAge?: number;
|
|
94
|
+
name?: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export declare const DEFAULT_PREFIX = "/observe";
|
|
99
|
+
export declare const OBSERVE_API_BASE = "/api/observe";
|
|
100
|
+
export declare const OBSERVE_INGEST_ROUTE = "/api/observe/ingest";
|
|
101
|
+
export declare const DEFAULT_DATABASE_PATH = ".data/observe.sqlite3";
|
|
102
|
+
export declare const DEFAULT_MAX_INGEST_BYTES = 1048576;
|
|
103
|
+
export declare const DEFAULT_MAX_INGEST_EVENTS = 500;
|
|
104
|
+
/** defu-mergeable defaults. Deep so `database`/`ingest` merge rather than replace. */
|
|
105
|
+
export declare const DEFAULT_OPTIONS: {
|
|
106
|
+
prefix: string;
|
|
107
|
+
retentionDays: number;
|
|
108
|
+
database: {
|
|
109
|
+
path: string;
|
|
110
|
+
};
|
|
111
|
+
ingest: {
|
|
112
|
+
maxBytes: number;
|
|
113
|
+
maxEvents: number;
|
|
114
|
+
};
|
|
115
|
+
auth: {
|
|
116
|
+
provider: "config";
|
|
117
|
+
users: never[];
|
|
118
|
+
};
|
|
119
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const DEFAULT_PREFIX = "/observe";
|
|
2
|
+
export const OBSERVE_API_BASE = "/api/observe";
|
|
3
|
+
export const OBSERVE_INGEST_ROUTE = "/api/observe/ingest";
|
|
4
|
+
export const DEFAULT_DATABASE_PATH = ".data/observe.sqlite3";
|
|
5
|
+
export const DEFAULT_MAX_INGEST_BYTES = 1048576;
|
|
6
|
+
export const DEFAULT_MAX_INGEST_EVENTS = 500;
|
|
7
|
+
export const DEFAULT_OPTIONS = {
|
|
8
|
+
prefix: DEFAULT_PREFIX,
|
|
9
|
+
retentionDays: 30,
|
|
10
|
+
database: { path: DEFAULT_DATABASE_PATH },
|
|
11
|
+
ingest: { maxBytes: DEFAULT_MAX_INGEST_BYTES, maxEvents: DEFAULT_MAX_INGEST_EVENTS },
|
|
12
|
+
auth: { provider: "config", users: [] }
|
|
13
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query filter for the logs table. Minimal in CP2 (enough to verify ingest);
|
|
3
|
+
* CP3 reuses and extends this for the analytical query helpers.
|
|
4
|
+
*/
|
|
5
|
+
export interface LogFilter {
|
|
6
|
+
from?: number;
|
|
7
|
+
to?: number;
|
|
8
|
+
level?: number;
|
|
9
|
+
minLevel?: number;
|
|
10
|
+
app?: string;
|
|
11
|
+
serviceId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* RBAC scope set (CP6): ANDs `service_id IN (...)` onto the query. `'*'` or absent means
|
|
14
|
+
* no scope restriction (admin); `[]` matches nothing (empty assignment -> zero rows).
|
|
15
|
+
* Callers pass the result of `getAllowedServiceIds` straight through.
|
|
16
|
+
*/
|
|
17
|
+
serviceIds?: string[] | '*';
|
|
18
|
+
traceId?: string;
|
|
19
|
+
session?: string;
|
|
20
|
+
user?: string;
|
|
21
|
+
errorFingerprint?: string;
|
|
22
|
+
route?: string;
|
|
23
|
+
feature?: string;
|
|
24
|
+
version?: string;
|
|
25
|
+
levels?: number[];
|
|
26
|
+
versions?: string[];
|
|
27
|
+
q?: string;
|
|
28
|
+
limit?: number;
|
|
29
|
+
offset?: number;
|
|
30
|
+
order?: 'asc' | 'desc';
|
|
31
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dashboard's WHEN helper: a compact relative timestamp for feed rows and stat
|
|
3
|
+
* cards. Pure and `now`-injectable so SSR and client render the same string for the
|
|
4
|
+
* same instant. Past ~30 days a relative label stops being useful; fall back to a
|
|
5
|
+
* locale date.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatRelative(ms: number, now?: number): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const MINUTE_MS = 6e4;
|
|
2
|
+
const HOUR_MS = 36e5;
|
|
3
|
+
const DAY_MS = 864e5;
|
|
4
|
+
export function formatRelative(ms, now = Date.now()) {
|
|
5
|
+
const delta = now - ms;
|
|
6
|
+
if (delta < MINUTE_MS) return "just now";
|
|
7
|
+
if (delta < HOUR_MS) return `${Math.floor(delta / MINUTE_MS)}m ago`;
|
|
8
|
+
if (delta < DAY_MS) return `${Math.floor(delta / HOUR_MS)}h ago`;
|
|
9
|
+
if (delta < 30 * DAY_MS) return `${Math.floor(delta / DAY_MS)}d ago`;
|
|
10
|
+
return new Date(ms).toLocaleDateString();
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy-paste ingest snippets for a freshly minted key. Framework-free: rendered
|
|
3
|
+
* server-side (the route computes the origin and passes the full result to the
|
|
4
|
+
* reveal modal) so the client never re-derives the URL or re-fetches the key.
|
|
5
|
+
*
|
|
6
|
+
* The frogger ingest path is `/api/observe/ingest/frogger`. frogger's browser
|
|
7
|
+
* transport POSTs a bare $fetch with no custom header, so a browser source MUST
|
|
8
|
+
* carry the key on `?key=`; a server transport can instead send it as `x-api-key`.
|
|
9
|
+
*/
|
|
10
|
+
/** The guaranteed-correct ingest URL with the key on the query string. */
|
|
11
|
+
export declare function buildIngestUrl(origin: string, key: string): string;
|
|
12
|
+
export declare function buildFroggerSnippet(opts: {
|
|
13
|
+
origin: string;
|
|
14
|
+
key: string;
|
|
15
|
+
}): {
|
|
16
|
+
rawUrl: string;
|
|
17
|
+
serverPluginSnippet: string;
|
|
18
|
+
configSnippet: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const INGEST_PATH = "/api/observe/ingest/frogger";
|
|
2
|
+
function trimOrigin(origin) {
|
|
3
|
+
return origin.replace(/\/+$/, "");
|
|
4
|
+
}
|
|
5
|
+
export function buildIngestUrl(origin, key) {
|
|
6
|
+
return `${trimOrigin(origin)}${INGEST_PATH}?key=${key}`;
|
|
7
|
+
}
|
|
8
|
+
export function buildFroggerSnippet(opts) {
|
|
9
|
+
const base = `${trimOrigin(opts.origin)}${INGEST_PATH}`;
|
|
10
|
+
const rawUrl = buildIngestUrl(opts.origin, opts.key);
|
|
11
|
+
const serverPluginSnippet = [
|
|
12
|
+
`// server/plugins/observe.ts`,
|
|
13
|
+
`import { createHttpTransport, addGlobalTransport } from '#frogger/server'`,
|
|
14
|
+
``,
|
|
15
|
+
`export default defineNitroPlugin(() => {`,
|
|
16
|
+
` addGlobalTransport(createHttpTransport({`,
|
|
17
|
+
` endpoint: '${base}',`,
|
|
18
|
+
` apiKey: '${opts.key}',`,
|
|
19
|
+
` }))`,
|
|
20
|
+
`})`
|
|
21
|
+
].join("\n");
|
|
22
|
+
const configSnippet = [
|
|
23
|
+
`// frogger.config.ts`,
|
|
24
|
+
`import { defineFroggerOptions } from '#frogger/config'`,
|
|
25
|
+
``,
|
|
26
|
+
`export default defineFroggerOptions({`,
|
|
27
|
+
` transports: [`,
|
|
28
|
+
` { type: 'http', endpoint: '${rawUrl}' },`,
|
|
29
|
+
` ],`,
|
|
30
|
+
`})`
|
|
31
|
+
].join("\n");
|
|
32
|
+
return { rawUrl, serverPluginSnippet, configSnippet };
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModuleOptions } from '../types/module-options.js';
|
|
2
|
+
/** Type-safe config helper for nuxt-observe.config.ts (mirrors defineFroggerOptions). */
|
|
3
|
+
export declare function defineObserveOptions(options: ModuleOptions): ModuleOptions;
|
|
4
|
+
/**
|
|
5
|
+
* CP0 loader stub: reads an optional nuxt-observe.config.{ts,js} from the project
|
|
6
|
+
* root and returns its default export. Precedence/merge hardening is deferred to a
|
|
7
|
+
* later checkpoint; for now the nuxt.config `observe` key alone is enough to boot.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadObserveConfig(rootDir: string): Promise<ModuleOptions | null>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
export function defineObserveOptions(options) {
|
|
4
|
+
return options;
|
|
5
|
+
}
|
|
6
|
+
export async function loadObserveConfig(rootDir) {
|
|
7
|
+
const candidates = ["nuxt-observe.config.ts", "nuxt-observe.config.js"];
|
|
8
|
+
const file = candidates.map((f) => join(rootDir, f)).find(existsSync);
|
|
9
|
+
if (!file) return null;
|
|
10
|
+
try {
|
|
11
|
+
const mod = await import(file);
|
|
12
|
+
const cfg = mod.default ?? mod;
|
|
13
|
+
return typeof cfg === "function" ? cfg() : cfg;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard time-window definition, shared by the overview endpoint (CP7) and the
|
|
3
|
+
* chart checkpoints (CP8+) so every screen agrees on what "24h" means. Framework-free
|
|
4
|
+
* and pure: `now` is injectable for deterministic tests.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PERIODS: readonly ["15m", "1h", "24h", "7d", "30d"];
|
|
7
|
+
export type Period = (typeof PERIODS)[number];
|
|
8
|
+
export interface PeriodRange {
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function periodToRange(period: Period, now?: number): PeriodRange;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const PERIODS = ["15m", "1h", "24h", "7d", "30d"];
|
|
2
|
+
const MINUTE_MS = 6e4;
|
|
3
|
+
const HOUR_MS = 36e5;
|
|
4
|
+
const DAY_MS = 864e5;
|
|
5
|
+
const PERIOD_WINDOWS = {
|
|
6
|
+
"15m": { ms: 15 * MINUTE_MS, label: "Last 15 minutes" },
|
|
7
|
+
"1h": { ms: HOUR_MS, label: "Last hour" },
|
|
8
|
+
"24h": { ms: 24 * HOUR_MS, label: "Last 24 hours" },
|
|
9
|
+
"7d": { ms: 7 * DAY_MS, label: "Last 7 days" },
|
|
10
|
+
"30d": { ms: 30 * DAY_MS, label: "Last 30 days" }
|
|
11
|
+
};
|
|
12
|
+
export function periodToRange(period, now = Date.now()) {
|
|
13
|
+
const { ms, label } = PERIOD_WINDOWS[period];
|
|
14
|
+
return { from: now - ms, to: now, label };
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function slugify(input: string): string;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* uuidv7: A JavaScript implementation of UUID version 7
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2021-2024 LiosK
|
|
5
|
+
*
|
|
6
|
+
* @license Apache-2.0
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/** Represents a UUID as a 16-byte byte array. */
|
|
10
|
+
export declare class UUID {
|
|
11
|
+
readonly bytes: Readonly<Uint8Array>;
|
|
12
|
+
/** @param bytes - The 16-byte byte array representation. */
|
|
13
|
+
private constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Creates an object from the internal representation, a 16-byte byte array
|
|
16
|
+
* containing the binary UUID representation in the big-endian byte order.
|
|
17
|
+
*
|
|
18
|
+
* This method does NOT shallow-copy the argument, and thus the created object
|
|
19
|
+
* holds the reference to the underlying buffer.
|
|
20
|
+
*
|
|
21
|
+
* @throws TypeError if the length of the argument is not 16.
|
|
22
|
+
*/
|
|
23
|
+
static ofInner(bytes: Readonly<Uint8Array>): UUID;
|
|
24
|
+
/**
|
|
25
|
+
* Builds a byte array from UUIDv7 field values.
|
|
26
|
+
*
|
|
27
|
+
* @param unixTsMs - A 48-bit `unix_ts_ms` field value.
|
|
28
|
+
* @param randA - A 12-bit `rand_a` field value.
|
|
29
|
+
* @param randBHi - The higher 30 bits of 62-bit `rand_b` field value.
|
|
30
|
+
* @param randBLo - The lower 32 bits of 62-bit `rand_b` field value.
|
|
31
|
+
* @throws RangeError if any field value is out of the specified range.
|
|
32
|
+
*/
|
|
33
|
+
static fromFieldsV7(unixTsMs: number, randA: number, randBHi: number, randBLo: number): UUID;
|
|
34
|
+
/**
|
|
35
|
+
* Builds a byte array from a string representation.
|
|
36
|
+
*
|
|
37
|
+
* This method accepts the following formats:
|
|
38
|
+
*
|
|
39
|
+
* - 32-digit hexadecimal format without hyphens: `0189dcd553117d408db09496a2eef37b`
|
|
40
|
+
* - 8-4-4-4-12 hyphenated format: `0189dcd5-5311-7d40-8db0-9496a2eef37b`
|
|
41
|
+
* - Hyphenated format with surrounding braces: `{0189dcd5-5311-7d40-8db0-9496a2eef37b}`
|
|
42
|
+
* - RFC 9562 URN format: `urn:uuid:0189dcd5-5311-7d40-8db0-9496a2eef37b`
|
|
43
|
+
*
|
|
44
|
+
* Leading and trailing whitespaces represents an error.
|
|
45
|
+
*
|
|
46
|
+
* @throws SyntaxError if the argument could not parse as a valid UUID string.
|
|
47
|
+
*/
|
|
48
|
+
static parse(uuid: string): UUID;
|
|
49
|
+
/**
|
|
50
|
+
* @returns The 8-4-4-4-12 canonical hexadecimal string representation
|
|
51
|
+
* (`0189dcd5-5311-7d40-8db0-9496a2eef37b`).
|
|
52
|
+
*/
|
|
53
|
+
toString(): string;
|
|
54
|
+
/**
|
|
55
|
+
* @returns The 32-digit hexadecimal representation without hyphens
|
|
56
|
+
* (`0189dcd553117d408db09496a2eef37b`).
|
|
57
|
+
*/
|
|
58
|
+
toHex(): string;
|
|
59
|
+
/** @returns The 8-4-4-4-12 canonical hexadecimal string representation. */
|
|
60
|
+
toJSON(): string;
|
|
61
|
+
/**
|
|
62
|
+
* Reports the variant field value of the UUID or, if appropriate, "NIL" or
|
|
63
|
+
* "MAX".
|
|
64
|
+
*
|
|
65
|
+
* For convenience, this method reports "NIL" or "MAX" if `this` represents
|
|
66
|
+
* the Nil or Max UUID, although the Nil and Max UUIDs are technically
|
|
67
|
+
* subsumed under the variants `0b0` and `0b111`, respectively.
|
|
68
|
+
*/
|
|
69
|
+
getVariant(): "VAR_0" | "VAR_10" | "VAR_110" | "VAR_RESERVED" | "NIL" | "MAX";
|
|
70
|
+
/**
|
|
71
|
+
* Returns the version field value of the UUID or `undefined` if the UUID does
|
|
72
|
+
* not have the variant field value of `0b10`.
|
|
73
|
+
*/
|
|
74
|
+
getVersion(): number | undefined;
|
|
75
|
+
/** Creates an object from `this`. */
|
|
76
|
+
clone(): UUID;
|
|
77
|
+
/** Returns true if `this` is equivalent to `other`. */
|
|
78
|
+
equals(other: UUID): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Returns a negative integer, zero, or positive integer if `this` is less
|
|
81
|
+
* than, equal to, or greater than `other`, respectively.
|
|
82
|
+
*/
|
|
83
|
+
compareTo(other: UUID): number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Encapsulates the monotonic counter state.
|
|
87
|
+
*
|
|
88
|
+
* This class provides APIs to utilize a separate counter state from that of the
|
|
89
|
+
* global generator used by {@link uuidv7} and {@link uuidv7obj}. In addition to
|
|
90
|
+
* the default {@link generate} method, this class has {@link generateOrAbort}
|
|
91
|
+
* that is useful to absolutely guarantee the monotonically increasing order of
|
|
92
|
+
* generated UUIDs. See their respective documentation for details.
|
|
93
|
+
*/
|
|
94
|
+
export declare class V7Generator {
|
|
95
|
+
private timestamp;
|
|
96
|
+
private counter;
|
|
97
|
+
/** The random number generator used by the generator. */
|
|
98
|
+
private readonly random;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a generator object with the default random number generator, or
|
|
101
|
+
* with the specified one if passed as an argument. The specified random
|
|
102
|
+
* number generator should be cryptographically strong and securely seeded.
|
|
103
|
+
*/
|
|
104
|
+
constructor(randomNumberGenerator?: {
|
|
105
|
+
/** Returns a 32-bit random unsigned integer. */
|
|
106
|
+
nextUint32(): number;
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* Generates a new UUIDv7 object from the current timestamp, or resets the
|
|
110
|
+
* generator upon significant timestamp rollback.
|
|
111
|
+
*
|
|
112
|
+
* This method returns a monotonically increasing UUID by reusing the previous
|
|
113
|
+
* timestamp even if the up-to-date timestamp is smaller than the immediately
|
|
114
|
+
* preceding UUID's. However, when such a clock rollback is considered
|
|
115
|
+
* significant (i.e., by more than ten seconds), this method resets the
|
|
116
|
+
* generator and returns a new UUID based on the given timestamp, breaking the
|
|
117
|
+
* increasing order of UUIDs.
|
|
118
|
+
*
|
|
119
|
+
* See {@link generateOrAbort} for the other mode of generation and
|
|
120
|
+
* {@link generateOrResetCore} for the low-level primitive.
|
|
121
|
+
*/
|
|
122
|
+
generate(): UUID;
|
|
123
|
+
/**
|
|
124
|
+
* Generates a new UUIDv7 object from the current timestamp, or returns
|
|
125
|
+
* `undefined` upon significant timestamp rollback.
|
|
126
|
+
*
|
|
127
|
+
* This method returns a monotonically increasing UUID by reusing the previous
|
|
128
|
+
* timestamp even if the up-to-date timestamp is smaller than the immediately
|
|
129
|
+
* preceding UUID's. However, when such a clock rollback is considered
|
|
130
|
+
* significant (i.e., by more than ten seconds), this method aborts and
|
|
131
|
+
* returns `undefined` immediately.
|
|
132
|
+
*
|
|
133
|
+
* See {@link generate} for the other mode of generation and
|
|
134
|
+
* {@link generateOrAbortCore} for the low-level primitive.
|
|
135
|
+
*/
|
|
136
|
+
generateOrAbort(): UUID | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Generates a new UUIDv7 object from the `unixTsMs` passed, or resets the
|
|
139
|
+
* generator upon significant timestamp rollback.
|
|
140
|
+
*
|
|
141
|
+
* This method is equivalent to {@link generate} except that it takes a custom
|
|
142
|
+
* timestamp and clock rollback allowance.
|
|
143
|
+
*
|
|
144
|
+
* @param rollbackAllowance - The amount of `unixTsMs` rollback that is
|
|
145
|
+
* considered significant. A suggested value is `10_000` (milliseconds).
|
|
146
|
+
* @throws RangeError if `unixTsMs` is not a 48-bit positive integer.
|
|
147
|
+
*/
|
|
148
|
+
generateOrResetCore(unixTsMs: number, rollbackAllowance: number): UUID;
|
|
149
|
+
/**
|
|
150
|
+
* Generates a new UUIDv7 object from the `unixTsMs` passed, or returns
|
|
151
|
+
* `undefined` upon significant timestamp rollback.
|
|
152
|
+
*
|
|
153
|
+
* This method is equivalent to {@link generateOrAbort} except that it takes a
|
|
154
|
+
* custom timestamp and clock rollback allowance.
|
|
155
|
+
*
|
|
156
|
+
* @param rollbackAllowance - The amount of `unixTsMs` rollback that is
|
|
157
|
+
* considered significant. A suggested value is `10_000` (milliseconds).
|
|
158
|
+
* @throws RangeError if `unixTsMs` is not a 48-bit positive integer.
|
|
159
|
+
*/
|
|
160
|
+
generateOrAbortCore(unixTsMs: number, rollbackAllowance: number): UUID | undefined;
|
|
161
|
+
/** Initializes the counter at a 42-bit random integer. */
|
|
162
|
+
private resetCounter;
|
|
163
|
+
/**
|
|
164
|
+
* Generates a new UUIDv4 object utilizing the random number generator inside.
|
|
165
|
+
*
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
generateV4(): UUID;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Generates a UUIDv7 string.
|
|
172
|
+
*
|
|
173
|
+
* @returns The 8-4-4-4-12 canonical hexadecimal string representation
|
|
174
|
+
* ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
|
|
175
|
+
*/
|
|
176
|
+
export declare const uuidv7: () => string;
|
|
177
|
+
/** Generates a UUIDv7 object. */
|
|
178
|
+
export declare const uuidv7obj: () => UUID;
|
|
179
|
+
/**
|
|
180
|
+
* Generates a UUIDv4 string.
|
|
181
|
+
*
|
|
182
|
+
* @returns The 8-4-4-4-12 canonical hexadecimal string representation
|
|
183
|
+
* ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
|
|
184
|
+
*/
|
|
185
|
+
export declare const uuidv4: () => string;
|
|
186
|
+
/** Generates a UUIDv4 object. */
|
|
187
|
+
export declare const uuidv4obj: () => UUID;
|