import { A as AccessType, H as HighLevelScopes } from './type-utils-BG2wp-D1.cjs';
import { H as HighLevelClient, D as DefaultOauthClient, A as AuthHeaders, a as HighLevelClientConfig, b as HighLevelOauthConfig, c as HighLevelClientWithOAuth } from './default-BzEMC57o.cjs';
import 'openapi-fetch';
import './types/blogs.cjs';
import './types/businesses.cjs';
import './types/calendars.cjs';
import './types/campaigns.cjs';
import './types/companies.cjs';
import './types/contacts.cjs';
import './types/conversations.cjs';
import './types/courses.cjs';
import './types/custom-menus.cjs';
import './types/email-isv.cjs';
import './types/emails.cjs';
import './types/forms.cjs';
import './types/funnels.cjs';
import './types/invoices.cjs';
import './types/links.cjs';
import './types/locations.cjs';
import './types/medias.cjs';
import './types/opportunities.cjs';
import './types/payments.cjs';
import './types/products.cjs';
import './types/saas-api.cjs';
import './types/snapshots.cjs';
import './types/social-media-posting.cjs';
import './types/surveys.cjs';
import './types/users.cjs';
import './types/workflows.cjs';
import './types/oauth.cjs';
import 'openapi-fetch/src/index.js';

type PrivateIntegrationConfig<T extends AccessType> = {
    /**
     * The access type for the integration. Decides what scopes are available.
     */
    accessType: T;
    /**
     * The private integration token.
     *
     * @see https://help.leadconnectorhq.com/support/solutions/articles/155000002774-private-integrations-everything-you-need-to-know
     */
    privateToken: string;
    /**
     * The scopes for the integration.
     *
     * @example
     * ```ts
     * // use all available scopes
     * const scopes = new ScopesBuilder().all().join(' ')
     * ```
     */
    scopes?: HighLevelScopes<T>;
};
/**
 * HighLevel API client using private integration token for authentication.
 * To create an instance, use the `createHighLevelClient` function from the main client.
 *
 * @see {@link createHighLevelClient}
 *
 * @example
 * ```ts
 * const client = createHighLevelClient({}, 'integration', {
 *   privateToken: 'your-token',
 *   accessType: 'Sub-Account',
 *   scopes: ['contacts.readonly']
 * })
 * ```
 * @internal
 */
declare class HighLevelIntegrationClient<T extends AccessType> extends HighLevelClient<T, DefaultOauthClient, AuthHeaders> {
    /**
     * The private token for the integration
     *
     * @see https://help.leadconnectorhq.com/support/solutions/articles/155000002774-private-integrations-everything-you-need-to-know
     */
    privateToken: string;
    /**
     * The scopes for the integration.
     *
     * _NOTE_: in a private integration, we never send off the scopes like we do in Oauth2, but leaving this here for potential future use.
     *
     * @example
     * ```ts
     * const scopes = new ScopesBuilder().all().build()
     * ```
     */
    scopes?: HighLevelScopes<T>;
    constructor(
    /**
     * The integration config uses your private token and scopes to add the appropriate headers to the client.
     */
    integrationConfig: PrivateIntegrationConfig<T>, 
    /**
     * The `openapi-fetch` client config.
     *
     * @default { baseUrl: `https://services.leadconnectorhq.com` }
     *
     * @see https://openapi-ts.dev/openapi-fetch
     */
    clientConfig?: HighLevelClientConfig);
}

type AuthConfig<T extends AccessType, TType extends 'oauth' | 'integration'> = TType extends 'oauth' ? HighLevelOauthConfig<T> : PrivateIntegrationConfig<T>;
type AuthClient<T extends AccessType, TType extends 'oauth' | 'integration' = never> = TType extends never ? HighLevelClient<T, DefaultOauthClient, undefined> : TType extends 'oauth' ? HighLevelClientWithOAuth<T> : HighLevelIntegrationClient<T>;
/**
 * Creates a HighLevel client with typed endpoints.
 *
 * @param clientConfig - the client configuration that will be used on each request.
 * @param authType - the type of authentication to use.
 * @param authConfig - the authentication configuration for either OAuth or Private Integration.
 *
 * @example
 * ```ts
 * // basic client
 * const client = createHighLevelClient()
 * const contacts = client.contacts.GET('/contacts/', {
 *   params: {
 *     header: {
 *       Authorization: 'Bearer 1234567890',
 *       Version: '2021-07-28',
 *     },
 *     query: {
 *       locationId: '1234567890',
 *       query: 'John Doe',
 *     },
 *   },
 * })
 * ```
 */
declare function createHighLevelClient<T extends AccessType>(): HighLevelClient<T, DefaultOauthClient, undefined>;
/**
 * Creates a default HighLevel client with typed endpoints.
 *
 * @example
 * ```ts
 * // pass in client config
 * const client = createHighLevelClient({ baseUrl: 'https://custom-url.com' })
 * ```
 */
declare function createHighLevelClient<T extends AccessType>(clientConfig?: HighLevelClientConfig): HighLevelClient<T, DefaultOauthClient, undefined>;
/**
 * Creates a HighLevel client with support for OAuth.
 *
 * @example
 * ```ts
 * // client with OAuth
 * const client = createHighLevelClient({}, 'oauth', {
 *	clientId: 'your-client-id',
 *	clientSecret: 'your-client-secret',
 *	redirectUri: 'http://localhost:3000/callback',
 *	accessType: 'Sub-Account',
 *	scopes: ['contacts.readonly'],
 *	storageFunction: async (tokenData) => {
 *		await db.set('tokenData', tokenData)
 *		return tokenData
 *	}
 * })
 * const authUrl = client.oauth.getAuthorizationUrl()
 * // redirect to authUrl, get the code from your callback route.
 * app.get('/auth/callback', async (c) => {
 * 	const code = c.req.query('code')
 * 		if (!code) {
 * 		throw new Error('No code found in callback')
 * 	}
 * 	const token = await client.oauth.getAccessToken(code)
 * 	const contacts = client.contacts.GET('/contacts/', {
 * 		params: {
 * 			query: {
 * 				locationId: '1234567890',
 * 				query: 'John Doe',
 * 			},
 * 			header: {
 * 				Authorization: `Bearer ${token}`,
 * 				Version: '2021-07-28',
 * 			},
 * 		},
 * 	})
 * return c.json(contacts)
 * })
 * ```
 */
declare function createHighLevelClient<T extends AccessType, TType extends 'oauth' | 'integration' = 'oauth'>(clientConfig?: HighLevelClientConfig, authType?: TType, authConfig?: AuthConfig<T, TType>): AuthClient<T, TType>;
/**
 * Creates a HighLevel client with support for Private Integration.
 *
 * @example
 * ```ts
 * const client = createHighLevelClient({}, 'integration', {
 *   privateToken: 'your-token',
 *   accessType: 'Agency',
 *   scopes: ['saas/company.write']
 * })
 * ```
 */
declare function createHighLevelClient<T extends AccessType, TType extends 'oauth' | 'integration' = 'integration'>(clientConfig?: HighLevelClientConfig, authType?: TType, authConfig?: AuthConfig<T, TType>): AuthClient<T, TType>;

export { createHighLevelClient };
