mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
Mechanically re-derived: bin/debrand runs over a fresh import of posthog/posthog@fa1a9a60d4 (2026-08-06). The pipeline (.hanzo/workflows), the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md and the squashed initial migration are restored from the shipped tree, same as the previous import. The prune's import-closure guard kept 21 products the new core now imports; dropping them is a refactor now, recorded rather than forced.
107 lines
3.7 KiB
TypeScript
107 lines
3.7 KiB
TypeScript
import { combineUrl } from 'kea-router'
|
|
|
|
import { urls } from 'scenes/urls'
|
|
|
|
import { FileSystemIconType, ProductItemCategory, ProductKey } from '~/queries/schema/schema-general'
|
|
|
|
import { FileSystemIconColor, ProductManifest } from '../../frontend/src/types'
|
|
|
|
export const manifest: ProductManifest = {
|
|
name: 'Endpoints',
|
|
scenes: {
|
|
EndpointsScene: {
|
|
import: () => import('./frontend/EndpointsScene'),
|
|
projectBased: true,
|
|
name: 'Endpoints',
|
|
activityScope: 'Endpoints',
|
|
layout: 'app-container',
|
|
iconType: 'endpoints',
|
|
description: 'Define queries your application will use via the API and monitor their cost and usage.',
|
|
},
|
|
EndpointScene: {
|
|
import: () => import('./frontend/EndpointScene'),
|
|
projectBased: true,
|
|
name: 'Endpoint',
|
|
activityScope: 'Endpoint',
|
|
},
|
|
},
|
|
routes: {
|
|
'/endpoints': ['EndpointsScene', 'endpoints'],
|
|
'/endpoints/:name': ['EndpointScene', 'endpoint'],
|
|
},
|
|
urls: {
|
|
endpoints: (): string => '/endpoints',
|
|
endpoint: (name: string, version?: number): string => {
|
|
const searchParams: Record<string, string> = {}
|
|
if (version) {
|
|
searchParams.version = String(version)
|
|
}
|
|
return combineUrl(`/endpoints/${name}`, searchParams).url
|
|
},
|
|
endpointsUsage: (params?: {
|
|
endpointFilter?: string[]
|
|
dateFrom?: string
|
|
dateTo?: string
|
|
materializationType?: 'materialized' | 'inline'
|
|
interval?: string
|
|
breakdownBy?: string
|
|
}): string => {
|
|
if (!params) {
|
|
return '/endpoints?tab=usage'
|
|
}
|
|
const searchParams: Record<string, string> = {}
|
|
if (params.endpointFilter?.length) {
|
|
searchParams.endpointFilter = params.endpointFilter.join(',')
|
|
}
|
|
if (params.dateFrom) {
|
|
searchParams.dateFrom = params.dateFrom
|
|
}
|
|
if (params.dateTo) {
|
|
searchParams.dateTo = params.dateTo
|
|
}
|
|
if (params.materializationType) {
|
|
searchParams.materializationType = params.materializationType
|
|
}
|
|
if (params.interval) {
|
|
searchParams.interval = params.interval
|
|
}
|
|
if (params.breakdownBy) {
|
|
searchParams.breakdownBy = params.breakdownBy
|
|
}
|
|
return combineUrl('/endpoints', { tab: 'usage', ...searchParams }).url
|
|
},
|
|
},
|
|
fileSystemTypes: {
|
|
endpoints: {
|
|
name: 'Endpoints',
|
|
iconType: 'endpoints',
|
|
href: () => urls.endpoints(),
|
|
iconColor: ['var(--color-product-endpoints-light)'],
|
|
filterKey: 'endpoints',
|
|
},
|
|
},
|
|
treeItemsProducts: [
|
|
{
|
|
path: 'Endpoints',
|
|
intents: [ProductKey.ENDPOINTS],
|
|
category: ProductItemCategory.TOOLS,
|
|
href: urls.endpoints(),
|
|
type: 'endpoints',
|
|
iconType: 'endpoints',
|
|
iconColor: ['var(--color-product-endpoints-light)'] as FileSystemIconColor,
|
|
sceneKey: 'EndpointsScene',
|
|
},
|
|
],
|
|
treeItemsMetadata: [
|
|
{
|
|
path: 'Endpoints',
|
|
category: 'Tools',
|
|
iconType: 'endpoints' as FileSystemIconType,
|
|
iconColor: ['var(--color-product-endpoints-light)'] as FileSystemIconColor,
|
|
href: urls.endpoints(),
|
|
sceneKey: 'EndpointsScene',
|
|
sceneKeys: ['EndpointsScene', 'EndpointScene'],
|
|
},
|
|
],
|
|
}
|