give the same treatment to catalog-backend too
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -112,7 +112,9 @@ export function getAzureFileFetchUrl(url: string): string;
|
||||
export function getAzureRequestOptions(
|
||||
config: AzureIntegrationConfig,
|
||||
additionalHeaders?: Record<string, string>,
|
||||
): RequestInit;
|
||||
): {
|
||||
headers: Record<string, string>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export function getBitbucketDefaultBranch(
|
||||
@@ -135,7 +137,9 @@ export function getBitbucketFileFetchUrl(
|
||||
// @public
|
||||
export function getBitbucketRequestOptions(
|
||||
config: BitbucketIntegrationConfig,
|
||||
): RequestInit;
|
||||
): {
|
||||
headers: Record<string, string>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export function getGitHubFileFetchUrl(
|
||||
@@ -148,7 +152,9 @@ export function getGitHubFileFetchUrl(
|
||||
export function getGitHubRequestOptions(
|
||||
config: GitHubIntegrationConfig,
|
||||
credentials: GithubCredentials,
|
||||
): RequestInit;
|
||||
): {
|
||||
headers: Record<string, string>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export function getGitLabFileFetchUrl(
|
||||
@@ -157,9 +163,9 @@ export function getGitLabFileFetchUrl(
|
||||
): Promise<string>;
|
||||
|
||||
// @public
|
||||
export function getGitLabRequestOptions(
|
||||
config: GitLabIntegrationConfig,
|
||||
): RequestInit;
|
||||
export function getGitLabRequestOptions(config: GitLabIntegrationConfig): {
|
||||
headers: Record<string, string>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type GithubAppConfig = {
|
||||
|
||||
@@ -64,8 +64,8 @@ export function getAzureCommitsUrl(url: string): string {
|
||||
export function getAzureRequestOptions(
|
||||
config: AzureIntegrationConfig,
|
||||
additionalHeaders?: Record<string, string>,
|
||||
): RequestInit {
|
||||
const headers: HeadersInit = additionalHeaders
|
||||
): { headers: Record<string, string> } {
|
||||
const headers: Record<string, string> = additionalHeaders
|
||||
? { ...additionalHeaders }
|
||||
: {};
|
||||
|
||||
|
||||
@@ -158,8 +158,8 @@ export function getBitbucketFileFetchUrl(
|
||||
*/
|
||||
export function getBitbucketRequestOptions(
|
||||
config: BitbucketIntegrationConfig,
|
||||
): RequestInit {
|
||||
const headers: HeadersInit = {};
|
||||
): { headers: Record<string, string> } {
|
||||
const headers: Record<string, string> = {};
|
||||
|
||||
if (config.token) {
|
||||
headers.Authorization = `Bearer ${config.token}`;
|
||||
|
||||
@@ -73,8 +73,8 @@ export function getGitHubFileFetchUrl(
|
||||
export function getGitHubRequestOptions(
|
||||
config: GitHubIntegrationConfig,
|
||||
credentials: GithubCredentials,
|
||||
): RequestInit {
|
||||
const headers: HeadersInit = {};
|
||||
): { headers: Record<string, string> } {
|
||||
const headers: Record<string, string> = {};
|
||||
|
||||
if (chooseEndpoint(config, credentials) === 'api') {
|
||||
headers.Accept = 'application/vnd.github.v3.raw';
|
||||
|
||||
@@ -54,9 +54,9 @@ export async function getGitLabFileFetchUrl(
|
||||
* @param config - The relevant provider config
|
||||
* @public
|
||||
*/
|
||||
export function getGitLabRequestOptions(
|
||||
config: GitLabIntegrationConfig,
|
||||
): RequestInit {
|
||||
export function getGitLabRequestOptions(config: GitLabIntegrationConfig): {
|
||||
headers: Record<string, string>;
|
||||
} {
|
||||
const { token = '' } = config;
|
||||
return {
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user