basant307/AI_Governance_Project
048
1declare namespace registryAuthToken {2 /**3 * The options for passing into `registry-auth-token`4 */5 interface AuthOptions {6 /**7 * Whether or not url's path parts are recursively trimmed from the registry8 * url when searching for tokens9 */10 recursive?: boolean | undefined;11 /**12 * An npmrc configuration object used when searching for tokens. If no object is provided,13 * the `.npmrc` file at the base of the project is used.14 */15 npmrc?:16 | {17 /**18 * A registry url used for matching19 */20 registry?: string | undefined;21 /**22 * Registry url's with token information23 */24 [registryUrls: string]: string | undefined;25 }26 | undefined;27 }28 /**29 * The generated authentication information30 */31 interface NpmCredentials {32 /**33 * The token representing the users credentials34 */35 token: string;36 /**37 * The type of token38 */39 type: 'Basic' | 'Bearer';40 /**41 * The username used in `Basic`42 */43 username?: string | undefined;44 /**45 * The password used in `Basic`46 */47 password?: string | undefined;48 }49}50 51/**52 * Retrieves the auth token to use for a given registry URL53 *54 * @param [registryUrl] - Either the registry url used for matching, or a configuration55 * object describing the contents of the .npmrc file. Uses default `registry` set in56 * `.npmrc` when argument is omitted.57 * @param [options] - a configuration object describing the58 * contents of the .npmrc file. If an `npmrc` config object was passed in as the59 * first parameter, this parameter is ignored.60 * @returns The `NpmCredentials` object or undefined if no match found.61 */62declare function registryAuthToken(63 registryUrl?: string | registryAuthToken.AuthOptions,64 options?: registryAuthToken.AuthOptions65): registryAuthToken.NpmCredentials | undefined;66 67export = registryAuthToken;68 