Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(frontend): inline Kea types batch 5 (#71459)

Marius Andra4321d74e4b27
diff --git a/.kearc b/.kearc
index ef9897a9f85a..92c6595d12e4 100644
--- a/.kearc
+++ b/.kearc
@@ -54,19 +54,19 @@
"./.kea-inline-batch-04-slot-14",
"./.kea-inline-separator-04",
"./.kea-inline-separator-04-b",
- "./.kea-inline-batch-05-slot-01",
- "./.kea-inline-batch-05-slot-02",
- "./.kea-inline-batch-05-slot-03",
- "./.kea-inline-batch-05-slot-04",
- "./.kea-inline-batch-05-slot-05",
- "./.kea-inline-batch-05-slot-06",
- "./.kea-inline-batch-05-slot-07",
- "./.kea-inline-batch-05-slot-08",
- "./.kea-inline-batch-05-slot-09",
- "./.kea-inline-batch-05-slot-10",
- "./.kea-inline-batch-05-slot-11",
- "./.kea-inline-batch-05-slot-12",
- "./.kea-inline-batch-05-slot-13",
+ "./frontend/src/scenes/audit-logs",
+ "./frontend/src/scenes/data-warehouse",
+ "./frontend/src/scenes/debug",
+ "./frontend/src/scenes/heatmaps",
+ "./frontend/src/scenes/inbox",
+ "./frontend/src/scenes/paths-v2",
+ "./frontend/src/scenes/persons",
+ "./frontend/src/scenes/product-tours",
+ "./frontend/src/scenes/saved-insights",
+ "./products/ai_gateway",
+ "./products/error_tracking",
+ "./products/posthog_ai",
+ "./products/wizard",
"./.kea-inline-separator-05",
"./.kea-inline-separator-05-b",
"./.kea-inline-batch-06-slot-01",
diff --git a/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx b/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx
index 022c0d2e5ef9..84223041e478 100644
--- a/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx
+++ b/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
@@ -16,8 +16,9 @@ import { teamLogic } from 'scenes/teamLogic'
import { ActivityScope, OrganizationType, TeamBasicType } from '~/types'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
+import type { AvailableFeature } from '../../types'
import { userLogic } from '../userLogic'
-import type { advancedActivityLogsLogicType } from './advancedActivityLogsLogicType'
export type ActivityLogsView = 'project' | 'organization'
@@ -140,6 +141,189 @@ function parseBooleanSearchParam(raw: unknown): boolean | undefined {
return undefined
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface advancedActivityLogsLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ currentOrganization: OrganizationType | null // organizationLogic
+ currentOrganizationId: string // organizationLogic
+ currentProjectId: number | string // teamLogic
+ currentTeamIdStrict: number | string // teamLogic
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
+ activeAdvancedFiltersCount: number
+ activeFilters: ActiveDetailFilter[]
+ activeTab: 'exports' | 'logs'
+ advancedActivityLogs: CountedPaginatedResponse<ActivityLogItem>
+ advancedActivityLogsBaseUrl: string
+ advancedActivityLogsLoading: boolean
+ availableFilters: AvailableFilters | null
+ availableFiltersLoading: boolean
+ canViewOrganization: boolean
+ exports: ExportedAsset[]
+ exportsLoading: boolean
+ filters: AdvancedActivityLogFilters
+ hasActiveFilters: boolean
+ isOrganizationView: boolean
+ pagination: PaginationManual
+ showMoreFilters: boolean
+ teamsById: Record<number, string>
+ urlSearchParams: {
+ activities: string | undefined
+ clients: string | undefined
+ detail_filters: string | undefined
+ end_date: string | undefined
+ ip_addresses: string | undefined
+ is_system: string | undefined
+ item_ids: string | undefined
+ page: number | undefined
+ scopes: string | undefined
+ start_date: string | undefined
+ team_ids: string | undefined
+ users: string | undefined
+ view: string | undefined
+ was_impersonated: string | undefined
+ }
+ view: ActivityLogsView
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface advancedActivityLogsLogicActions {
+ addActiveFilter: (
+ fieldPath: string,
+ isCustom?: boolean
+ ) => {
+ fieldPath: string
+ isCustom: boolean
+ }
+ clearAllFilters: () => {
+ value: true
+ }
+ exportLogs: (format: 'csv' | 'xlsx') => {
+ format: 'csv' | 'xlsx'
+ }
+ loadAdvancedActivityLogs: (_: any) => any
+ loadAdvancedActivityLogsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAdvancedActivityLogsSuccess: (
+ advancedActivityLogs: CountedPaginatedResponse<ActivityLogItem>,
+ payload?: any
+ ) => {
+ advancedActivityLogs: CountedPaginatedResponse<ActivityLogItem>
+ payload?: any
+ }
+ loadAvailableFilters: () => any
+ loadAvailableFiltersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAvailableFiltersSuccess: (
+ availableFilters: AvailableFilters | null,
+ payload?: any
+ ) => {
+ availableFilters: AvailableFilters | null
+ payload?: any
+ }
+ loadExports: () => any
+ loadExportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadExportsSuccess: (
+ exports: ExportedAsset[],
+ payload?: any
+ ) => {
+ exports: ExportedAsset[]
+ payload?: any
+ }
+ removeActiveFilter: (key: string) => {
+ key: string
+ }
+ setActiveFilters: (activeFilters: ActiveDetailFilter[]) => {
+ activeFilters: ActiveDetailFilter[]
+ }
+ setActiveTab: (tab: 'exports' | 'logs') => {
+ tab: 'exports' | 'logs'
+ }
+ setFilters: (filters: Partial<AdvancedActivityLogFilters>) => {
+ filters: Partial<AdvancedActivityLogFilters>
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+ setShowMoreFilters: (show: boolean) => {
+ show: boolean
+ }
+ setView: (view: ActivityLogsView) => {
+ view: ActivityLogsView
+ }
+ syncFiltersToAPI: () => {
+ value: true
+ }
+ updateActiveFilter: (
+ key: string,
+ updates: Partial<ActiveDetailFilter>
+ ) => {
+ key: string
+ updates: Partial<ActiveDetailFilter>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface advancedActivityLogsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isOrganizationView: (view: ActivityLogsView) => boolean
+ advancedActivityLogsBaseUrl: (
+ isOrganizationView: boolean,
+ currentProjectId: number | string,
+ currentOrganizationId: string
+ ) => string
+ canViewOrganization: (currentOrganization: OrganizationType | null) => boolean
+ teamsById: (currentOrganization: OrganizationType | null) => Record<number, string>
+ hasActiveFilters: (filters: AdvancedActivityLogFilters, isOrganizationView: boolean) => boolean
+ pagination: (
+ filters: AdvancedActivityLogFilters,
+ advancedActivityLogs: CountedPaginatedResponse<ActivityLogItem>
+ ) => PaginationManual
+ activeAdvancedFiltersCount: (filters: AdvancedActivityLogFilters) => number
+ urlSearchParams: (
+ filters: AdvancedActivityLogFilters,
+ isOrganizationView: boolean
+ ) => {
+ activities: string | undefined
+ clients: string | undefined
+ detail_filters: string | undefined
+ end_date: string | undefined
+ ip_addresses: string | undefined
+ is_system: string | undefined
+ item_ids: string | undefined
+ page: number | undefined
+ scopes: string | undefined
+ start_date: string | undefined
+ team_ids: string | undefined
+ users: string | undefined
+ view: string | undefined
+ was_impersonated: string | undefined
+ }
+ }
+}
+
+export type advancedActivityLogsLogicType = MakeLogicType<
+ advancedActivityLogsLogicValues,
+ advancedActivityLogsLogicActions,
+ Record<string, any>,
+ advancedActivityLogsLogicMeta
+>
+
export const advancedActivityLogsLogic = kea<advancedActivityLogsLogicType>([
path(['scenes', 'audit-logs', 'advancedActivityLogsLogic']),
connect(() => ({
@@ -360,7 +544,10 @@ export const advancedActivityLogsLogic = kea<advancedActivityLogsLogicType>([
pagination: [
(s) => [s.filters, s.advancedActivityLogs],
- (filters: AdvancedActivityLogFilters, advancedActivityLogs): PaginationManual => ({
+ (
+ filters: AdvancedActivityLogFilters,
+ advancedActivityLogs: CountedPaginatedResponse<ActivityLogItem>
+ ): PaginationManual => ({
controlled: true,
pageSize: ADVANCED_ACTIVITY_PAGE_SIZE,
currentPage: filters.page || 1,
diff --git a/frontend/src/scenes/data-warehouse/dataWarehouseSceneLogic.ts b/frontend/src/scenes/data-warehouse/dataWarehouseSceneLogic.ts
index 2d9d3f93460f..209b79d4ae6e 100644
--- a/frontend/src/scenes/data-warehouse/dataWarehouseSceneLogic.ts
+++ b/frontend/src/scenes/data-warehouse/dataWarehouseSceneLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { FEATURE_FLAGS } from 'lib/constants'
@@ -7,7 +7,8 @@ import { urls } from 'scenes/urls'
import { SIDE_PANEL_CONTEXT_KEY, SidePanelSceneContext } from '~/layout/navigation-3000/sidepanel/types'
-import type { dataWarehouseSceneLogicType } from './dataWarehouseSceneLogicType'
+import type { WarehouseStatusResponseApi } from '../../../../products/data_warehouse/frontend/generated/api.schemas'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
import { warehouseProvisioningLogic } from './scene/warehouseProvisioningLogic'
export enum DataWarehouseTab {
@@ -20,6 +21,55 @@ function isDataWarehouseTab(tab: unknown): tab is DataWarehouseTab {
return typeof tab === 'string' && (Object.values(DataWarehouseTab) as string[]).includes(tab)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseSceneLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ warehouseStatus: WarehouseStatusResponseApi | null // warehouseProvisioningLogic
+ activeTab: DataWarehouseTab | null
+ availableTabs: DataWarehouseTab[]
+ selectedTab: DataWarehouseTab | null
+ sidePanelContext: SidePanelSceneContext
+ warehouseReady: boolean
+ warehouseStatusResolved: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseSceneLogicActions {
+ loadWarehouseStatusFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // warehouseProvisioningLogic
+ loadWarehouseStatusSuccess: (
+ warehouseStatus: WarehouseStatusResponseApi | null,
+ payload?: any
+ ) => {
+ payload?: any
+ warehouseStatus: WarehouseStatusResponseApi | null
+ } // warehouseProvisioningLogic
+ setActiveTab: (tab: DataWarehouseTab | null) => {
+ tab: DataWarehouseTab | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseSceneLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ warehouseReady: (warehouseStatus: WarehouseStatusResponseApi | null) => boolean
+ availableTabs: (featureFlags: FeatureFlagsSet, warehouseReady: boolean) => DataWarehouseTab[]
+ activeTab: (selectedTab: DataWarehouseTab | null, availableTabs: DataWarehouseTab[]) => DataWarehouseTab | null
+ }
+}
+
+export type dataWarehouseSceneLogicType = MakeLogicType<
+ dataWarehouseSceneLogicValues,
+ dataWarehouseSceneLogicActions,
+ Record<string, any>,
+ dataWarehouseSceneLogicMeta
+>
+
// Single source of truth for which tabs the Data ops scene exposes. The scene, the URL
// state, and the default tab all derive from availableTabs / activeTab below.
export const dataWarehouseSceneLogic = kea<dataWarehouseSceneLogicType>([
@@ -52,10 +102,20 @@ export const dataWarehouseSceneLogic = kea<dataWarehouseSceneLogicType>([
selectors({
// A warehouse that isn't serving yet has nothing to report on, so Overview stays hidden
// until it's ready and the scene shows the setup form on its own.
- warehouseReady: [(s) => [s.warehouseStatus], (warehouseStatus): boolean => warehouseStatus?.state === 'ready'],
+ warehouseReady: [
+ (s) => [s.warehouseStatus],
+ (
+ warehouseStatus:
+ | null
+ | import('products/data_warehouse/frontend/generated/api.schemas').WarehouseStatusResponseApi
+ ): boolean => warehouseStatus?.state === 'ready',
+ ],
availableTabs: [
(s) => [s.featureFlags, s.warehouseReady],
- (featureFlags, warehouseReady): DataWarehouseTab[] => {
+ (
+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
+ warehouseReady: boolean
+ ): DataWarehouseTab[] => {
const tabs: DataWarehouseTab[] = []
if (featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE_SCENE] && warehouseReady) {
tabs.push(DataWarehouseTab.OVERVIEW)
@@ -73,7 +133,7 @@ export const dataWarehouseSceneLogic = kea<dataWarehouseSceneLogicType>([
// lives here rather than in urlToAction so it re-derives when the warehouse status lands.
activeTab: [
(s) => [s.selectedTab, s.availableTabs],
- (selectedTab, availableTabs): DataWarehouseTab | null =>
+ (selectedTab: DataWarehouseTab | null, availableTabs: DataWarehouseTab[]): DataWarehouseTab | null =>
selectedTab && availableTabs.includes(selectedTab) ? selectedTab : (availableTabs[0] ?? null),
],
[SIDE_PANEL_CONTEXT_KEY]: [
diff --git a/frontend/src/scenes/data-warehouse/editor/connectionSelectorLogic.ts b/frontend/src/scenes/data-warehouse/editor/connectionSelectorLogic.ts
index 899275e2f1ff..cccc9e2c54cf 100644
--- a/frontend/src/scenes/data-warehouse/editor/connectionSelectorLogic.ts
+++ b/frontend/src/scenes/data-warehouse/editor/connectionSelectorLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { ApiConfig } from 'lib/api'
@@ -15,7 +15,8 @@ import { sourcesDataLogic } from 'products/data_warehouse/frontend/shared/logics
import { externalDataSourcesConnectionsList } from 'products/warehouse_sources/frontend/generated/api'
import type { ExternalDataSourceConnectionOptionApi } from 'products/warehouse_sources/frontend/generated/api.schemas'
-import type { connectionSelectorLogicType } from './connectionSelectorLogicType'
+import type { PaginatedResponse } from '../../../lib/api'
+import type { ExternalDataSource } from '../../../types'
export const POSTHOG_WAREHOUSE = '__posthog_warehouse__'
export const LOADING_CONNECTIONS = '__loading_connections__'
@@ -92,6 +93,77 @@ export function getConnectionSelectorValue(
return POSTHOG_WAREHOUSE
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface connectionSelectorLogicValues {
+ connectionOptions: ExternalDataSourceConnectionOptionApi[] | null
+ connectionOptionsLoading: boolean
+ connectionSelectOptions: ConnectionSelectOptionGroup[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface connectionSelectorLogicActions {
+ loadSourcesSuccess: (
+ dataWarehouseSources:
+ | PaginatedResponse<ExternalDataSource>
+ | {
+ count: number
+ next: null
+ previous: null
+ results: never[]
+ },
+ payload?: {
+ value: true
+ }
+ ) => {
+ dataWarehouseSources:
+ | PaginatedResponse<ExternalDataSource>
+ | {
+ count: number
+ next: null
+ previous: null
+ results: never[]
+ }
+ payload?: {
+ value: true
+ }
+ } // sourcesDataLogic
+ loadConnectionOptions: () => any
+ loadConnectionOptionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadConnectionOptionsSuccess: (
+ connectionOptions: ExternalDataSourceConnectionOptionApi[],
+ payload?: any
+ ) => {
+ connectionOptions: ExternalDataSourceConnectionOptionApi[]
+ payload?: any
+ }
+ maybeLoadConnectionOptions: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface connectionSelectorLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ connectionSelectOptions: (
+ connectionOptions: ExternalDataSourceConnectionOptionApi[] | null,
+ connectionOptionsLoading: boolean
+ ) => ConnectionSelectOptionGroup[]
+ }
+}
+
+export type connectionSelectorLogicType = MakeLogicType<
+ connectionSelectorLogicValues,
+ connectionSelectorLogicActions,
+ Record<string, any>,
+ connectionSelectorLogicMeta
+>
+
export const connectionSelectorLogic = kea<connectionSelectorLogicType>([
path(['scenes', 'data-warehouse', 'editor', 'connectionSelectorLogic']),
connect(() => ({
diff --git a/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx b/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx
index 72305437459c..9dd8f9f683ed 100644
--- a/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -9,9 +9,113 @@ import api, { ApiError, PaginatedResponse } from 'lib/api'
import { HogQLQuery } from '~/queries/schema/schema-general'
import { DataWarehouseSavedQueryDraft } from '~/types'
-import type { draftsLogicType } from './draftsLogicType'
import { QueryTab } from './sqlEditorLogic'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface draftsLogicValues {
+ drafts: DataWarehouseSavedQueryDraft[]
+ draftsResponse: PaginatedResponse<DataWarehouseSavedQueryDraft>
+ draftsResponseLoading: boolean
+ hasMoreDrafts: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface draftsLogicActions {
+ deleteDraft: (
+ draftId: string,
+ viewName?: string
+ ) => {
+ draftId: string
+ viewName: string | undefined
+ }
+ deleteDraftSuccess: (
+ draftId: string,
+ viewName?: string
+ ) => {
+ draftId: string
+ viewName: string | undefined
+ }
+ loadDrafts: () => any
+ loadDraftsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDraftsSuccess: (
+ draftsResponse: PaginatedResponse<DataWarehouseSavedQueryDraft>,
+ payload?: any
+ ) => {
+ draftsResponse: PaginatedResponse<DataWarehouseSavedQueryDraft>
+ payload?: any
+ }
+ loadMoreDrafts: () => any
+ loadMoreDraftsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMoreDraftsSuccess: (
+ draftsResponse: PaginatedResponse<DataWarehouseSavedQueryDraft>,
+ payload?: any
+ ) => {
+ draftsResponse: PaginatedResponse<DataWarehouseSavedQueryDraft>
+ payload?: any
+ }
+ renameDraft: (
+ draftId: string,
+ name: string
+ ) => {
+ draftId: string
+ name: string
+ }
+ saveAsDraft: (
+ query: HogQLQuery,
+ viewId: string,
+ tab: QueryTab
+ ) => {
+ query: HogQLQuery
+ tab: QueryTab
+ viewId: string
+ }
+ saveAsDraftSuccess: (
+ draft: DataWarehouseSavedQueryDraft,
+ tab: QueryTab
+ ) => {
+ draft: DataWarehouseSavedQueryDraft
+ tab: QueryTab
+ }
+ saveOrUpdateDraft: (
+ query: HogQLQuery,
+ viewId?: string,
+ draftId?: string,
+ activeTab?: QueryTab
+ ) => {
+ activeTab: QueryTab | undefined
+ draftId: string | undefined
+ query: HogQLQuery
+ viewId: string | undefined
+ }
+ setDrafts: (drafts: DataWarehouseSavedQueryDraft[]) => {
+ drafts: DataWarehouseSavedQueryDraft[]
+ }
+ updateDraft: (draft: DataWarehouseSavedQueryDraft) => {
+ draft: DataWarehouseSavedQueryDraft
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface draftsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasMoreDrafts: (draftsResponse: PaginatedResponse<DataWarehouseSavedQueryDraft>) => boolean
+ }
+}
+
+export type draftsLogicType = MakeLogicType<draftsLogicValues, draftsLogicActions, Record<string, any>, draftsLogicMeta>
+
export const draftsLogic = kea<draftsLogicType>([
path(['scenes', 'data-warehouse', 'editor', 'draftsLogic']),
@@ -70,7 +174,10 @@ export const draftsLogic = kea<draftsLogicType>([
],
}),
selectors({
- hasMoreDrafts: [(s) => [s.draftsResponse], (draftsResponse) => draftsResponse.next !== null],
+ hasMoreDrafts: [
+ (s) => [s.draftsResponse],
+ (draftsResponse: PaginatedResponse<DataWarehouseSavedQueryDraft>) => draftsResponse.next !== null,
+ ],
}),
listeners(({ values, actions }) => ({
loadDraftsSuccess: ({ draftsResponse }) => {
diff --git a/frontend/src/scenes/data-warehouse/editor/editorSceneLogic.tsx b/frontend/src/scenes/data-warehouse/editor/editorSceneLogic.tsx
index a88d9d174c9e..1aa350cde4b2 100644
--- a/frontend/src/scenes/data-warehouse/editor/editorSceneLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/editorSceneLogic.tsx
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { copyToClipboard } from 'lib/utils/copyToClipboard'
@@ -11,8 +11,10 @@ import { SIDE_PANEL_CONTEXT_KEY, SidePanelSceneContext } from '~/layout/navigati
import { DataVisualizationNode, FileSystemIconType, HogQLFilters, NodeKind } from '~/queries/schema/schema-general'
import { Breadcrumb } from '~/types'
-import type { editorSceneLogicType } from './editorSceneLogicType'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
+import type { DataWarehouseSavedQuery, LinkBreadcrumb, QueryBasedInsightModel } from '../../../types'
import { normalizeFiltersForUrl, sqlEditorLogic, toDataVisualizationNode } from './sqlEditorLogic'
+import type { QueryTab, SqlEditorSource } from './sqlEditorLogic'
export interface SaveAsMenuItem {
action: 'insight' | 'endpoint' | 'view'
@@ -52,6 +54,132 @@ export interface EditorSceneLogicProps {
tabId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface editorSceneLogicValues {
+ activeTab: QueryTab | null // sqlEditorLogic
+ dashboardId: number | null // sqlEditorLogic
+ dataLogicKey: string // sqlEditorLogic
+ editingInsight: QueryBasedInsightModel | null // sqlEditorLogic
+ editingView: DataWarehouseSavedQuery | undefined // sqlEditorLogic
+ editorSource: SqlEditorSource // sqlEditorLogic
+ featureFlags: FeatureFlagsSet // sqlEditorLogic
+ insightLoading: boolean // sqlEditorLogic
+ queryInput: string | null // sqlEditorLogic
+ sourceQuery: DataVisualizationNode // sqlEditorLogic
+ viewLoading: boolean // sqlEditorLogic
+ breadcrumbs: Breadcrumb[]
+ isHistoryModalOpen: boolean
+ saveAsMenuItems: {
+ primary: SaveAsMenuItem
+ secondary: SaveAsMenuItem[]
+ }
+ sidePanelContext: SidePanelSceneContext
+ titleSectionProps:
+ | {
+ description: string
+ forceBackTo: LinkBreadcrumb
+ name: string
+ resourceType: {
+ type: string
+ }
+ }
+ | {
+ description?: undefined
+ forceBackTo: LinkBreadcrumb
+ name: string
+ resourceType: {
+ type: string
+ }
+ }
+ | {
+ description?: undefined
+ forceBackTo?: undefined
+ name: string
+ resourceType: {
+ type: string
+ }
+ }
+ updateInsightButtonEnabled: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface editorSceneLogicActions {
+ closeHistoryModal: () => {
+ value: true
+ }
+ openHistoryModal: () => {
+ value: true
+ }
+ shareTab: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface editorSceneLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ breadcrumbs: (activeTab: QueryTab | null) => Breadcrumb[]
+ titleSectionProps: (
+ editingInsight: QueryBasedInsightModel<
+ import('~/queries/schema/schema-general').Node<Record<string, any>>
+ > | null,
+ insightLoading: boolean,
+ editingView: DataWarehouseSavedQuery | undefined,
+ viewLoading: boolean,
+ editorSource: SqlEditorSource,
+ dashboardId: number | null,
+ activeTab: QueryTab | null
+ ) =>
+ | {
+ description: string
+ forceBackTo: LinkBreadcrumb
+ name: string
+ resourceType: {
+ type: string
+ }
+ }
+ | {
+ description?: undefined
+ forceBackTo: LinkBreadcrumb
+ name: string
+ resourceType: {
+ type: string
+ }
+ }
+ | {
+ description?: undefined
+ forceBackTo?: undefined
+ name: string
+ resourceType: {
+ type: string
+ }
+ }
+ saveAsMenuItems: (
+ editorSource: SqlEditorSource,
+ dashboardId: number | null,
+ featureFlags: FeatureFlagsSet
+ ) => {
+ primary: SaveAsMenuItem
+ secondary: SaveAsMenuItem[]
+ }
+ updateInsightButtonEnabled: (
+ sourceQuery: DataVisualizationNode,
+ activeTab: QueryTab | null,
+ editingInsight: QueryBasedInsightModel<
+ import('~/queries/schema/schema-general').Node<Record<string, any>>
+ > | null
+ ) => boolean
+ }
+}
+
+export type editorSceneLogicType = MakeLogicType<
+ editorSceneLogicValues,
+ editorSceneLogicActions,
+ EditorSceneLogicProps,
+ editorSceneLogicMeta
+>
+
export const editorSceneLogic = kea<editorSceneLogicType>([
path(['data-warehouse', 'editor', 'editorSceneLogic']),
props({} as EditorSceneLogicProps),
@@ -91,7 +219,7 @@ export const editorSceneLogic = kea<editorSceneLogicType>([
selectors({
breadcrumbs: [
(s) => [s.activeTab],
- (activeTab): Breadcrumb[] => {
+ (activeTab: null | import('./sqlEditorLogic').QueryTab): Breadcrumb[] => {
const { draft, insight, view } = activeTab || {}
const first = {
key: Scene.SQLEditor,
@@ -144,7 +272,15 @@ export const editorSceneLogic = kea<editorSceneLogicType>([
s.dashboardId,
s.activeTab,
],
- (editingInsight, insightLoading, editingView, viewLoading, editorSource, dashboardId, activeTab) => {
+ (
+ editingInsight: null | import('~/types').QueryBasedInsightModel,
+ insightLoading: boolean,
+ editingView: import('~/types').DataWarehouseSavedQuery | undefined,
+ viewLoading: boolean,
+ editorSource: import('./sqlEditorLogic').SqlEditorSource,
+ dashboardId: number | null,
+ activeTab: null | import('./sqlEditorLogic').QueryTab
+ ) => {
if (editingInsight) {
const forceBackTo: Breadcrumb = dashboardId
? {
@@ -262,7 +398,11 @@ export const editorSceneLogic = kea<editorSceneLogicType>([
],
saveAsMenuItems: [
(s) => [s.editorSource, s.dashboardId, s.featureFlags],
- (editorSource, dashboardId, featureFlags): { primary: SaveAsMenuItem; secondary: SaveAsMenuItem[] } => {
+ (
+ editorSource: import('./sqlEditorLogic').SqlEditorSource,
+ dashboardId: number | null,
+ featureFlags: import('../../../lib/logic/featureFlagLogic').FeatureFlagsSet
+ ): { primary: SaveAsMenuItem; secondary: SaveAsMenuItem[] } => {
const endpointsEnabled = !!featureFlags[FEATURE_FLAGS.ENDPOINTS]
const saveAsInsightItem: SaveAsMenuItem = {
action: 'insight',
@@ -300,7 +440,11 @@ export const editorSceneLogic = kea<editorSceneLogicType>([
],
updateInsightButtonEnabled: [
(s) => [s.sourceQuery, s.activeTab, s.editingInsight],
- (sourceQuery, activeTab, editingInsight) => {
+ (
+ sourceQuery: DataVisualizationNode,
+ activeTab: null | import('./sqlEditorLogic').QueryTab,
+ editingInsight: null | import('~/types').QueryBasedInsightModel
+ ) => {
if (!editingInsight?.query) {
return false
}
diff --git a/frontend/src/scenes/data-warehouse/editor/editorSizingLogic.tsx b/frontend/src/scenes/data-warehouse/editor/editorSizingLogic.tsx
index 841ea63a0517..32e56376d309 100644
--- a/frontend/src/scenes/data-warehouse/editor/editorSizingLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/editorSizingLogic.tsx
@@ -1,9 +1,7 @@
-import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { ResizerLogicProps, resizerLogic } from 'lib/components/Resizer/resizerLogic'
-import type { editorSizingLogicType } from './editorSizingLogicType'
-
export interface EditorSizingLogicProps {
editorSceneRef: React.RefObject<HTMLDivElement>
navigatorRef: React.RefObject<HTMLDivElement>
@@ -29,6 +27,75 @@ const DATABASE_TREE_DEFAULT_WIDTH = 300
const MAXIMUM_DATABASE_TREE_WIDTH = 600
const DATABASE_TREE_COLLAPSED_WIDTH = 48
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface editorSizingLogicValues {
+ databaseTreeDesiredSize: number | null // resizerLogic
+ databaseTreeIsResizing: boolean // resizerLogic
+ queryPaneDesiredSize: number | null // resizerLogic
+ sidebarDesiredSize: number | null // resizerLogic
+ sourceNavigatorDesiredSize: number | null // resizerLogic
+ databaseTreeResizerProps: ResizerLogicProps
+ databaseTreeWidth: number
+ databaseTreeWillCollapse: boolean
+ editorSceneRef: any
+ isDatabaseTreeCollapsed: boolean
+ queryPaneHeight: number
+ queryPaneResizerProps: ResizerLogicProps
+ queryTabsWidth: number
+ sidebarResizerProps: ResizerLogicProps
+ sidebarWidth: number
+ sourceNavigatorResizerProps: ResizerLogicProps
+ sourceNavigatorWidth: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface editorSizingLogicActions {
+ databaseTreeEndResize: () => {
+ value: true
+ } // resizerLogic
+ databaseTreeSetDesiredSize: (size: number | null) => {
+ size: number | null
+ } // resizerLogic
+ sidebarSetDesiredSize: (size: number | null) => {
+ size: number | null
+ } // resizerLogic
+ resetDefaultSidebarWidth: () => {
+ value: true
+ }
+ setDatabaseTreeCollapsed: (collapsed: boolean) => {
+ collapsed: boolean
+ }
+ setDatabaseTreeWillCollapse: (willCollapse: boolean) => {
+ willCollapse: boolean
+ }
+ toggleDatabaseTreeCollapsed: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface editorSizingLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ editorSceneRef: (editorSceneRef: any) => any
+ sourceNavigatorWidth: (sourceNavigatorDesiredSize: number | null) => number
+ queryPaneHeight: (queryPaneDesiredSize: number | null, arg: number | undefined) => number
+ queryTabsWidth: (queryPaneDesiredSize: number | null) => number
+ sourceNavigatorResizerProps: (sourceNavigatorResizerProps: ResizerLogicProps) => ResizerLogicProps
+ queryPaneResizerProps: (queryPaneResizerProps: ResizerLogicProps) => ResizerLogicProps
+ sidebarWidth: (sidebarDesiredSize: number | null) => number
+ sidebarResizerProps: (sidebarResizerProps: ResizerLogicProps) => ResizerLogicProps
+ databaseTreeWidth: (databaseTreeDesiredSize: number | null, isDatabaseTreeCollapsed: boolean) => number
+ databaseTreeResizerProps: (databaseTreeResizerProps: ResizerLogicProps) => ResizerLogicProps
+ }
+}
+
+export type editorSizingLogicType = MakeLogicType<
+ editorSizingLogicValues,
+ editorSizingLogicActions,
+ EditorSizingLogicProps,
+ editorSizingLogicMeta
+>
+
export const editorSizingLogic = kea<editorSizingLogicType>([
path(['scenes', 'data-warehouse', 'editor', 'editorSizingLogic']),
props({} as EditorSizingLogicProps),
@@ -97,22 +164,28 @@ export const editorSizingLogic = kea<editorSizingLogicType>([
editorSceneRef: [(p) => [p.editorSceneRef], (editorSceneRef) => editorSceneRef],
sourceNavigatorWidth: [
(s) => [s.sourceNavigatorDesiredSize],
- (desiredSize) => Math.max(desiredSize || NAVIGATOR_DEFAULT_WIDTH, MINIMUM_NAVIGATOR_WIDTH),
+ (desiredSize: number | null) => Math.max(desiredSize || NAVIGATOR_DEFAULT_WIDTH, MINIMUM_NAVIGATOR_WIDTH),
],
queryPaneHeight: [
(s) => [s.queryPaneDesiredSize, (_, props: EditorSizingLogicProps) => props.queryPaneDefaultHeight],
- (queryPaneDesiredSize, queryPaneDefaultHeight) =>
+ (queryPaneDesiredSize: number | null, queryPaneDefaultHeight: number | undefined) =>
Math.max(
queryPaneDesiredSize || queryPaneDefaultHeight || DEFAULT_QUERY_PANE_HEIGHT,
MINIMUM_QUERY_PANE_HEIGHT
),
],
- queryTabsWidth: [(s) => [s.queryPaneDesiredSize], (desiredSize) => desiredSize || NAVIGATOR_DEFAULT_WIDTH],
+ queryTabsWidth: [
+ (s) => [s.queryPaneDesiredSize],
+ (desiredSize: number | null) => desiredSize || NAVIGATOR_DEFAULT_WIDTH,
+ ],
sourceNavigatorResizerProps: [
(_, p) => [p.sourceNavigatorResizerProps],
- (sourceNavigatorResizerProps) => sourceNavigatorResizerProps,
+ (sourceNavigatorResizerProps: ResizerLogicProps) => sourceNavigatorResizerProps,
+ ],
+ queryPaneResizerProps: [
+ (_, p) => [p.queryPaneResizerProps],
+ (queryPaneResizerProps: ResizerLogicProps) => queryPaneResizerProps,
],
- queryPaneResizerProps: [(_, p) => [p.queryPaneResizerProps], (queryPaneResizerProps) => queryPaneResizerProps],
sidebarWidth: [
(s) => [s.sidebarDesiredSize],
(desiredSize: number | null) => {
@@ -125,7 +198,10 @@ export const editorSizingLogic = kea<editorSizingLogicType>([
)
},
],
- sidebarResizerProps: [(_, p) => [p.sidebarResizerProps], (sidebarResizerProps) => sidebarResizerProps],
+ sidebarResizerProps: [
+ (_, p) => [p.sidebarResizerProps],
+ (sidebarResizerProps: ResizerLogicProps) => sidebarResizerProps,
+ ],
databaseTreeWidth: [
(s) => [s.databaseTreeDesiredSize, s.isDatabaseTreeCollapsed],
(desiredSize: number | null, isCollapsed: boolean) => {
@@ -140,7 +216,7 @@ export const editorSizingLogic = kea<editorSizingLogicType>([
],
databaseTreeResizerProps: [
(_, p) => [p.databaseTreeResizerProps],
- (databaseTreeResizerProps) => databaseTreeResizerProps,
+ (databaseTreeResizerProps: ResizerLogicProps) => databaseTreeResizerProps,
],
}),
])
diff --git a/frontend/src/scenes/data-warehouse/editor/fixSQLErrorsLogic.ts b/frontend/src/scenes/data-warehouse/editor/fixSQLErrorsLogic.ts
index 1c19b47a6d52..f72ec33db0da 100644
--- a/frontend/src/scenes/data-warehouse/editor/fixSQLErrorsLogic.ts
+++ b/frontend/src/scenes/data-warehouse/editor/fixSQLErrorsLogic.ts
@@ -1,16 +1,53 @@
-import { actions, kea, path } from 'kea'
+import { MakeLogicType, actions, kea, path } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
-import type { fixSQLErrorsLogicType } from './fixSQLErrorsLogicType'
-
export interface Response {
query: string
trace_id: string
error?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface fixSQLErrorsLogicValues {
+ response: Response | null
+ responseLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface fixSQLErrorsLogicActions {
+ fixErrors: (
+ query: string,
+ error?: string
+ ) => {
+ error: string | undefined
+ query: string
+ }
+ fixErrorsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ fixErrorsSuccess: (
+ response: Response,
+ payload?: {
+ error: string | undefined
+ query: string
+ }
+ ) => {
+ response: Response
+ payload?: {
+ error: string | undefined
+ query: string
+ }
+ }
+}
+
+export type fixSQLErrorsLogicType = MakeLogicType<fixSQLErrorsLogicValues, fixSQLErrorsLogicActions>
+
export const fixSQLErrorsLogic = kea<fixSQLErrorsLogicType>([
path(['scenes', 'data-warehouse', 'editor', 'fixSQLErrorsLogic']),
actions({
diff --git a/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/infoTabLogic.ts b/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/infoTabLogic.ts
index 8c3a0dd579d6..20889f86ee30 100644
--- a/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/infoTabLogic.ts
+++ b/frontend/src/scenes/data-warehouse/editor/output-pane-tabs/infoTabLogic.ts
@@ -1,11 +1,17 @@
-import { afterMount, connect, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, key, path, props, selectors } from 'kea'
import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic'
import { dataWarehouseViewsLogic } from 'scenes/data-warehouse/saved_queries/dataWarehouseViewsLogic'
import { materializationJobsLogic } from 'scenes/data-warehouse/saved_queries/materializationJobsLogic'
+import type {
+ DatabaseSchemaDataWarehouseTable,
+ DatabaseSchemaTable,
+ DatabaseSchemaViewTable,
+ HogQLMetadataResponse,
+} from '../../../../queries/schema/schema-general'
+import type { DataWarehouseSavedQuery } from '../../../../types'
import { sqlEditorLogic } from '../sqlEditorLogic'
-import type { infoTabLogicType } from './infoTabLogicType'
export interface InfoTableRow {
name: string
@@ -20,6 +26,70 @@ export interface InfoTabLogicProps {
viewId?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface infoTabLogicValues {
+ dataWarehouseSavedQueryMap: Record<string, DataWarehouseSavedQuery> // dataWarehouseViewsLogic
+ dataWarehouseTablesMap: Record<string, DatabaseSchemaDataWarehouseTable | DatabaseSchemaViewTable> // databaseTableListLogic
+ posthogTablesMap: Record<string, DatabaseSchemaTable> // databaseTableListLogic
+ metadata: HogQLMetadataResponse | null // sqlEditorLogic
+ sourceTableItems: (
+ | {
+ last_run_at: undefined
+ name: string
+ status: undefined
+ type: string
+ view_id?: undefined
+ }
+ | {
+ last_run_at: string
+ name: string
+ status: string | undefined
+ type: string
+ view_id: string
+ }
+ )[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface infoTabLogicActions {
+ loadUpstream: (modelId: string) => {
+ modelId: string
+ } // sqlEditorLogic
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface infoTabLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ sourceTableItems: (
+ metadata: HogQLMetadataResponse | null,
+ dataWarehouseSavedQueryMap: Record<string, DataWarehouseSavedQuery>
+ ) => (
+ | {
+ last_run_at: undefined
+ name: string
+ status: undefined
+ type: string
+ view_id?: undefined
+ }
+ | {
+ last_run_at: string
+ name: string
+ status: string | undefined
+ type: string
+ view_id: string
+ }
+ )[]
+ }
+}
+
+export type infoTabLogicType = MakeLogicType<
+ infoTabLogicValues,
+ infoTabLogicActions,
+ InfoTabLogicProps,
+ infoTabLogicMeta
+>
+
export const infoTabLogic = kea<infoTabLogicType>([
path(['data-warehouse', 'editor', 'sidebar', 'infoTabLogic']),
props({} as InfoTabLogicProps),
@@ -39,7 +109,10 @@ export const infoTabLogic = kea<infoTabLogicType>([
selectors({
sourceTableItems: [
(s) => [s.metadata, s.dataWarehouseSavedQueryMap],
- (metadata, dataWarehouseSavedQueryMap) => {
+ (
+ metadata: null | import('../../../../queries/schema').HogQLMetadataResponse,
+ dataWarehouseSavedQueryMap: Record<string, import('../../../../types').DataWarehouseSavedQuery>
+ ) => {
if (!metadata) {
return []
}
diff --git a/frontend/src/scenes/data-warehouse/editor/outputPaneLogic.ts b/frontend/src/scenes/data-warehouse/editor/outputPaneLogic.ts
index ae7c28ab39db..c3bbbb9ffb2a 100644
--- a/frontend/src/scenes/data-warehouse/editor/outputPaneLogic.ts
+++ b/frontend/src/scenes/data-warehouse/editor/outputPaneLogic.ts
@@ -1,6 +1,4 @@
-import { actions, kea, key, path, props, reducers } from 'kea'
-
-import type { outputPaneLogicType } from './outputPaneLogicType'
+import { MakeLogicType, actions, kea, key, path, props, reducers } from 'kea'
export enum OutputTab {
Results = 'results',
@@ -12,6 +10,30 @@ export interface OutputTabProps {
tabId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface outputPaneLogicValues {
+ activeTab: OutputTab
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface outputPaneLogicActions {
+ setActiveTab: (tab: OutputTab) => {
+ tab: OutputTab
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface outputPaneLogicMeta {
+ key: string
+}
+
+export type outputPaneLogicType = MakeLogicType<
+ outputPaneLogicValues,
+ outputPaneLogicActions,
+ OutputTabProps,
+ outputPaneLogicMeta
+>
+
export const outputPaneLogic = kea<outputPaneLogicType>([
path(['data-warehouse', 'editor', 'outputPaneLogic']),
props({} as OutputTabProps),
diff --git a/frontend/src/scenes/data-warehouse/editor/queryHistoryLogic.ts b/frontend/src/scenes/data-warehouse/editor/queryHistoryLogic.ts
index 3c9da583a59e..ef5fa68e3bbc 100644
--- a/frontend/src/scenes/data-warehouse/editor/queryHistoryLogic.ts
+++ b/frontend/src/scenes/data-warehouse/editor/queryHistoryLogic.ts
@@ -1,15 +1,25 @@
-import { connect, kea, path, props } from 'kea'
+import { MakeLogicType, connect, kea, path, props } from 'kea'
import { activityLogLogic } from 'lib/components/ActivityLog/activityLogLogic'
import { ActivityScope } from '~/types'
-import type { queryHistoryLogicType } from './queryHistoryLogicType'
+import type { HumanizedActivityLogItem } from '../../../lib/components/ActivityLog/humanizeActivity'
+import type { PaginationManual } from '../../../lib/lemon-ui/PaginationControl/index'
export type QueryHistoryLogicProps = {
id: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface queryHistoryLogicValues {
+ activityLoading: boolean // activityLogLogic
+ humanizedActivity: HumanizedActivityLogItem[] // activityLogLogic
+ pagination: PaginationManual // activityLogLogic
+}
+
+export type queryHistoryLogicType = MakeLogicType<queryHistoryLogicValues, {}, QueryHistoryLogicProps>
+
export const queryHistoryLogic = kea<queryHistoryLogicType>([
path(['scenes', 'data-warehouse', 'editor', 'queryHistoryLogic']),
props({} as QueryHistoryLogicProps),
diff --git a/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx b/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx
index 00c42c9a0772..e45bc85f560d 100644
--- a/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/sidebar/queryDatabaseLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
@@ -37,10 +37,12 @@ import { SourceIcon, mapUrlToProvider } from 'products/data_warehouse/frontend/s
import { joinsLogic } from 'products/data_warehouse/frontend/shared/logics/joinsLogic'
import { sourceManagementLogic } from 'products/data_warehouse/frontend/shared/logics/sourceManagementLogic'
+import type { PaginatedResponse } from '../../../../lib/api'
+import type { DatabaseSchemaViewTable } from '../../../../queries/schema/schema-general'
+import type { ExternalDataSource, UserType } from '../../../../types'
import { dataWarehouseViewsLogic } from '../../saved_queries/dataWarehouseViewsLogic'
import { viewLinkLogic } from '../../viewLinkLogic'
import { draftsLogic } from '../draftsLogic'
-import type { queryDatabaseLogicType } from './queryDatabaseLogicType'
export type EditorSidebarTreeRef = React.RefObject<LemonTreeRef> | null
@@ -1327,6 +1329,442 @@ const getFolderIdFromDropTarget = (items: TreeDataItem[], dropTargetId: string |
return undefined
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface queryDatabaseLogicValues {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[] // dataWarehouseViewsLogic
+ dataWarehouseSavedQueriesLoading: boolean // dataWarehouseViewsLogic
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[] // dataWarehouseViewsLogic
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery> // dataWarehouseViewsLogic
+ materializingViewIds: string[] // dataWarehouseViewsLogic
+ allPosthogTables: DatabaseSchemaTable[] // databaseTableListLogic
+ allTablesMap: Record<string, DatabaseSchemaTable> // databaseTableListLogic
+ connectionId: string | null // databaseTableListLogic
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[] // databaseTableListLogic
+ dataWarehouseTablesMap: Record<string, DatabaseSchemaDataWarehouseTable | DatabaseSchemaViewTable> // databaseTableListLogic
+ databaseLoading: boolean // databaseTableListLogic
+ latestEndpointTables: DatabaseSchemaEndpointTable[] // databaseTableListLogic
+ managedViews: DatabaseSchemaManagedViewTable[] // databaseTableListLogic
+ posthogTables: DatabaseSchemaTable[] // databaseTableListLogic
+ posthogTablesMap: Record<string, DatabaseSchemaTable> // databaseTableListLogic
+ systemTables: DatabaseSchemaTable[] // databaseTableListLogic
+ systemTablesMap: Record<string, DatabaseSchemaTable> // databaseTableListLogic
+ viewsMapById: Record<string, DatabaseSchemaEndpointTable | DatabaseSchemaManagedViewTable | DatabaseSchemaViewTable> // databaseTableListLogic
+ drafts: DataWarehouseSavedQueryDraft[] // draftsLogic
+ draftsResponseLoading: boolean // draftsLogic
+ hasMoreDrafts: boolean // draftsLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ joins: DataWarehouseViewLink[] // joinsLogic
+ joinsLoading: boolean // joinsLogic
+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null // sourceManagementLogic
+ user: UserType | null // userLogic
+ activeDraggedViewId: string | null
+ activeExpandedFolderIds: string[]
+ defaultExpandedRootIds: string[]
+ displayedTreeData: TreeDataItem[]
+ editingDraftId: string | null
+ effectiveDataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ expandedFolders: string[]
+ expandedFoldersByConnection: Record<string, string[]>
+ expandedItemIds: string[]
+ expandedSearchFolders: string[]
+ hasNonPosthogSources: boolean
+ highlightViewsSectionDrop: boolean
+ highlightedDropFolderId: string | null
+ joinsByFieldName: Record<string, DataWarehouseViewLink>
+ pendingViewFolderOverrides: Record<string, string | null>
+ queryTabState: QueryTabState | null
+ queryTabStateLoading: boolean
+ relevantDataWarehouseTables: [DatabaseSchemaDataWarehouseTable, FuseSearchMatch[] | null][]
+ relevantDrafts: [DataWarehouseSavedQueryDraft, FuseSearchMatch[] | null][]
+ relevantEndpointTables: [DatabaseSchemaEndpointTable, FuseSearchMatch[] | null][]
+ relevantManagedViews: [DatabaseSchemaManagedViewTable, FuseSearchMatch[] | null][]
+ relevantPosthogTables: [DatabaseSchemaTable, FuseSearchMatch[] | null][]
+ relevantSavedQueries: [DataWarehouseSavedQuery, FuseSearchMatch[] | null][]
+ relevantSavedQueryFolders: [DataWarehouseSavedQueryFolder, FuseSearchMatch[] | null][]
+ relevantSystemTables: [DatabaseSchemaTable, FuseSearchMatch[] | null][]
+ searchTerm: string
+ searchTreeData: TreeDataItem[]
+ searchTreeMatches: SearchTreeMatches
+ searchTreeSourceContext: SearchTreeSourceContext
+ selectedDirectSource:
+ | {
+ job_inputs?: Record<string, any>
+ }
+ | undefined
+ selectedSchema: DatabaseSchemaDataWarehouseTable | DatabaseSchemaTable | DataWarehouseSavedQuery | null
+ sidebarOverlayTreeItems: TreeItem[]
+ syncMoreNoticeDismissed: boolean
+ treeData: TreeDataItem[]
+ treeDataContext: TreeDataContext
+ treeRef: EditorSidebarTreeRef
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface queryDatabaseLogicActions {
+ createDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?:
+ | (Partial<DataWarehouseSavedQuery> & {
+ dag_id?: string
+ folder_id?: string | null
+ types: string[][]
+ })
+ | undefined
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ dag_id?: string
+ folder_id?: string | null
+ types: string[][]
+ }
+ } // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQuery: (
+ view: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ ) => Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ } // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQueryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?:
+ | (Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ })
+ | undefined
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ } // dataWarehouseViewsLogic
+ loadDrafts: () => any // draftsLogic
+ loadMoreDrafts: () => any // draftsLogic
+ renameDraft: (
+ draftId: string,
+ name: string
+ ) => {
+ draftId: string
+ name: string
+ } // draftsLogic
+ deleteJoin: (join: DataWarehouseViewLink) => {
+ join: DataWarehouseViewLink
+ } // sourceManagementLogic
+ toggleEditJoinModal: (join: DataWarehouseViewLink) => {
+ join: DataWarehouseViewLink
+ } // viewLinkLogic
+ toggleJoinTableModal: () => {
+ value: true
+ } // viewLinkLogic
+ clearDraggedViewState: () => {
+ value: true
+ }
+ clearPendingViewFolderOverride: (viewId: string) => {
+ viewId: string
+ }
+ clearPendingViewFolderOverrides: () => {
+ value: true
+ }
+ clearSearch: () => {
+ value: true
+ }
+ deleteUnsavedQuery: (record: Record<string, any>) => {
+ record: Record<string, any>
+ }
+ deleteUnsavedQueryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteUnsavedQuerySuccess: (
+ queryTabState:
+ | QueryTabState
+ | {
+ id: string
+ state: {
+ editorModelsStateKey: string
+ }
+ }
+ | null,
+ payload?: {
+ record: Record<string, any>
+ }
+ ) => {
+ queryTabState:
+ | QueryTabState
+ | {
+ id: string
+ state: {
+ editorModelsStateKey: string
+ }
+ }
+ | null
+ payload?: {
+ record: Record<string, any>
+ }
+ }
+ loadQueryTabState: () => any
+ loadQueryTabStateFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadQueryTabStateSuccess: (
+ queryTabState: QueryTabState | null,
+ payload?: any
+ ) => {
+ queryTabState: QueryTabState | null
+ payload?: any
+ }
+ moveDraggedViewToDropTarget: (
+ viewId: string,
+ dropTargetId: string | null
+ ) => {
+ dropTargetId: string | null
+ viewId: string
+ }
+ openUnsavedQuery: (record: Record<string, any>) => {
+ record: Record<string, any>
+ }
+ selectSchema: (schema: DatabaseSchemaDataWarehouseTable | DatabaseSchemaTable | DataWarehouseSavedQuery) => {
+ schema: DatabaseSchemaTable | DataWarehouseSavedQuery
+ }
+ selectSourceTable: (tableName: string) => {
+ tableName: string
+ }
+ setDraggedViewDropState: (
+ folderId: string | null,
+ isViewsSectionDrop: boolean
+ ) => {
+ folderId: string | null
+ isViewsSectionDrop: boolean
+ }
+ setEditingDraft: (draftId: string) => {
+ draftId: string
+ }
+ setExpandedFolders: (
+ folderIds: string[],
+ connectionId?: string | null
+ ) => {
+ connectionId: string | null | undefined
+ folderIds: string[]
+ }
+ setExpandedSearchFolders: (folderIds: string[]) => {
+ folderIds: string[]
+ }
+ setPendingViewFolderOverride: (
+ viewId: string,
+ folderId: string | null
+ ) => {
+ folderId: string | null
+ viewId: string
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+ setSyncMoreNoticeDismissed: (dismissed: boolean) => {
+ dismissed: boolean
+ }
+ setTreeRef: (ref: EditorSidebarTreeRef | null) => {
+ ref: EditorSidebarTreeRef
+ }
+ startDraggingView: (viewId: string) => {
+ viewId: string
+ }
+ toggleFolderOpen: (
+ folderId: string,
+ isExpanded: boolean
+ ) => {
+ folderId: string
+ isExpanded: boolean
+ }
+ updateDraggedViewDropTarget: (dropTargetId: string | null) => {
+ dropTargetId: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface queryDatabaseLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasNonPosthogSources: (dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]) => boolean
+ relevantPosthogTables: (
+ posthogTables: DatabaseSchemaTable[],
+ searchTerm: string
+ ) => [DatabaseSchemaTable, FuseSearchMatch[] | null][]
+ relevantSystemTables: (
+ systemTables: DatabaseSchemaTable[],
+ searchTerm: string
+ ) => [DatabaseSchemaTable, FuseSearchMatch[] | null][]
+ relevantDataWarehouseTables: (
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],
+ searchTerm: string
+ ) => [DatabaseSchemaDataWarehouseTable, FuseSearchMatch[] | null][]
+ relevantSavedQueries: (
+ effectiveDataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ searchTerm: string
+ ) => [DataWarehouseSavedQuery, FuseSearchMatch[] | null][]
+ relevantSavedQueryFolders: (
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[],
+ searchTerm: string
+ ) => [DataWarehouseSavedQueryFolder, FuseSearchMatch[] | null][]
+ effectiveDataWarehouseSavedQueries: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ pendingViewFolderOverrides: Record<string, string | null>
+ ) => DataWarehouseSavedQuery[]
+ relevantManagedViews: (
+ managedViews: DatabaseSchemaManagedViewTable[],
+ searchTerm: string
+ ) => [DatabaseSchemaManagedViewTable, FuseSearchMatch[] | null][]
+ relevantDrafts: (
+ drafts: DataWarehouseSavedQueryDraft[],
+ searchTerm: string
+ ) => [DataWarehouseSavedQueryDraft, FuseSearchMatch[] | null][]
+ relevantEndpointTables: (
+ latestEndpointTables: DatabaseSchemaEndpointTable[],
+ searchTerm: string
+ ) => [DatabaseSchemaEndpointTable, FuseSearchMatch[] | null][]
+ selectedDirectSource: (
+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null,
+ connectionId: string | null
+ ) =>
+ | {
+ job_inputs?: Record<string, any>
+ }
+ | undefined
+ searchTreeSourceContext: (
+ allPosthogTables: DatabaseSchemaTable[],
+ systemTables: DatabaseSchemaTable[],
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],
+ effectiveDataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[],
+ managedViews: DatabaseSchemaManagedViewTable[],
+ allTablesMap: Record<string, DatabaseSchemaTable>
+ ) => SearchTreeSourceContext
+ searchTreeMatches: (
+ relevantPosthogTables: [DatabaseSchemaTable, FuseSearchMatch[] | null][],
+ relevantSystemTables: [DatabaseSchemaTable, FuseSearchMatch[] | null][],
+ relevantDataWarehouseTables: [DatabaseSchemaDataWarehouseTable, FuseSearchMatch[] | null][],
+ relevantSavedQueries: [DataWarehouseSavedQuery, FuseSearchMatch[] | null][],
+ relevantSavedQueryFolders: [DataWarehouseSavedQueryFolder, FuseSearchMatch[] | null][],
+ relevantManagedViews: [DatabaseSchemaManagedViewTable, FuseSearchMatch[] | null][],
+ relevantDrafts: [DataWarehouseSavedQueryDraft, FuseSearchMatch[] | null][],
+ relevantEndpointTables: [DatabaseSchemaEndpointTable, FuseSearchMatch[] | null][]
+ ) => SearchTreeMatches
+ searchTreeData: (
+ searchTreeSourceContext: SearchTreeSourceContext,
+ searchTreeMatches: SearchTreeMatches,
+ searchTerm: string,
+ featureFlags: FeatureFlagsSet,
+ expandedSearchFolders: string[],
+ materializingViewIds: string[]
+ ) => TreeDataItem[]
+ treeDataContext: (
+ allPosthogTables: DatabaseSchemaTable[],
+ posthogTables: DatabaseSchemaTable[],
+ systemTables: DatabaseSchemaTable[],
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],
+ effectiveDataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[],
+ managedViews: DatabaseSchemaManagedViewTable[],
+ latestEndpointTables: DatabaseSchemaEndpointTable[],
+ allTablesMap: Record<string, DatabaseSchemaTable>
+ ) => TreeDataContext
+ treeData: (
+ treeDataContext: TreeDataContext,
+ databaseLoading: boolean,
+ dataWarehouseSavedQueriesLoading: boolean,
+ drafts: DataWarehouseSavedQueryDraft[],
+ draftsResponseLoading: boolean,
+ hasMoreDrafts: boolean,
+ featureFlags: FeatureFlagsSet,
+ queryTabState: QueryTabState | null,
+ expandedFolders: string[],
+ materializingViewIds: string[]
+ ) => TreeDataItem[]
+ displayedTreeData: (
+ searchTerm: string,
+ searchTreeData: TreeDataItem[],
+ treeData: TreeDataItem[],
+ connectionId: string | null,
+ selectedDirectSource:
+ | {
+ job_inputs?: Record<string, any>
+ }
+ | undefined
+ ) => TreeDataItem[]
+ activeExpandedFolderIds: (
+ searchTerm: string,
+ expandedSearchFolders: string[],
+ expandedFolders: string[]
+ ) => string[]
+ expandedFolders: (
+ connectionId: string | null,
+ expandedFoldersByConnection: Record<string, string[]>
+ ) => string[]
+ defaultExpandedRootIds: (connectionId: string | null, displayedTreeData: TreeDataItem[]) => string[]
+ expandedItemIds: (activeExpandedFolderIds: string[], defaultExpandedRootIds: string[]) => string[]
+ joinsByFieldName: (joins: DataWarehouseViewLink[]) => Record<string, DataWarehouseViewLink>
+ sidebarOverlayTreeItems: (
+ selectedSchema: DatabaseSchemaTable | DataWarehouseSavedQuery | null,
+ posthogTablesMap: Record<string, DatabaseSchemaTable>,
+ systemTablesMap: Record<string, DatabaseSchemaTable>,
+ dataWarehouseTablesMap: Record<string, DatabaseSchemaDataWarehouseTable | DatabaseSchemaViewTable>,
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery>,
+ viewsMapById: Record<
+ string,
+ DatabaseSchemaEndpointTable | DatabaseSchemaManagedViewTable | DatabaseSchemaViewTable
+ >,
+ joinsByFieldName: Record<string, DataWarehouseViewLink>
+ ) => TreeItem[]
+ }
+}
+
+export type queryDatabaseLogicType = MakeLogicType<
+ queryDatabaseLogicValues,
+ queryDatabaseLogicActions,
+ Record<string, any>,
+ queryDatabaseLogicMeta
+>
+
export const queryDatabaseLogic = kea<queryDatabaseLogicType>([
path(['scenes', 'data-warehouse', 'editor', 'queryDatabaseLogic']),
actions({
@@ -1727,7 +2165,10 @@ export const queryDatabaseLogic = kea<queryDatabaseLogicType>([
],
selectedDirectSource: [
(s) => [s.dataWarehouseSources, s.connectionId],
- (dataWarehouseSources, connectionId): { job_inputs?: Record<string, any> } | undefined => {
+ (
+ dataWarehouseSources: null | import('lib/api').PaginatedResponse<import('~/types').ExternalDataSource>,
+ connectionId: string | null
+ ): { job_inputs?: Record<string, any> } | undefined => {
return dataWarehouseSources?.results.find((source) => source.id === connectionId)
},
],
@@ -2404,13 +2845,21 @@ export const queryDatabaseLogic = kea<queryDatabaseLogicType>([
s.joinsByFieldName,
],
(
- selectedSchema,
- posthogTablesMap,
- systemTablesMap,
- dataWarehouseTablesMap,
- dataWarehouseSavedQueryMapById,
- viewsMapById,
- joinsByFieldName
+ selectedSchema: DatabaseSchemaDataWarehouseTable | DatabaseSchemaTable | DataWarehouseSavedQuery | null,
+ posthogTablesMap: Record<string, DatabaseSchemaTable>,
+ systemTablesMap: Record<string, DatabaseSchemaTable>,
+ dataWarehouseTablesMap: Record<
+ string,
+ DatabaseSchemaDataWarehouseTable | import('~/queries/schema/schema-general').DatabaseSchemaViewTable
+ >,
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery>,
+ viewsMapById: Record<
+ string,
+ | DatabaseSchemaEndpointTable
+ | DatabaseSchemaManagedViewTable
+ | import('~/queries/schema/schema-general').DatabaseSchemaViewTable
+ >,
+ joinsByFieldName: Record<string, DataWarehouseViewLink>
): TreeItem[] => {
if (selectedSchema === null) {
return []
diff --git a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
index 355eaf515969..0ea1a5af1a6a 100644
--- a/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx
@@ -1,6 +1,7 @@
import { Monaco } from '@monaco-editor/react'
import { deepEqual as equal } from 'fast-equals'
import {
+ MakeLogicType,
actions,
afterMount,
beforeUnmount,
@@ -83,16 +84,21 @@ import { DagSelector, openCreateDagDialog } from 'products/data_modeling/fronten
import { sourcesDataLogic } from 'products/data_warehouse/frontend/shared/logics/sourcesDataLogic'
import { validateEndpointName } from 'products/endpoints/frontend/common'
+import type { ExternalDataSourceConnectionOptionApi } from '../../../../../products/warehouse_sources/frontend/generated/api.schemas'
+import type { PaginatedResponse } from '../../../lib/api'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
+import type { DatabaseSchemaQueryResponse, Node } from '../../../queries/schema/schema-general'
+import type { DataModelingDAG, DataWarehouseSavedQueryFolder, UserType } from '../../../types'
import { dataWarehouseViewsLogic } from '../saved_queries/dataWarehouseViewsLogic'
import { validateSavedQueryName } from '../saved_queries/savedQueryNameValidation'
import { dataModelingLogic } from '../scene/dataModelingLogic'
import { connectionSelectorLogic } from './connectionSelectorLogic'
import { draftsLogic } from './draftsLogic'
import { fixSQLErrorsLogic } from './fixSQLErrorsLogic'
+import type { Response } from './fixSQLErrorsLogic'
import { findInnermostSelectAtOffset, findQueryAtCursor, type QueryRange, splitQueries } from './multiQueryUtils'
import { OutputTab, outputPaneLogic } from './outputPaneLogic'
import { resolveSaveCandidates as resolveSaveCandidatesPure, SaveTargetCycler } from './SaveTargetCycler'
-import type { sqlEditorLogicType } from './sqlEditorLogicType'
import { SQLEditorMode, isEmbeddedSQLEditorMode } from './sqlEditorModes'
import {
aiSuggestionOnAccept,
@@ -454,6 +460,602 @@ const LazyQuery = lazyWithRetry(() =>
import('~/queries/Query/Query').then((m) => ({ default: m.Query<DataVisualizationNode> }))
)
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sqlEditorLogicValues {
+ connectionOptions: ExternalDataSourceConnectionOptionApi[] | null // connectionSelectorLogic
+ dags: DataModelingDAG[] // dataModelingLogic
+ selectedDagId: string | null // dataModelingLogic
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[] // dataWarehouseViewsLogic
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[] // dataWarehouseViewsLogic
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery> // dataWarehouseViewsLogic
+ database: Required<DatabaseSchemaQueryResponse> | null // databaseTableListLogic
+ databaseConnectionId: string | null // databaseTableListLogic
+ databaseLoading: boolean // databaseTableListLogic
+ drafts: DataWarehouseSavedQueryDraft[] // draftsLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ outputActiveTab: OutputTab // outputPaneLogic
+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null // sourcesDataLogic
+ user: UserType | null // userLogic
+ acceptText: string
+ accessControlModalOpen: boolean
+ activeQueryOffset: number
+ activeQueryText: string | null
+ activeTab: QueryTab | null
+ changesToSave: boolean
+ currentDraft: DataWarehouseSavedQueryDraft | null | undefined
+ dashboardId: number | null
+ dataLogicKey: string
+ diffShowRunButton: boolean | undefined
+ editingAccessControlObject: DataWarehouseAccessControlModalProps | null
+ editingInsight: QueryBasedInsightModel | null
+ editingView: DataWarehouseSavedQuery | undefined
+ editorKey: string
+ editorSource: SqlEditorSource
+ error: string | null
+ exportContext: ExportContext
+ finishedLoading: boolean
+ fixErrorsError: string | null
+ hasFiltersPlaceholder: boolean
+ hasQueryInput: boolean
+ hoveredNode: string | null
+ inProgressDraftEdits: Record<string, string>
+ inProgressViewEdits: Record<string, string>
+ insightLoading: boolean
+ isDraft: boolean
+ isEditingMaterializedView: boolean
+ isEmbeddedMode: boolean
+ isMultiQuery: boolean
+ isSourceQueryLastRun: boolean
+ lastRunQuery: DataVisualizationNode | null
+ materializationModalOpen: boolean
+ materializationModalView: DataWarehouseSavedQuery | null
+ metadata: HogQLMetadataResponse | null
+ metadataLoading: boolean
+ originalQueryInput: string | null | undefined
+ queryInput: string | null
+ rejectText: string
+ selectedConnectionId: string | undefined
+ selectedConnectionSupportsHogQL: boolean
+ selectedDirectSource: ExternalDataSource | undefined
+ selectedQueryColumns: Record<string, boolean>
+ selectedQueryTablesAndColumns: Record<string, Record<string, boolean>>
+ sendRawQueryEnabled: boolean
+ sourceQuery: DataVisualizationNode
+ splitQueryRanges: QueryRange[]
+ suggestedQueryInput: string
+ suggestedSource: 'hogql_fixer' | 'materialization_fix' | 'max_ai' | null
+ suggestionPayload: SuggestionPayload | null
+ upstream: {
+ edges: DataModelingEdge[]
+ nodes: DataModelingNode[]
+ } | null
+ upstreamLoading: boolean
+ upstreamViewMode: 'graph' | 'table'
+ viewLoading: boolean
+ viewQueryLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sqlEditorLogicActions {
+ loadConnectionOptionsSuccess: (
+ connectionOptions: ExternalDataSourceConnectionOptionApi[],
+ payload?: any
+ ) => {
+ connectionOptions: ExternalDataSourceConnectionOptionApi[]
+ payload?: any
+ } // connectionSelectorLogic
+ maybeLoadConnectionOptions: () => {
+ value: true
+ } // connectionSelectorLogic
+ createDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?:
+ | (Partial<DataWarehouseSavedQuery> & {
+ dag_id?: string
+ folder_id?: string | null
+ types: string[][]
+ })
+ | undefined
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ dag_id?: string
+ folder_id?: string | null
+ types: string[][]
+ }
+ } // dataWarehouseViewsLogic
+ deleteDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?: string | undefined
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: string
+ } // dataWarehouseViewsLogic
+ loadDataWarehouseSavedQueriesSuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?: any
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: any
+ } // dataWarehouseViewsLogic
+ loadDataWarehouseSavedQueryFolders: () => any // dataWarehouseViewsLogic
+ materializeDataWarehouseSavedQuery: (viewId: string) => {
+ viewId: string
+ } // dataWarehouseViewsLogic
+ runDataWarehouseSavedQuery: (viewId: string) => {
+ viewId: string
+ } // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQuery: (
+ view: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ ) => Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ } // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQueryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?:
+ | (Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ })
+ | undefined
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ } // dataWarehouseViewsLogic
+ loadDatabase: ({ force }?: { force?: boolean }) => {
+ force?: boolean
+ } // databaseTableListLogic
+ setConnection: (connectionId: string | null) => {
+ connectionId: string | null
+ } // databaseTableListLogic
+ deleteDraft: (
+ draftId: string,
+ viewName?: string | undefined
+ ) => {
+ draftId: string
+ viewName: string | undefined
+ } // draftsLogic
+ deleteDraftSuccess: (
+ draftId: string,
+ viewName?: string | undefined
+ ) => {
+ draftId: string
+ viewName: string | undefined
+ } // draftsLogic
+ saveAsDraft: (
+ query: HogQLQuery,
+ viewId: string,
+ tab: QueryTab
+ ) => {
+ query: HogQLQuery
+ tab: QueryTab
+ viewId: string
+ } // draftsLogic
+ saveAsDraftSuccess: (
+ draft: DataWarehouseSavedQueryDraft,
+ tab: QueryTab
+ ) => {
+ draft: DataWarehouseSavedQueryDraft
+ tab: QueryTab
+ } // draftsLogic
+ fixErrors: (
+ query: string,
+ error?: string | undefined
+ ) => {
+ error: string | undefined
+ query: string
+ } // fixSQLErrorsLogic
+ fixErrorsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // fixSQLErrorsLogic
+ fixErrorsSuccess: (
+ response: Response,
+ payload?:
+ | {
+ error: string | undefined
+ query: string
+ }
+ | undefined
+ ) => {
+ payload?: {
+ error: string | undefined
+ query: string
+ }
+ response: Response
+ } // fixSQLErrorsLogic
+ setActiveTab: (tab: OutputTab) => {
+ tab: OutputTab
+ } // outputPaneLogic
+ _setSuggestionPayload: (payload: SuggestionPayload | null) => {
+ payload: SuggestionPayload | null
+ }
+ closeAccessControlModal: () => {
+ value: true
+ }
+ closeEditingObject: () => {
+ value: true
+ }
+ closeMaterializationModal: () => {
+ value: true
+ }
+ createTab: (
+ query?: string,
+ view?: DataWarehouseSavedQuery,
+ insight?: QueryBasedInsightModel,
+ draft?: DataWarehouseSavedQueryDraft
+ ) => {
+ draft: DataWarehouseSavedQueryDraft | undefined
+ insight: QueryBasedInsightModel<Node<Record<string, any>>> | undefined
+ query: string | undefined
+ view: DataWarehouseSavedQuery | undefined
+ }
+ deleteInProgressDraftEdit: (draftId: string) => {
+ draftId: string
+ }
+ deleteInProgressViewEdit: (viewId: string) => {
+ viewId: string
+ }
+ editInsight: (
+ query: string,
+ insight: QueryBasedInsightModel
+ ) => {
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ query: string
+ }
+ editView: (
+ query: string,
+ view: DataWarehouseSavedQuery
+ ) => {
+ query: string
+ view: DataWarehouseSavedQuery
+ }
+ enforceConnectionRawQueryMode: () => {
+ value: true
+ }
+ initialize: () => {
+ value: true
+ }
+ insertTextAtCursor: (text: string) => {
+ text: string
+ }
+ loadUpstream: (modelId: string) => {
+ modelId: string
+ }
+ loadUpstreamFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadUpstreamSuccess: (
+ upstream: {
+ edges: DataModelingEdge[]
+ nodes: DataModelingNode[]
+ },
+ payload?: {
+ modelId: string
+ }
+ ) => {
+ upstream: {
+ edges: DataModelingEdge[]
+ nodes: DataModelingNode[]
+ }
+ payload?: {
+ modelId: string
+ }
+ }
+ onAcceptSuggestedQueryInput: (shouldRunQuery?: boolean) => {
+ shouldRunQuery: boolean | undefined
+ }
+ onRejectSuggestedQueryInput: () => {
+ value: true
+ }
+ openAccessControlModal: (editingAccessControlObject: DataWarehouseAccessControlModalProps) => {
+ editingAccessControlObject: DataWarehouseAccessControlModalProps
+ }
+ openMaterializationModal: (view?: DataWarehouseSavedQuery) => {
+ view: DataWarehouseSavedQuery | undefined
+ }
+ reportAIQueryAccepted: () => {
+ value: true
+ }
+ reportAIQueryPromptOpen: () => {
+ value: true
+ }
+ reportAIQueryPrompted: () => {
+ value: true
+ }
+ reportAIQueryRejected: () => {
+ value: true
+ }
+ runQuery: (
+ queryOverride?: string,
+ switchTab?: boolean
+ ) => {
+ queryOverride: string | undefined
+ switchTab: boolean | undefined
+ }
+ runSubquery: () => {
+ value: true
+ }
+ saveAsEndpoint: () => {
+ value: true
+ }
+ saveAsEndpointSubmit: (
+ name: string,
+ description?: string,
+ queryOverride?: string,
+ dagId?: string
+ ) => {
+ dagId: string | undefined
+ description: string | undefined
+ name: string
+ queryOverride: string | undefined
+ }
+ saveAsInsight: () => {
+ value: true
+ }
+ saveAsInsightSubmit: (
+ name: string,
+ queryOverride?: string
+ ) => {
+ name: string
+ queryOverride: string | undefined
+ }
+ saveAsView: (
+ materializeAfterSave?: any,
+ fromDraft?: string
+ ) => {
+ fromDraft: string | undefined
+ materializeAfterSave: any
+ }
+ saveAsViewSubmit: (
+ name: string,
+ materializeAfterSave?: any,
+ fromDraft?: string,
+ dagId?: string,
+ folderId?: string | null,
+ isTest?: any,
+ queryOverride?: string
+ ) => {
+ dagId: string | undefined
+ folderId: string | null | undefined
+ fromDraft: string | undefined
+ isTest: any
+ materializeAfterSave: any
+ name: string
+ queryOverride: string | undefined
+ }
+ saveDraft: (
+ activeTab: QueryTab,
+ queryInput: string,
+ viewId: string
+ ) => {
+ activeTab: QueryTab
+ queryInput: string
+ viewId: string
+ }
+ setActiveQueryText: (
+ activeQueryText: string | null,
+ activeQueryOffset: number
+ ) => {
+ activeQueryOffset: number
+ activeQueryText: string | null
+ }
+ setDashboardId: (dashboardId: number | null) => {
+ dashboardId: number | null
+ }
+ setDataError: (error: string | null) => {
+ error: string | null
+ }
+ setEditingInsightDescription: (description: string) => {
+ description: string
+ }
+ setEditingInsightName: (name: string) => {
+ name: string
+ }
+ setEditorSource: (source: SqlEditorSource) => {
+ source: SqlEditorSource
+ }
+ setError: (error: string | null) => {
+ error: string | null
+ }
+ setFinishedLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setHoveredNode: (nodeId: string | null) => {
+ nodeId: string | null
+ }
+ setInProgressDraftEdit: (
+ draftId: string,
+ historyId: string
+ ) => {
+ draftId: string
+ historyId: string
+ }
+ setInProgressDraftEdits: (inProgressDraftEdits: Record<string, string>) => {
+ inProgressDraftEdits: Record<string, string>
+ }
+ setInProgressViewEdit: (
+ viewId: string,
+ historyId: string
+ ) => {
+ historyId: string
+ viewId: string
+ }
+ setInProgressViewEdits: (inProgressViewEdits: Record<string, string>) => {
+ inProgressViewEdits: Record<string, string>
+ }
+ setInsightLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setLastRunQuery: (lastRunQuery: DataVisualizationNode | null) => {
+ lastRunQuery: DataVisualizationNode | null
+ }
+ setMaterializationModalOpen: (open: boolean) => {
+ open: boolean
+ }
+ setMaterializationModalView: (view: DataWarehouseSavedQuery | null) => {
+ view: DataWarehouseSavedQuery | null
+ }
+ setMetadata: (metadata: HogQLMetadataResponse | null) => {
+ metadata: HogQLMetadataResponse | null
+ }
+ setMetadataLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setQueryInput: (queryInput: string | null) => {
+ queryInput: string | null
+ }
+ setSelectedQueryTablesAndColumns: (tablesAndColumns: Record<string, Record<string, boolean>>) => {
+ tablesAndColumns: Record<string, Record<string, boolean>>
+ }
+ setSendRawQuery: (sendRawQuery: boolean) => {
+ sendRawQuery: boolean
+ }
+ setSourceQuery: (sourceQuery: DataVisualizationNode) => {
+ sourceQuery: DataVisualizationNode
+ }
+ setSuggestedQueryInput: (
+ suggestedQueryInput: string,
+ source?: SuggestionPayload['source']
+ ) => {
+ source: 'hogql_fixer' | 'materialization_fix' | 'max_ai' | undefined
+ suggestedQueryInput: string
+ }
+ setUpstreamViewMode: (mode: 'graph' | 'table') => {
+ mode: 'graph' | 'table'
+ }
+ setViewLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setViewQueryLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ syncUrlWithQuery: () => {
+ value: true
+ }
+ updateInsight: () => {
+ value: true
+ }
+ updateTab: (tab: QueryTab) => {
+ tab: QueryTab
+ }
+ updateView: (
+ view: UpdateViewPayload,
+ draftId?: string
+ ) => {
+ draftId: string | undefined
+ view: UpdateViewPayload
+ }
+ updateViewSuccess: (
+ view: UpdateViewPayload,
+ draftId?: string
+ ) => {
+ draftId: string | undefined
+ view: UpdateViewPayload
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sqlEditorLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ suggestedSource: (
+ suggestionPayload: SuggestionPayload | null
+ ) => 'hogql_fixer' | 'materialization_fix' | 'max_ai' | null
+ diffShowRunButton: (suggestionPayload: SuggestionPayload | null) => boolean | undefined
+ acceptText: (suggestionPayload: SuggestionPayload | null) => string
+ rejectText: (suggestionPayload: SuggestionPayload | null) => string
+ suggestedQueryInput: (suggestionPayload: SuggestionPayload | null, queryInput: string | null) => string
+ originalQueryInput: (
+ suggestionPayload: SuggestionPayload | null,
+ queryInput: string | null
+ ) => string | null | undefined
+ editingView: (activeTab: QueryTab | null) => DataWarehouseSavedQuery | undefined
+ changesToSave: (editingView: DataWarehouseSavedQuery | undefined, queryInput: string | null) => boolean
+ exportContext: (sourceQuery: DataVisualizationNode) => ExportContext
+ selectedConnectionId: (sourceQuery: DataVisualizationNode) => string | undefined
+ selectedDirectSource: (
+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null,
+ selectedConnectionId: string | undefined
+ ) => ExternalDataSource | undefined
+ sendRawQueryEnabled: (sourceQuery: DataVisualizationNode, selectedConnectionId: string | undefined) => boolean
+ selectedConnectionSupportsHogQL: (
+ connectionOptions: ExternalDataSourceConnectionOptionApi[] | null,
+ selectedConnectionId: string | undefined
+ ) => boolean
+ isEditingMaterializedView: (editingView: DataWarehouseSavedQuery | undefined) => boolean
+ splitQueryRanges: (queryInput: string | null) => QueryRange[]
+ isMultiQuery: (splitQueryRanges: QueryRange[]) => boolean
+ isSourceQueryLastRun: (
+ queryInput: string | null,
+ lastRunQuery: DataVisualizationNode | null,
+ sourceQuery: DataVisualizationNode,
+ splitQueryRanges: QueryRange[]
+ ) => boolean
+ hasFiltersPlaceholder: (queryInput: string | null) => boolean
+ hasQueryInput: (queryInput: string | null) => boolean
+ isEmbeddedMode: (arg: SQLEditorMode | undefined) => boolean
+ dataLogicKey: (tabId: string) => string
+ isDraft: (activeTab: QueryTab | null) => boolean
+ currentDraft: (activeTab: QueryTab | null) => DataWarehouseSavedQueryDraft | null | undefined
+ selectedQueryColumns: (
+ selectedQueryTablesAndColumns: Record<string, Record<string, boolean>>
+ ) => Record<string, boolean>
+ }
+}
+
+export type sqlEditorLogicType = MakeLogicType<
+ sqlEditorLogicValues,
+ sqlEditorLogicActions,
+ SqlEditorLogicProps,
+ sqlEditorLogicMeta
+>
+
export const sqlEditorLogic = kea<sqlEditorLogicType>([
path(['data-warehouse', 'editor', 'sqlEditorLogic']),
props({ mode: SQLEditorMode.FullScene } as SqlEditorLogicProps),
@@ -2150,32 +2752,32 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
selectors({
suggestedSource: [
(s) => [s.suggestionPayload],
- (suggestionPayload) => {
+ (suggestionPayload: SuggestionPayload | null) => {
return suggestionPayload?.source ?? null
},
],
diffShowRunButton: [
(s) => [s.suggestionPayload],
- (suggestionPayload) => {
+ (suggestionPayload: SuggestionPayload | null) => {
return suggestionPayload?.diffShowRunButton
},
],
acceptText: [
(s) => [s.suggestionPayload],
- (suggestionPayload) => {
+ (suggestionPayload: SuggestionPayload | null) => {
return suggestionPayload?.acceptText ?? 'Accept'
},
],
rejectText: [
(s) => [s.suggestionPayload],
- (suggestionPayload) => {
+ (suggestionPayload: SuggestionPayload | null) => {
return suggestionPayload?.rejectText ?? 'Reject'
},
],
suggestedQueryInput: [
(s) => [s.suggestionPayload, s.queryInput],
- (suggestionPayload, queryInput) => {
+ (suggestionPayload: SuggestionPayload | null, queryInput: string | null) => {
if (suggestionPayload?.suggestedValue && suggestionPayload?.suggestedValue !== queryInput) {
return suggestionPayload?.suggestedValue ?? ''
}
@@ -2185,7 +2787,7 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
],
originalQueryInput: [
(s) => [s.suggestionPayload, s.queryInput],
- (suggestionPayload, queryInput) => {
+ (suggestionPayload: SuggestionPayload | null, queryInput: string | null) => {
// If we have a suggestion payload, always show diff mode
if (suggestionPayload?.suggestedValue) {
// Prefer the stored originalValue if available, otherwise use current queryInput
@@ -2197,19 +2799,19 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
],
editingView: [
(s) => [s.activeTab],
- (activeTab) => {
+ (activeTab: QueryTab | null) => {
return activeTab?.view
},
],
changesToSave: [
(s) => [s.editingView, s.queryInput],
- (editingView, queryInput) => {
+ (editingView: DataWarehouseSavedQuery | undefined, queryInput: string | null) => {
return editingView?.query?.query !== queryInput
},
],
exportContext: [
(s) => [s.sourceQuery],
- (sourceQuery) => {
+ (sourceQuery: DataVisualizationNode) => {
// TODO: use active tab at some point
const filename = 'export'
@@ -2221,7 +2823,7 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
],
selectedConnectionId: [
(s) => [s.sourceQuery],
- (sourceQuery) => {
+ (sourceQuery: DataVisualizationNode) => {
return sourceQuery.source && 'connectionId' in sourceQuery.source
? sourceQuery.source.connectionId
: undefined
@@ -2229,17 +2831,24 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
],
selectedDirectSource: [
(s) => [s.dataWarehouseSources, s.selectedConnectionId],
- (dataWarehouseSources, selectedConnectionId): ExternalDataSource | undefined => {
+ (
+ dataWarehouseSources: null | import('lib/api').PaginatedResponse<ExternalDataSource>,
+ selectedConnectionId: string | undefined
+ ): ExternalDataSource | undefined => {
return dataWarehouseSources?.results.find((source) => source.id === selectedConnectionId)
},
],
sendRawQueryEnabled: [
(s) => [s.sourceQuery, s.selectedConnectionId],
- (sourceQuery, selectedConnectionId) => !!selectedConnectionId && (sourceQuery.source.sendRawQuery ?? false),
+ (sourceQuery: DataVisualizationNode, selectedConnectionId: string | undefined) =>
+ !!selectedConnectionId && (sourceQuery.source.sendRawQuery ?? false),
],
selectedConnectionSupportsHogQL: [
(s) => [s.connectionOptions, s.selectedConnectionId],
- (connectionOptions, selectedConnectionId): boolean => {
+ (
+ connectionOptions: ExternalDataSourceConnectionOptionApi[] | null,
+ selectedConnectionId: string | undefined
+ ): boolean => {
if (!selectedConnectionId) {
return true
}
@@ -2250,15 +2859,23 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
],
isEditingMaterializedView: [
(s) => [s.editingView],
- (editingView) => {
+ (editingView: DataWarehouseSavedQuery | undefined) => {
return !!editingView?.is_materialized
},
],
- splitQueryRanges: [(s) => [s.queryInput], (queryInput): QueryRange[] => splitQueries(queryInput ?? '')],
- isMultiQuery: [(s) => [s.splitQueryRanges], (ranges): boolean => ranges.length > 1],
+ splitQueryRanges: [
+ (s) => [s.queryInput],
+ (queryInput: string | null): QueryRange[] => splitQueries(queryInput ?? ''),
+ ],
+ isMultiQuery: [(s) => [s.splitQueryRanges], (ranges: QueryRange[]): boolean => ranges.length > 1],
isSourceQueryLastRun: [
(s) => [s.queryInput, s.lastRunQuery, s.sourceQuery, s.splitQueryRanges],
- (queryInput, lastRunQuery, sourceQuery, splitRanges) => {
+ (
+ queryInput: string | null,
+ lastRunQuery: DataVisualizationNode | null,
+ sourceQuery: DataVisualizationNode,
+ splitRanges: QueryRange[]
+ ) => {
const lastRunQueryText = (lastRunQuery?.source.query ?? sourceQuery.source.query ?? '').trim()
if ((queryInput ?? '').trim() === lastRunQueryText) {
return true
@@ -2270,18 +2887,18 @@ export const sqlEditorLogic = kea<sqlEditorLogicType>([
],
hasFiltersPlaceholder: [
(s) => [s.queryInput],
- (queryInput) => {
+ (queryInput: string | null) => {
return queryUsesFiltersPlaceholder(queryInput)
},
],
- hasQueryInput: [(s) => [s.queryInput], (queryInput) => !!queryInput],
+ hasQueryInput: [(s) => [s.queryInput], (queryInput: string | null) => !!queryInput],
isEmbeddedMode: [
() => [(_, p: SqlEditorLogicProps) => p.mode],
- (mode) => isEmbeddedSQLEditorMode(mode ?? SQLEditorMode.FullScene),
+ (mode: SQLEditorMode | undefined) => isEmbeddedSQLEditorMode(mode ?? SQLEditorMode.FullScene),
],
- dataLogicKey: [(_, p) => [p.tabId], (tabId) => `data-warehouse-editor-data-node-${tabId}`],
- isDraft: [(s) => [s.activeTab], (activeTab) => (activeTab ? !!activeTab.draft?.id : false)],
- currentDraft: [(s) => [s.activeTab], (activeTab) => (activeTab ? activeTab.draft : null)],
+ dataLogicKey: [(_, p) => [p.tabId], (tabId: string) => `data-warehouse-editor-data-node-${tabId}`],
+ isDraft: [(s) => [s.activeTab], (activeTab: QueryTab | null) => (activeTab ? !!activeTab.draft?.id : false)],
+ currentDraft: [(s) => [s.activeTab], (activeTab: QueryTab | null) => (activeTab ? activeTab.draft : null)],
selectedQueryColumns: [
(s) => [s.selectedQueryTablesAndColumns],
(tablesAndColumns: Record<string, Record<string, boolean>>): Record<string, boolean> => {
diff --git a/frontend/src/scenes/data-warehouse/editor/suggestions/aiSuggestion.ts b/frontend/src/scenes/data-warehouse/editor/suggestions/aiSuggestion.ts
index 0438b4e40d38..ec6e4ec48cb4 100644
--- a/frontend/src/scenes/data-warehouse/editor/suggestions/aiSuggestion.ts
+++ b/frontend/src/scenes/data-warehouse/editor/suggestions/aiSuggestion.ts
@@ -1,4 +1,4 @@
-import { sqlEditorLogicType } from '../sqlEditorLogicType'
+import type { sqlEditorLogicType } from '../sqlEditorLogic'
// Handlers for AI query suggestions
diff --git a/frontend/src/scenes/data-warehouse/saved_queries/dataWarehouseViewsLogic.tsx b/frontend/src/scenes/data-warehouse/saved_queries/dataWarehouseViewsLogic.tsx
index dc877a18acc9..aa8093972605 100644
--- a/frontend/src/scenes/data-warehouse/saved_queries/dataWarehouseViewsLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/saved_queries/dataWarehouseViewsLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -11,7 +11,8 @@ import { userLogic } from 'scenes/userLogic'
import { DataWarehouseSavedQuery, DataWarehouseSavedQueryFolder } from '~/types'
-import type { dataWarehouseViewsLogicType } from './dataWarehouseViewsLogicType'
+import type { DatabaseSchemaViewTable } from '../../../queries/schema/schema-general'
+import type { UserType } from '../../../types'
// Materialization is async: enabling it flips `is_materialized` either synchronously (the
// /materialize action) or later, when the Temporal job runs (scheduled sync frequency). After
@@ -20,6 +21,261 @@ import type { dataWarehouseViewsLogicType } from './dataWarehouseViewsLogicType'
const MATERIALIZATION_POLL_INTERVAL_MS = 5000
const MATERIALIZATION_POLL_MAX_ATTEMPTS = 12
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseViewsLogicValues {
+ databaseLoading: boolean // databaseTableListLogic
+ views: DatabaseSchemaViewTable[] // databaseTableListLogic
+ user: UserType | null // userLogic
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ dataWarehouseSavedQueriesLoading: boolean
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[]
+ dataWarehouseSavedQueryFoldersById: Record<string, DataWarehouseSavedQueryFolder>
+ dataWarehouseSavedQueryFoldersLoading: boolean
+ dataWarehouseSavedQueryMap: Record<string, DataWarehouseSavedQuery>
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery>
+ dataWarehouseSavedQueryMapByIdStringMap: Record<string, DataWarehouseSavedQuery>
+ initialDataWarehouseSavedQueryLoading: boolean
+ materializingViewIds: string[]
+ shouldShowEmptyState: boolean
+ updatingDataWarehouseSavedQuery: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseViewsLogicActions {
+ refreshDatabaseSchema: () => {
+ value: true
+ } // databaseTableListLogic
+ addMaterializingViews: (viewIds: string[]) => {
+ viewIds: string[]
+ }
+ cancelDataWarehouseSavedQuery: (viewId: string) => {
+ viewId: string
+ }
+ clearMaterializingView: (viewId: string) => {
+ viewId: string
+ }
+ createDataWarehouseSavedQuery: (
+ view: Partial<DataWarehouseSavedQuery> & {
+ dag_id?: string
+ folder_id?: string | null
+ types: string[][]
+ }
+ ) => Partial<DataWarehouseSavedQuery> & {
+ types: string[][]
+ folder_id?: string | null
+ dag_id?: string
+ }
+ createDataWarehouseSavedQueryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createDataWarehouseSavedQueryFolder: (name: string) => string
+ createDataWarehouseSavedQueryFolderFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createDataWarehouseSavedQueryFolderSuccess: (
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[],
+ payload?: string
+ ) => {
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[]
+ payload?: string
+ }
+ createDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ types: string[][]
+ folder_id?: string | null
+ dag_id?: string
+ }
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ types: string[][]
+ folder_id?: string | null
+ dag_id?: string
+ }
+ }
+ deleteDataWarehouseSavedQuery: (viewId: string) => string
+ deleteDataWarehouseSavedQueryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteDataWarehouseSavedQueryFolder: (folderId: string) => string
+ deleteDataWarehouseSavedQueryFolderFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteDataWarehouseSavedQueryFolderSuccess: (
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[],
+ payload?: string
+ ) => {
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[]
+ payload?: string
+ }
+ deleteDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?: string
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: string
+ }
+ loadDataWarehouseSavedQueries: () => any
+ loadDataWarehouseSavedQueriesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDataWarehouseSavedQueriesSuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?: any
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: any
+ }
+ loadDataWarehouseSavedQueryFolders: () => any
+ loadDataWarehouseSavedQueryFoldersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDataWarehouseSavedQueryFoldersSuccess: (
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[],
+ payload?: any
+ ) => {
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[]
+ payload?: any
+ }
+ materializeDataWarehouseSavedQuery: (viewId: string) => {
+ viewId: string
+ }
+ revertMaterialization: (viewId: string) => {
+ viewId: string
+ }
+ runDataWarehouseSavedQuery: (viewId: string) => {
+ viewId: string
+ }
+ updateDataWarehouseSavedQuery: (
+ view: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ ) => Partial<DataWarehouseSavedQuery> & {
+ id: string
+ types?: string[][]
+ sync_frequency?: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ edited_history_id?: string
+ folder_id?: string | null
+ soft_update?: boolean
+ }
+ updateDataWarehouseSavedQueryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateDataWarehouseSavedQueryFolder: ({ id, name }: { id: string; name: string }) => {
+ id: string
+ name: string
+ }
+ updateDataWarehouseSavedQueryFolderFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateDataWarehouseSavedQueryFolderSuccess: (
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[],
+ payload?: {
+ id: string
+ name: string
+ }
+ ) => {
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[]
+ payload?: {
+ id: string
+ name: string
+ }
+ }
+ updateDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ id: string
+ types?: string[][]
+ sync_frequency?: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ edited_history_id?: string
+ folder_id?: string | null
+ soft_update?: boolean
+ }
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ id: string
+ types?: string[][]
+ sync_frequency?: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ edited_history_id?: string
+ folder_id?: string | null
+ soft_update?: boolean
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseViewsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ shouldShowEmptyState: (views: DatabaseSchemaViewTable[], databaseLoading: boolean) => boolean
+ dataWarehouseSavedQueryMapById: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ ) => Record<string, DataWarehouseSavedQuery>
+ dataWarehouseSavedQueryMapByIdStringMap: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ ) => Record<string, DataWarehouseSavedQuery>
+ dataWarehouseSavedQueryMap: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ ) => Record<string, DataWarehouseSavedQuery>
+ dataWarehouseSavedQueryFoldersById: (
+ dataWarehouseSavedQueryFolders: DataWarehouseSavedQueryFolder[]
+ ) => Record<string, DataWarehouseSavedQueryFolder>
+ }
+}
+
+export type dataWarehouseViewsLogicType = MakeLogicType<
+ dataWarehouseViewsLogicValues,
+ dataWarehouseViewsLogicActions,
+ Record<string, any>,
+ dataWarehouseViewsLogicMeta
+>
+
export const dataWarehouseViewsLogic = kea<dataWarehouseViewsLogicType>([
path(['scenes', 'warehouse', 'dataWarehouseSavedQueriesLogic']),
connect(() => ({
@@ -283,13 +539,13 @@ export const dataWarehouseViewsLogic = kea<dataWarehouseViewsLogicType>([
selectors({
shouldShowEmptyState: [
(s) => [s.views, s.databaseLoading],
- (views, databaseLoading): boolean => {
+ (views: import('../../../queries/schema').DatabaseSchemaViewTable[], databaseLoading: boolean): boolean => {
return views?.length == 0 && !databaseLoading
},
],
dataWarehouseSavedQueryMapById: [
(s) => [s.dataWarehouseSavedQueries],
- (dataWarehouseSavedQueries) => {
+ (dataWarehouseSavedQueries: DataWarehouseSavedQuery[]) => {
return (
dataWarehouseSavedQueries?.reduce(
(acc, cur) => {
@@ -304,7 +560,7 @@ export const dataWarehouseViewsLogic = kea<dataWarehouseViewsLogicType>([
// id hyphens are removed. Used for hex'd id paths in DAG
dataWarehouseSavedQueryMapByIdStringMap: [
(s) => [s.dataWarehouseSavedQueries],
- (dataWarehouseSavedQueries) => {
+ (dataWarehouseSavedQueries: DataWarehouseSavedQuery[]) => {
return (
dataWarehouseSavedQueries?.reduce(
(acc, cur) => {
@@ -318,7 +574,7 @@ export const dataWarehouseViewsLogic = kea<dataWarehouseViewsLogicType>([
],
dataWarehouseSavedQueryMap: [
(s) => [s.dataWarehouseSavedQueries],
- (dataWarehouseSavedQueries) => {
+ (dataWarehouseSavedQueries: DataWarehouseSavedQuery[]) => {
return (
dataWarehouseSavedQueries?.reduce(
(acc, cur) => {
@@ -332,7 +588,7 @@ export const dataWarehouseViewsLogic = kea<dataWarehouseViewsLogicType>([
],
dataWarehouseSavedQueryFoldersById: [
(s) => [s.dataWarehouseSavedQueryFolders],
- (folders) => {
+ (folders: DataWarehouseSavedQueryFolder[]) => {
return folders.reduce(
(acc, folder) => {
acc[folder.id] = folder
diff --git a/frontend/src/scenes/data-warehouse/saved_queries/materializationJobsLogic.ts b/frontend/src/scenes/data-warehouse/saved_queries/materializationJobsLogic.ts
index 4e3f39f2e323..67a98bd41f2e 100644
--- a/frontend/src/scenes/data-warehouse/saved_queries/materializationJobsLogic.ts
+++ b/frontend/src/scenes/data-warehouse/saved_queries/materializationJobsLogic.ts
@@ -1,12 +1,25 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, propsChanged, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ propsChanged,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import api, { PaginatedResponse } from 'lib/api'
import { DataModelingJob, DataWarehouseSavedQuery } from '~/types'
+import type { CountedPaginatedResponse } from '../../../lib/api'
import { dataWarehouseViewsLogic } from './dataWarehouseViewsLogic'
-import type { materializationJobsLogicType } from './materializationJobsLogicType'
const REFRESH_INTERVAL = 10000
const DEFAULT_JOBS_PAGE_SIZE = 10
@@ -15,6 +28,110 @@ export interface MaterializationJobsLogicProps {
viewId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface materializationJobsLogicValues {
+ dataModelingJobs: PaginatedResponse<DataModelingJob> | null
+ dataModelingJobsLoading: boolean
+ hasMoreJobsToLoad: boolean
+ savedQuery: DataWarehouseSavedQuery | null
+ savedQueryLoading: boolean
+ startingMaterialization: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface materializationJobsLogicActions {
+ updateDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?:
+ | (Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ })
+ | undefined
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ } // dataWarehouseViewsLogic
+ loadDataModelingJobs: () => any
+ loadDataModelingJobsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDataModelingJobsSuccess: (
+ dataModelingJobs: CountedPaginatedResponse<DataModelingJob>,
+ payload?: any
+ ) => {
+ dataModelingJobs: CountedPaginatedResponse<DataModelingJob>
+ payload?: any
+ }
+ loadOlderDataModelingJobs: () => any
+ loadOlderDataModelingJobsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadOlderDataModelingJobsSuccess: (
+ dataModelingJobs: PaginatedResponse<DataModelingJob> | null,
+ payload?: any
+ ) => {
+ dataModelingJobs: PaginatedResponse<DataModelingJob> | null
+ payload?: any
+ }
+ loadSavedQuery: () => any
+ loadSavedQueryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSavedQuerySuccess: (
+ savedQuery: DataWarehouseSavedQuery | null,
+ payload?: any
+ ) => {
+ savedQuery: DataWarehouseSavedQuery | null
+ payload?: any
+ }
+ setStartingMaterialization: (starting: boolean) => {
+ starting: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface materializationJobsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ hasMoreJobsToLoad: (dataModelingJobs: PaginatedResponse<DataModelingJob> | null) => boolean
+ }
+}
+
+export type materializationJobsLogicType = MakeLogicType<
+ materializationJobsLogicValues,
+ materializationJobsLogicActions,
+ MaterializationJobsLogicProps,
+ materializationJobsLogicMeta
+>
+
export const materializationJobsLogic = kea<materializationJobsLogicType>([
path(['scenes', 'data-warehouse', 'saved_queries', 'materializationJobsLogic']),
props({} as MaterializationJobsLogicProps),
@@ -86,7 +203,10 @@ export const materializationJobsLogic = kea<materializationJobsLogicType>([
],
}),
selectors({
- hasMoreJobsToLoad: [(s) => [s.dataModelingJobs], (dataModelingJobs) => !!dataModelingJobs?.next],
+ hasMoreJobsToLoad: [
+ (s) => [s.dataModelingJobs],
+ (dataModelingJobs: PaginatedResponse<DataModelingJob> | null) => !!dataModelingJobs?.next,
+ ],
}),
afterMount(({ actions, props }) => {
if (props.viewId) {
diff --git a/frontend/src/scenes/data-warehouse/scene/dataModelingLogic.ts b/frontend/src/scenes/data-warehouse/scene/dataModelingLogic.ts
index 45d1fce3bd33..85e1a627d0ee 100644
--- a/frontend/src/scenes/data-warehouse/scene/dataModelingLogic.ts
+++ b/frontend/src/scenes/data-warehouse/scene/dataModelingLogic.ts
@@ -9,7 +9,7 @@ import {
applyNodeChanges,
} from '@xyflow/react'
import { deepEqual as equal } from 'fast-equals'
-import { actions, afterMount, beforeUnmount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, beforeUnmount, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import type { RefObject } from 'react'
@@ -24,7 +24,6 @@ import {
DataModelingNodeType,
} from '~/types'
-import type { dataModelingLogicType } from './dataModelingLogicType'
import { getFormattedNodes } from './modeling/autolayout'
import { PAGE_SIZE } from './modeling/constants'
import { Edge, ElkDirection, Node, NodeHandle, SearchMode, ViewMode } from './modeling/types'
@@ -93,6 +92,311 @@ export function parseSearchTerm(searchTerm: string): ParsedSearch {
return { mode: 'search', baseName: trimmed }
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataModelingLogicValues {
+ availableDagIds: string[]
+ availableTypes: DataModelingNodeType[]
+ currentPage: number
+ dags: DataModelingDAG[]
+ dagsLoading: boolean
+ dataModelingEdges: DataModelingEdge[]
+ dataModelingEdgesLoading: boolean
+ dataModelingNodes: DataModelingNode[]
+ dataModelingNodesLoading: boolean
+ debouncedSearchTerm: string
+ edges: Edge[]
+ enrichedEdges: Edge[]
+ enrichedNodes: Node[]
+ filterDagIds: string[]
+ filterTypes: DataModelingNodeType[]
+ filteredNodes: DataModelingNode[]
+ graphReady: boolean
+ highlightedNodeIds: (baseName: string, mode: 'all' | 'downstream' | 'upstream') => Set<string>
+ highlightedNodeType: DataModelingNodeType | null
+ hoveredNodeId: string | null
+ latestJobMetadataByNodeId: Record<
+ string,
+ {
+ lastRunAt: string | null
+ status: DataModelingJobStatus
+ }
+ >
+ latestJobMetadataBySavedQueryId: Record<
+ string,
+ {
+ lastRunAt: string | null
+ status: DataModelingJobStatus
+ }
+ >
+ layoutDirection: ElkDirection
+ nodeTypePanelCollapsed: boolean
+ nodes: Node[]
+ nodesById: Record<string, Node>
+ nodesLoading: boolean
+ parsedSearch: ParsedSearch
+ reactFlowInstance: ReactFlowInstance<Node, Edge> | null
+ reactFlowWrapper: RefObject<HTMLDivElement> | null
+ runningNodeIds: Set<string>
+ savedViewport: Viewport | null
+ searchTerm: string
+ selectedDag: DataModelingDAG | null
+ selectedDagId: string | null
+ viewMode: ViewMode
+ viewNodes: DataModelingNode[]
+ visibleNodes: DataModelingNode[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataModelingLogicActions {
+ clearFilterDagIds: () => {
+ value: true
+ }
+ clearFilterTypes: () => {
+ value: true
+ }
+ loadDags: () => any
+ loadDagsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDagsSuccess: (
+ dags: DataModelingDAG[],
+ payload?: any
+ ) => {
+ dags: DataModelingDAG[]
+ payload?: any
+ }
+ loadDataModelingEdges: () => any
+ loadDataModelingEdgesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDataModelingEdgesSuccess: (
+ dataModelingEdges: DataModelingEdge[],
+ payload?: any
+ ) => {
+ dataModelingEdges: DataModelingEdge[]
+ payload?: any
+ }
+ loadDataModelingNodes: () => any
+ loadDataModelingNodesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDataModelingNodesSuccess: (
+ dataModelingNodes: DataModelingNode[],
+ payload?: any
+ ) => {
+ dataModelingNodes: DataModelingNode[]
+ payload?: any
+ }
+ loadRecentJobs: () => {
+ value: true
+ }
+ loadRecentJobsSuccess: (recentJobs: DataModelingJob[]) => {
+ recentJobs: DataModelingJob[]
+ }
+ materializeNode: (nodeId: string) => {
+ nodeId: string
+ }
+ materializeNodeFailure: (
+ nodeId: string,
+ error: string
+ ) => {
+ error: string
+ nodeId: string
+ }
+ materializeNodeSuccess: (nodeId: string) => {
+ nodeId: string
+ }
+ onEdgesChange: (edges: EdgeChange<Edge>[]) => {
+ edges: EdgeChange<Edge>[]
+ }
+ onNodesChange: (nodes: NodeChange<Node>[]) => {
+ nodes: NodeChange<Node>[]
+ }
+ pollRunningJobs: () => {
+ value: true
+ }
+ pollRunningJobsSuccess: (runningJobs: DataModelingJob[]) => {
+ runningJobs: DataModelingJob[]
+ }
+ resetGraph: (
+ dataModelingNodes: DataModelingNode[],
+ dataModelingEdges: DataModelingEdge[],
+ fitViewAfter?: boolean
+ ) => {
+ dataModelingEdges: DataModelingEdge[]
+ dataModelingNodes: DataModelingNode[]
+ fitViewAfter: boolean | undefined
+ }
+ runNode: (
+ nodeId: string,
+ direction: 'downstream' | 'upstream'
+ ) => {
+ direction: 'downstream' | 'upstream'
+ nodeId: string
+ }
+ runNodeFailure: (
+ nodeId: string,
+ direction: 'downstream' | 'upstream',
+ error: string
+ ) => {
+ direction: 'downstream' | 'upstream'
+ error: string
+ nodeId: string
+ }
+ runNodeSuccess: (
+ nodeId: string,
+ direction: 'downstream' | 'upstream',
+ runningNodeIds: string[]
+ ) => {
+ direction: 'downstream' | 'upstream'
+ nodeId: string
+ runningNodeIds: string[]
+ }
+ setCurrentPage: (page: number) => {
+ page: number
+ }
+ setDebouncedSearchTerm: (debouncedSearchTerm: string) => {
+ debouncedSearchTerm: string
+ }
+ setEdges: (edges: Edge[]) => {
+ edges: Edge[]
+ }
+ setGraphReady: (ready: boolean) => {
+ ready: boolean
+ }
+ setHighlightedNodeType: (highlightedNodeType: DataModelingNodeType | null) => {
+ highlightedNodeType: DataModelingNodeType | null
+ }
+ setHoveredNodeId: (hoveredNodeId: string | null) => {
+ hoveredNodeId: string | null
+ }
+ setLayoutDirection: (layoutDirection: ElkDirection) => {
+ layoutDirection: ElkDirection
+ }
+ setNodeTypePanelCollapsed: (collapsed: boolean) => {
+ collapsed: boolean
+ }
+ setNodes: (
+ nodes: Node[],
+ fitViewAfter?: boolean
+ ) => {
+ fitViewAfter: boolean | undefined
+ nodes: Node[]
+ }
+ setNodesRaw: (nodes: Node[]) => {
+ nodes: Node[]
+ }
+ setReactFlowInstance: (reactFlowInstance: ReactFlowInstance<Node, Edge>) => {
+ reactFlowInstance: ReactFlowInstance<Node, Edge>
+ }
+ setReactFlowWrapper: (reactFlowWrapper: RefObject<HTMLDivElement>) => {
+ reactFlowWrapper: RefObject<HTMLDivElement>
+ }
+ setRunningNodeIds: (runningNodeIds: Set<string>) => {
+ runningNodeIds: Set<string>
+ }
+ setSavedViewport: (viewport: Viewport) => {
+ viewport: Viewport
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+ setSelectedDagId: (dagId: string | null) => {
+ dagId: string | null
+ }
+ setViewMode: (viewMode: ViewMode) => {
+ viewMode: ViewMode
+ }
+ startPollingRunningJobs: () => {
+ value: true
+ }
+ stopPollingRunningJobs: () => {
+ value: true
+ }
+ toggleFilterDagId: (dagId: string) => {
+ dagId: string
+ }
+ toggleFilterType: (nodeType: DataModelingNodeType) => {
+ nodeType: DataModelingNodeType
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataModelingLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ nodesById: (nodes: Node[]) => Record<string, Node>
+ nodesLoading: (
+ dataModelingNodesLoading: boolean,
+ dataModelingEdgesLoading: boolean,
+ graphReady: boolean,
+ viewMode: ViewMode
+ ) => boolean
+ latestJobMetadataByNodeId: (
+ nodes: Node[],
+ latestJobMetadataBySavedQueryId: Record<
+ string,
+ {
+ lastRunAt: string | null
+ status: DataModelingJobStatus
+ }
+ >
+ ) => Record<
+ string,
+ {
+ lastRunAt: string | null
+ status: DataModelingJobStatus
+ }
+ >
+ enrichedNodes: (
+ nodes: Node[],
+ runningNodeIds: Set<string>,
+ highlightedNodeType: DataModelingNodeType | null,
+ latestJobMetadataByNodeId: Record<
+ string,
+ {
+ lastRunAt: string | null
+ status: DataModelingJobStatus
+ }
+ >
+ ) => Node[]
+ enrichedEdges: (edges: Edge[], hoveredNodeId: string | null) => Edge[]
+ highlightedNodeIds: (
+ nodes: Node[],
+ edges: Edge[]
+ ) => (baseName: string, mode: 'all' | 'downstream' | 'upstream') => Set<string>
+ parsedSearch: (debouncedSearchTerm: string) => ParsedSearch
+ filteredNodes: (dataModelingNodes: DataModelingNode[], searchTerm: string) => DataModelingNode[]
+ selectedDag: (dags: DataModelingDAG[], selectedDagId: string | null) => DataModelingDAG | null
+ availableDagIds: (filteredNodes: DataModelingNode[]) => string[]
+ availableTypes: (filteredNodes: DataModelingNode[]) => DataModelingNodeType[]
+ viewNodes: (
+ filteredNodes: DataModelingNode[],
+ filterDagIds: string[],
+ filterTypes: DataModelingNodeType[]
+ ) => DataModelingNode[]
+ visibleNodes: (viewNodes: DataModelingNode[], currentPage: number) => DataModelingNode[]
+ }
+}
+
+export type dataModelingLogicType = MakeLogicType<
+ dataModelingLogicValues,
+ dataModelingLogicActions,
+ Record<string, any>,
+ dataModelingLogicMeta
+>
+
export const dataModelingLogic = kea<dataModelingLogicType>([
path(['scenes', 'data-warehouse', 'scene', 'dataModelingLogic']),
actions({
@@ -352,7 +656,7 @@ export const dataModelingLogic = kea<dataModelingLogicType>([
selectors({
nodesById: [
(s) => [s.nodes],
- (nodes): Record<string, Node> => {
+ (nodes: Node[]): Record<string, Node> => {
return nodes.reduce(
(acc, node) => {
acc[node.id] = node
@@ -375,8 +679,14 @@ export const dataModelingLogic = kea<dataModelingLogicType>([
latestJobMetadataByNodeId: [
(s) => [s.nodes, s.latestJobMetadataBySavedQueryId],
(
- nodes,
- latestJobMetadataBySavedQueryId
+ nodes: Node[],
+ latestJobMetadataBySavedQueryId: Record<
+ string,
+ {
+ lastRunAt: string | null
+ status: DataModelingJobStatus
+ }
+ >
): Record<string, { status: DataModelingJobStatus; lastRunAt: string | null }> => {
const map: Record<string, { status: DataModelingJobStatus; lastRunAt: string | null }> = {}
for (const node of nodes) {
@@ -390,7 +700,18 @@ export const dataModelingLogic = kea<dataModelingLogicType>([
],
enrichedNodes: [
(s) => [s.nodes, s.runningNodeIds, s.highlightedNodeType, s.latestJobMetadataByNodeId],
- (nodes, runningNodeIds, highlightedNodeType, latestJobMetadataByNodeId): Node[] => {
+ (
+ nodes: Node[],
+ runningNodeIds: Set<string>,
+ highlightedNodeType: DataModelingNodeType | null,
+ latestJobMetadataByNodeId: Record<
+ string,
+ {
+ lastRunAt: string | null
+ status: DataModelingJobStatus
+ }
+ >
+ ): Node[] => {
return nodes.map((node) => {
const isRunning = runningNodeIds.has(node.id)
const isTypeHighlighted = highlightedNodeType !== null && highlightedNodeType === node.data.type
@@ -424,7 +745,7 @@ export const dataModelingLogic = kea<dataModelingLogicType>([
],
enrichedEdges: [
(s) => [s.edges, s.hoveredNodeId],
- (edges, hoveredNodeId): Edge[] => {
+ (edges: Edge[], hoveredNodeId: string | null): Edge[] => {
if (!hoveredNodeId) {
return edges
}
@@ -447,7 +768,10 @@ export const dataModelingLogic = kea<dataModelingLogicType>([
],
highlightedNodeIds: [
(s) => [s.nodes, s.edges],
- (nodes, edges): ((baseName: string, mode: 'upstream' | 'downstream' | 'all') => Set<string>) => {
+ (
+ nodes: Node[],
+ edges: Edge[]
+ ): ((baseName: string, mode: 'upstream' | 'downstream' | 'all') => Set<string>) => {
const { upstream, downstream } = buildAdjacencyMaps(edges)
return (baseName: string, mode: 'upstream' | 'downstream' | 'all'): Set<string> => {
diff --git a/frontend/src/scenes/data-warehouse/scene/managedWarehouseDataStatusLogic.ts b/frontend/src/scenes/data-warehouse/scene/managedWarehouseDataStatusLogic.ts
index db98ca55f937..1a0b22449a49 100644
--- a/frontend/src/scenes/data-warehouse/scene/managedWarehouseDataStatusLogic.ts
+++ b/frontend/src/scenes/data-warehouse/scene/managedWarehouseDataStatusLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, connect, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, listeners, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { teamLogic } from 'scenes/teamLogic'
@@ -9,12 +9,51 @@ import type {
ManagedWarehouseReadinessStateEnumApi,
} from 'products/data_warehouse/frontend/generated/api.schemas'
-import type { managedWarehouseDataStatusLogicType } from './managedWarehouseDataStatusLogicType'
-
const ACTIVE_REFRESH_INTERVAL_MS = 15_000
const STABLE_REFRESH_INTERVAL_MS = 60_000
const ACTIVE_STATES: ManagedWarehouseReadinessStateEnumApi[] = ['waiting', 'backfilling', 'catching_up']
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface managedWarehouseDataStatusLogicValues {
+ currentTeamId: number | null // teamLogic
+ hasActiveWork: boolean
+ managedWarehouseDataStatus: ManagedWarehouseDataStatusResponseApi | null
+ managedWarehouseDataStatusLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface managedWarehouseDataStatusLogicActions {
+ loadManagedWarehouseDataStatus: () => any
+ loadManagedWarehouseDataStatusFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadManagedWarehouseDataStatusSuccess: (
+ managedWarehouseDataStatus: ManagedWarehouseDataStatusResponseApi,
+ payload?: any
+ ) => {
+ managedWarehouseDataStatus: ManagedWarehouseDataStatusResponseApi
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface managedWarehouseDataStatusLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasActiveWork: (managedWarehouseDataStatus: ManagedWarehouseDataStatusResponseApi | null) => boolean
+ }
+}
+
+export type managedWarehouseDataStatusLogicType = MakeLogicType<
+ managedWarehouseDataStatusLogicValues,
+ managedWarehouseDataStatusLogicActions,
+ Record<string, any>,
+ managedWarehouseDataStatusLogicMeta
+>
+
export const managedWarehouseDataStatusLogic = kea<managedWarehouseDataStatusLogicType>([
path(['scenes', 'data-warehouse', 'scene', 'managedWarehouseDataStatusLogic']),
connect(() => ({
@@ -33,7 +72,7 @@ export const managedWarehouseDataStatusLogic = kea<managedWarehouseDataStatusLog
selectors({
hasActiveWork: [
(s) => [s.managedWarehouseDataStatus],
- (managedWarehouseDataStatus): boolean =>
+ (managedWarehouseDataStatus: ManagedWarehouseDataStatusResponseApi | null): boolean =>
managedWarehouseDataStatus !== null &&
ACTIVE_STATES.includes(managedWarehouseDataStatus.overall_readiness_state),
],
diff --git a/frontend/src/scenes/data-warehouse/scene/sourceSchemasModalLogic.ts b/frontend/src/scenes/data-warehouse/scene/sourceSchemasModalLogic.ts
index 4a6037a1da34..91ab111fca94 100644
--- a/frontend/src/scenes/data-warehouse/scene/sourceSchemasModalLogic.ts
+++ b/frontend/src/scenes/data-warehouse/scene/sourceSchemasModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { teamLogic } from 'scenes/teamLogic'
@@ -6,8 +6,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { dataWarehouseManagedWarehouseSourceSchemasRetrieve } from 'products/data_warehouse/frontend/generated/api'
import type { ManagedWarehouseSourceTableStatusApi } from 'products/data_warehouse/frontend/generated/api.schemas'
-import type { sourceSchemasModalLogicType } from './sourceSchemasModalLogicType'
-
export interface ActiveSource {
sourceId: string
sourceName: string
@@ -20,6 +18,41 @@ function isStale(sourceId: string, activeSource: ActiveSource | null): boolean {
return activeSource?.sourceId !== sourceId
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sourceSchemasModalLogicValues {
+ activeSource: ActiveSource | null
+ sourceSchemas: ManagedWarehouseSourceTableStatusApi[]
+ sourceSchemasError: boolean
+ sourceSchemasLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sourceSchemasModalLogicActions {
+ closeSourceSchemasModal: () => {
+ value: true
+ }
+ loadSourceSchemas: ({ sourceId }: ActiveSource) => ActiveSource
+ loadSourceSchemasFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSourceSchemasSuccess: (
+ sourceSchemas: ManagedWarehouseSourceTableStatusApi[],
+ payload?: ActiveSource
+ ) => {
+ sourceSchemas: ManagedWarehouseSourceTableStatusApi[]
+ payload?: ActiveSource
+ }
+ setSourceSchemasError: (hasError: boolean) => {
+ hasError: boolean
+ }
+}
+
+export type sourceSchemasModalLogicType = MakeLogicType<sourceSchemasModalLogicValues, sourceSchemasModalLogicActions>
+
export const sourceSchemasModalLogic = kea<sourceSchemasModalLogicType>([
path(['scenes', 'data-warehouse', 'scene', 'sourceSchemasModalLogic']),
actions({
diff --git a/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts b/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts
index e6e522385f26..6daaac65f263 100644
--- a/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts
+++ b/frontend/src/scenes/data-warehouse/scene/viewsTabLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { LemonDialog } from '@posthog/lemon-ui'
@@ -13,11 +13,164 @@ import {
DataWarehouseSavedQueryRunHistory,
} from '~/types'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
import { dataWarehouseViewsLogic } from '../saved_queries/dataWarehouseViewsLogic'
-import type { viewsTabLogicType } from './viewsTabLogicType'
export const PAGE_SIZE = 10
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface viewsTabLogicValues {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[] // dataWarehouseViewsLogic
+ dataWarehouseSavedQueriesLoading: boolean // dataWarehouseViewsLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ accessControlModalOpen: boolean
+ editingAccessControlView: DataWarehouseSavedQuery | null
+ enrichedMaterializedViews: DataWarehouseSavedQuery[]
+ enrichedViews: DataWarehouseSavedQuery[]
+ filteredMaterializedViews: DataWarehouseSavedQuery[]
+ filteredViews: DataWarehouseSavedQuery[]
+ materializedViewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>
+ materializedViewDependenciesMapLoading: boolean
+ materializedViewsCurrentPage: number
+ runHistoryMap: Record<string, DataWarehouseSavedQueryRunHistory[]>
+ runHistoryMapLoading: boolean
+ searchTerm: string
+ viewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>
+ viewDependenciesMapLoading: boolean
+ viewsCurrentPage: number
+ viewsLoading: boolean
+ visibleMaterializedViews: DataWarehouseSavedQuery[]
+ visibleViews: DataWarehouseSavedQuery[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface viewsTabLogicActions {
+ deleteDataWarehouseSavedQuery: (viewId: string) => string // dataWarehouseViewsLogic
+ runDataWarehouseSavedQuery: (viewId: string) => {
+ viewId: string
+ } // dataWarehouseViewsLogic
+ closeAccessControlModal: () => {
+ value: true
+ }
+ deleteView: (viewId: string) => {
+ viewId: string
+ }
+ loadDependenciesForMaterializedViews: (viewIds: string[]) => {
+ viewIds: string[]
+ }
+ loadDependenciesForMaterializedViewsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDependenciesForMaterializedViewsSuccess: (
+ materializedViewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>,
+ payload?: {
+ viewIds: string[]
+ }
+ ) => {
+ materializedViewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>
+ payload?: {
+ viewIds: string[]
+ }
+ }
+ loadDependenciesForViews: (viewIds: string[]) => {
+ viewIds: string[]
+ }
+ loadDependenciesForViewsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadDependenciesForViewsSuccess: (
+ viewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>,
+ payload?: {
+ viewIds: string[]
+ }
+ ) => {
+ viewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>
+ payload?: {
+ viewIds: string[]
+ }
+ }
+ loadRunHistoryForViews: (viewIds: string[]) => {
+ viewIds: string[]
+ }
+ loadRunHistoryForViewsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRunHistoryForViewsSuccess: (
+ runHistoryMap: Record<string, DataWarehouseSavedQueryRunHistory[]>,
+ payload?: {
+ viewIds: string[]
+ }
+ ) => {
+ runHistoryMap: Record<string, DataWarehouseSavedQueryRunHistory[]>
+ payload?: {
+ viewIds: string[]
+ }
+ }
+ loadVisibleData: () => {
+ value: true
+ }
+ openAccessControlModal: (view: DataWarehouseSavedQuery) => {
+ view: DataWarehouseSavedQuery
+ }
+ runMaterialization: (viewId: string) => {
+ viewId: string
+ }
+ setMaterializedViewsPage: (page: number) => {
+ page: number
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+ setViewsPage: (page: number) => {
+ page: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface viewsTabLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ viewsLoading: (dataWarehouseSavedQueriesLoading: boolean) => boolean
+ enrichedMaterializedViews: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ materializedViewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>,
+ runHistoryMap: Record<string, DataWarehouseSavedQueryRunHistory[]>
+ ) => DataWarehouseSavedQuery[]
+ enrichedViews: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ viewDependenciesMap: Record<string, DataWarehouseSavedQueryDependencies>
+ ) => DataWarehouseSavedQuery[]
+ filteredViews: (enrichedViews: DataWarehouseSavedQuery[], searchTerm: string) => DataWarehouseSavedQuery[]
+ filteredMaterializedViews: (
+ enrichedMaterializedViews: DataWarehouseSavedQuery[],
+ searchTerm: string
+ ) => DataWarehouseSavedQuery[]
+ visibleMaterializedViews: (
+ filteredMaterializedViews: DataWarehouseSavedQuery[],
+ materializedViewsCurrentPage: number
+ ) => DataWarehouseSavedQuery[]
+ visibleViews: (filteredViews: DataWarehouseSavedQuery[], viewsCurrentPage: number) => DataWarehouseSavedQuery[]
+ }
+}
+
+export type viewsTabLogicType = MakeLogicType<
+ viewsTabLogicValues,
+ viewsTabLogicActions,
+ Record<string, any>,
+ viewsTabLogicMeta
+>
+
export const viewsTabLogic = kea<viewsTabLogicType>([
path(['scenes', 'data-warehouse', 'scene', 'viewsTabLogic']),
connect(() => ({
@@ -174,7 +327,7 @@ export const viewsTabLogic = kea<viewsTabLogicType>([
],
})),
selectors({
- viewsLoading: [(s) => [s.dataWarehouseSavedQueriesLoading], (loading): boolean => loading],
+ viewsLoading: [(s) => [s.dataWarehouseSavedQueriesLoading], (loading: boolean): boolean => loading],
enrichedMaterializedViews: [
(s) => [s.dataWarehouseSavedQueries, s.materializedViewDependenciesMap, s.runHistoryMap],
(
diff --git a/frontend/src/scenes/data-warehouse/scene/warehouseProvisioningLogic.ts b/frontend/src/scenes/data-warehouse/scene/warehouseProvisioningLogic.ts
index 97caac1ef0a4..e6bccb7221c4 100644
--- a/frontend/src/scenes/data-warehouse/scene/warehouseProvisioningLogic.ts
+++ b/frontend/src/scenes/data-warehouse/scene/warehouseProvisioningLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
@@ -18,7 +18,7 @@ import {
} from 'products/data_warehouse/frontend/generated/api'
import type { WarehouseStatusResponseApi } from 'products/data_warehouse/frontend/generated/api.schemas'
-import type { warehouseProvisioningLogicType } from './warehouseProvisioningLogicType'
+import type { PreflightStatus } from '../../../types'
// The warehouse name becomes the connection's SNI subdomain (a DNS-1123 label), so it
// mirrors the backend validator in products/data_warehouse/backend/api/managed_warehouse.py:
@@ -48,6 +48,148 @@ const DELETING_POLL_WARN_THRESHOLD = 18
const currentProjectId = (): string => String(teamLogic.values.currentTeamId)
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface warehouseProvisioningLogicValues {
+ preflight: PreflightStatus | null // preflightLogic
+ backfillTableSuffix: string | null
+ canProvision: boolean
+ canRetryProvision: boolean
+ databaseName: string
+ databaseNameAvailable: boolean | null
+ databaseNameChecking: boolean
+ deletingPollCount: number
+ deprovisionTakingLong: boolean
+ hasBackfill: boolean
+ initialPassword: string | null
+ isActionable: boolean
+ isDeletingOrg: boolean
+ isDeprovisioning: boolean
+ isEnablingBackfill: boolean
+ isInProgress: boolean
+ isProvisioning: boolean
+ isResettingPassword: boolean
+ isValidDatabaseName: boolean
+ isValidTableName: boolean
+ lastRequestedDatabaseName: string | null
+ orgDeletionFailed: boolean
+ orgDeletionSucceeded: boolean
+ pollingActive: boolean
+ retryDatabaseName: string
+ tableName: string
+ warehouseDomain: string | null
+ warehouseStatus: WarehouseStatusResponseApi | null
+ warehouseStatusLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface warehouseProvisioningLogicActions {
+ checkDatabaseName: (name: string) => {
+ name: string
+ }
+ clearInitialPassword: () => {
+ value: true
+ }
+ deleteOrg: () => {
+ value: true
+ }
+ deleteOrgComplete: (success: boolean) => {
+ success: boolean
+ }
+ deprovisionWarehouse: () => {
+ value: true
+ }
+ deprovisionWarehouseComplete: () => {
+ value: true
+ }
+ enableBackfill: (params: { tableName: string }) => {
+ tableName: string
+ }
+ enableBackfillComplete: (suffix: string | null) => {
+ suffix: string | null
+ }
+ loadWarehouseStatus: () => any
+ loadWarehouseStatusFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadWarehouseStatusSuccess: (
+ warehouseStatus: WarehouseStatusResponseApi | null,
+ payload?: any
+ ) => {
+ warehouseStatus: WarehouseStatusResponseApi | null
+ payload?: any
+ }
+ pollStatus: () => {
+ value: true
+ }
+ provisionWarehouse: (params: { databaseName: string; tableName: string }) => {
+ databaseName: string
+ tableName: string
+ }
+ provisionWarehouseComplete: () => {
+ value: true
+ }
+ resetPassword: () => {
+ value: true
+ }
+ resetPasswordComplete: () => {
+ value: true
+ }
+ setDatabaseName: (name: string) => {
+ name: string
+ }
+ setDatabaseNameAvailable: (available: boolean | null) => {
+ available: boolean | null
+ }
+ setDatabaseNameChecking: (checking: boolean) => {
+ checking: boolean
+ }
+ setInitialPassword: (password: string) => {
+ password: string
+ }
+ setLastRequestedDatabaseName: (name: string | null) => {
+ name: string | null
+ }
+ setTableName: (name: string) => {
+ name: string
+ }
+ stopPolling: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface warehouseProvisioningLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isActionable: (warehouseStatus: WarehouseStatusResponseApi | null) => boolean
+ isInProgress: (warehouseStatus: WarehouseStatusResponseApi | null) => boolean
+ deprovisionTakingLong: (
+ warehouseStatus: WarehouseStatusResponseApi | null,
+ deletingPollCount: number
+ ) => boolean
+ isValidDatabaseName: (databaseName: string) => boolean
+ warehouseDomain: (preflight: PreflightStatus | null) => string | null
+ retryDatabaseName: (databaseName: string, lastRequestedDatabaseName: string | null) => string
+ isValidTableName: (tableName: string) => boolean
+ canProvision: (
+ isValidDatabaseName: boolean,
+ databaseNameAvailable: boolean | null,
+ isValidTableName: boolean
+ ) => boolean
+ canRetryProvision: (retryDatabaseName: string, isValidTableName: boolean) => boolean
+ }
+}
+
+export type warehouseProvisioningLogicType = MakeLogicType<
+ warehouseProvisioningLogicValues,
+ warehouseProvisioningLogicActions,
+ Record<string, any>,
+ warehouseProvisioningLogicMeta
+>
+
export const warehouseProvisioningLogic = kea<warehouseProvisioningLogicType>([
path(['scenes', 'data-warehouse', 'scene', 'warehouseProvisioningLogic']),
@@ -237,7 +379,7 @@ export const warehouseProvisioningLogic = kea<warehouseProvisioningLogicType>([
selectors({
isActionable: [
(s) => [s.warehouseStatus],
- (status): boolean => {
+ (status: WarehouseStatusResponseApi | null): boolean => {
if (!status) {
return true
}
@@ -246,7 +388,7 @@ export const warehouseProvisioningLogic = kea<warehouseProvisioningLogicType>([
],
isInProgress: [
(s) => [s.warehouseStatus],
- (status): boolean => {
+ (status: WarehouseStatusResponseApi | null): boolean => {
if (!status) {
return false
}
@@ -257,32 +399,34 @@ export const warehouseProvisioningLogic = kea<warehouseProvisioningLogicType>([
// "still working" note rather than an indefinite spinner.
deprovisionTakingLong: [
(s) => [s.warehouseStatus, s.deletingPollCount],
- (status, deletingPollCount): boolean =>
+ (status: WarehouseStatusResponseApi | null, deletingPollCount: number): boolean =>
status?.state === 'deleting' && deletingPollCount >= DELETING_POLL_WARN_THRESHOLD,
],
- isValidDatabaseName: [(s) => [s.databaseName], (name): boolean => WAREHOUSE_NAME_REGEX.test(name)],
+ isValidDatabaseName: [(s) => [s.databaseName], (name: string): boolean => WAREHOUSE_NAME_REGEX.test(name)],
// DNS zone for the connection host, resolved from the deployment region (null when unknown).
warehouseDomain: [
(s) => [s.preflight],
- (preflight): string | null => {
+ (preflight: null | import('~/types').PreflightStatus): string | null => {
const region = preflight?.region
return region ? (MANAGED_WAREHOUSE_DOMAINS[region] ?? null) : null
},
],
retryDatabaseName: [
(s) => [s.databaseName, s.lastRequestedDatabaseName],
- (databaseName, lastRequestedDatabaseName): string => databaseName || lastRequestedDatabaseName || '',
+ (databaseName: string, lastRequestedDatabaseName: string | null): string =>
+ databaseName || lastRequestedDatabaseName || '',
],
// The table name is used verbatim as the table suffix, so it must already be a valid
// identifier (mirrors the backend validator) — we reject rather than silently rewrite.
- isValidTableName: [(s) => [s.tableName], (name): boolean => TABLE_NAME_REGEX.test(name)],
+ isValidTableName: [(s) => [s.tableName], (name: string): boolean => TABLE_NAME_REGEX.test(name)],
canProvision: [
(s) => [s.isValidDatabaseName, s.databaseNameAvailable, s.isValidTableName],
- (valid, available, validEvents): boolean => valid && available === true && validEvents,
+ (valid: boolean, available: boolean | null, validEvents: boolean): boolean =>
+ valid && available === true && validEvents,
],
canRetryProvision: [
(s) => [s.retryDatabaseName, s.isValidTableName],
- (retryDatabaseName, validEvents): boolean =>
+ (retryDatabaseName: string, validEvents: boolean): boolean =>
!!retryDatabaseName && WAREHOUSE_NAME_REGEX.test(retryDatabaseName) && validEvents,
],
}),
diff --git a/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsSceneLogic.ts b/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsSceneLogic.ts
index 802459be034a..7443e158fac4 100644
--- a/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsSceneLogic.ts
+++ b/frontend/src/scenes/data-warehouse/settings/dataWarehouseSettingsSceneLogic.ts
@@ -1,5 +1,5 @@
import type { Monaco } from '@monaco-editor/react'
-import { actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { router, urlToAction } from 'kea-router'
import type { editor } from 'monaco-editor'
import posthog from 'posthog-js'
@@ -19,14 +19,190 @@ import {
NodeKind,
} from '~/queries/schema/schema-general'
+import type {
+ DatabaseSchemaDataWarehouseTable,
+ DatabaseSchemaEndpointTable,
+ DatabaseSchemaManagedViewTable,
+ DatabaseSchemaQueryResponse,
+} from '../../../queries/schema/schema-general'
+import type { DataWarehouseSavedQuery } from '../../../types'
import { dataWarehouseViewsLogic } from '../saved_queries/dataWarehouseViewsLogic'
-import type { dataWarehouseSettingsSceneLogicType } from './dataWarehouseSettingsSceneLogicType'
export interface DataWarehouseSceneLogicProps {
monaco?: Monaco | null
editor?: editor.IStandaloneCodeEditor | null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseSettingsSceneLogicValues {
+ dataWarehouseSavedQueriesLoading: boolean // dataWarehouseViewsLogic
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery> // dataWarehouseViewsLogic
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[] // databaseTableListLogic
+ database: Required<DatabaseSchemaQueryResponse> | null // databaseTableListLogic
+ databaseLoading: boolean // databaseTableListLogic
+ externalDataSourceTables: DatabaseSchemaDataWarehouseTable[] // databaseTableListLogic
+ posthogTables: DatabaseSchemaTable[] // databaseTableListLogic
+ views: DatabaseSchemaViewTable[] // databaseTableListLogic
+ viewsMapById: Record<string, DatabaseSchemaEndpointTable | DatabaseSchemaManagedViewTable | DatabaseSchemaViewTable> // databaseTableListLogic
+ dataWarehouseTablesAndViews: DatabaseSchemaTable[]
+ dataWarehouseTablesBySourceType: Record<string, DatabaseSchemaTable[]>
+ editSchemaIsLoading: boolean
+ editingView: string | null
+ inEditSchemaMode: boolean
+ isEditingSavedQuery: boolean
+ materializedViews: DatabaseSchemaMaterializedViewTable[]
+ nonMaterializedViews: DatabaseSchemaTable[]
+ schemaModalIsOpen: boolean
+ schemaUpdates: Record<string, DatabaseSerializedFieldType>
+ selectedRow: DatabaseSchemaTable | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseSettingsSceneLogicActions {
+ deleteDataWarehouseSavedQuery: (viewId: string) => string // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQuery: (
+ view: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ ) => Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ } // dataWarehouseViewsLogic
+ updateDataWarehouseSavedQuerySuccess: (
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[],
+ payload?:
+ | (Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ })
+ | undefined
+ ) => {
+ dataWarehouseSavedQueries: DataWarehouseSavedQuery[]
+ payload?: Partial<DataWarehouseSavedQuery> & {
+ edited_history_id?: string
+ folder_id?: string | null
+ id: string
+ lifecycle?: string
+ shouldRematerialize?: boolean
+ soft_update?: boolean
+ sync_frequency?: string
+ types?: string[][]
+ }
+ } // dataWarehouseViewsLogic
+ loadDatabase: ({ force }?: { force?: boolean }) => {
+ force?: boolean
+ } // databaseTableListLogic
+ loadDatabaseFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // databaseTableListLogic
+ loadDatabaseSuccess: (
+ database: Required<DatabaseSchemaQueryResponse> | null,
+ payload?: {
+ force?: boolean
+ }
+ ) => {
+ database: Required<DatabaseSchemaQueryResponse> | null
+ payload?: {
+ force?: boolean
+ }
+ } // databaseTableListLogic
+ refreshDatabaseSchema: () => {
+ value: true
+ } // databaseTableListLogic
+ cancelEditSchema: () => {
+ database: Required<DatabaseSchemaQueryResponse> | null
+ }
+ deleteDataWarehouseTable: (tableId: string) => {
+ tableId: string
+ }
+ saveSchema: () => {
+ value: true
+ }
+ selectRow: (row: DatabaseSchemaTable | null) => {
+ row: DatabaseSchemaTable | null
+ }
+ setEditSchemaIsLoading: (isLoading: boolean) => {
+ isLoading: boolean
+ }
+ setEditingView: (id: string | null) => {
+ id: string | null
+ }
+ setIsEditingSavedQuery: (isEditingSavedQuery: boolean) => {
+ isEditingSavedQuery: boolean
+ }
+ toggleEditSchemaMode: (inEditSchemaMode?: boolean) => {
+ inEditSchemaMode: boolean | undefined
+ }
+ toggleSchemaModal: () => {
+ value: true
+ }
+ updateSelectedSchema: (
+ columnKey: string,
+ columnType: DatabaseSerializedFieldType
+ ) => {
+ columnKey: string
+ columnType: DatabaseSerializedFieldType
+ }
+ updateView: (
+ query: string,
+ types: string[][]
+ ) => {
+ query: string
+ types: string[][]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface dataWarehouseSettingsSceneLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ dataWarehouseTablesBySourceType: (
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]
+ ) => Record<string, DatabaseSchemaTable[]>
+ dataWarehouseTablesAndViews: (
+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],
+ views: DatabaseSchemaViewTable[]
+ ) => DatabaseSchemaTable[]
+ nonMaterializedViews: (
+ views: DatabaseSchemaViewTable[],
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery>
+ ) => DatabaseSchemaTable[]
+ materializedViews: (
+ views: DatabaseSchemaViewTable[],
+ dataWarehouseSavedQueryMapById: Record<string, DataWarehouseSavedQuery>
+ ) => DatabaseSchemaMaterializedViewTable[]
+ }
+}
+
+export type dataWarehouseSettingsSceneLogicType = MakeLogicType<
+ dataWarehouseSettingsSceneLogicValues,
+ dataWarehouseSettingsSceneLogicActions,
+ DataWarehouseSceneLogicProps,
+ dataWarehouseSettingsSceneLogicMeta
+>
+
export const dataWarehouseSettingsSceneLogic = kea<dataWarehouseSettingsSceneLogicType>([
path(['scenes', 'data-warehouse', 'settings', 'dataWarehouseSceneLogic']),
props({} as DataWarehouseSceneLogicProps),
@@ -169,7 +345,9 @@ export const dataWarehouseSettingsSceneLogic = kea<dataWarehouseSettingsSceneLog
selectors({
dataWarehouseTablesBySourceType: [
(s) => [s.dataWarehouseTables],
- (dataWarehouseTables): Record<string, DatabaseSchemaTable[]> => {
+ (
+ dataWarehouseTables: import('~/queries/schema/schema-general').DatabaseSchemaDataWarehouseTable[]
+ ): Record<string, DatabaseSchemaTable[]> => {
return dataWarehouseTables.reduce((acc: Record<string, DatabaseSchemaTable[]>, table) => {
const group = table.source?.source_type ?? 'S3'
acc[group] ??= []
@@ -181,13 +359,19 @@ export const dataWarehouseSettingsSceneLogic = kea<dataWarehouseSettingsSceneLog
],
dataWarehouseTablesAndViews: [
(s) => [s.dataWarehouseTables, s.views],
- (dataWarehouseTables, views): DatabaseSchemaTable[] => {
+ (
+ dataWarehouseTables: import('~/queries/schema/schema-general').DatabaseSchemaDataWarehouseTable[],
+ views: DatabaseSchemaViewTable[]
+ ): DatabaseSchemaTable[] => {
return [...dataWarehouseTables, ...views]
},
],
nonMaterializedViews: [
(s) => [s.views, s.dataWarehouseSavedQueryMapById],
- (views, dataWarehouseSavedQueryMapById): DatabaseSchemaTable[] => {
+ (
+ views: DatabaseSchemaViewTable[],
+ dataWarehouseSavedQueryMapById: Record<string, import('../../../types').DataWarehouseSavedQuery>
+ ): DatabaseSchemaTable[] => {
return views
.filter((view) => !dataWarehouseSavedQueryMapById[view.id]?.is_materialized)
.map((view) => ({
@@ -198,7 +382,10 @@ export const dataWarehouseSettingsSceneLogic = kea<dataWarehouseSettingsSceneLog
],
materializedViews: [
(s) => [s.views, s.dataWarehouseSavedQueryMapById],
- (views, dataWarehouseSavedQueryMapById): DatabaseSchemaMaterializedViewTable[] => {
+ (
+ views: DatabaseSchemaViewTable[],
+ dataWarehouseSavedQueryMapById: Record<string, import('../../../types').DataWarehouseSavedQuery>
+ ): DatabaseSchemaMaterializedViewTable[] => {
return views
.filter((view) => dataWarehouseSavedQueryMapById[view.id]?.is_materialized)
.map((view) => ({
diff --git a/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx b/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx
index a3abdf3ca8e3..dbd56e8219e0 100644
--- a/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/viewLinkLogic.tsx
@@ -1,5 +1,6 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -14,7 +15,7 @@ import { DataWarehouseViewLink } from '~/types'
import { joinsLogic } from 'products/data_warehouse/frontend/shared/logics/joinsLogic'
-import type { viewLinkLogicType } from './viewLinkLogicType'
+import type { DatabaseSchemaTable } from '../../queries/schema/schema-general'
import { ViewLinkKeyLabel } from './ViewLinkModal'
const NEW_VIEW_LINK: DataWarehouseViewLink = {
@@ -44,6 +45,199 @@ const disabledReasonForColumn = (column: DatabaseSchemaField): string | undefine
return undefined
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface viewLinkLogicValues {
+ allTables: DatabaseSchemaTable[] // databaseTableListLogic
+ error: string | null
+ fieldName: string
+ isJoinTableModalOpen: boolean
+ isJoinValid: boolean
+ isJoinValidating: boolean
+ isNewJoin: boolean
+ isViewLinkSubmitting: boolean
+ isViewLinkValid: boolean
+ joinToEdit: DataWarehouseViewLink | null
+ joiningIsUsingHogQLExpression: boolean
+ joiningTableKeys: KeySelectOption[]
+ joiningTablePreviewData: Record<string, any>[]
+ joiningTablePreviewLoading: boolean
+ selectedJoiningKey: string | null
+ selectedJoiningTable: DatabaseSchemaTable | undefined
+ selectedJoiningTableName: string | null
+ selectedSourceKey: string | null
+ selectedSourceTable: DatabaseSchemaTable | undefined
+ selectedSourceTableName: string | null
+ showViewLinkErrors: boolean
+ sourceIsUsingHogQLExpression: boolean
+ sourceTableKeys: KeySelectOption[]
+ sourceTablePreviewData: Record<string, any>[]
+ sourceTablePreviewLoading: boolean
+ sqlCodeSnippet: string | null
+ tableOptions: {
+ label: string
+ value: string
+ }[]
+ validationError: string | null
+ validationWarning: string | null
+ viewLink: DataWarehouseViewLink
+ viewLinkAllErrors: Record<string, any>
+ viewLinkChanged: boolean
+ viewLinkErrors: DeepPartialMap<DataWarehouseViewLink, ValidationErrorType>
+ viewLinkHasErrors: boolean
+ viewLinkManualErrors: Record<string, any>
+ viewLinkTouched: boolean
+ viewLinkTouches: Record<string, boolean>
+ viewLinkValidationErrors: DeepPartialMap<DataWarehouseViewLink, ValidationErrorType>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface viewLinkLogicActions {
+ loadDatabase: ({ force }?: { force?: boolean }) => {
+ force?: boolean
+ } // databaseTableListLogic
+ loadJoins: () => any // joinsLogic
+ checkKeyTypeMismatch: () => void
+ clearModalFields: () => {
+ value: true
+ }
+ deleteViewLink: (
+ table: any,
+ column: any
+ ) => {
+ column: any
+ table: any
+ }
+ loadJoiningTablePreview: (tableName: string) => {
+ tableName: string
+ }
+ loadSourceTablePreview: (tableName: string) => {
+ tableName: string
+ }
+ resetViewLink: (values?: DataWarehouseViewLink) => {
+ values?: DataWarehouseViewLink
+ }
+ saveViewLink: (viewLink: any) => {
+ viewLink: any
+ }
+ selectJoiningKey: (selectedKey: string) => {
+ joiningTable: DatabaseSchemaTable | undefined
+ selectedKey: string
+ }
+ selectJoiningTable: (selectedTableName: string) => {
+ selectedTableName: string
+ }
+ selectSourceKey: (selectedKey: string) => {
+ selectedKey: string
+ sourceTable: DatabaseSchemaTable | undefined
+ }
+ selectSourceTable: (selectedTableName: string) => {
+ selectedTableName: string
+ }
+ setError: (error: string) => {
+ error: string
+ }
+ setFieldName: (fieldName: string) => {
+ fieldName: string
+ }
+ setIsJoinValid: (isValid: boolean) => {
+ isValid: boolean
+ }
+ setJoiningTablePreviewData: (data: Record<string, any>[]) => {
+ data: Record<string, any>[]
+ }
+ setSourceTablePreviewData: (data: Record<string, any>[]) => {
+ data: Record<string, any>[]
+ }
+ setValidationError: (errorMessage: string | null) => {
+ errorMessage: string | null
+ }
+ setValidationWarning: (validationWarning: string | null) => {
+ validationWarning: string | null
+ }
+ setViewLinkManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setViewLinkValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setViewLinkValues: (values: DeepPartial<DataWarehouseViewLink>) => {
+ values: DeepPartial<DataWarehouseViewLink>
+ }
+ submitViewLink: () => {
+ value: boolean
+ }
+ submitViewLinkFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitViewLinkRequest: (viewLink: DataWarehouseViewLink) => {
+ viewLink: DataWarehouseViewLink
+ }
+ submitViewLinkSuccess: (viewLink: DataWarehouseViewLink) => {
+ viewLink: DataWarehouseViewLink
+ }
+ toggleEditJoinModal: (join: DataWarehouseViewLink) => {
+ join: DataWarehouseViewLink
+ }
+ toggleJoinTableModal: () => {
+ value: true
+ }
+ toggleNewJoinModal: (join?: Partial<DataWarehouseViewLink>) => {
+ join: Partial<DataWarehouseViewLink> | undefined
+ }
+ touchViewLinkField: (key: string) => {
+ key: string
+ }
+ validateJoin: () => void
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface viewLinkLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ selectedSourceTable: (
+ selectedSourceTableName: string | null,
+ allTables: DatabaseSchemaTable[]
+ ) => DatabaseSchemaTable | undefined
+ selectedJoiningTable: (
+ selectedJoiningTableName: string | null,
+ allTables: DatabaseSchemaTable[]
+ ) => DatabaseSchemaTable | undefined
+ sourceIsUsingHogQLExpression: (
+ selectedSourceKey: string | null,
+ selectedSourceTable: DatabaseSchemaTable | undefined
+ ) => boolean
+ joiningIsUsingHogQLExpression: (
+ selectedJoiningKey: string | null,
+ selectedJoiningTable: DatabaseSchemaTable | undefined
+ ) => boolean
+ tableOptions: (allTables: DatabaseSchemaTable[]) => {
+ label: string
+ value: string
+ }[]
+ sourceTableKeys: (selectedSourceTable: DatabaseSchemaTable | undefined) => KeySelectOption[]
+ joiningTableKeys: (selectedJoiningTable: DatabaseSchemaTable | undefined) => KeySelectOption[]
+ sqlCodeSnippet: (
+ selectedSourceTableName: string | null,
+ selectedJoiningTableName: string | null,
+ fieldName: string
+ ) => string | null
+ }
+}
+
+export type viewLinkLogicType = MakeLogicType<
+ viewLinkLogicValues,
+ viewLinkLogicActions,
+ Record<string, any>,
+ viewLinkLogicMeta
+>
+
export const viewLinkLogic = kea<viewLinkLogicType>([
path(['scenes', 'data-warehouse', 'viewLinkLogic']),
connect(() => ({
@@ -380,15 +574,24 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
selectors({
selectedSourceTable: [
(s) => [s.selectedSourceTableName, s.allTables],
- (selectedSourceTableName, tables) => tables.find((row) => row.name === selectedSourceTableName),
+ (
+ selectedSourceTableName: string | null,
+ tables: import('~/queries/schema/schema-general').DatabaseSchemaTable[]
+ ) => tables.find((row) => row.name === selectedSourceTableName),
],
selectedJoiningTable: [
(s) => [s.selectedJoiningTableName, s.allTables],
- (selectedJoiningTableName, tables) => tables.find((row) => row.name === selectedJoiningTableName),
+ (
+ selectedJoiningTableName: string | null,
+ tables: import('~/queries/schema/schema-general').DatabaseSchemaTable[]
+ ) => tables.find((row) => row.name === selectedJoiningTableName),
],
sourceIsUsingHogQLExpression: [
(s) => [s.selectedSourceKey, s.selectedSourceTable],
- (sourceKey, sourceTable) => {
+ (
+ sourceKey: string | null,
+ sourceTable: import('~/queries/schema/schema-general').DatabaseSchemaTable | undefined
+ ) => {
if (sourceKey === null) {
return false
}
@@ -398,7 +601,10 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
],
joiningIsUsingHogQLExpression: [
(s) => [s.selectedJoiningKey, s.selectedJoiningTable],
- (joiningKey, joiningTable) => {
+ (
+ joiningKey: string | null,
+ joiningTable: import('~/queries/schema/schema-general').DatabaseSchemaTable | undefined
+ ) => {
if (joiningKey === null) {
return false
}
@@ -408,7 +614,7 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
],
tableOptions: [
(s) => [s.allTables],
- (tables) =>
+ (tables: import('~/queries/schema/schema-general').DatabaseSchemaTable[]) =>
tables.map((table) => ({
value: table.name,
label: table.name,
@@ -416,7 +622,9 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
],
sourceTableKeys: [
(s) => [s.selectedSourceTable],
- (selectedSourceTable): KeySelectOption[] => {
+ (
+ selectedSourceTable: import('~/queries/schema/schema-general').DatabaseSchemaTable | undefined
+ ): KeySelectOption[] => {
if (!selectedSourceTable) {
return []
}
@@ -431,7 +639,9 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
],
joiningTableKeys: [
(s) => [s.selectedJoiningTable],
- (selectedJoiningTable): KeySelectOption[] => {
+ (
+ selectedJoiningTable: import('~/queries/schema/schema-general').DatabaseSchemaTable | undefined
+ ): KeySelectOption[] => {
if (!selectedJoiningTable) {
return []
}
@@ -446,7 +656,7 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
],
sqlCodeSnippet: [
(s) => [s.selectedSourceTableName, s.selectedJoiningTableName, s.fieldName],
- (selectedSourceTableName, joiningTableName, fieldName) => {
+ (selectedSourceTableName: string | null, joiningTableName: string | null, fieldName: string) => {
if (!selectedSourceTableName || !joiningTableName) {
return null
}
diff --git a/frontend/src/scenes/debug/debugSceneLogic.ts b/frontend/src/scenes/debug/debugSceneLogic.ts
index 6359476c298c..780d74f29649 100644
--- a/frontend/src/scenes/debug/debugSceneLogic.ts
+++ b/frontend/src/scenes/debug/debugSceneLogic.ts
@@ -1,14 +1,30 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { actionToUrl, urlToAction } from 'kea-router'
import { urls } from 'scenes/urls'
import { stringifiedExamples } from '~/queries/examples'
-import type { debugSceneLogicType } from './debugSceneLogicType'
-
const DEFAULT_QUERY: string = stringifiedExamples['HogQLRaw']
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugSceneLogicValues {
+ query1: string
+ query2: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugSceneLogicActions {
+ setQuery1: (query: string) => {
+ query: string
+ }
+ setQuery2: (query: string) => {
+ query: string
+ }
+}
+
+export type debugSceneLogicType = MakeLogicType<debugSceneLogicValues, debugSceneLogicActions>
+
export const debugSceneLogic = kea<debugSceneLogicType>([
path(['scenes', 'query', 'debugSceneLogic']),
actions({
diff --git a/frontend/src/scenes/debug/hog/hogReplLogic.ts b/frontend/src/scenes/debug/hog/hogReplLogic.ts
index ef42d95d51c2..df03b715cf3d 100644
--- a/frontend/src/scenes/debug/hog/hogReplLogic.ts
+++ b/frontend/src/scenes/debug/hog/hogReplLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { actionToUrl, urlToAction } from 'kea-router'
import { VMState, newHogCallable, newHogClosure } from '@posthog/hogvm'
@@ -7,8 +7,6 @@ import api from 'lib/api'
import { execHogAsync } from 'lib/hog'
import { urls } from 'scenes/urls'
-import type { hogReplLogicType } from './hogReplLogicType'
-
export interface ReplChunk {
code: string
result?: string
@@ -20,6 +18,82 @@ export interface ReplChunk {
status: 'pending' | 'success' | 'error'
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface hogReplLogicValues {
+ currentCode: string
+ lastLocalGlobals: Record<string, any> | undefined
+ lastLocals: ReplChunk['locals'] | undefined
+ lastState: ReplChunk['state'] | undefined
+ replChunks: ReplChunk[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface hogReplLogicActions {
+ editFromHere: (index: number) => {
+ index: number
+ }
+ print: (
+ index: number,
+ line: any[]
+ ) => {
+ index: number
+ line: any[]
+ }
+ runCode: (code: string) => {
+ code: string
+ }
+ runCurrentCode: () => {
+ value: true
+ }
+ setBytecode: (
+ index: number,
+ bytecode: any[],
+ locals: any[]
+ ) => {
+ bytecode: any[]
+ index: number
+ locals: any[]
+ }
+ setCurrentCode: (code: string) => {
+ code: string
+ }
+ setReplChunks: (replChunks: ReplChunk[]) => {
+ replChunks: ReplChunk[]
+ }
+ setResult: (
+ index: number,
+ result?: string,
+ error?: string
+ ) => {
+ error: string | undefined
+ index: number
+ result: string | undefined
+ }
+ setVMState: (
+ index: number,
+ state: any
+ ) => {
+ index: number
+ state: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface hogReplLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ lastLocals: (replChunks: ReplChunk[]) => ReplChunk['locals'] | undefined
+ lastState: (replChunks: ReplChunk[]) => ReplChunk['state'] | undefined
+ lastLocalGlobals: (lastLocals: any[] | undefined) => Record<string, any> | undefined
+ }
+}
+
+export type hogReplLogicType = MakeLogicType<
+ hogReplLogicValues,
+ hogReplLogicActions,
+ Record<string, any>,
+ hogReplLogicMeta
+>
+
export const hogReplLogic = kea<hogReplLogicType>([
path(['scenes', 'debug', 'HogRepl']),
actions({
@@ -58,7 +132,7 @@ export const hogReplLogic = kea<hogReplLogicType>([
selectors({
lastLocals: [
(s) => [s.replChunks],
- (replChunks): ReplChunk['locals'] | undefined => {
+ (replChunks: ReplChunk[]): ReplChunk['locals'] | undefined => {
for (let i = replChunks.length - 1; i >= 0; i--) {
if (replChunks[i].locals) {
return replChunks[i].locals
@@ -69,7 +143,7 @@ export const hogReplLogic = kea<hogReplLogicType>([
],
lastState: [
(s) => [s.replChunks],
- (replChunks): ReplChunk['state'] | undefined => {
+ (replChunks: ReplChunk[]): ReplChunk['state'] | undefined => {
for (let i = replChunks.length - 1; i >= 0; i--) {
if (replChunks[i].state) {
return replChunks[i].state
@@ -80,7 +154,7 @@ export const hogReplLogic = kea<hogReplLogicType>([
],
lastLocalGlobals: [
(s) => [s.lastLocals],
- (lastLocals): Record<string, any> | undefined => {
+ (lastLocals: ReplChunk['locals'] | undefined): Record<string, any> | undefined => {
if (lastLocals) {
return lastLocals.reduce((acc, local) => Object.assign(acc, { [local[0]]: 'local' }), {})
}
diff --git a/frontend/src/scenes/debug/queryLogTableLogic.ts b/frontend/src/scenes/debug/queryLogTableLogic.ts
index 0330f94dcc26..639777fe0f85 100644
--- a/frontend/src/scenes/debug/queryLogTableLogic.ts
+++ b/frontend/src/scenes/debug/queryLogTableLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -6,7 +6,7 @@ import { userLogic } from 'scenes/userLogic'
import { HogQLQueryResponse } from '~/queries/schema/schema-general'
-import type { queryLogTableLogicType } from './queryLogTableLogicType'
+import type { UserType } from '../../types'
export interface QueryLogEntry {
query_id: string
@@ -25,6 +25,83 @@ export interface QueryLogTableLogicProps {
key: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface queryLogTableLogicValues {
+ user: UserType | null // userLogic
+ hasMore: boolean
+ limit: number
+ moreQueryLogs: QueryLogEntry[]
+ moreQueryLogsLoading: boolean
+ queryLogs: QueryLogEntry[]
+ queryLogsLoading: boolean
+ queryLogsWithIndex: (QueryLogEntry & {
+ index: number
+ })[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface queryLogTableLogicActions {
+ loadMoreQueryLogs: () => {
+ value: true
+ }
+ loadMoreQueryLogsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMoreQueryLogsSuccess: (
+ moreQueryLogs: QueryLogEntry[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ moreQueryLogs: QueryLogEntry[]
+ payload?: {
+ value: true
+ }
+ }
+ loadQueryLogs: () => {
+ value: true
+ }
+ loadQueryLogsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadQueryLogsSuccess: (
+ queryLogs: QueryLogEntry[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ queryLogs: QueryLogEntry[]
+ payload?: {
+ value: true
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface queryLogTableLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ queryLogsWithIndex: (queryLogs: QueryLogEntry[]) => (QueryLogEntry & {
+ index: number
+ })[]
+ hasMore: (moreQueryLogs: QueryLogEntry[], limit: number) => boolean
+ }
+}
+
+export type queryLogTableLogicType = MakeLogicType<
+ queryLogTableLogicValues,
+ queryLogTableLogicActions,
+ Record<string, any>,
+ queryLogTableLogicMeta
+>
+
export const queryLogTableLogic = kea<queryLogTableLogicType>([
path(['scenes', 'debug', 'queryLogTableLogic']),
connect(() => ({
diff --git a/frontend/src/scenes/heatmaps/components/heatmapRecordingFallbackLogic.ts b/frontend/src/scenes/heatmaps/components/heatmapRecordingFallbackLogic.ts
index 1a4d855cc39e..406799f1ec0a 100644
--- a/frontend/src/scenes/heatmaps/components/heatmapRecordingFallbackLogic.ts
+++ b/frontend/src/scenes/heatmaps/components/heatmapRecordingFallbackLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -8,8 +8,6 @@ import { sessionPlayerModalLogic } from 'scenes/session-recordings/player/modal/
import { NodeKind, RecordingsQuery } from '~/queries/schema/schema-general'
import { PropertyFilterType, PropertyOperator, SessionRecordingType } from '~/types'
-import type { heatmapRecordingFallbackLogicType } from './heatmapRecordingFallbackLogicType'
-
export type HeatmapRecordingFallbackLogicProps = {
url: string
}
@@ -34,6 +32,59 @@ export function buildRecordingsQueryForUrl(url: string): RecordingsQuery {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapRecordingFallbackLogicValues {
+ matchingRecordings: SessionRecordingType[] | null
+ matchingRecordingsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapRecordingFallbackLogicActions {
+ openSessionPlayer: (
+ sessionRecording: Pick<SessionRecordingType, 'id' | 'matching_events'>,
+ initialTimestamp?: number | null
+ ) => {
+ initialTimestamp: number | null
+ sessionRecording: Pick<SessionRecordingType, 'id' | 'matching_events'>
+ } // sessionPlayerModalLogic
+ loadMatchingRecordings: () => {
+ value: true
+ }
+ loadMatchingRecordingsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMatchingRecordingsSuccess: (
+ matchingRecordings: SessionRecordingType[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ matchingRecordings: SessionRecordingType[]
+ payload?: {
+ value: true
+ }
+ }
+ openRecording: (recordingId: string) => {
+ recordingId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapRecordingFallbackLogicMeta {
+ key: string
+}
+
+export type heatmapRecordingFallbackLogicType = MakeLogicType<
+ heatmapRecordingFallbackLogicValues,
+ heatmapRecordingFallbackLogicActions,
+ HeatmapRecordingFallbackLogicProps,
+ heatmapRecordingFallbackLogicMeta
+>
+
export const heatmapRecordingFallbackLogic = kea<heatmapRecordingFallbackLogicType>([
path(['scenes', 'heatmaps', 'components', 'heatmapRecordingFallbackLogic']),
props({} as HeatmapRecordingFallbackLogicProps),
diff --git a/frontend/src/scenes/heatmaps/components/heatmapsBrowserLogic.ts b/frontend/src/scenes/heatmaps/components/heatmapsBrowserLogic.ts
index 7b5039486b32..dd96fc2578c8 100644
--- a/frontend/src/scenes/heatmaps/components/heatmapsBrowserLogic.ts
+++ b/frontend/src/scenes/heatmaps/components/heatmapsBrowserLogic.ts
@@ -1,4 +1,16 @@
-import { actions, afterMount, beforeUnmount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ beforeUnmount,
+ connect,
+ kea,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -19,7 +31,9 @@ import { removeReplayIframeDataFromLocalStorage } from 'scenes/session-recording
import { hogql } from '~/queries/utils'
-import type { heatmapsBrowserLogicType } from './heatmapsBrowserLogicType'
+import type { KeyedAppUrl } from '../../../lib/components/AuthorizedUrlList/authorizedUrlListLogic'
+import type { HrefMatchType } from '../../../lib/components/heatmaps/heatmapDataLogic'
+import type { HeatmapFilters } from '../../../lib/components/heatmaps/types'
export type HeatmapsBrowserLogicProps = {
iframeRef: RefObject<HTMLIFrameElement | null>
@@ -50,6 +64,207 @@ const normalizeUrlPath = (urlObj: URL): string => {
return urlObj.toString()
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapsBrowserLogicValues {
+ checkUrlIsAuthorized: (url: string) => boolean // authorizedUrlListLogic
+ urlsKeyed: KeyedAppUrl[] // authorizedUrlListLogic
+ commonFilters: CommonFilters // heatmapDataLogic
+ heatmapColorPalette: string | null // heatmapDataLogic
+ heatmapEmpty: boolean // heatmapDataLogic
+ heatmapFilters: HeatmapFilters // heatmapDataLogic
+ heatmapFixedPositionMode: HeatmapFixedPositionMode // heatmapDataLogic
+ heightOverride: number // heatmapDataLogic
+ hrefMatchType: HrefMatchType // heatmapDataLogic
+ isHeightCapped: boolean // heatmapDataLogic
+ widthOverride: number // heatmapDataLogic
+ browserSearchResults: string[] | null
+ browserSearchResultsLoading: boolean
+ browserSearchTerm: string
+ browserUrlSearchOptions: string[] | null
+ dataUrl: string | null
+ displayUrl: string | null
+ filterPanelCollapsed: boolean
+ hasValidReplayIframeData: boolean
+ iframeBanner: IFrameBanner | null
+ isBrowserUrlAuthorized: boolean
+ isBrowserUrlValid: boolean
+ loading: boolean
+ noPageviews: boolean
+ replayIframeData: ReplayIframeData | null
+ topUrls:
+ | {
+ count: number
+ url: string
+ }[]
+ | null
+ topUrlsLoading: boolean
+ userTouchedDataUrl: boolean
+ viewportRange: {
+ max: number
+ min: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapsBrowserLogicActions {
+ loadHeatmap: () => {
+ value: true
+ } // heatmapDataLogic
+ patchHeatmapFilters: (filters: Partial<HeatmapFilters>) => {
+ filters: Partial<HeatmapFilters>
+ } // heatmapDataLogic
+ setCommonFilters: (filters: CommonFilters) => {
+ filters: CommonFilters
+ } // heatmapDataLogic
+ setHeatmapColorPalette: (palette: string | null) => {
+ palette: string | null
+ } // heatmapDataLogic
+ setHeatmapFixedPositionMode: (mode: HeatmapFixedPositionMode) => {
+ mode: HeatmapFixedPositionMode
+ } // heatmapDataLogic
+ setHref: (href: string) => {
+ href: string
+ } // heatmapDataLogic
+ setHrefMatchType: (matchType: HrefMatchType) => {
+ matchType: HrefMatchType
+ } // heatmapDataLogic
+ setWindowWidthOverride: (widthOverride: number | null) => {
+ widthOverride: number | null
+ } // heatmapDataLogic
+ loadBrowserSearchResults: () => {
+ value: true
+ }
+ loadBrowserSearchResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadBrowserSearchResultsSuccess: (
+ browserSearchResults: string[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ browserSearchResults: string[]
+ payload?: {
+ value: true
+ }
+ }
+ loadTopUrls: () => {
+ value: true
+ }
+ loadTopUrlsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTopUrlsSuccess: (
+ topUrls: {
+ count: number
+ url: string
+ }[],
+ payload?: {
+ value: true
+ }
+ ) => {
+ topUrls: {
+ count: number
+ url: string
+ }[]
+ payload?: {
+ value: true
+ }
+ }
+ maybeLoadTopUrls: () => {
+ value: true
+ }
+ onIframeLoad: () => {
+ value: true
+ }
+ sendToolbarMessage: (
+ type: PostHogAppToolbarEvent,
+ payload?: Record<string, any>
+ ) => {
+ payload: Record<string, any> | undefined
+ type: PostHogAppToolbarEvent
+ }
+ setBrowserSearch: (searchTerm: string) => {
+ searchTerm: string
+ }
+ setDataUrl: (url: string | null) => {
+ url: string | null
+ }
+ setDataUrlUserTouched: (touched: boolean) => {
+ touched: boolean
+ }
+ setDisplayUrl: (url: string | null) => {
+ url: string | null
+ }
+ setIframeBanner: (banner: IFrameBanner | null) => {
+ banner: IFrameBanner | null
+ }
+ setReplayIframeData: (replayIframeData: ReplayIframeData | null) => {
+ replayIframeData: ReplayIframeData | null
+ }
+ setReplayIframeDataURL: (url: string | null) => {
+ url: string | null
+ }
+ startTrackingLoading: () => {
+ value: true
+ }
+ stopTrackingLoading: () => {
+ value: true
+ }
+ toggleFilterPanelCollapsed: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapsBrowserLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ browserUrlSearchOptions: (
+ browserSearchResults: string[] | null,
+ topUrls:
+ | {
+ count: number
+ url: string
+ }[]
+ | null,
+ browserSearchTerm: string
+ ) => string[] | null
+ isBrowserUrlAuthorized: (dataUrl: string | null, checkUrlIsAuthorized: (url: string) => boolean) => boolean
+ isBrowserUrlValid: (dataUrl: string | null) => boolean
+ viewportRange: (
+ heatmapFilters: HeatmapFilters,
+ widthOverride: number
+ ) => {
+ max: number
+ min: number
+ }
+ noPageviews: (
+ topUrlsLoading: boolean,
+ topUrls:
+ | {
+ count: number
+ url: string
+ }[]
+ | null
+ ) => boolean
+ }
+}
+
+export type heatmapsBrowserLogicType = MakeLogicType<
+ heatmapsBrowserLogicValues,
+ heatmapsBrowserLogicActions,
+ HeatmapsBrowserLogicProps,
+ heatmapsBrowserLogicMeta
+>
+
export const heatmapsBrowserLogic = kea<heatmapsBrowserLogicType>([
path(['scenes', 'heatmaps', 'components', 'heatmapsBrowserLogic']),
props({} as HeatmapsBrowserLogicProps),
@@ -229,14 +444,23 @@ export const heatmapsBrowserLogic = kea<heatmapsBrowserLogicType>([
selectors({
browserUrlSearchOptions: [
(s) => [s.browserSearchResults, s.topUrls, s.browserSearchTerm],
- (browserSearchResults, topUrls, browserSearchTerm) => {
+ (
+ browserSearchResults: string[] | null,
+ topUrls:
+ | {
+ count: number
+ url: string
+ }[]
+ | null,
+ browserSearchTerm: string
+ ) => {
return browserSearchTerm ? browserSearchResults : (topUrls?.map((x) => x.url) ?? [])
},
],
isBrowserUrlAuthorized: [
(s) => [s.dataUrl, s.checkUrlIsAuthorized],
- (dataUrl, checkUrlIsAuthorized) => {
+ (dataUrl: string | null, checkUrlIsAuthorized: (url: string) => boolean) => {
if (!dataUrl) {
return false
}
@@ -245,7 +469,7 @@ export const heatmapsBrowserLogic = kea<heatmapsBrowserLogicType>([
],
isBrowserUrlValid: [
(s) => [s.dataUrl],
- (dataUrl) => {
+ (dataUrl: string | null) => {
if (!dataUrl) {
// an empty dataUrl is valid
// since we just won't do anything with it
@@ -267,14 +491,22 @@ export const heatmapsBrowserLogic = kea<heatmapsBrowserLogicType>([
viewportRange: [
(s) => [s.heatmapFilters, s.widthOverride],
- (heatmapFilters, widthOverride) => {
+ (heatmapFilters: import('lib/components/heatmaps/types').HeatmapFilters, widthOverride: number) => {
return calculateViewportRange(heatmapFilters, widthOverride)
},
],
noPageviews: [
(s) => [s.topUrlsLoading, s.topUrls],
- (topUrlsLoading, topUrls) => !topUrlsLoading && (!topUrls || topUrls.length === 0),
+ (
+ topUrlsLoading: boolean,
+ topUrls:
+ | {
+ count: number
+ url: string
+ }[]
+ | null
+ ) => !topUrlsLoading && (!topUrls || topUrls.length === 0),
],
}),
diff --git a/frontend/src/scenes/heatmaps/components/recordingClickmapLogic.ts b/frontend/src/scenes/heatmaps/components/recordingClickmapLogic.ts
index b006f0fc82b3..f70c740f9ad8 100644
--- a/frontend/src/scenes/heatmaps/components/recordingClickmapLogic.ts
+++ b/frontend/src/scenes/heatmaps/components/recordingClickmapLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -23,8 +23,11 @@ import type {
ElementsStatsRetrieveParams,
} from 'products/product_analytics/frontend/generated/api.schemas'
+import type { CommonFilters } from '../../../lib/components/heatmaps/types'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
+import type { TeamPublicType, TeamType } from '../../../types'
import { heatmapsBrowserLogic, isUrlPattern } from './heatmapsBrowserLogic'
-import type { recordingClickmapLogicType } from './recordingClickmapLogicType'
+import type { ReplayIframeData } from './heatmapsBrowserLogic'
export interface ClickmapBox {
top: number
@@ -157,6 +160,111 @@ export function computeClickmapBoxes(
return boxes.sort((a, b) => b.count - a.count)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recordingClickmapLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ commonFilters: CommonFilters // heatmapDataLogic
+ replayIframeData: ReplayIframeData | null // heatmapsBrowserLogic
+ currentProjectId: number | null // projectLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ clickmapActive: boolean
+ clickmapAvailable: boolean
+ clickmapBoxes: ClickmapBox[]
+ clickmapEnabled: boolean
+ elementStats: ElementStatsResponseApi | null
+ elementStatsLoading: boolean
+ highestClickCount: number
+ hoveredBoxKey: string | null
+ matchLinksByHref: boolean
+ selectedBoxKey: string | null
+ tooltipSuppressed: boolean
+ totalClickCount: number
+ wantedDataAttributes: string[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recordingClickmapLogicActions {
+ setCommonFilters: (filters: CommonFilters) => {
+ filters: CommonFilters
+ } // heatmapDataLogic
+ setHeatmapTooltipSuppressed: (suppressed: boolean) => {
+ suppressed: boolean
+ } // heatmapDataLogic
+ setWindowWidthOverride: (widthOverride: number | null) => {
+ widthOverride: number | null
+ } // heatmapDataLogic
+ onIframeLoad: () => {
+ value: true
+ } // heatmapsBrowserLogic
+ setReplayIframeData: (replayIframeData: ReplayIframeData | null) => {
+ replayIframeData: ReplayIframeData | null
+ } // heatmapsBrowserLogic
+ setReplayIframeDataURL: (url: string | null) => {
+ url: string | null
+ } // heatmapsBrowserLogic
+ loadElementStats: () => {
+ value: true
+ }
+ loadElementStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadElementStatsSuccess: (
+ elementStats: ElementStatsResponseApi | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ elementStats: ElementStatsResponseApi | null
+ payload?: {
+ value: true
+ }
+ }
+ maybeLoadElementStats: () => {
+ value: true
+ }
+ recomputeClickmap: () => {
+ value: true
+ }
+ selectClickmapBox: (key: string | null) => {
+ key: string | null
+ }
+ setClickmapBoxes: (boxes: ClickmapBox[]) => {
+ boxes: ClickmapBox[]
+ }
+ setClickmapEnabled: (enabled: boolean) => {
+ enabled: boolean
+ }
+ setHoveredBoxKey: (key: string | null) => {
+ key: string | null
+ }
+ setMatchLinksByHref: (matchLinksByHref: boolean) => {
+ matchLinksByHref: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recordingClickmapLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ clickmapAvailable: (featureFlags: FeatureFlagsSet) => boolean
+ clickmapActive: (clickmapAvailable: boolean, clickmapEnabled: boolean) => boolean
+ wantedDataAttributes: (currentTeam: TeamPublicType | TeamType | null) => string[]
+ highestClickCount: (clickmapBoxes: ClickmapBox[]) => number
+ totalClickCount: (clickmapBoxes: ClickmapBox[]) => number
+ tooltipSuppressed: (hoveredBoxKey: string | null, selectedBoxKey: string | null) => boolean
+ }
+}
+
+export type recordingClickmapLogicType = MakeLogicType<
+ recordingClickmapLogicValues,
+ recordingClickmapLogicActions,
+ RecordingClickmapLogicProps,
+ recordingClickmapLogicMeta
+>
+
export const recordingClickmapLogic = kea<recordingClickmapLogicType>([
path(['scenes', 'heatmaps', 'components', 'recordingClickmapLogic']),
props({} as RecordingClickmapLogicProps),
@@ -269,27 +377,30 @@ export const recordingClickmapLogic = kea<recordingClickmapLogicType>([
selectors({
clickmapAvailable: [
(s) => [s.featureFlags],
- (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.HEATMAPS_RECORDING_CLICKMAP],
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>
+ !!featureFlags[FEATURE_FLAGS.HEATMAPS_RECORDING_CLICKMAP],
],
clickmapActive: [
(s) => [s.clickmapAvailable, s.clickmapEnabled],
- (clickmapAvailable, clickmapEnabled): boolean => clickmapAvailable && clickmapEnabled,
+ (clickmapAvailable: boolean, clickmapEnabled: boolean): boolean => clickmapAvailable && clickmapEnabled,
],
wantedDataAttributes: [
(s) => [s.currentTeam],
- (currentTeam): string[] => Array.from(new Set(['data-attr', ...(currentTeam?.data_attributes ?? [])])),
+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string[] =>
+ Array.from(new Set(['data-attr', ...(currentTeam?.data_attributes ?? [])])),
],
highestClickCount: [
(s) => [s.clickmapBoxes],
- (clickmapBoxes) => clickmapBoxes.reduce((max, box) => Math.max(max, box.count), 0),
+ (clickmapBoxes: ClickmapBox[]) => clickmapBoxes.reduce((max, box) => Math.max(max, box.count), 0),
],
totalClickCount: [
(s) => [s.clickmapBoxes],
- (clickmapBoxes) => clickmapBoxes.reduce((sum, box) => sum + box.count, 0),
+ (clickmapBoxes: ClickmapBox[]) => clickmapBoxes.reduce((sum, box) => sum + box.count, 0),
],
tooltipSuppressed: [
(s) => [s.hoveredBoxKey, s.selectedBoxKey],
- (hoveredBoxKey, selectedBoxKey): boolean => hoveredBoxKey !== null || selectedBoxKey !== null,
+ (hoveredBoxKey: string | null, selectedBoxKey: string | null): boolean =>
+ hoveredBoxKey !== null || selectedBoxKey !== null,
],
}),
subscriptions(({ actions }) => ({
diff --git a/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapLogic.ts b/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapLogic.ts
index bbf0a0eb403a..5ad6476711ff 100644
--- a/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapLogic.ts
+++ b/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { router } from 'kea-router'
import posthog from 'posthog-js'
@@ -13,7 +13,8 @@ import { heatmapsSceneLogic } from 'scenes/heatmaps/scenes/heatmaps/heatmapsScen
import { HeatmapStatus, HeatmapType } from '~/types'
-import type { heatmapLogicType } from './heatmapLogicType'
+import type { CommonFilters, HeatmapFilters, HeatmapFixedPositionMode } from '../../../../lib/components/heatmaps/types'
+import type { ExportContext } from '../../../../types'
const DEFAULT_HEATMAP_NAME = 'Untitled heatmap'
@@ -46,6 +47,167 @@ export function resolveHeatmapExportUrl(
return displayUrl ?? ''
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapLogicValues {
+ commonFilters: CommonFilters // heatmapDataLogic
+ heatmapColorPalette: string | null // heatmapDataLogic
+ heatmapFilters: HeatmapFilters // heatmapDataLogic
+ heatmapFixedPositionMode: HeatmapFixedPositionMode // heatmapDataLogic
+ heightOverride: number // heatmapDataLogic
+ isHeightCapped: boolean // heatmapDataLogic
+ widthOverride: number // heatmapDataLogic
+ dataUrl: string | null // heatmapsBrowserLogic
+ displayUrl: string | null // heatmapsBrowserLogic
+ isBrowserUrlAuthorized: boolean // heatmapsBrowserLogic
+ blockConsentModals: boolean
+ containerWidth: number | null
+ desiredNumericWidth: number
+ displayUrlIsPattern: boolean
+ effectiveWidth: number
+ generatingScreenshot: boolean
+ heatmapId: number | null
+ isDisplayUrlValid: boolean
+ isPageUrlDraftValid: boolean
+ loading: boolean
+ name: string
+ pageUrlDraft: string
+ pageUrlDraftIsPattern: boolean
+ savedBlockConsentModals: boolean
+ savedDisplayUrl: string | null
+ scalePercent: number
+ screenshotError: string | null
+ screenshotLoaded: boolean
+ screenshotLoading: boolean
+ screenshotUrl: string | null
+ status: HeatmapStatus
+ type: HeatmapType
+ width: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapLogicActions {
+ startHeatmapExport: (export_context: ExportContext) => {
+ export_context: ExportContext
+ } // exportsLogic
+ loadHeatmap: () => {
+ value: true
+ } // heatmapDataLogic
+ setWindowWidthOverride: (widthOverride: number | null) => {
+ widthOverride: number | null
+ } // heatmapDataLogic
+ onIframeLoad: () => {
+ value: true
+ } // heatmapsBrowserLogic
+ setDataUrl: (url: string | null) => {
+ url: string | null
+ } // heatmapsBrowserLogic
+ setDataUrlUserTouched: (touched: boolean) => {
+ touched: boolean
+ } // heatmapsBrowserLogic
+ setDisplayUrl: (url: string | null) => {
+ url: string | null
+ } // heatmapsBrowserLogic
+ loadSavedHeatmaps: () => {
+ value: true
+ } // heatmapsSceneLogic
+ applyPageUrlDraft: () => {
+ value: true
+ }
+ changeCaptureMethod: (type: HeatmapType) => {
+ type: HeatmapType
+ }
+ createHeatmap: () => {
+ value: true
+ }
+ exportHeatmap: () => {
+ value: true
+ }
+ load: () => {
+ value: true
+ }
+ pollScreenshotStatus: (
+ id: number,
+ width?: number
+ ) => {
+ id: number
+ width: number | undefined
+ }
+ regenerateScreenshot: () => {
+ value: true
+ }
+ setBlockConsentModals: (value: boolean) => {
+ value: boolean
+ }
+ setContainerWidth: (containerWidth: number | null) => {
+ containerWidth: number | null
+ }
+ setGeneratingScreenshot: (generating: boolean) => {
+ generating: boolean
+ }
+ setHeatmapId: (id: number | null) => {
+ id: number | null
+ }
+ setLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setName: (name: string) => {
+ name: string
+ }
+ setPageUrlDraft: (value: string) => {
+ value: string
+ }
+ setScreenshotError: (error: string | null) => {
+ error: string | null
+ }
+ setScreenshotLoaded: (screenshotLoaded: boolean) => {
+ screenshotLoaded: boolean
+ }
+ setScreenshotUrl: (url: string | null) => {
+ url: string | null
+ }
+ setType: (type: HeatmapType) => {
+ type: HeatmapType
+ }
+ setWidth: (width: number) => {
+ width: number
+ }
+ snapshotSavedBlockConsentModals: (value: boolean) => {
+ value: boolean
+ }
+ snapshotSavedDisplayUrl: (displayUrl: string | null) => {
+ displayUrl: string | null
+ }
+ updateHeatmap: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapLogicProps {
+ id: number | string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapLogicMeta {
+ key: number | string
+ __keaTypeGenInternalSelectorTypes: {
+ isDisplayUrlValid: (displayUrl: string | null) => boolean
+ displayUrlIsPattern: (displayUrl: string | null) => boolean
+ isPageUrlDraftValid: (pageUrlDraft: string) => boolean
+ pageUrlDraftIsPattern: (pageUrlDraft: string) => boolean
+ desiredNumericWidth: (widthOverride: number, containerWidth: number | null) => number
+ effectiveWidth: (desiredNumericWidth: number) => number
+ scalePercent: (widthOverride: number, containerWidth: number | null) => number
+ }
+}
+
+export type heatmapLogicType = MakeLogicType<
+ heatmapLogicValues,
+ heatmapLogicActions,
+ heatmapLogicProps,
+ heatmapLogicMeta
+>
+
export const heatmapLogic = kea<heatmapLogicType>([
path(['scenes', 'heatmaps', 'scenes', 'heatmap', 'heatmapLogic']),
props({ id: 'new' as string | number }),
diff --git a/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapRecordingLogic.ts b/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapRecordingLogic.ts
index 8bec7a1f5841..6311d141a4b9 100644
--- a/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapRecordingLogic.ts
+++ b/frontend/src/scenes/heatmaps/scenes/heatmap/heatmapRecordingLogic.ts
@@ -1,4 +1,4 @@
-import { kea, path, selectors } from 'kea'
+import { MakeLogicType, kea, path, selectors } from 'kea'
import { sceneConfigurations } from 'scenes/scenes'
import { Scene } from 'scenes/sceneTypes'
@@ -6,7 +6,12 @@ import { urls } from 'scenes/urls'
import { Breadcrumb } from '~/types'
-import type { heatmapRecordingLogicType } from './heatmapRecordingLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapRecordingLogicValues {
+ breadcrumbs: Breadcrumb[]
+}
+
+export type heatmapRecordingLogicType = MakeLogicType<heatmapRecordingLogicValues, {}>
export const heatmapRecordingLogic = kea<heatmapRecordingLogicType>([
path(['scenes', 'heatmaps', 'scenes', 'heatmap', 'heatmapRecordingLogic']),
diff --git a/frontend/src/scenes/heatmaps/scenes/heatmaps/heatmapsSceneLogic.ts b/frontend/src/scenes/heatmaps/scenes/heatmaps/heatmapsSceneLogic.ts
index 54b273bc4dcb..d5b0ee8ab3d0 100644
--- a/frontend/src/scenes/heatmaps/scenes/heatmaps/heatmapsSceneLogic.ts
+++ b/frontend/src/scenes/heatmaps/scenes/heatmaps/heatmapsSceneLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import api from 'lib/api'
import { deleteWithUndo } from 'lib/utils/deleteWithUndo'
@@ -10,8 +10,6 @@ import { urls } from 'scenes/urls'
import { Breadcrumb, HeatmapSavedFilters, HeatmapScreenshotType } from '~/types'
-import type { heatmapsSceneLogicType } from './heatmapsSceneLogicType'
-
export const DEFAULT_HEATMAP_FILTERS = {
createdBy: 'All users',
search: '',
@@ -21,6 +19,40 @@ export const DEFAULT_HEATMAP_FILTERS = {
export const HEATMAPS_PER_PAGE = 30
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapsSceneLogicValues {
+ currentTeamIdStrict: number | string // teamLogic
+ breadcrumbs: Breadcrumb[]
+ filters: HeatmapSavedFilters
+ savedHeatmaps: HeatmapScreenshotType[]
+ savedHeatmapsLoading: boolean
+ totalCount: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface heatmapsSceneLogicActions {
+ deleteHeatmap: (short_id: string) => {
+ short_id: string
+ }
+ loadSavedHeatmaps: () => {
+ value: true
+ }
+ setHeatmapsFilters: (filters: HeatmapSavedFilters) => {
+ filters: HeatmapSavedFilters
+ }
+ setLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setSavedHeatmaps: (items: HeatmapScreenshotType[]) => {
+ items: HeatmapScreenshotType[]
+ }
+ setTotalCount: (count: number) => {
+ count: number
+ }
+}
+
+export type heatmapsSceneLogicType = MakeLogicType<heatmapsSceneLogicValues, heatmapsSceneLogicActions>
+
export const heatmapsSceneLogic = kea<heatmapsSceneLogicType>([
path(['scenes', 'heatmaps', 'scenes', 'heatmaps', 'heatmapsSceneLogic']),
connect(() => ({ values: [teamLogic, ['currentTeamIdStrict']] })),
diff --git a/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts b/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts
index 39af9253b243..b591bf25ba8f 100644
--- a/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts
+++ b/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts
@@ -1,10 +1,25 @@
-import { actions, kea, path, reducers } from 'kea'
-
-import type { agentSetupModalLogicType } from './agentSetupModalLogicType'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
/** Setup widgets whose management UI opens in a modal. GitHub and MCP servers link out instead. */
export type AgentSetupModalKey = 'signal-sources' | 'scout-troop' | 'slack'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface agentSetupModalLogicValues {
+ openModal: AgentSetupModalKey | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface agentSetupModalLogicActions {
+ closeSetupModal: () => {
+ value: true
+ }
+ openSetupModal: (key: AgentSetupModalKey) => {
+ key: AgentSetupModalKey
+ }
+}
+
+export type agentSetupModalLogicType = MakeLogicType<agentSetupModalLogicValues, agentSetupModalLogicActions>
+
/** Tracks which agent-setup widget's modal is open (one at a time), driven from the widget strip. */
export const agentSetupModalLogic = kea<agentSetupModalLogicType>([
path(['scenes', 'inbox', 'components', 'shell', 'agentSetupModalLogic']),
diff --git a/frontend/src/scenes/inbox/components/signalCards/inboxErrorTrackingIssueLogic.ts b/frontend/src/scenes/inbox/components/signalCards/inboxErrorTrackingIssueLogic.ts
index b1794dd5f30c..6752371ce15d 100644
--- a/frontend/src/scenes/inbox/components/signalCards/inboxErrorTrackingIssueLogic.ts
+++ b/frontend/src/scenes/inbox/components/signalCards/inboxErrorTrackingIssueLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -10,7 +10,7 @@ import { DateRange, ErrorTrackingIssue, ErrorTrackingRelationalIssue } from '~/q
import { errorTrackingIssueQuery } from 'products/error_tracking/frontend/queries'
import { ERROR_TRACKING_LISTING_RESOLUTION } from 'products/error_tracking/frontend/utils'
-import type { inboxErrorTrackingIssueLogicType } from './inboxErrorTrackingIssueLogicType'
+import type { ErrorTrackingIssueAggregations } from '../../../../queries/schema/schema-general'
export type InboxErrorTrackingIssueSourceType = 'issue_created' | 'issue_reopened' | 'issue_spiking'
@@ -35,6 +35,99 @@ function defaultDateRange(): DateRange {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxErrorTrackingIssueLogicValues {
+ issue: ErrorTrackingRelationalIssue | null
+ issueLoading: boolean
+ mergedFailed: boolean
+ mergedIssue: ErrorTrackingIssue | null
+ mergedToIssueId: string | null
+ sparklineResolution: number
+ spikeEvents: ErrorTrackingSpikeEvent[]
+ spikeEventsLoading: boolean
+ summary: InboxErrorTrackingIssueSummary | null
+ summaryLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxErrorTrackingIssueLogicActions {
+ loadIssue: () => any
+ loadIssueFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadIssueSuccess: (
+ issue: ErrorTrackingRelationalIssue,
+ payload?: any
+ ) => {
+ issue: ErrorTrackingRelationalIssue
+ payload?: any
+ }
+ loadSpikeEvents: () => any
+ loadSpikeEventsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSpikeEventsSuccess: (
+ spikeEvents: ErrorTrackingSpikeEvent[],
+ payload?: any
+ ) => {
+ spikeEvents: ErrorTrackingSpikeEvent[]
+ payload?: any
+ }
+ loadSummary: () => any
+ loadSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSummarySuccess: (
+ summary: {
+ aggregations: ErrorTrackingIssueAggregations
+ first_seen: string
+ last_seen: string
+ } | null,
+ payload?: any
+ ) => {
+ summary: {
+ aggregations: ErrorTrackingIssueAggregations
+ first_seen: string
+ last_seen: string
+ } | null
+ payload?: any
+ }
+ setMergedToIssueId: (issueId: string | null) => {
+ issueId: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxErrorTrackingIssueLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ mergedFailed: (issueLoading: boolean, issue: ErrorTrackingRelationalIssue | null) => boolean
+ mergedIssue: (
+ issue: ErrorTrackingRelationalIssue | null,
+ summary: InboxErrorTrackingIssueSummary | null
+ ) => ErrorTrackingIssue | null
+ }
+}
+
+export type inboxErrorTrackingIssueLogicType = MakeLogicType<
+ inboxErrorTrackingIssueLogicValues,
+ inboxErrorTrackingIssueLogicActions,
+ InboxErrorTrackingIssueLogicProps,
+ inboxErrorTrackingIssueLogicMeta
+>
+
/**
* Loads the live error tracking issue (relational row + summary aggregations, plus spike events for
* spiking signals) so the inbox signal card can embed the real issue row read-only. Keyed by
@@ -123,7 +216,10 @@ export const inboxErrorTrackingIssueLogic = kea<inboxErrorTrackingIssueLogicType
selectors({
/** True once the issue load failed (not found, merged away, or otherwise unavailable). */
- mergedFailed: [(s) => [s.issueLoading, s.issue], (issueLoading, issue) => !issueLoading && !issue],
+ mergedFailed: [
+ (s) => [s.issueLoading, s.issue],
+ (issueLoading: boolean, issue: ErrorTrackingRelationalIssue | null) => !issueLoading && !issue,
+ ],
/** Assembled `ErrorTrackingIssue` for the read-only row: relational issue merged with summary. */
mergedIssue: [
diff --git a/frontend/src/scenes/inbox/components/signalCards/inboxLlmTraceLogic.ts b/frontend/src/scenes/inbox/components/signalCards/inboxLlmTraceLogic.ts
index 2f4499b5b956..8007401ea852 100644
--- a/frontend/src/scenes/inbox/components/signalCards/inboxLlmTraceLogic.ts
+++ b/frontend/src/scenes/inbox/components/signalCards/inboxLlmTraceLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, kea, key, path, props } from 'kea'
+import { MakeLogicType, afterMount, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -6,8 +6,6 @@ import { dayjs } from 'lib/dayjs'
import { LLMTrace, NodeKind, TraceQuery, TraceQueryResponse } from '~/queries/schema/schema-general'
-import type { inboxLlmTraceLogicType } from './inboxLlmTraceLogicType'
-
export interface InboxLlmTraceLogicProps {
traceId: string
}
@@ -17,6 +15,43 @@ export interface InboxLlmTraceLogicProps {
// narrow window would miss them.
const TRACE_LOOKBACK_FLOOR = dayjs.utc(new Date(2025, 0, 10)).toISOString()
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxLlmTraceLogicValues {
+ trace: LLMTrace | null
+ traceLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxLlmTraceLogicActions {
+ loadTrace: () => any
+ loadTraceFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTraceSuccess: (
+ trace: LLMTrace | null,
+ payload?: any
+ ) => {
+ trace: LLMTrace | null
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxLlmTraceLogicMeta {
+ key: string
+}
+
+export type inboxLlmTraceLogicType = MakeLogicType<
+ inboxLlmTraceLogicValues,
+ inboxLlmTraceLogicActions,
+ InboxLlmTraceLogicProps,
+ inboxLlmTraceLogicMeta
+>
+
/**
* Keyed loader that eagerly fetches a single `LLMTrace` by id for an inbox signal card. Intentionally
* standalone — it does not mount the AI observability trace scene logic (which owns URL routing). On
diff --git a/frontend/src/scenes/inbox/inboxSceneLogic.ts b/frontend/src/scenes/inbox/inboxSceneLogic.ts
index e2e3d198a078..2c4466bf72b4 100644
--- a/frontend/src/scenes/inbox/inboxSceneLogic.ts
+++ b/frontend/src/scenes/inbox/inboxSceneLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
@@ -14,13 +14,13 @@ import { Breadcrumb } from '~/types'
import { OriginProduct, Task, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
+import type { UserType } from '../../types'
import {
captureInboxReportClosed,
captureInboxReportOpened,
InboxReportCloseMethod,
InboxReportOpenMethod,
} from './inboxAnalytics'
-import type { inboxSceneLogicType } from './inboxSceneLogicType'
import { inboxFiltersLogic } from './logics/inboxFiltersLogic'
import { INBOX_FLAT_TAB_LIST_PARAMS, reportListLogic } from './logics/reportListLogic'
import { scratchpadLogic } from './logics/scratchpadLogic'
@@ -179,6 +179,123 @@ interface InboxOpenTracking {
openedAt: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxSceneLogicValues {
+ isSessionAnalysisRunning: boolean // signalSourcesLogic
+ user: UserType | null // userLogic
+ activeTab: InboxTabKey
+ breadcrumbs: Breadcrumb[]
+ isFindingsOpen: boolean
+ isRunningSessionAnalysis: boolean
+ isScratchpadOpen: boolean
+ isStaff: boolean
+ selectedReport: SignalReport | null
+ selectedReportId: string | null
+ selectedReportLoading: boolean
+ selectedReportResponse: SignalReport | null
+ selectedReportResponseLoading: boolean
+ selectedScoutFindingId: string | null
+ selectedScoutSkillName: string | null
+ signalRuns: SignalRun[]
+ signalRunsLoading: boolean
+ signalRunsResponse: SignalRun[] | null
+ signalRunsResponseLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxSceneLogicActions {
+ loadSourceConfigs: () => any // signalSourcesLogic
+ loadRuns: (_payload: void) => void
+ loadRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRunsSuccess: (
+ signalRunsResponse: SignalRun[],
+ payload?: void
+ ) => {
+ signalRunsResponse: SignalRun[]
+ payload?: void
+ }
+ loadSelectedReport: ({ id }: { id: string }) => {
+ id: string
+ }
+ loadSelectedReportFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSelectedReportSuccess: (
+ selectedReportResponse: SignalReport,
+ payload?: {
+ id: string
+ }
+ ) => {
+ selectedReportResponse: SignalReport
+ payload?: {
+ id: string
+ }
+ }
+ runSessionAnalysis: () => {
+ value: true
+ }
+ runSessionAnalysisFailure: (error: string) => {
+ error: string
+ }
+ runSessionAnalysisSuccess: () => {
+ value: true
+ }
+ seedSelectedReport: (report: SignalReport | null) => {
+ report: SignalReport | null
+ }
+ setActiveTab: (tab: InboxTabKey) => {
+ tab: InboxTabKey
+ }
+ setFindingsOpen: (open: boolean) => {
+ open: boolean
+ }
+ setScratchpadOpen: (open: boolean) => {
+ open: boolean
+ }
+ setSelectedReportId: (
+ id: string | null,
+ openMethod?: InboxReportOpenMethod
+ ) => {
+ id: string | null
+ openMethod: InboxReportOpenMethod
+ }
+ setSelectedScoutSkillName: (
+ skillName: string | null,
+ findingId?: string | null
+ ) => {
+ findingId: string | null
+ skillName: string | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxSceneLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isStaff: (user: UserType | null) => boolean
+ signalRuns: (signalRunsResponse: SignalRun[] | null) => SignalRun[]
+ signalRunsLoading: (signalRunsResponse: SignalRun[] | null, signalRunsResponseLoading: boolean) => boolean
+ selectedReport: (selectedReportResponse: SignalReport | null) => SignalReport | null
+ selectedReportLoading: (selectedReportResponseLoading: boolean) => boolean
+ }
+}
+
+export type inboxSceneLogicType = MakeLogicType<
+ inboxSceneLogicValues,
+ inboxSceneLogicActions,
+ Record<string, any>,
+ inboxSceneLogicMeta
+>
+
/**
* Inbox scene orchestrator. Owns the active tab, the selected report (loaded by id),
* the project-wide Runs list, and session-analysis. The per-tab report
@@ -340,7 +457,10 @@ export const inboxSceneLogic = kea<inboxSceneLogicType>([
},
],
],
- isStaff: [() => [userLogic.selectors.user], (user): boolean => user?.is_staff ?? false],
+ isStaff: [
+ () => [userLogic.selectors.user],
+ (user: null | import('~/types').UserType): boolean => user?.is_staff ?? false,
+ ],
signalRuns: [
(s) => [s.signalRunsResponse],
(signalRunsResponse: SignalRun[] | null): SignalRun[] => signalRunsResponse ?? [],
diff --git a/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts b/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts
index da181727d296..370a9ef5755a 100644
--- a/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts
+++ b/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import { router } from 'kea-router'
import { lemonToast } from '@posthog/lemon-ui'
@@ -9,7 +9,6 @@ import { urls } from 'scenes/urls'
import { OriginProduct } from 'products/posthog_ai/frontend/types/taskTypes'
import { RunSourceEnumApi } from 'products/tasks/frontend/generated/api.schemas'
-import type { inboxTaskKickoffLogicType } from './inboxTaskKickoffLogicType'
import {
SIGNAL_REPORT_TASK_DISCUSSION_RELATIONSHIP,
SIGNAL_REPORT_TASK_IMPLEMENTATION_RELATIONSHIP,
@@ -99,6 +98,42 @@ async function createReportTask(
router.actions.push(urls.taskDetail(task.id))
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxTaskKickoffLogicValues {
+ isCreatingPr: boolean
+ isDiscussing: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxTaskKickoffLogicActions {
+ createPrFailure: () => {
+ value: true
+ }
+ createPrFromReport: (report: SignalReport) => {
+ report: SignalReport
+ }
+ createPrSuccess: () => {
+ value: true
+ }
+ discussReport: (
+ report: SignalReport,
+ reportUrl: string,
+ question: string
+ ) => {
+ question: string
+ report: SignalReport
+ reportUrl: string
+ }
+ discussReportFailure: () => {
+ value: true
+ }
+ discussReportSuccess: () => {
+ value: true
+ }
+}
+
+export type inboxTaskKickoffLogicType = MakeLogicType<inboxTaskKickoffLogicValues, inboxTaskKickoffLogicActions>
+
export const inboxTaskKickoffLogic = kea<inboxTaskKickoffLogicType>([
path(['scenes', 'inbox', 'inboxTaskKickoffLogic']),
diff --git a/frontend/src/scenes/inbox/logics/findingsLogic.ts b/frontend/src/scenes/inbox/logics/findingsLogic.ts
index f1c0e66e71d0..a187ca53e6fa 100644
--- a/frontend/src/scenes/inbox/logics/findingsLogic.ts
+++ b/frontend/src/scenes/inbox/logics/findingsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
@@ -13,7 +13,6 @@ import {
SignalScoutRunSummary,
} from '../types'
import { mostRecentEmittedRuns, prettifyScoutSkillName } from '../utils/scoutRunsWindow'
-import type { findingsLogicType } from './findingsLogicType'
import { ScoutEmissionRow } from './scoutDetailLogic'
import { scoutFleetLogic } from './scoutFleetLogic'
@@ -34,6 +33,133 @@ function severityRank(severity: SignalReportPriority | null): number {
return severity == null ? 5 : SEVERITY_RANK[severity]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface findingsLogicValues {
+ runsWindow: {
+ complete: boolean
+ runs: SignalScoutRunSummary[]
+ } // scoutFleetLogic
+ runsWindowComplete: boolean // scoutFleetLogic
+ runsWindowLoadedOnce: boolean // scoutFleetLogic
+ availableScouts: {
+ count: number
+ label: string
+ skillName: string
+ }[]
+ emissionReports: SignalScoutEmissionReportLink[]
+ emissionReportsLoading: boolean
+ emissions: SignalScoutEmission[]
+ emissionsLoadFailed: boolean
+ emissionsLoading: boolean
+ emittedRuns: SignalScoutRunSummary[]
+ emittedRunsKey: string
+ filteredRows: ScoutEmissionRow[]
+ hasLoadedOnce: boolean
+ latestEmittedAt: string | null
+ reportBySourceId: Map<string, LinkedSignalReport>
+ rows: ScoutEmissionRow[]
+ scoutCount: number
+ scoutFilter: string
+ searchText: string
+ severityFilter: string
+ sortKey: FindingsSortKey
+ totalCount: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface findingsLogicActions {
+ loadEmissionReports: () => any
+ loadEmissionReportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEmissionReportsSuccess: (
+ emissionReports: SignalScoutEmissionReportLink[],
+ payload?: any
+ ) => {
+ emissionReports: SignalScoutEmissionReportLink[]
+ payload?: any
+ }
+ loadEmissions: () => any
+ loadEmissionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEmissionsSuccess: (
+ emissions: SignalScoutEmission[],
+ payload?: any
+ ) => {
+ emissions: SignalScoutEmission[]
+ payload?: any
+ }
+ setScoutFilter: (scoutFilter: string) => {
+ scoutFilter: string
+ }
+ setSearchText: (searchText: string) => {
+ searchText: string
+ }
+ setSeverityFilter: (severityFilter: string) => {
+ severityFilter: string
+ }
+ setSortKey: (sortKey: FindingsSortKey) => {
+ sortKey: FindingsSortKey
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface findingsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ emittedRuns: (runsWindow: { complete: boolean; runs: SignalScoutRunSummary[] }) => SignalScoutRunSummary[]
+ emittedRunsKey: (emittedRuns: SignalScoutRunSummary[]) => string
+ reportBySourceId: (emissionReports: SignalScoutEmissionReportLink[]) => Map<string, LinkedSignalReport>
+ rows: (
+ emissions: SignalScoutEmission[],
+ emittedRuns: SignalScoutRunSummary[],
+ reportBySourceId: Map<string, LinkedSignalReport>
+ ) => ScoutEmissionRow[]
+ availableScouts: (rows: ScoutEmissionRow[]) => {
+ count: number
+ label: string
+ skillName: string
+ }[]
+ filteredRows: (
+ rows: ScoutEmissionRow[],
+ searchText: string,
+ scoutFilter: string,
+ severityFilter: string,
+ sortKey: FindingsSortKey
+ ) => ScoutEmissionRow[]
+ totalCount: (rows: ScoutEmissionRow[]) => number
+ scoutCount: (
+ availableScouts: {
+ count: number
+ label: string
+ skillName: string
+ }[]
+ ) => number
+ latestEmittedAt: (rows: ScoutEmissionRow[]) => string | null
+ hasLoadedOnce: (
+ runsWindowLoadedOnce: boolean,
+ emittedRuns: SignalScoutRunSummary[],
+ emissionsLoading: boolean,
+ emissions: SignalScoutEmission[]
+ ) => boolean
+ }
+}
+
+export type findingsLogicType = MakeLogicType<
+ findingsLogicValues,
+ findingsLogicActions,
+ Record<string, any>,
+ findingsLogicMeta
+>
+
/**
* Fleet-wide findings logic — the cross-troop counterpart of the per-scout `scoutDetailLogic`. Reuses
* `scoutFleetLogic`'s polled runs window to find every scout's recent emitted runs, fetches their
@@ -135,7 +261,7 @@ export const findingsLogic = kea<findingsLogicType>([
],
reportBySourceId: [
(s) => [s.emissionReports],
- (emissionReports): Map<string, LinkedSignalReport> =>
+ (emissionReports: SignalScoutEmissionReportLink[]): Map<string, LinkedSignalReport> =>
new Map(
emissionReports
.filter((link) => link.report !== null)
@@ -162,7 +288,7 @@ export const findingsLogic = kea<findingsLogicType>([
// Distinct scouts present in the loaded findings, with a per-scout count, for the scout filter.
availableScouts: [
(s) => [s.rows],
- (rows): { skillName: string; label: string; count: number }[] => {
+ (rows: ScoutEmissionRow[]): { skillName: string; label: string; count: number }[] => {
const counts = new Map<string, number>()
for (const row of rows) {
counts.set(row.run.skill_name, (counts.get(row.run.skill_name) ?? 0) + 1)
@@ -175,7 +301,13 @@ export const findingsLogic = kea<findingsLogicType>([
// Visible set: search (over finding text + prettified scout name) + scout + severity, then sort.
filteredRows: [
(s) => [s.rows, s.searchText, s.scoutFilter, s.severityFilter, s.sortKey],
- (rows, searchText, scoutFilter, severityFilter, sortKey): ScoutEmissionRow[] => {
+ (
+ rows: ScoutEmissionRow[],
+ searchText: string,
+ scoutFilter: string,
+ severityFilter: string,
+ sortKey: FindingsSortKey
+ ): ScoutEmissionRow[] => {
const needle = searchText.trim().toLowerCase()
const filtered = rows.filter((row) => {
if (scoutFilter !== FINDINGS_SCOUT_FILTER_ALL && row.run.skill_name !== scoutFilter) {
@@ -213,11 +345,20 @@ export const findingsLogic = kea<findingsLogicType>([
},
],
// Page header tallies, from the loaded set (not the cheap window sum the callout uses).
- totalCount: [(s) => [s.rows], (rows): number => rows.length],
- scoutCount: [(s) => [s.availableScouts], (availableScouts): number => availableScouts.length],
+ totalCount: [(s) => [s.rows], (rows: ScoutEmissionRow[]): number => rows.length],
+ scoutCount: [
+ (s) => [s.availableScouts],
+ (
+ availableScouts: {
+ count: number
+ label: string
+ skillName: string
+ }[]
+ ): number => availableScouts.length,
+ ],
latestEmittedAt: [
(s) => [s.rows],
- (rows): string | null => {
+ (rows: ScoutEmissionRow[]): string | null => {
let latest: string | null = null
for (const row of rows) {
const at = row.emission.emitted_at
@@ -233,7 +374,12 @@ export const findingsLogic = kea<findingsLogicType>([
// `!emissionsLoading` guard suppresses poll flicker once findings are in hand.
hasLoadedOnce: [
(s) => [s.runsWindowLoadedOnce, s.emittedRuns, s.emissionsLoading, s.emissions],
- (runsWindowLoadedOnce, emittedRuns: SignalScoutRunSummary[], emissionsLoading, emissions): boolean =>
+ (
+ runsWindowLoadedOnce: boolean,
+ emittedRuns: SignalScoutRunSummary[],
+ emissionsLoading: boolean,
+ emissions: SignalScoutEmission[]
+ ): boolean =>
runsWindowLoadedOnce && (emittedRuns.length === 0 || !emissionsLoading || emissions.length > 0),
],
}),
diff --git a/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts b/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts
index 7e2fa8baf136..219a473565d1 100644
--- a/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { lemonToast } from '@posthog/lemon-ui'
@@ -6,7 +6,6 @@ import api from 'lib/api'
import { captureInboxReportAction } from '../inboxAnalytics'
import type { DismissalReasonValue } from '../utils/dismissalReasons'
-import type { inboxBulkActionsLogicType } from './inboxBulkActionsLogicType'
/** Tally of a bulk operation that ran one request per selected report. */
interface BulkActionResult {
@@ -23,6 +22,67 @@ function formatDismissSummary(result: BulkActionResult): string {
return `${successCount} ${pluralized} dismissed, ${failureCount} failed`
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxBulkActionsLogicValues {
+ hasSelection: boolean
+ isDismissing: boolean
+ selectedCount: number
+ selectedReportIds: string[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxBulkActionsLogicActions {
+ bulkDismiss: (
+ reason: DismissalReasonValue,
+ note: string
+ ) => {
+ note: string
+ reason:
+ | 'already_fixed'
+ | 'analysis_wrong'
+ | 'other'
+ | 'report_unclear'
+ | 'wontfix_intentional'
+ | 'wontfix_irrelevant'
+ }
+ bulkDismissFailure: () => {
+ value: true
+ }
+ bulkDismissSuccess: () => {
+ value: true
+ }
+ clearSelection: () => {
+ value: true
+ }
+ reportArchived: () => {
+ value: true
+ }
+ selectAll: (reportIds: string[]) => {
+ reportIds: string[]
+ }
+ setSelectedReportIds: (reportIds: string[]) => {
+ reportIds: string[]
+ }
+ toggleReportSelection: (reportId: string) => {
+ reportId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxBulkActionsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ selectedCount: (selectedReportIds: string[]) => number
+ hasSelection: (selectedReportIds: string[]) => boolean
+ }
+}
+
+export type inboxBulkActionsLogicType = MakeLogicType<
+ inboxBulkActionsLogicValues,
+ inboxBulkActionsLogicActions,
+ Record<string, any>,
+ inboxBulkActionsLogicMeta
+>
+
/**
* Multi-select + bulk dismiss for the inbox report list. Mirrors desktop
* `inboxReportSelectionStore` (selection state) and `useInboxBulkActions`
diff --git a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
index 028a90f8b41d..a34a9b3556e3 100644
--- a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
@@ -8,7 +8,6 @@ import { urls } from 'scenes/urls'
import { INBOX_PRIORITY_OPTIONS, INBOX_SORT_OPTIONS, INBOX_SOURCE_OPTIONS } from '../filterOptions'
import { INBOX_SCOPE_FOR_YOU, InboxScope, SignalReportPriority } from '../types'
-import type { inboxFiltersLogicType } from './inboxFiltersLogicType'
/** A teammate who can be scoped to / suggested as a reviewer. Matches the `available_reviewers` API row. */
export interface InboxReviewerOption {
@@ -142,6 +141,102 @@ export function buildSignalReportListOrdering(field: InboxSortField, direction:
return field === 'updated_at' ? `${fieldKey},status` : `${fieldKey},status,-updated_at`
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxFiltersLogicValues {
+ availableReviewers: InboxReviewerOption[]
+ availableReviewersLoading: boolean
+ hasActiveFilters: boolean
+ hasUserChosenScope: boolean
+ priorityFilter: SignalReportPriority[]
+ scope: InboxScope
+ searchQuery: string
+ sortDirection: InboxSortDirection
+ sortField: InboxSortField
+ sourceProductFilter: string[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxFiltersLogicActions {
+ applyDefaultScope: (scope: InboxScope) => {
+ scope: InboxScope
+ }
+ clearFilters: () => {
+ value: true
+ }
+ loadAvailableReviewers: ({ query }?: { query?: string }) => {
+ query?: string
+ }
+ loadAvailableReviewersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAvailableReviewersSuccess: (
+ availableReviewers: {
+ email: string
+ name: string
+ user_uuid: string
+ }[],
+ payload?: {
+ query?: string
+ }
+ ) => {
+ availableReviewers: {
+ email: string
+ name: string
+ user_uuid: string
+ }[]
+ payload?: {
+ query?: string
+ }
+ }
+ searchAvailableReviewers: (query: string) => {
+ query: string
+ }
+ setFilters: (filters: InboxFilterState) => {
+ filters: InboxFilterState
+ }
+ setScope: (scope: InboxScope) => {
+ scope: InboxScope
+ }
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+ setSort: (
+ field: InboxSortField,
+ direction: InboxSortDirection
+ ) => {
+ direction: InboxSortDirection
+ field: InboxSortField
+ }
+ togglePriority: (priority: SignalReportPriority) => {
+ priority: SignalReportPriority
+ }
+ toggleSourceProduct: (source: string) => {
+ source: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxFiltersLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasActiveFilters: (
+ searchQuery: string,
+ sourceProductFilter: string[],
+ priorityFilter: SignalReportPriority[]
+ ) => boolean
+ }
+}
+
+export type inboxFiltersLogicType = MakeLogicType<
+ inboxFiltersLogicValues,
+ inboxFiltersLogicActions,
+ Record<string, any>,
+ inboxFiltersLogicMeta
+>
+
/**
* Persisted inbox filter state. Mirrors desktop's zustand stores:
* - `inboxReviewerScopeStore` → `scope` (persisted, default "for-you")
@@ -272,7 +367,7 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
// reports the way search/source/priority do, and `clearFilters` leaves them untouched.
hasActiveFilters: [
(s) => [s.searchQuery, s.sourceProductFilter, s.priorityFilter],
- (searchQuery, sourceProductFilter, priorityFilter): boolean =>
+ (searchQuery: string, sourceProductFilter: string[], priorityFilter: SignalReportPriority[]): boolean =>
searchQuery.trim().length > 0 || sourceProductFilter.length > 0 || priorityFilter.length > 0,
],
}),
diff --git a/frontend/src/scenes/inbox/logics/inboxOnboardingLogic.ts b/frontend/src/scenes/inbox/logics/inboxOnboardingLogic.ts
index 80454f8caa65..ec857e3fa0e6 100644
--- a/frontend/src/scenes/inbox/logics/inboxOnboardingLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxOnboardingLogic.ts
@@ -1,7 +1,7 @@
-import { actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
import { signalSourcesLogic } from '../signalSourcesLogic'
-import type { inboxOnboardingLogicType } from './inboxOnboardingLogicType'
+import type { SignalScoutConfig, SignalSourceConfig } from '../types'
import { INBOX_FLAT_TAB_LIST_PARAMS, reportListLogic } from './reportListLogic'
import { scoutFleetLogic } from './scoutFleetLogic'
@@ -55,6 +55,60 @@ export function computeOnboardingMode({
return 'takeover'
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxOnboardingLogicValues {
+ pullsCount: number | null // reportListLogic
+ pullsCountLoading: boolean // reportListLogic
+ reportsCount: number | null // reportListLogic
+ reportsCountLoading: boolean // reportListLogic
+ enabledScoutsCount: number // scoutFleetLogic
+ scoutConfigs: SignalScoutConfig[] | null // scoutFleetLogic
+ enabledSourcesCount: number // signalSourcesLogic
+ sourceConfigs: SignalSourceConfig[] | null // signalSourcesLogic
+ areCountsResolved: boolean
+ bannerDismissed: boolean
+ hasExistingWork: boolean
+ isSelfDrivingSetUp: boolean
+ isSetupLoaded: boolean
+ onboardingMode: InboxOnboardingMode
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxOnboardingLogicActions {
+ dismissBanner: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxOnboardingLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isSelfDrivingSetUp: (enabledSourcesCount: number, enabledScoutsCount: number) => boolean
+ isSetupLoaded: (sourceConfigs: SignalSourceConfig[] | null, scoutConfigs: SignalScoutConfig[] | null) => boolean
+ areCountsResolved: (
+ pullsCount: number | null,
+ reportsCount: number | null,
+ pullsCountLoading: boolean,
+ reportsCountLoading: boolean
+ ) => boolean
+ hasExistingWork: (pullsCount: number | null, reportsCount: number | null) => boolean
+ onboardingMode: (
+ isSetupLoaded: boolean,
+ isSelfDrivingSetUp: boolean,
+ areCountsResolved: boolean,
+ hasExistingWork: boolean,
+ bannerDismissed: boolean
+ ) => InboxOnboardingMode
+ }
+}
+
+export type inboxOnboardingLogicType = MakeLogicType<
+ inboxOnboardingLogicValues,
+ inboxOnboardingLogicActions,
+ Record<string, any>,
+ inboxOnboardingLogicMeta
+>
+
/**
* Decides how the single-command self-driving onboarding presents itself. There are no in-app
* setup steps – the user runs one wizard command in their repo – so "set up" is read straight
@@ -104,33 +158,43 @@ export const inboxOnboardingLogic = kea<inboxOnboardingLogicType>([
selectors({
isSelfDrivingSetUp: [
(s) => [s.enabledSourcesCount, s.enabledScoutsCount],
- (enabledSourcesCount, enabledScoutsCount): boolean => enabledSourcesCount + enabledScoutsCount > 0,
+ (enabledSourcesCount: number, enabledScoutsCount: number): boolean =>
+ enabledSourcesCount + enabledScoutsCount > 0,
],
// Both source + scout config loaders have settled, so the set-up verdict is trustworthy.
isSetupLoaded: [
(s) => [s.sourceConfigs, s.scoutConfigs],
- (sourceConfigs, scoutConfigs): boolean => sourceConfigs !== null && scoutConfigs !== null,
+ (
+ sourceConfigs: import('../types').SignalSourceConfig[] | null,
+ scoutConfigs: import('../types').SignalScoutConfig[] | null
+ ): boolean => sourceConfigs !== null && scoutConfigs !== null,
],
// Counts are "resolved" once both limit=1 requests have returned, OR once neither is still
// loading (so a failed count request can't strand the onboarding on the loading state – this
// is only consulted after the configs have loaded, by which point the counts have started).
areCountsResolved: [
(s) => [s.pullsCount, s.reportsCount, s.pullsCountLoading, s.reportsCountLoading],
- (pullsCount, reportsCount, pullsCountLoading, reportsCountLoading): boolean =>
+ (
+ pullsCount: number | null,
+ reportsCount: number | null,
+ pullsCountLoading: boolean,
+ reportsCountLoading: boolean
+ ): boolean =>
(pullsCount !== null && reportsCount !== null) || (!pullsCountLoading && !reportsCountLoading),
],
hasExistingWork: [
(s) => [s.pullsCount, s.reportsCount],
- (pullsCount, reportsCount): boolean => (pullsCount ?? 0) + (reportsCount ?? 0) > 0,
+ (pullsCount: number | null, reportsCount: number | null): boolean =>
+ (pullsCount ?? 0) + (reportsCount ?? 0) > 0,
],
onboardingMode: [
(s) => [s.isSetupLoaded, s.isSelfDrivingSetUp, s.areCountsResolved, s.hasExistingWork, s.bannerDismissed],
(
- isSetupLoaded,
- isSelfDrivingSetUp,
- areCountsResolved,
- hasExistingWork,
- bannerDismissed
+ isSetupLoaded: boolean,
+ isSelfDrivingSetUp: boolean,
+ areCountsResolved: boolean,
+ hasExistingWork: boolean,
+ bannerDismissed: boolean
): InboxOnboardingMode =>
computeOnboardingMode({
isSetupLoaded,
diff --git a/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts b/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts
index d24877389c10..9178cb51e365 100644
--- a/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts
@@ -1,4 +1,16 @@
-import { actions, afterMount, kea, key, listeners, path, props, propsChanged, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ propsChanged,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -13,6 +25,7 @@ import { signalsReportsSignalsRetrieve } from 'products/signals/frontend/generat
import { signalsReportArtefactsDiff } from 'products/signals/frontend/generated/api'
import type { CommitDiffResponseApi } from 'products/signals/frontend/generated/api.schemas'
+import type { SignalNodeApi } from '../../../../../products/signals/frontend/generated/api.schemas'
import {
deriveTaskPurpose,
PURPOSE_ORDER,
@@ -31,7 +44,6 @@ import {
SignalReportArtefactResponse,
SignalReportStatus,
} from '../types'
-import type { inboxReportDetailLogicType } from './inboxReportDetailLogicType'
/** Run statuses that count as terminal. Mirrors desktop `isTerminalStatus` / `ReportTasksSection`. */
const TERMINAL_RUN_STATUSES: TaskRunStatus[] = [TaskRunStatus.COMPLETED, TaskRunStatus.FAILED, TaskRunStatus.CANCELLED]
@@ -88,6 +100,196 @@ function latestJudgmentExplanation(
return typeof explanation === 'string' && explanation.trim() ? explanation : null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxReportDetailLogicValues {
+ actionabilityExplanation: string | null
+ addReviewerOptions: AvailableReviewerOption[]
+ availableReviewers: AvailableReviewerOption[] | null
+ availableReviewersLoading: boolean
+ diffArtefactId: string | null
+ displayReviewers: EnrichedReviewer[] | null
+ expandedTaskIds: string[]
+ isReResearch: boolean
+ isReportActive: boolean
+ isUpdatingReviewers: boolean
+ latestCommitArtefact: SignalReportArtefact | null
+ optimisticReviewers: EnrichedReviewer[] | null
+ primaryTask: ReportTaskEntry | null
+ priorityExplanation: string | null
+ report: SignalReport | null
+ reportArtefacts: SignalReportArtefact[] | null
+ reportArtefactsLoading: boolean
+ reportDiff: CommitDiffResponseApi | null
+ reportDiffError: string | null
+ reportDiffLoading: boolean
+ reportReviewers: EnrichedReviewer[] | null
+ reportSignals: SignalNode[] | null
+ reportSignalsLoading: boolean
+ reportTasks: ReportTaskEntry[] | null
+ reportTasksLoading: boolean
+ selectedTask: ReportTaskEntry | null
+ selectedTaskId: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxReportDetailLogicActions {
+ loadAvailableReviewers: ({ query }?: { query?: string }) => {
+ query?: string
+ }
+ loadAvailableReviewersFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAvailableReviewersSuccess: (
+ availableReviewers: {
+ email: string
+ name: string
+ user_uuid: string
+ }[],
+ payload?: {
+ query?: string
+ }
+ ) => {
+ availableReviewers: {
+ email: string
+ name: string
+ user_uuid: string
+ }[]
+ payload?: {
+ query?: string
+ }
+ }
+ loadReportArtefacts: () => any
+ loadReportArtefactsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReportArtefactsSuccess: (
+ reportArtefacts: SignalReportArtefact[],
+ payload?: any
+ ) => {
+ reportArtefacts: SignalReportArtefact[]
+ payload?: any
+ }
+ loadReportDiff: ({ artefactId }: { artefactId: string }) => {
+ artefactId: string
+ }
+ loadReportDiffFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReportDiffSuccess: (
+ reportDiff: CommitDiffResponseApi | null,
+ payload?: {
+ artefactId: string
+ }
+ ) => {
+ reportDiff: CommitDiffResponseApi | null
+ payload?: {
+ artefactId: string
+ }
+ }
+ loadReportSignals: () => any
+ loadReportSignalsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReportSignalsSuccess: (
+ reportSignals: SignalNodeApi[],
+ payload?: any
+ ) => {
+ reportSignals: SignalNodeApi[]
+ payload?: any
+ }
+ loadReportTasks: () => any
+ loadReportTasksFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReportTasksSuccess: (
+ reportTasks: ReportTaskEntry[],
+ payload?: any
+ ) => {
+ reportTasks: ReportTaskEntry[]
+ payload?: any
+ }
+ searchAvailableReviewers: (query: string) => {
+ query: string
+ }
+ setOptimisticReviewers: (reviewers: EnrichedReviewer[] | null) => {
+ reviewers: EnrichedReviewer[] | null
+ }
+ setReport: (report: SignalReport | null) => {
+ report: SignalReport | null
+ }
+ setSelectedTaskId: (taskId: string | null) => {
+ taskId: string | null
+ }
+ toggleExpandedTask: (taskId: string) => {
+ taskId: string
+ }
+ updateReviewers: (
+ artefactId: string,
+ content: Record<string, string>[],
+ optimistic: EnrichedReviewer[]
+ ) => {
+ artefactId: string
+ content: Record<string, string>[]
+ optimistic: EnrichedReviewer[]
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxReportDetailLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isUpdatingReviewers: (optimisticReviewers: EnrichedReviewer[] | null) => boolean
+ reportReviewers: (reportArtefacts: SignalReportArtefact[] | null) => EnrichedReviewer[] | null
+ isReportActive: (report: SignalReport | null) => boolean
+ latestCommitArtefact: (reportArtefacts: SignalReportArtefact[] | null) => SignalReportArtefact | null
+ priorityExplanation: (reportArtefacts: SignalReportArtefact[] | null) => string | null
+ actionabilityExplanation: (reportArtefacts: SignalReportArtefact[] | null) => string | null
+ displayReviewers: (
+ reportReviewers: EnrichedReviewer[] | null,
+ optimisticReviewers: EnrichedReviewer[] | null,
+ user: null | import('../../../types').UserType
+ ) => EnrichedReviewer[] | null
+ addReviewerOptions: (
+ availableReviewers: AvailableReviewerOption[] | null,
+ user: null | import('../../../types').UserType
+ ) => AvailableReviewerOption[]
+ isReResearch: (reportTasks: ReportTaskEntry[] | null) => boolean
+ primaryTask: (reportTasks: ReportTaskEntry[] | null) => ReportTaskEntry | null
+ selectedTask: (
+ reportTasks: ReportTaskEntry[] | null,
+ selectedTaskId: string | null,
+ primaryTask: ReportTaskEntry | null
+ ) => ReportTaskEntry | null
+ }
+}
+
+export type inboxReportDetailLogicType = MakeLogicType<
+ inboxReportDetailLogicValues,
+ inboxReportDetailLogicActions,
+ InboxReportDetailLogicProps,
+ inboxReportDetailLogicMeta
+>
+
/**
* Per-selected-report detail logic: artefacts, contributing signals, suggested reviewers, and linked tasks.
* Keyed by `reportId` so each open report gets its own mounted instance. Does NOT import `inboxSceneLogic`
@@ -283,7 +485,10 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([
selectors({
// Mirrors the optimistic override lifecycle: an update is in flight exactly while the
// optimistic list is set (cleared once the reload lands or the update fails).
- isUpdatingReviewers: [(s) => [s.optimisticReviewers], (optimisticReviewers) => optimisticReviewers !== null],
+ isUpdatingReviewers: [
+ (s) => [s.optimisticReviewers],
+ (optimisticReviewers: EnrichedReviewer[] | null) => optimisticReviewers !== null,
+ ],
reportReviewers: [
(s) => [s.reportArtefacts],
(reportArtefacts: SignalReportArtefact[] | null): EnrichedReviewer[] | null => {
diff --git a/frontend/src/scenes/inbox/logics/inboxUsageLogic.ts b/frontend/src/scenes/inbox/logics/inboxUsageLogic.ts
index f03021f7a421..c6319e3ae24b 100644
--- a/frontend/src/scenes/inbox/logics/inboxUsageLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxUsageLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
@@ -16,8 +17,9 @@ import { BillingProductV2Type } from '~/types'
import { signalsReportsRefundSummaryRetrieve } from 'products/signals/frontend/generated/api'
import type { SignalReportRefundSummaryResponseApi } from 'products/signals/frontend/generated/api.schemas'
+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
+import type { BillingType } from '../../../types'
import { inboxBulkActionsLogic } from './inboxBulkActionsLogic'
-import type { inboxUsageLogicType } from './inboxUsageLogicType'
// The inbox/signals billing product type (a flat per-PR credit charge). This is the identifier
// billing uses everywhere — it's also the key into `custom_limits_usd` — so we match on it rather
@@ -39,6 +41,186 @@ function perCreditUsd(product: BillingProductV2Type): number | null {
return product.unit_amount_usd ? parseFloat(product.unit_amount_usd) : null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxUsageLogicValues {
+ billing: BillingType | null // billingLogic
+ billingLoading: boolean // billingLogic
+ canAccessBilling: boolean // billingLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ currentTeamId: number | null // teamLogic
+ creditsPerPr: number | null
+ customLimitUsd: number | null
+ estimatedBudgetUsd: number | null
+ freePrs: number
+ isLimitFormSubmitting: boolean
+ isLimitFormValid: boolean
+ isLoading: boolean
+ isModalOpen: boolean
+ isSubscribed: boolean
+ limitForm: {
+ prs: number | null
+ }
+ limitFormAllErrors: Record<string, any>
+ limitFormChanged: boolean
+ limitFormErrors: DeepPartialMap<
+ {
+ prs: number | null
+ },
+ ValidationErrorType
+ >
+ limitFormHasErrors: boolean
+ limitFormManualErrors: Record<string, any>
+ limitFormTouched: boolean
+ limitFormTouches: Record<string, boolean>
+ limitFormValidationErrors: DeepPartialMap<
+ {
+ prs: number | null
+ },
+ ValidationErrorType
+ >
+ limitPrs: number | null
+ percentage: number
+ pricePerPrUsd: number | null
+ product: BillingProductV2Type | null
+ refundSummary: SignalReportRefundSummaryResponseApi | null
+ refundSummaryLoading: boolean
+ refundsFlagEnabled: boolean
+ resetDate: Dayjs | null
+ showLimitFormErrors: boolean
+ spentUsd: number | null
+ status: InboxUsageStatus
+ usedPrs: number
+ usedPrsDisplay: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxUsageLogicActions {
+ loadBilling: () => any // billingLogic
+ updateBillingLimits: (limits: { [key: string]: number | null }) => {
+ [key: string]: number | null
+ } // billingLogic
+ closeModal: () => {
+ value: true
+ }
+ loadRefundSummary: () => any
+ loadRefundSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRefundSummarySuccess: (
+ refundSummary: SignalReportRefundSummaryResponseApi | null,
+ payload?: any
+ ) => {
+ refundSummary: SignalReportRefundSummaryResponseApi | null
+ payload?: any
+ }
+ openModal: () => {
+ value: true
+ }
+ resetLimitForm: (values?: { prs: number | null }) => {
+ values?: {
+ prs: number | null
+ }
+ }
+ setLimitFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setLimitFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setLimitFormValues: (
+ values: DeepPartial<{
+ prs: number | null
+ }>
+ ) => {
+ values: DeepPartial<{
+ prs: number | null
+ }>
+ }
+ submitLimitForm: () => {
+ value: boolean
+ }
+ submitLimitFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitLimitFormRequest: (limitForm: { prs: number | null }) => {
+ limitForm: {
+ prs: number | null
+ }
+ }
+ submitLimitFormSuccess: (limitForm: { prs: number | null }) => {
+ limitForm: {
+ prs: number | null
+ }
+ }
+ touchLimitFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface inboxUsageLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ refundsFlagEnabled: (featureFlags: FeatureFlagsSet) => boolean
+ product: (billing: BillingType | null) => BillingProductV2Type | null
+ isLoading: (
+ billing: BillingType | null,
+ billingLoading: boolean,
+ product: BillingProductV2Type | null,
+ refundSummary: SignalReportRefundSummaryResponseApi | null,
+ refundSummaryLoading: boolean,
+ refundsFlagEnabled: boolean
+ ) => boolean
+ isSubscribed: (product: BillingProductV2Type | null) => boolean
+ creditsPerPr: (product: BillingProductV2Type | null) => number | null
+ pricePerPrUsd: (product: BillingProductV2Type | null, creditsPerPr: number | null) => number | null
+ freePrs: (product: BillingProductV2Type | null, creditsPerPr: number | null) => number
+ usedPrs: (
+ product: BillingProductV2Type | null,
+ creditsPerPr: number | null,
+ refundSummary: SignalReportRefundSummaryResponseApi | null
+ ) => number
+ customLimitUsd: (billing: BillingType | null, product: BillingProductV2Type | null) => number | null
+ limitPrs: (
+ product: BillingProductV2Type | null,
+ creditsPerPr: number | null,
+ customLimitUsd: number | null,
+ pricePerPrUsd: number | null,
+ freePrs: number
+ ) => number | null
+ status: (usedPrs: number, limitPrs: number | null) => InboxUsageStatus
+ usedPrsDisplay: (usedPrs: number, limitPrs: number | null) => number
+ spentUsd: (usedPrs: number, freePrs: number, pricePerPrUsd: number | null) => number | null
+ percentage: (usedPrs: number, limitPrs: number | null, freePrs: number) => number
+ resetDate: (billing: BillingType | null) => Dayjs | null
+ estimatedBudgetUsd: (
+ limitForm: {
+ prs: number | null
+ },
+ pricePerPrUsd: number | null,
+ freePrs: number
+ ) => number | null
+ }
+}
+
+export type inboxUsageLogicType = MakeLogicType<
+ inboxUsageLogicValues,
+ inboxUsageLogicActions,
+ Record<string, any>,
+ inboxUsageLogicMeta
+>
+
/**
* Drives the PR-usage widget in the inbox agents rail. Reads the inbox/signals billing product and
* surfaces usage, limit, and reset date in PRs (the product bills in credits; `display_divisor`
@@ -135,11 +317,12 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
// has mounted. Derived here so a subscription can react to it flipping on.
refundsFlagEnabled: [
(s) => [s.featureFlags],
- (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.SIGNALS_PR_REFUNDS],
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>
+ !!featureFlags[FEATURE_FLAGS.SIGNALS_PR_REFUNDS],
],
product: [
(s) => [s.billing],
- (billing): BillingProductV2Type | null =>
+ (billing: null | import('~/types').BillingType): BillingProductV2Type | null =>
billing?.products?.find((p) => p.type === INBOX_PRODUCT_TYPE) ?? null,
],
isLoading: [
@@ -151,7 +334,14 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
s.refundSummaryLoading,
s.refundsFlagEnabled,
],
- (billing, billingLoading, product, refundSummary, refundSummaryLoading, refundsFlagEnabled): boolean => {
+ (
+ billing: null | import('~/types').BillingType,
+ billingLoading: boolean,
+ product: BillingProductV2Type | null,
+ refundSummary: SignalReportRefundSummaryResponseApi | null,
+ refundSummaryLoading: boolean,
+ refundsFlagEnabled: boolean
+ ): boolean => {
if (billing === null && billingLoading) {
return true
}
@@ -165,16 +355,16 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
],
// Free plan can't raise the limit past the free allocation — the widget points to
// billing to upgrade instead of editing a limit.
- isSubscribed: [(s) => [s.product], (product): boolean => !!product?.subscribed],
+ isSubscribed: [(s) => [s.product], (product: BillingProductV2Type | null): boolean => !!product?.subscribed],
// Credits per PR — the API's credits → PR divisor. Null means we can't safely show PRs.
creditsPerPr: [
(s) => [s.product],
- (product): number | null =>
+ (product: BillingProductV2Type | null): number | null =>
product?.display_divisor && product.display_divisor > 0 ? product.display_divisor : null,
],
pricePerPrUsd: [
(s) => [s.product, s.creditsPerPr],
- (product, creditsPerPr): number | null => {
+ (product: BillingProductV2Type | null, creditsPerPr: number | null): number | null => {
if (!product || !creditsPerPr) {
return null
}
@@ -184,12 +374,16 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
],
freePrs: [
(s) => [s.product, s.creditsPerPr],
- (product, creditsPerPr): number =>
+ (product: BillingProductV2Type | null, creditsPerPr: number | null): number =>
product && creditsPerPr ? Math.round(calculateFreeTier(product) / creditsPerPr) : 0,
],
usedPrs: [
(s) => [s.product, s.creditsPerPr, s.refundSummary],
- (product, creditsPerPr, refundSummary): number => {
+ (
+ product: BillingProductV2Type | null,
+ creditsPerPr: number | null,
+ refundSummary: SignalReportRefundSummaryResponseApi | null
+ ): number => {
if (!product || !creditsPerPr) {
return 0
}
@@ -206,7 +400,7 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
],
customLimitUsd: [
(s) => [s.billing, s.product],
- (billing, product): number | null => {
+ (billing: null | import('~/types').BillingType, product: BillingProductV2Type | null): number | null => {
if (!product) {
return null
}
@@ -218,7 +412,13 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
// product's own usage_limit (credits). Null means uncapped.
limitPrs: [
(s) => [s.product, s.creditsPerPr, s.customLimitUsd, s.pricePerPrUsd, s.freePrs],
- (product, creditsPerPr, customLimitUsd, pricePerPrUsd, freePrs): number | null => {
+ (
+ product: BillingProductV2Type | null,
+ creditsPerPr: number | null,
+ customLimitUsd: number | null,
+ pricePerPrUsd: number | null,
+ freePrs: number
+ ): number | null => {
if (!product || !creditsPerPr) {
return null
}
@@ -233,7 +433,7 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
],
status: [
(s) => [s.usedPrs, s.limitPrs],
- (usedPrs, limitPrs): InboxUsageStatus => {
+ (usedPrs: number, limitPrs: number | null): InboxUsageStatus => {
if (limitPrs == null) {
return 'normal'
}
@@ -249,19 +449,20 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
// Displayed usage caps at the limit — we never show "53 / 50" when usage runs over.
usedPrsDisplay: [
(s) => [s.usedPrs, s.limitPrs],
- (usedPrs, limitPrs): number => (limitPrs != null ? Math.min(usedPrs, limitPrs) : usedPrs),
+ (usedPrs: number, limitPrs: number | null): number =>
+ limitPrs != null ? Math.min(usedPrs, limitPrs) : usedPrs,
],
// USD spent so far this period: PRs beyond the free allowance, at the per-PR price.
// Null when we can't price a PR (so the widget hides the figure rather than show "$0").
spentUsd: [
(s) => [s.usedPrs, s.freePrs, s.pricePerPrUsd],
- (usedPrs, freePrs, pricePerPrUsd): number | null =>
+ (usedPrs: number, freePrs: number, pricePerPrUsd: number | null): number | null =>
pricePerPrUsd == null ? null : Math.max(0, usedPrs - freePrs) * pricePerPrUsd,
],
// Bar fill as a % of the denominator (the limit, or the free allowance when uncapped).
percentage: [
(s) => [s.usedPrs, s.limitPrs, s.freePrs],
- (usedPrs, limitPrs, freePrs): number => {
+ (usedPrs: number, limitPrs: number | null, freePrs: number): number => {
const denominator = limitPrs ?? (freePrs || null)
if (!denominator) {
return 0
@@ -269,11 +470,21 @@ export const inboxUsageLogic = kea<inboxUsageLogicType>([
return Math.min(100, Math.round((usedPrs / denominator) * 100))
},
],
- resetDate: [(s) => [s.billing], (billing): Dayjs | null => billing?.billing_period?.current_period_end ?? null],
+ resetDate: [
+ (s) => [s.billing],
+ (billing: null | import('~/types').BillingType): Dayjs | null =>
+ billing?.billing_period?.current_period_end ?? null,
+ ],
// USD spend cap implied by the limit currently typed into the modal. Drives the live budget.
estimatedBudgetUsd: [
(s) => [s.limitForm, s.pricePerPrUsd, s.freePrs],
- (limitForm, pricePerPrUsd, freePrs): number | null => {
+ (
+ limitForm: {
+ prs: number | null
+ },
+ pricePerPrUsd: number | null,
+ freePrs: number
+ ): number | null => {
const prs = limitForm?.prs
if (pricePerPrUsd == null || prs == null || Number.isNaN(prs)) {
return null
diff --git a/frontend/src/scenes/inbox/logics/reportListLogic.ts b/frontend/src/scenes/inbox/logics/reportListLogic.ts
index 7ffcc7dd8f88..20fe33040aab 100644
--- a/frontend/src/scenes/inbox/logics/reportListLogic.ts
+++ b/frontend/src/scenes/inbox/logics/reportListLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -6,6 +6,7 @@ import { lemonToast } from '@posthog/lemon-ui'
import api, { CountedPaginatedResponse } from 'lib/api'
import { userLogic } from 'scenes/userLogic'
+import type { UserType } from '../../../types'
import { captureInboxReportAction } from '../inboxAnalytics'
import {
ACTIONABLE_ACTIONABILITY_VALUES,
@@ -15,10 +16,11 @@ import {
InboxScope,
SignalReport,
} from '../types'
+import type { SignalReportPriority } from '../types'
import { DismissalReasonValue } from '../utils/dismissalReasons'
import { inboxBulkActionsLogic } from './inboxBulkActionsLogic'
import { buildSignalReportListOrdering, inboxFiltersLogic } from './inboxFiltersLogic'
-import type { reportListLogicType } from './reportListLogicType'
+import type { InboxFilterState, InboxSortDirection, InboxSortField } from './inboxFiltersLogic'
const PAGE_SIZE = 50
@@ -75,6 +77,186 @@ export function shouldDefaultToEntireProject(input: {
)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reportListLogicValues {
+ hasUserChosenScope: boolean // inboxFiltersLogic
+ priorityFilter: SignalReportPriority[] // inboxFiltersLogic
+ scope: InboxScope // inboxFiltersLogic
+ searchQuery: string // inboxFiltersLogic
+ sortDirection: InboxSortDirection // inboxFiltersLogic
+ sortField: InboxSortField // inboxFiltersLogic
+ sourceProductFilter: string[] // inboxFiltersLogic
+ user: UserType | null // userLogic
+ count: number | null
+ countLoading: boolean
+ hasMore: boolean
+ isLoaded: boolean
+ listApiParams: any
+ reports: SignalReport[]
+ reportsResponse: CountedPaginatedResponse<SignalReport> | null
+ reportsResponseLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reportListLogicActions {
+ applyDefaultScope: (scope: InboxScope) => {
+ scope: InboxScope
+ } // inboxFiltersLogic
+ clearFilters: () => {
+ value: true
+ } // inboxFiltersLogic
+ setFilters: (filters: InboxFilterState) => {
+ filters: InboxFilterState
+ } // inboxFiltersLogic
+ setScope: (scope: InboxScope) => {
+ scope: InboxScope
+ } // inboxFiltersLogic
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ } // inboxFiltersLogic
+ setSort: (
+ field: InboxSortField,
+ direction: InboxSortDirection
+ ) => {
+ direction: InboxSortDirection
+ field: InboxSortField
+ } // inboxFiltersLogic
+ togglePriority: (priority: SignalReportPriority) => {
+ priority: SignalReportPriority
+ } // inboxFiltersLogic
+ toggleSourceProduct: (source: string) => {
+ source: string
+ } // inboxFiltersLogic
+ archiveReport: (
+ reportId: string,
+ reason: DismissalReasonValue,
+ note: string
+ ) => {
+ note: string
+ reason:
+ | 'already_fixed'
+ | 'analysis_wrong'
+ | 'other'
+ | 'report_unclear'
+ | 'wontfix_intentional'
+ | 'wontfix_irrelevant'
+ reportId: string
+ }
+ ensureLoaded: () => {
+ value: true
+ }
+ loadCount: () => any
+ loadCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadCountSuccess: (
+ count: number,
+ payload?: any
+ ) => {
+ count: number
+ payload?: any
+ }
+ loadMore: () => {
+ value: true
+ }
+ loadMoreReports: () => any
+ loadMoreReportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMoreReportsSuccess: (
+ reportsResponse: {
+ count: number
+ next?: string | null | undefined
+ previous?: string | null | undefined
+ results: SignalReport[]
+ },
+ payload?: any
+ ) => {
+ reportsResponse: {
+ count: number
+ next?: string | null | undefined
+ previous?: string | null | undefined
+ results: SignalReport[]
+ }
+ payload?: any
+ }
+ loadReports: () => any
+ loadReportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReportsSuccess: (
+ reportsResponse: CountedPaginatedResponse<SignalReport>,
+ payload?: any
+ ) => {
+ reportsResponse: CountedPaginatedResponse<SignalReport>
+ payload?: any
+ }
+ refresh: () => {
+ value: true
+ }
+ removeReport: (reportId: string) => {
+ reportId: string
+ }
+ restoreReport: (reportId: string) => {
+ reportId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface reportListLogicMeta {
+ key: 'archived' | 'not-actionable' | 'pulls' | 'reports'
+ __keaTypeGenInternalSelectorTypes: {
+ listApiParams: (
+ searchQuery: string,
+ sortField: InboxSortField,
+ sortDirection: InboxSortDirection,
+ sourceProductFilter: string[],
+ priorityFilter: SignalReportPriority[],
+ scope: InboxScope,
+ user: UserType | null,
+ arg: any
+ ) => any
+ reports: (reportsResponse: CountedPaginatedResponse<SignalReport> | null) => SignalReport[]
+ hasMore: (reportsResponse: CountedPaginatedResponse<SignalReport> | null) => boolean
+ isLoaded: (reportsResponse: CountedPaginatedResponse<SignalReport> | null) => boolean
+ }
+ __keaTypeGenInternalReducerActions: {
+ 'load user success (scenes.userLogic)': (
+ user: UserType | null,
+ payload?: {
+ resetOnFailure: boolean | undefined
+ }
+ ) => {
+ payload: {
+ payload?: {
+ resetOnFailure: boolean | undefined
+ }
+ user: UserType | null
+ }
+ type: 'load user success (scenes.userLogic)'
+ }
+ }
+}
+
+export type reportListLogicType = MakeLogicType<
+ reportListLogicValues,
+ reportListLogicActions,
+ ReportListLogicProps,
+ reportListLogicMeta
+>
+
/**
* Keyed per-tab report list. Mounted once per flat tab (pulls / reports / not-actionable),
* each with its own fixed `listParams`, so every tab is its own filtered request with its
@@ -188,7 +370,16 @@ export const reportListLogic = kea<reportListLogicType>([
s.user,
(_, p) => p.listParams,
],
- (searchQuery, sortField, sortDirection, sourceProductFilter, priorityFilter, scope, user, listParams) => {
+ (
+ searchQuery: string,
+ sortField: import('./inboxFiltersLogic').InboxSortField,
+ sortDirection: import('./inboxFiltersLogic').InboxSortDirection,
+ sourceProductFilter: string[],
+ priorityFilter: import('../types').SignalReportPriority[],
+ scope: InboxScope,
+ user: null | import('../../../types').UserType,
+ listParams
+ ) => {
const suggestedReviewer =
scope === INBOX_SCOPE_FOR_YOU ? (user?.uuid ?? undefined) : teammateUuidFromScope(scope)
return {
@@ -211,7 +402,10 @@ export const reportListLogic = kea<reportListLogicType>([
(reportsResponse: CountedPaginatedResponse<SignalReport> | null): boolean =>
reportsResponse?.next !== null && reportsResponse?.next !== undefined,
],
- isLoaded: [(s) => [s.reportsResponse], (reportsResponse): boolean => reportsResponse !== null],
+ isLoaded: [
+ (s) => [s.reportsResponse],
+ (reportsResponse: CountedPaginatedResponse<SignalReport> | null): boolean => reportsResponse !== null,
+ ],
}),
listeners(({ actions, values, props }) => ({
diff --git a/frontend/src/scenes/inbox/logics/scoutDetailLogic.ts b/frontend/src/scenes/inbox/logics/scoutDetailLogic.ts
index d6c664bc6ce0..c5dfcd0c3313 100644
--- a/frontend/src/scenes/inbox/logics/scoutDetailLogic.ts
+++ b/frontend/src/scenes/inbox/logics/scoutDetailLogic.ts
@@ -1,4 +1,4 @@
-import { connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
@@ -12,7 +12,7 @@ import {
SignalScoutEmissionReportLink,
SignalScoutRunSummary,
} from '../types'
-import type { scoutDetailLogicType } from './scoutDetailLogicType'
+import type { ScoutRollup } from '../utils/scoutRunsWindow'
import { scoutFleetLogic } from './scoutFleetLogic'
export interface ScoutDetailLogicProps {
@@ -56,6 +56,121 @@ export interface ScoutEmissionRow {
report: LinkedSignalReport | null
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoutDetailLogicValues {
+ rollups: Map<string, ScoutRollup> // scoutFleetLogic
+ runsWindowComplete: boolean // scoutFleetLogic
+ runsWindowLoadedOnce: boolean // scoutFleetLogic
+ emissionReports: SignalScoutEmissionReportLink[]
+ emissionReportsLoading: boolean
+ emissionRows: ScoutEmissionRow[]
+ emissions: SignalScoutEmission[]
+ emissionsLoadFailed: boolean
+ emissionsLoading: boolean
+ emittedRuns: SignalScoutRunSummary[]
+ emittedRunsKey: string
+ reportBySourceId: Map<string, LinkedSignalReport>
+ reportRows: ScoutReportRow[]
+ scoutReports: SignalReport[]
+ scoutReportsLoading: boolean
+ touchedReports: {
+ action: ScoutReportAction
+ id: string
+ }[]
+ touchedReportsKey: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoutDetailLogicActions {
+ loadEmissionReports: () => any
+ loadEmissionReportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEmissionReportsSuccess: (
+ emissionReports: SignalScoutEmissionReportLink[],
+ payload?: any
+ ) => {
+ emissionReports: SignalScoutEmissionReportLink[]
+ payload?: any
+ }
+ loadEmissions: () => any
+ loadEmissionsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEmissionsSuccess: (
+ emissions: SignalScoutEmission[],
+ payload?: any
+ ) => {
+ emissions: SignalScoutEmission[]
+ payload?: any
+ }
+ loadScoutReports: () => any
+ loadScoutReportsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadScoutReportsSuccess: (
+ scoutReports: SignalReport[],
+ payload?: any
+ ) => {
+ scoutReports: SignalReport[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoutDetailLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ emittedRuns: (rollups: Map<string, ScoutRollup>, arg: any) => SignalScoutRunSummary[]
+ emittedRunsKey: (emittedRuns: SignalScoutRunSummary[]) => string
+ reportBySourceId: (emissionReports: SignalScoutEmissionReportLink[]) => Map<string, LinkedSignalReport>
+ touchedReports: (
+ rollups: Map<string, ScoutRollup>,
+ arg: any
+ ) => {
+ action: ScoutReportAction
+ id: string
+ }[]
+ touchedReportsKey: (
+ touchedReports: {
+ action: ScoutReportAction
+ id: string
+ }[]
+ ) => string
+ reportRows: (
+ scoutReports: SignalReport[],
+ touchedReports: {
+ action: ScoutReportAction
+ id: string
+ }[]
+ ) => ScoutReportRow[]
+ emissionRows: (
+ emissions: SignalScoutEmission[],
+ emittedRuns: SignalScoutRunSummary[],
+ reportBySourceId: Map<string, LinkedSignalReport>
+ ) => ScoutEmissionRow[]
+ }
+}
+
+export type scoutDetailLogicType = MakeLogicType<
+ scoutDetailLogicValues,
+ scoutDetailLogicActions,
+ ScoutDetailLogicProps,
+ scoutDetailLogicMeta
+>
+
/**
* Per-scout detail logic, keyed by skill_name. Reuses the singleton `scoutFleetLogic`'s
* runs window (already polled while the detail page is open) to find this scout's emitted
@@ -175,7 +290,10 @@ export const scoutDetailLogic = kea<scoutDetailLogicType>([
// never touches the shared rollup `runs` the header timeline reads (oldest-first).
emittedRuns: [
(s) => [s.rollups, (_, props) => props.skillName],
- (rollups, skillName): SignalScoutRunSummary[] =>
+ (
+ rollups: Map<string, import('../utils/scoutRunsWindow').ScoutRollup>,
+ skillName
+ ): SignalScoutRunSummary[] =>
(rollups.get(skillName)?.runs ?? [])
.filter((run) => (run.emitted_count ?? 0) > 0)
.sort((a, b) => (b.created_at ?? '').localeCompare(a.created_at ?? ''))
@@ -186,7 +304,7 @@ export const scoutDetailLogic = kea<scoutDetailLogicType>([
// `emitted_count` so a run that emits more findings while still in progress retriggers.
emittedRunsKey: [
(s) => [s.emittedRuns],
- (emittedRuns): string =>
+ (emittedRuns: SignalScoutRunSummary[]): string =>
emittedRuns
.map((run) => `${run.run_id}:${run.emitted_count ?? 0}`)
.sort()
@@ -197,7 +315,7 @@ export const scoutDetailLogic = kea<scoutDetailLogicType>([
// exact field the backend reverse-lookup keys on. Findings with a null report are skipped.
reportBySourceId: [
(s) => [s.emissionReports],
- (emissionReports): Map<string, LinkedSignalReport> =>
+ (emissionReports: SignalScoutEmissionReportLink[]): Map<string, LinkedSignalReport> =>
new Map(
emissionReports
.filter((link) => link.report !== null)
@@ -209,7 +327,10 @@ export const scoutDetailLogic = kea<scoutDetailLogicType>([
// the same report, so a report in both sets reads as "authored".
touchedReports: [
(s) => [s.rollups, (_, props) => props.skillName],
- (rollups, skillName): { id: string; action: ScoutReportAction }[] => {
+ (
+ rollups: Map<string, import('../utils/scoutRunsWindow').ScoutRollup>,
+ skillName
+ ): { id: string; action: ScoutReportAction }[] => {
const rollup = rollups.get(skillName)
if (!rollup) {
return []
@@ -228,7 +349,12 @@ export const scoutDetailLogic = kea<scoutDetailLogicType>([
// not on every runs-window poll that returns the same runs.
touchedReportsKey: [
(s) => [s.touchedReports],
- (touchedReports): string =>
+ (
+ touchedReports: {
+ action: ScoutReportAction
+ id: string
+ }[]
+ ): string =>
touchedReports
.map(({ id, action }) => `${id}:${action}`)
.sort()
@@ -238,7 +364,13 @@ export const scoutDetailLogic = kea<scoutDetailLogicType>([
// whose report fetch failed (deleted/inaccessible) is skipped.
reportRows: [
(s) => [s.scoutReports, s.touchedReports],
- (scoutReports, touchedReports): ScoutReportRow[] => {
+ (
+ scoutReports: SignalReport[],
+ touchedReports: {
+ action: ScoutReportAction
+ id: string
+ }[]
+ ): ScoutReportRow[] => {
const actionById = new Map(touchedReports.map(({ id, action }) => [id, action]))
return scoutReports
.map((report) => {
@@ -253,7 +385,11 @@ export const scoutDetailLogic = kea<scoutDetailLogicType>([
// report they grouped into (for the "In report" chip), newest first.
emissionRows: [
(s) => [s.emissions, s.emittedRuns, s.reportBySourceId],
- (emissions, emittedRuns, reportBySourceId): ScoutEmissionRow[] => {
+ (
+ emissions: SignalScoutEmission[],
+ emittedRuns: SignalScoutRunSummary[],
+ reportBySourceId: Map<string, LinkedSignalReport>
+ ): ScoutEmissionRow[] => {
const runsById = new Map(emittedRuns.map((run) => [run.run_id, run]))
return emissions
.map((emission) => {
diff --git a/frontend/src/scenes/inbox/logics/scoutFleetLogic.ts b/frontend/src/scenes/inbox/logics/scoutFleetLogic.ts
index be8bb990d9b2..ca210d1924d9 100644
--- a/frontend/src/scenes/inbox/logics/scoutFleetLogic.ts
+++ b/frontend/src/scenes/inbox/logics/scoutFleetLogic.ts
@@ -1,4 +1,4 @@
-import { actions, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -26,7 +26,6 @@ import {
ScoutRollup,
sortConfigsForDisplay,
} from '../utils/scoutRunsWindow'
-import type { scoutFleetLogicType } from './scoutFleetLogicType'
// Fleet runs are refetched on a slow cadence so "running now" / recent emissions
// stay live without hammering the capped runs endpoint (desktop: 60s).
@@ -38,6 +37,189 @@ const RUNS_REFETCH_INTERVAL_MS = 60_000
const RUNS_PAGE_LIMIT = 100
const MAX_RUNS_PAGES = 15
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoutFleetLogicValues {
+ customScoutCount: number
+ deletingScoutIds: string[]
+ emittedFindingsSummary: {
+ count: number
+ latestAt: string | null
+ scoutCount: number
+ }
+ enabledCount: number
+ expanded: boolean
+ fleetFindingsSummary: FleetFindingsSummaryApi | null
+ fleetFindingsSummaryLoadedOnce: boolean
+ fleetFindingsSummaryLoading: boolean
+ fleetSummary: FleetSummary | null
+ hideDisabled: boolean
+ lastRunAt: string | null
+ rollups: Map<string, ScoutRollup>
+ runningChatPrompt: string | null
+ runsWindow: {
+ complete: boolean
+ runs: SignalScoutRunSummary[]
+ }
+ runsWindowComplete: boolean
+ runsWindowLoadedOnce: boolean
+ runsWindowLoading: boolean
+ scoutBannerMessage: string | null
+ scoutConfigs: SignalScoutConfig[] | null
+ scoutConfigsLoading: boolean
+ scoutMetadata: ScoutMetadataApi | null
+ scoutMetadataLoading: boolean
+ visibleConfigs: SignalScoutConfig[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoutFleetLogicActions {
+ deleteScout: (configId: string) => {
+ configId: string
+ }
+ deleteScoutFinished: (configId: string) => {
+ configId: string
+ }
+ loadFleetFindingsSummary: () => any
+ loadFleetFindingsSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadFleetFindingsSummarySuccess: (
+ fleetFindingsSummary: FleetFindingsSummaryApi | null,
+ payload?: any
+ ) => {
+ fleetFindingsSummary: FleetFindingsSummaryApi | null
+ payload?: any
+ }
+ loadRunsWindow: () => any
+ loadRunsWindowFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRunsWindowSuccess: (
+ runsWindow: {
+ complete: boolean
+ runs: SignalScoutRunSummary[]
+ },
+ payload?: any
+ ) => {
+ runsWindow: {
+ complete: boolean
+ runs: SignalScoutRunSummary[]
+ }
+ payload?: any
+ }
+ loadScoutConfigs: () => any
+ loadScoutConfigsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadScoutConfigsSuccess: (
+ scoutConfigs: SignalScoutConfig[],
+ payload?: any
+ ) => {
+ scoutConfigs: SignalScoutConfig[]
+ payload?: any
+ }
+ loadScoutMetadata: () => any
+ loadScoutMetadataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadScoutMetadataSuccess: (
+ scoutMetadata: ScoutMetadataApi | null,
+ payload?: any
+ ) => {
+ scoutMetadata: ScoutMetadataApi | null
+ payload?: any
+ }
+ patchScoutConfigLocally: (
+ configId: string,
+ updates: SignalScoutConfigUpdate
+ ) => {
+ configId: string
+ updates: SignalScoutConfigUpdate
+ }
+ removeScoutConfigLocally: (configId: string) => {
+ configId: string
+ }
+ setExpanded: (expanded: boolean) => {
+ expanded: boolean
+ }
+ setHideDisabled: (hideDisabled: boolean) => {
+ hideDisabled: boolean
+ }
+ startRunsPolling: () => {
+ value: true
+ }
+ startScoutChatTask: (
+ prompt: string,
+ taskLabel: string,
+ fallbackTitle: string
+ ) => {
+ fallbackTitle: string
+ prompt: string
+ taskLabel: string
+ }
+ startScoutChatTaskFailure: () => {
+ value: true
+ }
+ startScoutChatTaskSuccess: () => {
+ value: true
+ }
+ stopRunsPolling: () => {
+ value: true
+ }
+ updateScoutConfig: (
+ configId: string,
+ updates: SignalScoutConfigUpdate
+ ) => {
+ configId: string
+ updates: SignalScoutConfigUpdate
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scoutFleetLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ scoutBannerMessage: (scoutMetadata: ScoutMetadataApi | null) => string | null
+ rollups: (runsWindow: { complete: boolean; runs: SignalScoutRunSummary[] }) => Map<string, ScoutRollup>
+ fleetSummary: (
+ scoutConfigs: SignalScoutConfig[] | null,
+ rollups: Map<string, ScoutRollup>
+ ) => FleetSummary | null
+ enabledCount: (scoutConfigs: SignalScoutConfig[] | null) => number
+ lastRunAt: (scoutConfigs: SignalScoutConfig[] | null) => string | null
+ visibleConfigs: (scoutConfigs: SignalScoutConfig[] | null, hideDisabled: boolean) => SignalScoutConfig[]
+ runsWindowComplete: (runsWindow: { complete: boolean; runs: SignalScoutRunSummary[] }) => boolean
+ emittedFindingsSummary: (fleetFindingsSummary: FleetFindingsSummaryApi | null) => {
+ count: number
+ latestAt: string | null
+ scoutCount: number
+ }
+ customScoutCount: (scoutConfigs: SignalScoutConfig[] | null) => number
+ }
+}
+
+export type scoutFleetLogicType = MakeLogicType<
+ scoutFleetLogicValues,
+ scoutFleetLogicActions,
+ Record<string, any>,
+ scoutFleetLogicMeta
+>
+
/**
* Cloud port of desktop's scouts fleet hooks (`useScoutConfigs`, `useScoutRuns`,
* `useScoutConfigMutations`, `useScoutChatTask`). Owns:
@@ -241,24 +423,26 @@ export const scoutFleetLogic = kea<scoutFleetLogicType>([
// Editorial alpha/announcement banner from the signals-scout flag, or null when unset.
scoutBannerMessage: [
(s) => [s.scoutMetadata],
- (scoutMetadata): string | null => scoutMetadata?.banner_message ?? null,
+ (scoutMetadata: ScoutMetadataApi | null): string | null => scoutMetadata?.banner_message ?? null,
],
rollups: [
(s) => [s.runsWindow],
- (runsWindow): Map<string, ScoutRollup> => computeScoutRollups(runsWindow.runs),
+ (runsWindow: { complete: boolean; runs: SignalScoutRunSummary[] }): Map<string, ScoutRollup> =>
+ computeScoutRollups(runsWindow.runs),
],
fleetSummary: [
(s) => [s.scoutConfigs, s.rollups],
- (scoutConfigs, rollups): FleetSummary | null =>
+ (scoutConfigs: SignalScoutConfig[] | null, rollups: Map<string, ScoutRollup>): FleetSummary | null =>
scoutConfigs ? computeFleetSummary(scoutConfigs, rollups) : null,
],
enabledCount: [
(s) => [s.scoutConfigs],
- (scoutConfigs): number => scoutConfigs?.filter((config) => config.enabled).length ?? 0,
+ (scoutConfigs: SignalScoutConfig[] | null): number =>
+ scoutConfigs?.filter((config) => config.enabled).length ?? 0,
],
lastRunAt: [
(s) => [s.scoutConfigs],
- (scoutConfigs): string | null => {
+ (scoutConfigs: SignalScoutConfig[] | null): string | null => {
let latest: string | null = null
for (const config of scoutConfigs ?? []) {
if (config.last_run_at && (!latest || config.last_run_at > latest)) {
@@ -270,12 +454,15 @@ export const scoutFleetLogic = kea<scoutFleetLogicType>([
],
visibleConfigs: [
(s) => [s.scoutConfigs, s.hideDisabled],
- (scoutConfigs, hideDisabled): SignalScoutConfig[] => {
+ (scoutConfigs: SignalScoutConfig[] | null, hideDisabled: boolean): SignalScoutConfig[] => {
const sorted = sortConfigsForDisplay(scoutConfigs ?? [])
return hideDisabled ? sorted.filter((config) => config.enabled) : sorted
},
],
- runsWindowComplete: [(s) => [s.runsWindow], (runsWindow): boolean => runsWindow.complete],
+ runsWindowComplete: [
+ (s) => [s.runsWindow],
+ (runsWindow: { complete: boolean; runs: SignalScoutRunSummary[] }): boolean => runsWindow.complete,
+ ],
// Fleet-wide findings tally for the "Scout findings" callout, read from the cheap backend
// summary rather than the paginated runs window. The backend counts the same capped set the
// findings page renders (most recent 120 emitted runs in the window), so the callout can't
@@ -292,7 +479,8 @@ export const scoutFleetLogic = kea<scoutFleetLogicType>([
],
customScoutCount: [
(s) => [s.scoutConfigs],
- (scoutConfigs): number => scoutConfigs?.filter((config) => config.scout_origin === 'custom').length ?? 0,
+ (scoutConfigs: SignalScoutConfig[] | null): number =>
+ scoutConfigs?.filter((config) => config.scout_origin === 'custom').length ?? 0,
],
}),
diff --git a/frontend/src/scenes/inbox/logics/scratchpadLogic.ts b/frontend/src/scenes/inbox/logics/scratchpadLogic.ts
index 7b180a7a3bad..f64ba5d33298 100644
--- a/frontend/src/scenes/inbox/logics/scratchpadLogic.ts
+++ b/frontend/src/scenes/inbox/logics/scratchpadLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { teamLogic } from 'scenes/teamLogic'
@@ -6,8 +6,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { signalsScoutScratchpadSearch } from 'products/signals/frontend/generated/api'
import type { ScratchpadEntryApi } from 'products/signals/frontend/generated/api.schemas'
-import type { scratchpadLogicType } from './scratchpadLogicType'
-
// The list view shows two ways to read the fleet's memory: newest-first (the API's
// native order) or clustered by the key namespace scouts choose (`tags:*`, `dedupe:*`).
export type ScratchpadGrouping = 'recent' | 'topic'
@@ -42,6 +40,63 @@ export function humanizeNamespace(namespace: string): string {
return namespace.replace(/[-_]/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scratchpadLogicValues {
+ entries: ScratchpadEntryApi[] | null
+ entriesLoading: boolean
+ expandedNamespaces: string[]
+ grouping: ScratchpadGrouping
+ groups: ScratchpadNamespaceGroup[]
+ lastUpdatedAt: string | null
+ loadFailed: boolean
+ searchText: string
+ totalCount: number | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scratchpadLogicActions {
+ loadEntries: (_payload: void) => void
+ loadEntriesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEntriesSuccess: (
+ entries: ScratchpadEntryApi[],
+ payload?: void
+ ) => {
+ entries: ScratchpadEntryApi[]
+ payload?: void
+ }
+ setGrouping: (grouping: ScratchpadGrouping) => {
+ grouping: ScratchpadGrouping
+ }
+ setSearchText: (searchText: string) => {
+ searchText: string
+ }
+ toggleNamespace: (namespace: string) => {
+ namespace: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface scratchpadLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ totalCount: (entries: ScratchpadEntryApi[] | null) => number | null
+ lastUpdatedAt: (entries: ScratchpadEntryApi[] | null) => string | null
+ groups: (entries: ScratchpadEntryApi[] | null) => ScratchpadNamespaceGroup[]
+ }
+}
+
+export type scratchpadLogicType = MakeLogicType<
+ scratchpadLogicValues,
+ scratchpadLogicActions,
+ Record<string, any>,
+ scratchpadLogicMeta
+>
+
/**
* Read-only view over the scout fleet's durable memory (`SignalScratchpad`). Owns the entry list,
* the debounced search text (wired straight to the endpoint's `?text=` ILIKE), and the recent /
@@ -105,14 +160,20 @@ export const scratchpadLogic = kea<scratchpadLogicType>([
}),
selectors({
- totalCount: [(s) => [s.entries], (entries): number | null => (entries ? entries.length : null)],
+ totalCount: [
+ (s) => [s.entries],
+ (entries: ScratchpadEntryApi[] | null): number | null => (entries ? entries.length : null),
+ ],
// Entries are newest-first, so the head's timestamp drives the callout's "updated when" hint.
- lastUpdatedAt: [(s) => [s.entries], (entries): string | null => entries?.[0]?.updated_at ?? null],
+ lastUpdatedAt: [
+ (s) => [s.entries],
+ (entries: ScratchpadEntryApi[] | null): string | null => entries?.[0]?.updated_at ?? null,
+ ],
// Entries arrive newest-first; preserve that order within each namespace cluster, and order
// the clusters by their most recently touched entry so the liveliest topic floats to the top.
groups: [
(s) => [s.entries],
- (entries): ScratchpadNamespaceGroup[] => {
+ (entries: ScratchpadEntryApi[] | null): ScratchpadNamespaceGroup[] => {
const byNamespace = new Map<string, ScratchpadEntryApi[]>()
for (const entry of entries ?? []) {
const namespace = scratchpadNamespaceOf(entry.key)
diff --git a/frontend/src/scenes/inbox/logics/signalTeamConfigLogic.ts b/frontend/src/scenes/inbox/logics/signalTeamConfigLogic.ts
index 02a5e1fbb06a..8cdd4362d61a 100644
--- a/frontend/src/scenes/inbox/logics/signalTeamConfigLogic.ts
+++ b/frontend/src/scenes/inbox/logics/signalTeamConfigLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -6,7 +6,36 @@ import { lemonToast } from '@posthog/lemon-ui'
import api from 'lib/api'
import type { SignalTeamConfig } from '../types'
-import type { signalTeamConfigLogicType } from './signalTeamConfigLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface signalTeamConfigLogicValues {
+ teamConfig: SignalTeamConfig | null
+ teamConfigLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface signalTeamConfigLogicActions {
+ loadTeamConfig: () => any
+ loadTeamConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTeamConfigSuccess: (
+ teamConfig: SignalTeamConfig,
+ payload?: any
+ ) => {
+ teamConfig: SignalTeamConfig
+ payload?: any
+ }
+ patchTeamConfig: (patch: Partial<SignalTeamConfig>) => {
+ patch: Partial<SignalTeamConfig>
+ }
+}
+
+export type signalTeamConfigLogicType = MakeLogicType<signalTeamConfigLogicValues, signalTeamConfigLogicActions>
/**
* Team-level Self-driving config (singleton per team). Wraps the
diff --git a/frontend/src/scenes/inbox/logics/userAutonomyLogic.ts b/frontend/src/scenes/inbox/logics/userAutonomyLogic.ts
index 508aa4733149..8e8be375dd43 100644
--- a/frontend/src/scenes/inbox/logics/userAutonomyLogic.ts
+++ b/frontend/src/scenes/inbox/logics/userAutonomyLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -6,7 +6,51 @@ import { lemonToast } from '@posthog/lemon-ui'
import api from 'lib/api'
import type { SignalReportPriority, SignalUserAutonomyConfig } from '../types'
-import type { userAutonomyLogicType } from './userAutonomyLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface userAutonomyLogicValues {
+ autonomyConfig: SignalUserAutonomyConfig | null
+ autonomyConfigLoading: boolean
+ slackPickersExpanded: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface userAutonomyLogicActions {
+ loadAutonomyConfig: () => any
+ loadAutonomyConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadAutonomyConfigSuccess: (
+ autonomyConfig: SignalUserAutonomyConfig | null,
+ payload?: any
+ ) => {
+ autonomyConfig: SignalUserAutonomyConfig | null
+ payload?: any
+ }
+ setAutostartPriority: (priority: SignalReportPriority | null) => {
+ priority: SignalReportPriority | null
+ }
+ setSlackPickersExpanded: (expanded: boolean) => {
+ expanded: boolean
+ }
+ updateSlackNotifications: (updates: {
+ channel?: string | null
+ integrationId?: number | null
+ minPriority?: SignalReportPriority | null
+ }) => {
+ updates: {
+ channel?: string | null | undefined
+ integrationId?: number | null | undefined
+ minPriority?: SignalReportPriority | null | undefined
+ }
+ }
+}
+
+export type userAutonomyLogicType = MakeLogicType<userAutonomyLogicValues, userAutonomyLogicActions>
/**
* Per-user Self-driving autonomy override. Wraps the `users/@me/signal_autonomy`
diff --git a/frontend/src/scenes/inbox/signalSourcesLogic.ts b/frontend/src/scenes/inbox/signalSourcesLogic.ts
index fa983b248efc..9a004d094e37 100644
--- a/frontend/src/scenes/inbox/signalSourcesLogic.ts
+++ b/frontend/src/scenes/inbox/signalSourcesLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -13,8 +13,9 @@ import { ExternalDataSource, ExternalDataSourceSchema, RecordingUniversalFilters
import { sourcesDataLogic } from 'products/data_warehouse/frontend/shared/logics/sourcesDataLogic'
+import type { PaginatedResponse } from '../../lib/api'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
import { captureSignalSourceConnected } from './inboxAnalytics'
-import type { signalSourcesLogicType } from './signalSourcesLogicType'
import { SignalSourceConfig, SignalSourceConfigStatus, ToggleSignalSourceParams } from './types'
export type DataWarehouseSource = 'Linear' | 'Zendesk' | 'Github' | 'PgAnalyze'
@@ -114,6 +115,1881 @@ function toggleSourceConfigState(
]
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface signalSourcesLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null // sourcesDataLogic
+ dataWarehouseSourcesLoading: boolean // sourcesDataLogic
+ anomalyInvestigationConfig: SignalSourceConfig | null
+ conversationsConfig: SignalSourceConfig | null
+ dataSourceSetupProduct: ExternalDataSourceType | null
+ enabledSourcesCount: number
+ errorTrackingIsFullyEnabled: boolean
+ evalReportsConfig: SignalSourceConfig | null
+ githubIssuesConfig: SignalSourceConfig | null
+ hasNoSources: boolean
+ healthChecksConfig: SignalSourceConfig | null
+ isAnomalyInvestigationToggling: boolean
+ isConversationsToggling: boolean
+ isErrorTrackingToggling: boolean
+ isEvalReportsToggling: boolean
+ isGithubIssuesToggling: boolean
+ isHealthChecksToggling: boolean
+ isLinearIssuesToggling: boolean
+ isPgAnalyzeIssuesToggling: boolean
+ isSessionAnalysisRunning: boolean
+ isSessionAnalysisToggling: boolean
+ isZendeskTicketsToggling: boolean
+ linearIssuesConfig: SignalSourceConfig | null
+ pgAnalyzeIssuesConfig: SignalSourceConfig | null
+ sessionAnalysisConfig: SignalSourceConfig | null
+ sessionAnalysisSetupOpen: boolean
+ sourceConfigs: SignalSourceConfig[] | null
+ sourceConfigsLoading: boolean
+ sourcesModalOpen: boolean
+ togglingSourceKeys: Set<string>
+ zendeskTicketsConfig: SignalSourceConfig | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface signalSourcesLogicActions {
+ loadSources: () => {
+ value: true
+ } // sourcesDataLogic
+ clearSessionAnalysisFilters: () => {
+ value: true
+ }
+ closeDataSourceSetup: () => {
+ value: true
+ }
+ closeSessionAnalysisSetup: () => {
+ value: true
+ }
+ closeSourcesModal: () => {
+ value: true
+ }
+ initiateDataWarehouseSourceToggle: (dwSource: DataWarehouseSource) => {
+ dwSource: DataWarehouseSource
+ }
+ loadSourceConfigs: () => any
+ loadSourceConfigsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSourceConfigsSuccess: (
+ sourceConfigs: SignalSourceConfig[],
+ payload?: any
+ ) => {
+ sourceConfigs: SignalSourceConfig[]
+ payload?: any
+ }
+ onDataSourceSetupComplete: (product: ExternalDataSourceType) => {
+ product:
+ | 'ActiveCampaign'
+ | 'AcuityScheduling'
+ | 'Adapty'
+ | 'Adjust'
+ | 'AdobeAnalytics'
+ | 'AdobeCommerce'
+ | 'AdpWorkforceNow'
+ | 'AdRoll'
+ | 'Adyen'
+ | 'AgileCRM'
+ | 'Aha'
+ | 'Ahrefs'
+ | 'AikidoSecurity'
+ | 'Airbrake'
+ | 'Airbyte'
+ | 'Aircall'
+ | 'AirOps'
+ | 'Airtable'
+ | 'Aiven'
+ | 'Akeneo'
+ | 'Algolia'
+ | 'Alguna'
+ | 'AlpacaBrokerAPI'
+ | 'AlphaVantage'
+ | 'AmazonAds'
+ | 'AmazonCloudWatch'
+ | 'AmazonEventBridge'
+ | 'AmazonKinesis'
+ | 'AmazonS3'
+ | 'AmazonSellingPartner'
+ | 'AmazonSNS'
+ | 'AmazonSQS'
+ | 'Amplitude'
+ | 'Anthropic'
+ | 'ApifyDataset'
+ | 'Apollo'
+ | 'Appcues'
+ | 'Appdynamics'
+ | 'Appfigures'
+ | 'Appfollow'
+ | 'AppleSearchAds'
+ | 'AppLovin'
+ | 'AppsFlyer'
+ | 'Appsignal'
+ | 'Appstack'
+ | 'Apptivo'
+ | 'Appwrite'
+ | 'Argocd'
+ | 'Asana'
+ | 'Ashby'
+ | 'Asknicely'
+ | 'AssemblyAI'
+ | 'Attentive'
+ | 'Attio'
+ | 'Auth0'
+ | 'Automox'
+ | 'Autumn'
+ | 'Aviationstack'
+ | 'Aviator'
+ | 'Awin'
+ | 'AwsCloudTrail'
+ | 'AzureBlob'
+ | 'AzureDevOps'
+ | 'AzureTableStorage'
+ | 'Babelforce'
+ | 'Backblaze'
+ | 'BambooHR'
+ | 'Basecamp'
+ | 'Baserow'
+ | 'Baseten'
+ | 'Beamer'
+ | 'Bettermode'
+ | 'BetterStack'
+ | 'BigCommerce'
+ | 'BigMailer'
+ | 'BigQuery'
+ | 'BingAds'
+ | 'Bitbucket'
+ | 'Bitly'
+ | 'Bitrise'
+ | 'BlandAI'
+ | 'Blogger'
+ | 'Bluetally'
+ | 'BoldSign'
+ | 'Box'
+ | 'Braintree'
+ | 'Braintrust'
+ | 'Branch'
+ | 'Braze'
+ | 'Breezometer'
+ | 'BreezyHR'
+ | 'Brevo'
+ | 'Brex'
+ | 'BrowseAI'
+ | 'Browserbase'
+ | 'BrowserUse'
+ | 'Bugsnag'
+ | 'BuildBetter'
+ | 'Buildkite'
+ | 'Bunny'
+ | 'Buzzsprout'
+ | 'CalCom'
+ | 'Calendly'
+ | 'CallRail'
+ | 'CampaignManager360'
+ | 'CampaignMonitor'
+ | 'Campayn'
+ | 'Campfire'
+ | 'Canny'
+ | 'CapsuleCRM'
+ | 'CaptainData'
+ | 'CareQualityCommission'
+ | 'CartCom'
+ | 'CastorEDC'
+ | 'Chameleon'
+ | 'Chargebee'
+ | 'Chargedesk'
+ | 'Chargify'
+ | 'ChartHop'
+ | 'ChartMogul'
+ | 'Chatwoot'
+ | 'Checkmarx'
+ | 'CheckoutCom'
+ | 'Chift'
+ | 'Chorus'
+ | 'Churnkey'
+ | 'Cimis'
+ | 'Cin7'
+ | 'CircleCI'
+ | 'CircleciInsights'
+ | 'CiscoDuo'
+ | 'CiscoMeraki'
+ | 'Clari'
+ | 'Clarifai'
+ | 'Clazar'
+ | 'Clerk'
+ | 'ClickHouse'
+ | 'ClickhouseCloud'
+ | 'ClickUp'
+ | 'Clockify'
+ | 'Clockodo'
+ | 'Close'
+ | 'Cloudbeds'
+ | 'Cloudflare'
+ | 'Coassemble'
+ | 'CockroachDB'
+ | 'Coda'
+ | 'Codacy'
+ | 'Codecov'
+ | 'Codefresh'
+ | 'Cody'
+ | 'Cohere'
+ | 'CoinApi'
+ | 'CoinGecko'
+ | 'CoinMarketCap'
+ | 'Commercetools'
+ | 'Concord'
+ | 'ConfigCat'
+ | 'Confluence'
+ | 'ConfluentCloud'
+ | 'ConstantContact'
+ | 'ConvertKit'
+ | 'Convex'
+ | 'Copper'
+ | 'Coralogix'
+ | 'CosmosDB'
+ | 'Couchbase'
+ | 'Coupa'
+ | 'Coveralls'
+ | 'CratesIO'
+ | 'Criteo'
+ | 'Cronitor'
+ | 'Crunchbase'
+ | 'CultureAmp'
+ | 'Cursor'
+ | 'Curve'
+ | 'Custom'
+ | 'CustomerIO'
+ | 'Customerly'
+ | 'DagsterCloud'
+ | 'Databricks'
+ | 'Datadog'
+ | 'Datahub'
+ | 'Datascope'
+ | 'Datorama'
+ | 'Db2'
+ | 'Dbt'
+ | 'Decagon'
+ | 'Deel'
+ | 'Deepgram'
+ | 'Deepsource'
+ | 'Delighted'
+ | 'DenoDeploy'
+ | 'Deputy'
+ | 'DevinAI'
+ | 'DigitalOcean'
+ | 'DingConnect'
+ | 'DisplayVideo360'
+ | 'Dixa'
+ | 'Dockerhub'
+ | 'Docuseal'
+ | 'Docusign'
+ | 'DodoPayments'
+ | 'DoIt'
+ | 'Dolibarr'
+ | 'Doppler'
+ | 'Drata'
+ | 'Dremio'
+ | 'Drip'
+ | 'Dropbox'
+ | 'DropboxSign'
+ | 'Dub'
+ | 'Dubsado'
+ | 'Dwolla'
+ | 'Dynamics365'
+ | 'DynamoDB'
+ | 'Dynatrace'
+ | 'E2B'
+ | 'Easypost'
+ | 'Easypromos'
+ | 'Ebay'
+ | 'EConomic'
+ | 'Elasticemail'
+ | 'Elasticsearch'
+ | 'ElevenLabs'
+ | 'Eloqua'
+ | 'EmailOctopus'
+ | 'EmploymentHero'
+ | 'Encharge'
+ | 'Env0'
+ | 'Eventbrite'
+ | 'Eventee'
+ | 'Eventzilla'
+ | 'Everhour'
+ | 'ExchangeRatesApi'
+ | 'Expensify'
+ | 'EZOfficeInventory'
+ | 'FacebookPages'
+ | 'Factorial'
+ | 'Fastbill'
+ | 'Fastly'
+ | 'Fauna'
+ | 'Featurebase'
+ | 'Feishu'
+ | 'Fillout'
+ | 'Finage'
+ | 'FinancialModelling'
+ | 'Finnhub'
+ | 'Finnworlds'
+ | 'Fintoc'
+ | 'Firebase'
+ | 'Firebolt'
+ | 'Firecrawl'
+ | 'FireHydrant'
+ | 'FireworksAI'
+ | 'Flagsmith'
+ | 'Fleetio'
+ | 'Flexmail'
+ | 'Flexport'
+ | 'FloatApp'
+ | 'Flowlu'
+ | 'FlyIo'
+ | 'Formbricks'
+ | 'FreeAgent'
+ | 'Freightview'
+ | 'FreshBooks'
+ | 'Freshcaller'
+ | 'Freshchat'
+ | 'Freshdesk'
+ | 'Freshsales'
+ | 'Freshservice'
+ | 'Frill'
+ | 'Front'
+ | 'Fulcrum'
+ | 'FullStory'
+ | 'GainsightPx'
+ | 'Gerrit'
+ | 'GetStream'
+ | 'Giphy'
+ | 'GitBook'
+ | 'Gitea'
+ | 'Gitguardian'
+ | 'Github'
+ | 'GitLab'
+ | 'Gladly'
+ | 'Glassfrog'
+ | 'Gmail'
+ | 'GNews'
+ | 'GoCardless'
+ | 'Gojiberry'
+ | 'Goldcast'
+ | 'GoLogin'
+ | 'Gong'
+ | 'GoogleAdManager'
+ | 'GoogleAds'
+ | 'GoogleAnalytics'
+ | 'GoogleCalendar'
+ | 'GoogleChat'
+ | 'GoogleClassroom'
+ | 'GoogleCloudStorage'
+ | 'GoogleDirectory'
+ | 'GoogleDrive'
+ | 'GoogleForms'
+ | 'GooglePageSpeedInsights'
+ | 'GoogleSearchConsole'
+ | 'GoogleSheets'
+ | 'GoogleTasks'
+ | 'GoogleWebfonts'
+ | 'GoogleWorkspaceAdminReports'
+ | 'Gorgias'
+ | 'Grafana'
+ | 'Granola'
+ | 'Greenhouse'
+ | 'GreytHr'
+ | 'Gridly'
+ | 'Groq'
+ | 'GrowthBook'
+ | 'Guardian'
+ | 'Gumloop'
+ | 'Guru'
+ | 'Gusto'
+ | 'Harness'
+ | 'Harvey'
+ | 'Hatchet'
+ | 'Healthchecks'
+ | 'Heap'
+ | 'Height'
+ | 'Helicone'
+ | 'Hellobaton'
+ | 'HelpScout'
+ | 'Heroku'
+ | 'Hetzner'
+ | 'Hex'
+ | 'HeyGen'
+ | 'HiBob'
+ | 'HighLevel'
+ | 'Hightouch'
+ | 'Honeybadger'
+ | 'Honeycomb'
+ | 'HoorayHR'
+ | 'Hubplanner'
+ | 'Hubspot'
+ | 'HuggingFace'
+ | 'Humanitix'
+ | 'Huntr'
+ | 'Hyperspell'
+ | 'Ikas'
+ | 'IlluminaBasespace'
+ | 'Imagga'
+ | 'Impact'
+ | 'IncidentIo'
+ | 'Infisical'
+ | 'Inflowinventory'
+ | 'InforNexus'
+ | 'Inngest'
+ | 'Insightful'
+ | 'Insightly'
+ | 'Instagram'
+ | 'Instana'
+ | 'Instantly'
+ | 'Instatus'
+ | 'Intercom'
+ | 'Interzoid'
+ | 'Intruder'
+ | 'Invoiced'
+ | 'Invoiceninja'
+ | 'IP2Whois'
+ | 'Iterable'
+ | 'JamfPro'
+ | 'Jellyfish'
+ | 'Jenkins'
+ | 'JfrogArtifactory'
+ | 'Jira'
+ | 'Jobber'
+ | 'JobNimbus'
+ | 'Jotform'
+ | 'JudgeMeReviews'
+ | 'Jumpcloud'
+ | 'JustCall'
+ | 'JustSift'
+ | 'K6Cloud'
+ | 'Kafka'
+ | 'Kajabi'
+ | 'Kandji'
+ | 'KapaAI'
+ | 'Katana'
+ | 'Keka'
+ | 'Kernel'
+ | 'Kickscale'
+ | 'Kisi'
+ | 'Kissmetrics'
+ | 'Klarna'
+ | 'Klaus'
+ | 'Klaviyo'
+ | 'Knock'
+ | 'KongKonnect'
+ | 'Koyeb'
+ | 'Kubecost'
+ | 'Kustomer'
+ | 'KYVE'
+ | 'Lacework'
+ | 'Lago'
+ | 'LambdaLabs'
+ | 'Langfuse'
+ | 'LangSmith'
+ | 'Lattice'
+ | 'LaunchDarkly'
+ | 'Leadfeeder'
+ | 'Leexi'
+ | 'Lemlist'
+ | 'LemonSqueezy'
+ | 'LessAnnoyingCRM'
+ | 'Lever'
+ | 'Liana'
+ | 'Lightfield'
+ | 'LightspeedRetail'
+ | 'Linear'
+ | 'Linearb'
+ | 'LingoDev'
+ | 'LinkedinAds'
+ | 'LinkedinPages'
+ | 'Linkrunner'
+ | 'Linnworks'
+ | 'Linode'
+ | 'LlamaCloud'
+ | 'Lob'
+ | 'LogzIO'
+ | 'Lokalise'
+ | 'Looker'
+ | 'Loops'
+ | 'Luma'
+ | 'M3ter'
+ | 'Mailchimp'
+ | 'MailerLite'
+ | 'MailerSend'
+ | 'Mailgun'
+ | 'Mailjet'
+ | 'Mailosaur'
+ | 'Mailtrap'
+ | 'Mantle'
+ | 'Marketo'
+ | 'Marketstack'
+ | 'Matomo'
+ | 'Maxio'
+ | 'Mem0'
+ | 'Mendeley'
+ | 'Mention'
+ | 'MercadoAds'
+ | 'Mercury'
+ | 'Merge'
+ | 'MetaAds'
+ | 'Metabase'
+ | 'Metaplane'
+ | 'Metorial'
+ | 'Metricool'
+ | 'Metriport'
+ | 'Metronome'
+ | 'MicrosoftDataverse'
+ | 'MicrosoftEntraId'
+ | 'MicrosoftLists'
+ | 'MicrosoftTeams'
+ | 'Mintlify'
+ | 'Miro'
+ | 'Missive'
+ | 'MistralAI'
+ | 'MixMax'
+ | 'Mixpanel'
+ | 'Mode'
+ | 'Mollie'
+ | 'Monday'
+ | 'MongoDB'
+ | 'Mono'
+ | 'MonteCarlo'
+ | 'MSSQL'
+ | 'Mux'
+ | 'MyHours'
+ | 'MySQL'
+ | 'N8n'
+ | 'Nasa'
+ | 'Navan'
+ | 'NebiusAI'
+ | 'Neon'
+ | 'Netlify'
+ | 'NetSuite'
+ | 'NewRelic'
+ | 'NewsApi'
+ | 'NewsData'
+ | 'NewYorkTimes'
+ | 'Nexiopay'
+ | 'NextdoorAds'
+ | 'NinjaOneRMM'
+ | 'NoCRM'
+ | 'Northflank'
+ | 'NorthpassLMS'
+ | 'Notion'
+ | 'Nuget'
+ | 'Nutshell'
+ | 'Nylas'
+ | 'Octolens'
+ | 'OctopusDeploy'
+ | 'Okta'
+ | 'Omnisend'
+ | 'Oncehub'
+ | 'OneDrive'
+ | 'OneHundredMs'
+ | 'Onepagecrm'
+ | 'OnePassword'
+ | 'OneSignal'
+ | 'Onfleet'
+ | 'OpenAI'
+ | 'OpenAIAds'
+ | 'OpenAQ'
+ | 'OpenDataDc'
+ | 'OpenExchangeRates'
+ | 'OpenFDA'
+ | 'OpenRouter'
+ | 'OpenWeather'
+ | 'OpinionStage'
+ | 'Opsgenie'
+ | 'Optimizely'
+ | 'OPUSWatch'
+ | 'Oracle'
+ | 'OracleEbs'
+ | 'OracleFusion'
+ | 'Orb'
+ | 'Orbit'
+ | 'OrcaSecurity'
+ | 'Ortto'
+ | 'Oura'
+ | 'Outbrain'
+ | 'Outlook'
+ | 'Outreach'
+ | 'Oveit'
+ | 'PabblySubscriptionsBilling'
+ | 'Packagist'
+ | 'Paddle'
+ | 'PagerDuty'
+ | 'PandaDoc'
+ | 'Paperform'
+ | 'Papersign'
+ | 'Pardot'
+ | 'Partnerize'
+ | 'PartnerStack'
+ | 'PayFit'
+ | 'Paylocity'
+ | 'PayPal'
+ | 'Paystack'
+ | 'PeecAI'
+ | 'Pendo'
+ | 'Pennylane'
+ | 'Perigon'
+ | 'Perk'
+ | 'PersistIq'
+ | 'Persona'
+ | 'Personio'
+ | 'Pexels'
+ | 'PgAnalyze'
+ | 'Phyllo'
+ | 'Picqer'
+ | 'Pinecone'
+ | 'Pingdom'
+ | 'PinterestAds'
+ | 'Pipedrive'
+ | 'Pipeliner'
+ | 'PivotalTracker'
+ | 'Piwik'
+ | 'Plaid'
+ | 'Plain'
+ | 'PlanetScale'
+ | 'Planhat'
+ | 'PlatformSh'
+ | 'Plausible'
+ | 'Plunk'
+ | 'Pocket'
+ | 'Podium'
+ | 'Polar'
+ | 'Polygon'
+ | 'Poplar'
+ | 'Postgres'
+ | 'Postmark'
+ | 'PrefectCloud'
+ | 'PrestaShop'
+ | 'Pretix'
+ | 'Primetric'
+ | 'Printify'
+ | 'Productboard'
+ | 'Productive'
+ | 'PromptingCompany'
+ | 'PulumiCloud'
+ | 'Pylon'
+ | 'PyPI'
+ | 'Qdrant'
+ | 'Qonto'
+ | 'Qualaroo'
+ | 'Qualtrics'
+ | 'QualysVmdr'
+ | 'QuickBooks'
+ | 'Railway'
+ | 'Railz'
+ | 'Ramp'
+ | 'Rapid7Insightvm'
+ | 'Raygun'
+ | 'Razorpay'
+ | 'RB2B'
+ | 'RDStationMarketing'
+ | 'Recharge'
+ | 'Recreation'
+ | 'Recruitee'
+ | 'Recurly'
+ | 'Reddit'
+ | 'RedditAds'
+ | 'Redis'
+ | 'Redshift'
+ | 'ReferralHero'
+ | 'Render'
+ | 'RentCast'
+ | 'Repairshopr'
+ | 'Replicate'
+ | 'ReplyIo'
+ | 'Resend'
+ | 'RetailExpress'
+ | 'RetellAI'
+ | 'Retently'
+ | 'RevenueCat'
+ | 'RevolutMerchant'
+ | 'RingCentral'
+ | 'Rippling'
+ | 'RKICovid'
+ | 'Roark'
+ | 'RocketChat'
+ | 'Rocketlane'
+ | 'Rollbar'
+ | 'Rootly'
+ | 'Rss'
+ | 'RudderStack'
+ | 'Ruddr'
+ | 'RunPod'
+ | 'SafetyCulture'
+ | 'SageHR'
+ | 'SageIntacct'
+ | 'Sailthru'
+ | 'Salesflare'
+ | 'Salesforce'
+ | 'SalesforceMarketingCloud'
+ | 'SalesLoft'
+ | 'Salestrics'
+ | 'Sanity'
+ | 'SapConcur'
+ | 'SapErp'
+ | 'SAPFieldglass'
+ | 'SapHana'
+ | 'SapSuccessFactors'
+ | 'SavvyCal'
+ | 'ScaleAI'
+ | 'Scaleway'
+ | 'SearchAds360'
+ | 'Secoda'
+ | 'Secureframe'
+ | 'Segment'
+ | 'Semaphore'
+ | 'Semgrep'
+ | 'SendGrid'
+ | 'Sendowl'
+ | 'SendPulse'
+ | 'Senseforce'
+ | 'Sentinelone'
+ | 'Sentry'
+ | 'Serpstat'
+ | 'ServiceNow'
+ | 'SevenShifts'
+ | 'SFTP'
+ | 'SharePoint'
+ | 'Sharetribe'
+ | 'Shippo'
+ | 'ShipStation'
+ | 'Shopify'
+ | 'Shopware'
+ | 'ShopWired'
+ | 'Shortcut'
+ | 'Shortio'
+ | 'Shutterstock'
+ | 'SigmaComputing'
+ | 'SignNow'
+ | 'SigNoz'
+ | 'Sim'
+ | 'SimFin'
+ | 'SimpleCast'
+ | 'Simplesat'
+ | 'Singular'
+ | 'Skyvern'
+ | 'Slack'
+ | 'Slash'
+ | 'Smaily'
+ | 'SmartEngage'
+ | 'Smartreach'
+ | 'Smartsheet'
+ | 'Smartwaiver'
+ | 'SnapchatAds'
+ | 'Snowflake'
+ | 'Snowplow'
+ | 'Snyk'
+ | 'SolarwindsServiceDesk'
+ | 'SonarCloud'
+ | 'Sonarqube'
+ | 'SonatypeNexus'
+ | 'Sourcegraph'
+ | 'Spacelift'
+ | 'SparkPost'
+ | 'SplitIo'
+ | 'SplunkObservabilityCloud'
+ | 'SpotifyAds'
+ | 'SpotlerCRM'
+ | 'Squadcast'
+ | 'Square'
+ | 'Squarespace'
+ | 'Statsig'
+ | 'Statuscake'
+ | 'Statuspage'
+ | 'Stigg'
+ | 'StockData'
+ | 'Strava'
+ | 'StreamElements'
+ | 'Streamlabs'
+ | 'Stripe'
+ | 'Stytch'
+ | 'SumoLogic'
+ | 'Sumsub'
+ | 'Supabase'
+ | 'Superwall'
+ | 'SurveyMonkey'
+ | 'SurveySparrow'
+ | 'Survicate'
+ | 'Svix'
+ | 'Swarmia'
+ | 'Swonkie'
+ | 'Synthesia'
+ | 'Systeme'
+ | 'Taboola'
+ | 'Tailscale'
+ | 'Talkwalker'
+ | 'Tavus'
+ | 'TawkTo'
+ | 'Teachable'
+ | 'Teamcity'
+ | 'Teamtailor'
+ | 'Teamwork'
+ | 'Telli'
+ | 'Tempo'
+ | 'TemporalIO'
+ | 'TenableVulnerabilityManagement'
+ | 'TerraApi'
+ | 'TerraformCloud'
+ | 'Testrail'
+ | 'Thinkific'
+ | 'ThinkificCourses'
+ | 'ThriveLearning'
+ | 'Ticketmaster'
+ | 'TicketTailor'
+ | 'TickTick'
+ | 'TikTokAds'
+ | 'Tile38'
+ | 'Timely'
+ | 'Tinyemail'
+ | 'TMDb'
+ | 'Todoist'
+ | 'TogetherAI'
+ | 'Toggl'
+ | 'TrackPMS'
+ | 'TravisCI'
+ | 'Trello'
+ | 'Tremendous'
+ | 'TriggerDev'
+ | 'TrustPilot'
+ | 'Turso'
+ | 'TVMaze'
+ | 'TwelveData'
+ | 'TwelveLabs'
+ | 'Twenty'
+ | 'Twilio'
+ | 'Twitter'
+ | 'TwitterAds'
+ | 'TyntecSMS'
+ | 'Typeform'
+ | 'Ubidots'
+ | 'Unleash'
+ | 'Unstructured'
+ | 'UpPromote'
+ | 'Upstash'
+ | 'Uptick'
+ | 'Uptimerobot'
+ | 'USCensus'
+ | 'Usersnap'
+ | 'Uservoice'
+ | 'Vantage'
+ | 'Vapi'
+ | 'Veeqo'
+ | 'Vellum'
+ | 'Veracode'
+ | 'Vercel'
+ | 'Vespa'
+ | 'VismaEconomic'
+ | 'Vitally'
+ | 'Vultr'
+ | 'VWO'
+ | 'Waiteraid'
+ | 'Wasabi'
+ | 'Watchmode'
+ | 'Webflow'
+ | 'WeightsAndBiases'
+ | 'WhenIWork'
+ | 'WikipediaPageviews'
+ | 'Windmill'
+ | 'WooCommerce'
+ | 'Wordpress'
+ | 'Workable'
+ | 'Workday'
+ | 'Workflowmax'
+ | 'WorkOS'
+ | 'Workramp'
+ | 'Wrike'
+ | 'Writesonic'
+ | 'Wufoo'
+ | 'Xero'
+ | 'Xmatters'
+ | 'Xsolla'
+ | 'YahooFinance'
+ | 'YandexMetrica'
+ | 'Ynab'
+ | 'Yotpo'
+ | 'Younium'
+ | 'YouSign'
+ | 'YouTubeAnalytics'
+ | 'YoutubeData'
+ | 'ZapierSupportedStorage'
+ | 'ZapSign'
+ | 'Zellify'
+ | 'Zendesk'
+ | 'ZendeskSell'
+ | 'ZendeskSunshine'
+ | 'Zenduty'
+ | 'Zenefits'
+ | 'Zenloop'
+ | 'Zep'
+ | 'ZohoAnalytics'
+ | 'ZohoBigin'
+ | 'ZohoBilling'
+ | 'ZohoBooks'
+ | 'ZohoCampaign'
+ | 'ZohoCRM'
+ | 'ZohoDesk'
+ | 'ZohoExpense'
+ | 'ZohoInventory'
+ | 'ZohoInvoice'
+ | 'ZonkaFeedback'
+ | 'Zoom'
+ | 'ZoomInfo'
+ | 'Zuora'
+ }
+ openDataSourceSetup: (product: ExternalDataSourceType) => {
+ product:
+ | 'ActiveCampaign'
+ | 'AcuityScheduling'
+ | 'Adapty'
+ | 'Adjust'
+ | 'AdobeAnalytics'
+ | 'AdobeCommerce'
+ | 'AdpWorkforceNow'
+ | 'AdRoll'
+ | 'Adyen'
+ | 'AgileCRM'
+ | 'Aha'
+ | 'Ahrefs'
+ | 'AikidoSecurity'
+ | 'Airbrake'
+ | 'Airbyte'
+ | 'Aircall'
+ | 'AirOps'
+ | 'Airtable'
+ | 'Aiven'
+ | 'Akeneo'
+ | 'Algolia'
+ | 'Alguna'
+ | 'AlpacaBrokerAPI'
+ | 'AlphaVantage'
+ | 'AmazonAds'
+ | 'AmazonCloudWatch'
+ | 'AmazonEventBridge'
+ | 'AmazonKinesis'
+ | 'AmazonS3'
+ | 'AmazonSellingPartner'
+ | 'AmazonSNS'
+ | 'AmazonSQS'
+ | 'Amplitude'
+ | 'Anthropic'
+ | 'ApifyDataset'
+ | 'Apollo'
+ | 'Appcues'
+ | 'Appdynamics'
+ | 'Appfigures'
+ | 'Appfollow'
+ | 'AppleSearchAds'
+ | 'AppLovin'
+ | 'AppsFlyer'
+ | 'Appsignal'
+ | 'Appstack'
+ | 'Apptivo'
+ | 'Appwrite'
+ | 'Argocd'
+ | 'Asana'
+ | 'Ashby'
+ | 'Asknicely'
+ | 'AssemblyAI'
+ | 'Attentive'
+ | 'Attio'
+ | 'Auth0'
+ | 'Automox'
+ | 'Autumn'
+ | 'Aviationstack'
+ | 'Aviator'
+ | 'Awin'
+ | 'AwsCloudTrail'
+ | 'AzureBlob'
+ | 'AzureDevOps'
+ | 'AzureTableStorage'
+ | 'Babelforce'
+ | 'Backblaze'
+ | 'BambooHR'
+ | 'Basecamp'
+ | 'Baserow'
+ | 'Baseten'
+ | 'Beamer'
+ | 'Bettermode'
+ | 'BetterStack'
+ | 'BigCommerce'
+ | 'BigMailer'
+ | 'BigQuery'
+ | 'BingAds'
+ | 'Bitbucket'
+ | 'Bitly'
+ | 'Bitrise'
+ | 'BlandAI'
+ | 'Blogger'
+ | 'Bluetally'
+ | 'BoldSign'
+ | 'Box'
+ | 'Braintree'
+ | 'Braintrust'
+ | 'Branch'
+ | 'Braze'
+ | 'Breezometer'
+ | 'BreezyHR'
+ | 'Brevo'
+ | 'Brex'
+ | 'BrowseAI'
+ | 'Browserbase'
+ | 'BrowserUse'
+ | 'Bugsnag'
+ | 'BuildBetter'
+ | 'Buildkite'
+ | 'Bunny'
+ | 'Buzzsprout'
+ | 'CalCom'
+ | 'Calendly'
+ | 'CallRail'
+ | 'CampaignManager360'
+ | 'CampaignMonitor'
+ | 'Campayn'
+ | 'Campfire'
+ | 'Canny'
+ | 'CapsuleCRM'
+ | 'CaptainData'
+ | 'CareQualityCommission'
+ | 'CartCom'
+ | 'CastorEDC'
+ | 'Chameleon'
+ | 'Chargebee'
+ | 'Chargedesk'
+ | 'Chargify'
+ | 'ChartHop'
+ | 'ChartMogul'
+ | 'Chatwoot'
+ | 'Checkmarx'
+ | 'CheckoutCom'
+ | 'Chift'
+ | 'Chorus'
+ | 'Churnkey'
+ | 'Cimis'
+ | 'Cin7'
+ | 'CircleCI'
+ | 'CircleciInsights'
+ | 'CiscoDuo'
+ | 'CiscoMeraki'
+ | 'Clari'
+ | 'Clarifai'
+ | 'Clazar'
+ | 'Clerk'
+ | 'ClickHouse'
+ | 'ClickhouseCloud'
+ | 'ClickUp'
+ | 'Clockify'
+ | 'Clockodo'
+ | 'Close'
+ | 'Cloudbeds'
+ | 'Cloudflare'
+ | 'Coassemble'
+ | 'CockroachDB'
+ | 'Coda'
+ | 'Codacy'
+ | 'Codecov'
+ | 'Codefresh'
+ | 'Cody'
+ | 'Cohere'
+ | 'CoinApi'
+ | 'CoinGecko'
+ | 'CoinMarketCap'
+ | 'Commercetools'
+ | 'Concord'
+ | 'ConfigCat'
+ | 'Confluence'
+ | 'ConfluentCloud'
+ | 'ConstantContact'
+ | 'ConvertKit'
+ | 'Convex'
+ | 'Copper'
+ | 'Coralogix'
+ | 'CosmosDB'
+ | 'Couchbase'
+ | 'Coupa'
+ | 'Coveralls'
+ | 'CratesIO'
+ | 'Criteo'
+ | 'Cronitor'
+ | 'Crunchbase'
+ | 'CultureAmp'
+ | 'Cursor'
+ | 'Curve'
+ | 'Custom'
+ | 'CustomerIO'
+ | 'Customerly'
+ | 'DagsterCloud'
+ | 'Databricks'
+ | 'Datadog'
+ | 'Datahub'
+ | 'Datascope'
+ | 'Datorama'
+ | 'Db2'
+ | 'Dbt'
+ | 'Decagon'
+ | 'Deel'
+ | 'Deepgram'
+ | 'Deepsource'
+ | 'Delighted'
+ | 'DenoDeploy'
+ | 'Deputy'
+ | 'DevinAI'
+ | 'DigitalOcean'
+ | 'DingConnect'
+ | 'DisplayVideo360'
+ | 'Dixa'
+ | 'Dockerhub'
+ | 'Docuseal'
+ | 'Docusign'
+ | 'DodoPayments'
+ | 'DoIt'
+ | 'Dolibarr'
+ | 'Doppler'
+ | 'Drata'
+ | 'Dremio'
+ | 'Drip'
+ | 'Dropbox'
+ | 'DropboxSign'
+ | 'Dub'
+ | 'Dubsado'
+ | 'Dwolla'
+ | 'Dynamics365'
+ | 'DynamoDB'
+ | 'Dynatrace'
+ | 'E2B'
+ | 'Easypost'
+ | 'Easypromos'
+ | 'Ebay'
+ | 'EConomic'
+ | 'Elasticemail'
+ | 'Elasticsearch'
+ | 'ElevenLabs'
+ | 'Eloqua'
+ | 'EmailOctopus'
+ | 'EmploymentHero'
+ | 'Encharge'
+ | 'Env0'
+ | 'Eventbrite'
+ | 'Eventee'
+ | 'Eventzilla'
+ | 'Everhour'
+ | 'ExchangeRatesApi'
+ | 'Expensify'
+ | 'EZOfficeInventory'
+ | 'FacebookPages'
+ | 'Factorial'
+ | 'Fastbill'
+ | 'Fastly'
+ | 'Fauna'
+ | 'Featurebase'
+ | 'Feishu'
+ | 'Fillout'
+ | 'Finage'
+ | 'FinancialModelling'
+ | 'Finnhub'
+ | 'Finnworlds'
+ | 'Fintoc'
+ | 'Firebase'
+ | 'Firebolt'
+ | 'Firecrawl'
+ | 'FireHydrant'
+ | 'FireworksAI'
+ | 'Flagsmith'
+ | 'Fleetio'
+ | 'Flexmail'
+ | 'Flexport'
+ | 'FloatApp'
+ | 'Flowlu'
+ | 'FlyIo'
+ | 'Formbricks'
+ | 'FreeAgent'
+ | 'Freightview'
+ | 'FreshBooks'
+ | 'Freshcaller'
+ | 'Freshchat'
+ | 'Freshdesk'
+ | 'Freshsales'
+ | 'Freshservice'
+ | 'Frill'
+ | 'Front'
+ | 'Fulcrum'
+ | 'FullStory'
+ | 'GainsightPx'
+ | 'Gerrit'
+ | 'GetStream'
+ | 'Giphy'
+ | 'GitBook'
+ | 'Gitea'
+ | 'Gitguardian'
+ | 'Github'
+ | 'GitLab'
+ | 'Gladly'
+ | 'Glassfrog'
+ | 'Gmail'
+ | 'GNews'
+ | 'GoCardless'
+ | 'Gojiberry'
+ | 'Goldcast'
+ | 'GoLogin'
+ | 'Gong'
+ | 'GoogleAdManager'
+ | 'GoogleAds'
+ | 'GoogleAnalytics'
+ | 'GoogleCalendar'
+ | 'GoogleChat'
+ | 'GoogleClassroom'
+ | 'GoogleCloudStorage'
+ | 'GoogleDirectory'
+ | 'GoogleDrive'
+ | 'GoogleForms'
+ | 'GooglePageSpeedInsights'
+ | 'GoogleSearchConsole'
+ | 'GoogleSheets'
+ | 'GoogleTasks'
+ | 'GoogleWebfonts'
+ | 'GoogleWorkspaceAdminReports'
+ | 'Gorgias'
+ | 'Grafana'
+ | 'Granola'
+ | 'Greenhouse'
+ | 'GreytHr'
+ | 'Gridly'
+ | 'Groq'
+ | 'GrowthBook'
+ | 'Guardian'
+ | 'Gumloop'
+ | 'Guru'
+ | 'Gusto'
+ | 'Harness'
+ | 'Harvey'
+ | 'Hatchet'
+ | 'Healthchecks'
+ | 'Heap'
+ | 'Height'
+ | 'Helicone'
+ | 'Hellobaton'
+ | 'HelpScout'
+ | 'Heroku'
+ | 'Hetzner'
+ | 'Hex'
+ | 'HeyGen'
+ | 'HiBob'
+ | 'HighLevel'
+ | 'Hightouch'
+ | 'Honeybadger'
+ | 'Honeycomb'
+ | 'HoorayHR'
+ | 'Hubplanner'
+ | 'Hubspot'
+ | 'HuggingFace'
+ | 'Humanitix'
+ | 'Huntr'
+ | 'Hyperspell'
+ | 'Ikas'
+ | 'IlluminaBasespace'
+ | 'Imagga'
+ | 'Impact'
+ | 'IncidentIo'
+ | 'Infisical'
+ | 'Inflowinventory'
+ | 'InforNexus'
+ | 'Inngest'
+ | 'Insightful'
+ | 'Insightly'
+ | 'Instagram'
+ | 'Instana'
+ | 'Instantly'
+ | 'Instatus'
+ | 'Intercom'
+ | 'Interzoid'
+ | 'Intruder'
+ | 'Invoiced'
+ | 'Invoiceninja'
+ | 'IP2Whois'
+ | 'Iterable'
+ | 'JamfPro'
+ | 'Jellyfish'
+ | 'Jenkins'
+ | 'JfrogArtifactory'
+ | 'Jira'
+ | 'Jobber'
+ | 'JobNimbus'
+ | 'Jotform'
+ | 'JudgeMeReviews'
+ | 'Jumpcloud'
+ | 'JustCall'
+ | 'JustSift'
+ | 'K6Cloud'
+ | 'Kafka'
+ | 'Kajabi'
+ | 'Kandji'
+ | 'KapaAI'
+ | 'Katana'
+ | 'Keka'
+ | 'Kernel'
+ | 'Kickscale'
+ | 'Kisi'
+ | 'Kissmetrics'
+ | 'Klarna'
+ | 'Klaus'
+ | 'Klaviyo'
+ | 'Knock'
+ | 'KongKonnect'
+ | 'Koyeb'
+ | 'Kubecost'
+ | 'Kustomer'
+ | 'KYVE'
+ | 'Lacework'
+ | 'Lago'
+ | 'LambdaLabs'
+ | 'Langfuse'
+ | 'LangSmith'
+ | 'Lattice'
+ | 'LaunchDarkly'
+ | 'Leadfeeder'
+ | 'Leexi'
+ | 'Lemlist'
+ | 'LemonSqueezy'
+ | 'LessAnnoyingCRM'
+ | 'Lever'
+ | 'Liana'
+ | 'Lightfield'
+ | 'LightspeedRetail'
+ | 'Linear'
+ | 'Linearb'
+ | 'LingoDev'
+ | 'LinkedinAds'
+ | 'LinkedinPages'
+ | 'Linkrunner'
+ | 'Linnworks'
+ | 'Linode'
+ | 'LlamaCloud'
+ | 'Lob'
+ | 'LogzIO'
+ | 'Lokalise'
+ | 'Looker'
+ | 'Loops'
+ | 'Luma'
+ | 'M3ter'
+ | 'Mailchimp'
+ | 'MailerLite'
+ | 'MailerSend'
+ | 'Mailgun'
+ | 'Mailjet'
+ | 'Mailosaur'
+ | 'Mailtrap'
+ | 'Mantle'
+ | 'Marketo'
+ | 'Marketstack'
+ | 'Matomo'
+ | 'Maxio'
+ | 'Mem0'
+ | 'Mendeley'
+ | 'Mention'
+ | 'MercadoAds'
+ | 'Mercury'
+ | 'Merge'
+ | 'MetaAds'
+ | 'Metabase'
+ | 'Metaplane'
+ | 'Metorial'
+ | 'Metricool'
+ | 'Metriport'
+ | 'Metronome'
+ | 'MicrosoftDataverse'
+ | 'MicrosoftEntraId'
+ | 'MicrosoftLists'
+ | 'MicrosoftTeams'
+ | 'Mintlify'
+ | 'Miro'
+ | 'Missive'
+ | 'MistralAI'
+ | 'MixMax'
+ | 'Mixpanel'
+ | 'Mode'
+ | 'Mollie'
+ | 'Monday'
+ | 'MongoDB'
+ | 'Mono'
+ | 'MonteCarlo'
+ | 'MSSQL'
+ | 'Mux'
+ | 'MyHours'
+ | 'MySQL'
+ | 'N8n'
+ | 'Nasa'
+ | 'Navan'
+ | 'NebiusAI'
+ | 'Neon'
+ | 'Netlify'
+ | 'NetSuite'
+ | 'NewRelic'
+ | 'NewsApi'
+ | 'NewsData'
+ | 'NewYorkTimes'
+ | 'Nexiopay'
+ | 'NextdoorAds'
+ | 'NinjaOneRMM'
+ | 'NoCRM'
+ | 'Northflank'
+ | 'NorthpassLMS'
+ | 'Notion'
+ | 'Nuget'
+ | 'Nutshell'
+ | 'Nylas'
+ | 'Octolens'
+ | 'OctopusDeploy'
+ | 'Okta'
+ | 'Omnisend'
+ | 'Oncehub'
+ | 'OneDrive'
+ | 'OneHundredMs'
+ | 'Onepagecrm'
+ | 'OnePassword'
+ | 'OneSignal'
+ | 'Onfleet'
+ | 'OpenAI'
+ | 'OpenAIAds'
+ | 'OpenAQ'
+ | 'OpenDataDc'
+ | 'OpenExchangeRates'
+ | 'OpenFDA'
+ | 'OpenRouter'
+ | 'OpenWeather'
+ | 'OpinionStage'
+ | 'Opsgenie'
+ | 'Optimizely'
+ | 'OPUSWatch'
+ | 'Oracle'
+ | 'OracleEbs'
+ | 'OracleFusion'
+ | 'Orb'
+ | 'Orbit'
+ | 'OrcaSecurity'
+ | 'Ortto'
+ | 'Oura'
+ | 'Outbrain'
+ | 'Outlook'
+ | 'Outreach'
+ | 'Oveit'
+ | 'PabblySubscriptionsBilling'
+ | 'Packagist'
+ | 'Paddle'
+ | 'PagerDuty'
+ | 'PandaDoc'
+ | 'Paperform'
+ | 'Papersign'
+ | 'Pardot'
+ | 'Partnerize'
+ | 'PartnerStack'
+ | 'PayFit'
+ | 'Paylocity'
+ | 'PayPal'
+ | 'Paystack'
+ | 'PeecAI'
+ | 'Pendo'
+ | 'Pennylane'
+ | 'Perigon'
+ | 'Perk'
+ | 'PersistIq'
+ | 'Persona'
+ | 'Personio'
+ | 'Pexels'
+ | 'PgAnalyze'
+ | 'Phyllo'
+ | 'Picqer'
+ | 'Pinecone'
+ | 'Pingdom'
+ | 'PinterestAds'
+ | 'Pipedrive'
+ | 'Pipeliner'
+ | 'PivotalTracker'
+ | 'Piwik'
+ | 'Plaid'
+ | 'Plain'
+ | 'PlanetScale'
+ | 'Planhat'
+ | 'PlatformSh'
+ | 'Plausible'
+ | 'Plunk'
+ | 'Pocket'
+ | 'Podium'
+ | 'Polar'
+ | 'Polygon'
+ | 'Poplar'
+ | 'Postgres'
+ | 'Postmark'
+ | 'PrefectCloud'
+ | 'PrestaShop'
+ | 'Pretix'
+ | 'Primetric'
+ | 'Printify'
+ | 'Productboard'
+ | 'Productive'
+ | 'PromptingCompany'
+ | 'PulumiCloud'
+ | 'Pylon'
+ | 'PyPI'
+ | 'Qdrant'
+ | 'Qonto'
+ | 'Qualaroo'
+ | 'Qualtrics'
+ | 'QualysVmdr'
+ | 'QuickBooks'
+ | 'Railway'
+ | 'Railz'
+ | 'Ramp'
+ | 'Rapid7Insightvm'
+ | 'Raygun'
+ | 'Razorpay'
+ | 'RB2B'
+ | 'RDStationMarketing'
+ | 'Recharge'
+ | 'Recreation'
+ | 'Recruitee'
+ | 'Recurly'
+ | 'Reddit'
+ | 'RedditAds'
+ | 'Redis'
+ | 'Redshift'
+ | 'ReferralHero'
+ | 'Render'
+ | 'RentCast'
+ | 'Repairshopr'
+ | 'Replicate'
+ | 'ReplyIo'
+ | 'Resend'
+ | 'RetailExpress'
+ | 'RetellAI'
+ | 'Retently'
+ | 'RevenueCat'
+ | 'RevolutMerchant'
+ | 'RingCentral'
+ | 'Rippling'
+ | 'RKICovid'
+ | 'Roark'
+ | 'RocketChat'
+ | 'Rocketlane'
+ | 'Rollbar'
+ | 'Rootly'
+ | 'Rss'
+ | 'RudderStack'
+ | 'Ruddr'
+ | 'RunPod'
+ | 'SafetyCulture'
+ | 'SageHR'
+ | 'SageIntacct'
+ | 'Sailthru'
+ | 'Salesflare'
+ | 'Salesforce'
+ | 'SalesforceMarketingCloud'
+ | 'SalesLoft'
+ | 'Salestrics'
+ | 'Sanity'
+ | 'SapConcur'
+ | 'SapErp'
+ | 'SAPFieldglass'
+ | 'SapHana'
+ | 'SapSuccessFactors'
+ | 'SavvyCal'
+ | 'ScaleAI'
+ | 'Scaleway'
+ | 'SearchAds360'
+ | 'Secoda'
+ | 'Secureframe'
+ | 'Segment'
+ | 'Semaphore'
+ | 'Semgrep'
+ | 'SendGrid'
+ | 'Sendowl'
+ | 'SendPulse'
+ | 'Senseforce'
+ | 'Sentinelone'
+ | 'Sentry'
+ | 'Serpstat'
+ | 'ServiceNow'
+ | 'SevenShifts'
+ | 'SFTP'
+ | 'SharePoint'
+ | 'Sharetribe'
+ | 'Shippo'
+ | 'ShipStation'
+ | 'Shopify'
+ | 'Shopware'
+ | 'ShopWired'
+ | 'Shortcut'
+ | 'Shortio'
+ | 'Shutterstock'
+ | 'SigmaComputing'
+ | 'SignNow'
+ | 'SigNoz'
+ | 'Sim'
+ | 'SimFin'
+ | 'SimpleCast'
+ | 'Simplesat'
+ | 'Singular'
+ | 'Skyvern'
+ | 'Slack'
+ | 'Slash'
+ | 'Smaily'
+ | 'SmartEngage'
+ | 'Smartreach'
+ | 'Smartsheet'
+ | 'Smartwaiver'
+ | 'SnapchatAds'
+ | 'Snowflake'
+ | 'Snowplow'
+ | 'Snyk'
+ | 'SolarwindsServiceDesk'
+ | 'SonarCloud'
+ | 'Sonarqube'
+ | 'SonatypeNexus'
+ | 'Sourcegraph'
+ | 'Spacelift'
+ | 'SparkPost'
+ | 'SplitIo'
+ | 'SplunkObservabilityCloud'
+ | 'SpotifyAds'
+ | 'SpotlerCRM'
+ | 'Squadcast'
+ | 'Square'
+ | 'Squarespace'
+ | 'Statsig'
+ | 'Statuscake'
+ | 'Statuspage'
+ | 'Stigg'
+ | 'StockData'
+ | 'Strava'
+ | 'StreamElements'
+ | 'Streamlabs'
+ | 'Stripe'
+ | 'Stytch'
+ | 'SumoLogic'
+ | 'Sumsub'
+ | 'Supabase'
+ | 'Superwall'
+ | 'SurveyMonkey'
+ | 'SurveySparrow'
+ | 'Survicate'
+ | 'Svix'
+ | 'Swarmia'
+ | 'Swonkie'
+ | 'Synthesia'
+ | 'Systeme'
+ | 'Taboola'
+ | 'Tailscale'
+ | 'Talkwalker'
+ | 'Tavus'
+ | 'TawkTo'
+ | 'Teachable'
+ | 'Teamcity'
+ | 'Teamtailor'
+ | 'Teamwork'
+ | 'Telli'
+ | 'Tempo'
+ | 'TemporalIO'
+ | 'TenableVulnerabilityManagement'
+ | 'TerraApi'
+ | 'TerraformCloud'
+ | 'Testrail'
+ | 'Thinkific'
+ | 'ThinkificCourses'
+ | 'ThriveLearning'
+ | 'Ticketmaster'
+ | 'TicketTailor'
+ | 'TickTick'
+ | 'TikTokAds'
+ | 'Tile38'
+ | 'Timely'
+ | 'Tinyemail'
+ | 'TMDb'
+ | 'Todoist'
+ | 'TogetherAI'
+ | 'Toggl'
+ | 'TrackPMS'
+ | 'TravisCI'
+ | 'Trello'
+ | 'Tremendous'
+ | 'TriggerDev'
+ | 'TrustPilot'
+ | 'Turso'
+ | 'TVMaze'
+ | 'TwelveData'
+ | 'TwelveLabs'
+ | 'Twenty'
+ | 'Twilio'
+ | 'Twitter'
+ | 'TwitterAds'
+ | 'TyntecSMS'
+ | 'Typeform'
+ | 'Ubidots'
+ | 'Unleash'
+ | 'Unstructured'
+ | 'UpPromote'
+ | 'Upstash'
+ | 'Uptick'
+ | 'Uptimerobot'
+ | 'USCensus'
+ | 'Usersnap'
+ | 'Uservoice'
+ | 'Vantage'
+ | 'Vapi'
+ | 'Veeqo'
+ | 'Vellum'
+ | 'Veracode'
+ | 'Vercel'
+ | 'Vespa'
+ | 'VismaEconomic'
+ | 'Vitally'
+ | 'Vultr'
+ | 'VWO'
+ | 'Waiteraid'
+ | 'Wasabi'
+ | 'Watchmode'
+ | 'Webflow'
+ | 'WeightsAndBiases'
+ | 'WhenIWork'
+ | 'WikipediaPageviews'
+ | 'Windmill'
+ | 'WooCommerce'
+ | 'Wordpress'
+ | 'Workable'
+ | 'Workday'
+ | 'Workflowmax'
+ | 'WorkOS'
+ | 'Workramp'
+ | 'Wrike'
+ | 'Writesonic'
+ | 'Wufoo'
+ | 'Xero'
+ | 'Xmatters'
+ | 'Xsolla'
+ | 'YahooFinance'
+ | 'YandexMetrica'
+ | 'Ynab'
+ | 'Yotpo'
+ | 'Younium'
+ | 'YouSign'
+ | 'YouTubeAnalytics'
+ | 'YoutubeData'
+ | 'ZapierSupportedStorage'
+ | 'ZapSign'
+ | 'Zellify'
+ | 'Zendesk'
+ | 'ZendeskSell'
+ | 'ZendeskSunshine'
+ | 'Zenduty'
+ | 'Zenefits'
+ | 'Zenloop'
+ | 'Zep'
+ | 'ZohoAnalytics'
+ | 'ZohoBigin'
+ | 'ZohoBilling'
+ | 'ZohoBooks'
+ | 'ZohoCampaign'
+ | 'ZohoCRM'
+ | 'ZohoDesk'
+ | 'ZohoExpense'
+ | 'ZohoInventory'
+ | 'ZohoInvoice'
+ | 'ZonkaFeedback'
+ | 'Zoom'
+ | 'ZoomInfo'
+ | 'Zuora'
+ }
+ openSessionAnalysisSetup: () => {
+ value: true
+ }
+ openSourcesModal: () => {
+ value: true
+ }
+ saveSessionAnalysisFilters: (filters: RecordingUniversalFilters) => {
+ filters: RecordingUniversalFilters
+ }
+ toggleAnomalyInvestigation: () => {
+ value: true
+ }
+ toggleConversations: () => {
+ value: true
+ }
+ toggleDataWarehouseSource: (dwSource: DataWarehouseSource) => {
+ dwSource: DataWarehouseSource
+ }
+ toggleErrorTracking: () => {
+ value: true
+ }
+ toggleErrorTrackingComplete: () => {
+ value: true
+ }
+ toggleEvalReports: () => {
+ value: true
+ }
+ toggleHealthChecks: () => {
+ value: true
+ }
+ toggleSessionAnalysis: () => {
+ value: true
+ }
+ toggleSignalSource: (params: ToggleSignalSourceParams) => {
+ params: ToggleSignalSourceParams
+ }
+ toggleSignalSourceFailure: (
+ params: ToggleSignalSourceParams,
+ error: string
+ ) => {
+ error: string
+ params: ToggleSignalSourceParams
+ }
+ toggleSignalSourceSuccess: (params: ToggleSignalSourceParams) => {
+ params: ToggleSignalSourceParams
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface signalSourcesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ sessionAnalysisConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ githubIssuesConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ linearIssuesConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ zendeskTicketsConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ pgAnalyzeIssuesConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ conversationsConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ isSessionAnalysisToggling: (togglingSourceKeys: Set<string>) => boolean
+ isConversationsToggling: (togglingSourceKeys: Set<string>) => boolean
+ isGithubIssuesToggling: (togglingSourceKeys: Set<string>) => boolean
+ isLinearIssuesToggling: (togglingSourceKeys: Set<string>) => boolean
+ isZendeskTicketsToggling: (togglingSourceKeys: Set<string>) => boolean
+ isPgAnalyzeIssuesToggling: (togglingSourceKeys: Set<string>) => boolean
+ isErrorTrackingToggling: (togglingSourceKeys: Set<string>) => boolean
+ healthChecksConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ isHealthChecksToggling: (togglingSourceKeys: Set<string>) => boolean
+ evalReportsConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ isEvalReportsToggling: (togglingSourceKeys: Set<string>) => boolean
+ anomalyInvestigationConfig: (sourceConfigs: SignalSourceConfig[] | null) => SignalSourceConfig | null
+ isAnomalyInvestigationToggling: (togglingSourceKeys: Set<string>) => boolean
+ errorTrackingIsFullyEnabled: (sourceConfigs: SignalSourceConfig[] | null) => boolean
+ isSessionAnalysisRunning: (sessionAnalysisConfig: SignalSourceConfig | null) => boolean
+ enabledSourcesCount: (sourceConfigs: SignalSourceConfig[] | null) => number
+ hasNoSources: (sourceConfigs: SignalSourceConfig[] | null, enabledSourcesCount: number) => boolean
+ }
+}
+
+export type signalSourcesLogicType = MakeLogicType<
+ signalSourcesLogicValues,
+ signalSourcesLogicActions,
+ Record<string, any>,
+ signalSourcesLogicMeta
+>
+
export const signalSourcesLogic = kea<signalSourcesLogicType>([
path(['scenes', 'inbox', 'signalSourcesLogic']),
diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeTaskCreate.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeTaskCreate.tsx
index 8e8a9543b04c..a26712ef5d97 100644
--- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeTaskCreate.tsx
+++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeTaskCreate.tsx
@@ -8,7 +8,7 @@ import { createPostHogWidgetNode } from 'scenes/notebooks/Nodes/NodeWrapper'
import { NotebookNodeProps, NotebookNodeType } from 'scenes/notebooks/types'
import { tasksLogic } from 'products/posthog_ai/frontend/logics/tasksLogic'
-import { tasksLogicType } from 'products/posthog_ai/frontend/logics/tasksLogicType'
+import type { tasksLogicType } from 'products/posthog_ai/frontend/logics/tasksLogic'
import { OriginProduct, TaskUpsertProps } from 'products/posthog_ai/frontend/types/taskTypes'
import { notebookNodeLogic } from './notebookNodeLogic'
diff --git a/frontend/src/scenes/paths-v2/pathsDataLogic.ts b/frontend/src/scenes/paths-v2/pathsDataLogic.ts
index 482e9a7171e2..812d73de8a4c 100644
--- a/frontend/src/scenes/paths-v2/pathsDataLogic.ts
+++ b/frontend/src/scenes/paths-v2/pathsDataLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, selectors } from 'kea'
import { router } from 'kea-router'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
@@ -16,7 +16,23 @@ import { InsightActorsQuery, InsightVizNode, NodeKind, PathsLink, PathsQuery } f
import { isPathsQuery } from '~/queries/utils'
import { InsightLogicProps, PathType } from '~/types'
-import type { pathsDataLogicType } from './pathsDataLogicType'
+import type { DataColorTheme } from '../../lib/colors'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
+import type {
+ DataNode,
+ DateRange,
+ FunnelPathsFilter,
+ FunnelsQuery,
+ InsightFilter,
+ LifecycleQuery,
+ PathsFilter,
+ RetentionQuery,
+ StickinessQuery,
+ TrendsQuery,
+ WebOverviewQuery,
+ WebStatsTableQuery,
+} from '../../queries/schema/schema-general'
+import type { QuerySourceUpdate } from '../insights/insightVizDataLogic'
import { PathNodeData } from './pathUtils'
import { Paths, PathsNode } from './types'
@@ -24,6 +40,67 @@ export const DEFAULT_STEP_LIMIT = 5
const DEFAULT_PATH_LOGIC_KEY = 'default_path_key'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pathsDataLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ dateRange: DateRange | null | undefined // insightVizDataLogic
+ funnelPathsFilter: FunnelPathsFilter | null | undefined // insightVizDataLogic
+ insightData: Record<string, any> // insightVizDataLogic
+ insightDataError: Record<string, any> | null // insightVizDataLogic
+ insightDataLoading: boolean // insightVizDataLogic
+ insightQuery: DataNode<Record<string, any>> // insightVizDataLogic
+ pathsFilter: PathsFilter | null // insightVizDataLogic
+ theme: DataColorTheme | null // insightVizDataLogic
+ vizQuerySource:
+ | FunnelsQuery
+ | LifecycleQuery
+ | PathsQuery
+ | RetentionQuery
+ | StickinessQuery
+ | TrendsQuery
+ | WebOverviewQuery
+ | WebStatsTableQuery
+ | null // insightVizDataLogic
+ paths: Paths
+ results: PathsLink[]
+ taxonomicGroupTypes: TaxonomicFilterGroupType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pathsDataLogicActions {
+ updateInsightFilter: (insightFilter: InsightFilter) => {
+ insightFilter: InsightFilter
+ } // insightVizDataLogic
+ updateQuerySource: (querySource: QuerySourceUpdate) => {
+ querySource: QuerySourceUpdate
+ } // insightVizDataLogic
+ openPersonsModal: (props: { path_dropoff_key?: string; path_end_key?: string; path_start_key?: string }) => {
+ path_dropoff_key?: string | undefined
+ path_end_key?: string | undefined
+ path_start_key?: string | undefined
+ }
+ viewPathToFunnel: (pathItemCard: PathNodeData) => {
+ pathItemCard: PathNodeData
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pathsDataLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ results: (insightQuery: DataNode<Record<string, any>>, insightData: Record<string, any>) => PathsLink[]
+ paths: (results: PathsLink[]) => Paths
+ taxonomicGroupTypes: (pathsFilter: PathsFilter | null) => TaxonomicFilterGroupType[]
+ }
+}
+
+export type pathsDataLogicType = MakeLogicType<
+ pathsDataLogicValues,
+ pathsDataLogicActions,
+ InsightLogicProps,
+ pathsDataLogicMeta
+>
+
export const pathsDataLogic = kea<pathsDataLogicType>([
path((key) => ['scenes', 'paths', 'pathsDataLogic', key]),
props({} as InsightLogicProps),
@@ -58,13 +135,16 @@ export const pathsDataLogic = kea<pathsDataLogicType>([
selectors({
results: [
(s) => [s.insightQuery, s.insightData],
- (insightQuery, insightData): PathsLink[] => {
+ (
+ insightQuery: import('~/queries/schema/schema-general').DataNode<Record<string, any>>,
+ insightData: Record<string, any>
+ ): PathsLink[] => {
return isPathsQuery(insightQuery) ? (insightData?.result ?? []) : []
},
],
paths: [
(s) => [s.results],
- (results): Paths => {
+ (results: PathsLink[]): Paths => {
const nodes: Record<string, PathsNode> = {}
for (const path of results) {
if (!nodes[path.source]) {
@@ -83,7 +163,7 @@ export const pathsDataLogic = kea<pathsDataLogicType>([
],
taxonomicGroupTypes: [
(s) => [s.pathsFilter],
- (pathsFilter) => {
+ (pathsFilter: null | import('~/queries/schema/schema-general').PathsFilter) => {
const taxonomicGroupTypes: TaxonomicFilterGroupType[] = []
if (pathsFilter?.includeEventTypes) {
if (pathsFilter.includeEventTypes.includes(PathType.PageView)) {
diff --git a/frontend/src/scenes/persons/mergeSplitPersonLogic.ts b/frontend/src/scenes/persons/mergeSplitPersonLogic.ts
index fefef6fc34bc..6365b0d516a8 100644
--- a/frontend/src/scenes/persons/mergeSplitPersonLogic.ts
+++ b/frontend/src/scenes/persons/mergeSplitPersonLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, key, listeners, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -8,7 +8,8 @@ import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { PersonType } from '~/types'
-import type { mergeSplitPersonLogicType } from './mergeSplitPersonLogicType'
+import type { CountedPaginatedResponse } from '../../lib/api'
+import type { PersonListParams } from '../../types'
import { personsLogic } from './personsLogic'
export interface SplitPersonLogicProps {
@@ -20,6 +21,74 @@ export type PersonUuids = NonNullable<PersonType['uuid']>[]
export type SplitMode = 'all' | 'partial'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface mergeSplitPersonLogicValues {
+ persons: CountedPaginatedResponse<PersonType> & {
+ offset: number
+ } // personsLogic
+ distinctIdsToSplit: string[]
+ executed: boolean
+ executedLoading: boolean
+ person: PersonType
+ selectedPersonToAssignSplit: string | null
+ splitMode: SplitMode
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface mergeSplitPersonLogicActions {
+ loadPersons: (url?: string | null | undefined) => {
+ url: string | null
+ } // personsLogic
+ setListFilters: (payload: PersonListParams) => {
+ payload: PersonListParams
+ } // personsLogic
+ setPerson: (person: PersonType | null) => {
+ person: PersonType | null
+ } // personsLogic
+ setSplitMergeModalShown: (shown: boolean) => {
+ shown: boolean
+ } // personsLogic
+ cancel: () => {
+ value: true
+ }
+ execute: () => any
+ executeFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ executeSuccess: (
+ executed: boolean,
+ payload?: any
+ ) => {
+ executed: boolean
+ payload?: any
+ }
+ setDistinctIdsToSplit: (ids: string[]) => {
+ ids: string[]
+ }
+ setSelectedPersonToAssignSplit: (id: string) => {
+ id: string
+ }
+ setSplitMode: (mode: SplitMode) => {
+ mode: SplitMode
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface mergeSplitPersonLogicMeta {
+ key: string
+}
+
+export type mergeSplitPersonLogicType = MakeLogicType<
+ mergeSplitPersonLogicValues,
+ mergeSplitPersonLogicActions,
+ SplitPersonLogicProps,
+ mergeSplitPersonLogicMeta
+>
+
export const mergeSplitPersonLogic = kea<mergeSplitPersonLogicType>([
props({} as SplitPersonLogicProps),
key((props) => `${props.person.id ?? 'new'}`),
diff --git a/frontend/src/scenes/persons/personDeleteModalLogic.tsx b/frontend/src/scenes/persons/personDeleteModalLogic.tsx
index b2e19f2dbfc0..22a2b694fdc1 100644
--- a/frontend/src/scenes/persons/personDeleteModalLogic.tsx
+++ b/frontend/src/scenes/persons/personDeleteModalLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, kea, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -9,13 +9,72 @@ import { toParams } from 'lib/utils/url'
import { PersonType } from '~/types'
import { asDisplay } from './person-utils'
-import type { personDeleteModalLogicType } from './personDeleteModalLogicType'
export interface PersonDeleteModalLogicProps {
person: PersonType
}
export type PersonDeleteCallback = (person: PersonType, deleteEvents: boolean) => void
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personDeleteModalLogicValues {
+ deleteConfirmationText: string
+ deletedPerson: PersonType | null
+ deletedPersonLoading: boolean
+ personDeleteCallback: PersonDeleteCallback | null
+ personDeleteModal: PersonType | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personDeleteModalLogicActions {
+ deletePerson: (
+ person: PersonType,
+ deleteEvents: boolean,
+ deleteRecordings: boolean
+ ) => {
+ deleteEvents: boolean
+ deleteRecordings: boolean
+ person: PersonType
+ }
+ deletePersonFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deletePersonSuccess: (
+ deletedPerson: PersonType,
+ payload?: {
+ deleteEvents: boolean
+ deleteRecordings: boolean
+ person: PersonType
+ }
+ ) => {
+ deletedPerson: PersonType
+ payload?: {
+ deleteEvents: boolean
+ deleteRecordings: boolean
+ person: PersonType
+ }
+ }
+ setDeleteConfirmationText: (deleteConfirmationText: string) => {
+ deleteConfirmationText: string
+ }
+ showPersonDeleteModal: (
+ person: PersonType | null,
+ callback?: PersonDeleteCallback
+ ) => {
+ callback: PersonDeleteCallback | undefined
+ person: PersonType | null
+ }
+}
+
+export type personDeleteModalLogicType = MakeLogicType<
+ personDeleteModalLogicValues,
+ personDeleteModalLogicActions,
+ PersonDeleteModalLogicProps
+>
+
export const personDeleteModalLogic = kea<personDeleteModalLogicType>([
path(['scenes', 'persons', 'personDeleteModalLogic']),
props({} as PersonDeleteModalLogicProps),
diff --git a/frontend/src/scenes/persons/personEmailsLogic.ts b/frontend/src/scenes/persons/personEmailsLogic.ts
index c188c64cc009..0958fa1e9b80 100644
--- a/frontend/src/scenes/persons/personEmailsLogic.ts
+++ b/frontend/src/scenes/persons/personEmailsLogic.ts
@@ -1,15 +1,50 @@
-import { kea, key, path, props } from 'kea'
+import { MakeLogicType, kea, key, path, props } from 'kea'
import { lazyLoaders } from 'kea-loaders'
import { getPersonMessageAssets, MessageAsset } from 'products/workflows/frontend/Workflows/messageAssetsApi'
-import type { personEmailsLogicType } from './personEmailsLogicType'
-
export interface PersonEmailsLogicProps {
teamId: number
personId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personEmailsLogicValues {
+ emails: MessageAsset[]
+ emailsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personEmailsLogicActions {
+ loadEmails: () => any
+ loadEmailsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadEmailsSuccess: (
+ emails: MessageAsset[],
+ payload?: any
+ ) => {
+ emails: MessageAsset[]
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personEmailsLogicMeta {
+ key: string
+}
+
+export type personEmailsLogicType = MakeLogicType<
+ personEmailsLogicValues,
+ personEmailsLogicActions,
+ PersonEmailsLogicProps,
+ personEmailsLogicMeta
+>
+
export const personEmailsLogic = kea<personEmailsLogicType>([
path(['scenes', 'persons', 'personEmailsLogic']),
props({} as PersonEmailsLogicProps),
diff --git a/frontend/src/scenes/persons/personLogic.tsx b/frontend/src/scenes/persons/personLogic.tsx
index a1e962f85996..cb99f6f7af74 100644
--- a/frontend/src/scenes/persons/personLogic.tsx
+++ b/frontend/src/scenes/persons/personLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, path, props, selectors } from 'kea'
import { lazyLoaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -14,7 +14,6 @@ import { CUSTOMER_ANALYTICS_DEFAULT_QUERY_TAGS } from 'products/customer_analyti
import { revenueAnalyticsLogic } from 'products/revenue_analytics/frontend/revenueAnalyticsLogic'
import { getHogqlQueryStringForPersonId, parsePersonFromHogQLRow } from './person-utils'
-import type { personLogicType } from './personLogicType'
export interface PersonLogicProps {
id: string | undefined
@@ -26,6 +25,95 @@ export interface Info {
eventCount: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personLogicValues {
+ isRevenueAnalyticsEnabled: boolean // revenueAnalyticsLogic
+ breadcrumbs: Breadcrumb[]
+ info: Info | null
+ infoLoading: boolean
+ person: PersonType | null
+ personLoading: boolean
+ revenueData: {
+ lifetimeValue: number | null
+ mrr: number | null
+ } | null
+ revenueDataLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personLogicActions {
+ loadInfo: () => {
+ value: true
+ }
+ loadInfoFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadInfoSuccess: (
+ info: Info | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ info: Info | null
+ payload?: {
+ value: true
+ }
+ }
+ loadPerson: () => {
+ value: true
+ }
+ loadPersonFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPersonSuccess: (
+ person: PersonType | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ person: PersonType | null
+ payload?: {
+ value: true
+ }
+ }
+ loadRevenueData: () => any
+ loadRevenueDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRevenueDataSuccess: (
+ revenueData: {
+ lifetimeValue: any
+ mrr: any
+ } | null,
+ payload?: any
+ ) => {
+ revenueData: {
+ lifetimeValue: any
+ mrr: any
+ } | null
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personLogicMeta {
+ key: string
+}
+
+export type personLogicType = MakeLogicType<personLogicValues, personLogicActions, PersonLogicProps, personLogicMeta>
+
export const personLogic = kea<personLogicType>([
props({} as PersonLogicProps),
key((props) => props.distinctId ?? props.id ?? 'undefined'),
diff --git a/frontend/src/scenes/persons/personsLogic.tsx b/frontend/src/scenes/persons/personsLogic.tsx
index c03b1d97067d..b812f3a5278d 100644
--- a/frontend/src/scenes/persons/personsLogic.tsx
+++ b/frontend/src/scenes/persons/personsLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { decodeParams, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -36,6 +36,8 @@ import {
import { CUSTOMER_ANALYTICS_DEFAULT_QUERY_TAGS } from 'products/customer_analytics/frontend/constants'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
+import type { TeamPublicType, TeamType } from '../../types'
import {
asDisplay,
coercePropertyValue,
@@ -43,7 +45,6 @@ import {
parsePersonFromHogQLRow,
pickBestPersonDistinctId,
} from './person-utils'
-import type { personsLogicType } from './personsLogicType'
export interface PersonsLogicProps {
cohort?: number | 'new'
@@ -104,6 +105,219 @@ function createInitialSurveyResponsesPayload(personId: string): DataTableNode {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personsLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ activeTab: PersonsTabType | null
+ apiDocsURL:
+ | 'https://posthog.com/docs/api/cohorts#get-api-projects-project_id-cohorts-id-persons'
+ | 'https://posthog.com/docs/api/persons'
+ breadcrumbs: Breadcrumb[]
+ cohortId: number | 'new' | undefined
+ cohorts: CohortType[] | null
+ cohortsLoading: boolean
+ currentTab: PersonsTabType
+ defaultTab: PersonsTabType.PROFILE | PersonsTabType.PROPERTIES
+ distinctId: string | null
+ eventsQuery: DataTableNode | null
+ eventsQueryIsDirty: boolean
+ exceptionsQuery: DataTableNode | null
+ exporterProps: TriggerExportProps[]
+ feedEnabled: boolean
+ hiddenListProperties: AnyPropertyFilter[]
+ listFilters: PersonListParams
+ person: PersonType | null
+ personError: string | null
+ personLoading: boolean
+ persons: CountedPaginatedResponse<PersonType> & {
+ offset: number
+ }
+ personsLoading: boolean
+ primaryDistinctId: string | null
+ sidePanelContext: SidePanelSceneContext
+ splitMergeModalShown: boolean
+ surveyResponsesQuery: DataTableNode | null
+ urlId: any
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personsLogicActions {
+ reportPersonDetailViewed: (person: PersonType) => {
+ person: PersonType
+ } // eventUsageLogic
+ deleteProperty: (key: string) => {
+ key: string
+ }
+ editProperty: (
+ key: string,
+ newValue?: boolean | number | string | null
+ ) => {
+ key: string
+ newValue: boolean | number | string | null | undefined
+ }
+ loadCohorts: () => any
+ loadCohortsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadCohortsSuccess: (
+ cohorts: CohortType[] | null,
+ payload?: any
+ ) => {
+ cohorts: CohortType[] | null
+ payload?: any
+ }
+ loadPerson: (id: string) => {
+ id: string
+ }
+ loadPersonFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPersonSuccess: (
+ person: PersonType | null,
+ payload?: {
+ id: string
+ }
+ ) => {
+ person: PersonType | null
+ payload?: {
+ id: string
+ }
+ }
+ loadPersonUUID: (uuid: string) => {
+ uuid: string
+ }
+ loadPersonUUIDFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPersonUUIDSuccess: (
+ person: PersonType | null,
+ payload?: {
+ uuid: string
+ }
+ ) => {
+ person: PersonType | null
+ payload?: {
+ uuid: string
+ }
+ }
+ loadPersons: (url?: string | null) => {
+ url: string | null
+ }
+ loadPersonsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadPersonsSuccess: (
+ persons: CountedPaginatedResponse<PersonType> & {
+ offset: number
+ },
+ payload?: {
+ url: string | null
+ }
+ ) => {
+ persons: CountedPaginatedResponse<PersonType> & {
+ offset: number
+ }
+ payload?: {
+ url: string | null
+ }
+ }
+ navigateToCohort: (cohort: CohortType) => {
+ cohort: CohortType
+ }
+ navigateToTab: (tab: PersonsTabType) => {
+ tab: PersonsTabType
+ }
+ resetEventsQuery: () => {
+ value: true
+ }
+ setActiveTab: (tab: PersonsTabType) => {
+ tab: PersonsTabType
+ }
+ setDistinctId: (distinctId: string) => {
+ distinctId: string
+ }
+ setEventsQuery: (eventsQuery: DataTableNode | null) => {
+ eventsQuery: DataTableNode | null
+ }
+ setExceptionsQuery: (exceptionsQuery: DataTableNode | null) => {
+ exceptionsQuery: DataTableNode | null
+ }
+ setHiddenListProperties: (payload: AnyPropertyFilter[]) => {
+ payload: AnyPropertyFilter[]
+ }
+ setListFilters: (payload: PersonListParams) => {
+ payload: PersonListParams
+ }
+ setPerson: (person: PersonType | null) => {
+ person: PersonType | null
+ }
+ setPersons: (persons: PersonType[]) => {
+ persons: PersonType[]
+ }
+ setSplitMergeModalShown: (shown: boolean) => {
+ shown: boolean
+ }
+ setSurveyResponsesQuery: (surveyResponsesQuery: DataTableNode | null) => {
+ surveyResponsesQuery: DataTableNode | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ apiDocsURL: (
+ arg: any
+ ) =>
+ | 'https://posthog.com/docs/api/cohorts#get-api-projects-project_id-cohorts-id-persons'
+ | 'https://posthog.com/docs/api/persons'
+ cohortId: (arg: any) => number | 'new' | undefined
+ currentTab: (
+ activeTab: PersonsTabType | null,
+ defaultTab: PersonsTabType.PROFILE | PersonsTabType.PROPERTIES
+ ) => PersonsTabType
+ defaultTab: (feedEnabled: boolean) => PersonsTabType.PROFILE | PersonsTabType.PROPERTIES
+ breadcrumbs: (
+ person: PersonType | null,
+ location: {
+ hash: string
+ pathname: string
+ search: string
+ }
+ ) => Breadcrumb[]
+ sidePanelContext: (person: PersonType | null) => SidePanelSceneContext
+ exporterProps: (listFilters: PersonListParams, arg: any) => TriggerExportProps[]
+ urlId: (arg: any) => any
+ feedEnabled: (featureFlags: FeatureFlagsSet) => boolean
+ primaryDistinctId: (person: PersonType | null) => string | null
+ eventsQueryIsDirty: (eventsQuery: DataTableNode | null, person: PersonType | null) => boolean
+ }
+}
+
+export type personsLogicType = MakeLogicType<
+ personsLogicValues,
+ personsLogicActions,
+ PersonsLogicProps,
+ personsLogicMeta
+>
+
export const personsLogic = kea<personsLogicType>([
props({} as PersonsLogicProps),
key((props) => {
@@ -359,14 +573,25 @@ export const personsLogic = kea<personsLogicType>([
: 'https://posthog.com/docs/api/persons',
],
cohortId: [() => [(_, props) => props.cohort], (cohort: PersonsLogicProps['cohort']) => cohort],
- currentTab: [(s) => [s.activeTab, s.defaultTab], (activeTab, defaultTab) => activeTab || defaultTab],
+ currentTab: [
+ (s) => [s.activeTab, s.defaultTab],
+ (activeTab: PersonsTabType | null, defaultTab: PersonsTabType.PROFILE | PersonsTabType.PROPERTIES) =>
+ activeTab || defaultTab,
+ ],
defaultTab: [
(s) => [s.feedEnabled],
- (feedEnabled) => (feedEnabled ? PersonsTabType.PROFILE : PersonsTabType.PROPERTIES),
+ (feedEnabled: boolean) => (feedEnabled ? PersonsTabType.PROFILE : PersonsTabType.PROPERTIES),
],
breadcrumbs: [
(s) => [s.person, router.selectors.location],
- (person, location): Breadcrumb[] => {
+ (
+ person: PersonType | null,
+ location: {
+ hash: string
+ pathname: string
+ search: string
+ }
+ ): Breadcrumb[] => {
const showPerson = person && location.pathname.match(/\/person\/.+/)
const breadcrumbs: Breadcrumb[] = [
{
@@ -389,7 +614,7 @@ export const personsLogic = kea<personsLogicType>([
[SIDE_PANEL_CONTEXT_KEY]: [
(s) => [s.person],
- (person): SidePanelSceneContext => {
+ (person: PersonType | null): SidePanelSceneContext => {
return {
activity_scope: ActivityScope.PERSON,
// TODO: Is this correct? It doesn't seem to work...
@@ -400,7 +625,7 @@ export const personsLogic = kea<personsLogicType>([
exporterProps: [
(s) => [s.listFilters, (_, { cohort }) => cohort],
- (listFilters, cohort: number | 'new' | undefined): TriggerExportProps[] => [
+ (listFilters: PersonListParams, cohort: number | 'new' | undefined): TriggerExportProps[] => [
{
export_format: ExporterFormat.CSV,
export_context: {
@@ -412,14 +637,18 @@ export const personsLogic = kea<personsLogicType>([
],
],
urlId: [() => [(_, props) => props.urlId], (urlId) => urlId],
- feedEnabled: [(s) => [s.featureFlags], (featureFlags) => !!featureFlags[FEATURE_FLAGS.CUSTOMER_ANALYTICS]],
+ feedEnabled: [
+ (s) => [s.featureFlags],
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet) =>
+ !!featureFlags[FEATURE_FLAGS.CUSTOMER_ANALYTICS],
+ ],
primaryDistinctId: [
(s) => [s.person],
- (person): string | null => pickBestPersonDistinctId(person?.distinct_ids) ?? null,
+ (person: PersonType | null): string | null => pickBestPersonDistinctId(person?.distinct_ids) ?? null,
],
eventsQueryIsDirty: [
(s) => [s.eventsQuery, s.person],
- (eventsQuery, person): boolean => {
+ (eventsQuery: DataTableNode | null, person: PersonType | null): boolean => {
if (!eventsQuery || !person?.id) {
return false
}
diff --git a/frontend/src/scenes/persons/personsSceneLogic.ts b/frontend/src/scenes/persons/personsSceneLogic.ts
index 93ce31ea324a..793030197ef6 100644
--- a/frontend/src/scenes/persons/personsSceneLogic.ts
+++ b/frontend/src/scenes/persons/personsSceneLogic.ts
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { urlToAction } from 'kea-router'
import { lemonToast } from '@posthog/lemon-ui'
@@ -15,7 +15,7 @@ import { defaultDataTableColumns } from '~/queries/nodes/DataTable/utils'
import { DataTableNode, NodeKind, ProductKey } from '~/queries/schema/schema-general'
import { Breadcrumb } from '~/types'
-import type { personsSceneLogicType } from './personsSceneLogicType'
+import type { TeamPublicType, TeamType } from '../../types'
export const PEOPLE_LIST_CONTEXT_KEY = 'people-list'
@@ -37,6 +37,48 @@ function buildDefaultQuery(personLastSeenAtEnabled: boolean): DataTableNode {
export const PEOPLE_LIST_DEFAULT_QUERY = buildDefaultQuery(false)
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personsSceneLogicValues {
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ breadcrumbs: Breadcrumb[]
+ defaultColumns: string[]
+ defaultQuery: DataTableNode
+ isBannerLoading: boolean
+ query: DataTableNode
+ showDisplayNameNudge: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personsSceneLogicActions {
+ resetDeletedDistinctId: (distinct_id: string) => {
+ distinct_id: string
+ }
+ setIsBannerLoading: (isBannerLoading: boolean) => {
+ isBannerLoading: boolean
+ }
+ setQuery: (query: DataTableNode) => {
+ query: DataTableNode
+ }
+ setShowDisplayNameNudge: (showDisplayNameNudge: boolean) => {
+ showDisplayNameNudge: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface personsSceneLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ defaultQuery: (currentTeam: TeamPublicType | TeamType | null) => DataTableNode
+ defaultColumns: (defaultQuery: DataTableNode) => string[]
+ }
+}
+
+export type personsSceneLogicType = MakeLogicType<
+ personsSceneLogicValues,
+ personsSceneLogicActions,
+ Record<string, any>,
+ personsSceneLogicMeta
+>
+
export const personsSceneLogic = kea<personsSceneLogicType>([
path(['scenes', 'persons', 'personsSceneLogic']),
@@ -83,10 +125,13 @@ export const personsSceneLogic = kea<personsSceneLogicType>([
selectors({
defaultQuery: [
(s) => [s.currentTeam],
- (currentTeam): DataTableNode =>
+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): DataTableNode =>
buildDefaultQuery(currentTeam?.extra_settings?.person_last_seen_at_enabled === true),
],
- defaultColumns: [(s) => [s.defaultQuery], (defaultQuery): string[] => defaultQuery.defaultColumns ?? []],
+ defaultColumns: [
+ (s) => [s.defaultQuery],
+ (defaultQuery: DataTableNode): string[] => defaultQuery.defaultColumns ?? [],
+ ],
breadcrumbs: [
() => [],
(): Breadcrumb[] => [
diff --git a/frontend/src/scenes/persons/relatedFeatureFlagsLogic.ts b/frontend/src/scenes/persons/relatedFeatureFlagsLogic.ts
index fb3e01b7bb7a..12845c1904eb 100644
--- a/frontend/src/scenes/persons/relatedFeatureFlagsLogic.ts
+++ b/frontend/src/scenes/persons/relatedFeatureFlagsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { urlToAction } from 'kea-router'
@@ -10,8 +10,9 @@ import { urls } from 'scenes/urls'
import { FeatureFlagReleaseType, FeatureFlagType } from '~/types'
+import type { PaginationManual } from '../../../@posthog/lemon-ui/src/index'
+import type { FeatureFlagsResult } from '../feature-flags/featureFlagsLogic'
import { FeatureFlagMatchReason } from './RelatedFeatureFlags'
-import type { relatedFeatureFlagsLogicType } from './relatedFeatureFlagsLogicType'
export interface RelatedFeatureFlag extends FeatureFlagType {
value: boolean | string
@@ -36,6 +37,96 @@ export interface RelatedFlagsFilters {
reason?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedFeatureFlagsLogicValues {
+ featureFlags: FeatureFlagsResult // featureFlagsLogic
+ featureFlagsLoading: boolean // featureFlagsLogic
+ pagination: PaginationManual // featureFlagsLogic
+ currentProjectId: number | null // projectLogic
+ filteredMappedFlags: RelatedFeatureFlag[]
+ filters: Partial<RelatedFlagsFilters>
+ isLoading: boolean
+ mappedRelatedFeatureFlags: RelatedFeatureFlag[]
+ relatedFeatureFlags: RelatedFeatureFlagResponse | null
+ relatedFeatureFlagsLoading: boolean
+ searchTerm: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedFeatureFlagsLogicActions {
+ loadFeatureFlags: () => any // featureFlagsLogic
+ setFeatureFlagsFilters: (
+ filters: Partial<FeatureFlagsFilters>,
+ replace?: boolean
+ ) => {
+ filters: Partial<FeatureFlagsFilters>
+ replace: boolean | undefined
+ } // featureFlagsLogic
+ loadRelatedFeatureFlags: () => {
+ value: true
+ }
+ loadRelatedFeatureFlagsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRelatedFeatureFlagsSuccess: (
+ relatedFeatureFlags: RelatedFeatureFlagResponse | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ relatedFeatureFlags: RelatedFeatureFlagResponse | null
+ payload?: {
+ value: true
+ }
+ }
+ setFilters: (
+ filters: Partial<RelatedFlagsFilters>,
+ replace?: boolean
+ ) => {
+ filters: Partial<RelatedFlagsFilters>
+ replace: boolean | undefined
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedFeatureFlagsLogicProps {
+ distinctId: string | null
+ groups?: {
+ [key: string]: string
+ }
+ groupTypeIndex?: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface relatedFeatureFlagsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isLoading: (relatedFeatureFlagsLoading: boolean, featureFlagsLoading: boolean) => boolean
+ mappedRelatedFeatureFlags: (
+ relatedFeatureFlags: RelatedFeatureFlagResponse | null,
+ featureFlags: FeatureFlagsResult
+ ) => RelatedFeatureFlag[]
+ filteredMappedFlags: (
+ mappedRelatedFeatureFlags: RelatedFeatureFlag[],
+ filters: Partial<RelatedFlagsFilters>
+ ) => RelatedFeatureFlag[]
+ }
+}
+
+export type relatedFeatureFlagsLogicType = MakeLogicType<
+ relatedFeatureFlagsLogicValues,
+ relatedFeatureFlagsLogicActions,
+ relatedFeatureFlagsLogicProps,
+ relatedFeatureFlagsLogicMeta
+>
+
export const relatedFeatureFlagsLogic = kea<relatedFeatureFlagsLogicType>([
path(['scenes', 'persons', 'relatedFeatureFlagsLogic']),
props(
@@ -108,7 +199,10 @@ export const relatedFeatureFlagsLogic = kea<relatedFeatureFlagsLogicType>([
],
mappedRelatedFeatureFlags: [
(selectors) => [selectors.relatedFeatureFlags, selectors.featureFlags],
- (relatedFlags, featureFlags): RelatedFeatureFlag[] => {
+ (
+ relatedFlags: RelatedFeatureFlagResponse | null,
+ featureFlags: import('scenes/feature-flags/featureFlagsLogic').FeatureFlagsResult
+ ): RelatedFeatureFlag[] => {
if (relatedFlags && featureFlags) {
let flags = featureFlags.results
.map((flag) => ({ ...relatedFlags[flag.key], ...flag }))
@@ -132,7 +226,7 @@ export const relatedFeatureFlagsLogic = kea<relatedFeatureFlagsLogicType>([
],
filteredMappedFlags: [
(selectors) => [selectors.mappedRelatedFeatureFlags, selectors.filters],
- (featureFlags, filters: Partial<RelatedFlagsFilters>) => {
+ (featureFlags: RelatedFeatureFlag[], filters: Partial<RelatedFlagsFilters>) => {
if (Object.keys(filters).length === 0) {
return featureFlags
}
diff --git a/frontend/src/scenes/product-tours/productTourLogic.ts b/frontend/src/scenes/product-tours/productTourLogic.ts
index 85603ead67d8..c8f50dc88065 100644
--- a/frontend/src/scenes/product-tours/productTourLogic.ts
+++ b/frontend/src/scenes/product-tours/productTourLogic.ts
@@ -1,6 +1,7 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { subscriptions } from 'kea-subscriptions'
@@ -31,7 +32,6 @@ import {
import { DEFAULT_APPEARANCE } from './constants'
import { prepareStepsForRender } from './editor/generateStepHtml'
-import type { productTourLogicType } from './productTourLogicType'
import { isAnnouncement, productToursLogic } from './productToursLogic'
import { getUpdatedStepOrderHistory, hasIncompleteTargeting, resolveStepTranslation } from './stepUtils'
@@ -170,6 +170,225 @@ function buildDraftPayload(formValues: ProductTourForm): Record<string, any> {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productTourLogicValues {
+ _selectedLanguage: string | null
+ breadcrumbs: Breadcrumb[]
+ dateRange: DateRange | null
+ draftActionInProgress: 'discard' | 'publish' | null
+ draftSaveStatus: 'saved' | 'saving' | 'unsaved' | null
+ editTab: ProductTourEditTab
+ entityKeyword: string
+ hasCustomTargeting: boolean
+ hasDraft: boolean
+ isEditingProductTour: boolean
+ isEditingTranslation: boolean
+ isProductTourFormSubmitting: boolean
+ isProductTourFormValid: boolean
+ isToolbarModalOpen: boolean
+ launchValidationIssues: LaunchValidationIssue[]
+ productTour: ProductTour | null
+ productTourForm: ProductTourForm
+ productTourFormAllErrors: Record<string, any>
+ productTourFormChanged: boolean
+ productTourFormErrors: DeepPartialMap<ProductTourForm, ValidationErrorType>
+ productTourFormHasErrors: boolean
+ productTourFormManualErrors: Record<string, any>
+ productTourFormTouched: boolean
+ productTourFormTouches: Record<string, boolean>
+ productTourFormValidationErrors: DeepPartialMap<ProductTourForm, ValidationErrorType>
+ productTourLoading: boolean
+ productTourMissing: boolean
+ selectedLanguage: string | null
+ selectedStep: ProductTourStep | null
+ selectedStepIndex: number
+ showProductTourFormErrors: boolean
+ targetingFlagFilters: FeatureFlagFilters | undefined
+ toolbarMode: 'edit' | 'preview'
+ tourStats: ProductTourStats | null
+ tourStatsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productTourLogicActions {
+ reportProductTourViewed: (tour: ProductTour) => {
+ tour: ProductTour
+ } // eventUsageLogic
+ loadProductTours: () => any // productToursLogic
+ closeToolbarModal: () => {
+ value: true
+ }
+ discardDraft: () => {
+ value: true
+ }
+ draftAutoSave: () => {
+ value: true
+ }
+ editingProductTour: (editing: boolean) => {
+ editing: boolean
+ }
+ handleToolbarTabVisibility: () => {
+ value: true
+ }
+ launchProductTour: () => {
+ value: true
+ }
+ loadProductTour: () => any
+ loadProductTourFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadProductTourSuccess: (
+ productTour: ProductTour | null,
+ payload?: any
+ ) => {
+ productTour: ProductTour | null
+ payload?: any
+ }
+ loadTourStats: () => any
+ loadTourStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTourStatsSuccess: (
+ tourStats: {
+ stepStats: {
+ stepOrder: number
+ totalCompleted: number
+ totalShown: number
+ uniqueCompleted: number
+ uniqueShown: number
+ }[]
+ totalCompleted: number
+ totalDismissed: number
+ totalShown: number
+ uniqueCompleted: number
+ uniqueDismissed: number
+ uniqueShown: number
+ } | null,
+ payload?: any
+ ) => {
+ tourStats: {
+ stepStats: {
+ stepOrder: number
+ totalCompleted: number
+ totalShown: number
+ uniqueCompleted: number
+ uniqueShown: number
+ }[]
+ totalCompleted: number
+ totalDismissed: number
+ totalShown: number
+ uniqueCompleted: number
+ uniqueDismissed: number
+ uniqueShown: number
+ } | null
+ payload?: any
+ }
+ openToolbarModal: (toolbarMode?: 'edit' | 'preview') => {
+ toolbarMode: 'edit' | 'preview'
+ }
+ removeLanguage: (langCode: string) => {
+ langCode: string
+ }
+ resetProductTourForm: (values?: ProductTourForm) => {
+ values?: ProductTourForm
+ }
+ resumeProductTour: () => {
+ value: true
+ }
+ setDateRange: (dateRange: DateRange) => {
+ dateRange: DateRange
+ }
+ setDraftActionInProgress: (action: 'discard' | 'publish' | null) => {
+ action: 'discard' | 'publish' | null
+ }
+ setDraftSaveStatus: (status: 'saved' | 'saving' | 'unsaved' | null) => {
+ status: 'saved' | 'saving' | 'unsaved' | null
+ }
+ setEditTab: (tab: ProductTourEditTab) => {
+ tab: ProductTourEditTab
+ }
+ setProductTourFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setProductTourFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setProductTourFormValues: (values: DeepPartial<ProductTourForm>) => {
+ values: DeepPartial<ProductTourForm>
+ }
+ setSelectedLanguage: (langCode: string) => {
+ langCode: string
+ }
+ setSelectedStepIndex: (index: number) => {
+ index: number
+ }
+ stopProductTour: () => {
+ value: true
+ }
+ submitProductTourForm: () => {
+ value: boolean
+ }
+ submitProductTourFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitProductTourFormRequest: (productTourForm: ProductTourForm) => {
+ productTourForm: ProductTourForm
+ }
+ submitProductTourFormSuccess: (productTourForm: ProductTourForm) => {
+ productTourForm: ProductTourForm
+ }
+ touchProductTourFormField: (key: string) => {
+ key: string
+ }
+ updateSelectedStep: (updates: Partial<ProductTourStep>) => {
+ updates: Partial<ProductTourStep>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productTourLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ breadcrumbs: (productTour: ProductTour | null) => Breadcrumb[]
+ targetingFlagFilters: (productTourForm: ProductTourForm) => FeatureFlagFilters | undefined
+ hasCustomTargeting: (targetingFlagFilters: FeatureFlagFilters | undefined) => boolean
+ selectedLanguage: (_selectedLanguage: string | null, productTourForm: ProductTourForm) => string | null
+ isEditingTranslation: (selectedLanguage: string | null, productTourForm: ProductTourForm) => boolean
+ selectedStep: (
+ productTourForm: ProductTourForm,
+ selectedStepIndex: number,
+ selectedLanguage: string | null,
+ isEditingTranslation: boolean
+ ) => ProductTourStep | null
+ entityKeyword: (productTour: ProductTour | null) => string
+ hasDraft: (productTour: ProductTour | null) => boolean
+ launchValidationIssues: (productTour: ProductTour | null) => LaunchValidationIssue[]
+ }
+}
+
+export type productTourLogicType = MakeLogicType<
+ productTourLogicValues,
+ productTourLogicActions,
+ ProductTourLogicProps,
+ productTourLogicMeta
+>
+
export const productTourLogic = kea<productTourLogicType>([
path(['scenes', 'product-tours', 'productTourLogic']),
props({} as ProductTourLogicProps),
diff --git a/frontend/src/scenes/product-tours/productToursLogic.ts b/frontend/src/scenes/product-tours/productToursLogic.ts
index f5caf015ff67..05d285eaa57e 100644
--- a/frontend/src/scenes/product-tours/productToursLogic.ts
+++ b/frontend/src/scenes/product-tours/productToursLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
@@ -27,7 +27,6 @@ import {
SurveyPosition,
} from '~/types'
-import type { productToursLogicType } from './productToursLogicType'
import { getExplainerStepContent } from './stepUtils'
export const BUTTON_ACTION_OPTIONS: { value: ProductTourButtonAction; label: string }[] = [
@@ -247,6 +246,134 @@ export interface ProductToursFilters {
archived: boolean
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productToursLogicValues {
+ breadcrumbs: Breadcrumb[]
+ duplicatedProductTour: ProductTour | null
+ duplicatedProductTourLoading: boolean
+ filteredProductTours: ProductTour[]
+ filters: ProductToursFilters
+ productTours: ProductTour[]
+ productToursLoading: boolean
+ searchTerm: string
+ tab: ProductToursTabs
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productToursLogicActions {
+ reportProductTourCreated: (
+ tour: ProductTour,
+ creationSource?: 'app' | 'toolbar' | undefined
+ ) => {
+ creationSource: 'app' | 'toolbar' | undefined
+ tour: ProductTour
+ } // eventUsageLogic
+ reportProductTourListViewed: () => {
+ value: true
+ } // eventUsageLogic
+ createAnnouncement: (name: string) => {
+ name: string
+ }
+ createBanner: (name: string) => {
+ name: string
+ }
+ createTour: (name: string) => {
+ name: string
+ }
+ deleteProductTour: (id: string) => string
+ deleteProductTourFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteProductTourSuccess: (
+ productTours: ProductTour[],
+ payload?: string
+ ) => {
+ productTours: ProductTour[]
+ payload?: string
+ }
+ duplicateProductTour: (tour: ProductTour) => ProductTour
+ duplicateProductTourFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ duplicateProductTourSuccess: (
+ duplicatedProductTour: ProductTour | null,
+ payload?: ProductTour
+ ) => {
+ duplicatedProductTour: ProductTour | null
+ payload?: ProductTour
+ }
+ loadProductTours: () => any
+ loadProductToursFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadProductToursSuccess: (
+ productTours: ProductTour[],
+ payload?: any
+ ) => {
+ productTours: ProductTour[]
+ payload?: any
+ }
+ setFilters: (filters: Partial<ProductToursFilters>) => {
+ filters: Partial<ProductToursFilters>
+ }
+ setSearchTerm: (searchTerm: string) => {
+ searchTerm: string
+ }
+ setTab: (tab: ProductToursTabs) => {
+ tab: ProductToursTabs
+ }
+ updateProductTour: ({ id, updatePayload }: { id: string; updatePayload: Partial<ProductTour> }) => {
+ id: string
+ updatePayload: Partial<ProductTour>
+ }
+ updateProductTourFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateProductTourSuccess: (
+ productTours: ProductTour[],
+ payload?: {
+ id: string
+ updatePayload: Partial<ProductTour>
+ }
+ ) => {
+ productTours: ProductTour[]
+ payload?: {
+ id: string
+ updatePayload: Partial<ProductTour>
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface productToursLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filteredProductTours: (productTours: ProductTour[], filters: ProductToursFilters) => ProductTour[]
+ }
+}
+
+export type productToursLogicType = MakeLogicType<
+ productToursLogicValues,
+ productToursLogicActions,
+ Record<string, any>,
+ productToursLogicMeta
+>
+
export const productToursLogic = kea<productToursLogicType>([
path(['scenes', 'product-tours', 'productToursLogic']),
connect(() => ({
diff --git a/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts b/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts
index f8ce734c1b82..879a45617748 100644
--- a/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts
+++ b/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -18,7 +18,9 @@ import { userLogic } from 'scenes/userLogic'
import { getQueryBasedInsightModel } from '~/queries/nodes/InsightViz/utils'
import type { QueryBasedInsightModel } from '~/types'
-import type { addSavedInsightsModalLogicType } from './addSavedInsightsModalLogicType'
+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'
+import type { Node } from '../../queries/schema/schema-general'
+import type { UserType } from '../../types'
import { SavedInsightFilters, cleanFilters } from './savedInsightsLogic'
interface InsightListParams {
@@ -38,6 +40,138 @@ interface InsightListParams {
export const INSIGHTS_PER_PAGE = 15
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface addSavedInsightsModalLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ currentTeamId: number | null // teamLogic
+ user: UserType | null // userLogic
+ count: number
+ dashboardUpdatesInProgress: Record<number, boolean>
+ filters: SavedInsightFilters
+ hasFilteredUI: boolean
+ hasLoadedInsights: boolean
+ hasSmartDefaults: boolean
+ insights: {
+ count: number
+ results: QueryBasedInsightModel<Node<Record<string, any>>>[]
+ }
+ insightsLoading: boolean
+ insightsPerPage: number
+ modalPage: number
+ rawModalFilters: Partial<SavedInsightFilters> | null
+ sorting: Sorting | null
+ userInsights: {
+ count: number
+ }
+ userInsightsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface addSavedInsightsModalLogicActions {
+ addInsightToDashboard: (
+ insight: QueryBasedInsightModel,
+ dashboardId: number
+ ) => {
+ dashboardId: number
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ dashboardUpdateFailed: (insightId: number) => {
+ insightId: number
+ }
+ loadInsights: () => {
+ value: true
+ }
+ loadInsightsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadInsightsSuccess: (
+ insights: {
+ count: number
+ results: QueryBasedInsightModel<Node<Record<string, any>>>[]
+ },
+ payload?: {
+ value: true
+ }
+ ) => {
+ insights: {
+ count: number
+ results: QueryBasedInsightModel<Node<Record<string, any>>>[]
+ }
+ payload?: {
+ value: true
+ }
+ }
+ loadUserInsights: () => any
+ loadUserInsightsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadUserInsightsSuccess: (
+ userInsights: {
+ count: any
+ },
+ payload?: any
+ ) => {
+ userInsights: {
+ count: any
+ }
+ payload?: any
+ }
+ removeInsightFromDashboard: (
+ insight: QueryBasedInsightModel,
+ dashboardId: number
+ ) => {
+ dashboardId: number
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ setDashboardUpdateLoading: (
+ insightId: number,
+ loading: boolean
+ ) => {
+ insightId: number
+ loading: boolean
+ }
+ setModalFilters: (
+ filters: Partial<SavedInsightFilters>,
+ merge?: boolean
+ ) => {
+ filters: Partial<SavedInsightFilters>
+ merge: boolean
+ }
+ setModalPage: (page: number) => {
+ page: number
+ }
+ updateInsight: (insight: QueryBasedInsightModel) => {
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface addSavedInsightsModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filters: (rawModalFilters: Partial<SavedInsightFilters> | null) => SavedInsightFilters
+ hasFilteredUI: (featureFlags: FeatureFlagsSet) => boolean
+ hasSmartDefaults: (featureFlags: FeatureFlagsSet) => boolean
+ count: (insights: { count: number; results: QueryBasedInsightModel<Node<Record<string, any>>>[] }) => number
+ sorting: (filters: SavedInsightFilters) => Sorting | null
+ modalPage: (filters: SavedInsightFilters) => number
+ }
+}
+
+export type addSavedInsightsModalLogicType = MakeLogicType<
+ addSavedInsightsModalLogicValues,
+ addSavedInsightsModalLogicActions,
+ Record<string, any>,
+ addSavedInsightsModalLogicMeta
+>
+
export const addSavedInsightsModalLogic = kea<addSavedInsightsModalLogicType>([
path(['scenes', 'saved-insights', 'addSavedInsightsModalLogic']),
connect(() => ({
@@ -165,32 +299,39 @@ export const addSavedInsightsModalLogic = kea<addSavedInsightsModalLogicType>([
selectors({
filters: [
(s) => [s.rawModalFilters],
- (rawModalFilters): SavedInsightFilters => cleanFilters(rawModalFilters || {}),
+ (rawModalFilters: Partial<SavedInsightFilters> | null): SavedInsightFilters =>
+ cleanFilters(rawModalFilters || {}),
],
hasFilteredUI: [
(s) => [s.featureFlags],
- (featureFlags): boolean => {
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean => {
const variant = featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_DASHBOARD_MODAL_SMART_DEFAULTS]
return variant === 'filtered' || variant === 'smart-filtered'
},
],
hasSmartDefaults: [
(s) => [s.featureFlags],
- (featureFlags): boolean =>
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>
featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_DASHBOARD_MODAL_SMART_DEFAULTS] === 'smart-filtered',
],
insightsPerPage: [() => [], (): number => INSIGHTS_PER_PAGE],
- count: [(s) => [s.insights], (insights) => insights.count],
+ count: [
+ (s) => [s.insights],
+ (insights: {
+ count: number
+ results: QueryBasedInsightModel<import('../../queries/schema').Node<Record<string, any>>>[]
+ }) => insights.count,
+ ],
sorting: [
(s) => [s.filters],
- (filters): Sorting | null =>
+ (filters: SavedInsightFilters): Sorting | null =>
filters.order
? filters.order.startsWith('-')
? { columnKey: filters.order.slice(1), order: -1 }
: { columnKey: filters.order, order: 1 }
: null,
],
- modalPage: [(s) => [s.filters], (filters) => filters.page],
+ modalPage: [(s) => [s.filters], (filters: SavedInsightFilters) => filters.page],
}),
listeners(({ actions, values, selectors }) => ({
setModalPage: async ({ page }) => {
diff --git a/frontend/src/scenes/saved-insights/insightDashboardModalLogic.ts b/frontend/src/scenes/saved-insights/insightDashboardModalLogic.ts
index 4cfb04b0c5d4..f58761861654 100644
--- a/frontend/src/scenes/saved-insights/insightDashboardModalLogic.ts
+++ b/frontend/src/scenes/saved-insights/insightDashboardModalLogic.ts
@@ -1,12 +1,103 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import type { QueryBasedInsightModel } from '~/types'
+import type { Node } from '../../queries/schema/schema-general'
import { addSavedInsightsModalLogic } from './addSavedInsightsModalLogic'
-import type { insightDashboardModalLogicType } from './insightDashboardModalLogicType'
export type OptimisticDashboardState = Record<number, boolean>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface insightDashboardModalLogicValues {
+ dashboardUpdatesInProgress: Record<number, boolean> // addSavedInsightsModalLogic
+ isInsightInDashboard: (
+ insight: QueryBasedInsightModel,
+ dashboardTiles?: {
+ insight?: {
+ id: number
+ } | null
+ }[]
+ ) => boolean
+ optimisticDashboardState: OptimisticDashboardState
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface insightDashboardModalLogicActions {
+ addInsightToDashboard: (
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>,
+ dashboardId: number
+ ) => {
+ dashboardId: number
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ } // addSavedInsightsModalLogic
+ dashboardUpdateFailed: (insightId: number) => {
+ insightId: number
+ } // addSavedInsightsModalLogic
+ removeInsightFromDashboard: (
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>,
+ dashboardId: number
+ ) => {
+ dashboardId: number
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ } // addSavedInsightsModalLogic
+ clearOptimisticDashboardState: (insightId: number) => {
+ insightId: number
+ }
+ setOptimisticDashboardState: (
+ insightId: number,
+ inDashboard: boolean
+ ) => {
+ inDashboard: boolean
+ insightId: number
+ }
+ syncOptimisticStateWithDashboard: (
+ tiles: {
+ insight?: {
+ id: number
+ } | null
+ }[]
+ ) => {
+ tiles: {
+ insight?:
+ | {
+ id: number
+ }
+ | null
+ | undefined
+ }[]
+ }
+ toggleInsightOnDashboard: (
+ insight: QueryBasedInsightModel,
+ dashboardId: number,
+ currentlyInDashboard: boolean
+ ) => {
+ currentlyInDashboard: boolean
+ dashboardId: number
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface insightDashboardModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isInsightInDashboard: (optimisticDashboardState: OptimisticDashboardState) => (
+ insight: QueryBasedInsightModel,
+ dashboardTiles?: {
+ insight?: {
+ id: number
+ } | null
+ }[]
+ ) => boolean
+ }
+}
+
+export type insightDashboardModalLogicType = MakeLogicType<
+ insightDashboardModalLogicValues,
+ insightDashboardModalLogicActions,
+ Record<string, any>,
+ insightDashboardModalLogicMeta
+>
+
export const insightDashboardModalLogic = kea<insightDashboardModalLogicType>([
path(['scenes', 'saved-insights', 'insightDashboardModalLogic']),
connect({
diff --git a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
index 3e02373abedd..456649154a1b 100644
--- a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
+++ b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
@@ -1,9 +1,9 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router, urlToAction } from 'kea-router'
import api, { CountedPaginatedResponse } from 'lib/api'
-import { dayjs } from 'lib/dayjs'
+import { dayjs, type Dayjs } from 'lib/dayjs'
import { Sorting } from 'lib/lemon-ui/LemonTable'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { PaginationManual } from 'lib/lemon-ui/PaginationControl'
@@ -30,8 +30,10 @@ import {
InsightBulkRestoreResponseApi,
} from 'products/product_analytics/frontend/generated/api.schemas'
+import type { Node } from '../../queries/schema/schema-general'
+import type { DeleteDashboardForm } from '../dashboard/deleteDashboardLogic'
+import type { DuplicateDashboardForm } from '../dashboard/duplicateDashboardLogic'
import { teamLogic } from '../teamLogic'
-import type { savedInsightsLogicType } from './savedInsightsLogicType'
export const INSIGHTS_PER_PAGE = 30
@@ -88,6 +90,268 @@ export function cleanFilters(values: Partial<SavedInsightFilters>): SavedInsight
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface savedInsightsLogicValues {
+ activeSceneId: string | null // sceneLogic
+ currentTeamId: number | null // teamLogic
+ alertModalId: AlertType['id'] | null
+ breadcrumbs: Breadcrumb[]
+ bulkDeleteResponse: InsightBulkDeleteResponseApi | null
+ bulkDeleteResponseLoading: boolean
+ bulkRestoreResponse: InsightBulkRestoreResponseApi | null
+ bulkRestoreResponseLoading: boolean
+ count: number
+ dashboardUpdatesInProgress: Record<number, boolean>
+ filters: SavedInsightFilters
+ insights: InsightsResult
+ insightsLoading: boolean
+ pagination: PaginationManual
+ paramsFromFilters: {
+ created_by?: string | undefined
+ created_date_from?: string | Dayjs | undefined
+ created_date_to?: string | Dayjs | null | undefined
+ dashboards?: number[] | undefined
+ date_from?: string | Dayjs | undefined
+ date_to?: string | Dayjs | null | undefined
+ favorited?: true | undefined
+ hide_feature_flag_insights?: true | undefined
+ insight?: string | undefined
+ last_viewed_date_from?: string | Dayjs | undefined
+ last_viewed_date_to?: string | Dayjs | null | undefined
+ limit: number
+ offset: number
+ order: string
+ saved: true
+ search?: string | undefined
+ tags?: string | undefined
+ user?: true | undefined
+ }
+ rawFilters: Partial<SavedInsightFilters> | null
+ sidePanelContext: SidePanelSceneContext
+ sorting: Sorting | null
+ usingFilters: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface savedInsightsLogicActions {
+ addInsight: (insight: QueryBasedInsightModel) => {
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ bulkDeleteInsights: ({ ids }: { ids: number[] }) => {
+ ids: number[]
+ }
+ bulkDeleteInsightsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ bulkDeleteInsightsSuccess: (
+ bulkDeleteResponse: InsightBulkDeleteResponseApi,
+ payload?: {
+ ids: number[]
+ }
+ ) => {
+ bulkDeleteResponse: InsightBulkDeleteResponseApi
+ payload?: {
+ ids: number[]
+ }
+ }
+ bulkRestoreInsights: ({ ids }: { ids: number[] }) => {
+ ids: number[]
+ }
+ bulkRestoreInsightsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ bulkRestoreInsightsSuccess: (
+ bulkRestoreResponse: InsightBulkRestoreResponseApi,
+ payload?: {
+ ids: number[]
+ }
+ ) => {
+ bulkRestoreResponse: InsightBulkRestoreResponseApi
+ payload?: {
+ ids: number[]
+ }
+ }
+ closeAlertModal: () => {
+ value: true
+ }
+ duplicateInsight: (
+ insight: QueryBasedInsightModel,
+ redirectToInsight?: any
+ ) => {
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ redirectToInsight: any
+ }
+ loadInsights: (debounce?: boolean) => {
+ debounce: boolean
+ }
+ loadInsightsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadInsightsSuccess: (
+ insights: InsightsResult,
+ payload?: {
+ debounce: boolean
+ }
+ ) => {
+ insights: InsightsResult
+ payload?: {
+ debounce: boolean
+ }
+ }
+ openAlertModal: (alertId: AlertType['id']) => {
+ alertId: string
+ }
+ renameInsight: (insight: QueryBasedInsightModel) => {
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ setDashboardUpdateLoading: (
+ insightId: number,
+ loading: boolean
+ ) => {
+ insightId: number
+ loading: boolean
+ }
+ setSavedInsightsFilters: (
+ filters: Partial<SavedInsightFilters>,
+ merge?: boolean,
+ debounce?: boolean
+ ) => {
+ debounce: boolean
+ filters: Partial<SavedInsightFilters>
+ merge: boolean
+ }
+ updateFavoritedInsight: (
+ insight: QueryBasedInsightModel,
+ favorited: boolean
+ ) => {
+ favorited: boolean
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ updateFavoritedInsightFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateFavoritedInsightSuccess: (
+ insights: {
+ count: number
+ filters?: SavedInsightFilters | null | undefined
+ next?: string | null | undefined
+ offset: number
+ previous?: string | null | undefined
+ results: QueryBasedInsightModel<Node<Record<string, any>>>[]
+ },
+ payload?: {
+ favorited: boolean
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ ) => {
+ insights: {
+ count: number
+ filters?: SavedInsightFilters | null | undefined
+ next?: string | null | undefined
+ offset: number
+ previous?: string | null | undefined
+ results: QueryBasedInsightModel<Node<Record<string, any>>>[]
+ }
+ payload?: {
+ favorited: boolean
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ }
+ updateInsight: (insight: QueryBasedInsightModel) => {
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface savedInsightsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ filters: (rawFilters: Partial<SavedInsightFilters> | null) => SavedInsightFilters
+ count: (insights: InsightsResult) => number
+ usingFilters: (filters: SavedInsightFilters) => boolean
+ sorting: (filters: SavedInsightFilters) => Sorting | null
+ paramsFromFilters: (filters: SavedInsightFilters) => {
+ created_by?: string | undefined
+ created_date_from?: string | Dayjs | undefined
+ created_date_to?: string | Dayjs | null | undefined
+ dashboards?: number[] | undefined
+ date_from?: string | Dayjs | undefined
+ date_to?: string | Dayjs | null | undefined
+ favorited?: true | undefined
+ hide_feature_flag_insights?: true | undefined
+ insight?: string | undefined
+ last_viewed_date_from?: string | Dayjs | undefined
+ last_viewed_date_to?: string | Dayjs | null | undefined
+ limit: number
+ offset: number
+ order: string
+ saved: true
+ search?: string | undefined
+ tags?: string | undefined
+ user?: true | undefined
+ }
+ pagination: (filters: SavedInsightFilters, count: number) => PaginationManual
+ }
+ __keaTypeGenInternalReducerActions: {
+ 'rename insight success (models.insightsModel)': (item: QueryBasedInsightModel) => {
+ payload: {
+ item: QueryBasedInsightModel<Node<Record<string, any>>>
+ }
+ type: 'rename insight success (models.insightsModel)'
+ }
+ 'update dashboard insight (models.dashboardsModel)': (
+ insight: QueryBasedInsightModel,
+ extraDashboardIds?: number[],
+ sourceDashboardId?: number
+ ) => {
+ payload: {
+ extraDashboardIds: number[] | undefined
+ insight: QueryBasedInsightModel<Node<Record<string, any>>>
+ sourceDashboardId: number | undefined
+ }
+ type: 'update dashboard insight (models.dashboardsModel)'
+ }
+ 'submit delete dashboard success (scenes.dashboard.deleteDashboardLogic)': (
+ deleteDashboard: DeleteDashboardForm
+ ) => {
+ payload: {
+ deleteDashboard: DeleteDashboardForm
+ }
+ type: 'submit delete dashboard success (scenes.dashboard.deleteDashboardLogic)'
+ }
+ 'submit duplicate dashboard success (scenes.dashboard.duplicateDashboardLogic)': (
+ duplicateDashboard: DuplicateDashboardForm
+ ) => {
+ payload: {
+ duplicateDashboard: DuplicateDashboardForm
+ }
+ type: 'submit duplicate dashboard success (scenes.dashboard.duplicateDashboardLogic)'
+ }
+ }
+}
+
+export type savedInsightsLogicType = MakeLogicType<
+ savedInsightsLogicValues,
+ savedInsightsLogicActions,
+ Record<string, any>,
+ savedInsightsLogicMeta
+>
+
export const savedInsightsLogic = kea<savedInsightsLogicType>([
path(['scenes', 'saved-insights', 'savedInsightsLogic']),
connect(() => ({
@@ -242,15 +506,19 @@ export const savedInsightsLogic = kea<savedInsightsLogicType>([
],
}),
selectors({
- filters: [(s) => [s.rawFilters], (rawFilters): SavedInsightFilters => cleanFilters(rawFilters || {})],
- count: [(s) => [s.insights], (insights) => insights.count],
+ filters: [
+ (s) => [s.rawFilters],
+ (rawFilters: Partial<SavedInsightFilters> | null): SavedInsightFilters => cleanFilters(rawFilters || {}),
+ ],
+ count: [(s) => [s.insights], (insights: InsightsResult) => insights.count],
usingFilters: [
(s) => [s.filters],
- (filters) => !objectsEqual(cleanFilters({ ...filters, tab: SavedInsightsTabs.All }), cleanFilters({})),
+ (filters: SavedInsightFilters) =>
+ !objectsEqual(cleanFilters({ ...filters, tab: SavedInsightsTabs.All }), cleanFilters({})),
],
sorting: [
(s) => [s.filters],
- (filters): Sorting | null => {
+ (filters: SavedInsightFilters): Sorting | null => {
if (!filters.order) {
// Sync with `cleanFilters` function
return {
@@ -271,7 +539,7 @@ export const savedInsightsLogic = kea<savedInsightsLogicType>([
],
paramsFromFilters: [
(s) => [s.filters],
- (filters) => ({
+ (filters: SavedInsightFilters) => ({
order: filters.order,
limit: INSIGHTS_PER_PAGE,
offset: Math.max(0, (filters.page - 1) * INSIGHTS_PER_PAGE),
@@ -310,7 +578,7 @@ export const savedInsightsLogic = kea<savedInsightsLogicType>([
],
pagination: [
(s) => [s.filters, s.count],
- (filters, count): PaginationManual => {
+ (filters: SavedInsightFilters, count: number): PaginationManual => {
return {
controlled: true,
pageSize: INSIGHTS_PER_PAGE,
diff --git a/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts b/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts
index c6ec2cb8683b..2f9292d96e8a 100644
--- a/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts
+++ b/frontend/src/scenes/surveys/forms/surveyFormBuilderLogic.ts
@@ -20,8 +20,15 @@ export interface surveyFormBuilderLogicValues {
export interface surveyFormBuilderLogicActions {
reportSurveyCreated: (
survey: Survey,
- isDuplicate?: boolean,
- creationSource?: 'form_builder' | 'full_editor' | 'llm_analytics' | 'quick_create' | 'template' | 'wizard'
+ isDuplicate?: boolean | undefined,
+ creationSource?:
+ | 'form_builder'
+ | 'full_editor'
+ | 'llm_analytics'
+ | 'quick_create'
+ | 'template'
+ | 'wizard'
+ | undefined
) => {
creationSource:
| 'form_builder'
diff --git a/frontend/src/scenes/surveys/surveyLogic.tsx b/frontend/src/scenes/surveys/surveyLogic.tsx
index 5ce55fc0078e..7f6d45f5bd8e 100644
--- a/frontend/src/scenes/surveys/surveyLogic.tsx
+++ b/frontend/src/scenes/surveys/surveyLogic.tsx
@@ -779,8 +779,15 @@ export interface surveyLogicActions {
} // eventUsageLogic
reportSurveyCreated: (
survey: Survey,
- isDuplicate?: boolean,
- creationSource?: 'form_builder' | 'full_editor' | 'llm_analytics' | 'quick_create' | 'template' | 'wizard'
+ isDuplicate?: boolean | undefined,
+ creationSource?:
+ | 'form_builder'
+ | 'full_editor'
+ | 'llm_analytics'
+ | 'quick_create'
+ | 'template'
+ | 'wizard'
+ | undefined
) => {
creationSource:
| 'form_builder'
diff --git a/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts b/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts
index c6723b1a7971..2f7c9af5a723 100644
--- a/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts
+++ b/frontend/src/scenes/surveys/wizard/surveyWizardLogic.ts
@@ -98,8 +98,15 @@ export interface surveyWizardLogicValues {
export interface surveyWizardLogicActions {
reportSurveyCreated: (
survey: Survey,
- isDuplicate?: boolean,
- creationSource?: 'form_builder' | 'full_editor' | 'llm_analytics' | 'quick_create' | 'template' | 'wizard'
+ isDuplicate?: boolean | undefined,
+ creationSource?:
+ | 'form_builder'
+ | 'full_editor'
+ | 'llm_analytics'
+ | 'quick_create'
+ | 'template'
+ | 'wizard'
+ | undefined
) => {
creationSource:
| 'form_builder'
@@ -117,7 +124,7 @@ export interface surveyWizardLogicActions {
} // eventUsageLogic
reportSurveyTemplateClicked: (
template: SurveyTemplateType,
- source?: string
+ source?: string | undefined
) => {
source: string | undefined
template: SurveyTemplateType
diff --git a/products/ai_gateway/frontend/aiGatewayLogic.ts b/products/ai_gateway/frontend/aiGatewayLogic.ts
index 5f28ad031c67..8e61b65b6155 100644
--- a/products/ai_gateway/frontend/aiGatewayLogic.ts
+++ b/products/ai_gateway/frontend/aiGatewayLogic.ts
@@ -1,11 +1,10 @@
-import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { humanFriendlyCurrency } from 'lib/utils/numbers'
import { teamLogic } from 'scenes/teamLogic'
-import type { aiGatewayLogicType } from './aiGatewayLogicType'
import {
buildSpendChartData,
fetchGatewaySpendByDay,
@@ -18,6 +17,98 @@ import {
export type EndpointTab = 'typescript' | 'python' | 'curl'
export type EndpointProvider = 'openai' | 'anthropic'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiGatewayLogicValues {
+ endpointProvider: EndpointProvider
+ endpointTab: EndpointTab
+ hasUsage: boolean
+ isTopUpModalOpen: boolean
+ modelUsage: GatewayModelUsage[]
+ modelUsageLoading: boolean
+ spendChart: {
+ data: number[]
+ labels: string[]
+ }
+ spendSeries: GatewaySpendPoint[]
+ spendSeriesLoading: boolean
+ topUpAmountUsd: number
+ usage: GatewayUsage
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiGatewayLogicActions {
+ closeTopUpModal: () => {
+ value: true
+ }
+ confirmTopUp: () => {
+ value: true
+ }
+ loadModelUsage: () => any
+ loadModelUsageFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadModelUsageSuccess: (
+ modelUsage: GatewayModelUsage[],
+ payload?: any
+ ) => {
+ modelUsage: GatewayModelUsage[]
+ payload?: any
+ }
+ loadSpendSeries: () => any
+ loadSpendSeriesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSpendSeriesSuccess: (
+ spendSeries: GatewaySpendPoint[],
+ payload?: any
+ ) => {
+ spendSeries: GatewaySpendPoint[]
+ payload?: any
+ }
+ openTopUpModal: () => {
+ value: true
+ }
+ setEndpointProvider: (provider: EndpointProvider) => {
+ provider: EndpointProvider
+ }
+ setEndpointTab: (tab: EndpointTab) => {
+ tab: EndpointTab
+ }
+ setTopUpAmount: (amountUsd: number) => {
+ amountUsd: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface aiGatewayLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ usage: (modelUsage: GatewayModelUsage[]) => GatewayUsage
+ spendChart: (
+ spendSeries: GatewaySpendPoint[],
+ timezone: string
+ ) => {
+ data: number[]
+ labels: string[]
+ }
+ hasUsage: (modelUsage: GatewayModelUsage[]) => boolean
+ }
+}
+
+export type aiGatewayLogicType = MakeLogicType<
+ aiGatewayLogicValues,
+ aiGatewayLogicActions,
+ Record<string, any>,
+ aiGatewayLogicMeta
+>
+
export const aiGatewayLogic = kea<aiGatewayLogicType>([
path(['products', 'ai_gateway', 'frontend', 'aiGatewayLogic']),
actions({
@@ -51,7 +142,7 @@ export const aiGatewayLogic = kea<aiGatewayLogicType>([
selectors({
usage: [
(s) => [s.modelUsage],
- (modelUsage): GatewayUsage =>
+ (modelUsage: GatewayModelUsage[]): GatewayUsage =>
modelUsage.reduce(
(acc, model) => ({
requests: acc.requests + model.requests,
@@ -64,9 +155,10 @@ export const aiGatewayLogic = kea<aiGatewayLogicType>([
],
spendChart: [
(s) => [s.spendSeries, teamLogic.selectors.timezone],
- (spendSeries, timezone): { data: number[]; labels: string[] } => buildSpendChartData(spendSeries, timezone),
+ (spendSeries: GatewaySpendPoint[], timezone: string): { data: number[]; labels: string[] } =>
+ buildSpendChartData(spendSeries, timezone),
],
- hasUsage: [(s) => [s.modelUsage], (modelUsage): boolean => modelUsage.length > 0],
+ hasUsage: [(s) => [s.modelUsage], (modelUsage: GatewayModelUsage[]): boolean => modelUsage.length > 0],
}),
listeners(({ values, actions }) => ({
confirmTopUp: () => {
diff --git a/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx b/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx
index f2d5745304ea..832ef462b27e 100644
--- a/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx
+++ b/products/error_tracking/frontend/components/Assignee/assigneeSelectLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { createFuse, Fuse } from 'lib/utils/fuseSearch'
import { membersLogic } from 'scenes/organization/membersLogic'
@@ -7,8 +7,6 @@ import { rolesLogic } from 'scenes/settings/organization/Permissions/Roles/roles
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
import type { OrganizationMemberType, RoleType } from '~/types'
-import type { assigneeSelectLogicType } from './assigneeSelectLogicType'
-
export type ErrorTrackingAssigneeSelectProps = {
assignee: ErrorTrackingIssue['assignee']
}
@@ -27,6 +25,56 @@ export type RoleAssignee = {
export type Assignee = UserAssignee | RoleAssignee | null
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface assigneeSelectLogicValues {
+ filteredMembers: OrganizationMemberType[] // membersLogic
+ meFirstMembers: OrganizationMemberType[] // membersLogic
+ membersLoading: boolean // membersLogic
+ roles: RoleType[] // rolesLogic
+ rolesLoading: boolean // rolesLogic
+ filteredRoles: RoleType[]
+ loading: boolean
+ resolveAssignee: (assignee: ErrorTrackingIssue['assignee']) => Assignee
+ rolesFuse: Fuse<RoleType>
+ search: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface assigneeSelectLogicActions {
+ ensureAllMembersLoaded: () => {
+ value: true
+ } // membersLogic
+ setMembersSearch: (search: any) => {
+ search: any
+ } // membersLogic
+ ensureAssigneeTypesLoaded: () => {
+ value: true
+ }
+ setSearch: (search: any) => {
+ search: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface assigneeSelectLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ loading: (membersLoading: boolean, rolesLoading: boolean) => boolean
+ rolesFuse: (roles: RoleType[]) => Fuse<RoleType>
+ filteredRoles: (roles: RoleType[], rolesFuse: Fuse<RoleType>, search: string) => RoleType[]
+ resolveAssignee: (
+ roles: RoleType[],
+ meFirstMembers: OrganizationMemberType[]
+ ) => (assignee: ErrorTrackingIssue['assignee']) => Assignee
+ }
+}
+
+export type assigneeSelectLogicType = MakeLogicType<
+ assigneeSelectLogicValues,
+ assigneeSelectLogicActions,
+ ErrorTrackingAssigneeSelectProps,
+ assigneeSelectLogicMeta
+>
+
export const assigneeSelectLogic = kea<assigneeSelectLogicType>([
path(['products', 'error_tracking', 'components', 'Assignee', 'assigneeSelectLogic']),
props({} as ErrorTrackingAssigneeSelectProps),
@@ -62,19 +110,25 @@ export const assigneeSelectLogic = kea<assigneeSelectLogicType>([
selectors({
loading: [
(s) => [s.membersLoading, s.rolesLoading],
- (membersLoading, rolesLoading): boolean => membersLoading || rolesLoading,
+ (membersLoading: boolean, rolesLoading: boolean): boolean => membersLoading || rolesLoading,
],
- rolesFuse: [(s) => [s.roles], (roles): Fuse<RoleType> => createFuse(roles, { keys: ['name'], threshold: 0.3 })],
+ rolesFuse: [
+ (s) => [s.roles],
+ (roles: RoleType[]): Fuse<RoleType> => createFuse(roles, { keys: ['name'], threshold: 0.3 }),
+ ],
filteredRoles: [
(s) => [s.roles, s.rolesFuse, s.search],
- (roles, rolesFuse, search): RoleType[] =>
+ (roles: RoleType[], rolesFuse: Fuse<RoleType>, search: string): RoleType[] =>
search ? rolesFuse.search(search).map((result) => result.item) : (roles ?? []),
],
resolveAssignee: [
(s) => [s.roles, s.meFirstMembers],
- (roles, members): ((assignee: ErrorTrackingIssue['assignee']) => Assignee) => {
+ (
+ roles: RoleType[],
+ members: OrganizationMemberType[]
+ ): ((assignee: ErrorTrackingIssue['assignee']) => Assignee) => {
return (assignee: ErrorTrackingIssue['assignee']) => {
if (assignee) {
if (assignee.type === 'role') {
diff --git a/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts b/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts
index 5796f51f1681..7594a2821f66 100644
--- a/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts
+++ b/products/error_tracking/frontend/components/Breakdowns/breakdownFiltersLogic.ts
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { Params } from 'scenes/sceneTypes'
@@ -7,9 +7,34 @@ import { Params } from 'scenes/sceneTypes'
import { DateRange } from '~/queries/schema/schema-general'
import { syncSearchParams, updateSearchParams } from '../../utils'
-import type { breakdownFiltersLogicType } from './breakdownFiltersLogicType'
import { DEFAULT_DATE_RANGE, DEFAULT_TEST_ACCOUNT } from './consts'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface breakdownFiltersLogicValues {
+ breakdownProperty: string
+ dateRange: DateRange
+ filterOpen: boolean
+ filterTestAccounts: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface breakdownFiltersLogicActions {
+ setBreakdownProperty: (breakdownProperty: string) => {
+ breakdownProperty: string
+ }
+ setDateRange: (dateRange: DateRange) => {
+ dateRange: DateRange
+ }
+ setFilterOpen: (filterOpen: boolean) => {
+ filterOpen: boolean
+ }
+ setFilterTestAccounts: (filterTestAccounts: boolean) => {
+ filterTestAccounts: boolean
+ }
+}
+
+export type breakdownFiltersLogicType = MakeLogicType<breakdownFiltersLogicValues, breakdownFiltersLogicActions>
+
export const breakdownFiltersLogic = kea<breakdownFiltersLogicType>([
path(['products', 'error_tracking', 'components', 'Breakdowns', 'breakdownFiltersLogic']),
diff --git a/products/error_tracking/frontend/components/Breakdowns/miniBreakdownsLogic.ts b/products/error_tracking/frontend/components/Breakdowns/miniBreakdownsLogic.ts
index 4e0f8804afee..842b0ff60fbc 100644
--- a/products/error_tracking/frontend/components/Breakdowns/miniBreakdownsLogic.ts
+++ b/products/error_tracking/frontend/components/Breakdowns/miniBreakdownsLogic.ts
@@ -1,4 +1,4 @@
-import { connect, events, kea, key, path, props, selectors } from 'kea'
+import { MakeLogicType, connect, events, kea, key, path, props, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -11,10 +11,10 @@ import {
ErrorTrackingBreakdownsQueryResponse,
} from '~/queries/schema/schema-general'
+import type { DateRange } from '../../../../../frontend/src/queries/schema/schema-general'
import { errorTrackingBreakdownsQuery } from '../../queries'
import { breakdownFiltersLogic } from './breakdownFiltersLogic'
import { BREAKDOWN_PRESETS, BreakdownsEvents, LIMIT_ITEMS } from './consts'
-import type { miniBreakdownsLogicType } from './miniBreakdownsLogicType'
export interface MiniBreakdownsLogicProps {
issueId: string
@@ -25,6 +25,55 @@ export interface BreakdownSinglePropertyStat {
count: number
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface miniBreakdownsLogicValues {
+ dateRange: DateRange // breakdownFiltersLogic
+ filterTestAccounts: boolean // breakdownFiltersLogic
+ getBreakdownForProperty: (property: string) => {
+ properties: BreakdownSinglePropertyStat[]
+ totalCount: number
+ }
+ response: ErrorTrackingBreakdownsQueryResponse | null
+ responseLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface miniBreakdownsLogicActions {
+ loadResponse: () => any
+ loadResponseFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadResponseSuccess: (
+ response: ErrorTrackingBreakdownsQueryResponse,
+ payload?: any
+ ) => {
+ response: ErrorTrackingBreakdownsQueryResponse
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface miniBreakdownsLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ getBreakdownForProperty: (response: ErrorTrackingBreakdownsQueryResponse | null) => (property: string) => {
+ properties: BreakdownSinglePropertyStat[]
+ totalCount: number
+ }
+ }
+}
+
+export type miniBreakdownsLogicType = MakeLogicType<
+ miniBreakdownsLogicValues,
+ miniBreakdownsLogicActions,
+ MiniBreakdownsLogicProps,
+ miniBreakdownsLogicMeta
+>
+
export const miniBreakdownsLogic = kea<miniBreakdownsLogicType>([
path(['products', 'error_tracking', 'components', 'Breakdowns', 'miniBreakdownsLogic']),
props({} as MiniBreakdownsLogicProps),
diff --git a/products/error_tracking/frontend/components/ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic.ts b/products/error_tracking/frontend/components/ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic.ts
index 80449b03fb53..a6291fec14e4 100644
--- a/products/error_tracking/frontend/components/ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic.ts
+++ b/products/error_tracking/frontend/components/ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic.ts
@@ -1,10 +1,35 @@
-import { connect, kea, path, props, selectors } from 'kea'
+import { MakeLogicType, connect, kea, path, props, selectors } from 'kea'
import { ErrorPropertiesLogicProps, errorPropertiesLogic } from 'lib/components/Errors/errorPropertiesLogic'
import { ErrorTrackingRelease } from 'lib/components/Errors/types'
import { dayjs } from 'lib/dayjs'
-import type { releasePreviewLogicType } from './releasePreviewLogicType'
+import type { KeyedStackFrameRecords } from '../../../../../../frontend/src/lib/components/Errors/Frame/stackFrameLogic'
+import type { ErrorTrackingStackFrame } from '../../../../../../frontend/src/lib/components/Errors/types'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface releasePreviewLogicValues {
+ frames: ErrorTrackingStackFrame[] // errorPropertiesLogic
+ stackFrameRecords: KeyedStackFrameRecords // errorPropertiesLogic
+ release: ErrorTrackingRelease | null | undefined
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface releasePreviewLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ release: (
+ frames: ErrorTrackingStackFrame[],
+ stackFrameRecords: KeyedStackFrameRecords
+ ) => ErrorTrackingRelease | null | undefined
+ }
+}
+
+export type releasePreviewLogicType = MakeLogicType<
+ releasePreviewLogicValues,
+ {},
+ ErrorPropertiesLogicProps,
+ releasePreviewLogicMeta
+>
export const releasePreviewLogic = kea<releasePreviewLogicType>([
path([
@@ -26,7 +51,10 @@ export const releasePreviewLogic = kea<releasePreviewLogicType>([
selectors(() => ({
release: [
(s) => [s.frames, s.stackFrameRecords],
- (frames, stackFrameRecords) => {
+ (
+ frames: import('lib/components/Errors/types').ErrorTrackingStackFrame[],
+ stackFrameRecords: import('lib/components/Errors/Frame/stackFrameLogic').KeyedStackFrameRecords
+ ) => {
if (!frames.length || Object.keys(stackFrameRecords).length === 0) {
return undefined
}
diff --git a/products/error_tracking/frontend/components/ExceptionCard/Tabs/SessionTab/sessionTabLogic.ts b/products/error_tracking/frontend/components/ExceptionCard/Tabs/SessionTab/sessionTabLogic.ts
index 38ab5e9caf3e..18c7b52870ab 100644
--- a/products/error_tracking/frontend/components/ExceptionCard/Tabs/SessionTab/sessionTabLogic.ts
+++ b/products/error_tracking/frontend/components/ExceptionCard/Tabs/SessionTab/sessionTabLogic.ts
@@ -1,4 +1,17 @@
-import { actions, connect, defaults, events, kea, key, path, props, propsChanged, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ connect,
+ defaults,
+ events,
+ kea,
+ key,
+ path,
+ props,
+ propsChanged,
+ reducers,
+ selectors,
+} from 'kea'
import { Dayjs, dayjs } from 'lib/dayjs'
import { sessionRecordingDataCoordinatorLogic } from 'scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic'
@@ -7,8 +20,6 @@ import { sessionRecordingPlayerLogic } from 'scenes/session-recordings/player/se
import { SessionPlayerData } from '~/types'
-import type { sessionTabLogicType } from './sessionTabLogicType'
-
export type SessionTabLogicProps = {
sessionId: string
timestamp: string
@@ -33,6 +44,65 @@ function getRecordingProps(sessionId: string): SessionRecordingPlayerProps {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionTabLogicValues {
+ isNotFound: boolean // sessionRecordingDataCoordinatorLogic
+ sessionPlayerData: SessionPlayerData // sessionRecordingDataCoordinatorLogic
+ sessionPlayerMetaDataLoading: boolean // sessionRecordingDataCoordinatorLogic
+ exceptionTimestamp: number | null
+ isTimestampOutsideRecording: boolean
+ recordingProps: SessionRecordingPlayerProps
+ recordingTimestamp: number | null
+ sessionId: string
+ timestamp: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionTabLogicActions {
+ seekToTimestamp: (
+ timestamp: number,
+ forcePlay?: boolean
+ ) => {
+ forcePlay: boolean
+ timestamp: number
+ } // sessionRecordingPlayerLogic
+ setPause: () => {
+ value: true
+ } // sessionRecordingPlayerLogic
+ setPlay: () => {
+ value: true
+ } // sessionRecordingPlayerLogic
+ setRecordingTimestamp: (
+ timestamp: Dayjs,
+ offset: number
+ ) => {
+ offset: number
+ timestamp: Dayjs
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sessionTabLogicMeta {
+ key: KeyType
+ __keaTypeGenInternalSelectorTypes: {
+ sessionId: (sessionId: string) => string
+ timestamp: (timestamp: string) => string
+ recordingProps: (sessionId: string) => SessionRecordingPlayerProps
+ isTimestampOutsideRecording: (
+ exceptionTimestamp: number | null,
+ sessionPlayerData: SessionPlayerData,
+ sessionPlayerMetaDataLoading: boolean
+ ) => boolean
+ }
+}
+
+export type sessionTabLogicType = MakeLogicType<
+ sessionTabLogicValues,
+ sessionTabLogicActions,
+ SessionTabLogicProps,
+ sessionTabLogicMeta
+>
+
export const sessionTabLogic = kea<sessionTabLogicType>([
path((key) => ['scenes', 'error-tracking', 'exceptionCard', 'sessionTab', key]),
props({} as SessionTabLogicProps),
@@ -73,11 +143,11 @@ export const sessionTabLogic = kea<sessionTabLogicType>([
},
}),
selectors({
- sessionId: [(_, p) => [p.sessionId], (sessionId) => sessionId],
- timestamp: [(_, p) => [p.timestamp], (timestamp) => timestamp],
+ sessionId: [(_, p) => [p.sessionId], (sessionId: string) => sessionId],
+ timestamp: [(_, p) => [p.timestamp], (timestamp: string) => timestamp],
recordingProps: [
(_, p) => [p.sessionId],
- (sessionId) => {
+ (sessionId: string) => {
return getRecordingProps(sessionId)
},
],
diff --git a/products/error_tracking/frontend/components/ExceptionCard/exceptionCardLogic.ts b/products/error_tracking/frontend/components/ExceptionCard/exceptionCardLogic.ts
index 587ac1da55ca..750d84d46a97 100644
--- a/products/error_tracking/frontend/components/ExceptionCard/exceptionCardLogic.ts
+++ b/products/error_tracking/frontend/components/ExceptionCard/exceptionCardLogic.ts
@@ -1,13 +1,63 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import posthog from 'lib/posthog-typed'
-import type { exceptionCardLogicType } from './exceptionCardLogicType'
-
export type ExceptionCardLogicProps = {
issueId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface exceptionCardLogicValues {
+ currentSessionTab: string
+ currentTab: string
+ expandedFrameRawIds: Set<string>
+ issueId: string
+ loading: boolean
+ showAdditionalProperties: boolean
+ showJSONProperties: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface exceptionCardLogicActions {
+ setCurrentSessionTab: (tab: string) => {
+ tab: string
+ }
+ setCurrentTab: (tab: string) => {
+ tab: string
+ }
+ setFrameExpanded: (
+ rawId: string,
+ expanded: boolean
+ ) => {
+ expanded: boolean
+ rawId: string
+ }
+ setLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ setShowAdditionalProperties: (showProperties: boolean) => {
+ showProperties: boolean
+ }
+ setShowJSONProperties: (showJSON: boolean) => {
+ showJSON: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface exceptionCardLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ issueId: (issueId: string) => string
+ }
+}
+
+export type exceptionCardLogicType = MakeLogicType<
+ exceptionCardLogicValues,
+ exceptionCardLogicActions,
+ ExceptionCardLogicProps,
+ exceptionCardLogicMeta
+>
+
export const exceptionCardLogic = kea<exceptionCardLogicType>([
path((key) => ['products', 'error_tracking', 'ExceptionCard', key]),
key((props) => props.issueId),
@@ -74,7 +124,7 @@ export const exceptionCardLogic = kea<exceptionCardLogicType>([
}),
selectors({
- issueId: [(_, p) => [p.issueId], (issueId) => issueId],
+ issueId: [(_, p) => [p.issueId], (issueId: string) => issueId],
}),
listeners(({ props }) => ({
diff --git a/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx b/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx
index 27dcbeee08bc..e78c1c7f3946 100644
--- a/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx
+++ b/products/error_tracking/frontend/components/IssueActions/issueActionsLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import posthog from 'posthog-js'
import api from 'lib/api'
@@ -11,13 +11,114 @@ import { createCohortFormData } from 'scenes/cohorts/cohortUtils'
import { ErrorTrackingIssue } from '~/queries/schema/schema-general'
import { BehavioralEventType, CohortType, FilterLogicalOperator, PropertyFilterType, PropertyOperator } from '~/types'
+import type {
+ ErrorTrackingIssueAssignee,
+ ErrorTrackingIssueStatus,
+} from '../../../../../frontend/src/queries/schema/schema-general'
import { pendingFingerprintIssueStateUpdateLogic } from '../../logics/pendingFingerprintIssueStateUpdateLogic'
-import type { issueActionsLogicType } from './issueActionsLogicType'
const pendingUpdateActions = ():
| NonNullable<ReturnType<typeof pendingFingerprintIssueStateUpdateLogic.findMounted>>['asyncActions']
| undefined => pendingFingerprintIssueStateUpdateLogic.findMounted()?.asyncActions
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueActionsLogicValues {
+ needsReload: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueActionsLogicActions {
+ activateIssues: (ids: string[]) => {
+ ids: string[]
+ }
+ assignIssues: (
+ ids: string[],
+ assignee: ErrorTrackingIssue['assignee']
+ ) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ ids: string[]
+ }
+ clearNeedsReload: () => {
+ value: true
+ }
+ createIssueCohort: (
+ id: string,
+ name: string,
+ description: string
+ ) => {
+ description: string
+ id: string
+ name: string
+ }
+ mergeIssues: (ids: string[]) => {
+ ids: string[]
+ }
+ mutationFailure: (
+ mutationName: string,
+ error: unknown
+ ) => {
+ error: unknown
+ mutationName: string
+ }
+ mutationSuccess: (mutationName: string) => {
+ mutationName: string
+ }
+ resolveIssues: (ids: string[]) => {
+ ids: string[]
+ }
+ splitIssue: (
+ id: ErrorTrackingIssue['id'],
+ fingerprints: {
+ description?: string
+ fingerprint: string
+ name?: string
+ }[]
+ ) => {
+ fingerprints: {
+ description?: string | undefined
+ fingerprint: string
+ name?: string | undefined
+ }[]
+ id: string
+ }
+ splitIssueSuccess: (newIssueIds: string[]) => {
+ newIssueIds: string[]
+ }
+ suppressIssues: (ids: string[]) => {
+ ids: string[]
+ }
+ updateIssueAssignee: (
+ id: string,
+ assignee: ErrorTrackingIssue['assignee']
+ ) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ id: string
+ }
+ updateIssueDescription: (
+ id: string,
+ description: string
+ ) => {
+ description: string
+ id: string
+ }
+ updateIssueName: (
+ id: string,
+ name: string
+ ) => {
+ id: string
+ name: string
+ }
+ updateIssueStatus: (
+ id: string,
+ status: ErrorTrackingIssue['status']
+ ) => {
+ id: string
+ status: ErrorTrackingIssueStatus
+ }
+}
+
+export type issueActionsLogicType = MakeLogicType<issueActionsLogicValues, issueActionsLogicActions>
+
export const issueActionsLogic = kea<issueActionsLogicType>([
path(['products', 'error_tracking', 'components', 'IssueActions', 'issueActionsLogic']),
diff --git a/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts b/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts
index a2bd5acb05b3..bd8db2e2edaf 100644
--- a/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts
+++ b/products/error_tracking/frontend/components/IssueFilters/issueFiltersLogic.ts
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { SelectedQuickFilter, quickFiltersSectionLogic } from 'lib/components/QuickFilters'
import { taxonomicFilterLogic } from 'lib/components/TaxonomicFilter/taxonomicFilterLogic'
@@ -11,7 +11,6 @@ import { FilterLogicalOperator, PropertyFilterType, UniversalFiltersGroup } from
import { updateSearchParams } from '../../utils'
import { TAXONOMIC_FILTER_LOGIC_KEY, TAXONOMIC_GROUP_TYPES } from './consts'
-import type { issueFiltersLogicType } from './issueFiltersLogicType'
export const DEFAULT_DATE_RANGE = { date_from: '-7d', date_to: null }
export const DEFAULT_FILTER_GROUP = {
@@ -25,6 +24,53 @@ export interface IssueFiltersLogicProps {
logicKey: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueFiltersLogicValues {
+ selectedQuickFilters: Record<string, SelectedQuickFilter> // quickFiltersSectionLogic
+ dateRange: DateRange
+ filterGroup: UniversalFiltersGroup
+ filterTestAccounts: boolean
+ mergedFilterGroup: UniversalFiltersGroup
+ searchQuery: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueFiltersLogicActions {
+ setTaxonomicSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ } // taxonomicFilterLogic
+ setDateRange: (dateRange: DateRange) => {
+ dateRange: DateRange
+ }
+ setFilterGroup: (filterGroup: UniversalFiltersGroup) => {
+ filterGroup: UniversalFiltersGroup
+ }
+ setFilterTestAccounts: (filterTestAccounts: boolean) => {
+ filterTestAccounts: boolean
+ }
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueFiltersLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ mergedFilterGroup: (
+ filterGroup: UniversalFiltersGroup,
+ selectedQuickFilters: Record<string, SelectedQuickFilter>
+ ) => UniversalFiltersGroup
+ }
+}
+
+export type issueFiltersLogicType = MakeLogicType<
+ issueFiltersLogicValues,
+ issueFiltersLogicActions,
+ IssueFiltersLogicProps,
+ issueFiltersLogicMeta
+>
+
export const issueFiltersLogic = kea<issueFiltersLogicType>([
path(['products', 'error_tracking', 'components', 'IssueFilters', 'issueFiltersLogic']),
props({} as IssueFiltersLogicProps),
diff --git a/products/error_tracking/frontend/components/IssueQueryOptions/issueQueryOptionsLogic.ts b/products/error_tracking/frontend/components/IssueQueryOptions/issueQueryOptionsLogic.ts
index 02972f6f7cfc..60c5e33028a6 100644
--- a/products/error_tracking/frontend/components/IssueQueryOptions/issueQueryOptionsLogic.ts
+++ b/products/error_tracking/frontend/components/IssueQueryOptions/issueQueryOptionsLogic.ts
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import posthog from 'posthog-js'
@@ -7,8 +7,11 @@ import { Params } from 'scenes/sceneTypes'
import { ErrorTrackingIssue, ErrorTrackingQuery } from '~/queries/schema/schema-general'
+import type {
+ ErrorTrackingIssueAssignee,
+ ErrorTrackingOrderBy,
+} from '../../../../../frontend/src/queries/schema/schema-general'
import { syncSearchParams, updateSearchParams } from '../../utils'
-import type { issueQueryOptionsLogicType } from './issueQueryOptionsLogicType'
export type ErrorTrackingQueryOrderBy = ErrorTrackingQuery['orderBy']
export type ErrorTrackingQueryOrderDirection = ErrorTrackingQuery['orderDirection']
@@ -31,6 +34,42 @@ export interface IssueQueryOptionsLogicProps {
logicKey: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueQueryOptionsLogicValues {
+ assignee: ErrorTrackingQueryAssignee | null
+ orderBy: ErrorTrackingQueryOrderBy
+ orderDirection: ErrorTrackingQueryOrderDirection
+ status: ErrorTrackingQueryStatus
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueQueryOptionsLogicActions {
+ setAssignee: (assignee: ErrorTrackingIssue['assignee']) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ }
+ setOrderBy: (orderBy: ErrorTrackingQueryOrderBy) => {
+ orderBy: ErrorTrackingOrderBy
+ }
+ setOrderDirection: (orderDirection: ErrorTrackingQueryOrderDirection) => {
+ orderDirection: 'ASC' | 'DESC' | undefined
+ }
+ setStatus: (status: ErrorTrackingQueryStatus) => {
+ status: ErrorTrackingQueryStatus | undefined
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueQueryOptionsLogicMeta {
+ key: string
+}
+
+export type issueQueryOptionsLogicType = MakeLogicType<
+ issueQueryOptionsLogicValues,
+ issueQueryOptionsLogicActions,
+ IssueQueryOptionsLogicProps,
+ issueQueryOptionsLogicMeta
+>
+
export const issueQueryOptionsLogic = kea<issueQueryOptionsLogicType>([
path(['products', 'error_tracking', 'components', 'IssueQueryOptions', 'issueQueryOptionsLogic']),
props({} as IssueQueryOptionsLogicProps),
diff --git a/products/error_tracking/frontend/components/SetupPrompt/exceptionIngestionLogic.tsx b/products/error_tracking/frontend/components/SetupPrompt/exceptionIngestionLogic.tsx
index fc7f8813c3ae..7b0f7a06b2ed 100644
--- a/products/error_tracking/frontend/components/SetupPrompt/exceptionIngestionLogic.tsx
+++ b/products/error_tracking/frontend/components/SetupPrompt/exceptionIngestionLogic.tsx
@@ -1,9 +1,34 @@
-import { afterMount, kea, path } from 'kea'
+import { MakeLogicType, afterMount, kea, path } from 'kea'
import { loaders } from 'kea-loaders'
import { ApiRequest } from 'lib/api'
-import type { exceptionIngestionLogicType } from './exceptionIngestionLogicType'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface exceptionIngestionLogicValues {
+ hasSentExceptionEvent: boolean | undefined
+ hasSentExceptionEventLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface exceptionIngestionLogicActions {
+ loadExceptionIngestionState: () => any
+ loadExceptionIngestionStateFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadExceptionIngestionStateSuccess: (
+ hasSentExceptionEvent: boolean,
+ payload?: any
+ ) => {
+ hasSentExceptionEvent: boolean
+ payload?: any
+ }
+}
+
+export type exceptionIngestionLogicType = MakeLogicType<exceptionIngestionLogicValues, exceptionIngestionLogicActions>
export const exceptionIngestionLogic = kea<exceptionIngestionLogicType>([
path(['products', 'error_tracking', 'components', 'SetupPrompt', 'exceptionIngestionLogic']),
diff --git a/products/error_tracking/frontend/components/VolumeSparkline/errorTrackingVolumeSparklineLogic.ts b/products/error_tracking/frontend/components/VolumeSparkline/errorTrackingVolumeSparklineLogic.ts
index 78ee465e90ec..eca7ec22f5b6 100644
--- a/products/error_tracking/frontend/components/VolumeSparkline/errorTrackingVolumeSparklineLogic.ts
+++ b/products/error_tracking/frontend/components/VolumeSparkline/errorTrackingVolumeSparklineLogic.ts
@@ -1,12 +1,72 @@
-import { actions, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props, reducers, selectors } from 'kea'
-import type { errorTrackingVolumeSparklineLogicType } from './errorTrackingVolumeSparklineLogicType'
import type { SparklineDatum, SparklineEvent, VolumeSparklineHoverSelection } from './types'
export interface ErrorTrackingVolumeSparklineLogicProps {
sparklineKey: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingVolumeSparklineLogicValues {
+ clickedSpike: {
+ clientX: number
+ clientY: number
+ datum: SparklineDatum
+ } | null
+ hoverSelection: VolumeSparklineHoverSelection | null
+ hoveredDatum: SparklineDatum | null
+ hoveredIndex: number | null
+ isBarHighlighted: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingVolumeSparklineLogicActions {
+ setClickedSpike: (
+ payload: {
+ clientX: number
+ clientY: number
+ datum: SparklineDatum
+ } | null
+ ) => {
+ payload: {
+ clientX: number
+ clientY: number
+ datum: SparklineDatum
+ } | null
+ }
+ setHoveredBin: (
+ payload: {
+ datum: SparklineDatum
+ index: number
+ } | null
+ ) => {
+ payload: {
+ datum: SparklineDatum
+ index: number
+ } | null
+ }
+ setHoveredEvent: (payload: SparklineEvent<string> | null) => {
+ payload: SparklineEvent<string> | null
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingVolumeSparklineLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ hoveredIndex: (hoverSelection: VolumeSparklineHoverSelection | null) => number | null
+ hoveredDatum: (hoverSelection: VolumeSparklineHoverSelection | null) => SparklineDatum | null
+ isBarHighlighted: (hoverSelection: VolumeSparklineHoverSelection | null) => boolean
+ }
+}
+
+export type errorTrackingVolumeSparklineLogicType = MakeLogicType<
+ errorTrackingVolumeSparklineLogicValues,
+ errorTrackingVolumeSparklineLogicActions,
+ ErrorTrackingVolumeSparklineLogicProps,
+ errorTrackingVolumeSparklineLogicMeta
+>
+
export const errorTrackingVolumeSparklineLogic = kea<errorTrackingVolumeSparklineLogicType>([
path((key) => [
'products',
diff --git a/products/error_tracking/frontend/logics/batchSpikeEventsLogic.ts b/products/error_tracking/frontend/logics/batchSpikeEventsLogic.ts
index fa968568579c..42ee7fad3a88 100644
--- a/products/error_tracking/frontend/logics/batchSpikeEventsLogic.ts
+++ b/products/error_tracking/frontend/logics/batchSpikeEventsLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,7 +7,46 @@ import { ErrorTrackingSpikeEvent } from 'lib/components/Errors/types'
import { DateRange } from '~/queries/schema/schema-general'
import { dateRangeToIsoBounds } from '../utils'
-import type { batchSpikeEventsLogicType } from './batchSpikeEventsLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchSpikeEventsLogicValues {
+ rawSpikeEvents: ErrorTrackingSpikeEvent[]
+ rawSpikeEventsLoading: boolean
+ spikeEventsByIssueId: Record<string, ErrorTrackingSpikeEvent[]>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface batchSpikeEventsLogicActions {
+ loadSpikeEventsForIssues: (
+ issueIds: string[],
+ dateRange?: DateRange
+ ) => {
+ dateRange: DateRange | undefined
+ issueIds: string[]
+ }
+ loadSpikeEventsForIssuesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSpikeEventsForIssuesSuccess: (
+ rawSpikeEvents: ErrorTrackingSpikeEvent[],
+ payload?: {
+ dateRange: DateRange | undefined
+ issueIds: string[]
+ }
+ ) => {
+ rawSpikeEvents: ErrorTrackingSpikeEvent[]
+ payload?: {
+ dateRange: DateRange | undefined
+ issueIds: string[]
+ }
+ }
+}
+
+export type batchSpikeEventsLogicType = MakeLogicType<batchSpikeEventsLogicValues, batchSpikeEventsLogicActions>
export const batchSpikeEventsLogic = kea<batchSpikeEventsLogicType>([
path(['products', 'error_tracking', 'logics', 'batchSpikeEventsLogic']),
diff --git a/products/error_tracking/frontend/logics/bulkSelectLogic.ts b/products/error_tracking/frontend/logics/bulkSelectLogic.ts
index b11a8e8f8e30..57af3a3a2d4a 100644
--- a/products/error_tracking/frontend/logics/bulkSelectLogic.ts
+++ b/products/error_tracking/frontend/logics/bulkSelectLogic.ts
@@ -1,7 +1,38 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
import { issueActionsLogic } from '../components/IssueActions/issueActionsLogic'
-import type { bulkSelectLogicType } from './bulkSelectLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface bulkSelectLogicValues {
+ previouslyCheckedRecordIndex: number | null
+ selectedIssueIds: string[]
+ shiftKeyHeld: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface bulkSelectLogicActions {
+ mutationFailure: (
+ mutationName: string,
+ error: unknown
+ ) => {
+ error: unknown
+ mutationName: string
+ } // issueActionsLogic
+ mutationSuccess: (mutationName: string) => {
+ mutationName: string
+ } // issueActionsLogic
+ setPreviouslyCheckedRecordIndex: (index: number) => {
+ index: number
+ }
+ setSelectedIssueIds: (ids: string[]) => {
+ ids: string[]
+ }
+ setShiftKeyHeld: (shiftKeyHeld: boolean) => {
+ shiftKeyHeld: boolean
+ }
+}
+
+export type bulkSelectLogicType = MakeLogicType<bulkSelectLogicValues, bulkSelectLogicActions>
export const bulkSelectLogic = kea<bulkSelectLogicType>([
path(['products', 'error_tracking', 'logics', 'bulkSelectLogic']),
diff --git a/products/error_tracking/frontend/logics/issuesDataNodeLogic.tsx b/products/error_tracking/frontend/logics/issuesDataNodeLogic.tsx
index efd8f7286e4c..810912198eab 100644
--- a/products/error_tracking/frontend/logics/issuesDataNodeLogic.tsx
+++ b/products/error_tracking/frontend/logics/issuesDataNodeLogic.tsx
@@ -1,19 +1,234 @@
-import { actions, afterMount, connect, kea, listeners, path, props, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, props, selectors } from 'kea'
import posthog from 'posthog-js'
import { DataNodeLogicProps, dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'
import { ErrorTrackingIssue, ErrorTrackingQuery } from '~/queries/schema/schema-general'
+import type {
+ AnyResponseType,
+ DataNode,
+ DateRange,
+ ErrorTrackingIssueAssignee,
+ ErrorTrackingIssueStatus,
+ ErrorTrackingQueryResponse,
+ EventsQueryResponse,
+ HogQLAutocompleteResponse,
+ HogQLMetadataResponse,
+ HogQLQueryResponse,
+ HogQueryResponse,
+ LogAttributesQueryResponse,
+ LogValuesQueryResponse,
+ LogsQueryResponse,
+ MetricsQueryResponse,
+ RefreshType,
+ SessionsQueryResponse,
+ TraceSpansAggregationQueryResponse,
+ TraceSpansAttributeBreakdownQueryResponse,
+ TraceSpansQueryResponse,
+ TraceSpansTreeQueryResponse,
+} from '../../../../frontend/src/queries/schema/schema-general'
import { issueActionsLogic } from '../components/IssueActions/issueActionsLogic'
import { mergeIssues } from '../utils'
import { batchSpikeEventsLogic } from './batchSpikeEventsLogic'
-import type { issuesDataNodeLogicType } from './issuesDataNodeLogicType'
export interface IssuesDataNodeLogicProps {
query: DataNodeLogicProps['query']
key: DataNodeLogicProps['key']
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issuesDataNodeLogicValues {
+ needsReload: boolean // issueActionsLogic
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null // nodeLogic
+ responseLoading: boolean // nodeLogic
+ results: ErrorTrackingIssue[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issuesDataNodeLogicActions {
+ loadSpikeEventsForIssues: (
+ issueIds: string[],
+ dateRange?: DateRange | undefined
+ ) => {
+ dateRange: DateRange | undefined
+ issueIds: string[]
+ } // batchSpikeEventsLogic
+ activateIssues: (ids: string[]) => {
+ ids: string[]
+ } // issueActionsLogic
+ assignIssues: (
+ ids: string[],
+ assignee: ErrorTrackingIssueAssignee | null
+ ) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ ids: string[]
+ } // issueActionsLogic
+ clearNeedsReload: () => {
+ value: true
+ } // issueActionsLogic
+ mergeIssues: (ids: string[]) => {
+ ids: string[]
+ } // issueActionsLogic
+ mutationFailure: (
+ mutationName: string,
+ error: unknown
+ ) => {
+ error: unknown
+ mutationName: string
+ } // issueActionsLogic
+ resolveIssues: (ids: string[]) => {
+ ids: string[]
+ } // issueActionsLogic
+ suppressIssues: (ids: string[]) => {
+ ids: string[]
+ } // issueActionsLogic
+ updateIssueAssignee: (
+ id: string,
+ assignee: ErrorTrackingIssueAssignee | null
+ ) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ id: string
+ } // issueActionsLogic
+ updateIssueStatus: (
+ id: string,
+ status: ErrorTrackingIssueStatus
+ ) => {
+ id: string
+ status: ErrorTrackingIssueStatus
+ } // issueActionsLogic
+ cancelQuery: () => {
+ value: true
+ } // nodeLogic
+ loadData: (
+ refresh?: RefreshType,
+ alreadyRunningQueryId?: string,
+ overrideQuery?: DataNode<Record<string, any>>
+ ) => {
+ overrideQuery: DataNode<Record<string, any>> | undefined
+ pollOnly: boolean
+ queryId: string
+ refresh: RefreshType | undefined
+ } // nodeLogic
+ loadDataFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ } // nodeLogic
+ loadDataSuccess: (
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null
+ | undefined,
+ payload?: {
+ overrideQuery: DataNode<Record<string, any>> | undefined
+ pollOnly: boolean
+ queryId: string
+ refresh: RefreshType | undefined
+ }
+ ) => {
+ payload?: {
+ overrideQuery: DataNode<Record<string, any>> | undefined
+ pollOnly: boolean
+ queryId: string
+ refresh: RefreshType | undefined
+ }
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null
+ | undefined
+ } // nodeLogic
+ setResponse: (
+ response: Exclude<AnyResponseType, undefined>
+ ) =>
+ | ErrorTrackingQueryResponse
+ | EventsQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogsQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | TraceSpansTreeQueryResponse // nodeLogic
+ reloadData: () => {}
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issuesDataNodeLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ results: (
+ response:
+ | ErrorTrackingQueryResponse
+ | HogQLAutocompleteResponse
+ | HogQLMetadataResponse
+ | HogQLQueryResponse<any[]>
+ | HogQueryResponse
+ | LogAttributesQueryResponse
+ | LogValuesQueryResponse
+ | MetricsQueryResponse
+ | Record<string, any>
+ | SessionsQueryResponse
+ | TraceSpansAggregationQueryResponse
+ | TraceSpansAttributeBreakdownQueryResponse
+ | TraceSpansQueryResponse
+ | null
+ ) => ErrorTrackingIssue[]
+ }
+}
+
+export type issuesDataNodeLogicType = MakeLogicType<
+ issuesDataNodeLogicValues,
+ issuesDataNodeLogicActions,
+ IssuesDataNodeLogicProps,
+ issuesDataNodeLogicMeta
+>
+
export const issuesDataNodeLogic = kea<issuesDataNodeLogicType>([
path(['products', 'error_tracking', 'logics', 'issuesDataNodeLogic']),
props({} as IssuesDataNodeLogicProps),
@@ -50,7 +265,23 @@ export const issuesDataNodeLogic = kea<issuesDataNodeLogicType>([
selectors({
results: [
(s) => [s.response],
- (response): ErrorTrackingIssue[] => (response && 'results' in response ? response.results : []),
+ (
+ response:
+ | Record<string, any>
+ | null
+ | import('~/queries/schema').ErrorTrackingQueryResponse
+ | import('~/queries/schema').HogQLAutocompleteResponse
+ | import('~/queries/schema').HogQLMetadataResponse
+ | import('~/queries/schema').HogQLQueryResponse<any[]>
+ | import('~/queries/schema').HogQueryResponse
+ | import('~/queries/schema').LogAttributesQueryResponse
+ | import('~/queries/schema').LogValuesQueryResponse
+ | import('~/queries/schema').MetricsQueryResponse
+ | import('~/queries/schema').SessionsQueryResponse
+ | import('~/queries/schema').TraceSpansAggregationQueryResponse
+ | import('~/queries/schema').TraceSpansAttributeBreakdownQueryResponse
+ | import('~/queries/schema').TraceSpansQueryResponse
+ ): ErrorTrackingIssue[] => (response && 'results' in response ? response.results : []),
],
}),
diff --git a/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.ts b/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.ts
index 7cfe49e1da45..14898da39e04 100644
--- a/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.ts
+++ b/products/error_tracking/frontend/logics/pendingFingerprintIssueStateUpdateLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import api from 'lib/api'
import { ErrorTrackingFingerprint } from 'lib/components/Errors/types'
@@ -11,7 +11,6 @@ import {
import { errorTrackingIssueSceneLogic } from '../scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic'
import { issuesDataNodeLogic } from './issuesDataNodeLogic'
-import type { pendingFingerprintIssueStateUpdateLogicType } from './pendingFingerprintIssueStateUpdateLogicType'
import { applyDelta, buildPendingUpdate, CurrentIssueState, IssueStateDelta } from './pendingUpdateHelpers'
// CH sync typically lands in seconds; 60s is generous.
@@ -19,6 +18,52 @@ export const PENDING_UPDATE_TTL_MS = 60_000
export type StoredPendingUpdate = ErrorTrackingPendingFingerprintIssueStateUpdate & { expiresAt: number }
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pendingFingerprintIssueStateUpdateLogicValues {
+ currentPendingUpdates: ErrorTrackingPendingFingerprintIssueStateUpdate[]
+ pendingUpdates: Record<string, StoredPendingUpdate>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pendingFingerprintIssueStateUpdateLogicActions {
+ addPendingUpdates: (rows: ErrorTrackingPendingFingerprintIssueStateUpdate[]) => {
+ rows: ErrorTrackingPendingFingerprintIssueStateUpdate[]
+ }
+ captureMergePendingUpdates: (
+ primaryId: string,
+ sourceIds: string[]
+ ) => {
+ primaryId: string
+ sourceIds: string[]
+ }
+ capturePendingUpdatesForIssues: (
+ issueIds: string[],
+ delta: IssueStateDelta
+ ) => {
+ delta: IssueStateDelta
+ issueIds: string[]
+ }
+ clearAll: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface pendingFingerprintIssueStateUpdateLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ currentPendingUpdates: (
+ pendingUpdates: Record<string, StoredPendingUpdate>
+ ) => ErrorTrackingPendingFingerprintIssueStateUpdate[]
+ }
+}
+
+export type pendingFingerprintIssueStateUpdateLogicType = MakeLogicType<
+ pendingFingerprintIssueStateUpdateLogicValues,
+ pendingFingerprintIssueStateUpdateLogicActions,
+ Record<string, any>,
+ pendingFingerprintIssueStateUpdateLogicMeta
+>
+
export const pendingFingerprintIssueStateUpdateLogic = kea<pendingFingerprintIssueStateUpdateLogicType>([
path(['products', 'error_tracking', 'logics', 'pendingFingerprintIssueStateUpdateLogic']),
@@ -62,7 +107,9 @@ export const pendingFingerprintIssueStateUpdateLogic = kea<pendingFingerprintIss
selectors({
currentPendingUpdates: [
(s) => [s.pendingUpdates],
- (pendingUpdates): ErrorTrackingPendingFingerprintIssueStateUpdate[] => {
+ (
+ pendingUpdates: Record<string, StoredPendingUpdate>
+ ): ErrorTrackingPendingFingerprintIssueStateUpdate[] => {
const now = Date.now()
const rows: ErrorTrackingPendingFingerprintIssueStateUpdate[] = []
for (const row of Object.values(pendingUpdates)) {
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/assignmentRuleModalLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/assignmentRuleModalLogic.ts
index 3913727fa11d..25b66b474eb6 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/assignmentRuleModalLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/assignmentRuleModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -8,7 +8,6 @@ import { AnyPropertyFilter, FilterLogicalOperator, UniversalFiltersGroup } from
import { rulesLogic } from '../rules/rulesLogic'
import { ErrorTrackingAssignmentRule, ErrorTrackingRuleType } from '../rules/types'
-import type { assignmentRuleModalLogicType } from './assignmentRuleModalLogicType'
function emptyRule(orderKey: number = 0): ErrorTrackingAssignmentRule {
return {
@@ -20,6 +19,121 @@ function emptyRule(orderKey: number = 0): ErrorTrackingAssignmentRule {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface assignmentRuleModalLogicValues {
+ dateRange: string
+ deleting: boolean
+ deletingLoading: boolean
+ hasAssignee: boolean
+ hasFilters: boolean
+ isOpen: boolean
+ matchResult: {
+ exceptionCount: number
+ issueCount: number
+ } | null
+ matchResultLoading: boolean
+ rule: ErrorTrackingAssignmentRule
+ saving: boolean
+ savingLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface assignmentRuleModalLogicActions {
+ closeModal: () => {
+ value: true
+ }
+ deleteRule: () => any
+ deleteRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteRuleSuccess: (
+ deleting: boolean,
+ payload?: any
+ ) => {
+ deleting: boolean
+ payload?: any
+ }
+ increaseDateRange: () => {
+ value: true
+ }
+ loadMatchCount: () => any
+ loadMatchCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMatchCountSuccess: (
+ matchResult: {
+ exceptionCount: any
+ issueCount: any
+ } | null,
+ payload?: any
+ ) => {
+ matchResult: {
+ exceptionCount: any
+ issueCount: any
+ } | null
+ payload?: any
+ }
+ openModal: (rule?: ErrorTrackingAssignmentRule) => {
+ rule: ErrorTrackingAssignmentRule | null
+ }
+ resetMatchCount: () => any
+ resetMatchCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ resetMatchCountSuccess: (
+ matchResult: null,
+ payload?: any
+ ) => {
+ matchResult: null
+ payload?: any
+ }
+ saveRule: () => any
+ saveRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveRuleSuccess: (
+ saving: boolean,
+ payload?: any
+ ) => {
+ saving: boolean
+ payload?: any
+ }
+ updateRule: (rule: ErrorTrackingAssignmentRule) => {
+ rule: ErrorTrackingAssignmentRule
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface assignmentRuleModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasFilters: (rule: ErrorTrackingAssignmentRule) => boolean
+ hasAssignee: (rule: ErrorTrackingAssignmentRule) => boolean
+ }
+}
+
+export type assignmentRuleModalLogicType = MakeLogicType<
+ assignmentRuleModalLogicValues,
+ assignmentRuleModalLogicActions,
+ Record<string, any>,
+ assignmentRuleModalLogicMeta
+>
+
export const assignmentRuleModalLogic = kea<assignmentRuleModalLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/codeOwnersModalLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/codeOwnersModalLogic.ts
index a406042d2229..d23d015fe69f 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/codeOwnersModalLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/assignment_rules/codeOwnersModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -10,6 +10,7 @@ import { rolesLogic } from 'scenes/settings/organization/Permissions/Roles/roles
import { ErrorTrackingIssueAssignee, NodeKind, ProductKey } from '~/queries/schema/schema-general'
import { AnyPropertyFilter, OrganizationMemberType, RoleType } from '~/types'
+import type { OrganizationType } from '../../../../../../frontend/src/types'
import { assigneeSelectLogic } from '../../../components/Assignee/assigneeSelectLogic'
import { rulesLogic } from '../rules/rulesLogic'
import { ErrorTrackingAssignmentRule, ErrorTrackingRuleType } from '../rules/types'
@@ -22,7 +23,6 @@ import {
buildOwnerRows,
buildSavableRows,
} from './codeownersImport'
-import type { codeOwnersModalLogicType } from './codeOwnersModalLogicType'
export type MatchCount = { exceptionCount: number; issueCount: number }
export type SaveAllResult = { createdCount: number; failedCount: number; totalCount: number }
@@ -36,6 +36,144 @@ function distinctRejectionReasons(reasons: unknown[]): string[] {
return Array.from(new Set(messages.filter(Boolean)))
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface codeOwnersModalLogicValues {
+ meFirstMembers: OrganizationMemberType[] // assigneeSelectLogic
+ currentOrganization: OrganizationType | null // organizationLogic
+ roles: RoleType[] // rolesLogic
+ assigneeOverrides: Record<string, ErrorTrackingIssueAssignee | null>
+ dateRange: string
+ hasParsedOwners: boolean
+ isOpen: boolean
+ mappingRows: CodeOwnerOwnerMapping[]
+ mappingUnresolvedCount: number
+ matchResults: Record<string, MatchCount | null>
+ matchResultsLoading: boolean
+ ownerRows: CodeOwnerRuleCandidate[]
+ ownersToMap: string[]
+ parseErrors: CodeownersError[]
+ parsedOwners: OwnerGroup[]
+ rawText: string
+ savableRows: CodeOwnerRuleCandidate[]
+ saving: SaveAllResult
+ savingLoading: boolean
+ step: 'configure' | 'impact' | 'paste'
+ unmatchedCount: number
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface codeOwnersModalLogicActions {
+ ensureAssigneeTypesLoaded: () => {
+ value: true
+ } // assigneeSelectLogic
+ loadRoles: () => any // rolesLogic
+ backToMapping: () => {
+ value: true
+ }
+ backToPaste: () => {
+ value: true
+ }
+ closeModal: () => {
+ value: true
+ }
+ goToConfigure: () => {
+ value: true
+ }
+ goToImpact: () => {
+ value: true
+ }
+ openModal: () => {
+ value: true
+ }
+ resetMatchResults: () => any
+ resetMatchResultsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ resetMatchResultsSuccess: (
+ matchResults: Record<string, MatchCount | null>,
+ payload?: any
+ ) => {
+ matchResults: Record<string, MatchCount | null>
+ payload?: any
+ }
+ saveAll: () => any
+ saveAllFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveAllSuccess: (
+ saving: SaveAllResult,
+ payload?: any
+ ) => {
+ saving: SaveAllResult
+ payload?: any
+ }
+ setDateRange: (dateRange: string) => {
+ dateRange: string
+ }
+ setOwnerAssignee: (
+ owner: string,
+ assignee: ErrorTrackingIssueAssignee | null
+ ) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ owner: string
+ }
+ setOwnersToMap: (owners: string[]) => {
+ owners: string[]
+ }
+ setRawText: (rawText: string) => {
+ rawText: string
+ }
+ testMatches: () => any
+ testMatchesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ testMatchesSuccess: (
+ matchResults: Record<string, MatchCount | null>,
+ payload?: any
+ ) => {
+ matchResults: Record<string, MatchCount | null>
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface codeOwnersModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ parsedOwners: (rawText: string) => OwnerGroup[]
+ ownerRows: (
+ parsedOwners: OwnerGroup[],
+ roles: RoleType[],
+ meFirstMembers: OrganizationMemberType[],
+ assigneeOverrides: Record<string, ErrorTrackingIssueAssignee | null>
+ ) => CodeOwnerRuleCandidate[]
+ savableRows: (ownerRows: CodeOwnerRuleCandidate[]) => CodeOwnerRuleCandidate[]
+ mappingRows: (ownerRows: CodeOwnerRuleCandidate[], ownersToMap: string[]) => CodeOwnerOwnerMapping[]
+ hasParsedOwners: (parsedOwners: OwnerGroup[]) => boolean
+ parseErrors: (rawText: string) => CodeownersError[]
+ unmatchedCount: (ownerRows: CodeOwnerRuleCandidate[]) => number
+ mappingUnresolvedCount: (mappingRows: CodeOwnerOwnerMapping[]) => number
+ }
+}
+
+export type codeOwnersModalLogicType = MakeLogicType<
+ codeOwnersModalLogicValues,
+ codeOwnersModalLogicActions,
+ Record<string, any>,
+ codeOwnersModalLogicMeta
+>
+
export const codeOwnersModalLogic = kea<codeOwnersModalLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/bypass_rules/bypassRuleModalLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/bypass_rules/bypassRuleModalLogic.ts
index 5810940ca330..28b01e688e5c 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/bypass_rules/bypassRuleModalLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/bypass_rules/bypassRuleModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -7,7 +7,7 @@ import { FilterLogicalOperator, UniversalFiltersGroup } from '~/types'
import { rulesLogic } from '../rules/rulesLogic'
import { ErrorTrackingBypassRule, ErrorTrackingRuleType } from '../rules/types'
-import type { bypassRuleModalLogicType } from './bypassRuleModalLogicType'
+import type { ErrorTrackingBaseRule } from '../rules/types'
function emptyRule(orderKey: number = 0): ErrorTrackingBypassRule {
return {
@@ -18,6 +18,74 @@ function emptyRule(orderKey: number = 0): ErrorTrackingBypassRule {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface bypassRuleModalLogicValues {
+ deleting: boolean
+ deletingLoading: boolean
+ hasFilters: boolean
+ isOpen: boolean
+ rule: ErrorTrackingBypassRule
+ saving: boolean
+ savingLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface bypassRuleModalLogicActions {
+ closeModal: () => {
+ value: true
+ }
+ deleteRule: () => any
+ deleteRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteRuleSuccess: (
+ deleting: boolean,
+ payload?: any
+ ) => {
+ deleting: boolean
+ payload?: any
+ }
+ openModal: (rule?: ErrorTrackingBypassRule) => {
+ rule: ErrorTrackingBaseRule | null
+ }
+ saveRule: () => any
+ saveRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveRuleSuccess: (
+ saving: boolean,
+ payload?: any
+ ) => {
+ saving: boolean
+ payload?: any
+ }
+ updateRule: (rule: ErrorTrackingBypassRule) => {
+ rule: ErrorTrackingBaseRule
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface bypassRuleModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasFilters: (rule: ErrorTrackingBaseRule) => boolean
+ }
+}
+
+export type bypassRuleModalLogicType = MakeLogicType<
+ bypassRuleModalLogicValues,
+ bypassRuleModalLogicActions,
+ Record<string, any>,
+ bypassRuleModalLogicMeta
+>
+
export const bypassRuleModalLogic = kea<bypassRuleModalLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/exception_autocapture/disableSurveyLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/exception_autocapture/disableSurveyLogic.ts
index 8c14fa7698d8..b9f7fec5fba2 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/exception_autocapture/disableSurveyLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/exception_autocapture/disableSurveyLogic.ts
@@ -1,12 +1,43 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import posthog from 'posthog-js'
import { SurveyQuestion } from '~/types'
-import type { disableSurveyLogicType } from './disableSurveyLogicType'
-
const SURVEY_ID = '019c89a0-1469-0000-a31c-35883eb31be4'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface disableSurveyLogicValues {
+ openResponse: string
+ selectedChoice: string | null
+ submitted: boolean
+ surveyQuestions: SurveyQuestion[]
+ visible: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface disableSurveyLogicActions {
+ hideSurvey: () => {
+ value: true
+ }
+ setOpenResponse: (response: string) => {
+ response: string
+ }
+ setSelectedChoice: (choice: string) => {
+ choice: string
+ }
+ setSurveyQuestions: (questions: SurveyQuestion[]) => {
+ questions: SurveyQuestion[]
+ }
+ showSurvey: () => {
+ value: true
+ }
+ submitResponse: () => {
+ value: true
+ }
+}
+
+export type disableSurveyLogicType = MakeLogicType<disableSurveyLogicValues, disableSurveyLogicActions>
+
export const disableSurveyLogic = kea<disableSurveyLogicType>([
path(['scenes', 'error-tracking', 'configuration', 'disableSurveyLogic']),
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/grouping_rules/groupingRuleModalLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/grouping_rules/groupingRuleModalLogic.ts
index 21e8135cf2a4..04b8319753ef 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/grouping_rules/groupingRuleModalLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/grouping_rules/groupingRuleModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -8,7 +8,6 @@ import { AnyPropertyFilter, FilterLogicalOperator, UniversalFiltersGroup } from
import { rulesLogic } from '../rules/rulesLogic'
import { ErrorTrackingGroupingRule, ErrorTrackingRuleType } from '../rules/types'
-import type { groupingRuleModalLogicType } from './groupingRuleModalLogicType'
function emptyRule(orderKey: number = 0): ErrorTrackingGroupingRule {
return {
@@ -20,6 +19,119 @@ function emptyRule(orderKey: number = 0): ErrorTrackingGroupingRule {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupingRuleModalLogicValues {
+ dateRange: string
+ deleting: boolean
+ deletingLoading: boolean
+ hasFilters: boolean
+ isOpen: boolean
+ matchResult: {
+ exceptionCount: number
+ issueCount: number
+ } | null
+ matchResultLoading: boolean
+ rule: ErrorTrackingGroupingRule
+ saving: boolean
+ savingLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupingRuleModalLogicActions {
+ closeModal: () => {
+ value: true
+ }
+ deleteRule: () => any
+ deleteRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteRuleSuccess: (
+ deleting: boolean,
+ payload?: any
+ ) => {
+ deleting: boolean
+ payload?: any
+ }
+ increaseDateRange: () => {
+ value: true
+ }
+ loadMatchCount: () => any
+ loadMatchCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMatchCountSuccess: (
+ matchResult: {
+ exceptionCount: any
+ issueCount: any
+ } | null,
+ payload?: any
+ ) => {
+ matchResult: {
+ exceptionCount: any
+ issueCount: any
+ } | null
+ payload?: any
+ }
+ openModal: (rule?: ErrorTrackingGroupingRule) => {
+ rule: ErrorTrackingGroupingRule | null
+ }
+ resetMatchCount: () => any
+ resetMatchCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ resetMatchCountSuccess: (
+ matchResult: null,
+ payload?: any
+ ) => {
+ matchResult: null
+ payload?: any
+ }
+ saveRule: () => any
+ saveRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveRuleSuccess: (
+ saving: boolean,
+ payload?: any
+ ) => {
+ saving: boolean
+ payload?: any
+ }
+ updateRule: (rule: ErrorTrackingGroupingRule) => {
+ rule: ErrorTrackingGroupingRule
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface groupingRuleModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasFilters: (rule: ErrorTrackingGroupingRule) => boolean
+ }
+}
+
+export type groupingRuleModalLogicType = MakeLogicType<
+ groupingRuleModalLogicValues,
+ groupingRuleModalLogicActions,
+ Record<string, any>,
+ groupingRuleModalLogicMeta
+>
+
export const groupingRuleModalLogic = kea<groupingRuleModalLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/issueRateLimitConfigLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/issueRateLimitConfigLogic.ts
index a294dc1c7f6a..bb651812e24f 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/issueRateLimitConfigLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/issueRateLimitConfigLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -9,7 +10,6 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { HogQLQueryResponse, NodeKind, ProductKey } from '~/queries/schema/schema-general'
-import type { issueRateLimitConfigLogicType } from './issueRateLimitConfigLogicType'
import {
DEFAULT_BUCKET_MINUTES,
BYPASSED_METRIC_NAME,
@@ -39,6 +39,218 @@ const DEFAULT_CONFIG: IssueRateLimitConfigForm = {
per_issue_rate_limit_bucket_size_minutes: DEFAULT_BUCKET_MINUTES,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueRateLimitConfigLogicValues {
+ chartMode: RateLimitChartMode
+ config: ErrorTrackingSettings | null
+ configForm: IssueRateLimitConfigForm
+ configFormAllErrors: Record<string, any>
+ configFormChanged: boolean
+ configFormErrors: DeepPartialMap<IssueRateLimitConfigForm, ValidationErrorType>
+ configFormHasErrors: boolean
+ configFormManualErrors: Record<string, any>
+ configFormTouched: boolean
+ configFormTouches: Record<string, boolean>
+ configFormValidationErrors: DeepPartialMap<IssueRateLimitConfigForm, ValidationErrorType>
+ configLoading: boolean
+ hasLoadedConfig: boolean
+ isConfigFormSubmitting: boolean
+ isConfigFormValid: boolean
+ selectedIssue: TopIssue | null
+ selectedIssueHistory: RateLimitHistoryBucket[]
+ selectedIssueHistoryLoading: boolean
+ selectedIssueId: string | null
+ selectedIssueVolume: ExceptionVolumeBucket[]
+ selectedIssueVolumeLoading: boolean
+ showConfigFormErrors: boolean
+ topIssues: TopIssue[]
+ topIssuesLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueRateLimitConfigLogicActions {
+ loadConfig: () => any
+ loadConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadConfigSuccess: (
+ config: ErrorTrackingSettings,
+ payload?: any
+ ) => {
+ config: ErrorTrackingSettings
+ payload?: any
+ }
+ loadSelectedIssueHistory: ({
+ issueId,
+ bucketMinutes,
+ force,
+ }: {
+ bucketMinutes: number
+ force?: boolean
+ issueId: string
+ }) => {
+ issueId: string
+ bucketMinutes: number
+ force?: boolean
+ }
+ loadSelectedIssueHistoryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSelectedIssueHistorySuccess: (
+ selectedIssueHistory: RateLimitHistoryBucket[],
+ payload?: {
+ issueId: string
+ bucketMinutes: number
+ force?: boolean
+ }
+ ) => {
+ selectedIssueHistory: RateLimitHistoryBucket[]
+ payload?: {
+ issueId: string
+ bucketMinutes: number
+ force?: boolean
+ }
+ }
+ loadSelectedIssueVolume: ({
+ issueId,
+ bucketMinutes,
+ force,
+ }: {
+ bucketMinutes: number
+ force?: boolean
+ issueId: string
+ }) => {
+ issueId: string
+ bucketMinutes: number
+ force?: boolean
+ }
+ loadSelectedIssueVolumeFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSelectedIssueVolumeSuccess: (
+ selectedIssueVolume: {
+ bucket: string
+ count: number
+ }[],
+ payload?: {
+ issueId: string
+ bucketMinutes: number
+ force?: boolean
+ }
+ ) => {
+ selectedIssueVolume: {
+ bucket: string
+ count: number
+ }[]
+ payload?: {
+ issueId: string
+ bucketMinutes: number
+ force?: boolean
+ }
+ }
+ loadTopIssues: ({ bucketMinutes }: { bucketMinutes: number }) => {
+ bucketMinutes: number
+ }
+ loadTopIssuesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTopIssuesSuccess: (
+ topIssues: {
+ description: string | null
+ issue_id: string
+ name: string | null
+ occurrences: number
+ }[],
+ payload?: {
+ bucketMinutes: number
+ }
+ ) => {
+ topIssues: {
+ description: string | null
+ issue_id: string
+ name: string | null
+ occurrences: number
+ }[]
+ payload?: {
+ bucketMinutes: number
+ }
+ }
+ refreshChart: () => {
+ value: true
+ }
+ resetConfigForm: (values?: IssueRateLimitConfigForm) => {
+ values?: IssueRateLimitConfigForm
+ }
+ selectIssue: (issueId: string | null) => {
+ issueId: string | null
+ }
+ setChartMode: (mode: RateLimitChartMode) => {
+ mode: RateLimitChartMode
+ }
+ setConfigFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setConfigFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setConfigFormValues: (values: DeepPartial<IssueRateLimitConfigForm>) => {
+ values: DeepPartial<IssueRateLimitConfigForm>
+ }
+ submitConfigForm: () => {
+ value: boolean
+ }
+ submitConfigFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitConfigFormRequest: (configForm: IssueRateLimitConfigForm) => {
+ configForm: IssueRateLimitConfigForm
+ }
+ submitConfigFormSuccess: (configForm: IssueRateLimitConfigForm) => {
+ configForm: IssueRateLimitConfigForm
+ }
+ touchConfigFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface issueRateLimitConfigLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ selectedIssue: (topIssues: TopIssue[], selectedIssueId: string | null) => TopIssue | null
+ }
+}
+
+export type issueRateLimitConfigLogicType = MakeLogicType<
+ issueRateLimitConfigLogicValues,
+ issueRateLimitConfigLogicActions,
+ Record<string, any>,
+ issueRateLimitConfigLogicMeta
+>
+
export const issueRateLimitConfigLogic = kea<issueRateLimitConfigLogicType>([
path([
'products',
@@ -254,7 +466,7 @@ export const issueRateLimitConfigLogic = kea<issueRateLimitConfigLogicType>([
selectors({
selectedIssue: [
(s) => [s.topIssues, s.selectedIssueId],
- (issues, selectedId) => issues.find((i) => i.issue_id === selectedId) ?? null,
+ (issues: TopIssue[], selectedId: string | null) => issues.find((i) => i.issue_id === selectedId) ?? null,
],
}),
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/rateLimitConfigLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/rateLimitConfigLogic.ts
index fe2bec69eaac..a5f46815f12c 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/rateLimitConfigLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rate_limit/rateLimitConfigLogic.ts
@@ -1,5 +1,6 @@
-import { actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -10,8 +11,6 @@ import { teamLogic } from 'scenes/teamLogic'
import { HogQLQueryResponse, NodeKind, ProductKey } from '~/queries/schema/schema-general'
-import type { rateLimitConfigLogicType } from './rateLimitConfigLogicType'
-
export interface RateLimitConfigForm {
project_rate_limit_value: number | null
project_rate_limit_bucket_size_minutes: number
@@ -69,6 +68,130 @@ export const RECORDED_METRIC_NAME = 'allowed'
export const DROPPED_METRIC_NAME = 'rate_limited'
export const BYPASSED_METRIC_NAME = 'bypassed'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rateLimitConfigLogicValues {
+ currentTeamId: number | null // teamLogic
+ chartMode: RateLimitChartMode
+ config: ErrorTrackingSettings | null
+ configForm: RateLimitConfigForm
+ configFormAllErrors: Record<string, any>
+ configFormChanged: boolean
+ configFormErrors: DeepPartialMap<RateLimitConfigForm, ValidationErrorType>
+ configFormHasErrors: boolean
+ configFormManualErrors: Record<string, any>
+ configFormTouched: boolean
+ configFormTouches: Record<string, boolean>
+ configFormValidationErrors: DeepPartialMap<RateLimitConfigForm, ValidationErrorType>
+ configLoading: boolean
+ hasLoadedConfig: boolean
+ history: RateLimitHistoryBucket[]
+ historyLoading: boolean
+ isConfigFormSubmitting: boolean
+ isConfigFormValid: boolean
+ showConfigFormErrors: boolean
+ volume: ExceptionVolumeBucket[]
+ volumeBucketMinutes: number
+ volumeLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rateLimitConfigLogicActions {
+ loadConfig: () => any
+ loadConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadConfigSuccess: (
+ config: ErrorTrackingSettings,
+ payload?: any
+ ) => {
+ config: ErrorTrackingSettings
+ payload?: any
+ }
+ loadHistory: ({ bucketMinutes, force }: ChartLoadParams) => ChartLoadParams
+ loadHistoryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHistorySuccess: (
+ history: RateLimitHistoryBucket[],
+ payload?: ChartLoadParams
+ ) => {
+ history: RateLimitHistoryBucket[]
+ payload?: ChartLoadParams
+ }
+ loadVolume: ({ bucketMinutes, force }: ChartLoadParams) => ChartLoadParams
+ loadVolumeFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadVolumeSuccess: (
+ volume: {
+ bucket: string
+ count: number
+ }[],
+ payload?: ChartLoadParams
+ ) => {
+ volume: {
+ bucket: string
+ count: number
+ }[]
+ payload?: ChartLoadParams
+ }
+ refreshChart: () => {
+ value: true
+ }
+ resetConfigForm: (values?: RateLimitConfigForm) => {
+ values?: RateLimitConfigForm
+ }
+ setChartMode: (mode: RateLimitChartMode) => {
+ mode: RateLimitChartMode
+ }
+ setConfigFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setConfigFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setConfigFormValues: (values: DeepPartial<RateLimitConfigForm>) => {
+ values: DeepPartial<RateLimitConfigForm>
+ }
+ submitConfigForm: () => {
+ value: boolean
+ }
+ submitConfigFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitConfigFormRequest: (configForm: RateLimitConfigForm) => {
+ configForm: RateLimitConfigForm
+ }
+ submitConfigFormSuccess: (configForm: RateLimitConfigForm) => {
+ configForm: RateLimitConfigForm
+ }
+ touchConfigFormField: (key: string) => {
+ key: string
+ }
+}
+
+export type rateLimitConfigLogicType = MakeLogicType<rateLimitConfigLogicValues, rateLimitConfigLogicActions>
+
export const rateLimitConfigLogic = kea<rateLimitConfigLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/releases/releasesLogic.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/releases/releasesLogic.tsx
index 21984884e139..45068bce18c6 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/releases/releasesLogic.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/releases/releasesLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, defaults, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, defaults, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api, { CountedPaginatedResponse } from 'lib/api'
@@ -8,12 +8,74 @@ import { urls } from 'scenes/urls'
import { Breadcrumb } from '~/types'
-import type { releasesLogicType } from './releasesLogicType'
-
export const RESULTS_PER_PAGE = 20
export type ErrorTrackingReleaseResponse = CountedPaginatedResponse<ErrorTrackingRelease>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface releasesLogicValues {
+ breadcrumbs: Breadcrumb[]
+ page: number
+ pagination: {
+ controlled: true
+ currentPage: number
+ entryCount: number
+ onBackward: () => void
+ onForward: () => void
+ pageSize: number
+ }
+ releaseResponse: ErrorTrackingReleaseResponse | null
+ releaseResponseLoading: boolean
+ releases: ErrorTrackingRelease[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface releasesLogicActions {
+ loadReleases: () => void
+ loadReleasesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadReleasesSuccess: (
+ releaseResponse: CountedPaginatedResponse<ErrorTrackingRelease>,
+ payload?: void
+ ) => {
+ releaseResponse: CountedPaginatedResponse<ErrorTrackingRelease>
+ payload?: void
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface releasesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ releases: (releaseResponse: ErrorTrackingReleaseResponse | null) => ErrorTrackingRelease[]
+ pagination: (
+ page: number,
+ releaseResponse: ErrorTrackingReleaseResponse | null
+ ) => {
+ controlled: true
+ currentPage: number
+ entryCount: number
+ onBackward: () => void
+ onForward: () => void
+ pageSize: number
+ }
+ }
+}
+
+export type releasesLogicType = MakeLogicType<
+ releasesLogicValues,
+ releasesLogicActions,
+ Record<string, any>,
+ releasesLogicMeta
+>
+
export const releasesLogic = kea<releasesLogicType>([
path(['products', 'error_tracking', 'scenes', 'ErrorTrackingConfigurationScene', 'releases', 'releasesLogic']),
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rules/rulesLogic.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rules/rulesLogic.tsx
index 7793151978be..09461306d0bf 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rules/rulesLogic.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/rules/rulesLogic.tsx
@@ -1,11 +1,10 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { FilterLogicalOperator } from '~/types'
-import type { rulesLogicType } from './rulesLogicType'
import { ErrorTrackingRule, ErrorTrackingRuleNew, ErrorTrackingRuleType, ErrorTrackingRulesLogicProps } from './types'
function createNewRule(ruleType: ErrorTrackingRuleType, order_key: number): ErrorTrackingRuleNew {
@@ -47,6 +46,150 @@ function createNewRule(ruleType: ErrorTrackingRuleType, order_key: number): Erro
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rulesLogicValues {
+ allRules: ErrorTrackingRule[]
+ hasNewRule: boolean
+ initialLoadComplete: boolean
+ isReorderingRules: boolean
+ isSelectingRules: boolean
+ localRules: ErrorTrackingRule[]
+ rules: ErrorTrackingRule[]
+ rulesLoading: boolean
+ selectedRuleIds: ErrorTrackingRule['id'][]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rulesLogicActions {
+ _setLocalRules: (rules: ErrorTrackingRule[]) => {
+ rules: ErrorTrackingRule[]
+ }
+ addRule: () => {
+ value: true
+ }
+ cancelReorderingRules: () => {
+ value: true
+ }
+ cancelSelectingRules: () => {
+ value: true
+ }
+ deleteRule: (id: any) => any
+ deleteRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteRuleSuccess: (
+ rules: ErrorTrackingRule[],
+ payload?: any
+ ) => {
+ rules: ErrorTrackingRule[]
+ payload?: any
+ }
+ deleteSelectedRules: () => any
+ deleteSelectedRulesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteSelectedRulesSuccess: (
+ rules: ErrorTrackingRule[],
+ payload?: any
+ ) => {
+ rules: ErrorTrackingRule[]
+ payload?: any
+ }
+ finishReorderingRules: () => any
+ finishReorderingRulesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ finishReorderingRulesSuccess: (
+ rules: ErrorTrackingRule[],
+ payload?: any
+ ) => {
+ rules: ErrorTrackingRule[]
+ payload?: any
+ }
+ loadRules: () => any
+ loadRulesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRulesSuccess: (
+ rules: ErrorTrackingRule[],
+ payload?: any
+ ) => {
+ rules: ErrorTrackingRule[]
+ payload?: any
+ }
+ reorderLocalRules: (rules: ErrorTrackingRule[]) => {
+ rules: ErrorTrackingRule[]
+ }
+ saveRule: (id: any) => any
+ saveRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveRuleSuccess: (
+ rules: ErrorTrackingRule[],
+ payload?: any
+ ) => {
+ rules: ErrorTrackingRule[]
+ payload?: any
+ }
+ setRuleEditable: (id: ErrorTrackingRule['id']) => {
+ id: string
+ }
+ setSelectedRuleIds: (ids: ErrorTrackingRule['id'][]) => {
+ ids: string[]
+ }
+ startReorderingRules: () => {
+ value: true
+ }
+ startSelectingRules: () => {
+ value: true
+ }
+ toggleSelectedRule: (id: ErrorTrackingRule['id']) => {
+ id: string
+ }
+ unsetRuleEditable: (id: ErrorTrackingRule['id']) => {
+ id: string
+ }
+ updateLocalRule: (rule: ErrorTrackingRule) => {
+ rule: ErrorTrackingRule
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface rulesLogicMeta {
+ key: ErrorTrackingRuleType
+ __keaTypeGenInternalSelectorTypes: {
+ allRules: (localRules: ErrorTrackingRule[], rules: ErrorTrackingRule[]) => ErrorTrackingRule[]
+ hasNewRule: (allRules: ErrorTrackingRule[]) => boolean
+ }
+}
+
+export type rulesLogicType = MakeLogicType<
+ rulesLogicValues,
+ rulesLogicActions,
+ ErrorTrackingRulesLogicProps,
+ rulesLogicMeta
+>
+
export const rulesLogic = kea<rulesLogicType>([
props({} as ErrorTrackingRulesLogicProps),
key(({ ruleType }) => ruleType),
@@ -208,11 +351,14 @@ export const rulesLogic = kea<rulesLogicType>([
selectors({
allRules: [
(s) => [s.localRules, s.rules],
- (localRules, rules): ErrorTrackingRule[] => {
+ (localRules: ErrorTrackingRule[], rules: ErrorTrackingRule[]): ErrorTrackingRule[] => {
const uniqueRules = new Map([...rules, ...localRules].map((item) => [item.id, item]))
return Array.from(uniqueRules.values()).sort((a, b) => a.order_key - b.order_key)
},
],
- hasNewRule: [(s) => [s.allRules], (allRules): boolean => allRules.some((r) => r.id === 'new')],
+ hasNewRule: [
+ (s) => [s.allRules],
+ (allRules: ErrorTrackingRule[]): boolean => allRules.some((r) => r.id === 'new'),
+ ],
}),
])
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/recentSpikesLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/recentSpikesLogic.ts
index 6e44e96c0d27..2d4605c003a5 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/recentSpikesLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/recentSpikesLogic.ts
@@ -1,11 +1,9 @@
-import { actions, afterMount, defaults, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, defaults, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api, { CountedPaginatedResponse } from 'lib/api'
import { ErrorTrackingSpikeEvent } from 'lib/components/Errors/types'
-import type { recentSpikesLogicType } from './recentSpikesLogicType'
-
const RESULTS_PER_PAGE = 10
export type SpikeEventOrder =
@@ -18,6 +16,79 @@ export type SpikeEventOrder =
export type RecentSpikesResponse = CountedPaginatedResponse<ErrorTrackingSpikeEvent>
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recentSpikesLogicValues {
+ order: SpikeEventOrder
+ page: number
+ pagination: {
+ controlled: true
+ currentPage: number
+ entryCount: number
+ onBackward: () => void
+ onForward: () => void
+ pageSize: number
+ }
+ recentSpikes: ErrorTrackingSpikeEvent[]
+ spikesResponse: RecentSpikesResponse | null
+ spikesResponseLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recentSpikesLogicActions {
+ loadRecentSpikes: () => {
+ value: true
+ }
+ loadRecentSpikesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRecentSpikesSuccess: (
+ spikesResponse: CountedPaginatedResponse<ErrorTrackingSpikeEvent>,
+ payload?: {
+ value: true
+ }
+ ) => {
+ spikesResponse: CountedPaginatedResponse<ErrorTrackingSpikeEvent>
+ payload?: {
+ value: true
+ }
+ }
+ setOrder: (order: SpikeEventOrder) => {
+ order: SpikeEventOrder
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recentSpikesLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ recentSpikes: (spikesResponse: RecentSpikesResponse | null) => ErrorTrackingSpikeEvent[]
+ pagination: (
+ page: number,
+ spikesResponse: RecentSpikesResponse | null
+ ) => {
+ controlled: true
+ currentPage: number
+ entryCount: number
+ onBackward: () => void
+ onForward: () => void
+ pageSize: number
+ }
+ }
+}
+
+export type recentSpikesLogicType = MakeLogicType<
+ recentSpikesLogicValues,
+ recentSpikesLogicActions,
+ Record<string, any>,
+ recentSpikesLogicMeta
+>
+
export const recentSpikesLogic = kea<recentSpikesLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/spikeDetectionConfigLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/spikeDetectionConfigLogic.ts
index 82d30fea27a6..f67f0bbd83bf 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/spikeDetectionConfigLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/spike_detection/spikeDetectionConfigLogic.ts
@@ -1,5 +1,6 @@
-import { afterMount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { loaders } from 'kea-loaders'
import posthog from 'posthog-js'
@@ -9,8 +10,6 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { HogFunctionType } from '~/types'
-import type { spikeDetectionConfigLogicType } from './spikeDetectionConfigLogicType'
-
export interface SpikeDetectionConfigForm {
snooze_duration_minutes: number
multiplier: number
@@ -23,6 +22,111 @@ const DEFAULT_CONFIG: SpikeDetectionConfigForm = {
threshold: 500,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface spikeDetectionConfigLogicValues {
+ config: ErrorTrackingSpikeDetectionConfig | null
+ configForm: SpikeDetectionConfigForm
+ configFormAllErrors: Record<string, any>
+ configFormChanged: boolean
+ configFormErrors: DeepPartialMap<SpikeDetectionConfigForm, ValidationErrorType>
+ configFormHasErrors: boolean
+ configFormManualErrors: Record<string, any>
+ configFormTouched: boolean
+ configFormTouches: Record<string, boolean>
+ configFormValidationErrors: DeepPartialMap<SpikeDetectionConfigForm, ValidationErrorType>
+ configLoading: boolean
+ hasLoadedConfig: boolean
+ hasSpikeAlerts: boolean
+ isConfigFormSubmitting: boolean
+ isConfigFormValid: boolean
+ showConfigFormErrors: boolean
+ spikeAlerts: HogFunctionType[]
+ spikeAlertsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface spikeDetectionConfigLogicActions {
+ loadConfig: () => any
+ loadConfigFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadConfigSuccess: (
+ config: ErrorTrackingSpikeDetectionConfig,
+ payload?: any
+ ) => {
+ config: ErrorTrackingSpikeDetectionConfig
+ payload?: any
+ }
+ loadSpikeAlerts: () => any
+ loadSpikeAlertsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSpikeAlertsSuccess: (
+ spikeAlerts: HogFunctionType[],
+ payload?: any
+ ) => {
+ spikeAlerts: HogFunctionType[]
+ payload?: any
+ }
+ resetConfigForm: (values?: SpikeDetectionConfigForm) => {
+ values?: SpikeDetectionConfigForm
+ }
+ setConfigFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setConfigFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setConfigFormValues: (values: DeepPartial<SpikeDetectionConfigForm>) => {
+ values: DeepPartial<SpikeDetectionConfigForm>
+ }
+ submitConfigForm: () => {
+ value: boolean
+ }
+ submitConfigFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitConfigFormRequest: (configForm: SpikeDetectionConfigForm) => {
+ configForm: SpikeDetectionConfigForm
+ }
+ submitConfigFormSuccess: (configForm: SpikeDetectionConfigForm) => {
+ configForm: SpikeDetectionConfigForm
+ }
+ touchConfigFormField: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface spikeDetectionConfigLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasSpikeAlerts: (spikeAlerts: HogFunctionType[]) => boolean
+ }
+}
+
+export type spikeDetectionConfigLogicType = MakeLogicType<
+ spikeDetectionConfigLogicValues,
+ spikeDetectionConfigLogicActions,
+ Record<string, any>,
+ spikeDetectionConfigLogicMeta
+>
+
export const spikeDetectionConfigLogic = kea<spikeDetectionConfigLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/suppression_rules/suppressionRuleModalLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/suppression_rules/suppressionRuleModalLogic.ts
index f790d5152d9d..82cb2532abb3 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/suppression_rules/suppressionRuleModalLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/suppression_rules/suppressionRuleModalLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -8,7 +8,6 @@ import { AnyPropertyFilter, FilterLogicalOperator, UniversalFiltersGroup } from
import { rulesLogic } from '../rules/rulesLogic'
import { ErrorTrackingRuleType, ErrorTrackingSuppressionRule } from '../rules/types'
-import type { suppressionRuleModalLogicType } from './suppressionRuleModalLogicType'
function emptyRule(orderKey: number = 0): ErrorTrackingSuppressionRule {
return {
@@ -20,6 +19,122 @@ function emptyRule(orderKey: number = 0): ErrorTrackingSuppressionRule {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface suppressionRuleModalLogicValues {
+ dateRange: string
+ deleting: boolean
+ deletingLoading: boolean
+ hasFilters: boolean
+ isOpen: boolean
+ matchResult: {
+ exceptionCount: number
+ issueCount: number
+ } | null
+ matchResultLoading: boolean
+ rule: ErrorTrackingSuppressionRule
+ saving: boolean
+ savingLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface suppressionRuleModalLogicActions {
+ closeModal: () => {
+ value: true
+ }
+ deleteRule: () => any
+ deleteRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteRuleSuccess: (
+ deleting: boolean,
+ payload?: any
+ ) => {
+ deleting: boolean
+ payload?: any
+ }
+ increaseDateRange: () => {
+ value: true
+ }
+ loadMatchCount: () => any
+ loadMatchCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMatchCountSuccess: (
+ matchResult: {
+ exceptionCount: any
+ issueCount: any
+ },
+ payload?: any
+ ) => {
+ matchResult: {
+ exceptionCount: any
+ issueCount: any
+ }
+ payload?: any
+ }
+ openModal: (rule?: ErrorTrackingSuppressionRule) => {
+ rule: ErrorTrackingSuppressionRule | null
+ }
+ resetMatchCount: () => any
+ resetMatchCountFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ resetMatchCountSuccess: (
+ matchResult: null,
+ payload?: any
+ ) => {
+ matchResult: null
+ payload?: any
+ }
+ saveRule: () => any
+ saveRuleFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ saveRuleSuccess: (
+ saving: boolean,
+ payload?: any
+ ) => {
+ saving: boolean
+ payload?: any
+ }
+ updateRule: (rule: ErrorTrackingSuppressionRule) => {
+ rule: ErrorTrackingSuppressionRule
+ }
+ updateSamplingRate: (sampling_rate: number) => {
+ sampling_rate: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface suppressionRuleModalLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ hasFilters: (rule: ErrorTrackingSuppressionRule) => boolean
+ }
+}
+
+export type suppressionRuleModalLogicType = MakeLogicType<
+ suppressionRuleModalLogicValues,
+ suppressionRuleModalLogicActions,
+ Record<string, any>,
+ suppressionRuleModalLogicMeta
+>
+
export const suppressionRuleModalLogic = kea<suppressionRuleModalLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/symbol_sets/symbolSetLogic.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/symbol_sets/symbolSetLogic.tsx
index 82960f8bbae9..e2d17a3dc9ca 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/symbol_sets/symbolSetLogic.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingConfigurationScene/symbol_sets/symbolSetLogic.tsx
@@ -1,4 +1,4 @@
-import { actions, afterMount, defaults, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, defaults, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
@@ -11,13 +11,102 @@ import { urls } from 'scenes/urls'
import { Breadcrumb } from '~/types'
-import type { symbolSetLogicType } from './symbolSetLogicType'
-
export const RESULTS_PER_PAGE = 20
export type ErrorTrackingSymbolSetResponse = CountedPaginatedResponse<ErrorTrackingSymbolSet>
export type SymbolSetOrder = 'created_at' | '-created_at' | 'last_used' | '-last_used'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface symbolSetLogicValues {
+ breadcrumbs: Breadcrumb[]
+ deleteSymbolSetResponse: null
+ deleteSymbolSetResponseLoading: boolean
+ page: number
+ previouslyCheckedIndex: number | null
+ searchQuery: string
+ selectedSymbolSetIds: string[]
+ shiftKeyHeld: boolean
+ symbolSetOrder: SymbolSetOrder
+ symbolSetResponse: ErrorTrackingSymbolSetResponse | null
+ symbolSetResponseLoading: boolean
+ symbolSetStatusFilter: SymbolSetStatusFilter
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface symbolSetLogicActions {
+ bulkDeleteSymbolSets: () => any
+ bulkDeleteSymbolSetsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ bulkDeleteSymbolSetsSuccess: (
+ deleteSymbolSetResponse: null,
+ payload?: any
+ ) => {
+ deleteSymbolSetResponse: null
+ payload?: any
+ }
+ deleteSymbolSet: (id: string) => string
+ deleteSymbolSetFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteSymbolSetSuccess: (
+ deleteSymbolSetResponse: null,
+ payload?: string
+ ) => {
+ deleteSymbolSetResponse: null
+ payload?: string
+ }
+ downloadSymbolSet: (id: string) => {
+ id: string
+ }
+ loadSymbolSets: () => void
+ loadSymbolSetsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSymbolSetsSuccess: (
+ symbolSetResponse: CountedPaginatedResponse<ErrorTrackingSymbolSet>,
+ payload?: void
+ ) => {
+ symbolSetResponse: CountedPaginatedResponse<ErrorTrackingSymbolSet>
+ payload?: void
+ }
+ setPage: (page: number) => {
+ page: number
+ }
+ setPreviouslyCheckedIndex: (index: number) => {
+ index: number
+ }
+ setSearchQuery: (search: string) => {
+ search: string
+ }
+ setSelectedSymbolSetIds: (ids: string[]) => {
+ ids: string[]
+ }
+ setShiftKeyHeld: (shiftKeyHeld: boolean) => {
+ shiftKeyHeld: boolean
+ }
+ setSymbolSetOrder: (order: SymbolSetOrder) => {
+ order: SymbolSetOrder
+ }
+ setSymbolSetStatusFilter: (status: SymbolSetStatusFilter) => {
+ status: SymbolSetStatusFilter
+ }
+}
+
+export type symbolSetLogicType = MakeLogicType<symbolSetLogicValues, symbolSetLogicActions>
+
export const symbolSetLogic = kea<symbolSetLogicType>([
path(['products', 'error_tracking', 'scenes', 'ErrorTrackingConfigurationScene', 'symbol_sets', 'symbolSetLogic']),
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/errorTrackingIssueFingerprintsSceneLogic.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/errorTrackingIssueFingerprintsSceneLogic.tsx
index f316fbc12160..666a00889063 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/errorTrackingIssueFingerprintsSceneLogic.tsx
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/errorTrackingIssueFingerprintsSceneLogic.tsx
@@ -1,4 +1,17 @@
-import { actions, connect, defaults, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ connect,
+ defaults,
+ events,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -18,7 +31,160 @@ import {
ErrorTrackingFingerprintSamples,
ErrorTrackingIssueFingerprintsSceneProps,
} from './ErrorTrackingIssueFingerprintsScene'
-import type { errorTrackingIssueFingerprintsSceneLogicType } from './errorTrackingIssueFingerprintsSceneLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueFingerprintsSceneLogicValues {
+ breadcrumbs: Breadcrumb[]
+ fingerprintSamples: ErrorTrackingFingerprintSamples[]
+ fingerprintSamplesLoading: boolean
+ isLoading: boolean
+ issue: ErrorTrackingRelationalIssue | null
+ issueFingerprints: ErrorTrackingFingerprint[] | null
+ issueFingerprintsLoading: boolean
+ issueLoading: boolean
+ unmergingFingerprints: Set<string>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueFingerprintsSceneLogicActions {
+ mutationFailure: (
+ mutationName: string,
+ error: unknown
+ ) => {
+ error: unknown
+ mutationName: string
+ } // issueActionsLogic
+ splitIssue: (
+ id: string,
+ fingerprints: {
+ description?: string
+ fingerprint: string
+ name?: string
+ }[]
+ ) => {
+ fingerprints: {
+ description?: string | undefined
+ fingerprint: string
+ name?: string | undefined
+ }[]
+ id: string
+ } // issueActionsLogic
+ splitIssueSuccess: (newIssueIds: string[]) => {
+ newIssueIds: string[]
+ } // issueActionsLogic
+ loadFingerprintSamples: (
+ issue: ErrorTrackingRelationalIssue,
+ fingerprints: ErrorTrackingFingerprint[]
+ ) => {
+ fingerprints: ErrorTrackingFingerprint[]
+ issue: ErrorTrackingRelationalIssue
+ }
+ loadFingerprintSamplesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadFingerprintSamplesSuccess: (
+ fingerprintSamples: {
+ count: any
+ fingerprint: any
+ samples: any
+ }[],
+ payload?: {
+ fingerprints: ErrorTrackingFingerprint[]
+ issue: ErrorTrackingRelationalIssue
+ }
+ ) => {
+ fingerprintSamples: {
+ count: any
+ fingerprint: any
+ samples: any
+ }[]
+ payload?: {
+ fingerprints: ErrorTrackingFingerprint[]
+ issue: ErrorTrackingRelationalIssue
+ }
+ }
+ loadIssue: () => {
+ value: true
+ }
+ loadIssueFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadIssueFingerprints: () => any
+ loadIssueFingerprintsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadIssueFingerprintsSuccess: (
+ issueFingerprints: ErrorTrackingFingerprint[],
+ payload?: any
+ ) => {
+ issueFingerprints: ErrorTrackingFingerprint[]
+ payload?: any
+ }
+ loadIssueSuccess: (
+ issue: ErrorTrackingRelationalIssue,
+ payload?: {
+ value: true
+ }
+ ) => {
+ issue: ErrorTrackingRelationalIssue
+ payload?: {
+ value: true
+ }
+ }
+ unmerge: (fingerprint: string) => {
+ fingerprint: string
+ }
+ unmergeFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ unmergeSuccess: (
+ issueFingerprints: ErrorTrackingFingerprint[],
+ payload?: {
+ fingerprint: string
+ }
+ ) => {
+ issueFingerprints: ErrorTrackingFingerprint[]
+ payload?: {
+ fingerprint: string
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueFingerprintsSceneLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isLoading: (
+ fingerprintSamplesLoading: boolean,
+ issueLoading: boolean,
+ issueFingerprintsLoading: boolean
+ ) => boolean
+ breadcrumbs: (issue: ErrorTrackingRelationalIssue | null) => Breadcrumb[]
+ }
+}
+
+export type errorTrackingIssueFingerprintsSceneLogicType = MakeLogicType<
+ errorTrackingIssueFingerprintsSceneLogicValues,
+ errorTrackingIssueFingerprintsSceneLogicActions,
+ ErrorTrackingIssueFingerprintsSceneProps,
+ errorTrackingIssueFingerprintsSceneLogicMeta
+>
export const errorTrackingIssueFingerprintsSceneLogic = kea<errorTrackingIssueFingerprintsSceneLogicType>([
path((key) => [
@@ -100,13 +266,13 @@ export const errorTrackingIssueFingerprintsSceneLogic = kea<errorTrackingIssueFi
selectors({
isLoading: [
(s) => [s.fingerprintSamplesLoading, s.issueLoading, s.issueFingerprintsLoading],
- (fingerprintSamplesLoading, issueLoading, issueFingerprintsLoading) => {
+ (fingerprintSamplesLoading: boolean, issueLoading: boolean, issueFingerprintsLoading: boolean) => {
return fingerprintSamplesLoading || issueLoading || issueFingerprintsLoading
},
],
breadcrumbs: [
(s) => [s.issue],
- (issue): Breadcrumb[] => {
+ (issue: ErrorTrackingRelationalIssue | null): Breadcrumb[] => {
const breadcrumbs: Breadcrumb[] = [
{
key: Scene.ErrorTracking,
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.ts
index d80a68ded8c4..7e496d3383e9 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneConfigurationLogic.ts
@@ -1,6 +1,4 @@
-import { actions, defaults, kea, path, reducers } from 'kea'
-
-import type { errorTrackingIssueSceneConfigurationLogicType } from './errorTrackingIssueSceneConfigurationLogicType'
+import { MakeLogicType, actions, defaults, kea, path, reducers } from 'kea'
export type ErrorTrackingIssueSceneCategory = 'exceptions' | 'breakdowns' | 'autofix' | 'similar_issues'
@@ -12,6 +10,23 @@ export const VALID_CATEGORIES: ErrorTrackingIssueSceneCategory[] = [
]
export const DEFAULT_CATEGORY: ErrorTrackingIssueSceneCategory = 'exceptions'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueSceneConfigurationLogicValues {
+ category: ErrorTrackingIssueSceneCategory
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueSceneConfigurationLogicActions {
+ setCategory: (category: ErrorTrackingIssueSceneCategory) => {
+ category: ErrorTrackingIssueSceneCategory
+ }
+}
+
+export type errorTrackingIssueSceneConfigurationLogicType = MakeLogicType<
+ errorTrackingIssueSceneConfigurationLogicValues,
+ errorTrackingIssueSceneConfigurationLogicActions
+>
+
export const errorTrackingIssueSceneConfigurationLogic = kea<errorTrackingIssueSceneConfigurationLogicType>([
path([
'products',
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts
index 0ffda6a48020..5ea00bc40d57 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts
@@ -1,4 +1,17 @@
-import { actions, connect, defaults, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ connect,
+ defaults,
+ events,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { subscriptions } from 'kea-subscriptions'
@@ -29,6 +42,12 @@ import {
} from '~/queries/schema/schema-general'
import { ActivityScope, Breadcrumb, IntegrationType, UniversalFiltersGroup } from '~/types'
+import type {
+ ErrorTrackingExternalReference,
+ ErrorTrackingIssueAssignee,
+ ErrorTrackingIssueCohort,
+ EventsQuery,
+} from '../../../../../frontend/src/queries/schema/schema-general'
import { issueActionsLogic } from '../../components/IssueActions/issueActionsLogic'
import {
DEFAULT_DATE_RANGE,
@@ -45,7 +64,6 @@ import {
VALID_CATEGORIES,
errorTrackingIssueSceneConfigurationLogic,
} from './errorTrackingIssueSceneConfigurationLogic'
-import type { errorTrackingIssueSceneLogicType } from './errorTrackingIssueSceneLogicType'
export interface ErrorTrackingIssueSceneLogicProps {
id: ErrorTrackingIssue['id']
@@ -57,6 +75,480 @@ export type ErrorTrackingIssueStatus = ErrorTrackingIssue['status']
export const ERROR_TRACKING_ISSUE_SCENE_LOGIC_KEY = 'ErrorTrackingIssueScene'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueSceneLogicValues {
+ category: ErrorTrackingIssueSceneCategory // errorTrackingIssueSceneConfigurationLogic
+ dateRange: DateRange // issueFiltersLogic
+ filterGroup: UniversalFiltersGroup // issueFiltersLogic
+ filterTestAccounts: boolean // issueFiltersLogic
+ searchQuery: string // issueFiltersLogic
+ aggregations: ErrorTrackingIssueAggregations | undefined
+ breadcrumbs: Breadcrumb[]
+ eventsQuery: EventsQuery
+ eventsQueryKey: string
+ firstSeen: Dayjs | null
+ initialEvent: ErrorEventType | null
+ initialEventLoading: boolean
+ initialEventTimestamp: string | null
+ issue: ErrorTrackingRelationalIssue | null
+ issueFingerprints: ErrorTrackingFingerprint[]
+ issueFingerprintsLoading: boolean
+ issueId: string
+ issueLoading: boolean
+ lastSeen: Dayjs | null
+ listDateRange: DateRange | null
+ maxContext: MaxContextInput[]
+ mobileDetailOpen: boolean
+ properties: ErrorEventProperties | null
+ selectedEvent: ErrorEventType | null
+ sidePanelContext: SidePanelSceneContext
+ similarIssues: SimilarIssue[]
+ similarIssuesError: string | null
+ similarIssuesLoading: boolean
+ similarIssuesMaxDistance: number
+ spikeEvents: ErrorTrackingSpikeEvent[]
+ spikeEventsLoading: boolean
+ summary: ErrorTrackingIssueSummary | null
+ summaryLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueSceneLogicActions {
+ setCategory: (category: ErrorTrackingIssueSceneCategory) => {
+ category: ErrorTrackingIssueSceneCategory
+ } // errorTrackingIssueSceneConfigurationLogic
+ updateIssueAssignee: (
+ id: string,
+ assignee: ErrorTrackingIssueAssignee | null
+ ) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ id: string
+ } // issueActionsLogic
+ updateIssueDescription: (
+ id: string,
+ description: string
+ ) => {
+ description: string
+ id: string
+ } // issueActionsLogic
+ updateIssueName: (
+ id: string,
+ name: string
+ ) => {
+ id: string
+ name: string
+ } // issueActionsLogic
+ updateIssueStatus: (
+ id: string,
+ status: import('~/queries/schema').ErrorTrackingIssueStatus
+ ) => {
+ id: string
+ status: import('~/queries/schema').ErrorTrackingIssueStatus
+ } // issueActionsLogic
+ setDateRange: (dateRange: DateRange) => {
+ dateRange: DateRange
+ } // issueFiltersLogic
+ setFilterGroup: (filterGroup: UniversalFiltersGroup) => {
+ filterGroup: UniversalFiltersGroup
+ } // issueFiltersLogic
+ setFilterTestAccounts: (filterTestAccounts: boolean) => {
+ filterTestAccounts: boolean
+ } // issueFiltersLogic
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ } // issueFiltersLogic
+ createExternalReference: (
+ integrationId: IntegrationType['id'],
+ config: Record<string, string>
+ ) => {
+ config: Record<string, string>
+ integrationId: number
+ }
+ createExternalReferenceFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createExternalReferenceSuccess: (
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues: ErrorTrackingExternalReference[]
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null,
+ payload?: {
+ config: Record<string, string>
+ integrationId: number
+ }
+ ) => {
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues: ErrorTrackingExternalReference[]
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null
+ payload?: {
+ config: Record<string, string>
+ integrationId: number
+ }
+ }
+ loadInitialEvent: (timestamp: string) => {
+ timestamp: string
+ }
+ loadInitialEventFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadInitialEventSuccess: (
+ initialEvent: ErrorEventType | null,
+ payload?: {
+ timestamp: string
+ }
+ ) => {
+ initialEvent: ErrorEventType | null
+ payload?: {
+ timestamp: string
+ }
+ }
+ loadIssue: () => {
+ value: true
+ }
+ loadIssueFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadIssueFingerprints: () => any
+ loadIssueFingerprintsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadIssueFingerprintsSuccess: (
+ issueFingerprints: ErrorTrackingFingerprint[],
+ payload?: any
+ ) => {
+ issueFingerprints: ErrorTrackingFingerprint[]
+ payload?: any
+ }
+ loadIssueSuccess: (
+ issue: ErrorTrackingRelationalIssue,
+ payload?: {
+ value: true
+ }
+ ) => {
+ issue: ErrorTrackingRelationalIssue
+ payload?: {
+ value: true
+ }
+ }
+ loadSimilarIssues: (refresh?: boolean) => boolean
+ loadSimilarIssuesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSimilarIssuesSuccess: (
+ similarIssues: SimilarIssue[],
+ payload?: boolean
+ ) => {
+ similarIssues: SimilarIssue[]
+ payload?: boolean
+ }
+ loadSpikeEvents: () => any
+ loadSpikeEventsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSpikeEventsSuccess: (
+ spikeEvents: ErrorTrackingSpikeEvent[],
+ payload?: any
+ ) => {
+ spikeEvents: ErrorTrackingSpikeEvent[]
+ payload?: any
+ }
+ loadSummary: () => {
+ value: true
+ }
+ loadSummaryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSummarySuccess: (
+ summary: {
+ aggregations: ErrorTrackingIssueAggregations
+ first_seen: string
+ last_seen: string
+ } | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ summary: {
+ aggregations: ErrorTrackingIssueAggregations
+ first_seen: string
+ last_seen: string
+ } | null
+ payload?: {
+ value: true
+ }
+ }
+ selectEvent: (event: ErrorEventType | null) => {
+ event: ErrorEventType | null
+ }
+ setInitialEventTimestamp: (timestamp: string | null) => {
+ timestamp: string | null
+ }
+ setIssue: (issue: ErrorTrackingRelationalIssue) => {
+ issue: ErrorTrackingRelationalIssue
+ }
+ setIssueFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ setIssueSuccess: (
+ issue: ErrorTrackingRelationalIssue,
+ payload?: {
+ issue: ErrorTrackingRelationalIssue
+ }
+ ) => {
+ issue: ErrorTrackingRelationalIssue
+ payload?: {
+ issue: ErrorTrackingRelationalIssue
+ }
+ }
+ setLastSeen: (lastSeen: string) => {
+ lastSeen: string
+ }
+ setListDateRange: (dateRange: DateRange) => {
+ dateRange: DateRange
+ }
+ setMobileDetailOpen: (mobileDetailOpen: boolean) => {
+ mobileDetailOpen: boolean
+ }
+ setSimilarIssuesMaxDistance: (distance: number) => {
+ distance: number
+ }
+ updateAssignee: (assignee: ErrorTrackingIssue['assignee']) => {
+ assignee: ErrorTrackingIssueAssignee | null
+ }
+ updateAssigneeFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateAssigneeSuccess: (
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null,
+ payload?: {
+ assignee: ErrorTrackingIssueAssignee | null
+ }
+ ) => {
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null
+ payload?: {
+ assignee: ErrorTrackingIssueAssignee | null
+ }
+ }
+ updateDescription: (description: string) => {
+ description: string
+ }
+ updateDescriptionFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateDescriptionSuccess: (
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null,
+ payload?: {
+ description: string
+ }
+ ) => {
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null
+ payload?: {
+ description: string
+ }
+ }
+ updateName: (name: string) => {
+ name: string
+ }
+ updateNameFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateNameSuccess: (
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string
+ status: ErrorTrackingIssueStatus
+ } | null,
+ payload?: {
+ name: string
+ }
+ ) => {
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string
+ status: ErrorTrackingIssueStatus
+ } | null
+ payload?: {
+ name: string
+ }
+ }
+ updateStatus: (status: ErrorTrackingIssue['status']) => {
+ status: ErrorTrackingIssueStatus
+ }
+ updateStatusFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateStatusSuccess: (
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null,
+ payload?: {
+ status: ErrorTrackingIssueStatus
+ }
+ ) => {
+ issue: {
+ assignee: ErrorTrackingIssueAssignee | null
+ cohort?: ErrorTrackingIssueCohort | undefined
+ description: string | null
+ external_issues?: ErrorTrackingExternalReference[] | undefined
+ first_seen: string
+ id: string
+ name: string | null
+ status: ErrorTrackingIssueStatus
+ } | null
+ payload?: {
+ status: ErrorTrackingIssueStatus
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingIssueSceneLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ breadcrumbs: (
+ issue: ErrorTrackingRelationalIssue | null,
+ listDateRange: DateRange | null,
+ filterTestAccounts: boolean,
+ filterGroup: UniversalFiltersGroup,
+ searchQuery: string
+ ) => Breadcrumb[]
+ sidePanelContext: (id: string) => SidePanelSceneContext
+ issueId: (id: string) => string
+ firstSeen: (issue: ErrorTrackingRelationalIssue | null) => Dayjs | null
+ aggregations: (summary: ErrorTrackingIssueSummary | null) => ErrorTrackingIssueAggregations | undefined
+ eventsQuery: (
+ issueFingerprints: ErrorTrackingFingerprint[],
+ filterTestAccounts: boolean,
+ searchQuery: string,
+ filterGroup: UniversalFiltersGroup,
+ dateRange: DateRange
+ ) => EventsQuery
+ eventsQueryKey: (eventsQuery: EventsQuery) => string
+ maxContext: (issue: ErrorTrackingRelationalIssue | null, issueId: string) => MaxContextInput[]
+ }
+}
+
+export type errorTrackingIssueSceneLogicType = MakeLogicType<
+ errorTrackingIssueSceneLogicValues,
+ errorTrackingIssueSceneLogicActions,
+ ErrorTrackingIssueSceneLogicProps,
+ errorTrackingIssueSceneLogicMeta
+>
+
export const errorTrackingIssueSceneLogic = kea<errorTrackingIssueSceneLogicType>([
path((key) => [
'products',
@@ -348,7 +840,7 @@ export const errorTrackingIssueSceneLogic = kea<errorTrackingIssueSceneLogicType
[SIDE_PANEL_CONTEXT_KEY]: [
(_, p) => [p.id],
- (issueId): SidePanelSceneContext => {
+ (issueId: string): SidePanelSceneContext => {
return {
activity_scope: ActivityScope.ERROR_TRACKING_ISSUE,
activity_item_id: issueId,
@@ -366,7 +858,13 @@ export const errorTrackingIssueSceneLogic = kea<errorTrackingIssueSceneLogicType
eventsQuery: [
(s) => [s.issueFingerprints, s.filterTestAccounts, s.searchQuery, s.filterGroup, s.dateRange],
- (issueFingerprints, filterTestAccounts, searchQuery, filterGroup, dateRange) =>
+ (
+ issueFingerprints: ErrorTrackingFingerprint[],
+ filterTestAccounts: boolean,
+ searchQuery: string,
+ filterGroup: UniversalFiltersGroup,
+ dateRange: DateRange
+ ) =>
errorTrackingIssueEventsQuery({
fingerprints: issueFingerprints.map((f: ErrorTrackingFingerprint) => f.fingerprint),
filterTestAccounts,
@@ -384,7 +882,10 @@ export const errorTrackingIssueSceneLogic = kea<errorTrackingIssueSceneLogicType
// once per key: it MUST change when the query content changes (that's how a new query
// reaches the data layer) and must NOT change otherwise — every key change unmounts and
// remounts the entire events table tree.
- eventsQueryKey: [(s) => [s.eventsQuery], (eventsQuery): string => JSON.stringify(eventsQuery)],
+ eventsQueryKey: [
+ (s) => [s.eventsQuery],
+ (eventsQuery: import('~/queries/schema').EventsQuery): string => JSON.stringify(eventsQuery),
+ ],
maxContext: [
(s) => [s.issue, s.issueId],
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/errorTrackingSceneLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingScene/errorTrackingSceneLogic.ts
index e81deadacc01..908b14967eb2 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/errorTrackingSceneLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/errorTrackingSceneLogic.ts
@@ -1,5 +1,5 @@
import { deepEqual as equal } from 'fast-equals'
-import { actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -11,6 +11,11 @@ import { SIDE_PANEL_CONTEXT_KEY, SidePanelSceneContext } from '~/layout/navigati
import { DataTableNode } from '~/queries/schema/schema-general'
import { ActivityScope, Breadcrumb, UniversalFiltersGroup } from '~/types'
+import type {
+ DateRange,
+ ErrorTrackingPendingFingerprintIssueStateUpdate,
+} from '../../../../../frontend/src/queries/schema/schema-general'
+import type { SettingId } from '../../../../../frontend/src/scenes/settings/types'
import { issueActionsLogic } from '../../components/IssueActions/issueActionsLogic'
import {
issueFiltersLogic,
@@ -18,6 +23,12 @@ import {
updateFilterSearchParams,
} from '../../components/IssueFilters/issueFiltersLogic'
import { issueQueryOptionsLogic } from '../../components/IssueQueryOptions/issueQueryOptionsLogic'
+import type {
+ ErrorTrackingQueryAssignee,
+ ErrorTrackingQueryOrderBy,
+ ErrorTrackingQueryOrderDirection,
+ ErrorTrackingQueryStatus,
+} from '../../components/IssueQueryOptions/issueQueryOptionsLogic'
import { bulkSelectLogic } from '../../logics/bulkSelectLogic'
import { pendingFingerprintIssueStateUpdateLogic } from '../../logics/pendingFingerprintIssueStateUpdateLogic'
import { errorTrackingQuery } from '../../queries'
@@ -27,7 +38,6 @@ import {
syncSearchParams,
updateSearchParams,
} from '../../utils'
-import type { errorTrackingSceneLogicType } from './errorTrackingSceneLogicType'
export const ERROR_TRACKING_SCENE_LOGIC_KEY = 'ErrorTrackingScene'
@@ -35,6 +45,84 @@ const DEFAULT_ACTIVE_TAB = 'issues'
export type ErrorTrackingSceneActiveTab = 'issues' | 'insights' | 'recommendations' | 'configuration'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingSceneLogicValues {
+ dateRange: DateRange // issueFiltersLogic
+ filterGroup: UniversalFiltersGroup // issueFiltersLogic
+ filterTestAccounts: boolean // issueFiltersLogic
+ mergedFilterGroup: UniversalFiltersGroup // issueFiltersLogic
+ searchQuery: string // issueFiltersLogic
+ assignee: ErrorTrackingQueryAssignee | null // issueQueryOptionsLogic
+ orderBy: ErrorTrackingQueryOrderBy // issueQueryOptionsLogic
+ orderDirection: ErrorTrackingQueryOrderDirection // issueQueryOptionsLogic
+ status: ErrorTrackingQueryStatus // issueQueryOptionsLogic
+ currentPendingUpdates: ErrorTrackingPendingFingerprintIssueStateUpdate[] // pendingFingerprintIssueStateUpdateLogic
+ selectedSettingId: SettingId | null // settingsLogic
+ activeTab: ErrorTrackingSceneActiveTab
+ breadcrumbs: Breadcrumb[]
+ query: DataTableNode
+ sidePanelContext: SidePanelSceneContext
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingSceneLogicActions {
+ setSelectedIssueIds: (ids: string[]) => {
+ ids: string[]
+ } // bulkSelectLogic
+ mutationFailure: (
+ mutationName: string,
+ error: unknown
+ ) => {
+ error: unknown
+ mutationName: string
+ } // issueActionsLogic
+ mutationSuccess: (mutationName: string) => {
+ mutationName: string
+ } // issueActionsLogic
+ setDateRange: (dateRange: DateRange) => {
+ dateRange: DateRange
+ } // issueFiltersLogic
+ setFilterGroup: (filterGroup: UniversalFiltersGroup) => {
+ filterGroup: UniversalFiltersGroup
+ } // issueFiltersLogic
+ setFilterTestAccounts: (filterTestAccounts: boolean) => {
+ filterTestAccounts: boolean
+ } // issueFiltersLogic
+ setSearchQuery: (searchQuery: string) => {
+ searchQuery: string
+ } // issueFiltersLogic
+ selectSetting: (setting: SettingId) => {
+ setting: SettingId
+ } // settingsLogic
+ setActiveTab: (activeTab: ErrorTrackingSceneActiveTab) => {
+ activeTab: ErrorTrackingSceneActiveTab
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingSceneLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ query: (
+ orderBy: import('~/queries/schema').ErrorTrackingOrderBy,
+ status: import('~/queries/schema').ErrorTrackingQueryStatus | undefined,
+ dateRange: DateRange,
+ assignee: null | import('~/queries/schema').ErrorTrackingIssueAssignee | undefined,
+ filterTestAccounts: boolean,
+ mergedFilterGroup: UniversalFiltersGroup,
+ searchQuery: string,
+ orderDirection: 'ASC' | 'DESC' | undefined,
+ currentPendingUpdates: ErrorTrackingPendingFingerprintIssueStateUpdate[]
+ ) => DataTableNode
+ }
+}
+
+export type errorTrackingSceneLogicType = MakeLogicType<
+ errorTrackingSceneLogicValues,
+ errorTrackingSceneLogicActions,
+ Record<string, any>,
+ errorTrackingSceneLogicMeta
+>
+
export const errorTrackingSceneLogic = kea<errorTrackingSceneLogicType>([
path(['products', 'error_tracking', 'scenes', 'ErrorTrackingScene', 'errorTrackingSceneLogic']),
@@ -96,15 +184,17 @@ export const errorTrackingSceneLogic = kea<errorTrackingSceneLogicType>([
s.currentPendingUpdates,
],
(
- orderBy,
- status,
- dateRange,
- assignee,
- filterTestAccounts,
- mergedFilterGroup,
- searchQuery,
- orderDirection,
- currentPendingUpdates
+ orderBy: import('../../components/IssueQueryOptions/issueQueryOptionsLogic').ErrorTrackingQueryOrderBy,
+ status: import('../../components/IssueQueryOptions/issueQueryOptionsLogic').ErrorTrackingQueryStatus,
+ dateRange: import('~/queries/schema').DateRange,
+ assignee:
+ | null
+ | import('../../components/IssueQueryOptions/issueQueryOptionsLogic').ErrorTrackingQueryAssignee,
+ filterTestAccounts: boolean,
+ mergedFilterGroup: UniversalFiltersGroup,
+ searchQuery: string,
+ orderDirection: import('../../components/IssueQueryOptions/issueQueryOptionsLogic').ErrorTrackingQueryOrderDirection,
+ currentPendingUpdates: import('~/queries/schema').ErrorTrackingPendingFingerprintIssueStateUpdate[]
): DataTableNode => {
return errorTrackingQuery({
orderBy,
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/errorTrackingInsightsLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/errorTrackingInsightsLogic.ts
index ca0aac927867..b83584a57c71 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/errorTrackingInsightsLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/insights/errorTrackingInsightsLogic.ts
@@ -1,4 +1,4 @@
-import { afterMount, connect, kea, listeners, path, selectors } from 'kea'
+import { MakeLogicType, afterMount, connect, kea, listeners, path, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import posthog from 'posthog-js'
@@ -24,7 +24,6 @@ import {
import { issueFiltersLogic } from '../../../../components/IssueFilters/issueFiltersLogic'
import { ERROR_TRACKING_SCENE_LOGIC_KEY } from '../../errorTrackingSceneLogic'
-import type { errorTrackingInsightsLogicType } from './errorTrackingInsightsLogicType'
import {
buildAffectedUsersQuery,
buildCrashFreeSessionsQuery,
@@ -59,6 +58,95 @@ function stripIssueFiltersFromGroup(group: UniversalFiltersGroup): UniversalFilt
return { ...group, values }
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingInsightsLogicValues {
+ dateRange: DateRange // issueFiltersLogic
+ filterGroup: UniversalFiltersGroup // issueFiltersLogic
+ filterTestAccounts: boolean // issueFiltersLogic
+ mergedFilterGroup: UniversalFiltersGroup // issueFiltersLogic
+ affectedUsersQuery: InsightVizNode<TrendsQuery>
+ crashFreeSessionsQuery: InsightVizNode<TrendsQuery>
+ effectiveDateRange: DateRange
+ effectiveProperties: AnyPropertyFilter[]
+ exceptionVolumeQuery: InsightVizNode<TrendsQuery>
+ insightQueryFilters: InsightQueryFilters
+ insightsFilterGroup: UniversalFiltersGroup
+ summaryStats: InsightsSummaryStats | null
+ summaryStatsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingInsightsLogicActions {
+ setDateRange: (dateRange: DateRange) => {
+ dateRange: DateRange
+ } // issueFiltersLogic
+ setFilterGroup: (filterGroup: UniversalFiltersGroup) => {
+ filterGroup: UniversalFiltersGroup
+ } // issueFiltersLogic
+ setFilterTestAccounts: (filterTestAccounts: boolean) => {
+ filterTestAccounts: boolean
+ } // issueFiltersLogic
+ loadSummaryStats: (_: any) => any
+ loadSummaryStatsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSummaryStatsSuccess: (
+ summaryStats: {
+ affectedUsers: number
+ crashFreeRate: number
+ crashSessions: number
+ totalExceptions: number
+ totalSessions: number
+ } | null,
+ payload?: any
+ ) => {
+ summaryStats: {
+ affectedUsers: number
+ crashFreeRate: number
+ crashSessions: number
+ totalExceptions: number
+ totalSessions: number
+ } | null
+ payload?: any
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface errorTrackingInsightsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ insightsFilterGroup: (mergedFilterGroup: UniversalFiltersGroup) => UniversalFiltersGroup
+ effectiveProperties: (insightsFilterGroup: UniversalFiltersGroup) => AnyPropertyFilter[]
+ effectiveDateRange: (dateRange: DateRange) => DateRange
+ insightQueryFilters: (
+ effectiveProperties: AnyPropertyFilter[],
+ filterTestAccounts: boolean
+ ) => InsightQueryFilters
+ exceptionVolumeQuery: (
+ effectiveDateRange: DateRange,
+ insightQueryFilters: InsightQueryFilters
+ ) => InsightVizNode<TrendsQuery>
+ affectedUsersQuery: (
+ effectiveDateRange: DateRange,
+ insightQueryFilters: InsightQueryFilters
+ ) => InsightVizNode<TrendsQuery>
+ crashFreeSessionsQuery: (
+ effectiveDateRange: DateRange,
+ insightQueryFilters: InsightQueryFilters
+ ) => InsightVizNode<TrendsQuery>
+ }
+}
+
+export type errorTrackingInsightsLogicType = MakeLogicType<
+ errorTrackingInsightsLogicValues,
+ errorTrackingInsightsLogicActions,
+ Record<string, any>,
+ errorTrackingInsightsLogicMeta
+>
+
export const errorTrackingInsightsLogic = kea<errorTrackingInsightsLogicType>([
path([
'products',
@@ -84,7 +172,7 @@ export const errorTrackingInsightsLogic = kea<errorTrackingInsightsLogicType>([
selectors({
insightsFilterGroup: [
(s) => [s.mergedFilterGroup],
- (mergedFilterGroup): UniversalFiltersGroup => {
+ (mergedFilterGroup: UniversalFiltersGroup): UniversalFiltersGroup => {
const inner = mergedFilterGroup.values[0] as UniversalFiltersGroup
return {
type: FilterLogicalOperator.And,
@@ -97,7 +185,7 @@ export const errorTrackingInsightsLogic = kea<errorTrackingInsightsLogicType>([
// to the other can cause the summary stats and charts to disagree on which events match.
effectiveProperties: [
(s) => [s.insightsFilterGroup],
- (insightsFilterGroup): AnyPropertyFilter[] => {
+ (insightsFilterGroup: UniversalFiltersGroup): AnyPropertyFilter[] => {
const inner = insightsFilterGroup.values[0] as UniversalFiltersGroup | undefined
return (inner?.values ?? []) as AnyPropertyFilter[]
},
@@ -105,29 +193,32 @@ export const errorTrackingInsightsLogic = kea<errorTrackingInsightsLogicType>([
// Single source of truth for the date range used by both the summary stats query and the charts.
effectiveDateRange: [
(s) => [s.dateRange],
- (dateRange): DateRange => ({
+ (dateRange: DateRange): DateRange => ({
date_from: dateRange.date_from ?? '-7d',
date_to: dateRange.date_to ?? null,
}),
],
insightQueryFilters: [
(s) => [s.effectiveProperties, s.filterTestAccounts],
- (properties, filterTestAccounts): InsightQueryFilters => ({
+ (properties: AnyPropertyFilter[], filterTestAccounts: boolean): InsightQueryFilters => ({
properties,
filterTestAccounts,
}),
],
exceptionVolumeQuery: [
(s) => [s.effectiveDateRange, s.insightQueryFilters],
- (dateRange, filters): InsightVizNode<TrendsQuery> => buildExceptionVolumeQuery(dateRange, filters),
+ (dateRange: DateRange, filters: InsightQueryFilters): InsightVizNode<TrendsQuery> =>
+ buildExceptionVolumeQuery(dateRange, filters),
],
affectedUsersQuery: [
(s) => [s.effectiveDateRange, s.insightQueryFilters],
- (dateRange, filters): InsightVizNode<TrendsQuery> => buildAffectedUsersQuery(dateRange, filters),
+ (dateRange: DateRange, filters: InsightQueryFilters): InsightVizNode<TrendsQuery> =>
+ buildAffectedUsersQuery(dateRange, filters),
],
crashFreeSessionsQuery: [
(s) => [s.effectiveDateRange, s.insightQueryFilters],
- (dateRange, filters): InsightVizNode<TrendsQuery> => buildCrashFreeSessionsQuery(dateRange, filters),
+ (dateRange: DateRange, filters: InsightQueryFilters): InsightVizNode<TrendsQuery> =>
+ buildCrashFreeSessionsQuery(dateRange, filters),
],
}),
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/recommendationsTabLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/recommendationsTabLogic.ts
index 9c2713f9aac1..5b5e436680ef 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/recommendationsTabLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/recommendationsTabLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, beforeUnmount, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, afterMount, beforeUnmount, kea, listeners, path, reducers, selectors } from 'kea'
import { lemonToast } from '@posthog/lemon-ui'
@@ -6,7 +6,6 @@ import api from 'lib/api'
import { HogFunctionSubTemplateIdType } from '~/types'
-import type { recommendationsTabLogicType } from './recommendationsTabLogicType'
import type {
AlertsRecommendation,
ErrorTrackingRecommendation,
@@ -33,6 +32,94 @@ export const isSourceMapsRecommendation = (
const POLL_INTERVAL_MS = 500
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recommendationsTabLogicValues {
+ activeRecommendations: ErrorTrackingRecommendation[]
+ completedExpanded: boolean
+ completedRecommendations: ErrorTrackingRecommendation[]
+ computingIds: Set<string>
+ dismissedExpanded: boolean
+ ignoredRecommendations: ErrorTrackingRecommendation[]
+ openAlertTriggerKey: HogFunctionSubTemplateIdType | null
+ recommendations: ErrorTrackingRecommendation[]
+ recommendationsLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recommendationsTabLogicActions {
+ activateIssue: (issueId: string) => {
+ issueId: string
+ }
+ clearPolling: () => {
+ value: true
+ }
+ dismissRecommendation: (id: string) => {
+ id: string
+ }
+ ensurePollingScheduled: () => {
+ value: true
+ }
+ loadRecommendations: () => {
+ value: true
+ }
+ markRecommendationComputing: (id: string) => {
+ id: string
+ }
+ pollRecommendations: () => {
+ value: true
+ }
+ refreshRecommendation: (id: string) => {
+ id: string
+ }
+ restoreRecommendation: (id: string) => {
+ id: string
+ }
+ setOpenAlertTriggerKey: (triggerKey: HogFunctionSubTemplateIdType | null) => {
+ triggerKey: HogFunctionSubTemplateIdType | null
+ }
+ setRecommendations: (recommendations: ErrorTrackingRecommendation[]) => {
+ recommendations: ErrorTrackingRecommendation<Record<string, unknown>>[]
+ }
+ setRecommendationsLoading: (loading: boolean) => {
+ loading: boolean
+ }
+ suppressIssue: (issueId: string) => {
+ issueId: string
+ }
+ toggleCompletedExpanded: () => {
+ value: true
+ }
+ toggleDismissedExpanded: () => {
+ value: true
+ }
+ upsertRecommendation: (recommendation: ErrorTrackingRecommendation) => {
+ recommendation: ErrorTrackingRecommendation<Record<string, unknown>>
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface recommendationsTabLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ activeRecommendations: (
+ recommendations: ErrorTrackingRecommendation<Record<string, unknown>>[]
+ ) => ErrorTrackingRecommendation[]
+ completedRecommendations: (
+ recommendations: ErrorTrackingRecommendation<Record<string, unknown>>[]
+ ) => ErrorTrackingRecommendation[]
+ ignoredRecommendations: (
+ recommendations: ErrorTrackingRecommendation<Record<string, unknown>>[]
+ ) => ErrorTrackingRecommendation[]
+ computingIds: (recommendations: ErrorTrackingRecommendation<Record<string, unknown>>[]) => Set<string>
+ }
+}
+
+export type recommendationsTabLogicType = MakeLogicType<
+ recommendationsTabLogicValues,
+ recommendationsTabLogicActions,
+ Record<string, any>,
+ recommendationsTabLogicMeta
+>
+
// The backend `status` field is the single source of truth for "is this recommendation
// being computed". The frontend shows a spinner whenever status === 'computing', and
// optimistically flips status to 'computing' before issuing a refresh HTTP call so the
@@ -188,25 +275,25 @@ export const recommendationsTabLogic = kea<recommendationsTabLogicType>([
selectors({
activeRecommendations: [
(s) => [s.recommendations],
- (recommendations): ErrorTrackingRecommendation[] => {
+ (recommendations: ErrorTrackingRecommendation[]): ErrorTrackingRecommendation[] => {
return recommendations.filter((r) => !r.dismissed_at && !r.completed)
},
],
completedRecommendations: [
(s) => [s.recommendations],
- (recommendations): ErrorTrackingRecommendation[] => {
+ (recommendations: ErrorTrackingRecommendation[]): ErrorTrackingRecommendation[] => {
return recommendations.filter((r) => !r.dismissed_at && r.completed)
},
],
ignoredRecommendations: [
(s) => [s.recommendations],
- (recommendations): ErrorTrackingRecommendation[] => {
+ (recommendations: ErrorTrackingRecommendation[]): ErrorTrackingRecommendation[] => {
return recommendations.filter((r) => !!r.dismissed_at)
},
],
computingIds: [
(s) => [s.recommendations],
- (recommendations): Set<string> =>
+ (recommendations: ErrorTrackingRecommendation[]): Set<string> =>
new Set(recommendations.filter((r) => r.status === 'computing').map((r) => r.id)),
],
}),
diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts
index 40238ac862b0..7ef9176caac9 100644
--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts
+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'
import posthog from 'posthog-js'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
@@ -6,8 +6,6 @@ import { getSurveyIdBasedResponseKey, getSurveyResponseKey } from 'scenes/survey
import { Region, SurveyEventName, SurveyEventProperties } from '~/types'
-import type { sourceMapsFixWizardLogicType } from './sourceMapsFixWizardLogicType'
-
export type WizardRating = 'good' | 'bad'
export type WizardOpenSource = 'issues_list' | 'recommendations'
@@ -27,6 +25,59 @@ const SURVEY_ID = '019e7335-af36-0000-42a8-ad5add623630'
const RATING_QUESTION_ID = '030dde7d-0dee-4d79-b568-ed16e85b431c'
const FEEDBACK_QUESTION_ID = '03e1255c-6daf-46a2-9629-2354bcd230ff'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sourceMapsFixWizardLogicValues {
+ feedbackRevealed: boolean
+ feedbackSubmitted: boolean
+ feedbackText: string
+ isModalOpen: boolean
+ rating: WizardRating | null
+ ratingScore: number | null
+ wizardCommand: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sourceMapsFixWizardLogicActions {
+ closeModal: () => {
+ value: true
+ }
+ dismissFeedback: () => {
+ value: true
+ }
+ openModal: (source: WizardOpenSource) => {
+ source: WizardOpenSource
+ }
+ rateWizard: (rating: WizardRating) => {
+ rating: WizardRating
+ }
+ revealFeedback: () => {
+ value: true
+ }
+ setFeedbackText: (feedbackText: string) => {
+ feedbackText: string
+ }
+ setRatingScore: (ratingScore: number) => {
+ ratingScore: number
+ }
+ submitFeedback: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface sourceMapsFixWizardLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ wizardCommand: (preflight: null | import('~/types').PreflightStatus) => string
+ }
+}
+
+export type sourceMapsFixWizardLogicType = MakeLogicType<
+ sourceMapsFixWizardLogicValues,
+ sourceMapsFixWizardLogicActions,
+ Record<string, any>,
+ sourceMapsFixWizardLogicMeta
+>
+
export const sourceMapsFixWizardLogic = kea<sourceMapsFixWizardLogicType>([
path([
'products',
@@ -109,7 +160,7 @@ export const sourceMapsFixWizardLogic = kea<sourceMapsFixWizardLogicType>([
selectors({
wizardCommand: [
() => [preflightLogic.selectors.preflight],
- (preflight): string =>
+ (preflight: null | import('~/types').PreflightStatus): string =>
`npx -y @posthog/wizard@latest upload-source-maps${preflight?.region === Region.EU ? ' --region eu' : ''}`,
],
}),
diff --git a/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts b/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
index fe09659b87e2..6d7fd59eb848 100644
--- a/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
+++ b/products/metrics/frontend/components/metricsSqlEditorTrackingLogic.ts
@@ -17,17 +17,17 @@ export interface MetricsSqlEditorTrackingLogicProps {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface metricsSqlEditorTrackingLogicActions {
sqlEditorRunQuery: (
- queryOverride?: string,
- switchTab?: boolean
+ queryOverride?: string | undefined,
+ switchTab?: boolean | undefined
) => {
queryOverride: string | undefined
switchTab: boolean | undefined
} // sqlEditorLogic
sqlEditorSaveAsEndpointSubmit: (
name: string,
- description?: string,
- queryOverride?: string,
- dagId?: string
+ description?: string | undefined,
+ queryOverride?: string | undefined,
+ dagId?: string | undefined
) => {
dagId: string | undefined
description: string | undefined
@@ -36,7 +36,7 @@ export interface metricsSqlEditorTrackingLogicActions {
} // sqlEditorLogic
sqlEditorSaveAsInsightSubmit: (
name: string,
- queryOverride?: string
+ queryOverride?: string | undefined
) => {
name: string
queryOverride: string | undefined
@@ -44,11 +44,11 @@ export interface metricsSqlEditorTrackingLogicActions {
sqlEditorSaveAsViewSubmit: (
name: string,
materializeAfterSave?: any,
- fromDraft?: string,
- dagId?: string,
- folderId?: string | null,
+ fromDraft?: string | undefined,
+ dagId?: string | undefined,
+ folderId?: string | null | undefined,
isTest?: any,
- queryOverride?: string
+ queryOverride?: string | undefined
) => {
dagId: string | undefined
folderId: string | null | undefined
diff --git a/products/posthog_ai/frontend/components/tool/widgets/maxErrorTrackingWidgetLogic.ts b/products/posthog_ai/frontend/components/tool/widgets/maxErrorTrackingWidgetLogic.ts
index 2fae9b46929d..d91a7fb3a0b3 100644
--- a/products/posthog_ai/frontend/components/tool/widgets/maxErrorTrackingWidgetLogic.ts
+++ b/products/posthog_ai/frontend/components/tool/widgets/maxErrorTrackingWidgetLogic.ts
@@ -1,4 +1,4 @@
-import { actions, kea, key, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, key, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { performQuery } from '~/queries/query'
@@ -8,13 +8,73 @@ import {
} from '~/queries/schema/schema-assistant-error-tracking'
import { ErrorTrackingQuery, NodeKind } from '~/queries/schema/schema-general'
-import type { maxErrorTrackingWidgetLogicType } from './maxErrorTrackingWidgetLogicType'
-
export interface MaxErrorTrackingWidgetLogicProps {
toolCallId: string
filters: MaxErrorTrackingSearchResponse | null | undefined
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface maxErrorTrackingWidgetLogicValues {
+ hasMore: boolean
+ isLoading: boolean
+ issues: MaxErrorTrackingIssuePreview[]
+ moreIssuesResponse: {
+ hasMore: boolean
+ issues: MaxErrorTrackingIssuePreview[]
+ nextCursor: string | null
+ } | null
+ moreIssuesResponseLoading: boolean
+ nextCursor: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface maxErrorTrackingWidgetLogicActions {
+ loadMoreIssues: () => {
+ value: true
+ }
+ loadMoreIssuesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMoreIssuesSuccess: (
+ moreIssuesResponse: {
+ hasMore: boolean
+ issues: MaxErrorTrackingIssuePreview[]
+ nextCursor: string | null
+ } | null,
+ payload?: {
+ value: true
+ }
+ ) => {
+ moreIssuesResponse: {
+ hasMore: boolean
+ issues: MaxErrorTrackingIssuePreview[]
+ nextCursor: string | null
+ } | null
+ payload?: {
+ value: true
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface maxErrorTrackingWidgetLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isLoading: (moreIssuesResponseLoading: boolean) => boolean
+ }
+}
+
+export type maxErrorTrackingWidgetLogicType = MakeLogicType<
+ maxErrorTrackingWidgetLogicValues,
+ maxErrorTrackingWidgetLogicActions,
+ MaxErrorTrackingWidgetLogicProps,
+ maxErrorTrackingWidgetLogicMeta
+>
+
export const maxErrorTrackingWidgetLogic = kea<maxErrorTrackingWidgetLogicType>([
path(['products', 'posthog_ai', 'frontend', 'components', 'tool', 'widgets', 'maxErrorTrackingWidgetLogic']),
props({} as MaxErrorTrackingWidgetLogicProps),
diff --git a/products/posthog_ai/frontend/logics/attachedContextLogic.ts b/products/posthog_ai/frontend/logics/attachedContextLogic.ts
index d338aaa436cb..256e1ac28a96 100644
--- a/products/posthog_ai/frontend/logics/attachedContextLogic.ts
+++ b/products/posthog_ai/frontend/logics/attachedContextLogic.ts
@@ -1,7 +1,60 @@
-import { actions, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, kea, path, reducers, selectors } from 'kea'
import { type AttachedContextItem, attachedContextItemKey } from '../types/contextTypes'
-import type { attachedContextLogicType } from './attachedContextLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface attachedContextLogicValues {
+ contextItems: AttachedContextItem[]
+ dismissedKeys: Record<string, true>
+ hasContext: boolean
+ providers: Record<string, AttachedContextItem[]>
+ sentContextKeysByTask: Record<string, string[]>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface attachedContextLogicActions {
+ deregisterContext: (providerId: string) => {
+ providerId: string
+ }
+ dismissContext: (key: string) => {
+ key: string
+ }
+ markContextSent: (
+ taskId: string,
+ keys: string[]
+ ) => {
+ keys: string[]
+ taskId: string
+ }
+ registerContext: (
+ providerId: string,
+ items: AttachedContextItem[]
+ ) => {
+ items: AttachedContextItem[]
+ providerId: string
+ }
+ undismissContext: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface attachedContextLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ contextItems: (
+ providers: Record<string, AttachedContextItem[]>,
+ dismissedKeys: Record<string, true>
+ ) => AttachedContextItem[]
+ hasContext: (contextItems: AttachedContextItem[]) => boolean
+ }
+}
+
+export type attachedContextLogicType = MakeLogicType<
+ attachedContextLogicValues,
+ attachedContextLogicActions,
+ Record<string, any>,
+ attachedContextLogicMeta
+>
/**
* Global, unkeyed store of attached context for the PostHog AI surface. One mechanism only — a
@@ -89,7 +142,10 @@ export const attachedContextLogic = kea<attachedContextLogicType>([
// Items with neither `key` nor `value` carry no payload and are dropped, as are dismissed keys.
contextItems: [
(s) => [s.providers, s.dismissedKeys],
- (providers, dismissedKeys): AttachedContextItem[] => {
+ (
+ providers: Record<string, AttachedContextItem[]>,
+ dismissedKeys: Record<string, true>
+ ): AttachedContextItem[] => {
const seen = new Set<string>()
const out: AttachedContextItem[] = []
for (const items of Object.values(providers)) {
@@ -110,6 +166,9 @@ export const attachedContextLogic = kea<attachedContextLogicType>([
return out
},
],
- hasContext: [(s) => [s.contextItems], (contextItems): boolean => contextItems.length > 0],
+ hasContext: [
+ (s) => [s.contextItems],
+ (contextItems: AttachedContextItem[]): boolean => contextItems.length > 0,
+ ],
}),
])
diff --git a/products/posthog_ai/frontend/logics/composerSeedLogic.ts b/products/posthog_ai/frontend/logics/composerSeedLogic.ts
index 99e6583ecdc8..a2c02f288834 100644
--- a/products/posthog_ai/frontend/logics/composerSeedLogic.ts
+++ b/products/posthog_ai/frontend/logics/composerSeedLogic.ts
@@ -1,6 +1,4 @@
-import { actions, kea, key, path, props, reducers } from 'kea'
-
-import type { composerSeedLogicType } from './composerSeedLogicType'
+import { MakeLogicType, actions, kea, key, path, props, reducers } from 'kea'
// A prompt to prefill into the composer, plus whether to submit it straight away. Kept deliberately
// generic — the Max-specific `!`/`mode=` command-string parsing happens in the consuming app before the
@@ -17,6 +15,33 @@ export interface ComposerSeedLogicProps {
panelId?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface composerSeedLogicValues {
+ seed: ComposerSeed | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface composerSeedLogicActions {
+ consumeSeed: () => {
+ value: true
+ }
+ setSeed: (seed: ComposerSeed) => {
+ seed: ComposerSeed
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface composerSeedLogicMeta {
+ key: string
+}
+
+export type composerSeedLogicType = MakeLogicType<
+ composerSeedLogicValues,
+ composerSeedLogicActions,
+ ComposerSeedLogicProps,
+ composerSeedLogicMeta
+>
+
/**
* A tiny hand-off store that lets a host seed a not-yet-mounted composer with an initial prompt. A producer
* (a main-app consumer of this surface) dispatches `setSeed`; the paired `taskTrackerSceneLogic` picks it up
diff --git a/products/posthog_ai/frontend/logics/contextPickerLogic.ts b/products/posthog_ai/frontend/logics/contextPickerLogic.ts
index 835daa0b4dd6..aab3fe86c542 100644
--- a/products/posthog_ai/frontend/logics/contextPickerLogic.ts
+++ b/products/posthog_ai/frontend/logics/contextPickerLogic.ts
@@ -1,10 +1,21 @@
-import { actions, connect, events, kea, listeners, path, reducers, selectors, sharedListeners } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ connect,
+ events,
+ kea,
+ listeners,
+ path,
+ reducers,
+ selectors,
+ sharedListeners,
+} from 'kea'
+import type { BreakPointFunction } from 'kea'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { type AttachedContextItem, attachedContextItemKey } from '../types/contextTypes'
import { attachedContextLogic } from './attachedContextLogic'
-import type { contextPickerLogicType } from './contextPickerLogicType'
export const PICKER_PROVIDER_ID = 'user-picker'
@@ -46,6 +57,69 @@ export function taxonomicItemToAttachedContext(
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface contextPickerLogicValues {
+ pickedItems: AttachedContextItem[]
+ pickedKeys: Set<string>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface contextPickerLogicActions {
+ deregisterContext: (providerId: string) => {
+ providerId: string
+ } // attachedContextLogic
+ registerContext: (
+ providerId: string,
+ items: AttachedContextItem[]
+ ) => {
+ items: AttachedContextItem[]
+ providerId: string
+ } // attachedContextLogic
+ undismissContext: (key: string) => {
+ key: string
+ } // attachedContextLogic
+ handleTaxonomicFilterChange: (
+ value: number | string,
+ groupType: TaxonomicFilterGroupType,
+ item: PickableTaxonomicItem
+ ) => {
+ groupType: TaxonomicFilterGroupType
+ item: PickableTaxonomicItem
+ value: number | string
+ }
+ pickItem: (item: AttachedContextItem) => {
+ item: AttachedContextItem
+ }
+ removePickedItem: (key: string) => {
+ key: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface contextPickerLogicMeta {
+ sharedListeners: {
+ syncProvider: (
+ payload: any,
+ breakpoint: BreakPointFunction,
+ action: {
+ type: string
+ payload: any
+ },
+ previousState: any
+ ) => void | Promise<void>
+ }
+ __keaTypeGenInternalSelectorTypes: {
+ pickedKeys: (pickedItems: AttachedContextItem[]) => Set<string>
+ }
+}
+
+export type contextPickerLogicType = MakeLogicType<
+ contextPickerLogicValues,
+ contextPickerLogicActions,
+ Record<string, any>,
+ contextPickerLogicMeta
+>
+
/**
* Global store of context the user explicitly picked via the composer's @-affordance. Just another
* provider on `attachedContextLogic` (id `user-picker`): picks upsert into `pickedItems`, and every
@@ -87,7 +161,7 @@ export const contextPickerLogic = kea<contextPickerLogicType>([
selectors({
pickedKeys: [
(s) => [s.pickedItems],
- (pickedItems): Set<string> => new Set(pickedItems.map(attachedContextItemKey)),
+ (pickedItems: AttachedContextItem[]): Set<string> => new Set(pickedItems.map(attachedContextItemKey)),
],
}),
diff --git a/products/posthog_ai/frontend/logics/debugLogsLogic.ts b/products/posthog_ai/frontend/logics/debugLogsLogic.ts
index 791a802f5e84..b7fa29d5b3c8 100644
--- a/products/posthog_ai/frontend/logics/debugLogsLogic.ts
+++ b/products/posthog_ai/frontend/logics/debugLogsLogic.ts
@@ -1,9 +1,40 @@
-import { actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { userLogic } from 'scenes/userLogic'
-import type { debugLogsLogicType } from './debugLogsLogicType'
+import type { UserType } from '../../../../frontend/src/types'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugLogsLogicValues {
+ isDev: boolean | undefined // preflightLogic
+ user: UserType | null // userLogic
+ canControlDebugLogs: boolean
+ debugLogsEnabled: boolean
+ showDebugLogs: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugLogsLogicActions {
+ setDebugLogsEnabled: (enabled: boolean) => {
+ enabled: boolean
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface debugLogsLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ canControlDebugLogs: (user: UserType | null, isDev: boolean | undefined) => boolean
+ showDebugLogs: (user: UserType | null, canControlDebugLogs: boolean, debugLogsEnabled: boolean) => boolean
+ }
+}
+
+export type debugLogsLogicType = MakeLogicType<
+ debugLogsLogicValues,
+ debugLogsLogicActions,
+ Record<string, any>,
+ debugLogsLogicMeta
+>
/**
* Staff-only preference for whether `_posthog/console` debug rows surface in the run thread. Persisted
@@ -36,7 +67,8 @@ export const debugLogsLogic = kea<debugLogsLogicType>([
*/
canControlDebugLogs: [
(s) => [s.user, s.isDev],
- (user, isDev): boolean => !user?.is_impersonated && (!!user?.is_staff || !!isDev),
+ (user: null | import('~/types').UserType, isDev: boolean | undefined): boolean =>
+ !user?.is_impersonated && (!!user?.is_staff || !!isDev),
],
/**
* Whether debug rows should actually render. Impersonation always shows them; otherwise staff/dev
@@ -44,8 +76,11 @@ export const debugLogsLogic = kea<debugLogsLogicType>([
*/
showDebugLogs: [
(s) => [s.user, s.canControlDebugLogs, s.debugLogsEnabled],
- (user, canControlDebugLogs, debugLogsEnabled): boolean =>
- !!user?.is_impersonated || (canControlDebugLogs && debugLogsEnabled),
+ (
+ user: null | import('~/types').UserType,
+ canControlDebugLogs: boolean,
+ debugLogsEnabled: boolean
+ ): boolean => !!user?.is_impersonated || (canControlDebugLogs && debugLogsEnabled),
],
}),
])
diff --git a/products/posthog_ai/frontend/logics/runInteractionLogic.ts b/products/posthog_ai/frontend/logics/runInteractionLogic.ts
index fbf2c75cfe87..b6bf5429b103 100644
--- a/products/posthog_ai/frontend/logics/runInteractionLogic.ts
+++ b/products/posthog_ai/frontend/logics/runInteractionLogic.ts
@@ -1,5 +1,6 @@
-import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { projectLogic } from 'scenes/projectLogic'
@@ -18,10 +19,11 @@ import {
} from 'products/tasks/frontend/generated/api.schemas'
import { type AttachedContextItem, attachedContextItemKey } from '../types/contextTypes'
+import type { PermissionRequestRecord } from '../types/streamTypes'
import { wrapWithPosthogContext } from '../utils/posthogContextBlock'
import { attachedContextLogic } from './attachedContextLogic'
-import type { runInteractionLogicType } from './runInteractionLogicType'
import { isTerminalRunStatus, runStreamLogic } from './runStreamLogic'
+import type { RunStatus } from './runStreamLogic'
export interface RunInteractionLogicProps {
taskId: string
@@ -56,6 +58,228 @@ const QUEUED_MESSAGE_ID = 'queued'
const MODEL_CONFIG_ID = 'model'
const EFFORT_CONFIG_ID = 'effort'
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runInteractionLogicValues {
+ dataProcessingAccepted: boolean // aiConsentLogic
+ contextItems: AttachedContextItem[] // attachedContextLogic
+ sentContextKeysByTask: Record<string, string[]> // attachedContextLogic
+ currentProjectId: number | null // projectLogic
+ currentRunStatus: RunStatus | null // runStreamLogic
+ isThinking: boolean // runStreamLogic
+ pendingPermissionRequest: PermissionRequestRecord | null // runStreamLogic
+ respondingToPermission: boolean // runStreamLogic
+ canSend: boolean
+ composerForm: {
+ draft: string
+ }
+ composerFormAllErrors: Record<string, any>
+ composerFormChanged: boolean
+ composerFormErrors: DeepPartialMap<
+ {
+ draft: string
+ },
+ ValidationErrorType
+ >
+ composerFormHasErrors: boolean
+ composerFormManualErrors: Record<string, any>
+ composerFormTouched: boolean
+ composerFormTouches: Record<string, boolean>
+ composerFormValidationErrors: DeepPartialMap<
+ {
+ draft: string
+ },
+ ValidationErrorType
+ >
+ consentBlocked: boolean
+ effortOverride: string | null
+ isBusy: boolean
+ isComposerFormSubmitting: boolean
+ isComposerFormValid: boolean
+ isSubmitting: boolean
+ isTerminal: boolean
+ modelOverride: string | null
+ pendingContextItems: AttachedContextItem[]
+ queuedMessages: QueuedMessage[]
+ selectedEffort: ReasoningEffortEnumApi
+ selectedModel: string
+ sending: boolean
+ sentEffort: string | null
+ sentModel: string | null
+ showComposerFormErrors: boolean
+ startingRun: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runInteractionLogicActions {
+ markContextSent: (
+ taskId: string,
+ keys: string[]
+ ) => {
+ keys: string[]
+ taskId: string
+ } // attachedContextLogic
+ cancelRun: (
+ run?:
+ | {
+ runId: string
+ taskId: string
+ }
+ | undefined
+ ) => {
+ run:
+ | {
+ runId: string
+ taskId: string
+ }
+ | undefined
+ } // runStreamLogic
+ markTurnComplete: () => {
+ value: true
+ } // runStreamLogic
+ pushHumanMessage: (content: string) => {
+ content: string
+ } // runStreamLogic
+ respondToPermission: (payload: {
+ answers?: Record<string, string>
+ customInput?: string
+ optionId: string
+ requestId: string
+ }) => {
+ answers?: Record<string, string> | undefined
+ customInput?: string | undefined
+ optionId: string
+ requestId: string
+ } // runStreamLogic
+ blockOnConsent: () => {
+ value: true
+ }
+ clearConsentBlock: () => {
+ value: true
+ }
+ clearQueue: () => {
+ value: true
+ }
+ enqueueMessage: (content: string) => {
+ content: string
+ }
+ flushQueue: () => {
+ value: true
+ }
+ prependQueuedMessage: (content: string) => {
+ content: string
+ }
+ removeQueuedMessage: (id: string) => {
+ id: string
+ }
+ resetComposerForm: (values?: { draft: string }) => {
+ values?: {
+ draft: string
+ }
+ }
+ sendNow: (
+ content: string,
+ source: 'draft' | 'queue'
+ ) => {
+ content: string
+ source: 'draft' | 'queue'
+ }
+ setComposerFormManualErrors: (errors: Record<string, any>) => {
+ errors: Record<string, any>
+ }
+ setComposerFormValue: (
+ key: FieldName,
+ value: any
+ ) => {
+ name: FieldName
+ value: any
+ }
+ setComposerFormValues: (
+ values: DeepPartial<{
+ draft: string
+ }>
+ ) => {
+ values: DeepPartial<{
+ draft: string
+ }>
+ }
+ setEffort: (effort: string) => {
+ effort: string
+ }
+ setModel: (model: string) => {
+ model: string
+ }
+ setSending: (sending: boolean) => {
+ sending: boolean
+ }
+ setSentEffort: (effort: string) => {
+ effort: string
+ }
+ setSentModel: (model: string) => {
+ model: string
+ }
+ setStartingRun: (starting: boolean) => {
+ starting: boolean
+ }
+ startNewRun: (content: string) => {
+ content: string
+ }
+ submitComposerForm: () => {
+ value: boolean
+ }
+ submitComposerFormFailure: (
+ error: Error,
+ errors: Record<string, any>
+ ) => {
+ error: Error
+ errors: Record<string, any>
+ }
+ submitComposerFormRequest: (composerForm: { draft: string }) => {
+ composerForm: {
+ draft: string
+ }
+ }
+ submitComposerFormSuccess: (composerForm: { draft: string }) => {
+ composerForm: {
+ draft: string
+ }
+ }
+ touchComposerFormField: (key: string) => {
+ key: string
+ }
+ updateQueuedMessage: (
+ id: string,
+ content: string
+ ) => {
+ content: string
+ id: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runInteractionLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ isTerminal: (currentRunStatus: RunStatus | null) => boolean
+ selectedModel: (modelOverride: string | null, arg: any) => string
+ selectedEffort: (effortOverride: string | null, arg: any, selectedModel: string) => ReasoningEffortEnumApi
+ isBusy: (isThinking: boolean) => boolean
+ canSend: (sending: boolean, isTerminal: boolean, currentProjectId: number | null) => boolean
+ isSubmitting: (sending: boolean, startingRun: boolean) => boolean
+ pendingContextItems: (
+ contextItems: AttachedContextItem[],
+ sentContextKeysByTask: Record<string, string[]>,
+ arg: string
+ ) => AttachedContextItem[]
+ }
+}
+
+export type runInteractionLogicType = MakeLogicType<
+ runInteractionLogicValues,
+ runInteractionLogicActions,
+ RunInteractionLogicProps,
+ runInteractionLogicMeta
+>
+
/**
* Max-agnostic interaction facade for a single task run. The UI binds to this one logic to drive every
* user → run interaction — sending follow-ups, staging an editable "Up next" message while the agent is
@@ -236,26 +460,33 @@ export const runInteractionLogic = kea<runInteractionLogicType>([
})),
selectors({
- isTerminal: [(s) => [s.currentRunStatus], (status): boolean => isTerminalRunStatus(status)],
+ isTerminal: [
+ (s) => [s.currentRunStatus],
+ (status: null | import('./runStreamLogic').RunStatus): boolean => isTerminalRunStatus(status),
+ ],
// The model/effort to display in the picker and launch the next run with: the optimistic client-side
// override, else the run's stored value, else the default. Effort is clamped to one the model supports.
selectedModel: [
(s) => [s.modelOverride, (_, p) => p.currentModel],
- (override, current): string => override ?? current ?? DEFAULT_COMPOSER_MODEL,
+ (override: string | null, current): string => override ?? current ?? DEFAULT_COMPOSER_MODEL,
],
selectedEffort: [
(s) => [s.effortOverride, (_, p) => p.currentEffort, s.selectedModel],
- (override, current, model): ReasoningEffortEnumApi =>
+ (override: string | null, current, model: string): ReasoningEffortEnumApi =>
resolveEffortForModel(override ?? current ?? DEFAULT_COMPOSER_EFFORT, model),
],
// The agent is actively working a turn — a follow-up typed now should stage rather than send.
- isBusy: [(s) => [s.isThinking], (isThinking): boolean => isThinking],
+ isBusy: [(s) => [s.isThinking], (isThinking: boolean): boolean => isThinking],
canSend: [
(s) => [s.sending, s.isTerminal, s.currentProjectId],
- (sending, isTerminal, currentProjectId): boolean => !sending && !isTerminal && currentProjectId != null,
+ (sending: boolean, isTerminal: boolean, currentProjectId: number | null): boolean =>
+ !sending && !isTerminal && currentProjectId != null,
],
// In-flight indicator for the composer's send button — a live send or a new-run start.
- isSubmitting: [(s) => [s.sending, s.startingRun], (sending, startingRun): boolean => sending || startingRun],
+ isSubmitting: [
+ (s) => [s.sending, s.startingRun],
+ (sending: boolean, startingRun: boolean): boolean => sending || startingRun,
+ ],
// Attached context not yet wrapped into a message for this task, the snapshot the next send wraps.
// The sent-key bookkeeping is task-scoped (`attachedContextLogic.sentContextKeysByTask`), not
// run-scoped, so the dedupe survives a terminal-run send re-pointing to a fresh run instance.
@@ -263,7 +494,11 @@ export const runInteractionLogic = kea<runInteractionLogicType>([
// text is intentional, e.g. consecutive error snippets).
pendingContextItems: [
(s) => [s.contextItems, s.sentContextKeysByTask, (_, p: RunInteractionLogicProps) => p.taskId],
- (contextItems, sentContextKeysByTask, taskId): AttachedContextItem[] => {
+ (
+ contextItems: AttachedContextItem[],
+ sentContextKeysByTask: Record<string, string[]>,
+ taskId: string
+ ): AttachedContextItem[] => {
const sentKeys = new Set(sentContextKeysByTask[taskId] ?? [])
return contextItems.filter(
(item) => item.type === 'text' || !sentKeys.has(attachedContextItemKey(item))
diff --git a/products/posthog_ai/frontend/logics/runStreamLogic.ts b/products/posthog_ai/frontend/logics/runStreamLogic.ts
index 7ea4534733d4..a984d53c88f0 100644
--- a/products/posthog_ai/frontend/logics/runStreamLogic.ts
+++ b/products/posthog_ai/frontend/logics/runStreamLogic.ts
@@ -1,5 +1,17 @@
import { type EventSourceMessage, createParser } from 'eventsource-parser'
-import { type BreakPointFunction, actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ type BreakPointFunction,
+ actions,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ reducers,
+ selectors,
+} from 'kea'
import posthog from 'posthog-js'
import api from 'lib/api'
@@ -13,6 +25,8 @@ import { userLogic } from 'scenes/userLogic'
import { tasksRunsCommandCreate, tasksRunsStreamTokenRetrieve } from 'products/tasks/frontend/generated/api'
import type { TaskRunBootstrapCreateRequestInitialPermissionModeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import type { FeatureFlagsSet } from '../../../../frontend/src/lib/logic/featureFlagLogic'
+import type { UserType } from '../../../../frontend/src/types'
import { getClaudeCodeMeta, resolveToolCall } from '../components/tool/toolResolver'
import { parseSandboxQuestions } from '../policy/questionUtils'
import { defaultPermissionDecision, findAllowOptionId } from '../policy/toolPolicy'
@@ -31,6 +45,7 @@ import type {
ToolInvocationStatus,
ToolStreamPhase,
} from '../types/streamTypes'
+import type { ToolStreamEvent } from '../types/streamTypes'
import {
type PermissionOption,
type PermissionRequestFrame,
@@ -50,8 +65,8 @@ import {
isTaskRunStateFrame,
} from '../types/wireTypes'
import { debugLogsLogic } from './debugLogsLogic'
-import type { runStreamLogicType } from './runStreamLogicType'
import { hasReplayListener, toolStreamEventsLogic } from './toolStreamEventsLogic'
+import type { ToolStreamSubscription } from './toolStreamEventsLogic'
export type RunSseStatus = 'idle' | 'connecting' | 'open' | 'reconnecting' | 'closed' | 'error'
export type RunStatus = 'queued' | 'in_progress' | 'completed' | 'failed' | 'cancelled'
@@ -1229,6 +1244,269 @@ function rendersThreadItemContent(item: ThreadItem): boolean {
}
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runStreamLogicValues {
+ showDebugLogs: boolean // debugLogsLogic
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ isDev: boolean | undefined // preflightLogic
+ currentProjectId: number | null // projectLogic
+ toolListeners: Record<string, ToolStreamSubscription> // toolStreamEventsLogic
+ user: UserType | null // userLogic
+ awaitingOptimisticAttach: boolean
+ bootstrapError: StreamErrorEnvelope | null
+ bootstrapLoading: boolean
+ bootstrappedRunId: string | null
+ contextUsage: ContextUsage | null
+ cumulativeReconnectAttempt: number
+ currentMode: string | null
+ currentProgress: string | null
+ currentRunStatus: RunStatus | null
+ currentStage: string | null
+ foldedThread: FoldedThread
+ hasGitArtifacts: boolean
+ isBootstrapResumeRun: boolean
+ isThinking: boolean
+ log: RunLog
+ logBootstrapLoading: boolean
+ pendingPermissionRequest: PermissionRequestRecord | null
+ reconnectAttempt: number
+ resolvedPermissionRequestIds: Set<string>
+ resourcesUsed: ResourceProduct[]
+ respondingToPermission: boolean
+ runArtifacts: RunArtifacts
+ runConnectionState: RunConnectionState | null
+ runOpening: boolean
+ runStarted: boolean
+ sdkSession: SdkSession | null
+ seenPermissionRequestIds: Set<string>
+ showThinkingIndicator: boolean
+ sseStatus: RunSseStatus
+ streamPhase: 'idle' | 'provisioning' | 'thinking'
+ streamViaProxyEnabled: boolean
+ threadItems: ThreadItem[]
+ toolInvocations: Map<string, ToolInvocation>
+ traceId: string | null
+ turnComplete: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runStreamLogicActions {
+ emitToolEvent: (event: ToolStreamEvent) => {
+ event: ToolStreamEvent
+ } // toolStreamEventsLogic
+ appendEntries: (entries: StoredEntry[]) => {
+ entries: StoredEntry[]
+ }
+ autoApprovePermissionRequest: (
+ record: PermissionRequestRecord,
+ optionId: string
+ ) => {
+ optionId: string
+ record: PermissionRequestRecord
+ }
+ bootstrapLogReady: () => {
+ value: true
+ }
+ bootstrapReplayComplete: () => {
+ value: true
+ }
+ bootstrapRun: (payload: { justCreatedRun?: boolean; runId: string; taskId: string; traceId?: string }) => {
+ justCreatedRun?: boolean | undefined
+ runId: string
+ taskId: string
+ traceId?: string | undefined
+ }
+ cancelRun: (run?: { runId: string; taskId: string }) => {
+ run:
+ | {
+ runId: string
+ taskId: string
+ }
+ | undefined
+ }
+ clearPermissionRequest: () => {
+ value: true
+ }
+ closeSse: () => {
+ value: true
+ }
+ handleStreamError: (envelope: StreamErrorEnvelope) => StreamErrorEnvelope
+ handleTerminalStatus: (status: {
+ errorMessage?: string | null
+ replayedFromHistory?: boolean
+ status: RunStatus
+ }) => {
+ errorMessage?: string | null | undefined
+ replayedFromHistory?: boolean | undefined
+ status: RunStatus
+ }
+ ingestAcpFrame: (
+ entry: StoredLogEntry,
+ source?: FrameSource
+ ) => {
+ entry: StoredLogEntry
+ source: FrameSource
+ }
+ ingestPermissionRequest: (
+ record: PermissionRequestRecord,
+ replayedFromHistory?: boolean
+ ) => {
+ record: PermissionRequestRecord
+ replayedFromHistory: boolean
+ }
+ markBootstrapResumeRun: (value: boolean) => {
+ value: boolean
+ }
+ markPermissionRequestResolved: (requestId: string) => {
+ requestId: string
+ }
+ markPermissionRequestSeen: (requestId: string) => {
+ requestId: string
+ }
+ markRunStarted: () => {
+ value: true
+ }
+ markTurnComplete: () => {
+ value: true
+ }
+ mergeResourcesUsed: (
+ products: {
+ id?: string
+ label?: string
+ }[]
+ ) => {
+ products: {
+ id?: string | undefined
+ label?: string | undefined
+ }[]
+ }
+ mergeRunArtifacts: (partial: Partial<RunArtifacts>) => {
+ partial: Partial<RunArtifacts>
+ }
+ openSseForRun: (payload: { runId: string; startLatest?: boolean; taskId: string; traceId?: string }) => {
+ runId: string
+ startLatest?: boolean | undefined
+ taskId: string
+ traceId?: string | undefined
+ }
+ permissionResponseFailed: () => {
+ value: true
+ }
+ pushErrorItem: (
+ errorMessage: string,
+ variant?: 'crash' | 'error'
+ ) => {
+ errorMessage: string
+ variant: 'crash' | 'error'
+ }
+ pushHumanMessage: (content: string) => {
+ content: string
+ }
+ reset: () => {
+ value: true
+ }
+ respondToPermission: (payload: {
+ answers?: Record<string, string>
+ customInput?: string
+ optionId: string
+ requestId: string
+ }) => {
+ answers?: Record<string, string> | undefined
+ customInput?: string | undefined
+ optionId: string
+ requestId: string
+ }
+ routePermissionRequest: (
+ record: PermissionRequestRecord,
+ replayedFromHistory?: boolean
+ ) => {
+ record: PermissionRequestRecord
+ replayedFromHistory: boolean
+ }
+ setContextUsage: (usage: ContextUsage) => {
+ usage: ContextUsage
+ }
+ setCurrentMode: (mode: string) => {
+ mode: string
+ }
+ setCurrentProgress: (progress: string) => {
+ progress: string
+ }
+ setCurrentStage: (stage: string | null) => {
+ stage: string | null
+ }
+ setRunOpening: (opening: boolean) => {
+ opening: boolean
+ }
+ setSdkSession: (session: SdkSession) => {
+ session: SdkSession
+ }
+ sseConnecting: () => {
+ value: true
+ }
+ sseDropped: () => {
+ value: true
+ }
+ sseOpened: () => {
+ value: true
+ }
+ sseReconnecting: (attempt: number) => {
+ attempt: number
+ }
+ startOptimisticRun: (message?: string) => {
+ message: string | undefined
+ }
+ streamEnded: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runStreamLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ foldedThread: (log: RunLog, isBootstrapResumeRun: boolean) => FoldedThread
+ threadItems: (foldedThread: FoldedThread, showDebugLogs: boolean) => ThreadItem[]
+ toolInvocations: (foldedThread: FoldedThread) => Map<string, ToolInvocation>
+ isThinking: (
+ runStarted: boolean,
+ turnComplete: boolean,
+ currentRunStatus: RunStatus | null,
+ sseStatus: RunSseStatus,
+ arg: boolean | undefined
+ ) => boolean
+ streamPhase: (
+ runStarted: boolean,
+ isThinking: boolean,
+ currentRunStatus: RunStatus | null,
+ sseStatus: RunSseStatus,
+ runOpening: boolean,
+ arg: boolean | undefined
+ ) => 'idle' | 'provisioning' | 'thinking'
+ showThinkingIndicator: (
+ streamPhase: 'idle' | 'provisioning' | 'thinking',
+ threadItems: ThreadItem[],
+ toolInvocations: Map<string, ToolInvocation>
+ ) => boolean
+ hasGitArtifacts: (runArtifacts: RunArtifacts) => boolean
+ streamViaProxyEnabled: (featureFlags: FeatureFlagsSet) => boolean
+ runConnectionState: (
+ sseStatus: RunSseStatus,
+ reconnectAttempt: number,
+ bootstrapError: StreamErrorEnvelope | null,
+ currentRunStatus: RunStatus | null,
+ arg: boolean | undefined
+ ) => RunConnectionState | null
+ }
+}
+
+export type runStreamLogicType = MakeLogicType<
+ runStreamLogicValues,
+ runStreamLogicActions,
+ RunStreamLogicProps,
+ runStreamLogicMeta
+>
+
/**
* Owns the SSE connection to the products/tasks stream endpoint (a `fetch` reader driven by
* `eventsource-parser`, so a reconnect can resume via a Last-Event-ID header), parses the ACP wire
@@ -1697,11 +1975,11 @@ export const runStreamLogic = kea<runStreamLogicType>([
*/
foldedThread: [
(s) => [s.log, s.isBootstrapResumeRun],
- (log, isResumeRun): FoldedThread => foldLogToThread(log.entries, { isResumeRun }),
+ (log: RunLog, isResumeRun: boolean): FoldedThread => foldLogToThread(log.entries, { isResumeRun }),
],
threadItems: [
(s) => [s.foldedThread, s.showDebugLogs],
- (foldedThread, showDebugLogs): ThreadItem[] =>
+ (foldedThread: FoldedThread, showDebugLogs: boolean): ThreadItem[] =>
// Filtering lives here, not in the renderer: a row the renderer would return `null` for
// (a content-less item, or a debug row a non-privileged user can't see) still reserves an
// empty, gap-padded slot in the virtualized thread. Drop them before they become rows.
@@ -1713,7 +1991,7 @@ export const runStreamLogic = kea<runStreamLogicType>([
],
toolInvocations: [
(s) => [s.foldedThread],
- (foldedThread): Map<string, ToolInvocation> => foldedThread.toolInvocations,
+ (foldedThread: FoldedThread): Map<string, ToolInvocation> => foldedThread.toolInvocations,
],
/**
* Whether the agent is actively working a turn — drives the thread's thinking indicator.
@@ -1727,7 +2005,13 @@ export const runStreamLogic = kea<runStreamLogicType>([
isThinking: [
// `replayOnly` always resolves (default in `props`); `!` drops the optional-prop `undefined`.
(s, p) => [s.runStarted, s.turnComplete, s.currentRunStatus, s.sseStatus, p.replayOnly!],
- (runStarted, turnComplete, currentRunStatus, sseStatus, replayOnly): boolean => {
+ (
+ runStarted: boolean,
+ turnComplete: boolean,
+ currentRunStatus: RunStatus | null,
+ sseStatus: RunSseStatus,
+ replayOnly: boolean | undefined
+ ): boolean => {
// A read-only snapshot is never "thinking" — it's a static replay, so the indicator
// must never spin (an in-progress run replayed read-only has no live turn to await).
if (replayOnly) {
@@ -1754,12 +2038,12 @@ export const runStreamLogic = kea<runStreamLogicType>([
streamPhase: [
(s, p) => [s.runStarted, s.isThinking, s.currentRunStatus, s.sseStatus, s.runOpening, p.replayOnly!],
(
- runStarted,
- isThinking,
- currentRunStatus,
- sseStatus,
- runOpening,
- replayOnly
+ runStarted: boolean,
+ isThinking: boolean,
+ currentRunStatus: RunStatus | null,
+ sseStatus: RunSseStatus,
+ runOpening: boolean,
+ replayOnly: boolean | undefined
): 'provisioning' | 'thinking' | 'idle' => {
// A read-only snapshot never provisions or thinks — there is no live stream behind it.
if (replayOnly) {
@@ -1787,7 +2071,11 @@ export const runStreamLogic = kea<runStreamLogicType>([
*/
showThinkingIndicator: [
(s) => [s.streamPhase, s.threadItems, s.toolInvocations],
- (streamPhase, threadItems, toolInvocations): boolean => {
+ (
+ streamPhase: 'idle' | 'provisioning' | 'thinking',
+ threadItems: ThreadItem[],
+ toolInvocations: Map<string, ToolInvocation>
+ ): boolean => {
if (streamPhase !== 'thinking') {
return false
}
@@ -1819,7 +2107,7 @@ export const runStreamLogic = kea<runStreamLogicType>([
/** Whether the run exposes any git artifact worth surfacing — gates the pre/post-turn coding UI. */
hasGitArtifacts: [
(s) => [s.runArtifacts],
- (runArtifacts): boolean => !!runArtifacts.prUrl || !!runArtifacts.branch,
+ (runArtifacts: RunArtifacts): boolean => !!runArtifacts.prUrl || !!runArtifacts.branch,
],
/**
* Gates routing the live stream through the standalone agent-proxy (the durable-streaming
@@ -1831,7 +2119,8 @@ export const runStreamLogic = kea<runStreamLogicType>([
*/
streamViaProxyEnabled: [
(s) => [s.featureFlags],
- (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.TASKS_STREAM_VIA_PROXY],
+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>
+ !!featureFlags[FEATURE_FLAGS.TASKS_STREAM_VIA_PROXY],
],
/**
* The live connection banner view-model (footer `RunAlertActivity`), or null when the connection is
@@ -1842,7 +2131,13 @@ export const runStreamLogic = kea<runStreamLogicType>([
*/
runConnectionState: [
(s, p) => [s.sseStatus, s.reconnectAttempt, s.bootstrapError, s.currentRunStatus, p.replayOnly!],
- (sseStatus, reconnectAttempt, bootstrapError, currentRunStatus, replayOnly): RunConnectionState | null => {
+ (
+ sseStatus: RunSseStatus,
+ reconnectAttempt: number,
+ bootstrapError: StreamErrorEnvelope | null,
+ currentRunStatus: RunStatus | null,
+ replayOnly: boolean | undefined
+ ): RunConnectionState | null => {
if (isTerminalRunStatus(currentRunStatus)) {
return null
}
diff --git a/products/posthog_ai/frontend/logics/runnerPanelLogic.ts b/products/posthog_ai/frontend/logics/runnerPanelLogic.ts
index 2e916604fa91..afbd0421bda9 100644
--- a/products/posthog_ai/frontend/logics/runnerPanelLogic.ts
+++ b/products/posthog_ai/frontend/logics/runnerPanelLogic.ts
@@ -1,6 +1,4 @@
-import { actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
-
-import type { runnerPanelLogicType } from './runnerPanelLogicType'
+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers, selectors } from 'kea'
// The optimistic run opened on send, before the task/run exist. `streamKey` is the client key the pending
// `RunSurface` (and its seeded `runStreamLogic`) bind to; `taskId`/`runId` are filled once known (reserved
@@ -18,6 +16,51 @@ export interface RunnerPanelLogicProps {
panelId?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runnerPanelLogicValues {
+ activeCreation: ActiveCreation | null
+ cameFromHistory: boolean
+ canGoBack: boolean
+ historyExpanded: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runnerPanelLogicActions {
+ clearActiveCreation: () => {
+ value: true
+ }
+ goBack: () => {
+ value: true
+ }
+ setActiveCreation: (creation: ActiveCreation) => {
+ creation: ActiveCreation
+ }
+ setCameFromHistory: (cameFromHistory: boolean) => {
+ cameFromHistory: boolean
+ }
+ setHistoryExpanded: (expanded: boolean) => {
+ expanded: boolean
+ }
+ toggleHistory: () => {
+ value: true
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface runnerPanelLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ canGoBack: (activeCreation: ActiveCreation | null, historyExpanded: boolean) => boolean
+ }
+}
+
+export type runnerPanelLogicType = MakeLogicType<
+ runnerPanelLogicValues,
+ runnerPanelLogicActions,
+ RunnerPanelLogicProps,
+ runnerPanelLogicMeta
+>
+
export const runnerPanelLogic = kea<runnerPanelLogicType>([
path(['products', 'posthog_ai', 'frontend', 'logics', 'runnerPanelLogic']),
props({} as RunnerPanelLogicProps),
@@ -66,7 +109,8 @@ export const runnerPanelLogic = kea<runnerPanelLogicType>([
selectors({
canGoBack: [
(s) => [s.activeCreation, s.historyExpanded],
- (activeCreation, historyExpanded): boolean => !!activeCreation || historyExpanded,
+ (activeCreation: ActiveCreation | null, historyExpanded: boolean): boolean =>
+ !!activeCreation || historyExpanded,
],
}),
diff --git a/products/posthog_ai/frontend/logics/taskHistoryLogic.ts b/products/posthog_ai/frontend/logics/taskHistoryLogic.ts
index 3a1fda8c720b..951bfb135db2 100644
--- a/products/posthog_ai/frontend/logics/taskHistoryLogic.ts
+++ b/products/posthog_ai/frontend/logics/taskHistoryLogic.ts
@@ -1,12 +1,44 @@
-import { actions, connect, events, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, path, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { userLogic } from 'scenes/userLogic'
+import type { UserType } from '../../../../frontend/src/types'
import { loadErrorMessage } from '../lib/load-error'
import { OriginProduct, Task } from '../types/taskTypes'
-import type { taskHistoryLogicType } from './taskHistoryLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskHistoryLogicValues {
+ user: UserType | null // userLogic
+ history: Task[]
+ historyError: string | null
+ historyLoading: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskHistoryLogicActions {
+ loadHistory: (_: void) => void
+ loadHistoryFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadHistorySuccess: (
+ history: Task[],
+ payload?: void
+ ) => {
+ history: Task[]
+ payload?: void
+ }
+ taskArchived: (taskId: string) => {
+ taskId: string
+ }
+}
+
+export type taskHistoryLogicType = MakeLogicType<taskHistoryLogicValues, taskHistoryLogicActions>
// Deliberately independent of `tasksLogic` — the panel history must show the user's own recent
// posthog_ai tasks regardless of whatever search/assignee filter is active on the /tasks scene.
diff --git a/products/posthog_ai/frontend/logics/taskLogic.ts b/products/posthog_ai/frontend/logics/taskLogic.ts
index 028a9c6362e1..230b3271ecb1 100644
--- a/products/posthog_ai/frontend/logics/taskLogic.ts
+++ b/products/posthog_ai/frontend/logics/taskLogic.ts
@@ -1,4 +1,4 @@
-import { kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, kea, key, listeners, path, props, reducers } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -7,13 +7,97 @@ import api from 'lib/api'
import { isApiNotFound, loadErrorMessage } from '../lib/load-error'
import { phDebugQueryParams } from '../lib/ph-debug'
import { Task, type TaskUpsertProps } from '../types/taskTypes'
-import type { taskLogicType } from './taskLogicType'
import { tasksLogic } from './tasksLogic'
export interface TaskLogicProps {
taskId: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskLogicValues {
+ task: Task | null
+ taskError: string | null
+ taskLoading: boolean
+ taskNotFound: boolean
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskLogicActions {
+ deleteTask: () => any
+ deleteTaskFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteTaskSuccess: (
+ task: null,
+ payload?: any
+ ) => {
+ task: null
+ payload?: any
+ }
+ loadTask: () => any
+ loadTaskFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTaskSuccess: (
+ task: Task | null,
+ payload?: any
+ ) => {
+ task: Task | null
+ payload?: any
+ }
+ runTask: () => any
+ runTaskFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ runTaskSuccess: (
+ task: Task,
+ payload?: any
+ ) => {
+ task: Task
+ payload?: any
+ }
+ updateTask: ({ data }: { data: TaskUpsertProps }) => {
+ data: TaskUpsertProps
+ }
+ updateTaskFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ updateTaskSuccess: (
+ task: Task,
+ payload?: {
+ data: TaskUpsertProps
+ }
+ ) => {
+ task: Task
+ payload?: {
+ data: TaskUpsertProps
+ }
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskLogicMeta {
+ key: string
+}
+
+export type taskLogicType = MakeLogicType<taskLogicValues, taskLogicActions, TaskLogicProps, taskLogicMeta>
+
export const taskLogic = kea<taskLogicType>([
path(['products', 'posthog_ai', 'frontend', 'logics', 'taskLogic']),
props({} as TaskLogicProps),
diff --git a/products/posthog_ai/frontend/logics/tasksLogic.ts b/products/posthog_ai/frontend/logics/tasksLogic.ts
index 7e069a4080ab..f5c99351b3be 100644
--- a/products/posthog_ai/frontend/logics/tasksLogic.ts
+++ b/products/posthog_ai/frontend/logics/tasksLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -10,9 +10,145 @@ import { userLogic } from 'scenes/userLogic'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
+import type { UserType } from '../../../../frontend/src/types'
import { loadErrorMessage } from '../lib/load-error'
import { OriginProduct, Task, TaskAssigneeFilter, TaskListParams, TaskUpsertProps } from '../types/taskTypes'
-import type { tasksLogicType } from './tasksLogicType'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tasksLogicValues {
+ user: UserType | null // userLogic
+ assigneeFilter: TaskAssigneeFilter
+ isStaffUser: boolean
+ repositories: string[]
+ repositoriesLoading: boolean
+ searchQuery: string
+ taskListParams: TaskListParams
+ tasks: Task[]
+ tasksError: string | null
+ tasksLoading: boolean
+ tasksLoadingMore: boolean
+ tasksNext: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tasksLogicActions {
+ createTask: ({ data }: { data: TaskUpsertProps }) => {
+ data: TaskUpsertProps
+ }
+ createTaskFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ createTaskSuccess: (
+ tasks: Task[],
+ payload?: {
+ data: TaskUpsertProps
+ }
+ ) => {
+ tasks: Task[]
+ payload?: {
+ data: TaskUpsertProps
+ }
+ }
+ deleteTask: ({ taskId }: { taskId: string }) => {
+ taskId: string
+ }
+ deleteTaskFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ deleteTaskSuccess: (
+ tasks: Task[],
+ payload?: {
+ taskId: string
+ }
+ ) => {
+ tasks: Task[]
+ payload?: {
+ taskId: string
+ }
+ }
+ loadMoreTasks: (_: void) => void
+ loadMoreTasksFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadMoreTasksSuccess: (
+ tasks: Task[],
+ payload?: void
+ ) => {
+ tasks: Task[]
+ payload?: void
+ }
+ loadRepositories: () => any
+ loadRepositoriesFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadRepositoriesSuccess: (
+ repositories: string[],
+ payload?: any
+ ) => {
+ repositories: string[]
+ payload?: any
+ }
+ loadTasks: (params?: TaskListParams) => TaskListParams
+ loadTasksFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTasksSuccess: (
+ tasks: Task[],
+ payload?: TaskListParams
+ ) => {
+ tasks: Task[]
+ payload?: TaskListParams
+ }
+ openTask: (taskId: Task['id']) => {
+ taskId: string
+ }
+ setAssigneeFilter: (assigneeFilter: TaskAssigneeFilter) => {
+ assigneeFilter: TaskAssigneeFilter
+ }
+ setSearchQuery: (search: string) => {
+ search: string
+ }
+ setTasksNext: (next: string | null) => {
+ next: string | null
+ }
+ updateTask: (task: Task) => {
+ task: Task
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface tasksLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ isStaffUser: (user: UserType | null) => boolean
+ taskListParams: (
+ searchQuery: string,
+ assigneeFilter: TaskAssigneeFilter,
+ user: UserType | null
+ ) => TaskListParams
+ }
+}
+
+export type tasksLogicType = MakeLogicType<tasksLogicValues, tasksLogicActions, Record<string, any>, tasksLogicMeta>
export const tasksLogic = kea<tasksLogicType>([
path(['products', 'posthog_ai', 'frontend', 'logics', 'tasksLogic']),
@@ -140,13 +276,17 @@ export const tasksLogic = kea<tasksLogicType>([
selectors({
// The "all team" filter is staff-only; expose it so the menu can conditionally show it.
- isStaffUser: [(s) => [s.user], (user): boolean => !!user?.is_staff],
+ isStaffUser: [(s) => [s.user], (user: null | import('~/types').UserType): boolean => !!user?.is_staff],
// Combined list filters: search term + the assignee toggle. "For you" scopes to the current
// user's own tasks; "team scouts" scopes to autonomous Signals Scout tasks; "all team" (staff
// only) lists every task on the team, letting the server bypass the per-user visibility filter.
taskListParams: [
(s) => [s.searchQuery, s.assigneeFilter, s.user],
- (searchQuery, assigneeFilter, user): TaskListParams => {
+ (
+ searchQuery: string,
+ assigneeFilter: TaskAssigneeFilter,
+ user: null | import('~/types').UserType
+ ): TaskListParams => {
const base: TaskListParams = { search: searchQuery || undefined }
// Guard here too: a non-staff user must never send `all_team_tasks` (the server ignores
// it, but this keeps the request honest and falls back to their own tasks).
diff --git a/products/posthog_ai/frontend/logics/toolStreamEventsLogic.ts b/products/posthog_ai/frontend/logics/toolStreamEventsLogic.ts
index 0621010e4882..f8c2826b8b19 100644
--- a/products/posthog_ai/frontend/logics/toolStreamEventsLogic.ts
+++ b/products/posthog_ai/frontend/logics/toolStreamEventsLogic.ts
@@ -1,8 +1,7 @@
-import { actions, kea, listeners, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
import posthog from 'posthog-js'
import type { ToolStreamEvent } from '../types/streamTypes'
-import type { toolStreamEventsLogicType } from './toolStreamEventsLogicType'
export interface ToolStreamSubscription {
/** Resolved tool names to match, or `'*'` for every tool. */
@@ -22,6 +21,30 @@ function subscriptionMatches(subscription: ToolStreamSubscription, event: ToolSt
return subscription.tools.includes(event.toolName)
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface toolStreamEventsLogicValues {
+ toolListeners: Record<string, ToolStreamSubscription>
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface toolStreamEventsLogicActions {
+ deregisterToolListener: (listenerId: string) => {
+ listenerId: string
+ }
+ emitToolEvent: (event: ToolStreamEvent) => {
+ event: ToolStreamEvent
+ }
+ registerToolListener: (
+ listenerId: string,
+ subscription: ToolStreamSubscription
+ ) => {
+ listenerId: string
+ subscription: ToolStreamSubscription
+ }
+}
+
+export type toolStreamEventsLogicType = MakeLogicType<toolStreamEventsLogicValues, toolStreamEventsLogicActions>
+
/**
* Global, unkeyed event bus for tool-call lifecycle events. `runStreamLogic` emits `ToolStreamEvent`s
* (with resolved tool names); consumers register a listener that fires their `onEvent` for matching
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.ts
index fb30f9c4e407..973a2f566633 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.ts
@@ -1,4 +1,17 @@
-import { actions, afterMount, connect, kea, key, listeners, path, props, propsChanged, reducers, selectors } from 'kea'
+import {
+ MakeLogicType,
+ actions,
+ afterMount,
+ connect,
+ kea,
+ key,
+ listeners,
+ path,
+ props,
+ propsChanged,
+ reducers,
+ selectors,
+} from 'kea'
import { loaders } from 'kea-loaders'
import { router } from 'kea-router'
@@ -10,10 +23,123 @@ import { phDebugQueryParams } from '../../lib/ph-debug'
import { TaskLogicProps, taskLogic } from '../../logics/taskLogic'
import { tasksLogic } from '../../logics/tasksLogic'
import { TaskRun } from '../../types/taskTypes'
-import type { taskDetailSceneLogicType } from './taskDetailSceneLogicType'
+import type { Task, TaskUpsertProps } from '../../types/taskTypes'
export type TaskDetailSceneLogicProps = TaskLogicProps
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskDetailSceneLogicValues {
+ task: Task | null // taskLogic
+ taskError: string | null // taskLogic
+ taskLoading: boolean // taskLogic
+ taskNotFound: boolean // taskLogic
+ canEditRepository: boolean
+ isHeaderLoading: boolean
+ isRunPending: boolean
+ isTaskPending: boolean
+ runs: TaskRun[]
+ runsError: string | null
+ runsLoading: boolean
+ selectedRun: TaskRun | null
+ selectedRunData: TaskRun | null
+ selectedRunDataLoading: boolean
+ selectedRunError: string | null
+ selectedRunId: TaskRun['id'] | null
+ selectedRunNotFound: boolean
+ taskId: any
+ title: string
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskDetailSceneLogicActions {
+ deleteTask: () => any // taskLogic
+ loadTask: () => any // taskLogic
+ loadTaskSuccess: (
+ task: Task | null,
+ payload?: any
+ ) => {
+ payload?: any
+ task: Task | null
+ } // taskLogic
+ runTask: () => any // taskLogic
+ runTaskSuccess: (
+ task: Task,
+ payload?: any
+ ) => {
+ payload?: any
+ task: Task
+ } // taskLogic
+ updateTask: (args_0: { data: TaskUpsertProps }) => {
+ data: TaskUpsertProps
+ } // taskLogic
+ loadSelectedTaskRun: () => any
+ loadSelectedTaskRunFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadSelectedTaskRunSuccess: (
+ selectedRunData: TaskRun | null,
+ payload?: any
+ ) => {
+ selectedRunData: TaskRun | null
+ payload?: any
+ }
+ loadTaskRuns: () => any
+ loadTaskRunsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadTaskRunsSuccess: (
+ runs: TaskRun[],
+ payload?: any
+ ) => {
+ runs: TaskRun[]
+ payload?: any
+ }
+ setSelectedRunId: (
+ runId: TaskRun['id'] | null,
+ taskId: string
+ ) => {
+ runId: string | null
+ taskId: string
+ }
+ updateRun: (run: TaskRun) => {
+ run: TaskRun
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskDetailSceneLogicMeta {
+ key: string
+ __keaTypeGenInternalSelectorTypes: {
+ taskId: (arg: any) => any
+ selectedRun: (selectedRunData: TaskRun | null, runs: TaskRun[], selectedRunId: string | null) => TaskRun | null
+ canEditRepository: (runs: TaskRun[]) => boolean
+ isTaskPending: (taskLoading: boolean, task: Task | null) => boolean
+ isRunPending: (
+ runsLoading: boolean,
+ runs: TaskRun[],
+ selectedRunDataLoading: boolean,
+ selectedRun: TaskRun | null
+ ) => boolean
+ isHeaderLoading: (isTaskPending: boolean, isRunPending: boolean) => boolean
+ title: (task: Task | null) => string
+ }
+}
+
+export type taskDetailSceneLogicType = MakeLogicType<
+ taskDetailSceneLogicValues,
+ taskDetailSceneLogicActions,
+ TaskDetailSceneLogicProps,
+ taskDetailSceneLogicMeta
+>
+
export const taskDetailSceneLogic = kea<taskDetailSceneLogicType>([
path(['products', 'posthog_ai', 'frontend', 'scenes', 'TaskTracker', 'taskDetailSceneLogic']),
props({} as TaskDetailSceneLogicProps),
@@ -112,7 +238,7 @@ export const taskDetailSceneLogic = kea<taskDetailSceneLogicType>([
taskId: [() => [(_, props) => props.taskId], (taskId) => taskId],
selectedRun: [
(s) => [s.selectedRunData, s.runs, s.selectedRunId],
- (selectedRunData, runs, selectedRunId): TaskRun | null => {
+ (selectedRunData: TaskRun | null, runs: TaskRun[], selectedRunId: TaskRun['id'] | null): TaskRun | null => {
if (selectedRunData && selectedRunData.id === selectedRunId) {
return selectedRunData
}
@@ -124,25 +250,32 @@ export const taskDetailSceneLogic = kea<taskDetailSceneLogicType>([
],
canEditRepository: [
(s) => [s.runs],
- (runs): boolean => {
+ (runs: TaskRun[]): boolean => {
return runs.length === 0
},
],
- isTaskPending: [(s) => [s.taskLoading, s.task], (taskLoading, task): boolean => taskLoading && !task],
+ isTaskPending: [
+ (s) => [s.taskLoading, s.task],
+ (taskLoading: boolean, task: null | import('../../types/taskTypes').Task): boolean => taskLoading && !task,
+ ],
isRunPending: [
(s) => [s.runsLoading, s.runs, s.selectedRunDataLoading, s.selectedRun],
- (runsLoading, runs, selectedRunDataLoading, selectedRun): boolean =>
- (runsLoading && runs.length === 0) || (selectedRunDataLoading && !selectedRun),
+ (
+ runsLoading: boolean,
+ runs: TaskRun[],
+ selectedRunDataLoading: boolean,
+ selectedRun: TaskRun | null
+ ): boolean => (runsLoading && runs.length === 0) || (selectedRunDataLoading && !selectedRun),
],
// The header (task panel + title + run metadata) and the run log share the runs-loading phase, so
// both resolve together: one skeleton-only loading state, no piecemeal pop-in.
isHeaderLoading: [
(s) => [s.isTaskPending, s.isRunPending],
- (isTaskPending, isRunPending): boolean => isTaskPending || isRunPending,
+ (isTaskPending: boolean, isRunPending: boolean): boolean => isTaskPending || isRunPending,
],
title: [
(s) => [s.task],
- (task): string => {
+ (task: null | import('../../types/taskTypes').Task): string => {
return task?.title || task?.slug || 'Task'
},
],
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
index 30c348956c63..690b70b6394a 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, events, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, connect, events, kea, key, listeners, path, props, reducers } from 'kea'
import { router, urlToAction } from 'kea-router'
import { lemonToast } from '@posthog/lemon-ui'
@@ -14,17 +14,21 @@ import {
TaskExecutionModeEnumApi,
} from 'products/tasks/frontend/generated/api.schemas'
+import type { IntegrationType, UserBasicType } from '../../../../../frontend/src/types'
import { attachedContextItemKey, attachedContextLogic, runStreamLogic } from '../../api/logics'
import type { SuggestionGroup, SuggestionItem } from '../../api/primitives'
import { DEFAULT_HEADLINES, pickHeadline } from '../../api/primitives'
import { composerSeedLogic } from '../../logics/composerSeedLogic'
+import type { ComposerSeed } from '../../logics/composerSeedLogic'
import { runnerPanelLogic } from '../../logics/runnerPanelLogic'
+import type { ActiveCreation } from '../../logics/runnerPanelLogic'
import { tasksLogic } from '../../logics/tasksLogic'
+import type { AttachedContextItem } from '../../types/contextTypes'
import type { RepositoryConfig, Task } from '../../types/taskTypes'
import { OriginProduct, TaskUpsertProps } from '../../types/taskTypes'
+import type { TaskListParams } from '../../types/taskTypes'
import { DEFAULT_COMPOSER_EFFORT, DEFAULT_COMPOSER_MODEL, resolveEffortForModel } from '../../utils/composerModels'
import { wrapWithPosthogContext } from '../../utils/posthogContextBlock'
-import type { taskTrackerSceneLogicType } from './taskTrackerSceneLogicType'
export type { ActiveCreation } from '../../logics/runnerPanelLogic'
@@ -59,6 +63,217 @@ const EMPTY_TASK_FORM: TaskCreateForm = {
reasoningEffort: DEFAULT_COMPOSER_EFFORT,
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskTrackerSceneLogicValues {
+ dataProcessingAccepted: boolean // aiConsentLogic
+ contextItems: AttachedContextItem[] // attachedContextLogic
+ seed: ComposerSeed | null // composerSeedLogic
+ integrations: IntegrationType[] | null // integrationsLogic
+ activeCreation: ActiveCreation | null // runnerPanelLogic
+ historyExpanded: boolean // runnerPanelLogic
+ repositories: string[] // tasksLogic
+ taskListParams: TaskListParams // tasksLogic
+ tasks: Task[] // tasksLogic
+ activeSuggestionGroup: SuggestionGroup | null
+ consentBlocked: boolean
+ headline: string
+ isSubmittingTask: boolean
+ newTaskData: TaskCreateForm
+ persistedRepositoryConfig: PersistedRepositoryConfig
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskTrackerSceneLogicActions {
+ markContextSent: (
+ taskId: string,
+ keys: string[]
+ ) => {
+ keys: string[]
+ taskId: string
+ } // attachedContextLogic
+ consumeSeed: () => {
+ value: true
+ } // composerSeedLogic
+ setSeed: (seed: ComposerSeed) => {
+ seed: ComposerSeed
+ } // composerSeedLogic
+ loadIntegrationsSuccess: (
+ integrations: {
+ config: any
+ created_at: string
+ created_by?: UserBasicType | null | undefined
+ display_name: string
+ errors?: string | undefined
+ icon_url: any
+ id: number
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ }[],
+ payload?: any
+ ) => {
+ integrations: {
+ config: any
+ created_at: string
+ created_by?: UserBasicType | null | undefined
+ display_name: string
+ errors?: string | undefined
+ icon_url: any
+ id: number
+ kind:
+ | 'apns'
+ | 'aws-s3'
+ | 'azure-blob'
+ | 'bing-ads'
+ | 'clickup'
+ | 'customerio-app'
+ | 'customerio-track'
+ | 'customerio-webhook'
+ | 'databricks'
+ | 'email'
+ | 'firebase'
+ | 'github'
+ | 'gitlab'
+ | 'google-ads'
+ | 'google-analytics'
+ | 'google-cloud-service-account'
+ | 'google-cloud-storage'
+ | 'google-pubsub'
+ | 'google-search-console'
+ | 'google-sheets'
+ | 'hubspot'
+ | 'intercom'
+ | 'jira'
+ | 'linear'
+ | 'linkedin-ads'
+ | 'meta-ads'
+ | 'pinterest-ads'
+ | 'postgresql'
+ | 'reddit-ads'
+ | 's3-compatible'
+ | 'salesforce'
+ | 'slack'
+ | 'snapchat'
+ | 'snowflake'
+ | 'stripe'
+ | 'tiktok-ads'
+ | 'twilio'
+ | 'vercel'
+ }[]
+ payload?: any
+ } // integrationsLogic
+ clearActiveCreation: () => {
+ value: true
+ } // runnerPanelLogic
+ setActiveCreation: (creation: ActiveCreation) => {
+ creation: ActiveCreation
+ } // runnerPanelLogic
+ setHistoryExpanded: (expanded: boolean) => {
+ expanded: boolean
+ } // runnerPanelLogic
+ toggleHistory: () => {
+ value: true
+ } // runnerPanelLogic
+ deleteTask: (args_0: { taskId: string }) => {
+ taskId: string
+ } // tasksLogic
+ loadRepositories: () => any // tasksLogic
+ loadTasks: (params?: TaskListParams | undefined) => TaskListParams // tasksLogic
+ applyComposerSeed: () => {
+ value: true
+ }
+ applySuggestion: (item: SuggestionItem) => {
+ item: SuggestionItem
+ }
+ blockOnConsent: () => {
+ value: true
+ }
+ clearConsentBlock: () => {
+ value: true
+ }
+ maybeAutoSelectIntegration: () => {
+ value: true
+ }
+ openExistingTask: (task: Task) => {
+ task: Task
+ }
+ resetNewTaskData: () => {
+ value: true
+ }
+ setActiveSuggestionGroup: (group: SuggestionGroup | null) => {
+ group: SuggestionGroup | null
+ }
+ setHeadline: (headline: string) => {
+ headline: string
+ }
+ setNewTaskData: (data: Partial<TaskCreateForm>) => {
+ data: Partial<TaskCreateForm>
+ }
+ setPersistedRepositoryConfig: (config: PersistedRepositoryConfig) => {
+ config: PersistedRepositoryConfig
+ }
+ submitNewTask: () => {
+ value: true
+ }
+ submitNewTaskFailure: (error: string) => {
+ error: string
+ }
+ submitNewTaskSuccess: () => {
+ value: true
+ }
+ updateActiveCreationRun: (runId: string) => {
+ runId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface taskTrackerSceneLogicMeta {
+ key: string
+}
+
+export type taskTrackerSceneLogicType = MakeLogicType<
+ taskTrackerSceneLogicValues,
+ taskTrackerSceneLogicActions,
+ TaskTrackerSceneLogicProps,
+ taskTrackerSceneLogicMeta
+>
+
export const taskTrackerSceneLogic = kea<taskTrackerSceneLogicType>([
path(['products', 'posthog_ai', 'frontend', 'scenes', 'TaskTracker', 'taskTrackerSceneLogic']),
props({} as TaskTrackerSceneLogicProps),
diff --git a/products/wizard/frontend/wizardSessionStreamLogic.ts b/products/wizard/frontend/wizardSessionStreamLogic.ts
index 746752982555..847d3a380c67 100644
--- a/products/wizard/frontend/wizardSessionStreamLogic.ts
+++ b/products/wizard/frontend/wizardSessionStreamLogic.ts
@@ -1,4 +1,4 @@
-import { actions, connect, kea, key, listeners, path, props, reducers } from 'kea'
+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers } from 'kea'
import posthog from 'posthog-js'
import { FEATURE_FLAGS } from 'lib/constants'
@@ -13,9 +13,9 @@ import {
import { logSyncDebug } from 'lib/wizard-sync/wizardSyncDebugLogic'
import { projectLogic } from 'scenes/projectLogic'
+import type { FeatureFlagsSet } from '../../../frontend/src/lib/logic/featureFlagLogic'
import { getWizardSessionsStreamRetrieveUrl, wizardSessionsLatestRetrieve } from './generated/api'
import type { WizardSessionDTOApi } from './generated/api.schemas'
-import type { wizardSessionStreamLogicType } from './wizardSessionStreamLogicType'
export type WizardConnectionStatus = 'idle' | 'connecting' | 'open' | 'closed' | 'error'
@@ -29,6 +29,46 @@ export interface WizardSessionStreamLogicProps {
skillId?: string
}
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface wizardSessionStreamLogicValues {
+ featureFlags: FeatureFlagsSet // featureFlagLogic
+ currentProjectId: number | null // projectLogic
+ connectionStatus: WizardConnectionStatus
+ lastError: string | null
+ latestSession: WizardSessionDTOApi | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface wizardSessionStreamLogicActions {
+ connect: () => {
+ value: true
+ }
+ connectionErrored: (error: string) => {
+ error: string
+ }
+ connectionOpened: () => {
+ value: true
+ }
+ disconnect: () => {
+ value: true
+ }
+ sessionUpdated: (session: WizardSessionDTOApi) => {
+ session: WizardSessionDTOApi
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface wizardSessionStreamLogicMeta {
+ key: string
+}
+
+export type wizardSessionStreamLogicType = MakeLogicType<
+ wizardSessionStreamLogicValues,
+ wizardSessionStreamLogicActions,
+ WizardSessionStreamLogicProps,
+ wizardSessionStreamLogicMeta
+>
+
/**
* Subscribes to the SSE stream for a wizard workflow (optionally a specific skill)
* and exposes the latest WizardSession state plus connection status.