import { CredentialType } from '@bubblelab/shared-schemas';
import { ServiceBubble } from '../../../types/service-bubble-class.js';
import type { BubbleContext } from '../../../types/bubble.js';
import { type PosthogParamsInput, type PosthogResult } from './posthog.schema.js';
/**
 * PosthogBubble - Integration with PostHog product analytics
 *
 * Provides read operations for retrieving analytics data from PostHog:
 * - List events with filtering by event type, person, and date range
 * - Execute HogQL queries for custom analytics
 * - Look up person profiles and properties
 * - Retrieve saved insight results
 *
 * @example
 * ```typescript
 * // List recent pageview events
 * const result = await new PosthogBubble({
 *   operation: 'list_events',
 *   project_id: '12345',
 *   event: '$pageview',
 *   limit: 50,
 * }).action();
 *
 * // Execute a HogQL query
 * const queryResult = await new PosthogBubble({
 *   operation: 'query',
 *   project_id: '12345',
 *   query: 'SELECT event, count() FROM events GROUP BY event ORDER BY count() DESC LIMIT 10',
 * }).action();
 *
 * // Look up a person by distinct ID
 * const person = await new PosthogBubble({
 *   operation: 'get_person',
 *   project_id: '12345',
 *   distinct_id: 'user_123',
 * }).action();
 * ```
 */
