Added missing changes and modified dist assets.

This commit is contained in:
GitHub Action 2023-11-28 23:33:35 +00:00 committed by renovate[bot]
parent 42fe158594
commit ee5ef758aa
2 changed files with 94 additions and 51 deletions

143
dist/index.js generated vendored
View File

@ -6475,7 +6475,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.3"; var VERSION = "9.0.4";
// 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)()}`;
@ -6594,10 +6594,13 @@ function extractUrlVariableNames(url) {
// pkg/dist-src/util/omit.js // pkg/dist-src/util/omit.js
function omit(object, keysToOmit) { function omit(object, keysToOmit) {
return Object.keys(object).filter((option) => !keysToOmit.includes(option)).reduce((obj, key) => { const result = { __proto__: null };
obj[key] = object[key]; for (const key of Object.keys(object)) {
return obj; if (keysToOmit.indexOf(key) === -1) {
}, {}); result[key] = object[key];
}
}
return result;
} }
// pkg/dist-src/util/url-template.js // pkg/dist-src/util/url-template.js
@ -7411,7 +7414,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.1.5"; var VERSION = "10.2.0";
// pkg/dist-src/generated/endpoints.js // pkg/dist-src/generated/endpoints.js
var Endpoints = { var Endpoints = {
@ -35966,11 +35969,9 @@ class Parser {
socket[kReset] = true socket[kReset] = true
} }
let pause const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
try {
pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false if (request.aborted) {
} catch (err) {
util.destroy(socket, err)
return -1 return -1
} }
@ -36017,13 +36018,8 @@ class Parser {
this.bytesRead += buf.length this.bytesRead += buf.length
try { if (request.onData(buf) === false) {
if (request.onData(buf) === false) { return constants.ERROR.PAUSED
return constants.ERROR.PAUSED
}
} catch (err) {
util.destroy(socket, err)
return -1
} }
} }
@ -36064,11 +36060,7 @@ class Parser {
return -1 return -1
} }
try { request.onComplete(headers)
request.onComplete(headers)
} catch (err) {
errorRequest(client, request, err)
}
client[kQueue][client[kRunningIdx]++] = null client[kQueue][client[kRunningIdx]++] = null
@ -36854,13 +36846,17 @@ function writeH2 (client, session, request) {
}) })
stream.on('data', (chunk) => { stream.on('data', (chunk) => {
if (request.onData(chunk) === false) stream.pause() if (request.onData(chunk) === false) {
stream.pause()
}
}) })
stream.once('close', () => { stream.once('close', () => {
h2State.openStreams -= 1 h2State.openStreams -= 1
// TODO(HTTP/2): unref only if current streams count is 0 // TODO(HTTP/2): unref only if current streams count is 0
if (h2State.openStreams === 0) session.unref() if (h2State.openStreams === 0) {
session.unref()
}
}) })
stream.once('error', function (err) { stream.once('error', function (err) {
@ -38903,7 +38899,11 @@ class Request {
onBodySent (chunk) { onBodySent (chunk) {
if (this[kHandler].onBodySent) { if (this[kHandler].onBodySent) {
return this[kHandler].onBodySent(chunk) try {
return this[kHandler].onBodySent(chunk)
} catch (err) {
this.abort(err)
}
} }
} }
@ -38913,7 +38913,11 @@ class Request {
} }
if (this[kHandler].onRequestSent) { if (this[kHandler].onRequestSent) {
return this[kHandler].onRequestSent() try {
return this[kHandler].onRequestSent()
} catch (err) {
this.abort(err)
}
} }
} }
@ -38937,14 +38941,23 @@ class Request {
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
} }
return this[kHandler].onHeaders(statusCode, headers, resume, statusText) try {
return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
} catch (err) {
this.abort(err)
}
} }
onData (chunk) { onData (chunk) {
assert(!this.aborted) assert(!this.aborted)
assert(!this.completed) assert(!this.completed)
return this[kHandler].onData(chunk) try {
return this[kHandler].onData(chunk)
} catch (err) {
this.abort(err)
return false
}
} }
onUpgrade (statusCode, headers, socket) { onUpgrade (statusCode, headers, socket) {
@ -38963,7 +38976,13 @@ class Request {
if (channels.trailers.hasSubscribers) { if (channels.trailers.hasSubscribers) {
channels.trailers.publish({ request: this, trailers }) channels.trailers.publish({ request: this, trailers })
} }
return this[kHandler].onComplete(trailers)
try {
return this[kHandler].onComplete(trailers)
} catch (err) {
// TODO (fix): This might be a bad idea?
this.onError(err)
}
} }
onError (error) { onError (error) {
@ -38977,6 +38996,7 @@ class Request {
return return
} }
this.aborted = true this.aborted = true
return this[kHandler].onError(error) return this[kHandler].onError(error)
} }
@ -44811,7 +44831,8 @@ const {
isValidHTTPToken, isValidHTTPToken,
sameOrigin, sameOrigin,
normalizeMethod, normalizeMethod,
makePolicyContainer makePolicyContainer,
normalizeMethodRecord
} = __nccwpck_require__(2538) } = __nccwpck_require__(2538)
const { const {
forbiddenMethodsSet, forbiddenMethodsSet,
@ -44984,8 +45005,10 @@ class Request {
urlList: [...request.urlList] urlList: [...request.urlList]
}) })
const initHasKey = Object.keys(init).length !== 0
// 13. If init is not empty, then: // 13. If init is not empty, then:
if (Object.keys(init).length > 0) { if (initHasKey) {
// 1. If requests mode is "navigate", then set it to "same-origin". // 1. If requests mode is "navigate", then set it to "same-origin".
if (request.mode === 'navigate') { if (request.mode === 'navigate') {
request.mode = 'same-origin' request.mode = 'same-origin'
@ -45116,16 +45139,16 @@ class Request {
// 2. If method is not a method or method is a forbidden method, then // 2. If method is not a method or method is a forbidden method, then
// throw a TypeError. // throw a TypeError.
if (!isValidHTTPToken(init.method)) { if (!isValidHTTPToken(method)) {
throw new TypeError(`'${init.method}' is not a valid HTTP method.`) throw new TypeError(`'${method}' is not a valid HTTP method.`)
} }
if (forbiddenMethodsSet.has(method.toUpperCase())) { if (forbiddenMethodsSet.has(method.toUpperCase())) {
throw new TypeError(`'${init.method}' HTTP method is unsupported.`) throw new TypeError(`'${method}' HTTP method is unsupported.`)
} }
// 3. Normalize method. // 3. Normalize method.
method = normalizeMethod(init.method) method = normalizeMethodRecord[method] ?? normalizeMethod(method)
// 4. Set requests method to method. // 4. Set requests method to method.
request.method = method request.method = method
@ -45216,25 +45239,25 @@ class Request {
} }
// 32. If init is not empty, then: // 32. If init is not empty, then:
if (Object.keys(init).length !== 0) { if (initHasKey) {
/** @type {HeadersList} */
const headersList = this[kHeaders][kHeadersList]
// 1. Let headers be a copy of thiss headers and its associated header // 1. Let headers be a copy of thiss headers and its associated header
// list. // list.
let headers = new Headers(this[kHeaders])
// 2. If init["headers"] exists, then set headers to init["headers"]. // 2. If init["headers"] exists, then set headers to init["headers"].
if (init.headers !== undefined) { const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
headers = init.headers
}
// 3. Empty thiss headerss header list. // 3. Empty thiss headerss header list.
this[kHeaders][kHeadersList].clear() headersList.clear()
// 4. If headers is a Headers object, then for each header in its header // 4. If headers is a Headers object, then for each header in its header
// list, append headers name/headers value to thiss headers. // list, append headers name/headers value to thiss headers.
if (headers.constructor.name === 'Headers') { if (headers instanceof HeadersList) {
for (const [key, val] of headers) { for (const [key, val] of headers) {
this[kHeaders].append(key, val) headersList.append(key, val)
} }
// Note: Copy the `set-cookie` meta-data.
headersList.cookies = headers.cookies
} else { } else {
// 5. Otherwise, fill thiss headers with headers. // 5. Otherwise, fill thiss headers with headers.
fillHeaders(this[kHeaders], headers) fillHeaders(this[kHeaders], headers)
@ -47052,11 +47075,30 @@ function isCancelled (fetchParams) {
fetchParams.controller.state === 'terminated' fetchParams.controller.state === 'terminated'
} }
// https://fetch.spec.whatwg.org/#concept-method-normalize const normalizeMethodRecord = {
delete: 'DELETE',
DELETE: 'DELETE',
get: 'GET',
GET: 'GET',
head: 'HEAD',
HEAD: 'HEAD',
options: 'OPTIONS',
OPTIONS: 'OPTIONS',
post: 'POST',
POST: 'POST',
put: 'PUT',
PUT: 'PUT'
}
// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
Object.setPrototypeOf(normalizeMethodRecord, null)
/**
* @see https://fetch.spec.whatwg.org/#concept-method-normalize
* @param {string} method
*/
function normalizeMethod (method) { function normalizeMethod (method) {
return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method) return normalizeMethodRecord[method.toLowerCase()] ?? method
? method.toUpperCase()
: method
} }
// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
@ -47401,7 +47443,8 @@ module.exports = {
urlIsLocal, urlIsLocal,
urlHasHttpsScheme, urlHasHttpsScheme,
urlIsHttpHttpsScheme, urlIsHttpHttpsScheme,
readAllBytes readAllBytes,
normalizeMethodRecord
} }

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long