MCPcopy Create free account
hub / github.com/decaporg/decap-cms / request

Method request

packages/decap-cms-backend-github/src/API.ts:372–394  ·  view source on GitHub ↗
(
    path: string,
    options: Options = {},
    parser = (response: Response) => this.parseResponse(response),
  )

Source from the content-addressed store, hash-verified

370 }
371
372 async request(
373 path: string,
374 options: Options = {},
375 parser = (response: Response) => this.parseResponse(response),
376 ) {
377 options = { cache: 'no-cache', ...options };
378 const headers = await this.requestHeaders(options.headers || {});
379 const url = this.urlFor(path, options);
380 let responseStatus = 500;
381
382 try {
383 const req = unsentRequest.fromFetchArguments(url, {
384 ...options,
385 headers,
386 }) as unknown as ApiRequest;
387 const response = await requestWithBackoff(this, req);
388 responseStatus = response.status;
389 const parsedResponse = await parser(response);
390 return parsedResponse;
391 } catch (error) {
392 return this.handleRequestError(error, responseStatus);
393 }
394 }
395
396 nextUrlProcessor() {
397 return (url: string) => url;

Callers 15

hasWriteAccessMethod · 0.95
checkMetadataRefMethod · 0.95
retrieveMetadataOldMethod · 0.95
getPullRequestCommitsMethod · 0.95
getPullRequestAuthorMethod · 0.95
fetchFileMetadataMethod · 0.95
fetchBlobContentMethod · 0.95
listFilesMethod · 0.95
getStatusesMethod · 0.95
getFileShaMethod · 0.95
getDifferencesMethod · 0.95

Calls 5

parseResponseMethod · 0.95
requestHeadersMethod · 0.95
urlForMethod · 0.95
handleRequestErrorMethod · 0.95
requestWithBackoffFunction · 0.90

Tested by

no test coverage detected