mirror of
https://github.com/actions/upload-artifact.git
synced 2026-04-10 17:38:27 +01:00
Compare commits
1 Commits
yacaovsnc/
...
danwkenned
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
068fe031ff |
180
dist/merge/index.js
vendored
180
dist/merge/index.js
vendored
@@ -88021,13 +88021,13 @@ class Sanitizer {
|
||||
message: value.message,
|
||||
};
|
||||
}
|
||||
if (key === "headers" && isObject(value)) {
|
||||
if (key === "headers") {
|
||||
return this.sanitizeHeaders(value);
|
||||
}
|
||||
else if (key === "url" && typeof value === "string") {
|
||||
else if (key === "url") {
|
||||
return this.sanitizeUrl(value);
|
||||
}
|
||||
else if (key === "query" && isObject(value)) {
|
||||
else if (key === "query") {
|
||||
return this.sanitizeQuery(value);
|
||||
}
|
||||
else if (key === "body") {
|
||||
@@ -88598,68 +88598,6 @@ function logPolicy_logPolicy(options = {}) {
|
||||
};
|
||||
}
|
||||
//# 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
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
@@ -88677,14 +88615,15 @@ function getHeaderName() {
|
||||
async function userAgentPlatform_setPlatformSpecificData(map) {
|
||||
if (process && process.versions) {
|
||||
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
|
||||
if (process.versions.bun) {
|
||||
map.set("Bun", `${process.versions.bun} (${osInfo})`);
|
||||
const versions = process.versions;
|
||||
if (versions.bun) {
|
||||
map.set("Bun", `${versions.bun} (${osInfo})`);
|
||||
}
|
||||
else if (process.versions.deno) {
|
||||
map.set("Deno", `${process.versions.deno} (${osInfo})`);
|
||||
else if (versions.deno) {
|
||||
map.set("Deno", `${versions.deno} (${osInfo})`);
|
||||
}
|
||||
else if (process.versions.node) {
|
||||
map.set("Node", `${process.versions.node} (${osInfo})`);
|
||||
else if (versions.node) {
|
||||
map.set("Node", `${versions.node} (${osInfo})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88991,7 +88930,7 @@ function isSystemError(err) {
|
||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const constants_SDK_VERSION = "0.3.5";
|
||||
const constants_SDK_VERSION = "0.3.3";
|
||||
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
||||
//# sourceMappingURL=constants.js.map
|
||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
|
||||
@@ -89001,7 +88940,6 @@ const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
||||
|
||||
|
||||
|
||||
|
||||
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
|
||||
/**
|
||||
* The programmatic identifier of the retryPolicy.
|
||||
@@ -89032,11 +88970,11 @@ function retryPolicy_retryPolicy(strategies, options = { maxRetries: constants_D
|
||||
// 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 the received error is not a RestError, it is immediately thrown.
|
||||
if (!restError_isRestError(e)) {
|
||||
responseError = e;
|
||||
if (!e || responseError.name !== "RestError") {
|
||||
throw e;
|
||||
}
|
||||
responseError = e;
|
||||
response = e.response;
|
||||
response = responseError.response;
|
||||
}
|
||||
if (request.abortSignal?.aborted) {
|
||||
logger.error(`Retry ${retryCount}: Request aborted.`);
|
||||
@@ -89437,15 +89375,16 @@ function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) {
|
||||
if (request.tlsSettings) {
|
||||
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 (!cachedAgents.httpProxyAgent) {
|
||||
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl);
|
||||
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl, { headers });
|
||||
}
|
||||
request.agent = cachedAgents.httpProxyAgent;
|
||||
}
|
||||
else {
|
||||
if (!cachedAgents.httpsProxyAgent) {
|
||||
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl);
|
||||
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl, { headers });
|
||||
}
|
||||
request.agent = cachedAgents.httpsProxyAgent;
|
||||
}
|
||||
@@ -89497,13 +89436,13 @@ function typeGuards_isBinaryBody(body) {
|
||||
(body instanceof Uint8Array ||
|
||||
typeGuards_isReadableStream(body) ||
|
||||
typeof body === "function" ||
|
||||
(typeof Blob !== "undefined" && body instanceof Blob)));
|
||||
body instanceof Blob));
|
||||
}
|
||||
function typeGuards_isReadableStream(x) {
|
||||
return isNodeReadableStream(x) || isWebReadableStream(x);
|
||||
}
|
||||
function typeGuards_isBlob(x) {
|
||||
return typeof Blob !== "undefined" && x instanceof Blob;
|
||||
function isBlob(x) {
|
||||
return typeof x.stream === "function";
|
||||
}
|
||||
//# sourceMappingURL=typeGuards.js.map
|
||||
// EXTERNAL MODULE: external "stream"
|
||||
@@ -89549,7 +89488,7 @@ function toStream(source) {
|
||||
if (source instanceof Uint8Array) {
|
||||
return external_stream_.Readable.from(Buffer.from(source));
|
||||
}
|
||||
else if (typeGuards_isBlob(source)) {
|
||||
else if (isBlob(source)) {
|
||||
return ensureNodeStream(source.stream());
|
||||
}
|
||||
else {
|
||||
@@ -89599,7 +89538,7 @@ function getLength(source) {
|
||||
if (source instanceof Uint8Array) {
|
||||
return source.byteLength;
|
||||
}
|
||||
else if (typeGuards_isBlob(source)) {
|
||||
else if (isBlob(source)) {
|
||||
// if was created using createFile then -1 means we have an unknown size
|
||||
return source.size === -1 ? undefined : source.size;
|
||||
}
|
||||
@@ -90128,14 +90067,9 @@ async function sendRequest_sendRequest(method, url, pipeline, options = {}, cust
|
||||
* @returns returns the content-type
|
||||
*/
|
||||
function getRequestContentType(options = {}) {
|
||||
if (options.contentType) {
|
||||
return options.contentType;
|
||||
}
|
||||
const headerContentType = options.headers?.["content-type"];
|
||||
if (typeof headerContentType === "string") {
|
||||
return headerContentType;
|
||||
}
|
||||
return getContentType(options.body);
|
||||
return (options.contentType ??
|
||||
options.headers?.["content-type"] ??
|
||||
getContentType(options.body));
|
||||
}
|
||||
/**
|
||||
* Function to determine the content-type of a body
|
||||
@@ -90150,9 +90084,6 @@ function getContentType(body) {
|
||||
if (ArrayBuffer.isView(body)) {
|
||||
return "application/octet-stream";
|
||||
}
|
||||
if (isBlob(body) && body.type) {
|
||||
return body.type;
|
||||
}
|
||||
if (typeof body === "string") {
|
||||
try {
|
||||
JSON.parse(body);
|
||||
@@ -90203,15 +90134,9 @@ function getRequestBody(body, contentType = "") {
|
||||
if (typeof FormData !== "undefined" && body instanceof FormData) {
|
||||
return { body };
|
||||
}
|
||||
if (isBlob(body)) {
|
||||
return { body };
|
||||
}
|
||||
if (isReadableStream(body)) {
|
||||
return { body };
|
||||
}
|
||||
if (typeof body === "function") {
|
||||
return { body: body };
|
||||
}
|
||||
if (ArrayBuffer.isView(body)) {
|
||||
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
|
||||
}
|
||||
@@ -90401,6 +90326,8 @@ function statusCodeToNumber(statusCode) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
@@ -90597,6 +90524,59 @@ function throttlingRetryPolicy(options = {}) {
|
||||
};
|
||||
}
|
||||
//# 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
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// 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,
|
||||
};
|
||||
}
|
||||
if (key === "headers" && isObject(value)) {
|
||||
if (key === "headers") {
|
||||
return this.sanitizeHeaders(value);
|
||||
}
|
||||
else if (key === "url" && typeof value === "string") {
|
||||
else if (key === "url") {
|
||||
return this.sanitizeUrl(value);
|
||||
}
|
||||
else if (key === "query" && isObject(value)) {
|
||||
else if (key === "query") {
|
||||
return this.sanitizeQuery(value);
|
||||
}
|
||||
else if (key === "body") {
|
||||
@@ -86173,68 +86173,6 @@ function logPolicy_logPolicy(options = {}) {
|
||||
};
|
||||
}
|
||||
//# 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
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
@@ -86252,14 +86190,15 @@ function getHeaderName() {
|
||||
async function userAgentPlatform_setPlatformSpecificData(map) {
|
||||
if (process && process.versions) {
|
||||
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
|
||||
if (process.versions.bun) {
|
||||
map.set("Bun", `${process.versions.bun} (${osInfo})`);
|
||||
const versions = process.versions;
|
||||
if (versions.bun) {
|
||||
map.set("Bun", `${versions.bun} (${osInfo})`);
|
||||
}
|
||||
else if (process.versions.deno) {
|
||||
map.set("Deno", `${process.versions.deno} (${osInfo})`);
|
||||
else if (versions.deno) {
|
||||
map.set("Deno", `${versions.deno} (${osInfo})`);
|
||||
}
|
||||
else if (process.versions.node) {
|
||||
map.set("Node", `${process.versions.node} (${osInfo})`);
|
||||
else if (versions.node) {
|
||||
map.set("Node", `${versions.node} (${osInfo})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86566,7 +86505,7 @@ function isSystemError(err) {
|
||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const constants_SDK_VERSION = "0.3.5";
|
||||
const constants_SDK_VERSION = "0.3.3";
|
||||
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
||||
//# sourceMappingURL=constants.js.map
|
||||
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
|
||||
@@ -86576,7 +86515,6 @@ const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
|
||||
|
||||
|
||||
|
||||
|
||||
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
|
||||
/**
|
||||
* The programmatic identifier of the retryPolicy.
|
||||
@@ -86607,11 +86545,11 @@ function retryPolicy_retryPolicy(strategies, options = { maxRetries: constants_D
|
||||
// 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 the received error is not a RestError, it is immediately thrown.
|
||||
if (!restError_isRestError(e)) {
|
||||
responseError = e;
|
||||
if (!e || responseError.name !== "RestError") {
|
||||
throw e;
|
||||
}
|
||||
responseError = e;
|
||||
response = e.response;
|
||||
response = responseError.response;
|
||||
}
|
||||
if (request.abortSignal?.aborted) {
|
||||
logger.error(`Retry ${retryCount}: Request aborted.`);
|
||||
@@ -87012,15 +86950,16 @@ function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) {
|
||||
if (request.tlsSettings) {
|
||||
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 (!cachedAgents.httpProxyAgent) {
|
||||
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl);
|
||||
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl, { headers });
|
||||
}
|
||||
request.agent = cachedAgents.httpProxyAgent;
|
||||
}
|
||||
else {
|
||||
if (!cachedAgents.httpsProxyAgent) {
|
||||
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl);
|
||||
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl, { headers });
|
||||
}
|
||||
request.agent = cachedAgents.httpsProxyAgent;
|
||||
}
|
||||
@@ -87072,13 +87011,13 @@ function typeGuards_isBinaryBody(body) {
|
||||
(body instanceof Uint8Array ||
|
||||
typeGuards_isReadableStream(body) ||
|
||||
typeof body === "function" ||
|
||||
(typeof Blob !== "undefined" && body instanceof Blob)));
|
||||
body instanceof Blob));
|
||||
}
|
||||
function typeGuards_isReadableStream(x) {
|
||||
return isNodeReadableStream(x) || isWebReadableStream(x);
|
||||
}
|
||||
function typeGuards_isBlob(x) {
|
||||
return typeof Blob !== "undefined" && x instanceof Blob;
|
||||
function isBlob(x) {
|
||||
return typeof x.stream === "function";
|
||||
}
|
||||
//# sourceMappingURL=typeGuards.js.map
|
||||
// EXTERNAL MODULE: external "stream"
|
||||
@@ -87124,7 +87063,7 @@ function toStream(source) {
|
||||
if (source instanceof Uint8Array) {
|
||||
return external_stream_.Readable.from(Buffer.from(source));
|
||||
}
|
||||
else if (typeGuards_isBlob(source)) {
|
||||
else if (isBlob(source)) {
|
||||
return ensureNodeStream(source.stream());
|
||||
}
|
||||
else {
|
||||
@@ -87174,7 +87113,7 @@ function getLength(source) {
|
||||
if (source instanceof Uint8Array) {
|
||||
return source.byteLength;
|
||||
}
|
||||
else if (typeGuards_isBlob(source)) {
|
||||
else if (isBlob(source)) {
|
||||
// if was created using createFile then -1 means we have an unknown size
|
||||
return source.size === -1 ? undefined : source.size;
|
||||
}
|
||||
@@ -87703,14 +87642,9 @@ async function sendRequest_sendRequest(method, url, pipeline, options = {}, cust
|
||||
* @returns returns the content-type
|
||||
*/
|
||||
function getRequestContentType(options = {}) {
|
||||
if (options.contentType) {
|
||||
return options.contentType;
|
||||
}
|
||||
const headerContentType = options.headers?.["content-type"];
|
||||
if (typeof headerContentType === "string") {
|
||||
return headerContentType;
|
||||
}
|
||||
return getContentType(options.body);
|
||||
return (options.contentType ??
|
||||
options.headers?.["content-type"] ??
|
||||
getContentType(options.body));
|
||||
}
|
||||
/**
|
||||
* Function to determine the content-type of a body
|
||||
@@ -87725,9 +87659,6 @@ function getContentType(body) {
|
||||
if (ArrayBuffer.isView(body)) {
|
||||
return "application/octet-stream";
|
||||
}
|
||||
if (isBlob(body) && body.type) {
|
||||
return body.type;
|
||||
}
|
||||
if (typeof body === "string") {
|
||||
try {
|
||||
JSON.parse(body);
|
||||
@@ -87778,15 +87709,9 @@ function getRequestBody(body, contentType = "") {
|
||||
if (typeof FormData !== "undefined" && body instanceof FormData) {
|
||||
return { body };
|
||||
}
|
||||
if (isBlob(body)) {
|
||||
return { body };
|
||||
}
|
||||
if (isReadableStream(body)) {
|
||||
return { body };
|
||||
}
|
||||
if (typeof body === "function") {
|
||||
return { body: body };
|
||||
}
|
||||
if (ArrayBuffer.isView(body)) {
|
||||
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
|
||||
}
|
||||
@@ -87976,6 +87901,8 @@ function statusCodeToNumber(statusCode) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
@@ -88172,6 +88099,59 @@ function throttlingRetryPolicy(options = {}) {
|
||||
};
|
||||
}
|
||||
//# 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
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "upload-artifact",
|
||||
"version": "7.0.1",
|
||||
"version": "7.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "upload-artifact",
|
||||
"version": "7.0.1",
|
||||
"version": "7.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^6.2.0",
|
||||
@@ -2477,9 +2477,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typespec/ts-http-runtime": {
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.5.tgz",
|
||||
"integrity": "sha512-yURCknZhvywvQItHMMmFSo+fq5arCUIyz/CVk7jD89MSai7dkaX8ufjCWp3NttLojoTVbcE72ri+be/TnEbMHw==",
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.3.tgz",
|
||||
"integrity": "sha512-91fp6CAAJSRtH5ja95T1FHSKa8aPW9/Zw6cta81jlZTUw/+Vq8jM/AfF/14h2b71wwR84JUTW/3Y8QPhDAawFA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "upload-artifact",
|
||||
"version": "7.0.1",
|
||||
"version": "7.0.0",
|
||||
"description": "Upload an Actions Artifact in a workflow run",
|
||||
"type": "module",
|
||||
"main": "dist/upload/index.js",
|
||||
|
||||
Reference in New Issue
Block a user