mirror of
https://github.com/actions/upload-artifact.git
synced 2026-04-12 00:20:48 +02:00
Compare commits
3 Commits
danwkenned
...
v7.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
043fb46d1a | ||
|
|
634250c138 | ||
|
|
e454baaac2 |
44
README.md
44
README.md
@@ -67,7 +67,7 @@ You are welcome to still raise bugs in this repo.
|
|||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
# Name of the artifact to upload.
|
# Name of the artifact to upload.
|
||||||
# Optional. Default is 'artifact'
|
# Optional. Default is 'artifact'
|
||||||
@@ -131,7 +131,7 @@ You are welcome to still raise bugs in this repo.
|
|||||||
steps:
|
steps:
|
||||||
- run: mkdir -p path/to/artifact
|
- run: mkdir -p path/to/artifact
|
||||||
- run: echo hello > path/to/artifact/world.txt
|
- run: echo hello > path/to/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/to/artifact/world.txt
|
path: path/to/artifact/world.txt
|
||||||
@@ -143,7 +143,7 @@ steps:
|
|||||||
steps:
|
steps:
|
||||||
- run: mkdir -p path/to/artifact
|
- run: mkdir -p path/to/artifact
|
||||||
- run: echo hello > path/to/artifact/world.txt
|
- run: echo hello > path/to/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: path/to/artifact/world.txt
|
path: path/to/artifact/world.txt
|
||||||
archive: false
|
archive: false
|
||||||
@@ -152,7 +152,7 @@ steps:
|
|||||||
### Upload an Entire Directory
|
### Upload an Entire Directory
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/to/artifact/ # or path/to/artifact
|
path: path/to/artifact/ # or path/to/artifact
|
||||||
@@ -161,7 +161,7 @@ steps:
|
|||||||
### Upload using a Wildcard Pattern
|
### Upload using a Wildcard Pattern
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/**/[abc]rtifac?/*
|
path: path/**/[abc]rtifac?/*
|
||||||
@@ -170,7 +170,7 @@ steps:
|
|||||||
### Upload using Multiple Paths and Exclusions
|
### Upload using Multiple Paths and Exclusions
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: |
|
path: |
|
||||||
@@ -218,7 +218,7 @@ For instance, if you are uploading random binary data, you can save a lot of tim
|
|||||||
- name: Make a 1GB random binary file
|
- name: Make a 1GB random binary file
|
||||||
run: |
|
run: |
|
||||||
dd if=/dev/urandom of=my-1gb-file bs=1M count=1000
|
dd if=/dev/urandom of=my-1gb-file bs=1M count=1000
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: my-1gb-file
|
path: my-1gb-file
|
||||||
@@ -231,7 +231,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
|
|||||||
- name: Make a file with a lot of repeated text
|
- name: Make a file with a lot of repeated text
|
||||||
run: |
|
run: |
|
||||||
for i in {1..100000}; do echo -n 'foobar' >> foobar.txt; done
|
for i in {1..100000}; do echo -n 'foobar' >> foobar.txt; done
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: foobar.txt
|
path: foobar.txt
|
||||||
@@ -243,7 +243,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
|
|||||||
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found:
|
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/to/artifact/
|
path: path/to/artifact/
|
||||||
@@ -256,13 +256,13 @@ Unlike earlier versions of `upload-artifact`, uploading to the same artifact via
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- run: echo hi > world.txt
|
- run: echo hi > world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
# implicitly named as 'artifact'
|
# implicitly named as 'artifact'
|
||||||
path: world.txt
|
path: world.txt
|
||||||
|
|
||||||
- run: echo howdy > extra-file.txt
|
- run: echo howdy > extra-file.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
# also implicitly named as 'artifact', will fail here!
|
# also implicitly named as 'artifact', will fail here!
|
||||||
path: extra-file.txt
|
path: extra-file.txt
|
||||||
@@ -288,7 +288,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: ./some-script --version=${{ matrix.version }} > my-binary
|
run: ./some-script --version=${{ matrix.version }} > my-binary
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: binary-${{ matrix.os }}-${{ matrix.version }}
|
name: binary-${{ matrix.os }}-${{ matrix.version }}
|
||||||
path: my-binary
|
path: my-binary
|
||||||
@@ -306,7 +306,7 @@ You can use `~` in the path input as a substitute for `$HOME`. Basic tilde expan
|
|||||||
- run: |
|
- run: |
|
||||||
mkdir -p ~/new/artifact
|
mkdir -p ~/new/artifact
|
||||||
echo hello > ~/new/artifact/world.txt
|
echo hello > ~/new/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifacts
|
name: my-artifacts
|
||||||
path: ~/new/**/*
|
path: ~/new/**/*
|
||||||
@@ -321,7 +321,7 @@ Environment variables along with context expressions can also be used for input.
|
|||||||
- run: |
|
- run: |
|
||||||
mkdir -p ${{ github.workspace }}/artifact
|
mkdir -p ${{ github.workspace }}/artifact
|
||||||
echo hello > ${{ github.workspace }}/artifact/world.txt
|
echo hello > ${{ github.workspace }}/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ env.name }}-name
|
name: ${{ env.name }}-name
|
||||||
path: ${{ github.workspace }}/artifact/**/*
|
path: ${{ github.workspace }}/artifact/**/*
|
||||||
@@ -335,7 +335,7 @@ For environment variables created in other steps, make sure to use the `env` exp
|
|||||||
mkdir testing
|
mkdir testing
|
||||||
echo "This is a file to upload" > testing/file.txt
|
echo "This is a file to upload" > testing/file.txt
|
||||||
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
|
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: artifact
|
name: artifact
|
||||||
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
|
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
|
||||||
@@ -350,7 +350,7 @@ Artifacts are retained for 90 days by default. You can specify a shorter retenti
|
|||||||
run: echo "I won't live long" > my_file.txt
|
run: echo "I won't live long" > my_file.txt
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: my_file.txt
|
path: my_file.txt
|
||||||
@@ -366,7 +366,7 @@ If an artifact upload is successful then an `artifact-id` output is available. T
|
|||||||
#### Example output between steps
|
#### Example output between steps
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
id: artifact-upload-step
|
id: artifact-upload-step
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
@@ -385,7 +385,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
output1: ${{ steps.artifact-upload-step.outputs.artifact-id }}
|
output1: ${{ steps.artifact-upload-step.outputs.artifact-id }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
id: artifact-upload-step
|
id: artifact-upload-step
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
@@ -411,7 +411,7 @@ jobs:
|
|||||||
- name: Create a file
|
- name: Create a file
|
||||||
run: echo "hello world" > my-file.txt
|
run: echo "hello world" > my-file.txt
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact # NOTE: same artifact name
|
name: my-artifact # NOTE: same artifact name
|
||||||
path: my-file.txt
|
path: my-file.txt
|
||||||
@@ -422,7 +422,7 @@ jobs:
|
|||||||
- name: Create a different file
|
- name: Create a different file
|
||||||
run: echo "goodbye world" > my-file.txt
|
run: echo "goodbye world" > my-file.txt
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact # NOTE: same artifact name
|
name: my-artifact # NOTE: same artifact name
|
||||||
path: my-file.txt
|
path: my-file.txt
|
||||||
@@ -438,7 +438,7 @@ Any files that contain sensitive information that should not be in the uploaded
|
|||||||
using the `path`:
|
using the `path`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
@@ -470,7 +470,7 @@ If you must preserve permissions, you can `tar` all of your files together befor
|
|||||||
run: tar -cvf my_files.tar /path/to/my/directory
|
run: tar -cvf my_files.tar /path/to/my/directory
|
||||||
|
|
||||||
- name: 'Upload Artifact'
|
- name: 'Upload Artifact'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: my_files.tar
|
path: my_files.tar
|
||||||
archive: false
|
archive: false
|
||||||
|
|||||||
180
dist/merge/index.js
vendored
180
dist/merge/index.js
vendored
@@ -88021,13 +88021,13 @@ class Sanitizer {
|
|||||||
message: value.message,
|
message: value.message,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (key === "headers") {
|
if (key === "headers" && isObject(value)) {
|
||||||
return this.sanitizeHeaders(value);
|
return this.sanitizeHeaders(value);
|
||||||
}
|
}
|
||||||
else if (key === "url") {
|
else if (key === "url" && typeof value === "string") {
|
||||||
return this.sanitizeUrl(value);
|
return this.sanitizeUrl(value);
|
||||||
}
|
}
|
||||||
else if (key === "query") {
|
else if (key === "query" && isObject(value)) {
|
||||||
return this.sanitizeQuery(value);
|
return this.sanitizeQuery(value);
|
||||||
}
|
}
|
||||||
else if (key === "body") {
|
else if (key === "body") {
|
||||||
@@ -88598,6 +88598,68 @@ function logPolicy_logPolicy(options = {}) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=logPolicy.js.map
|
//# sourceMappingURL=logPolicy.js.map
|
||||||
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The programmatic identifier of the redirectPolicy.
|
||||||
|
*/
|
||||||
|
const redirectPolicyName = "redirectPolicy";
|
||||||
|
/**
|
||||||
|
* Methods that are allowed to follow redirects 301 and 302
|
||||||
|
*/
|
||||||
|
const allowedRedirect = ["GET", "HEAD"];
|
||||||
|
/**
|
||||||
|
* A policy to follow Location headers from the server in order
|
||||||
|
* to support server-side redirection.
|
||||||
|
* In the browser, this policy is not used.
|
||||||
|
* @param options - Options to control policy behavior.
|
||||||
|
*/
|
||||||
|
function redirectPolicy_redirectPolicy(options = {}) {
|
||||||
|
const { maxRetries = 20, allowCrossOriginRedirects = false } = options;
|
||||||
|
return {
|
||||||
|
name: redirectPolicyName,
|
||||||
|
async sendRequest(request, next) {
|
||||||
|
const response = await next(request);
|
||||||
|
return handleRedirect(next, response, maxRetries, allowCrossOriginRedirects);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
async function handleRedirect(next, response, maxRetries, allowCrossOriginRedirects, currentRetries = 0) {
|
||||||
|
const { request, status, headers } = response;
|
||||||
|
const locationHeader = headers.get("location");
|
||||||
|
if (locationHeader &&
|
||||||
|
(status === 300 ||
|
||||||
|
(status === 301 && allowedRedirect.includes(request.method)) ||
|
||||||
|
(status === 302 && allowedRedirect.includes(request.method)) ||
|
||||||
|
(status === 303 && request.method === "POST") ||
|
||||||
|
status === 307) &&
|
||||||
|
currentRetries < maxRetries) {
|
||||||
|
const url = new URL(locationHeader, request.url);
|
||||||
|
// Only follow redirects to the same origin by default.
|
||||||
|
if (!allowCrossOriginRedirects) {
|
||||||
|
const originalUrl = new URL(request.url);
|
||||||
|
if (url.origin !== originalUrl.origin) {
|
||||||
|
log_logger.verbose(`Skipping cross-origin redirect from ${originalUrl.origin} to ${url.origin}.`);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
request.url = url.toString();
|
||||||
|
// POST request with Status code 303 should be converted into a
|
||||||
|
// redirected GET request if the redirect url is present in the location header
|
||||||
|
if (status === 303) {
|
||||||
|
request.method = "GET";
|
||||||
|
request.headers.delete("Content-Length");
|
||||||
|
delete request.body;
|
||||||
|
}
|
||||||
|
request.headers.delete("Authorization");
|
||||||
|
const res = await next(request);
|
||||||
|
return handleRedirect(next, res, maxRetries, allowCrossOriginRedirects, currentRetries + 1);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=redirectPolicy.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgentPlatform.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgentPlatform.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
@@ -88615,15 +88677,14 @@ function getHeaderName() {
|
|||||||
async function userAgentPlatform_setPlatformSpecificData(map) {
|
async function userAgentPlatform_setPlatformSpecificData(map) {
|
||||||
if (process && process.versions) {
|
if (process && process.versions) {
|
||||||
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
|
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
|
||||||
const versions = process.versions;
|
if (process.versions.bun) {
|
||||||
if (versions.bun) {
|
map.set("Bun", `${process.versions.bun} (${osInfo})`);
|
||||||
map.set("Bun", `${versions.bun} (${osInfo})`);
|
|
||||||
}
|
}
|
||||||
else if (versions.deno) {
|
else if (process.versions.deno) {
|
||||||
map.set("Deno", `${versions.deno} (${osInfo})`);
|
map.set("Deno", `${process.versions.deno} (${osInfo})`);
|
||||||
}
|
}
|
||||||
else if (versions.node) {
|
else if (process.versions.node) {
|
||||||
map.set("Node", `${versions.node} (${osInfo})`);
|
map.set("Node", `${process.versions.node} (${osInfo})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88930,7 +88991,7 @@ function isSystemError(err) {
|
|||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
const constants_SDK_VERSION = "0.3.3";
|
const constants_SDK_VERSION = "0.3.5";
|
||||||
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
||||||
//# sourceMappingURL=constants.js.map
|
//# sourceMappingURL=constants.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
|
||||||
@@ -88940,6 +89001,7 @@ const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
|
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
|
||||||
/**
|
/**
|
||||||
* The programmatic identifier of the retryPolicy.
|
* The programmatic identifier of the retryPolicy.
|
||||||
@@ -88970,11 +89032,11 @@ function retryPolicy_retryPolicy(strategies, options = { maxRetries: constants_D
|
|||||||
// RestErrors are valid targets for the retry strategies.
|
// RestErrors are valid targets for the retry strategies.
|
||||||
// If none of the retry strategies can work with them, they will be thrown later in this policy.
|
// If none of the retry strategies can work with them, they will be thrown later in this policy.
|
||||||
// If the received error is not a RestError, it is immediately thrown.
|
// If the received error is not a RestError, it is immediately thrown.
|
||||||
responseError = e;
|
if (!restError_isRestError(e)) {
|
||||||
if (!e || responseError.name !== "RestError") {
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
response = responseError.response;
|
responseError = e;
|
||||||
|
response = e.response;
|
||||||
}
|
}
|
||||||
if (request.abortSignal?.aborted) {
|
if (request.abortSignal?.aborted) {
|
||||||
logger.error(`Retry ${retryCount}: Request aborted.`);
|
logger.error(`Retry ${retryCount}: Request aborted.`);
|
||||||
@@ -89375,16 +89437,15 @@ function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) {
|
|||||||
if (request.tlsSettings) {
|
if (request.tlsSettings) {
|
||||||
log_logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");
|
log_logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");
|
||||||
}
|
}
|
||||||
const headers = request.headers.toJSON();
|
|
||||||
if (isInsecure) {
|
if (isInsecure) {
|
||||||
if (!cachedAgents.httpProxyAgent) {
|
if (!cachedAgents.httpProxyAgent) {
|
||||||
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl, { headers });
|
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl);
|
||||||
}
|
}
|
||||||
request.agent = cachedAgents.httpProxyAgent;
|
request.agent = cachedAgents.httpProxyAgent;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!cachedAgents.httpsProxyAgent) {
|
if (!cachedAgents.httpsProxyAgent) {
|
||||||
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl, { headers });
|
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl);
|
||||||
}
|
}
|
||||||
request.agent = cachedAgents.httpsProxyAgent;
|
request.agent = cachedAgents.httpsProxyAgent;
|
||||||
}
|
}
|
||||||
@@ -89436,13 +89497,13 @@ function typeGuards_isBinaryBody(body) {
|
|||||||
(body instanceof Uint8Array ||
|
(body instanceof Uint8Array ||
|
||||||
typeGuards_isReadableStream(body) ||
|
typeGuards_isReadableStream(body) ||
|
||||||
typeof body === "function" ||
|
typeof body === "function" ||
|
||||||
body instanceof Blob));
|
(typeof Blob !== "undefined" && body instanceof Blob)));
|
||||||
}
|
}
|
||||||
function typeGuards_isReadableStream(x) {
|
function typeGuards_isReadableStream(x) {
|
||||||
return isNodeReadableStream(x) || isWebReadableStream(x);
|
return isNodeReadableStream(x) || isWebReadableStream(x);
|
||||||
}
|
}
|
||||||
function isBlob(x) {
|
function typeGuards_isBlob(x) {
|
||||||
return typeof x.stream === "function";
|
return typeof Blob !== "undefined" && x instanceof Blob;
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=typeGuards.js.map
|
//# sourceMappingURL=typeGuards.js.map
|
||||||
// EXTERNAL MODULE: external "stream"
|
// EXTERNAL MODULE: external "stream"
|
||||||
@@ -89488,7 +89549,7 @@ function toStream(source) {
|
|||||||
if (source instanceof Uint8Array) {
|
if (source instanceof Uint8Array) {
|
||||||
return external_stream_.Readable.from(Buffer.from(source));
|
return external_stream_.Readable.from(Buffer.from(source));
|
||||||
}
|
}
|
||||||
else if (isBlob(source)) {
|
else if (typeGuards_isBlob(source)) {
|
||||||
return ensureNodeStream(source.stream());
|
return ensureNodeStream(source.stream());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -89538,7 +89599,7 @@ function getLength(source) {
|
|||||||
if (source instanceof Uint8Array) {
|
if (source instanceof Uint8Array) {
|
||||||
return source.byteLength;
|
return source.byteLength;
|
||||||
}
|
}
|
||||||
else if (isBlob(source)) {
|
else if (typeGuards_isBlob(source)) {
|
||||||
// if was created using createFile then -1 means we have an unknown size
|
// if was created using createFile then -1 means we have an unknown size
|
||||||
return source.size === -1 ? undefined : source.size;
|
return source.size === -1 ? undefined : source.size;
|
||||||
}
|
}
|
||||||
@@ -90067,9 +90128,14 @@ async function sendRequest_sendRequest(method, url, pipeline, options = {}, cust
|
|||||||
* @returns returns the content-type
|
* @returns returns the content-type
|
||||||
*/
|
*/
|
||||||
function getRequestContentType(options = {}) {
|
function getRequestContentType(options = {}) {
|
||||||
return (options.contentType ??
|
if (options.contentType) {
|
||||||
options.headers?.["content-type"] ??
|
return options.contentType;
|
||||||
getContentType(options.body));
|
}
|
||||||
|
const headerContentType = options.headers?.["content-type"];
|
||||||
|
if (typeof headerContentType === "string") {
|
||||||
|
return headerContentType;
|
||||||
|
}
|
||||||
|
return getContentType(options.body);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Function to determine the content-type of a body
|
* Function to determine the content-type of a body
|
||||||
@@ -90084,6 +90150,9 @@ function getContentType(body) {
|
|||||||
if (ArrayBuffer.isView(body)) {
|
if (ArrayBuffer.isView(body)) {
|
||||||
return "application/octet-stream";
|
return "application/octet-stream";
|
||||||
}
|
}
|
||||||
|
if (isBlob(body) && body.type) {
|
||||||
|
return body.type;
|
||||||
|
}
|
||||||
if (typeof body === "string") {
|
if (typeof body === "string") {
|
||||||
try {
|
try {
|
||||||
JSON.parse(body);
|
JSON.parse(body);
|
||||||
@@ -90134,9 +90203,15 @@ function getRequestBody(body, contentType = "") {
|
|||||||
if (typeof FormData !== "undefined" && body instanceof FormData) {
|
if (typeof FormData !== "undefined" && body instanceof FormData) {
|
||||||
return { body };
|
return { body };
|
||||||
}
|
}
|
||||||
|
if (isBlob(body)) {
|
||||||
|
return { body };
|
||||||
|
}
|
||||||
if (isReadableStream(body)) {
|
if (isReadableStream(body)) {
|
||||||
return { body };
|
return { body };
|
||||||
}
|
}
|
||||||
|
if (typeof body === "function") {
|
||||||
|
return { body: body };
|
||||||
|
}
|
||||||
if (ArrayBuffer.isView(body)) {
|
if (ArrayBuffer.isView(body)) {
|
||||||
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
|
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
|
||||||
}
|
}
|
||||||
@@ -90326,8 +90401,6 @@ function statusCodeToNumber(statusCode) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
|
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
@@ -90524,59 +90597,6 @@ function throttlingRetryPolicy(options = {}) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=throttlingRetryPolicy.js.map
|
//# sourceMappingURL=throttlingRetryPolicy.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
|
|
||||||
// Copyright (c) Microsoft Corporation.
|
|
||||||
// Licensed under the MIT License.
|
|
||||||
/**
|
|
||||||
* The programmatic identifier of the redirectPolicy.
|
|
||||||
*/
|
|
||||||
const redirectPolicyName = "redirectPolicy";
|
|
||||||
/**
|
|
||||||
* Methods that are allowed to follow redirects 301 and 302
|
|
||||||
*/
|
|
||||||
const allowedRedirect = ["GET", "HEAD"];
|
|
||||||
/**
|
|
||||||
* A policy to follow Location headers from the server in order
|
|
||||||
* to support server-side redirection.
|
|
||||||
* In the browser, this policy is not used.
|
|
||||||
* @param options - Options to control policy behavior.
|
|
||||||
*/
|
|
||||||
function redirectPolicy_redirectPolicy(options = {}) {
|
|
||||||
const { maxRetries = 20 } = options;
|
|
||||||
return {
|
|
||||||
name: redirectPolicyName,
|
|
||||||
async sendRequest(request, next) {
|
|
||||||
const response = await next(request);
|
|
||||||
return handleRedirect(next, response, maxRetries);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
async function handleRedirect(next, response, maxRetries, currentRetries = 0) {
|
|
||||||
const { request, status, headers } = response;
|
|
||||||
const locationHeader = headers.get("location");
|
|
||||||
if (locationHeader &&
|
|
||||||
(status === 300 ||
|
|
||||||
(status === 301 && allowedRedirect.includes(request.method)) ||
|
|
||||||
(status === 302 && allowedRedirect.includes(request.method)) ||
|
|
||||||
(status === 303 && request.method === "POST") ||
|
|
||||||
status === 307) &&
|
|
||||||
currentRetries < maxRetries) {
|
|
||||||
const url = new URL(locationHeader, request.url);
|
|
||||||
request.url = url.toString();
|
|
||||||
// POST request with Status code 303 should be converted into a
|
|
||||||
// redirected GET request if the redirect url is present in the location header
|
|
||||||
if (status === 303) {
|
|
||||||
request.method = "GET";
|
|
||||||
request.headers.delete("Content-Length");
|
|
||||||
delete request.body;
|
|
||||||
}
|
|
||||||
request.headers.delete("Authorization");
|
|
||||||
const res = await next(request);
|
|
||||||
return handleRedirect(next, res, maxRetries, currentRetries + 1);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=redirectPolicy.js.map
|
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/tlsPolicy.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/tlsPolicy.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|||||||
180
dist/upload/index.js
vendored
180
dist/upload/index.js
vendored
@@ -85596,13 +85596,13 @@ class Sanitizer {
|
|||||||
message: value.message,
|
message: value.message,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (key === "headers") {
|
if (key === "headers" && isObject(value)) {
|
||||||
return this.sanitizeHeaders(value);
|
return this.sanitizeHeaders(value);
|
||||||
}
|
}
|
||||||
else if (key === "url") {
|
else if (key === "url" && typeof value === "string") {
|
||||||
return this.sanitizeUrl(value);
|
return this.sanitizeUrl(value);
|
||||||
}
|
}
|
||||||
else if (key === "query") {
|
else if (key === "query" && isObject(value)) {
|
||||||
return this.sanitizeQuery(value);
|
return this.sanitizeQuery(value);
|
||||||
}
|
}
|
||||||
else if (key === "body") {
|
else if (key === "body") {
|
||||||
@@ -86173,6 +86173,68 @@ function logPolicy_logPolicy(options = {}) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=logPolicy.js.map
|
//# sourceMappingURL=logPolicy.js.map
|
||||||
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The programmatic identifier of the redirectPolicy.
|
||||||
|
*/
|
||||||
|
const redirectPolicyName = "redirectPolicy";
|
||||||
|
/**
|
||||||
|
* Methods that are allowed to follow redirects 301 and 302
|
||||||
|
*/
|
||||||
|
const allowedRedirect = ["GET", "HEAD"];
|
||||||
|
/**
|
||||||
|
* A policy to follow Location headers from the server in order
|
||||||
|
* to support server-side redirection.
|
||||||
|
* In the browser, this policy is not used.
|
||||||
|
* @param options - Options to control policy behavior.
|
||||||
|
*/
|
||||||
|
function redirectPolicy_redirectPolicy(options = {}) {
|
||||||
|
const { maxRetries = 20, allowCrossOriginRedirects = false } = options;
|
||||||
|
return {
|
||||||
|
name: redirectPolicyName,
|
||||||
|
async sendRequest(request, next) {
|
||||||
|
const response = await next(request);
|
||||||
|
return handleRedirect(next, response, maxRetries, allowCrossOriginRedirects);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
async function handleRedirect(next, response, maxRetries, allowCrossOriginRedirects, currentRetries = 0) {
|
||||||
|
const { request, status, headers } = response;
|
||||||
|
const locationHeader = headers.get("location");
|
||||||
|
if (locationHeader &&
|
||||||
|
(status === 300 ||
|
||||||
|
(status === 301 && allowedRedirect.includes(request.method)) ||
|
||||||
|
(status === 302 && allowedRedirect.includes(request.method)) ||
|
||||||
|
(status === 303 && request.method === "POST") ||
|
||||||
|
status === 307) &&
|
||||||
|
currentRetries < maxRetries) {
|
||||||
|
const url = new URL(locationHeader, request.url);
|
||||||
|
// Only follow redirects to the same origin by default.
|
||||||
|
if (!allowCrossOriginRedirects) {
|
||||||
|
const originalUrl = new URL(request.url);
|
||||||
|
if (url.origin !== originalUrl.origin) {
|
||||||
|
log_logger.verbose(`Skipping cross-origin redirect from ${originalUrl.origin} to ${url.origin}.`);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
request.url = url.toString();
|
||||||
|
// POST request with Status code 303 should be converted into a
|
||||||
|
// redirected GET request if the redirect url is present in the location header
|
||||||
|
if (status === 303) {
|
||||||
|
request.method = "GET";
|
||||||
|
request.headers.delete("Content-Length");
|
||||||
|
delete request.body;
|
||||||
|
}
|
||||||
|
request.headers.delete("Authorization");
|
||||||
|
const res = await next(request);
|
||||||
|
return handleRedirect(next, res, maxRetries, allowCrossOriginRedirects, currentRetries + 1);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=redirectPolicy.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgentPlatform.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgentPlatform.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
@@ -86190,15 +86252,14 @@ function getHeaderName() {
|
|||||||
async function userAgentPlatform_setPlatformSpecificData(map) {
|
async function userAgentPlatform_setPlatformSpecificData(map) {
|
||||||
if (process && process.versions) {
|
if (process && process.versions) {
|
||||||
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
|
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
|
||||||
const versions = process.versions;
|
if (process.versions.bun) {
|
||||||
if (versions.bun) {
|
map.set("Bun", `${process.versions.bun} (${osInfo})`);
|
||||||
map.set("Bun", `${versions.bun} (${osInfo})`);
|
|
||||||
}
|
}
|
||||||
else if (versions.deno) {
|
else if (process.versions.deno) {
|
||||||
map.set("Deno", `${versions.deno} (${osInfo})`);
|
map.set("Deno", `${process.versions.deno} (${osInfo})`);
|
||||||
}
|
}
|
||||||
else if (versions.node) {
|
else if (process.versions.node) {
|
||||||
map.set("Node", `${versions.node} (${osInfo})`);
|
map.set("Node", `${process.versions.node} (${osInfo})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86505,7 +86566,7 @@ function isSystemError(err) {
|
|||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
const constants_SDK_VERSION = "0.3.3";
|
const constants_SDK_VERSION = "0.3.5";
|
||||||
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
||||||
//# sourceMappingURL=constants.js.map
|
//# sourceMappingURL=constants.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
|
||||||
@@ -86515,6 +86576,7 @@ const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
|
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
|
||||||
/**
|
/**
|
||||||
* The programmatic identifier of the retryPolicy.
|
* The programmatic identifier of the retryPolicy.
|
||||||
@@ -86545,11 +86607,11 @@ function retryPolicy_retryPolicy(strategies, options = { maxRetries: constants_D
|
|||||||
// RestErrors are valid targets for the retry strategies.
|
// RestErrors are valid targets for the retry strategies.
|
||||||
// If none of the retry strategies can work with them, they will be thrown later in this policy.
|
// If none of the retry strategies can work with them, they will be thrown later in this policy.
|
||||||
// If the received error is not a RestError, it is immediately thrown.
|
// If the received error is not a RestError, it is immediately thrown.
|
||||||
responseError = e;
|
if (!restError_isRestError(e)) {
|
||||||
if (!e || responseError.name !== "RestError") {
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
response = responseError.response;
|
responseError = e;
|
||||||
|
response = e.response;
|
||||||
}
|
}
|
||||||
if (request.abortSignal?.aborted) {
|
if (request.abortSignal?.aborted) {
|
||||||
logger.error(`Retry ${retryCount}: Request aborted.`);
|
logger.error(`Retry ${retryCount}: Request aborted.`);
|
||||||
@@ -86950,16 +87012,15 @@ function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) {
|
|||||||
if (request.tlsSettings) {
|
if (request.tlsSettings) {
|
||||||
log_logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");
|
log_logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");
|
||||||
}
|
}
|
||||||
const headers = request.headers.toJSON();
|
|
||||||
if (isInsecure) {
|
if (isInsecure) {
|
||||||
if (!cachedAgents.httpProxyAgent) {
|
if (!cachedAgents.httpProxyAgent) {
|
||||||
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl, { headers });
|
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl);
|
||||||
}
|
}
|
||||||
request.agent = cachedAgents.httpProxyAgent;
|
request.agent = cachedAgents.httpProxyAgent;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!cachedAgents.httpsProxyAgent) {
|
if (!cachedAgents.httpsProxyAgent) {
|
||||||
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl, { headers });
|
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl);
|
||||||
}
|
}
|
||||||
request.agent = cachedAgents.httpsProxyAgent;
|
request.agent = cachedAgents.httpsProxyAgent;
|
||||||
}
|
}
|
||||||
@@ -87011,13 +87072,13 @@ function typeGuards_isBinaryBody(body) {
|
|||||||
(body instanceof Uint8Array ||
|
(body instanceof Uint8Array ||
|
||||||
typeGuards_isReadableStream(body) ||
|
typeGuards_isReadableStream(body) ||
|
||||||
typeof body === "function" ||
|
typeof body === "function" ||
|
||||||
body instanceof Blob));
|
(typeof Blob !== "undefined" && body instanceof Blob)));
|
||||||
}
|
}
|
||||||
function typeGuards_isReadableStream(x) {
|
function typeGuards_isReadableStream(x) {
|
||||||
return isNodeReadableStream(x) || isWebReadableStream(x);
|
return isNodeReadableStream(x) || isWebReadableStream(x);
|
||||||
}
|
}
|
||||||
function isBlob(x) {
|
function typeGuards_isBlob(x) {
|
||||||
return typeof x.stream === "function";
|
return typeof Blob !== "undefined" && x instanceof Blob;
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=typeGuards.js.map
|
//# sourceMappingURL=typeGuards.js.map
|
||||||
// EXTERNAL MODULE: external "stream"
|
// EXTERNAL MODULE: external "stream"
|
||||||
@@ -87063,7 +87124,7 @@ function toStream(source) {
|
|||||||
if (source instanceof Uint8Array) {
|
if (source instanceof Uint8Array) {
|
||||||
return external_stream_.Readable.from(Buffer.from(source));
|
return external_stream_.Readable.from(Buffer.from(source));
|
||||||
}
|
}
|
||||||
else if (isBlob(source)) {
|
else if (typeGuards_isBlob(source)) {
|
||||||
return ensureNodeStream(source.stream());
|
return ensureNodeStream(source.stream());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -87113,7 +87174,7 @@ function getLength(source) {
|
|||||||
if (source instanceof Uint8Array) {
|
if (source instanceof Uint8Array) {
|
||||||
return source.byteLength;
|
return source.byteLength;
|
||||||
}
|
}
|
||||||
else if (isBlob(source)) {
|
else if (typeGuards_isBlob(source)) {
|
||||||
// if was created using createFile then -1 means we have an unknown size
|
// if was created using createFile then -1 means we have an unknown size
|
||||||
return source.size === -1 ? undefined : source.size;
|
return source.size === -1 ? undefined : source.size;
|
||||||
}
|
}
|
||||||
@@ -87642,9 +87703,14 @@ async function sendRequest_sendRequest(method, url, pipeline, options = {}, cust
|
|||||||
* @returns returns the content-type
|
* @returns returns the content-type
|
||||||
*/
|
*/
|
||||||
function getRequestContentType(options = {}) {
|
function getRequestContentType(options = {}) {
|
||||||
return (options.contentType ??
|
if (options.contentType) {
|
||||||
options.headers?.["content-type"] ??
|
return options.contentType;
|
||||||
getContentType(options.body));
|
}
|
||||||
|
const headerContentType = options.headers?.["content-type"];
|
||||||
|
if (typeof headerContentType === "string") {
|
||||||
|
return headerContentType;
|
||||||
|
}
|
||||||
|
return getContentType(options.body);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Function to determine the content-type of a body
|
* Function to determine the content-type of a body
|
||||||
@@ -87659,6 +87725,9 @@ function getContentType(body) {
|
|||||||
if (ArrayBuffer.isView(body)) {
|
if (ArrayBuffer.isView(body)) {
|
||||||
return "application/octet-stream";
|
return "application/octet-stream";
|
||||||
}
|
}
|
||||||
|
if (isBlob(body) && body.type) {
|
||||||
|
return body.type;
|
||||||
|
}
|
||||||
if (typeof body === "string") {
|
if (typeof body === "string") {
|
||||||
try {
|
try {
|
||||||
JSON.parse(body);
|
JSON.parse(body);
|
||||||
@@ -87709,9 +87778,15 @@ function getRequestBody(body, contentType = "") {
|
|||||||
if (typeof FormData !== "undefined" && body instanceof FormData) {
|
if (typeof FormData !== "undefined" && body instanceof FormData) {
|
||||||
return { body };
|
return { body };
|
||||||
}
|
}
|
||||||
|
if (isBlob(body)) {
|
||||||
|
return { body };
|
||||||
|
}
|
||||||
if (isReadableStream(body)) {
|
if (isReadableStream(body)) {
|
||||||
return { body };
|
return { body };
|
||||||
}
|
}
|
||||||
|
if (typeof body === "function") {
|
||||||
|
return { body: body };
|
||||||
|
}
|
||||||
if (ArrayBuffer.isView(body)) {
|
if (ArrayBuffer.isView(body)) {
|
||||||
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
|
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
|
||||||
}
|
}
|
||||||
@@ -87901,8 +87976,6 @@ function statusCodeToNumber(statusCode) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
|
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
@@ -88099,59 +88172,6 @@ function throttlingRetryPolicy(options = {}) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=throttlingRetryPolicy.js.map
|
//# sourceMappingURL=throttlingRetryPolicy.js.map
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
|
|
||||||
// Copyright (c) Microsoft Corporation.
|
|
||||||
// Licensed under the MIT License.
|
|
||||||
/**
|
|
||||||
* The programmatic identifier of the redirectPolicy.
|
|
||||||
*/
|
|
||||||
const redirectPolicyName = "redirectPolicy";
|
|
||||||
/**
|
|
||||||
* Methods that are allowed to follow redirects 301 and 302
|
|
||||||
*/
|
|
||||||
const allowedRedirect = ["GET", "HEAD"];
|
|
||||||
/**
|
|
||||||
* A policy to follow Location headers from the server in order
|
|
||||||
* to support server-side redirection.
|
|
||||||
* In the browser, this policy is not used.
|
|
||||||
* @param options - Options to control policy behavior.
|
|
||||||
*/
|
|
||||||
function redirectPolicy_redirectPolicy(options = {}) {
|
|
||||||
const { maxRetries = 20 } = options;
|
|
||||||
return {
|
|
||||||
name: redirectPolicyName,
|
|
||||||
async sendRequest(request, next) {
|
|
||||||
const response = await next(request);
|
|
||||||
return handleRedirect(next, response, maxRetries);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
async function handleRedirect(next, response, maxRetries, currentRetries = 0) {
|
|
||||||
const { request, status, headers } = response;
|
|
||||||
const locationHeader = headers.get("location");
|
|
||||||
if (locationHeader &&
|
|
||||||
(status === 300 ||
|
|
||||||
(status === 301 && allowedRedirect.includes(request.method)) ||
|
|
||||||
(status === 302 && allowedRedirect.includes(request.method)) ||
|
|
||||||
(status === 303 && request.method === "POST") ||
|
|
||||||
status === 307) &&
|
|
||||||
currentRetries < maxRetries) {
|
|
||||||
const url = new URL(locationHeader, request.url);
|
|
||||||
request.url = url.toString();
|
|
||||||
// POST request with Status code 303 should be converted into a
|
|
||||||
// redirected GET request if the redirect url is present in the location header
|
|
||||||
if (status === 303) {
|
|
||||||
request.method = "GET";
|
|
||||||
request.headers.delete("Content-Length");
|
|
||||||
delete request.body;
|
|
||||||
}
|
|
||||||
request.headers.delete("Authorization");
|
|
||||||
const res = await next(request);
|
|
||||||
return handleRedirect(next, res, maxRetries, currentRetries + 1);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=redirectPolicy.js.map
|
|
||||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/tlsPolicy.js
|
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/tlsPolicy.js
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|||||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "upload-artifact",
|
"name": "upload-artifact",
|
||||||
"version": "7.0.0",
|
"version": "7.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "upload-artifact",
|
"name": "upload-artifact",
|
||||||
"version": "7.0.0",
|
"version": "7.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "^6.2.0",
|
"@actions/artifact": "^6.2.0",
|
||||||
@@ -2477,9 +2477,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typespec/ts-http-runtime": {
|
"node_modules/@typespec/ts-http-runtime": {
|
||||||
"version": "0.3.3",
|
"version": "0.3.5",
|
||||||
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.5.tgz",
|
||||||
"integrity": "sha512-91fp6CAAJSRtH5ja95T1FHSKa8aPW9/Zw6cta81jlZTUw/+Vq8jM/AfF/14h2b71wwR84JUTW/3Y8QPhDAawFA==",
|
"integrity": "sha512-yURCknZhvywvQItHMMmFSo+fq5arCUIyz/CVk7jD89MSai7dkaX8ufjCWp3NttLojoTVbcE72ri+be/TnEbMHw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"http-proxy-agent": "^7.0.0",
|
"http-proxy-agent": "^7.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "upload-artifact",
|
"name": "upload-artifact",
|
||||||
"version": "7.0.0",
|
"version": "7.0.1",
|
||||||
"description": "Upload an Actions Artifact in a workflow run",
|
"description": "Upload an Actions Artifact in a workflow run",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/upload/index.js",
|
"main": "dist/upload/index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user