export declare class PosthogBubble<T extends PosthogParamsInput = PosthogParamsInput> extends ServiceBubble<T, Extract<PosthogResult, {
    operation: T['operation'];
}>> {
    static readonly service = "posthog";
    static readonly authType: "apikey";
    static readonly bubbleName: "posthog";
    static readonly type: "service";
    static readonly schema: import("zod").ZodDiscriminatedUnion<"operation", [import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"list_projects">;
        host: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
        limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "list_projects";
        limit: number;
        host: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "list_projects";
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        limit?: number | undefined;
        host?: string | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"list_events">;
        project_id: import("zod").ZodString;
        host: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
        event: import("zod").ZodOptional<import("zod").ZodString>;
        person_id: import("zod").ZodOptional<import("zod").ZodString>;
        distinct_id: import("zod").ZodOptional<import("zod").ZodString>;
        after: import("zod").ZodOptional<import("zod").ZodString>;
        before: import("zod").ZodOptional<import("zod").ZodString>;
        properties: import("zod").ZodOptional<import("zod").ZodString>;
        limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "list_events";
        limit: number;
        project_id: string;
        host: string;
        properties?: string | undefined;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        event?: string | undefined;
        person_id?: string | undefined;
        after?: string | undefined;
        before?: string | undefined;
        distinct_id?: string | undefined;
    }, {
        operation: "list_events";
        project_id: string;
        properties?: string | undefined;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        limit?: number | undefined;
        event?: string | undefined;
        person_id?: string | undefined;
        after?: string | undefined;
        before?: string | undefined;
        distinct_id?: string | undefined;
        host?: string | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"query">;
        project_id: import("zod").ZodString;
        host: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
        query: import("zod").ZodString;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        query: string;
        operation: "query";
        project_id: string;
        host: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        query: string;
        operation: "query";
        project_id: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        host?: string | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_person">;
        project_id: import("zod").ZodString;
        host: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
        distinct_id: import("zod").ZodOptional<import("zod").ZodString>;
        search: import("zod").ZodOptional<import("zod").ZodString>;
        limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "get_person";
        limit: number;
        project_id: string;
        host: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        search?: string | undefined;
        distinct_id?: string | undefined;
    }, {
        operation: "get_person";
        project_id: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        search?: string | undefined;
        limit?: number | undefined;
        distinct_id?: string | undefined;
        host?: string | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_insight">;
        project_id: import("zod").ZodString;
        host: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
        insight_id: import("zod").ZodNumber;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "get_insight";
        project_id: string;
        host: string;
        insight_id: number;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "get_insight";
        project_id: string;
        insight_id: number;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        host?: string | undefined;
    }>]>;
    static readonly resultSchema: import("zod").ZodDiscriminatedUnion<"operation", [import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"list_projects">;
        success: import("zod").ZodBoolean;
        projects: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
            id: import("zod").ZodNumber;
            uuid: import("zod").ZodOptional<import("zod").ZodString>;
            name: import("zod").ZodString;
            organization: import("zod").ZodOptional<import("zod").ZodString>;
            created_at: import("zod").ZodOptional<import("zod").ZodString>;
            timezone: import("zod").ZodOptional<import("zod").ZodString>;
            is_demo: import("zod").ZodOptional<import("zod").ZodBoolean>;
        }, "strip", import("zod").ZodTypeAny, {
            name: string;
            id: number;
            uuid?: string | undefined;
            created_at?: string | undefined;
            organization?: string | undefined;
            timezone?: string | undefined;
            is_demo?: boolean | undefined;
        }, {
            name: string;
            id: number;
            uuid?: string | undefined;
            created_at?: string | undefined;
            organization?: string | undefined;
            timezone?: string | undefined;
            is_demo?: boolean | undefined;
        }>, "many">>;
        next: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        error: string;
        success: boolean;
        operation: "list_projects";
        projects?: {
            name: string;
            id: number;
            uuid?: string | undefined;
            created_at?: string | undefined;
            organization?: string | undefined;
            timezone?: string | undefined;
            is_demo?: boolean | undefined;
        }[] | undefined;
        next?: string | null | undefined;
    }, {
        error: string;
        success: boolean;
        operation: "list_projects";
        projects?: {
            name: string;
            id: number;
            uuid?: string | undefined;
            created_at?: string | undefined;
            organization?: string | undefined;
            timezone?: string | undefined;
            is_demo?: boolean | undefined;
        }[] | undefined;
        next?: string | null | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"list_events">;
        success: import("zod").ZodBoolean;
        events: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
            id: import("zod").ZodOptional<import("zod").ZodString>;
            uuid: import("zod").ZodOptional<import("zod").ZodString>;
            event: import("zod").ZodString;
            distinct_id: import("zod").ZodString;
            properties: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
            timestamp: import("zod").ZodOptional<import("zod").ZodString>;
            created_at: import("zod").ZodOptional<import("zod").ZodString>;
            elements: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnknown, "many">>;
            elements_chain: import("zod").ZodOptional<import("zod").ZodString>;
        }, "strip", import("zod").ZodTypeAny, {
            event: string;
            distinct_id: string;
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            id?: string | undefined;
            elements?: unknown[] | undefined;
            timestamp?: string | undefined;
            created_at?: string | undefined;
            elements_chain?: string | undefined;
        }, {
            event: string;
            distinct_id: string;
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            id?: string | undefined;
            elements?: unknown[] | undefined;
            timestamp?: string | undefined;
            created_at?: string | undefined;
            elements_chain?: string | undefined;
        }>, "many">>;
        next: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        error: string;
        success: boolean;
        operation: "list_events";
        events?: {
            event: string;
            distinct_id: string;
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            id?: string | undefined;
            elements?: unknown[] | undefined;
            timestamp?: string | undefined;
            created_at?: string | undefined;
            elements_chain?: string | undefined;
        }[] | undefined;
        next?: string | null | undefined;
    }, {
        error: string;
        success: boolean;
        operation: "list_events";
        events?: {
            event: string;
            distinct_id: string;
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            id?: string | undefined;
            elements?: unknown[] | undefined;
            timestamp?: string | undefined;
            created_at?: string | undefined;
            elements_chain?: string | undefined;
        }[] | undefined;
        next?: string | null | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"query">;
        success: import("zod").ZodBoolean;
        columns: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
        results: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodUnknown, "many">, "many">>;
        types: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>, "many">>;
        hasMore: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        error: string;
        success: boolean;
        operation: "query";
        types?: (string | string[])[] | undefined;
        hasMore?: boolean | null | undefined;
        results?: unknown[][] | undefined;
        columns?: string[] | undefined;
    }, {
        error: string;
        success: boolean;
        operation: "query";
        types?: (string | string[])[] | undefined;
        hasMore?: boolean | null | undefined;
        results?: unknown[][] | undefined;
        columns?: string[] | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_person">;
        success: import("zod").ZodBoolean;
        persons: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
            id: import("zod").ZodString;
            uuid: import("zod").ZodOptional<import("zod").ZodString>;
            distinct_ids: import("zod").ZodArray<import("zod").ZodString, "many">;
            properties: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
            created_at: import("zod").ZodOptional<import("zod").ZodString>;
        }, "strip", import("zod").ZodTypeAny, {
            id: string;
            distinct_ids: string[];
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            created_at?: string | undefined;
        }, {
            id: string;
            distinct_ids: string[];
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            created_at?: string | undefined;
        }>, "many">>;
        next: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        error: string;
        success: boolean;
        operation: "get_person";
        next?: string | null | undefined;
        persons?: {
            id: string;
            distinct_ids: string[];
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            created_at?: string | undefined;
        }[] | undefined;
    }, {
        error: string;
        success: boolean;
        operation: "get_person";
        next?: string | null | undefined;
        persons?: {
            id: string;
            distinct_ids: string[];
            properties?: Record<string, unknown> | undefined;
            uuid?: string | undefined;
            created_at?: string | undefined;
        }[] | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_insight">;
        success: import("zod").ZodBoolean;
        insight: import("zod").ZodOptional<import("zod").ZodObject<{
            id: import("zod").ZodNumber;
            short_id: import("zod").ZodOptional<import("zod").ZodString>;
            name: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
            description: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
            result: import("zod").ZodOptional<import("zod").ZodUnknown>;
            filters: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
            created_at: import("zod").ZodOptional<import("zod").ZodString>;
            last_refresh: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
            last_modified_at: import("zod").ZodOptional<import("zod").ZodString>;
        }, "strip", import("zod").ZodTypeAny, {
            id: number;
            description?: string | null | undefined;
            name?: string | null | undefined;
            result?: unknown;
            created_at?: string | undefined;
            filters?: Record<string, unknown> | undefined;
            short_id?: string | undefined;
            last_refresh?: string | null | undefined;
            last_modified_at?: string | undefined;
        }, {
            id: number;
            description?: string | null | undefined;
            name?: string | null | undefined;
            result?: unknown;
            created_at?: string | undefined;
            filters?: Record<string, unknown> | undefined;
            short_id?: string | undefined;
            last_refresh?: string | null | undefined;
            last_modified_at?: string | undefined;
        }>>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        error: string;
        success: boolean;
        operation: "get_insight";
        insight?: {
            id: number;
            description?: string | null | undefined;
            name?: string | null | undefined;
            result?: unknown;
            created_at?: string | undefined;
            filters?: Record<string, unknown> | undefined;
            short_id?: string | undefined;
            last_refresh?: string | null | undefined;
            last_modified_at?: string | undefined;
        } | undefined;
    }, {
        error: string;
        success: boolean;
        operation: "get_insight";
        insight?: {
            id: number;
            description?: string | null | undefined;
            name?: string | null | undefined;
            result?: unknown;
            created_at?: string | undefined;
            filters?: Record<string, unknown> | undefined;
            short_id?: string | undefined;
            last_refresh?: string | null | undefined;
            last_modified_at?: string | undefined;
        } | undefined;
    }>]>;
    static readonly shortDescription = "PostHog product analytics for events, persons, and insights";
    static readonly longDescription = "\n    PostHog is an open-source product analytics platform.\n    This bubble provides read operations for retrieving analytics data:\n    - List and filter captured events (pageviews, custom events, etc.)\n    - Execute HogQL queries for advanced custom analytics\n    - Look up person profiles and their properties\n    - Retrieve saved insight results\n\n    Authentication:\n    - Uses a Personal API Key via Bearer token\n    - Supports US Cloud, EU Cloud, and self-hosted instances via configurable host URL\n\n    Use Cases:\n    - Pull analytics data into automated workflows\n    - Query event data with HogQL for custom reports\n    - Look up user profiles and their properties\n    - Retrieve computed insight results for dashboards\n  ";
    static readonly alias = "posthog-analytics";
    constructor(params?: T, context?: BubbleContext);
    /**
     * Choose the appropriate credential for PostHog API
     */
    protected chooseCredential(): string | undefined;
    /**
     * Test if the credential is valid by listing projects
     */
    testCredential(): Promise<boolean>;
    /**
     * Perform the PostHog operation
     */
    protected performAction(context?: BubbleContext): Promise<Extract<PosthogResult, {
        operation: T['operation'];
    }>>;
    /**
     * Make an authenticated GET request to the PostHog API
     */
    private makePosthogGetRequest;
    /**
     * Make an authenticated POST request to the PostHog API
     */
    private makePosthogPostRequest;
    /**
     * List all projects accessible with the API key
     */
    private listProjects;
    /**
     * List events with optional filtering
     */
    private listEvents;
    /**
     * Execute a HogQL query
     */
    private executeQuery;
    /**
     * Get person profiles
     */
    private getPerson;
    /**
     * Get a saved insight's results
     */
    private getInsight;
}
//# sourceMappingURL=posthog.d.ts.map