Merge pull request #91 from actions/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-8.4.0

Bump @typescript-eslint/eslint-plugin from 7.16.1 to 8.4.0
This commit is contained in:
Nick Alteen
2024-09-03 17:06:30 -04:00
committed by GitHub
6 changed files with 2297 additions and 2209 deletions

View File

@@ -53,7 +53,6 @@ rules:
['error', { 'accessibility': 'no-public' }], ['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type': '@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }], ['error', { 'allowExpressions': true }],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-explicit-any': 'error',
@@ -76,8 +75,6 @@ rules:
'@typescript-eslint/promise-function-async': 'error', '@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error', '@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error', '@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/space-before-function-paren': 'off', '@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'error' '@typescript-eslint/unbound-method': 'error'
} }

View File

@@ -1 +1 @@
20.6.0 21.6.2

139
dist/index.js generated vendored
View File

@@ -1843,7 +1843,7 @@ class HttpClient {
if (this._keepAlive && useProxy) { if (this._keepAlive && useProxy) {
agent = this._proxyAgent; agent = this._proxyAgent;
} }
if (this._keepAlive && !useProxy) { if (!useProxy) {
agent = this._agent; agent = this._agent;
} }
// if agent is already assigned use that agent. // if agent is already assigned use that agent.
@@ -1875,16 +1875,12 @@ class HttpClient {
agent = tunnelAgent(agentOptions); agent = tunnelAgent(agentOptions);
this._proxyAgent = agent; this._proxyAgent = agent;
} }
// if reusing agent across request and tunneling agent isn't assigned create a new agent // if tunneling agent isn't assigned create a new agent
if (this._keepAlive && !agent) { if (!agent) {
const options = { keepAlive: this._keepAlive, maxSockets }; const options = { keepAlive: this._keepAlive, maxSockets };
agent = usingSsl ? new https.Agent(options) : new http.Agent(options); agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
this._agent = agent; this._agent = agent;
} }
// if not using private agent and tunnel agent isn't setup then use global agent
if (!agent) {
agent = usingSsl ? https.globalAgent : http.globalAgent;
}
if (usingSsl && this._ignoreSslError) { if (usingSsl && this._ignoreSslError) {
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
@@ -1906,7 +1902,7 @@ class HttpClient {
} }
const usingSsl = parsedUrl.protocol === 'https:'; const usingSsl = parsedUrl.protocol === 'https:';
proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
token: `${proxyUrl.username}:${proxyUrl.password}` token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`
}))); })));
this._proxyAgentDispatcher = proxyAgent; this._proxyAgentDispatcher = proxyAgent;
if (usingSsl && this._ignoreSslError) { if (usingSsl && this._ignoreSslError) {
@@ -2020,11 +2016,11 @@ function getProxyUrl(reqUrl) {
})(); })();
if (proxyVar) { if (proxyVar) {
try { try {
return new URL(proxyVar); return new DecodedURL(proxyVar);
} }
catch (_a) { catch (_a) {
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
return new URL(`http://${proxyVar}`); return new DecodedURL(`http://${proxyVar}`);
} }
} }
else { else {
@@ -2083,6 +2079,19 @@ function isLoopbackAddress(host) {
hostLower.startsWith('[::1]') || hostLower.startsWith('[::1]') ||
hostLower.startsWith('[0:0:0:0:0:0:0:1]')); hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
} }
class DecodedURL extends URL {
constructor(url, base) {
super(url, base);
this._decodedUsername = decodeURIComponent(super.username);
this._decodedPassword = decodeURIComponent(super.password);
}
get username() {
return this._decodedUsername;
}
get password() {
return this._decodedPassword;
}
}
//# sourceMappingURL=proxy.js.map //# sourceMappingURL=proxy.js.map
/***/ }), /***/ }),
@@ -2208,7 +2217,7 @@ var import_graphql = __nccwpck_require__(8467);
var import_auth_token = __nccwpck_require__(334); var import_auth_token = __nccwpck_require__(334);
// pkg/dist-src/version.js // pkg/dist-src/version.js
var VERSION = "5.0.2"; var VERSION = "5.2.0";
// pkg/dist-src/index.js // pkg/dist-src/index.js
var noop = () => { var noop = () => {
@@ -2375,7 +2384,7 @@ module.exports = __toCommonJS(dist_src_exports);
var import_universal_user_agent = __nccwpck_require__(5030); var import_universal_user_agent = __nccwpck_require__(5030);
// pkg/dist-src/version.js // pkg/dist-src/version.js
var VERSION = "9.0.4"; var VERSION = "9.0.5";
// pkg/dist-src/defaults.js // pkg/dist-src/defaults.js
var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
@@ -2760,7 +2769,7 @@ var import_request3 = __nccwpck_require__(6234);
var import_universal_user_agent = __nccwpck_require__(5030); var import_universal_user_agent = __nccwpck_require__(5030);
// pkg/dist-src/version.js // pkg/dist-src/version.js
var VERSION = "7.0.2"; var VERSION = "7.1.0";
// pkg/dist-src/with-defaults.js // pkg/dist-src/with-defaults.js
var import_request2 = __nccwpck_require__(6234); var import_request2 = __nccwpck_require__(6234);
@@ -2917,7 +2926,7 @@ __export(dist_src_exports, {
module.exports = __toCommonJS(dist_src_exports); module.exports = __toCommonJS(dist_src_exports);
// pkg/dist-src/version.js // pkg/dist-src/version.js
var VERSION = "9.1.4"; var VERSION = "9.2.1";
// pkg/dist-src/normalize-paginated-list-response.js // pkg/dist-src/normalize-paginated-list-response.js
function normalizePaginatedListResponse(response) { function normalizePaginatedListResponse(response) {
@@ -3078,6 +3087,8 @@ var paginatingEndpoints = [
"GET /orgs/{org}/members/{username}/codespaces", "GET /orgs/{org}/members/{username}/codespaces",
"GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations",
"GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/migrations/{migration_id}/repositories",
"GET /orgs/{org}/organization-roles/{role_id}/teams",
"GET /orgs/{org}/organization-roles/{role_id}/users",
"GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/outside_collaborators",
"GET /orgs/{org}/packages", "GET /orgs/{org}/packages",
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
@@ -3314,7 +3325,7 @@ __export(dist_src_exports, {
module.exports = __toCommonJS(dist_src_exports); module.exports = __toCommonJS(dist_src_exports);
// pkg/dist-src/version.js // pkg/dist-src/version.js
var VERSION = "10.2.0"; var VERSION = "10.4.1";
// pkg/dist-src/generated/endpoints.js // pkg/dist-src/generated/endpoints.js
var Endpoints = { var Endpoints = {
@@ -3441,6 +3452,9 @@ var Endpoints = {
"GET /repos/{owner}/{repo}/actions/permissions/selected-actions" "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
], ],
getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
getCustomOidcSubClaimForRepo: [
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
],
getEnvironmentPublicKey: [ getEnvironmentPublicKey: [
"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
], ],
@@ -3593,6 +3607,9 @@ var Endpoints = {
setCustomLabelsForSelfHostedRunnerForRepo: [ setCustomLabelsForSelfHostedRunnerForRepo: [
"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
], ],
setCustomOidcSubClaimForRepo: [
"PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
],
setGithubActionsDefaultWorkflowPermissionsOrganization: [ setGithubActionsDefaultWorkflowPermissionsOrganization: [
"PUT /orgs/{org}/actions/permissions/workflow" "PUT /orgs/{org}/actions/permissions/workflow"
], ],
@@ -3662,6 +3679,7 @@ var Endpoints = {
listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
markNotificationsAsRead: ["PUT /notifications"], markNotificationsAsRead: ["PUT /notifications"],
markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
setThreadSubscription: [ setThreadSubscription: [
@@ -3938,10 +3956,10 @@ var Endpoints = {
updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
}, },
copilot: { copilot: {
addCopilotForBusinessSeatsForTeams: [ addCopilotSeatsForTeams: [
"POST /orgs/{org}/copilot/billing/selected_teams" "POST /orgs/{org}/copilot/billing/selected_teams"
], ],
addCopilotForBusinessSeatsForUsers: [ addCopilotSeatsForUsers: [
"POST /orgs/{org}/copilot/billing/selected_users" "POST /orgs/{org}/copilot/billing/selected_users"
], ],
cancelCopilotSeatAssignmentForTeams: [ cancelCopilotSeatAssignmentForTeams: [
@@ -4254,10 +4272,24 @@ var Endpoints = {
} }
] ]
}, },
oidc: {
getOidcCustomSubTemplateForOrg: [
"GET /orgs/{org}/actions/oidc/customization/sub"
],
updateOidcCustomSubTemplateForOrg: [
"PUT /orgs/{org}/actions/oidc/customization/sub"
]
},
orgs: { orgs: {
addSecurityManagerTeam: [ addSecurityManagerTeam: [
"PUT /orgs/{org}/security-managers/teams/{team_slug}" "PUT /orgs/{org}/security-managers/teams/{team_slug}"
], ],
assignTeamToOrgRole: [
"PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
],
assignUserToOrgRole: [
"PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
],
blockUser: ["PUT /orgs/{org}/blocks/{username}"], blockUser: ["PUT /orgs/{org}/blocks/{username}"],
cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
@@ -4266,6 +4298,7 @@ var Endpoints = {
convertMemberToOutsideCollaborator: [ convertMemberToOutsideCollaborator: [
"PUT /orgs/{org}/outside_collaborators/{username}" "PUT /orgs/{org}/outside_collaborators/{username}"
], ],
createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
createInvitation: ["POST /orgs/{org}/invitations"], createInvitation: ["POST /orgs/{org}/invitations"],
createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
createOrUpdateCustomPropertiesValuesForRepos: [ createOrUpdateCustomPropertiesValuesForRepos: [
@@ -4276,6 +4309,9 @@ var Endpoints = {
], ],
createWebhook: ["POST /orgs/{org}/hooks"], createWebhook: ["POST /orgs/{org}/hooks"],
delete: ["DELETE /orgs/{org}"], delete: ["DELETE /orgs/{org}"],
deleteCustomOrganizationRole: [
"DELETE /orgs/{org}/organization-roles/{role_id}"
],
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
enableOrDisableSecurityProductOnAllOrgRepos: [ enableOrDisableSecurityProductOnAllOrgRepos: [
"POST /orgs/{org}/{security_product}/{enablement}" "POST /orgs/{org}/{security_product}/{enablement}"
@@ -4287,6 +4323,7 @@ var Endpoints = {
], ],
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
getWebhookDelivery: [ getWebhookDelivery: [
@@ -4302,6 +4339,12 @@ var Endpoints = {
listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
listMembers: ["GET /orgs/{org}/members"], listMembers: ["GET /orgs/{org}/members"],
listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
listOrgRoles: ["GET /orgs/{org}/organization-roles"],
listOrganizationFineGrainedPermissions: [
"GET /orgs/{org}/organization-fine-grained-permissions"
],
listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
listPatGrantRepositories: [ listPatGrantRepositories: [
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
@@ -4316,6 +4359,9 @@ var Endpoints = {
listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
listWebhooks: ["GET /orgs/{org}/hooks"], listWebhooks: ["GET /orgs/{org}/hooks"],
patchCustomOrganizationRole: [
"PATCH /orgs/{org}/organization-roles/{role_id}"
],
pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
redeliverWebhookDelivery: [ redeliverWebhookDelivery: [
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
@@ -4340,6 +4386,18 @@ var Endpoints = {
reviewPatGrantRequestsInBulk: [ reviewPatGrantRequestsInBulk: [
"POST /orgs/{org}/personal-access-token-requests" "POST /orgs/{org}/personal-access-token-requests"
], ],
revokeAllOrgRolesTeam: [
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
],
revokeAllOrgRolesUser: [
"DELETE /orgs/{org}/organization-roles/users/{username}"
],
revokeOrgRoleTeam: [
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
],
revokeOrgRoleUser: [
"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
],
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
setPublicMembershipForAuthenticatedUser: [ setPublicMembershipForAuthenticatedUser: [
"PUT /orgs/{org}/public_members/{username}" "PUT /orgs/{org}/public_members/{username}"
@@ -4630,6 +4688,9 @@ var Endpoints = {
{}, {},
{ mapToData: "users" } { mapToData: "users" }
], ],
cancelPagesDeployment: [
"POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
],
checkAutomatedSecurityFixes: [ checkAutomatedSecurityFixes: [
"GET /repos/{owner}/{repo}/automated-security-fixes" "GET /repos/{owner}/{repo}/automated-security-fixes"
], ],
@@ -4665,12 +4726,15 @@ var Endpoints = {
createForAuthenticatedUser: ["POST /user/repos"], createForAuthenticatedUser: ["POST /user/repos"],
createFork: ["POST /repos/{owner}/{repo}/forks"], createFork: ["POST /repos/{owner}/{repo}/forks"],
createInOrg: ["POST /orgs/{org}/repos"], createInOrg: ["POST /orgs/{org}/repos"],
createOrUpdateCustomPropertiesValues: [
"PATCH /repos/{owner}/{repo}/properties/values"
],
createOrUpdateEnvironment: [ createOrUpdateEnvironment: [
"PUT /repos/{owner}/{repo}/environments/{environment_name}" "PUT /repos/{owner}/{repo}/environments/{environment_name}"
], ],
createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
createOrgRuleset: ["POST /orgs/{org}/rulesets"], createOrgRuleset: ["POST /orgs/{org}/rulesets"],
createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployment"], createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
createRelease: ["POST /repos/{owner}/{repo}/releases"], createRelease: ["POST /repos/{owner}/{repo}/releases"],
createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
@@ -4823,6 +4887,9 @@ var Endpoints = {
getOrgRulesets: ["GET /orgs/{org}/rulesets"], getOrgRulesets: ["GET /orgs/{org}/rulesets"],
getPages: ["GET /repos/{owner}/{repo}/pages"], getPages: ["GET /repos/{owner}/{repo}/pages"],
getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
getPagesDeployment: [
"GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
],
getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
getPullRequestReviewProtection: [ getPullRequestReviewProtection: [
@@ -5033,6 +5100,9 @@ var Endpoints = {
] ]
}, },
securityAdvisories: { securityAdvisories: {
createFork: [
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
],
createPrivateVulnerabilityReport: [ createPrivateVulnerabilityReport: [
"POST /repos/{owner}/{repo}/security-advisories/reports" "POST /repos/{owner}/{repo}/security-advisories/reports"
], ],
@@ -5524,7 +5594,7 @@ var import_endpoint = __nccwpck_require__(9440);
var import_universal_user_agent = __nccwpck_require__(5030); var import_universal_user_agent = __nccwpck_require__(5030);
// pkg/dist-src/version.js // pkg/dist-src/version.js
var VERSION = "8.1.6"; var VERSION = "8.4.0";
// pkg/dist-src/is-plain-object.js // pkg/dist-src/is-plain-object.js
function isPlainObject(value) { function isPlainObject(value) {
@@ -5549,7 +5619,7 @@ function getBufferResponse(response) {
// pkg/dist-src/fetch-wrapper.js // pkg/dist-src/fetch-wrapper.js
function fetchWrapper(requestOptions) { function fetchWrapper(requestOptions) {
var _a, _b, _c; var _a, _b, _c, _d;
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
@@ -5570,8 +5640,9 @@ function fetchWrapper(requestOptions) {
return fetch(requestOptions.url, { return fetch(requestOptions.url, {
method: requestOptions.method, method: requestOptions.method,
body: requestOptions.body, body: requestOptions.body,
redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
headers: requestOptions.headers, headers: requestOptions.headers,
signal: (_c = requestOptions.request) == null ? void 0 : _c.signal, signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
// duplex must be set if request.body is ReadableStream or Async Iterables. // duplex must be set if request.body is ReadableStream or Async Iterables.
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
...requestOptions.body && { duplex: "half" } ...requestOptions.body && { duplex: "half" }
@@ -5668,11 +5739,17 @@ async function getResponseData(response) {
function toErrorMessage(data) { function toErrorMessage(data) {
if (typeof data === "string") if (typeof data === "string")
return data; return data;
let suffix;
if ("documentation_url" in data) {
suffix = ` - ${data.documentation_url}`;
} else {
suffix = "";
}
if ("message" in data) { if ("message" in data) {
if (Array.isArray(data.errors)) { if (Array.isArray(data.errors)) {
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
} }
return data.message; return `${data.message}${suffix}`;
} }
return `Unknown error: ${JSON.stringify(data)}`; return `Unknown error: ${JSON.stringify(data)}`;
} }
@@ -29514,7 +29591,7 @@ Dicer.prototype._write = function (data, encoding, cb) {
if (this._headerFirst && this._isPreamble) { if (this._headerFirst && this._isPreamble) {
if (!this._part) { if (!this._part) {
this._part = new PartStream(this._partOpts) this._part = new PartStream(this._partOpts)
if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() } if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
} }
const r = this._hparser.push(data) const r = this._hparser.push(data)
if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
@@ -29571,7 +29648,7 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) {
} }
} }
if (this._dashes === 2) { if (this._dashes === 2) {
if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) } if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
this.reset() this.reset()
this._finished = true this._finished = true
// no more parts will be added // no more parts will be added
@@ -29589,7 +29666,13 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) {
this._part._read = function (n) { this._part._read = function (n) {
self._unpause() self._unpause()
} }
if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() } if (this._isPreamble && this.listenerCount('preamble') !== 0) {
this.emit('preamble', this._part)
} else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
this.emit('part', this._part)
} else {
this._ignore()
}
if (!this._isPreamble) { this._inHeader = true } if (!this._isPreamble) { this._inHeader = true }
} }
if (data && start < end && !this._ignoreData) { if (data && start < end && !this._ignoreData) {
@@ -30272,7 +30355,7 @@ function Multipart (boy, cfg) {
++nfiles ++nfiles
if (!boy._events.file) { if (boy.listenerCount('file') === 0) {
self.parser._ignore() self.parser._ignore()
return return
} }
@@ -30801,7 +30884,7 @@ const decoders = {
if (textDecoders.has(this.toString())) { if (textDecoders.has(this.toString())) {
try { try {
return textDecoders.get(this).decode(data) return textDecoders.get(this).decode(data)
} catch (e) { } } catch {}
} }
return typeof data === 'string' return typeof data === 'string'
? data ? data

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

4354
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@
".": "./dist/index.js" ".": "./dist/index.js"
}, },
"engines": { "engines": {
"node": ">=20" "node": ">=21"
}, },
"scripts": { "scripts": {
"bundle": "npm run format:write && npm run package", "bundle": "npm run format:write && npm run package",
@@ -74,8 +74,8 @@
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.12", "@types/jest": "^29.5.12",
"@types/node": "^22.5.2", "@types/node": "^22.5.2",
"@typescript-eslint/eslint-plugin": "^7.16.1", "@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^8.4.0",
"@vercel/ncc": "^0.38.1", "@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-plugin-github": "^5.0.1", "eslint-plugin-github": "^5.0.1",