registry-auth-token
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -5,2 +5,8 @@ # Change Log | ||
## [5.0.3] - 2024-11-27 | ||
### Changes | ||
- Make all arguments optional in type definitions (Mattias Leino) | ||
## [5.0.2] - 2023-03-05 | ||
@@ -7,0 +13,0 @@ |
declare namespace registryAuthToken { | ||
/** | ||
* The options for passing into `registry-auth-token` | ||
*/ | ||
interface AuthOptions { | ||
/** | ||
* The options for passing into `registry-auth-token` | ||
* Whether or not url's path parts are recursively trimmed from the registry | ||
* url when searching for tokens | ||
*/ | ||
interface AuthOptions { | ||
/** | ||
* Whether or not url's path parts are recursively trimmed from the registry | ||
* url when searching for tokens | ||
*/ | ||
recursive?: boolean | undefined; | ||
/** | ||
* An npmrc configuration object used when searching for tokens. If no object is provided, | ||
* the `.npmrc` file at the base of the project is used. | ||
*/ | ||
npmrc?: { | ||
/** | ||
* A registry url used for matching | ||
*/ | ||
registry?: string | undefined; | ||
/** | ||
* Registry url's with token information | ||
*/ | ||
[registryUrls: string]: string | undefined; | ||
} | undefined; | ||
} | ||
recursive?: boolean | undefined; | ||
/** | ||
* The generated authentication information | ||
* An npmrc configuration object used when searching for tokens. If no object is provided, | ||
* the `.npmrc` file at the base of the project is used. | ||
*/ | ||
interface NpmCredentials { | ||
/** | ||
* The token representing the users credentials | ||
*/ | ||
token: string; | ||
/** | ||
* The type of token | ||
*/ | ||
type: 'Basic' | 'Bearer'; | ||
/** | ||
* The username used in `Basic` | ||
*/ | ||
username?: string | undefined; | ||
/** | ||
* The password used in `Basic` | ||
*/ | ||
password?: string | undefined; | ||
} | ||
npmrc?: | ||
| { | ||
/** | ||
* A registry url used for matching | ||
*/ | ||
registry?: string | undefined; | ||
/** | ||
* Registry url's with token information | ||
*/ | ||
[registryUrls: string]: string | undefined; | ||
} | ||
| undefined; | ||
} | ||
/** | ||
* The generated authentication information | ||
*/ | ||
interface NpmCredentials { | ||
/** | ||
* The token representing the users credentials | ||
*/ | ||
token: string; | ||
/** | ||
* The type of token | ||
*/ | ||
type: 'Basic' | 'Bearer'; | ||
/** | ||
* The username used in `Basic` | ||
*/ | ||
username?: string | undefined; | ||
/** | ||
* The password used in `Basic` | ||
*/ | ||
password?: string | undefined; | ||
} | ||
} | ||
@@ -52,4 +54,5 @@ | ||
* | ||
* @param registryUrl - Either the registry url used for matching, or a configuration | ||
* object describing the contents of the .npmrc file | ||
* @param [registryUrl] - Either the registry url used for matching, or a configuration | ||
* object describing the contents of the .npmrc file. Uses default `registry` set in | ||
* `.npmrc` when argument is omitted. | ||
* @param [options] - a configuration object describing the | ||
@@ -61,6 +64,6 @@ * contents of the .npmrc file. If an `npmrc` config object was passed in as the | ||
declare function registryAuthToken( | ||
registryUrl: string | registryAuthToken.AuthOptions, | ||
options?: registryAuthToken.AuthOptions, | ||
registryUrl?: string | registryAuthToken.AuthOptions, | ||
options?: registryAuthToken.AuthOptions | ||
): registryAuthToken.NpmCredentials | undefined; | ||
export = registryAuthToken; |
{ | ||
"name": "registry-auth-token", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Get the auth token set for an npm registry (if any)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import { AuthOptions } from './'; | ||
/** | ||
* Get the registry URL for a given npm scope | ||
* Get the registry URL for a given npm scope. Falls back to global registry if scope is not defined. | ||
* | ||
* @param scope - npm scope to resolve URL for | ||
* @param [scope] - npm scope to resolve URL for. Falls back to global registry if not defined. | ||
* @param [npmrc] - Optional object of npmrc properties to use instead of looking up the users local npmrc file | ||
* @returns The resolved registry URL, falling back to the global npm registry | ||
*/ | ||
declare function registryUrl(scope: string, npmrc?: Pick<AuthOptions, 'npmrc'>): string; | ||
declare function registryUrl( | ||
scope?: string, | ||
npmrc?: Pick<AuthOptions, 'npmrc'> | ||
): string; | ||
export = registryUrl; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15216
199