import { type PackageDotJson } from './package-json.js'; import { type PackageManager } from './package-manager.js'; import type { InstallerOptions } from './types.js'; import { type Integration } from '../lib/constants.js'; /** * Redact sensitive info (API keys, client secrets) from a string. */ export declare function redactSensitiveInfo(str: string): string; export interface CliSetupConfig { filename: string; name: string; gitignore: boolean; likelyAlreadyHasAuthToken(contents: string): boolean; tokenContent(authToken: string): string; likelyAlreadyHasOrgAndProject(contents: string): boolean; orgAndProjContent(org: string, project: string): string; likelyAlreadyHasUrl?(contents: string): boolean; urlContent?(url: string): string; } export interface CliSetupConfigContent { authToken: string; org?: string; project?: string; url?: string; } export declare function abort(message?: string, status?: number): Promise; export declare function abortIfCancelled(input: T | Promise, integration?: Integration): Promise>; export declare function printWelcome(options: { wizardName: string; message?: string; }): void; export declare function confirmContinueIfNoOrDirtyGitRepo(options: Pick): Promise; export declare function isInGitRepo(): boolean; export declare function getUncommittedOrUntrackedFiles(): string[]; export declare function askForItemSelection(items: string[], message: string): Promise<{ value: string; index: number; }>; export declare function confirmContinueIfPackageVersionNotSupported({ packageId, packageName, packageVersion, acceptableVersions, note, }: { packageId: string; packageName: string; packageVersion: string; acceptableVersions: string; note?: string; }): Promise; export declare function isReact19Installed({ installDir }: Pick): Promise; /** * Installs or updates a package with the user's package manager. * * IMPORTANT: This function modifies the `package.json`! Be sure to re-read * it if you make additional modifications to it after calling this function! */ export declare function installPackage({ packageName, alreadyInstalled, askBeforeUpdating, packageNameDisplayLabel, packageManager, forceInstall, integration, installDir, }: { /** The string that is passed to the package manager CLI as identifier to install (e.g. `@workos-inc/authkit-nextjs`, or `@workos-inc/authkit-nextjs@^2.0.0`) */ packageName: string; alreadyInstalled: boolean; askBeforeUpdating?: boolean; /** Overrides what is shown in the installation logs in place of the `packageName` option. Useful if the `packageName` is ugly */ packageNameDisplayLabel?: string; packageManager?: PackageManager; /** Add force install flag to command to skip install precondition fails */ forceInstall?: boolean; /** The integration that is being used */ integration?: string; /** The directory to install the package in */ installDir: string; }): Promise<{ packageManager?: PackageManager; }>; /** * Checks if @param packageId is listed as a dependency in @param packageJson. * If not, it will ask users if they want to continue without the package. * * Use this function to check if e.g. a the framework of the SDK is installed * * @param packageJson the package.json object * @param packageId the npm name of the package * @param packageName a human readable name of the package */ export declare function ensurePackageIsInstalled(packageJson: PackageDotJson, packageId: string, packageName: string, options?: Pick): Promise; export declare function getPackageDotJson({ installDir }: Pick): Promise; export declare function updatePackageDotJson(packageDotJson: PackageDotJson, { installDir }: Pick): Promise; export declare function getPackageManager(options: Pick & { ci?: boolean; }): Promise; export declare function isUsingTypeScript({ installDir }: Pick): boolean; /** * Get WorkOS credentials (API Key and Client ID) from user or CLI options * @param requireApiKey - Whether API key is needed (false for client-only SDKs like React, Vanilla JS) */ export declare function getOrAskForWorkOSCredentials(_options: Pick, requireApiKey?: boolean): Promise<{ apiKey: string; clientId: string; }>; /** * Fetch project data using a personal API key (for CI mode) */