Next release of setup-bun

This commit is contained in:
Ashcon Partovi 2023-02-22 17:47:24 -08:00
parent ed9eb0969c
commit 9c14b74b45
1082 changed files with 242557 additions and 173810 deletions

View file

@ -6,7 +6,6 @@ var uuid = require('uuid');
var util = require('util');
var tslib = require('tslib');
var xml2js = require('xml2js');
var abortController = require('@azure/abort-controller');
var coreUtil = require('@azure/core-util');
var logger$1 = require('@azure/logger');
var coreAuth = require('@azure/core-auth');
@ -14,6 +13,7 @@ var os = require('os');
var http = require('http');
var https = require('https');
var tough = require('tough-cookie');
var abortController = require('@azure/abort-controller');
var tunnel = require('tunnel');
var stream = require('stream');
var FormData = require('form-data');
@ -236,7 +236,7 @@ const Constants = {
/**
* The core-http version
*/
coreHttpVersion: "2.2.7",
coreHttpVersion: "2.3.1",
/**
* Specifies HTTP.
*/
@ -1153,7 +1153,8 @@ function isSpecialXmlProperty(propertyName, options) {
return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName);
}
function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) {
var _a;
var _a, _b;
const xmlCharKey = (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {
mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName");
}
@ -1184,6 +1185,16 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {
instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options);
}
else if (propertyMapper.xmlIsMsText) {
if (responseBody[xmlCharKey] !== undefined) {
instance[key] = responseBody[xmlCharKey];
}
else if (typeof responseBody === "string") {
// The special case where xml parser parses "<Name>content</Name>" into JSON of
// `{ name: "content"}` instead of `{ name: { "_": "content" }}`
instance[key] = responseBody;
}
}
else {
const propertyName = xmlElementName || xmlName || serializedName;
if (propertyMapper.xmlIsWrapped) {
@ -1202,7 +1213,7 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
xmlName is "Cors" and xmlElementName is"CorsRule".
*/
const wrapped = responseBody[xmlName];
const elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : [];
const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : [];
instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options);
}
else {
@ -2628,7 +2639,11 @@ class NodeFetchHttpClient {
body = uploadReportStream;
}
const platformSpecificRequestInit = await this.prepareRequest(httpRequest);
const requestInit = Object.assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit);
const requestInit = Object.assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method,
// the types for RequestInit are from the browser, which expects AbortSignal to
// have `reason` and `throwIfAborted`, but these don't exist on our polyfill
// for Node.
signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit);
let operationResponse;
try {
const response = await this.fetch(httpRequest.url, requestInit);
@ -3390,49 +3405,6 @@ function updateRetryData(retryOptions, retryData = { retryCount: 0, retryInterva
return retryData;
}
// Copyright (c) Microsoft Corporation.
const StandardAbortMessage$1 = "The operation was aborted.";
/**
* A wrapper for setTimeout that resolves a promise after delayInMs milliseconds.
* @param delayInMs - The number of milliseconds to be delayed.
* @param value - The value to be resolved with after a timeout of t milliseconds.
* @param options - The options for delay - currently abort options
* @param abortSignal - The abortSignal associated with containing operation.
* @param abortErrorMsg - The abort error message associated with containing operation.
* @returns - Resolved promise
*/
function delay(delayInMs, value, options) {
return new Promise((resolve, reject) => {
let timer = undefined;
let onAborted = undefined;
const rejectOnAbort = () => {
return reject(new abortController.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage$1));
};
const removeListeners = () => {
if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) {
options.abortSignal.removeEventListener("abort", onAborted);
}
};
onAborted = () => {
if (coreUtil.isDefined(timer)) {
clearTimeout(timer);
}
removeListeners();
return rejectOnAbort();
};
if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) {
return rejectOnAbort();
}
timer = setTimeout(() => {
removeListeners();
resolve(value);
}, delayInMs);
if (options === null || options === void 0 ? void 0 : options.abortSignal) {
options.abortSignal.addEventListener("abort", onAborted);
}
});
}
// Copyright (c) Microsoft Corporation.
/**
* Policy that retries the request as many times as configured for as long as the max retry time interval specified, each retry waiting longer to begin than the last time.
@ -3513,7 +3485,7 @@ async function retry$1(policy, request, response, retryData, requestError) {
if (!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response)) {
logger.info(`Retrying request in ${retryData.retryInterval}`);
try {
await delay(retryData.retryInterval);
await coreUtil.delay(retryData.retryInterval);
const res = await policy._nextPolicy.sendRequest(request.clone());
return retry$1(policy, request, res, retryData);
}
@ -3808,7 +3780,7 @@ async function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) {
}
let token = await tryGetAccessToken();
while (token === null) {
await delay(retryIntervalInMs);
await coreUtil.delay(retryIntervalInMs);
token = await tryGetAccessToken();
}
return token;
@ -4340,7 +4312,7 @@ async function getRegistrationStatus(policy, url, originalRequest) {
return true;
}
else {
await delay(policy._retryTimeout * 1000);
await coreUtil.delay(policy._retryTimeout * 1000);
return getRegistrationStatus(policy, url, originalRequest);
}
}
@ -4432,7 +4404,7 @@ async function retry(policy, request, operationResponse, err, retryData) {
if (shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) {
// If previous operation ended with an error and the policy allows a retry, do that
try {
await delay(retryData.retryInterval);
await coreUtil.delay(retryData.retryInterval);
return policy._nextPolicy.sendRequest(request.clone());
}
catch (nestedErr) {
@ -4507,7 +4479,7 @@ class ThrottlingRetryPolicy extends BaseRequestPolicy {
const delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader);
if (delayInMs) {
this.numberOfRetries += 1;
await delay(delayInMs, undefined, {
await coreUtil.delay(delayInMs, {
abortSignal: httpRequest.abortSignal,
abortErrorMsg: StandardAbortMessage,
});
@ -5463,6 +5435,10 @@ class TopicCredentials extends ApiKeyCredentials {
}
}
Object.defineProperty(exports, 'delay', {
enumerable: true,
get: function () { return coreUtil.delay; }
});
Object.defineProperty(exports, 'isTokenCredential', {
enumerable: true,
get: function () { return coreAuth.isTokenCredential; }
@ -5490,7 +5466,6 @@ exports.applyMixins = applyMixins;
exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy;
exports.createPipelineFromOptions = createPipelineFromOptions;
exports.createSpanFunction = createSpanFunction;
exports.delay = delay;
exports.deserializationPolicy = deserializationPolicy;
exports.deserializeResponseBody = deserializeResponseBody;
exports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy;