/opt/canhelp/node_modules/google-auth-library/build/src/auth
NameSizeModeActions
authclient.d.ts107640644editdlrm
authclient.js112470644editdlrm
awsclient.d.ts53150644editdlrm
awsclient.js75560644editdlrm
awsrequestsigner.d.ts16260644editdlrm
awsrequestsigner.js94420644editdlrm
baseexternalclient.d.ts130200644editdlrm
baseexternalclient.js208570644editdlrm
certificatesubjecttokensupplier.d.ts22020644editdlrm
certificatesubjecttokensupplier.js106190644editdlrm
computeclient.d.ts13590644editdlrm
computeclient.js44970644editdlrm
credentials.d.ts23590644editdlrm
credentials.js7040644editdlrm
defaultawssecuritycredentialssupplier.d.ts37950644editdlrm
defaultawssecuritycredentialssupplier.js93300644editdlrm
downscopedclient.d.ts66930644editdlrm
downscopedclient.js123530644editdlrm
envDetect.d.ts3630644editdlrm
envDetect.js28310644editdlrm
executable-response.d.ts44890644editdlrm
executable-response.js75190644editdlrm
externalAccountAuthorizedUserClient.d.ts31730644editdlrm
externalAccountAuthorizedUserClient.js100050644editdlrm
externalclient.d.ts15280644editdlrm
externalclient.js30480644editdlrm
filesubjecttokensupplier.d.ts16080644editdlrm
filesubjecttokensupplier.js35150644editdlrm
googleauth.d.ts235740644editdlrm
googleauth.js363740644editdlrm
iam.d.ts6230644editdlrm
iam.js13730644editdlrm
identitypoolclient.d.ts56260644editdlrm
identitypoolclient.js67750644editdlrm
idtokenclient.d.ts9380644editdlrm
idtokenclient.js21060644editdlrm
impersonated.d.ts56870644editdlrm
impersonated.js86540644editdlrm
jwtaccess.d.ts23360644editdlrm
jwtaccess.js72130644editdlrm
jwtclient.d.ts51220644editdlrm
jwtclient.js112560644editdlrm
loginticket.d.ts53670644editdlrm
loginticket.js17950644editdlrm
oauth2client.d.ts253260644editdlrm
oauth2client.js336620644editdlrm
oauth2common.d.ts40940644editdlrm
oauth2common.js80800644editdlrm
passthrough.d.ts10970644editdlrm
passthrough.js18420644editdlrm
pluggable-auth-client.d.ts54850644editdlrm
pluggable-auth-client.js100020644editdlrm
pluggable-auth-handler.d.ts21090644editdlrm
pluggable-auth-handler.js72600644editdlrm
refreshclient.d.ts34360644editdlrm
refreshclient.js66500644editdlrm
stscredentials.d.ts52610644editdlrm
stscredentials.js47380644editdlrm
urlsubjecttokensupplier.d.ts21860644editdlrm
urlsubjecttokensupplier.js28590644editdlrm
Edit: /opt/canhelp/node_modules/google-auth-library/build/src/auth/authclient.d.ts (10764B)
import { EventEmitter } from 'events'; import { Gaxios, GaxiosOptions, GaxiosPromise, GaxiosResponse } from 'gaxios'; import { Credentials } from './credentials'; import { OriginalAndCamel } from '../util'; /** * An interface for enforcing `fetch`-type compliance. * * @remarks * * This provides type guarantees during build-time, ensuring the `fetch` method is 1:1 * compatible with the `Gaxios#fetch` API. */ interface GaxiosFetchCompliance { fetch: typeof fetch | Gaxios['fetch']; } /** * Easy access to symbol-indexed strings on config objects. */ export type SymbolIndexString = { [key: symbol]: string | undefined; }; /** * Base auth configurations (e.g. from JWT or `.json` files) with conventional * camelCased options. * * @privateRemarks * * This interface is purposely not exported so that it can be removed once * {@link https://github.com/microsoft/TypeScript/issues/50715} has been * resolved. Then, we can use {@link OriginalAndCamel} to shrink this interface. * * Tracking: {@link https://github.com/googleapis/google-auth-library-nodejs/issues/1686} */ interface AuthJSONOptions { /** * The project ID corresponding to the current credentials if available. */ project_id: string | null; /** * An alias for {@link AuthJSONOptions.project_id `project_id`}. */ projectId: AuthJSONOptions['project_id']; /** * The quota project ID. The quota project can be used by client libraries for the billing purpose. * See {@link https://cloud.google.com/docs/quota Working with quotas} */ quota_project_id: string; /** * An alias for {@link AuthJSONOptions.quota_project_id `quota_project_id`}. */ quotaProjectId: AuthJSONOptions['quota_project_id']; /** * The default service domain for a given Cloud universe. * * @example * 'googleapis.com' */ universe_domain: string; /** * An alias for {@link AuthJSONOptions.universe_domain `universe_domain`}. */ universeDomain: AuthJSONOptions['universe_domain']; } /** * Base `AuthClient` configuration. * * The camelCased options are aliases of the snake_cased options, supporting both * JSON API and JS conventions. */ export interface AuthClientOptions extends Partial> { /** * An API key to use, optional. */ apiKey?: string; credentials?: Credentials; /** * The {@link Gaxios `Gaxios`} instance used for making requests. * * @see {@link AuthClientOptions.useAuthRequestParameters} */ transporter?: Gaxios; /** * Provides default options to the transporter, such as {@link GaxiosOptions.agent `agent`} or * {@link GaxiosOptions.retryConfig `retryConfig`}. * * This option is ignored if {@link AuthClientOptions.transporter `gaxios`} has been provided */ transporterOptions?: GaxiosOptions; /** * The expiration threshold in milliseconds before forcing token refresh of * unexpired tokens. */ eagerRefreshThresholdMillis?: number; /** * Whether to attempt to refresh tokens on status 401/403 responses * even if an attempt is made to refresh the token preemptively based * on the expiry_date. */ forceRefreshOnFailure?: boolean; /** * Enables/disables the adding of the AuthClient's default interceptor. * * @see {@link AuthClientOptions.transporter} * * @remarks * * Disabling is useful for debugging and experimentation. * * @default true */ useAuthRequestParameters?: boolean; } /** * The default cloud universe * * @see {@link AuthJSONOptions.universe_domain} */ export declare const DEFAULT_UNIVERSE = "googleapis.com"; /** * The default {@link AuthClientOptions.eagerRefreshThresholdMillis} */ export declare const DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS: number; /** * Defines the root interface for all clients that generate credentials * for calling Google APIs. All clients should implement this interface. */ export interface CredentialsClient { projectId?: AuthClientOptions['projectId']; eagerRefreshThresholdMillis: NonNullable; forceRefreshOnFailure: NonNullable; /** * @return A promise that resolves with the current GCP access token * response. If the current credential is expired, a new one is retrieved. */ getAccessToken(): Promise; /** * The main authentication interface. It takes an optional url which when * present is the endpoint being accessed, and returns a Promise which * resolves with authorization header fields. * * The result has the form: * { authorization: 'Bearer ' } * @param url The URI being authorized. */ getRequestHeaders(url?: string | URL): Promise; /** * Provides an alternative Gaxios request implementation with auth credentials */ request(opts: GaxiosOptions): GaxiosPromise; /** * Sets the auth credentials. */ setCredentials(credentials: Credentials): void; /** * Subscribes a listener to the tokens event triggered when a token is * generated. * * @param event The tokens event to subscribe to. * @param listener The listener that triggers on event trigger. * @return The current client instance. */ on(event: 'tokens', listener: (tokens: Credentials) => void): this; } export declare interface AuthClient { on(event: 'tokens', listener: (tokens: Credentials) => void): this; } /** * The base of all Auth Clients. */ export declare abstract class AuthClient extends EventEmitter implements CredentialsClient, GaxiosFetchCompliance { apiKey?: string; projectId?: string | null; /** * The quota project ID. The quota project can be used by client libraries for the billing purpose. * See {@link https://cloud.google.com/docs/quota Working with quotas} */ quotaProjectId?: string; /** * The {@link Gaxios `Gaxios`} instance used for making requests. */ transporter: Gaxios; credentials: Credentials; eagerRefreshThresholdMillis: number; forceRefreshOnFailure: boolean; universeDomain: string; /** * Symbols that can be added to GaxiosOptions to specify the method name that is * making an RPC call, for logging purposes, as well as a string ID that can be * used to correlate calls and responses. */ static readonly RequestMethodNameSymbol: unique symbol; static readonly RequestLogIdSymbol: unique symbol; constructor(opts?: AuthClientOptions); /** * A {@link fetch `fetch`} compliant API for {@link AuthClient}. * * @see {@link AuthClient.request} for the classic method. * * @remarks * * This is useful as a drop-in replacement for `fetch` API usage. * * @example * * ```ts * const authClient = new AuthClient(); * const fetchWithAuthClient: typeof fetch = (...args) => authClient.fetch(...args); * await fetchWithAuthClient('https://example.com'); * ``` * * @param args `fetch` API or {@link Gaxios.fetch `Gaxios#fetch`} parameters * @returns the {@link GaxiosResponse} with Gaxios-added properties */ fetch(...args: Parameters): GaxiosPromise; /** * The public request API in which credentials may be added to the request. * * @see {@link AuthClient.fetch} for the modern method. * * @param options options for `gaxios` */ abstract request(options: GaxiosOptions): GaxiosPromise; /** * The main authentication interface. It takes an optional url which when * present is the endpoint being accessed, and returns a Promise which * resolves with authorization header fields. * * The result has the form: * ```ts * new Headers({'authorization': 'Bearer '}); * ``` * * @param url The URI being authorized. */ abstract getRequestHeaders(url?: string | URL): Promise; /** * @return A promise that resolves with the current GCP access token * response. If the current credential is expired, a new one is retrieved. */ abstract getAccessToken(): Promise<{ token?: string | null; res?: GaxiosResponse | null; }>; /** * Sets the auth credentials. */ setCredentials(credentials: Credentials): void; /** * Append additional headers, e.g., x-goog-user-project, shared across the * classes inheriting AuthClient. This method should be used by any method * that overrides getRequestMetadataAsync(), which is a shared helper for * setting request information in both gRPC and HTTP API calls. * * @param headers object to append additional headers to. */ protected addSharedMetadataHeaders(headers: Headers): Headers; /** * Adds the `x-goog-user-project` and `authorization` headers to the target Headers * object, if they exist on the source. * * @param target the headers to target * @param source the headers to source from * @returns the target headers */ protected addUserProjectAndAuthHeaders(target: T, source: Headers): T; static log: import("google-logging-utils").AdhocDebugLogFunction; static readonly DEFAULT_REQUEST_INTERCEPTOR: Parameters[0]; static readonly DEFAULT_RESPONSE_INTERCEPTOR: Parameters[0]; /** * Sets the method name that is making a Gaxios request, so that logging may tag * log lines with the operation. * @param config A Gaxios request config * @param methodName The method name making the call */ static setMethodName(config: GaxiosOptions, methodName: string): void; /** * Retry config for Auth-related requests. * * @remarks * * This is not a part of the default {@link AuthClient.transporter transporter/gaxios} * config as some downstream APIs would prefer if customers explicitly enable retries, * such as GCS. */ protected static get RETRY_CONFIG(): GaxiosOptions; } export type HeadersInit = ConstructorParameters[0]; export interface GetAccessTokenResponse { token?: string | null; res?: GaxiosResponse | null; } /** * @deprecated - use the Promise API instead */ export interface BodyResponseCallback { (err: Error | null, res?: GaxiosResponse | null): void; } export {};