Compare commits

..

3 Commits

Author SHA1 Message Date
semantic-release-bot
31c86eb3b3 build(release): 1.10.3 [skip ci]
## [1.10.3](https://github.com/actions/create-github-app-token/compare/v1.10.2...v1.10.3) (2024-07-01)

### Bug Fixes

* **deps:** bump undici from 6.18.2 to 6.19.2 in the production-dependencies group ([#149](https://github.com/actions/create-github-app-token/issues/149)) ([cc82279](cc82279e84)), closes [#3337](https://github.com/actions/create-github-app-token/issues/3337) [nodejs/undici#3338](https://github.com/nodejs/undici/issues/3338) [nodejs/undici#3340](https://github.com/nodejs/undici/issues/3340) [nodejs/undici#3332](https://github.com/nodejs/undici/issues/3332) [nodejs/undici#3335](https://github.com/nodejs/undici/issues/3335) [nodejs/undici#3305](https://github.com/nodejs/undici/issues/3305) [nodejs/undici#3303](https://github.com/nodejs/undici/issues/3303) [nodejs/undici#3304](https://github.com/nodejs/undici/issues/3304) [nodejs/undici#3306](https://github.com/nodejs/undici/issues/3306) [nodejs/undici#3309](https://github.com/nodejs/undici/issues/3309) [nodejs/undici#3313](https://github.com/nodejs/undici/issues/3313) [nodejs/undici#3311](https://github.com/nodejs/undici/issues/3311) [nodejs/undici#3107](https://github.com/nodejs/undici/issues/3107) [nodejs/undici#3302](https://github.com/nodejs/undici/issues/3302) [nodejs/undici#3320](https://github.com/nodejs/undici/issues/3320) [nodejs/undici#3321](https://github.com/nodejs/undici/issues/3321) [nodejs/undici#3316](https://github.com/nodejs/undici/issues/3316) [nodejs/undici#3318](https://github.com/nodejs/undici/issues/3318) [nodejs/undici#3326](https://github.com/nodejs/undici/issues/3326) [nodejs/undici#3324](https://github.com/nodejs/undici/issues/3324) [nodejs/undici#3325](https://github.com/nodejs/undici/issues/3325) [nodejs/undici#3316](https://github.com/nodejs/undici/issues/3316) [nodejs/undici#3318](https://github.com/nodejs/undici/issues/3318) [#3342](https://github.com/actions/create-github-app-token/issues/3342) [#3332](https://github.com/actions/create-github-app-token/issues/3332) [#3340](https://github.com/actions/create-github-app-token/issues/3340) [#3337](https://github.com/actions/create-github-app-token/issues/3337) [#3338](https://github.com/actions/create-github-app-token/issues/3338) [#3336](https://github.com/actions/create-github-app-token/issues/3336) [#3335](https://github.com/actions/create-github-app-token/issues/3335) [#3325](https://github.com/actions/create-github-app-token/issues/3325) [#3324](https://github.com/actions/create-github-app-token/issues/3324) [#3326](https://github.com/actions/create-github-app-token/issues/3326)
2024-07-01 13:15:08 +00:00
dependabot[bot]
cc82279e84 fix(deps): bump undici from 6.18.2 to 6.19.2 in the production-dependencies group (#149)
Bumps the production-dependencies group with 1 update:
[undici](https://github.com/nodejs/undici).

Updates `undici` from 6.18.2 to 6.19.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nodejs/undici/releases">undici's
releases</a>.</em></p>
<blockquote>
<h2>v6.19.2</h2>
<h2>What's Changed</h2>
<ul>
<li>fix <a
href="https://redirect.github.com/nodejs/undici/issues/3337">#3337</a>
by <a href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3338">nodejs/undici#3338</a></li>
<li>build: use <code>husky</code> as <code>husky install</code> is
deprecated by <a
href="https://github.com/jazelly"><code>@​jazelly</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3340">nodejs/undici#3340</a></li>
<li>fix: interceptors.d.ts has no default export by <a
href="https://github.com/Uzlopak"><code>@​Uzlopak</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3332">nodejs/undici#3332</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.19.1...v6.19.2">https://github.com/nodejs/undici/compare/v6.19.1...v6.19.2</a></p>
<h2>v6.19.1</h2>
<h2>What's Changed</h2>
<ul>
<li>don't append empty origin by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3335">nodejs/undici#3335</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.19.0...v6.19.1">https://github.com/nodejs/undici/compare/v6.19.0...v6.19.1</a></p>
<h2>v6.19.0</h2>
<h2>What's Changed</h2>
<ul>
<li>build(deps): bump ossf/scorecard-action from 2.3.1 to 2.3.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3305">nodejs/undici#3305</a></li>
<li>build(deps): bump codecov/codecov-action from 4.3.1 to 4.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3303">nodejs/undici#3303</a></li>
<li>build(deps): bump step-security/harden-runner from 2.7.1 to 2.8.0 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://redirect.github.com/nodejs/undici/pull/3304">nodejs/undici#3304</a></li>
<li>build(deps): bump github/codeql-action from 3.25.3 to 3.25.7 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3306">nodejs/undici#3306</a></li>
<li>build(deps): bump node from <code>9e8f45f</code> to
<code>dd7e693</code> in /build by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3309">nodejs/undici#3309</a></li>
<li>build(deps): bump node from <code>dd7e693</code> to
<code>e6d4495</code> in /build by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3313">nodejs/undici#3313</a></li>
<li>remove websocket experimental warning by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3311">nodejs/undici#3311</a></li>
<li>perf: optimization of request instantiation by <a
href="https://github.com/tsctx"><code>@​tsctx</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3107">nodejs/undici#3107</a></li>
<li>perf: convert object to params by <a
href="https://github.com/DarkGL"><code>@​DarkGL</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3302">nodejs/undici#3302</a></li>
<li>build(deps-dev): bump borp from 0.14.0 to 0.15.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3320">nodejs/undici#3320</a></li>
<li>build(deps-dev): bump c8 from 9.1.0 to 10.0.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3321">nodejs/undici#3321</a></li>
<li>fix: add missing error classes to types by <a
href="https://github.com/maxbeatty"><code>@​maxbeatty</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3316">nodejs/undici#3316</a></li>
<li>export interceptor to type def file by <a
href="https://github.com/jakecastelli"><code>@​jakecastelli</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3318">nodejs/undici#3318</a></li>
<li>build(deps): bump node from <code>e6d4495</code> to
<code>075a5cc</code> in /build by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3326">nodejs/undici#3326</a></li>
<li>doc: clearify the behaviour of <code>bodyTimeout</code> in the
request by <a
href="https://github.com/jakecastelli"><code>@​jakecastelli</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3324">nodejs/undici#3324</a></li>
<li>feature: support pre-shared sessions by <a
href="https://github.com/tastypackets"><code>@​tastypackets</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3325">nodejs/undici#3325</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/maxbeatty"><code>@​maxbeatty</code></a>
made their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/3316">nodejs/undici#3316</a></li>
<li><a
href="https://github.com/jakecastelli"><code>@​jakecastelli</code></a>
made their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/3318">nodejs/undici#3318</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.18.2...v6.19.0">https://github.com/nodejs/undici/compare/v6.18.2...v6.19.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="532b7b2882"><code>532b7b2</code></a>
Bumped v6.19.2 (<a
href="https://redirect.github.com/nodejs/undici/issues/3342">#3342</a>)</li>
<li><a
href="a7441d8aaa"><code>a7441d8</code></a>
fix: interceptors.d.ts has no default export (<a
href="https://redirect.github.com/nodejs/undici/issues/3332">#3332</a>)</li>
<li><a
href="5dadb95f10"><code>5dadb95</code></a>
build: use <code>husky</code> as <code>husky install</code> is
deprecated (<a
href="https://redirect.github.com/nodejs/undici/issues/3340">#3340</a>)</li>
<li><a
href="035524e717"><code>035524e</code></a>
fix <a
href="https://redirect.github.com/nodejs/undici/issues/3337">#3337</a>
(<a
href="https://redirect.github.com/nodejs/undici/issues/3338">#3338</a>)</li>
<li><a
href="f6b9b442b0"><code>f6b9b44</code></a>
Bumped v6.19.1 (<a
href="https://redirect.github.com/nodejs/undici/issues/3336">#3336</a>)</li>
<li><a
href="1573f693db"><code>1573f69</code></a>
don't append empty origin (<a
href="https://redirect.github.com/nodejs/undici/issues/3335">#3335</a>)</li>
<li><a
href="981fb3d72a"><code>981fb3d</code></a>
Bumped v6.19.0</li>
<li><a
href="39869b2996"><code>39869b2</code></a>
feature: support pre-shared sessions (<a
href="https://redirect.github.com/nodejs/undici/issues/3325">#3325</a>)</li>
<li><a
href="7f54a24a4a"><code>7f54a24</code></a>
doc: clearify the behaviour of <code>bodyTimeout</code> in the request
(<a
href="https://redirect.github.com/nodejs/undici/issues/3324">#3324</a>)</li>
<li><a
href="9785b15cbd"><code>9785b15</code></a>
build(deps): bump node from <code>e6d4495</code> to <code>075a5cc</code>
in /build (<a
href="https://redirect.github.com/nodejs/undici/issues/3326">#3326</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/nodejs/undici/compare/v6.18.2...v6.19.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=undici&package-manager=npm_and_yarn&previous-version=6.18.2&new-version=6.19.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 06:14:36 -07:00
Anuraag (Rag) Agrawal
74cd7f68cb docs(README): fix committer string example and add git config example (#145) 2024-06-28 07:51:24 -07:00
5 changed files with 263 additions and 255 deletions

View File

@@ -79,11 +79,49 @@ jobs:
# required # required
app-id: ${{ vars.APP_ID }} app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }} private-key: ${{ secrets.PRIVATE_KEY }}
- name: Retrieve GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.generate-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- id: committer - id: committer
run: echo "string=${{steps.app-auth.outputs.app-slug}}[bot] <${{ steps.app-auth.outputs.installation-id }}+${{ steps.app-auth.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT" run: echo "string=${{steps.app-token.outputs.app-slug}}[bot] <${{steps.get-user-id.outputs.user-id}}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
- run: echo "committer string is ${{steps.committer.outputs.string}}" - run: echo "committer string is ${{steps.committer.outputs.string}}"
``` ```
### Configure git CLI for an app's bot user
```yaml
on: [pull_request]
jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Retrieve GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.generate-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- run: |
git config --global user.name '${{steps.app-token.outputs.app-slug}}[bot]'
git config --global user.email '${{steps.get-user-id.outputs.user-id}}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
# git commands like commit work using the bot user
- run: |
git add .
git commit -m "Auto-generated changes"
git push
```
The `<BOT USER ID>` is the numeric user ID of the app's bot user, which can be found under `https://api.github.com/users/<app-slug>%5Bbot%5D`.
For example, we can check at `https://api.github.com/users/dependabot%5Bbot%5D` to see the user ID of dependabot is 49699333.
### Create a token for all repositories in the current owner's installation ### Create a token for all repositories in the current owner's installation
```yaml ```yaml

231
dist/main.cjs vendored
View File

@@ -20172,6 +20172,27 @@ var require_util8 = __commonJS({
} }
var kEnumerableProperty = /* @__PURE__ */ Object.create(null); var kEnumerableProperty = /* @__PURE__ */ Object.create(null);
kEnumerableProperty.enumerable = true; kEnumerableProperty.enumerable = true;
var normalizedMethodRecordsBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizedMethodRecords = {
...normalizedMethodRecordsBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizedMethodRecordsBase, null);
Object.setPrototypeOf(normalizedMethodRecords, null);
module2.exports = { module2.exports = {
kEnumerableProperty, kEnumerableProperty,
nop, nop,
@@ -20210,6 +20231,8 @@ var require_util8 = __commonJS({
isValidHeaderValue, isValidHeaderValue,
isTokenCharCode, isTokenCharCode,
parseRangeHeader, parseRangeHeader,
normalizedMethodRecordsBase,
normalizedMethodRecords,
isValidPort, isValidPort,
isHttpOrHttpsPrefixed, isHttpOrHttpsPrefixed,
nodeMajor, nodeMajor,
@@ -20425,7 +20448,8 @@ var require_request3 = __commonJS({
isBlobLike, isBlobLike,
buildURL, buildURL,
validateHandler, validateHandler,
getServerName getServerName,
normalizedMethodRecords
} = require_util8(); } = require_util8();
var { channels } = require_diagnostics(); var { channels } = require_diagnostics();
var { headerNameLowerCasedRecord } = require_constants6(); var { headerNameLowerCasedRecord } = require_constants6();
@@ -20452,12 +20476,12 @@ var require_request3 = __commonJS({
throw new InvalidArgumentError("path must be a string"); throw new InvalidArgumentError("path must be a string");
} else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") { } else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") {
throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
} else if (invalidPathRegex.exec(path) !== null) { } else if (invalidPathRegex.test(path)) {
throw new InvalidArgumentError("invalid request path"); throw new InvalidArgumentError("invalid request path");
} }
if (typeof method !== "string") { if (typeof method !== "string") {
throw new InvalidArgumentError("method must be a string"); throw new InvalidArgumentError("method must be a string");
} else if (!isValidHTTPToken(method)) { } else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) {
throw new InvalidArgumentError("invalid request method"); throw new InvalidArgumentError("invalid request method");
} }
if (upgrade && typeof upgrade !== "string") { if (upgrade && typeof upgrade !== "string") {
@@ -21002,7 +21026,7 @@ var require_connect2 = __commonJS({
} }
}; };
} }
function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
} }
@@ -21018,7 +21042,7 @@ var require_connect2 = __commonJS({
} }
servername = servername || options.servername || util.getServerName(host) || null; servername = servername || options.servername || util.getServerName(host) || null;
const sessionKey = servername || hostname; const sessionKey = servername || hostname;
const session = sessionCache.get(sessionKey) || null; const session = customSession || sessionCache.get(sessionKey) || null;
assert(sessionKey); assert(sessionKey);
socket = tls.connect({ socket = tls.connect({
highWaterMark: 16384, highWaterMark: 16384,
@@ -22536,7 +22560,7 @@ var require_util9 = __commonJS({
var { getGlobalOrigin } = require_global3(); var { getGlobalOrigin } = require_global3();
var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
var { performance: performance2 } = require("node:perf_hooks"); var { performance: performance2 } = require("node:perf_hooks");
var { isBlobLike, ReadableStreamFrom, isValidHTTPToken } = require_util8(); var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util8();
var assert = require("node:assert"); var assert = require("node:assert");
var { isUint8Array } = require("node:util/types"); var { isUint8Array } = require("node:util/types");
var { webidl } = require_webidl2(); var { webidl } = require_webidl2();
@@ -22643,7 +22667,7 @@ var require_util9 = __commonJS({
} }
function appendRequestOriginHeader(request2) { function appendRequestOriginHeader(request2) {
let serializedOrigin = request2.origin; let serializedOrigin = request2.origin;
if (serializedOrigin === "client") { if (serializedOrigin === "client" || serializedOrigin === void 0) {
return; return;
} }
if (request2.responseTainting === "cors" || request2.mode === "websocket") { if (request2.responseTainting === "cors" || request2.mode === "websocket") {
@@ -22924,29 +22948,8 @@ var require_util9 = __commonJS({
function isCancelled(fetchParams) { function isCancelled(fetchParams) {
return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";
} }
var normalizeMethodRecordBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizeMethodRecord = {
...normalizeMethodRecordBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizeMethodRecordBase, null);
Object.setPrototypeOf(normalizeMethodRecord, null);
function normalizeMethod(method) { function normalizeMethod(method) {
return normalizeMethodRecordBase[method.toLowerCase()] ?? method; return normalizedMethodRecordsBase[method.toLowerCase()] ?? method;
} }
function serializeJavascriptValueToJSONString(value) { function serializeJavascriptValueToJSONString(value) {
const result = JSON.stringify(value); const result = JSON.stringify(value);
@@ -23083,7 +23086,7 @@ var require_util9 = __commonJS({
} }
}); });
} }
async function fullyReadBody(body, processBody, processBodyError, shouldClone) { async function fullyReadBody(body, processBody, processBodyError) {
const successSteps = processBody; const successSteps = processBody;
const errorSteps = processBodyError; const errorSteps = processBodyError;
let reader; let reader;
@@ -23094,7 +23097,7 @@ var require_util9 = __commonJS({
return; return;
} }
try { try {
successSteps(await readAllBytes(reader, shouldClone)); successSteps(await readAllBytes(reader));
} catch (e) { } catch (e) {
errorSteps(e); errorSteps(e);
} }
@@ -23117,19 +23120,12 @@ var require_util9 = __commonJS({
assert(!invalidIsomorphicEncodeValueRegex.test(input)); assert(!invalidIsomorphicEncodeValueRegex.test(input));
return input; return input;
} }
async function readAllBytes(reader, shouldClone) { async function readAllBytes(reader) {
const bytes = []; const bytes = [];
let byteLength = 0; let byteLength = 0;
while (true) { while (true) {
const { done, value: chunk } = await reader.read(); const { done, value: chunk } = await reader.read();
if (done) { if (done) {
if (bytes.length === 1) {
const { buffer, byteOffset, byteLength: byteLength2 } = bytes[0];
if (shouldClone === false) {
return Buffer.from(buffer, byteOffset, byteLength2);
}
return Buffer.from(buffer.slice(byteOffset, byteOffset + byteLength2), 0, byteLength2);
}
return Buffer.concat(bytes, byteLength); return Buffer.concat(bytes, byteLength);
} }
if (!isUint8Array(chunk)) { if (!isUint8Array(chunk)) {
@@ -23392,7 +23388,6 @@ var require_util9 = __commonJS({
urlHasHttpsScheme, urlHasHttpsScheme,
urlIsHttpHttpsScheme, urlIsHttpHttpsScheme,
readAllBytes, readAllBytes,
normalizeMethodRecord,
simpleRangeHeaderValue, simpleRangeHeaderValue,
buildContentRange, buildContentRange,
parseMetadata, parseMetadata,
@@ -24064,18 +24059,18 @@ Content-Type: ${value.type || "application/octet-stream"}\r
mimeType = serializeAMimeType(mimeType); mimeType = serializeAMimeType(mimeType);
} }
return new Blob2([bytes], { type: mimeType }); return new Blob2([bytes], { type: mimeType });
}, instance, false); }, instance);
}, },
arrayBuffer() { arrayBuffer() {
return consumeBody(this, (bytes) => { return consumeBody(this, (bytes) => {
return bytes.buffer; return new Uint8Array(bytes).buffer;
}, instance, true); }, instance);
}, },
text() { text() {
return consumeBody(this, utf8DecodeBytes, instance, false); return consumeBody(this, utf8DecodeBytes, instance);
}, },
json() { json() {
return consumeBody(this, parseJSONFromBytes, instance, false); return consumeBody(this, parseJSONFromBytes, instance);
}, },
formData() { formData() {
return consumeBody(this, (value) => { return consumeBody(this, (value) => {
@@ -24104,12 +24099,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r
throw new TypeError( throw new TypeError(
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
); );
}, instance, false); }, instance);
}, },
bytes() { bytes() {
return consumeBody(this, (bytes) => { return consumeBody(this, (bytes) => {
return new Uint8Array(bytes.buffer, 0, bytes.byteLength); return new Uint8Array(bytes);
}, instance, true); }, instance);
} }
}; };
return methods; return methods;
@@ -24117,7 +24112,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
function mixinBody(prototype) { function mixinBody(prototype) {
Object.assign(prototype.prototype, bodyMixinMethods(prototype)); Object.assign(prototype.prototype, bodyMixinMethods(prototype));
} }
async function consumeBody(object, convertBytesToJSValue, instance, shouldClone) { async function consumeBody(object, convertBytesToJSValue, instance) {
webidl.brandCheck(object, instance); webidl.brandCheck(object, instance);
if (bodyUnusable(object[kState].body)) { if (bodyUnusable(object[kState].body)) {
throw new TypeError("Body is unusable: Body has already been read"); throw new TypeError("Body is unusable: Body has already been read");
@@ -24136,7 +24131,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
successSteps(Buffer.allocUnsafe(0)); successSteps(Buffer.allocUnsafe(0));
return promise.promise; return promise.promise;
} }
await fullyReadBody(object[kState].body, successSteps, errorSteps, shouldClone); await fullyReadBody(object[kState].body, successSteps, errorSteps);
return promise.promise; return promise.promise;
} }
function bodyUnusable(body) { function bodyUnusable(body) {
@@ -24889,25 +24884,25 @@ upgrade: ${upgrade}\r
channels.sendHeaders.publish({ request: request2, headers: header, socket }); channels.sendHeaders.publish({ request: request2, headers: header, socket });
} }
if (!body || bodyLength === 0) { if (!body || bodyLength === 0) {
writeBuffer({ abort, body: null, client, request: request2, socket, contentLength, header, expectsPayload }); writeBuffer(abort, null, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBuffer(body)) { } else if (util.isBuffer(body)) {
writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBlobLike(body)) { } else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") { if (typeof body.stream === "function") {
writeIterable({ abort, body: body.stream(), client, request: request2, socket, contentLength, header, expectsPayload }); writeIterable(abort, body.stream(), client, request2, socket, contentLength, header, expectsPayload);
} else { } else {
writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} }
} else if (util.isStream(body)) { } else if (util.isStream(body)) {
writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isIterable(body)) { } else if (util.isIterable(body)) {
writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else { } else {
assert(false); assert(false);
} }
return true; return true;
} }
function writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { function writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
let finished = false; let finished = false;
const writer = new AsyncWriter({ abort, socket, request: request2, contentLength, client, expectsPayload, header }); const writer = new AsyncWriter({ abort, socket, request: request2, contentLength, client, expectsPayload, header });
@@ -24976,7 +24971,7 @@ upgrade: ${upgrade}\r
setImmediate(onClose); setImmediate(onClose);
} }
} }
function writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { function writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
try { try {
if (!body) { if (!body) {
if (contentLength === 0) { if (contentLength === 0) {
@@ -25007,7 +25002,7 @@ upgrade: ${upgrade}\r
abort(err); abort(err);
} }
} }
async function writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { async function writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length"); assert(contentLength === body.size, "blob body must have content length");
try { try {
if (contentLength != null && contentLength !== body.size) { if (contentLength != null && contentLength !== body.size) {
@@ -25030,7 +25025,7 @@ upgrade: ${upgrade}\r
abort(err); abort(err);
} }
} }
async function writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { async function writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null; let callback = null;
function onDrain() { function onDrain() {
@@ -25493,81 +25488,79 @@ var require_client_h2 = __commonJS({
return true; return true;
function writeBodyH2() { function writeBodyH2() {
if (!body || contentLength === 0) { if (!body || contentLength === 0) {
writeBuffer({ writeBuffer(
abort, abort,
stream,
null,
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
h2stream: stream, );
body: null,
socket: client[kSocket]
});
} else if (util.isBuffer(body)) { } else if (util.isBuffer(body)) {
writeBuffer({ writeBuffer(
abort, abort,
client, stream,
request: request2,
contentLength,
body, body,
expectsPayload, client,
h2stream: stream, request2,
socket: client[kSocket] client[kSocket],
}); contentLength,
expectsPayload
);
} else if (util.isBlobLike(body)) { } else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") { if (typeof body.stream === "function") {
writeIterable({ writeIterable(
abort, abort,
stream,
body.stream(),
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
h2stream: stream, );
body: body.stream(),
socket: client[kSocket]
});
} else { } else {
writeBlob({ writeBlob(
abort, abort,
stream,
body, body,
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
h2stream: stream, );
socket: client[kSocket]
});
} }
} else if (util.isStream(body)) { } else if (util.isStream(body)) {
writeStream({ writeStream(
abort, abort,
client[kSocket],
expectsPayload,
stream,
body, body,
client, client,
request: request2, request2,
contentLength, contentLength
expectsPayload, );
socket: client[kSocket],
h2stream: stream,
header: ""
});
} else if (util.isIterable(body)) { } else if (util.isIterable(body)) {
writeIterable({ writeIterable(
abort, abort,
stream,
body, body,
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
header: "", );
h2stream: stream,
socket: client[kSocket]
});
} else { } else {
assert(false); assert(false);
} }
} }
} }
function writeBuffer({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) { function writeBuffer(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
try { try {
if (body != null && util.isBuffer(body)) { if (body != null && util.isBuffer(body)) {
assert(contentLength === body.byteLength, "buffer body must have content length"); assert(contentLength === body.byteLength, "buffer body must have content length");
@@ -25586,7 +25579,7 @@ var require_client_h2 = __commonJS({
abort(error); abort(error);
} }
} }
function writeStream({ abort, socket, expectsPayload, h2stream, body, client, request: request2, contentLength }) { function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
const pipe = pipeline( const pipe = pipeline(
body, body,
@@ -25610,7 +25603,7 @@ var require_client_h2 = __commonJS({
request2.onBodySent(chunk); request2.onBodySent(chunk);
} }
} }
async function writeBlob({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) { async function writeBlob(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length"); assert(contentLength === body.size, "blob body must have content length");
try { try {
if (contentLength != null && contentLength !== body.size) { if (contentLength != null && contentLength !== body.size) {
@@ -25631,7 +25624,7 @@ var require_client_h2 = __commonJS({
abort(err); abort(err);
} }
} }
async function writeIterable({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) { async function writeIterable(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null; let callback = null;
function onDrain() { function onDrain() {
@@ -27376,7 +27369,7 @@ var require_retry_handler = __commonJS({
this.abort( this.abort(
new RequestRetryError("Content-Range mismatch", statusCode, { new RequestRetryError("Content-Range mismatch", statusCode, {
headers, headers,
count: this.retryCount data: { count: this.retryCount }
}) })
); );
return false; return false;
@@ -27385,7 +27378,7 @@ var require_retry_handler = __commonJS({
this.abort( this.abort(
new RequestRetryError("ETag mismatch", statusCode, { new RequestRetryError("ETag mismatch", statusCode, {
headers, headers,
count: this.retryCount data: { count: this.retryCount }
}) })
); );
return false; return false;
@@ -30609,9 +30602,7 @@ var require_request4 = __commonJS({
var { var {
isValidHTTPToken, isValidHTTPToken,
sameOrigin, sameOrigin,
normalizeMethod, environmentSettingsObject
environmentSettingsObject,
normalizeMethodRecord
} = require_util9(); } = require_util9();
var { var {
forbiddenMethodsSet, forbiddenMethodsSet,
@@ -30623,7 +30614,7 @@ var require_request4 = __commonJS({
requestCache, requestCache,
requestDuplex requestDuplex
} = require_constants8(); } = require_constants8();
var { kEnumerableProperty } = util; var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util;
var { kHeaders, kSignal, kState, kDispatcher } = require_symbols7(); var { kHeaders, kSignal, kState, kDispatcher } = require_symbols7();
var { webidl } = require_webidl2(); var { webidl } = require_webidl2();
var { URLSerializer } = require_data_url(); var { URLSerializer } = require_data_url();
@@ -30820,17 +30811,18 @@ var require_request4 = __commonJS({
} }
if (init.method !== void 0) { if (init.method !== void 0) {
let method = init.method; let method = init.method;
const mayBeNormalized = normalizeMethodRecord[method]; const mayBeNormalized = normalizedMethodRecords[method];
if (mayBeNormalized !== void 0) { if (mayBeNormalized !== void 0) {
request2.method = mayBeNormalized; request2.method = mayBeNormalized;
} else { } else {
if (!isValidHTTPToken(method)) { if (!isValidHTTPToken(method)) {
throw new TypeError(`'${method}' is not a valid HTTP method.`); throw new TypeError(`'${method}' is not a valid HTTP method.`);
} }
if (forbiddenMethodsSet.has(method.toUpperCase())) { const upperCase = method.toUpperCase();
if (forbiddenMethodsSet.has(upperCase)) {
throw new TypeError(`'${method}' HTTP method is unsupported.`); throw new TypeError(`'${method}' HTTP method is unsupported.`);
} }
method = normalizeMethod(method); method = normalizedMethodRecordsBase[upperCase] ?? method;
request2.method = method; request2.method = method;
} }
if (!patchMethodWarning && request2.method === "patch") { if (!patchMethodWarning && request2.method === "patch") {
@@ -35546,7 +35538,6 @@ var require_websocket2 = __commonJS({
var { types } = require("node:util"); var { types } = require("node:util");
var { ErrorEvent, CloseEvent } = require_events2(); var { ErrorEvent, CloseEvent } = require_events2();
var { SendQueue } = require_sender(); var { SendQueue } = require_sender();
var experimentalWarned = false;
var WebSocket = class _WebSocket extends EventTarget { var WebSocket = class _WebSocket extends EventTarget {
#events = { #events = {
open: null, open: null,
@@ -35567,12 +35558,6 @@ var require_websocket2 = __commonJS({
super(); super();
const prefix = "WebSocket constructor"; const prefix = "WebSocket constructor";
webidl.argumentLengthCheck(arguments, 1, prefix); webidl.argumentLengthCheck(arguments, 1, prefix);
if (!experimentalWarned) {
experimentalWarned = true;
process.emitWarning("WebSockets are experimental, expect them to change at any time.", {
code: "UNDICI-WS"
});
}
const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options"); const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options");
url = webidl.converters.USVString(url, prefix, "url"); url = webidl.converters.USVString(url, prefix, "url");
protocols = options.protocols; protocols = options.protocols;

231
dist/post.cjs vendored
View File

@@ -19943,6 +19943,27 @@ var require_util8 = __commonJS({
} }
var kEnumerableProperty = /* @__PURE__ */ Object.create(null); var kEnumerableProperty = /* @__PURE__ */ Object.create(null);
kEnumerableProperty.enumerable = true; kEnumerableProperty.enumerable = true;
var normalizedMethodRecordsBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizedMethodRecords = {
...normalizedMethodRecordsBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizedMethodRecordsBase, null);
Object.setPrototypeOf(normalizedMethodRecords, null);
module2.exports = { module2.exports = {
kEnumerableProperty, kEnumerableProperty,
nop, nop,
@@ -19981,6 +20002,8 @@ var require_util8 = __commonJS({
isValidHeaderValue, isValidHeaderValue,
isTokenCharCode, isTokenCharCode,
parseRangeHeader, parseRangeHeader,
normalizedMethodRecordsBase,
normalizedMethodRecords,
isValidPort, isValidPort,
isHttpOrHttpsPrefixed, isHttpOrHttpsPrefixed,
nodeMajor, nodeMajor,
@@ -20196,7 +20219,8 @@ var require_request3 = __commonJS({
isBlobLike, isBlobLike,
buildURL, buildURL,
validateHandler, validateHandler,
getServerName getServerName,
normalizedMethodRecords
} = require_util8(); } = require_util8();
var { channels } = require_diagnostics(); var { channels } = require_diagnostics();
var { headerNameLowerCasedRecord } = require_constants6(); var { headerNameLowerCasedRecord } = require_constants6();
@@ -20223,12 +20247,12 @@ var require_request3 = __commonJS({
throw new InvalidArgumentError("path must be a string"); throw new InvalidArgumentError("path must be a string");
} else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") { } else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") {
throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
} else if (invalidPathRegex.exec(path) !== null) { } else if (invalidPathRegex.test(path)) {
throw new InvalidArgumentError("invalid request path"); throw new InvalidArgumentError("invalid request path");
} }
if (typeof method !== "string") { if (typeof method !== "string") {
throw new InvalidArgumentError("method must be a string"); throw new InvalidArgumentError("method must be a string");
} else if (!isValidHTTPToken(method)) { } else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) {
throw new InvalidArgumentError("invalid request method"); throw new InvalidArgumentError("invalid request method");
} }
if (upgrade && typeof upgrade !== "string") { if (upgrade && typeof upgrade !== "string") {
@@ -20773,7 +20797,7 @@ var require_connect2 = __commonJS({
} }
}; };
} }
function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
} }
@@ -20789,7 +20813,7 @@ var require_connect2 = __commonJS({
} }
servername = servername || options.servername || util.getServerName(host) || null; servername = servername || options.servername || util.getServerName(host) || null;
const sessionKey = servername || hostname; const sessionKey = servername || hostname;
const session = sessionCache.get(sessionKey) || null; const session = customSession || sessionCache.get(sessionKey) || null;
assert(sessionKey); assert(sessionKey);
socket = tls.connect({ socket = tls.connect({
highWaterMark: 16384, highWaterMark: 16384,
@@ -22307,7 +22331,7 @@ var require_util9 = __commonJS({
var { getGlobalOrigin } = require_global3(); var { getGlobalOrigin } = require_global3();
var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
var { performance: performance2 } = require("node:perf_hooks"); var { performance: performance2 } = require("node:perf_hooks");
var { isBlobLike, ReadableStreamFrom, isValidHTTPToken } = require_util8(); var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util8();
var assert = require("node:assert"); var assert = require("node:assert");
var { isUint8Array } = require("node:util/types"); var { isUint8Array } = require("node:util/types");
var { webidl } = require_webidl2(); var { webidl } = require_webidl2();
@@ -22414,7 +22438,7 @@ var require_util9 = __commonJS({
} }
function appendRequestOriginHeader(request2) { function appendRequestOriginHeader(request2) {
let serializedOrigin = request2.origin; let serializedOrigin = request2.origin;
if (serializedOrigin === "client") { if (serializedOrigin === "client" || serializedOrigin === void 0) {
return; return;
} }
if (request2.responseTainting === "cors" || request2.mode === "websocket") { if (request2.responseTainting === "cors" || request2.mode === "websocket") {
@@ -22695,29 +22719,8 @@ var require_util9 = __commonJS({
function isCancelled(fetchParams) { function isCancelled(fetchParams) {
return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";
} }
var normalizeMethodRecordBase = {
delete: "DELETE",
DELETE: "DELETE",
get: "GET",
GET: "GET",
head: "HEAD",
HEAD: "HEAD",
options: "OPTIONS",
OPTIONS: "OPTIONS",
post: "POST",
POST: "POST",
put: "PUT",
PUT: "PUT"
};
var normalizeMethodRecord = {
...normalizeMethodRecordBase,
patch: "patch",
PATCH: "PATCH"
};
Object.setPrototypeOf(normalizeMethodRecordBase, null);
Object.setPrototypeOf(normalizeMethodRecord, null);
function normalizeMethod(method) { function normalizeMethod(method) {
return normalizeMethodRecordBase[method.toLowerCase()] ?? method; return normalizedMethodRecordsBase[method.toLowerCase()] ?? method;
} }
function serializeJavascriptValueToJSONString(value) { function serializeJavascriptValueToJSONString(value) {
const result = JSON.stringify(value); const result = JSON.stringify(value);
@@ -22854,7 +22857,7 @@ var require_util9 = __commonJS({
} }
}); });
} }
async function fullyReadBody(body, processBody, processBodyError, shouldClone) { async function fullyReadBody(body, processBody, processBodyError) {
const successSteps = processBody; const successSteps = processBody;
const errorSteps = processBodyError; const errorSteps = processBodyError;
let reader; let reader;
@@ -22865,7 +22868,7 @@ var require_util9 = __commonJS({
return; return;
} }
try { try {
successSteps(await readAllBytes(reader, shouldClone)); successSteps(await readAllBytes(reader));
} catch (e) { } catch (e) {
errorSteps(e); errorSteps(e);
} }
@@ -22888,19 +22891,12 @@ var require_util9 = __commonJS({
assert(!invalidIsomorphicEncodeValueRegex.test(input)); assert(!invalidIsomorphicEncodeValueRegex.test(input));
return input; return input;
} }
async function readAllBytes(reader, shouldClone) { async function readAllBytes(reader) {
const bytes = []; const bytes = [];
let byteLength = 0; let byteLength = 0;
while (true) { while (true) {
const { done, value: chunk } = await reader.read(); const { done, value: chunk } = await reader.read();
if (done) { if (done) {
if (bytes.length === 1) {
const { buffer, byteOffset, byteLength: byteLength2 } = bytes[0];
if (shouldClone === false) {
return Buffer.from(buffer, byteOffset, byteLength2);
}
return Buffer.from(buffer.slice(byteOffset, byteOffset + byteLength2), 0, byteLength2);
}
return Buffer.concat(bytes, byteLength); return Buffer.concat(bytes, byteLength);
} }
if (!isUint8Array(chunk)) { if (!isUint8Array(chunk)) {
@@ -23163,7 +23159,6 @@ var require_util9 = __commonJS({
urlHasHttpsScheme, urlHasHttpsScheme,
urlIsHttpHttpsScheme, urlIsHttpHttpsScheme,
readAllBytes, readAllBytes,
normalizeMethodRecord,
simpleRangeHeaderValue, simpleRangeHeaderValue,
buildContentRange, buildContentRange,
parseMetadata, parseMetadata,
@@ -23835,18 +23830,18 @@ Content-Type: ${value.type || "application/octet-stream"}\r
mimeType = serializeAMimeType(mimeType); mimeType = serializeAMimeType(mimeType);
} }
return new Blob2([bytes], { type: mimeType }); return new Blob2([bytes], { type: mimeType });
}, instance, false); }, instance);
}, },
arrayBuffer() { arrayBuffer() {
return consumeBody(this, (bytes) => { return consumeBody(this, (bytes) => {
return bytes.buffer; return new Uint8Array(bytes).buffer;
}, instance, true); }, instance);
}, },
text() { text() {
return consumeBody(this, utf8DecodeBytes, instance, false); return consumeBody(this, utf8DecodeBytes, instance);
}, },
json() { json() {
return consumeBody(this, parseJSONFromBytes, instance, false); return consumeBody(this, parseJSONFromBytes, instance);
}, },
formData() { formData() {
return consumeBody(this, (value) => { return consumeBody(this, (value) => {
@@ -23875,12 +23870,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r
throw new TypeError( throw new TypeError(
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
); );
}, instance, false); }, instance);
}, },
bytes() { bytes() {
return consumeBody(this, (bytes) => { return consumeBody(this, (bytes) => {
return new Uint8Array(bytes.buffer, 0, bytes.byteLength); return new Uint8Array(bytes);
}, instance, true); }, instance);
} }
}; };
return methods; return methods;
@@ -23888,7 +23883,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
function mixinBody(prototype) { function mixinBody(prototype) {
Object.assign(prototype.prototype, bodyMixinMethods(prototype)); Object.assign(prototype.prototype, bodyMixinMethods(prototype));
} }
async function consumeBody(object, convertBytesToJSValue, instance, shouldClone) { async function consumeBody(object, convertBytesToJSValue, instance) {
webidl.brandCheck(object, instance); webidl.brandCheck(object, instance);
if (bodyUnusable(object[kState].body)) { if (bodyUnusable(object[kState].body)) {
throw new TypeError("Body is unusable: Body has already been read"); throw new TypeError("Body is unusable: Body has already been read");
@@ -23907,7 +23902,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
successSteps(Buffer.allocUnsafe(0)); successSteps(Buffer.allocUnsafe(0));
return promise.promise; return promise.promise;
} }
await fullyReadBody(object[kState].body, successSteps, errorSteps, shouldClone); await fullyReadBody(object[kState].body, successSteps, errorSteps);
return promise.promise; return promise.promise;
} }
function bodyUnusable(body) { function bodyUnusable(body) {
@@ -24660,25 +24655,25 @@ upgrade: ${upgrade}\r
channels.sendHeaders.publish({ request: request2, headers: header, socket }); channels.sendHeaders.publish({ request: request2, headers: header, socket });
} }
if (!body || bodyLength === 0) { if (!body || bodyLength === 0) {
writeBuffer({ abort, body: null, client, request: request2, socket, contentLength, header, expectsPayload }); writeBuffer(abort, null, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBuffer(body)) { } else if (util.isBuffer(body)) {
writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isBlobLike(body)) { } else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") { if (typeof body.stream === "function") {
writeIterable({ abort, body: body.stream(), client, request: request2, socket, contentLength, header, expectsPayload }); writeIterable(abort, body.stream(), client, request2, socket, contentLength, header, expectsPayload);
} else { } else {
writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} }
} else if (util.isStream(body)) { } else if (util.isStream(body)) {
writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else if (util.isIterable(body)) { } else if (util.isIterable(body)) {
writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }); writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload);
} else { } else {
assert(false); assert(false);
} }
return true; return true;
} }
function writeStream({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { function writeStream(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
let finished = false; let finished = false;
const writer = new AsyncWriter({ abort, socket, request: request2, contentLength, client, expectsPayload, header }); const writer = new AsyncWriter({ abort, socket, request: request2, contentLength, client, expectsPayload, header });
@@ -24747,7 +24742,7 @@ upgrade: ${upgrade}\r
setImmediate(onClose); setImmediate(onClose);
} }
} }
function writeBuffer({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { function writeBuffer(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
try { try {
if (!body) { if (!body) {
if (contentLength === 0) { if (contentLength === 0) {
@@ -24778,7 +24773,7 @@ upgrade: ${upgrade}\r
abort(err); abort(err);
} }
} }
async function writeBlob({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { async function writeBlob(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length"); assert(contentLength === body.size, "blob body must have content length");
try { try {
if (contentLength != null && contentLength !== body.size) { if (contentLength != null && contentLength !== body.size) {
@@ -24801,7 +24796,7 @@ upgrade: ${upgrade}\r
abort(err); abort(err);
} }
} }
async function writeIterable({ abort, body, client, request: request2, socket, contentLength, header, expectsPayload }) { async function writeIterable(abort, body, client, request2, socket, contentLength, header, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null; let callback = null;
function onDrain() { function onDrain() {
@@ -25264,81 +25259,79 @@ var require_client_h2 = __commonJS({
return true; return true;
function writeBodyH2() { function writeBodyH2() {
if (!body || contentLength === 0) { if (!body || contentLength === 0) {
writeBuffer({ writeBuffer(
abort, abort,
stream,
null,
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
h2stream: stream, );
body: null,
socket: client[kSocket]
});
} else if (util.isBuffer(body)) { } else if (util.isBuffer(body)) {
writeBuffer({ writeBuffer(
abort, abort,
client, stream,
request: request2,
contentLength,
body, body,
expectsPayload, client,
h2stream: stream, request2,
socket: client[kSocket] client[kSocket],
}); contentLength,
expectsPayload
);
} else if (util.isBlobLike(body)) { } else if (util.isBlobLike(body)) {
if (typeof body.stream === "function") { if (typeof body.stream === "function") {
writeIterable({ writeIterable(
abort, abort,
stream,
body.stream(),
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
h2stream: stream, );
body: body.stream(),
socket: client[kSocket]
});
} else { } else {
writeBlob({ writeBlob(
abort, abort,
stream,
body, body,
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
h2stream: stream, );
socket: client[kSocket]
});
} }
} else if (util.isStream(body)) { } else if (util.isStream(body)) {
writeStream({ writeStream(
abort, abort,
client[kSocket],
expectsPayload,
stream,
body, body,
client, client,
request: request2, request2,
contentLength, contentLength
expectsPayload, );
socket: client[kSocket],
h2stream: stream,
header: ""
});
} else if (util.isIterable(body)) { } else if (util.isIterable(body)) {
writeIterable({ writeIterable(
abort, abort,
stream,
body, body,
client, client,
request: request2, request2,
client[kSocket],
contentLength, contentLength,
expectsPayload, expectsPayload
header: "", );
h2stream: stream,
socket: client[kSocket]
});
} else { } else {
assert(false); assert(false);
} }
} }
} }
function writeBuffer({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) { function writeBuffer(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
try { try {
if (body != null && util.isBuffer(body)) { if (body != null && util.isBuffer(body)) {
assert(contentLength === body.byteLength, "buffer body must have content length"); assert(contentLength === body.byteLength, "buffer body must have content length");
@@ -25357,7 +25350,7 @@ var require_client_h2 = __commonJS({
abort(error); abort(error);
} }
} }
function writeStream({ abort, socket, expectsPayload, h2stream, body, client, request: request2, contentLength }) { function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) {
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
const pipe = pipeline( const pipe = pipeline(
body, body,
@@ -25381,7 +25374,7 @@ var require_client_h2 = __commonJS({
request2.onBodySent(chunk); request2.onBodySent(chunk);
} }
} }
async function writeBlob({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) { async function writeBlob(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength === body.size, "blob body must have content length"); assert(contentLength === body.size, "blob body must have content length");
try { try {
if (contentLength != null && contentLength !== body.size) { if (contentLength != null && contentLength !== body.size) {
@@ -25402,7 +25395,7 @@ var require_client_h2 = __commonJS({
abort(err); abort(err);
} }
} }
async function writeIterable({ abort, h2stream, body, client, request: request2, socket, contentLength, expectsPayload }) { async function writeIterable(abort, h2stream, body, client, request2, socket, contentLength, expectsPayload) {
assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
let callback = null; let callback = null;
function onDrain() { function onDrain() {
@@ -27147,7 +27140,7 @@ var require_retry_handler = __commonJS({
this.abort( this.abort(
new RequestRetryError("Content-Range mismatch", statusCode, { new RequestRetryError("Content-Range mismatch", statusCode, {
headers, headers,
count: this.retryCount data: { count: this.retryCount }
}) })
); );
return false; return false;
@@ -27156,7 +27149,7 @@ var require_retry_handler = __commonJS({
this.abort( this.abort(
new RequestRetryError("ETag mismatch", statusCode, { new RequestRetryError("ETag mismatch", statusCode, {
headers, headers,
count: this.retryCount data: { count: this.retryCount }
}) })
); );
return false; return false;
@@ -30380,9 +30373,7 @@ var require_request4 = __commonJS({
var { var {
isValidHTTPToken, isValidHTTPToken,
sameOrigin, sameOrigin,
normalizeMethod, environmentSettingsObject
environmentSettingsObject,
normalizeMethodRecord
} = require_util9(); } = require_util9();
var { var {
forbiddenMethodsSet, forbiddenMethodsSet,
@@ -30394,7 +30385,7 @@ var require_request4 = __commonJS({
requestCache, requestCache,
requestDuplex requestDuplex
} = require_constants8(); } = require_constants8();
var { kEnumerableProperty } = util; var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util;
var { kHeaders, kSignal, kState, kDispatcher } = require_symbols7(); var { kHeaders, kSignal, kState, kDispatcher } = require_symbols7();
var { webidl } = require_webidl2(); var { webidl } = require_webidl2();
var { URLSerializer } = require_data_url(); var { URLSerializer } = require_data_url();
@@ -30591,17 +30582,18 @@ var require_request4 = __commonJS({
} }
if (init.method !== void 0) { if (init.method !== void 0) {
let method = init.method; let method = init.method;
const mayBeNormalized = normalizeMethodRecord[method]; const mayBeNormalized = normalizedMethodRecords[method];
if (mayBeNormalized !== void 0) { if (mayBeNormalized !== void 0) {
request2.method = mayBeNormalized; request2.method = mayBeNormalized;
} else { } else {
if (!isValidHTTPToken(method)) { if (!isValidHTTPToken(method)) {
throw new TypeError(`'${method}' is not a valid HTTP method.`); throw new TypeError(`'${method}' is not a valid HTTP method.`);
} }
if (forbiddenMethodsSet.has(method.toUpperCase())) { const upperCase = method.toUpperCase();
if (forbiddenMethodsSet.has(upperCase)) {
throw new TypeError(`'${method}' HTTP method is unsupported.`); throw new TypeError(`'${method}' HTTP method is unsupported.`);
} }
method = normalizeMethod(method); method = normalizedMethodRecordsBase[upperCase] ?? method;
request2.method = method; request2.method = method;
} }
if (!patchMethodWarning && request2.method === "patch") { if (!patchMethodWarning && request2.method === "patch") {
@@ -35317,7 +35309,6 @@ var require_websocket2 = __commonJS({
var { types } = require("node:util"); var { types } = require("node:util");
var { ErrorEvent, CloseEvent } = require_events2(); var { ErrorEvent, CloseEvent } = require_events2();
var { SendQueue } = require_sender(); var { SendQueue } = require_sender();
var experimentalWarned = false;
var WebSocket = class _WebSocket extends EventTarget { var WebSocket = class _WebSocket extends EventTarget {
#events = { #events = {
open: null, open: null,
@@ -35338,12 +35329,6 @@ var require_websocket2 = __commonJS({
super(); super();
const prefix = "WebSocket constructor"; const prefix = "WebSocket constructor";
webidl.argumentLengthCheck(arguments, 1, prefix); webidl.argumentLengthCheck(arguments, 1, prefix);
if (!experimentalWarned) {
experimentalWarned = true;
process.emitWarning("WebSockets are experimental, expect them to change at any time.", {
code: "UNDICI-WS"
});
}
const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options"); const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols, prefix, "options");
url = webidl.converters.USVString(url, prefix, "url"); url = webidl.converters.USVString(url, prefix, "url");
protocols = options.protocols; protocols = options.protocols;

12
package-lock.json generated
View File

@@ -1,19 +1,19 @@
{ {
"name": "create-github-app-token", "name": "create-github-app-token",
"version": "1.10.1", "version": "1.10.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "create-github-app-token", "name": "create-github-app-token",
"version": "1.10.1", "version": "1.10.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",
"@octokit/auth-app": "^7.1.0", "@octokit/auth-app": "^7.1.0",
"@octokit/request": "^9.0.1", "@octokit/request": "^9.0.1",
"p-retry": "^6.2.0", "p-retry": "^6.2.0",
"undici": "^6.18.2" "undici": "^6.19.2"
}, },
"devDependencies": { "devDependencies": {
"@sinonjs/fake-timers": "^11.2.2", "@sinonjs/fake-timers": "^11.2.2",
@@ -3412,9 +3412,9 @@
} }
}, },
"node_modules/undici": { "node_modules/undici": {
"version": "6.18.2", "version": "6.19.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.18.2.tgz", "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.2.tgz",
"integrity": "sha512-o/MQLTwRm9IVhOqhZ0NQ9oXax1ygPjw6Vs+Vq/4QRjbOAC3B1GCHy7TYxxbExKlb7bzDRzt9vBWU6BDz0RFfYg==", "integrity": "sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==",
"engines": { "engines": {
"node": ">=18.17" "node": ">=18.17"
} }

View File

@@ -2,7 +2,7 @@
"name": "create-github-app-token", "name": "create-github-app-token",
"private": true, "private": true,
"type": "module", "type": "module",
"version": "1.10.2", "version": "1.10.3",
"description": "GitHub Action for creating a GitHub App Installation Access Token", "description": "GitHub Action for creating a GitHub App Installation Access Token",
"scripts": { "scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0", "build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0",
@@ -16,7 +16,7 @@
"@octokit/auth-app": "^7.1.0", "@octokit/auth-app": "^7.1.0",
"@octokit/request": "^9.0.1", "@octokit/request": "^9.0.1",
"p-retry": "^6.2.0", "p-retry": "^6.2.0",
"undici": "^6.18.2" "undici": "^6.19.2"
}, },
"devDependencies": { "devDependencies": {
"@sinonjs/fake-timers": "^11.2.2", "@sinonjs/fake-timers": "^11.2.2",