mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 02:01:27 +00:00
Allow getApiClient to accept GitHubApiDetails
This commit is contained in:
4
lib/entry-points.js
generated
4
lib/entry-points.js
generated
@@ -170758,8 +170758,8 @@ function getApiDetails(env = getEnv()) {
|
||||
...getCurrentInstance(env)
|
||||
};
|
||||
}
|
||||
function getApiClient(env = getEnv()) {
|
||||
return createApiClientWithDetails(getApiDetails(env));
|
||||
function getApiClient(env = getEnv(), apiDetails) {
|
||||
return createApiClientWithDetails(apiDetails ?? getApiDetails(env));
|
||||
}
|
||||
function getApiClientWithExternalAuth(apiDetails, proxy) {
|
||||
return createApiClientWithDetails(apiDetails, { allowExternal: true, proxy });
|
||||
|
||||
@@ -169,8 +169,22 @@ export function getApiDetails(env: ReadOnlyEnv = getEnv()): GitHubApiDetails {
|
||||
};
|
||||
}
|
||||
|
||||
export function getApiClient(env: ReadOnlyEnv = getEnv()) {
|
||||
return createApiClientWithDetails(getApiDetails(env));
|
||||
/**
|
||||
* Constructs an {@link ApiClient} using {@link apiDetails}.
|
||||
*
|
||||
* If {@link apiDetails} is not specified, then the GitHub instance URLs and auth token
|
||||
* are taken from {@link env}.
|
||||
*
|
||||
* If {@link env} is not specified, then the process environment is used.
|
||||
*
|
||||
* @param env The environment to obtain the GitHub instance URLs from.
|
||||
* @param apiDetails The {@link GitHubApiDetails} to construct the {@link ApiClient} for.
|
||||
*/
|
||||
export function getApiClient(
|
||||
env: ReadOnlyEnv = getEnv(),
|
||||
apiDetails?: GitHubApiDetails,
|
||||
) {
|
||||
return createApiClientWithDetails(apiDetails ?? getApiDetails(env));
|
||||
}
|
||||
|
||||
export function getApiClientWithExternalAuth(
|
||||
|
||||
Reference in New Issue
Block a user