3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-04-14 08:08:43 +00:00

bump deps and rebuild

This commit is contained in:
Arpad Borsos 2022-10-14 21:54:25 +02:00
parent c4652c677c
commit d4d463bd9b
No known key found for this signature in database
GPG key ID: 570F20163159CB55
4 changed files with 1488 additions and 1323 deletions

326
dist/restore/index.js vendored
View file

@ -2494,7 +2494,6 @@ const file_command_1 = __nccwpck_require__(717);
const utils_1 = __nccwpck_require__(5278); const utils_1 = __nccwpck_require__(5278);
const os = __importStar(__nccwpck_require__(2037)); const os = __importStar(__nccwpck_require__(2037));
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
const uuid_1 = __nccwpck_require__(8974);
const oidc_utils_1 = __nccwpck_require__(8041); const oidc_utils_1 = __nccwpck_require__(8041);
/** /**
* The code to exit an action * The code to exit an action
@ -2524,20 +2523,9 @@ function exportVariable(name, val) {
process.env[name] = convertedVal; process.env[name] = convertedVal;
const filePath = process.env['GITHUB_ENV'] || ''; const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) { if (filePath) {
const delimiter = `ghadelimiter_${uuid_1.v4()}`; return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
if (name.includes(delimiter)) {
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
} }
if (convertedVal.includes(delimiter)) {
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
}
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal); command_1.issueCommand('set-env', { name }, convertedVal);
}
} }
exports.exportVariable = exportVariable; exports.exportVariable = exportVariable;
/** /**
@ -2555,7 +2543,7 @@ exports.setSecret = setSecret;
function addPath(inputPath) { function addPath(inputPath) {
const filePath = process.env['GITHUB_PATH'] || ''; const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) { if (filePath) {
file_command_1.issueCommand('PATH', inputPath); file_command_1.issueFileCommand('PATH', inputPath);
} }
else { else {
command_1.issueCommand('add-path', {}, inputPath); command_1.issueCommand('add-path', {}, inputPath);
@ -2595,7 +2583,10 @@ function getMultilineInput(name, options) {
const inputs = getInput(name, options) const inputs = getInput(name, options)
.split('\n') .split('\n')
.filter(x => x !== ''); .filter(x => x !== '');
if (options && options.trimWhitespace === false) {
return inputs; return inputs;
}
return inputs.map(input => input.trim());
} }
exports.getMultilineInput = getMultilineInput; exports.getMultilineInput = getMultilineInput;
/** /**
@ -2628,8 +2619,12 @@ exports.getBooleanInput = getBooleanInput;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function setOutput(name, value) { function setOutput(name, value) {
const filePath = process.env['GITHUB_OUTPUT'] || '';
if (filePath) {
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
}
process.stdout.write(os.EOL); process.stdout.write(os.EOL);
command_1.issueCommand('set-output', { name }, value); command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
} }
exports.setOutput = setOutput; exports.setOutput = setOutput;
/** /**
@ -2758,7 +2753,11 @@ exports.group = group;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function saveState(name, value) { function saveState(name, value) {
command_1.issueCommand('save-state', { name }, value); const filePath = process.env['GITHUB_STATE'] || '';
if (filePath) {
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
}
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
} }
exports.saveState = saveState; exports.saveState = saveState;
/** /**
@ -2824,13 +2823,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.issueCommand = void 0; exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
// We use any as a valid input type // We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__nccwpck_require__(7147)); const fs = __importStar(__nccwpck_require__(7147));
const os = __importStar(__nccwpck_require__(2037)); const os = __importStar(__nccwpck_require__(2037));
const uuid_1 = __nccwpck_require__(8974);
const utils_1 = __nccwpck_require__(5278); const utils_1 = __nccwpck_require__(5278);
function issueCommand(command, message) { function issueFileCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`]; const filePath = process.env[`GITHUB_${command}`];
if (!filePath) { if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`); throw new Error(`Unable to find environment variable for file command ${command}`);
@ -2842,7 +2842,22 @@ function issueCommand(command, message) {
encoding: 'utf8' encoding: 'utf8'
}); });
} }
exports.issueCommand = issueCommand; exports.issueFileCommand = issueFileCommand;
function prepareKeyValueMessage(key, value) {
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
const convertedValue = utils_1.toCommandValue(value);
// These should realistically never happen, but just in case someone finds a
// way to exploit uuid generation let's not allow keys or values that contain
// the delimiter.
if (key.includes(delimiter)) {
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
}
if (convertedValue.includes(delimiter)) {
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
}
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
}
exports.prepareKeyValueMessage = prepareKeyValueMessage;
//# sourceMappingURL=file-command.js.map //# sourceMappingURL=file-command.js.map
/***/ }), /***/ }),
@ -17230,8 +17245,7 @@ function setStateError(inputs) {
}; };
} }
function processOperationStatus(result) { function processOperationStatus(result) {
const { state, stateProxy, status } = result; const { state, stateProxy, status, isDone, processResult, response, setErrorAsResult } = result;
logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`);
switch (status) { switch (status) {
case "succeeded": { case "succeeded": {
stateProxy.setSucceeded(state); stateProxy.setSucceeded(state);
@ -17247,6 +17261,15 @@ function processOperationStatus(result) {
break; break;
} }
} }
if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) ||
(isDone === undefined &&
["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) {
stateProxy.setResult(state, buildResult({
response,
state,
processResult,
}));
}
} }
function buildResult(inputs) { function buildResult(inputs) {
const { processResult, response, state } = inputs; const { processResult, response, state } = inputs;
@ -17256,7 +17279,7 @@ function buildResult(inputs) {
* Initiates the long-running operation. * Initiates the long-running operation.
*/ */
async function initOperation(inputs) { async function initOperation(inputs) {
const { init, stateProxy, processResult, getOperationStatus, withOperationLocation } = inputs; const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs;
const { operationLocation, resourceLocation, metadata, response } = await init(); const { operationLocation, resourceLocation, metadata, response } = await init();
if (operationLocation) if (operationLocation)
withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false);
@ -17267,41 +17290,33 @@ async function initOperation(inputs) {
}; };
logger.verbose(`LRO: Operation description:`, config); logger.verbose(`LRO: Operation description:`, config);
const state = stateProxy.initState(config); const state = stateProxy.initState(config);
const status = getOperationStatus(response, state); const status = getOperationStatus({ response, state, operationLocation });
if (status === "succeeded" || operationLocation === undefined) { processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult });
stateProxy.setSucceeded(state);
stateProxy.setResult(state, buildResult({
response,
state,
processResult,
}));
}
return state; return state;
} }
async function pollOperationHelper(inputs) { async function pollOperationHelper(inputs) {
const { poll, state, stateProxy, operationLocation, resourceLocation, getOperationStatus, options, } = inputs; const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, options, } = inputs;
const response = await poll(operationLocation, options).catch(setStateError({ const response = await poll(operationLocation, options).catch(setStateError({
state, state,
stateProxy, stateProxy,
})); }));
const status = getOperationStatus(response, state); const status = getOperationStatus(response, state);
processOperationStatus({ logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`);
status, if (status === "succeeded") {
state, const resourceLocation = getResourceLocation(response, state);
stateProxy, if (resourceLocation !== undefined) {
});
if (status === "succeeded" && resourceLocation !== undefined) {
return { return {
response: await poll(resourceLocation).catch(setStateError({ state, stateProxy })), response: await poll(resourceLocation).catch(setStateError({ state, stateProxy })),
status, status,
}; };
} }
}
return { response, status }; return { response, status };
} }
/** Polls the long-running operation. */ /** Polls the long-running operation. */
async function pollOperation(inputs) { async function pollOperation(inputs) {
const { poll, state, stateProxy, options, getOperationStatus, getOperationLocation, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, } = inputs; const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
const { operationLocation, resourceLocation } = state.config; const { operationLocation } = state.config;
if (operationLocation !== undefined) { if (operationLocation !== undefined) {
const { response, status } = await pollOperationHelper({ const { response, status } = await pollOperationHelper({
poll, poll,
@ -17309,18 +17324,19 @@ async function pollOperation(inputs) {
state, state,
stateProxy, stateProxy,
operationLocation, operationLocation,
resourceLocation, getResourceLocation,
options, options,
}); });
if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || processOperationStatus({
(isDone === undefined && ["succeeded", "canceled"].includes(status))) { status,
stateProxy.setResult(state, buildResult({
response, response,
state, state,
stateProxy,
isDone,
processResult, processResult,
})); setErrorAsResult,
} });
else { if (!terminalStates.includes(status)) {
const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response);
if (intervalInMs) if (intervalInMs)
setDelay(intervalInMs); setDelay(intervalInMs);
@ -17411,15 +17427,21 @@ function inferLroMode(inputs) {
return undefined; return undefined;
} }
} }
function transformStatus(status) { function transformStatus(inputs) {
switch (status === null || status === void 0 ? void 0 : status.toLowerCase()) { const { status, statusCode } = inputs;
if (typeof status !== "string" && status !== undefined) {
throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`);
}
switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) {
case undefined: case undefined:
return toOperationStatus(statusCode);
case "succeeded": case "succeeded":
return "succeeded"; return "succeeded";
case "failed": case "failed":
return "failed"; return "failed";
case "running": case "running":
case "accepted": case "accepted":
case "started":
case "canceling": case "canceling":
case "cancelling": case "cancelling":
return "running"; return "running";
@ -17435,13 +17457,13 @@ function transformStatus(status) {
function getStatus(rawResponse) { function getStatus(rawResponse) {
var _a; var _a;
const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
return transformStatus(status); return transformStatus({ status, statusCode: rawResponse.statusCode });
} }
function getProvisioningState(rawResponse) { function getProvisioningState(rawResponse) {
var _a, _b; var _a, _b;
const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
const state = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState;
return transformStatus(state); return transformStatus({ status, statusCode: rawResponse.statusCode });
} }
function toOperationStatus(statusCode) { function toOperationStatus(statusCode) {
if (statusCode === 202) { if (statusCode === 202) {
@ -17473,11 +17495,28 @@ function calculatePollingIntervalFromDate(retryAfterDate) {
} }
return undefined; return undefined;
} }
function getStatusFromInitialResponse(inputs) {
const { response, state, operationLocation } = inputs;
function helper() {
var _a;
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
switch (mode) {
case undefined:
return toOperationStatus(response.rawResponse.statusCode);
case "Body":
return getOperationStatus(response, state);
default:
return "running";
}
}
const status = helper();
return status === "running" && operationLocation === undefined ? "succeeded" : status;
}
/** /**
* Initiates the long-running operation. * Initiates the long-running operation.
*/ */
async function initHttpOperation(inputs) { async function initHttpOperation(inputs) {
const { stateProxy, resourceLocationConfig, processResult, lro } = inputs; const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs;
return initOperation({ return initOperation({
init: async () => { init: async () => {
const response = await lro.sendInitialRequest(); const response = await lro.sendInitialRequest();
@ -17493,14 +17532,8 @@ async function initHttpOperation(inputs) {
processResult: processResult processResult: processResult
? ({ flatResponse }, state) => processResult(flatResponse, state) ? ({ flatResponse }, state) => processResult(flatResponse, state)
: ({ flatResponse }) => flatResponse, : ({ flatResponse }) => flatResponse,
getOperationStatus: (response, state) => { getOperationStatus: getStatusFromInitialResponse,
var _a; setErrorAsResult,
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
return mode === undefined ||
(mode === "Body" && getOperationStatus(response, state) === "succeeded")
? "succeeded"
: "running";
},
}); });
} }
function getOperationLocation({ rawResponse }, state) { function getOperationLocation({ rawResponse }, state) {
@ -17536,12 +17569,21 @@ function getOperationStatus({ rawResponse }, state) {
return getProvisioningState(rawResponse); return getProvisioningState(rawResponse);
} }
default: default:
throw new Error(`Unexpected operation mode: ${mode}`); throw new Error(`Internal error: Unexpected operation mode: ${mode}`);
} }
} }
function getResourceLocation({ flatResponse }, state) {
if (typeof flatResponse === "object") {
const resourceLocation = flatResponse.resourceLocation;
if (resourceLocation !== undefined) {
state.config.resourceLocation = resourceLocation;
}
}
return state.config.resourceLocation;
}
/** Polls the long-running operation. */ /** Polls the long-running operation. */
async function pollHttpOperation(inputs) { async function pollHttpOperation(inputs) {
const { lro, stateProxy, options, processResult, updateState, setDelay, state } = inputs; const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs;
return pollOperation({ return pollOperation({
state, state,
stateProxy, stateProxy,
@ -17553,12 +17595,14 @@ async function pollHttpOperation(inputs) {
getPollingInterval: parseRetryAfter, getPollingInterval: parseRetryAfter,
getOperationLocation, getOperationLocation,
getOperationStatus, getOperationStatus,
getResourceLocation,
options, options,
/** /**
* The expansion here is intentional because `lro` could be an object that * The expansion here is intentional because `lro` could be an object that
* references an inner this, so we need to preserve a reference to it. * references an inner this, so we need to preserve a reference to it.
*/ */
poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions),
setErrorAsResult,
}); });
} }
@ -17639,7 +17683,7 @@ const createStateProxy$1 = () => ({
* Returns a poller factory. * Returns a poller factory.
*/ */
function buildCreatePoller(inputs) { function buildCreatePoller(inputs) {
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, getPollingInterval, } = inputs; const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, getResourceLocation, getPollingInterval, resolveOnUnsuccessful, } = inputs;
return async ({ init, poll }, options) => { return async ({ init, poll }, options) => {
const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {};
const stateProxy = createStateProxy$1(); const stateProxy = createStateProxy$1();
@ -17663,6 +17707,7 @@ function buildCreatePoller(inputs) {
processResult, processResult,
getOperationStatus: getStatusFromInitialResponse, getOperationStatus: getStatusFromInitialResponse,
withOperationLocation, withOperationLocation,
setErrorAsResult: !resolveOnUnsuccessful,
}); });
let resultPromise; let resultPromise;
let cancelJob; let cancelJob;
@ -17706,10 +17751,14 @@ function buildCreatePoller(inputs) {
return poller.getResult(); return poller.getResult();
} }
case "canceled": { case "canceled": {
if (!resolveOnUnsuccessful)
throw new Error("Operation was canceled"); throw new Error("Operation was canceled");
return poller.getResult();
} }
case "failed": { case "failed": {
if (!resolveOnUnsuccessful)
throw state.error; throw state.error;
return poller.getResult();
} }
case "notStarted": case "notStarted":
case "running": { case "running": {
@ -17729,18 +17778,20 @@ function buildCreatePoller(inputs) {
withOperationLocation, withOperationLocation,
getPollingInterval, getPollingInterval,
getOperationStatus: getStatusFromPollResponse, getOperationStatus: getStatusFromPollResponse,
getResourceLocation,
processResult, processResult,
updateState, updateState,
options: pollOptions, options: pollOptions,
setDelay: (pollIntervalInMs) => { setDelay: (pollIntervalInMs) => {
currentPollIntervalInMs = pollIntervalInMs; currentPollIntervalInMs = pollIntervalInMs;
}, },
setErrorAsResult: !resolveOnUnsuccessful,
}); });
await handleProgressEvents(); await handleProgressEvents();
if (state.status === "canceled") { if (state.status === "canceled" && !resolveOnUnsuccessful) {
throw new Error("Operation was canceled"); throw new Error("Operation was canceled");
} }
if (state.status === "failed") { if (state.status === "failed" && !resolveOnUnsuccessful) {
throw state.error; throw state.error;
} }
}, },
@ -17757,19 +17808,14 @@ function buildCreatePoller(inputs) {
* @returns an initialized poller * @returns an initialized poller
*/ */
async function createHttpPoller(lro, options) { async function createHttpPoller(lro, options) {
const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, } = options || {}; const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {};
return buildCreatePoller({ return buildCreatePoller({
getStatusFromInitialResponse: (response, state) => { getStatusFromInitialResponse,
var _a;
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
return mode === undefined ||
(mode === "Body" && getOperationStatus(response, state) === "succeeded")
? "succeeded"
: "running";
},
getStatusFromPollResponse: getOperationStatus, getStatusFromPollResponse: getOperationStatus,
getOperationLocation, getOperationLocation,
getResourceLocation,
getPollingInterval: parseRetryAfter, getPollingInterval: parseRetryAfter,
resolveOnUnsuccessful,
})({ })({
init: async () => { init: async () => {
const response = await lro.sendInitialRequest(); const response = await lro.sendInitialRequest();
@ -17812,9 +17858,10 @@ const createStateProxy = () => ({
isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error),
}); });
class GenericPollOperation { class GenericPollOperation {
constructor(state, lro, lroResourceLocationConfig, processResult, updateState, isDone) { constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) {
this.state = state; this.state = state;
this.lro = lro; this.lro = lro;
this.setErrorAsResult = setErrorAsResult;
this.lroResourceLocationConfig = lroResourceLocationConfig; this.lroResourceLocationConfig = lroResourceLocationConfig;
this.processResult = processResult; this.processResult = processResult;
this.updateState = updateState; this.updateState = updateState;
@ -17832,11 +17879,12 @@ class GenericPollOperation {
stateProxy, stateProxy,
resourceLocationConfig: this.lroResourceLocationConfig, resourceLocationConfig: this.lroResourceLocationConfig,
processResult: this.processResult, processResult: this.processResult,
setErrorAsResult: this.setErrorAsResult,
}))); })));
} }
const updateState = this.updateState; const updateState = this.updateState;
const isDone = this.isDone; const isDone = this.isDone;
if (!this.state.isCompleted) { if (!this.state.isCompleted && this.state.error === undefined) {
await pollHttpOperation({ await pollHttpOperation({
lro: this.lro, lro: this.lro,
state: this.state, state: this.state,
@ -17852,6 +17900,7 @@ class GenericPollOperation {
setDelay: (intervalInMs) => { setDelay: (intervalInMs) => {
this.pollerConfig.intervalInMs = intervalInMs; this.pollerConfig.intervalInMs = intervalInMs;
}, },
setErrorAsResult: this.setErrorAsResult,
}); });
} }
(_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state);
@ -18024,6 +18073,8 @@ class Poller {
* @param operation - Must contain the basic properties of `PollOperation<State, TResult>`. * @param operation - Must contain the basic properties of `PollOperation<State, TResult>`.
*/ */
constructor(operation) { constructor(operation) {
/** controls whether to throw an error if the operation failed or was canceled. */
this.resolveOnUnsuccessful = false;
this.stopped = true; this.stopped = true;
this.pollProgressCallbacks = []; this.pollProgressCallbacks = [];
this.operation = operation; this.operation = operation;
@ -18061,16 +18112,11 @@ class Poller {
*/ */
async pollOnce(options = {}) { async pollOnce(options = {}) {
if (!this.isDone()) { if (!this.isDone()) {
try {
this.operation = await this.operation.update({ this.operation = await this.operation.update({
abortSignal: options.abortSignal, abortSignal: options.abortSignal,
fireProgress: this.fireProgress.bind(this), fireProgress: this.fireProgress.bind(this),
}); });
} }
catch (e) {
this.operation.state.error = e;
}
}
this.processUpdatedState(); this.processUpdatedState();
} }
/** /**
@ -18113,22 +18159,26 @@ class Poller {
processUpdatedState() { processUpdatedState() {
if (this.operation.state.error) { if (this.operation.state.error) {
this.stopped = true; this.stopped = true;
if (!this.resolveOnUnsuccessful) {
this.reject(this.operation.state.error); this.reject(this.operation.state.error);
throw this.operation.state.error; throw this.operation.state.error;
} }
}
if (this.operation.state.isCancelled) { if (this.operation.state.isCancelled) {
this.stopped = true; this.stopped = true;
if (!this.resolveOnUnsuccessful) {
const error = new PollerCancelledError("Operation was canceled"); const error = new PollerCancelledError("Operation was canceled");
this.reject(error); this.reject(error);
throw error; throw error;
} }
else if (this.isDone() && this.resolve) { }
if (this.isDone() && this.resolve) {
// If the poller has finished polling, this means we now have a result. // If the poller has finished polling, this means we now have a result.
// However, it can be the case that TResult is instantiated to void, so // However, it can be the case that TResult is instantiated to void, so
// we are not expecting a result anyway. To assert that we might not // we are not expecting a result anyway. To assert that we might not
// have a result eventually after finishing polling, we cast the result // have a result eventually after finishing polling, we cast the result
// to TResult. // to TResult.
this.resolve(this.operation.state.result); this.resolve(this.getResult());
} }
} }
/** /**
@ -18273,12 +18323,13 @@ class Poller {
*/ */
class LroEngine extends Poller { class LroEngine extends Poller {
constructor(lro, options) { constructor(lro, options) {
const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom } = options || {}; const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {};
const state = resumeFrom const state = resumeFrom
? deserializeState(resumeFrom) ? deserializeState(resumeFrom)
: {}; : {};
const operation = new GenericPollOperation(state, lro, options === null || options === void 0 ? void 0 : options.lroResourceLocationConfig, options === null || options === void 0 ? void 0 : options.processResult, options === null || options === void 0 ? void 0 : options.updateState, options === null || options === void 0 ? void 0 : options.isDone); const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone);
super(operation); super(operation);
this.resolveOnUnsuccessful = resolveOnUnsuccessful;
this.config = { intervalInMs: intervalInMs }; this.config = { intervalInMs: intervalInMs };
operation.setPollerConfig(this.config); operation.setPollerConfig(this.config);
} }
@ -18945,6 +18996,7 @@ exports.setSpanContext = setSpanContext;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
var abortController = __nccwpck_require__(2557);
var crypto = __nccwpck_require__(6113); var crypto = __nccwpck_require__(6113);
// Copyright (c) Microsoft Corporation. // Copyright (c) Microsoft Corporation.
@ -18957,13 +19009,77 @@ const isNode = typeof process !== "undefined" && Boolean(process.version) && Boo
// Copyright (c) Microsoft Corporation. // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license. // Licensed under the MIT license.
/**
* Helper TypeGuard that checks if something is defined or not.
* @param thing - Anything
*/
function isDefined(thing) {
return typeof thing !== "undefined" && thing !== null;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified properties.
* @param thing - Anything.
* @param properties - The name of the properties that should appear in the object.
*/
function isObjectWithProperties(thing, properties) {
if (!isDefined(thing) || typeof thing !== "object") {
return false;
}
for (const property of properties) {
if (!objectHasProperty(thing, property)) {
return false;
}
}
return true;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified property.
* @param thing - Any object.
* @param property - The name of the property that should appear in the object.
*/
function objectHasProperty(thing, property) {
return (isDefined(thing) && typeof thing === "object" && property in thing);
}
// Copyright (c) Microsoft Corporation.
const StandardAbortMessage = "The operation was aborted.";
/** /**
* A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds.
* @param timeInMs - The number of milliseconds to be delayed. * @param timeInMs - The number of milliseconds to be delayed.
* @param options - The options for delay - currently abort options
* @returns Promise that is resolved after timeInMs * @returns Promise that is resolved after timeInMs
*/ */
function delay(timeInMs) { function delay(timeInMs, options) {
return new Promise((resolve) => setTimeout(() => resolve(), timeInMs)); return new Promise((resolve, reject) => {
let timer = undefined;
let onAborted = undefined;
const rejectOnAbort = () => {
var _a;
return reject(new abortController.AbortError((_a = options === null || options === void 0 ? void 0 : options.abortErrorMsg) !== null && _a !== void 0 ? _a : StandardAbortMessage));
};
const removeListeners = () => {
if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) {
options.abortSignal.removeEventListener("abort", onAborted);
}
};
onAborted = () => {
if (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();
}, timeInMs);
if (options === null || options === void 0 ? void 0 : options.abortSignal) {
options.abortSignal.addEventListener("abort", onAborted);
}
});
} }
// Copyright (c) Microsoft Corporation. // Copyright (c) Microsoft Corporation.
@ -19061,40 +19177,6 @@ async function computeSha256Hash(content, encoding) {
return crypto.createHash("sha256").update(content).digest(encoding); return crypto.createHash("sha256").update(content).digest(encoding);
} }
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Helper TypeGuard that checks if something is defined or not.
* @param thing - Anything
*/
function isDefined(thing) {
return typeof thing !== "undefined" && thing !== null;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified properties.
* @param thing - Anything.
* @param properties - The name of the properties that should appear in the object.
*/
function isObjectWithProperties(thing, properties) {
if (!isDefined(thing) || typeof thing !== "object") {
return false;
}
for (const property of properties) {
if (!objectHasProperty(thing, property)) {
return false;
}
}
return true;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified property.
* @param thing - Any object.
* @param property - The name of the property that should appear in the object.
*/
function objectHasProperty(thing, property) {
return (isDefined(thing) && typeof thing === "object" && property in thing);
}
exports.computeSha256Hash = computeSha256Hash; exports.computeSha256Hash = computeSha256Hash;
exports.computeSha256Hmac = computeSha256Hmac; exports.computeSha256Hmac = computeSha256Hmac;
exports.delay = delay; exports.delay = delay;

326
dist/save/index.js vendored
View file

@ -2494,7 +2494,6 @@ const file_command_1 = __nccwpck_require__(717);
const utils_1 = __nccwpck_require__(5278); const utils_1 = __nccwpck_require__(5278);
const os = __importStar(__nccwpck_require__(2037)); const os = __importStar(__nccwpck_require__(2037));
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
const uuid_1 = __nccwpck_require__(8974);
const oidc_utils_1 = __nccwpck_require__(8041); const oidc_utils_1 = __nccwpck_require__(8041);
/** /**
* The code to exit an action * The code to exit an action
@ -2524,20 +2523,9 @@ function exportVariable(name, val) {
process.env[name] = convertedVal; process.env[name] = convertedVal;
const filePath = process.env['GITHUB_ENV'] || ''; const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) { if (filePath) {
const delimiter = `ghadelimiter_${uuid_1.v4()}`; return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
if (name.includes(delimiter)) {
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
} }
if (convertedVal.includes(delimiter)) {
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
}
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal); command_1.issueCommand('set-env', { name }, convertedVal);
}
} }
exports.exportVariable = exportVariable; exports.exportVariable = exportVariable;
/** /**
@ -2555,7 +2543,7 @@ exports.setSecret = setSecret;
function addPath(inputPath) { function addPath(inputPath) {
const filePath = process.env['GITHUB_PATH'] || ''; const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) { if (filePath) {
file_command_1.issueCommand('PATH', inputPath); file_command_1.issueFileCommand('PATH', inputPath);
} }
else { else {
command_1.issueCommand('add-path', {}, inputPath); command_1.issueCommand('add-path', {}, inputPath);
@ -2595,7 +2583,10 @@ function getMultilineInput(name, options) {
const inputs = getInput(name, options) const inputs = getInput(name, options)
.split('\n') .split('\n')
.filter(x => x !== ''); .filter(x => x !== '');
if (options && options.trimWhitespace === false) {
return inputs; return inputs;
}
return inputs.map(input => input.trim());
} }
exports.getMultilineInput = getMultilineInput; exports.getMultilineInput = getMultilineInput;
/** /**
@ -2628,8 +2619,12 @@ exports.getBooleanInput = getBooleanInput;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function setOutput(name, value) { function setOutput(name, value) {
const filePath = process.env['GITHUB_OUTPUT'] || '';
if (filePath) {
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
}
process.stdout.write(os.EOL); process.stdout.write(os.EOL);
command_1.issueCommand('set-output', { name }, value); command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
} }
exports.setOutput = setOutput; exports.setOutput = setOutput;
/** /**
@ -2758,7 +2753,11 @@ exports.group = group;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function saveState(name, value) { function saveState(name, value) {
command_1.issueCommand('save-state', { name }, value); const filePath = process.env['GITHUB_STATE'] || '';
if (filePath) {
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
}
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
} }
exports.saveState = saveState; exports.saveState = saveState;
/** /**
@ -2824,13 +2823,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.issueCommand = void 0; exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
// We use any as a valid input type // We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__nccwpck_require__(7147)); const fs = __importStar(__nccwpck_require__(7147));
const os = __importStar(__nccwpck_require__(2037)); const os = __importStar(__nccwpck_require__(2037));
const uuid_1 = __nccwpck_require__(8974);
const utils_1 = __nccwpck_require__(5278); const utils_1 = __nccwpck_require__(5278);
function issueCommand(command, message) { function issueFileCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`]; const filePath = process.env[`GITHUB_${command}`];
if (!filePath) { if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`); throw new Error(`Unable to find environment variable for file command ${command}`);
@ -2842,7 +2842,22 @@ function issueCommand(command, message) {
encoding: 'utf8' encoding: 'utf8'
}); });
} }
exports.issueCommand = issueCommand; exports.issueFileCommand = issueFileCommand;
function prepareKeyValueMessage(key, value) {
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
const convertedValue = utils_1.toCommandValue(value);
// These should realistically never happen, but just in case someone finds a
// way to exploit uuid generation let's not allow keys or values that contain
// the delimiter.
if (key.includes(delimiter)) {
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
}
if (convertedValue.includes(delimiter)) {
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
}
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
}
exports.prepareKeyValueMessage = prepareKeyValueMessage;
//# sourceMappingURL=file-command.js.map //# sourceMappingURL=file-command.js.map
/***/ }), /***/ }),
@ -17230,8 +17245,7 @@ function setStateError(inputs) {
}; };
} }
function processOperationStatus(result) { function processOperationStatus(result) {
const { state, stateProxy, status } = result; const { state, stateProxy, status, isDone, processResult, response, setErrorAsResult } = result;
logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`);
switch (status) { switch (status) {
case "succeeded": { case "succeeded": {
stateProxy.setSucceeded(state); stateProxy.setSucceeded(state);
@ -17247,6 +17261,15 @@ function processOperationStatus(result) {
break; break;
} }
} }
if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) ||
(isDone === undefined &&
["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) {
stateProxy.setResult(state, buildResult({
response,
state,
processResult,
}));
}
} }
function buildResult(inputs) { function buildResult(inputs) {
const { processResult, response, state } = inputs; const { processResult, response, state } = inputs;
@ -17256,7 +17279,7 @@ function buildResult(inputs) {
* Initiates the long-running operation. * Initiates the long-running operation.
*/ */
async function initOperation(inputs) { async function initOperation(inputs) {
const { init, stateProxy, processResult, getOperationStatus, withOperationLocation } = inputs; const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs;
const { operationLocation, resourceLocation, metadata, response } = await init(); const { operationLocation, resourceLocation, metadata, response } = await init();
if (operationLocation) if (operationLocation)
withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false);
@ -17267,41 +17290,33 @@ async function initOperation(inputs) {
}; };
logger.verbose(`LRO: Operation description:`, config); logger.verbose(`LRO: Operation description:`, config);
const state = stateProxy.initState(config); const state = stateProxy.initState(config);
const status = getOperationStatus(response, state); const status = getOperationStatus({ response, state, operationLocation });
if (status === "succeeded" || operationLocation === undefined) { processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult });
stateProxy.setSucceeded(state);
stateProxy.setResult(state, buildResult({
response,
state,
processResult,
}));
}
return state; return state;
} }
async function pollOperationHelper(inputs) { async function pollOperationHelper(inputs) {
const { poll, state, stateProxy, operationLocation, resourceLocation, getOperationStatus, options, } = inputs; const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, options, } = inputs;
const response = await poll(operationLocation, options).catch(setStateError({ const response = await poll(operationLocation, options).catch(setStateError({
state, state,
stateProxy, stateProxy,
})); }));
const status = getOperationStatus(response, state); const status = getOperationStatus(response, state);
processOperationStatus({ logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`);
status, if (status === "succeeded") {
state, const resourceLocation = getResourceLocation(response, state);
stateProxy, if (resourceLocation !== undefined) {
});
if (status === "succeeded" && resourceLocation !== undefined) {
return { return {
response: await poll(resourceLocation).catch(setStateError({ state, stateProxy })), response: await poll(resourceLocation).catch(setStateError({ state, stateProxy })),
status, status,
}; };
} }
}
return { response, status }; return { response, status };
} }
/** Polls the long-running operation. */ /** Polls the long-running operation. */
async function pollOperation(inputs) { async function pollOperation(inputs) {
const { poll, state, stateProxy, options, getOperationStatus, getOperationLocation, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, } = inputs; const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
const { operationLocation, resourceLocation } = state.config; const { operationLocation } = state.config;
if (operationLocation !== undefined) { if (operationLocation !== undefined) {
const { response, status } = await pollOperationHelper({ const { response, status } = await pollOperationHelper({
poll, poll,
@ -17309,18 +17324,19 @@ async function pollOperation(inputs) {
state, state,
stateProxy, stateProxy,
operationLocation, operationLocation,
resourceLocation, getResourceLocation,
options, options,
}); });
if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || processOperationStatus({
(isDone === undefined && ["succeeded", "canceled"].includes(status))) { status,
stateProxy.setResult(state, buildResult({
response, response,
state, state,
stateProxy,
isDone,
processResult, processResult,
})); setErrorAsResult,
} });
else { if (!terminalStates.includes(status)) {
const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response);
if (intervalInMs) if (intervalInMs)
setDelay(intervalInMs); setDelay(intervalInMs);
@ -17411,15 +17427,21 @@ function inferLroMode(inputs) {
return undefined; return undefined;
} }
} }
function transformStatus(status) { function transformStatus(inputs) {
switch (status === null || status === void 0 ? void 0 : status.toLowerCase()) { const { status, statusCode } = inputs;
if (typeof status !== "string" && status !== undefined) {
throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`);
}
switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) {
case undefined: case undefined:
return toOperationStatus(statusCode);
case "succeeded": case "succeeded":
return "succeeded"; return "succeeded";
case "failed": case "failed":
return "failed"; return "failed";
case "running": case "running":
case "accepted": case "accepted":
case "started":
case "canceling": case "canceling":
case "cancelling": case "cancelling":
return "running"; return "running";
@ -17435,13 +17457,13 @@ function transformStatus(status) {
function getStatus(rawResponse) { function getStatus(rawResponse) {
var _a; var _a;
const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
return transformStatus(status); return transformStatus({ status, statusCode: rawResponse.statusCode });
} }
function getProvisioningState(rawResponse) { function getProvisioningState(rawResponse) {
var _a, _b; var _a, _b;
const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
const state = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState;
return transformStatus(state); return transformStatus({ status, statusCode: rawResponse.statusCode });
} }
function toOperationStatus(statusCode) { function toOperationStatus(statusCode) {
if (statusCode === 202) { if (statusCode === 202) {
@ -17473,11 +17495,28 @@ function calculatePollingIntervalFromDate(retryAfterDate) {
} }
return undefined; return undefined;
} }
function getStatusFromInitialResponse(inputs) {
const { response, state, operationLocation } = inputs;
function helper() {
var _a;
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
switch (mode) {
case undefined:
return toOperationStatus(response.rawResponse.statusCode);
case "Body":
return getOperationStatus(response, state);
default:
return "running";
}
}
const status = helper();
return status === "running" && operationLocation === undefined ? "succeeded" : status;
}
/** /**
* Initiates the long-running operation. * Initiates the long-running operation.
*/ */
async function initHttpOperation(inputs) { async function initHttpOperation(inputs) {
const { stateProxy, resourceLocationConfig, processResult, lro } = inputs; const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs;
return initOperation({ return initOperation({
init: async () => { init: async () => {
const response = await lro.sendInitialRequest(); const response = await lro.sendInitialRequest();
@ -17493,14 +17532,8 @@ async function initHttpOperation(inputs) {
processResult: processResult processResult: processResult
? ({ flatResponse }, state) => processResult(flatResponse, state) ? ({ flatResponse }, state) => processResult(flatResponse, state)
: ({ flatResponse }) => flatResponse, : ({ flatResponse }) => flatResponse,
getOperationStatus: (response, state) => { getOperationStatus: getStatusFromInitialResponse,
var _a; setErrorAsResult,
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
return mode === undefined ||
(mode === "Body" && getOperationStatus(response, state) === "succeeded")
? "succeeded"
: "running";
},
}); });
} }
function getOperationLocation({ rawResponse }, state) { function getOperationLocation({ rawResponse }, state) {
@ -17536,12 +17569,21 @@ function getOperationStatus({ rawResponse }, state) {
return getProvisioningState(rawResponse); return getProvisioningState(rawResponse);
} }
default: default:
throw new Error(`Unexpected operation mode: ${mode}`); throw new Error(`Internal error: Unexpected operation mode: ${mode}`);
} }
} }
function getResourceLocation({ flatResponse }, state) {
if (typeof flatResponse === "object") {
const resourceLocation = flatResponse.resourceLocation;
if (resourceLocation !== undefined) {
state.config.resourceLocation = resourceLocation;
}
}
return state.config.resourceLocation;
}
/** Polls the long-running operation. */ /** Polls the long-running operation. */
async function pollHttpOperation(inputs) { async function pollHttpOperation(inputs) {
const { lro, stateProxy, options, processResult, updateState, setDelay, state } = inputs; const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs;
return pollOperation({ return pollOperation({
state, state,
stateProxy, stateProxy,
@ -17553,12 +17595,14 @@ async function pollHttpOperation(inputs) {
getPollingInterval: parseRetryAfter, getPollingInterval: parseRetryAfter,
getOperationLocation, getOperationLocation,
getOperationStatus, getOperationStatus,
getResourceLocation,
options, options,
/** /**
* The expansion here is intentional because `lro` could be an object that * The expansion here is intentional because `lro` could be an object that
* references an inner this, so we need to preserve a reference to it. * references an inner this, so we need to preserve a reference to it.
*/ */
poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions),
setErrorAsResult,
}); });
} }
@ -17639,7 +17683,7 @@ const createStateProxy$1 = () => ({
* Returns a poller factory. * Returns a poller factory.
*/ */
function buildCreatePoller(inputs) { function buildCreatePoller(inputs) {
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, getPollingInterval, } = inputs; const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, getResourceLocation, getPollingInterval, resolveOnUnsuccessful, } = inputs;
return async ({ init, poll }, options) => { return async ({ init, poll }, options) => {
const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {};
const stateProxy = createStateProxy$1(); const stateProxy = createStateProxy$1();
@ -17663,6 +17707,7 @@ function buildCreatePoller(inputs) {
processResult, processResult,
getOperationStatus: getStatusFromInitialResponse, getOperationStatus: getStatusFromInitialResponse,
withOperationLocation, withOperationLocation,
setErrorAsResult: !resolveOnUnsuccessful,
}); });
let resultPromise; let resultPromise;
let cancelJob; let cancelJob;
@ -17706,10 +17751,14 @@ function buildCreatePoller(inputs) {
return poller.getResult(); return poller.getResult();
} }
case "canceled": { case "canceled": {
if (!resolveOnUnsuccessful)
throw new Error("Operation was canceled"); throw new Error("Operation was canceled");
return poller.getResult();
} }
case "failed": { case "failed": {
if (!resolveOnUnsuccessful)
throw state.error; throw state.error;
return poller.getResult();
} }
case "notStarted": case "notStarted":
case "running": { case "running": {
@ -17729,18 +17778,20 @@ function buildCreatePoller(inputs) {
withOperationLocation, withOperationLocation,
getPollingInterval, getPollingInterval,
getOperationStatus: getStatusFromPollResponse, getOperationStatus: getStatusFromPollResponse,
getResourceLocation,
processResult, processResult,
updateState, updateState,
options: pollOptions, options: pollOptions,
setDelay: (pollIntervalInMs) => { setDelay: (pollIntervalInMs) => {
currentPollIntervalInMs = pollIntervalInMs; currentPollIntervalInMs = pollIntervalInMs;
}, },
setErrorAsResult: !resolveOnUnsuccessful,
}); });
await handleProgressEvents(); await handleProgressEvents();
if (state.status === "canceled") { if (state.status === "canceled" && !resolveOnUnsuccessful) {
throw new Error("Operation was canceled"); throw new Error("Operation was canceled");
} }
if (state.status === "failed") { if (state.status === "failed" && !resolveOnUnsuccessful) {
throw state.error; throw state.error;
} }
}, },
@ -17757,19 +17808,14 @@ function buildCreatePoller(inputs) {
* @returns an initialized poller * @returns an initialized poller
*/ */
async function createHttpPoller(lro, options) { async function createHttpPoller(lro, options) {
const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, } = options || {}; const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {};
return buildCreatePoller({ return buildCreatePoller({
getStatusFromInitialResponse: (response, state) => { getStatusFromInitialResponse,
var _a;
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
return mode === undefined ||
(mode === "Body" && getOperationStatus(response, state) === "succeeded")
? "succeeded"
: "running";
},
getStatusFromPollResponse: getOperationStatus, getStatusFromPollResponse: getOperationStatus,
getOperationLocation, getOperationLocation,
getResourceLocation,
getPollingInterval: parseRetryAfter, getPollingInterval: parseRetryAfter,
resolveOnUnsuccessful,
})({ })({
init: async () => { init: async () => {
const response = await lro.sendInitialRequest(); const response = await lro.sendInitialRequest();
@ -17812,9 +17858,10 @@ const createStateProxy = () => ({
isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error),
}); });
class GenericPollOperation { class GenericPollOperation {
constructor(state, lro, lroResourceLocationConfig, processResult, updateState, isDone) { constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) {
this.state = state; this.state = state;
this.lro = lro; this.lro = lro;
this.setErrorAsResult = setErrorAsResult;
this.lroResourceLocationConfig = lroResourceLocationConfig; this.lroResourceLocationConfig = lroResourceLocationConfig;
this.processResult = processResult; this.processResult = processResult;
this.updateState = updateState; this.updateState = updateState;
@ -17832,11 +17879,12 @@ class GenericPollOperation {
stateProxy, stateProxy,
resourceLocationConfig: this.lroResourceLocationConfig, resourceLocationConfig: this.lroResourceLocationConfig,
processResult: this.processResult, processResult: this.processResult,
setErrorAsResult: this.setErrorAsResult,
}))); })));
} }
const updateState = this.updateState; const updateState = this.updateState;
const isDone = this.isDone; const isDone = this.isDone;
if (!this.state.isCompleted) { if (!this.state.isCompleted && this.state.error === undefined) {
await pollHttpOperation({ await pollHttpOperation({
lro: this.lro, lro: this.lro,
state: this.state, state: this.state,
@ -17852,6 +17900,7 @@ class GenericPollOperation {
setDelay: (intervalInMs) => { setDelay: (intervalInMs) => {
this.pollerConfig.intervalInMs = intervalInMs; this.pollerConfig.intervalInMs = intervalInMs;
}, },
setErrorAsResult: this.setErrorAsResult,
}); });
} }
(_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state);
@ -18024,6 +18073,8 @@ class Poller {
* @param operation - Must contain the basic properties of `PollOperation<State, TResult>`. * @param operation - Must contain the basic properties of `PollOperation<State, TResult>`.
*/ */
constructor(operation) { constructor(operation) {
/** controls whether to throw an error if the operation failed or was canceled. */
this.resolveOnUnsuccessful = false;
this.stopped = true; this.stopped = true;
this.pollProgressCallbacks = []; this.pollProgressCallbacks = [];
this.operation = operation; this.operation = operation;
@ -18061,16 +18112,11 @@ class Poller {
*/ */
async pollOnce(options = {}) { async pollOnce(options = {}) {
if (!this.isDone()) { if (!this.isDone()) {
try {
this.operation = await this.operation.update({ this.operation = await this.operation.update({
abortSignal: options.abortSignal, abortSignal: options.abortSignal,
fireProgress: this.fireProgress.bind(this), fireProgress: this.fireProgress.bind(this),
}); });
} }
catch (e) {
this.operation.state.error = e;
}
}
this.processUpdatedState(); this.processUpdatedState();
} }
/** /**
@ -18113,22 +18159,26 @@ class Poller {
processUpdatedState() { processUpdatedState() {
if (this.operation.state.error) { if (this.operation.state.error) {
this.stopped = true; this.stopped = true;
if (!this.resolveOnUnsuccessful) {
this.reject(this.operation.state.error); this.reject(this.operation.state.error);
throw this.operation.state.error; throw this.operation.state.error;
} }
}
if (this.operation.state.isCancelled) { if (this.operation.state.isCancelled) {
this.stopped = true; this.stopped = true;
if (!this.resolveOnUnsuccessful) {
const error = new PollerCancelledError("Operation was canceled"); const error = new PollerCancelledError("Operation was canceled");
this.reject(error); this.reject(error);
throw error; throw error;
} }
else if (this.isDone() && this.resolve) { }
if (this.isDone() && this.resolve) {
// If the poller has finished polling, this means we now have a result. // If the poller has finished polling, this means we now have a result.
// However, it can be the case that TResult is instantiated to void, so // However, it can be the case that TResult is instantiated to void, so
// we are not expecting a result anyway. To assert that we might not // we are not expecting a result anyway. To assert that we might not
// have a result eventually after finishing polling, we cast the result // have a result eventually after finishing polling, we cast the result
// to TResult. // to TResult.
this.resolve(this.operation.state.result); this.resolve(this.getResult());
} }
} }
/** /**
@ -18273,12 +18323,13 @@ class Poller {
*/ */
class LroEngine extends Poller { class LroEngine extends Poller {
constructor(lro, options) { constructor(lro, options) {
const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom } = options || {}; const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {};
const state = resumeFrom const state = resumeFrom
? deserializeState(resumeFrom) ? deserializeState(resumeFrom)
: {}; : {};
const operation = new GenericPollOperation(state, lro, options === null || options === void 0 ? void 0 : options.lroResourceLocationConfig, options === null || options === void 0 ? void 0 : options.processResult, options === null || options === void 0 ? void 0 : options.updateState, options === null || options === void 0 ? void 0 : options.isDone); const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone);
super(operation); super(operation);
this.resolveOnUnsuccessful = resolveOnUnsuccessful;
this.config = { intervalInMs: intervalInMs }; this.config = { intervalInMs: intervalInMs };
operation.setPollerConfig(this.config); operation.setPollerConfig(this.config);
} }
@ -18945,6 +18996,7 @@ exports.setSpanContext = setSpanContext;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
var abortController = __nccwpck_require__(2557);
var crypto = __nccwpck_require__(6113); var crypto = __nccwpck_require__(6113);
// Copyright (c) Microsoft Corporation. // Copyright (c) Microsoft Corporation.
@ -18957,13 +19009,77 @@ const isNode = typeof process !== "undefined" && Boolean(process.version) && Boo
// Copyright (c) Microsoft Corporation. // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license. // Licensed under the MIT license.
/**
* Helper TypeGuard that checks if something is defined or not.
* @param thing - Anything
*/
function isDefined(thing) {
return typeof thing !== "undefined" && thing !== null;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified properties.
* @param thing - Anything.
* @param properties - The name of the properties that should appear in the object.
*/
function isObjectWithProperties(thing, properties) {
if (!isDefined(thing) || typeof thing !== "object") {
return false;
}
for (const property of properties) {
if (!objectHasProperty(thing, property)) {
return false;
}
}
return true;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified property.
* @param thing - Any object.
* @param property - The name of the property that should appear in the object.
*/
function objectHasProperty(thing, property) {
return (isDefined(thing) && typeof thing === "object" && property in thing);
}
// Copyright (c) Microsoft Corporation.
const StandardAbortMessage = "The operation was aborted.";
/** /**
* A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds.
* @param timeInMs - The number of milliseconds to be delayed. * @param timeInMs - The number of milliseconds to be delayed.
* @param options - The options for delay - currently abort options
* @returns Promise that is resolved after timeInMs * @returns Promise that is resolved after timeInMs
*/ */
function delay(timeInMs) { function delay(timeInMs, options) {
return new Promise((resolve) => setTimeout(() => resolve(), timeInMs)); return new Promise((resolve, reject) => {
let timer = undefined;
let onAborted = undefined;
const rejectOnAbort = () => {
var _a;
return reject(new abortController.AbortError((_a = options === null || options === void 0 ? void 0 : options.abortErrorMsg) !== null && _a !== void 0 ? _a : StandardAbortMessage));
};
const removeListeners = () => {
if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) {
options.abortSignal.removeEventListener("abort", onAborted);
}
};
onAborted = () => {
if (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();
}, timeInMs);
if (options === null || options === void 0 ? void 0 : options.abortSignal) {
options.abortSignal.addEventListener("abort", onAborted);
}
});
} }
// Copyright (c) Microsoft Corporation. // Copyright (c) Microsoft Corporation.
@ -19061,40 +19177,6 @@ async function computeSha256Hash(content, encoding) {
return crypto.createHash("sha256").update(content).digest(encoding); return crypto.createHash("sha256").update(content).digest(encoding);
} }
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Helper TypeGuard that checks if something is defined or not.
* @param thing - Anything
*/
function isDefined(thing) {
return typeof thing !== "undefined" && thing !== null;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified properties.
* @param thing - Anything.
* @param properties - The name of the properties that should appear in the object.
*/
function isObjectWithProperties(thing, properties) {
if (!isDefined(thing) || typeof thing !== "object") {
return false;
}
for (const property of properties) {
if (!objectHasProperty(thing, property)) {
return false;
}
}
return true;
}
/**
* Helper TypeGuard that checks if the input is an object with the specified property.
* @param thing - Any object.
* @param property - The name of the property that should appear in the object.
*/
function objectHasProperty(thing, property) {
return (isDefined(thing) && typeof thing === "object" && property in thing);
}
exports.computeSha256Hash = computeSha256Hash; exports.computeSha256Hash = computeSha256Hash;
exports.computeSha256Hmac = computeSha256Hmac; exports.computeSha256Hmac = computeSha256Hmac;
exports.delay = delay; exports.delay = delay;

73
package-lock.json generated
View file

@ -5,10 +5,11 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "rust-cache",
"version": "2.0.0", "version": "2.0.0",
"license": "LGPL-3.0", "license": "LGPL-3.0",
"dependencies": { "dependencies": {
"@actions/cache": "^3.0.4", "@actions/cache": "^3.0.5",
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/glob": "^0.3.0", "@actions/glob": "^0.3.0",
@ -16,18 +17,18 @@
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.34.0", "@vercel/ncc": "^0.34.0",
"typescript": "4.8.2" "typescript": "4.8.4"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/Swatinem" "url": "https://github.com/sponsors/Swatinem"
} }
}, },
"node_modules/@actions/cache": { "node_modules/@actions/cache": {
"version": "3.0.4", "version": "3.0.5",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.5.tgz",
"integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==", "integrity": "sha512-0WpPmwnRPkn5k5ASmjoX8bY8NrZEPTwN+64nGYJmR/bHjEVgC8svdf5K956wi67tNJBGJky2+UfvNbUOtHmMHg==",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
"@actions/glob": "^0.1.0", "@actions/glob": "^0.1.0",
"@actions/http-client": "^2.0.1", "@actions/http-client": "^2.0.1",
@ -193,9 +194,9 @@
} }
}, },
"node_modules/@azure/core-lro": { "node_modules/@azure/core-lro": {
"version": "2.3.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.3.0.tgz", "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.4.0.tgz",
"integrity": "sha512-n53pk9Gs450rv1zDr9H7aPmMkYHMu9Bwks9qFlK+P46b4virATRf3TNuBZH7DIGVs8ePjtRCNYhcM4D+/Gyn6A==", "integrity": "sha512-F65+rYkll1dpw3RGm8/SSiSj+/QkMeYDanzS/QKlM1dmuneVyXbO46C88V1MRHluLGdMP6qfD3vDRYALn0z0tQ==",
"dependencies": { "dependencies": {
"@azure/abort-controller": "^1.0.0", "@azure/abort-controller": "^1.0.0",
"@azure/logger": "^1.0.0", "@azure/logger": "^1.0.0",
@ -244,10 +245,11 @@
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
}, },
"node_modules/@azure/core-util": { "node_modules/@azure/core-util": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.1.1.tgz",
"integrity": "sha512-+i93lNJNA3Pl3KSuC6xKP2jTL4YFeDfO6VNOaYdk0cppZcLCxt811gS878VsqsCisaltdhl9lhMzK5kbxCiF4w==", "integrity": "sha512-A4TBYVQCtHOigFb2ETiiKFDocBoI1Zk2Ui1KpI42aJSIDexF7DHQFpnjonltXAIU/ceH+1fsZAWWgvX6/AKzog==",
"dependencies": { "dependencies": {
"@azure/abort-controller": "^1.0.0",
"tslib": "^2.2.0" "tslib": "^2.2.0"
}, },
"engines": { "engines": {
@ -331,9 +333,9 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.7.14", "version": "18.8.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.14.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.5.tgz",
"integrity": "sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA==" "integrity": "sha512-Bq7G3AErwe5A/Zki5fdD3O6+0zDChhg671NfPjtIcbtzDNZTv4NPKMRFr7gtYPG7y+B8uTiNK4Ngd9T0FTar6Q=="
}, },
"node_modules/@types/node-fetch": { "node_modules/@types/node-fetch": {
"version": "2.6.2", "version": "2.6.2",
@ -370,7 +372,6 @@
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==", "integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
"dev": true, "dev": true,
"license": "MIT",
"bin": { "bin": {
"ncc": "dist/ncc/cli.js" "ncc": "dist/ncc/cli.js"
} }
@ -591,11 +592,10 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "4.8.2", "version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true, "dev": true,
"license": "Apache-2.0",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@ -667,11 +667,11 @@
}, },
"dependencies": { "dependencies": {
"@actions/cache": { "@actions/cache": {
"version": "3.0.4", "version": "3.0.5",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.5.tgz",
"integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==", "integrity": "sha512-0WpPmwnRPkn5k5ASmjoX8bY8NrZEPTwN+64nGYJmR/bHjEVgC8svdf5K956wi67tNJBGJky2+UfvNbUOtHmMHg==",
"requires": { "requires": {
"@actions/core": "^1.2.6", "@actions/core": "^1.10.0",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
"@actions/glob": "^0.1.0", "@actions/glob": "^0.1.0",
"@actions/http-client": "^2.0.1", "@actions/http-client": "^2.0.1",
@ -826,9 +826,9 @@
} }
}, },
"@azure/core-lro": { "@azure/core-lro": {
"version": "2.3.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.3.0.tgz", "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.4.0.tgz",
"integrity": "sha512-n53pk9Gs450rv1zDr9H7aPmMkYHMu9Bwks9qFlK+P46b4virATRf3TNuBZH7DIGVs8ePjtRCNYhcM4D+/Gyn6A==", "integrity": "sha512-F65+rYkll1dpw3RGm8/SSiSj+/QkMeYDanzS/QKlM1dmuneVyXbO46C88V1MRHluLGdMP6qfD3vDRYALn0z0tQ==",
"requires": { "requires": {
"@azure/abort-controller": "^1.0.0", "@azure/abort-controller": "^1.0.0",
"@azure/logger": "^1.0.0", "@azure/logger": "^1.0.0",
@ -874,10 +874,11 @@
} }
}, },
"@azure/core-util": { "@azure/core-util": {
"version": "1.1.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.1.1.tgz",
"integrity": "sha512-+i93lNJNA3Pl3KSuC6xKP2jTL4YFeDfO6VNOaYdk0cppZcLCxt811gS878VsqsCisaltdhl9lhMzK5kbxCiF4w==", "integrity": "sha512-A4TBYVQCtHOigFb2ETiiKFDocBoI1Zk2Ui1KpI42aJSIDexF7DHQFpnjonltXAIU/ceH+1fsZAWWgvX6/AKzog==",
"requires": { "requires": {
"@azure/abort-controller": "^1.0.0",
"tslib": "^2.2.0" "tslib": "^2.2.0"
}, },
"dependencies": { "dependencies": {
@ -954,9 +955,9 @@
"integrity": "sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g==" "integrity": "sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g=="
}, },
"@types/node": { "@types/node": {
"version": "18.7.14", "version": "18.8.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.14.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.5.tgz",
"integrity": "sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA==" "integrity": "sha512-Bq7G3AErwe5A/Zki5fdD3O6+0zDChhg671NfPjtIcbtzDNZTv4NPKMRFr7gtYPG7y+B8uTiNK4Ngd9T0FTar6Q=="
}, },
"@types/node-fetch": { "@types/node-fetch": {
"version": "2.6.2", "version": "2.6.2",
@ -1153,9 +1154,9 @@
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
}, },
"typescript": { "typescript": {
"version": "4.8.2", "version": "4.8.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz",
"integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==",
"dev": true "dev": true
}, },
"universalify": { "universalify": {

View file

@ -22,7 +22,7 @@
}, },
"homepage": "https://github.com/Swatinem/rust-cache#readme", "homepage": "https://github.com/Swatinem/rust-cache#readme",
"dependencies": { "dependencies": {
"@actions/cache": "^3.0.4", "@actions/cache": "^3.0.5",
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/glob": "^0.3.0", "@actions/glob": "^0.3.0",
@ -30,7 +30,7 @@
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.34.0", "@vercel/ncc": "^0.34.0",
"typescript": "4.8.2" "typescript": "4.8.4"
}, },
"scripts": { "scripts": {
"prepare": "ncc build --target es2020 -o dist/restore src/restore.ts && ncc build --target es2020 -o dist/save src/save.ts" "prepare": "ncc build --target es2020 -o dist/restore src/restore.ts && ncc build --target es2020 -o dist/save src/save.ts"