@octokit/plugin-paginate-rest
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -5,3 +5,3 @@ 'use strict'; | ||
const VERSION = "2.0.0"; | ||
const VERSION = "2.0.1"; | ||
@@ -28,15 +28,9 @@ /** | ||
*/ | ||
const REGEX_IS_SEARCH_PATH = /^\/search\//; | ||
const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/; | ||
const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/; | ||
const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/; | ||
const REGEX = [/^\/search\//, /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)([^/]|$)/, /^\/installation\/repositories([^/]|$)/, /^\/user\/installations([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/secrets([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/workflows(\/[^/]+\/runs)?([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/runs(\/[^/]+\/(artifacts|jobs))?([^/]|$)/]; | ||
function normalizePaginatedListResponse(octokit, url, response) { | ||
const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, ""); | ||
if (!REGEX_IS_SEARCH_PATH.test(path) && !REGEX_IS_CHECKS_PATH.test(path) && !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) && !REGEX_IS_USER_INSTALLATIONS_PATH.test(path)) { | ||
return; | ||
} // keep the additional properties intact as there is currently no other way | ||
const responseNeedsNormalization = REGEX.find(regex => regex.test(path)); | ||
if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way | ||
// to retrieve the same information. | ||
const incompleteResults = response.data.incomplete_results; | ||
@@ -43,0 +37,0 @@ const repositorySelection = response.data.repository_selection; |
@@ -21,14 +21,16 @@ /** | ||
*/ | ||
const REGEX_IS_SEARCH_PATH = /^\/search\//; | ||
const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/; | ||
const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/; | ||
const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/; | ||
const REGEX = [ | ||
/^\/search\//, | ||
/^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)([^/]|$)/, | ||
/^\/installation\/repositories([^/]|$)/, | ||
/^\/user\/installations([^/]|$)/, | ||
/^\/repos\/[^/]+\/[^/]+\/actions\/secrets([^/]|$)/, | ||
/^\/repos\/[^/]+\/[^/]+\/actions\/workflows(\/[^/]+\/runs)?([^/]|$)/, | ||
/^\/repos\/[^/]+\/[^/]+\/actions\/runs(\/[^/]+\/(artifacts|jobs))?([^/]|$)/ | ||
]; | ||
export function normalizePaginatedListResponse(octokit, url, response) { | ||
const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, ""); | ||
if (!REGEX_IS_SEARCH_PATH.test(path) && | ||
!REGEX_IS_CHECKS_PATH.test(path) && | ||
!REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) && | ||
!REGEX_IS_USER_INSTALLATIONS_PATH.test(path)) { | ||
const responseNeedsNormalization = REGEX.find(regex => regex.test(path)); | ||
if (!responseNeedsNormalization) | ||
return; | ||
} | ||
// keep the additional properties intact as there is currently no other way | ||
@@ -35,0 +37,0 @@ // to retrieve the same information. |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "2.0.0"; | ||
export const VERSION = "2.0.1"; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "2.0.0"; | ||
export declare const VERSION = "2.0.1"; |
@@ -1,2 +0,2 @@ | ||
const VERSION = "2.0.0"; | ||
const VERSION = "2.0.1"; | ||
@@ -23,14 +23,16 @@ /** | ||
*/ | ||
const REGEX_IS_SEARCH_PATH = /^\/search\//; | ||
const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/; | ||
const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/; | ||
const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/; | ||
const REGEX = [ | ||
/^\/search\//, | ||
/^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)([^/]|$)/, | ||
/^\/installation\/repositories([^/]|$)/, | ||
/^\/user\/installations([^/]|$)/, | ||
/^\/repos\/[^/]+\/[^/]+\/actions\/secrets([^/]|$)/, | ||
/^\/repos\/[^/]+\/[^/]+\/actions\/workflows(\/[^/]+\/runs)?([^/]|$)/, | ||
/^\/repos\/[^/]+\/[^/]+\/actions\/runs(\/[^/]+\/(artifacts|jobs))?([^/]|$)/ | ||
]; | ||
function normalizePaginatedListResponse(octokit, url, response) { | ||
const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, ""); | ||
if (!REGEX_IS_SEARCH_PATH.test(path) && | ||
!REGEX_IS_CHECKS_PATH.test(path) && | ||
!REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) && | ||
!REGEX_IS_USER_INSTALLATIONS_PATH.test(path)) { | ||
const responseNeedsNormalization = REGEX.find(regex => regex.test(path)); | ||
if (!responseNeedsNormalization) | ||
return; | ||
} | ||
// keep the additional properties intact as there is currently no other way | ||
@@ -37,0 +39,0 @@ // to retrieve the same information. |
{ | ||
"name": "@octokit/plugin-paginate-rest", | ||
"description": "Octokit plugin to paginate REST API endpoint responses", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
469
47594