: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(frontend): inline Kea types batch 7 (#71461)
Marius Andradf382dc3b8b4
diff --git a/.kearc b/.kearcindex 92c6595d12e4..208cf05b0fab 100644--- a/.kearc+++ b/.kearc@@ -84,19 +84,19 @@"./.kea-inline-batch-06-slot-13","./.kea-inline-separator-06","./.kea-inline-separator-06-b",- "./.kea-inline-batch-07-slot-01",- "./.kea-inline-batch-07-slot-02",- "./.kea-inline-batch-07-slot-03",- "./.kea-inline-batch-07-slot-04",- "./.kea-inline-batch-07-slot-05",- "./.kea-inline-batch-07-slot-06",- "./.kea-inline-batch-07-slot-07",- "./.kea-inline-batch-07-slot-08",- "./.kea-inline-batch-07-slot-09",- "./.kea-inline-batch-07-slot-10",- "./.kea-inline-batch-07-slot-11",- "./.kea-inline-batch-07-slot-12",- "./.kea-inline-batch-07-slot-13",+ "./frontend/src/scenes/appContextLogic.ts",+ "./frontend/src/scenes/cohorts",+ "./frontend/src/scenes/data-management",+ "./frontend/src/scenes/notebooks",+ "./frontend/src/scenes/sceneLogic.tsx",+ "./frontend/src/scenes/settings",+ "./frontend/src/scenes/teamLogic.tsx",+ "./frontend/src/scenes/trends",+ "./frontend/src/scenes/web-analytics",+ "./products/conversations",+ "./products/early_access_features",+ "./products/subscriptions",+ "./products/tasks","./.kea-inline-separator-07","./.kea-inline-separator-07-b","./.kea-inline-batch-08-slot-01",diff --git a/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.ts b/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.tsindex 7c41c484d3c8..d2e43bfc765b 100644--- a/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.ts+++ b/frontend/src/lib/components/IframedToolbarBrowser/iframedToolbarBrowserLogic.ts@@ -95,7 +95,7 @@ export interface iframedToolbarBrowserLogicActions {} // authorizedUrlListLogicupdateCurrentTeamSuccess: (currentTeam: TeamPublicType | TeamType,- payload?: Partial<TeamType>+ payload?: Partial<TeamType> | undefined) => {currentTeam: TeamPublicType | TeamTypepayload?: Partial<TeamType>@@ -155,10 +155,13 @@ export interface iframedToolbarBrowserLogicActions {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface iframedToolbarBrowserLogicMeta {__keaTypeGenInternalSelectorTypes: {- isBrowserUrlAuthorized: (browserUrl: string | null, checkUrlIsAuthorized: (url: string) => boolean) => boolean+ isBrowserUrlAuthorized: (+ browserUrl: string | null,+ checkUrlIsAuthorized: (url: string) => boolean // authorizedUrlListLogic+ ) => booleanisProposedBrowserUrlAuthorized: (proposedBrowserUrl: string | null,- checkUrlIsAuthorized: (url: string) => boolean+ checkUrlIsAuthorized: (url: string) => boolean // authorizedUrlListLogic) => booleanviewportRange: (heatmapFilters: HeatmapFilters,diff --git a/frontend/src/scenes/appContextLogic.ts b/frontend/src/scenes/appContextLogic.tsindex a18f0714160c..0da032d98048 100644--- a/frontend/src/scenes/appContextLogic.ts+++ b/frontend/src/scenes/appContextLogic.ts@@ -1,4 +1,4 @@-import { afterMount, connect, kea, path } from 'kea'+import { MakeLogicType, afterMount, connect, kea, path } from 'kea'import posthog from 'posthog-js'import api from 'lib/api'@@ -6,12 +6,38 @@ import { getAppContext } from 'lib/utils/getAppContext'import { UserType } from '~/types'-import type { appContextLogicType } from './appContextLogicType'+import type { OrganizationType } from '../types'import { organizationLogic } from './organizationLogic'import { projectLogic } from './projectLogic'import { teamLogic } from './teamLogic'import { userLogic } from './userLogic'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface appContextLogicActions {+ loadCurrentOrganizationSuccess: (+ currentOrganization: OrganizationType | null,+ payload?: any+ ) => {+ currentOrganization: OrganizationType | null+ payload?: any+ } // organizationLogic+ loadCurrentProject: () => any // projectLogic+ loadCurrentTeam: () => any // teamLogic+ loadUserSuccess: (+ user: UserType | null,+ payload?: {+ resetOnFailure: boolean | undefined+ }+ ) => {+ payload?: {+ resetOnFailure: boolean | undefined+ }+ user: UserType | null+ } // userLogic+}++export type appContextLogicType = MakeLogicType<{}, appContextLogicActions>+export const appContextLogic = kea<appContextLogicType>([path(['scenes', 'appContextLogic']),connect(() => ({diff --git a/frontend/src/scenes/cohorts/CohortFilters/cohortFieldLogic.ts b/frontend/src/scenes/cohorts/CohortFilters/cohortFieldLogic.tsindex d230ecbd8735..3de1c9021158 100644--- a/frontend/src/scenes/cohorts/CohortFilters/cohortFieldLogic.ts+++ b/frontend/src/scenes/cohorts/CohortFilters/cohortFieldLogic.ts@@ -1,4 +1,16 @@-import { actions, connect, kea, key, listeners, path, props, propsChanged, reducers, selectors } from 'kea'+import {+ MakeLogicType,+ actions,+ connect,+ kea,+ key,+ listeners,+ path,+ props,+ propsChanged,+ reducers,+ selectors,+} from 'kea'import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'import { objectsEqual } from 'lib/utils/objects'@@ -12,7 +24,8 @@ import { cohortsModel } from '~/models/cohortsModel'import { groupsModel } from '~/models/groupsModel'import { ActorGroupType, AnyCohortCriteriaType, AvailableFeature } from '~/types'-import type { cohortFieldLogicType } from './cohortFieldLogicType'+import type { Noun } from '../../../models/groupsModel'+import type { AnyPropertyFilter, GroupType, GroupTypeIndex, PropertyFilterValue } from '../../../types'export interface CohortFieldLogicProps {cohortFilterLogicKey: string@@ -23,6 +36,69 @@ export interface CohortFieldLogicProps {fieldOptionGroupTypes?: FieldOptionsType[]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortFieldLogicValues {+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic+ calculatedValue: (+ taxonomicGroupType: TaxonomicFilterGroupType+ ) => PropertyFilterValue | AnyPropertyFilter[] | undefined+ calculatedValueLoading: (taxonomicGroupType: TaxonomicFilterGroupType) => boolean+ currentOption: any+ fieldOptionGroups: FieldValues[]+ hasBehavioralCohortFiltering: boolean+ value: PropertyFilterValue | AnyPropertyFilter[] | undefined+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortFieldLogicActions {+ onChange: (newField: AnyCohortCriteriaType) => {+ newField: AnyCohortCriteriaType+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortFieldLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ hasBehavioralCohortFiltering: (+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => boolean+ fieldOptionGroups: (+ arg: any,+ groupTypes: Map<GroupTypeIndex, GroupType>,+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun,+ hasBehavioralCohortFiltering: boolean+ ) => FieldValues[]+ currentOption: (+ fieldOptionGroups: FieldValues[],+ value: PropertyFilterValue | AnyPropertyFilter[] | undefined+ ) => any+ calculatedValueLoading: (+ value: PropertyFilterValue | AnyPropertyFilter[] | undefined,+ criteria: AnyCohortCriteriaType,+ fieldKey: keyof import('~/types').CohortCriteriaType,+ allCohortsLoading: boolean,+ actionsLoading: boolean+ ) => (taxonomicGroupType: TaxonomicFilterGroupType) => boolean+ calculatedValue: (+ value: PropertyFilterValue | AnyPropertyFilter[] | undefined,+ criteria: AnyCohortCriteriaType,+ fieldKey: keyof import('~/types').CohortCriteriaType,+ allCohortsLoading: boolean,+ actionsLoading: boolean+ ) => (taxonomicGroupType: TaxonomicFilterGroupType) => PropertyFilterValue | AnyPropertyFilter[] | undefined+ }+}++export type cohortFieldLogicType = MakeLogicType<+ cohortFieldLogicValues,+ cohortFieldLogicActions,+ CohortFieldLogicProps,+ cohortFieldLogicMeta+>+export const cohortFieldLogic = kea<cohortFieldLogicType>([path(['scenes', 'cohorts', 'CohortFilters', 'cohortFieldLogic']),key((props) => `${props.cohortFilterLogicKey}`),@@ -50,7 +126,8 @@ export const cohortFieldLogic = kea<cohortFieldLogicType>([selectors({hasBehavioralCohortFiltering: [(s) => [s.hasAvailableFeature],- (hasAvailableFeature) => hasAvailableFeature(AvailableFeature.BEHAVIORAL_COHORT_FILTERING),+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean) =>+ hasAvailableFeature(AvailableFeature.BEHAVIORAL_COHORT_FILTERING),],fieldOptionGroups: [(s) => [@@ -59,7 +136,15 @@ export const cohortFieldLogic = kea<cohortFieldLogicType>([s.aggregationLabel,s.hasBehavioralCohortFiltering,],- (fieldOptionGroupTypes, groupTypes, aggregationLabel, hasBehavioralCohortFiltering): FieldValues[] => {+ (+ fieldOptionGroupTypes,+ groupTypes: Map<import('~/types').GroupTypeIndex, import('~/types').GroupType>,+ aggregationLabel: (+ groupTypeIndex: number | null | undefined,+ deferToUserWording?: boolean+ ) => import('~/models/groupsModel').Noun,+ hasBehavioralCohortFiltering: boolean+ ): FieldValues[] => {const fieldOptions = hasBehavioralCohortFiltering? { ...FIELD_VALUES, ...SCALE_FIELD_VALUES }: FIELD_VALUES@@ -89,7 +174,10 @@ export const cohortFieldLogic = kea<cohortFieldLogicType>([],currentOption: [(s) => [s.fieldOptionGroups, s.value],- (fieldOptionGroups, value) =>+ (+ fieldOptionGroups: FieldValues[],+ value: import('~/types').AnyPropertyFilter[] | import('~/types').PropertyFilterValue | undefined+ ) =>value && typeof value === 'string'? fieldOptionGroups.reduce((accumulator, group) => {@@ -108,7 +196,13 @@ export const cohortFieldLogic = kea<cohortFieldLogicType>([cohortsModel.selectors.allCohortsLoading,actionsModel.selectors.actionsLoading,],- (value, criteria, fieldKey, cohortsModelLoading, actionsModelLoading) =>+ (+ value: import('~/types').AnyPropertyFilter[] | import('~/types').PropertyFilterValue | undefined,+ criteria: AnyCohortCriteriaType,+ fieldKey: keyof import('~/types').CohortCriteriaType,+ cohortsModelLoading: boolean,+ actionsModelLoading: boolean+ ) =>(taxonomicGroupType: TaxonomicFilterGroupType) => {return ((criteria.type === BehavioralFilterKey.Cohort &&@@ -129,7 +223,13 @@ export const cohortFieldLogic = kea<cohortFieldLogicType>([cohortsModel.selectors.allCohortsLoading,actionsModel.selectors.actionsLoading,],- (value, criteria, fieldKey, cohortsModelLoading, actionsModelLoading) =>+ (+ value: import('~/types').AnyPropertyFilter[] | import('~/types').PropertyFilterValue | undefined,+ criteria: AnyCohortCriteriaType,+ fieldKey: keyof import('~/types').CohortCriteriaType,+ cohortsModelLoading: boolean,+ actionsModelLoading: boolean+ ) =>(taxonomicGroupType: TaxonomicFilterGroupType) => {// Only used by taxonomic filter field to determine label nameif (diff --git a/frontend/src/scenes/cohorts/addPersonToCohortModalLogic.ts b/frontend/src/scenes/cohorts/addPersonToCohortModalLogic.tsindex b36679c21f9c..03509cab803e 100644--- a/frontend/src/scenes/cohorts/addPersonToCohortModalLogic.ts+++ b/frontend/src/scenes/cohorts/addPersonToCohortModalLogic.ts@@ -1,4 +1,4 @@-import { actions, kea, key, listeners, path, props, reducers } from 'kea'+import { MakeLogicType, actions, kea, key, listeners, path, props, reducers } from 'kea'import { loaders } from 'kea-loaders'import api, { PaginatedResponse } from 'lib/api'@@ -8,7 +8,6 @@ import { dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'import { ActorsQuery, NodeKind } from '~/queries/schema/schema-general'import { CohortType, PersonType } from '~/types'-import type { addPersonToCohortModalLogicType } from './addPersonToCohortModalLogicType'import { cohortEditLogic } from './cohortEditLogic'import { createCohortDataNodeLogicKey } from './cohortUtils'@@ -22,6 +21,67 @@ const DEFAULT_QUERY: ActorsQuery = {select: ['id', 'person_display_name -- Person'],}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface addPersonToCohortModalLogicValues {+ addPersonToCohortModalVisible: boolean+ cohortPersons: PaginatedResponse<PersonType>+ cohortPersonsLoading: boolean+ isCohortUpdating: boolean+ personsToAddToCohort: Record<string, boolean>+ query: ActorsQuery+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface addPersonToCohortModalLogicActions {+ addPerson: (personId: string) => {+ personId: string+ }+ addPersonsToCohort: () => boolean+ hideAddPersonToCohortModal: () => {+ value: true+ }+ loadCohortPersons: () => any+ loadCohortPersonsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCohortPersonsSuccess: (+ cohortPersons: PaginatedResponse<PersonType>,+ payload?: any+ ) => {+ cohortPersons: PaginatedResponse<PersonType>+ payload?: any+ }+ removePerson: (personId: string) => {+ personId: string+ }+ resetPersons: () => boolean+ setCohortUpdating: (updating: boolean) => {+ updating: boolean+ }+ setQuery: (query: ActorsQuery) => {+ query: ActorsQuery+ }+ showAddPersonToCohortModal: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface addPersonToCohortModalLogicMeta {+ key: string+}++export type addPersonToCohortModalLogicType = MakeLogicType<+ addPersonToCohortModalLogicValues,+ addPersonToCohortModalLogicActions,+ AddPersonToCohortModalProps,+ addPersonToCohortModalLogicMeta+>+export const addPersonToCohortModalLogic = kea<addPersonToCohortModalLogicType>([props({} as AddPersonToCohortModalProps),path(['scenes', 'cohorts', 'addPersonToCohortModalLogic']),diff --git a/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.ts b/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.tsindex bcf00bd6b1df..c45991ba6641 100644--- a/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.ts+++ b/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.ts@@ -1,9 +1,9 @@-import { actions, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'+import { MakeLogicType, actions, events, kea, key, listeners, path, props, reducers, selectors } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'-import type { cohortCalculationHistorySceneLogicType } from './cohortCalculationHistorySceneLogicType'+import type { CohortType } from '../../types'export interface CohortCalculationHistorySceneLogicProps {cohortId: number@@ -41,6 +41,80 @@ export interface CohortCalculationHistoryResponse {previous: string | null}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortCalculationHistorySceneLogicValues {+ calculationHistory: CohortCalculationHistoryRecord[]+ calculationHistoryResponse: CohortCalculationHistoryResponse+ calculationHistoryResponseLoading: boolean+ cohort: any+ cohortLoading: boolean+ cohortMissing: boolean+ limit: number+ page: number+ totalRecords: number+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortCalculationHistorySceneLogicActions {+ loadCalculationHistory: (_: any) => any+ loadCalculationHistoryFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCalculationHistorySuccess: (+ calculationHistoryResponse: CohortCalculationHistoryResponse,+ payload?: any+ ) => {+ calculationHistoryResponse: CohortCalculationHistoryResponse+ payload?: any+ }+ loadCohort: (_: any) => any+ loadCohortFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCohortSuccess: (+ cohort: CohortType | null,+ payload?: any+ ) => {+ cohort: CohortType | null+ payload?: any+ }+ setCohortMissing: () => {+ value: true+ }+ setLimit: (limit: number) => {+ limit: number+ }+ setPage: (page: number) => {+ page: number+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortCalculationHistorySceneLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ calculationHistory: (+ calculationHistoryResponse: CohortCalculationHistoryResponse+ ) => CohortCalculationHistoryRecord[]+ totalRecords: (calculationHistoryResponse: CohortCalculationHistoryResponse) => number+ }+}++export type cohortCalculationHistorySceneLogicType = MakeLogicType<+ cohortCalculationHistorySceneLogicValues,+ cohortCalculationHistorySceneLogicActions,+ CohortCalculationHistorySceneLogicProps,+ cohortCalculationHistorySceneLogicMeta+>+export const cohortCalculationHistorySceneLogic = kea<cohortCalculationHistorySceneLogicType>([props({} as CohortCalculationHistorySceneLogicProps),key(({ cohortId }) => String(cohortId)),diff --git a/frontend/src/scenes/cohorts/cohortCountWarningLogic.test.ts b/frontend/src/scenes/cohorts/cohortCountWarningLogic.test.tsindex 8089e37aa36d..f9917558a2f9 100644--- a/frontend/src/scenes/cohorts/cohortCountWarningLogic.test.ts+++ b/frontend/src/scenes/cohorts/cohortCountWarningLogic.test.ts@@ -9,7 +9,7 @@ import { mockCohort } from '~/test/mocks'import { CohortType, FilterLogicalOperator, PropertyFilterType, PropertyOperator } from '~/types'import { CohortCountWarningLogicProps, cohortCountWarningLogic } from './cohortCountWarningLogic'-import type { cohortCountWarningLogicType } from './cohortCountWarningLogicType'+import type { cohortCountWarningLogicType } from './cohortCountWarningLogic'const createMockQuery = (cohortId: number, overrides: Partial<ActorsQuery> = {}): DataTableNode => ({kind: NodeKind.DataTableNode,diff --git a/frontend/src/scenes/cohorts/cohortCountWarningLogic.ts b/frontend/src/scenes/cohorts/cohortCountWarningLogic.tsindex 7337fe00edad..2907a18a3875 100644--- a/frontend/src/scenes/cohorts/cohortCountWarningLogic.ts+++ b/frontend/src/scenes/cohorts/cohortCountWarningLogic.ts@@ -1,10 +1,23 @@-import { connect, kea, key, path, props, selectors } from 'kea'+import { MakeLogicType, connect, kea, key, path, props, selectors } from 'kea'import { dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'import { ActorsQuery, ActorsQueryResponse, DataTableNode } from '~/queries/schema/schema-general'import { CohortType } from '~/types'-import type { cohortCountWarningLogicType } from './cohortCountWarningLogicType'+import type {+ ErrorTrackingQueryResponse,+ HogQLAutocompleteResponse,+ HogQLMetadataResponse,+ HogQLQueryResponse,+ HogQueryResponse,+ LogAttributesQueryResponse,+ LogValuesQueryResponse,+ MetricsQueryResponse,+ SessionsQueryResponse,+ TraceSpansAggregationQueryResponse,+ TraceSpansAttributeBreakdownQueryResponse,+ TraceSpansQueryResponse,+} from '../../queries/schema/schema-general'export type CohortCountWarningLogicProps = {cohort: CohortType@@ -12,6 +25,58 @@ export type CohortCountWarningLogicProps = {dataNodeLogicKey: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortCountWarningLogicValues {+ response:+ | ErrorTrackingQueryResponse+ | HogQLAutocompleteResponse+ | HogQLMetadataResponse+ | HogQLQueryResponse<any[]>+ | HogQueryResponse+ | LogAttributesQueryResponse+ | LogValuesQueryResponse+ | MetricsQueryResponse+ | Record<string, any>+ | SessionsQueryResponse+ | TraceSpansAggregationQueryResponse+ | TraceSpansAttributeBreakdownQueryResponse+ | TraceSpansQueryResponse+ | null // dataNodeLogic+ shouldShowCountWarning: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortCountWarningLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ shouldShowCountWarning: (+ response:+ | ErrorTrackingQueryResponse+ | HogQLAutocompleteResponse+ | HogQLMetadataResponse+ | HogQLQueryResponse<any[]>+ | HogQueryResponse+ | LogAttributesQueryResponse+ | LogValuesQueryResponse+ | MetricsQueryResponse+ | Record<string, any>+ | SessionsQueryResponse+ | TraceSpansAggregationQueryResponse+ | TraceSpansAttributeBreakdownQueryResponse+ | TraceSpansQueryResponse+ | null,+ query: DataTableNode+ ) => boolean+ }+}++export type cohortCountWarningLogicType = MakeLogicType<+ cohortCountWarningLogicValues,+ {},+ CohortCountWarningLogicProps,+ cohortCountWarningLogicMeta+>+export const cohortCountWarningLogic = kea<cohortCountWarningLogicType>([props({} as CohortCountWarningLogicProps),key((props) => `cohort-count-warning-${props.cohort.id}-${props.dataNodeLogicKey}`),diff --git a/frontend/src/scenes/cohorts/cohortEditLogic.ts b/frontend/src/scenes/cohorts/cohortEditLogic.tsindex 2cab4788bfaf..bd8a733be982 100644--- a/frontend/src/scenes/cohorts/cohortEditLogic.ts+++ b/frontend/src/scenes/cohorts/cohortEditLogic.ts@@ -1,4 +1,5 @@import {+ MakeLogicType,actions,afterMount,beforeUnmount,@@ -13,6 +14,7 @@ import {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 posthog from 'posthog-js'@@ -66,7 +68,7 @@ import {import { cohortsUsedInRetrieve } from 'products/cohorts/frontend/generated/api'import type { CohortUsedInResponseApi } from 'products/cohorts/frontend/generated/api.schemas'-import type { cohortEditLogicType } from './cohortEditLogicType'+import type { UserBasicType } from '../../types'export type CohortLogicProps = {id?: CohortType['id']@@ -97,6 +99,413 @@ const inferStaticCohortMode = (cohort: CohortType): StaticCohortMode =>? 'criteria': 'people'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortEditLogicValues {+ currentProjectId: number | string // teamLogic+ activeTab: CohortEditTab+ canRemovePersonFromCohort: boolean | undefined+ cohort: CohortType+ cohortAllErrors: Record<string, any>+ cohortChanged: boolean+ cohortErrors: DeepPartialMap<CohortType, ValidationErrorType>+ cohortHasErrors: boolean+ cohortLoading: boolean+ cohortManualErrors: Record<string, any>+ cohortMissing: boolean+ cohortTouched: boolean+ cohortTouches: Record<string, boolean>+ cohortValidationErrors: DeepPartialMap<CohortType, ValidationErrorType>+ creationPersonQuery: ActorsQuery+ duplicatedCohort: CohortType | null+ duplicatedCohortLoading: boolean+ effectiveQuery: DataTableNode+ isCalculatingOrPending: boolean+ isCohortSubmitting: boolean+ isCohortValid: boolean+ isPendingCalculation: boolean+ persistedColumns: string[] | null+ personsToCreateStaticCohort: Record<string, boolean>+ pollTimeout: number | null+ query: DataTableNode+ removePersonFromCohort: any+ removePersonFromCohortLoading: boolean+ showCohortErrors: boolean+ staticCohortMode: StaticCohortMode+ usedIn: CohortUsedInResponseApi | null+ usedInLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortEditLogicActions {+ reportExperimentExposureCohortEdited: (+ existingCohort: CohortType,+ newCohort: CohortType+ ) => {+ existingCohort: CohortType+ newCohort: CohortType+ } // eventUsageLogic+ addFilter: (groupIndex?: number) => {+ groupIndex: number | undefined+ }+ addPersonToCreateStaticCohort: (personId: string) => {+ personId: string+ }+ checkIfFinishedCalculating: (cohort: CohortType) => {+ cohort: CohortType+ }+ deleteCohort: () => {+ value: true+ }+ duplicateCohort: (asStatic: boolean) => {+ asStatic: boolean+ }+ duplicateCohortFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ duplicateCohortSuccess: (+ duplicatedCohort: CohortType | null,+ payload?: {+ asStatic: boolean+ }+ ) => {+ duplicatedCohort: CohortType | null+ payload?: {+ asStatic: boolean+ }+ }+ duplicateFilter: (+ groupIndex: number,+ criteriaIndex?: number+ ) => {+ criteriaIndex: number | undefined+ groupIndex: number+ }+ fetchCohort: (id: CohortType['id']) => {+ id: number | 'new'+ }+ fetchCohortFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ fetchCohortSuccess: (+ cohort: CohortType,+ payload?: {+ id: number | 'new'+ }+ ) => {+ cohort: CohortType+ payload?: {+ id: number | 'new'+ }+ }+ loadUsedIn: () => any+ loadUsedInFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadUsedInSuccess: (+ usedIn: CohortUsedInResponseApi | null,+ payload?: any+ ) => {+ usedIn: CohortUsedInResponseApi | null+ payload?: any+ }+ onCriteriaChange: (+ newGroup: Partial<CohortGroupType>,+ id: string+ ) => {+ id: string+ newGroup: Partial<CohortGroupType>+ }+ onCriteriaChangeFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ onCriteriaChangeSuccess: (+ cohort: CohortType,+ payload?: {+ id: string+ newGroup: Partial<CohortGroupType>+ }+ ) => {+ cohort: CohortType+ payload?: {+ id: string+ newGroup: Partial<CohortGroupType>+ }+ }+ refreshPersonsData: () => {+ value: true+ }+ removeFilter: (+ groupIndex: number,+ criteriaIndex?: number+ ) => {+ criteriaIndex: number | undefined+ groupIndex: number+ }+ removePersonFromCohort: (personId: string) => {+ personId: string+ }+ removePersonFromCohortFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ removePersonFromCohortSuccess: (+ removePersonFromCohort: void,+ payload?: {+ personId: string+ }+ ) => {+ removePersonFromCohort: void+ payload?: {+ personId: string+ }+ }+ removePersonFromCreateStaticCohort: (personId: string) => {+ personId: string+ }+ resetCohort: (values?: CohortType) => {+ values?: CohortType+ }+ resetPersonsToCreateStaticCohort: () => {+ value: true+ }+ restoreCohort: () => {+ value: true+ }+ restoreCohortFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ restoreCohortSuccess: (+ cohort: CohortType,+ payload?: {+ value: true+ }+ ) => {+ cohort: CohortType+ payload?: {+ value: true+ }+ }+ saveCohort: (cohortParams?: any) => {+ cohortParams: any+ }+ saveCohortFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ saveCohortSuccess: (+ cohort: CohortType,+ payload?: {+ cohortParams: any+ }+ ) => {+ cohort: CohortType+ payload?: {+ cohortParams: any+ }+ }+ setActiveTab: (tab: CohortEditTab) => {+ tab: CohortEditTab+ }+ setCohort: (cohort: CohortType) => {+ cohort: CohortType+ }+ setCohortFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setCohortManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setCohortMissing: () => {+ value: true+ }+ setCohortSuccess: (+ cohort: CohortType,+ payload?: {+ cohort: CohortType+ }+ ) => {+ cohort: CohortType+ payload?: {+ cohort: CohortType+ }+ }+ setCohortValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setCohortValues: (values: DeepPartial<CohortType>) => {+ values: DeepPartial<CohortType>+ }+ setCreationPersonQuery: (query: ActorsQuery) => {+ query: ActorsQuery+ }+ setCriteria: (+ newCriteria: AnyCohortCriteriaType,+ groupIndex: number,+ criteriaIndex: number+ ) => {+ criteriaIndex: number+ groupIndex: number+ newCriteria: AnyCohortCriteriaType+ }+ setInnerGroupType: (+ type: FilterLogicalOperator,+ groupIndex: number+ ) => {+ groupIndex: number+ type: FilterLogicalOperator+ }+ setOuterGroupsType: (type: FilterLogicalOperator) => {+ type: FilterLogicalOperator+ }+ setPollTimeout: (pollTimeout: number | null) => {+ pollTimeout: number | null+ }+ setQuery: (query: Node) => {+ query: Node<Record<string, any>>+ }+ setStaticCohortMode: (mode: StaticCohortMode) => {+ mode: StaticCohortMode+ }+ submitCohort: () => {+ value: boolean+ }+ submitCohortFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitCohortRequest: (cohort: CohortType) => {+ cohort: CohortType+ }+ submitCohortSuccess: (cohort: CohortType) => {+ cohort: CohortType+ }+ touchCohortField: (key: string) => {+ key: string+ }+ updateCohortCount: () => {+ value: true+ }+ updateCohortCountFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ updateCohortCountSuccess: (+ cohort: {+ _create_in_folder?: string | null | undefined+ _create_static_person_ids?: string[] | undefined+ count: number | undefined+ created_at?: string | undefined+ created_by?: UserBasicType | null | undefined+ csv?: File | undefined+ deleted?: boolean | undefined+ description?: string | undefined+ errors_calculating?: number | undefined+ experiment_set?: number[] | undefined+ filters: {+ properties: CohortCriteriaGroupFilter+ }+ groups: CohortGroupType[]+ id: number | 'new'+ is_calculating?: boolean | undefined+ is_static?: boolean | undefined+ last_calculation?: string | undefined+ last_error_message?: string | null | undefined+ name?: string | undefined+ pending_version?: number | null | undefined+ version?: number | null | undefined+ },+ payload?: {+ value: true+ }+ ) => {+ cohort: {+ _create_in_folder?: string | null | undefined+ _create_static_person_ids?: string[] | undefined+ count: number | undefined+ created_at?: string | undefined+ created_by?: UserBasicType | null | undefined+ csv?: File | undefined+ deleted?: boolean | undefined+ description?: string | undefined+ errors_calculating?: number | undefined+ experiment_set?: number[] | undefined+ filters: {+ properties: CohortCriteriaGroupFilter+ }+ groups: CohortGroupType[]+ id: number | 'new'+ is_calculating?: boolean | undefined+ is_static?: boolean | undefined+ last_calculation?: string | undefined+ last_error_message?: string | null | undefined+ name?: string | undefined+ pending_version?: number | null | undefined+ version?: number | null | undefined+ }+ payload?: {+ value: true+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortEditLogicMeta {+ key: number | 'new'+ __keaTypeGenInternalSelectorTypes: {+ effectiveQuery: (query: DataTableNode, persistedColumns: string[] | null) => DataTableNode+ canRemovePersonFromCohort: (cohort: CohortType) => boolean | undefined+ isPendingCalculation: (cohort: CohortType) => boolean+ isCalculatingOrPending: (cohort: CohortType, isPendingCalculation: boolean) => boolean+ }+}++export type cohortEditLogicType = MakeLogicType<+ cohortEditLogicValues,+ cohortEditLogicActions,+ CohortLogicProps,+ cohortEditLogicMeta+>+export const cohortEditLogic = kea<cohortEditLogicType>([props({} as CohortLogicProps),key((props) => (props.id === 'new' || !props.id ? 'new' : props.id)),diff --git a/frontend/src/scenes/cohorts/cohortSceneLogic.ts b/frontend/src/scenes/cohorts/cohortSceneLogic.tsindex 3b28bc30a37d..76076a47064f 100644--- a/frontend/src/scenes/cohorts/cohortSceneLogic.ts+++ b/frontend/src/scenes/cohorts/cohortSceneLogic.ts@@ -1,4 +1,4 @@-import { kea, path, props, selectors } from 'kea'+import { MakeLogicType, kea, path, props, selectors } from 'kea'import { Scene } from 'scenes/sceneTypes'import { urls } from 'scenes/urls'@@ -8,7 +8,27 @@ import { cohortsModel } from '~/models/cohortsModel'import { ActivityScope, Breadcrumb, ProjectTreeRef } from '~/types'import { CohortLogicProps } from './cohortEditLogic'-import type { cohortSceneLogicType } from './cohortSceneLogicType'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortSceneLogicValues {+ breadcrumbs: Breadcrumb[]+ projectTreeRef: ProjectTreeRef+ sidePanelContext: SidePanelSceneContext | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortSceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ breadcrumbs: (+ cohortsById: Partial<Record<number | string, import('~/types').CohortType>>,+ arg: CohortLogicProps['id']+ ) => Breadcrumb[]+ sidePanelContext: (arg: number | 'new' | undefined) => SidePanelSceneContext | null+ projectTreeRef: (arg: number | 'new' | undefined) => ProjectTreeRef+ }+}++export type cohortSceneLogicType = MakeLogicType<cohortSceneLogicValues, {}, CohortLogicProps, cohortSceneLogicMeta>export const cohortSceneLogic = kea<cohortSceneLogicType>([props({} as CohortLogicProps),@@ -17,7 +37,10 @@ export const cohortSceneLogic = kea<cohortSceneLogicType>([selectors({breadcrumbs: [() => [cohortsModel.selectors.cohortsById, (_, props) => props.id as CohortLogicProps['id']],- (cohortsById, cohortId): Breadcrumb[] => {+ (+ cohortsById: Partial<Record<number | string, import('~/types').CohortType>>,+ cohortId: CohortLogicProps['id']+ ): Breadcrumb[] => {return [{key: 'cohorts',@@ -46,7 +69,10 @@ export const cohortSceneLogic = kea<cohortSceneLogicType>([],projectTreeRef: [() => [(_, props: CohortLogicProps) => props.id],- (id): ProjectTreeRef => ({ type: 'cohort', ref: id === 'new' ? null : String(id) }),+ (id: number | 'new' | undefined): ProjectTreeRef => ({+ type: 'cohort',+ ref: id === 'new' ? null : String(id),+ }),],}),])diff --git a/frontend/src/scenes/cohorts/cohortsSceneLogic.ts b/frontend/src/scenes/cohorts/cohortsSceneLogic.tsindex 4f7233f33fa2..07add017252d 100644--- a/frontend/src/scenes/cohorts/cohortsSceneLogic.ts+++ b/frontend/src/scenes/cohorts/cohortsSceneLogic.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 { router, urlToAction } from 'kea-router'import posthog from 'posthog-js'@@ -18,7 +18,7 @@ import { deleteFromTree, refreshTreeItem } from '~/layout/panel-layout/ProjectTrimport { processCohort } from '~/models/cohortsModel'import { ActivityScope, Breadcrumb, CohortType, ExporterFormat } from '~/types'-import type { cohortsSceneLogicType } from './cohortsSceneLogicType'+import type { TriggerExportProps } from '../../lib/components/ExportButton/exporter'export interface CohortFilters {search?: string@@ -38,6 +38,104 @@ const DEFAULT_COHORT_FILTERS: CohortFilters = {const COHORTS_PER_PAGE = 100+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortsSceneLogicValues {+ breadcrumbs: Breadcrumb[]+ cohortFilters: CohortFilters+ cohortSorting: Sorting | null+ cohorts: CountedPaginatedResponse<CohortType>+ cohortsLoadError: string | null+ cohortsLoading: boolean+ count: number+ pagination: PaginationManual+ paramsFromFilters: {+ created_by_id?: number | undefined+ limit: number+ offset: number+ page?: number | undefined+ search?: string | undefined+ type?: 'dynamic' | 'static' | undefined+ }+ shouldShowEmptyState: boolean+ sidePanelContext: SidePanelSceneContext+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortsSceneLogicActions {+ startExport: (exportData: TriggerExportProps) => {+ exportData: TriggerExportProps+ } // exportsLogic+ deleteCohort: (cohort: Partial<CohortType>) => {+ cohort: Partial<CohortType>+ }+ exportCohortPersons: (+ id: CohortType['id'],+ columns?: string[]+ ) => {+ columns: string[] | undefined+ id: number | 'new'+ }+ loadCohorts: () => any+ loadCohortsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCohortsSuccess: (+ cohorts: {+ count: number+ results: CohortType[]+ },+ payload?: any+ ) => {+ cohorts: {+ count: number+ results: CohortType[]+ }+ payload?: any+ }+ setCohortFilters: (+ filters: Partial<CohortFilters>,+ replace?: boolean+ ) => {+ filters: Partial<CohortFilters>+ replace: boolean | undefined+ }+ setCohortSorting: (sorting: Sorting | null) => {+ sorting: Sorting | null+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cohortsSceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ count: (cohorts: CountedPaginatedResponse<CohortType>) => number+ paramsFromFilters: (cohortFilters: CohortFilters) => {+ created_by_id?: number | undefined+ limit: number+ offset: number+ page?: number | undefined+ search?: string | undefined+ type?: 'dynamic' | 'static' | undefined+ }+ pagination: (cohortFilters: CohortFilters, count: number) => PaginationManual+ shouldShowEmptyState: (+ cohorts: CountedPaginatedResponse<CohortType>,+ cohortFilters: CohortFilters,+ cohortsLoadError: string | null+ ) => boolean+ }+}++export type cohortsSceneLogicType = MakeLogicType<+ cohortsSceneLogicValues,+ cohortsSceneLogicActions,+ Record<string, any>,+ cohortsSceneLogicMeta+>+export const cohortsSceneLogic = kea<cohortsSceneLogicType>([path(['scenes', 'cohorts', 'cohortsSceneLogic']),connect(() => ({@@ -141,7 +239,7 @@ export const cohortsSceneLogic = kea<cohortsSceneLogicType>([activity_scope: ActivityScope.COHORT,}),],- count: [(selectors) => [selectors.cohorts], (cohorts) => cohorts.count],+ count: [(selectors) => [selectors.cohorts], (cohorts: CountedPaginatedResponse<CohortType>) => cohorts.count],paramsFromFilters: [(s) => [s.cohortFilters],(filters: CohortFilters) => ({@@ -152,7 +250,7 @@ export const cohortsSceneLogic = kea<cohortsSceneLogicType>([],pagination: [(s) => [s.cohortFilters, s.count],- (filters, count): PaginationManual => {+ (filters: CohortFilters, count: number): PaginationManual => {return {controlled: true,pageSize: COHORTS_PER_PAGE,diff --git a/frontend/src/scenes/data-management/DataManagementScene.tsx b/frontend/src/scenes/data-management/DataManagementScene.tsxindex 57e647fd0327..07587ef83687 100644--- a/frontend/src/scenes/data-management/DataManagementScene.tsx+++ b/frontend/src/scenes/data-management/DataManagementScene.tsx@@ -1,4 +1,4 @@-import { actions, connect, kea, path, reducers, selectors, useValues } from 'kea'+import { MakeLogicType, actions, connect, kea, path, reducers, selectors, useValues } from 'kea'import { actionToUrl, combineUrl, router, urlToAction } from 'kea-router'import React from 'react'@@ -27,7 +27,7 @@ import { ActionsTable } from 'products/actions/frontend/components/ActionsTable'import { NewActionButton } from 'products/actions/frontend/components/NewActionButton'import { RevenueAnalyticsSettings } from 'products/revenue_analytics/frontend/settings/RevenueAnalyticsSettings'-import type { dataManagementSceneLogicType } from './DataManagementSceneType'+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'import { EventDefinitionsTable } from './events/EventDefinitionsTable'import { IngestionWarningsV2View } from './ingestion-warnings-v2/IngestionWarningsV2View'import { IngestionWarningsView } from './ingestion-warnings/IngestionWarningsView'@@ -201,6 +201,38 @@ const tabs: Record<DataManagementTab, TabConfig> = {},}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataManagementSceneLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ breadcrumbs: Breadcrumb[]+ enabledTabs: DataManagementTab[]+ sidePanelContext: SidePanelSceneContext | null+ tab: DataManagementTab+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataManagementSceneLogicActions {+ setTab: (tab: DataManagementTab) => {+ tab: DataManagementTab+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataManagementSceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ breadcrumbs: (tab: DataManagementTab) => Breadcrumb[]+ enabledTabs: (featureFlags: FeatureFlagsSet) => DataManagementTab[]+ sidePanelContext: (tab: DataManagementTab) => SidePanelSceneContext | null+ }+}++export type dataManagementSceneLogicType = MakeLogicType<+ dataManagementSceneLogicValues,+ dataManagementSceneLogicActions,+ Record<string, any>,+ dataManagementSceneLogicMeta+>+const dataManagementSceneLogic = kea<dataManagementSceneLogicType>([path(['scenes', 'events', 'dataManagementSceneLogic']),connect(() => ({@@ -220,7 +252,7 @@ const dataManagementSceneLogic = kea<dataManagementSceneLogicType>([selectors({breadcrumbs: [(s) => [s.tab],- (tab): Breadcrumb[] => {+ (tab: DataManagementTab): Breadcrumb[] => {if (tab === DataManagementTab.EventDefinitions) {return [{@@ -297,7 +329,7 @@ const dataManagementSceneLogic = kea<dataManagementSceneLogicType>([],enabledTabs: [(s) => [s.featureFlags],- (featureFlags): DataManagementTab[] => {+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): DataManagementTab[] => {const allTabs = Object.entries(tabs)return allTabsdiff --git a/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.ts b/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.tsindex d347c2ddbf61..3db79bd3b7c5 100644--- a/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.ts+++ b/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.ts@@ -1,11 +1,11 @@-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 api from 'lib/api'import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'import { teamLogic } from 'scenes/teamLogic'-import type { materializedColumnsLogicType } from './materializedColumnsLogicType'+import type { TeamPublicType, TeamType } from '../../../types'export enum MaterializedColumnSlotState {PENDING = 'PENDING',@@ -51,6 +51,108 @@ export interface AutoMaterializedColumn {is_nullable: boolean}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface materializedColumnsLogicValues {+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ autoMaterializedColumns: AutoMaterializedColumn[]+ autoMaterializedColumnsLoading: boolean+ availableProperties: PropertyDefinition[]+ availablePropertiesLoading: boolean+ canAssignMoreSlots: boolean+ showCreateModal: boolean+ slotUsage: SlotUsageSummary | null+ slotUsageLoading: boolean+ slots: MaterializedColumnSlot[]+ slotsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface materializedColumnsLogicActions {+ deleteSlot: (slotId: string) => {+ slotId: string+ }+ loadAutoMaterializedColumns: () => any+ loadAutoMaterializedColumnsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAutoMaterializedColumnsSuccess: (+ autoMaterializedColumns: AutoMaterializedColumn[],+ payload?: any+ ) => {+ autoMaterializedColumns: AutoMaterializedColumn[]+ payload?: any+ }+ loadAvailableProperties: () => any+ loadAvailablePropertiesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAvailablePropertiesSuccess: (+ availableProperties: PropertyDefinition[],+ payload?: any+ ) => {+ availableProperties: PropertyDefinition[]+ payload?: any+ }+ loadSlotUsage: () => any+ loadSlotUsageFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSlotUsageSuccess: (+ slotUsage: SlotUsageSummary | null,+ payload?: any+ ) => {+ slotUsage: SlotUsageSummary | null+ payload?: any+ }+ loadSlots: () => any+ loadSlotsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSlotsSuccess: (+ slots: MaterializedColumnSlot[],+ payload?: any+ ) => {+ slots: MaterializedColumnSlot[]+ payload?: any+ }+ retrySlot: (slotId: string) => {+ slotId: string+ }+ setShowCreateModal: (show: boolean) => {+ show: boolean+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface materializedColumnsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ canAssignMoreSlots: (slotUsage: SlotUsageSummary | null) => boolean+ }+}++export type materializedColumnsLogicType = MakeLogicType<+ materializedColumnsLogicValues,+ materializedColumnsLogicActions,+ Record<string, any>,+ materializedColumnsLogicMeta+>+export const materializedColumnsLogic = kea<materializedColumnsLogicType>([path(['scenes', 'data-management', 'MaterializedColumns', 'materializedColumnsLogic']),connect(() => ({@@ -127,7 +229,7 @@ export const materializedColumnsLogic = kea<materializedColumnsLogicType>([selectors({canAssignMoreSlots: [(s) => [s.slotUsage],- (slotUsage): boolean => {+ (slotUsage: SlotUsageSummary | null): boolean => {if (!slotUsage) {return false}diff --git a/frontend/src/scenes/data-management/comments/commentsLogic.ts b/frontend/src/scenes/data-management/comments/commentsLogic.tsindex 5ba011d46f9b..cdfd78ecdf41 100644--- a/frontend/src/scenes/data-management/comments/commentsLogic.ts+++ b/frontend/src/scenes/data-management/comments/commentsLogic.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 posthog from 'posthog-js'@@ -13,7 +13,8 @@ import { userLogic } from 'scenes/userLogic'import { ActivityScope, CommentType, InsightShortId } from '~/types'-import type { commentsLogicType } from './commentsLogicType'+import type { TeamPublicType, TeamType } from '../../../types'+import type { UserType } from '../../../types'export const SCOPE_OPTIONS: LemonSelectOption<ActivityScope | null>[] = Object.values(ActivityScope).map((scope) => ({value: scope,@@ -75,6 +76,145 @@ export const openURLFor = (c: CommentType): string | null => {export type CommentKindFilter = 'any' | 'comment' | 'task'export type CommentCompletedFilter = 'any' | 'open' | 'completed'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface commentsLogicValues {+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ user: UserType | null // userLogic+ comments: CommentType[]+ commentsLoading: boolean+ completedFilter: CommentCompletedFilter+ filterCreatedBy: string | null+ hasAnySearch: boolean+ kind: CommentKindFilter+ scope: ActivityScope | null+ searchText: string+ shouldShowEmptyState: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface commentsLogicActions {+ completeComment: (comment: CommentType) => {+ comment: CommentType+ }+ completeCommentFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ completeCommentSuccess: (+ comments: CommentType[],+ payload?: {+ comment: CommentType+ }+ ) => {+ comments: CommentType[]+ payload?: {+ comment: CommentType+ }+ }+ deleteComment: (id: string) => {+ id: string+ }+ deleteCommentFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteCommentSuccess: (+ comments: CommentType[],+ payload?: {+ id: string+ }+ ) => {+ comments: CommentType[]+ payload?: {+ id: string+ }+ }+ loadComments: () => {+ value: true+ }+ loadCommentsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCommentsSuccess: (+ comments: CommentType[],+ payload?: {+ value: true+ }+ ) => {+ comments: CommentType[]+ payload?: {+ value: true+ }+ }+ reopenComment: (comment: CommentType) => {+ comment: CommentType+ }+ reopenCommentFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ reopenCommentSuccess: (+ comments: CommentType[],+ payload?: {+ comment: CommentType+ }+ ) => {+ comments: CommentType[]+ payload?: {+ comment: CommentType+ }+ }+ setCompletedFilter: (completed: CommentCompletedFilter) => {+ completed: CommentCompletedFilter+ }+ setFilterCreatedBy: (createdBy: string | null) => {+ createdBy: string | null+ }+ setKind: (kind: CommentKindFilter) => {+ kind: CommentKindFilter+ }+ setScope: (scope: ActivityScope | null) => {+ scope: ActivityScope | null+ }+ setSearchText: (searchText: string) => {+ searchText: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface commentsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ hasAnySearch: (+ searchText: string,+ scope: ActivityScope | null,+ filterCreatedBy: string | null,+ kind: CommentKindFilter,+ completedFilter: CommentCompletedFilter+ ) => boolean+ shouldShowEmptyState: (comments: CommentType[], commentsLoading: boolean, hasAnySearch: boolean) => boolean+ }+}++export type commentsLogicType = MakeLogicType<+ commentsLogicValues,+ commentsLogicActions,+ Record<string, any>,+ commentsLogicMeta+>+export const commentsLogic = kea<commentsLogicType>([path(['scenes', 'data-management', 'comments', 'commentsLogic']),connect(() => ({@@ -156,13 +296,19 @@ export const commentsLogic = kea<commentsLogicType>([selectors(() => ({hasAnySearch: [(s) => [s.searchText, s.scope, s.filterCreatedBy, s.kind, s.completedFilter],- (searchText, scope, filterCreatedBy, kind, completedFilter) => {+ (+ searchText: string,+ scope: ActivityScope | null,+ filterCreatedBy: string | null,+ kind: CommentKindFilter,+ completedFilter: CommentCompletedFilter+ ) => {return !!searchText || !!scope || !!filterCreatedBy || kind !== 'any' || completedFilter !== 'any'},],shouldShowEmptyState: [(s) => [s.comments, s.commentsLoading, s.hasAnySearch],- (comments, commentsLoading, hasAnySearch): boolean => {+ (comments: CommentType[], commentsLoading: boolean, hasAnySearch: boolean): boolean => {return comments.length === 0 && !commentsLoading && !hasAnySearch},],diff --git a/frontend/src/scenes/data-management/database/databaseTableListLogic.ts b/frontend/src/scenes/data-management/database/databaseTableListLogic.tsindex 027e10c2198e..a74b5d643a87 100644--- a/frontend/src/scenes/data-management/database/databaseTableListLogic.ts+++ b/frontend/src/scenes/data-management/database/databaseTableListLogic.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 { objectsEqual } from 'lib/utils/objects'@@ -16,8 +16,6 @@ import {} from '~/queries/schema/schema-general'import { setLatestVersionsOnQuery } from '~/queries/utils'-import type { databaseTableListLogicType } from './databaseTableListLogicType'-const toMapByName = <T extends { name: string }>(items: T[]): Record<string, T> =>items.reduce((acc, cur) => {@@ -47,6 +45,116 @@ let inFlightDatabaseLoadPromise: Promise<Required<DatabaseSchemaQueryResponse> |let latestDatabaseLoadEpoch = 0let inFlightDatabaseLoadEpoch = 0+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface databaseTableListLogicValues {+ allPosthogTables: DatabaseSchemaTable[]+ allTables: DatabaseSchemaTable[]+ allTablesMap: Record<string, DatabaseSchemaTable>+ connectionId: string | null+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]+ dataWarehouseTablesMap: Record<string, DatabaseSchemaDataWarehouseTable | DatabaseSchemaViewTable>+ dataWarehouseTablesMapById: Record<string, DatabaseSchemaDataWarehouseTable | DatabaseSchemaViewTable>+ database: Required<DatabaseSchemaQueryResponse> | null+ databaseLoading: boolean+ endpointTables: DatabaseSchemaEndpointTable[]+ externalDataSourceTables: DatabaseSchemaDataWarehouseTable[]+ filteredTables: DatabaseSchemaTable[]+ latestEndpointTables: DatabaseSchemaEndpointTable[]+ managedViews: DatabaseSchemaManagedViewTable[]+ posthogTables: DatabaseSchemaTable[]+ posthogTablesMap: Record<string, DatabaseSchemaTable>+ searchTerm: string+ systemTables: DatabaseSchemaTable[]+ systemTablesMap: Record<string, DatabaseSchemaTable>+ views: DatabaseSchemaViewTable[]+ viewsMap: Record<string, DatabaseSchemaEndpointTable | DatabaseSchemaManagedViewTable | DatabaseSchemaViewTable>+ viewsMapById: Record<string, DatabaseSchemaEndpointTable | DatabaseSchemaManagedViewTable | DatabaseSchemaViewTable>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface databaseTableListLogicActions {+ loadDatabase: ({ force }?: { force?: boolean }) => {+ force?: boolean+ }+ loadDatabaseFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadDatabaseSuccess: (+ database: Required<DatabaseSchemaQueryResponse> | null,+ payload?: {+ force?: boolean+ }+ ) => {+ database: Required<DatabaseSchemaQueryResponse> | null+ payload?: {+ force?: boolean+ }+ }+ refreshDatabaseSchema: () => {+ value: true+ }+ setConnection: (connectionId: string | null) => {+ connectionId: string | null+ }+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface databaseTableListLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ allPosthogTables: (allTables: DatabaseSchemaTable[]) => DatabaseSchemaTable[]+ filteredTables: (allTables: DatabaseSchemaTable[], searchTerm: string) => DatabaseSchemaTable[]+ allTables: (+ database: Required<DatabaseSchemaQueryResponse> | null,+ databaseLoading: boolean+ ) => DatabaseSchemaTable[]+ allTablesMap: (allTables: DatabaseSchemaTable[]) => Record<string, DatabaseSchemaTable>+ posthogTables: (allPosthogTables: DatabaseSchemaTable[], connectionId: string | null) => DatabaseSchemaTable[]+ posthogTablesMap: (posthogTables: DatabaseSchemaTable[]) => Record<string, DatabaseSchemaTable>+ systemTables: (allTables: DatabaseSchemaTable[], connectionId: string | null) => DatabaseSchemaTable[]+ systemTablesMap: (systemTables: DatabaseSchemaTable[]) => Record<string, DatabaseSchemaTable>+ dataWarehouseTables: (allTables: DatabaseSchemaTable[]) => DatabaseSchemaDataWarehouseTable[]+ externalDataSourceTables: (+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]+ ) => DatabaseSchemaDataWarehouseTable[]+ dataWarehouseTablesMap: (+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],+ views: DatabaseSchemaViewTable[]+ ) => Record<string, DatabaseSchemaDataWarehouseTable | DatabaseSchemaViewTable>+ dataWarehouseTablesMapById: (+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],+ views: DatabaseSchemaViewTable[]+ ) => Record<string, DatabaseSchemaDataWarehouseTable | DatabaseSchemaViewTable>+ views: (allTables: DatabaseSchemaTable[]) => DatabaseSchemaViewTable[]+ managedViews: (allTables: DatabaseSchemaTable[]) => DatabaseSchemaManagedViewTable[]+ endpointTables: (allTables: DatabaseSchemaTable[]) => DatabaseSchemaEndpointTable[]+ latestEndpointTables: (endpointTables: DatabaseSchemaEndpointTable[]) => DatabaseSchemaEndpointTable[]+ viewsMap: (+ views: DatabaseSchemaViewTable[],+ managedViews: DatabaseSchemaManagedViewTable[],+ endpointTables: DatabaseSchemaEndpointTable[]+ ) => Record<string, DatabaseSchemaEndpointTable | DatabaseSchemaManagedViewTable | DatabaseSchemaViewTable>+ viewsMapById: (+ views: DatabaseSchemaViewTable[],+ managedViews: DatabaseSchemaManagedViewTable[],+ endpointTables: DatabaseSchemaEndpointTable[]+ ) => Record<string, DatabaseSchemaEndpointTable | DatabaseSchemaManagedViewTable | DatabaseSchemaViewTable>+ }+}++export type databaseTableListLogicType = MakeLogicType<+ databaseTableListLogicValues,+ databaseTableListLogicActions,+ Record<string, any>,+ databaseTableListLogicMeta+>+export const databaseTableListLogic = kea<databaseTableListLogicType>([path(['scenes', 'data-management', 'database', 'databaseTableListLogic']),actions({@@ -140,7 +248,7 @@ export const databaseTableListLogic = kea<databaseTableListLogicType>([],filteredTables: [(s) => [s.allTables, s.searchTerm],- (allTables, searchTerm): DatabaseSchemaTable[] => {+ (allTables: DatabaseSchemaTable[], searchTerm: string): DatabaseSchemaTable[] => {return allTables.filter(({ name }) => name.toLowerCase().includes(searchTerm.toLowerCase())).sort((a, b) => a.name.localeCompare(b.name))@@ -149,7 +257,10 @@ export const databaseTableListLogic = kea<databaseTableListLogicType>([],allTables: [(s) => [s.database, s.databaseLoading],- (database, databaseLoading): DatabaseSchemaTable[] => {+ (+ database: Required<DatabaseSchemaQueryResponse> | null,+ databaseLoading: boolean+ ): DatabaseSchemaTable[] => {if (databaseLoading || !database || !database.tables) {return []}diff --git a/frontend/src/scenes/data-management/definition/definitionEditLogic.ts b/frontend/src/scenes/data-management/definition/definitionEditLogic.tsindex 6c04556ea412..526cc472c33f 100644--- a/frontend/src/scenes/data-management/definition/definitionEditLogic.ts+++ b/frontend/src/scenes/data-management/definition/definitionEditLogic.ts@@ -1,5 +1,6 @@-import { connect, kea, key, path, props } from 'kea'+import { MakeLogicType, connect, kea, key, path, props } from 'kea'import { forms } from 'kea-forms'+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'import { loaders } from 'kea-loaders'import { beforeUnload, router } from 'kea-router'import { subscriptions } from 'kea-subscriptions'@@ -19,7 +20,205 @@ import { updatePropertyDefinitions } from '~/models/propertyDefinitionsModel'import { tagsModel } from '~/models/tagsModel'import { Definition, EventDefinition, PropertyDefinition } from '~/types'-import type { definitionEditLogicType } from './definitionEditLogicType'+import type {+ PropertyDefinitionType,+ PropertyType,+ SchemaEnforcementMode,+ UserBasicType,+ WarehousePropertyOrigin,+} from '../../../types'+import type { SetDefinitionProps } from './definitionLogic'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface definitionEditLogicValues {+ definition: Definition // definitionLogic+ isEvent: boolean // definitionLogic+ singular: string // definitionLogic+ editDefinition: Definition+ editDefinitionAllErrors: Record<string, any>+ editDefinitionChanged: boolean+ editDefinitionErrors: DeepPartialMap<Definition, ValidationErrorType>+ editDefinitionHasErrors: boolean+ editDefinitionLoading: boolean+ editDefinitionManualErrors: Record<string, any>+ editDefinitionTouched: boolean+ editDefinitionTouches: Record<string, boolean>+ editDefinitionValidationErrors: DeepPartialMap<Definition, ValidationErrorType>+ isEditDefinitionSubmitting: boolean+ isEditDefinitionValid: boolean+ showEditDefinitionErrors: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface definitionEditLogicActions {+ setDefinition: (+ definition: Partial<Definition>,+ options?: SetDefinitionProps | undefined+ ) => {+ definition: Partial<Definition>+ options: SetDefinitionProps+ } // definitionLogic+ setLocalEventDefinition: (definition: EventDefinition) => {+ definition: EventDefinition+ } // eventDefinitionsTableLogic+ refreshLoadedPrimaryProperties: () => {+ value: true+ } // primaryEventPropertiesModel+ setLocalPropertyDefinition: (definition: PropertyDefinition) => {+ definition: PropertyDefinition+ } // propertyDefinitionsTableLogic+ loadTags: () => any // tagsModel+ resetEditDefinition: (values?: Definition) => {+ values?: Definition+ }+ saveDefinition: (_: any) => any+ saveDefinitionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ saveDefinitionSuccess: (+ editDefinition:+ | {+ created_at?: string | undefined+ default_columns?: string[] | undefined+ description?: string | undefined+ enforcement_mode?: SchemaEnforcementMode | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_data_warehouse?: boolean | undefined+ last_seen_at?: string | undefined+ last_updated_at?: string | undefined+ media_preview_urls?: string[] | undefined+ name: string+ owner?: UserBasicType | null | undefined+ primary_property?: string | null | undefined+ tags?: string[] | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ }+ | {+ created_at?: string | undefined+ description?: string | undefined+ example?: string | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_numerical?: boolean | undefined+ is_seen_on_filtered_events?: boolean | undefined+ last_seen_at?: string | undefined+ name: string+ property_type?: PropertyType | undefined+ tags?: string[] | undefined+ type?: PropertyDefinitionType | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ virtual?: boolean | undefined+ warehouse_origin?: WarehousePropertyOrigin | null | undefined+ },+ payload?: any+ ) => {+ editDefinition:+ | {+ created_at?: string | undefined+ default_columns?: string[] | undefined+ description?: string | undefined+ enforcement_mode?: SchemaEnforcementMode | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_data_warehouse?: boolean | undefined+ last_seen_at?: string | undefined+ last_updated_at?: string | undefined+ media_preview_urls?: string[] | undefined+ name: string+ owner?: UserBasicType | null | undefined+ primary_property?: string | null | undefined+ tags?: string[] | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ }+ | {+ created_at?: string | undefined+ description?: string | undefined+ example?: string | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_numerical?: boolean | undefined+ is_seen_on_filtered_events?: boolean | undefined+ last_seen_at?: string | undefined+ name: string+ property_type?: PropertyType | undefined+ tags?: string[] | undefined+ type?: PropertyDefinitionType | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ virtual?: boolean | undefined+ warehouse_origin?: WarehousePropertyOrigin | null | undefined+ }+ payload?: any+ }+ setEditDefinitionManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setEditDefinitionValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setEditDefinitionValues: (values: DeepPartial<Definition>) => {+ values: DeepPartial<Definition>+ }+ submitEditDefinition: () => {+ value: boolean+ }+ submitEditDefinitionFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitEditDefinitionRequest: (editDefinition: Definition) => {+ editDefinition: Definition+ }+ submitEditDefinitionSuccess: (editDefinition: Definition) => {+ editDefinition: Definition+ }+ touchEditDefinitionField: (key: string) => {+ key: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface definitionEditLogicMeta {+ key: string+}++export type definitionEditLogicType = MakeLogicType<+ definitionEditLogicValues,+ definitionEditLogicActions,+ DefinitionLogicProps,+ definitionEditLogicMeta+>export const definitionEditLogic = kea<definitionEditLogicType>([path(['scenes', 'data-management', 'definition', 'definitionDetailLogic']),diff --git a/frontend/src/scenes/data-management/definition/definitionLogic.ts b/frontend/src/scenes/data-management/definition/definitionLogic.tsindex 8adde4b47084..82971854aacc 100644--- a/frontend/src/scenes/data-management/definition/definitionLogic.ts+++ b/frontend/src/scenes/data-management/definition/definitionLogic.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 { router } from 'kea-router'@@ -12,10 +12,16 @@ import { updatePropertyDefinitions } from '~/models/propertyDefinitionsModel'import { getFilterLabel } from '~/taxonomy/helpers'import { Breadcrumb, Definition, EventDefinitionMetrics, ObjectMediaPreview, PropertyDefinition } from '~/types'+import type {+ PropertyDefinitionType,+ PropertyType,+ SchemaEnforcementMode,+ UserBasicType,+ WarehousePropertyOrigin,+} from '../../../types'import { DataManagementTab } from '../DataManagementScene'import { eventDefinitionsTableLogic } from '../events/eventDefinitionsTableLogic'import { propertyDefinitionsTableLogic } from '../properties/propertyDefinitionsTableLogic'-import type { definitionLogicType } from './definitionLogicType'export const createNewDefinition = (isEvent: boolean): Definition => ({id: 'new',@@ -32,6 +38,287 @@ export interface DefinitionLogicProps {id?: Definition['id']}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface definitionLogicValues {+ breadcrumbs: Breadcrumb[]+ definition: Definition+ definitionLoading: boolean+ definitionMissing: boolean+ isEvent: boolean+ isProperty: boolean+ metrics: EventDefinitionMetrics | null+ metricsLoading: boolean+ previews: ObjectMediaPreview[]+ previewsLoading: boolean+ singular: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface definitionLogicActions {+ createMediaPreview: (+ uploadedMediaId: string,+ metadata?: Record<string, any>+ ) => {+ metadata: Record<string, any> | undefined+ uploadedMediaId: string+ }+ createMediaPreviewFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ createMediaPreviewSuccess: (+ previews: ObjectMediaPreview[],+ payload?: {+ metadata: Record<string, any> | undefined+ uploadedMediaId: string+ }+ ) => {+ previews: ObjectMediaPreview[]+ payload?: {+ metadata: Record<string, any> | undefined+ uploadedMediaId: string+ }+ }+ deleteDefinition: () => any+ deleteDefinitionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteDefinitionSuccess: (+ definition: Definition,+ payload?: any+ ) => {+ definition: Definition+ payload?: any+ }+ deleteMediaPreview: (previewId: string) => {+ previewId: string+ }+ deleteMediaPreviewFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteMediaPreviewSuccess: (+ previews: ObjectMediaPreview[],+ payload?: {+ previewId: string+ }+ ) => {+ previews: ObjectMediaPreview[]+ payload?: {+ previewId: string+ }+ }+ loadDefinition: (id: Definition['id']) => {+ id: string+ }+ loadDefinitionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadDefinitionSuccess: (+ definition:+ | {+ created_at?: string | undefined+ default_columns?: string[] | undefined+ description?: string | undefined+ enforcement_mode?: SchemaEnforcementMode | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_data_warehouse?: boolean | undefined+ last_seen_at?: string | undefined+ last_updated_at?: string | undefined+ media_preview_urls?: string[] | undefined+ name: string+ owner?: UserBasicType | null | undefined+ primary_property?: string | null | undefined+ tags?: string[] | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ }+ | {+ created_at?: string | undefined+ description?: string | undefined+ example?: string | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_numerical?: boolean | undefined+ is_seen_on_filtered_events?: boolean | undefined+ last_seen_at?: string | undefined+ name: string+ property_type?: PropertyType | undefined+ tags?: string[] | undefined+ type?: PropertyDefinitionType | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ virtual?: boolean | undefined+ warehouse_origin?: WarehousePropertyOrigin | null | undefined+ },+ payload?: {+ id: string+ }+ ) => {+ definition:+ | {+ created_at?: string | undefined+ default_columns?: string[] | undefined+ description?: string | undefined+ enforcement_mode?: SchemaEnforcementMode | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_data_warehouse?: boolean | undefined+ last_seen_at?: string | undefined+ last_updated_at?: string | undefined+ media_preview_urls?: string[] | undefined+ name: string+ owner?: UserBasicType | null | undefined+ primary_property?: string | null | undefined+ tags?: string[] | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ }+ | {+ created_at?: string | undefined+ description?: string | undefined+ example?: string | undefined+ hidden?: boolean | undefined+ id: string+ is_action?: boolean | undefined+ is_numerical?: boolean | undefined+ is_seen_on_filtered_events?: boolean | undefined+ last_seen_at?: string | undefined+ name: string+ property_type?: PropertyType | undefined+ tags?: string[] | undefined+ type?: PropertyDefinitionType | undefined+ updated_at?: string | undefined+ updated_by?: UserBasicType | null | undefined+ verified?: boolean | undefined+ verified_at?: string | undefined+ verified_by?: string | undefined+ virtual?: boolean | undefined+ warehouse_origin?: WarehousePropertyOrigin | null | undefined+ }+ payload?: {+ id: string+ }+ }+ loadMetrics: (id: Definition['id']) => {+ id: string+ }+ loadMetricsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadMetricsSuccess: (+ metrics: EventDefinitionMetrics | null,+ payload?: {+ id: string+ }+ ) => {+ metrics: EventDefinitionMetrics | null+ payload?: {+ id: string+ }+ }+ loadPreviews: () => {+ value: true+ }+ loadPreviewsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPreviewsSuccess: (+ previews: ObjectMediaPreview[],+ payload?: {+ value: true+ }+ ) => {+ previews: ObjectMediaPreview[]+ payload?: {+ value: true+ }+ }+ setDefinition: (+ definition: Partial<Definition>,+ options?: SetDefinitionProps+ ) => {+ definition: Partial<Definition>+ options: SetDefinitionProps+ }+ setDefinitionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setDefinitionMissing: () => {+ value: true+ }+ setDefinitionSuccess: (+ definition: Definition,+ payload?: {+ definition: Partial<Definition>+ options: SetDefinitionProps+ }+ ) => {+ definition: Definition+ payload?: {+ definition: Partial<Definition>+ options: SetDefinitionProps+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface definitionLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ isEvent: (location: { hash: string; pathname: string; search: string }) => boolean+ isProperty: (isEvent: boolean) => boolean+ singular: (isEvent: boolean) => string+ breadcrumbs: (definition: Definition, isEvent: boolean) => Breadcrumb[]+ }+}++export type definitionLogicType = MakeLogicType<+ definitionLogicValues,+ definitionLogicActions,+ DefinitionLogicProps,+ definitionLogicMeta+>+export const definitionLogic = kea<definitionLogicType>([path(['scenes', 'data-management', 'definition', 'definitionViewLogic']),props({} as DefinitionLogicProps),@@ -147,11 +434,11 @@ export const definitionLogic = kea<definitionLogicType>([})),selectors({isEvent: [() => [router.selectors.location], ({ pathname }) => pathname.includes(urls.eventDefinitions())],- isProperty: [(s) => [s.isEvent], (isEvent) => !isEvent],- singular: [(s) => [s.isEvent], (isEvent): string => (isEvent ? 'event' : 'property')],+ isProperty: [(s) => [s.isEvent], (isEvent: boolean) => !isEvent],+ singular: [(s) => [s.isEvent], (isEvent: boolean): string => (isEvent ? 'event' : 'property')],breadcrumbs: [(s) => [s.definition, s.isEvent],- (definition, isEvent): Breadcrumb[] => {+ (definition: Definition, isEvent: boolean): Breadcrumb[] => {return [{key: Scene.DataManagement,diff --git a/frontend/src/scenes/data-management/definition/propertyAccessControlLogic.ts b/frontend/src/scenes/data-management/definition/propertyAccessControlLogic.tsindex 2cce9b601855..335a2eb9ef67 100644--- a/frontend/src/scenes/data-management/definition/propertyAccessControlLogic.ts+++ b/frontend/src/scenes/data-management/definition/propertyAccessControlLogic.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 { captureAccessControlEvent } from 'lib/utils/accessControlUtils'@@ -15,8 +15,6 @@ import type {PropertyAccessControlStateApi,} from 'products/access_control/frontend/generated/api.schemas'-import type { propertyAccessControlLogicType } from './propertyAccessControlLogicType'-export interface PropertyAccessControlLogicProps {propertyDefinitionId: stringteamId: number@@ -30,6 +28,106 @@ export interface LocalAccessControlState {roleOverrides: Record<string, AccessLevelEnumApi | null>}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface propertyAccessControlLogicValues {+ activeTab: string+ allMembers: {+ email: string+ first_name: string+ id: string+ last_name: string+ }[]+ allRoles: {+ id: string+ members: any[]+ name: string+ }[]+ defaultLevel: AccessLevelEnumApi+ hasChanges: boolean+ localState: LocalAccessControlState | null+ memberOverrides: Record<string, AccessLevelEnumApi | null>+ remoteState: PropertyAccessControlStateApi | null+ remoteStateLoading: boolean+ roleOverrides: Record<string, AccessLevelEnumApi | null>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface propertyAccessControlLogicActions {+ loadRemoteState: () => any+ loadRemoteStateFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadRemoteStateSuccess: (+ remoteState: PropertyAccessControlStateApi,+ payload?: any+ ) => {+ remoteState: PropertyAccessControlStateApi+ payload?: any+ }+ resetLocalState: () => {+ value: true+ }+ saveAccessControls: () => {+ value: true+ }+ setActiveTab: (tab: string) => {+ tab: string+ }+ setLocalDefaultLevel: (level: AccessLevelEnumApi) => {+ level: AccessLevelEnumApi+ }+ setLocalMemberOverride: (+ memberId: string,+ level: AccessLevelEnumApi | null+ ) => {+ level: AccessLevelEnumApi | null+ memberId: string+ }+ setLocalRoleOverride: (+ roleId: string,+ level: AccessLevelEnumApi | null+ ) => {+ level: AccessLevelEnumApi | null+ roleId: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface propertyAccessControlLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ defaultLevel: (localState: LocalAccessControlState | null) => AccessLevelEnumApi+ memberOverrides: (localState: LocalAccessControlState | null) => Record<string, AccessLevelEnumApi | null>+ roleOverrides: (localState: LocalAccessControlState | null) => Record<string, AccessLevelEnumApi | null>+ allMembers: (members: import('../../../types').OrganizationMemberType[] | null) => {+ email: string+ first_name: string+ id: string+ last_name: string+ }[]+ allRoles: (roles: import('../../../types').RoleType[]) => {+ id: string+ members: any[]+ name: string+ }[]+ hasChanges: (+ localState: LocalAccessControlState | null,+ remoteState: PropertyAccessControlStateApi | null+ ) => boolean+ }+}++export type propertyAccessControlLogicType = MakeLogicType<+ propertyAccessControlLogicValues,+ propertyAccessControlLogicActions,+ PropertyAccessControlLogicProps,+ propertyAccessControlLogicMeta+>+export const propertyAccessControlLogic = kea<propertyAccessControlLogicType>([path(['scenes', 'data-management', 'definition', 'propertyAccessControlLogic']),props({} as PropertyAccessControlLogicProps),@@ -99,19 +197,24 @@ export const propertyAccessControlLogic = kea<propertyAccessControlLogicType>([selectors({defaultLevel: [(s) => [s.localState],- (localState): AccessLevelEnumApi => localState?.defaultLevel ?? 'read_write',+ (localState: LocalAccessControlState | null): AccessLevelEnumApi =>+ localState?.defaultLevel ?? 'read_write',],memberOverrides: [(s) => [s.localState],- (localState): Record<string, AccessLevelEnumApi | null> => localState?.memberOverrides ?? {},+ (localState: LocalAccessControlState | null): Record<string, AccessLevelEnumApi | null> =>+ localState?.memberOverrides ?? {},],roleOverrides: [(s) => [s.localState],- (localState): Record<string, AccessLevelEnumApi | null> => localState?.roleOverrides ?? {},+ (localState: LocalAccessControlState | null): Record<string, AccessLevelEnumApi | null> =>+ localState?.roleOverrides ?? {},],allMembers: [() => [membersLogic.selectors.members],- (members): { id: string; first_name: string; last_name: string; email: string }[] =>+ (+ members: import('../../../types').OrganizationMemberType[] | null+ ): { id: string; first_name: string; last_name: string; email: string }[] =>(members ?? []).map((member: any) => ({id: member.id,first_name: member.user?.first_name ?? '',@@ -121,7 +224,7 @@ export const propertyAccessControlLogic = kea<propertyAccessControlLogicType>([],allRoles: [() => [rolesLogic.selectors.roles],- (roles): { id: string; name: string; members: any[] }[] =>+ (roles: import('../../../types').RoleType[]): { id: string; name: string; members: any[] }[] =>(roles ?? []).map((role: any) => ({id: role.id,name: role.name,@@ -135,7 +238,10 @@ export const propertyAccessControlLogic = kea<propertyAccessControlLogicType>([],hasChanges: [(s) => [s.localState, s.remoteState],- (localState, remoteState): boolean => {+ (+ localState: LocalAccessControlState | null,+ remoteState: PropertyAccessControlStateApi | null+ ): boolean => {if (!localState || !remoteState) {return false}diff --git a/frontend/src/scenes/data-management/events/eventDefinitionModalLogic.ts b/frontend/src/scenes/data-management/events/eventDefinitionModalLogic.tsindex bc5985e4794e..3daaeadf073a 100644--- a/frontend/src/scenes/data-management/events/eventDefinitionModalLogic.ts+++ b/frontend/src/scenes/data-management/events/eventDefinitionModalLogic.ts@@ -1,5 +1,6 @@-import { actions, kea, listeners, path, props, reducers } from 'kea'+import { MakeLogicType, actions, kea, listeners, path, props, reducers } from 'kea'import { forms } from 'kea-forms'+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'import { loaders } from 'kea-loaders'import { router } from 'kea-router'@@ -10,8 +11,6 @@ import { urls } from 'scenes/urls'import { EventDefinition } from '~/types'-import type { eventDefinitionModalLogicType } from './eventDefinitionModalLogicType'-export interface EventDefinitionModalLogicProps {onClose: () => void}@@ -23,6 +22,90 @@ export interface EventDefinitionFormType {tags?: string[]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionModalLogicValues {+ eventDefinitionForm: EventDefinitionFormType+ eventDefinitionFormAllErrors: Record<string, any>+ eventDefinitionFormChanged: boolean+ eventDefinitionFormErrors: DeepPartialMap<EventDefinitionFormType, ValidationErrorType>+ eventDefinitionFormHasErrors: boolean+ eventDefinitionFormManualErrors: Record<string, any>+ eventDefinitionFormTouched: boolean+ eventDefinitionFormTouches: Record<string, boolean>+ eventDefinitionFormValidationErrors: DeepPartialMap<EventDefinitionFormType, ValidationErrorType>+ existingEvent: EventDefinition | null+ existingEventLoading: boolean+ isEventDefinitionFormSubmitting: boolean+ isEventDefinitionFormValid: boolean+ showEventDefinitionFormErrors: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionModalLogicActions {+ checkEventNameExists: (name: string) => {+ name: string+ }+ checkEventNameExistsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ checkEventNameExistsSuccess: (+ existingEvent: EventDefinition | null,+ payload?: {+ name: string+ }+ ) => {+ existingEvent: EventDefinition | null+ payload?: {+ name: string+ }+ }+ resetEventDefinitionForm: (values?: EventDefinitionFormType) => {+ values?: EventDefinitionFormType+ }+ setEventDefinitionFormManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setEventDefinitionFormValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setEventDefinitionFormValues: (values: DeepPartial<EventDefinitionFormType>) => {+ values: DeepPartial<EventDefinitionFormType>+ }+ submitEventDefinitionForm: () => {+ value: boolean+ }+ submitEventDefinitionFormFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitEventDefinitionFormRequest: (eventDefinitionForm: EventDefinitionFormType) => {+ eventDefinitionForm: EventDefinitionFormType+ }+ submitEventDefinitionFormSuccess: (eventDefinitionForm: EventDefinitionFormType) => {+ eventDefinitionForm: EventDefinitionFormType+ }+ touchEventDefinitionFormField: (key: string) => {+ key: string+ }+}++export type eventDefinitionModalLogicType = MakeLogicType<+ eventDefinitionModalLogicValues,+ eventDefinitionModalLogicActions,+ EventDefinitionModalLogicProps+>+export const eventDefinitionModalLogic = kea<eventDefinitionModalLogicType>([path(['scenes', 'data-management', 'events', 'eventDefinitionModalLogic']),props({} as EventDefinitionModalLogicProps),diff --git a/frontend/src/scenes/data-management/events/eventDefinitionSchemaLogic.ts b/frontend/src/scenes/data-management/events/eventDefinitionSchemaLogic.tsindex 9c21999c665c..a82b207882ac 100644--- a/frontend/src/scenes/data-management/events/eventDefinitionSchemaLogic.ts+++ b/frontend/src/scenes/data-management/events/eventDefinitionSchemaLogic.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 { loaders } from 'kea-loaders'import api from 'lib/api'@@ -6,9 +6,10 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'import { EventDefinition, SchemaEnforcementMode } from '~/types'+import type { Definition } from '../../../types'import { definitionLogic } from '../definition/definitionLogic'+import type { SetDefinitionProps } from '../definition/definitionLogic'import { type SchemaPropertyGroup, schemaManagementLogic } from '../schema/schemaManagementLogic'-import type { eventDefinitionSchemaLogicType } from './eventDefinitionSchemaLogicType'export type { SchemaPropertyGroup }@@ -60,6 +61,112 @@ export interface EventDefinitionSchemaLogicProps {eventDefinitionId: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionSchemaLogicValues {+ definition: Definition // definitionLogic+ allPropertyGroups: SchemaPropertyGroup[]+ allPropertyGroupsLoading: boolean+ availablePropertyGroups: SchemaPropertyGroup[]+ eventSchemas: EventSchema[]+ eventSchemasLoading: boolean+ schemaEnforcementMode: SchemaEnforcementMode+ schemaEnforcementModeUpdating: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionSchemaLogicActions {+ setDefinition: (+ definition: Partial<Definition>,+ options?: SetDefinitionProps | undefined+ ) => {+ definition: Partial<Definition>+ options: SetDefinitionProps+ } // definitionLogic+ createPropertyGroupSuccess: (+ propertyGroups: any[],+ payload?: Partial<SchemaPropertyGroup> | undefined+ ) => {+ payload?: Partial<SchemaPropertyGroup>+ propertyGroups: any[]+ } // schemaManagementLogic+ updatePropertyGroupSuccess: (+ propertyGroups: any[],+ payload?:+ | {+ data: Partial<SchemaPropertyGroup>+ id: string+ }+ | undefined+ ) => {+ payload?: {+ data: Partial<SchemaPropertyGroup>+ id: string+ }+ propertyGroups: any[]+ } // schemaManagementLogic+ addPropertyGroup: (propertyGroupId: string) => {+ propertyGroupId: string+ }+ loadAllPropertyGroups: () => any+ loadAllPropertyGroupsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAllPropertyGroupsSuccess: (+ allPropertyGroups: SchemaPropertyGroup[],+ payload?: any+ ) => {+ allPropertyGroups: SchemaPropertyGroup[]+ payload?: any+ }+ loadEventSchemas: () => any+ loadEventSchemasFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadEventSchemasSuccess: (+ eventSchemas: EventSchema[],+ payload?: any+ ) => {+ eventSchemas: EventSchema[]+ payload?: any+ }+ removePropertyGroup: (eventSchemaId: string) => {+ eventSchemaId: string+ }+ setSchemaEnforcementModeUpdating: (updating: boolean) => {+ updating: boolean+ }+ updateSchemaEnforcementMode: (mode: SchemaEnforcementMode) => {+ mode: SchemaEnforcementMode+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionSchemaLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ schemaEnforcementMode: (definition: Definition) => SchemaEnforcementMode+ availablePropertyGroups: (+ allPropertyGroups: SchemaPropertyGroup[],+ eventSchemas: EventSchema[]+ ) => SchemaPropertyGroup[]+ }+}++export type eventDefinitionSchemaLogicType = MakeLogicType<+ eventDefinitionSchemaLogicValues,+ eventDefinitionSchemaLogicActions,+ EventDefinitionSchemaLogicProps,+ eventDefinitionSchemaLogicMeta+>+export const eventDefinitionSchemaLogic = kea<eventDefinitionSchemaLogicType>([path(['scenes', 'data-management', 'events', 'eventDefinitionSchemaLogic']),props({} as EventDefinitionSchemaLogicProps),@@ -113,7 +220,7 @@ export const eventDefinitionSchemaLogic = kea<eventDefinitionSchemaLogicType>([selectors({schemaEnforcementMode: [(s) => [s.definition],- (definition): SchemaEnforcementMode =>+ (definition: import('~/types').Definition): SchemaEnforcementMode =>(definition as EventDefinition).enforcement_mode ?? SchemaEnforcementMode.Allow,],availablePropertyGroups: [diff --git a/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.ts b/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.tsindex 42678bcdbf60..9b400a1eaa5a 100644--- a/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.ts+++ b/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.ts@@ -1,4 +1,4 @@-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 { actionToUrl, combineUrl, router, urlToAction } from 'kea-router'@@ -11,8 +11,6 @@ import { parseTagsFilter } from 'lib/utils/url'import { AnyPropertyFilter, EventDefinition, EventDefinitionType, PropertyDefinition } from '~/types'-import type { eventDefinitionsTableLogicType } from './eventDefinitionsTableLogicType'-export interface EventDefinitionsPaginatedResponse extends PaginatedResponse<EventDefinition> {current?: stringcount?: number@@ -91,6 +89,182 @@ export interface EventDefinitionsTableLogicProps {key: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionsTableLogicValues {+ eventDefinitionPropertiesLoading: string[]+ eventDefinitions: EventDefinitionsPaginatedResponse+ eventDefinitionsLoading: boolean+ eventPropertiesCacheMap: Record<string, PropertyDefinitionsPaginatedResponse>+ eventPropertiesCacheMapLoading: boolean+ filters: Filters+ paramsFromFilters: Record<string, any>+ showVerifiedFilter: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionsTableLogicActions {+ applyBulkTagUpdates: (+ updates: {+ id: number | string+ tags: string[]+ }[]+ ) => {+ updates: {+ id: number | string+ tags: string[]+ }[]+ }+ applyBulkTagUpdatesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ applyBulkTagUpdatesSuccess: (+ eventDefinitions: EventDefinitionsPaginatedResponse,+ payload?: {+ updates: {+ id: number | string+ tags: string[]+ }[]+ }+ ) => {+ eventDefinitions: EventDefinitionsPaginatedResponse+ payload?: {+ updates: {+ id: number | string+ tags: string[]+ }[]+ }+ }+ loadEventDefinitions: (url?: string | null) => {+ url: string | null+ }+ loadEventDefinitionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadEventDefinitionsSuccess: (+ eventDefinitions: EventDefinitionsPaginatedResponse,+ payload?: {+ url: string | null+ }+ ) => {+ eventDefinitions: EventDefinitionsPaginatedResponse+ payload?: {+ url: string | null+ }+ }+ loadEventExample: (definition: EventDefinition) => {+ definition: EventDefinition+ }+ loadPropertiesForEvent: (+ definition: EventDefinition,+ url?: string | null+ ) => {+ definition: EventDefinition+ url: string | null+ }+ loadPropertiesForEventFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPropertiesForEventSuccess: (+ eventPropertiesCacheMap: {+ [x: string]: any+ },+ payload?: {+ definition: EventDefinition+ url: string | null+ }+ ) => {+ eventPropertiesCacheMap: {+ [x: string]: any+ }+ payload?: {+ definition: EventDefinition+ url: string | null+ }+ }+ setEventDefinitionPropertiesLoading: (ids: string[]) => {+ ids: string[]+ }+ setFilters: (filters: Partial<Filters>) => {+ filters: Partial<Filters>+ }+ setLocalEventDefinition: (definition: EventDefinition) => {+ definition: EventDefinition+ }+ setLocalEventDefinitionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setLocalEventDefinitionSuccess: (+ eventDefinitions: EventDefinitionsPaginatedResponse,+ payload?: {+ definition: EventDefinition+ }+ ) => {+ eventDefinitions: EventDefinitionsPaginatedResponse+ payload?: {+ definition: EventDefinition+ }+ }+ setLocalPropertyDefinition: (+ event: EventDefinition,+ definition: PropertyDefinition+ ) => {+ definition: PropertyDefinition+ event: EventDefinition+ }+ setLocalPropertyDefinitionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setLocalPropertyDefinitionSuccess: (+ eventPropertiesCacheMap: Record<string, PropertyDefinitionsPaginatedResponse>,+ payload?: {+ definition: PropertyDefinition+ event: EventDefinition+ }+ ) => {+ eventPropertiesCacheMap: Record<string, PropertyDefinitionsPaginatedResponse>+ payload?: {+ definition: PropertyDefinition+ event: EventDefinition+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventDefinitionsTableLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ showVerifiedFilter: (eventDefinitions: EventDefinitionsPaginatedResponse, filters: Filters) => boolean+ paramsFromFilters: (filters: Filters) => Record<string, any>+ }+}++export type eventDefinitionsTableLogicType = MakeLogicType<+ eventDefinitionsTableLogicValues,+ eventDefinitionsTableLogicActions,+ EventDefinitionsTableLogicProps,+ eventDefinitionsTableLogicMeta+>+export const eventDefinitionsTableLogic = kea<eventDefinitionsTableLogicType>([path((key) => ['scenes', 'data-management', 'events', 'eventDefinitionsTableLogic', key]),props({} as EventDefinitionsTableLogicProps),diff --git a/frontend/src/scenes/data-management/events/eventExperimentsLogic.ts b/frontend/src/scenes/data-management/events/eventExperimentsLogic.tsindex db207f258a9b..c74a99338215 100644--- a/frontend/src/scenes/data-management/events/eventExperimentsLogic.ts+++ b/frontend/src/scenes/data-management/events/eventExperimentsLogic.ts@@ -1,4 +1,4 @@-import { actions, afterMount, connect, kea, key, listeners, path, props, reducers } from 'kea'+import { MakeLogicType, actions, afterMount, connect, kea, key, listeners, path, props, reducers } from 'kea'import { loaders } from 'kea-loaders'import { teamLogic } from 'scenes/teamLogic'@@ -9,8 +9,6 @@ import type {PaginatedExperimentBasicListApi,} from 'products/experiments/frontend/generated/api.schemas'-import type { eventExperimentsLogicType } from './eventExperimentsLogicType'-export interface EventExperimentsLogicProps {event: string}@@ -19,6 +17,48 @@ export const EXPERIMENTS_PER_PAGE = 10const EMPTY_RESULT: PaginatedExperimentBasicListApi = { count: 0, next: null, previous: null, results: [] }+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventExperimentsLogicValues {+ currentProjectId: number | string // teamLogic+ experiments: PaginatedExperimentBasicListApi+ experimentsLoading: boolean+ page: number+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventExperimentsLogicActions {+ loadExperiments: () => any+ loadExperimentsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadExperimentsSuccess: (+ experiments: PaginatedExperimentBasicListApi,+ payload?: any+ ) => {+ experiments: PaginatedExperimentBasicListApi+ payload?: any+ }+ setPage: (page: number) => {+ page: number+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventExperimentsLogicMeta {+ key: string+}++export type eventExperimentsLogicType = MakeLogicType<+ eventExperimentsLogicValues,+ eventExperimentsLogicActions,+ EventExperimentsLogicProps,+ eventExperimentsLogicMeta+>+export const eventExperimentsLogic = kea<eventExperimentsLogicType>([path(['scenes', 'data-management', 'events', 'eventExperimentsLogic']),props({} as EventExperimentsLogicProps),diff --git a/frontend/src/scenes/data-management/events/eventInsightsLogic.ts b/frontend/src/scenes/data-management/events/eventInsightsLogic.tsindex bc723f7808ff..e888575cdf7f 100644--- a/frontend/src/scenes/data-management/events/eventInsightsLogic.ts+++ b/frontend/src/scenes/data-management/events/eventInsightsLogic.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 api from 'lib/api'@@ -11,14 +11,75 @@ import { teamLogic } from 'scenes/teamLogic'import { getQueryBasedInsightModel } from '~/queries/nodes/InsightViz/utils'-import type { eventInsightsLogicType } from './eventInsightsLogicType'-export interface EventInsightsLogicProps {event: string}export const INSIGHTS_PER_PAGE = 10+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventInsightsLogicValues {+ currentTeamId: number | null // teamLogic+ count: number+ filters: SavedInsightFilters+ insights: InsightsResult+ insightsLoading: boolean+ page: number+ rawFilters: Partial<SavedInsightFilters> | null+ sorting: Sorting | null+ usingFilters: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventInsightsLogicActions {+ loadInsights: () => {+ value: true+ }+ loadInsightsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadInsightsSuccess: (+ insights: InsightsResult,+ payload?: {+ value: true+ }+ ) => {+ insights: InsightsResult+ payload?: {+ value: true+ }+ }+ setFilters: (filters: Partial<SavedInsightFilters>) => {+ filters: Partial<SavedInsightFilters>+ }+ setPage: (page: number) => {+ page: number+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface eventInsightsLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ filters: (rawFilters: Partial<SavedInsightFilters> | null) => SavedInsightFilters+ count: (insights: InsightsResult) => number+ sorting: (filters: SavedInsightFilters) => Sorting | null+ page: (filters: SavedInsightFilters) => number+ usingFilters: (filters: SavedInsightFilters) => boolean+ }+}++export type eventInsightsLogicType = MakeLogicType<+ eventInsightsLogicValues,+ eventInsightsLogicActions,+ EventInsightsLogicProps,+ eventInsightsLogicMeta+>+export const eventInsightsLogic = kea<eventInsightsLogicType>([path(['scenes', 'data-management', 'events', 'eventInsightsLogic']),props({} as EventInsightsLogicProps),@@ -79,20 +140,21 @@ export const eventInsightsLogic = kea<eventInsightsLogicType>([}),selectors({filters: [(s) => [s.rawFilters], (rawFilters: object): SavedInsightFilters => cleanFilters(rawFilters || {})],- count: [(s) => [s.insights], (insights) => insights.count],+ count: [(s) => [s.insights], (insights: InsightsResult) => 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,],- page: [(s) => [s.filters], (filters) => filters.page],+ page: [(s) => [s.filters], (filters: SavedInsightFilters) => filters.page],usingFilters: [(s) => [s.filters],- (filters) => !objectsEqual(cleanFilters({ ...filters, events: undefined }), cleanFilters({})),+ (filters: SavedInsightFilters) =>+ !objectsEqual(cleanFilters({ ...filters, events: undefined }), cleanFilters({})),],}),listeners(({ actions, values, selectors }) => ({diff --git a/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.ts b/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.tsindex 3154f2eb42a9..fe32d10178d1 100644--- a/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.ts+++ b/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.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'@@ -10,7 +10,6 @@ import { projectLogic } from 'scenes/projectLogic'import { urls } from 'scenes/urls'import { teamLogic } from '../../teamLogic'-import type { ingestionWarningsV2LogicType } from './ingestionWarningsV2LogicType'// No generated types for this endpoint yet: it is attributed to `data_management`,// which has no products/ frontend module, so these mirror IngestionWarningsV2SummarySerializer.@@ -105,6 +104,68 @@ function paramsFromFilters(filters: IngestionWarningsFilters): Record<string, anreturn searchParams}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ingestionWarningsV2LogicValues {+ currentProjectId: number | null // projectLogic+ timezone: string // teamLogic+ bucketLabels: string[]+ filters: IngestionWarningsFilters+ hasActiveFilters: boolean+ showProductIntro: boolean+ summaryDatasets: Record<string, number[]>+ summaryStats: IngestionWarningsSummaryStats+ warnings: IngestionWarningV2Summary[]+ warningsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ingestionWarningsV2LogicActions {+ loadWarnings: (_: void) => void+ loadWarningsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadWarningsSuccess: (+ warnings: IngestionWarningV2Summary[],+ payload?: void+ ) => {+ warnings: IngestionWarningV2Summary[]+ payload?: void+ }+ setFilters: (filters: Partial<IngestionWarningsFilters>) => {+ filters: Partial<IngestionWarningsFilters>+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ingestionWarningsV2LogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ bucketLabels: (filters: IngestionWarningsFilters) => string[]+ summaryDatasets: (+ warnings: IngestionWarningV2Summary[],+ filters: IngestionWarningsFilters,+ timezone: string+ ) => Record<string, number[]>+ summaryStats: (warnings: IngestionWarningV2Summary[]) => IngestionWarningsSummaryStats+ hasActiveFilters: (filters: IngestionWarningsFilters) => boolean+ showProductIntro: (+ warnings: IngestionWarningV2Summary[],+ warningsLoading: boolean,+ hasActiveFilters: boolean+ ) => boolean+ }+}++export type ingestionWarningsV2LogicType = MakeLogicType<+ ingestionWarningsV2LogicValues,+ ingestionWarningsV2LogicActions,+ Record<string, any>,+ ingestionWarningsV2LogicMeta+>+export const ingestionWarningsV2Logic = kea<ingestionWarningsV2LogicType>([path(['scenes', 'data-management', 'ingestion-warnings-v2', 'ingestionWarningsV2Logic']),diff --git a/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.ts b/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.tsindex 2fb8a070b889..07fa08989096 100644--- a/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.ts+++ b/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.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 api from 'lib/api'@@ -12,7 +12,6 @@ import { Breadcrumb } from '~/types'import { teamLogic } from '../../teamLogic'import { DataManagementTab } from '../DataManagementScene'-import type { ingestionWarningsLogicType } from './ingestionWarningsLogicType'export interface IngestionWarningSummary {type: string@@ -29,6 +28,56 @@ export interface IngestionWarning {details: Record<string, any>}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ingestionWarningsLogicValues {+ currentProjectId: number | null // projectLogic+ timezone: string // teamLogic+ breadcrumbs: Breadcrumb[]+ data: IngestionWarningSummary[]+ dataLoading: boolean+ dates: string[]+ searchQuery: string+ showProductIntro: boolean+ summaryDatasets: Record<string, number[]>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ingestionWarningsLogicActions {+ loadData: () => any+ loadDataFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadDataSuccess: (+ data: IngestionWarningSummary[],+ payload?: any+ ) => {+ data: IngestionWarningSummary[]+ payload?: any+ }+ setSearchQuery: (search: string) => {+ search: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ingestionWarningsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ summaryDatasets: (data: IngestionWarningSummary[], timezone: string) => Record<string, number[]>+ showProductIntro: (data: IngestionWarningSummary[], dataLoading: boolean, searchQuery: string) => boolean+ }+}++export type ingestionWarningsLogicType = MakeLogicType<+ ingestionWarningsLogicValues,+ ingestionWarningsLogicActions,+ Record<string, any>,+ ingestionWarningsLogicMeta+>+export const ingestionWarningsLogic = kea<ingestionWarningsLogicType>([path(['scenes', 'data-management', 'ingestion-warnings', 'ingestionWarningsLogic']),@@ -108,7 +157,7 @@ export const ingestionWarningsLogic = kea<ingestionWarningsLogicType>([],showProductIntro: [(s) => [s.data, s.dataLoading, s.searchQuery],- (data: IngestionWarningSummary[], dataLoading: boolean, searchQuery) =>+ (data: IngestionWarningSummary[], dataLoading: boolean, searchQuery: string) =>data.length === 0 && !dataLoading && !searchQuery.trim().length,],}),diff --git a/frontend/src/scenes/data-management/managed-viewsets/dataWarehouseManagedViewsetsLogic.ts b/frontend/src/scenes/data-management/managed-viewsets/dataWarehouseManagedViewsetsLogic.tsindex a83708d01b65..abd279da56e7 100644--- a/frontend/src/scenes/data-management/managed-viewsets/dataWarehouseManagedViewsetsLogic.ts+++ b/frontend/src/scenes/data-management/managed-viewsets/dataWarehouseManagedViewsetsLogic.ts@@ -1,4 +1,4 @@-import { actions, connect, kea, key, path, props, reducers } from 'kea'+import { MakeLogicType, actions, connect, kea, key, path, props, reducers } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'@@ -7,7 +7,7 @@ import { teamLogic } from 'scenes/teamLogic'import { DataWarehouseManagedViewsetKind } from '~/queries/schema/schema-general'-import type { dataWarehouseManagedViewsetsLogicType } from './dataWarehouseManagedViewsetsLogicType'+import type { TeamPublicType, TeamType } from '../../../types'import {DisableDataWarehouseManagedViewsetModalLogicProps,disableDataWarehouseManagedViewsetModalLogic,@@ -17,6 +17,61 @@ export interface DataWarehouseManagedViewsetsLogicProps {type: DisableDataWarehouseManagedViewsetModalLogicProps['type']}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataWarehouseManagedViewsetsLogicValues {+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ toggleResult: void | null+ toggleResultLoading: boolean+ togglingViewset: DataWarehouseManagedViewsetKind | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataWarehouseManagedViewsetsLogicActions {+ openModal: (kind: 'revenue_analytics') => {+ kind: 'revenue_analytics'+ } // disableDataWarehouseManagedViewsetModalLogic+ loadCurrentTeam: () => any // teamLogic+ toggleViewset: (+ kind: DataWarehouseManagedViewsetKind,+ enabled: boolean+ ) => {+ enabled: boolean+ kind: 'revenue_analytics'+ }+ toggleViewsetFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ toggleViewsetSuccess: (+ toggleResult: void,+ payload?: {+ enabled: boolean+ kind: 'revenue_analytics'+ }+ ) => {+ toggleResult: void+ payload?: {+ enabled: boolean+ kind: 'revenue_analytics'+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataWarehouseManagedViewsetsLogicMeta {+ key: string+}++export type dataWarehouseManagedViewsetsLogicType = MakeLogicType<+ dataWarehouseManagedViewsetsLogicValues,+ dataWarehouseManagedViewsetsLogicActions,+ DataWarehouseManagedViewsetsLogicProps,+ dataWarehouseManagedViewsetsLogicMeta+>+export const dataWarehouseManagedViewsetsLogic = kea<dataWarehouseManagedViewsetsLogicType>([props({ type: 'root' } as DataWarehouseManagedViewsetsLogicProps),key(({ type }) => `dataWarehouseManagedViewsetsLogic-${type}`),diff --git a/frontend/src/scenes/data-management/managed-viewsets/disableDataWarehouseManagedViewsetModalLogic.ts b/frontend/src/scenes/data-management/managed-viewsets/disableDataWarehouseManagedViewsetModalLogic.tsindex 4aa75bbdd08c..93e9740ad2cb 100644--- a/frontend/src/scenes/data-management/managed-viewsets/disableDataWarehouseManagedViewsetModalLogic.ts+++ b/frontend/src/scenes/data-management/managed-viewsets/disableDataWarehouseManagedViewsetModalLogic.ts@@ -1,4 +1,4 @@-import { actions, kea, key, path, props, reducers } from 'kea'+import { MakeLogicType, actions, kea, key, path, props, reducers } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'@@ -6,8 +6,6 @@ import api from 'lib/api'import { DataWarehouseManagedViewsetKind } from '~/queries/schema/schema-general'import { DataWarehouseManagedViewsetSavedQuery } from '~/types'-import type { disableDataWarehouseManagedViewsetModalLogicType } from './disableDataWarehouseManagedViewsetModalLogicType'-export const VIEWSET_TITLES: Record<DataWarehouseManagedViewsetKind, string> = {revenue_analytics: 'Revenue analytics',}@@ -16,6 +14,62 @@ export interface DisableDataWarehouseManagedViewsetModalLogicProps {type: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface disableDataWarehouseManagedViewsetModalLogicValues {+ confirmationInput: string+ isDeleting: boolean+ isOpen: boolean+ kind: DataWarehouseManagedViewsetKind | null+ views: DataWarehouseManagedViewsetSavedQuery[]+ viewsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface disableDataWarehouseManagedViewsetModalLogicActions {+ closeModal: () => {+ value: true+ }+ openModal: (kind: DataWarehouseManagedViewsetKind) => {+ kind: 'revenue_analytics'+ }+ openModalFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ openModalSuccess: (+ views: DataWarehouseManagedViewsetSavedQuery[],+ payload?: {+ kind: 'revenue_analytics'+ }+ ) => {+ views: DataWarehouseManagedViewsetSavedQuery[]+ payload?: {+ kind: 'revenue_analytics'+ }+ }+ setConfirmationInput: (confirmationInput: string) => {+ confirmationInput: string+ }+ setIsDeleting: (isDeleting: boolean) => {+ isDeleting: boolean+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface disableDataWarehouseManagedViewsetModalLogicMeta {+ key: string+}++export type disableDataWarehouseManagedViewsetModalLogicType = MakeLogicType<+ disableDataWarehouseManagedViewsetModalLogicValues,+ disableDataWarehouseManagedViewsetModalLogicActions,+ DisableDataWarehouseManagedViewsetModalLogicProps,+ disableDataWarehouseManagedViewsetModalLogicMeta+>+export const disableDataWarehouseManagedViewsetModalLogic = kea<disableDataWarehouseManagedViewsetModalLogicType>([props({ type: 'root' } as DisableDataWarehouseManagedViewsetModalLogicProps),key(({ type }) => `disableDataWarehouseManagedViewsetModalLogic-${type}`),diff --git a/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts b/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.tsindex ca89eabf364e..49f8db5cd73a 100644--- a/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts+++ b/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts@@ -1,4 +1,4 @@-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 { loaders } from 'kea-loaders'import { actionToUrl, combineUrl, router, urlToAction } from 'kea-router'@@ -17,7 +17,8 @@ import { urls } from 'scenes/urls'import { PropertyDefinition } from '~/types'import { groupsModel } from '../../../models/groupsModel'-import type { propertyDefinitionsTableLogicType } from './propertyDefinitionsTableLogicType'+import type { Noun } from '../../../models/groupsModel'+import type { GroupType, GroupTypeIndex } from '../../../types'export interface Filters {property: string@@ -49,6 +50,95 @@ export interface PropertyDefinitionsTableLogicProps {key: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface propertyDefinitionsTableLogicValues {+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel+ filters: Filters+ hoveredDefinition: string | null+ propertyDefinitions: PropertyDefinitionsPaginatedResponse+ propertyDefinitionsLoading: boolean+ propertyTypeOptions: LemonSelectOption<string>[]+ showVerifiedFilter: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface propertyDefinitionsTableLogicActions {+ loadPropertyDefinitions: (url?: string | null) => {+ url: string | null+ }+ loadPropertyDefinitionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPropertyDefinitionsSuccess: (+ propertyDefinitions: PropertyDefinitionsPaginatedResponse,+ payload?: {+ url: string | null+ }+ ) => {+ propertyDefinitions: PropertyDefinitionsPaginatedResponse+ payload?: {+ url: string | null+ }+ }+ setFilters: (filters: Partial<Filters>) => {+ filters: Partial<Filters>+ }+ setHoveredDefinition: (definitionKey: string | null) => {+ definitionKey: string | null+ }+ setLocalPropertyDefinition: (definition: PropertyDefinition) => {+ definition: PropertyDefinition+ }+ setLocalPropertyDefinitionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setLocalPropertyDefinitionSuccess: (+ propertyDefinitions: PropertyDefinitionsPaginatedResponse,+ payload?: {+ definition: PropertyDefinition+ }+ ) => {+ propertyDefinitions: PropertyDefinitionsPaginatedResponse+ payload?: {+ definition: PropertyDefinition+ }+ }+ setOpenedDefinition: (id: string | null) => {+ id: string | null+ }+ setPropertyType: (propertyType: string) => {+ propertyType: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface propertyDefinitionsTableLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ propertyTypeOptions: (+ groupTypes: Map<GroupTypeIndex, GroupType>,+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun+ ) => LemonSelectOption<string>[]+ showVerifiedFilter: (propertyDefinitions: PropertyDefinitionsPaginatedResponse) => boolean+ }+}++export type propertyDefinitionsTableLogicType = MakeLogicType<+ propertyDefinitionsTableLogicValues,+ propertyDefinitionsTableLogicActions,+ PropertyDefinitionsTableLogicProps,+ propertyDefinitionsTableLogicMeta+>+export const propertyDefinitionsTableLogic = kea<propertyDefinitionsTableLogicType>([path(['scenes', 'data-management', 'properties', 'propertyDefinitionsTableLogic']),props({} as PropertyDefinitionsTableLogicProps),@@ -89,7 +179,13 @@ export const propertyDefinitionsTableLogic = kea<propertyDefinitionsTableLogicTyselectors({propertyTypeOptions: [(s) => [s.groupTypes, s.aggregationLabel],- (groupTypes, aggregationLabel) => {+ (+ groupTypes: Map<import('~/types').GroupTypeIndex, import('~/types').GroupType>,+ aggregationLabel: (+ groupTypeIndex: number | null | undefined,+ deferToUserWording?: boolean+ ) => import('../../../models/groupsModel').Noun+ ) => {const groupChoices: Array<LemonSelectOption<string>> = Array.from(groupTypes.values()).map((type) => ({label: `${capitalizeFirstLetter(aggregationLabel(type.group_type_index).singular)} properties`,value: `group::${type.group_type_index}`,diff --git a/frontend/src/scenes/data-management/schema/schemaManagementLogic.ts b/frontend/src/scenes/data-management/schema/schemaManagementLogic.tsindex 265364499790..42e3b75af066 100644--- a/frontend/src/scenes/data-management/schema/schemaManagementLogic.ts+++ b/frontend/src/scenes/data-management/schema/schemaManagementLogic.ts@@ -1,13 +1,12 @@-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 api from 'lib/api'import { lemonToast } from 'lib/lemon-ui/LemonToast'import { teamLogic } from 'scenes/teamLogic'-import type { schemaManagementLogicType } from './schemaManagementLogicType'-export type PropertyType = 'String' | 'Numeric' | 'Boolean' | 'DateTime' | 'Object'export const MAX_PROPERTY_NAME_LENGTH = 200@@ -98,6 +97,164 @@ export interface PropertyGroupFormType {properties: SchemaPropertyGroupProperty[]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface schemaManagementLogicValues {+ currentProjectId: number | string // teamLogic+ editingPropertyGroup: SchemaPropertyGroup | null+ filteredPropertyGroups: SchemaPropertyGroup[]+ isPropertyGroupFormSubmitting: boolean+ isPropertyGroupFormValid: boolean+ propertyGroupForm: PropertyGroupFormType+ propertyGroupFormAllErrors: Record<string, any>+ propertyGroupFormChanged: boolean+ propertyGroupFormErrors: DeepPartialMap<PropertyGroupFormType, ValidationErrorType>+ propertyGroupFormHasErrors: boolean+ propertyGroupFormManualErrors: Record<string, any>+ propertyGroupFormTouched: boolean+ propertyGroupFormTouches: Record<string, boolean>+ propertyGroupFormValidationError: string | null+ propertyGroupFormValidationErrors: DeepPartialMap<PropertyGroupFormType, ValidationErrorType>+ propertyGroupModalOpen: boolean+ propertyGroups: SchemaPropertyGroup[]+ propertyGroupsLoading: boolean+ searchTerm: string+ showPropertyGroupFormErrors: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface schemaManagementLogicActions {+ addPropertyToForm: () => {+ value: true+ }+ createPropertyGroup: (data: Partial<SchemaPropertyGroup>) => Partial<SchemaPropertyGroup>+ createPropertyGroupFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ createPropertyGroupSuccess: (+ propertyGroups: any[],+ payload?: Partial<SchemaPropertyGroup>+ ) => {+ propertyGroups: any[]+ payload?: Partial<SchemaPropertyGroup>+ }+ deletePropertyGroup: (id: string) => {+ id: string+ }+ loadPropertyGroups: () => any+ loadPropertyGroupsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPropertyGroupsSuccess: (+ propertyGroups: SchemaPropertyGroup[],+ payload?: any+ ) => {+ propertyGroups: SchemaPropertyGroup[]+ payload?: any+ }+ removePropertyFromForm: (index: number) => {+ index: number+ }+ resetPropertyGroupForm: (values?: PropertyGroupFormType) => {+ values?: PropertyGroupFormType+ }+ setEditingPropertyGroup: (propertyGroup: SchemaPropertyGroup | null) => {+ propertyGroup: SchemaPropertyGroup | null+ }+ setPropertyGroupFormManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setPropertyGroupFormValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setPropertyGroupFormValues: (values: DeepPartial<PropertyGroupFormType>) => {+ values: DeepPartial<PropertyGroupFormType>+ }+ setPropertyGroupModalOpen: (open: boolean) => {+ open: boolean+ }+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+ submitPropertyGroupForm: () => {+ value: boolean+ }+ submitPropertyGroupFormFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitPropertyGroupFormRequest: (propertyGroupForm: PropertyGroupFormType) => {+ propertyGroupForm: PropertyGroupFormType+ }+ submitPropertyGroupFormSuccess: (propertyGroupForm: PropertyGroupFormType) => {+ propertyGroupForm: PropertyGroupFormType+ }+ touchPropertyGroupFormField: (key: string) => {+ key: string+ }+ updatePropertyGroup: ({ id, data }: { data: Partial<SchemaPropertyGroup>; id: string }) => {+ id: string+ data: Partial<SchemaPropertyGroup>+ }+ updatePropertyGroupFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ updatePropertyGroupSuccess: (+ propertyGroups: any[],+ payload?: {+ id: string+ data: Partial<SchemaPropertyGroup>+ }+ ) => {+ propertyGroups: any[]+ payload?: {+ id: string+ data: Partial<SchemaPropertyGroup>+ }+ }+ updatePropertyInForm: (+ index: number,+ updates: Partial<SchemaPropertyGroupProperty>+ ) => {+ index: number+ updates: Partial<SchemaPropertyGroupProperty>+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface schemaManagementLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ filteredPropertyGroups: (propertyGroups: SchemaPropertyGroup[], searchTerm: string) => SchemaPropertyGroup[]+ propertyGroupFormValidationError: (propertyGroupForm: PropertyGroupFormType) => string | null+ }+}++export type schemaManagementLogicType = MakeLogicType<+ schemaManagementLogicValues,+ schemaManagementLogicActions,+ SchemaManagementLogicProps,+ schemaManagementLogicMeta+>+export const schemaManagementLogic = kea<schemaManagementLogicType>([path(['scenes', 'data-management', 'schema', 'schemaManagementLogic']),props({} as SchemaManagementLogicProps),@@ -246,7 +403,7 @@ export const schemaManagementLogic = kea<schemaManagementLogicType>([selectors({filteredPropertyGroups: [(s) => [s.propertyGroups, s.searchTerm],- (propertyGroups, searchTerm): SchemaPropertyGroup[] => {+ (propertyGroups: SchemaPropertyGroup[], searchTerm: string): SchemaPropertyGroup[] => {if (!searchTerm) {return propertyGroups}@@ -261,7 +418,7 @@ export const schemaManagementLogic = kea<schemaManagementLogicType>([],propertyGroupFormValidationError: [(s) => [s.propertyGroupForm],- (form): string | null => {+ (form: PropertyGroupFormType): string | null => {if (form.properties.length === 0) {return null}diff --git a/frontend/src/scenes/data-management/variables/sqlVariableEditSceneLogic.ts b/frontend/src/scenes/data-management/variables/sqlVariableEditSceneLogic.tsindex af91bc23d67f..62675797f9af 100644--- a/frontend/src/scenes/data-management/variables/sqlVariableEditSceneLogic.ts+++ b/frontend/src/scenes/data-management/variables/sqlVariableEditSceneLogic.ts@@ -1,5 +1,6 @@-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 { router } from 'kea-router'@@ -16,8 +17,8 @@ import {import { ListVariable, Variable, VariableType } from '~/queries/nodes/DataVisualization/types'import { QueryBasedInsightModel } from '~/types'+import type { Node } from '../../../queries/schema/schema-general'import { fetchInsightsUsingVariable } from './insightsLoader'-import type { sqlVariableEditSceneLogicType } from './sqlVariableEditSceneLogicType'export interface SqlVariableEditSceneLogicProps {id: string@@ -43,6 +44,150 @@ export const variableToFormValues = (variable: Variable): Partial<Variable> =>...(variable.type === 'List' && { values: getListVariableValues(variable as ListVariable) }),}) as Partial<Variable>+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sqlVariableEditSceneLogicValues {+ currentTeamId: number | null // teamLogic+ breadcrumbs: (+ | {+ key: string+ name: string+ path: string+ }+ | {+ key: string+ name: string+ path?: undefined+ }+ )[]+ hasChanges: boolean+ insightsUsingVariable: QueryBasedInsightModel[]+ insightsUsingVariableLoading: boolean+ isNew: boolean+ isVariableFormSubmitting: boolean+ isVariableFormValid: boolean+ showVariableFormErrors: boolean+ variable: Variable | null+ variableForm: Partial<Variable>+ variableFormAllErrors: Record<string, any>+ variableFormChanged: boolean+ variableFormErrors: DeepPartialMap<Partial<Variable>, ValidationErrorType>+ variableFormHasErrors: boolean+ variableFormManualErrors: Record<string, any>+ variableFormTouched: boolean+ variableFormTouches: Record<string, boolean>+ variableFormValidationErrors: DeepPartialMap<Partial<Variable>, ValidationErrorType>+ variableLoading: boolean+ variableType: VariableType+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sqlVariableEditSceneLogicActions {+ loadInsightsUsingVariable: () => any+ loadInsightsUsingVariableFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadInsightsUsingVariableSuccess: (+ insightsUsingVariable: QueryBasedInsightModel<Node<Record<string, any>>>[],+ payload?: any+ ) => {+ insightsUsingVariable: QueryBasedInsightModel<Node<Record<string, any>>>[]+ payload?: any+ }+ loadVariable: () => any+ loadVariableFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadVariableSuccess: (+ variable: Variable | null,+ payload?: any+ ) => {+ variable: Variable | null+ payload?: any+ }+ resetVariableForm: (values?: Partial<Variable>) => {+ values?: Partial<Variable>+ }+ setVariableFormManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setVariableFormValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setVariableFormValues: (values: DeepPartial<Partial<Variable>>) => {+ values: DeepPartial<Partial<Variable>>+ }+ setVariableType: (type: VariableType) => {+ type: VariableType+ }+ submitVariableForm: () => {+ value: boolean+ }+ submitVariableFormFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitVariableFormRequest: (variableForm: Partial<Variable>) => {+ variableForm: Partial<Variable>+ }+ submitVariableFormSuccess: (variableForm: Partial<Variable>) => {+ variableForm: Partial<Variable>+ }+ touchVariableFormField: (key: string) => {+ key: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sqlVariableEditSceneLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ isNew: (id: string) => boolean+ hasChanges: (+ variableForm: Partial<Variable>,+ variableType: VariableType,+ variable: Variable | null,+ variableLoading: boolean+ ) => boolean+ breadcrumbs: (+ variable: Variable | null,+ id: string+ ) => (+ | {+ key: string+ name: string+ path: string+ }+ | {+ key: string+ name: string+ path?: undefined+ }+ )[]+ }+}++export type sqlVariableEditSceneLogicType = MakeLogicType<+ sqlVariableEditSceneLogicValues,+ sqlVariableEditSceneLogicActions,+ SqlVariableEditSceneLogicProps,+ sqlVariableEditSceneLogicMeta+>+export const sqlVariableEditSceneLogic = kea<sqlVariableEditSceneLogicType>([props({} as SqlVariableEditSceneLogicProps),path(['scenes', 'data-management', 'variables', 'sqlVariableEditSceneLogic']),diff --git a/frontend/src/scenes/data-management/variables/sqlVariablesLogic.ts b/frontend/src/scenes/data-management/variables/sqlVariablesLogic.tsindex af762c66ca6b..8d5870783e6d 100644--- a/frontend/src/scenes/data-management/variables/sqlVariablesLogic.ts+++ b/frontend/src/scenes/data-management/variables/sqlVariablesLogic.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 { lemonToast } from '@posthog/lemon-ui'@@ -7,7 +7,73 @@ import api from 'lib/api'import { Variable } from '~/queries/nodes/DataVisualization/types'-import type { sqlVariablesLogicType } from './sqlVariablesLogicType'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sqlVariablesLogicValues {+ filteredVariables: Variable[]+ searchTerm: string+ variables: Variable[]+ variablesLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sqlVariablesLogicActions {+ deleteVariable: (variableId: string) => {+ variableId: string+ }+ deleteVariableSuccess: ({ variableId }: { variableId: string }) => {+ variableId: string+ }+ deleteVariableSuccessFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteVariableSuccessSuccess: (+ variables: Variable[],+ payload?: {+ variableId: string+ }+ ) => {+ variables: Variable[]+ payload?: {+ variableId: string+ }+ }+ loadVariables: () => any+ loadVariablesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadVariablesSuccess: (+ variables: Variable[],+ payload?: any+ ) => {+ variables: Variable[]+ payload?: any+ }+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sqlVariablesLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ filteredVariables: (variables: Variable[], searchTerm: string) => Variable[]+ }+}++export type sqlVariablesLogicType = MakeLogicType<+ sqlVariablesLogicValues,+ sqlVariablesLogicActions,+ Record<string, any>,+ sqlVariablesLogicMeta+>export const sqlVariablesLogic = kea<sqlVariablesLogicType>([path(['scenes', 'data-management', 'variables', 'sqlVariablesLogic']),diff --git a/frontend/src/scenes/insights/summarizeInsight.ts b/frontend/src/scenes/insights/summarizeInsight.tsindex 998fd9c56848..4e641449587c 100644--- a/frontend/src/scenes/insights/summarizeInsight.ts+++ b/frontend/src/scenes/insights/summarizeInsight.ts@@ -10,7 +10,7 @@ import {} from 'scenes/insights/utils'import { retentionOptions } from 'scenes/retention/constants'import { MathCategory, apiValueToMathType, mathsLogic } from 'scenes/trends/mathsLogic'-import { mathsLogicType } from 'scenes/trends/mathsLogicType'+import type { mathsLogicType } from 'scenes/trends/mathsLogic'import { cohortsModel } from '~/models/cohortsModel'import { cohortsModelType } from '~/models/cohortsModelType'diff --git a/frontend/src/scenes/sceneLogic.tsx b/frontend/src/scenes/sceneLogic.tsxindex 002c85436f1a..e8c3fe61fe2c 100644--- a/frontend/src/scenes/sceneLogic.tsx+++ b/frontend/src/scenes/sceneLogic.tsx@@ -1,6 +1,19 @@import { deepEqual as equal } from 'fast-equals'-import { BuiltLogic, actions, afterMount, connect, kea, listeners, path, props, reducers, selectors } from 'kea'+import {+ MakeLogicType,+ BuiltLogic,+ actions,+ afterMount,+ connect,+ kea,+ listeners,+ path,+ props,+ reducers,+ selectors,+} from 'kea'import { router, urlToAction } from 'kea-router'+import type { LocationChangedPayload } from 'kea-router/lib/types'import posthog from 'posthog-js'import { useEffect, useState } from 'react'@@ -39,13 +52,14 @@ import { isSharedView } from '~/exporter/exporterViewLogic'import { FileSystemIconType, ProductKey } from '~/queries/schema/schema-general'import { AccessControlLevel } from '~/types'+import type { BillingType } from '../types'import { handleLoginRedirect } from './authentication/login/loginLogic'import { billingLogic } from './billing/billingLogic'import { parseCouponCampaign } from './coupons/utils'import { isOnboardingRedirectSuppressed } from './onboarding/legacy/onboardingDelegationState'import { organizationLogic } from './organizationLogic'import { preflightLogic } from './PreflightCheck/preflightLogic'-import type { sceneLogicType } from './sceneLogicType'+import type { SceneProps } from './sceneTypes'import { inviteLogic } from './settings/organization/inviteLogic'import { teamLogic } from './teamLogic'import { userLogic } from './userLogic'@@ -184,6 +198,154 @@ export function withForwardedSearchParams(return redirectUrlObj.pathname + redirectUrlObj.search + redirectUrlObj.hash}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sceneLogicValues {+ billing: BillingType | null // billingLogic+ organizationBeingDeleted: string | null // organizationLogic+ activeExportedScene: SceneExport<SceneProps> | null+ activeLoadedScene: LoadedScene | null+ activeSceneComponentParams: Record<string, any>+ activeSceneId: string | null+ activeSceneLogic: BuiltLogic | null+ activeSceneLogicProps: Record<string, any>+ activeSceneProductKey: ProductKey | null+ exportedScenes: Record<string, SceneExport<SceneProps>>+ hashParams: Record<string, any>+ homepage: SceneTab | null+ lastReloadAt: number | null+ lastSetScenePayload: Record<string, any>+ loadingScene: string | null+ sceneConfig: SceneConfig | null+ sceneId: string | null+ sceneKey: string | null+ sceneParams: SceneParams+ searchParams: Record<string, any>+ titleAndIcon: {+ iconType: FileSystemIconType | 'blank' | 'loading'+ title: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sceneLogicActions {+ hideInviteModal: () => {+ value: true+ } // inviteLogic+ locationChanged: ({+ method,+ pathname,+ search,+ searchParams,+ hash,+ hashParams,+ initial,+ url,+ routerState,+ }: LocationChangedPayload) => {+ hash: string+ hashParams: Record<string, any>+ initial: boolean+ method: 'POP' | 'PUSH' | 'REPLACE'+ pathname: string+ routerState: Record<string, any>+ search: string+ searchParams: Record<string, any>+ url: string+ } // router+ loadScene: (+ sceneId: string,+ sceneKey: string | undefined,+ params: SceneParams,+ method: string+ ) => {+ method: string+ params: SceneParams+ sceneId: string+ sceneKey: string | undefined+ }+ openScene: (+ sceneId: string,+ sceneKey: string | undefined,+ params: SceneParams,+ method: string+ ) => {+ method: string+ params: SceneParams+ sceneId: string+ sceneKey: string | undefined+ }+ reloadBrowserDueToImportError: () => {+ value: true+ }+ setExportedScene: (+ exportedScene: SceneExport,+ sceneId: string,+ sceneKey: string | undefined,+ params: SceneParams+ ) => {+ exportedScene: SceneExport<SceneProps>+ params: SceneParams+ sceneId: string+ sceneKey: string | undefined+ }+ setHomepage: (tab: SceneTab | null) => {+ tab: SceneTab | null+ }+ setScene: (+ sceneId: string,+ sceneKey: string | undefined,+ params: SceneParams,+ scrollToTop?: boolean,+ exportedScene?: SceneExport+ ) => {+ exportedScene: SceneExport<SceneProps> | undefined+ params: SceneParams+ sceneId: string+ sceneKey: string | undefined+ scrollToTop: boolean+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sceneLogicProps {+ scenes?: Record<string, () => any>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ sceneConfig: (sceneId: string | null) => SceneConfig | null+ activeSceneId: (sceneId: string | null, isCurrentTeamUnavailable: boolean) => string | null+ activeExportedScene: (+ activeSceneId: string | null,+ exportedScenes: Record<string, SceneExport<SceneProps>>+ ) => SceneExport<SceneProps> | null+ activeLoadedScene: (+ activeSceneId: string | null,+ activeExportedScene: SceneExport<SceneProps> | null,+ sceneParams: SceneParams+ ) => LoadedScene | null+ activeSceneComponentParams: (sceneParams: SceneParams) => Record<string, any>+ activeSceneLogicProps: (+ activeExportedScene: SceneExport<SceneProps> | null,+ sceneParams: SceneParams+ ) => Record<string, any>+ activeSceneLogic: (+ activeExportedScene: SceneExport<SceneProps> | null,+ activeSceneLogicProps: Record<string, any>+ ) => BuiltLogic | null+ searchParams: (sceneParams: SceneParams) => Record<string, any>+ hashParams: (sceneParams: SceneParams) => Record<string, any>+ titleAndIcon: (arg: { iconType: FileSystemIconType | 'blank' | 'loading'; title: string }) => {+ iconType: FileSystemIconType | 'blank' | 'loading'+ title: string+ }+ activeSceneProductKey: (activeExportedScene: SceneExport<SceneProps> | null) => ProductKey | null+ }+}++export type sceneLogicType = MakeLogicType<sceneLogicValues, sceneLogicActions, sceneLogicProps, sceneLogicMeta>+export const sceneLogic = kea<sceneLogicType>([props({} as {@@ -323,7 +485,7 @@ export const sceneLogic = kea<sceneLogicType>([],activeSceneId: [(s) => [s.sceneId, teamLogic.selectors.isCurrentTeamUnavailable],- (sceneId, isCurrentTeamUnavailable) => {+ (sceneId: string | null, isCurrentTeamUnavailable: boolean) => {const effectiveResourceAccessControl = getAppContext()?.effective_resource_access_control// Get the access control resource type for the current scene@@ -354,14 +516,21 @@ export const sceneLogic = kea<sceneLogicType>([],activeExportedScene: [(s) => [s.activeSceneId, s.exportedScenes],- (activeSceneId, exportedScenes) => {+ (+ activeSceneId: string | null,+ exportedScenes: Record<string, SceneExport<import('scenes/sceneTypes').SceneProps>>+ ) => {return activeSceneId ? exportedScenes[activeSceneId] : null},{ resultEqualityCheck: (a, b) => a === b },],activeLoadedScene: [(s) => [s.activeSceneId, s.activeExportedScene, s.sceneParams],- (activeSceneId, activeExportedScene, sceneParams): LoadedScene | null => {+ (+ activeSceneId: string | null,+ activeExportedScene: SceneExport<import('scenes/sceneTypes').SceneProps> | null,+ sceneParams: SceneParams+ ): LoadedScene | null => {return {...(activeExportedScene ?? { component: DelayedLoadingSpinner }),id: activeSceneId ?? Scene.Error404,@@ -371,7 +540,7 @@ export const sceneLogic = kea<sceneLogicType>([],activeSceneComponentParams: [(s) => [s.sceneParams],- (sceneParams): Record<string, any> => {+ (sceneParams: SceneParams): Record<string, any> => {return {...sceneParams.params,}@@ -380,7 +549,10 @@ export const sceneLogic = kea<sceneLogicType>([],activeSceneLogicProps: [(s) => [s.activeExportedScene, s.sceneParams],- (activeExportedScene, sceneParams): Record<string, any> => {+ (+ activeExportedScene: SceneExport<import('scenes/sceneTypes').SceneProps> | null,+ sceneParams: SceneParams+ ): Record<string, any> => {return {...activeExportedScene?.paramsToProps?.(sceneParams),}@@ -389,7 +561,10 @@ export const sceneLogic = kea<sceneLogicType>([],activeSceneLogic: [(s) => [s.activeExportedScene, s.activeSceneLogicProps],- (activeExportedScene, activeSceneLogicProps): BuiltLogic | null => {+ (+ activeExportedScene: SceneExport<import('scenes/sceneTypes').SceneProps> | null,+ activeSceneLogicProps: Record<string, any>+ ): BuiltLogic | null => {if (activeExportedScene?.logic) {try {return activeExportedScene.logic.build(activeSceneLogicProps)@@ -411,8 +586,14 @@ export const sceneLogic = kea<sceneLogicType>([return null},],- searchParams: [(s) => [s.sceneParams], (sceneParams): Record<string, any> => sceneParams.searchParams || {}],- hashParams: [(s) => [s.sceneParams], (sceneParams): Record<string, any> => sceneParams.hashParams || {}],+ searchParams: [+ (s) => [s.sceneParams],+ (sceneParams: SceneParams): Record<string, any> => sceneParams.searchParams || {},+ ],+ hashParams: [+ (s) => [s.sceneParams],+ (sceneParams: SceneParams): Record<string, any> => sceneParams.hashParams || {},+ ],titleAndIcon: [(s) => [@@ -448,7 +629,8 @@ export const sceneLogic = kea<sceneLogicType>([return { title: '...', iconType: 'loading' }},],- (titleAndIcon) => titleAndIcon as { title: string; iconType: FileSystemIconType | 'loading' | 'blank' },+ (titleAndIcon: { iconType: FileSystemIconType | 'blank' | 'loading'; title: string }) =>+ titleAndIcon as { title: string; iconType: FileSystemIconType | 'loading' | 'blank' },{ resultEqualityCheck: equal },],activeSceneProductKey: [diff --git a/frontend/src/scenes/settings/environment/coreEventsLogic.ts b/frontend/src/scenes/settings/environment/coreEventsLogic.tsindex 87f18ec9ac94..91cf5f0cfbe4 100644--- a/frontend/src/scenes/settings/environment/coreEventsLogic.ts+++ b/frontend/src/scenes/settings/environment/coreEventsLogic.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 api from 'lib/api'@@ -7,8 +7,6 @@ import { teamLogic } from 'scenes/teamLogic'import { CoreEvent } from '~/queries/schema/schema-general'-import type { coreEventsLogicType } from './coreEventsLogicType'-/** API response type for core events */interface CoreEventResponse {id: string@@ -31,6 +29,60 @@ function toCoreEvent(response: CoreEventResponse): CoreEvent {}}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface coreEventsLogicValues {+ currentTeamId: number | null // teamLogic+ coreEvents: CoreEvent[]+ coreEventsLoader: any+ coreEventsLoaderLoading: boolean+ coreEventsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface coreEventsLogicActions {+ addCoreEvent: (event: Omit<CoreEvent, 'id'>) => {+ event: Omit<CoreEvent, 'id'>+ }+ loadCoreEvents: () => any+ loadCoreEventsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCoreEventsSuccess: (+ coreEventsLoader: any,+ payload?: any+ ) => {+ coreEventsLoader: any+ payload?: any+ }+ removeCoreEvent: (eventId: string) => {+ eventId: string+ }+ setCoreEvents: (events: CoreEvent[]) => {+ events: CoreEvent[]+ }+ updateCoreEvent: (event: CoreEvent) => {+ event: CoreEvent+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface coreEventsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ coreEventsLoading: (coreEventsLoaderLoading: boolean) => boolean+ }+}++export type coreEventsLogicType = MakeLogicType<+ coreEventsLogicValues,+ coreEventsLogicActions,+ Record<string, any>,+ coreEventsLogicMeta+>+export const coreEventsLogic = kea<coreEventsLogicType>([path(['scenes', 'settings', 'environment', 'coreEventsLogic']),connect(() => ({diff --git a/frontend/src/scenes/settings/environment/dataColorThemeModalLogic.ts b/frontend/src/scenes/settings/environment/dataColorThemeModalLogic.tsindex 92b104ea5c39..2dd26e6e2a7c 100644--- a/frontend/src/scenes/settings/environment/dataColorThemeModalLogic.ts+++ b/frontend/src/scenes/settings/environment/dataColorThemeModalLogic.ts@@ -1,5 +1,6 @@-import { actions, kea, listeners, path, reducers } from 'kea'+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'import { forms } from 'kea-forms'+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'import { lemonToast } from '@posthog/lemon-ui'@@ -7,10 +8,84 @@ import api from 'lib/api'import { DataColorThemeModelPayload } from '~/types'-import type { dataColorThemesModalLogicType } from './dataColorThemeModalLogicType'-const PAYLOAD_DEFAULT: DataColorThemeModelPayload = { name: '', colors: [] }+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataColorThemesModalLogicValues {+ isOpen: boolean+ isThemeSubmitting: boolean+ isThemeValid: boolean+ showThemeErrors: boolean+ theme: DataColorThemeModelPayload+ themeAllErrors: Record<string, any>+ themeChanged: boolean+ themeErrors: DeepPartialMap<DataColorThemeModelPayload, ValidationErrorType>+ themeHasErrors: boolean+ themeManualErrors: Record<string, any>+ themeTouched: boolean+ themeTouches: Record<string, boolean>+ themeValidationErrors: DeepPartialMap<DataColorThemeModelPayload, ValidationErrorType>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataColorThemesModalLogicActions {+ addColor: () => {+ value: true+ }+ closeModal: () => {+ value: true+ }+ duplicateColor: (index: number) => {+ index: number+ }+ openModal: (theme: any) => {+ theme: any+ }+ removeColor: (index: number) => {+ index: number+ }+ resetTheme: (values?: DataColorThemeModelPayload) => {+ values?: DataColorThemeModelPayload+ }+ setThemeManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setThemeValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setThemeValues: (values: DeepPartial<DataColorThemeModelPayload>) => {+ values: DeepPartial<DataColorThemeModelPayload>+ }+ submitTheme: () => {+ value: boolean+ }+ submitThemeFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitThemeRequest: (theme: DataColorThemeModelPayload) => {+ theme: DataColorThemeModelPayload+ }+ submitThemeSuccess: (theme: DataColorThemeModelPayload) => {+ theme: DataColorThemeModelPayload+ }+ touchThemeField: (key: string) => {+ key: string+ }+}++export type dataColorThemesModalLogicType = MakeLogicType<+ dataColorThemesModalLogicValues,+ dataColorThemesModalLogicActions+>+export const dataColorThemesModalLogic = kea<dataColorThemesModalLogicType>([path(['scenes', 'settings', 'environment', 'dataColorThemesModalLogic']),actions({diff --git a/frontend/src/scenes/settings/environment/dataColorThemesLogic.ts b/frontend/src/scenes/settings/environment/dataColorThemesLogic.tsindex 1111d5f73a85..1311a8cd2046 100644--- a/frontend/src/scenes/settings/environment/dataColorThemesLogic.ts+++ b/frontend/src/scenes/settings/environment/dataColorThemesLogic.ts@@ -1,9 +1,35 @@-import { actions, connect, kea, listeners, path } from 'kea'+import { MakeLogicType, actions, connect, kea, listeners, path } from 'kea'import { dataThemeLogic } from 'scenes/dataThemeLogic'+import type { DataColorThemeModel, DataColorThemeModelPayload } from '../../../types'import { dataColorThemesModalLogic } from './dataColorThemeModalLogic'-import type { dataColorThemesLogicType } from './dataColorThemesLogicType'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataColorThemesLogicValues {+ defaultTheme: DataColorThemeModel | null // dataThemeLogic+ posthogTheme: DataColorThemeModel | null | undefined // dataThemeLogic+ themes: DataColorThemeModel[] | null // dataThemeLogic+ themesLoading: boolean // dataThemeLogic+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface dataColorThemesLogicActions {+ openModal: (theme: any) => {+ theme: any+ } // dataColorThemesModalLogic+ submitThemeSuccess: (theme: DataColorThemeModelPayload) => {+ theme: DataColorThemeModelPayload+ } // dataColorThemesModalLogic+ setThemes: (themes: any) => {+ themes: any+ } // dataThemeLogic+ selectTheme: (id: number | 'new' | null) => {+ id: number | 'new' | null+ }+}++export type dataColorThemesLogicType = MakeLogicType<dataColorThemesLogicValues, dataColorThemesLogicActions>export const dataColorThemesLogic = kea<dataColorThemesLogicType>([path(['scenes', 'settings', 'environment', 'dataColorThemesLogic']),diff --git a/frontend/src/scenes/settings/environment/experimentsConfigLogic.ts b/frontend/src/scenes/settings/environment/experimentsConfigLogic.tsindex 4a6282c32650..8d9342f9892c 100644--- a/frontend/src/scenes/settings/environment/experimentsConfigLogic.ts+++ b/frontend/src/scenes/settings/environment/experimentsConfigLogic.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 api from 'lib/api'@@ -6,8 +6,6 @@ import api from 'lib/api'import { DEFAULT_MDE } from '~/scenes/experiments/constants'import { teamLogic } from '~/scenes/teamLogic'-import type { experimentsConfigLogicType } from './experimentsConfigLogicType'-export interface ExperimentsConfig {experiment_recalculation_time: string | nulldefault_experiment_confidence_level: number | null@@ -20,6 +18,50 @@ export interface ExperimentsConfig {default_sequential_tuning_parameter: number | null}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface experimentsConfigLogicValues {+ currentTeamId: number | null // teamLogic+ defaultMinimumDetectableEffect: number+ experimentsConfig: ExperimentsConfig | null+ experimentsConfigLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface experimentsConfigLogicActions {+ loadExperimentsConfig: () => any+ loadExperimentsConfigFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadExperimentsConfigSuccess: (+ experimentsConfig: ExperimentsConfig,+ payload?: any+ ) => {+ experimentsConfig: ExperimentsConfig+ payload?: any+ }+ updateExperimentsConfig: (payload: Partial<ExperimentsConfig>) => {+ payload: Partial<ExperimentsConfig>+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface experimentsConfigLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ defaultMinimumDetectableEffect: (experimentsConfig: ExperimentsConfig | null) => number+ }+}++export type experimentsConfigLogicType = MakeLogicType<+ experimentsConfigLogicValues,+ experimentsConfigLogicActions,+ Record<string, any>,+ experimentsConfigLogicMeta+>+export const experimentsConfigLogic = kea<experimentsConfigLogicType>([path(['scenes', 'settings', 'environment', 'experimentsConfigLogic']),connect({ values: [teamLogic, ['currentTeamId']] }),@@ -44,7 +86,7 @@ export const experimentsConfigLogic = kea<experimentsConfigLogicType>([selectors({defaultMinimumDetectableEffect: [(s) => [s.experimentsConfig],- (config): number => config?.default_minimum_detectable_effect ?? DEFAULT_MDE,+ (config: ExperimentsConfig | null): number => config?.default_minimum_detectable_effect ?? DEFAULT_MDE,],}),listeners(({ actions, values }) => ({diff --git a/frontend/src/scenes/settings/environment/filterTestAccountDefaultsLogic.ts b/frontend/src/scenes/settings/environment/filterTestAccountDefaultsLogic.tsindex 89e4fe038dfc..a636b3e5422f 100644--- a/frontend/src/scenes/settings/environment/filterTestAccountDefaultsLogic.ts+++ b/frontend/src/scenes/settings/environment/filterTestAccountDefaultsLogic.ts@@ -1,8 +1,45 @@-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'import { teamLogic } from 'scenes/teamLogic'-import type { filterTestAccountsDefaultsLogicType } from './filterTestAccountDefaultsLogicType'+import type { TeamPublicType, TeamType } from '../../../types'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface filterTestAccountsDefaultsLogicValues {+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ filterTestAccountsDefault: boolean+ localFilterTestAccountsDefault: boolean | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface filterTestAccountsDefaultsLogicActions {+ setDefault: (value: boolean) => {+ value: boolean+ }+ setLocalDefault: (value: boolean) => {+ value: boolean+ }+ setTeamDefault: (value: boolean) => {+ value: boolean+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface filterTestAccountsDefaultsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ filterTestAccountsDefault: (+ localFilterTestAccountsDefault: boolean | null,+ currentTeam: TeamPublicType | TeamType | null+ ) => boolean+ }+}++export type filterTestAccountsDefaultsLogicType = MakeLogicType<+ filterTestAccountsDefaultsLogicValues,+ filterTestAccountsDefaultsLogicActions,+ Record<string, any>,+ filterTestAccountsDefaultsLogicMeta+>export const filterTestAccountsDefaultsLogic = kea<filterTestAccountsDefaultsLogicType>([path(['scenes', 'project', 'Settings', 'filterTestAccountsDefaultLogic']),@@ -27,7 +64,10 @@ export const filterTestAccountsDefaultsLogic = kea<filterTestAccountsDefaultsLogselectors({filterTestAccountsDefault: [(s) => [s.localFilterTestAccountsDefault, s.currentTeam],- (localFilterTestAccountsDefault, currentTeam) => {+ (+ localFilterTestAccountsDefault: boolean | null,+ currentTeam: null | import('../../../types').TeamPublicType | import('../../../types').TeamType+ ) => {if (localFilterTestAccountsDefault !== null) {return localFilterTestAccountsDefault} else if (currentTeam?.test_account_filters_default_checked) {diff --git a/frontend/src/scenes/settings/environment/groupAnalyticsConfigLogic.ts b/frontend/src/scenes/settings/environment/groupAnalyticsConfigLogic.tsindex 19a2912f5625..93d1338bf96f 100644--- a/frontend/src/scenes/settings/environment/groupAnalyticsConfigLogic.ts+++ b/frontend/src/scenes/settings/environment/groupAnalyticsConfigLogic.ts@@ -1,8 +1,61 @@-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'import { groupsModel } from '~/models/groupsModel'-import type { groupAnalyticsConfigLogicType } from './groupAnalyticsConfigLogicType'+import type { GroupType, GroupTypeIndex } from '../../../types'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface groupAnalyticsConfigLogicValues {+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel+ groupTypesLoading: boolean // groupsModel+ hasChanges: boolean+ pluralChanges: Record<number, string | undefined>+ singularChanges: Record<number, string | undefined>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface groupAnalyticsConfigLogicActions {+ deleteGroupType: (groupTypeIndex: number) => number // groupsModel+ loadAllGroupTypes: () => any // groupsModel+ updateGroupTypesMetadata: (payload: Array<GroupType>) => Array<GroupType> // groupsModel+ reset: () => {+ value: true+ }+ save: () => {+ value: true+ }+ setPlural: (+ groupTypeIndex: number,+ value: string+ ) => {+ groupTypeIndex: number+ value: string+ }+ setSingular: (+ groupTypeIndex: number,+ value: string+ ) => {+ groupTypeIndex: number+ value: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface groupAnalyticsConfigLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ hasChanges: (+ singularChanges: Record<number, string | undefined>,+ pluralChanges: Record<number, string | undefined>+ ) => boolean+ }+}++export type groupAnalyticsConfigLogicType = MakeLogicType<+ groupAnalyticsConfigLogicValues,+ groupAnalyticsConfigLogicActions,+ Record<string, any>,+ groupAnalyticsConfigLogicMeta+>export const groupAnalyticsConfigLogic = kea<groupAnalyticsConfigLogicType>([path(['scenes', 'project', 'Settings', 'groupAnalyticsConfigLogic']),@@ -37,7 +90,7 @@ export const groupAnalyticsConfigLogic = kea<groupAnalyticsConfigLogicType>([selectors({hasChanges: [(s) => [s.singularChanges, s.pluralChanges],- (singularChanges, pluralChanges) =>+ (singularChanges: Record<number, string | undefined>, pluralChanges: Record<number, string | undefined>) =>Object.keys(singularChanges).length > 0 || Object.keys(pluralChanges).length > 0,],}),diff --git a/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.ts b/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.tsindex f315d0185002..fded41d35a1c 100644--- a/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.ts+++ b/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.ts@@ -1,17 +1,70 @@-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 api from 'lib/api'import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'import { teamLogic } from 'scenes/teamLogic'-import type { jsSnippetVersionPinLogicType } from './jsSnippetVersionPinLogicType'-export interface VersionPinResponse {requested_version: string | nullresolved_version: string | null}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface jsSnippetVersionPinLogicValues {+ localPin: string+ versionPinResponse: VersionPinResponse | null+ versionPinResponseLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface jsSnippetVersionPinLogicActions {+ loadVersionPin: () => any+ loadVersionPinFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadVersionPinSuccess: (+ versionPinResponse: VersionPinResponse | null,+ payload?: any+ ) => {+ versionPinResponse: VersionPinResponse | null+ payload?: any+ }+ saveVersionPin: ({ pin }: { pin: string | null }) => {+ pin: string | null+ }+ saveVersionPinFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ saveVersionPinSuccess: (+ versionPinResponse: VersionPinResponse | null,+ payload?: {+ pin: string | null+ }+ ) => {+ versionPinResponse: VersionPinResponse | null+ payload?: {+ pin: string | null+ }+ }+ setLocalPin: (localPin: string) => {+ localPin: string+ }+}++export type jsSnippetVersionPinLogicType = MakeLogicType<+ jsSnippetVersionPinLogicValues,+ jsSnippetVersionPinLogicActions+>+export const jsSnippetVersionPinLogic = kea<jsSnippetVersionPinLogicType>([path(['scenes', 'settings', 'environment', 'jsSnippetVersionPinLogic']),actions({diff --git a/frontend/src/scenes/settings/environment/maxSettingsLogic.tsx b/frontend/src/scenes/settings/environment/maxSettingsLogic.tsxindex 915fb984752c..c7ed7690d9b9 100644--- a/frontend/src/scenes/settings/environment/maxSettingsLogic.tsx+++ b/frontend/src/scenes/settings/environment/maxSettingsLogic.tsx@@ -1,5 +1,6 @@-import { actions, afterMount, kea, listeners, path, reducers } from 'kea'+import { MakeLogicType, actions, afterMount, 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 api from 'lib/api'@@ -8,12 +9,104 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'import { CoreMemory } from '~/types'-import type { maxSettingsLogicType } from './maxSettingsLogicType'-export type CoreMemoryForm = {text: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface maxSettingsLogicValues {+ coreMemory: CoreMemory | null+ coreMemoryForm: CoreMemoryForm+ coreMemoryFormAllErrors: Record<string, any>+ coreMemoryFormChanged: boolean+ coreMemoryFormErrors: DeepPartialMap<CoreMemoryForm, ValidationErrorType>+ coreMemoryFormHasErrors: boolean+ coreMemoryFormManualErrors: Record<string, any>+ coreMemoryFormTouched: boolean+ coreMemoryFormTouches: Record<string, boolean>+ coreMemoryFormValidationErrors: DeepPartialMap<CoreMemoryForm, ValidationErrorType>+ coreMemoryLoading: boolean+ isCoreMemoryFormSubmitting: boolean+ isCoreMemoryFormValid: boolean+ isLoading: boolean+ isUpdating: boolean+ showCoreMemoryFormErrors: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface maxSettingsLogicActions {+ loadCoreMemory: () => any+ loadCoreMemoryFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCoreMemorySuccess: (+ coreMemory: CoreMemory | null,+ payload?: any+ ) => {+ coreMemory: CoreMemory | null+ payload?: any+ }+ resetCoreMemoryForm: (values?: CoreMemoryForm) => {+ values?: CoreMemoryForm+ }+ setCoreMemoryFormManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setCoreMemoryFormValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setCoreMemoryFormValues: (values: DeepPartial<CoreMemoryForm>) => {+ values: DeepPartial<CoreMemoryForm>+ }+ setIsLoading: (isLoading: boolean) => {+ isLoading: boolean+ }+ submitCoreMemoryForm: () => {+ value: boolean+ }+ submitCoreMemoryFormFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitCoreMemoryFormRequest: (coreMemoryForm: CoreMemoryForm) => {+ coreMemoryForm: CoreMemoryForm+ }+ submitCoreMemoryFormSuccess: (coreMemoryForm: CoreMemoryForm) => {+ coreMemoryForm: CoreMemoryForm+ }+ touchCoreMemoryFormField: (key: string) => {+ key: string+ }+ updateCoreMemory: (data: CoreMemoryForm) => CoreMemoryForm+ updateCoreMemoryFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ updateCoreMemorySuccess: (+ coreMemory: CoreMemory,+ payload?: CoreMemoryForm+ ) => {+ coreMemory: CoreMemory+ payload?: CoreMemoryForm+ }+}++export type maxSettingsLogicType = MakeLogicType<maxSettingsLogicValues, maxSettingsLogicActions>+export const maxSettingsLogic = kea<maxSettingsLogicType>([path(['scenes', 'project', 'Settings', 'maxSettingsLogic']),diff --git a/frontend/src/scenes/settings/environment/proxyLogic.ts b/frontend/src/scenes/settings/environment/proxyLogic.tsindex 07d76f61290e..f55061092816 100644--- a/frontend/src/scenes/settings/environment/proxyLogic.ts+++ b/frontend/src/scenes/settings/environment/proxyLogic.ts@@ -1,6 +1,7 @@import { isFreeEmail } from 'bloommx'-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 { LemonDialog } from '@posthog/lemon-ui'@@ -16,8 +17,6 @@ import { userLogic } from 'scenes/userLogic'import { UserType } from '~/types'-import type { proxyLogicType } from './proxyLogicType'-export type ProxyRecord = {id: stringdomain: string@@ -108,6 +107,245 @@ function initialDomainFor(user: UserType | null): string {return `${subdomain}.${domain}`}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface proxyLogicValues {+ currentOrganizationId: string // organizationLogic+ user: UserType | null // userLogic+ cloudflareOptInAcknowledged: boolean+ cloudflareOptInChecked: boolean+ createRecord: {+ domain: string+ }+ createRecordAllErrors: Record<string, any>+ createRecordChanged: boolean+ createRecordErrors: DeepPartialMap<+ {+ domain: string+ },+ ValidationErrorType+ >+ createRecordHasErrors: boolean+ createRecordManualErrors: Record<string, any>+ createRecordTouched: boolean+ createRecordTouches: Record<string, boolean>+ createRecordValidationErrors: DeepPartialMap<+ {+ domain: string+ },+ ValidationErrorType+ >+ diagnoseLoadingIds: string[]+ diagnosticReports: Record<string, DiagnosticReport>+ expandedRecordIds: string[]+ formState: FormState+ isCreateRecordSubmitting: boolean+ isCreateRecordValid: boolean+ maxProxyRecords: number+ proxyRecords: ProxyRecord[]+ proxyRecordsLoaded: boolean+ proxyRecordsLoading: boolean+ recordActiveTabs: Record<string, string>+ shouldRefreshRecords: boolean+ shouldShowCloudflareOptIn: boolean+ showCreateRecordErrors: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface proxyLogicActions {+ acknowledgeCloudflareOptIn: () => {+ value: true+ }+ clearDiagnosticReport: (id: ProxyRecord['id']) => {+ id: string+ }+ collapseForm: () => {+ value: true+ }+ createRecord: ({ domain }: { domain: string }) => {+ domain: string+ }+ createRecordFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ createRecordSuccess: (+ proxyRecords: any[],+ payload?: {+ domain: string+ }+ ) => {+ proxyRecords: any[]+ payload?: {+ domain: string+ }+ }+ deleteRecord: (id: ProxyRecord['id']) => ProxyRecord[]+ deleteRecordFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteRecordSuccess: (+ proxyRecords: {+ domain: string+ id: string+ message?: string | undefined+ status: 'deleting' | 'erroring' | 'issuing' | 'timed_out' | 'valid' | 'waiting' | 'warning'+ target_cname: string+ }[],+ payload?: ProxyRecord[]+ ) => {+ proxyRecords: {+ domain: string+ id: string+ message?: string | undefined+ status: 'deleting' | 'erroring' | 'issuing' | 'timed_out' | 'valid' | 'waiting' | 'warning'+ target_cname: string+ }[]+ payload?: ProxyRecord[]+ }+ diagnose: (id: ProxyRecord['id']) => {+ id: string+ }+ diagnoseFailure: (+ id: ProxyRecord['id'],+ error: string+ ) => {+ error: string+ id: string+ }+ diagnoseSuccess: (+ id: ProxyRecord['id'],+ report: DiagnosticReport+ ) => {+ id: string+ report: DiagnosticReport+ }+ loadRecords: () => any+ loadRecordsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadRecordsSuccess: (+ proxyRecords: ProxyRecord[],+ payload?: any+ ) => {+ proxyRecords: ProxyRecord[]+ payload?: any+ }+ maybeRefreshRecords: () => {+ value: true+ }+ resetCreateRecord: (values?: { domain: string }) => {+ values?: {+ domain: string+ }+ }+ retryRecord: (id: ProxyRecord['id']) => ProxyRecord[]+ retryRecordFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ retryRecordSuccess: (+ proxyRecords: ProxyRecord[],+ payload?: ProxyRecord[]+ ) => {+ proxyRecords: ProxyRecord[]+ payload?: ProxyRecord[]+ }+ setCloudflareOptInChecked: (checked: boolean) => {+ checked: boolean+ }+ setCreateRecordManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setCreateRecordValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setCreateRecordValues: (+ values: DeepPartial<{+ domain: string+ }>+ ) => {+ values: DeepPartial<{+ domain: string+ }>+ }+ setMaxProxyRecords: (maxProxyRecords: number) => {+ maxProxyRecords: number+ }+ setRecordActiveTab: (+ id: ProxyRecord['id'],+ tab: string+ ) => {+ id: string+ tab: string+ }+ setRecordExpanded: (+ id: ProxyRecord['id'],+ expanded: boolean+ ) => {+ expanded: boolean+ id: string+ }+ showForm: () => {+ value: true+ }+ submitCreateRecord: () => {+ value: boolean+ }+ submitCreateRecordFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitCreateRecordRequest: (createRecord: { domain: string }) => {+ createRecord: {+ domain: string+ }+ }+ submitCreateRecordSuccess: (createRecord: { domain: string }) => {+ createRecord: {+ domain: string+ }+ }+ touchCreateRecordField: (key: string) => {+ key: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface proxyLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ shouldRefreshRecords: (proxyRecords: ProxyRecord[]) => boolean+ shouldShowCloudflareOptIn: (+ cloudflareOptInAcknowledged: boolean,+ proxyRecordsLoaded: boolean,+ proxyRecords: ProxyRecord[],+ user: UserType | null+ ) => boolean+ }+}++export type proxyLogicType = MakeLogicType<proxyLogicValues, proxyLogicActions, Record<string, any>, proxyLogicMeta>+export const proxyLogic = kea<proxyLogicType>([path(['scenes', 'project', 'Settings', 'proxyLogic']),connect(() => ({@@ -238,7 +476,7 @@ export const proxyLogic = kea<proxyLogicType>([selectors(() => ({shouldRefreshRecords: [(s) => [s.proxyRecords],- (proxyRecords) => {+ (proxyRecords: ProxyRecord[]) => {return proxyRecords.some((r) => ['waiting', 'issuing', 'deleting'].includes(r.status))},],diff --git a/frontend/src/scenes/settings/environment/replayTriggersLogic.ts b/frontend/src/scenes/settings/environment/replayTriggersLogic.tsindex 534b3ef0a36a..4126966ac11d 100644--- a/frontend/src/scenes/settings/environment/replayTriggersLogic.ts+++ b/frontend/src/scenes/settings/environment/replayTriggersLogic.ts@@ -1,5 +1,7 @@-import { actions, connect, kea, listeners, path, reducers, selectors, sharedListeners } from 'kea'+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors, sharedListeners } from 'kea'+import type { BreakPointFunction } from 'kea'import { forms } from 'kea-forms'+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'import { actionToUrl, router, urlToAction } from 'kea-router'import { subscriptions } from 'kea-subscriptions'@@ -10,7 +12,7 @@ import { teamLogic } from 'scenes/teamLogic'import { TeamPublicType, TeamType } from '~/types'-import type { replayTriggersLogicType } from './replayTriggersLogicType'+import type { AugmentedTeamSdkVersionsInfo } from '../../onboarding/shared/sdkHealth/sdkHealthLogic'export type ReplayPlatform = 'web' | 'mobile'@@ -89,6 +91,286 @@ function ensureAnchored(url: string): string {return `^${url}$`}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface replayTriggersLogicValues {+ augmentedData: AugmentedTeamSdkVersionsInfo // sdkHealthLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ checkUrlBlocklist: string+ checkUrlBlocklistResults: {+ [key: number]: boolean+ }+ checkUrlTrigger: string+ checkUrlTriggerResults: {+ [key: number]: boolean+ }+ editUrlBlocklistIndex: number | null+ editUrlTriggerIndex: number | null+ eventTriggerConfig: string[] | null+ hasOutdatedWebSdk: boolean+ isAddUrlBlocklistConfigFormVisible: boolean+ isAddUrlTriggerConfigFormVisible: boolean+ isProposedUrlBlocklistSubmitting: boolean+ isProposedUrlBlocklistValid: boolean+ isProposedUrlTriggerSubmitting: boolean+ isProposedUrlTriggerValid: boolean+ outdatedWebTraffic: {+ outdatedCount: number+ share: number+ totalCount: number+ }+ proposedUrlBlocklist: UrlTriggerConfig+ proposedUrlBlocklistAllErrors: Record<string, any>+ proposedUrlBlocklistChanged: boolean+ proposedUrlBlocklistErrors: DeepPartialMap<UrlTriggerConfig, ValidationErrorType>+ proposedUrlBlocklistHasErrors: boolean+ proposedUrlBlocklistManualErrors: Record<string, any>+ proposedUrlBlocklistTouched: boolean+ proposedUrlBlocklistTouches: Record<string, boolean>+ proposedUrlBlocklistValidationErrors: DeepPartialMap<UrlTriggerConfig, ValidationErrorType>+ proposedUrlTrigger: UrlTriggerConfig+ proposedUrlTriggerAllErrors: Record<string, any>+ proposedUrlTriggerChanged: boolean+ proposedUrlTriggerErrors: DeepPartialMap<UrlTriggerConfig, ValidationErrorType>+ proposedUrlTriggerHasErrors: boolean+ proposedUrlTriggerManualErrors: Record<string, any>+ proposedUrlTriggerTouched: boolean+ proposedUrlTriggerTouches: Record<string, boolean>+ proposedUrlTriggerValidationErrors: DeepPartialMap<UrlTriggerConfig, ValidationErrorType>+ remoteUrlBlocklistConfig: UrlTriggerConfig[] | undefined+ selectedPlatform: ReplayPlatform+ shouldMinimizeLegacyConditions: boolean+ showProposedUrlBlocklistErrors: boolean+ showProposedUrlTriggerErrors: boolean+ urlBlocklistConfig: UrlTriggerConfig[] | null+ urlBlocklistInputValidationWarning: string | null+ urlBlocklistToEdit: {+ matching: string+ url: string+ }+ urlTriggerConfig: UrlTriggerConfig[] | null+ urlTriggerInputValidationWarning: string | null+ urlTriggerToEdit: {+ matching: string+ url: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface replayTriggersLogicActions {+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType> // teamLogic+ addUrlBlocklist: (urlBlocklistConfig: UrlTriggerConfig) => {+ urlBlocklistConfig: UrlTriggerConfig+ }+ addUrlTrigger: (urlTriggerConfig: UrlTriggerConfig) => {+ urlTriggerConfig: UrlTriggerConfig+ }+ cancelProposingUrlBlocklist: () => {+ value: true+ }+ cancelProposingUrlTrigger: () => {+ value: true+ }+ newUrlBlocklist: () => {+ value: true+ }+ newUrlTrigger: () => {+ value: true+ }+ removeUrlBlocklist: (index: number) => {+ index: number+ }+ removeUrlTrigger: (index: number) => {+ index: number+ }+ resetProposedUrlBlocklist: (values?: UrlTriggerConfig) => {+ values?: UrlTriggerConfig+ }+ resetProposedUrlTrigger: (values?: UrlTriggerConfig) => {+ values?: UrlTriggerConfig+ }+ selectPlatform: (platform: ReplayPlatform) => {+ platform: ReplayPlatform+ }+ setCheckUrlBlocklist: (url: string) => {+ url: string+ }+ setCheckUrlTrigger: (url: string) => {+ url: string+ }+ setEditUrlBlocklistIndex: (originalIndex: number | null) => {+ originalIndex: number | null+ }+ setEditUrlTriggerIndex: (originalIndex: number | null) => {+ originalIndex: number | null+ }+ setEventTriggerConfig: (eventTriggerConfig: string[]) => {+ eventTriggerConfig: string[]+ }+ setProposedUrlBlocklistManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setProposedUrlBlocklistValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setProposedUrlBlocklistValues: (values: DeepPartial<UrlTriggerConfig>) => {+ values: DeepPartial<UrlTriggerConfig>+ }+ setProposedUrlTriggerManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setProposedUrlTriggerValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setProposedUrlTriggerValues: (values: DeepPartial<UrlTriggerConfig>) => {+ values: DeepPartial<UrlTriggerConfig>+ }+ setUrlBlocklistConfig: (urlBlocklistConfig: UrlTriggerConfig[]) => {+ urlBlocklistConfig: UrlTriggerConfig[]+ }+ setUrlTriggerConfig: (urlTriggerConfig: UrlTriggerConfig[]) => {+ urlTriggerConfig: UrlTriggerConfig[]+ }+ submitProposedUrlBlocklist: () => {+ value: boolean+ }+ submitProposedUrlBlocklistFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitProposedUrlBlocklistRequest: (proposedUrlBlocklist: UrlTriggerConfig) => {+ proposedUrlBlocklist: UrlTriggerConfig+ }+ submitProposedUrlBlocklistSuccess: (proposedUrlBlocklist: UrlTriggerConfig) => {+ proposedUrlBlocklist: UrlTriggerConfig+ }+ submitProposedUrlTrigger: () => {+ value: boolean+ }+ submitProposedUrlTriggerFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitProposedUrlTriggerRequest: (proposedUrlTrigger: UrlTriggerConfig) => {+ proposedUrlTrigger: UrlTriggerConfig+ }+ submitProposedUrlTriggerSuccess: (proposedUrlTrigger: UrlTriggerConfig) => {+ proposedUrlTrigger: UrlTriggerConfig+ }+ touchProposedUrlBlocklistField: (key: string) => {+ key: string+ }+ touchProposedUrlTriggerField: (key: string) => {+ key: string+ }+ updateEventTriggerConfig: (eventTriggerConfig: string[]) => {+ eventTriggerConfig: string[]+ }+ updateUrlBlocklist: (+ index: number,+ urlBlocklistConfig: UrlTriggerConfig+ ) => {+ index: number+ urlBlocklistConfig: UrlTriggerConfig+ }+ updateUrlTrigger: (+ index: number,+ urlTriggerConfig: UrlTriggerConfig+ ) => {+ index: number+ urlTriggerConfig: UrlTriggerConfig+ }+ validateUrlInput: (+ url: string,+ type: 'blocklist' | 'trigger'+ ) => {+ type: 'blocklist' | 'trigger'+ url: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface replayTriggersLogicMeta {+ sharedListeners: {+ saveUrlTriggers: (+ payload: any,+ breakpoint: BreakPointFunction,+ action: {+ type: string+ payload: any+ },+ previousState: any+ ) => void | Promise<void>+ saveUrlBlocklists: (+ payload: any,+ breakpoint: BreakPointFunction,+ action: {+ type: string+ payload: any+ },+ previousState: any+ ) => void | Promise<void>+ }+ __keaTypeGenInternalSelectorTypes: {+ shouldMinimizeLegacyConditions: (augmentedData: AugmentedTeamSdkVersionsInfo) => boolean+ hasOutdatedWebSdk: (augmentedData: AugmentedTeamSdkVersionsInfo) => boolean+ outdatedWebTraffic: (augmentedData: AugmentedTeamSdkVersionsInfo) => {+ outdatedCount: number+ share: number+ totalCount: number+ }+ isAddUrlTriggerConfigFormVisible: (editUrlTriggerIndex: number | null) => boolean+ urlTriggerToEdit: (+ urlTriggerConfig: UrlTriggerConfig[] | null,+ editUrlTriggerIndex: number | null+ ) => {+ matching: string+ url: string+ }+ remoteUrlBlocklistConfig: (currentTeam: TeamPublicType | TeamType | null) => UrlTriggerConfig[] | undefined+ isAddUrlBlocklistConfigFormVisible: (editUrlBlocklistIndex: number | null) => boolean+ urlBlocklistToEdit: (+ urlBlocklistConfig: UrlTriggerConfig[] | null,+ editUrlBlocklistIndex: number | null+ ) => {+ matching: string+ url: string+ }+ checkUrlTriggerResults: (+ checkUrlTrigger: string,+ urlTriggerConfig: UrlTriggerConfig[] | null+ ) => {+ [key: number]: boolean+ }+ checkUrlBlocklistResults: (+ checkUrlBlocklist: string,+ urlBlocklistConfig: UrlTriggerConfig[] | null+ ) => {+ [key: number]: boolean+ }+ }+}++export type replayTriggersLogicType = MakeLogicType<+ replayTriggersLogicValues,+ replayTriggersLogicActions,+ Record<string, any>,+ replayTriggersLogicMeta+>+export const replayTriggersLogic = kea<replayTriggersLogicType>([path(['scenes', 'settings', 'project', 'replayTriggersLogic']),actions({@@ -248,24 +530,30 @@ export const replayTriggersLogic = kea<replayTriggersLogicType>([selectors({shouldMinimizeLegacyConditions: [(s) => [s.augmentedData],- (augmentedData): boolean => legacyConditionsAreInactive(augmentedData?.web?.allReleases ?? []),+ (+ augmentedData: import('scenes/onboarding/shared/sdkHealth/sdkHealthLogic').AugmentedTeamSdkVersionsInfo+ ): boolean => legacyConditionsAreInactive(augmentedData?.web?.allReleases ?? []),],hasOutdatedWebSdk: [(s) => [s.augmentedData],- (augmentedData): boolean => hasOutdatedWebSdk(augmentedData?.web?.allReleases ?? []),+ (+ augmentedData: import('scenes/onboarding/shared/sdkHealth/sdkHealthLogic').AugmentedTeamSdkVersionsInfo+ ): boolean => hasOutdatedWebSdk(augmentedData?.web?.allReleases ?? []),],outdatedWebTraffic: [(s) => [s.augmentedData],- (augmentedData): { outdatedCount: number; totalCount: number; share: number } =>+ (+ augmentedData: import('scenes/onboarding/shared/sdkHealth/sdkHealthLogic').AugmentedTeamSdkVersionsInfo+ ): { outdatedCount: number; totalCount: number; share: number } =>outdatedWebTrafficShare(augmentedData?.web?.allReleases ?? []),],isAddUrlTriggerConfigFormVisible: [(s) => [s.editUrlTriggerIndex],- (editUrlTriggerIndex) => editUrlTriggerIndex === -1,+ (editUrlTriggerIndex: number | null) => editUrlTriggerIndex === -1,],urlTriggerToEdit: [(s) => [s.urlTriggerConfig, s.editUrlTriggerIndex],- (urlTriggerConfig, editUrlTriggerIndex) => {+ (urlTriggerConfig: UrlTriggerConfig[] | null, editUrlTriggerIndex: number | null) => {if (editUrlTriggerIndex === null ||editUrlTriggerIndex === -1 ||@@ -279,15 +567,15 @@ export const replayTriggersLogic = kea<replayTriggersLogicType>([remoteUrlBlocklistConfig: [(s) => [s.currentTeam],- (currentTeam) => currentTeam?.session_recording_url_blocklist_config,+ (currentTeam: TeamPublicType | TeamType | null) => currentTeam?.session_recording_url_blocklist_config,],isAddUrlBlocklistConfigFormVisible: [(s) => [s.editUrlBlocklistIndex],- (editUrlBlocklistIndex) => editUrlBlocklistIndex === -1,+ (editUrlBlocklistIndex: number | null) => editUrlBlocklistIndex === -1,],urlBlocklistToEdit: [(s) => [s.urlBlocklistConfig, s.editUrlBlocklistIndex],- (urlBlocklistConfig, editUrlBlocklistIndex) => {+ (urlBlocklistConfig: UrlTriggerConfig[] | null, editUrlBlocklistIndex: number | null) => {if (editUrlBlocklistIndex === null ||editUrlBlocklistIndex === -1 ||@@ -301,7 +589,7 @@ export const replayTriggersLogic = kea<replayTriggersLogicType>([checkUrlTriggerResults: [(s) => [s.checkUrlTrigger, s.urlTriggerConfig],- (checkUrl, urlTriggerConfig): { [key: number]: boolean } => {+ (checkUrl: string, urlTriggerConfig: UrlTriggerConfig[] | null): { [key: number]: boolean } => {if (!checkUrl.trim() || !urlTriggerConfig) {return {}}@@ -321,7 +609,7 @@ export const replayTriggersLogic = kea<replayTriggersLogicType>([checkUrlBlocklistResults: [(s) => [s.checkUrlBlocklist, s.urlBlocklistConfig],- (checkUrl, urlBlocklistConfig): { [key: number]: boolean } => {+ (checkUrl: string, urlBlocklistConfig: UrlTriggerConfig[] | null): { [key: number]: boolean } => {if (!checkUrl.trim() || !urlBlocklistConfig) {return {}}diff --git a/frontend/src/scenes/settings/environment/usageMetricsConfigLogic.ts b/frontend/src/scenes/settings/environment/usageMetricsConfigLogic.tsindex 7e1b41e9f9b1..a27cb7e32149 100644--- a/frontend/src/scenes/settings/environment/usageMetricsConfigLogic.ts+++ b/frontend/src/scenes/settings/environment/usageMetricsConfigLogic.ts@@ -1,5 +1,6 @@-import { actions, connect, kea, key, listeners, path, props, reducers } from 'kea'+import { MakeLogicType, actions, connect, kea, key, listeners, path, props, reducers } from 'kea'import { forms } from 'kea-forms'+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'import { lazyLoaders } from 'kea-loaders'import { eventUsageLogic } from 'lib/utils/eventUsageLogic'@@ -17,7 +18,7 @@ import {} from 'products/customer_analytics/frontend/generated/api'import type { GroupUsageMetricApi } from 'products/customer_analytics/frontend/generated/api.schemas'-import type { usageMetricsConfigLogicType } from './usageMetricsConfigLogicType'+import type { ProductIntentProperties } from '../../../lib/utils/product-intents'export type UsageMetricSource = 'events' | 'data_warehouse'@@ -119,6 +120,165 @@ export interface UsageMetricsConfigLogicProps {logicKey?: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface usageMetricsConfigLogicValues {+ currentProjectId: number | null // projectLogic+ isModalOpen: boolean+ isUsageMetricSubmitting: boolean+ isUsageMetricValid: boolean+ showUsageMetricErrors: boolean+ usageMetric: UsageMetricFormData+ usageMetricAllErrors: Record<string, any>+ usageMetricChanged: boolean+ usageMetricErrors: DeepPartialMap<UsageMetricFormData, ValidationErrorType>+ usageMetricHasErrors: boolean+ usageMetricManualErrors: Record<string, any>+ usageMetricTouched: boolean+ usageMetricTouches: Record<string, boolean>+ usageMetricValidationErrors: DeepPartialMap<UsageMetricFormData, ValidationErrorType>+ usageMetrics: GroupUsageMetricApi[]+ usageMetricsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface usageMetricsConfigLogicActions {+ reportUsageMetricCreated: () => boolean // eventUsageLogic+ reportUsageMetricDeleted: () => boolean // eventUsageLogic+ reportUsageMetricUpdated: () => boolean // eventUsageLogic+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic+ addUsageMetric: (metric: UsageMetricFormData) => {+ metric: UsageMetricFormData+ }+ addUsageMetricFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ addUsageMetricSuccess: (+ usageMetrics: GroupUsageMetricApi[],+ payload?: {+ metric: UsageMetricFormData+ }+ ) => {+ usageMetrics: GroupUsageMetricApi[]+ payload?: {+ metric: UsageMetricFormData+ }+ }+ closeModal: () => {+ value: true+ }+ loadUsageMetrics: () => any+ loadUsageMetricsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadUsageMetricsSuccess: (+ usageMetrics: GroupUsageMetricApi[],+ payload?: any+ ) => {+ usageMetrics: GroupUsageMetricApi[]+ payload?: any+ }+ openModal: () => {+ value: true+ }+ removeUsageMetric: (id: string) => {+ id: string+ }+ removeUsageMetricFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ removeUsageMetricSuccess: (+ usageMetrics: GroupUsageMetricApi[],+ payload?: {+ id: string+ }+ ) => {+ usageMetrics: GroupUsageMetricApi[]+ payload?: {+ id: string+ }+ }+ resetUsageMetric: (values?: UsageMetricFormData) => {+ values?: UsageMetricFormData+ }+ setUsageMetricManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setUsageMetricValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setUsageMetricValues: (values: DeepPartial<UsageMetricFormData>) => {+ values: DeepPartial<UsageMetricFormData>+ }+ submitUsageMetric: () => {+ value: boolean+ }+ submitUsageMetricFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitUsageMetricRequest: (usageMetric: UsageMetricFormData) => {+ usageMetric: UsageMetricFormData+ }+ submitUsageMetricSuccess: (usageMetric: UsageMetricFormData) => {+ usageMetric: UsageMetricFormData+ }+ touchUsageMetricField: (key: string) => {+ key: string+ }+ updateUsageMetric: (metric: UsageMetricFormData) => {+ metric: UsageMetricFormData+ }+ updateUsageMetricFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ updateUsageMetricSuccess: (+ usageMetrics: GroupUsageMetricApi[],+ payload?: {+ metric: UsageMetricFormData+ }+ ) => {+ usageMetrics: GroupUsageMetricApi[]+ payload?: {+ metric: UsageMetricFormData+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface usageMetricsConfigLogicMeta {+ key: string+}++export type usageMetricsConfigLogicType = MakeLogicType<+ usageMetricsConfigLogicValues,+ usageMetricsConfigLogicActions,+ UsageMetricsConfigLogicProps,+ usageMetricsConfigLogicMeta+>+export const usageMetricsConfigLogic = kea<usageMetricsConfigLogicType>([path(['scenes', 'settings', 'environment', 'usageMetricsConfigLogic']),props({} as UsageMetricsConfigLogicProps),diff --git a/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsx b/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsxindex a0a0d1596dc7..0d16ce4fb173 100644--- a/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsx+++ b/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsx@@ -1,4 +1,4 @@-import { actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path, reducers } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'@@ -8,7 +8,52 @@ import { userLogic } from 'scenes/userLogic'import { ApprovalPolicy, AvailableFeature } from '~/types'-import type { approvalPoliciesLogicType } from './approvalPoliciesLogicType'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface approvalPoliciesLogicValues {+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic+ policies: ApprovalPolicy[]+ policiesLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface approvalPoliciesLogicActions {+ createPolicy: (policy: Partial<ApprovalPolicy>) => {+ policy: Partial<ApprovalPolicy>+ }+ deletePolicy: (id: string) => {+ id: string+ }+ loadPolicies: () => {+ value: true+ }+ loadPoliciesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPoliciesSuccess: (+ policies: ApprovalPolicy[],+ payload?: {+ value: true+ }+ ) => {+ policies: ApprovalPolicy[]+ payload?: {+ value: true+ }+ }+ updatePolicy: (+ id: string,+ policy: Partial<ApprovalPolicy>+ ) => {+ id: string+ policy: Partial<ApprovalPolicy>+ }+}++export type approvalPoliciesLogicType = MakeLogicType<approvalPoliciesLogicValues, approvalPoliciesLogicActions>export const approvalPoliciesLogic = kea<approvalPoliciesLogicType>([path(['scenes', 'settings', 'organization', 'Approvals', 'approvalPoliciesLogic']),diff --git a/frontend/src/scenes/settings/organization/Permissions/Roles/rolesLogic.tsx b/frontend/src/scenes/settings/organization/Permissions/Roles/rolesLogic.tsxindex 5d012c77eb40..42316386c33c 100644--- a/frontend/src/scenes/settings/organization/Permissions/Roles/rolesLogic.tsx+++ b/frontend/src/scenes/settings/organization/Permissions/Roles/rolesLogic.tsx@@ -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 api from 'lib/api'@@ -7,7 +7,144 @@ import { membersLogic } from 'scenes/organization/membersLogic'import { RoleMemberType, RoleType, UserBasicType } from '~/types'-import type { rolesLogicType } from './rolesLogicType'+import type { OrganizationMemberType } from '../../../../../types'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface rolesLogicValues {+ members: OrganizationMemberType[] | null // membersLogic+ addableMembers: UserBasicType[]+ createRoleModalShown: boolean+ roleInFocus: RoleType | null+ roleMembersInFocus: RoleMemberType[]+ roleMembersInFocusLoading: boolean+ roleMembersToAdd: string[]+ roles: RoleType[]+ rolesLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface rolesLogicActions {+ addRoleMembers: ({ role, membersToAdd }: any) => any+ addRoleMembersFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ addRoleMembersSuccess: (+ roleMembersInFocus: any[],+ payload?: any+ ) => {+ roleMembersInFocus: any[]+ payload?: any+ }+ createRole: (roleName: string) => string+ createRoleFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ createRoleSuccess: (+ roles: RoleType[],+ payload?: string+ ) => {+ roles: RoleType[]+ payload?: string+ }+ deleteRole: (role: RoleType) => RoleType+ deleteRoleFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteRoleMember: ({ roleMemberUuid }: any) => any+ deleteRoleMemberFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteRoleMemberSuccess: (+ roleMembersInFocus: RoleMemberType[],+ payload?: any+ ) => {+ roleMembersInFocus: RoleMemberType[]+ payload?: any+ }+ deleteRoleSuccess: (+ roles: RoleType[],+ payload?: RoleType+ ) => {+ roles: RoleType[]+ payload?: RoleType+ }+ loadRoleMembers: ({ roleId }: any) => any+ loadRoleMembersFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadRoleMembersSuccess: (+ roleMembersInFocus: RoleMemberType[],+ payload?: any+ ) => {+ roleMembersInFocus: RoleMemberType[]+ payload?: any+ }+ loadRoles: () => any+ loadRolesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadRolesSuccess: (+ roles: RoleType[],+ payload?: any+ ) => {+ roles: RoleType[]+ payload?: any+ }+ openCreateRoleModal: () => {+ value: true+ }+ setCreateRoleModalShown: (shown: boolean) => {+ shown: boolean+ }+ setRoleInFocus: (role: RoleType | null) => {+ role: RoleType | null+ }+ setRoleMembersInFocus: (roleMembers: RoleMemberType[]) => {+ roleMembers: RoleMemberType[]+ }+ setRoleMembersToAdd: (uuids: string[]) => {+ uuids: string[]+ }+ updateRole: (role: RoleType) => {+ role: RoleType+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface rolesLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ addableMembers: (+ members: OrganizationMemberType[] | null,+ roleMembersInFocus: RoleMemberType[]+ ) => UserBasicType[]+ }+}++export type rolesLogicType = MakeLogicType<rolesLogicValues, rolesLogicActions, Record<string, any>, rolesLogicMeta>export const rolesLogic = kea<rolesLogicType>([path(['scenes', 'organization', 'rolesLogic']),@@ -113,7 +250,10 @@ export const rolesLogic = kea<rolesLogicType>([selectors({addableMembers: [(s) => [s.members, s.roleMembersInFocus],- (members, roleMembersInFocus): UserBasicType[] => {+ (+ members: import('~/types').OrganizationMemberType[] | null,+ roleMembersInFocus: RoleMemberType[]+ ): UserBasicType[] => {const addableMembers: UserBasicType[] = []for (const member of members || []) {if (diff --git a/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.ts b/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.tsindex f2ceaa10c1a9..61f40aaffd7f 100644--- a/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.ts+++ b/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.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 api from 'lib/api'@@ -19,8 +20,6 @@ import {import { IdentityProviderConfigApi } from '~/generated/core/api.schemas'import { AvailableFeature, OrganizationDomainType, PaginatedSCIMRequestLogs } from '~/types'-import type { verifiedDomainsLogicType } from './verifiedDomainsLogicType'-/*** Resolve the `IdentityProviderConfig` id that backs a domain, creating and linking an empty* config first if the domain doesn't have one yet. The config is the sole read/write interface@@ -96,6 +95,535 @@ export const isSecureURL = (url: string): boolean => {}}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface verifiedDomainsLogicValues {+ currentOrganizationId: string // organizationLogic+ addModalShown: boolean+ configureIdJagModalId: string | null+ configureSAMLModalId: string | null+ configureSCIMModalId: string | null+ domainBeingVerified: OrganizationDomainType | null+ idJagConfig: Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ idJagConfigAllErrors: Record<string, any>+ idJagConfigChanged: boolean+ idJagConfigErrors: DeepPartialMap<+ Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >,+ ValidationErrorType+ >+ idJagConfigHasErrors: boolean+ idJagConfigManualErrors: Record<string, any>+ idJagConfigTouched: boolean+ idJagConfigTouches: Record<string, boolean>+ idJagConfigValidationErrors: DeepPartialMap<+ Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >,+ ValidationErrorType+ >+ isIdJagConfigSubmitting: boolean+ isIdJagConfigValid: boolean+ isSAMLAvailable: boolean+ isSCIMAvailable: boolean+ isSSOEnforcementAvailable: boolean+ isSamlConfigSubmitting: boolean+ isSamlConfigValid: boolean+ isXAAAuthenticationAvailable: boolean+ samlConfig: Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ samlConfigAllErrors: Record<string, any>+ samlConfigChanged: boolean+ samlConfigErrors: DeepPartialMap<+ Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >,+ ValidationErrorType+ >+ samlConfigHasErrors: boolean+ samlConfigManualErrors: Record<string, any>+ samlConfigTouched: boolean+ samlConfigTouches: Record<string, boolean>+ samlConfigValidationErrors: DeepPartialMap<+ Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >,+ ValidationErrorType+ >+ scimConfig: SCIMConfigType+ scimConfigLoading: boolean+ scimLogs: PaginatedSCIMRequestLogs | null+ scimLogsLoading: boolean+ scimLogsModalId: string | null+ scimLogsPage: number+ scimLogsSearch: string+ scimLogsStatusFilter: '4xx' | '5xx' | 'all' | 'success'+ showIdJagConfigErrors: boolean+ showSamlConfigErrors: boolean+ updatingDomain: boolean+ updatingDomainLoading: boolean+ verifiedDomains: OrganizationDomainType[]+ verifiedDomainsLoading: boolean+ verifyModal: string | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface verifiedDomainsLogicActions {+ addVerifiedDomain: (domain: string) => string+ addVerifiedDomainFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ addVerifiedDomainSuccess: (+ verifiedDomains: OrganizationDomainType[],+ payload?: string+ ) => {+ verifiedDomains: OrganizationDomainType[]+ payload?: string+ }+ deleteVerifiedDomain: (id: string) => string+ deleteVerifiedDomainFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteVerifiedDomainSuccess: (+ verifiedDomains: OrganizationDomainType[],+ payload?: string+ ) => {+ verifiedDomains: OrganizationDomainType[]+ payload?: string+ }+ disableScim: (domainId: string) => string+ disableScimFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ disableScimSuccess: (+ scimConfig: Partial<+ Pick<IdentityProviderConfigApi, 'scim_bearer_token' | 'scim_enabled'> & {+ id: string+ scim_base_url: string | null+ }+ >,+ payload?: string+ ) => {+ scimConfig: Partial<+ Pick<IdentityProviderConfigApi, 'scim_bearer_token' | 'scim_enabled'> & {+ id: string+ scim_base_url: string | null+ }+ >+ payload?: string+ }+ enableScim: (domainId: string) => string+ enableScimFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ enableScimSuccess: (+ scimConfig: Partial<+ Pick<IdentityProviderConfigApi, 'scim_bearer_token' | 'scim_enabled'> & {+ id: string+ scim_base_url: string | null+ }+ >,+ payload?: string+ ) => {+ scimConfig: Partial<+ Pick<IdentityProviderConfigApi, 'scim_bearer_token' | 'scim_enabled'> & {+ id: string+ scim_base_url: string | null+ }+ >+ payload?: string+ }+ hideAddDomainModal: () => {+ value: true+ }+ loadScimConfig: (domainId: string) => string+ loadScimConfigFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadScimConfigSuccess: (+ scimConfig: {+ id: string+ scim_base_url: string | undefined+ scim_enabled: boolean+ },+ payload?: string+ ) => {+ scimConfig: {+ id: string+ scim_base_url: string | undefined+ scim_enabled: boolean+ }+ payload?: string+ }+ loadScimLogs: ({ domainId, page }: { domainId: string; page?: number }) => {+ domainId: string+ page?: number+ }+ loadScimLogsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadScimLogsSuccess: (+ scimLogs: PaginatedSCIMRequestLogs | null,+ payload?: {+ domainId: string+ page?: number+ }+ ) => {+ scimLogs: PaginatedSCIMRequestLogs | null+ payload?: {+ domainId: string+ page?: number+ }+ }+ loadVerifiedDomains: () => any+ loadVerifiedDomainsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadVerifiedDomainsSuccess: (+ verifiedDomains: OrganizationDomainType[],+ payload?: any+ ) => {+ verifiedDomains: OrganizationDomainType[]+ payload?: any+ }+ regenerateScimToken: (domainId: string) => string+ regenerateScimTokenFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ regenerateScimTokenSuccess: (+ scimConfig: Partial<+ Pick<IdentityProviderConfigApi, 'scim_bearer_token' | 'scim_enabled'> & {+ id: string+ scim_base_url: string | null+ }+ >,+ payload?: string+ ) => {+ scimConfig: Partial<+ Pick<IdentityProviderConfigApi, 'scim_bearer_token' | 'scim_enabled'> & {+ id: string+ scim_base_url: string | null+ }+ >+ payload?: string+ }+ reloadScimLogs: () => {+ value: true+ }+ replaceDomain: (domain: OrganizationDomainType) => {+ domain: OrganizationDomainType+ }+ resetIdJagConfig: (+ values?: Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ ) => {+ values?: Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ }+ resetSamlConfig: (+ values?: Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ ) => {+ values?: Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ }+ setConfigureIdJagModalId: (id: string | null) => {+ id: string | null+ }+ setConfigureSAMLModalId: (id: string | null) => {+ id: string | null+ }+ setConfigureSCIMModalId: (id: string | null) => {+ id: string | null+ }+ setIdJagConfigManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setIdJagConfigValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setIdJagConfigValues: (+ values: DeepPartial<+ Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ >+ ) => {+ values: DeepPartial<+ Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ >+ }+ setSamlConfigManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setSamlConfigValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setSamlConfigValues: (+ values: DeepPartial<+ Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ >+ ) => {+ values: DeepPartial<+ Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ >+ }+ setScimLogsModalId: (id: string | null) => {+ id: string | null+ }+ setScimLogsModalIdFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setScimLogsModalIdSuccess: (+ scimLogs: null,+ payload?: {+ id: string | null+ }+ ) => {+ scimLogs: null+ payload?: {+ id: string | null+ }+ }+ setScimLogsPage: (page: number) => {+ page: number+ }+ setScimLogsSearch: (search: string) => {+ search: string+ }+ setScimLogsStatusFilter: (filter: '4xx' | '5xx' | 'all' | 'success') => {+ filter: '4xx' | '5xx' | 'all' | 'success'+ }+ setVerifyModal: (id: string | null) => {+ id: string | null+ }+ showAddDomainModal: () => {+ value: true+ }+ submitIdJagConfig: () => {+ value: boolean+ }+ submitIdJagConfigFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitIdJagConfigRequest: (+ idJagConfig: Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ ) => {+ idJagConfig: Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ }+ submitIdJagConfigSuccess: (+ idJagConfig: Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ ) => {+ idJagConfig: Partial<+ Pick<IdentityProviderConfigApi, 'id_jag_allowed_clients' | 'id_jag_issuer_url' | 'id_jag_jwks_url'> & {+ id: string+ }+ >+ }+ submitSamlConfig: () => {+ value: boolean+ }+ submitSamlConfigFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitSamlConfigRequest: (+ samlConfig: Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ ) => {+ samlConfig: Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ }+ submitSamlConfigSuccess: (+ samlConfig: Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ ) => {+ samlConfig: Partial<+ Pick<IdentityProviderConfigApi, 'saml_acs_url' | 'saml_entity_id' | 'saml_x509_cert'> & {+ id: string+ }+ >+ }+ touchIdJagConfigField: (key: string) => {+ key: string+ }+ touchSamlConfigField: (key: string) => {+ key: string+ }+ updateDomain: (payload: OrganizationDomainUpdatePayload) => OrganizationDomainUpdatePayload+ updateDomainFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ updateDomainSuccess: (+ updatingDomain: boolean,+ payload?: OrganizationDomainUpdatePayload+ ) => {+ updatingDomain: boolean+ payload?: OrganizationDomainUpdatePayload+ }+ verifyDomain: () => any+ verifyDomainFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ verifyDomainSuccess: (+ updatingDomain: boolean,+ payload?: any+ ) => {+ updatingDomain: boolean+ payload?: any+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface verifiedDomainsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ domainBeingVerified: (+ verifiedDomains: OrganizationDomainType[],+ verifyModal: string | null+ ) => OrganizationDomainType | null+ isSSOEnforcementAvailable: (+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => boolean+ isSAMLAvailable: (+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => boolean+ isSCIMAvailable: (+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => boolean+ isXAAAuthenticationAvailable: (+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => boolean+ }+}++export type verifiedDomainsLogicType = MakeLogicType<+ verifiedDomainsLogicValues,+ verifiedDomainsLogicActions,+ Record<string, any>,+ verifiedDomainsLogicMeta+>+export const verifiedDomainsLogic = kea<verifiedDomainsLogicType>([path(['scenes', 'organization', 'verifiedDomainsLogic']),connect(() => ({ values: [organizationLogic, ['currentOrganizationId']], logic: [userLogic] })),@@ -407,24 +935,28 @@ export const verifiedDomainsLogic = kea<verifiedDomainsLogicType>([selectors({domainBeingVerified: [(s) => [s.verifiedDomains, s.verifyModal],- (verifiedDomains, verifyingId): OrganizationDomainType | null =>+ (verifiedDomains: OrganizationDomainType[], verifyingId: string | null): OrganizationDomainType | null =>(verifyingId && verifiedDomains.find(({ id }) => id === verifyingId)) || null,],isSSOEnforcementAvailable: [() => [userLogic.selectors.hasAvailableFeature],- (hasAvailableFeature): boolean => hasAvailableFeature(AvailableFeature.SSO_ENFORCEMENT),+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean): boolean =>+ hasAvailableFeature(AvailableFeature.SSO_ENFORCEMENT),],isSAMLAvailable: [() => [userLogic.selectors.hasAvailableFeature],- (hasAvailableFeature): boolean => hasAvailableFeature(AvailableFeature.SAML),+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean): boolean =>+ hasAvailableFeature(AvailableFeature.SAML),],isSCIMAvailable: [() => [userLogic.selectors.hasAvailableFeature],- (hasAvailableFeature): boolean => hasAvailableFeature(AvailableFeature.SCIM),+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean): boolean =>+ hasAvailableFeature(AvailableFeature.SCIM),],isXAAAuthenticationAvailable: [() => [userLogic.selectors.hasAvailableFeature],- (hasAvailableFeature): boolean => hasAvailableFeature(AvailableFeature.XAA_AUTHENTICATION),+ (hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean): boolean =>+ hasAvailableFeature(AvailableFeature.XAA_AUTHENTICATION),],}),afterMount(({ actions }) => actions.loadVerifiedDomains()),diff --git a/frontend/src/scenes/settings/organization/aiConsentLogic.ts b/frontend/src/scenes/settings/organization/aiConsentLogic.tsindex 543141048ab0..44cfa4e795c9 100644--- a/frontend/src/scenes/settings/organization/aiConsentLogic.ts+++ b/frontend/src/scenes/settings/organization/aiConsentLogic.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 { OrganizationMembershipLevel } from 'lib/constants'import { dayjs } from 'lib/dayjs'@@ -7,7 +7,7 @@ import { organizationLogic } from 'scenes/organizationLogic'import { requestAiAccessCreate } from 'products/platform_features/frontend/generated/api'-import type { aiConsentLogicType } from './aiConsentLogicType'+import type { OrganizationType } from '../../../types'// Keep this stored across all projects, only display this once per monthconst AI_DATA_PROCESSING_DISMISSED_STORAGE_KEY = `posthog_ai_data_processing_dismissed_${dayjs().format('YYYY-MM')}`@@ -16,6 +16,55 @@ const AI_DATA_PROCESSING_DISMISSED_STORAGE_KEY = `posthog_ai_data_processing_dis// PostHog AI — so the request button doesn't invite repeated submissions.const AI_ACCESS_REQUESTED_STORAGE_KEY = 'posthog_ai_access_requested_by_org'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface aiConsentLogicValues {+ currentOrganization: OrganizationType | null // organizationLogic+ aiAccessRequested: boolean+ aiAccessRequestedByOrg: Record<string, boolean>+ dataProcessingAccepted: boolean+ dataProcessingApprovalDisabledReason: string | null+ dataProcessingDismissed: boolean+ requestingAiAccess: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface aiConsentLogicActions {+ acceptDataProcessing: (testOnlyOverride?: boolean) => {+ testOnlyOverride: boolean | undefined+ }+ dismissDataProcessing: () => {+ value: true+ }+ markAiAccessRequested: (organizationId: string) => {+ organizationId: string+ }+ requestAiAccess: () => {+ value: true+ }+ requestAiAccessError: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface aiConsentLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ dataProcessingAccepted: (currentOrganization: OrganizationType | null) => boolean+ dataProcessingApprovalDisabledReason: (currentOrganization: OrganizationType | null) => string | null+ aiAccessRequested: (+ aiAccessRequestedByOrg: Record<string, boolean>,+ currentOrganization: OrganizationType | null+ ) => boolean+ }+}++export type aiConsentLogicType = MakeLogicType<+ aiConsentLogicValues,+ aiConsentLogicActions,+ Record<string, any>,+ aiConsentLogicMeta+>+export const aiConsentLogic = kea<aiConsentLogicType>([path(['scenes', 'settings', 'organization', 'aiConsentLogic']),connect(() => ({@@ -79,11 +128,12 @@ export const aiConsentLogic = kea<aiConsentLogicType>([selectors({dataProcessingAccepted: [(s) => [s.currentOrganization],- (currentOrganization): boolean => !!currentOrganization?.is_ai_data_processing_approved,+ (currentOrganization: OrganizationType | null): boolean =>+ !!currentOrganization?.is_ai_data_processing_approved,],dataProcessingApprovalDisabledReason: [(s) => [s.currentOrganization],- (currentOrganization): string | null =>+ (currentOrganization: OrganizationType | null): string | null =>!currentOrganization?.membership_level ||currentOrganization.membership_level < OrganizationMembershipLevel.Admin? `Ask an admin or owner of ${currentOrganization?.name} to approve this`@@ -91,7 +141,7 @@ export const aiConsentLogic = kea<aiConsentLogicType>([],aiAccessRequested: [(s) => [s.aiAccessRequestedByOrg, s.currentOrganization],- (aiAccessRequestedByOrg, currentOrganization): boolean =>+ (aiAccessRequestedByOrg: Record<string, boolean>, currentOrganization: OrganizationType | null): boolean =>!!(currentOrganization && aiAccessRequestedByOrg[currentOrganization.id]),],}),diff --git a/frontend/src/scenes/settings/organization/cimdVerificationTokensLogic.ts b/frontend/src/scenes/settings/organization/cimdVerificationTokensLogic.tsindex a322be68c14d..ce3aa9d0d173 100644--- a/frontend/src/scenes/settings/organization/cimdVerificationTokensLogic.ts+++ b/frontend/src/scenes/settings/organization/cimdVerificationTokensLogic.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 'lib/lemon-ui/LemonToast/LemonToast'@@ -11,11 +11,60 @@ import {} from '~/generated/core/api'import { CIMDVerificationTokenApi, CIMDVerificationTokenWithValueApi } from '~/generated/core/api.schemas'-import type { cimdVerificationTokensLogicType } from './cimdVerificationTokensLogicType'-export type CIMDVerificationToken = CIMDVerificationTokenApiexport type CIMDVerificationTokenWithValue = CIMDVerificationTokenWithValueApi+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cimdVerificationTokensLogicValues {+ isCreateDialogOpen: boolean+ justCreatedToken: CIMDVerificationTokenWithValue | null+ newTokenLabel: string+ tokens: CIMDVerificationToken[]+ tokensLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface cimdVerificationTokensLogicActions {+ createToken: () => {+ value: true+ }+ deleteToken: (token: CIMDVerificationToken) => {+ token: CIMDVerificationTokenApi+ }+ hideCreateDialog: () => {+ value: true+ }+ loadTokens: () => any+ loadTokensFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadTokensSuccess: (+ tokens: CIMDVerificationTokenApi[],+ payload?: any+ ) => {+ tokens: CIMDVerificationTokenApi[]+ payload?: any+ }+ setJustCreatedToken: (token: CIMDVerificationTokenWithValue | null) => {+ token: CIMDVerificationTokenWithValueApi | null+ }+ setNewTokenLabel: (label: string) => {+ label: string+ }+ showCreateDialog: () => {+ value: true+ }+}++export type cimdVerificationTokensLogicType = MakeLogicType<+ cimdVerificationTokensLogicValues,+ cimdVerificationTokensLogicActions+>+export const cimdVerificationTokensLogic = kea<cimdVerificationTokensLogicType>([path(['scenes', 'settings', 'organization', 'cimdVerificationTokensLogic']),diff --git a/frontend/src/scenes/settings/organization/inviteLogic.ts b/frontend/src/scenes/settings/organization/inviteLogic.tsindex 69be469a2ced..28a5d345cc22 100644--- a/frontend/src/scenes/settings/organization/inviteLogic.ts+++ b/frontend/src/scenes/settings/organization/inviteLogic.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 { lazyLoaders, loaders } from 'kea-loaders'import api, { PaginatedResponse } from 'lib/api'@@ -12,7 +12,7 @@ import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'import { AccessControlLevel, OrganizationInviteType } from '~/types'-import type { inviteLogicType } from './inviteLogicType'+import type { PreflightStatus } from '../../../types'/** State of a single invite row (with input data) in bulk invite creation. */export interface InviteRowState {@@ -32,6 +32,158 @@ const EMPTY_INVITE: InviteRowState = {private_project_access: [],}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface inviteLogicValues {+ preflight: PreflightStatus | null // preflightLogic+ availableProjects: any[]+ canSubmit: boolean+ inviteContainsOwnerLevel: boolean+ invitedTeamMembersInternal: OrganizationInviteType[]+ invitedTeamMembersInternalLoading: boolean+ invites: OrganizationInviteType[]+ invitesLoading: boolean+ invitesToSend: InviteRowState[]+ isInviteConfirmed: boolean+ isInviteModalShown: boolean+ isInviting: boolean+ message: string+ projectAccessControls: Record<+ number,+ {+ access_level: string+ }+ >+ projectAccessControlsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface inviteLogicActions {+ addProjectAccess: (+ inviteIndex: number,+ projectId: number,+ level: AccessControlLevel+ ) => {+ inviteIndex: number+ level: AccessControlLevel+ projectId: number+ }+ appendInviteRow: () => {+ value: true+ }+ deleteInvite: (invite: OrganizationInviteType) => OrganizationInviteType+ deleteInviteAtIndex: (index: number) => {+ index: number+ }+ deleteInviteFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteInviteSuccess: (+ invites: OrganizationInviteType[],+ payload?: OrganizationInviteType+ ) => {+ invites: OrganizationInviteType[]+ payload?: OrganizationInviteType+ }+ hideInviteModal: () => {+ value: true+ }+ inviteTeamMembers: () => any+ inviteTeamMembersFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ inviteTeamMembersSuccess: (+ invitedTeamMembersInternal: OrganizationInviteType[],+ payload?: any+ ) => {+ invitedTeamMembersInternal: OrganizationInviteType[]+ payload?: any+ }+ loadInvites: () => any+ loadInvitesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadInvitesSuccess: (+ invites: OrganizationInviteType[],+ payload?: any+ ) => {+ invites: OrganizationInviteType[]+ payload?: any+ }+ loadProjectAccessControl: (projectId: number) => number+ loadProjectAccessControlFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadProjectAccessControlSuccess: (+ projectAccessControls: {+ [x: number]: any+ },+ payload?: number+ ) => {+ projectAccessControls: {+ [x: number]: any+ }+ payload?: number+ }+ removeProjectAccess: (+ inviteIndex: number,+ projectId: number+ ) => {+ inviteIndex: number+ projectId: number+ }+ resetInviteRows: () => {+ value: true+ }+ setIsInviteConfirmed: (inviteConfirmed: boolean) => {+ inviteConfirmed: boolean+ }+ showInviteModal: () => {+ value: true+ }+ updateInviteAtIndex: (+ payload: any,+ index: number+ ) => {+ index: number+ payload: any+ }+ updateMessage: (message: string) => {+ message: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface inviteLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ inviteContainsOwnerLevel: (invitesToSend: InviteRowState[]) => boolean+ canSubmit: (+ invitesToSend: InviteRowState[],+ inviteContainsOwnerLevel: boolean,+ isInviteConfirmed: boolean+ ) => boolean+ availableProjects: (currentOrganization: null | import('~/types').OrganizationType) => any[]+ isInviting: (invitedTeamMembersInternalLoading: boolean) => boolean+ }+}++export type inviteLogicType = MakeLogicType<inviteLogicValues, inviteLogicActions, Record<string, any>, inviteLogicMeta>+export const inviteLogic = kea<inviteLogicType>([path(['scenes', 'organization', 'Settings', 'inviteLogic']),connect(() => ({diff --git a/frontend/src/scenes/settings/organization/oauthAppsLogic.ts b/frontend/src/scenes/settings/organization/oauthAppsLogic.tsindex bb00acedc3ce..ce71ce2e3bae 100644--- a/frontend/src/scenes/settings/organization/oauthAppsLogic.ts+++ b/frontend/src/scenes/settings/organization/oauthAppsLogic.ts@@ -1,11 +1,36 @@-import { afterMount, kea, path } from 'kea'+import { MakeLogicType, afterMount, kea, path } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'import { OrganizationOAuthApplicationApi } from '~/generated/core/api.schemas'-import type { oauthAppsLogicType } from './oauthAppsLogicType'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface oauthAppsLogicValues {+ oauthApps: OrganizationOAuthApplicationApi[]+ oauthAppsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface oauthAppsLogicActions {+ loadOAuthApps: () => any+ loadOAuthAppsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadOAuthAppsSuccess: (+ oauthApps: OrganizationOAuthApplicationApi[],+ payload?: any+ ) => {+ oauthApps: OrganizationOAuthApplicationApi[]+ payload?: any+ }+}++export type oauthAppsLogicType = MakeLogicType<oauthAppsLogicValues, oauthAppsLogicActions>export const oauthAppsLogic = kea<oauthAppsLogicType>([path(['scenes', 'settings', 'organization', 'oauthAppsLogic']),diff --git a/frontend/src/scenes/settings/organization/organizationIntegrationsLogic.ts b/frontend/src/scenes/settings/organization/organizationIntegrationsLogic.tsindex 4f91e83a1a63..6852486f0233 100644--- a/frontend/src/scenes/settings/organization/organizationIntegrationsLogic.ts+++ b/frontend/src/scenes/settings/organization/organizationIntegrationsLogic.ts@@ -1,4 +1,4 @@-import { actions, afterMount, kea, listeners, path, selectors } from 'kea'+import { MakeLogicType, actions, afterMount, kea, listeners, path, selectors } from 'kea'import { loaders } from 'kea-loaders'import { LemonDialog, lemonToast } from '@posthog/lemon-ui'@@ -8,7 +8,230 @@ import { ICONS } from 'lib/integrations/utils'import { IntegrationKind, IntegrationType } from '~/types'-import type { organizationIntegrationsLogicType } from './organizationIntegrationsLogicType'+import type { UserBasicType } from '../../../types'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface organizationIntegrationsLogicValues {+ getOrganizationIntegrationsByKind: (+ kinds: (+ | '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'+ )[]+ ) => IntegrationType[]+ organizationIntegrations: IntegrationType[] | null+ organizationIntegrationsLoading: boolean+ vercelIntegrations: IntegrationType[] | undefined+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface organizationIntegrationsLogicActions {+ deleteOrganizationIntegration: (id: IntegrationType['id']) => {+ id: number+ }+ loadOrganizationIntegrations: () => any+ loadOrganizationIntegrationsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadOrganizationIntegrationsSuccess: (+ organizationIntegrations: {+ 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+ ) => {+ organizationIntegrations: {+ 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+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface organizationIntegrationsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ vercelIntegrations: (organizationIntegrations: IntegrationType[] | null) => IntegrationType[] | undefined+ getOrganizationIntegrationsByKind: (+ organizationIntegrations: IntegrationType[] | null+ ) => (+ kinds: (+ | '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'+ )[]+ ) => IntegrationType[]+ }+}++export type organizationIntegrationsLogicType = MakeLogicType<+ organizationIntegrationsLogicValues,+ organizationIntegrationsLogicActions,+ Record<string, any>,+ organizationIntegrationsLogicMeta+>export const organizationIntegrationsLogic = kea<organizationIntegrationsLogicType>([path(['scenes', 'settings', 'organization', 'organizationIntegrationsLogic']),@@ -38,13 +261,13 @@ export const organizationIntegrationsLogic = kea<organizationIntegrationsLogicTyselectors({vercelIntegrations: [(s) => [s.organizationIntegrations],- (organizationIntegrations) => {+ (organizationIntegrations: IntegrationType[] | null) => {return organizationIntegrations?.filter((x) => x.kind === 'vercel')},],getOrganizationIntegrationsByKind: [(s) => [s.organizationIntegrations],- (organizationIntegrations) => {+ (organizationIntegrations: IntegrationType[] | null) => {return (kinds: IntegrationKind[]) =>organizationIntegrations?.filter((i) => kinds.includes(i.kind)) || []},diff --git a/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.ts b/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.tsindex 5714f6cc43df..8ff7a37d9c68 100644--- a/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.ts+++ b/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.ts@@ -1,4 +1,4 @@-import { actions, afterMount, kea, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, afterMount, kea, path, reducers, selectors } from 'kea'import { loaders } from 'kea-loaders'import api, { ApiConfig } from 'lib/api'@@ -7,7 +7,49 @@ import { fullName } from 'lib/utils/strings'import { getPersonalApiKeysListUrl } from 'products/platform_features/frontend/generated/api'import type { OrganizationPersonalAPIKeyApi } from 'products/platform_features/frontend/generated/api.schemas'-import type { organizationPersonalAPIKeysLogicType } from './organizationPersonalAPIKeysLogicType'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface organizationPersonalAPIKeysLogicValues {+ filteredKeys: OrganizationPersonalAPIKeyApi[]+ keys: OrganizationPersonalAPIKeyApi[]+ keysLoading: boolean+ search: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface organizationPersonalAPIKeysLogicActions {+ loadKeys: () => any+ loadKeysFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadKeysSuccess: (+ keys: OrganizationPersonalAPIKeyApi[],+ payload?: any+ ) => {+ keys: OrganizationPersonalAPIKeyApi[]+ payload?: any+ }+ setSearch: (search: string) => {+ search: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface organizationPersonalAPIKeysLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ filteredKeys: (keys: OrganizationPersonalAPIKeyApi[], search: string) => OrganizationPersonalAPIKeyApi[]+ }+}++export type organizationPersonalAPIKeysLogicType = MakeLogicType<+ organizationPersonalAPIKeysLogicValues,+ organizationPersonalAPIKeysLogicActions,+ Record<string, any>,+ organizationPersonalAPIKeysLogicMeta+>export const organizationPersonalAPIKeysLogic = kea<organizationPersonalAPIKeysLogicType>([path(['scenes', 'settings', 'organization', 'organizationPersonalAPIKeysLogic']),@@ -33,7 +75,7 @@ export const organizationPersonalAPIKeysLogic = kea<organizationPersonalAPIKeysL// Client-side filtering — the full list is already loaded, so this stays in the browser.filteredKeys: [(s) => [s.keys, s.search],- (keys, search): OrganizationPersonalAPIKeyApi[] => {+ (keys: OrganizationPersonalAPIKeyApi[], search: string): OrganizationPersonalAPIKeyApi[] => {const term = search.trim().toLowerCase()if (!term) {return keysdiff --git a/frontend/src/scenes/settings/project/projectSecretAPIKeysLogic.tsx b/frontend/src/scenes/settings/project/projectSecretAPIKeysLogic.tsxindex c74cef372f4d..b4e80e665f3e 100644--- a/frontend/src/scenes/settings/project/projectSecretAPIKeysLogic.tsx+++ b/frontend/src/scenes/settings/project/projectSecretAPIKeysLogic.tsx@@ -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 { LemonDialog } from '@posthog/lemon-ui'@@ -21,7 +22,7 @@ import { teamLogic } from 'scenes/teamLogic'import { ProjectSecretAPIKeyApi } from '~/generated/core/api.schemas'import { APIScopeAction, ProjectSecretAPIKeyRequest } from '~/types'-import type { projectSecretAPIKeysLogicType } from './projectSecretAPIKeysLogicType'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'export type EditingProjectKeyFormValues = ProjectSecretAPIKeyRequest & {preset?: string@@ -34,6 +35,182 @@ const PROJECT_SECRET_SCOPE_OBJECT_NAMES: Record<string, string> = {llm_gateway: 'AI gateway',}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface projectSecretAPIKeysLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentTeamId: number | null // teamLogic+ availablePresets: ProjectSecretAPIKeyScopePreset[]+ editingKey: EditingProjectKeyFormValues+ editingKeyAllErrors: Record<string, any>+ editingKeyChanged: boolean+ editingKeyErrors: DeepPartialMap<EditingProjectKeyFormValues, ValidationErrorType>+ editingKeyHasErrors: boolean+ editingKeyId: ProjectSecretAPIKeyApi['id'] | null+ editingKeyManualErrors: Record<string, any>+ editingKeyTouched: boolean+ editingKeyTouches: Record<string, boolean>+ editingKeyValidationErrors: DeepPartialMap<EditingProjectKeyFormValues, ValidationErrorType>+ filteredScopes: {+ disabledActions: APIScopeAction[]+ key: string+ label: string+ }[]+ formScopeRadioValues: Record<string, string>+ isEditingKeySubmitting: boolean+ isEditingKeyValid: boolean+ keys: ProjectSecretAPIKeyApi[]+ keysLoading: boolean+ searchTerm: string+ showEditingKeyErrors: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface projectSecretAPIKeysLogicActions {+ createKeySuccess: (key: ProjectSecretAPIKeyApi) => {+ key: ProjectSecretAPIKeyApi+ }+ deleteKey: (id: ProjectSecretAPIKeyApi['id']) => {+ id: string+ }+ deleteKeyFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteKeySuccess: (+ keys: ProjectSecretAPIKeyApi[],+ payload?: {+ id: string+ }+ ) => {+ keys: ProjectSecretAPIKeyApi[]+ payload?: {+ id: string+ }+ }+ loadKeys: () => {+ value: true+ }+ loadKeysFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadKeysSuccess: (+ keys: ProjectSecretAPIKeyApi[],+ payload?: {+ value: true+ }+ ) => {+ keys: ProjectSecretAPIKeyApi[]+ payload?: {+ value: true+ }+ }+ resetEditingKey: (values?: EditingProjectKeyFormValues) => {+ values?: EditingProjectKeyFormValues+ }+ resetScopes: () => {+ value: true+ }+ rollKey: (id: ProjectSecretAPIKeyApi['id']) => {+ id: string+ }+ rollKeyFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ rollKeySuccess: (+ keys: ProjectSecretAPIKeyApi[],+ payload?: {+ id: string+ }+ ) => {+ keys: ProjectSecretAPIKeyApi[]+ payload?: {+ id: string+ }+ }+ setEditingKeyId: (id: ProjectSecretAPIKeyApi['id'] | null) => {+ id: string | null+ }+ setEditingKeyManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setEditingKeyValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setEditingKeyValues: (values: DeepPartial<EditingProjectKeyFormValues>) => {+ values: DeepPartial<EditingProjectKeyFormValues>+ }+ setScopeRadioValue: (+ key: string,+ action: string+ ) => {+ action: string+ key: string+ }+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+ showRollKeySuccessDialog: (key: ProjectSecretAPIKeyApi) => {+ key: ProjectSecretAPIKeyApi+ }+ submitEditingKey: () => {+ value: boolean+ }+ submitEditingKeyFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitEditingKeyRequest: (editingKey: EditingProjectKeyFormValues) => {+ editingKey: EditingProjectKeyFormValues+ }+ submitEditingKeySuccess: (editingKey: EditingProjectKeyFormValues) => {+ editingKey: EditingProjectKeyFormValues+ }+ touchEditingKeyField: (key: string) => {+ key: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface projectSecretAPIKeysLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ formScopeRadioValues: (editingKey: EditingProjectKeyFormValues) => Record<string, string>+ filteredScopes: (+ searchTerm: string,+ featureFlags: FeatureFlagsSet+ ) => {+ disabledActions: APIScopeAction[]+ key: string+ label: string+ }[]+ availablePresets: (featureFlags: FeatureFlagsSet) => ProjectSecretAPIKeyScopePreset[]+ }+}++export type projectSecretAPIKeysLogicType = MakeLogicType<+ projectSecretAPIKeysLogicValues,+ projectSecretAPIKeysLogicActions,+ Record<string, any>,+ projectSecretAPIKeysLogicMeta+>+export const projectSecretAPIKeysLogic = kea<projectSecretAPIKeysLogicType>([path(['scenes', 'settings', 'project', 'projectSecretAPIKeysLogic']),connect(() => ({@@ -174,7 +351,10 @@ export const projectSecretAPIKeysLogic = kea<projectSecretAPIKeysLogicType>([],filteredScopes: [(s) => [s.searchTerm, s.featureFlags],- (searchTerm: string, featureFlags): { key: string; label: string; disabledActions: APIScopeAction[] }[] => {+ (+ searchTerm: string,+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet+ ): { key: string; label: string; disabledActions: APIScopeAction[] }[] => {const allActions: APIScopeAction[] = ['read', 'write']// llm_gateway:read is added only when the ai-gateway flag is on, mirroring the backend.const allowedScopeActions: string[] = [...PROJECT_SECRET_API_KEY_ALLOWED_API_SCOPE_ACTION]@@ -203,7 +383,7 @@ export const projectSecretAPIKeysLogic = kea<projectSecretAPIKeysLogicType>([],availablePresets: [(s) => [s.featureFlags],- (featureFlags): ProjectSecretAPIKeyScopePreset[] =>+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): ProjectSecretAPIKeyScopePreset[] =>PROJECT_SECRET_API_KEY_SCOPE_PRESETS.filter(({ value }) => value !== 'llm_gateway' || featureFlags[FEATURE_FLAGS.AI_GATEWAY]),diff --git a/frontend/src/scenes/settings/settingsLogic.ts b/frontend/src/scenes/settings/settingsLogic.tsindex 324eb4540186..b086493afbb0 100644--- a/frontend/src/scenes/settings/settingsLogic.ts+++ b/frontend/src/scenes/settings/settingsLogic.ts@@ -1,5 +1,5 @@import FuseClass from 'fuse.js'-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 { loaders } from 'kea-loaders'import { actionToUrl, router, urlToAction } from 'kea-router'@@ -14,8 +14,10 @@ import { organizationIntegrationsLogic } from 'scenes/settings/organization/orgaimport { teamLogic } from 'scenes/teamLogic'import { userLogic } from 'scenes/userLogic'+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'+import type { IntegrationType, PreflightStatus, TeamPublicType, TeamType } from '../../types'+import type { AvailableFeature, OrganizationType } from '../../types'import { matchesFlagDefinition } from './flagGating'-import type { settingsLogicType } from './settingsLogicType'import { SETTINGS_MAP } from './SettingsMap'import { Setting, SettingId, SettingLevelId, SettingSection, SettingSectionId, SettingsLogicProps } from './types'@@ -75,6 +77,184 @@ const getSectionStringValue = (section: SettingSection): string => {return section.id}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface settingsLogicValues {+ canAccessBilling: boolean // billingLogic+ featureFlags: FeatureFlagsSet // featureFlagLogic+ organizationIntegrations: IntegrationType[] | null // organizationIntegrationsLogic+ currentOrganization: OrganizationType | null // organizationLogic+ isAdminOrOwner: boolean | null // organizationLogic+ isCloudOrDev: boolean | undefined // preflightLogic+ preflight: PreflightStatus | null // preflightLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic+ collapsedGroups: Record<string, boolean>+ collapsedLevels: Record<SettingLevelId, boolean>+ defaultSectionId: SettingSectionId | null+ doesMatchFlags: (flagDefinition: Pick<Setting, 'flag'>) => boolean+ filteredLevels: SettingLevelId[]+ filteredSections: SettingSection[]+ globalSearchIndex: GlobalSearchFuse+ isCompactNavigationOpen: boolean+ isSearching: boolean+ levels: SettingLevelId[]+ searchResults: SearchResultGroup[]+ searchTerm: string+ sections: SettingSection[]+ sectionsFuse: SectionsFuse+ selectedLevel: SettingLevelId+ selectedLevelRaw: 'environment' | 'organization' | 'project' | 'user'+ selectedSection: SettingSection | null+ selectedSectionId: SettingSectionId | null+ selectedSectionIdRaw: SettingSectionId | null+ selectedSetting: Setting | null+ selectedSettingId: SettingId | null+ settings: Setting[]+ settingsFuse: SettingsFuse+ settingsSnapshot: Record<string, any> | null+ settingsSnapshotLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface settingsLogicActions {+ closeCompactNavigation: () => {+ value: true+ }+ expandGroup: (group: string) => {+ group: string+ }+ loadSettingsAsOf: (+ at: string,+ scope?: string | string[]+ ) => {+ at: string+ scope: string | string[] | undefined+ }+ loadSettingsAsOfFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSettingsAsOfSuccess: (+ settingsSnapshot: Record<string, any>,+ payload?: {+ at: string+ scope: string | string[] | undefined+ }+ ) => {+ settingsSnapshot: Record<string, any>+ payload?: {+ at: string+ scope: string | string[] | undefined+ }+ }+ navigateToSetting: (+ sectionId: SettingSectionId,+ settingId: SettingId+ ) => {+ sectionId: SettingSectionId+ settingId: SettingId+ }+ openCompactNavigation: () => {+ value: true+ }+ selectLevel: (level: SettingLevelId) => {+ level: 'environment' | 'organization' | 'project' | 'user'+ }+ selectSection: (+ section: SettingSectionId,+ level: SettingLevelId+ ) => {+ level: 'environment' | 'organization' | 'project' | 'user'+ section: SettingSectionId+ }+ selectSetting: (setting: SettingId) => {+ setting: SettingId+ }+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+ toggleGroupCollapse: (group: string) => {+ group: string+ }+ toggleLevelCollapse: (level: SettingLevelId) => {+ level: 'environment' | 'organization' | 'project' | 'user'+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface settingsLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ levels: (sections: SettingSection[]) => SettingLevelId[]+ sections: (+ doesMatchFlags: (flagDefinition: Pick<Setting, 'flag'>) => boolean,+ isCloudOrDev: boolean | undefined,+ currentTeam: TeamPublicType | TeamType | null,+ currentOrganization: OrganizationType | null,+ organizationIntegrations: IntegrationType[] | null,+ preflight: PreflightStatus | null,+ canAccessBilling: boolean,+ isAdminOrOwner: boolean | null+ ) => SettingSection[]+ selectedLevel: (+ selectedLevelRaw: 'environment' | 'organization' | 'project' | 'user',+ selectedSectionIdRaw: SettingSectionId | null,+ currentTeam: TeamPublicType | TeamType | null+ ) => SettingLevelId+ selectedSectionId: (selectedSectionIdRaw: SettingSectionId | null) => SettingSectionId | null+ defaultSectionId: (+ sections: SettingSection[],+ selectedLevel: 'environment' | 'organization' | 'project' | 'user'+ ) => SettingSectionId | null+ selectedSection: (+ sections: SettingSection[],+ selectedSectionId: SettingSectionId | null,+ defaultSectionId: SettingSectionId | null+ ) => SettingSection | null+ settings: (+ selectedLevel: 'environment' | 'organization' | 'project' | 'user',+ selectedSectionId: SettingSectionId | null,+ defaultSectionId: SettingSectionId | null,+ sections: SettingSection[],+ doesMatchFlags: (flagDefinition: Pick<Setting, 'flag'>) => boolean,+ preflight: PreflightStatus | null,+ currentTeam: TeamPublicType | TeamType | null+ ) => Setting[]+ selectedSetting: (settings: Setting[], selectedSettingId: SettingId | null) => Setting | null+ doesMatchFlags: (featureFlags: FeatureFlagsSet) => (flagDefinition: Pick<Setting, 'flag'>) => boolean+ settingsFuse: (settings: Setting[]) => SettingsFuse+ sectionsFuse: (sections: SettingSection[]) => SectionsFuse+ isSearching: (searchTerm: string) => boolean+ globalSearchIndex: (+ sections: SettingSection[],+ doesMatchFlags: (flagDefinition: Pick<Setting, 'flag'>) => boolean,+ preflight: PreflightStatus | null,+ currentTeam: TeamPublicType | TeamType | null+ ) => GlobalSearchFuse+ searchResults: (searchTerm: string, globalSearchIndex: GlobalSearchFuse) => SearchResultGroup[]+ filteredLevels: (+ levels: ('environment' | 'organization' | 'project' | 'user')[],+ searchResults: SearchResultGroup[],+ isSearching: boolean+ ) => SettingLevelId[]+ filteredSections: (+ sections: SettingSection[],+ searchResults: SearchResultGroup[],+ isSearching: boolean+ ) => SettingSection[]+ }+}++export type settingsLogicType = MakeLogicType<+ settingsLogicValues,+ settingsLogicActions,+ SettingsLogicProps,+ settingsLogicMeta+>+export const settingsLogic = kea<settingsLogicType>([props({} as SettingsLogicProps),key((props) => props.logicKey ?? 'global'),@@ -247,7 +427,7 @@ export const settingsLogic = kea<settingsLogicType>([selectors({levels: [(s) => [s.sections],- (sections): SettingLevelId[] => {+ (sections: SettingSection[]): SettingLevelId[] => {return sections.reduce<SettingLevelId[]>((acc, section) => {if (!acc.includes(section.level)) {acc.push(section.level)@@ -268,14 +448,14 @@ export const settingsLogic = kea<settingsLogicType>([s.isAdminOrOwner,],(- doesMatchFlags,- isCloudOrDev,- currentTeam,- currentOrganization,- organizationIntegrations,- preflight,- canAccessBilling,- isAdminOrOwner+ doesMatchFlags: (flagDefinition: Pick<Setting, 'flag'>) => boolean,+ isCloudOrDev: boolean | undefined,+ currentTeam: null | import('../../types').TeamPublicType | import('../../types').TeamType,+ currentOrganization: null | import('../../types').OrganizationType,+ organizationIntegrations: import('../../types').IntegrationType[] | null,+ preflight: null | import('../../types').PreflightStatus,+ canAccessBilling: boolean,+ isAdminOrOwner: boolean | null): SettingSection[] => {const isSettingVisible = (setting: Setting): boolean => {if (!doesMatchFlags(setting)) {@@ -346,7 +526,11 @@ export const settingsLogic = kea<settingsLogicType>([],selectedLevel: [(s) => [s.selectedLevelRaw, s.selectedSectionIdRaw, s.currentTeam],- (selectedLevelRaw, selectedSectionIdRaw, currentTeam): SettingLevelId => {+ (+ selectedLevelRaw: 'environment' | 'organization' | 'project' | 'user',+ selectedSectionIdRaw: SettingSectionId | null,+ currentTeam: null | import('../../types').TeamPublicType | import('../../types').TeamType+ ): SettingLevelId => {if (!selectedSectionIdRaw ||(!selectedSectionIdRaw.endsWith('-details') && !selectedSectionIdRaw.endsWith('-danger-zone'))@@ -363,7 +547,7 @@ export const settingsLogic = kea<settingsLogicType>([],selectedSectionId: [(s) => [s.selectedSectionIdRaw],- (selectedSectionIdRaw): SettingSectionId | null => {+ (selectedSectionIdRaw: SettingSectionId | null): SettingSectionId | null => {if (!selectedSectionIdRaw) {return null}@@ -376,14 +560,18 @@ export const settingsLogic = kea<settingsLogicType>([],defaultSectionId: [(s) => [s.sections, s.selectedLevel],- (sections, selectedLevel): SettingSectionId | null => {+ (sections: SettingSection[], selectedLevel: SettingLevelId): SettingSectionId | null => {const firstSection = sections.find((s) => s.level === selectedLevel)return firstSection?.id ?? null},],selectedSection: [(s) => [s.sections, s.selectedSectionId, s.defaultSectionId],- (sections, selectedSectionId, defaultSectionId): SettingSection | null => {+ (+ sections: SettingSection[],+ selectedSectionId: SettingSectionId | null,+ defaultSectionId: SettingSectionId | null+ ): SettingSection | null => {const effectiveId = selectedSectionId ?? defaultSectionIdreturn sections.find((x) => x.id === effectiveId) ?? null},@@ -399,13 +587,13 @@ export const settingsLogic = kea<settingsLogicType>([s.currentTeam,],(- selectedLevel,- selectedSectionId,- defaultSectionId,- sections,- doesMatchFlags,- preflight,- currentTeam+ selectedLevel: SettingLevelId,+ selectedSectionId: SettingSectionId | null,+ defaultSectionId: SettingSectionId | null,+ sections: SettingSection[],+ doesMatchFlags: (flagDefinition: Pick<Setting, 'flag'>) => boolean,+ preflight: null | import('../../types').PreflightStatus,+ currentTeam: null | import('../../types').TeamPublicType | import('../../types').TeamType): Setting[] => {const effectiveSectionId = selectedSectionId ?? defaultSectionId@@ -438,13 +626,13 @@ export const settingsLogic = kea<settingsLogicType>([],selectedSetting: [(s) => [s.settings, s.selectedSettingId],- (settings, selectedSettingId): Setting | null => {+ (settings: Setting[], selectedSettingId: SettingId | null): Setting | null => {return settings.find((s) => s.id === selectedSettingId) ?? null},],doesMatchFlags: [(s) => [s.featureFlags],- (featureFlags) => {+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet) => {return (flagDefinition: Pick<Setting, 'flag'>) =>matchesFlagDefinition(flagDefinition.flag, featureFlags)},@@ -485,7 +673,12 @@ export const settingsLogic = kea<settingsLogicType>([globalSearchIndex: [(s) => [s.sections, s.doesMatchFlags, s.preflight, s.currentTeam],- (sections, doesMatchFlags, preflight, currentTeam): GlobalSearchFuse => {+ (+ sections: SettingSection[],+ doesMatchFlags: (flagDefinition: Pick<Setting, 'flag'>) => boolean,+ preflight: null | import('../../types').PreflightStatus,+ currentTeam: null | import('../../types').TeamPublicType | import('../../types').TeamType+ ): GlobalSearchFuse => {const entries: SearchIndexEntry[] = []for (const section of sections.filter((s) => !s.hideFromNavigation)) {@@ -554,7 +747,7 @@ export const settingsLogic = kea<settingsLogicType>([searchResults: [(s) => [s.searchTerm, s.globalSearchIndex],- (searchTerm, globalSearchIndex): SearchResultGroup[] => {+ (searchTerm: string, globalSearchIndex: GlobalSearchFuse): SearchResultGroup[] => {if (!searchTerm.trim()) {return []}@@ -578,7 +771,7 @@ export const settingsLogic = kea<settingsLogicType>([filteredLevels: [(s) => [s.levels, s.searchResults, s.isSearching],- (levels, searchResults, isSearching): SettingLevelId[] => {+ (levels: SettingLevelId[], searchResults: SearchResultGroup[], isSearching: boolean): SettingLevelId[] => {if (!isSearching) {return levels}@@ -590,7 +783,11 @@ export const settingsLogic = kea<settingsLogicType>([filteredSections: [(s) => [s.sections, s.searchResults, s.isSearching],- (sections, searchResults, isSearching): SettingSection[] => {+ (+ sections: SettingSection[],+ searchResults: SearchResultGroup[],+ isSearching: boolean+ ): SettingSection[] => {const visibleSections = sections.filter((section) => !section.hideFromNavigation)if (!isSearching) {diff --git a/frontend/src/scenes/settings/settingsSceneLogic.ts b/frontend/src/scenes/settings/settingsSceneLogic.tsindex 9a6386713d86..d837cdad62af 100644--- a/frontend/src/scenes/settings/settingsSceneLogic.ts+++ b/frontend/src/scenes/settings/settingsSceneLogic.ts@@ -1,4 +1,4 @@-import { connect, kea, listeners, path, selectors } from 'kea'+import { MakeLogicType, connect, kea, listeners, path, selectors } from 'kea'import { actionToUrl, router, urlToAction } from 'kea-router'import { copyToClipboard } from 'lib/utils/copyToClipboard'@@ -11,8 +11,8 @@ import { SIDE_PANEL_CONTEXT_KEY, SidePanelSceneContext } from '~/layout/navigatiimport { ActivityScope, Breadcrumb } from '~/types'import { settingsLogic } from './settingsLogic'-import type { settingsSceneLogicType } from './settingsSceneLogicType'import { SettingId, SettingLevelId, SettingLevelIds, SettingSectionId } from './types'+import type { Setting, SettingSection } from './types'const AI_OBSERVABILITY_SETTINGS_SECTION: SettingSectionId = 'project-ai-observability'const AI_OBSERVABILITY_BYOK_SETTING: SettingId = 'ai-observability-byok'@@ -62,6 +62,53 @@ const canonicalSettingsHashParams = (hashParams: Params): [Params, boolean] => {return [nextHashParams, changed]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface settingsSceneLogicValues {+ sections: SettingSection[] // settingsLogic+ selectedLevel: SettingLevelId // settingsLogic+ selectedSection: SettingSection | null // settingsLogic+ selectedSectionId: SettingSectionId | null // settingsLogic+ settings: Setting[] // settingsLogic+ breadcrumbs: Breadcrumb[]+ sidePanelContext: SidePanelSceneContext | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface settingsSceneLogicActions {+ selectLevel: (level: 'environment' | 'organization' | 'project' | 'user') => {+ level: 'environment' | 'organization' | 'project' | 'user'+ } // settingsLogic+ selectSection: (+ section: SettingSectionId,+ level: 'environment' | 'organization' | 'project' | 'user'+ ) => {+ level: 'environment' | 'organization' | 'project' | 'user'+ section: SettingSectionId+ } // settingsLogic+ selectSetting: (setting: SettingId) => {+ setting: SettingId+ } // settingsLogic+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface settingsSceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ breadcrumbs: (+ selectedLevel: 'environment' | 'organization' | 'project' | 'user',+ selectedSectionId: SettingSectionId | null,+ selectedSection: SettingSection | null+ ) => Breadcrumb[]+ sidePanelContext: (selectedSectionId: SettingSectionId | null) => SidePanelSceneContext | null+ }+}++export type settingsSceneLogicType = MakeLogicType<+ settingsSceneLogicValues,+ settingsSceneLogicActions,+ Record<string, any>,+ settingsSceneLogicMeta+>+export const settingsSceneLogic = kea<settingsSceneLogicType>([path(['scenes', 'settings', 'settingsSceneLogic']),connect(() => ({@@ -75,7 +122,11 @@ export const settingsSceneLogic = kea<settingsSceneLogicType>([selectors({breadcrumbs: [(s) => [s.selectedLevel, s.selectedSectionId, s.selectedSection],- (selectedLevel, selectedSectionId, selectedSection): Breadcrumb[] => {+ (+ selectedLevel: SettingLevelId,+ selectedSectionId: SettingSectionId | null,+ selectedSection: null | import('./types').SettingSection+ ): Breadcrumb[] => {const sectionName = selectedSection?.title ?? capitalizeFirstLetter(selectedLevel)return [diff --git a/frontend/src/scenes/settings/user/changePasswordLogic.ts b/frontend/src/scenes/settings/user/changePasswordLogic.tsindex 46534452c73d..5461408796ca 100644--- a/frontend/src/scenes/settings/user/changePasswordLogic.ts+++ b/frontend/src/scenes/settings/user/changePasswordLogic.ts@@ -1,5 +1,6 @@-import { connect, kea, path, selectors } from 'kea'+import { MakeLogicType, connect, kea, path, selectors } from 'kea'import { forms } from 'kea-forms'+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'import { lemonToast } from '@posthog/lemon-ui'@@ -7,7 +8,7 @@ import api from 'lib/api'import { ValidatedPasswordResult, validatePassword } from 'lib/components/PasswordStrength'import { userLogic } from 'scenes/userLogic'-import type { changePasswordLogicType } from './changePasswordLogicType'+import type { UserType } from '../../../types'export interface ChangePasswordForm {current_password: string@@ -15,6 +16,80 @@ export interface ChangePasswordForm {confirm_password: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface changePasswordLogicValues {+ user: UserType | null // userLogic+ changePassword: ChangePasswordForm+ changePasswordAllErrors: Record<string, any>+ changePasswordChanged: boolean+ changePasswordErrors: DeepPartialMap<ChangePasswordForm, ValidationErrorType>+ changePasswordHasErrors: boolean+ changePasswordManualErrors: Record<string, any>+ changePasswordTouched: boolean+ changePasswordTouches: Record<string, boolean>+ changePasswordValidationErrors: DeepPartialMap<ChangePasswordForm, ValidationErrorType>+ isChangePasswordSubmitting: boolean+ isChangePasswordValid: boolean+ showChangePasswordErrors: boolean+ validatedPassword: ValidatedPasswordResult+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface changePasswordLogicActions {+ loadUser: (resetOnFailure?: boolean) => {+ resetOnFailure: boolean | undefined+ } // userLogic+ resetChangePassword: (values?: ChangePasswordForm) => {+ values?: ChangePasswordForm+ }+ setChangePasswordManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setChangePasswordValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setChangePasswordValues: (values: DeepPartial<ChangePasswordForm>) => {+ values: DeepPartial<ChangePasswordForm>+ }+ submitChangePassword: () => {+ value: boolean+ }+ submitChangePasswordFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitChangePasswordRequest: (changePassword: ChangePasswordForm) => {+ changePassword: ChangePasswordForm+ }+ submitChangePasswordSuccess: (changePassword: ChangePasswordForm) => {+ changePassword: ChangePasswordForm+ }+ touchChangePasswordField: (key: string) => {+ key: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface changePasswordLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ validatedPassword: (changePassword: ChangePasswordForm) => ValidatedPasswordResult+ }+}++export type changePasswordLogicType = MakeLogicType<+ changePasswordLogicValues,+ changePasswordLogicActions,+ Record<string, any>,+ changePasswordLogicMeta+>+export const changePasswordLogic = kea<changePasswordLogicType>([path(['scenes', 'me', 'settings', 'changePasswordLogic']),connect(() => ({diff --git a/frontend/src/scenes/settings/user/connectedAppsLogic.ts b/frontend/src/scenes/settings/user/connectedAppsLogic.tsindex d3a1f2393cf7..d40f7c94a4b8 100644--- a/frontend/src/scenes/settings/user/connectedAppsLogic.ts+++ b/frontend/src/scenes/settings/user/connectedAppsLogic.ts@@ -1,11 +1,9 @@-import { actions, events, kea, path } from 'kea'+import { MakeLogicType, actions, events, kea, path } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'-import type { connectedAppsLogicType } from './connectedAppsLogicType'-export interface ConnectedApp {id: stringname: string@@ -16,6 +14,54 @@ export interface ConnectedApp {is_first_party: boolean}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface connectedAppsLogicValues {+ connectedApps: ConnectedApp[]+ connectedAppsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface connectedAppsLogicActions {+ loadConnectedApps: () => any+ loadConnectedAppsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadConnectedAppsSuccess: (+ connectedApps: ConnectedApp[],+ payload?: any+ ) => {+ connectedApps: ConnectedApp[]+ payload?: any+ }+ revokeApp: (id: string) => {+ id: string+ }+ revokeAppFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ revokeAppSuccess: (+ connectedApps: ConnectedApp[],+ payload?: {+ id: string+ }+ ) => {+ connectedApps: ConnectedApp[]+ payload?: {+ id: string+ }+ }+}++export type connectedAppsLogicType = MakeLogicType<connectedAppsLogicValues, connectedAppsLogicActions>+export const connectedAppsLogic = kea<connectedAppsLogicType>([path(['scenes', 'settings', 'user', 'connectedAppsLogic']),diff --git a/frontend/src/scenes/settings/user/loginSessionsLogic.ts b/frontend/src/scenes/settings/user/loginSessionsLogic.tsindex edae7743de4e..9d00576d50c1 100644--- a/frontend/src/scenes/settings/user/loginSessionsLogic.ts+++ b/frontend/src/scenes/settings/user/loginSessionsLogic.ts@@ -1,4 +1,4 @@-import { actions, events, kea, path } from 'kea'+import { MakeLogicType, actions, events, kea, path } from 'kea'import { loaders } from 'kea-loaders'import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'@@ -10,7 +10,74 @@ import {} from '~/generated/core/api'import type { UserAuthSessionApi } from '~/generated/core/api.schemas'-import type { loginSessionsLogicType } from './loginSessionsLogicType'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface loginSessionsLogicValues {+ loginSessions: UserAuthSessionApi[]+ loginSessionsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface loginSessionsLogicActions {+ loadLoginSessions: () => any+ loadLoginSessionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadLoginSessionsSuccess: (+ loginSessions: UserAuthSessionApi[],+ payload?: any+ ) => {+ loginSessions: UserAuthSessionApi[]+ payload?: any+ }+ revokeOtherSessions: () => {+ value: true+ }+ revokeOtherSessionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ revokeOtherSessionsSuccess: (+ loginSessions: UserAuthSessionApi[],+ payload?: {+ value: true+ }+ ) => {+ loginSessions: UserAuthSessionApi[]+ payload?: {+ value: true+ }+ }+ revokeSession: (id: string) => {+ id: string+ }+ revokeSessionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ revokeSessionSuccess: (+ loginSessions: UserAuthSessionApi[],+ payload?: {+ id: string+ }+ ) => {+ loginSessions: UserAuthSessionApi[]+ payload?: {+ id: string+ }+ }+}++export type loginSessionsLogicType = MakeLogicType<loginSessionsLogicValues, loginSessionsLogicActions>export const loginSessionsLogic = kea<loginSessionsLogicType>([path(['scenes', 'settings', 'user', 'loginSessionsLogic']),diff --git a/frontend/src/scenes/settings/user/passkeySettingsLogic.ts b/frontend/src/scenes/settings/user/passkeySettingsLogic.tsindex 9f80cb1ebc1a..c8f26a849c11 100644--- a/frontend/src/scenes/settings/user/passkeySettingsLogic.ts+++ b/frontend/src/scenes/settings/user/passkeySettingsLogic.ts@@ -1,5 +1,5 @@import { type PublicKeyCredentialDescriptorJSON, startAuthentication, startRegistration } from '@simplewebauthn/browser'-import { actions, connect, kea, listeners, path, reducers } from 'kea'+import { MakeLogicType, actions, connect, kea, listeners, path, reducers } from 'kea'import { loaders } from 'kea-loaders'import { lemonToast } from '@posthog/lemon-ui'@@ -9,7 +9,6 @@ import { twoFactorLogic } from 'scenes/authentication/two-factor-setup/twoFactorimport { userLogic } from 'scenes/userLogic'import { getPasskeyErrorMessage } from './passkeys/utils'-import type { passkeySettingsLogicType } from './passkeySettingsLogicType'export interface PasskeyCredential {id: number@@ -48,6 +47,165 @@ export interface VerificationBeginResponse {export type RegistrationStep = 'idle' | 'registering' | 'verifying' | 'complete'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface passkeySettingsLogicValues {+ deleteModalId: number | null+ error: string | null+ passkeys: PasskeyCredential[]+ passkeysLoading: boolean+ registerPasskey: null+ registerPasskeyLoading: boolean+ registrationLabel: string+ registrationStep: RegistrationStep+ renameModal: {+ currentLabel: string+ id: number+ } | null+ verifyingPasskeyId: number | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface passkeySettingsLogicActions {+ loadStatus: () => {+ value: true+ } // twoFactorLogic+ loadUser: (resetOnFailure?: boolean) => {+ resetOnFailure: boolean | undefined+ } // userLogic+ beginRegistration: (label: string) => {+ label: string+ }+ beginRegistrationFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ beginRegistrationSuccess: (+ registerPasskey: null,+ payload?: {+ label: string+ }+ ) => {+ registerPasskey: null+ payload?: {+ label: string+ }+ }+ clearError: () => {+ value: true+ }+ closeDeleteModal: () => {+ value: true+ }+ closeRenameModal: () => {+ value: true+ }+ deletePasskey: (id: number) => {+ id: number+ }+ deletePasskeyFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deletePasskeySuccess: (+ passkeys: PasskeyCredential[],+ payload?: {+ id: number+ }+ ) => {+ passkeys: PasskeyCredential[]+ payload?: {+ id: number+ }+ }+ loadPasskeys: () => any+ loadPasskeysFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPasskeysSuccess: (+ passkeys: PasskeyCredential[],+ payload?: any+ ) => {+ passkeys: PasskeyCredential[]+ payload?: any+ }+ openDeleteModal: (id: number) => {+ id: number+ }+ openRenameModal: (+ id: number,+ currentLabel: string+ ) => {+ currentLabel: string+ id: number+ }+ renamePasskey: (+ id: number,+ label: string+ ) => {+ id: number+ label: string+ }+ renamePasskeyFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ renamePasskeySuccess: (+ passkeys: PasskeyCredential[],+ payload?: {+ id: number+ label: string+ }+ ) => {+ passkeys: PasskeyCredential[]+ payload?: {+ id: number+ label: string+ }+ }+ setError: (error: string | null) => {+ error: string | null+ }+ setRegistrationStep: (step: RegistrationStep) => {+ step: RegistrationStep+ }+ verifyPasskey: (id: number) => {+ id: number+ }+ verifyPasskeyFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ verifyPasskeySuccess: (+ passkeys: PasskeyCredential[],+ payload?: {+ id: number+ }+ ) => {+ passkeys: PasskeyCredential[]+ payload?: {+ id: number+ }+ }+}++export type passkeySettingsLogicType = MakeLogicType<passkeySettingsLogicValues, passkeySettingsLogicActions>+export const passkeySettingsLogic = kea<passkeySettingsLogicType>([path(['scenes', 'settings', 'user', 'passkeySettingsLogic']),connect(() => ({diff --git a/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsx b/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsxindex 1643c0b74cc0..cb8d3c039de4 100644--- a/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsx+++ b/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsx@@ -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 { actionToUrl, router, urlToAction } from 'kea-router'@@ -24,7 +25,7 @@ import { userLogic } from 'scenes/userLogic'import { API_KEY_SCOPE_PRESETS } from '~/lib/scopes'import { AvailableFeature, OrganizationBasicType, PersonalAPIKeyType, TeamBasicType, UserType } from '~/types'-import type { personalAPIKeysLogicType } from './personalAPIKeysLogicType'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'export type EditingKeyFormValues = Pick<PersonalAPIKeyType,@@ -34,6 +35,238 @@ export type EditingKeyFormValues = Pick<access_type?: 'all' | 'organizations' | 'teams'}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personalAPIKeysLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic+ user: UserType | null // userLogic+ allAccessSelected: boolean+ allOrganizations: OrganizationBasicType[]+ allTeams: TeamBasicType[] | null+ allTeamsLoading: boolean+ allowedScopeKeys: Set<string>+ allowedScopes: APIScope[]+ canUsePersonalApiKeys: boolean+ editingKey: EditingKeyFormValues+ editingKeyAllErrors: Record<string, any>+ editingKeyChanged: boolean+ editingKeyErrors: DeepPartialMap<EditingKeyFormValues, ValidationErrorType>+ editingKeyHasErrors: boolean+ editingKeyId: PersonalAPIKeyType['id'] | null+ editingKeyManualErrors: Record<string, any>+ editingKeyTouched: boolean+ editingKeyTouches: Record<string, boolean>+ editingKeyValidationErrors: DeepPartialMap<EditingKeyFormValues, ValidationErrorType>+ filteredScopes: APIScope[]+ formScopeRadioValues: Record<string, string>+ getRestrictedOrganizationsForKey: (keyId: string) => OrganizationBasicType[]+ getRestrictedTeamsForKey: (keyId: string) => TeamBasicType[]+ isDescriptionFieldVisible: boolean+ isEditingKeyLegacy: boolean+ isEditingKeySubmitting: boolean+ isEditingKeyValid: boolean+ isPersonalApiKeyIdDisabled: (keyId: string) => boolean+ keys: PersonalAPIKeyType[]+ keysLoading: boolean+ searchTerm: string+ showEditingKeyErrors: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personalAPIKeysLogicActions {+ createKeySuccess: (key: PersonalAPIKeyType) => {+ key: PersonalAPIKeyType+ }+ deleteKey: (id: PersonalAPIKeyType['id']) => {+ id: string+ }+ deleteKeyFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteKeySuccess: (+ keys: PersonalAPIKeyType[],+ payload?: {+ id: string+ }+ ) => {+ keys: PersonalAPIKeyType[]+ payload?: {+ id: string+ }+ }+ loadAllTeams: () => {+ value: true+ }+ loadAllTeamsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAllTeamsSuccess: (+ allTeams: TeamBasicType[],+ payload?: {+ value: true+ }+ ) => {+ allTeams: TeamBasicType[]+ payload?: {+ value: true+ }+ }+ loadKeys: () => {+ value: true+ }+ loadKeysFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadKeysSuccess: (+ keys: PersonalAPIKeyType[],+ payload?: {+ value: true+ }+ ) => {+ keys: PersonalAPIKeyType[]+ payload?: {+ value: true+ }+ }+ resetEditingKey: (values?: EditingKeyFormValues) => {+ values?: EditingKeyFormValues+ }+ resetScopes: () => {+ value: true+ }+ rollKey: (id: PersonalAPIKeyType['id']) => {+ id: string+ }+ rollKeyFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ rollKeySuccess: (+ keys: PersonalAPIKeyType[],+ payload?: {+ id: string+ }+ ) => {+ keys: PersonalAPIKeyType[]+ payload?: {+ id: string+ }+ }+ setEditingKeyId: (id: PersonalAPIKeyType['id'] | null) => {+ id: string | null+ }+ setEditingKeyManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setEditingKeyValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setEditingKeyValues: (values: DeepPartial<EditingKeyFormValues>) => {+ values: DeepPartial<EditingKeyFormValues>+ }+ setScopeRadioValue: (+ key: string,+ action: string+ ) => {+ action: string+ key: string+ }+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+ showDescriptionField: () => {+ value: true+ }+ showRollKeySuccessDialog: (+ key: PersonalAPIKeyType,+ prevMaskedValue?: string | null+ ) => {+ key: PersonalAPIKeyType+ prevMaskedValue: string | null | undefined+ }+ submitEditingKey: () => {+ value: boolean+ }+ submitEditingKeyFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitEditingKeyRequest: (editingKey: EditingKeyFormValues) => {+ editingKey: EditingKeyFormValues+ }+ submitEditingKeySuccess: (editingKey: EditingKeyFormValues) => {+ editingKey: EditingKeyFormValues+ }+ touchEditingKeyField: (key: string) => {+ key: string+ }+ updateKey: (+ data: Partial<Pick<PersonalAPIKeyType, 'label' | 'scopes'>>+ ) => Partial<Pick<PersonalAPIKeyType, 'label' | 'scopes'>>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personalAPIKeysLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ allowedScopes: (+ featureFlags: FeatureFlagsSet,+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => APIScope[]+ allowedScopeKeys: (allowedScopes: APIScope[]) => Set<string>+ filteredScopes: (searchTerm: string, allowedScopes: APIScope[]) => APIScope[]+ formScopeRadioValues: (editingKey: EditingKeyFormValues) => Record<string, string>+ allAccessSelected: (editingKey: EditingKeyFormValues) => boolean+ isEditingKeyLegacy: (editingKeyId: string | null, keys: PersonalAPIKeyType[]) => boolean+ allOrganizations: (user: UserType | null) => OrganizationBasicType[]+ canUsePersonalApiKeys: (user: UserType | null) => boolean+ isPersonalApiKeyIdDisabled: (+ allOrganizations: OrganizationBasicType[],+ allTeams: TeamBasicType[] | null,+ keys: PersonalAPIKeyType[],+ getRestrictedOrganizationsForKey: (keyId: string) => OrganizationBasicType[]+ ) => (keyId: string) => boolean+ getRestrictedOrganizationsForKey: (+ allOrganizations: OrganizationBasicType[],+ keys: PersonalAPIKeyType[],+ getRestrictedTeamsForKey: (keyId: string) => TeamBasicType[]+ ) => (keyId: string) => OrganizationBasicType[]+ getRestrictedTeamsForKey: (+ allOrganizations: OrganizationBasicType[],+ allTeams: TeamBasicType[] | null,+ keys: PersonalAPIKeyType[]+ ) => (keyId: string) => TeamBasicType[]+ }+}++export type personalAPIKeysLogicType = MakeLogicType<+ personalAPIKeysLogicValues,+ personalAPIKeysLogicActions,+ Record<string, any>,+ personalAPIKeysLogicMeta+>+export const personalAPIKeysLogic = kea<personalAPIKeysLogicType>([path(['lib', 'components', 'PersonalAPIKeys', 'personalAPIKeysLogic']),connect(() => ({@@ -177,7 +410,10 @@ export const personalAPIKeysLogic = kea<personalAPIKeysLogicType>([selectors(() => ({allowedScopes: [(s) => [s.featureFlags, s.hasAvailableFeature],- (featureFlags, hasAvailableFeature): APIScope[] => {+ (+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ): APIScope[] => {let scopes = API_SCOPES// Filter out llm_gateway scope if feature flag is disabled@@ -205,11 +441,11 @@ export const personalAPIKeysLogic = kea<personalAPIKeysLogicType>([],allowedScopeKeys: [(s) => [s.allowedScopes],- (allowedScopes): Set<string> => new Set(allowedScopes.map((scope) => scope.key)),+ (allowedScopes: APIScope[]): Set<string> => new Set(allowedScopes.map((scope) => scope.key)),],filteredScopes: [(s) => [s.searchTerm, s.allowedScopes],- (searchTerm, allowedScopes): APIScope[] => {+ (searchTerm: string, allowedScopes: APIScope[]): APIScope[] => {const scopes = allowedScopesif (!searchTerm.trim()) {@@ -231,20 +467,20 @@ export const personalAPIKeysLogic = kea<personalAPIKeysLogicType>([],formScopeRadioValues: [(s) => [s.editingKey],- (editingKey): Record<string, string> => {+ (editingKey: EditingKeyFormValues): Record<string, string> => {return scopesArrayToObject(editingKey.scopes)},],allAccessSelected: [(s) => [s.editingKey],- (editingKey): boolean => {+ (editingKey: EditingKeyFormValues): boolean => {return editingKey.scopes.includes('*')},],isEditingKeyLegacy: [(s) => [s.editingKeyId, s.keys],- (editingKeyId, keys): boolean => {+ (editingKeyId: PersonalAPIKeyType['id'] | null, keys: PersonalAPIKeyType[]): boolean => {if (!editingKeyId || editingKeyId === 'new') {return false}@@ -255,7 +491,7 @@ export const personalAPIKeysLogic = kea<personalAPIKeysLogicType>([allOrganizations: [(s) => [s.user],- (user): OrganizationBasicType[] => {+ (user: UserType | null): OrganizationBasicType[] => {return user?.organizations ?? []},],diff --git a/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts b/frontend/src/scenes/settings/user/personalIntegrationsLogic.tsindex b41e8652a01a..441615f6d895 100644--- a/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts+++ b/frontend/src/scenes/settings/user/personalIntegrationsLogic.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'@@ -18,7 +18,8 @@ import {usersIntegrationsSlackStartCreate,} from '~/generated/core/api'-import type { personalIntegrationsLogicType } from './personalIntegrationsLogicType'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'+import type { TeamPublicType, TeamType, UserBasicType } from '../../../types'export interface PersonalGitHubIntegration {kind: 'github'@@ -88,6 +89,220 @@ function writeConnectFromStorage(value: string | null): void {}}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personalIntegrationsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ githubConnecting: boolean+ integrations: PersonalGitHubIntegration[]+ integrationsLoading: boolean+ linkableSlackWorkspaces: LinkableSlackWorkspace[]+ linkableSlackWorkspacesLoading: boolean+ slackConnect: boolean+ slackConnectLoading: boolean+ slackIntegrations: PersonalSlackIntegration[]+ slackIntegrationsLoading: boolean+ slackLinkEnabled: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personalIntegrationsLogicActions {+ loadProjectIntegrations: () => any // integrationsLogic+ projectIntegrationsLoaded: (+ 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+ connectGitHub: () => {+ value: true+ }+ connectGitHubFailure: () => {+ value: true+ }+ connectSlack: (payload?: { workspace?: LinkableSlackWorkspace }) => {+ workspace?: LinkableSlackWorkspace+ }+ connectSlackFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ connectSlackSuccess: (+ slackConnect: boolean,+ payload?: {+ workspace?: LinkableSlackWorkspace+ }+ ) => {+ slackConnect: boolean+ payload?: {+ workspace?: LinkableSlackWorkspace+ }+ }+ disconnectGitHub: (installationId: string) => {+ installationId: string+ }+ disconnectSlack: (slackUserId: string) => {+ slackUserId: string+ }+ loadIntegrations: () => any+ loadIntegrationsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadIntegrationsSuccess: (+ integrations: PersonalGitHubIntegration[],+ payload?: any+ ) => {+ integrations: PersonalGitHubIntegration[]+ payload?: any+ }+ loadLinkableSlackWorkspaces: () => any+ loadLinkableSlackWorkspacesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadLinkableSlackWorkspacesSuccess: (+ linkableSlackWorkspaces: LinkableSlackWorkspace[],+ payload?: any+ ) => {+ linkableSlackWorkspaces: LinkableSlackWorkspace[]+ payload?: any+ }+ loadSlackIntegrations: () => any+ loadSlackIntegrationsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSlackIntegrationsSuccess: (+ slackIntegrations: PersonalSlackIntegration[],+ payload?: any+ ) => {+ slackIntegrations: PersonalSlackIntegration[]+ payload?: any+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personalIntegrationsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ slackLinkEnabled: (featureFlags: FeatureFlagsSet) => boolean+ }+}++export type personalIntegrationsLogicType = MakeLogicType<+ personalIntegrationsLogicValues,+ personalIntegrationsLogicActions,+ Record<string, any>,+ personalIntegrationsLogicMeta+>+export const personalIntegrationsLogic = kea<personalIntegrationsLogicType>([path(['scenes', 'settings', 'user', 'personalIntegrationsLogic']),@@ -199,7 +414,8 @@ export const personalIntegrationsLogic = kea<personalIntegrationsLogicType>([// is hidden, not the unlink path.slackLinkEnabled: [(s) => [s.featureFlags],- (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.SLACK_APP_OAUTH],+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>+ !!featureFlags[FEATURE_FLAGS.SLACK_APP_OAUTH],],}),diff --git a/frontend/src/scenes/settings/user/pipelineNotificationsLogic.ts b/frontend/src/scenes/settings/user/pipelineNotificationsLogic.tsindex a8fec5cbd52c..2add933aac9c 100644--- a/frontend/src/scenes/settings/user/pipelineNotificationsLogic.ts+++ b/frontend/src/scenes/settings/user/pipelineNotificationsLogic.ts@@ -1,4 +1,4 @@-import { afterMount, connect, kea, path, selectors } from 'kea'+import { MakeLogicType, afterMount, connect, kea, path, selectors } from 'kea'import { loaders } from 'kea-loaders'import { subscriptions } from 'kea-subscriptions'@@ -16,8 +16,6 @@ import type {PaginatedHogFunctionMinimalListApi,} from 'products/cdp/frontend/generated/api.schemas'-import type { pipelineNotificationsLogicType } from './pipelineNotificationsLogicType'-export type PipelineKind = 'destination' | 'transformation' | 'plugin' | 'batch_export'export type PipelineItem = {@@ -49,6 +47,52 @@ function displayName(name: string | null | undefined): string {return name?.trim() || '(unnamed)'}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface pipelineNotificationsLogicValues {+ currentOrganization: OrganizationType | null // organizationLogic+ user: UserType | null // userLogic+ allPipelineIds: string[]+ isPipelineDisabled: (pipelineId: string) => boolean+ pipelines: PipelineItem[]+ pipelinesByTeam: Record<string, PipelineTeamGroup>+ pipelinesLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface pipelineNotificationsLogicActions {+ loadPipelines: () => any+ loadPipelinesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPipelinesSuccess: (+ pipelines: PipelineItem[],+ payload?: any+ ) => {+ pipelines: PipelineItem[]+ payload?: any+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface pipelineNotificationsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ allPipelineIds: (pipelines: PipelineItem[]) => string[]+ pipelinesByTeam: (pipelines: PipelineItem[]) => Record<string, PipelineTeamGroup>+ isPipelineDisabled: (user: UserType | null) => (pipelineId: string) => boolean+ }+}++export type pipelineNotificationsLogicType = MakeLogicType<+ pipelineNotificationsLogicValues,+ pipelineNotificationsLogicActions,+ Record<string, any>,+ pipelineNotificationsLogicMeta+>+export const pipelineNotificationsLogic = kea<pipelineNotificationsLogicType>([path(['scenes', 'settings', 'user', 'pipelineNotificationsLogic']),connect(() => ({diff --git a/frontend/src/scenes/settings/user/realtimeNotificationPreferencesLogic.ts b/frontend/src/scenes/settings/user/realtimeNotificationPreferencesLogic.tsindex 31979e8993ce..d22c4f018aca 100644--- a/frontend/src/scenes/settings/user/realtimeNotificationPreferencesLogic.ts+++ b/frontend/src/scenes/settings/user/realtimeNotificationPreferencesLogic.ts@@ -1,14 +1,73 @@-import { actions, connect, kea, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'import { organizationLogic } from 'scenes/organizationLogic'import { userLogic } from 'scenes/userLogic'import { TeamBasicType } from '~/types'-import type { realtimeNotificationPreferencesLogicType } from './realtimeNotificationPreferencesLogicType'+import type { OrganizationType, UserType } from '../../../types'export type ProjectState = 'on' | 'off' | 'partial'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface realtimeNotificationPreferencesLogicValues {+ currentOrganization: OrganizationType | null // organizationLogic+ user: UserType | null // userLogic+ activeTypes: string[]+ allOff: boolean+ allOn: boolean+ defaultExpanded: boolean+ disabledMap: Record<string, Record<string, boolean>>+ expandedOverrides: Record<number, boolean>+ isProjectExpanded: (teamId: number) => boolean+ isTypeEnabledForTeam: (type: string, teamId: number) => boolean+ projectState: (teamId: number) => ProjectState+ teamIds: number[]+ teams: TeamBasicType[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface realtimeNotificationPreferencesLogicActions {+ setProjectExpanded: (+ teamId: number,+ expanded: boolean+ ) => {+ expanded: boolean+ teamId: number+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface realtimeNotificationPreferencesLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ teams: (currentOrganization: OrganizationType | null) => TeamBasicType[]+ teamIds: (teams: TeamBasicType[]) => number[]+ activeTypes: (user: UserType | null) => string[]+ disabledMap: (user: UserType | null) => Record<string, Record<string, boolean>>+ defaultExpanded: (teams: TeamBasicType[]) => boolean+ isProjectExpanded: (+ expandedOverrides: Record<number, boolean>,+ defaultExpanded: boolean+ ) => (teamId: number) => boolean+ isTypeEnabledForTeam: (+ disabledMap: Record<string, Record<string, boolean>>+ ) => (type: string, teamId: number) => boolean+ projectState: (+ activeTypes: string[],+ disabledMap: Record<string, Record<string, boolean>>+ ) => (teamId: number) => ProjectState+ allOn: (teamIds: number[], projectState: (teamId: number) => ProjectState) => boolean+ allOff: (teamIds: number[], projectState: (teamId: number) => ProjectState) => boolean+ }+}++export type realtimeNotificationPreferencesLogicType = MakeLogicType<+ realtimeNotificationPreferencesLogicValues,+ realtimeNotificationPreferencesLogicActions,+ Record<string, any>,+ realtimeNotificationPreferencesLogicMeta+>+export const realtimeNotificationPreferencesLogic = kea<realtimeNotificationPreferencesLogicType>([path(['scenes', 'settings', 'user', 'realtimeNotificationPreferencesLogic']),connect({@@ -28,16 +87,18 @@ export const realtimeNotificationPreferencesLogic = kea<realtimeNotificationPrefselectors(() => ({teams: [(s) => [s.currentOrganization],- (currentOrganization): TeamBasicType[] => currentOrganization?.teams ?? [],+ (currentOrganization: null | import('~/types').OrganizationType): TeamBasicType[] =>+ currentOrganization?.teams ?? [],],teamIds: [(s) => [s.teams], (teams: TeamBasicType[]): number[] => teams.map((t) => t.id)],activeTypes: [() => [userLogic.selectors.user],- (user): string[] => (user?.active_realtime_notification_types ?? []) as string[],+ (user: null | import('~/types').UserType): string[] =>+ (user?.active_realtime_notification_types ?? []) as string[],],disabledMap: [() => [userLogic.selectors.user],- (user): Record<string, Record<string, boolean>> =>+ (user: null | import('~/types').UserType): Record<string, Record<string, boolean>> =>user?.notification_settings?.realtime_notifications_disabled ?? {},],defaultExpanded: [(s) => [s.teams], (teams: TeamBasicType[]): boolean => teams.length <= 3],@@ -49,13 +110,13 @@ export const realtimeNotificationPreferencesLogic = kea<realtimeNotificationPref],isTypeEnabledForTeam: [(s) => [s.disabledMap],- (disabledMap) =>+ (disabledMap: Record<string, Record<string, boolean>>) =>(type: string, teamId: number): boolean =>!disabledMap[type]?.[String(teamId)],],projectState: [(s) => [s.activeTypes, s.disabledMap],- (activeTypes, disabledMap) =>+ (activeTypes: string[], disabledMap: Record<string, Record<string, boolean>>) =>(teamId: number): ProjectState => {if (activeTypes.length === 0) {return 'on'diff --git a/frontend/src/scenes/settings/user/remindersLogic.ts b/frontend/src/scenes/settings/user/remindersLogic.tsindex 36eae63d4da3..05c98c83add0 100644--- a/frontend/src/scenes/settings/user/remindersLogic.ts+++ b/frontend/src/scenes/settings/user/remindersLogic.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 { dayjs } from 'lib/dayjs'@@ -16,7 +17,8 @@ import {} from 'products/reminders/frontend/generated/api'import { RecurrenceIntervalEnumApi, ReminderApi } from 'products/reminders/frontend/generated/api.schemas'-import type { remindersLogicType } from './remindersLogicType'+import type { PreflightStatus } from '../../../types'+import type { OrganizationType } from '../../../types'export type ReminderScheduleType = 'one-off' | 'repeats' | 'advanced'@@ -54,6 +56,132 @@ function scheduleTypeForReminder(reminder: ReminderApi): ReminderScheduleType {return 'one-off'}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface remindersLogicValues {+ currentOrganization: OrganizationType | null // organizationLogic+ preflight: PreflightStatus | null // preflightLogic+ editingReminder: ReminderApi | null+ editingReminderId: string | null+ isReminderFormSubmitting: boolean+ isReminderFormValid: boolean+ isScheduleEditable: boolean+ projectOptions: {+ label: string+ value: number | null+ }[]+ reminderForm: ReminderFormValues+ reminderFormAllErrors: Record<string, any>+ reminderFormChanged: boolean+ reminderFormErrors: DeepPartialMap<ReminderFormValues, ValidationErrorType>+ reminderFormHasErrors: boolean+ reminderFormManualErrors: Record<string, any>+ reminderFormTouched: boolean+ reminderFormTouches: Record<string, boolean>+ reminderFormValidationErrors: DeepPartialMap<ReminderFormValues, ValidationErrorType>+ reminders: ReminderApi[]+ remindersLoading: boolean+ showReminderFormErrors: boolean+ timezoneOptions: {+ key: string+ label: string+ }[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface remindersLogicActions {+ deleteReminder: (id: string) => string+ deleteReminderFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteReminderSuccess: (+ reminders: ReminderApi[],+ payload?: string+ ) => {+ reminders: ReminderApi[]+ payload?: string+ }+ loadReminders: () => any+ loadRemindersFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadRemindersSuccess: (+ reminders: ReminderApi[],+ payload?: any+ ) => {+ reminders: ReminderApi[]+ payload?: any+ }+ resetReminderForm: (values?: ReminderFormValues) => {+ values?: ReminderFormValues+ }+ setEditingReminderId: (id: string | null) => {+ id: string | null+ }+ setReminderFormManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setReminderFormValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setReminderFormValues: (values: DeepPartial<ReminderFormValues>) => {+ values: DeepPartial<ReminderFormValues>+ }+ submitReminderForm: () => {+ value: boolean+ }+ submitReminderFormFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitReminderFormRequest: (reminderForm: ReminderFormValues) => {+ reminderForm: ReminderFormValues+ }+ submitReminderFormSuccess: (reminderForm: ReminderFormValues) => {+ reminderForm: ReminderFormValues+ }+ touchReminderFormField: (key: string) => {+ key: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface remindersLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ editingReminder: (editingReminderId: string | null, reminders: ReminderApi[]) => ReminderApi | null+ isScheduleEditable: (editingReminderId: string | null, editingReminder: ReminderApi | null) => boolean+ projectOptions: (currentOrganization: OrganizationType | null) => {+ label: string+ value: number | null+ }[]+ timezoneOptions: (preflight: PreflightStatus | null) => {+ key: string+ label: string+ }[]+ }+}++export type remindersLogicType = MakeLogicType<+ remindersLogicValues,+ remindersLogicActions,+ Record<string, any>,+ remindersLogicMeta+>+export const remindersLogic = kea<remindersLogicType>([path(['scenes', 'settings', 'user', 'remindersLogic']),connect(() => ({@@ -156,26 +284,28 @@ export const remindersLogic = kea<remindersLogicType>([selectors({editingReminder: [(s) => [s.editingReminderId, s.reminders],- (editingReminderId, reminders): ReminderApi | null =>+ (editingReminderId: string | null, reminders: ReminderApi[]): ReminderApi | null =>editingReminderId && editingReminderId !== NEW? (reminders.find((reminder) => reminder.id === editingReminderId) ?? null): null,],isScheduleEditable: [(s) => [s.editingReminderId, s.editingReminder],- (editingReminderId, editingReminder): boolean =>+ (editingReminderId: string | null, editingReminder: ReminderApi | null): boolean =>editingReminderId === NEW || editingReminder?.status === 'active',],projectOptions: [(s) => [s.currentOrganization],- (currentOrganization): { value: number | null; label: string }[] => [+ (+ currentOrganization: null | import('../../../types').OrganizationType+ ): { value: number | null; label: string }[] => [{ value: null, label: 'Organization-wide (no project)' },...(currentOrganization?.teams ?? []).map((team) => ({ value: team.id, label: team.name })),],],timezoneOptions: [(s) => [s.preflight],- (preflight): { key: string; label: string }[] =>+ (preflight: null | import('../../../types').PreflightStatus): { key: string; label: string }[] =>Object.entries(preflight?.available_timezones ?? {}).map(([tz, offset]) => ({key: tz,label: timeZoneLabel(tz, offset),diff --git a/frontend/src/scenes/settings/user/userDangerZoneLogic.ts b/frontend/src/scenes/settings/user/userDangerZoneLogic.tsindex 30f99232f94e..f29a34aea1d1 100644--- a/frontend/src/scenes/settings/user/userDangerZoneLogic.ts+++ b/frontend/src/scenes/settings/user/userDangerZoneLogic.ts@@ -1,4 +1,4 @@-import { kea } from 'kea'+import { MakeLogicType, kea } from 'kea'import { router } from 'kea-router'import api from 'lib/api'@@ -8,7 +8,51 @@ import { urls } from 'scenes/urls'import type { OrganizationBasicType } from '~/types'-import type { userDangerZoneLogicType } from './userDangerZoneLogicType'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface userDangerZoneLogicValues {+ _leaveOrganization: null+ _leaveOrganizationLoading: boolean+ deleteUserModalOpen: boolean+ deletedOrganizationIds: string[]+ isUserDeletionConfirmed: boolean+ organizationToDelete: OrganizationBasicType | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface userDangerZoneLogicActions {+ deleteOrganizationSuccess: ({ redirectPath }: { redirectPath?: string }) => {+ redirectPath: string | undefined+ } // organizationLogic+ addDeletedOrganizationId: (id: string) => {+ id: string+ }+ leaveOrganization: (organizationId: string) => string+ leaveOrganizationFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ leaveOrganizationSuccess: (+ _leaveOrganization: null,+ payload?: string+ ) => {+ _leaveOrganization: null+ payload?: string+ }+ setDeleteUserModalOpen: (open: boolean) => {+ open: boolean+ }+ setIsUserDeletionConfirmed: (confirmed: boolean) => {+ confirmed: boolean+ }+ setOrganizationToDelete: (organization: OrganizationBasicType | null) => {+ organization: OrganizationBasicType | null+ }+}++export type userDangerZoneLogicType = MakeLogicType<userDangerZoneLogicValues, userDangerZoneLogicActions>export const userDangerZoneLogic = kea<userDangerZoneLogicType>({path: ['scenes', 'settings', 'user', 'userDangerZoneLogic'],diff --git a/frontend/src/scenes/teamLogic.tsx b/frontend/src/scenes/teamLogic.tsxindex e9120e9949e9..523c52232c60 100644--- a/frontend/src/scenes/teamLogic.tsx+++ b/frontend/src/scenes/teamLogic.tsx@@ -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 posthog from 'posthog-js'@@ -24,9 +24,9 @@ import { customProductsLogic } from '~/layout/panel-layout/ProjectTree/customProimport { CurrencyCode, CustomerAnalyticsConfig, ProductKey } from '~/queries/schema/schema-general'import { CorrelationConfigType, ProjectType, TeamPublicType, TeamType } from '~/types'+import type { FeatureFlagsSet } from '../lib/logic/featureFlagLogic'import { organizationLogic } from './organizationLogic'import { projectLogic } from './projectLogic'-import type { teamLogicType } from './teamLogicType'import { userLogic } from './userLogic'const parseUpdatedAttributeName = (attr: keyof TeamType | null): string => {@@ -56,6 +56,237 @@ export interface FrequentMistakeAdvice {fix: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface teamLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentProject: ProjectType | null // projectLogic+ baseCurrency: CurrencyCode+ currentProjectId: number | string+ currentTeam: TeamPublicType | TeamType | null+ currentTeamId: number | null+ currentTeamIdStrict: number | string+ currentTeamLoading: boolean+ customerAnalyticsConfig: CustomerAnalyticsConfig+ demoOnlyProject: boolean+ funnelCorrelationConfig: CorrelationConfigType+ hasOnboardedAnyProduct: boolean+ isCurrentTeamUnavailable: boolean+ isTeamTokenResetAvailable: boolean+ teamBeingDeleted: TeamType | null+ testAccountFilterFrequentMistakes: FrequentMistakeAdvice[]+ timezone: string+ weekStartDay: number+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface teamLogicActions {+ loadCustomProducts: () => any // customProductsLogic+ loadCurrentOrganization: () => any // organizationLogic+ loadCurrentProjectSuccess: (+ currentProject: ProjectType | null,+ payload?: any+ ) => {+ currentProject: ProjectType | null+ payload?: any+ } // projectLogic+ loadUser: (resetOnFailure?: boolean) => {+ resetOnFailure: boolean | undefined+ } // userLogic+ switchTeam: (+ teamId: number | string,+ destination?: string+ ) => {+ destination: string | undefined+ teamId: number | string+ } // userLogic+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties+ addProductIntentFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ addProductIntentForCrossSell: (properties: ProductCrossSellProperties) => ProductCrossSellProperties+ addProductIntentForCrossSellFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ addProductIntentForCrossSellSuccess: (+ currentTeam: TeamType | null,+ payload?: ProductCrossSellProperties+ ) => {+ currentTeam: TeamType | null+ payload?: ProductCrossSellProperties+ }+ addProductIntentSuccess: (+ currentTeam: TeamType | null,+ payload?: ProductIntentProperties+ ) => {+ currentTeam: TeamType | null+ payload?: ProductIntentProperties+ }+ createTeam: ({ name, is_demo }: { is_demo: boolean; name: string }) => {+ name: string+ is_demo: boolean+ }+ createTeamFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ createTeamSuccess: (+ currentTeam: TeamPublicType | TeamType | null,+ payload?: {+ name: string+ is_demo: boolean+ }+ ) => {+ currentTeam: TeamPublicType | TeamType | null+ payload?: {+ name: string+ is_demo: boolean+ }+ }+ deleteSecretTokenBackup: () => any+ deleteSecretTokenBackupFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deleteSecretTokenBackupSuccess: (+ currentTeam: TeamPublicType | TeamType | null,+ payload?: any+ ) => {+ currentTeam: TeamPublicType | TeamType | null+ payload?: any+ }+ deleteTeam: (team: TeamType) => {+ team: TeamType+ }+ deleteTeamFailure: () => {+ value: true+ }+ deleteTeamSuccess: () => {+ value: true+ }+ loadCurrentTeam: () => any+ loadCurrentTeamFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCurrentTeamSuccess: (+ currentTeam: TeamPublicType | null,+ payload?: any+ ) => {+ currentTeam: TeamPublicType | null+ payload?: any+ }+ recordProductIntentOnboardingComplete: ({ product_type }: { product_type: ProductKey }) => {+ product_type: ProductKey+ }+ recordProductIntentOnboardingCompleteFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ recordProductIntentOnboardingCompleteSuccess: (+ currentTeam: TeamPublicType | TeamType | null,+ payload?: {+ product_type: ProductKey+ }+ ) => {+ currentTeam: TeamPublicType | TeamType | null+ payload?: {+ product_type: ProductKey+ }+ }+ resetToken: () => any+ resetTokenFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ resetTokenSuccess: (+ currentTeam: TeamPublicType | TeamType | null,+ payload?: any+ ) => {+ currentTeam: TeamPublicType | TeamType | null+ payload?: any+ }+ rotateSecretToken: () => any+ rotateSecretTokenFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ rotateSecretTokenSuccess: (+ currentTeam: TeamPublicType | TeamType | null,+ payload?: any+ ) => {+ currentTeam: TeamPublicType | TeamType | null+ payload?: any+ }+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType>+ updateCurrentTeamFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ updateCurrentTeamSuccess: (+ currentTeam: TeamPublicType | TeamType,+ payload?: Partial<TeamType>+ ) => {+ currentTeam: TeamPublicType | TeamType+ payload?: Partial<TeamType>+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface teamLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ hasOnboardedAnyProduct: (currentTeam: TeamPublicType | TeamType | null) => boolean+ currentTeamId: (currentTeam: TeamPublicType | TeamType | null) => number | null+ currentTeamIdStrict: (currentTeam: TeamPublicType | TeamType | null) => number | string+ currentProjectId: (currentTeam: TeamPublicType | TeamType | null) => number | string+ isCurrentTeamUnavailable: (+ currentTeam: TeamPublicType | TeamType | null,+ currentTeamLoading: boolean+ ) => boolean+ demoOnlyProject: (+ currentTeam: TeamPublicType | TeamType | null,+ currentOrganization: null | import('~/types').OrganizationType+ ) => boolean+ funnelCorrelationConfig: (currentTeam: TeamPublicType | TeamType | null) => CorrelationConfigType+ timezone: (currentTeam: TeamPublicType | TeamType | null) => string+ weekStartDay: (currentTeam: TeamPublicType | TeamType | null) => number+ isTeamTokenResetAvailable: (currentTeam: TeamPublicType | TeamType | null) => boolean+ testAccountFilterFrequentMistakes: (currentTeam: TeamPublicType | TeamType | null) => FrequentMistakeAdvice[]+ baseCurrency: (currentTeam: TeamPublicType | TeamType | null) => CurrencyCode+ customerAnalyticsConfig: (currentTeam: TeamPublicType | TeamType | null) => CustomerAnalyticsConfig+ }+}++export type teamLogicType = MakeLogicType<teamLogicValues, teamLogicActions, Record<string, any>, teamLogicMeta>+export const teamLogic = kea<teamLogicType>([path(['scenes', 'teamLogic']),connect(() => ({@@ -244,7 +475,7 @@ export const teamLogic = kea<teamLogicType>([selectors(() => ({hasOnboardedAnyProduct: [(selectors) => [selectors.currentTeam],- (currentTeam): boolean => {+ (currentTeam: TeamPublicType | TeamType | null): boolean => {if (currentTeam &&!currentTeam.completed_snippet_onboarding &&@@ -257,7 +488,7 @@ export const teamLogic = kea<teamLogicType>([],currentTeamId: [(selectors) => [selectors.currentTeam],- (currentTeam): number | null => (currentTeam ? currentTeam.id : null),+ (currentTeam: TeamPublicType | TeamType | null): number | null => (currentTeam ? currentTeam.id : null),],// currentTeamIdStrict is currentTeamId with throwing an error to be consistent with the// newly introduced currentProjectId and currentOrganizationId. To not cause a breaking change@@ -265,7 +496,7 @@ export const teamLogic = kea<teamLogicType>([// currentTeamId and so that currentTeamIdStrict can be removed.currentTeamIdStrict: [(selectors) => [selectors.currentTeam],- (currentTeam): number | string => {+ (currentTeam: TeamPublicType | TeamType | null): number | string => {if (!currentTeam || !currentTeam.id) {// TODO: Fix callers that access currentTeamIdStrict before the team is loaded,// then restore the throw. Temporarily falling back to "@current" to avoid crashes.@@ -280,7 +511,7 @@ export const teamLogic = kea<teamLogicType>([],currentProjectId: [(selectors) => [selectors.currentTeam],- (currentTeam): number | string => {+ (currentTeam: TeamPublicType | TeamType | null): number | string => {if (!currentTeam || !currentTeam.project_id) {// TODO: Fix callers that access currentProjectId before the team is loaded,// then restore the throw. Temporarily falling back to "@current" to avoid crashes.@@ -296,37 +527,43 @@ export const teamLogic = kea<teamLogicType>([isCurrentTeamUnavailable: [(selectors) => [selectors.currentTeam, selectors.currentTeamLoading],// If project has been loaded and is still null, it means the user just doesn't have access.- (currentTeam, currentTeamLoading): boolean =>+ (currentTeam: TeamPublicType | TeamType | null, currentTeamLoading: boolean): boolean =>(!currentTeam?.effective_membership_level || currentTeam.user_access_level === 'none') &&!currentTeamLoading,],demoOnlyProject: [(selectors) => [selectors.currentTeam, organizationLogic.selectors.currentOrganization],- (currentTeam, currentOrganization): boolean =>+ (+ currentTeam: TeamPublicType | TeamType | null,+ currentOrganization: null | import('~/types').OrganizationType+ ): boolean =>(currentTeam?.is_demo && currentOrganization?.teams && currentOrganization.teams.length == 1) || false,],funnelCorrelationConfig: [(selectors) => [selectors.currentTeam],- (currentTeam): CorrelationConfigType => {+ (currentTeam: TeamPublicType | TeamType | null): CorrelationConfigType => {return currentTeam?.correlation_config || {}},],- timezone: [(selectors) => [selectors.currentTeam], (currentTeam): string => currentTeam?.timezone || 'UTC'],+ timezone: [+ (selectors) => [selectors.currentTeam],+ (currentTeam: TeamPublicType | TeamType | null): string => currentTeam?.timezone || 'UTC',+ ],/** 0 means Sunday, 1 means Monday. */weekStartDay: [(selectors) => [selectors.currentTeam],- (currentTeam): number => currentTeam?.week_start_day || 0,+ (currentTeam: TeamPublicType | TeamType | null): number => currentTeam?.week_start_day || 0,],isTeamTokenResetAvailable: [(selectors) => [selectors.currentTeam],- (currentTeam): boolean =>+ (currentTeam: TeamPublicType | TeamType | null): boolean =>(!!currentTeam?.effective_membership_level &¤tTeam.effective_membership_level >= OrganizationMembershipLevel.Admin) ||currentTeam?.user_access_level === 'admin',],testAccountFilterFrequentMistakes: [(selectors) => [selectors.currentTeam],- (currentTeam): FrequentMistakeAdvice[] => {+ (currentTeam: TeamPublicType | TeamType | null): FrequentMistakeAdvice[] => {if (!currentTeam) {return []}diff --git a/frontend/src/scenes/trends/mathsLogic.tsx b/frontend/src/scenes/trends/mathsLogic.tsxindex 40301fb12b48..6c0c952393f9 100644--- a/frontend/src/scenes/trends/mathsLogic.tsx+++ b/frontend/src/scenes/trends/mathsLogic.tsx@@ -1,4 +1,4 @@-import { connect, kea, path, selectors } from 'kea'+import { MakeLogicType, connect, kea, path, selectors } from 'kea'import { groupsAccessLogic } from 'lib/introductions/groupsAccessLogic'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'@@ -14,7 +14,9 @@ import {PropertyMathType,} from '~/types'-import type { mathsLogicType } from './mathsLogicType'+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'+import type { Noun } from '../../models/groupsModel'+import type { GroupType, GroupTypeIndex } from '../../types'export enum MathCategory {EventCount,@@ -426,6 +428,39 @@ export function apiValueToMathType(math: string | undefined, groupTypeIndex: numreturn assembledMath as MathType}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface mathsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ canStartUsingGroups: boolean // groupsAccessLogic+ needsUpgradeForGroups: boolean // groupsAccessLogic+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel+ calendarHeatmapMathDefinitions: Partial<Record<string, MathDefinition>>+ funnelMathDefinitions: Partial<Record<string, MathDefinition>>+ groupsMathDefinitions: Partial<Record<string, MathDefinition>>+ mathDefinitions: Partial<Record<string, MathDefinition>>+ staticActorsOnlyMathDefinitions: Partial<Record<string, MathDefinition>>+ staticMathDefinitions: Partial<Record<string, MathDefinition>>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface mathsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ mathDefinitions: (+ groupsMathDefinitions: Partial<Record<string, MathDefinition>>+ ) => Partial<Record<string, MathDefinition>>+ staticActorsOnlyMathDefinitions: (+ staticMathDefinitions: Partial<Record<string, MathDefinition>>+ ) => Partial<Record<string, MathDefinition>>+ groupsMathDefinitions: (+ groupTypes: Map<GroupTypeIndex, GroupType>,+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun+ ) => Partial<Record<string, MathDefinition>>+ }+}++export type mathsLogicType = MakeLogicType<mathsLogicValues, {}, Record<string, any>, mathsLogicMeta>+export const mathsLogic = kea<mathsLogicType>([path(['scenes', 'trends', 'mathsLogic']),connect(() => ({@@ -441,7 +476,9 @@ export const mathsLogic = kea<mathsLogicType>([selectors({mathDefinitions: [(s) => [s.groupsMathDefinitions],- (groupsMathDefinitions): Partial<Record<string, MathDefinition>> => {+ (+ groupsMathDefinitions: Partial<Record<string, MathDefinition>>+ ): Partial<Record<string, MathDefinition>> => {const allMathDefinitions: Partial<Record<string, MathDefinition>> = {...BASE_MATH_DEFINITIONS,...groupsMathDefinitions,@@ -470,7 +507,9 @@ export const mathsLogic = kea<mathsLogicType>([staticMathDefinitions: [() => [], (): Partial<Record<string, MathDefinition>> => BASE_MATH_DEFINITIONS],staticActorsOnlyMathDefinitions: [(s) => [s.staticMathDefinitions],- (staticMathDefinitions): Partial<Record<string, MathDefinition>> => {+ (+ staticMathDefinitions: Partial<Record<string, MathDefinition>>+ ): Partial<Record<string, MathDefinition>> => {return Object.fromEntries(Object.entries(staticMathDefinitions).filter(([, mathDefinition]) => mathDefinition?.category === MathCategory.ActorCount@@ -481,7 +520,13 @@ export const mathsLogic = kea<mathsLogicType>([// Definitions based on group types present in the projectgroupsMathDefinitions: [(s) => [s.groupTypes, s.aggregationLabel],- (groupTypes, aggregationLabel): Partial<Record<string, MathDefinition>> =>+ (+ groupTypes: Map<import('~/types').GroupTypeIndex, import('~/types').GroupType>,+ aggregationLabel: (+ groupTypeIndex: number | null | undefined,+ deferToUserWording?: boolean+ ) => import('~/models/groupsModel').Noun+ ): Partial<Record<string, MathDefinition>> =>Object.fromEntries(Array.from(groupTypes.values()).map((groupType) => [diff --git a/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts b/frontend/src/scenes/trends/persons-modal/personsModalLogic.tsindex 9d3c35c08677..c12309f837d9 100644--- a/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts+++ b/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts@@ -1,4 +1,16 @@-import { actions, afterMount, connect, kea, listeners, path, props, propsChanged, reducers, selectors } from 'kea'+import {+ MakeLogicType,+ actions,+ afterMount,+ connect,+ kea,+ listeners,+ path,+ props,+ propsChanged,+ reducers,+ selectors,+} from 'kea'import { loaders } from 'kea-loaders'import { combineUrl, router, urlToAction } from 'kea-router'@@ -48,7 +60,9 @@ import {UniversalFilterValue,} from '~/types'-import type { personsModalLogicType } from './personsModalLogicType'+import type { Noun } from '../../../models/groupsModel'+import type { InsightQueryNode } from '../../../queries/schema/schema-general'+import type { GroupType, GroupTypeIndex } from '../../../types'const RESULTS_PER_PAGE = 100@@ -143,6 +157,158 @@ export interface ListActorsResponse {offset?: number // Offset for HogQL queries}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personsModalLogicValues {+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel+ groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel+ currentTeamId: number | null // teamLogic+ actorLabel: Noun+ actors: ActorType[]+ actorsQuery: ActorsQuery | null+ actorsResponse: ListActorsResponse | null+ actorsResponseLoading: boolean+ errorObject: Record<string, any> | null+ exploreUrl: string | null+ insightActorsQueryOptions: InsightActorsQueryOptionsResponse | null+ insightActorsQueryOptionsLoading: boolean+ insightEventsQueryUrl: string | null+ isCohortModalOpen: boolean+ isModalOpen: boolean+ missingActorsCount: number+ propertiesTimelineFilterFromUrl: PropertiesTimelineFilterType+ query: FunnelsActorsQuery | InsightActorsQuery | null+ recordingFilters: Partial<RecordingUniversalFilters>+ searchTerm: string+ selectFields: string[]+ sessionIdsFromLoadedActors: string[]+ validationError: string | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personsModalLogicActions {+ reportPersonsModalSearched: (params: { actorType?: string; teamId?: number | null }) => {+ params: {+ actorType?: string | undefined+ teamId?: number | null | undefined+ }+ } // eventUsageLogic+ reportPersonsModalViewed: (params: any) => {+ params: any+ } // eventUsageLogic+ closeModal: () => boolean+ loadActors: ({ url, clear, offset }: { clear?: boolean; offset?: number; url?: string | null }) => {+ clear: boolean | undefined+ offset: number | undefined+ url: string | null | undefined+ }+ loadActorsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadActorsQueryOptions: (query: FunnelsActorsQuery | InsightActorsQuery) => {+ query: FunnelsActorsQuery | InsightActorsQuery<InsightQueryNode>+ }+ loadActorsQueryOptionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadActorsQueryOptionsSuccess: (+ insightActorsQueryOptions:+ | InsightActorsQueryOptionsResponse+ | {+ [k: string]: any+ }+ | null,+ payload?: {+ query: FunnelsActorsQuery | InsightActorsQuery<InsightQueryNode>+ }+ ) => {+ insightActorsQueryOptions:+ | InsightActorsQueryOptionsResponse+ | {+ [k: string]: any+ }+ | null+ payload?: {+ query: FunnelsActorsQuery | InsightActorsQuery<InsightQueryNode>+ }+ }+ loadActorsSuccess: (+ actorsResponse: ListActorsResponse | null,+ payload?: {+ clear: boolean | undefined+ offset: number | undefined+ url: string | null | undefined+ }+ ) => {+ actorsResponse: ListActorsResponse | null+ payload?: {+ clear: boolean | undefined+ offset: number | undefined+ url: string | null | undefined+ }+ }+ loadNextActors: () => {+ value: true+ }+ resetActors: () => boolean+ saveAsCohort: (cohortName: string) => {+ cohortName: string+ }+ setIsCohortModalOpen: (isOpen: boolean) => {+ isOpen: boolean+ }+ setSearchTerm: (search: string) => {+ search: string+ }+ updateActorsQuery: (query: Partial<InsightActorsQuery> | Partial<FunnelsActorsQuery>) => {+ query: Partial<InsightActorsQuery<InsightQueryNode>> | Partial<FunnelsActorsQuery>+ }+ updateQuery: (query: FunnelsActorsQuery | InsightActorsQuery) => {+ query: FunnelsActorsQuery | InsightActorsQuery<InsightQueryNode>+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface personsModalLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ actorLabel: (+ actors: ActorType[],+ aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun+ ) => Noun+ validationError: (errorObject: Record<string, any> | null) => string | null+ propertiesTimelineFilterFromUrl: (arg: any) => PropertiesTimelineFilterType+ selectFields: (arg: any) => string[]+ actorsQuery: (+ arg: any,+ query: FunnelsActorsQuery | InsightActorsQuery<InsightQueryNode> | null,+ searchTerm: string,+ selectFields: string[]+ ) => ActorsQuery | null+ exploreUrl: (actorsQuery: ActorsQuery | null) => string | null+ insightEventsQueryUrl: (actorsQuery: ActorsQuery | null) => string | null+ sessionIdsFromLoadedActors: (actors: ActorType[]) => string[]+ recordingFilters: (+ actorsQuery: ActorsQuery | null,+ propertiesTimelineFilterFromUrl: PropertiesTimelineFilterType,+ sessionIdsFromLoadedActors: string[]+ ) => Partial<RecordingUniversalFilters>+ }+}++export type personsModalLogicType = MakeLogicType<+ personsModalLogicValues,+ personsModalLogicActions,+ PersonModalLogicProps,+ personsModalLogicMeta+>+export const personsModalLogic = kea<personsModalLogicType>([path(['scenes', 'trends', 'personsModalLogic']),props({} as PersonModalLogicProps),@@ -404,7 +570,13 @@ export const personsModalLogic = kea<personsModalLogicType>([selectors({actorLabel: [(s) => [s.actors, s.aggregationLabel],- (actors, aggregationLabel) => {+ (+ actors: ActorType[],+ aggregationLabel: (+ groupTypeIndex: number | null | undefined,+ deferToUserWording?: boolean+ ) => import('~/models/groupsModel').Noun+ ) => {const firstResult = actors[0]if (!firstResult) {@@ -418,7 +590,7 @@ export const personsModalLogic = kea<personsModalLogicType>([],validationError: [(s) => [s.errorObject],- (errorObject): string | null => {+ (errorObject: Record<string, any> | null): string | null => {return extractValidationError(errorObject)},],@@ -457,7 +629,12 @@ export const personsModalLogic = kea<personsModalLogicType>([],actorsQuery: [(s) => [(_, p) => p.orderBy, s.query, s.searchTerm, s.selectFields],- (orderBy, query, searchTerm, selectFields): ActorsQuery | null => {+ (+ orderBy,+ query: FunnelsActorsQuery | InsightActorsQuery | null,+ searchTerm: string,+ selectFields: string[]+ ): ActorsQuery | null => {if (!query) {return null}@@ -482,7 +659,7 @@ export const personsModalLogic = kea<personsModalLogicType>([],exploreUrl: [(s) => [s.actorsQuery],- (actorsQuery): string | null => {+ (actorsQuery: ActorsQuery | null): string | null => {if (!actorsQuery) {return null}diff --git a/frontend/src/scenes/trends/trendsDataLogic.ts b/frontend/src/scenes/trends/trendsDataLogic.tsindex 421e50941594..5d1109bb310a 100644--- a/frontend/src/scenes/trends/trendsDataLogic.ts+++ b/frontend/src/scenes/trends/trendsDataLogic.ts@@ -1,4 +1,4 @@-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 { DataColorTheme, DataColorToken } from 'lib/colors'import { dayjs } from 'lib/dayjs'@@ -44,7 +44,43 @@ import {TrendResult,} from '~/types'-import type { trendsDataLogicType } from './trendsDataLogicType'+import type { Intervals } from '../../lib/components/IntervalFilter/intervals'+import type {+ AnyDataWarehouseNode,+ AnyEntityNode,+ CompareFilter,+ DataWarehouseNode,+ ErrorTrackingQueryResponse,+ EventsQueryResponse,+ FunnelsQuery,+ GoalLine,+ GroupNode,+ HogQLAutocompleteResponse,+ HogQLMetadataResponse,+ HogQLQueryResponse,+ HogQueryResponse,+ InsightFilter,+ LifecycleFilter,+ LogAttributesQueryResponse,+ LogValuesQueryResponse,+ LogsQueryResponse,+ MetricsQueryResponse,+ PathsQuery,+ ResultCustomizationByPosition,+ ResultCustomizationByValue,+ RetentionQuery,+ SessionsQueryResponse,+ StickinessFilter,+ StickinessQuery,+ TraceSpansAggregationQueryResponse,+ TraceSpansAttributeBreakdownQueryResponse,+ TraceSpansQueryResponse,+ TraceSpansTreeQueryResponse,+ TrendsFormulaNode,+ VizSpecificOptions,+ WebOverviewQuery,+ WebStatsTableQuery,+} from '../../queries/schema/schema-general'import { IndexedTrendResult } from './types'export const RESULT_CUSTOMIZATION_DEFAULT = ResultCustomizationBy.Value@@ -69,6 +105,322 @@ export const INTERVAL_TO_DEFAULT_MOVING_AVERAGE_PERIOD: Record<IntervalType, numconst DEFAULT_CONFIDENCE_LEVEL = 95+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface trendsDataLogicValues {+ showPersonsModal: boolean // insightLogic+ breakdownFilter: BreakdownFilter | null | undefined // insightVizDataLogic+ compareFilter: CompareFilter | null | undefined // insightVizDataLogic+ display: ChartDisplayType | null | undefined // insightVizDataLogic+ enabledIntervals: Intervals // insightVizDataLogic+ formula: string | null | undefined // insightVizDataLogic+ formulaNodes: TrendsFormulaNode[] // insightVizDataLogic+ getTheme: (themeId: number | string | null | undefined) => DataColorTheme | null // insightVizDataLogic+ goalLines: GoalLine[] | null | undefined // insightVizDataLogic+ hasDataWarehouseSeries: boolean // insightVizDataLogic+ hasLegend: boolean // insightVizDataLogic+ insightData: Record<string, any> // insightVizDataLogic+ insightDataLoading: boolean // insightVizDataLogic+ insightFilter: InsightFilter | null | undefined // insightVizDataLogic+ interval: IntervalType | null | undefined // insightVizDataLogic+ isBreakdownSeries: boolean // insightVizDataLogic+ isLifecycle: boolean // insightVizDataLogic+ isNonTimeSeriesDisplay: boolean // insightVizDataLogic+ isSingleSeriesDefinition: boolean // insightVizDataLogic+ isSingleSeriesOutput: boolean // insightVizDataLogic+ isStickiness: boolean // insightVizDataLogic+ isTrends: boolean // insightVizDataLogic+ legendPosition: string | null | undefined // insightVizDataLogic+ lifecycleFilter: LifecycleFilter | null | undefined // insightVizDataLogic+ querySource:+ | FunnelsQuery+ | LifecycleQuery+ | PathsQuery+ | RetentionQuery+ | StickinessQuery+ | TrendsQuery+ | WebOverviewQuery+ | WebStatsTableQuery+ | null // insightVizDataLogic+ resultCustomizationByRaw: ResultCustomizationBy | null | undefined // insightVizDataLogic+ series: (AnyEntityNode<AnyDataWarehouseNode> | GroupNode<DataWarehouseNode>)[] | null | undefined // insightVizDataLogic+ showAnnotations: boolean | null | undefined // insightVizDataLogic+ showLabelOnSeries: boolean | null | undefined // insightVizDataLogic+ showLegend: boolean | null | undefined // insightVizDataLogic+ showMultipleYAxes: boolean | null | undefined // insightVizDataLogic+ showPercentStackView: boolean | null | undefined // insightVizDataLogic+ showPercentagesOnSeries: boolean | null | undefined // insightVizDataLogic+ showValuesOnSeries: boolean | null | undefined // insightVizDataLogic+ stickinessFilter: StickinessFilter | null | undefined // insightVizDataLogic+ supportsPercentStackView: boolean // insightVizDataLogic+ theme: DataColorTheme | null // insightVizDataLogic+ trendsFilter: TrendsFilter | null | undefined // insightVizDataLogic+ vizSpecificOptions: VizSpecificOptions | null | undefined // insightVizDataLogic+ yAxisScaleType: string | null | undefined // insightVizDataLogic+ alertSeries: EventsNode[]+ areAllSeriesVisible: boolean+ breakdownValuesLoading: boolean+ confidenceLevel: number+ currentPeriodResult: IndexedTrendResult | undefined+ getIsOnlyVisibleSeriesInLegend: (dataset: IndexedTrendResult) => boolean+ getTrendsColor: (dataset: IndexedTrendResult) => string+ getTrendsColorToken: (dataset: IndexedTrendResult) => [DataColorTheme | null, DataColorToken | null]+ getTrendsHidden: (dataset: IndexedTrendResult) => boolean+ hasBreakdownMore: boolean+ hasPersonsModal: boolean+ hoveredDatasetIndex: number | null+ incompletenessOffsetFromEnd: number+ indexedResults: IndexedTrendResult[]+ isBreakdownValid: boolean+ labelGroupType: number | 'none' | 'people'+ legendSeriesIsolationMenuEligible: boolean+ mightContainFractionalNumbers: boolean+ movingAverageIntervals: number+ pieChartVizOptions:+ | {+ disableHoverOffset?: boolean | undefined+ hideAggregation?: boolean | undefined+ }+ | undefined+ resultCustomizationBy: ResultCustomizationBy+ resultCustomizations:+ | Record<string, ResultCustomizationByValue>+ | Record<number, ResultCustomizationByPosition>+ | undefined+ results: TrendResult[]+ showConfidenceIntervals: boolean+ showLegendIsolateSeriesItem: boolean+ showMovingAverage: boolean+ showTrendLines: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface trendsDataLogicActions {+ setInsightData: (+ response:+ | ErrorTrackingQueryResponse+ | EventsQueryResponse+ | HogQLAutocompleteResponse+ | HogQLMetadataResponse+ | HogQLQueryResponse<any[]>+ | HogQueryResponse+ | LogAttributesQueryResponse+ | LogsQueryResponse+ | LogValuesQueryResponse+ | MetricsQueryResponse+ | Record<string, any>+ | SessionsQueryResponse+ | TraceSpansAggregationQueryResponse+ | TraceSpansAttributeBreakdownQueryResponse+ | TraceSpansQueryResponse+ | TraceSpansTreeQueryResponse+ ) =>+ | ErrorTrackingQueryResponse+ | EventsQueryResponse+ | HogQLAutocompleteResponse+ | HogQLMetadataResponse+ | HogQLQueryResponse<any[]>+ | HogQueryResponse+ | LogAttributesQueryResponse+ | LogsQueryResponse+ | LogValuesQueryResponse+ | MetricsQueryResponse+ | Record<string, any>+ | SessionsQueryResponse+ | TraceSpansAggregationQueryResponse+ | TraceSpansAttributeBreakdownQueryResponse+ | TraceSpansQueryResponse+ | TraceSpansTreeQueryResponse // insightVizDataLogic+ updateBreakdownFilter: (breakdownFilter: BreakdownFilter) => {+ breakdownFilter: BreakdownFilter+ } // insightVizDataLogic+ updateInsightFilter: (insightFilter: InsightFilter) => {+ insightFilter: InsightFilter+ } // insightVizDataLogic+ loadMoreBreakdownValues: () => {+ value: true+ }+ setBreakdownValuesLoading: (loading: boolean) => {+ loading: boolean+ }+ setHoveredDatasetIndex: (index: number | null) => {+ index: number | null+ }+ toggleAllResultsHidden: (+ datasets: IndexedTrendResult[],+ hidden: boolean+ ) => {+ datasets: IndexedTrendResult[]+ hidden: boolean+ }+ toggleOtherSeriesHidden: (dataset: IndexedTrendResult) => {+ dataset: IndexedTrendResult+ }+ toggleResultHidden: (dataset: IndexedTrendResult) => {+ dataset: IndexedTrendResult+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface trendsDataLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ alertSeries: (+ querySource:+ | FunnelsQuery+ | LifecycleQuery+ | PathsQuery+ | RetentionQuery+ | StickinessQuery+ | TrendsQuery+ | WebOverviewQuery+ | WebStatsTableQuery+ | null+ ) => EventsNode[]+ results: (insightData: Record<string, any>) => TrendResult[]+ hasBreakdownMore: (insightData: Record<string, any>, isTrends: boolean) => boolean+ hasPersonsModal: (+ formula: string | null | undefined,+ hasDataWarehouseSeries: boolean,+ isLifecycle: boolean,+ querySource:+ | FunnelsQuery+ | LifecycleQuery+ | PathsQuery+ | RetentionQuery+ | StickinessQuery+ | TrendsQuery+ | WebOverviewQuery+ | WebStatsTableQuery+ | null,+ showPersonsModal: boolean+ ) => boolean+ isBreakdownValid: (breakdownFilter: BreakdownFilter | null | undefined) => boolean+ indexedResults: (+ results: TrendResult[],+ display: ChartDisplayType | null | undefined,+ lifecycleFilter: LifecycleFilter | null | undefined+ ) => IndexedTrendResult[]+ currentPeriodResult: (indexedResults: IndexedTrendResult[]) => IndexedTrendResult | undefined+ labelGroupType: (+ series: (AnyEntityNode<AnyDataWarehouseNode> | GroupNode<DataWarehouseNode>)[] | null | undefined,+ querySource:+ | FunnelsQuery+ | LifecycleQuery+ | PathsQuery+ | RetentionQuery+ | StickinessQuery+ | TrendsQuery+ | WebOverviewQuery+ | WebStatsTableQuery+ | null,+ isLifecycle: boolean+ ) => number | 'none' | 'people'+ incompletenessOffsetFromEnd: (results: TrendResult[], interval: IntervalType | null | undefined) => number+ showConfidenceIntervals: (+ trendsFilter: TrendsFilter | null | undefined,+ isTrends: boolean,+ hasDataWarehouseSeries: boolean,+ yAxisScaleType: string | null | undefined+ ) => boolean+ showTrendLines: (+ querySource:+ | FunnelsQuery+ | LifecycleQuery+ | PathsQuery+ | RetentionQuery+ | StickinessQuery+ | TrendsQuery+ | WebOverviewQuery+ | WebStatsTableQuery+ | null,+ isTrends: boolean,+ hasDataWarehouseSeries: boolean,+ yAxisScaleType: string | null | undefined,+ trendsFilter: TrendsFilter | null | undefined+ ) => boolean+ showMovingAverage: (+ trendsFilter: TrendsFilter | null | undefined,+ isTrends: boolean,+ hasDataWarehouseSeries: boolean,+ yAxisScaleType: string | null | undefined+ ) => boolean+ movingAverageIntervals: (+ trendsFilter: TrendsFilter | null | undefined,+ interval: IntervalType | null | undefined+ ) => number+ confidenceLevel: (trendsFilter: TrendsFilter | null | undefined) => number+ pieChartVizOptions: (arg: VizSpecificOptions | null | undefined) =>+ | {+ disableHoverOffset?: boolean | undefined+ hideAggregation?: boolean | undefined+ }+ | undefined+ mightContainFractionalNumbers: (+ formula: string | null | undefined,+ series: (AnyEntityNode<AnyDataWarehouseNode> | GroupNode<DataWarehouseNode>)[] | null | undefined+ ) => boolean+ resultCustomizations: (+ isTrends: boolean,+ isStickiness: boolean,+ trendsFilter: TrendsFilter | null | undefined,+ stickinessFilter: StickinessFilter | null | undefined+ ) => Record<string, ResultCustomizationByValue> | Record<number, ResultCustomizationByPosition> | undefined+ resultCustomizationBy: (+ resultCustomizationByRaw: ResultCustomizationBy | null | undefined+ ) => ResultCustomizationBy+ getTrendsColorToken: (+ resultCustomizationBy: ResultCustomizationBy,+ resultCustomizations:+ | Record<string, ResultCustomizationByValue>+ | Record<number, ResultCustomizationByPosition>+ | undefined,+ getTheme: (themeId: number | string | null | undefined) => DataColorTheme | null,+ breakdownFilter: BreakdownFilter | null | undefined,+ querySource:+ | FunnelsQuery+ | LifecycleQuery+ | PathsQuery+ | RetentionQuery+ | StickinessQuery+ | TrendsQuery+ | WebOverviewQuery+ | WebStatsTableQuery+ | null+ ) => (dataset: IndexedTrendResult) => [DataColorTheme | null, DataColorToken | null]+ getTrendsColor: (+ getTrendsColorToken: (dataset: IndexedTrendResult) => [DataColorTheme | null, DataColorToken | null]+ ) => (dataset: IndexedTrendResult) => string+ getTrendsHidden: (+ resultCustomizationBy: ResultCustomizationBy,+ resultCustomizations:+ | Record<string, ResultCustomizationByValue>+ | Record<number, ResultCustomizationByPosition>+ | undefined+ ) => (dataset: IndexedTrendResult) => boolean+ areAllSeriesVisible: (+ indexedResults: IndexedTrendResult[],+ getTrendsHidden: (dataset: IndexedTrendResult) => boolean+ ) => boolean+ showLegendIsolateSeriesItem: (+ indexedResults: IndexedTrendResult[],+ getTrendsHidden: (dataset: IndexedTrendResult) => boolean+ ) => boolean+ legendSeriesIsolationMenuEligible: (indexedResults: IndexedTrendResult[]) => boolean+ getIsOnlyVisibleSeriesInLegend: (+ indexedResults: IndexedTrendResult[],+ resultCustomizationBy: ResultCustomizationBy,+ getTrendsHidden: (dataset: IndexedTrendResult) => boolean+ ) => (dataset: IndexedTrendResult) => boolean+ }+}++export type trendsDataLogicType = MakeLogicType<+ trendsDataLogicValues,+ trendsDataLogicActions,+ InsightLogicProps,+ trendsDataLogicMeta+>+export const trendsDataLogic = kea<trendsDataLogicType>([props({} as InsightLogicProps),key(keyForInsightLogicProps('all_trends')),@@ -173,7 +525,7 @@ export const trendsDataLogic = kea<trendsDataLogicType>([hasBreakdownMore: [(s) => [s.insightData, s.isTrends],- (insightData, isTrends) => {+ (insightData: Record<string, any>, isTrends: boolean) => {if (!isTrends) {return false}@@ -182,7 +534,22 @@ export const trendsDataLogic = kea<trendsDataLogicType>([],hasPersonsModal: [(s) => [s.formula, s.hasDataWarehouseSeries, s.isLifecycle, s.querySource, s.showPersonsModal],- (formula, hasDataWarehouseSeries, isLifecycle, querySource, showPersonsModal) => {+ (+ formula: string | null | undefined,+ hasDataWarehouseSeries: boolean,+ isLifecycle: boolean,+ querySource:+ | LifecycleQuery+ | TrendsQuery+ | null+ | import('~/queries/schema/schema-general').FunnelsQuery+ | import('~/queries/schema/schema-general').PathsQuery+ | import('~/queries/schema/schema-general').RetentionQuery+ | import('~/queries/schema/schema-general').StickinessQuery+ | import('~/queries/schema/schema-general').WebOverviewQuery+ | import('~/queries/schema/schema-general').WebStatsTableQuery,+ showPersonsModal: boolean+ ) => {if (!showPersonsModal || isSharedView()) {return false}@@ -206,7 +573,11 @@ export const trendsDataLogic = kea<trendsDataLogicType>([indexedResults: [(s) => [s.results, s.display, s.lifecycleFilter],- (results, display, lifecycleFilter): IndexedTrendResult[] => {+ (+ results: TrendResult[],+ display: ChartDisplayType | null | undefined,+ lifecycleFilter: null | import('~/queries/schema/schema-general').LifecycleFilter | undefined+ ): IndexedTrendResult[] => {const defaultLifecyclesOrder = ['new', 'resurrecting', 'returning', 'dormant']let indexedResults = results.map((result, index) => ({ ...result, seriesIndex: index }))@@ -284,7 +655,30 @@ export const trendsDataLogic = kea<trendsDataLogicType>([labelGroupType: [(s) => [s.series, s.querySource, s.isLifecycle],- (series, querySource, isLifecycle): 'people' | 'none' | number => {+ (+ series:+ | (+ | import('~/queries/schema/schema-general').AnyEntityNode<+ import('~/queries/schema/schema-general').AnyDataWarehouseNode+ >+ | import('~/queries/schema/schema-general').GroupNode<+ import('~/queries/schema/schema-general').DataWarehouseNode+ >+ )[]+ | null+ | undefined,+ querySource:+ | LifecycleQuery+ | TrendsQuery+ | null+ | import('~/queries/schema/schema-general').FunnelsQuery+ | import('~/queries/schema/schema-general').PathsQuery+ | import('~/queries/schema/schema-general').RetentionQuery+ | import('~/queries/schema/schema-general').StickinessQuery+ | import('~/queries/schema/schema-general').WebOverviewQuery+ | import('~/queries/schema/schema-general').WebStatsTableQuery,+ isLifecycle: boolean+ ): 'people' | 'none' | number => {// Find the commonly shared aggregation group index if there is one.let firstAggregationGroupTypeIndex: 'people' | 'none' | number | undefined | nullif (isLifecycle) {@@ -302,7 +696,7 @@ export const trendsDataLogic = kea<trendsDataLogicType>([incompletenessOffsetFromEnd: [(s) => [s.results, s.interval],- (results, interval) => {+ (results: TrendResult[], interval: IntervalType | null | undefined) => {// Returns negative number of points to paint over starting from end of arrayif (results[0]?.days === undefined) {return 0@@ -402,12 +796,26 @@ export const trendsDataLogic = kea<trendsDataLogicType>([pieChartVizOptions: [() => [() => values.vizSpecificOptions],- (vizSpecificOptions) => vizSpecificOptions?.[ChartDisplayType.ActionsPie],+ (vizSpecificOptions: null | import('~/queries/schema/schema-general').VizSpecificOptions | undefined) =>+ vizSpecificOptions?.[ChartDisplayType.ActionsPie],],mightContainFractionalNumbers: [(s) => [s.formula, s.series],- (formula, series): boolean => {+ (+ formula: string | null | undefined,+ series:+ | (+ | import('~/queries/schema/schema-general').AnyEntityNode<+ import('~/queries/schema/schema-general').AnyDataWarehouseNode+ >+ | import('~/queries/schema/schema-general').GroupNode<+ import('~/queries/schema/schema-general').DataWarehouseNode+ >+ )[]+ | null+ | undefined+ ): boolean => {// Whether data points might contain fractional numbers, which involve extra display considerations,// such as roundingif (formula) {@@ -422,7 +830,12 @@ export const trendsDataLogic = kea<trendsDataLogicType>([resultCustomizations: [(s) => [s.isTrends, s.isStickiness, s.trendsFilter, s.stickinessFilter],- (isTrends, isStickiness, trendsFilter, stickinessFilter) => {+ (+ isTrends: boolean,+ isStickiness: boolean,+ trendsFilter: TrendsFilter | null | undefined,+ stickinessFilter: null | import('~/queries/schema/schema-general').StickinessFilter | undefined+ ) => {if (isTrends) {return trendsFilter?.resultCustomizations}@@ -434,12 +847,31 @@ export const trendsDataLogic = kea<trendsDataLogicType>([],resultCustomizationBy: [(s) => [s.resultCustomizationByRaw],- (resultCustomizationByRaw) => resultCustomizationByRaw || RESULT_CUSTOMIZATION_DEFAULT,+ (resultCustomizationByRaw: ResultCustomizationBy | null | undefined) =>+ resultCustomizationByRaw || RESULT_CUSTOMIZATION_DEFAULT,],getTrendsColorToken: [(s) => [s.resultCustomizationBy, s.resultCustomizations, s.getTheme, s.breakdownFilter, s.querySource],- (resultCustomizationBy, resultCustomizations, getTheme, breakdownFilter, querySource) => {+ (+ resultCustomizationBy: ResultCustomizationBy,+ resultCustomizations:+ | Record<string, import('~/queries/schema/schema-general').ResultCustomizationByValue>+ | Record<number, import('~/queries/schema/schema-general').ResultCustomizationByPosition>+ | undefined,+ getTheme: (themeId: number | string | null | undefined) => DataColorTheme | null,+ breakdownFilter: BreakdownFilter | null | undefined,+ querySource:+ | LifecycleQuery+ | TrendsQuery+ | null+ | import('~/queries/schema/schema-general').FunnelsQuery+ | import('~/queries/schema/schema-general').PathsQuery+ | import('~/queries/schema/schema-general').RetentionQuery+ | import('~/queries/schema/schema-general').StickinessQuery+ | import('~/queries/schema/schema-general').WebOverviewQuery+ | import('~/queries/schema/schema-general').WebStatsTableQuery+ ) => {return (dataset: IndexedTrendResult): [DataColorTheme | null, DataColorToken | null] => {// stringified breakdown valueconst key = getTrendDatasetKey(dataset)@@ -481,7 +913,7 @@ export const trendsDataLogic = kea<trendsDataLogicType>([],getTrendsColor: [(s) => [s.getTrendsColorToken],- (getTrendsColorToken) => {+ (getTrendsColorToken: (dataset: IndexedTrendResult) => [DataColorTheme | null, DataColorToken | null]) => {return (dataset: IndexedTrendResult) => {const [colorTheme, colorToken] = getTrendsColorToken(dataset)return colorTheme && colorToken ? getColorFromToken(colorTheme, colorToken) : '#000000'@@ -490,7 +922,13 @@ export const trendsDataLogic = kea<trendsDataLogicType>([],getTrendsHidden: [(s) => [s.resultCustomizationBy, s.resultCustomizations],- (resultCustomizationBy, resultCustomizations) => {+ (+ resultCustomizationBy: ResultCustomizationBy,+ resultCustomizations:+ | Record<string, import('~/queries/schema/schema-general').ResultCustomizationByValue>+ | Record<number, import('~/queries/schema/schema-general').ResultCustomizationByPosition>+ | undefined+ ) => {return (dataset: IndexedTrendResult): boolean => {const resultCustomization = getTrendResultCustomization(resultCustomizationBy,@@ -504,13 +942,18 @@ export const trendsDataLogic = kea<trendsDataLogicType>([areAllSeriesVisible: [(s) => [s.indexedResults, s.getTrendsHidden],- (indexedResults, getTrendsHidden): boolean => indexedResults.every((d) => !getTrendsHidden(d)),+ (+ indexedResults: IndexedTrendResult[],+ getTrendsHidden: (dataset: IndexedTrendResult) => boolean+ ): boolean => indexedResults.every((d) => !getTrendsHidden(d)),],showLegendIsolateSeriesItem: [(s) => [s.indexedResults, s.getTrendsHidden],- (indexedResults, getTrendsHidden): boolean =>- indexedResults.length > 0 && !indexedResults.every((d) => getTrendsHidden(d)),+ (+ indexedResults: IndexedTrendResult[],+ getTrendsHidden: (dataset: IndexedTrendResult) => boolean+ ): boolean => indexedResults.length > 0 && !indexedResults.every((d) => getTrendsHidden(d)),],legendSeriesIsolationMenuEligible: [@@ -520,7 +963,11 @@ export const trendsDataLogic = kea<trendsDataLogicType>([getIsOnlyVisibleSeriesInLegend: [(s) => [s.indexedResults, s.resultCustomizationBy, s.getTrendsHidden],- (indexedResults, resultCustomizationBy, getTrendsHidden) => {+ (+ indexedResults: IndexedTrendResult[],+ resultCustomizationBy: ResultCustomizationBy,+ getTrendsHidden: (dataset: IndexedTrendResult) => boolean+ ) => {if (indexedResults.length < 2) {return (): boolean => false}diff --git a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownDrawerLogic.ts b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownDrawerLogic.tsindex b0cf71a11ef2..775797982e6f 100644--- a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownDrawerLogic.ts+++ b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownDrawerLogic.ts@@ -1,6 +1,4 @@-import { actions, kea, path, reducers } from 'kea'--import type { livePersonDrillDownDrawerLogicType } from './livePersonDrillDownDrawerLogicType'+import { MakeLogicType, actions, kea, path, reducers } from 'kea'export type LivePersonDrillDownBreakdownType = 'country' | 'city' | 'device' | 'browser'@@ -10,6 +8,24 @@ export interface LivePersonDrillDownSelection {breakdownLabel: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface livePersonDrillDownDrawerLogicValues {+ currentSelection: LivePersonDrillDownSelection | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface livePersonDrillDownDrawerLogicActions {+ closeDrillDown: () => {+ value: true+ }+ openDrillDown: (selection: LivePersonDrillDownSelection) => LivePersonDrillDownSelection+}++export type livePersonDrillDownDrawerLogicType = MakeLogicType<+ livePersonDrillDownDrawerLogicValues,+ livePersonDrillDownDrawerLogicActions+>+export const livePersonDrillDownDrawerLogic = kea<livePersonDrillDownDrawerLogicType>([path(['scenes', 'webAnalytics', 'livePersonDrillDownDrawerLogic']),actions({diff --git a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownLogic.ts b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownLogic.tsindex 449726427ebb..fa4656368576 100644--- a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownLogic.ts+++ b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/livePersonDrillDownLogic.ts@@ -1,5 +1,5 @@import { deepEqual as equal } from 'fast-equals'-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 { parsePersonFromHogQLRow } from 'scenes/persons/person-utils'@@ -11,9 +11,10 @@ import { HogQLQueryResponse, NodeKind } from '~/queries/schema/schema-general'import { hogql } from '~/queries/utils'import { PersonType } from '~/types'+import type { TeamPublicType, TeamType } from '../../../types'import { LiveMetricsSlidingWindow } from './LiveMetricsSlidingWindow'import { LivePersonDrillDownBreakdownType, livePersonDrillDownDrawerLogic } from './livePersonDrillDownDrawerLogic'-import type { livePersonDrillDownLogicType } from './livePersonDrillDownLogicType'+import type { LivePersonDrillDownSelection } from './livePersonDrillDownDrawerLogic'import { liveWebAnalyticsMetricsLogic } from './liveWebAnalyticsMetricsLogic'export const COOKIELESS_DISTINCT_ID_PREFIX = 'cookieless_'@@ -58,6 +59,115 @@ export const aggregateRecordingCountsByPerson = (return byKey}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface livePersonDrillDownLogicValues {+ currentSelection: LivePersonDrillDownSelection | null // livePersonDrillDownDrawerLogic+ eventsVersion: number // liveWebAnalyticsMetricsLogic+ geoVersion: number // liveWebAnalyticsMetricsLogic+ slidingWindow: LiveMetricsSlidingWindow // liveWebAnalyticsMetricsLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ anonymousCount: number+ currentDistinctIds: string[]+ displayedDistinctIds: string[]+ identifiedCount: number+ identifiedDistinctIds: string[]+ isTruncated: boolean+ newVisitorCount: number+ partitionedDistinctIds: {+ anonymous: string[]+ identified: string[]+ }+ persons: PersonType[]+ personsLoading: boolean+ recordingCountByPersonKey: Record<string, number>+ recordingCountsByDistinctId: Record<string, number>+ recordingCountsByDistinctIdLoading: boolean+ totalCount: number+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface livePersonDrillDownLogicActions {+ loadPersons: ({ distinctIds }: { distinctIds: string[] }) => {+ distinctIds: string[]+ }+ loadPersonsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPersonsSuccess: (+ persons: PersonType[],+ payload?: {+ distinctIds: string[]+ }+ ) => {+ persons: PersonType[]+ payload?: {+ distinctIds: string[]+ }+ }+ loadRecordingCounts: ({ distinctIds }: { distinctIds: string[] }) => {+ distinctIds: string[]+ }+ loadRecordingCountsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadRecordingCountsSuccess: (+ recordingCountsByDistinctId: Record<string, number>,+ payload?: {+ distinctIds: string[]+ }+ ) => {+ recordingCountsByDistinctId: Record<string, number>+ payload?: {+ distinctIds: string[]+ }+ }+ refresh: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface livePersonDrillDownLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ currentDistinctIds: (+ slidingWindow: LiveMetricsSlidingWindow,+ eventsVersion: number,+ geoVersion: number,+ arg: any+ ) => string[]+ partitionedDistinctIds: (currentDistinctIds: string[]) => {+ anonymous: string[]+ identified: string[]+ }+ identifiedDistinctIds: (partitionedDistinctIds: { anonymous: string[]; identified: string[] }) => string[]+ anonymousCount: (partitionedDistinctIds: { anonymous: string[]; identified: string[] }) => number+ totalCount: (currentDistinctIds: string[]) => number+ identifiedCount: (identifiedDistinctIds: string[]) => number+ newVisitorCount: (identifiedDistinctIds: string[], displayedDistinctIds: string[]) => number+ isTruncated: (identifiedCount: number) => boolean+ recordingCountByPersonKey: (+ persons: PersonType[],+ recordingCountsByDistinctId: Record<string, number>+ ) => Record<string, number>+ }+}++export type livePersonDrillDownLogicType = MakeLogicType<+ livePersonDrillDownLogicValues,+ livePersonDrillDownLogicActions,+ LivePersonDrillDownLogicProps,+ livePersonDrillDownLogicMeta+>+export const livePersonDrillDownLogic = kea<livePersonDrillDownLogicType>([props({} as LivePersonDrillDownLogicProps),key((p) => `${p.breakdownType}:${p.breakdownValue}`),diff --git a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsLayoutLogic.ts b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsLayoutLogic.tsindex 157fdded5e04..d426b9a44db3 100644--- a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsLayoutLogic.ts+++ b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsLayoutLogic.ts@@ -1,11 +1,50 @@-import { actions, kea, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, kea, path, reducers, selectors } from 'kea'import { DEFAULT_CONTENT_ORDER, DEFAULT_STAT_ORDER, LiveContentCardId, LiveStatCardId, mergeOrder } from './liveCards'-import type { liveWebAnalyticsLayoutLogicType } from './liveWebAnalyticsLayoutLogicType'const teamId = window.POSTHOG_APP_CONTEXT?.current_team?.idconst persistConfig = { persist: true, prefix: `${teamId}__` }+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWebAnalyticsLayoutLogicValues {+ cardOrder: LiveContentCardId[]+ isEditing: boolean+ persistedCardOrder: LiveContentCardId[]+ persistedStatOrder: LiveStatCardId[]+ statOrder: LiveStatCardId[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWebAnalyticsLayoutLogicActions {+ resetLayout: () => {+ value: true+ }+ setCardOrder: (order: LiveContentCardId[]) => {+ order: LiveContentCardId[]+ }+ setEditing: (editing: boolean) => {+ editing: boolean+ }+ setStatOrder: (order: LiveStatCardId[]) => {+ order: LiveStatCardId[]+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWebAnalyticsLayoutLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ statOrder: (persistedStatOrder: LiveStatCardId[]) => LiveStatCardId[]+ cardOrder: (persistedCardOrder: LiveContentCardId[]) => LiveContentCardId[]+ }+}++export type liveWebAnalyticsLayoutLogicType = MakeLogicType<+ liveWebAnalyticsLayoutLogicValues,+ liveWebAnalyticsLayoutLogicActions,+ Record<string, any>,+ liveWebAnalyticsLayoutLogicMeta+>+export const liveWebAnalyticsLayoutLogic = kea<liveWebAnalyticsLayoutLogicType>([path(['scenes', 'webAnalytics', 'liveWebAnalyticsLayoutLogic']),actions({diff --git a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsMetricsLogic.tsx b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsMetricsLogic.tsxindex 0c8d0c87dc1c..bd55f75544db 100644--- a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsMetricsLogic.tsx+++ b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWebAnalyticsMetricsLogic.tsx@@ -1,5 +1,5 @@import { deepEqual as equal } from 'fast-equals'-import { actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, connect, events, kea, listeners, path, reducers, selectors } from 'kea'import { subscriptions } from 'kea-subscriptions'import { lemonToast } from '@posthog/lemon-ui'@@ -28,9 +28,10 @@ import {} from '~/queries/schema/schema-general'import { BaseMathType, LiveEvent, PropertyFilterType, PropertyOperator } from '~/types'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'+import type { TeamPublicType, TeamType } from '../../../types'import { createStreamConnection } from './createStreamConnection'import { LiveMetricsSlidingWindow } from './LiveMetricsSlidingWindow'-import type { liveWebAnalyticsMetricsLogicType } from './liveWebAnalyticsMetricsLogicType'import {BOT_ELIGIBLE_EVENTS,BOT_KEY_SEPARATOR,@@ -85,6 +86,129 @@ const collapseTopWithOther = <T extends { count: number; percentage: number }>(return [...top, makeOther(othersCount, othersPercentage)]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWebAnalyticsMetricsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ rawLiveFilters: WebAnalyticsPropertyFilter[] // webAnalyticsFilterLogic+ rawSelectedHost: string | null // webAnalyticsFilterLogic+ productTab: ProductTab // webAnalyticsLogic+ botBreakdown: BotBreakdownItem[]+ browserBreakdown: BrowserBreakdownItem[]+ chartData: ChartDataPoint[]+ cityBreakdown: CityBreakdownItem[]+ countryBreakdown: CountryBreakdownItem[]+ deviceBreakdown: DeviceBreakdownItem[]+ eventsVersion: number+ geoVersion: number+ hasActiveFilters: boolean+ isLoading: boolean+ liveFilters: WebAnalyticsPropertyFilter[]+ liveUserCount: number+ recentEvents: LiveEvent[]+ recentUsersByLastSeen: Map<string, number>+ selectedHost: string | null+ slidingWindow: LiveMetricsSlidingWindow+ topCityBreakdown: CityBreakdownItem[]+ topCountryBreakdown: CountryBreakdownItem[]+ topPaths: PathItem[]+ topReferrers: ReferrerItem[]+ totalBotEligibleEvents: number+ totalBotEvents: number+ totalBrowsers: number+ totalPageviews: number+ totalUniqueVisitors: number+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWebAnalyticsMetricsLogicActions {+ addEvents: (+ events: LiveEvent[],+ newerThan: Date+ ) => {+ events: LiveEvent[]+ newerThan: Date+ }+ addGeoEvents: (events: LiveGeoEvent[]) => {+ events: LiveGeoEvent[]+ }+ clearFilteredLiveUsers: () => {+ value: true+ }+ clearRecentEvents: () => {+ value: true+ }+ loadInitialData: () => {+ value: true+ }+ pauseStream: () => {+ value: true+ }+ resumeStream: () => {+ value: true+ }+ setInitialData: (+ buckets: {+ bucket: SlidingWindowBucket+ timestamp: number+ }[],+ recentUsersByLastSeen: [string, number][]+ ) => {+ buckets: {+ bucket: SlidingWindowBucket+ timestamp: number+ }[]+ recentUsersByLastSeen: [string, number][]+ }+ setIsLoading: (loading: boolean) => {+ loading: boolean+ }+ tickCurrentMinute: () => {+ value: true+ }+ tickLiveUserCount: () => {+ value: true+ }+ updateConnection: () => {+ value: true+ }+ updateGeoConnection: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWebAnalyticsMetricsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ chartData: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => ChartDataPoint[]+ deviceBreakdown: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => DeviceBreakdownItem[]+ browserBreakdown: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => BrowserBreakdownItem[]+ countryBreakdown: (slidingWindow: LiveMetricsSlidingWindow, geoVersion: number) => CountryBreakdownItem[]+ topCountryBreakdown: (countryBreakdown: CountryBreakdownItem[]) => CountryBreakdownItem[]+ cityBreakdown: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => CityBreakdownItem[]+ topCityBreakdown: (cityBreakdown: CityBreakdownItem[]) => CityBreakdownItem[]+ topPaths: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => PathItem[]+ topReferrers: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => ReferrerItem[]+ totalPageviews: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => number+ totalUniqueVisitors: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => number+ totalBrowsers: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => number+ botBreakdown: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => BotBreakdownItem[]+ totalBotEvents: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => number+ totalBotEligibleEvents: (slidingWindow: LiveMetricsSlidingWindow, eventsVersion: number) => number+ liveUserCount: (recentUsersByLastSeen: Map<string, number>) => number+ selectedHost: (rawSelectedHost: string | null, productTab: ProductTab) => string | null+ liveFilters: (rawLiveFilters: WebAnalyticsPropertyFilter[]) => WebAnalyticsPropertyFilter[]+ hasActiveFilters: (liveFilters: WebAnalyticsPropertyFilter[]) => boolean+ }+}++export type liveWebAnalyticsMetricsLogicType = MakeLogicType<+ liveWebAnalyticsMetricsLogicValues,+ liveWebAnalyticsMetricsLogicActions,+ Record<string, any>,+ liveWebAnalyticsMetricsLogicMeta+>+export const liveWebAnalyticsMetricsLogic = kea<liveWebAnalyticsMetricsLogicType>([path(['scenes', 'web-analytics', 'livePageviewsLogic']),connect(() => ({diff --git a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWorldMapLogic.tsx b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWorldMapLogic.tsxindex 51fc7f71c5e2..37781edc48ae 100644--- a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWorldMapLogic.tsx+++ b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/liveWorldMapLogic.tsx@@ -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 { getSeriesColor } from 'lib/colors'import { COUNTRY_CODE_TO_LONG_NAME, countryCodeToFlag } from 'lib/utils/country'@@ -6,7 +6,6 @@ import { COUNTRY_CODE_TO_LONG_NAME, countryCodeToFlag } from 'lib/utils/country'import type { DisposablesManager } from '~/kea-disposables'import { CountryBreakdownItem } from './LiveWebAnalyticsMetricsTypes'-import type { liveWorldMapLogicType } from './liveWorldMapLogicType'const HEAT_DECAY_MS = 3000const HEAT_UPDATE_INTERVAL_MS = 250@@ -24,6 +23,83 @@ export interface TooltipData {y: number}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWorldMapLogicValues {+ countryCodeToCount: Record<string, number>+ countryData: CountryBreakdownItem[]+ countryHeat: Record<string, number>+ hasData: boolean+ hoveredCountryCode: string | null+ mapColor: string+ maxCount: number+ tooltipCoordinates: {+ x: number+ y: number+ } | null+ tooltipData: TooltipData | null+ tooltipPosition: {+ left: number+ top: number+ } | null+ totalEvents: number+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWorldMapLogicActions {+ hideTooltip: () => {+ value: true+ }+ setCountryHeat: (heat: Record<string, number>) => {+ heat: Record<string, number>+ }+ showTooltip: (countryCode: string) => {+ countryCode: string+ }+ updateCountryData: (+ data: CountryBreakdownItem[],+ totalEvents: number+ ) => {+ data: CountryBreakdownItem[]+ totalEvents: number+ }+ updateTooltipCoordinates: (+ x: number,+ y: number+ ) => {+ x: number+ y: number+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface liveWorldMapLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ countryCodeToCount: (countryData: CountryBreakdownItem[]) => Record<string, number>+ maxCount: (countryData: CountryBreakdownItem[]) => number+ hasData: (countryData: CountryBreakdownItem[]) => boolean+ tooltipData: (+ hoveredCountryCode: string | null,+ tooltipCoordinates: {+ x: number+ y: number+ } | null,+ countryCodeToCount: Record<string, number>,+ totalEvents: number+ ) => TooltipData | null+ tooltipPosition: (tooltipData: TooltipData | null) => {+ left: number+ top: number+ } | null+ }+}++export type liveWorldMapLogicType = MakeLogicType<+ liveWorldMapLogicValues,+ liveWorldMapLogicActions,+ Record<string, any>,+ liveWorldMapLogicMeta+>+export const liveWorldMapLogic = kea<liveWorldMapLogicType>([path(['scenes', 'web-analytics', 'LiveMetricsDashboard', 'liveWorldMapLogic']),actions({diff --git a/frontend/src/scenes/web-analytics/SessionAttributionExplorer/sessionAttributionExplorerLogic.ts b/frontend/src/scenes/web-analytics/SessionAttributionExplorer/sessionAttributionExplorerLogic.tsindex a42cac3d9450..a970934bd304 100644--- a/frontend/src/scenes/web-analytics/SessionAttributionExplorer/sessionAttributionExplorerLogic.ts+++ b/frontend/src/scenes/web-analytics/SessionAttributionExplorer/sessionAttributionExplorerLogic.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, urlToAction } from 'kea-router'import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'@@ -17,7 +17,7 @@ import {} from '~/queries/schema/schema-general'import { Breadcrumb, SessionPropertyFilter } from '~/types'-import type { sessionAttributionExplorerLogicType } from './sessionAttributionExplorerLogicType'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'export const initialProperties = [] as SessionPropertyFilter[]export const initialGroupBy = [@@ -27,6 +27,56 @@ export const initialGroupBy = [SessionAttributionGroupBy.ReferringDomain,]export const defaultDateRange: DateRange = { date_from: '-7d', date_to: 'now' }+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sessionAttributionExplorerLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ breadcrumbs: Breadcrumb[]+ dateRange: DateRange | null+ groupBy: SessionAttributionGroupBy[]+ properties: SessionPropertyFilter[]+ query: DataTableNode+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sessionAttributionExplorerLogicActions {+ disableGroupBy: (groupBy: SessionAttributionGroupBy) => {+ groupBy: SessionAttributionGroupBy+ }+ enableGroupBy: (groupBy: SessionAttributionGroupBy) => {+ groupBy: SessionAttributionGroupBy+ }+ setDateRange: (dateRange: DateRange | null) => {+ dateRange: DateRange | null+ }+ setProperties: (properties: SessionPropertyFilter[]) => {+ properties: SessionPropertyFilter[]+ }+ setStateFromUrl: (state: { dateRange: DateRange | null; properties: SessionPropertyFilter[] }) => {+ state: {+ dateRange: DateRange | null+ properties: SessionPropertyFilter[]+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sessionAttributionExplorerLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ query: (+ properties: SessionPropertyFilter[],+ dateRange: DateRange | null,+ groupBy: SessionAttributionGroupBy[]+ ) => DataTableNode+ }+}++export type sessionAttributionExplorerLogicType = MakeLogicType<+ sessionAttributionExplorerLogicValues,+ sessionAttributionExplorerLogicActions,+ Record<string, any>,+ sessionAttributionExplorerLogicMeta+>+export const sessionAttributionExplorerLogic = kea<sessionAttributionExplorerLogicType>([path(['scenes', 'webAnalytics', 'sessionDebuggerLogic']),connect(() => ({@@ -75,7 +125,11 @@ export const sessionAttributionExplorerLogic = kea<sessionAttributionExplorerLogselectors({query: [(s) => [s.properties, s.dateRange, s.groupBy],- (properties: SessionPropertyFilter[], dateRange, groupBy): DataTableNode => {+ (+ properties: SessionPropertyFilter[],+ dateRange: DateRange | null,+ groupBy: SessionAttributionGroupBy[]+ ): DataTableNode => {const filters = {properties,dateRange: dateRange ?? defaultDateRange,diff --git a/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsLogic.ts b/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsLogic.tsindex 7e9db95a9acf..c26a9713c3ec 100644--- a/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsLogic.ts+++ b/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsLogic.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 posthog from 'posthog-js'@@ -20,9 +20,10 @@ import {type PendingCelebrationApi,} from 'products/web_analytics/frontend/generated/api.schemas'+import type { WebAnalyticsUserPreferencesApi } from '../../../../../products/web_analytics/frontend/generated/api.schemas'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'import { deriveTrackProgress } from './achievementProgress'import { isWebAnalyticsAchievementsEnabled } from './gating'-import type { webAnalyticsAchievementsLogicType } from './webAnalyticsAchievementsLogicType'import { webAnalyticsAchievementsPreferencesLogic } from './webAnalyticsAchievementsPreferencesLogic'const celebrationKey = (trackKey: string, stage: number): string => `${trackKey}:${stage}`@@ -42,6 +43,110 @@ function sortByCloseness(.map(({ track }) => track)}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsAchievementsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentProjectId: number | string // teamLogic+ achievementsOptOut: boolean // webAnalyticsAchievementsPreferencesLogic+ preferences: WebAnalyticsUserPreferencesApi | null // webAnalyticsAchievementsPreferencesLogic+ achievements: AchievementsListResponseApi | null+ achievementsLoading: boolean+ celebratedKeys: string[]+ definitions: AchievementDefinitionApi[]+ expandedTracks: string[]+ modalOpen: boolean+ pendingCelebrations: PendingCelebrationApi[]+ pendingTrackKeys: Set<string>+ progressByTrack: Record<string, AchievementProgressApi>+ sortedTeamTracks: AchievementDefinitionApi[]+ sortedUserTracks: AchievementDefinitionApi[]+ teamProgress: AchievementProgressApi[]+ totalStages: number+ uncelebratedPending: PendingCelebrationApi[]+ unlockedStages: number+ userProgress: AchievementProgressApi[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsAchievementsLogicActions {+ acknowledgeCelebration: (+ trackKey: string,+ stage: number+ ) => {+ stage: number+ trackKey: string+ }+ closeModal: () => {+ value: true+ }+ loadAchievements: () => any+ loadAchievementsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAchievementsSuccess: (+ achievements: AchievementsListResponseApi,+ payload?: any+ ) => {+ achievements: AchievementsListResponseApi+ payload?: any+ }+ markCelebrated: (key: string) => {+ key: string+ }+ openModal: () => {+ value: true+ }+ recordInteraction: (kind: InteractionKindEnumApi) => {+ kind: InteractionKindEnumApi+ }+ toggleTrackExpanded: (trackKey: string) => {+ trackKey: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsAchievementsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ definitions: (achievements: AchievementsListResponseApi | null) => AchievementDefinitionApi[]+ userProgress: (achievements: AchievementsListResponseApi | null) => AchievementProgressApi[]+ teamProgress: (achievements: AchievementsListResponseApi | null) => AchievementProgressApi[]+ pendingCelebrations: (achievements: AchievementsListResponseApi | null) => PendingCelebrationApi[]+ uncelebratedPending: (+ pendingCelebrations: PendingCelebrationApi[],+ celebratedKeys: string[]+ ) => PendingCelebrationApi[]+ progressByTrack: (+ userProgress: AchievementProgressApi[],+ teamProgress: AchievementProgressApi[]+ ) => Record<string, AchievementProgressApi>+ sortedUserTracks: (+ definitions: AchievementDefinitionApi[],+ progressByTrack: Record<string, AchievementProgressApi>+ ) => AchievementDefinitionApi[]+ sortedTeamTracks: (+ definitions: AchievementDefinitionApi[],+ progressByTrack: Record<string, AchievementProgressApi>+ ) => AchievementDefinitionApi[]+ pendingTrackKeys: (uncelebratedPending: PendingCelebrationApi[]) => Set<string>+ unlockedStages: (+ definitions: AchievementDefinitionApi[],+ progressByTrack: Record<string, AchievementProgressApi>+ ) => number+ totalStages: (definitions: AchievementDefinitionApi[]) => number+ }+}++export type webAnalyticsAchievementsLogicType = MakeLogicType<+ webAnalyticsAchievementsLogicValues,+ webAnalyticsAchievementsLogicActions,+ Record<string, any>,+ webAnalyticsAchievementsLogicMeta+>+export const webAnalyticsAchievementsLogic = kea<webAnalyticsAchievementsLogicType>([path(['scenes', 'web-analytics', 'achievements', 'webAnalyticsAchievementsLogic']),connect(() => ({@@ -98,28 +203,35 @@ export const webAnalyticsAchievementsLogic = kea<webAnalyticsAchievementsLogicTyselectors({definitions: [(s) => [s.achievements],- (achievements): AchievementDefinitionApi[] => achievements?.definitions ?? [],+ (achievements: AchievementsListResponseApi | null): AchievementDefinitionApi[] =>+ achievements?.definitions ?? [],],userProgress: [(s) => [s.achievements],- (achievements): AchievementProgressApi[] => achievements?.user_progress ?? [],+ (achievements: AchievementsListResponseApi | null): AchievementProgressApi[] =>+ achievements?.user_progress ?? [],],teamProgress: [(s) => [s.achievements],- (achievements): AchievementProgressApi[] => achievements?.team_progress ?? [],+ (achievements: AchievementsListResponseApi | null): AchievementProgressApi[] =>+ achievements?.team_progress ?? [],],pendingCelebrations: [(s) => [s.achievements],- (achievements): PendingCelebrationApi[] => achievements?.pending_celebrations ?? [],+ (achievements: AchievementsListResponseApi | null): PendingCelebrationApi[] =>+ achievements?.pending_celebrations ?? [],],uncelebratedPending: [(s) => [s.pendingCelebrations, s.celebratedKeys],- (pending, celebrated): PendingCelebrationApi[] =>+ (pending: PendingCelebrationApi[], celebrated: string[]): PendingCelebrationApi[] =>pending.filter((entry) => !celebrated.includes(celebrationKey(entry.track_key, entry.stage))),],progressByTrack: [(s) => [s.userProgress, s.teamProgress],- (userProgress, teamProgress): Record<string, AchievementProgressApi> => {+ (+ userProgress: AchievementProgressApi[],+ teamProgress: AchievementProgressApi[]+ ): Record<string, AchievementProgressApi> => {const byTrack: Record<string, AchievementProgressApi> = {}for (const row of [...userProgress, ...teamProgress]) {byTrack[row.track_key] = row@@ -129,7 +241,10 @@ export const webAnalyticsAchievementsLogic = kea<webAnalyticsAchievementsLogicTy],sortedUserTracks: [(s) => [s.definitions, s.progressByTrack],- (definitions, progressByTrack): AchievementDefinitionApi[] =>+ (+ definitions: AchievementDefinitionApi[],+ progressByTrack: Record<string, AchievementProgressApi>+ ): AchievementDefinitionApi[] =>sortByCloseness(definitions.filter((track) => track.scope === 'user'),progressByTrack@@ -137,7 +252,10 @@ export const webAnalyticsAchievementsLogic = kea<webAnalyticsAchievementsLogicTy],sortedTeamTracks: [(s) => [s.definitions, s.progressByTrack],- (definitions, progressByTrack): AchievementDefinitionApi[] =>+ (+ definitions: AchievementDefinitionApi[],+ progressByTrack: Record<string, AchievementProgressApi>+ ): AchievementDefinitionApi[] =>sortByCloseness(definitions.filter((track) => track.scope === 'team'),progressByTrack@@ -145,16 +263,19 @@ export const webAnalyticsAchievementsLogic = kea<webAnalyticsAchievementsLogicTy],pendingTrackKeys: [(s) => [s.uncelebratedPending],- (pending): Set<string> => new Set(pending.map((entry) => entry.track_key)),+ (pending: PendingCelebrationApi[]): Set<string> => new Set(pending.map((entry) => entry.track_key)),],unlockedStages: [(s) => [s.definitions, s.progressByTrack],- (definitions, progressByTrack): number =>- definitions.reduce((sum, track) => sum + (progressByTrack[track.key]?.current_stage ?? 0), 0),+ (+ definitions: AchievementDefinitionApi[],+ progressByTrack: Record<string, AchievementProgressApi>+ ): number => definitions.reduce((sum, track) => sum + (progressByTrack[track.key]?.current_stage ?? 0), 0),],totalStages: [(s) => [s.definitions],- (definitions): number => definitions.reduce((sum, track) => sum + track.stages.length, 0),+ (definitions: AchievementDefinitionApi[]): number =>+ definitions.reduce((sum, track) => sum + track.stages.length, 0),],}),listeners(({ values, actions }) => ({diff --git a/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsPreferencesLogic.ts b/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsPreferencesLogic.tsindex cf5b7759440a..be2d6769608b 100644--- a/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsPreferencesLogic.ts+++ b/frontend/src/scenes/web-analytics/achievements/webAnalyticsAchievementsPreferencesLogic.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 posthog from 'posthog-js'@@ -12,7 +12,70 @@ import {} from 'products/web_analytics/frontend/generated/api'import type { WebAnalyticsUserPreferencesApi } from 'products/web_analytics/frontend/generated/api.schemas'-import type { webAnalyticsAchievementsPreferencesLogicType } from './webAnalyticsAchievementsPreferencesLogicType'+import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsAchievementsPreferencesLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentProjectId: number | string // teamLogic+ achievementsOptOut: boolean+ preferences: WebAnalyticsUserPreferencesApi | null+ preferencesLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsAchievementsPreferencesLogicActions {+ loadPreferences: () => any+ loadPreferencesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPreferencesSuccess: (+ preferences: WebAnalyticsUserPreferencesApi,+ payload?: any+ ) => {+ preferences: WebAnalyticsUserPreferencesApi+ payload?: any+ }+ setAchievementsOptOut: ({ optedOut }: { optedOut: boolean }) => {+ optedOut: boolean+ }+ setAchievementsOptOutFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setAchievementsOptOutSuccess: (+ preferences: WebAnalyticsUserPreferencesApi,+ payload?: {+ optedOut: boolean+ }+ ) => {+ preferences: WebAnalyticsUserPreferencesApi+ payload?: {+ optedOut: boolean+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsAchievementsPreferencesLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ achievementsOptOut: (preferences: WebAnalyticsUserPreferencesApi | null) => boolean+ }+}++export type webAnalyticsAchievementsPreferencesLogicType = MakeLogicType<+ webAnalyticsAchievementsPreferencesLogicValues,+ webAnalyticsAchievementsPreferencesLogicActions,+ Record<string, any>,+ webAnalyticsAchievementsPreferencesLogicMeta+>export const webAnalyticsAchievementsPreferencesLogic = kea<webAnalyticsAchievementsPreferencesLogicType>([path(['scenes', 'web-analytics', 'achievements', 'webAnalyticsAchievementsPreferencesLogic']),@@ -37,7 +100,7 @@ export const webAnalyticsAchievementsPreferencesLogic = kea<webAnalyticsAchievemselectors({achievementsOptOut: [(s) => [s.preferences],- (preferences): boolean => preferences?.achievements_opt_out ?? false,+ (preferences: WebAnalyticsUserPreferencesApi | null): boolean => preferences?.achievements_opt_out ?? false,],}),listeners({diff --git a/frontend/src/scenes/web-analytics/botAnalyticsLogic.ts b/frontend/src/scenes/web-analytics/botAnalyticsLogic.tsindex c8e880f06a2e..6823f7b9f76a 100644--- a/frontend/src/scenes/web-analytics/botAnalyticsLogic.ts+++ b/frontend/src/scenes/web-analytics/botAnalyticsLogic.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 { router } from 'kea-router'import { isNotNil } from 'lib/utils/guards'@@ -22,7 +22,6 @@ import {PropertyOperator,} from '~/types'-import type { botAnalyticsLogicType } from './botAnalyticsLogicType'import {BOT_ANALYTICS_EVENTS,INITIAL_DATE_FROM,@@ -38,11 +37,66 @@ import {} from './common'import { getDashboardItemId } from './insightsUtils'import { webAnalyticsLogic } from './webAnalyticsLogic'+import type { DateFilterState } from './webAnalyticsLogic'const teamId = window.POSTHOG_APP_CONTEXT?.current_team?.id// Distinct prefix from webAnalyticsFilterLogic so bot-tab filters don't collide with the regular tab.const persistConfig = { persist: true, prefix: `${teamId}__bot_` }+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface botAnalyticsLogicValues {+ dateFilter: DateFilterState // webAnalyticsLogic+ filterTestAccounts: boolean // webAnalyticsLogic+ _botTrendsTab: string | null+ botFilters: WebAnalyticsPropertyFilters+ botTrendsTab: string+ rawBotAnalyticsFilters: WebAnalyticsPropertyFilters+ tiles: WebAnalyticsTile[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface botAnalyticsLogicActions {+ clearBotAnalyticsFilters: () => {+ value: true+ }+ setBotAnalyticsFilters: (filters: WebAnalyticsPropertyFilters) => {+ filters: WebAnalyticsPropertyFilters+ }+ setBotTrendsTab: (tab: string) => {+ tab: string+ }+ toggleBotAnalyticsFilter: (+ type: PropertyFilterType.Event | PropertyFilterType.Person | PropertyFilterType.Session,+ key: string,+ value: number | string | null+ ) => {+ key: string+ type: PropertyFilterType.Event | PropertyFilterType.Person | PropertyFilterType.Session+ value: number | string | null+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface botAnalyticsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ botTrendsTab: (_botTrendsTab: string | null) => string+ botFilters: (rawBotAnalyticsFilters: WebAnalyticsPropertyFilters) => WebAnalyticsPropertyFilters+ tiles: (+ dateFilter: DateFilterState,+ filterTestAccounts: boolean,+ botTrendsTab: string,+ botFilters: WebAnalyticsPropertyFilters+ ) => WebAnalyticsTile[]+ }+}++export type botAnalyticsLogicType = MakeLogicType<+ botAnalyticsLogicValues,+ botAnalyticsLogicActions,+ Record<string, any>,+ botAnalyticsLogicMeta+>+export const botAnalyticsLogic = kea<botAnalyticsLogicType>([path(['scenes', 'webAnalytics', 'botAnalyticsLogic']),connect(() => ({@@ -164,7 +218,12 @@ export const botAnalyticsLogic = kea<botAnalyticsLogicType>([],tiles: [(s) => [s.dateFilter, s.filterTestAccounts, s.botTrendsTab, s.botFilters],- (dateFilter, filterTestAccounts, botTrendsTab, botFilters): WebAnalyticsTile[] => {+ (+ dateFilter: import('./webAnalyticsLogic').DateFilterState,+ filterTestAccounts: boolean,+ botTrendsTab: string,+ botFilters: WebAnalyticsPropertyFilters+ ): WebAnalyticsTile[] => {const dateRange = { date_from: dateFilter.dateFrom, date_to: dateFilter.dateTo }const interval = dateFilter.intervaldiff --git a/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.ts b/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.tsindex cb5f32fb71a3..7d545cca51b7 100644--- a/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.ts+++ b/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.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 api, { ApiError } from 'lib/api'@@ -22,7 +22,6 @@ import {HealthCheckStatus,OverallHealthStatus,} from './healthCheckTypes'-import type { webAnalyticsHealthLogicType } from './webAnalyticsHealthLogicType'/*** Static presentational config for the web analytics checks. The pass/fail decision and the@@ -122,6 +121,148 @@ const WEB_HEALTH_CHECKS: WebHealthCheckConfig[] = [},]+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsHealthLogicValues {+ currentTeamIdStrict: number | string // teamLogic+ activeIssuesByKind: Record<string, HealthIssue>+ allChecks: HealthCheck[]+ checksByCategory: Record<HealthCheckCategory, HealthCheck[]>+ hasIssues: boolean+ hasUrgentIssues: boolean+ healthIssues: HealthIssuesResponse | null+ healthIssuesLoading: boolean+ nextRefreshAvailableAt: number | null+ overallHealthStatus: OverallHealthStatus+ urgentFailedChecks: HealthCheck[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsHealthLogicActions {+ reportWebAnalyticsHealthActionClicked: (props: {+ category: string+ check_id: string+ is_urgent: boolean+ status: string+ }) => {+ props: {+ category: string+ check_id: string+ is_urgent: boolean+ status: string+ }+ } // eventUsageLogic+ reportWebAnalyticsHealthRefreshed: (props: { overall_status: string; passed_count: number }) => {+ props: {+ overall_status: string+ passed_count: number+ }+ } // eventUsageLogic+ reportWebAnalyticsHealthSectionToggled: (props: { category: string; is_expanded: boolean }) => {+ props: {+ category: string+ is_expanded: boolean+ }+ } // eventUsageLogic+ reportWebAnalyticsHealthStatus: (props: {+ has_authorized_urls: boolean+ has_pageleaves: boolean+ has_pageviews: boolean+ has_reverse_proxy: boolean+ has_scroll_depth: boolean+ has_web_vitals: boolean+ overall_status: string+ }) => {+ props: {+ has_authorized_urls: boolean+ has_pageleaves: boolean+ has_pageviews: boolean+ has_reverse_proxy: boolean+ has_scroll_depth: boolean+ has_web_vitals: boolean+ overall_status: string+ }+ } // eventUsageLogic+ reportWebAnalyticsHealthTabViewed: (props: {+ error_count: number+ overall_status: string+ passed_count: number+ warning_count: number+ }) => {+ props: {+ error_count: number+ overall_status: string+ passed_count: number+ warning_count: number+ }+ } // eventUsageLogic+ loadHealthIssues: () => any+ loadHealthIssuesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadHealthIssuesSuccess: (+ healthIssues: HealthIssuesResponse,+ payload?: any+ ) => {+ healthIssues: HealthIssuesResponse+ payload?: any+ }+ refreshHealthChecks: (isManual?: boolean) => {+ isManual: boolean+ }+ setNextRefreshAvailableAt: (timestamp: number | null) => {+ timestamp: number | null+ }+ trackActionClicked: (+ checkId: HealthCheckId,+ category: HealthCheckCategory,+ status: HealthCheckStatus,+ isUrgent: boolean+ ) => {+ category: HealthCheckCategory+ checkId: HealthCheckId+ isUrgent: boolean+ status: HealthCheckStatus+ }+ trackSectionToggled: (+ category: HealthCheckCategory,+ isExpanded: boolean+ ) => {+ category: HealthCheckCategory+ isExpanded: boolean+ }+ trackTabViewed: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsHealthLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ activeIssuesByKind: (healthIssues: HealthIssuesResponse | null) => Record<string, HealthIssue>+ allChecks: (+ activeIssuesByKind: Record<string, HealthIssue>,+ healthIssuesLoading: boolean,+ healthIssues: HealthIssuesResponse | null+ ) => HealthCheck[]+ checksByCategory: (allChecks: HealthCheck[]) => Record<HealthCheckCategory, HealthCheck[]>+ overallHealthStatus: (allChecks: HealthCheck[]) => OverallHealthStatus+ hasIssues: (overallHealthStatus: OverallHealthStatus) => boolean+ urgentFailedChecks: (allChecks: HealthCheck[]) => HealthCheck[]+ hasUrgentIssues: (urgentFailedChecks: HealthCheck[]) => boolean+ }+}++export type webAnalyticsHealthLogicType = MakeLogicType<+ webAnalyticsHealthLogicValues,+ webAnalyticsHealthLogicActions,+ Record<string, any>,+ webAnalyticsHealthLogicMeta+>+export const webAnalyticsHealthLogic = kea<webAnalyticsHealthLogicType>([path(['scenes', 'web-analytics', 'health', 'webAnalyticsHealthLogic']),diff --git a/frontend/src/scenes/web-analytics/pageReportsLogic.ts b/frontend/src/scenes/web-analytics/pageReportsLogic.tsindex 17e2f8d4bba7..342522868c61 100644--- a/frontend/src/scenes/web-analytics/pageReportsLogic.ts+++ b/frontend/src/scenes/web-analytics/pageReportsLogic.ts@@ -1,4 +1,4 @@-import { kea } from 'kea'+import { MakeLogicType, kea } from 'kea'import { router } from 'kea-router'import api from 'lib/api'@@ -32,6 +32,8 @@ import {TeamType,} from '~/types'+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'+import type { QueryLogTags } from '../../queries/schema/schema-general'import {DeviceTab,GeographyTab,@@ -49,8 +51,8 @@ import {parseWebAnalyticsURL,} from './common'import { PROPERTY_PATHNAME } from './constants'-import type { pageReportsLogicType } from './pageReportsLogicType'import { webAnalyticsLogic } from './webAnalyticsLogic'+import type { DateFilterState } from './webAnalyticsLogic'/*** Creates property filters for URL matching that handles query parameters consistently@@ -258,6 +260,337 @@ const createTimeOnPageTrendsQuery = (}}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface pageReportsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ compareFilter: CompareFilter // webAnalyticsLogic+ controls: {+ filterTestAccounts: boolean+ includeHostPath: boolean+ isPathCleaningEnabled: boolean+ shouldStripQueryParams: boolean+ useWebAnalyticsPrecompute: boolean | undefined+ } // webAnalyticsLogic+ dateFilter: DateFilterState // webAnalyticsLogic+ isPathCleaningEnabled: boolean // webAnalyticsLogic+ selectedHost: string | null // webAnalyticsLogic+ shouldFilterTestAccounts: boolean // webAnalyticsLogic+ webAnalyticsFilters: WebAnalyticsPropertyFilters // webAnalyticsLogic+ webAnalyticsTiles: WebAnalyticsTile[] // webAnalyticsLogic+ combinedMetricsQuery: (dateFilter: DateFilterState) => InsightVizNode<TrendsQuery>+ createInsightProps: (tileId: TileId, tabId?: string | undefined) => InsightLogicProps<QuerySchema>+ hasPageUrl: boolean+ isInitialLoad: boolean+ isLoading: boolean+ pageUrl: string | null+ pageUrlOptions: PageURLOption[]+ pageUrlSearchTerm: string+ pagesUrls: PageURLSearchResult[]+ pagesUrlsLoading: boolean+ pathCleaningFilters: PathCleaningFilter[]+ queries:+ | {+ avgTimeOnPageTrendQuery: InsightVizNode<TrendsQuery> | undefined+ browserQuery: QuerySchema | undefined+ channelsQuery: QuerySchema | undefined+ citiesQuery: QuerySchema | undefined+ countriesQuery: QuerySchema | undefined+ deviceTypeQuery: QuerySchema | undefined+ entryPathsQuery: QuerySchema | undefined+ exitPathsQuery: QuerySchema | undefined+ languagesQuery: QuerySchema | undefined+ osQuery: QuerySchema | undefined+ outboundClicksQuery: QuerySchema | undefined+ prevPathsQuery: {+ embedded: boolean+ full: boolean+ kind: NodeKind+ showActions: boolean+ source: {+ breakdownBy: WebStatsBreakdown+ compareFilter: CompareFilter+ dateRange: {+ date_from: string | null+ date_to: string | null+ }+ doPathCleaning: boolean+ filterTestAccounts: boolean+ kind: NodeKind+ limit: number+ properties: WebAnalyticsPropertyFilters+ tags: QueryLogTags+ }+ }+ referrersQuery: QuerySchema | undefined+ regionsQuery: QuerySchema | undefined+ timezonesQuery: QuerySchema | undefined+ topEventsQuery: QuerySchema | undefined+ utmCampaignQuery: QuerySchema | undefined+ utmContentQuery: QuerySchema | undefined+ utmMediumQuery: QuerySchema | undefined+ utmSourceQuery: QuerySchema | undefined+ utmTermQuery: QuerySchema | undefined+ }+ | {+ avgTimeOnPageTrendQuery: undefined+ browserQuery: undefined+ channelsQuery: undefined+ citiesQuery: undefined+ countriesQuery: undefined+ deviceTypeQuery: undefined+ entryPathsQuery: undefined+ exitPathsQuery: undefined+ languagesQuery: undefined+ osQuery: undefined+ outboundClicksQuery: undefined+ prevPathsQuery?: undefined+ referrersQuery: undefined+ regionsQuery: undefined+ timezonesQuery: undefined+ topEventsQuery: undefined+ utmCampaignQuery: undefined+ utmContentQuery: undefined+ utmMediumQuery: undefined+ utmSourceQuery: undefined+ utmTermQuery: undefined+ }+ stripQueryParams: boolean+ tileVisualizations: Record<TileId, TileVisualizationOption>+ tiles: SectionTile[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface pageReportsLogicActions {+ setDates: (+ dateFrom: string | null,+ dateTo: string | null+ ) => {+ dateFrom: string | null+ dateTo: string | null+ } // webAnalyticsLogic+ setDomainFilter: (domain: string | null) => {+ domain: string | null+ } // webAnalyticsLogic+ setIsPathCleaningEnabled: (isPathCleaningEnabled: boolean) => {+ isPathCleaningEnabled: boolean+ } // webAnalyticsLogic+ loadPages: (searchTerm?: string) => {+ searchTerm: string+ }+ loadPagesUrls: ({ searchTerm }: { searchTerm: string }) => {+ searchTerm: string+ }+ loadPagesUrlsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPagesUrlsSuccess: (+ pagesUrls: PageURLSearchResult[],+ payload?: {+ searchTerm: string+ }+ ) => {+ pagesUrls: PageURLSearchResult[]+ payload?: {+ searchTerm: string+ }+ }+ setPageUrl: (url: string | string[] | null) => {+ url: string | string[] | null+ }+ setPageUrlSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+ setTileVisualization: (+ tileId: TileId,+ visualization: TileVisualizationOption+ ) => {+ tileId: TileId+ visualization: TileVisualizationOption+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface pageReportsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ hasPageUrl: (pageUrl: string | null) => boolean+ isLoading: (pagesUrlsLoading: boolean, isInitialLoad: boolean) => boolean+ pathCleaningFilters: (currentTeam: TeamPublicType | TeamType | null) => PathCleaningFilter[]+ pageUrlOptions: (+ pagesUrls: PageURLSearchResult[],+ pageUrl: string | null,+ pathCleaningFilters: PathCleaningFilter[],+ isPathCleaningEnabled: boolean+ ) => PageURLOption[]+ queries: (+ webAnalyticsTiles: WebAnalyticsTile[],+ pageUrl: string | null,+ stripQueryParams: boolean,+ dateFilter: DateFilterState,+ shouldFilterTestAccounts: boolean,+ compareFilter: CompareFilter,+ isPathCleaningEnabled: boolean,+ selectedHost: string | null+ ) =>+ | {+ avgTimeOnPageTrendQuery: InsightVizNode<TrendsQuery> | undefined+ browserQuery: QuerySchema | undefined+ channelsQuery: QuerySchema | undefined+ citiesQuery: QuerySchema | undefined+ countriesQuery: QuerySchema | undefined+ deviceTypeQuery: QuerySchema | undefined+ entryPathsQuery: QuerySchema | undefined+ exitPathsQuery: QuerySchema | undefined+ languagesQuery: QuerySchema | undefined+ osQuery: QuerySchema | undefined+ outboundClicksQuery: QuerySchema | undefined+ prevPathsQuery: {+ embedded: boolean+ full: boolean+ kind: NodeKind+ showActions: boolean+ source: {+ breakdownBy: WebStatsBreakdown+ compareFilter: CompareFilter+ dateRange: {+ date_from: string | null+ date_to: string | null+ }+ doPathCleaning: boolean+ filterTestAccounts: boolean+ kind: NodeKind+ limit: number+ properties: WebAnalyticsPropertyFilters+ tags: QueryLogTags+ }+ }+ referrersQuery: QuerySchema | undefined+ regionsQuery: QuerySchema | undefined+ timezonesQuery: QuerySchema | undefined+ topEventsQuery: QuerySchema | undefined+ utmCampaignQuery: QuerySchema | undefined+ utmContentQuery: QuerySchema | undefined+ utmMediumQuery: QuerySchema | undefined+ utmSourceQuery: QuerySchema | undefined+ utmTermQuery: QuerySchema | undefined+ }+ | {+ avgTimeOnPageTrendQuery: undefined+ browserQuery: undefined+ channelsQuery: undefined+ citiesQuery: undefined+ countriesQuery: undefined+ deviceTypeQuery: undefined+ entryPathsQuery: undefined+ exitPathsQuery: undefined+ languagesQuery: undefined+ osQuery: undefined+ outboundClicksQuery: undefined+ prevPathsQuery?: undefined+ referrersQuery: undefined+ regionsQuery: undefined+ timezonesQuery: undefined+ topEventsQuery: undefined+ utmCampaignQuery: undefined+ utmContentQuery: undefined+ utmMediumQuery: undefined+ utmSourceQuery: undefined+ utmTermQuery: undefined+ }+ combinedMetricsQuery: (+ pageUrl: string | null,+ stripQueryParams: boolean,+ shouldFilterTestAccounts: boolean,+ selectedHost: string | null,+ isPathCleaningEnabled: boolean+ ) => (dateFilter: DateFilterState) => InsightVizNode<TrendsQuery>+ tiles: (+ queries:+ | {+ avgTimeOnPageTrendQuery: InsightVizNode<TrendsQuery> | undefined+ browserQuery: QuerySchema | undefined+ channelsQuery: QuerySchema | undefined+ citiesQuery: QuerySchema | undefined+ countriesQuery: QuerySchema | undefined+ deviceTypeQuery: QuerySchema | undefined+ entryPathsQuery: QuerySchema | undefined+ exitPathsQuery: QuerySchema | undefined+ languagesQuery: QuerySchema | undefined+ osQuery: QuerySchema | undefined+ outboundClicksQuery: QuerySchema | undefined+ prevPathsQuery: {+ embedded: boolean+ full: boolean+ kind: NodeKind+ showActions: boolean+ source: {+ breakdownBy: WebStatsBreakdown+ compareFilter: CompareFilter+ dateRange: {+ date_from: string | null+ date_to: string | null+ }+ doPathCleaning: boolean+ filterTestAccounts: boolean+ kind: NodeKind+ limit: number+ properties: WebAnalyticsPropertyFilters+ tags: QueryLogTags+ }+ }+ referrersQuery: QuerySchema | undefined+ regionsQuery: QuerySchema | undefined+ timezonesQuery: QuerySchema | undefined+ topEventsQuery: QuerySchema | undefined+ utmCampaignQuery: QuerySchema | undefined+ utmContentQuery: QuerySchema | undefined+ utmMediumQuery: QuerySchema | undefined+ utmSourceQuery: QuerySchema | undefined+ utmTermQuery: QuerySchema | undefined+ }+ | {+ avgTimeOnPageTrendQuery: undefined+ browserQuery: undefined+ channelsQuery: undefined+ citiesQuery: undefined+ countriesQuery: undefined+ deviceTypeQuery: undefined+ entryPathsQuery: undefined+ exitPathsQuery: undefined+ languagesQuery: undefined+ osQuery: undefined+ outboundClicksQuery: undefined+ prevPathsQuery?: undefined+ referrersQuery: undefined+ regionsQuery: undefined+ timezonesQuery: undefined+ topEventsQuery: undefined+ utmCampaignQuery: undefined+ utmContentQuery: undefined+ utmMediumQuery: undefined+ utmSourceQuery: undefined+ utmTermQuery: undefined+ },+ pageUrl: string | null,+ createInsightProps: (tileId: TileId, tabId?: string | undefined) => InsightLogicProps<QuerySchema>,+ combinedMetricsQuery: (dateFilter: DateFilterState) => InsightVizNode<TrendsQuery>,+ dateFilter: DateFilterState,+ featureFlags: FeatureFlagsSet+ ) => SectionTile[]+ }+}++export type pageReportsLogicType = MakeLogicType<+ pageReportsLogicValues,+ pageReportsLogicActions,+ Record<string, any>,+ pageReportsLogicMeta+>+export const pageReportsLogic = kea<pageReportsLogicType>({path: ['scenes', 'web-analytics', 'pageReportsLogic'],diff --git a/frontend/src/scenes/web-analytics/recap/webAnalyticsRecapLogic.ts b/frontend/src/scenes/web-analytics/recap/webAnalyticsRecapLogic.tsindex 06ee85ae6d04..46d4f2284402 100644--- a/frontend/src/scenes/web-analytics/recap/webAnalyticsRecapLogic.ts+++ b/frontend/src/scenes/web-analytics/recap/webAnalyticsRecapLogic.ts@@ -1,4 +1,4 @@-import { actions, afterMount, connect, kea, listeners, path } from 'kea'+import { MakeLogicType, actions, afterMount, connect, kea, listeners, path } from 'kea'import { loaders } from 'kea-loaders'import { router } from 'kea-router'import posthog from 'posthog-js'@@ -11,7 +11,6 @@ import { webAnalyticsRecap } from 'products/web_analytics/frontend/generated/apiimport type { WebAnalyticsRecapResponseApi } from 'products/web_analytics/frontend/generated/api.schemas'import { formatRecapDateRange } from './recapDates'-import type { webAnalyticsRecapLogicType } from './webAnalyticsRecapLogicType'export type RecapShareMethod = 'copy_link' | 'copy_slack' | 'copy_email'export type RecapCta = 'view_dashboard' | 'ask_posthog_ai' | 'go_to_web_analytics'@@ -62,6 +61,61 @@ function buildEmailCopy(recap: WebAnalyticsRecapResponseApi): string {].join('\n')}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsRecapLogicValues {+ currentProjectId: number | null // projectLogic+ recap: WebAnalyticsRecapResponseApi | null+ recapLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsRecapLogicActions {+ copyRecapForEmail: () => {+ value: true+ }+ copyRecapForSlack: () => {+ value: true+ }+ copyRecapLink: () => {+ value: true+ }+ goToWebAnalytics: (cta: Extract<RecapCta, 'go_to_web_analytics' | 'view_dashboard'>) => {+ cta: 'go_to_web_analytics' | 'view_dashboard'+ }+ loadRecap: () => any+ loadRecapFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadRecapSuccess: (+ recap: WebAnalyticsRecapResponseApi | null,+ payload?: any+ ) => {+ recap: WebAnalyticsRecapResponseApi | null+ payload?: any+ }+ recordButtonClicked: (button: RecapButton) => {+ button: RecapButton+ }+ recordCtaClicked: (cta: RecapCta) => {+ cta: RecapCta+ }+ recordOpened: () => {+ value: true+ }+ recordReachedEnd: () => {+ value: true+ }+ recordShared: (method: RecapShareMethod) => {+ method: RecapShareMethod+ }+}++export type webAnalyticsRecapLogicType = MakeLogicType<webAnalyticsRecapLogicValues, webAnalyticsRecapLogicActions>+export const webAnalyticsRecapLogic = kea<webAnalyticsRecapLogicType>([path(['scenes', 'web-analytics', 'recap', 'webAnalyticsRecapLogic']),connect(() => ({diff --git a/frontend/src/scenes/web-analytics/shareNudgeLogic.ts b/frontend/src/scenes/web-analytics/shareNudgeLogic.tsindex b159989f5a4e..7836190efad7 100644--- a/frontend/src/scenes/web-analytics/shareNudgeLogic.ts+++ b/frontend/src/scenes/web-analytics/shareNudgeLogic.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 { subscriptions } from 'kea-subscriptions'import posthog from 'posthog-js'@@ -6,11 +6,59 @@ import { FEATURE_FLAGS } from 'lib/constants'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { organizationLogic } from 'scenes/organizationLogic'-import type { shareNudgeLogicType } from './shareNudgeLogicType'+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'+import type { OrganizationType } from '../../types'const FLAG = FEATURE_FLAGS.WEB_ANALYTICS_SHARE_NUDGE_V2const EXPORT_PROMPT_PROBABILITY = 0.25+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface shareNudgeLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentOrganization: OrganizationType | null // organizationLogic+ emphasizeShareButton: boolean+ exportPromptEnabled: boolean+ hasColleagues: boolean+ intentPromptEnabled: boolean+ promptSource: string | null+ promptVisible: boolean+ sessionDismissed: boolean+ showBanner: boolean+ variant: string | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface shareNudgeLogicActions {+ dismissForSession: () => {+ value: true+ }+ exportTriggered: () => {+ value: true+ }+ showPrompt: (source: string) => {+ source: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface shareNudgeLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ hasColleagues: (currentOrganization: OrganizationType | null) => boolean+ variant: (featureFlags: FeatureFlagsSet, hasColleagues: boolean) => string | null+ showBanner: (variant: string | null, sessionDismissed: boolean) => boolean+ emphasizeShareButton: (variant: string | null) => boolean+ intentPromptEnabled: (variant: string | null) => boolean+ exportPromptEnabled: (variant: string | null) => boolean+ }+}++export type shareNudgeLogicType = MakeLogicType<+ shareNudgeLogicValues,+ shareNudgeLogicActions,+ Record<string, any>,+ shareNudgeLogicMeta+>+export const shareNudgeLogic = kea<shareNudgeLogicType>([path(['scenes', 'web-analytics', 'shareNudgeLogic']),connect(() => ({@@ -45,20 +93,26 @@ export const shareNudgeLogic = kea<shareNudgeLogicType>([selectors({hasColleagues: [(s) => [s.currentOrganization],- (currentOrganization): boolean => (currentOrganization?.member_count ?? 1) >= 2,+ (currentOrganization: null | import('../../types').OrganizationType): boolean =>+ (currentOrganization?.member_count ?? 1) >= 2,],variant: [(s) => [s.featureFlags, s.hasColleagues],- (featureFlags, hasColleagues): string | null => {+ (+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,+ hasColleagues: boolean+ ): string | null => {const flag = featureFlags[FLAG]return hasColleagues && typeof flag === 'string' ? flag : null},],showBanner: [(s) => [s.variant, s.sessionDismissed],- (variant, sessionDismissed): boolean => variant === 'banner' && !sessionDismissed,+ (variant: string | null, sessionDismissed: boolean): boolean => variant === 'banner' && !sessionDismissed,],- exportPromptEnabled: [(s) => [s.variant], (variant): boolean => variant === 'export'],+ emphasizeShareButton: [(s) => [s.variant], (variant: string | null): boolean => variant === 'button'],+ intentPromptEnabled: [(s) => [s.variant], (variant: string | null): boolean => variant === 'prompt'],+ exportPromptEnabled: [(s) => [s.variant], (variant: string | null): boolean => variant === 'export'],}),listeners(({ values, actions }) => ({showPrompt: ({ source }) => {diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.tsindex 411b59ab7da8..e3d45b2b21a1 100644--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.ts+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic.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 { actionToUrl } from 'kea-router'import { FEATURE_FLAGS } from 'lib/constants'@@ -35,8 +35,10 @@ import { ChartDisplayType } from '~/types'import { mapUrlToProvider } from 'products/data_warehouse/frontend/shared/components/SourceIcon'import { sourceManagementLogic } from 'products/data_warehouse/frontend/shared/logics/sourceManagementLogic'+import type { PaginatedResponse } from '../../../../../../lib/api'+import type { FeatureFlagsSet } from '../../../../../../lib/logic/featureFlagLogic'+import type { ProductIntentProperties } from '../../../../../../lib/utils/product-intents'import { defaultConversionGoalFilter } from '../components/settings/constants'-import type { marketingAnalyticsLogicType } from './marketingAnalyticsLogicType'import { marketingAnalyticsSettingsLogic } from './marketingAnalyticsSettingsLogic'import { externalAdsCostTile } from './marketingCostTile'import {@@ -209,6 +211,348 @@ const INITIAL_DATE_FROM = '-7d' as string | nullconst INITIAL_DATE_TO = null as string | nullconst INITIAL_INTERVAL = getDefaultInterval(INITIAL_DATE_FROM, INITIAL_DATE_TO)+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ conversion_goals: ConversionGoalFilter[] // marketingAnalyticsSettingsLogic+ sources_map: Record<string, SourceMap> // marketingAnalyticsSettingsLogic+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null // sourceManagementLogic+ dataWarehouseSourcesLoading: boolean // sourceManagementLogic+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[] // sourceManagementLogic+ baseCurrency: CurrencyCode // teamLogic+ _drillDownLevel: MarketingAnalyticsDrillDownLevel+ activeTab: MarketingAnalyticsTab+ allAvailableSources: {+ id: string+ name: string+ prefix?: string | undefined+ source_type: string+ type: string+ }[]+ allAvailableSourcesWithStatus: {+ id: string+ name: string+ prefix?: string | undefined+ source_type: string+ status: SourceStatus+ statusMessage: string+ type: string+ }[]+ allExternalTablesWithStatus: {+ columns: {+ name: string+ type: string+ }[]+ dw_source_type: string+ external_type: DataWarehouseSettingsTab+ id: string+ name: string+ schema_name: string+ schema_status?: string | undefined+ source_map: SourceMap | null+ source_map_id: string+ source_prefix: string+ source_type: string+ sourceUrl: string+ status: SourceStatus+ statusMessage: string+ url_pattern: string+ }[]+ chartDisplayType: ChartDisplayType+ columnConfigModalVisible: boolean+ compareFilter: CompareFilter+ conversionGoalInput: ConversionGoalFilter+ conversionGoalModalVisible: boolean+ createMarketingDataWarehouseNodes: DataWarehouseNode[]+ dateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ }+ draftConversionGoal: ConversionGoalFilter | null+ drillDownLevel: MarketingAnalyticsDrillDownLevel+ externalTables: ExternalTable[]+ hasNoConfiguredSources: boolean+ hasSources: boolean+ initialized: boolean+ integrationFilter: IntegrationFilter+ loading: boolean+ nativeSources: ExternalDataSource[]+ nativeSourcesHierarchyStatus: NativeSourceHierarchyStatus[]+ overviewQuery: MarketingAnalyticsAggregatedQuery+ tileColumnSelection: validColumnsForTiles+ uniqueConversionGoalName: string+ validExternalTables: ExternalTable[]+ validNativeSources: NativeSource[]+ validSourcesMap: {+ [x: string]: SourceMap+ } | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsLogicActions {+ reloadAll: () => {} // dataNodeCollectionLogic+ addOrUpdateConversionGoal: (conversionGoal: ConversionGoalFilter) => {+ conversionGoal: ConversionGoalFilter+ } // marketingAnalyticsSettingsLogic+ loadDatabase: (+ args_0?:+ | {+ force?: boolean+ }+ | undefined+ ) => {+ force?: boolean+ } // sourceManagementLogic+ loadSources: () => {+ value: true+ } // sourceManagementLogic+ loadSourcesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ } // sourceManagementLogic+ 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+ }+ } // sourceManagementLogic+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic+ applyConversionGoal: () => {+ value: true+ }+ clearConversionGoal: () => {+ value: true+ }+ hideColumnConfigModal: () => {+ value: true+ }+ hideConversionGoalModal: () => {+ value: true+ }+ loadConversionGoal: (goal: ConversionGoalFilter) => {+ goal: ConversionGoalFilter+ }+ saveConversionGoal: () => {+ value: true+ }+ setActiveTab: (tab: MarketingAnalyticsTab) => {+ tab: MarketingAnalyticsTab+ }+ setChartDisplayType: (chartDisplayType: ChartDisplayType) => {+ chartDisplayType: ChartDisplayType+ }+ setCompareFilter: (compareFilter: CompareFilter) => {+ compareFilter: CompareFilter+ }+ setConversionGoalInput: (goal: ConversionGoalFilter) => {+ goal: ConversionGoalFilter+ }+ setDateInterval: (interval: IntervalType) => {+ interval: IntervalType+ }+ setDates: (+ dateFrom: string | null,+ dateTo: string | null+ ) => {+ dateFrom: string | null+ dateTo: string | null+ }+ setDatesAndInterval: (+ dateFrom: string | null,+ dateTo: string | null,+ interval: IntervalType+ ) => {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ }+ setDraftConversionGoal: (goal: ConversionGoalFilter | null) => {+ goal: ConversionGoalFilter | null+ }+ setDrillDownLevel: (level: MarketingAnalyticsDrillDownLevel) => {+ level: MarketingAnalyticsDrillDownLevel+ }+ setInitialized: () => {+ value: true+ }+ setIntegrationFilter: (integrationFilter: IntegrationFilter) => {+ integrationFilter: IntegrationFilter+ }+ setTileColumnSelection: (column: validColumnsForTiles) => {+ column: validColumnsForTiles+ }+ showColumnConfigModal: () => {+ value: true+ }+ showConversionGoalModal: () => {+ value: true+ }+ syncFromUrl: (params: {+ chartDisplayType?: ChartDisplayType+ compare?: boolean+ compare_to?: string+ dateFrom?: string | null+ dateTo?: string | null+ drillDownLevel?: MarketingAnalyticsDrillDownLevel+ integrationSourceIds?: string[]+ interval?: IntervalType+ tileColumnSelection?: string+ }) => {+ params: {+ chartDisplayType?: ChartDisplayType | undefined+ compare?: boolean | undefined+ compare_to?: string | undefined+ dateFrom?: string | null | undefined+ dateTo?: string | null | undefined+ drillDownLevel?: MarketingAnalyticsDrillDownLevel | undefined+ integrationSourceIds?: string[] | undefined+ interval?: IntervalType | undefined+ tileColumnSelection?: string | undefined+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ drillDownLevel: (+ _drillDownLevel: MarketingAnalyticsDrillDownLevel,+ featureFlags: FeatureFlagsSet+ ) => MarketingAnalyticsDrillDownLevel+ validSourcesMap: (sources_map: Record<string, SourceMap>) => {+ [x: string]: SourceMap+ } | null+ externalTables: (+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],+ sources_map: Record<string, SourceMap>,+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null+ ) => ExternalTable[]+ validExternalTables: (+ externalTables: ExternalTable[],+ validSourcesMap: {+ [x: string]: SourceMap+ } | null+ ) => ExternalTable[]+ nativeSources: (dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null) => ExternalDataSource[]+ validNativeSources: (+ nativeSources: ExternalDataSource[],+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]+ ) => NativeSource[]+ uniqueConversionGoalName: (+ conversionGoalInput: ConversionGoalFilter,+ conversion_goals: ConversionGoalFilter[]+ ) => string+ nativeSourcesHierarchyStatus: (validNativeSources: NativeSource[]) => NativeSourceHierarchyStatus[]+ loading: (dataWarehouseSourcesLoading: boolean) => boolean+ allAvailableSources: (+ validExternalTables: ExternalTable[],+ validNativeSources: NativeSource[]+ ) => {+ id: string+ name: string+ prefix?: string | undefined+ source_type: string+ type: string+ }[]+ allAvailableSourcesWithStatus: (+ allAvailableSources: {+ id: string+ name: string+ prefix?: string | undefined+ source_type: string+ type: string+ }[],+ nativeSources: ExternalDataSource[],+ validExternalTables: ExternalTable[]+ ) => {+ id: string+ name: string+ prefix?: string | undefined+ source_type: string+ status: SourceStatus+ statusMessage: string+ type: string+ }[]+ hasNoConfiguredSources: (+ validExternalTables: ExternalTable[],+ validNativeSources: NativeSource[],+ loading: boolean,+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]+ ) => boolean+ hasSources: (validExternalTables: ExternalTable[], validNativeSources: NativeSource[]) => boolean+ allExternalTablesWithStatus: (+ externalTables: ExternalTable[],+ nativeSources: ExternalDataSource[]+ ) => {+ columns: {+ name: string+ type: string+ }[]+ dw_source_type: string+ external_type: DataWarehouseSettingsTab+ id: string+ name: string+ schema_name: string+ schema_status?: string | undefined+ source_map: SourceMap | null+ source_map_id: string+ source_prefix: string+ source_type: string+ sourceUrl: string+ status: SourceStatus+ statusMessage: string+ url_pattern: string+ }[]+ createMarketingDataWarehouseNodes: (+ validExternalTables: ExternalTable[],+ baseCurrency: CurrencyCode,+ validNativeSources: NativeSource[],+ tileColumnSelection: validColumnsForTiles,+ integrationFilter: IntegrationFilter+ ) => DataWarehouseNode[]+ overviewQuery: (+ dateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ },+ compareFilter: CompareFilter,+ draftConversionGoal: ConversionGoalFilter | null,+ integrationFilter: IntegrationFilter+ ) => MarketingAnalyticsAggregatedQuery+ }+}++export type marketingAnalyticsLogicType = MakeLogicType<+ marketingAnalyticsLogicValues,+ marketingAnalyticsLogicActions,+ Record<string, any>,+ marketingAnalyticsLogicMeta+>+export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([path(['scenes', 'webAnalytics', 'marketingAnalyticsLogic']),connect(() => ({@@ -450,7 +794,7 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],validSourcesMap: [(s) => [s.sources_map],- (sources_map) => {+ (sources_map: Record<string, SourceMap>) => {if (!sources_map || Object.keys(sources_map).length === 0) {return null}@@ -480,7 +824,11 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],externalTables: [(s) => [s.dataWarehouseTables, s.sources_map, s.dataWarehouseSources],- (dataWarehouseTables, sources_map, dataWarehouseSources) => {+ (+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],+ sources_map: Record<string, SourceMap>,+ dataWarehouseSources: null | import('../../../../../../lib/api').PaginatedResponse<ExternalDataSource>+ ) => {const externalTables: ExternalTable[] = []if (dataWarehouseTables?.length) {dataWarehouseTables.forEach((table) => {@@ -526,7 +874,7 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],validExternalTables: [(s) => [s.externalTables, s.validSourcesMap],- (externalTables, validSourcesMap: Record<string, SourceMap> | null): ExternalTable[] => {+ (externalTables: ExternalTable[], validSourcesMap: Record<string, SourceMap> | null): ExternalTable[] => {if (!validSourcesMap || Object.keys(validSourcesMap).length === 0) {return []}@@ -536,14 +884,19 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],nativeSources: [(s) => [s.dataWarehouseSources],- (dataWarehouseSources): ExternalDataSource[] =>+ (+ dataWarehouseSources: null | import('../../../../../../lib/api').PaginatedResponse<ExternalDataSource>+ ): ExternalDataSource[] =>dataWarehouseSources?.results.filter((source) =>VALID_NATIVE_MARKETING_SOURCES.includes(source.source_type as NativeMarketingSource)) ?? [],],validNativeSources: [(s) => [s.nativeSources, s.dataWarehouseTables],- (nativeSources, dataWarehouseTables): NativeSource[] => {+ (+ nativeSources: ExternalDataSource[],+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]+ ): NativeSource[] => {return nativeSources.reduce((validNativeSources: NativeSource[], source) => {const requiredFields =NEEDED_FIELDS_FOR_NATIVE_MARKETING_ANALYTICS[source.source_type as NativeMarketingSource] || []@@ -653,7 +1006,17 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],allAvailableSourcesWithStatus: [(s) => [s.allAvailableSources, s.nativeSources, s.validExternalTables],- (allAvailableSources, nativeSources: ExternalDataSource[], validExternalTables) => {+ (+ allAvailableSources: {+ id: string+ name: string+ prefix?: string | undefined+ source_type: string+ type: string+ }[],+ nativeSources: ExternalDataSource[],+ validExternalTables: ExternalTable[]+ ) => {const sourcesWithStatus = allAvailableSources.map((source) => {const status = getSourceStatus(source, nativeSources, validExternalTables)return {@@ -695,7 +1058,12 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],hasNoConfiguredSources: [(s) => [s.validExternalTables, s.validNativeSources, s.loading, s.dataWarehouseTables],- (validExternalTables, validNativeSources, loading, dataWarehouseTables): boolean => {+ (+ validExternalTables: ExternalTable[],+ validNativeSources: NativeSource[],+ loading: boolean,+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[]+ ): boolean => {// Don't show error banner while data is loading or if tables haven't been fetched yetif (loading || dataWarehouseTables === null) {return false@@ -710,7 +1078,7 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],allExternalTablesWithStatus: [(s) => [s.externalTables, s.nativeSources],- (externalTables, nativeSources) => {+ (externalTables: ExternalTable[], nativeSources: ExternalDataSource[]) => {// Filter out tables that belong to native sources (to avoid duplicates)// Only include BigQuery, self-managed, and other non-native sources// For example a native source could have multiple external tables.@@ -809,7 +1177,16 @@ export const marketingAnalyticsLogic = kea<marketingAnalyticsLogicType>([],overviewQuery: [(s) => [s.dateFilter, s.compareFilter, s.draftConversionGoal, s.integrationFilter],- (dateFilter, compareFilter, draftConversionGoal, integrationFilter): MarketingAnalyticsAggregatedQuery => ({+ (+ dateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ },+ compareFilter: CompareFilter,+ draftConversionGoal: ConversionGoalFilter | null,+ integrationFilter: IntegrationFilter+ ): MarketingAnalyticsAggregatedQuery => ({kind: NodeKind.MarketingAnalyticsAggregatedQuery,dateRange: {date_from: dateFilter.dateFrom,diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.tsindex 84c4bfca45c3..dce4cb08f356 100644--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.ts+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.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 api from 'lib/api'@@ -25,8 +25,10 @@ import { ExternalDataSource } from '~/types'import { sourceManagementLogic } from 'products/data_warehouse/frontend/shared/logics/sourceManagementLogic'+import type { PaginatedResponse } from '../../../../../../lib/api'+import type { ProductIntentProperties } from '../../../../../../lib/utils/product-intents'+import type { TeamPublicType, TeamType } from '../../../../../../types'import { IntegrationSettingsTab } from '../components/settings/IntegrationSettingsModal'-import type { marketingAnalyticsSettingsLogicType } from './marketingAnalyticsSettingsLogicType'import { DEFAULT_ATTRIBUTION_WINDOW_DAYS, generateUniqueName } from './utils'export interface IntegrationSettingsModalState {@@ -58,6 +60,159 @@ const createEmptyConfig = (): MarketingAnalyticsConfig => ({const isNativeMarketingSource = (value: string): value is NativeMarketingSource =>VALID_NATIVE_MARKETING_SOURCES.includes(value as NativeMarketingSource)+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsSettingsLogicValues {+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null // sourceManagementLogic+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[] // sourceManagementLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ currentTeamId: number | null // teamLogic+ attribution_mode: AttributionMode+ attribution_window_days: number+ conversion_goals: ConversionGoalFilter[]+ integrationCampaignTables: Record<string, string>+ integrationCampaigns: Record<+ string,+ Array<{+ id: string+ name: string+ }>+ >+ integrationCampaignsLoading: Record<string, boolean>+ integrationSettingsModal: IntegrationSettingsModalState+ marketingAnalyticsConfig: MarketingAnalyticsConfig | null+ marketingAnalyticsConfigLoading: boolean+ savedMarketingAnalyticsConfig: MarketingAnalyticsConfig+ sources_map: Record<string, SourceMap>+ testMappingResults: Record<string, TestMappingResult>+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsSettingsLogicActions {+ addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogic+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType> // teamLogic+ addOrUpdateConversionGoal: (conversionGoal: ConversionGoalFilter) => {+ conversionGoal: ConversionGoalFilter+ }+ closeIntegrationSettingsModal: () => {+ value: true+ }+ loadIntegrationCampaigns: (integration: string) => {+ integration: string+ }+ loadMarketingAnalyticsConfig: () => any+ loadMarketingAnalyticsConfigFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadMarketingAnalyticsConfigSuccess: (+ marketingAnalyticsConfig: MarketingAnalyticsConfig | null,+ payload?: any+ ) => {+ marketingAnalyticsConfig: MarketingAnalyticsConfig | null+ payload?: any+ }+ openIntegrationSettingsModal: (+ integration: NativeMarketingSource,+ initialTab: IntegrationSettingsTab,+ initialUtmValue: string,+ initialCampaignName?: string+ ) => {+ initialCampaignName: string+ initialTab: IntegrationSettingsTab+ initialUtmValue: string+ integration:+ | 'BingAds'+ | 'GoogleAds'+ | 'LinkedinAds'+ | 'MetaAds'+ | 'PinterestAds'+ | 'RedditAds'+ | 'SnapchatAds'+ | 'TikTokAds'+ }+ removeConversionGoal: (goalId: string) => {+ goalId: string+ }+ setIntegrationCampaigns: (+ integration: string,+ campaigns: Array<{+ id: string+ name: string+ }>+ ) => {+ campaigns: {+ id: string+ name: string+ }[]+ integration: string+ }+ setTestMappingResult: (+ tableId: string,+ result: TestMappingResult+ ) => {+ result: TestMappingResult+ tableId: string+ }+ testMapping: (+ tableId: string,+ sourceMap: SourceMap+ ) => {+ sourceMap: SourceMap+ tableId: string+ }+ updateAttributionMode: (mode: AttributionMode) => {+ mode: AttributionMode+ }+ updateAttributionWindowDays: (days: number) => {+ days: number+ }+ updateCampaignFieldPreferences: (campaignFieldPreferences: Record<string, CampaignFieldPreference>) => {+ campaignFieldPreferences: Record<string, CampaignFieldPreference>+ }+ updateCampaignNameMappings: (campaignNameMappings: Record<string, Record<string, string[]>>) => {+ campaignNameMappings: Record<string, Record<string, string[]>>+ }+ updateConversionGoals: (conversionGoals: ConversionGoalFilter[]) => {+ conversionGoals: ConversionGoalFilter[]+ }+ updateCustomSourceMappings: (customSourceMappings: Record<string, string[]>) => {+ customSourceMappings: Record<string, string[]>+ }+ updateSourceMapping: (+ tableId: string,+ fieldName: MarketingAnalyticsColumnsSchemaNames,+ columnName: string | null+ ) => {+ columnName: string | null+ fieldName: MarketingAnalyticsColumnsSchemaNames+ tableId: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsSettingsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ sources_map: (marketingAnalyticsConfig: MarketingAnalyticsConfig | null) => Record<string, SourceMap>+ conversion_goals: (marketingAnalyticsConfig: MarketingAnalyticsConfig | null) => ConversionGoalFilter[]+ attribution_window_days: (marketingAnalyticsConfig: MarketingAnalyticsConfig | null) => number+ attribution_mode: (marketingAnalyticsConfig: MarketingAnalyticsConfig | null) => AttributionMode+ integrationCampaignTables: (+ dataWarehouseTables: DatabaseSchemaDataWarehouseTable[],+ dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null+ ) => Record<string, string>+ }+}++export type marketingAnalyticsSettingsLogicType = MakeLogicType<+ marketingAnalyticsSettingsLogicValues,+ marketingAnalyticsSettingsLogicActions,+ Record<string, any>,+ marketingAnalyticsSettingsLogicMeta+>+export const marketingAnalyticsSettingsLogic = kea<marketingAnalyticsSettingsLogicType>([path(['scenes', 'web-analytics', 'marketingAnalyticsSettingsLogic']),connect(() => ({diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTableLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTableLogic.tsindex c57977f65012..275c92e00378 100644--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTableLogic.ts+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTableLogic.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 { actionToUrl, urlToAction } from 'kea-router'import { isNotNil } from 'lib/utils/guards'@@ -19,7 +19,6 @@ import {import { DataWarehouseSettingsTab, ExternalDataSource } from '~/types'import { marketingAnalyticsLogic } from './marketingAnalyticsLogic'-import type { marketingAnalyticsTableLogicType } from './marketingAnalyticsTableLogicType'import { createMarketingAnalyticsOrderBy, isDraftConversionGoalColumn } from './utils'export type ExternalTable = {@@ -42,6 +41,44 @@ export type NativeSource = {tables: DatabaseSchemaDataWarehouseTable[]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsTableLogicValues {+ conversion_goals: ConversionGoalFilter[] // marketingAnalyticsLogic+ draftConversionGoal: ConversionGoalFilter | null // marketingAnalyticsLogic+ drillDownLevel: MarketingAnalyticsDrillDownLevel // marketingAnalyticsLogic+ defaultColumns: string[]+ query: DataTableNode | null+ sortedColumns: string[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsTableLogicActions {+ setDraftConversionGoal: (goal: ConversionGoalFilter | null) => {+ goal: ConversionGoalFilter | null+ } // marketingAnalyticsLogic+ setQuery: (query: DataTableNode) => {+ query: DataTableNode+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsTableLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ defaultColumns: (+ conversion_goals: ConversionGoalFilter[],+ drillDownLevel: MarketingAnalyticsDrillDownLevel+ ) => string[]+ sortedColumns: (defaultColumns: string[], query: DataTableNode | null) => string[]+ }+}++export type marketingAnalyticsTableLogicType = MakeLogicType<+ marketingAnalyticsTableLogicValues,+ marketingAnalyticsTableLogicActions,+ Record<string, any>,+ marketingAnalyticsTableLogicMeta+>+export const marketingAnalyticsTableLogic = kea<marketingAnalyticsTableLogicType>([path(['scenes', 'marketingAnalytics', 'marketingAnalyticsTableLogic']),connect(() => ({diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTilesLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTilesLogic.tsindex b0f8dd14c7b4..0906e6532c86 100644--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTilesLogic.ts+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsTilesLogic.ts@@ -1,4 +1,4 @@-import { connect, kea, path, selectors } from 'kea'+import { MakeLogicType, connect, kea, path, selectors } from 'kea'import { FEATURE_FLAGS } from 'lib/constants'import { FeatureFlagsSet, featureFlagLogic } from 'lib/logic/featureFlagLogic'@@ -36,7 +36,6 @@ import {import { marketingAnalyticsLogic } from './marketingAnalyticsLogic'import { marketingAnalyticsTableLogic } from './marketingAnalyticsTableLogic'-import type { marketingAnalyticsTilesLogicType } from './marketingAnalyticsTilesLogicType'import {getOrderBy,getSortedColumnsByArray,@@ -69,6 +68,92 @@ const createInsightProps = (tile: TileId, tab?: string): InsightLogicProps => ({dataNodeCollectionId: MARKETING_ANALYTICS_DATA_COLLECTION_NODE_ID,})+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsTilesLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ baseCurrency: CurrencyCode // marketingAnalyticsLogic+ chartDisplayType: ChartDisplayType // marketingAnalyticsLogic+ compareFilter: CompareFilter // marketingAnalyticsLogic+ createMarketingDataWarehouseNodes: DataWarehouseNode[] // marketingAnalyticsLogic+ dateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ } // marketingAnalyticsLogic+ draftConversionGoal: ConversionGoalFilter | null // marketingAnalyticsLogic+ drillDownLevel: MarketingAnalyticsDrillDownLevel // marketingAnalyticsLogic+ integrationFilter: IntegrationFilter // marketingAnalyticsLogic+ loading: boolean // marketingAnalyticsLogic+ tileColumnSelection: validColumnsForTiles // marketingAnalyticsLogic+ defaultColumns: string[] // marketingAnalyticsTableLogic+ query: DataTableNode | null // marketingAnalyticsTableLogic+ campaignBreakdownTile: QueryTile | null+ campaignCostsBreakdown: DataTableNode | null+ marketingChartTile: QueryTile+ overviewTile: QueryTile+ tiles: QueryTile[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface marketingAnalyticsTilesLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ overviewTile: (+ compareFilter: CompareFilter,+ dateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ },+ draftConversionGoal: ConversionGoalFilter | null,+ integrationFilter: IntegrationFilter+ ) => QueryTile+ marketingChartTile: (+ compareFilter: CompareFilter,+ dateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ },+ createMarketingDataWarehouseNodes: DataWarehouseNode[],+ chartDisplayType: ChartDisplayType,+ tileColumnSelection: validColumnsForTiles,+ baseCurrency: CurrencyCode,+ integrationFilter: IntegrationFilter,+ featureFlags: FeatureFlagsSet+ ) => QueryTile+ campaignBreakdownTile: (+ campaignCostsBreakdown: DataTableNode | null,+ drillDownLevel: MarketingAnalyticsDrillDownLevel+ ) => QueryTile | null+ tiles: (+ overviewTile: QueryTile,+ marketingChartTile: QueryTile,+ campaignBreakdownTile: QueryTile | null+ ) => QueryTile[]+ campaignCostsBreakdown: (+ loading: boolean,+ query: DataTableNode | null,+ dateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ },+ draftConversionGoal: ConversionGoalFilter | null,+ defaultColumns: string[],+ compareFilter: CompareFilter,+ integrationFilter: IntegrationFilter,+ drillDownLevel: MarketingAnalyticsDrillDownLevel+ ) => DataTableNode | null+ }+}++export type marketingAnalyticsTilesLogicType = MakeLogicType<+ marketingAnalyticsTilesLogicValues,+ {},+ Record<string, any>,+ marketingAnalyticsTilesLogicMeta+>+export const marketingAnalyticsTilesLogic = kea<marketingAnalyticsTilesLogicType>([path(['scenes', 'webAnalytics', 'marketingAnalyticsTilesLogic']),connect(() => ({diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.tsindex 56f6d5932608..6089c195024b 100644--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.ts+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.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 api from 'lib/api'@@ -11,10 +11,10 @@ import {VALID_NATIVE_MARKETING_SOURCES,} from '~/queries/schema/schema-general'+import type { CurrencyCode } from '../../../../../../queries/schema/schema-general'import { similarityScore } from '../components/settings/stringSimilarity'import { marketingAnalyticsSettingsLogic } from './marketingAnalyticsSettingsLogic'import { MARKETING_ANALYTICS_DATA_COLLECTION_NODE_ID } from './marketingAnalyticsTilesLogic'-import type { utmAuditLogicType } from './utmAuditLogicType'export interface UtmIssue {field: string@@ -85,6 +85,107 @@ const SOURCE_TO_INTEGRATION_NAME: Record<string, string> = Object.fromEntries(KNOWN_SOURCES_LIST.map((s) => [s.source, s.integration]))+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface utmAuditLogicValues {+ marketingAnalyticsConfig: MarketingAnalyticsConfig | null // marketingAnalyticsSettingsLogic+ baseCurrency: CurrencyCode // teamLogic+ currentTeamId: number | null // teamLogic+ activeTab: HealthTab+ aggregatedUtmSources: AggregatedUtmSource[]+ allMappedSources: Set<string>+ auditData: UtmAuditResponse | null+ auditDataFailure: string | null+ auditDataLoading: boolean+ availableSources: string[]+ campaignSearch: string+ campaignsWithoutUtmCount: number+ filteredCampaigns: CampaignAuditResult[]+ selectedCampaign: string | null+ selectedCampaignData: CampaignAuditResult | null+ selectedUtmCampaign: string | null+ sortedUtmCampaigns: UtmEvent[]+ sourceFilter: string | null+ totalUtmSourcesCount: number+ unmappedSourcesCount: number+ utmSearch: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface utmAuditLogicActions {+ reloadAll: () => {} // dataNodeCollectionLogic+ loadAuditData: () => any+ loadAuditDataFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAuditDataSuccess: (+ auditData: UtmAuditResponse,+ payload?: any+ ) => {+ auditData: UtmAuditResponse+ payload?: any+ }+ setActiveTab: (tab: HealthTab) => {+ tab: HealthTab+ }+ setCampaignSearch: (search: string) => {+ search: string+ }+ setSelectedCampaign: (campaignName: string | null) => {+ campaignName: string | null+ }+ setSelectedUtmCampaign: (utmCampaign: string | null) => {+ utmCampaign: string | null+ }+ setSourceFilter: (source: string | null) => {+ source: string | null+ }+ setUtmSearch: (search: string) => {+ search: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface utmAuditLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ availableSources: (auditData: UtmAuditResponse | null) => string[]+ filteredCampaigns: (+ auditData: UtmAuditResponse | null,+ sourceFilter: string | null,+ campaignSearch: string+ ) => CampaignAuditResult[]+ campaignsWithoutUtmCount: (auditData: UtmAuditResponse | null) => number+ totalUtmSourcesCount: (auditData: UtmAuditResponse | null) => number+ unmappedSourcesCount: (auditData: UtmAuditResponse | null, allMappedSources: Set<string>) => number+ selectedCampaignData: (+ auditData: UtmAuditResponse | null,+ selectedCampaign: string | null+ ) => CampaignAuditResult | null+ sortedUtmCampaigns: (+ auditData: UtmAuditResponse | null,+ selectedCampaign: string | null,+ utmSearch: string+ ) => UtmEvent[]+ allMappedSources: (marketingAnalyticsConfig: MarketingAnalyticsConfig | null) => Set<string>+ aggregatedUtmSources: (+ auditData: UtmAuditResponse | null,+ utmSearch: string,+ allMappedSources: Set<string>,+ marketingAnalyticsConfig: MarketingAnalyticsConfig | null+ ) => AggregatedUtmSource[]+ }+}++export type utmAuditLogicType = MakeLogicType<+ utmAuditLogicValues,+ utmAuditLogicActions,+ Record<string, any>,+ utmAuditLogicMeta+>+export const utmAuditLogic = kea<utmAuditLogicType>([path(['scenes', 'webAnalytics', 'utmAuditLogic']),connect(() => ({diff --git a/frontend/src/scenes/web-analytics/webAnalyticsFilterLogic.ts b/frontend/src/scenes/web-analytics/webAnalyticsFilterLogic.tsindex 4b0d50a96338..a13a84e3a807 100644--- a/frontend/src/scenes/web-analytics/webAnalyticsFilterLogic.ts+++ b/frontend/src/scenes/web-analytics/webAnalyticsFilterLogic.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 { AuthorizedUrlListType, authorizedUrlListLogic } from 'lib/components/AuthorizedUrlList/authorizedUrlListLogic'import { eventUsageLogic } from 'lib/utils/eventUsageLogic'@@ -8,7 +8,6 @@ import { CompareFilter, WebAnalyticsPropertyFilter, WebAnalyticsPropertyFiltersimport { PropertyFilterBaseValue, PropertyFilterType, PropertyOperator, WebAnalyticsFiltersConfig } from '~/types'import { DeviceType, INITIAL_WEB_ANALYTICS_FILTER } from './common'-import type { webAnalyticsFilterLogicType } from './webAnalyticsFilterLogicType'const teamId = window.POSTHOG_APP_CONTEXT?.current_team?.idconst persistConfig = { persist: true, prefix: `${teamId}__` }@@ -24,6 +23,101 @@ const eventFilter = (key: string, value: string | string[]): WebAnalyticsPropertexport const isLiveStreamFilter = (filter: WebAnalyticsPropertyFilter): boolean =>filter.type === PropertyFilterType.Event && filter.operator === PropertyOperator.Exact+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsFilterLogicValues {+ rawAuthorizedUrls: string[] // authorizedUrlListLogic+ authorizedDomains: string[]+ compareFilter: CompareFilter+ countryFilter: string | null+ deviceTypeFilter: DeviceType | null+ domainFilter: string | null+ effectiveDomain: string | null+ hasHostFilter: boolean+ liveFilters: WebAnalyticsPropertyFilter[]+ rawWebAnalyticsFilters: WebAnalyticsPropertyFilters+ referrerFilter: string | null+ selectedHost: string | null+ validatedDomainFilter: string | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsFilterLogicActions {+ clearFilters: () => {+ value: true+ }+ loadPreset: (filters: WebAnalyticsFiltersConfig) => {+ filters: WebAnalyticsFiltersConfig+ }+ setCompareFilter: (compareFilter: CompareFilter) => {+ compareFilter: CompareFilter+ }+ setCountryFilter: (countryCode: string | null) => {+ countryCode: string | null+ }+ setDeviceTypeFilter: (deviceType: DeviceType | null) => {+ deviceType: DeviceType | null+ }+ setDomainFilter: (domain: string | null) => {+ domain: string | null+ }+ setReferrerFilter: (referrer: string | null) => {+ referrer: string | null+ }+ setWebAnalyticsFilters: (webAnalyticsFilters: WebAnalyticsPropertyFilters) => {+ webAnalyticsFilters: WebAnalyticsPropertyFilters+ }+ togglePropertyFilter: (+ type: PropertyFilterType.Event | PropertyFilterType.Person | PropertyFilterType.Session,+ key: string,+ value: number | string | null,+ tabChange?: {+ activeHoursTab?: string+ deviceTab?: string+ geographyTab?: string+ graphsTab?: string+ pathTab?: string+ sourceTab?: string+ }+ ) => {+ key: string+ tabChange:+ | {+ activeHoursTab?: string | undefined+ deviceTab?: string | undefined+ geographyTab?: string | undefined+ graphsTab?: string | undefined+ pathTab?: string | undefined+ sourceTab?: string | undefined+ }+ | undefined+ type: PropertyFilterType.Event | PropertyFilterType.Person | PropertyFilterType.Session+ value: number | string | null+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsFilterLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ hasHostFilter: (rawWebAnalyticsFilters: WebAnalyticsPropertyFilters) => boolean+ authorizedDomains: (rawAuthorizedUrls: string[]) => string[]+ validatedDomainFilter: (domainFilter: string | null, authorizedDomains: string[]) => string | null+ selectedHost: (validatedDomainFilter: string | null) => string | null+ effectiveDomain: (domainFilter: string | null, authorizedDomains: string[]) => string | null+ liveFilters: (+ rawWebAnalyticsFilters: WebAnalyticsPropertyFilters,+ selectedHost: string | null,+ deviceTypeFilter: DeviceType | null+ ) => WebAnalyticsPropertyFilter[]+ }+}++export type webAnalyticsFilterLogicType = MakeLogicType<+ webAnalyticsFilterLogicValues,+ webAnalyticsFilterLogicActions,+ Record<string, any>,+ webAnalyticsFilterLogicMeta+>+export const webAnalyticsFilterLogic = kea<webAnalyticsFilterLogicType>([path(['scenes', 'webAnalytics', 'webAnalyticsFilterLogic']),connect(() => ({@@ -204,7 +298,10 @@ export const webAnalyticsFilterLogic = kea<webAnalyticsFilterLogicType>([],}),selectors({- hasHostFilter: [(s) => [s.rawWebAnalyticsFilters], (filters) => filters.some((f) => f.key === '$host')],+ hasHostFilter: [+ (s) => [s.rawWebAnalyticsFilters],+ (filters: WebAnalyticsPropertyFilters) => filters.some((f) => f.key === '$host'),+ ],authorizedDomains: [(s) => [s.rawAuthorizedUrls],(rawAuthorizedUrls: string[]): string[] => {diff --git a/frontend/src/scenes/web-analytics/webAnalyticsFilterPresetsLogic.ts b/frontend/src/scenes/web-analytics/webAnalyticsFilterPresetsLogic.tsindex f7f2d10d9185..ac78d45cb0f4 100644--- a/frontend/src/scenes/web-analytics/webAnalyticsFilterPresetsLogic.ts+++ b/frontend/src/scenes/web-analytics/webAnalyticsFilterPresetsLogic.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 { router } from 'kea-router'@@ -9,10 +9,203 @@ import { toParams } from 'lib/utils/url'import { WebAnalyticsFilterPresetType } from '~/types'+import type { WebAnalyticsFiltersConfig } from '../../types'import { webAnalyticsFilterLogic } from './webAnalyticsFilterLogic'-import type { webAnalyticsFilterPresetsLogicType } from './webAnalyticsFilterPresetsLogicType'import { webAnalyticsLogic } from './webAnalyticsLogic'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsFilterPresetsLogicValues {+ currentFiltersConfig: WebAnalyticsFiltersConfig // webAnalyticsLogic+ activePreset: WebAnalyticsFilterPresetType | null+ appliedPreset: WebAnalyticsFilterPresetType | null+ canSavePreset: boolean+ editingPreset: WebAnalyticsFilterPresetType | null+ hasPresets: boolean+ hasUnsavedChanges: boolean+ isEditMode: boolean+ pinnedPresets: WebAnalyticsFilterPresetType[]+ presetFormDescription: string+ presetFormName: string+ presetToDelete: WebAnalyticsFilterPresetType | null+ presets: PaginatedResponse<WebAnalyticsFilterPresetType>+ presetsLoading: boolean+ recentPresets: WebAnalyticsFilterPresetType[]+ saveModalOpen: boolean+ savedPreset: WebAnalyticsFilterPresetType | null+ savedPresetLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsFilterPresetsLogicActions {+ clearPropertyFilters: () => {+ value: true+ } // webAnalyticsFilterLogic+ loadPreset: (filters: WebAnalyticsFiltersConfig) => {+ filters: WebAnalyticsFiltersConfig+ } // webAnalyticsFilterLogic+ clearDateFilters: () => {+ value: true+ } // webAnalyticsLogic+ applyPreset: (preset: WebAnalyticsFilterPresetType) => {+ preset: WebAnalyticsFilterPresetType+ }+ checkForPresetRedirect: () => {+ value: true+ }+ clearPreset: () => {+ value: true+ }+ closeDeleteModal: () => {+ value: true+ }+ closeSaveModal: () => {+ value: true+ }+ deletePreset: (preset: WebAnalyticsFilterPresetType) => {+ preset: WebAnalyticsFilterPresetType+ }+ deletePresetFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ deletePresetSuccess: (+ savedPreset: null,+ payload?: {+ preset: WebAnalyticsFilterPresetType+ }+ ) => {+ savedPreset: null+ payload?: {+ preset: WebAnalyticsFilterPresetType+ }+ }+ loadPresets: () => {+ value: true+ }+ loadPresetsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPresetsSuccess: (+ presets: PaginatedResponse<WebAnalyticsFilterPresetType>,+ payload?: {+ value: true+ }+ ) => {+ presets: PaginatedResponse<WebAnalyticsFilterPresetType>+ payload?: {+ value: true+ }+ }+ openDeleteModal: (preset: WebAnalyticsFilterPresetType) => {+ preset: WebAnalyticsFilterPresetType+ }+ openEditModal: (preset: WebAnalyticsFilterPresetType) => {+ preset: WebAnalyticsFilterPresetType+ }+ openSaveModal: () => {+ value: true+ }+ resetPresetForm: () => {+ value: true+ }+ saveCurrentFiltersAsPreset: (+ name: string,+ description?: string+ ) => {+ description: string | undefined+ name: string+ }+ saveCurrentFiltersAsPresetFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ saveCurrentFiltersAsPresetSuccess: (+ savedPreset: WebAnalyticsFilterPresetType,+ payload?: {+ description: string | undefined+ name: string+ }+ ) => {+ savedPreset: WebAnalyticsFilterPresetType+ payload?: {+ description: string | undefined+ name: string+ }+ }+ setAppliedPreset: (preset: WebAnalyticsFilterPresetType | null) => {+ preset: WebAnalyticsFilterPresetType | null+ }+ setPresetFormDescription: (description: string) => {+ description: string+ }+ setPresetFormName: (name: string) => {+ name: string+ }+ updateAppliedPresetFilters: () => {+ value: true+ }+ updatePreset: (+ shortId: string,+ updates: Partial<WebAnalyticsFilterPresetType>+ ) => {+ shortId: string+ updates: Partial<WebAnalyticsFilterPresetType>+ }+ updatePresetFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ updatePresetSuccess: (+ savedPreset: WebAnalyticsFilterPresetType,+ payload?: {+ shortId: string+ updates: Partial<WebAnalyticsFilterPresetType>+ }+ ) => {+ savedPreset: WebAnalyticsFilterPresetType+ payload?: {+ shortId: string+ updates: Partial<WebAnalyticsFilterPresetType>+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsFilterPresetsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ pinnedPresets: (presets: PaginatedResponse<WebAnalyticsFilterPresetType>) => WebAnalyticsFilterPresetType[]+ recentPresets: (presets: PaginatedResponse<WebAnalyticsFilterPresetType>) => WebAnalyticsFilterPresetType[]+ hasPresets: (presets: PaginatedResponse<WebAnalyticsFilterPresetType>) => boolean+ canSavePreset: (presetFormName: string) => boolean+ activePreset: (appliedPreset: WebAnalyticsFilterPresetType | null) => WebAnalyticsFilterPresetType | null+ hasUnsavedChanges: (+ appliedPreset: WebAnalyticsFilterPresetType | null,+ currentFiltersConfig: WebAnalyticsFiltersConfig+ ) => boolean+ isEditMode: (editingPreset: WebAnalyticsFilterPresetType | null) => boolean+ }+}++export type webAnalyticsFilterPresetsLogicType = MakeLogicType<+ webAnalyticsFilterPresetsLogicValues,+ webAnalyticsFilterPresetsLogicActions,+ Record<string, any>,+ webAnalyticsFilterPresetsLogicMeta+>+export const webAnalyticsFilterPresetsLogic = kea<webAnalyticsFilterPresetsLogicType>([path(['scenes', 'webAnalytics', 'webAnalyticsFilterPresetsLogic']),connect(() => ({@@ -197,31 +390,31 @@ export const webAnalyticsFilterPresetsLogic = kea<webAnalyticsFilterPresetsLogicselectors({pinnedPresets: [(s) => [s.presets],- (presets): WebAnalyticsFilterPresetType[] => {+ (presets: PaginatedResponse<WebAnalyticsFilterPresetType>): WebAnalyticsFilterPresetType[] => {return presets.results.filter((p) => p.pinned)},],recentPresets: [(s) => [s.presets],- (presets): WebAnalyticsFilterPresetType[] => {+ (presets: PaginatedResponse<WebAnalyticsFilterPresetType>): WebAnalyticsFilterPresetType[] => {return presets.results.filter((p) => !p.pinned).slice(0, 5)},],hasPresets: [(s) => [s.presets],- (presets): boolean => {+ (presets: PaginatedResponse<WebAnalyticsFilterPresetType>): boolean => {return presets.results.length > 0},],canSavePreset: [(s) => [s.presetFormName],- (name): boolean => {+ (name: string): boolean => {return name.trim().length > 0},],activePreset: [(s) => [s.appliedPreset],- (appliedPreset): WebAnalyticsFilterPresetType | null => {+ (appliedPreset: WebAnalyticsFilterPresetType | null): WebAnalyticsFilterPresetType | null => {if (!appliedPreset) {return null}@@ -231,14 +424,20 @@ export const webAnalyticsFilterPresetsLogic = kea<webAnalyticsFilterPresetsLogic],hasUnsavedChanges: [(s) => [s.appliedPreset, s.currentFiltersConfig],- (appliedPreset, currentFiltersConfig): boolean => {+ (+ appliedPreset: WebAnalyticsFilterPresetType | null,+ currentFiltersConfig: import('~/types').WebAnalyticsFiltersConfig+ ): boolean => {if (!appliedPreset) {return false}return !objectsEqual(appliedPreset.filters, currentFiltersConfig)},],- isEditMode: [(s) => [s.editingPreset], (editingPreset): boolean => !!editingPreset],+ isEditMode: [+ (s) => [s.editingPreset],+ (editingPreset: WebAnalyticsFilterPresetType | null): boolean => !!editingPreset,+ ],}),afterMount(({ actions }) => {actions.loadPresets()diff --git a/frontend/src/scenes/web-analytics/webAnalyticsLoadTimeLogic.ts b/frontend/src/scenes/web-analytics/webAnalyticsLoadTimeLogic.tsindex 94a4bde12bcf..522ea8f8267f 100644--- a/frontend/src/scenes/web-analytics/webAnalyticsLoadTimeLogic.ts+++ b/frontend/src/scenes/web-analytics/webAnalyticsLoadTimeLogic.ts@@ -1,4 +1,16 @@-import { actions, afterMount, connect, kea, listeners, path, reducers, selectors, sharedListeners } from 'kea'+import {+ MakeLogicType,+ actions,+ afterMount,+ connect,+ kea,+ listeners,+ path,+ reducers,+ selectors,+ sharedListeners,+} from 'kea'+import type { BreakPointFunction } from 'kea'import posthog from 'posthog-js'import { FEATURE_FLAGS } from 'lib/constants'@@ -13,7 +25,57 @@ import { isWebAnalyticsAchievementsEnabled } from './achievements/gating'import { webAnalyticsAchievementsLogic } from './achievements/webAnalyticsAchievementsLogic'import { webAnalyticsAchievementsPreferencesLogic } from './achievements/webAnalyticsAchievementsPreferencesLogic'import { WEB_ANALYTICS_DATA_COLLECTION_NODE_ID } from './common'-import type { webAnalyticsLoadTimeLogicType } from './webAnalyticsLoadTimeLogicType'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsLoadTimeLogicValues {+ areAnyLoading: boolean // dataNodeCollectionLogic+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentProjectId: number | string // teamLogic+ achievementsOptOut: boolean // webAnalyticsAchievementsPreferencesLogic+ hasObservedLoading: boolean+ tileSkeletonsEnabled: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsLoadTimeLogicActions {+ collectionNodeLoadData: (id: string) => {+ id: string+ } // dataNodeCollectionLogic+ collectionNodeLoadDataFailure: (id: string) => {+ id: string+ } // dataNodeCollectionLogic+ collectionNodeLoadDataSuccess: (id: string) => {+ id: string+ } // dataNodeCollectionLogic+ recordVisit: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsLoadTimeLogicMeta {+ sharedListeners: {+ maybeCaptureLoaded: (+ payload: any,+ breakpoint: BreakPointFunction,+ action: {+ type: string+ payload: any+ },+ previousState: any+ ) => void | Promise<void>+ }+ __keaTypeGenInternalSelectorTypes: {+ tileSkeletonsEnabled: (featureFlags: FeatureFlagsSet) => boolean+ }+}++export type webAnalyticsLoadTimeLogicType = MakeLogicType<+ webAnalyticsLoadTimeLogicValues,+ webAnalyticsLoadTimeLogicActions,+ Record<string, any>,+ webAnalyticsLoadTimeLogicMeta+>export const webAnalyticsLoadTimeLogic = kea<webAnalyticsLoadTimeLogicType>([path(['scenes', 'webAnalytics', 'webAnalyticsLoadTimeLogic']),diff --git a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsxindex 08331ad80622..42f8dab65693 100644--- a/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx+++ b/frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx@@ -1,4 +1,15 @@-import { BreakPointFunction, actions, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'+import {+ MakeLogicType,+ BreakPointFunction,+ actions,+ afterMount,+ connect,+ kea,+ listeners,+ path,+ reducers,+ selectors,+} from 'kea'import { loaders } from 'kea-loaders'import { router, urlToAction } from 'kea-router'import { subscriptions } from 'kea-subscriptions'@@ -79,6 +90,8 @@ import {WebAnalyticsFiltersConfig,} from '~/types'+import type { FeatureFlagsSet } from '../../lib/logic/featureFlagLogic'+import type { CompareFilter, CurrencyCode } from '../../queries/schema/schema-general'import { botAnalyticsLogic } from './botAnalyticsLogic'import {ActiveHoursTab,@@ -121,7 +134,6 @@ import { webAnalyticsHealthLogic } from './health'import { IncludeHostToggle } from './IncludeHostToggle'import { getDashboardItemId, getNewInsightUrlFactory } from './insightsUtils'import { webAnalyticsFilterLogic } from './webAnalyticsFilterLogic'-import type { webAnalyticsLogicType } from './webAnalyticsLogicType'export interface DateFilterState {dateFrom: string | null@@ -130,6 +142,549 @@ export interface DateFilterState {isIntervalManuallySet: boolean}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsLogicValues {+ authorizedUrls: string[] // authorizedUrlListLogic+ isProposedUrlSubmitting: boolean // authorizedUrlListLogic+ showProposedURLForm: boolean // authorizedUrlListLogic+ urlSuggestions: any[] // authorizedUrlListLogic+ featureFlags: FeatureFlagsSet // featureFlagLogic+ isDev: boolean | undefined // preflightLogic+ baseCurrency: CurrencyCode // teamLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic+ user: UserType | null // userLogic+ authorizedDomains: string[] // webAnalyticsFilterLogic+ compareFilter: CompareFilter // webAnalyticsFilterLogic+ countryFilter: string | null // webAnalyticsFilterLogic+ deviceTypeFilter: DeviceType | null // webAnalyticsFilterLogic+ domainFilter: string | null // webAnalyticsFilterLogic+ hasHostFilter: boolean // webAnalyticsFilterLogic+ rawWebAnalyticsFilters: WebAnalyticsPropertyFilters // webAnalyticsFilterLogic+ referrerFilter: string | null // webAnalyticsFilterLogic+ selectedHost: string | null // webAnalyticsFilterLogic+ validatedDomainFilter: string | null // webAnalyticsFilterLogic+ _activeHoursTab: string | null+ _deviceTab: string | null+ _geographyTab: string | null+ _graphsTab: string | null+ _isPathCleaningEnabled: boolean+ _pathTab: string | null+ _sourceTab: string | null+ activeHoursTab: string+ breadcrumbs: Breadcrumb[]+ controls: {+ filterTestAccounts: boolean+ includeHostPath: boolean+ isPathCleaningEnabled: boolean+ shouldStripQueryParams: boolean+ useWebAnalyticsPrecompute: boolean | undefined+ }+ conversionGoal: WebAnalyticsConversionGoal | null+ conversionGoalWarning: ConversionGoalWarning | null+ currentFiltersConfig: WebAnalyticsFiltersConfig+ dateFilter: DateFilterState+ deviceTab: string+ filters: {+ compareFilter: CompareFilter+ conversionGoal: WebAnalyticsConversionGoal | null+ dateFilter: DateFilterState+ replayFilters: RecordingUniversalFilters+ tablesOrderBy: WebAnalyticsOrderBy | null+ webAnalyticsFilters: WebAnalyticsPropertyFilters+ webVitalsPercentile: WebVitalsPercentile+ webVitalsTab: WebVitalsMetric+ }+ focusModeConcerns: WebAnalyticsConcern[]+ focusModeDraftConcerns: WebAnalyticsConcern[]+ focusModeEnabled: boolean+ focusModeModalIsOnboarding: boolean+ focusModeModalOpen: boolean+ focusModeOnboardingModalOpen: boolean+ geographyTab: string+ getNewInsightUrl: (tileId: TileId, tabId?: string | undefined) => string | undefined+ graphsTab: string+ hasCountryFilter: boolean+ hasIncompatibleFilters: boolean+ hasSavedFocusMode: boolean+ hasSeenFocusModeOnboarding: boolean+ hiddenTiles: TileId[]+ includeHostPath: boolean+ incompatibleFilters: WebAnalyticsPropertyFilters+ isFocusModeActive: boolean+ isGreaterThanMd: boolean+ isPathCleaningEnabled: boolean+ pathTab: string+ preAggregatedEnabled: boolean | undefined+ preZoomDateFilter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ } | null+ productTab: ProductTab+ replayFilters: RecordingUniversalFilters+ shouldAutoOpenFocusModeOnboarding: boolean+ shouldFilterTestAccounts: boolean+ shouldShowGeoIPQueries: any+ shouldShowGeoIPQueriesLoading: boolean+ shouldStripQueryParams: boolean+ showFocusMode: boolean+ sourceTab: string+ surveyModalPath: string | null+ tablesOrderBy: WebAnalyticsOrderBy | null+ tabs: {+ activeHoursTab: string+ deviceTab: string+ geographyTab: string+ graphsTab: string+ pathTab: string+ shouldShowGeoIPQueries: any+ sourceTab: string+ }+ tileVisualizations: Record<TileId, TileVisualizationOption>+ tiles: WebAnalyticsTile[]+ useWebAnalyticsPrecompute: boolean | null+ webAnalyticsFilters: WebAnalyticsPropertyFilters+ webVitalsMetricQuery: InsightVizNode<TrendsQuery>+ webVitalsPercentile: WebVitalsPercentile+ webVitalsTab: WebVitalsMetric+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsLogicActions {+ addAuthorizedUrl: (+ url: string,+ launch?: boolean | undefined+ ) => {+ launch: boolean | undefined+ url: string+ } // authorizedUrlListLogic+ cancelProposingAuthorizedUrl: () => {+ value: true+ } // authorizedUrlListLogic+ newAuthorizedUrl: () => {+ value: true+ } // authorizedUrlListLogic+ cancelAllLoading: () => {} // dataNodeCollectionLogic+ updateUser: (+ user: Partial<UserType>,+ successCallback?: () => void+ ) => {+ successCallback: (() => void) | undefined+ user: Partial<UserType>+ } // userLogic+ loadPreset: (filters: WebAnalyticsFiltersConfig) => {+ filters: WebAnalyticsFiltersConfig+ } // webAnalyticsFilterLogic+ setCompareFilter: (compareFilter: CompareFilter) => {+ compareFilter: CompareFilter+ } // webAnalyticsFilterLogic+ setCountryFilter: (countryCode: string | null) => {+ countryCode: string | null+ } // webAnalyticsFilterLogic+ setDeviceTypeFilter: (deviceType: DeviceType | null) => {+ deviceType: DeviceType | null+ } // webAnalyticsFilterLogic+ setDomainFilter: (domain: string | null) => {+ domain: string | null+ } // webAnalyticsFilterLogic+ setReferrerFilter: (referrer: string | null) => {+ referrer: string | null+ } // webAnalyticsFilterLogic+ setWebAnalyticsFilters: (webAnalyticsFilters: WebAnalyticsPropertyFilters) => {+ webAnalyticsFilters: WebAnalyticsPropertyFilters+ } // webAnalyticsFilterLogic+ togglePropertyFilter: (+ type: PropertyFilterType.Event | PropertyFilterType.Person | PropertyFilterType.Session,+ key: string,+ value: number | string | null,+ tabChange?:+ | {+ activeHoursTab?: string+ deviceTab?: string+ geographyTab?: string+ graphsTab?: string+ pathTab?: string+ sourceTab?: string+ }+ | undefined+ ) => {+ key: string+ tabChange:+ | {+ activeHoursTab?: string | undefined+ deviceTab?: string | undefined+ geographyTab?: string | undefined+ graphsTab?: string | undefined+ pathTab?: string | undefined+ sourceTab?: string | undefined+ }+ | undefined+ type: PropertyFilterType.Event | PropertyFilterType.Person | PropertyFilterType.Session+ value: number | string | null+ } // webAnalyticsFilterLogic+ trackTabViewed: () => {+ value: true+ } // webAnalyticsHealthLogic+ applyFocusMode: () => {+ value: true+ }+ clearFilters: () => {+ value: true+ }+ clearTablesOrderBy: () => boolean+ closeFocusModeModal: () => {+ value: true+ }+ closeSurveyModal: () => {+ value: true+ }+ dismissFocusModeOnboarding: () => {+ value: true+ }+ enterFocusMode: () => {+ value: true+ }+ exitFocusMode: () => {+ value: true+ }+ loadShouldShowGeoIPQueries: () => any+ loadShouldShowGeoIPQueriesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadShouldShowGeoIPQueriesSuccess: (+ shouldShowGeoIPQueries: boolean,+ payload?: any+ ) => {+ shouldShowGeoIPQueries: boolean+ payload?: any+ }+ markFocusModeOnboardingSeen: () => {+ value: true+ }+ openAsNewInsight: (+ tileId: TileId,+ tabId?: string+ ) => {+ tabId: string | undefined+ tileId: TileId+ }+ openFocusModeModal: (onboarding?: boolean) => {+ onboarding: boolean+ }+ openFocusModeOnboarding: () => {+ value: true+ }+ openSurveyModal: (path: string) => {+ path: string+ }+ removeIncompatibleFilters: () => {+ value: true+ }+ resetTileVisibility: () => boolean+ resetZoom: () => {+ value: true+ }+ setActiveHoursTab: (tab: string) => {+ tab: string+ }+ setConversionGoal: (conversionGoal: WebAnalyticsConversionGoal | null) => {+ conversionGoal: WebAnalyticsConversionGoal | null+ }+ setConversionGoalWarning: (warning: ConversionGoalWarning | null) => {+ warning: ConversionGoalWarning | null+ }+ setDateInterval: (interval: IntervalType) => {+ interval: IntervalType+ }+ setDates: (+ dateFrom: string | null,+ dateTo: string | null+ ) => {+ dateFrom: string | null+ dateTo: string | null+ }+ setDatesAndInterval: (+ dateFrom: string | null,+ dateTo: string | null,+ interval: IntervalType+ ) => {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ }+ setDeviceTab: (tab: string) => {+ tab: string+ }+ setFocusModeConcerns: (concerns: WebAnalyticsConcern[]) => {+ concerns: WebAnalyticsConcern[]+ }+ setFocusModeDraftConcerns: (concerns: WebAnalyticsConcern[]) => {+ concerns: WebAnalyticsConcern[]+ }+ setFocusModeEnabled: (enabled: boolean) => {+ enabled: boolean+ }+ setGeographyTab: (tab: string) => {+ tab: string+ }+ setGraphsTab: (tab: string) => {+ tab: string+ }+ setHiddenTiles: (hiddenTiles: TileId[]) => {+ hiddenTiles: TileId[]+ }+ setIncludeHostPath: (includeHostPath: boolean) => {+ includeHostPath: boolean+ }+ setIsPathCleaningEnabled: (isPathCleaningEnabled: boolean) => {+ isPathCleaningEnabled: boolean+ }+ setPathTab: (tab: string) => {+ tab: string+ }+ setPreZoomDateFilter: (+ filter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ } | null+ ) => {+ filter: {+ dateFrom: string | null+ dateTo: string | null+ interval: IntervalType+ } | null+ }+ setProductTab: (tab: ProductTab) => {+ tab: ProductTab+ }+ setShouldFilterTestAccounts: (shouldFilterTestAccounts: boolean) => {+ shouldFilterTestAccounts: boolean+ }+ setShouldStripQueryParams: (shouldStripQueryParams: boolean) => {+ shouldStripQueryParams: boolean+ }+ setSourceTab: (tab: string) => {+ tab: string+ }+ setTablesOrderBy: (+ orderBy: WebAnalyticsOrderByFields,+ direction: WebAnalyticsOrderByDirection+ ) => {+ direction: WebAnalyticsOrderByDirection+ orderBy: WebAnalyticsOrderByFields+ }+ setTileVisibility: (+ tileId: TileId,+ visible: boolean+ ) => {+ tileId: TileId+ visible: boolean+ }+ setTileVisualization: (+ tileId: TileId,+ visualization: TileVisualizationOption+ ) => {+ tileId: TileId+ visualization: TileVisualizationOption+ }+ setUseWebAnalyticsPrecompute: (useWebAnalyticsPrecompute: boolean | null) => {+ useWebAnalyticsPrecompute: boolean | null+ }+ setWebVitalsPercentile: (percentile: WebVitalsPercentile) => {+ percentile: WebVitalsPercentile+ }+ setWebVitalsTab: (tab: WebVitalsMetric) => {+ tab: WebVitalsMetric+ }+ startFocusModeOnboarding: () => {+ value: true+ }+ toggleFocusModeConcern: (concern: WebAnalyticsConcern) => {+ concern: WebAnalyticsConcern+ }+ zoomIntoPeriod: (+ dateFrom: string,+ dateTo: string+ ) => {+ dateFrom: string+ dateTo: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ preAggregatedEnabled: (+ featureFlags: FeatureFlagsSet,+ currentTeam: TeamPublicType | TeamType | null+ ) => boolean | undefined+ incompatibleFilters: (+ rawWebAnalyticsFilters: WebAnalyticsPropertyFilters,+ preAggregatedEnabled: boolean | undefined+ ) => WebAnalyticsPropertyFilters+ hasIncompatibleFilters: (incompatibleFilters: WebAnalyticsPropertyFilters) => boolean+ graphsTab: (_graphsTab: string | null) => string+ sourceTab: (_sourceTab: string | null) => string+ deviceTab: (_deviceTab: string | null) => string+ pathTab: (_pathTab: string | null) => string+ geographyTab: (_geographyTab: string | null) => string+ activeHoursTab: (_activeHoursTab: string | null) => string+ isPathCleaningEnabled: (+ _isPathCleaningEnabled: boolean,+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => boolean+ currentFiltersConfig: (+ rawWebAnalyticsFilters: WebAnalyticsPropertyFilters,+ domainFilter: string | null,+ deviceTypeFilter: DeviceType | null,+ countryFilter: string | null,+ referrerFilter: string | null,+ compareFilter: CompareFilter,+ dateFilter: DateFilterState,+ conversionGoal: WebAnalyticsConversionGoal | null,+ isPathCleaningEnabled: boolean,+ shouldFilterTestAccounts: boolean+ ) => WebAnalyticsFiltersConfig+ webAnalyticsFilters: (+ rawWebAnalyticsFilters: WebAnalyticsPropertyFilters,+ isPathCleaningEnabled: boolean,+ selectedHost: string | null,+ deviceTypeFilter: DeviceType | null,+ countryFilter: string | null,+ referrerFilter: string | null+ ) => WebAnalyticsPropertyFilters+ tabs: (+ graphsTab: string,+ sourceTab: string,+ deviceTab: string,+ pathTab: string,+ geographyTab: string,+ activeHoursTab: string,+ shouldShowGeoIPQueries: any+ ) => {+ activeHoursTab: string+ deviceTab: string+ geographyTab: string+ graphsTab: string+ pathTab: string+ shouldShowGeoIPQueries: any+ sourceTab: string+ }+ controls: (+ isPathCleaningEnabled: boolean,+ shouldFilterTestAccounts: boolean,+ shouldStripQueryParams: boolean,+ includeHostPath: boolean,+ useWebAnalyticsPrecompute: boolean | null,+ featureFlags: FeatureFlagsSet+ ) => {+ filterTestAccounts: boolean+ includeHostPath: boolean+ isPathCleaningEnabled: boolean+ shouldStripQueryParams: boolean+ useWebAnalyticsPrecompute: boolean | undefined+ }+ filters: (+ webAnalyticsFilters: WebAnalyticsPropertyFilters,+ replayFilters: RecordingUniversalFilters,+ dateFilter: DateFilterState,+ compareFilter: CompareFilter,+ webVitalsTab: WebVitalsMetric,+ webVitalsPercentile: WebVitalsPercentile,+ tablesOrderBy: WebAnalyticsOrderBy | null,+ conversionGoal: WebAnalyticsConversionGoal | null+ ) => {+ compareFilter: CompareFilter+ conversionGoal: WebAnalyticsConversionGoal | null+ dateFilter: DateFilterState+ replayFilters: RecordingUniversalFilters+ tablesOrderBy: WebAnalyticsOrderBy | null+ webAnalyticsFilters: WebAnalyticsPropertyFilters+ webVitalsPercentile: WebVitalsPercentile+ webVitalsTab: WebVitalsMetric+ }+ replayFilters: (+ webAnalyticsFilters: WebAnalyticsPropertyFilters,+ dateFilter: DateFilterState,+ shouldFilterTestAccounts: boolean,+ conversionGoal: WebAnalyticsConversionGoal | null+ ) => RecordingUniversalFilters+ hasCountryFilter: (webAnalyticsFilters: WebAnalyticsPropertyFilters) => boolean+ webVitalsMetricQuery: (+ webVitalsPercentile: WebVitalsPercentile,+ webVitalsTab: WebVitalsMetric,+ dateFilter: DateFilterState,+ webAnalyticsFilters: WebAnalyticsPropertyFilters,+ shouldFilterTestAccounts: boolean+ ) => InsightVizNode<TrendsQuery>+ showFocusMode: (featureFlags: FeatureFlagsSet, productTab: ProductTab) => boolean+ hasSavedFocusMode: (focusModeConcerns: WebAnalyticsConcern[]) => boolean+ hasSeenFocusModeOnboarding: (user: UserType | null, currentTeam: TeamPublicType | TeamType | null) => boolean+ shouldAutoOpenFocusModeOnboarding: (+ user: UserType | null,+ currentTeam: TeamPublicType | TeamType | null,+ showFocusMode: boolean,+ hasSavedFocusMode: boolean,+ hasSeenFocusModeOnboarding: boolean+ ) => boolean+ isFocusModeActive: (+ showFocusMode: boolean,+ focusModeEnabled: boolean,+ focusModeConcerns: WebAnalyticsConcern[]+ ) => boolean+ tiles: (+ productTab: ProductTab,+ tabs: {+ activeHoursTab: string+ deviceTab: string+ geographyTab: string+ graphsTab: string+ pathTab: string+ shouldShowGeoIPQueries: any+ sourceTab: string+ },+ controls: {+ filterTestAccounts: boolean+ includeHostPath: boolean+ isPathCleaningEnabled: boolean+ shouldStripQueryParams: boolean+ useWebAnalyticsPrecompute: boolean | undefined+ },+ filters: {+ compareFilter: CompareFilter+ conversionGoal: WebAnalyticsConversionGoal | null+ dateFilter: DateFilterState+ replayFilters: RecordingUniversalFilters+ tablesOrderBy: WebAnalyticsOrderBy | null+ webAnalyticsFilters: WebAnalyticsPropertyFilters+ webVitalsPercentile: WebVitalsPercentile+ webVitalsTab: WebVitalsMetric+ },+ featureFlags: FeatureFlagsSet,+ isGreaterThanMd: boolean,+ tileVisualizations: Record<TileId, TileVisualizationOption>,+ preAggregatedEnabled: boolean | undefined,+ hiddenTiles: TileId[]+ ) => WebAnalyticsTile[]+ getNewInsightUrl: (+ tiles: WebAnalyticsTile[]+ ) => (tileId: TileId, tabId?: string | undefined) => string | undefined+ }+}++export type webAnalyticsLogicType = MakeLogicType<+ webAnalyticsLogicValues,+ webAnalyticsLogicActions,+ Record<string, any>,+ webAnalyticsLogicMeta+>+export const webAnalyticsLogic = kea<webAnalyticsLogicType>([path(['scenes', 'webAnalytics', 'webAnalyticsSceneLogic']),connect(() => ({@@ -654,7 +1209,10 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([],isPathCleaningEnabled: [(s) => [s._isPathCleaningEnabled, s.hasAvailableFeature],- (isPathCleaningEnabled: boolean, hasAvailableFeature) => {+ (+ isPathCleaningEnabled: boolean,+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean+ ) => {return hasAvailableFeature(AvailableFeature.PATHS_ADVANCED) && isPathCleaningEnabled},],@@ -672,16 +1230,16 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([s.shouldFilterTestAccounts,],(- properties,- domainFilter,- deviceTypeFilter,- countryFilter,- referrerFilter,- compareFilter,- dateFilter,- conversionGoal,- isPathCleaningEnabled,- shouldFilterTestAccounts+ properties: WebAnalyticsPropertyFilters,+ domainFilter: string | null,+ deviceTypeFilter: DeviceType | null,+ countryFilter: string | null,+ referrerFilter: string | null,+ compareFilter: import('~/queries/schema/schema-general').CompareFilter,+ dateFilter: DateFilterState,+ conversionGoal: WebAnalyticsConversionGoal | null,+ isPathCleaningEnabled: boolean,+ shouldFilterTestAccounts: boolean): WebAnalyticsFiltersConfig => ({properties,dateFrom: dateFilter.dateFrom,@@ -812,7 +1370,15 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([s.activeHoursTab,s.shouldShowGeoIPQueries,],- (graphsTab, sourceTab, deviceTab, pathTab, geographyTab, activeHoursTab, shouldShowGeoIPQueries) => ({+ (+ graphsTab: string,+ sourceTab: string,+ deviceTab: string,+ pathTab: string,+ geographyTab: string,+ activeHoursTab: string,+ shouldShowGeoIPQueries+ ) => ({graphsTab,sourceTab,deviceTab,@@ -870,14 +1436,14 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([s.conversionGoal,],(- webAnalyticsFilters,- replayFilters,- dateFilter,- compareFilter,- webVitalsTab,- webVitalsPercentile,- tablesOrderBy,- conversionGoal+ webAnalyticsFilters: WebAnalyticsPropertyFilters,+ replayFilters: RecordingUniversalFilters,+ dateFilter: DateFilterState,+ compareFilter: import('~/queries/schema/schema-general').CompareFilter,+ webVitalsTab: WebVitalsMetric,+ webVitalsPercentile: WebVitalsPercentile,+ tablesOrderBy: WebAnalyticsOrderBy | null,+ conversionGoal: WebAnalyticsConversionGoal | null) => ({webAnalyticsFilters,replayFilters,@@ -893,9 +1459,9 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([(s) => [s.webAnalyticsFilters, s.dateFilter, s.shouldFilterTestAccounts, s.conversionGoal],(webAnalyticsFilters: WebAnalyticsPropertyFilters,- dateFilter,- shouldFilterTestAccounts,- conversionGoal+ dateFilter: DateFilterState,+ shouldFilterTestAccounts: boolean,+ conversionGoal: WebAnalyticsConversionGoal | null): RecordingUniversalFilters => {const filters: UniversalFiltersGroupValue[] = [...webAnalyticsFilters]if (conversionGoal) {@@ -954,11 +1520,11 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([s.shouldFilterTestAccounts,],(- webVitalsPercentile,- webVitalsTab,+ webVitalsPercentile: WebVitalsPercentile,+ webVitalsTab: WebVitalsMetric,{ dateFrom, dateTo, interval },- webAnalyticsFilters,- filterTestAccounts+ webAnalyticsFilters: WebAnalyticsPropertyFilters,+ filterTestAccounts: boolean): InsightVizNode<TrendsQuery> => ({kind: NodeKind.InsightVizNode,source: {@@ -1007,7 +1573,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([selectors(({ actions }) => ({showFocusMode: [(s) => [s.featureFlags, s.productTab],- (featureFlags, productTab: ProductTab): boolean =>+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet, productTab: ProductTab): boolean =>featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_FOCUS_MODE] === 'test' && productTab === ProductTab.ANALYTICS,],hasSavedFocusMode: [@@ -1047,7 +1613,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([s.hiddenTiles,],(- productTab,+ productTab: ProductTab,{ graphsTab, sourceTab, deviceTab, pathTab, geographyTab, shouldShowGeoIPQueries, activeHoursTab },{isPathCleaningEnabled,@@ -1066,11 +1632,11 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([webVitalsTab,tablesOrderBy,},- featureFlags,- isGreaterThanMd,- tileVisualizations,- preAggregatedEnabled,- hiddenTiles+ featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,+ isGreaterThanMd: boolean,+ tileVisualizations: Record<TileId, TileVisualizationOption>,+ preAggregatedEnabled: boolean | undefined,+ hiddenTiles: TileId[]): WebAnalyticsTile[] => {const dateRange = { date_from: dateFrom, date_to: dateTo }const sampling = { enabled: false, forceSamplingRate: { numerator: 1, denominator: 10 } }diff --git a/frontend/src/scenes/web-analytics/webAnalyticsModalLogic.ts b/frontend/src/scenes/web-analytics/webAnalyticsModalLogic.tsindex ebfd67a3b7f5..9f69a8c04291 100644--- a/frontend/src/scenes/web-analytics/webAnalyticsModalLogic.ts+++ b/frontend/src/scenes/web-analytics/webAnalyticsModalLogic.ts@@ -1,14 +1,14 @@-import { actions, connect, kea, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'import { NodeKind, QuerySchema } from '~/queries/schema/schema-general'import { InsightLogicProps } from '~/types'import { botAnalyticsLogic } from './botAnalyticsLogic'import { TileId, WEB_ANALYTICS_DATA_COLLECTION_NODE_ID, WebAnalyticsTile } from './common'+import type { SectionTile } from './common'import { getDashboardItemId, getNewInsightUrlFactory } from './insightsUtils'import { pageReportsLogic } from './pageReportsLogic'import { webAnalyticsLogic } from './webAnalyticsLogic'-import type { webAnalyticsModalLogicType } from './webAnalyticsModalLogicType'export interface WebAnalyticsModalQuery {tileId: TileId@@ -21,6 +21,60 @@ export interface WebAnalyticsModalQuery {canOpenInsight?: boolean}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsModalLogicValues {+ botAnalyticsTiles: WebAnalyticsTile[] // botAnalyticsLogic+ pageReportsTiles: SectionTile[] // pageReportsLogic+ webAnalyticsTiles: WebAnalyticsTile[] // webAnalyticsLogic+ combinedTiles: WebAnalyticsTile[]+ getNewInsightUrl: (tileId: TileId, tabId?: string | undefined) => string | undefined+ modal: WebAnalyticsModalQuery | null+ modalTileAndTab: {+ tabId?: string+ tileId: TileId+ } | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsModalLogicActions {+ closeModal: () => boolean+ openModal: (+ tileId: TileId,+ tabId?: string+ ) => {+ tabId: string | undefined+ tileId: TileId+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface webAnalyticsModalLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ combinedTiles: (+ webAnalyticsTiles: WebAnalyticsTile[],+ pageReportsTiles: SectionTile[],+ botAnalyticsTiles: WebAnalyticsTile[]+ ) => WebAnalyticsTile[]+ modal: (+ combinedTiles: WebAnalyticsTile[],+ modalTileAndTab: {+ tabId?: string+ tileId: TileId+ } | null+ ) => WebAnalyticsModalQuery | null+ getNewInsightUrl: (+ combinedTiles: WebAnalyticsTile[]+ ) => (tileId: TileId, tabId?: string | undefined) => string | undefined+ }+}++export type webAnalyticsModalLogicType = MakeLogicType<+ webAnalyticsModalLogicValues,+ webAnalyticsModalLogicActions,+ Record<string, any>,+ webAnalyticsModalLogicMeta+>+/*** This logic serves as a bridge between webAnalyticsLogic and pageReportsLogic* It combines tiles from both logics and provides a unified API for the modaldiff --git a/products/actions/frontend/logics/actionEditLogic.tsx b/products/actions/frontend/logics/actionEditLogic.tsxindex 69ad7924cb3b..9001371ca744 100644--- a/products/actions/frontend/logics/actionEditLogic.tsx+++ b/products/actions/frontend/logics/actionEditLogic.tsx@@ -73,7 +73,7 @@ export interface actionEditLogicValues {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface actionEditLogicActions {loadActions: () => any // actionsModel- loadEventDefinitions: (url?: string | null) => {+ loadEventDefinitions: (url?: string | null | undefined) => {url: string | null} // eventDefinitionsTableLogicloadTags: () => any // tagsModeldiff --git a/products/conversations/frontend/browserNotificationLogic.ts b/products/conversations/frontend/browserNotificationLogic.tsindex 71b3b88824f3..58fdaf925ae8 100644--- a/products/conversations/frontend/browserNotificationLogic.ts+++ b/products/conversations/frontend/browserNotificationLogic.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 { router } from 'kea-router'import { subscriptions } from 'kea-subscriptions'@@ -6,7 +6,7 @@ import { getCurrentTeamIdOrNone } from 'lib/utils/getAppContext'import { teamLogic } from 'scenes/teamLogic'import { urls } from 'scenes/urls'-import type { browserNotificationLogicType } from './browserNotificationLogicType'+import type { TeamPublicType, TeamType } from '../../../frontend/src/types'import type { NotificationPermission } from './types'const STORAGE_KEY_PREFIX = 'posthog-support-notifications'@@ -42,6 +42,52 @@ const setStoredPreference = (enabled: boolean): void => {}}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface browserNotificationLogicValues {+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ canShowNotifications: boolean+ enabled: boolean+ isPermissionDenied: boolean+ isSupported: boolean+ permission: NotificationPermission+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface browserNotificationLogicActions {+ requestPermission: () => {+ value: true+ }+ setEnabled: (enabled: boolean) => {+ enabled: boolean+ }+ setPermission: (permission: NotificationPermission) => {+ permission: NotificationPermission+ }+ showNotification: (count: number) => {+ count: number+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface browserNotificationLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ canShowNotifications: (+ isSupported: boolean,+ permission: NotificationPermission,+ enabled: boolean,+ currentTeam: TeamPublicType | TeamType | null+ ) => boolean+ isPermissionDenied: (isSupported: boolean, permission: NotificationPermission) => boolean+ }+}++export type browserNotificationLogicType = MakeLogicType<+ browserNotificationLogicValues,+ browserNotificationLogicActions,+ Record<string, any>,+ browserNotificationLogicMeta+>+export const browserNotificationLogic = kea<browserNotificationLogicType>([path(['products', 'conversations', 'frontend', 'browserNotificationLogic']),connect(() => ({@@ -124,12 +170,17 @@ export const browserNotificationLogic = kea<browserNotificationLogicType>([isSupported: [() => [], () => isNotificationSupported()],canShowNotifications: [(s) => [s.isSupported, s.permission, s.enabled, s.currentTeam],- (isSupported, permission, enabled, currentTeam): boolean =>- isSupported && permission === 'granted' && enabled && !!currentTeam?.conversations_enabled,+ (+ isSupported: boolean,+ permission: NotificationPermission,+ enabled: boolean,+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType+ ): boolean => isSupported && permission === 'granted' && enabled && !!currentTeam?.conversations_enabled,],isPermissionDenied: [(s) => [s.isSupported, s.permission],- (isSupported, permission): boolean => isSupported && permission === 'denied',+ (isSupported: boolean, permission: NotificationPermission): boolean =>+ isSupported && permission === 'denied',],}),subscriptions(({ actions }) => ({diff --git a/products/conversations/frontend/components/Assignee/assigneeSelectLogic.tsx b/products/conversations/frontend/components/Assignee/assigneeSelectLogic.tsxindex 9272e755ae48..ae928b7b3f7e 100644--- a/products/conversations/frontend/components/Assignee/assigneeSelectLogic.tsx+++ b/products/conversations/frontend/components/Assignee/assigneeSelectLogic.tsx@@ -1,5 +1,5 @@import Fuse from 'fuse.js'-import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'import { createFuse } from 'lib/utils/fuseSearch'import { membersLogic } from 'scenes/organization/membersLogic'@@ -7,11 +7,61 @@ import { rolesLogic } from 'scenes/settings/organization/Permissions/Roles/rolesimport type { RoleType } from '~/types'-import type { assigneeSelectLogicType } from './assigneeSelectLogicType'+import type { OrganizationMemberType } from '../../../../../frontend/src/types'import { Assignee, TicketAssignee } from './types'export interface RolesFuse extends Fuse<RoleType> {}+// 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: TicketAssignee) => Assignee+ rolesFuse: RolesFuse+ 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: string) => {+ search: string+ }+}++// 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[]) => RolesFuse+ filteredRoles: (roles: RoleType[], rolesFuse: RolesFuse, search: string) => RoleType[]+ resolveAssignee: (+ roles: RoleType[],+ meFirstMembers: OrganizationMemberType[]+ ) => (assignee: TicketAssignee) => Assignee+ }+}++export type assigneeSelectLogicType = MakeLogicType<+ assigneeSelectLogicValues,+ assigneeSelectLogicActions,+ Record<string, any>,+ assigneeSelectLogicMeta+>+export const assigneeSelectLogic = kea<assigneeSelectLogicType>([path(['products', 'conversations', 'frontend', 'components', 'Assignee', 'assigneeSelectLogic']),connect(() => ({@@ -41,22 +91,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): RolesFuse => createFuse<RoleType>(roles, { keys: ['name'], threshold: 0.3 }),+ (roles: RoleType[]): RolesFuse => createFuse<RoleType>(roles, { keys: ['name'], threshold: 0.3 }),],filteredRoles: [(s) => [s.roles, s.rolesFuse, s.search],- (roles, rolesFuse, search): RoleType[] =>+ (roles: RoleType[], rolesFuse: RolesFuse, search: string): RoleType[] =>search ? rolesFuse.search(search).map((result) => result.item) : (roles ?? []),],resolveAssignee: [(s) => [s.roles, s.meFirstMembers],- (roles, members): ((assignee: TicketAssignee) => Assignee) => {+ (+ roles: RoleType[],+ members: import('~/types').OrganizationMemberType[]+ ): ((assignee: TicketAssignee) => Assignee) => {return (assignee: TicketAssignee) => {if (assignee) {if (assignee.type === 'role') {diff --git a/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.ts b/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.tsindex 29727623ea36..9b2656163fe9 100644--- a/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.ts+++ b/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.ts@@ -1,4 +1,4 @@-import { actions, kea, listeners, path, reducers } from 'kea'+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'import { loaders } from 'kea-loaders'import { router } from 'kea-router'@@ -8,7 +8,75 @@ import api from 'lib/api'import { urls } from 'scenes/urls'import type { EmailConfigStatus } from '../../scenes/settings/supportSettingsLogic'-import type { composeTicketLogicType } from './composeTicketLogicType'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface composeTicketLogicValues {+ composingLoading: boolean+ emailConfigId: string+ emailConfigs: EmailConfigStatus[]+ emailConfigsLoading: boolean+ emailSubject: string+ isOpen: boolean+ recipientDistinctId: string+ recipientEmail: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface composeTicketLogicActions {+ closeComposeModal: () => {+ value: true+ }+ loadEmailConfigs: () => any+ loadEmailConfigsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadEmailConfigsSuccess: (+ emailConfigs: EmailConfigStatus[],+ payload?: any+ ) => {+ emailConfigs: EmailConfigStatus[]+ payload?: any+ }+ openComposeModal: (prefill?: { distinctId?: string; email?: string }) => {+ prefill:+ | {+ distinctId?: string | undefined+ email?: string | undefined+ }+ | undefined+ }+ resetForm: () => {+ value: true+ }+ setEmailConfigId: (configId: string) => {+ configId: string+ }+ setEmailSubject: (subject: string) => {+ subject: string+ }+ setRecipientDistinctId: (distinctId: string) => {+ distinctId: string+ }+ setRecipientEmail: (email: string) => {+ email: string+ }+ submitCompose: (+ message: string,+ richContent: Record<string, unknown> | null+ ) => {+ message: string+ richContent: Record<string, unknown> | null+ }+ submitComposeFinished: () => {+ value: true+ }+}++export type composeTicketLogicType = MakeLogicType<composeTicketLogicValues, composeTicketLogicActions>export const composeTicketLogic = kea<composeTicketLogicType>([path(['products', 'conversations', 'frontend', 'components', 'ComposeTicket', 'composeTicketLogic']),diff --git a/products/conversations/frontend/components/SavedViews/ticketViewsLogic.ts b/products/conversations/frontend/components/SavedViews/ticketViewsLogic.tsindex 265d40510d4b..6125693e7ada 100644--- a/products/conversations/frontend/components/SavedViews/ticketViewsLogic.ts+++ b/products/conversations/frontend/components/SavedViews/ticketViewsLogic.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 { loaders } from 'kea-loaders'import { lemonToast } from '@posthog/lemon-ui'@@ -14,7 +14,6 @@ import {import type { PatchedTicketViewApi, TicketViewApiFilters } from '../../generated/api.schemas'import { supportTicketsSceneLogic } from '../../scenes/tickets/supportTicketsSceneLogic'import type { SavedTicketView, TicketViewFilters } from '../../types'-import type { ticketViewsLogicType } from './ticketViewsLogicType'export interface TicketViewsLogicProps {id: string@@ -25,6 +24,113 @@ export interface TicketViewChanges {filters?: TicketViewFilters}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ticketViewsLogicValues {+ activeView: SavedTicketView | null // supportTicketsSceneLogic+ currentFilters: TicketViewFilters // supportTicketsSceneLogic+ currentTeamId: number | null // teamLogic+ isModalOpen: boolean+ isSaveModalOpen: boolean+ viewName: string+ views: SavedTicketView[]+ viewsLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ticketViewsLogicActions {+ applyViewFilters: (filters: TicketViewFilters) => {+ filters: TicketViewFilters+ } // supportTicketsSceneLogic+ setActiveView: (view: SavedTicketView | null) => {+ view: SavedTicketView | null+ } // supportTicketsSceneLogic+ closeModal: () => {+ value: true+ }+ closeSaveModal: () => {+ value: true+ }+ createView: ({ name, filters }: { filters: TicketViewFilters; name: string }) => {+ name: string+ filters: TicketViewFilters+ }+ createViewFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ createViewSuccess: (+ views: SavedTicketView[],+ payload?: {+ name: string+ filters: TicketViewFilters+ }+ ) => {+ views: SavedTicketView[]+ payload?: {+ name: string+ filters: TicketViewFilters+ }+ }+ deleteView: (shortId: string) => {+ shortId: string+ }+ loadView: (view: SavedTicketView) => {+ view: SavedTicketView+ }+ loadViews: () => any+ loadViewsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadViewsSuccess: (+ views: SavedTicketView[],+ payload?: any+ ) => {+ views: SavedTicketView[]+ payload?: any+ }+ openModal: () => {+ value: true+ }+ openSaveModal: () => {+ value: true+ }+ saveView: () => {+ value: true+ }+ setViewName: (viewName: string) => {+ viewName: string+ }+ updateView: (+ shortId: string,+ changes: TicketViewChanges+ ) => {+ changes: TicketViewChanges+ shortId: string+ }+ viewUpdated: (view: SavedTicketView) => {+ view: SavedTicketView+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface ticketViewsLogicMeta {+ key: string+}++export type ticketViewsLogicType = MakeLogicType<+ ticketViewsLogicValues,+ ticketViewsLogicActions,+ TicketViewsLogicProps,+ ticketViewsLogicMeta+>+export const ticketViewsLogic = kea<ticketViewsLogicType>([props({} as TicketViewsLogicProps),key((props) => props.id),diff --git a/products/conversations/frontend/components/ScenesTabs/scenesTabsLogic.ts b/products/conversations/frontend/components/ScenesTabs/scenesTabsLogic.tsindex 5fbd234030b9..ee729d215eb7 100644--- a/products/conversations/frontend/components/ScenesTabs/scenesTabsLogic.ts+++ b/products/conversations/frontend/components/ScenesTabs/scenesTabsLogic.ts@@ -1,10 +1,9 @@-import { actions, kea, listeners, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'import { router, urlToAction } from 'kea-router'import { urls } from 'scenes/urls'import type { SceneTabKey } from '../../types'-import type { scenesTabsLogicType } from './scenesTabsLogicType'export type SceneTabConfig = {key: SceneTabKey@@ -25,6 +24,24 @@ export const SCENE_TABS: SceneTabConfig[] = [},]+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface scenesTabsLogicValues {+ activeTab: SceneTabKey+ tabs: SceneTabConfig[]+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface scenesTabsLogicActions {+ setActiveTab: (tab: SceneTabKey) => {+ tab: SceneTabKey+ }+ setTab: (tab: SceneTabKey) => {+ tab: SceneTabKey+ }+}++export type scenesTabsLogicType = MakeLogicType<scenesTabsLogicValues, scenesTabsLogicActions>+export const scenesTabsLogic = kea<scenesTabsLogicType>([path(['products', 'conversations', 'frontend', 'components', 'ScenesTabs', 'scenesTabsLogic']),actions({diff --git a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.tsindex bca4ac1bf432..eca8f9b4e0a1 100644--- a/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts+++ b/products/conversations/frontend/components/SidePanel/sidepanelTicketsLogic.ts@@ -1,5 +1,16 @@import { JSONContent } from '@tiptap/core'-import { actions, beforeUnmount, afterMount, connect, kea, listeners, path, reducers, selectors } from 'kea'+import {+ MakeLogicType,+ actions,+ beforeUnmount,+ afterMount,+ connect,+ kea,+ listeners,+ path,+ reducers,+ selectors,+} from 'kea'import { router } from 'kea-router'import { subscriptions } from 'kea-subscriptions'import posthog from 'posthog-js'@@ -11,6 +22,8 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'+import type { SupportFormFields } from '../../../../../frontend/src/lib/components/Support/supportLogic'+import type { FeatureFlagsSet } from '../../../../../frontend/src/lib/logic/featureFlagLogic'import type {ChatMessage,ConversationMessage,@@ -18,7 +31,6 @@ import type {RestoreFlowState,SidePanelViewState,} from '../../types'-import type { sidepanelTicketsLogicType } from './sidepanelTicketsLogicType'const POLL_INTERVAL = 60 * 1000 // 60 seconds@@ -39,6 +51,134 @@ function messageToRichContent(message: string): JSONContent {}}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sidepanelTicketsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ sidePanelOpen: boolean // sidePanelStateLogic+ isEmailFormOpen: boolean // supportLogic+ pendingViewTicket: {+ created_at: string+ id: string+ status: string+ } | null // supportLogic+ sendSupportRequest: SupportFormFields // supportLogic+ currentTicket: ConversationTicket | null+ hasMoreMessages: boolean+ isEnabled: boolean+ messageSending: boolean+ messages: ChatMessage[]+ messagesLoading: boolean+ newTicketDraft: JSONContent | null+ newTicketDraftRevision: number+ restoreError: string | null+ restoreState: RestoreFlowState+ tickets: ConversationTicket[]+ ticketsLoading: boolean+ totalUnreadCount: number+ view: SidePanelViewState+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sidepanelTicketsLogicActions {+ clearPendingViewTicket: () => {+ value: true+ } // supportLogic+ closeEmailForm: () => {+ value: true+ } // supportLogic+ closeSupportForm: () => {+ value: true+ } // supportLogic+ resetSendSupportRequest: (values?: SupportFormFields | undefined) => {+ values?: SupportFormFields+ } // supportLogic+ initTickets: () => {+ value: true+ }+ loadMessages: (ticketId: string) => {+ ticketId: string+ }+ loadTickets: () => {+ value: true+ }+ markAsRead: (ticketId: string) => {+ ticketId: string+ }+ openPendingTicket: () => {+ value: true+ }+ requestRestoreLink: (email: string) => {+ email: string+ }+ restoreFromUrlToken: (token: string) => {+ token: string+ }+ sendMessage: (+ content: string,+ onSuccess: () => void+ ) => {+ content: string+ onSuccess: () => void+ }+ setCurrentTicket: (ticket: ConversationTicket) => {+ ticket: ConversationTicket+ }+ setHasMoreMessages: (hasMore: boolean) => {+ hasMore: boolean+ }+ setMessageSending: (sending: boolean) => {+ sending: boolean+ }+ setMessages: (messages: ChatMessage[]) => {+ messages: ChatMessage[]+ }+ setMessagesLoading: (loading: boolean) => {+ loading: boolean+ }+ setNewTicketDraft: (content: JSONContent | null) => {+ content: JSONContent | null+ }+ setRestoreError: (error: string | null) => {+ error: string | null+ }+ setRestoreState: (state: RestoreFlowState) => {+ state: RestoreFlowState+ }+ setTickets: (tickets: ConversationTicket[]) => {+ tickets: ConversationTicket[]+ }+ setTicketsLoading: (loading: boolean) => {+ loading: boolean+ }+ setView: (view: SidePanelViewState) => {+ view: SidePanelViewState+ }+ startPolling: () => {+ value: true+ }+ startTicketFromSupportForm: () => {+ value: true+ }+ stopPolling: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface sidepanelTicketsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ isEnabled: (featureFlags: FeatureFlagsSet) => boolean+ totalUnreadCount: (tickets: ConversationTicket[]) => number+ }+}++export type sidepanelTicketsLogicType = MakeLogicType<+ sidepanelTicketsLogicValues,+ sidepanelTicketsLogicActions,+ Record<string, any>,+ sidepanelTicketsLogicMeta+>+export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([path(['products', 'conversations', 'frontend', 'components', 'SidePanel', 'sidepanelTicketsLogic']),connect(() => ({@@ -162,9 +302,13 @@ export const sidepanelTicketsLogic = kea<sidepanelTicketsLogicType>([selectors({isEnabled: [(s) => [s.featureFlags],- (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.PRODUCT_SUPPORT_SIDE_PANEL],+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): boolean =>+ !!featureFlags[FEATURE_FLAGS.PRODUCT_SUPPORT_SIDE_PANEL],+ ],+ totalUnreadCount: [+ (s) => [s.tickets],+ (tickets: ConversationTicket[]) => tickets.reduce((sum, t) => sum + (t.unread_count ?? 0), 0),],- totalUnreadCount: [(s) => [s.tickets], (tickets) => tickets.reduce((sum, t) => sum + (t.unread_count ?? 0), 0)],}),listeners(({ actions, values, cache }) => ({initTickets: () => {diff --git a/products/conversations/frontend/scenes/settings/supportSettingsLogic.ts b/products/conversations/frontend/scenes/settings/supportSettingsLogic.tsindex 567084f3b47d..6f89e3bc5edd 100644--- a/products/conversations/frontend/scenes/settings/supportSettingsLogic.ts+++ b/products/conversations/frontend/scenes/settings/supportSettingsLogic.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 api from 'lib/api'@@ -9,8 +9,9 @@ import { teamLogic } from 'scenes/teamLogic'import { SlackChannelType, UserBasicType } from '~/types'+import type { FeatureFlagsSet } from '../../../../../frontend/src/lib/logic/featureFlagLogic'+import type { TeamPublicType, TeamType } from '../../../../../frontend/src/types'import { TicketChannel } from '../../types'-import type { supportSettingsLogicType } from './supportSettingsLogicType'const BASE_AI_CHANNELS: TicketChannel[] = ['widget', 'email', 'slack']@@ -36,6 +37,530 @@ export interface EmailConfigStatus {is_default: boolean}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportSettingsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ currentTeamLoading: boolean // teamLogic+ addEmailFormVisible: boolean+ aiAllChannels: TicketChannel[]+ aiDiagnosticsEnabled: boolean+ aiDiagnosticsLoading: boolean+ aiEnabledChannels: TicketChannel[]+ aiReplyModes: Record<string, Record<string, 'bot_reply' | 'private_note'>>+ aiResolutionChannels: TicketChannel[]+ aiSuggestionsEnabled: boolean+ aiSuggestionsLoading: boolean+ conversationsDomains: string[]+ conversationsEnabledLoading: boolean+ domainInputValue: string+ editingDomainIndex: number | null+ emailConfigs: EmailConfigStatus[]+ emailConnected: boolean+ emailConnecting: boolean+ emailTestingConfigId: string | null+ emailVerifyingConfigId: string | null+ githubConnected: boolean+ githubIntegrations: {+ id: number+ name: string+ }[]+ githubIntegrationsLoading: boolean+ githubRepos: {+ full_name: string+ name: string+ }[]+ githubReposLoading: boolean+ githubSelectedRepos: string[]+ greetingInputValue: string | null+ identificationFormDescriptionValue: string | null+ identificationFormTitleValue: string | null+ isAddingDomain: boolean+ newEmailFromEmail: string+ newEmailFromName: string+ notificationRecipients: number[]+ placeholderTextValue: string | null+ settingDefaultEmailConfigId: string | null+ slackAlertChannelId: string | null+ slackBotDisplayName: string | null+ slackBotDisplayNameValue: string | null+ slackBotIconUrl: string | null+ slackBotIconUrlValue: string | null+ slackChannelIds: string[]+ slackChannels: SlackChannelType[]+ slackChannelsLoading: boolean+ slackConnected: boolean+ slackEnabled: boolean+ slackNotifyOnJoin: boolean+ slackNotifyOnLeave: boolean+ slackNudgeEnabled: boolean+ slackTicketEmoji: string+ slackTicketEmojiValue: string | null+ teamsChannelId: string | null+ teamsChannelName: string | null+ teamsChannelPairLoading: string | null+ teamsChannelPairs: {+ channel_id: string+ channel_name?: string | null+ membership_type?: string | null+ team_id: string+ team_name?: string | null+ }[]+ teamsChannels: {+ id: string+ membership_type?: string | null+ name: string+ }[]+ teamsChannelsCache: Record<+ string,+ {+ id: string+ membership_type?: string | null+ name: string+ }[]+ >+ teamsChannelsLoading: boolean+ teamsConnected: boolean+ teamsInstallStatus: 'error' | 'idle' | 'installed' | 'installing' | 'needs_org_catalog'+ teamsInstallingForTeamId: string | null+ teamsTeamId: string | null+ teamsTeamName: string | null+ teamsTeams: {+ id: string+ name: string+ }[]+ teamsTeamsLoading: boolean+ widgetEnabledLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportSettingsLogicActions {+ loadCurrentTeam: () => any // teamLogic+ updateCurrentTeam: (payload: Partial<TeamType>) => Partial<TeamType> // teamLogic+ updateCurrentTeamFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ } // teamLogic+ updateCurrentTeamSuccess: (+ currentTeam: TeamPublicType | TeamType,+ payload?: Partial<TeamType> | undefined+ ) => {+ currentTeam: TeamPublicType | TeamType+ payload?: Partial<TeamType>+ } // teamLogic+ addTeamsChannelPair: (+ teamId: string,+ channelId: string+ ) => {+ channelId: string+ teamId: string+ }+ cacheTeamsChannelsForTeam: (+ teamId: string,+ channels: {+ id: string+ membership_type?: string | null+ name: string+ }[]+ ) => {+ channels: {+ id: string+ membership_type?: string | null | undefined+ name: string+ }[]+ teamId: string+ }+ cancelDomainEdit: () => {+ value: true+ }+ connectEmail: () => {+ value: true+ }+ connectEmailDone: (config: EmailConfigStatus | null) => {+ config: EmailConfigStatus | null+ }+ connectGithub: (integrationId: number) => {+ integrationId: number+ }+ connectSlack: (nextPath: string) => {+ nextPath: string+ }+ connectTeams: (nextPath: string) => {+ nextPath: string+ }+ disconnectEmail: (configId: string) => {+ configId: string+ }+ disconnectEmailDone: (configId: string) => {+ configId: string+ }+ disconnectGithub: () => {+ value: true+ }+ disconnectSlack: () => {+ value: true+ }+ disconnectTeams: () => {+ value: true+ }+ generateNewToken: () => {+ value: true+ }+ installTeamsApp: (teamId: string) => {+ teamId: string+ }+ loadEmailConfigs: () => {+ value: true+ }+ loadEmailConfigsDone: (configs: EmailConfigStatus[]) => {+ configs: EmailConfigStatus[]+ }+ loadGithubIntegrations: () => any+ loadGithubIntegrationsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadGithubIntegrationsSuccess: (+ githubIntegrations: {+ id: any+ name: any+ }[],+ payload?: any+ ) => {+ githubIntegrations: {+ id: any+ name: any+ }[]+ payload?: any+ }+ loadGithubRepos: () => {+ value: true+ }+ loadGithubReposFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadGithubReposSuccess: (+ githubRepos: {+ full_name: string+ name: string+ }[],+ payload?: {+ value: true+ }+ ) => {+ githubRepos: {+ full_name: string+ name: string+ }[]+ payload?: {+ value: true+ }+ }+ loadSlackChannelsWithToken: () => {+ value: true+ }+ loadSlackChannelsWithTokenFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSlackChannelsWithTokenSuccess: (+ slackChannels: SlackChannelType[],+ payload?: {+ value: true+ }+ ) => {+ slackChannels: SlackChannelType[]+ payload?: {+ value: true+ }+ }+ loadTeamsChannelsForTeam: (teamId: string) => {+ teamId: string+ }+ loadTeamsChannelsForTeamFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadTeamsChannelsForTeamSuccess: (+ teamsChannels: {+ id: string+ membership_type?: string | null+ name: string+ }[],+ payload?: {+ teamId: string+ }+ ) => {+ teamsChannels: {+ id: string+ membership_type?: string | null+ name: string+ }[]+ payload?: {+ teamId: string+ }+ }+ loadTeamsTeamsWithToken: () => {+ value: true+ }+ loadTeamsTeamsWithTokenFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadTeamsTeamsWithTokenSuccess: (+ teamsTeams: {+ id: string+ name: string+ }[],+ payload?: {+ value: true+ }+ ) => {+ teamsTeams: {+ id: string+ name: string+ }[]+ payload?: {+ value: true+ }+ }+ removeDomain: (index: number) => {+ index: number+ }+ removeTeamsChannelPair: (channelId: string) => {+ channelId: string+ }+ saveDomain: (+ value: string,+ editingIndex: number | null+ ) => {+ editingIndex: number | null+ value: string+ }+ saveGreetingText: () => {+ value: true+ }+ saveIdentificationFormDescription: () => {+ value: true+ }+ saveIdentificationFormTitle: () => {+ value: true+ }+ savePlaceholderText: () => {+ value: true+ }+ saveSlackBotSettings: () => {+ value: true+ }+ saveSlackTicketEmoji: () => {+ value: true+ }+ sendTestEmail: (configId: string) => {+ configId: string+ }+ sendTestEmailDone: (configId: string) => {+ configId: string+ }+ setAddEmailFormVisible: (visible: boolean) => {+ visible: boolean+ }+ setAiDiagnosticsEnabled: (enabled: boolean) => {+ enabled: boolean+ }+ setAiDiagnosticsLoading: (loading: boolean) => {+ loading: boolean+ }+ setAiReplyMode: (+ channel: string,+ ticketType: string,+ mode: 'bot_reply' | 'private_note'+ ) => {+ channel: string+ mode: 'bot_reply' | 'private_note'+ ticketType: string+ }+ setAiResolutionChannels: (channels: TicketChannel[]) => {+ channels: TicketChannel[]+ }+ setAiSuggestionsEnabled: (enabled: boolean) => {+ enabled: boolean+ }+ setAiSuggestionsLoading: (loading: boolean) => {+ loading: boolean+ }+ setConversationsEnabledLoading: (loading: boolean) => {+ loading: boolean+ }+ setDefaultEmail: (configId: string) => {+ configId: string+ }+ setDefaultEmailDone: (configId: string) => {+ configId: string+ }+ setDefaultEmailFailed: () => {+ value: true+ }+ setDomainInputValue: (value: string) => {+ value: string+ }+ setEditingDomainIndex: (index: number | null) => {+ index: number | null+ }+ setGithubRepos: (repos: string[]) => {+ repos: string[]+ }+ setGreetingInputValue: (value: string | null) => {+ value: string | null+ }+ setIdentificationFormDescriptionValue: (value: string | null) => {+ value: string | null+ }+ setIdentificationFormTitleValue: (value: string | null) => {+ value: string | null+ }+ setIsAddingDomain: (isAdding: boolean) => {+ isAdding: boolean+ }+ setNewEmailFromEmail: (value: string) => {+ value: string+ }+ setNewEmailFromName: (value: string) => {+ value: string+ }+ setNotificationRecipients: (users: UserBasicType[]) => {+ users: UserBasicType[]+ }+ setPlaceholderTextValue: (value: string | null) => {+ value: string | null+ }+ setSlackAlertChannel: (channelId: string | null) => {+ channelId: string | null+ }+ setSlackBotDisplayNameValue: (value: string | null) => {+ value: string | null+ }+ setSlackBotIconUrlValue: (value: string | null) => {+ value: string | null+ }+ setSlackChannels: (channelIds: string[]) => {+ channelIds: string[]+ }+ setSlackNotifyOnJoin: (enabled: boolean) => {+ enabled: boolean+ }+ setSlackNotifyOnLeave: (enabled: boolean) => {+ enabled: boolean+ }+ setSlackNudgeEnabled: (enabled: boolean) => {+ enabled: boolean+ }+ setSlackTicketEmojiValue: (value: string | null) => {+ value: string | null+ }+ setTeamsChannelPairLoading: (channelId: string | null) => {+ channelId: string | null+ }+ setTeamsInstallStatus: (+ status: 'error' | 'idle' | 'installed' | 'installing' | 'needs_org_catalog',+ teamId?: string | null+ ) => {+ status: 'error' | 'idle' | 'installed' | 'installing' | 'needs_org_catalog'+ teamId: string | null+ }+ setWidgetEnabledLoading: (loading: boolean) => {+ loading: boolean+ }+ startEditDomain: (index: number) => {+ index: number+ }+ verifyEmailDomain: (configId: string) => {+ configId: string+ }+ verifyEmailDomainDone: (+ configId: string,+ verified: boolean,+ dnsRecords: Record<string, any> | null+ ) => {+ configId: string+ dnsRecords: Record<string, any> | null+ verified: boolean+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportSettingsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ conversationsDomains: (currentTeam: TeamPublicType | TeamType | null) => string[]+ notificationRecipients: (currentTeam: TeamPublicType | TeamType | null) => number[]+ slackEnabled: (currentTeam: TeamPublicType | TeamType | null) => boolean+ slackChannelIds: (currentTeam: TeamPublicType | TeamType | null) => string[]+ slackTicketEmoji: (currentTeam: TeamPublicType | TeamType | null) => string+ slackConnected: (currentTeam: TeamPublicType | TeamType | null) => boolean+ slackBotIconUrl: (currentTeam: TeamPublicType | TeamType | null) => string | null+ slackBotDisplayName: (currentTeam: TeamPublicType | TeamType | null) => string | null+ slackNotifyOnJoin: (currentTeam: TeamPublicType | TeamType | null) => boolean+ slackNotifyOnLeave: (currentTeam: TeamPublicType | TeamType | null) => boolean+ slackNudgeEnabled: (currentTeam: TeamPublicType | TeamType | null) => boolean+ slackAlertChannelId: (currentTeam: TeamPublicType | TeamType | null) => string | null+ emailConnected: (emailConfigs: EmailConfigStatus[]) => boolean+ teamsConnected: (currentTeam: TeamPublicType | TeamType | null) => boolean+ teamsTeamId: (currentTeam: TeamPublicType | TeamType | null) => string | null+ teamsTeamName: (currentTeam: TeamPublicType | TeamType | null) => string | null+ teamsChannelId: (currentTeam: TeamPublicType | TeamType | null) => string | null+ teamsChannelName: (currentTeam: TeamPublicType | TeamType | null) => string | null+ teamsChannelPairs: (currentTeam: TeamPublicType | TeamType | null) => {+ channel_id: string+ channel_name?: string | null+ membership_type?: string | null+ team_id: string+ team_name?: string | null+ }[]+ githubConnected: (currentTeam: TeamPublicType | TeamType | null) => boolean+ githubSelectedRepos: (currentTeam: TeamPublicType | TeamType | null) => string[]+ aiSuggestionsEnabled: (currentTeam: TeamPublicType | TeamType | null) => boolean+ aiDiagnosticsEnabled: (currentTeam: TeamPublicType | TeamType | null) => boolean+ aiEnabledChannels: (+ currentTeam: TeamPublicType | TeamType | null,+ emailConfigs: EmailConfigStatus[]+ ) => TicketChannel[]+ aiAllChannels: (featureFlags: FeatureFlagsSet) => TicketChannel[]+ aiResolutionChannels: (+ currentTeam: TeamPublicType | TeamType | null,+ aiEnabledChannels: TicketChannel[],+ aiAllChannels: TicketChannel[]+ ) => TicketChannel[]+ aiReplyModes: (+ currentTeam: TeamPublicType | TeamType | null+ ) => Record<string, Record<string, 'bot_reply' | 'private_note'>>+ }+}++export type supportSettingsLogicType = MakeLogicType<+ supportSettingsLogicValues,+ supportSettingsLogicActions,+ Record<string, any>,+ supportSettingsLogicMeta+>+export const supportSettingsLogic = kea<supportSettingsLogicType>([path(['products', 'conversations', 'frontend', 'scenes', 'settings', 'supportSettingsLogic']),connect(() => ({@@ -440,19 +965,22 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([selectors({conversationsDomains: [(s) => [s.currentTeam],- (currentTeam): string[] => currentTeam?.conversations_settings?.widget_domains || [],+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string[] =>+ currentTeam?.conversations_settings?.widget_domains || [],],notificationRecipients: [(s) => [s.currentTeam],- (currentTeam): number[] => currentTeam?.conversations_settings?.notification_recipients || [],+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): number[] =>+ currentTeam?.conversations_settings?.notification_recipients || [],],slackEnabled: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.slack_enabled,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.slack_enabled,],slackChannelIds: [(s) => [s.currentTeam],- (currentTeam): string[] => {+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string[] => {const cs = currentTeam?.conversations_settingsif (Array.isArray(cs?.slack_channel_ids)) {return cs.slack_channel_ids@@ -462,61 +990,77 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([],slackTicketEmoji: [(s) => [s.currentTeam],- (currentTeam): string => currentTeam?.conversations_settings?.slack_ticket_emoji ?? 'ticket',+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string =>+ currentTeam?.conversations_settings?.slack_ticket_emoji ?? 'ticket',],slackConnected: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.slack_enabled,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.slack_enabled,],slackBotIconUrl: [(s) => [s.currentTeam],- (currentTeam): string | null => currentTeam?.conversations_settings?.slack_bot_icon_url ?? null,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string | null =>+ currentTeam?.conversations_settings?.slack_bot_icon_url ?? null,],slackBotDisplayName: [(s) => [s.currentTeam],- (currentTeam): string | null => currentTeam?.conversations_settings?.slack_bot_display_name ?? null,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string | null =>+ currentTeam?.conversations_settings?.slack_bot_display_name ?? null,],slackNotifyOnJoin: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.slack_notify_on_join,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.slack_notify_on_join,],slackNotifyOnLeave: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.slack_notify_on_leave,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.slack_notify_on_leave,],slackNudgeEnabled: [(s) => [s.currentTeam],- (currentTeam): boolean => currentTeam?.conversations_settings?.slack_nudge_enabled ?? true,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ currentTeam?.conversations_settings?.slack_nudge_enabled ?? true,],slackAlertChannelId: [(s) => [s.currentTeam],- (currentTeam): string | null => currentTeam?.conversations_settings?.slack_alert_channel_id ?? null,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string | null =>+ currentTeam?.conversations_settings?.slack_alert_channel_id ?? null,+ ],+ emailConnected: [+ (s) => [s.emailConfigs],+ (emailConfigs: EmailConfigStatus[]): boolean => emailConfigs.length > 0,],- emailConnected: [(s) => [s.emailConfigs], (emailConfigs): boolean => emailConfigs.length > 0],teamsConnected: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.teams_enabled,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.teams_enabled,],teamsTeamId: [(s) => [s.currentTeam],- (currentTeam): string | null => currentTeam?.conversations_settings?.teams_team_id ?? null,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string | null =>+ currentTeam?.conversations_settings?.teams_team_id ?? null,],teamsTeamName: [(s) => [s.currentTeam],- (currentTeam): string | null => currentTeam?.conversations_settings?.teams_team_name ?? null,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string | null =>+ currentTeam?.conversations_settings?.teams_team_name ?? null,],teamsChannelId: [(s) => [s.currentTeam],- (currentTeam): string | null => currentTeam?.conversations_settings?.teams_channel_id ?? null,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string | null =>+ currentTeam?.conversations_settings?.teams_channel_id ?? null,],teamsChannelName: [(s) => [s.currentTeam],- (currentTeam): string | null => currentTeam?.conversations_settings?.teams_channel_name ?? null,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string | null =>+ currentTeam?.conversations_settings?.teams_channel_name ?? null,],teamsChannelPairs: [(s) => [s.currentTeam],(- currentTeam+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): {team_id: stringteam_name?: string | null@@ -544,23 +1088,30 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([],githubConnected: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.github_enabled,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.github_enabled,],githubSelectedRepos: [(s) => [s.currentTeam],- (currentTeam): string[] => currentTeam?.conversations_settings?.github_repos || [],+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): string[] =>+ currentTeam?.conversations_settings?.github_repos || [],],aiSuggestionsEnabled: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.ai_suggestions_enabled,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.ai_suggestions_enabled,],aiDiagnosticsEnabled: [(s) => [s.currentTeam],- (currentTeam): boolean => !!currentTeam?.conversations_settings?.ai_diagnostics_enabled,+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_settings?.ai_diagnostics_enabled,],aiEnabledChannels: [(s) => [s.currentTeam, s.emailConfigs],- (currentTeam, emailConfigs): TicketChannel[] => {+ (+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,+ emailConfigs: EmailConfigStatus[]+ ): TicketChannel[] => {const cs = currentTeam?.conversations_settingsif (!cs) {return []@@ -584,11 +1135,16 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([],aiAllChannels: [(s) => [s.featureFlags],- (featureFlags): TicketChannel[] => aiAllChannelsForFeatureFlags(featureFlags),+ (featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet): TicketChannel[] =>+ aiAllChannelsForFeatureFlags(featureFlags),],aiResolutionChannels: [(s) => [s.currentTeam, s.aiEnabledChannels, s.aiAllChannels],- (currentTeam, aiEnabledChannels, aiAllChannels): TicketChannel[] => {+ (+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType,+ aiEnabledChannels: TicketChannel[],+ aiAllChannels: TicketChannel[]+ ): TicketChannel[] => {const allowed = aiEnabledChannels.filter((channel) => aiAllChannels.includes(channel))const stored = currentTeam?.conversations_settings?.ai_resolution_channelsif (Array.isArray(stored)) {@@ -601,7 +1157,9 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([],aiReplyModes: [(s) => [s.currentTeam],- (currentTeam): Record<string, Record<string, 'private_note' | 'bot_reply'>> => {+ (+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType+ ): Record<string, Record<string, 'private_note' | 'bot_reply'>> => {return currentTeam?.conversations_settings?.ai_reply_modes ?? {}},],diff --git a/products/conversations/frontend/scenes/settings/zendeskImportLogic.ts b/products/conversations/frontend/scenes/settings/zendeskImportLogic.tsindex 577896e055d6..996bd2cdfa91 100644--- a/products/conversations/frontend/scenes/settings/zendeskImportLogic.ts+++ b/products/conversations/frontend/scenes/settings/zendeskImportLogic.ts@@ -1,4 +1,15 @@-import { actions, afterMount, beforeUnmount, connect, kea, listeners, path, reducers, selectors } from 'kea'+import {+ MakeLogicType,+ actions,+ afterMount,+ beforeUnmount,+ connect,+ kea,+ listeners,+ path,+ reducers,+ selectors,+} from 'kea'import { loaders } from 'kea-loaders'import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'@@ -7,13 +18,102 @@ import { getCurrentTeamId } from 'lib/utils/getAppContext'import { conversationsZendeskImportsCreate, conversationsZendeskImportsStatusRetrieve } from '../../generated/api'import type { ZendeskImportJobApi } from '../../generated/api.schemas'import { supportSettingsLogic } from './supportSettingsLogic'-import type { zendeskImportLogicType } from './zendeskImportLogicType'+import type { EmailConfigStatus } from './supportSettingsLogic'export type ZendeskImportJobStatus = ZendeskImportJobApi['status']const TERMINAL_STATUSES: ZendeskImportJobStatus[] = ['completed', 'failed']const POLL_INTERVAL_MS = 3000+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface zendeskImportLogicValues {+ emailConfigs: EmailConfigStatus[] // supportSettingsLogic+ apiToken: string+ defaultEmailChannelId: string | null+ emailAddress: string+ importJob: ZendeskImportJobApi | null+ importJobLoading: boolean+ importProgressLabel: string | null+ isImportRunning: boolean+ subdomain: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface zendeskImportLogicActions {+ loadEmailConfigs: () => {+ value: true+ } // supportSettingsLogic+ loadImportJob: () => any+ loadImportJobFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadImportJobSuccess: (+ importJob: ZendeskImportJobApi | null,+ payload?: any+ ) => {+ importJob: ZendeskImportJobApi | null+ payload?: any+ }+ setApiToken: (apiToken: string) => {+ apiToken: string+ }+ setDefaultEmailChannelId: (defaultEmailChannelId: string | null) => {+ defaultEmailChannelId: string | null+ }+ setEmailAddress: (emailAddress: string) => {+ emailAddress: string+ }+ setSubdomain: (subdomain: string) => {+ subdomain: string+ }+ startPolling: () => {+ value: true+ }+ stopPolling: () => {+ value: true+ }+ submitImport: () => {+ value: true+ }+ submitImportFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ submitImportSuccess: (+ importJob: ZendeskImportJobApi,+ payload?: {+ value: true+ }+ ) => {+ importJob: ZendeskImportJobApi+ payload?: {+ value: true+ }+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface zendeskImportLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ isImportRunning: (importJob: ZendeskImportJobApi | null) => boolean+ importProgressLabel: (importJob: ZendeskImportJobApi | null) => string | null+ }+}++export type zendeskImportLogicType = MakeLogicType<+ zendeskImportLogicValues,+ zendeskImportLogicActions,+ Record<string, any>,+ zendeskImportLogicMeta+>+export const zendeskImportLogic = kea<zendeskImportLogicType>([path(['products', 'conversations', 'frontend', 'scenes', 'settings', 'zendeskImportLogic']),connect(() => ({diff --git a/products/conversations/frontend/scenes/ticket/creationGroupLogic.ts b/products/conversations/frontend/scenes/ticket/creationGroupLogic.tsindex 0d3b1985604e..0ec0fdee2da1 100644--- a/products/conversations/frontend/scenes/ticket/creationGroupLogic.ts+++ b/products/conversations/frontend/scenes/ticket/creationGroupLogic.ts@@ -1,4 +1,4 @@-import { afterMount, connect, kea, key, path, props } from 'kea'+import { MakeLogicType, afterMount, connect, kea, key, path, props } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'@@ -7,13 +7,49 @@ import { teamLogic } from 'scenes/teamLogic'import { Group } from '~/types'-import type { creationGroupLogicType } from './creationGroupLogicType'-export type CreationGroupLogicProps = {groupTypeIndex: number | nullgroupKey: string | null}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface creationGroupLogicValues {+ currentTeamId: number | null // teamLogic+ group: Group | null+ groupLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface creationGroupLogicActions {+ loadGroup: () => any+ loadGroupFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadGroupSuccess: (+ group: Group | null,+ payload?: any+ ) => {+ group: Group | null+ payload?: any+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface creationGroupLogicMeta {+ key: string+}++export type creationGroupLogicType = MakeLogicType<+ creationGroupLogicValues,+ creationGroupLogicActions,+ CreationGroupLogicProps,+ creationGroupLogicMeta+>+// Fetches the group a ticket was created with (its organization_id snapshot) so the related-groups// panel can show its name and a working link even when it has dropped out of the live related list.export const creationGroupLogic = kea<creationGroupLogicType>([diff --git a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.tsindex 81eadfdf5489..0e0a037a473c 100644--- a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts+++ b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts@@ -1,5 +1,18 @@import { JSONContent } from '@tiptap/core'-import { actions, afterMount, beforeUnmount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea'+import {+ MakeLogicType,+ actions,+ afterMount,+ beforeUnmount,+ connect,+ kea,+ key,+ listeners,+ path,+ props,+ reducers,+ selectors,+} from 'kea'import { loaders } from 'kea-loaders'import { beforeUnload, router } from 'kea-router'@@ -25,6 +38,7 @@ import {businessKnowledgeGapSuggestionsList,} from 'products/business_knowledge/frontend/generated/api'+import type { TeamPublicType, TeamType } from '../../../../../frontend/src/types'import type { TicketAssignee } from '../../components/Assignee'import { supportTicketCounterLogic } from '../../supportTicketCounterLogic'import type {@@ -36,7 +50,6 @@ import type {TicketStatus,} from '../../types'import { supportTicketsSceneLogic } from '../tickets/supportTicketsSceneLogic'-import type { supportTicketSceneLogicType } from './supportTicketSceneLogicType'const MESSAGE_POLL_INTERVAL = 5000 // 5 seconds@@ -148,6 +161,238 @@ export function getEmailReplyBlockedReason(return null}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketSceneLogicValues {+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ assignee: TicketAssignee+ breadcrumbs: Breadcrumb[]+ chatMessages: ChatMessage[]+ chatPanelWidth: (desiredSize: number | null) => number+ draftContent: JSONContent | null+ draftIsPrivate: boolean+ emailReplyBlockedReason: EmailReplyBlockedReason | null+ eventsQuery: DataTableNode | null+ exceptionsQuery: DataTableNode | null+ feedbackByMessageId: Record<string, AiReplyFeedbackRating>+ hasMoreMessages: boolean+ hasPendingWork: boolean+ hasUnsavedChanges: boolean+ knowledgeGaps: KnowledgeGapSuggestion[]+ knowledgeGapsLoading: boolean+ latestAiMessage: ChatMessage | null+ messageSending: boolean+ messages: CommentType[]+ messagesLoading: boolean+ olderMessagesLoading: boolean+ person: PersonType | null+ personLoading: boolean+ previousTickets: Ticket[]+ previousTicketsLoading: boolean+ priority: TicketPriority | null+ snoozedUntil: string | null+ status: TicketStatus | null+ tags: string[]+ ticket: Ticket | null+ ticketLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketSceneLogicActions {+ loadTickets: () => {+ value: true+ } // supportTicketsSceneLogic+ dismissKnowledgeGap: (suggestionId: string) => {+ suggestionId: string+ }+ incrementUnreadCustomerCount: () => {+ value: true+ }+ loadKnowledgeGaps: () => {+ value: true+ }+ loadKnowledgeGapsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadKnowledgeGapsSuccess: (+ knowledgeGaps: KnowledgeGapSuggestion[],+ payload?: {+ value: true+ }+ ) => {+ knowledgeGaps: KnowledgeGapSuggestion[]+ payload?: {+ value: true+ }+ }+ loadMessages: () => {+ value: true+ }+ loadOlderMessages: () => {+ 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+ }+ }+ loadPreviousTickets: () => {+ value: true+ }+ loadPreviousTicketsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadPreviousTicketsSuccess: (+ previousTickets: Ticket[],+ payload?: {+ value: true+ }+ ) => {+ previousTickets: Ticket[]+ payload?: {+ value: true+ }+ }+ loadTicket: () => {+ value: true+ }+ recordAiReplyFeedback: (+ messageId: string,+ rating: AiReplyFeedbackRating+ ) => {+ messageId: string+ rating: AiReplyFeedbackRating+ }+ sendMessage: (+ content: string,+ richContent: Record<string, unknown> | null,+ isPrivate: boolean,+ onSuccess?: () => void+ ) => {+ content: string+ isPrivate: boolean+ onSuccess: (() => void) | undefined+ richContent: Record<string, unknown> | null+ }+ setAssignee: (assignee: TicketAssignee) => {+ assignee: TicketAssignee+ }+ setDraftContent: (content: JSONContent | null) => {+ content: JSONContent | null+ }+ setDraftIsPrivate: (isPrivate: boolean) => {+ isPrivate: boolean+ }+ setHasMoreMessages: (hasMore: boolean) => {+ hasMore: boolean+ }+ setMessageSending: (sending: boolean) => {+ sending: boolean+ }+ setMessages: (messages: CommentType[]) => {+ messages: CommentType[]+ }+ setMessagesLoading: (loading: boolean) => {+ loading: boolean+ }+ setOlderMessages: (olderMessages: CommentType[]) => {+ olderMessages: CommentType[]+ }+ setOlderMessagesLoading: (loading: boolean) => {+ loading: boolean+ }+ setPriority: (priority: TicketPriority) => {+ priority: TicketPriority+ }+ setSnoozedUntil: (snoozedUntil: string | null) => {+ snoozedUntil: string | null+ }+ setStatus: (status: TicketStatus) => {+ status: TicketStatus+ }+ setTags: (tags: string[]) => {+ tags: string[]+ }+ setTicket: (ticket: Ticket | null) => {+ ticket: Ticket | null+ }+ setTicketLoading: (loading: boolean) => {+ loading: boolean+ }+ submitAiReplyFeedback: (+ messageId: string,+ rating: AiReplyFeedbackRating,+ feedbackText?: string+ ) => {+ feedbackText: string | undefined+ messageId: string+ rating: AiReplyFeedbackRating+ }+ updateTicket: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketSceneLogicProps {+ id: number | string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketSceneLogicMeta {+ key: number | string+ __keaTypeGenInternalSelectorTypes: {+ breadcrumbs: (id: number | string) => Breadcrumb[]+ emailReplyBlockedReason: (+ ticket: Ticket | null,+ currentTeam: TeamPublicType | TeamType | null+ ) => EmailReplyBlockedReason | null+ hasUnsavedChanges: (+ status: TicketStatus | null,+ priority: TicketPriority | null,+ assignee: TicketAssignee,+ tags: string[],+ snoozedUntil: string | null,+ ticket: Ticket | null+ ) => boolean+ hasPendingWork: (hasUnsavedChanges: boolean) => boolean+ chatMessages: (messages: CommentType[], ticket: Ticket | null) => ChatMessage[]+ eventsQuery: (ticket: Ticket | null) => DataTableNode | null+ exceptionsQuery: (ticket: Ticket | null) => DataTableNode | null+ latestAiMessage: (chatMessages: ChatMessage[]) => ChatMessage | null+ }+}++export type supportTicketSceneLogicType = MakeLogicType<+ supportTicketSceneLogicValues,+ supportTicketSceneLogicActions,+ supportTicketSceneLogicProps,+ supportTicketSceneLogicMeta+>+export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([path(['products', 'conversations', 'frontend', 'scenes', 'ticket', 'supportTicketSceneLogic']),props({ id: 'new' as string | number }),@@ -408,7 +653,7 @@ export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([selectors({breadcrumbs: [(_, p) => [p.id],- (id): Breadcrumb[] => {+ (id: number | string): Breadcrumb[] => {let name: stringif (id === 'new') {name = 'New ticket'@@ -423,12 +668,22 @@ export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([],emailReplyBlockedReason: [(s) => [s.ticket, s.currentTeam],- (ticket, currentTeam): EmailReplyBlockedReason | null =>+ (+ ticket: Ticket | null,+ currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType+ ): EmailReplyBlockedReason | null =>getEmailReplyBlockedReason(ticket, currentTeam?.conversations_settings),],hasUnsavedChanges: [(s) => [s.status, s.priority, s.assignee, s.tags, s.snoozedUntil, s.ticket],- (status, priority, assignee, tags, snoozedUntil, ticket): boolean => {+ (+ status: TicketStatus | null,+ priority: TicketPriority | null,+ assignee: TicketAssignee,+ tags: string[],+ snoozedUntil: string | null,+ ticket: Ticket | null+ ): boolean => {if (!ticket) {return false}@@ -442,7 +697,7 @@ export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([)},],- hasPendingWork: [(s) => [s.hasUnsavedChanges], (hasUnsavedChanges): boolean => hasUnsavedChanges],+ hasPendingWork: [(s) => [s.hasUnsavedChanges], (hasUnsavedChanges: boolean): boolean => hasUnsavedChanges],chatPanelWidth: [() => [],() =>diff --git a/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.ts b/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.tsindex 875bd8f296e6..16af2770f504 100644--- a/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.ts+++ b/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.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 { router } from 'kea-router'import { lemonToast } from '@posthog/lemon-ui'@@ -21,7 +21,6 @@ import type {TicketTagsMatch,TicketViewFilters,} from '../../types'-import type { supportTicketsSceneLogicType } from './supportTicketsSceneLogicType'export const SUPPORT_TICKETS_PAGE_SIZE = 20@@ -30,6 +29,150 @@ export interface SupportTicketsSceneLogicProps {distinctIds?: string[]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketsSceneLogicValues {+ activeView: SavedTicketView | null+ aiEnabled: boolean+ aiTriageResultFilter: AITriageFilterValue[]+ assigneeFilter: AssigneeFilterValue+ bulkUpdating: boolean+ channelFilter: TicketChannel | 'all'+ currentFilters: TicketViewFilters+ currentPage: number+ dateFrom: string | null+ dateTo: string | null+ orderBy: string+ priorityFilter: TicketPriority[]+ searchQuery: string+ selectedTicketIds: string[]+ selectedTickets: Ticket[]+ slaFilter: TicketSlaState | 'all'+ sorting: Sorting | null+ statusFilter: TicketStatus[]+ tagsExcludeFilter: string[]+ tagsFilter: string[]+ tagsMatch: TicketTagsMatch+ tickets: Ticket[]+ ticketsLoading: boolean+ totalCount: number+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketsSceneLogicActions {+ applyViewFilters: (filters: TicketViewFilters) => {+ filters: TicketViewFilters+ }+ bulkUpdateStatus: (+ ids: string[],+ status: TicketStatus+ ) => {+ ids: string[]+ status: TicketStatus+ }+ clearActiveView: () => {+ value: true+ }+ clearSelectedTickets: () => {+ value: true+ }+ loadTickets: () => {+ value: true+ }+ setActiveView: (view: SavedTicketView | null) => {+ view: SavedTicketView | null+ }+ setAiTriageResultFilter: (results: AITriageFilterValue[]) => {+ results: AITriageFilterValue[]+ }+ setAssigneeFilter: (assignee: AssigneeFilterValue) => {+ assignee: AssigneeFilterValue+ }+ setBulkUpdating: (updating: boolean) => {+ updating: boolean+ }+ setChannelFilter: (channel: TicketChannel | 'all') => {+ channel: TicketChannel | 'all'+ }+ setCurrentPage: (page: number) => {+ page: number+ }+ setDateRange: (+ dateFrom: string | null,+ dateTo: string | null+ ) => {+ dateFrom: string | null+ dateTo: string | null+ }+ setPriorityFilter: (priorities: TicketPriority[]) => {+ priorities: TicketPriority[]+ }+ setSearchQuery: (query: string) => {+ query: string+ }+ setSelectedTicketIds: (ids: string[]) => {+ ids: string[]+ }+ setSlaFilter: (sla: TicketSlaState | 'all') => {+ sla: TicketSlaState | 'all'+ }+ setSorting: (sorting: Sorting | null) => {+ sorting: Sorting | null+ }+ setStatusFilter: (statuses: TicketStatus[]) => {+ statuses: TicketStatus[]+ }+ setTagsExcludeFilter: (tags: string[]) => {+ tags: string[]+ }+ setTagsFilter: (tags: string[]) => {+ tags: string[]+ }+ setTagsMatch: (match: TicketTagsMatch) => {+ match: TicketTagsMatch+ }+ setTickets: (tickets: Ticket[]) => {+ tickets: Ticket[]+ }+ setTicketsLoading: (loading: boolean) => {+ loading: boolean+ }+ setTotalCount: (count: number) => {+ count: number+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketsSceneLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ aiEnabled: (currentTeam: TeamType | null | import('~/types').TeamPublicType) => boolean+ orderBy: (sorting: Sorting | null) => string+ selectedTickets: (tickets: Ticket[], selectedTicketIds: string[]) => Ticket[]+ currentFilters: (+ statusFilter: TicketStatus[],+ priorityFilter: TicketPriority[],+ channelFilter: TicketChannel | 'all',+ slaFilter: TicketSlaState | 'all',+ aiTriageResultFilter: AITriageFilterValue[],+ assigneeFilter: AssigneeFilterValue,+ tagsFilter: string[],+ tagsMatch: TicketTagsMatch,+ tagsExcludeFilter: string[],+ dateFrom: string | null,+ dateTo: string | null,+ sorting: Sorting | null,+ searchQuery: string+ ) => TicketViewFilters+ }+}++export type supportTicketsSceneLogicType = MakeLogicType<+ supportTicketsSceneLogicValues,+ supportTicketsSceneLogicActions,+ SupportTicketsSceneLogicProps,+ supportTicketsSceneLogicMeta+>+export const supportTicketsSceneLogic = kea<supportTicketsSceneLogicType>([path(['products', 'conversations', 'frontend', 'scenes', 'tickets', 'supportTicketsSceneLogic']),props({} as SupportTicketsSceneLogicProps),diff --git a/products/conversations/frontend/supportTicketCounterLogic.ts b/products/conversations/frontend/supportTicketCounterLogic.tsindex 0a5958e8887f..d3d042c822e8 100644--- a/products/conversations/frontend/supportTicketCounterLogic.ts+++ b/products/conversations/frontend/supportTicketCounterLogic.ts@@ -1,13 +1,13 @@-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 { subscriptions } from 'kea-subscriptions'import api from 'lib/api'import { teamLogic } from 'scenes/teamLogic'+import type { TeamPublicType, TeamType } from '../../../frontend/src/types'import { browserNotificationLogic } from './browserNotificationLogic'import { supportTicketsSceneLogic } from './scenes/tickets/supportTicketsSceneLogic'-import type { supportTicketCounterLogicType } from './supportTicketCounterLogicType'const POLL_INTERVAL = 5 * 1000 // 5 seconds - backend is cached so frequent polling is cheap@@ -15,6 +15,91 @@ export interface UnreadCountResponse {count: number}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketCounterLogicValues {+ canShowNotifications: boolean // browserNotificationLogic+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ errorCounter: number+ isSupportEnabled: boolean+ unreadCount: number+ unreadCountLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketCounterLogicActions {+ showNotification: (count: number) => {+ count: number+ } // browserNotificationLogic+ clearErrorCount: () => {+ value: true+ }+ incrementErrorCount: () => {+ value: true+ }+ loadUnreadCount: () => {+ value: true+ }+ loadUnreadCountFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadUnreadCountSuccess: (+ unreadCount: number,+ payload?: {+ value: true+ }+ ) => {+ unreadCount: number+ payload?: {+ value: true+ }+ }+ refreshCount: () => {+ value: true+ }+ resetCount: () => {+ value: true+ }+ resetCountFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ resetCountSuccess: (+ unreadCount: number,+ payload?: {+ value: true+ }+ ) => {+ unreadCount: number+ payload?: {+ value: true+ }+ }+ schedulePoll: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface supportTicketCounterLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ isSupportEnabled: (currentTeam: TeamPublicType | TeamType | null) => boolean+ }+}++export type supportTicketCounterLogicType = MakeLogicType<+ supportTicketCounterLogicValues,+ supportTicketCounterLogicActions,+ Record<string, any>,+ supportTicketCounterLogicMeta+>+export const supportTicketCounterLogic = kea<supportTicketCounterLogicType>([path(['products', 'conversations', 'frontend', 'supportTicketCounterLogic']),connect(() => ({@@ -65,7 +150,11 @@ export const supportTicketCounterLogic = kea<supportTicketCounterLogicType>([],})),selectors({- isSupportEnabled: [(s) => [s.currentTeam], (currentTeam): boolean => !!currentTeam?.conversations_enabled],+ isSupportEnabled: [+ (s) => [s.currentTeam],+ (currentTeam: null | import('~/types').TeamPublicType | import('~/types').TeamType): boolean =>+ !!currentTeam?.conversations_enabled,+ ],}),listeners(({ actions, values, cache }) => ({// Re-schedule after each load completes. The loader catches API errorsdiff --git a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.tsindex 561a8c93d411..11e77e229614 100644--- a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts@@ -330,7 +330,13 @@ export interface accountsColumnConfigLogicValues {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface accountsColumnConfigLogicActions {- loadDatabase: ({ force }?: { force?: boolean }) => {+ loadDatabase: (+ args_0?:+ | {+ force?: boolean+ }+ | undefined+ ) => {force?: boolean} // databaseTableListLogicloadJoins: () => any // joinsLogicdiff --git a/products/early_access_features/frontend/earlyAccessFeatureLogic.ts b/products/early_access_features/frontend/earlyAccessFeatureLogic.tsindex 27945669d208..1552dc13ec06 100644--- a/products/early_access_features/frontend/earlyAccessFeatureLogic.ts+++ b/products/early_access_features/frontend/earlyAccessFeatureLogic.ts@@ -1,5 +1,6 @@-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 { router, urlToAction } from 'kea-router'import React from 'react'@@ -31,7 +32,6 @@ import {PropertyOperator,} from '~/types'-import type { earlyAccessFeatureLogicType } from './earlyAccessFeatureLogicType'import { earlyAccessFeaturesLogic } from './earlyAccessFeaturesLogic'import { GAPromotionDialogContent } from './GAPromotionDialogContent'@@ -49,6 +49,181 @@ export interface EarlyAccessFeatureLogicProps {id: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface earlyAccessFeatureLogicValues {+ earlyAccessFeatures: EarlyAccessFeatureType[] // earlyAccessFeaturesLogic+ currentTeamId: number | null // teamLogic+ activeTab: EarlyAccessFeatureTabs+ breadcrumbs: Breadcrumb[]+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ earlyAccessFeatureAllErrors: Record<string, any>+ earlyAccessFeatureChanged: boolean+ earlyAccessFeatureErrors: DeepPartialMap<EarlyAccessFeatureType | NewEarlyAccessFeatureType, ValidationErrorType>+ earlyAccessFeatureHasErrors: boolean+ earlyAccessFeatureLoading: boolean+ earlyAccessFeatureManualErrors: Record<string, any>+ earlyAccessFeatureMissing: boolean+ earlyAccessFeatureTouched: boolean+ earlyAccessFeatureTouches: Record<string, boolean>+ earlyAccessFeatureValidationErrors: DeepPartialMap<+ EarlyAccessFeatureType | NewEarlyAccessFeatureType,+ ValidationErrorType+ >+ featureEnrollmentKey: string+ implementOptInInstructionsModal: boolean+ isEarlyAccessFeatureSubmitting: boolean+ isEarlyAccessFeatureValid: boolean+ isEditingFeature: boolean+ optedInCount: number | null+ optedOutCount: number | null+ originalEarlyAccessFeatureStage: EarlyAccessFeatureStage | null+ personsCount: [number, number] | null+ personsCountLoading: boolean+ projectTreeRef: ProjectTreeRef+ showEarlyAccessFeatureErrors: boolean+ sidePanelContext: SidePanelSceneContext | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface earlyAccessFeatureLogicActions {+ deleteEarlyAccessFeature: (earlyAccessFeatureId: EarlyAccessFeatureType['id']) => {+ earlyAccessFeatureId: string+ }+ editFeature: (editing: boolean) => {+ editing: boolean+ }+ loadEarlyAccessFeature: () => any+ loadEarlyAccessFeatureFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadEarlyAccessFeatureSuccess: (+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType,+ payload?: any+ ) => {+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ payload?: any+ }+ loadEarlyAccessFeatureSuccessFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadEarlyAccessFeatureSuccessSuccess: (+ personsCount: [number, number] | null,+ payload?: {+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ payload?: any+ }+ ) => {+ personsCount: [number, number] | null+ payload?: {+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ payload?: any+ }+ }+ resetEarlyAccessFeature: (values?: EarlyAccessFeatureType | NewEarlyAccessFeatureType) => {+ values?: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ }+ saveEarlyAccessFeature: (+ updatedEarlyAccessFeature: Partial<EarlyAccessFeatureType | NewEarlyAccessFeatureType>+ ) => Partial<EarlyAccessFeatureType | NewEarlyAccessFeatureType>+ saveEarlyAccessFeatureFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ saveEarlyAccessFeatureSuccess: (+ earlyAccessFeature: EarlyAccessFeatureType,+ payload?: Partial<EarlyAccessFeatureType | NewEarlyAccessFeatureType>+ ) => {+ earlyAccessFeature: EarlyAccessFeatureType+ payload?: Partial<EarlyAccessFeatureType | NewEarlyAccessFeatureType>+ }+ setActiveTab: (activeTab: EarlyAccessFeatureTabs) => {+ activeTab: EarlyAccessFeatureTabs+ }+ setEarlyAccessFeatureManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setEarlyAccessFeatureMissing: () => {+ value: true+ }+ setEarlyAccessFeatureValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setEarlyAccessFeatureValues: (values: DeepPartial<EarlyAccessFeatureType | NewEarlyAccessFeatureType>) => {+ values: DeepPartial<EarlyAccessFeatureType | NewEarlyAccessFeatureType>+ }+ setOriginalStage: (stage: EarlyAccessFeatureStage) => {+ stage: EarlyAccessFeatureStage+ }+ showGAPromotionConfirmation: (onConfirm: (rolloutToAll: boolean) => void) => {+ onConfirm: (rolloutToAll: boolean) => void+ }+ submitEarlyAccessFeature: () => {+ value: boolean+ }+ submitEarlyAccessFeatureFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitEarlyAccessFeatureRequest: (earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType) => {+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ }+ submitEarlyAccessFeatureSuccess: (earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType) => {+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ }+ toggleImplementOptInInstructionsModal: () => {+ value: true+ }+ touchEarlyAccessFeatureField: (key: string) => {+ key: string+ }+ updateStage: (stage: EarlyAccessFeatureStage) => {+ stage: EarlyAccessFeatureStage+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface earlyAccessFeatureLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ breadcrumbs: (+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType,+ isEditingFeature: boolean+ ) => Breadcrumb[]+ projectTreeRef: (arg: string) => ProjectTreeRef+ sidePanelContext: (+ earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType+ ) => SidePanelSceneContext | null+ optedInCount: (personsCount: [number, number] | null) => number | null+ optedOutCount: (personsCount: [number, number] | null) => number | null+ featureEnrollmentKey: (earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType) => string+ }+}++export type earlyAccessFeatureLogicType = MakeLogicType<+ earlyAccessFeatureLogicValues,+ earlyAccessFeatureLogicActions,+ EarlyAccessFeatureLogicProps,+ earlyAccessFeatureLogicMeta+>+export const earlyAccessFeatureLogic = kea<earlyAccessFeatureLogicType>([path(['products', 'earlyAccessFeatures', 'frontend', 'earlyAccessFeatureLogic']),props({} as EarlyAccessFeatureLogicProps),@@ -276,11 +451,11 @@ export const earlyAccessFeatureLogic = kea<earlyAccessFeatureLogicType>([],projectTreeRef: [() => [(_, props: EarlyAccessFeatureLogicProps) => props.id],- (id): ProjectTreeRef => ({ type: 'early_access_feature', ref: id === 'new' ? null : String(id) }),+ (id: string): ProjectTreeRef => ({ type: 'early_access_feature', ref: id === 'new' ? null : String(id) }),],[SIDE_PANEL_CONTEXT_KEY]: [(s) => [s.earlyAccessFeature],- (earlyAccessFeature): SidePanelSceneContext | null => {+ (earlyAccessFeature: EarlyAccessFeatureType | NewEarlyAccessFeatureType): SidePanelSceneContext | null => {return 'id' in earlyAccessFeature && earlyAccessFeature.id? {activity_scope: ActivityScope.EARLY_ACCESS_FEATURE,diff --git a/products/early_access_features/frontend/earlyAccessFeaturesLogic.ts b/products/early_access_features/frontend/earlyAccessFeaturesLogic.tsindex 0b1107d30125..407366a4f377 100644--- a/products/early_access_features/frontend/earlyAccessFeaturesLogic.ts+++ b/products/early_access_features/frontend/earlyAccessFeaturesLogic.ts@@ -1,4 +1,4 @@-import { actions, afterMount, kea, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, afterMount, kea, path, reducers, selectors } from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'@@ -7,10 +7,56 @@ import { urls } from 'scenes/urls'import { Breadcrumb, EarlyAccessFeatureType } from '~/types'-import type { earlyAccessFeaturesLogicType } from './earlyAccessFeaturesLogicType'-const search = createFeaturePreviewSearch<EarlyAccessFeatureType>()+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface earlyAccessFeaturesLogicValues {+ breadcrumbs: Breadcrumb[]+ earlyAccessFeatures: EarlyAccessFeatureType[]+ earlyAccessFeaturesLoading: boolean+ filteredEarlyAccessFeatures: EarlyAccessFeatureType[]+ searchTerm: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface earlyAccessFeaturesLogicActions {+ loadEarlyAccessFeatures: () => any+ loadEarlyAccessFeaturesFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadEarlyAccessFeaturesSuccess: (+ earlyAccessFeatures: EarlyAccessFeatureType[],+ payload?: any+ ) => {+ earlyAccessFeatures: EarlyAccessFeatureType[]+ payload?: any+ }+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface earlyAccessFeaturesLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ filteredEarlyAccessFeatures: (+ earlyAccessFeatures: EarlyAccessFeatureType[],+ searchTerm: string+ ) => EarlyAccessFeatureType[]+ }+}++export type earlyAccessFeaturesLogicType = MakeLogicType<+ earlyAccessFeaturesLogicValues,+ earlyAccessFeaturesLogicActions,+ Record<string, any>,+ earlyAccessFeaturesLogicMeta+>+export const earlyAccessFeaturesLogic = kea<earlyAccessFeaturesLogicType>([path(['products', 'earlyAccessFeatures', 'frontend', 'earlyAccessFeaturesLogic']),diff --git a/products/subscriptions/frontend/components/Subscriptions/insightSelectorLogic.ts b/products/subscriptions/frontend/components/Subscriptions/insightSelectorLogic.tsindex 7f6f41424156..341fc46efe94 100644--- a/products/subscriptions/frontend/components/Subscriptions/insightSelectorLogic.ts+++ b/products/subscriptions/frontend/components/Subscriptions/insightSelectorLogic.ts@@ -1,9 +1,7 @@-import { actions, kea, path, props, reducers, selectors } from 'kea'+import { MakeLogicType, actions, kea, path, props, reducers, selectors } from 'kea'import { DashboardTile, InsightModel } from '~/types'-import type { insightSelectorLogicType } from './insightSelectorLogicType'-// Keep in sync with DEFAULT_MAX_ASSET_COUNT in ee/tasks/subscriptions/subscription_utils.pyexport const MAX_INSIGHTS = 6@@ -11,6 +9,44 @@ export interface InsightSelectorLogicProps {tiles: DashboardTile[]}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface insightSelectorLogicValues {+ filteredTiles: DashboardTile<InsightModel>[]+ insightTiles: DashboardTile<InsightModel>[]+ searchTerm: string+ showSearch: boolean+ userHasInteracted: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface insightSelectorLogicActions {+ setSearchTerm: (searchTerm: string) => {+ searchTerm: string+ }+ setUserHasInteracted: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface insightSelectorLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ insightTiles: (tiles: DashboardTile<InsightModel>[]) => DashboardTile<InsightModel>[]+ filteredTiles: (+ insightTiles: DashboardTile<InsightModel>[],+ searchTerm: string+ ) => DashboardTile<InsightModel>[]+ showSearch: (insightTiles: DashboardTile<InsightModel>[]) => boolean+ }+}++export type insightSelectorLogicType = MakeLogicType<+ insightSelectorLogicValues,+ insightSelectorLogicActions,+ InsightSelectorLogicProps,+ insightSelectorLogicMeta+>+export const insightSelectorLogic = kea<insightSelectorLogicType>([props({} as InsightSelectorLogicProps),path(['lib', 'components', 'Subscriptions', 'insightSelectorLogic']),@@ -28,7 +64,7 @@ export const insightSelectorLogic = kea<insightSelectorLogicType>([selectors({insightTiles: [(_, p) => [p.tiles],- (tiles): DashboardTile<InsightModel>[] =>+ (tiles: DashboardTile<InsightModel>[]): DashboardTile<InsightModel>[] =>((tiles || []) as DashboardTile<InsightModel>[]).filter((tile): tile is DashboardTile<InsightModel> =>@@ -42,7 +78,7 @@ export const insightSelectorLogic = kea<insightSelectorLogicType>([],filteredTiles: [(s) => [s.insightTiles, s.searchTerm],- (insightTiles, searchTerm): DashboardTile<InsightModel>[] => {+ (insightTiles: DashboardTile<InsightModel>[], searchTerm: string): DashboardTile<InsightModel>[] => {if (!searchTerm.trim()) {return insightTiles}@@ -53,6 +89,9 @@ export const insightSelectorLogic = kea<insightSelectorLogicType>([})},],- showSearch: [(s) => [s.insightTiles], (insightTiles) => insightTiles.length > 10],+ showSearch: [+ (s) => [s.insightTiles],+ (insightTiles: DashboardTile<InsightModel>[]) => insightTiles.length > 10,+ ],}),])diff --git a/products/subscriptions/frontend/components/Subscriptions/subscriptionCountLogic.ts b/products/subscriptions/frontend/components/Subscriptions/subscriptionCountLogic.tsindex bcf372454a49..87eeae7b6045 100644--- a/products/subscriptions/frontend/components/Subscriptions/subscriptionCountLogic.ts+++ b/products/subscriptions/frontend/components/Subscriptions/subscriptionCountLogic.ts@@ -1,11 +1,36 @@-import { afterMount, kea, path } from 'kea'+import { MakeLogicType, afterMount, kea, path } from 'kea'import { loaders } from 'kea-loaders'import { getCurrentTeamId } from 'lib/utils/getAppContext'import { subscriptionsList } from 'products/subscriptions/frontend/generated/api'-import type { subscriptionCountLogicType } from './subscriptionCountLogicType'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionCountLogicValues {+ subscriptionCount: number | null+ subscriptionCountLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionCountLogicActions {+ loadSubscriptionCount: () => any+ loadSubscriptionCountFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSubscriptionCountSuccess: (+ subscriptionCount: number,+ payload?: any+ ) => {+ subscriptionCount: number+ payload?: any+ }+}++export type subscriptionCountLogicType = MakeLogicType<subscriptionCountLogicValues, subscriptionCountLogicActions>export const subscriptionCountLogic = kea<subscriptionCountLogicType>([path(['lib', 'components', 'Subscriptions', 'subscriptionCountLogic']),diff --git a/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.ts b/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.tsindex ac6f7527775a..fe91b5aefc6f 100644--- a/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.ts+++ b/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.ts@@ -1,5 +1,6 @@-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 { forms } from 'kea-forms'+import type { DeepPartial, DeepPartialMap, FieldName, ValidationErrorType } from 'kea-forms'import { loaders } from 'kea-loaders'import { beforeUnload, router, urlToAction } from 'kea-router'import posthog from 'posthog-js'@@ -18,7 +19,9 @@ import { ExportedAssetType, ExporterFormat, SubscriptionResourceTypes, Subscriptimport type { AIWindowConfigApi } from 'products/subscriptions/frontend/generated/api.schemas'-import type { subscriptionLogicType } from './subscriptionLogicType'+import type { SubscriptionResourceType, UserBasicType, WeekdayType } from '../../../../../frontend/src/types'+import type { OrganizationType, UserType } from '../../../../../frontend/src/types'+import type { AIPromptConfigApi } from '../../generated/api.schemas'import { subscriptionsLogic } from './subscriptionsLogic'import { AI_PROMPT_MAX_LENGTH, SUBSCRIPTION_PREFILL_PARAMS, SubscriptionBaseProps, urlForSubscription } from './utils'@@ -132,6 +135,209 @@ export interface SubscriptionLogicProps extends SubscriptionBaseProps {/** Used to build the prefilled title when the form is opened via the subscribe-nudge notification. */dashboardName?: string | null}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionLogicValues {+ currentOrganization: OrganizationType | null // organizationLogic+ user: UserType | null // userLogic+ isSubscriptionSubmitting: boolean+ isSubscriptionValid: boolean+ previewAsset: ExportedAssetType | null+ previewError: string | null+ previewImageUrl: string | null+ previewLoading: boolean+ showSubscriptionErrors: boolean+ subscription: SubscriptionType+ subscriptionAllErrors: Record<string, any>+ subscriptionChanged: boolean+ subscriptionErrors: DeepPartialMap<SubscriptionType, ValidationErrorType>+ subscriptionHasErrors: boolean+ subscriptionLoading: boolean+ subscriptionManualErrors: Record<string, any>+ subscriptionTouched: boolean+ subscriptionTouches: Record<string, boolean>+ subscriptionValidationErrors: DeepPartialMap<SubscriptionType, ValidationErrorType>+ summaryQuota: {+ active_count: number+ at_limit: boolean+ limit: number | null+ } | null+ summaryQuotaLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionLogicActions {+ applyInsightSelectionDefaults: (selectedIds: number[]) => {+ selectedIds: number[]+ }+ generatePreview: () => {+ value: true+ }+ loadSubscription: () => any+ loadSubscriptionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSubscriptionSuccess: (+ subscription: {+ ai_prompt_config?: AIPromptConfigApi | null | undefined+ bysetpos?: number | null | undefined+ byweekday?: WeekdayType[] | null | undefined+ created_at?: string | undefined+ created_by?: UserBasicType | null | undefined+ dashboard?: number | undefined+ dashboard_export_insights?: number[] | undefined+ deleted?: boolean | undefined+ enabled?: boolean | undefined+ frequency?: 'daily' | 'monthly' | 'weekly' | 'yearly' | undefined+ id?: number | undefined+ insight?: number | undefined+ insight_short_id?: string | null | undefined+ integration_id?: number | null | undefined+ interval?: number | undefined+ next_delivery_date?: string | null | undefined+ prompt?: string | null | undefined+ resource_name?: string | null | undefined+ resource_type?: SubscriptionResourceType | undefined+ send_test_now?: boolean | undefined+ start_date?: string | undefined+ summary?: string | undefined+ summary_enabled?: boolean | undefined+ summary_prompt_guide?: string | undefined+ target_type?: string | undefined+ target_value?: string | undefined+ title?: string | undefined+ until_date?: string | undefined+ },+ payload?: any+ ) => {+ subscription: {+ ai_prompt_config?: AIPromptConfigApi | null | undefined+ bysetpos?: number | null | undefined+ byweekday?: WeekdayType[] | null | undefined+ created_at?: string | undefined+ created_by?: UserBasicType | null | undefined+ dashboard?: number | undefined+ dashboard_export_insights?: number[] | undefined+ deleted?: boolean | undefined+ enabled?: boolean | undefined+ frequency?: 'daily' | 'monthly' | 'weekly' | 'yearly' | undefined+ id?: number | undefined+ insight?: number | undefined+ insight_short_id?: string | null | undefined+ integration_id?: number | null | undefined+ interval?: number | undefined+ next_delivery_date?: string | null | undefined+ prompt?: string | null | undefined+ resource_name?: string | null | undefined+ resource_type?: SubscriptionResourceType | undefined+ send_test_now?: boolean | undefined+ start_date?: string | undefined+ summary?: string | undefined+ summary_enabled?: boolean | undefined+ summary_prompt_guide?: string | undefined+ target_type?: string | undefined+ target_value?: string | undefined+ title?: string | undefined+ until_date?: string | undefined+ }+ payload?: any+ }+ loadSummaryQuota: () => any+ loadSummaryQuotaFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSummaryQuotaSuccess: (+ summaryQuota: {+ active_count: number+ at_limit: boolean+ limit: number | null+ },+ payload?: any+ ) => {+ summaryQuota: {+ active_count: number+ at_limit: boolean+ limit: number | null+ }+ payload?: any+ }+ resetSubscription: (values?: SubscriptionType) => {+ values?: SubscriptionType+ }+ selectAiExamplePrompt: (+ prompt: string,+ label: string,+ window?: AIWindowConfigApi+ ) => {+ label: string+ prompt: string+ window: AIWindowConfigApi | undefined+ }+ setPreviewAsset: (asset: ExportedAssetType | null) => {+ asset: ExportedAssetType | null+ }+ setPreviewError: (error: string | null) => {+ error: string | null+ }+ setPreviewImageUrl: (url: string | null) => {+ url: string | null+ }+ setPreviewLoading: (loading: boolean) => {+ loading: boolean+ }+ setSubscriptionManualErrors: (errors: Record<string, any>) => {+ errors: Record<string, any>+ }+ setSubscriptionValue: (+ key: FieldName,+ value: any+ ) => {+ name: FieldName+ value: any+ }+ setSubscriptionValues: (values: DeepPartial<SubscriptionType>) => {+ values: DeepPartial<SubscriptionType>+ }+ submitSubscription: () => {+ value: boolean+ }+ submitSubscriptionFailure: (+ error: Error,+ errors: Record<string, any>+ ) => {+ error: Error+ errors: Record<string, any>+ }+ submitSubscriptionRequest: (subscription: SubscriptionType) => {+ subscription: SubscriptionType+ }+ submitSubscriptionSuccess: (subscription: SubscriptionType) => {+ subscription: SubscriptionType+ }+ touchSubscriptionField: (key: string) => {+ key: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionLogicMeta {+ key: string+}++export type subscriptionLogicType = MakeLogicType<+ subscriptionLogicValues,+ subscriptionLogicActions,+ SubscriptionLogicProps,+ subscriptionLogicMeta+>+export const subscriptionLogic = kea<subscriptionLogicType>([path(['lib', 'components', 'Subscriptions', 'subscriptionLogic']),props({} as SubscriptionLogicProps),diff --git a/products/subscriptions/frontend/components/Subscriptions/subscriptionsLogic.ts b/products/subscriptions/frontend/components/Subscriptions/subscriptionsLogic.tsindex 58afb7d8cbb5..690d215ad446 100644--- a/products/subscriptions/frontend/components/Subscriptions/subscriptionsLogic.ts+++ b/products/subscriptions/frontend/components/Subscriptions/subscriptionsLogic.ts@@ -1,4 +1,16 @@-import { BreakPointFunction, actions, afterMount, connect, kea, key, listeners, path, props, reducers } from 'kea'+import {+ MakeLogicType,+ BreakPointFunction,+ actions,+ afterMount,+ connect,+ kea,+ key,+ listeners,+ path,+ props,+ reducers,+} from 'kea'import { loaders } from 'kea-loaders'import api from 'lib/api'@@ -9,11 +21,113 @@ import { getInsightId } from 'scenes/insights/utils'import { SubscriptionResourceTypes, SubscriptionType } from '~/types'+import type { FeatureFlagsSet } from '../../../../../frontend/src/lib/logic/featureFlagLogic'import { runSubscriptionTestDelivery } from './runSubscriptionTestDelivery'-import type { subscriptionsLogicType } from './subscriptionsLogicType'import { toggleSubscriptionEnabled } from './toggleSubscriptionEnabled'import { SubscriptionsLogicProps } from './utils'+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionsLogicValues {+ featureFlags: FeatureFlagsSet // featureFlagLogic+ aiSubscriptions: SubscriptionType[]+ aiSubscriptionsLoading: boolean+ deliveringSubscriptionId: number | null+ insightSubscriptions: SubscriptionType[]+ insightSubscriptionsLoading: boolean+ subscriptions: SubscriptionType[]+ subscriptionsLoading: boolean+ togglingEnabledId: number | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionsLogicActions {+ deleteSubscription: (id: number) => {+ id: number+ }+ deliverSubscription: (id: number) => {+ id: number+ }+ deliverSubscriptionFailure: () => {+ value: true+ }+ deliverSubscriptionSuccess: () => {+ value: true+ }+ loadAiSubscriptions: (_?: any) => any+ loadAiSubscriptionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadAiSubscriptionsSuccess: (+ aiSubscriptions: SubscriptionType[],+ payload?: any+ ) => {+ aiSubscriptions: SubscriptionType[]+ payload?: any+ }+ loadAllSubscriptions: () => {+ value: true+ }+ loadInsightSubscriptions: (_?: any) => any+ loadInsightSubscriptionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadInsightSubscriptionsSuccess: (+ insightSubscriptions: SubscriptionType[],+ payload?: any+ ) => {+ insightSubscriptions: SubscriptionType[]+ payload?: any+ }+ loadSubscriptions: (_?: any) => any+ loadSubscriptionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSubscriptionsSuccess: (+ subscriptions: SubscriptionType[],+ payload?: any+ ) => {+ subscriptions: SubscriptionType[]+ payload?: any+ }+ setSubscriptionEnabled: (+ id: number,+ enabled: boolean+ ) => {+ enabled: boolean+ id: number+ }+ setSubscriptionEnabledFailure: () => {+ value: true+ }+ setSubscriptionEnabledSuccess: () => {+ value: true+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionsLogicMeta {+ key: string+}++export type subscriptionsLogicType = MakeLogicType<+ subscriptionsLogicValues,+ subscriptionsLogicActions,+ SubscriptionsLogicProps,+ subscriptionsLogicMeta+>+export const subscriptionsLogic = kea<subscriptionsLogicType>([path(['lib', 'components', 'Subscriptions', 'subscriptionsLogic']),props({} as SubscriptionsLogicProps),diff --git a/products/subscriptions/frontend/scenes/subscriptionSceneLogic.tsx b/products/subscriptions/frontend/scenes/subscriptionSceneLogic.tsxindex b348ae023902..ccd488bc0cf7 100644--- a/products/subscriptions/frontend/scenes/subscriptionSceneLogic.tsx+++ b/products/subscriptions/frontend/scenes/subscriptionSceneLogic.tsx@@ -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 { router, urlToAction } from 'kea-router'import posthog from 'posthog-js'@@ -25,7 +25,6 @@ import type {import { runSubscriptionTestDelivery } from '../components/Subscriptions/runSubscriptionTestDelivery'import { subscriptionName } from './components/SubscriptionsTable'-import type { subscriptionSceneLogicType } from './subscriptionSceneLogicType'export type SubscriptionSceneLogicProps = {id: string@@ -49,6 +48,113 @@ function parseCursorFromPaginationUrl(url: string | null | undefined): string |}}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionSceneLogicValues {+ breadcrumbs: Breadcrumb[]+ deliveriesPage: PaginatedSubscriptionDeliveryListApi | null+ deliveriesPageLoading: boolean+ deliveringSubscriptionId: number | null+ deliveryFeedback: Record<string, DeliveryFeedback>+ deliveryStatusFilter: SubscriptionsDeliveriesListStatus | null+ recentlyThankedDeliveries: Record<string, true>+ subscription: SubscriptionApi | null+ subscriptionLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionSceneLogicActions {+ deliverSubscription: (id: number) => {+ id: number+ }+ deliverSubscriptionFailure: () => {+ value: true+ }+ deliverSubscriptionSuccess: () => {+ value: true+ }+ expireDeliveryThanks: (deliveryId: string) => {+ deliveryId: string+ }+ loadDeliveriesPage: (targetUrl: string | null) => string | null+ loadDeliveriesPageFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadDeliveriesPageSuccess: (+ deliveriesPage: PaginatedSubscriptionDeliveryListApi | null,+ payload?: string | null+ ) => {+ deliveriesPage: PaginatedSubscriptionDeliveryListApi | null+ payload?: string | null+ }+ loadSubscription: () => any+ loadSubscriptionFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSubscriptionSuccess: (+ subscription: SubscriptionApi | null,+ payload?: any+ ) => {+ subscription: SubscriptionApi | null+ payload?: any+ }+ setDeliveryStatusFilter: (status: SubscriptionsDeliveriesListStatus | null) => {+ status: SubscriptionsDeliveriesListStatus | null+ }+ setEnabled: ({ enabled }: { enabled: boolean }) => {+ enabled: boolean+ }+ setEnabledFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ setEnabledSuccess: (+ subscription: SubscriptionApi | null,+ payload?: {+ enabled: boolean+ }+ ) => {+ subscription: SubscriptionApi | null+ payload?: {+ enabled: boolean+ }+ }+ submitDeliveryFeedback: (+ deliveryId: string,+ feedback: DeliveryFeedback,+ source: DeliveryFeedbackSource+ ) => {+ deliveryId: string+ feedback: DeliveryFeedback+ source: DeliveryFeedbackSource+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionSceneLogicMeta {+ key: string+ __keaTypeGenInternalSelectorTypes: {+ breadcrumbs: (subscription: SubscriptionApi | null) => Breadcrumb[]+ }+}++export type subscriptionSceneLogicType = MakeLogicType<+ subscriptionSceneLogicValues,+ subscriptionSceneLogicActions,+ SubscriptionSceneLogicProps,+ subscriptionSceneLogicMeta+>+export const subscriptionSceneLogic = kea<subscriptionSceneLogicType>([props({} as SubscriptionSceneLogicProps),key(({ id }) => id),@@ -150,7 +256,7 @@ export const subscriptionSceneLogic = kea<subscriptionSceneLogicType>([selectors({breadcrumbs: [(s) => [s.subscription],- (subscription): Breadcrumb[] => {+ (subscription: SubscriptionApi | null): Breadcrumb[] => {const listCrumb: Breadcrumb = {key: Scene.Subscriptions,name: sceneConfigurations[Scene.Subscriptions].name,diff --git a/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsx b/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsxindex 8ae9b65ade0e..4c179627fb38 100644--- a/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsx+++ b/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsx@@ -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 { router, urlToAction } from 'kea-router'@@ -21,9 +21,10 @@ import {type SubscriptionsListTargetType,} from 'products/subscriptions/frontend/generated/api.schemas'+import type { UserType } from '../../../../frontend/src/types'import { runSubscriptionTestDelivery } from '../components/Subscriptions/runSubscriptionTestDelivery'import { toggleSubscriptionEnabled } from '../components/Subscriptions/toggleSubscriptionEnabled'-import type { subscriptionsSceneLogicType } from './subscriptionsSceneLogicType'+import type { SubscriptionApi } from '../generated/api.schemas'const PAGE_SIZE = 20@@ -190,6 +191,134 @@ function buildSubscriptionsListOrdering(sorting: Sorting | null): string {return `${dir}${field}`}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionsSceneLogicValues {+ user: UserType | null // userLogic+ breadcrumbs: Breadcrumb[]+ createdByUuid: string | null+ currentTab: SubscriptionsTab+ deliveringSubscriptionId: number | null+ page: number+ pagination: {+ controlled: true+ currentPage: number+ entryCount: number+ onBackward: () => void+ onForward: () => void+ pageSize: number+ }+ search: string+ subscriptionModalId: number | 'new' | null+ subscriptions: SubscriptionApi[]+ subscriptionsListAwaitingDebouncedFetch: boolean+ subscriptionsLoading: boolean+ subscriptionsResponse: PaginatedSubscriptionListApi | null+ subscriptionsResponseLoading: boolean+ subscriptionsSorting: Sorting | null+ targetTypeFilter: SubscriptionsListTargetType | null+ togglingEnabledId: number | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionsSceneLogicActions {+ applySubscriptionsQueryFromUrl: (query: SubscriptionsQueryFromUrl) => {+ query: SubscriptionsQueryFromUrl+ }+ deleteSubscriptionSuccess: () => {+ value: true+ }+ deliverSubscription: (id: number) => {+ id: number+ }+ deliverSubscriptionFailure: () => {+ value: true+ }+ deliverSubscriptionSuccess: () => {+ value: true+ }+ loadSubscriptions: () => {+ value: true+ }+ loadSubscriptionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadSubscriptionsSuccess: (+ subscriptionsResponse: PaginatedSubscriptionListApi,+ payload?: {+ value: true+ }+ ) => {+ subscriptionsResponse: PaginatedSubscriptionListApi+ payload?: {+ value: true+ }+ }+ setCreatedByFilter: (uuid: string | null) => {+ uuid: string | null+ }+ setCurrentTab: (tab: SubscriptionsTab) => {+ tab: SubscriptionsTab+ }+ setPage: (page: number) => {+ page: number+ }+ setSearch: (search: string) => {+ search: string+ }+ setSubscriptionEnabled: (+ id: number,+ enabled: boolean+ ) => {+ enabled: boolean+ id: number+ }+ setSubscriptionEnabledFailure: () => {+ value: true+ }+ setSubscriptionEnabledSuccess: () => {+ value: true+ }+ setSubscriptionModalId: (id: number | 'new' | null) => {+ id: number | 'new' | null+ }+ setSubscriptionsSorting: (sorting: Sorting | null) => {+ sorting: Sorting | null+ }+ setTargetTypeFilter: (targetType: SubscriptionsListTargetType | null) => {+ targetType: SubscriptionsListTargetType | null+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface subscriptionsSceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ subscriptions: (subscriptionsResponse: PaginatedSubscriptionListApi | null) => SubscriptionApi[]+ subscriptionsLoading: (subscriptionsResponseLoading: boolean) => boolean+ pagination: (+ page: number,+ subscriptionsResponse: PaginatedSubscriptionListApi | null+ ) => {+ controlled: true+ currentPage: number+ entryCount: number+ onBackward: () => void+ onForward: () => void+ pageSize: number+ }+ }+}++export type subscriptionsSceneLogicType = MakeLogicType<+ subscriptionsSceneLogicValues,+ subscriptionsSceneLogicActions,+ Record<string, any>,+ subscriptionsSceneLogicMeta+>+export const subscriptionsSceneLogic = kea<subscriptionsSceneLogicType>([path(['scenes', 'subscriptions', 'subscriptionsSceneLogic']),connect(() => ({ values: [userLogic, ['user']] })),diff --git a/products/tasks/frontend/logics/slackTaskContextSceneLogic.ts b/products/tasks/frontend/logics/slackTaskContextSceneLogic.tsindex ea0500fef243..34313726b714 100644--- a/products/tasks/frontend/logics/slackTaskContextSceneLogic.ts+++ b/products/tasks/frontend/logics/slackTaskContextSceneLogic.ts@@ -1,4 +1,4 @@-import { actions, kea, path, reducers, selectors } from 'kea'+import { MakeLogicType, actions, kea, path, reducers, selectors } from 'kea'import { loaders } from 'kea-loaders'import { teamLogic } from 'scenes/teamLogic'@@ -6,13 +6,80 @@ import { teamLogic } from 'scenes/teamLogic'import { tasksSlackThreadContextRetrieve } from 'products/tasks/frontend/generated/api'import { SlackThreadContextResponseApi } from 'products/tasks/frontend/generated/api.schemas'-import type { slackTaskContextSceneLogicType } from './slackTaskContextSceneLogicType'-export type SlackTaskContextSubmissionError = {status: number | nulldetail: string}+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface slackTaskContextSceneLogicValues {+ canSubmit: boolean+ result: SlackThreadContextResponseApi | null+ resultLoading: boolean+ submissionError: SlackTaskContextSubmissionError | null+ url: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface slackTaskContextSceneLogicActions {+ clearResult: () => {+ value: true+ }+ clearResultFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ clearResultSuccess: (+ result: null,+ payload?: {+ value: true+ }+ ) => {+ result: null+ payload?: {+ value: true+ }+ }+ loadResult: () => any+ loadResultFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadResultSuccess: (+ result: SlackThreadContextResponseApi | null,+ payload?: any+ ) => {+ result: SlackThreadContextResponseApi | null+ payload?: any+ }+ setSubmissionError: (error: SlackTaskContextSubmissionError | null) => {+ error: SlackTaskContextSubmissionError | null+ }+ setUrl: (url: string) => {+ url: string+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface slackTaskContextSceneLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ canSubmit: (url: string, resultLoading: boolean) => boolean+ }+}++export type slackTaskContextSceneLogicType = MakeLogicType<+ slackTaskContextSceneLogicValues,+ slackTaskContextSceneLogicActions,+ Record<string, any>,+ slackTaskContextSceneLogicMeta+>+export const slackTaskContextSceneLogic = kea<slackTaskContextSceneLogicType>([path(['products', 'tasks', 'frontend', 'logics', 'slackTaskContextSceneLogic']),@@ -77,6 +144,9 @@ export const slackTaskContextSceneLogic = kea<slackTaskContextSceneLogicType>([})),selectors({- canSubmit: [(s) => [s.url, s.resultLoading], (url, loading): boolean => url.trim().length > 0 && !loading],+ canSubmit: [+ (s) => [s.url, s.resultLoading],+ (url: string, loading: boolean): boolean => url.trim().length > 0 && !loading,+ ],}),])