Added missing changes and modified dist assets.
This commit is contained in:
parent
229fe310d2
commit
905fcf74f4
102
dist/index.js
generated
vendored
102
dist/index.js
generated
vendored
@ -7830,7 +7830,7 @@ module.exports = __toCommonJS(dist_src_exports);
|
||||
var import_universal_user_agent = __nccwpck_require__(5030);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "9.0.1";
|
||||
var VERSION = "9.0.2";
|
||||
|
||||
// pkg/dist-src/defaults.js
|
||||
var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
|
||||
@ -8038,7 +8038,7 @@ function parseUrl(template) {
|
||||
}
|
||||
function expand(template, context) {
|
||||
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
||||
return template.replace(
|
||||
template = template.replace(
|
||||
/\{([^\{\}]+)\}|([^\{\}]+)/g,
|
||||
function(_, expression, literal) {
|
||||
if (expression) {
|
||||
@ -8068,6 +8068,11 @@ function expand(template, context) {
|
||||
}
|
||||
}
|
||||
);
|
||||
if (template === "/") {
|
||||
return template;
|
||||
} else {
|
||||
return template.replace(/\/$/, "");
|
||||
}
|
||||
}
|
||||
|
||||
// pkg/dist-src/parse.js
|
||||
@ -8352,7 +8357,7 @@ __export(dist_src_exports, {
|
||||
module.exports = __toCommonJS(dist_src_exports);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "9.1.1";
|
||||
var VERSION = "9.1.2";
|
||||
|
||||
// pkg/dist-src/normalize-paginated-list-response.js
|
||||
function normalizePaginatedListResponse(response) {
|
||||
@ -8749,7 +8754,7 @@ __export(dist_src_exports, {
|
||||
module.exports = __toCommonJS(dist_src_exports);
|
||||
|
||||
// pkg/dist-src/version.js
|
||||
var VERSION = "10.1.1";
|
||||
var VERSION = "10.1.2";
|
||||
|
||||
// pkg/dist-src/generated/endpoints.js
|
||||
var Endpoints = {
|
||||
@ -40239,6 +40244,14 @@ class Request {
|
||||
if (channels.bodySent.hasSubscribers) {
|
||||
channels.bodySent.publish({ request: this })
|
||||
}
|
||||
|
||||
if (this[kHandler].onRequestSent) {
|
||||
try {
|
||||
this[kHandler].onRequestSent()
|
||||
} catch (err) {
|
||||
this.onError(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onConnect (abort) {
|
||||
@ -41292,6 +41305,8 @@ let ReadableStream = globalThis.ReadableStream
|
||||
|
||||
/** @type {globalThis['File']} */
|
||||
const File = NativeFile ?? UndiciFile
|
||||
const textEncoder = new TextEncoder()
|
||||
const textDecoder = new TextDecoder()
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
|
||||
function extractBody (object, keepalive = false) {
|
||||
@ -41315,7 +41330,7 @@ function extractBody (object, keepalive = false) {
|
||||
stream = new ReadableStream({
|
||||
async pull (controller) {
|
||||
controller.enqueue(
|
||||
typeof source === 'string' ? new TextEncoder().encode(source) : source
|
||||
typeof source === 'string' ? textEncoder.encode(source) : source
|
||||
)
|
||||
queueMicrotask(() => readableStreamClose(controller))
|
||||
},
|
||||
@ -41385,7 +41400,6 @@ function extractBody (object, keepalive = false) {
|
||||
// - That the content-length is calculated in advance.
|
||||
// - And that all parts are pre-encoded and ready to be sent.
|
||||
|
||||
const enc = new TextEncoder()
|
||||
const blobParts = []
|
||||
const rn = new Uint8Array([13, 10]) // '\r\n'
|
||||
length = 0
|
||||
@ -41393,13 +41407,13 @@ function extractBody (object, keepalive = false) {
|
||||
|
||||
for (const [name, value] of object) {
|
||||
if (typeof value === 'string') {
|
||||
const chunk = enc.encode(prefix +
|
||||
const chunk = textEncoder.encode(prefix +
|
||||
`; name="${escape(normalizeLinefeeds(name))}"` +
|
||||
`\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
|
||||
blobParts.push(chunk)
|
||||
length += chunk.byteLength
|
||||
} else {
|
||||
const chunk = enc.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
|
||||
const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
|
||||
(value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
|
||||
`Content-Type: ${
|
||||
value.type || 'application/octet-stream'
|
||||
@ -41413,7 +41427,7 @@ function extractBody (object, keepalive = false) {
|
||||
}
|
||||
}
|
||||
|
||||
const chunk = enc.encode(`--${boundary}--`)
|
||||
const chunk = textEncoder.encode(`--${boundary}--`)
|
||||
blobParts.push(chunk)
|
||||
length += chunk.byteLength
|
||||
if (hasUnknownSizeValue) {
|
||||
@ -41709,14 +41723,16 @@ function bodyMixinMethods (instance) {
|
||||
let text = ''
|
||||
// application/x-www-form-urlencoded parser will keep the BOM.
|
||||
// https://url.spec.whatwg.org/#concept-urlencoded-parser
|
||||
const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
|
||||
// Note that streaming decoder is stateful and cannot be reused
|
||||
const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
|
||||
|
||||
for await (const chunk of consumeBody(this[kState].body)) {
|
||||
if (!isUint8Array(chunk)) {
|
||||
throw new TypeError('Expected Uint8Array chunk')
|
||||
}
|
||||
text += textDecoder.decode(chunk, { stream: true })
|
||||
text += streamingDecoder.decode(chunk, { stream: true })
|
||||
}
|
||||
text += textDecoder.decode()
|
||||
text += streamingDecoder.decode()
|
||||
entries = new URLSearchParams(text)
|
||||
} catch (err) {
|
||||
// istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
|
||||
@ -41831,7 +41847,7 @@ function utf8DecodeBytes (buffer) {
|
||||
|
||||
// 3. Process a queue with an instance of UTF-8’s
|
||||
// decoder, ioQueue, output, and "replacement".
|
||||
const output = new TextDecoder().decode(buffer)
|
||||
const output = textDecoder.decode(buffer)
|
||||
|
||||
// 4. Return output.
|
||||
return output
|
||||
@ -41879,10 +41895,12 @@ module.exports = {
|
||||
const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
|
||||
|
||||
const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
|
||||
const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
|
||||
|
||||
const nullBodyStatus = [101, 204, 205, 304]
|
||||
|
||||
const redirectStatus = [301, 302, 303, 307, 308]
|
||||
const redirectStatusSet = new Set(redirectStatus)
|
||||
|
||||
// https://fetch.spec.whatwg.org/#block-bad-port
|
||||
const badPorts = [
|
||||
@ -41894,6 +41912,8 @@ const badPorts = [
|
||||
'10080'
|
||||
]
|
||||
|
||||
const badPortsSet = new Set(badPorts)
|
||||
|
||||
// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
|
||||
const referrerPolicy = [
|
||||
'',
|
||||
@ -41906,10 +41926,12 @@ const referrerPolicy = [
|
||||
'strict-origin-when-cross-origin',
|
||||
'unsafe-url'
|
||||
]
|
||||
const referrerPolicySet = new Set(referrerPolicy)
|
||||
|
||||
const requestRedirect = ['follow', 'manual', 'error']
|
||||
|
||||
const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
|
||||
const safeMethodsSet = new Set(safeMethods)
|
||||
|
||||
const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
|
||||
|
||||
@ -41944,6 +41966,7 @@ const requestDuplex = [
|
||||
|
||||
// http://fetch.spec.whatwg.org/#forbidden-method
|
||||
const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
|
||||
const forbiddenMethodsSet = new Set(forbiddenMethods)
|
||||
|
||||
const subresource = [
|
||||
'audio',
|
||||
@ -41959,6 +41982,7 @@ const subresource = [
|
||||
'xslt',
|
||||
''
|
||||
]
|
||||
const subresourceSet = new Set(subresource)
|
||||
|
||||
/** @type {globalThis['DOMException']} */
|
||||
const DOMException = globalThis.DOMException ?? (() => {
|
||||
@ -42008,7 +42032,14 @@ module.exports = {
|
||||
nullBodyStatus,
|
||||
safeMethods,
|
||||
badPorts,
|
||||
requestDuplex
|
||||
requestDuplex,
|
||||
subresourceSet,
|
||||
badPortsSet,
|
||||
redirectStatusSet,
|
||||
corsSafeListedMethodsSet,
|
||||
safeMethodsSet,
|
||||
forbiddenMethodsSet,
|
||||
referrerPolicySet
|
||||
}
|
||||
|
||||
|
||||
@ -42664,6 +42695,7 @@ const { isBlobLike } = __nccwpck_require__(2538)
|
||||
const { webidl } = __nccwpck_require__(1744)
|
||||
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
|
||||
const { kEnumerableProperty } = __nccwpck_require__(3983)
|
||||
const encoder = new TextEncoder()
|
||||
|
||||
class File extends Blob {
|
||||
constructor (fileBits, fileName, options = {}) {
|
||||
@ -42937,7 +42969,7 @@ function processBlobParts (parts, options) {
|
||||
}
|
||||
|
||||
// 3. Append the result of UTF-8 encoding s to bytes.
|
||||
bytes.push(new TextEncoder().encode(s))
|
||||
bytes.push(encoder.encode(s))
|
||||
} else if (
|
||||
types.isAnyArrayBuffer(element) ||
|
||||
types.isTypedArray(element)
|
||||
@ -43935,11 +43967,11 @@ const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
|
||||
const assert = __nccwpck_require__(9491)
|
||||
const { safelyExtractBody } = __nccwpck_require__(1472)
|
||||
const {
|
||||
redirectStatus,
|
||||
redirectStatusSet,
|
||||
nullBodyStatus,
|
||||
safeMethods,
|
||||
safeMethodsSet,
|
||||
requestBodyHeader,
|
||||
subresource,
|
||||
subresourceSet,
|
||||
DOMException
|
||||
} = __nccwpck_require__(1037)
|
||||
const { kHeadersList } = __nccwpck_require__(2785)
|
||||
@ -43951,6 +43983,7 @@ const { TransformStream } = __nccwpck_require__(5356)
|
||||
const { getGlobalDispatcher } = __nccwpck_require__(1892)
|
||||
const { webidl } = __nccwpck_require__(1744)
|
||||
const { STATUS_CODES } = __nccwpck_require__(3685)
|
||||
const GET_OR_HEAD = ['GET', 'HEAD']
|
||||
|
||||
/** @type {import('buffer').resolveObjectURL} */
|
||||
let resolveObjectURL
|
||||
@ -44398,7 +44431,7 @@ function fetching ({
|
||||
}
|
||||
|
||||
// 15. If request is a subresource request, then:
|
||||
if (subresource.includes(request.destination)) {
|
||||
if (subresourceSet.has(request.destination)) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -44952,7 +44985,7 @@ async function httpFetch (fetchParams) {
|
||||
}
|
||||
|
||||
// 8. If actualResponse’s status is a redirect status, then:
|
||||
if (redirectStatus.includes(actualResponse.status)) {
|
||||
if (redirectStatusSet.has(actualResponse.status)) {
|
||||
// 1. If actualResponse’s status is not 303, request’s body is not null,
|
||||
// and the connection uses HTTP/2, then user agents may, and are even
|
||||
// encouraged to, transmit an RST_STREAM frame.
|
||||
@ -45070,7 +45103,7 @@ function httpRedirectFetch (fetchParams, response) {
|
||||
if (
|
||||
([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
|
||||
(actualResponse.status === 303 &&
|
||||
!['GET', 'HEAD'].includes(request.method))
|
||||
!GET_OR_HEAD.includes(request.method))
|
||||
) {
|
||||
// then:
|
||||
// 1. Set request’s method to `GET` and request’s body to null.
|
||||
@ -45354,7 +45387,7 @@ async function httpNetworkOrCacheFetch (
|
||||
// responses in httpCache, as per the "Invalidation" chapter of HTTP
|
||||
// Caching, and set storedResponse to null. [HTTP-CACHING]
|
||||
if (
|
||||
!safeMethods.includes(httpRequest.method) &&
|
||||
!safeMethodsSet.has(httpRequest.method) &&
|
||||
forwardResponse.status >= 200 &&
|
||||
forwardResponse.status <= 399
|
||||
) {
|
||||
@ -45914,7 +45947,7 @@ async function httpNetworkFetch (
|
||||
|
||||
const willFollow = request.redirect === 'follow' &&
|
||||
location &&
|
||||
redirectStatus.includes(status)
|
||||
redirectStatusSet.has(status)
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
||||
if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
|
||||
@ -46054,8 +46087,8 @@ const {
|
||||
makePolicyContainer
|
||||
} = __nccwpck_require__(2538)
|
||||
const {
|
||||
forbiddenMethods,
|
||||
corsSafeListedMethods,
|
||||
forbiddenMethodsSet,
|
||||
corsSafeListedMethodsSet,
|
||||
referrerPolicy,
|
||||
requestRedirect,
|
||||
requestMode,
|
||||
@ -46360,7 +46393,7 @@ class Request {
|
||||
throw TypeError(`'${init.method}' is not a valid HTTP method.`)
|
||||
}
|
||||
|
||||
if (forbiddenMethods.indexOf(method.toUpperCase()) !== -1) {
|
||||
if (forbiddenMethodsSet.has(method.toUpperCase())) {
|
||||
throw TypeError(`'${init.method}' HTTP method is unsupported.`)
|
||||
}
|
||||
|
||||
@ -46445,7 +46478,7 @@ class Request {
|
||||
if (mode === 'no-cors') {
|
||||
// 1. If this’s request’s method is not a CORS-safelisted method,
|
||||
// then throw a TypeError.
|
||||
if (!corsSafeListedMethods.includes(request.method)) {
|
||||
if (!corsSafeListedMethodsSet.has(request.method)) {
|
||||
throw new TypeError(
|
||||
`'${request.method} is unsupported in no-cors mode.`
|
||||
)
|
||||
@ -47007,7 +47040,7 @@ const {
|
||||
isomorphicEncode
|
||||
} = __nccwpck_require__(2538)
|
||||
const {
|
||||
redirectStatus,
|
||||
redirectStatusSet,
|
||||
nullBodyStatus,
|
||||
DOMException
|
||||
} = __nccwpck_require__(1037)
|
||||
@ -47021,6 +47054,7 @@ const assert = __nccwpck_require__(9491)
|
||||
const { types } = __nccwpck_require__(3837)
|
||||
|
||||
const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
|
||||
const textEncoder = new TextEncoder('utf-8')
|
||||
|
||||
// https://fetch.spec.whatwg.org/#response-class
|
||||
class Response {
|
||||
@ -47050,7 +47084,7 @@ class Response {
|
||||
}
|
||||
|
||||
// 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
|
||||
const bytes = new TextEncoder('utf-8').encode(
|
||||
const bytes = textEncoder.encode(
|
||||
serializeJavascriptValueToJSONString(data)
|
||||
)
|
||||
|
||||
@ -47095,7 +47129,7 @@ class Response {
|
||||
}
|
||||
|
||||
// 3. If status is not a redirect status, then throw a RangeError.
|
||||
if (!redirectStatus.includes(status)) {
|
||||
if (!redirectStatusSet.has(status)) {
|
||||
throw new RangeError('Invalid status code ' + status)
|
||||
}
|
||||
|
||||
@ -47593,7 +47627,7 @@ module.exports = {
|
||||
"use strict";
|
||||
|
||||
|
||||
const { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = __nccwpck_require__(1037)
|
||||
const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
|
||||
const { getGlobalOrigin } = __nccwpck_require__(1246)
|
||||
const { performance } = __nccwpck_require__(4074)
|
||||
const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
|
||||
@ -47622,7 +47656,7 @@ function responseURL (response) {
|
||||
// https://fetch.spec.whatwg.org/#concept-response-location-url
|
||||
function responseLocationURL (response, requestFragment) {
|
||||
// 1. If response’s status is not a redirect status, then return null.
|
||||
if (!redirectStatus.includes(response.status)) {
|
||||
if (!redirectStatusSet.has(response.status)) {
|
||||
return null
|
||||
}
|
||||
|
||||
@ -47657,7 +47691,7 @@ function requestBadPort (request) {
|
||||
|
||||
// 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
|
||||
// then return blocked.
|
||||
if (urlIsHttpHttpsScheme(url) && badPorts.includes(url.port)) {
|
||||
if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
|
||||
return 'blocked'
|
||||
}
|
||||
|
||||
@ -47799,7 +47833,7 @@ function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
|
||||
// The left-most policy is the fallback.
|
||||
for (let i = policyHeader.length; i !== 0; i--) {
|
||||
const token = policyHeader[i - 1].trim()
|
||||
if (referrerPolicyTokens.includes(token)) {
|
||||
if (referrerPolicyTokens.has(token)) {
|
||||
policy = token
|
||||
break
|
||||
}
|
||||
|
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