mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-20 13:38:28 +02:00
Next release of setup-bun
This commit is contained in:
parent
ed9eb0969c
commit
9c14b74b45
1082 changed files with 242557 additions and 173810 deletions
4
node_modules/@azure/core-lro/dist-esm/src/http/operation.js
generated
vendored
4
node_modules/@azure/core-lro/dist-esm/src/http/operation.js
generated
vendored
|
@ -229,6 +229,9 @@ export function getResourceLocation({ flatResponse }, state) {
|
|||
}
|
||||
return state.config.resourceLocation;
|
||||
}
|
||||
export function isOperationError(e) {
|
||||
return e.name === "RestError";
|
||||
}
|
||||
/** Polls the long-running operation. */
|
||||
export async function pollHttpOperation(inputs) {
|
||||
const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs;
|
||||
|
@ -243,6 +246,7 @@ export async function pollHttpOperation(inputs) {
|
|||
getPollingInterval: parseRetryAfter,
|
||||
getOperationLocation,
|
||||
getOperationStatus,
|
||||
isOperationError,
|
||||
getResourceLocation,
|
||||
options,
|
||||
/**
|
||||
|
|
2
node_modules/@azure/core-lro/dist-esm/src/http/operation.js.map
generated
vendored
2
node_modules/@azure/core-lro/dist-esm/src/http/operation.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
node_modules/@azure/core-lro/dist-esm/src/http/poller.js
generated
vendored
3
node_modules/@azure/core-lro/dist-esm/src/http/poller.js
generated
vendored
|
@ -1,6 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { getOperationLocation, getOperationStatus, getResourceLocation, getStatusFromInitialResponse, inferLroMode, parseRetryAfter, } from "./operation";
|
||||
import { getOperationLocation, getOperationStatus, getResourceLocation, getStatusFromInitialResponse, inferLroMode, isOperationError, parseRetryAfter, } from "./operation";
|
||||
import { buildCreatePoller } from "../poller/poller";
|
||||
/**
|
||||
* Creates a poller that can be used to poll a long-running operation.
|
||||
|
@ -13,6 +13,7 @@ export async function createHttpPoller(lro, options) {
|
|||
return buildCreatePoller({
|
||||
getStatusFromInitialResponse,
|
||||
getStatusFromPollResponse: getOperationStatus,
|
||||
isOperationError,
|
||||
getOperationLocation,
|
||||
getResourceLocation,
|
||||
getPollingInterval: parseRetryAfter,
|
||||
|
|
2
node_modules/@azure/core-lro/dist-esm/src/http/poller.js.map
generated
vendored
2
node_modules/@azure/core-lro/dist-esm/src/http/poller.js.map
generated
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../src/http/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,YAAY,EACZ,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAyB,EACzB,OAAkD;IAElD,MAAM,EACJ,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,qBAAqB,GAAG,KAAK,GAC9B,GAAG,OAAO,IAAI,EAAE,CAAC;IAClB,OAAO,iBAAiB,CAA+B;QACrD,4BAA4B;QAC5B,yBAAyB,EAAE,kBAAkB;QAC7C,oBAAoB;QACpB,mBAAmB;QACnB,kBAAkB,EAAE,eAAe;QACnC,qBAAqB;KACtB,CAAC,CACA;QACE,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,kBAAkB,EAAE,CAAC;YAChD,MAAM,MAAM,GAAG,YAAY,CAAC;gBAC1B,WAAW,EAAE,QAAQ,CAAC,WAAW;gBACjC,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,aAAa,EAAE,GAAG,CAAC,aAAa;gBAChC,sBAAsB;aACvB,CAAC,CAAC;YACH,uBACE,QAAQ,EACR,iBAAiB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,EAC5C,gBAAgB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,IACvC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC5D;QACJ,CAAC;QACD,IAAI,EAAE,GAAG,CAAC,eAAe;KAC1B,EACD;QACE,YAAY;QACZ,qBAAqB;QACrB,WAAW;QACX,WAAW;QACX,aAAa,EAAE,aAAa;YAC1B,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC;YACjE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAuB;KAClD,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LongRunningOperation, LroResponse } from \"./models\";\nimport { OperationState, SimplePollerLike } from \"../poller/models\";\nimport {\n getOperationLocation,\n getOperationStatus,\n getResourceLocation,\n getStatusFromInitialResponse,\n inferLroMode,\n parseRetryAfter,\n} from \"./operation\";\nimport { CreateHttpPollerOptions } from \"./models\";\nimport { buildCreatePoller } from \"../poller/poller\";\n\n/**\n * Creates a poller that can be used to poll a long-running operation.\n * @param lro - Description of the long-running operation\n * @param options - options to configure the poller\n * @returns an initialized poller\n */\nexport async function createHttpPoller<TResult, TState extends OperationState<TResult>>(\n lro: LongRunningOperation,\n options?: CreateHttpPollerOptions<TResult, TState>\n): Promise<SimplePollerLike<TState, TResult>> {\n const {\n resourceLocationConfig,\n intervalInMs,\n processResult,\n restoreFrom,\n updateState,\n withOperationLocation,\n resolveOnUnsuccessful = false,\n } = options || {};\n return buildCreatePoller<LroResponse, TResult, TState>({\n getStatusFromInitialResponse,\n getStatusFromPollResponse: getOperationStatus,\n getOperationLocation,\n getResourceLocation,\n getPollingInterval: parseRetryAfter,\n resolveOnUnsuccessful,\n })(\n {\n init: async () => {\n const response = await lro.sendInitialRequest();\n const config = inferLroMode({\n rawResponse: response.rawResponse,\n requestPath: lro.requestPath,\n requestMethod: lro.requestMethod,\n resourceLocationConfig,\n });\n return {\n response,\n operationLocation: config?.operationLocation,\n resourceLocation: config?.resourceLocation,\n ...(config?.mode ? { metadata: { mode: config.mode } } : {}),\n };\n },\n poll: lro.sendPollRequest,\n },\n {\n intervalInMs,\n withOperationLocation,\n restoreFrom,\n updateState,\n processResult: processResult\n ? ({ flatResponse }, state) => processResult(flatResponse, state)\n : ({ flatResponse }) => flatResponse as TResult,\n }\n );\n}\n"]}
|
||||
{"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../src/http/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAyB,EACzB,OAAkD;IAElD,MAAM,EACJ,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,qBAAqB,GAAG,KAAK,GAC9B,GAAG,OAAO,IAAI,EAAE,CAAC;IAClB,OAAO,iBAAiB,CAA+B;QACrD,4BAA4B;QAC5B,yBAAyB,EAAE,kBAAkB;QAC7C,gBAAgB;QAChB,oBAAoB;QACpB,mBAAmB;QACnB,kBAAkB,EAAE,eAAe;QACnC,qBAAqB;KACtB,CAAC,CACA;QACE,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,kBAAkB,EAAE,CAAC;YAChD,MAAM,MAAM,GAAG,YAAY,CAAC;gBAC1B,WAAW,EAAE,QAAQ,CAAC,WAAW;gBACjC,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,aAAa,EAAE,GAAG,CAAC,aAAa;gBAChC,sBAAsB;aACvB,CAAC,CAAC;YACH,uBACE,QAAQ,EACR,iBAAiB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,EAC5C,gBAAgB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,IACvC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC5D;QACJ,CAAC;QACD,IAAI,EAAE,GAAG,CAAC,eAAe;KAC1B,EACD;QACE,YAAY;QACZ,qBAAqB;QACrB,WAAW;QACX,WAAW;QACX,aAAa,EAAE,aAAa;YAC1B,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC;YACjE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAuB;KAClD,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LongRunningOperation, LroResponse } from \"./models\";\nimport { OperationState, SimplePollerLike } from \"../poller/models\";\nimport {\n getOperationLocation,\n getOperationStatus,\n getResourceLocation,\n getStatusFromInitialResponse,\n inferLroMode,\n isOperationError,\n parseRetryAfter,\n} from \"./operation\";\nimport { CreateHttpPollerOptions } from \"./models\";\nimport { buildCreatePoller } from \"../poller/poller\";\n\n/**\n * Creates a poller that can be used to poll a long-running operation.\n * @param lro - Description of the long-running operation\n * @param options - options to configure the poller\n * @returns an initialized poller\n */\nexport async function createHttpPoller<TResult, TState extends OperationState<TResult>>(\n lro: LongRunningOperation,\n options?: CreateHttpPollerOptions<TResult, TState>\n): Promise<SimplePollerLike<TState, TResult>> {\n const {\n resourceLocationConfig,\n intervalInMs,\n processResult,\n restoreFrom,\n updateState,\n withOperationLocation,\n resolveOnUnsuccessful = false,\n } = options || {};\n return buildCreatePoller<LroResponse, TResult, TState>({\n getStatusFromInitialResponse,\n getStatusFromPollResponse: getOperationStatus,\n isOperationError,\n getOperationLocation,\n getResourceLocation,\n getPollingInterval: parseRetryAfter,\n resolveOnUnsuccessful,\n })(\n {\n init: async () => {\n const response = await lro.sendInitialRequest();\n const config = inferLroMode({\n rawResponse: response.rawResponse,\n requestPath: lro.requestPath,\n requestMethod: lro.requestMethod,\n resourceLocationConfig,\n });\n return {\n response,\n operationLocation: config?.operationLocation,\n resourceLocation: config?.resourceLocation,\n ...(config?.mode ? { metadata: { mode: config.mode } } : {}),\n };\n },\n poll: lro.sendPollRequest,\n },\n {\n intervalInMs,\n withOperationLocation,\n restoreFrom,\n updateState,\n processResult: processResult\n ? ({ flatResponse }, state) => processResult(flatResponse, state)\n : ({ flatResponse }) => flatResponse as TResult,\n }\n );\n}\n"]}
|
2
node_modules/@azure/core-lro/dist-esm/src/poller/models.js.map
generated
vendored
2
node_modules/@azure/core-lro/dist-esm/src/poller/models.js.map
generated
vendored
File diff suppressed because one or more lines are too long
16
node_modules/@azure/core-lro/dist-esm/src/poller/operation.js
generated
vendored
16
node_modules/@azure/core-lro/dist-esm/src/poller/operation.js
generated
vendored
|
@ -14,10 +14,12 @@ export function deserializeState(serializedState) {
|
|||
}
|
||||
}
|
||||
function setStateError(inputs) {
|
||||
const { state, stateProxy } = inputs;
|
||||
const { state, stateProxy, isOperationError } = inputs;
|
||||
return (error) => {
|
||||
stateProxy.setError(state, error);
|
||||
stateProxy.setFailed(state);
|
||||
if (isOperationError(error)) {
|
||||
stateProxy.setError(state, error);
|
||||
stateProxy.setFailed(state);
|
||||
}
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
|
@ -72,10 +74,11 @@ export async function initOperation(inputs) {
|
|||
return state;
|
||||
}
|
||||
async function pollOperationHelper(inputs) {
|
||||
const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, options, } = inputs;
|
||||
const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs;
|
||||
const response = await poll(operationLocation, options).catch(setStateError({
|
||||
state,
|
||||
stateProxy,
|
||||
isOperationError,
|
||||
}));
|
||||
const status = getOperationStatus(response, state);
|
||||
logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`);
|
||||
|
@ -83,7 +86,7 @@ async function pollOperationHelper(inputs) {
|
|||
const resourceLocation = getResourceLocation(response, state);
|
||||
if (resourceLocation !== undefined) {
|
||||
return {
|
||||
response: await poll(resourceLocation).catch(setStateError({ state, stateProxy })),
|
||||
response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })),
|
||||
status,
|
||||
};
|
||||
}
|
||||
|
@ -92,7 +95,7 @@ async function pollOperationHelper(inputs) {
|
|||
}
|
||||
/** Polls the long-running operation. */
|
||||
export async function pollOperation(inputs) {
|
||||
const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
|
||||
const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
|
||||
const { operationLocation } = state.config;
|
||||
if (operationLocation !== undefined) {
|
||||
const { response, status } = await pollOperationHelper({
|
||||
|
@ -102,6 +105,7 @@ export async function pollOperation(inputs) {
|
|||
stateProxy,
|
||||
operationLocation,
|
||||
getResourceLocation,
|
||||
isOperationError,
|
||||
options,
|
||||
});
|
||||
processOperationStatus({
|
||||
|
|
2
node_modules/@azure/core-lro/dist-esm/src/poller/operation.js.map
generated
vendored
2
node_modules/@azure/core-lro/dist-esm/src/poller/operation.js.map
generated
vendored
File diff suppressed because one or more lines are too long
60
node_modules/@azure/core-lro/dist-esm/src/poller/poller.js
generated
vendored
60
node_modules/@azure/core-lro/dist-esm/src/poller/poller.js
generated
vendored
|
@ -28,7 +28,7 @@ const createStateProxy = () => ({
|
|||
* Returns a poller factory.
|
||||
*/
|
||||
export function buildCreatePoller(inputs) {
|
||||
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, getResourceLocation, getPollingInterval, resolveOnUnsuccessful, } = inputs;
|
||||
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, resolveOnUnsuccessful, } = inputs;
|
||||
return async ({ init, poll }, options) => {
|
||||
const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {};
|
||||
const stateProxy = createStateProxy();
|
||||
|
@ -59,6 +59,7 @@ export function buildCreatePoller(inputs) {
|
|||
const abortController = new AbortController();
|
||||
const handlers = new Map();
|
||||
const handleProgressEvents = async () => handlers.forEach((h) => h(state));
|
||||
const cancelErrMsg = "Operation was canceled";
|
||||
let currentPollIntervalInMs = intervalInMs;
|
||||
const poller = {
|
||||
getOperationState: () => state,
|
||||
|
@ -91,35 +92,46 @@ export function buildCreatePoller(inputs) {
|
|||
await poller.poll({ abortSignal });
|
||||
}
|
||||
}
|
||||
switch (state.status) {
|
||||
case "succeeded": {
|
||||
return poller.getResult();
|
||||
}
|
||||
case "canceled": {
|
||||
if (!resolveOnUnsuccessful)
|
||||
throw new Error("Operation was canceled");
|
||||
return poller.getResult();
|
||||
}
|
||||
case "failed": {
|
||||
if (!resolveOnUnsuccessful)
|
||||
if (resolveOnUnsuccessful) {
|
||||
return poller.getResult();
|
||||
}
|
||||
else {
|
||||
switch (state.status) {
|
||||
case "succeeded":
|
||||
return poller.getResult();
|
||||
case "canceled":
|
||||
throw new Error(cancelErrMsg);
|
||||
case "failed":
|
||||
throw state.error;
|
||||
return poller.getResult();
|
||||
}
|
||||
case "notStarted":
|
||||
case "running": {
|
||||
// Unreachable
|
||||
throw new Error(`polling completed without succeeding or failing`);
|
||||
case "notStarted":
|
||||
case "running":
|
||||
throw new Error(`Polling completed without succeeding or failing`);
|
||||
}
|
||||
}
|
||||
})().finally(() => {
|
||||
resultPromise = undefined;
|
||||
}))),
|
||||
async poll(pollOptions) {
|
||||
if (resolveOnUnsuccessful) {
|
||||
if (poller.isDone())
|
||||
return;
|
||||
}
|
||||
else {
|
||||
switch (state.status) {
|
||||
case "succeeded":
|
||||
return;
|
||||
case "canceled":
|
||||
throw new Error(cancelErrMsg);
|
||||
case "failed":
|
||||
throw state.error;
|
||||
}
|
||||
}
|
||||
await pollOperation({
|
||||
poll,
|
||||
state,
|
||||
stateProxy,
|
||||
getOperationLocation,
|
||||
isOperationError,
|
||||
withOperationLocation,
|
||||
getPollingInterval,
|
||||
getOperationStatus: getStatusFromPollResponse,
|
||||
|
@ -133,11 +145,13 @@ export function buildCreatePoller(inputs) {
|
|||
setErrorAsResult: !resolveOnUnsuccessful,
|
||||
});
|
||||
await handleProgressEvents();
|
||||
if (state.status === "canceled" && !resolveOnUnsuccessful) {
|
||||
throw new Error("Operation was canceled");
|
||||
}
|
||||
if (state.status === "failed" && !resolveOnUnsuccessful) {
|
||||
throw state.error;
|
||||
if (!resolveOnUnsuccessful) {
|
||||
switch (state.status) {
|
||||
case "canceled":
|
||||
throw new Error(cancelErrMsg);
|
||||
case "failed":
|
||||
throw state.error;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
2
node_modules/@azure/core-lro/dist-esm/src/poller/poller.js.map
generated
vendored
2
node_modules/@azure/core-lro/dist-esm/src/poller/poller.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue