Added missing changes and modified dist assets.
This commit is contained in:
parent
42fe158594
commit
ee5ef758aa
143
dist/index.js
generated
vendored
143
dist/index.js
generated
vendored
@ -6475,7 +6475,7 @@ module.exports = __toCommonJS(dist_src_exports);
|
||||
var import_universal_user_agent = __nccwpck_require__(5030);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "9.0.3";
|
||||
var VERSION = "9.0.4";
|
||||
|
||||
// pkg/dist-src/defaults.js
|
||||
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
|
||||
function omit(object, keysToOmit) {
|
||||
return Object.keys(object).filter((option) => !keysToOmit.includes(option)).reduce((obj, key) => {
|
||||
obj[key] = object[key];
|
||||
return obj;
|
||||
}, {});
|
||||
const result = { __proto__: null };
|
||||
for (const key of Object.keys(object)) {
|
||||
if (keysToOmit.indexOf(key) === -1) {
|
||||
result[key] = object[key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// pkg/dist-src/util/url-template.js
|
||||
@ -7411,7 +7414,7 @@ __export(dist_src_exports, {
|
||||
module.exports = __toCommonJS(dist_src_exports);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "10.1.5";
|
||||
var VERSION = "10.2.0";
|
||||
|
||||
// pkg/dist-src/generated/endpoints.js
|
||||
var Endpoints = {
|
||||
@ -35966,11 +35969,9 @@ class Parser {
|
||||
socket[kReset] = true
|
||||
}
|
||||
|
||||
let pause
|
||||
try {
|
||||
pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
|
||||
} catch (err) {
|
||||
util.destroy(socket, err)
|
||||
const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
|
||||
|
||||
if (request.aborted) {
|
||||
return -1
|
||||
}
|
||||
|
||||
@ -36017,13 +36018,8 @@ class Parser {
|
||||
|
||||
this.bytesRead += buf.length
|
||||
|
||||
try {
|
||||
if (request.onData(buf) === false) {
|
||||
return constants.ERROR.PAUSED
|
||||
}
|
||||
} catch (err) {
|
||||
util.destroy(socket, err)
|
||||
return -1
|
||||
if (request.onData(buf) === false) {
|
||||
return constants.ERROR.PAUSED
|
||||
}
|
||||
}
|
||||
|
||||
@ -36064,11 +36060,7 @@ class Parser {
|
||||
return -1
|
||||
}
|
||||
|
||||
try {
|
||||
request.onComplete(headers)
|
||||
} catch (err) {
|
||||
errorRequest(client, request, err)
|
||||
}
|
||||
request.onComplete(headers)
|
||||
|
||||
client[kQueue][client[kRunningIdx]++] = null
|
||||
|
||||
@ -36854,13 +36846,17 @@ function writeH2 (client, session, request) {
|
||||
})
|
||||
|
||||
stream.on('data', (chunk) => {
|
||||
if (request.onData(chunk) === false) stream.pause()
|
||||
if (request.onData(chunk) === false) {
|
||||
stream.pause()
|
||||
}
|
||||
})
|
||||
|
||||
stream.once('close', () => {
|
||||
h2State.openStreams -= 1
|
||||
// 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) {
|
||||
@ -38903,7 +38899,11 @@ class Request {
|
||||
|
||||
onBodySent (chunk) {
|
||||
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) {
|
||||
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 } })
|
||||
}
|
||||
|
||||
return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
|
||||
try {
|
||||
return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
|
||||
} catch (err) {
|
||||
this.abort(err)
|
||||
}
|
||||
}
|
||||
|
||||
onData (chunk) {
|
||||
assert(!this.aborted)
|
||||
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) {
|
||||
@ -38963,7 +38976,13 @@ class Request {
|
||||
if (channels.trailers.hasSubscribers) {
|
||||
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) {
|
||||
@ -38977,6 +38996,7 @@ class Request {
|
||||
return
|
||||
}
|
||||
this.aborted = true
|
||||
|
||||
return this[kHandler].onError(error)
|
||||
}
|
||||
|
||||
@ -44811,7 +44831,8 @@ const {
|
||||
isValidHTTPToken,
|
||||
sameOrigin,
|
||||
normalizeMethod,
|
||||
makePolicyContainer
|
||||
makePolicyContainer,
|
||||
normalizeMethodRecord
|
||||
} = __nccwpck_require__(2538)
|
||||
const {
|
||||
forbiddenMethodsSet,
|
||||
@ -44984,8 +45005,10 @@ class Request {
|
||||
urlList: [...request.urlList]
|
||||
})
|
||||
|
||||
const initHasKey = Object.keys(init).length !== 0
|
||||
|
||||
// 13. If init is not empty, then:
|
||||
if (Object.keys(init).length > 0) {
|
||||
if (initHasKey) {
|
||||
// 1. If request’s mode is "navigate", then set it to "same-origin".
|
||||
if (request.mode === 'navigate') {
|
||||
request.mode = 'same-origin'
|
||||
@ -45116,16 +45139,16 @@ class Request {
|
||||
|
||||
// 2. If method is not a method or method is a forbidden method, then
|
||||
// throw a TypeError.
|
||||
if (!isValidHTTPToken(init.method)) {
|
||||
throw new TypeError(`'${init.method}' is not a valid HTTP method.`)
|
||||
if (!isValidHTTPToken(method)) {
|
||||
throw new TypeError(`'${method}' is not a valid HTTP method.`)
|
||||
}
|
||||
|
||||
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.
|
||||
method = normalizeMethod(init.method)
|
||||
method = normalizeMethodRecord[method] ?? normalizeMethod(method)
|
||||
|
||||
// 4. Set request’s method to method.
|
||||
request.method = method
|
||||
@ -45216,25 +45239,25 @@ class Request {
|
||||
}
|
||||
|
||||
// 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 this’s headers and its associated header
|
||||
// list.
|
||||
let headers = new Headers(this[kHeaders])
|
||||
|
||||
// 2. If init["headers"] exists, then set headers to init["headers"].
|
||||
if (init.headers !== undefined) {
|
||||
headers = init.headers
|
||||
}
|
||||
const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
|
||||
|
||||
// 3. Empty this’s headers’s header list.
|
||||
this[kHeaders][kHeadersList].clear()
|
||||
headersList.clear()
|
||||
|
||||
// 4. If headers is a Headers object, then for each header in its header
|
||||
// list, append header’s name/header’s value to this’s headers.
|
||||
if (headers.constructor.name === 'Headers') {
|
||||
if (headers instanceof HeadersList) {
|
||||
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 {
|
||||
// 5. Otherwise, fill this’s headers with headers.
|
||||
fillHeaders(this[kHeaders], headers)
|
||||
@ -47052,11 +47075,30 @@ function isCancelled (fetchParams) {
|
||||
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) {
|
||||
return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method)
|
||||
? method.toUpperCase()
|
||||
: method
|
||||
return normalizeMethodRecord[method.toLowerCase()] ?? method
|
||||
}
|
||||
|
||||
// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
|
||||
@ -47401,7 +47443,8 @@ module.exports = {
|
||||
urlIsLocal,
|
||||
urlHasHttpsScheme,
|
||||
urlIsHttpHttpsScheme,
|
||||
readAllBytes
|
||||
readAllBytes,
|
||||
normalizeMethodRecord
|
||||
}
|
||||
|
||||
|
||||
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user