import type { OAuthScope } from '../utils/config/cli-options'; import { TokenType, TokenValidity } from './definitions'; import type { TokenFileContent, TokenContext, GetBearerTokenTypes } from './types'; export { TokenType } from './definitions'; export type { TokenContext, TokenFileContent, GetBearerTokenTypes, } from './types'; export declare const SSO_CLIENT_ID = "dt0s08.dt-app-local"; export declare const defaultGetBearerOptions: (cwd: string) => { openAuthUrl: boolean; tokenFilePath: string; }; /** * Wrapper function that will validate and return token without returning token validity * @internal */ export declare function getBearerToken(tokenType: TokenType): Promise; /** * This function handles the whole authentication process. Depending on the tokenType passed you either get the full powered TOOLKIT_TOKEN or the APP_TOKEN, which only has the scopes specified for the app. * Priority of which token is used: DT_APP_PLATFORM_TOKEN --> cached token (if still valid) --> refresh token --> sso process. * If DT_APP_CLIENT_ID and DT_APP_CLIENT_SECRET are set it is executing the automation process instead of the sso process. */ export declare function getAutomationOrAccessToken(bearerTokenContext: TokenContext, tokenValidity: TokenValidity): Promise; /** Function that will process refresh of the access token save it to the file and return the token */ export declare function refreshToken(bearerTokenContext: TokenContext): Promise; /** Function that returns all needed data for calling the getToken and validateToken functions */ export declare function createTokenContext(options: GetBearerTokenTypes, appScopesInput?: readonly OAuthScope[]): Promise; /** Gets the token via the refresh_token process and adapts the tokenJson accordingly */ export declare function processRefreshOauth2Token(tokenJson: TokenFileContent, tokenType: TokenType, environmentUrl: string, oauthUrl: string, clientId: string): Promise<[TokenFileContent, string]>; /** Adds all the scopes at the beginning of the array if they are not already part of the array. */ export declare function enrichAppScopes(scopes: readonly OAuthScope[], scopesToAdd: readonly OAuthScope[]): OAuthScope[];