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

Method request

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

Source from the content-addressed store, hash-verified

342 }
343
344 async request(
345 path: string,
346 options: Options = {},
347 parser = (response: Response) => this.parseResponse(response),
348 ) {
349 options = { cache: 'no-cache', ...options };
350 const headers = await this.requestHeaders(options.headers || {});
351 const url = this.urlFor(path, options);
352 let responseStatus = 500;
353
354 try {
355 const req = unsentRequest.fromFetchArguments(url, {
356 ...options,
357 headers,
358 }) as unknown as ApiRequest;
359 const response = await requestWithBackoff(this, req);
360 responseStatus = response.status;
361 const parsedResponse = await parser(response);
362 return parsedResponse;
363 } catch (error) {
364 return this.handleRequestError(error, responseStatus);
365 }
366 }
367
368 nextUrlProcessor() {
369 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