Merge pull request #8233 from backstage/freben/less-cross
🧹 Align on usage of `cross-fetch` vs `node-fetch` in frontend vs backend packages
This commit is contained in:
@@ -41,10 +41,10 @@
|
||||
"json-schema": "^0.4.0",
|
||||
"json-schema-merge-allof": "^0.8.1",
|
||||
"json-schema-traverse": "^1.0.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"typescript-json-schema": "^0.51.0",
|
||||
"yaml": "^1.9.2",
|
||||
"yup": "^0.32.9",
|
||||
"node-fetch": "2.6.5"
|
||||
"yup": "^0.32.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.7",
|
||||
|
||||
@@ -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