mirror of
https://github.com/microsoft/setup-msbuild.git
synced 2024-11-10 05:51:07 +07:00
prod dependencies
This commit is contained in:
parent
2008f912f5
commit
fc16ae6170
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
# Dependency directory
|
# Dependency directory
|
||||||
node_modules
|
# node_modules
|
||||||
|
|
||||||
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||||
# Logs
|
# Logs
|
||||||
|
15
node_modules/.bin/semver
generated
vendored
Normal file
15
node_modules/.bin/semver
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../semver/bin/semver.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
7
node_modules/.bin/semver.cmd
generated
vendored
Normal file
7
node_modules/.bin/semver.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
@IF EXIST "%~dp0\node.exe" (
|
||||||
|
"%~dp0\node.exe" "%~dp0\..\semver\bin\semver.js" %*
|
||||||
|
) ELSE (
|
||||||
|
@SETLOCAL
|
||||||
|
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
node "%~dp0\..\semver\bin\semver.js" %*
|
||||||
|
)
|
15
node_modules/.bin/uuid
generated
vendored
Normal file
15
node_modules/.bin/uuid
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../uuid/bin/uuid" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../uuid/bin/uuid" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
7
node_modules/.bin/uuid.cmd
generated
vendored
Normal file
7
node_modules/.bin/uuid.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
@IF EXIST "%~dp0\node.exe" (
|
||||||
|
"%~dp0\node.exe" "%~dp0\..\uuid\bin\uuid" %*
|
||||||
|
) ELSE (
|
||||||
|
@SETLOCAL
|
||||||
|
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
node "%~dp0\..\uuid\bin\uuid" %*
|
||||||
|
)
|
140
node_modules/@actions/core/README.md
generated
vendored
Normal file
140
node_modules/@actions/core/README.md
generated
vendored
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
# `@actions/core`
|
||||||
|
|
||||||
|
> Core functions for setting results, logging, registering secrets and exporting variables across actions
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Import the package
|
||||||
|
|
||||||
|
```js
|
||||||
|
// javascript
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
// typescript
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Inputs/Outputs
|
||||||
|
|
||||||
|
Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const myInput = core.getInput('inputName', { required: true });
|
||||||
|
|
||||||
|
core.setOutput('outputKey', 'outputVal');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Exporting variables
|
||||||
|
|
||||||
|
Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks.
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.exportVariable('envVar', 'Val');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Setting a secret
|
||||||
|
|
||||||
|
Setting a secret registers the secret with the runner to ensure it is masked in logs.
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.setSecret('myPassword');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PATH Manipulation
|
||||||
|
|
||||||
|
To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH.
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.addPath('/path/to/mytool');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Exit codes
|
||||||
|
|
||||||
|
You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Do stuff
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// setFailed logs the message and sets a failing exit code
|
||||||
|
core.setFailed(`Action failed with error ${err}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Logging
|
||||||
|
|
||||||
|
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
const myInput = core.getInput('input');
|
||||||
|
try {
|
||||||
|
core.debug('Inside try block');
|
||||||
|
|
||||||
|
if (!myInput) {
|
||||||
|
core.warning('myInput was not set');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do stuff
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
core.error(`Error ${err}, action may still succeed though`);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This library can also wrap chunks of output in foldable groups.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core')
|
||||||
|
|
||||||
|
// Manually wrap output
|
||||||
|
core.startGroup('Do some function')
|
||||||
|
doSomeFunction()
|
||||||
|
core.endGroup()
|
||||||
|
|
||||||
|
// Wrap an asynchronous function call
|
||||||
|
const result = await core.group('Do something async', async () => {
|
||||||
|
const response = await doSomeHTTPRequest()
|
||||||
|
return response
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Action state
|
||||||
|
|
||||||
|
You can use this library to save state and get state for sharing information between a given wrapper action:
|
||||||
|
|
||||||
|
**action.yml**
|
||||||
|
```yaml
|
||||||
|
name: 'Wrapper action sample'
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
default: 'GitHub'
|
||||||
|
runs:
|
||||||
|
using: 'node12'
|
||||||
|
main: 'main.js'
|
||||||
|
post: 'cleanup.js'
|
||||||
|
```
|
||||||
|
|
||||||
|
In action's `main.js`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
core.saveState("pidToKill", 12345);
|
||||||
|
```
|
||||||
|
|
||||||
|
In action's `cleanup.js`:
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
var pid = core.getState("pidToKill");
|
||||||
|
|
||||||
|
process.kill(pid);
|
||||||
|
```
|
16
node_modules/@actions/core/lib/command.d.ts
generated
vendored
Normal file
16
node_modules/@actions/core/lib/command.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
interface CommandProperties {
|
||||||
|
[key: string]: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Commands
|
||||||
|
*
|
||||||
|
* Command Format:
|
||||||
|
* ##[name key=value;key=value]message
|
||||||
|
*
|
||||||
|
* Examples:
|
||||||
|
* ##[warning]This is the user warning message
|
||||||
|
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
||||||
|
*/
|
||||||
|
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
|
||||||
|
export declare function issue(name: string, message?: string): void;
|
||||||
|
export {};
|
66
node_modules/@actions/core/lib/command.js
generated
vendored
Normal file
66
node_modules/@actions/core/lib/command.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const os = require("os");
|
||||||
|
/**
|
||||||
|
* Commands
|
||||||
|
*
|
||||||
|
* Command Format:
|
||||||
|
* ##[name key=value;key=value]message
|
||||||
|
*
|
||||||
|
* Examples:
|
||||||
|
* ##[warning]This is the user warning message
|
||||||
|
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
||||||
|
*/
|
||||||
|
function issueCommand(command, properties, message) {
|
||||||
|
const cmd = new Command(command, properties, message);
|
||||||
|
process.stdout.write(cmd.toString() + os.EOL);
|
||||||
|
}
|
||||||
|
exports.issueCommand = issueCommand;
|
||||||
|
function issue(name, message = '') {
|
||||||
|
issueCommand(name, {}, message);
|
||||||
|
}
|
||||||
|
exports.issue = issue;
|
||||||
|
const CMD_STRING = '::';
|
||||||
|
class Command {
|
||||||
|
constructor(command, properties, message) {
|
||||||
|
if (!command) {
|
||||||
|
command = 'missing.command';
|
||||||
|
}
|
||||||
|
this.command = command;
|
||||||
|
this.properties = properties;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
toString() {
|
||||||
|
let cmdStr = CMD_STRING + this.command;
|
||||||
|
if (this.properties && Object.keys(this.properties).length > 0) {
|
||||||
|
cmdStr += ' ';
|
||||||
|
for (const key in this.properties) {
|
||||||
|
if (this.properties.hasOwnProperty(key)) {
|
||||||
|
const val = this.properties[key];
|
||||||
|
if (val) {
|
||||||
|
// safely append the val - avoid blowing up when attempting to
|
||||||
|
// call .replace() if message is not a string for some reason
|
||||||
|
cmdStr += `${key}=${escape(`${val || ''}`)},`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cmdStr += CMD_STRING;
|
||||||
|
// safely append the message - avoid blowing up when attempting to
|
||||||
|
// call .replace() if message is not a string for some reason
|
||||||
|
const message = `${this.message || ''}`;
|
||||||
|
cmdStr += escapeData(message);
|
||||||
|
return cmdStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function escapeData(s) {
|
||||||
|
return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
|
||||||
|
}
|
||||||
|
function escape(s) {
|
||||||
|
return s
|
||||||
|
.replace(/\r/g, '%0D')
|
||||||
|
.replace(/\n/g, '%0A')
|
||||||
|
.replace(/]/g, '%5D')
|
||||||
|
.replace(/;/g, '%3B');
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=command.js.map
|
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,8DAA8D;wBAC9D,6DAA6D;wBAC7D,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC,GAAG,CAAA;qBAC9C;iBACF;aACF;SACF;QAED,MAAM,IAAI,UAAU,CAAA;QAEpB,kEAAkE;QAClE,6DAA6D;QAC7D,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAA;QACvC,MAAM,IAAI,UAAU,CAAC,OAAO,CAAC,CAAA;QAE7B,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
112
node_modules/@actions/core/lib/core.d.ts
generated
vendored
Normal file
112
node_modules/@actions/core/lib/core.d.ts
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
/**
|
||||||
|
* Interface for getInput options
|
||||||
|
*/
|
||||||
|
export interface InputOptions {
|
||||||
|
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
||||||
|
required?: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The code to exit an action
|
||||||
|
*/
|
||||||
|
export declare enum ExitCode {
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was successful
|
||||||
|
*/
|
||||||
|
Success = 0,
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was a failure
|
||||||
|
*/
|
||||||
|
Failure = 1
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Sets env variable for this action and future actions in the job
|
||||||
|
* @param name the name of the variable to set
|
||||||
|
* @param val the value of the variable
|
||||||
|
*/
|
||||||
|
export declare function exportVariable(name: string, val: string): void;
|
||||||
|
/**
|
||||||
|
* Registers a secret which will get masked from logs
|
||||||
|
* @param secret value of the secret
|
||||||
|
*/
|
||||||
|
export declare function setSecret(secret: string): void;
|
||||||
|
/**
|
||||||
|
* Prepends inputPath to the PATH (for this action and future actions)
|
||||||
|
* @param inputPath
|
||||||
|
*/
|
||||||
|
export declare function addPath(inputPath: string): void;
|
||||||
|
/**
|
||||||
|
* Gets the value of an input. The value is also trimmed.
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
export declare function getInput(name: string, options?: InputOptions): string;
|
||||||
|
/**
|
||||||
|
* Sets the value of an output.
|
||||||
|
*
|
||||||
|
* @param name name of the output to set
|
||||||
|
* @param value value to store
|
||||||
|
*/
|
||||||
|
export declare function setOutput(name: string, value: string): void;
|
||||||
|
/**
|
||||||
|
* Sets the action status to failed.
|
||||||
|
* When the action exits it will be with an exit code of 1
|
||||||
|
* @param message add error issue message
|
||||||
|
*/
|
||||||
|
export declare function setFailed(message: string): void;
|
||||||
|
/**
|
||||||
|
* Writes debug message to user log
|
||||||
|
* @param message debug message
|
||||||
|
*/
|
||||||
|
export declare function debug(message: string): void;
|
||||||
|
/**
|
||||||
|
* Adds an error issue
|
||||||
|
* @param message error issue message
|
||||||
|
*/
|
||||||
|
export declare function error(message: string): void;
|
||||||
|
/**
|
||||||
|
* Adds an warning issue
|
||||||
|
* @param message warning issue message
|
||||||
|
*/
|
||||||
|
export declare function warning(message: string): void;
|
||||||
|
/**
|
||||||
|
* Writes info to log with console.log.
|
||||||
|
* @param message info message
|
||||||
|
*/
|
||||||
|
export declare function info(message: string): void;
|
||||||
|
/**
|
||||||
|
* Begin an output group.
|
||||||
|
*
|
||||||
|
* Output until the next `groupEnd` will be foldable in this group
|
||||||
|
*
|
||||||
|
* @param name The name of the output group
|
||||||
|
*/
|
||||||
|
export declare function startGroup(name: string): void;
|
||||||
|
/**
|
||||||
|
* End an output group.
|
||||||
|
*/
|
||||||
|
export declare function endGroup(): void;
|
||||||
|
/**
|
||||||
|
* Wrap an asynchronous function call in a group.
|
||||||
|
*
|
||||||
|
* Returns the same type as the function itself.
|
||||||
|
*
|
||||||
|
* @param name The name of the group
|
||||||
|
* @param fn The function to wrap in the group
|
||||||
|
*/
|
||||||
|
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
||||||
|
/**
|
||||||
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to store
|
||||||
|
* @param value value to store
|
||||||
|
*/
|
||||||
|
export declare function saveState(name: string, value: string): void;
|
||||||
|
/**
|
||||||
|
* Gets the value of an state set by this action's main execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to get
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
export declare function getState(name: string): string;
|
195
node_modules/@actions/core/lib/core.js
generated
vendored
Normal file
195
node_modules/@actions/core/lib/core.js
generated
vendored
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const command_1 = require("./command");
|
||||||
|
const os = require("os");
|
||||||
|
const path = require("path");
|
||||||
|
/**
|
||||||
|
* The code to exit an action
|
||||||
|
*/
|
||||||
|
var ExitCode;
|
||||||
|
(function (ExitCode) {
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was successful
|
||||||
|
*/
|
||||||
|
ExitCode[ExitCode["Success"] = 0] = "Success";
|
||||||
|
/**
|
||||||
|
* A code indicating that the action was a failure
|
||||||
|
*/
|
||||||
|
ExitCode[ExitCode["Failure"] = 1] = "Failure";
|
||||||
|
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Variables
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Sets env variable for this action and future actions in the job
|
||||||
|
* @param name the name of the variable to set
|
||||||
|
* @param val the value of the variable
|
||||||
|
*/
|
||||||
|
function exportVariable(name, val) {
|
||||||
|
process.env[name] = val;
|
||||||
|
command_1.issueCommand('set-env', { name }, val);
|
||||||
|
}
|
||||||
|
exports.exportVariable = exportVariable;
|
||||||
|
/**
|
||||||
|
* Registers a secret which will get masked from logs
|
||||||
|
* @param secret value of the secret
|
||||||
|
*/
|
||||||
|
function setSecret(secret) {
|
||||||
|
command_1.issueCommand('add-mask', {}, secret);
|
||||||
|
}
|
||||||
|
exports.setSecret = setSecret;
|
||||||
|
/**
|
||||||
|
* Prepends inputPath to the PATH (for this action and future actions)
|
||||||
|
* @param inputPath
|
||||||
|
*/
|
||||||
|
function addPath(inputPath) {
|
||||||
|
command_1.issueCommand('add-path', {}, inputPath);
|
||||||
|
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
||||||
|
}
|
||||||
|
exports.addPath = addPath;
|
||||||
|
/**
|
||||||
|
* Gets the value of an input. The value is also trimmed.
|
||||||
|
*
|
||||||
|
* @param name name of the input to get
|
||||||
|
* @param options optional. See InputOptions.
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
function getInput(name, options) {
|
||||||
|
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
||||||
|
if (options && options.required && !val) {
|
||||||
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
|
}
|
||||||
|
return val.trim();
|
||||||
|
}
|
||||||
|
exports.getInput = getInput;
|
||||||
|
/**
|
||||||
|
* Sets the value of an output.
|
||||||
|
*
|
||||||
|
* @param name name of the output to set
|
||||||
|
* @param value value to store
|
||||||
|
*/
|
||||||
|
function setOutput(name, value) {
|
||||||
|
command_1.issueCommand('set-output', { name }, value);
|
||||||
|
}
|
||||||
|
exports.setOutput = setOutput;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Results
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Sets the action status to failed.
|
||||||
|
* When the action exits it will be with an exit code of 1
|
||||||
|
* @param message add error issue message
|
||||||
|
*/
|
||||||
|
function setFailed(message) {
|
||||||
|
process.exitCode = ExitCode.Failure;
|
||||||
|
error(message);
|
||||||
|
}
|
||||||
|
exports.setFailed = setFailed;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Logging Commands
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Writes debug message to user log
|
||||||
|
* @param message debug message
|
||||||
|
*/
|
||||||
|
function debug(message) {
|
||||||
|
command_1.issueCommand('debug', {}, message);
|
||||||
|
}
|
||||||
|
exports.debug = debug;
|
||||||
|
/**
|
||||||
|
* Adds an error issue
|
||||||
|
* @param message error issue message
|
||||||
|
*/
|
||||||
|
function error(message) {
|
||||||
|
command_1.issue('error', message);
|
||||||
|
}
|
||||||
|
exports.error = error;
|
||||||
|
/**
|
||||||
|
* Adds an warning issue
|
||||||
|
* @param message warning issue message
|
||||||
|
*/
|
||||||
|
function warning(message) {
|
||||||
|
command_1.issue('warning', message);
|
||||||
|
}
|
||||||
|
exports.warning = warning;
|
||||||
|
/**
|
||||||
|
* Writes info to log with console.log.
|
||||||
|
* @param message info message
|
||||||
|
*/
|
||||||
|
function info(message) {
|
||||||
|
process.stdout.write(message + os.EOL);
|
||||||
|
}
|
||||||
|
exports.info = info;
|
||||||
|
/**
|
||||||
|
* Begin an output group.
|
||||||
|
*
|
||||||
|
* Output until the next `groupEnd` will be foldable in this group
|
||||||
|
*
|
||||||
|
* @param name The name of the output group
|
||||||
|
*/
|
||||||
|
function startGroup(name) {
|
||||||
|
command_1.issue('group', name);
|
||||||
|
}
|
||||||
|
exports.startGroup = startGroup;
|
||||||
|
/**
|
||||||
|
* End an output group.
|
||||||
|
*/
|
||||||
|
function endGroup() {
|
||||||
|
command_1.issue('endgroup');
|
||||||
|
}
|
||||||
|
exports.endGroup = endGroup;
|
||||||
|
/**
|
||||||
|
* Wrap an asynchronous function call in a group.
|
||||||
|
*
|
||||||
|
* Returns the same type as the function itself.
|
||||||
|
*
|
||||||
|
* @param name The name of the group
|
||||||
|
* @param fn The function to wrap in the group
|
||||||
|
*/
|
||||||
|
function group(name, fn) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
startGroup(name);
|
||||||
|
let result;
|
||||||
|
try {
|
||||||
|
result = yield fn();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
endGroup();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.group = group;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Wrapper action state
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to store
|
||||||
|
* @param value value to store
|
||||||
|
*/
|
||||||
|
function saveState(name, value) {
|
||||||
|
command_1.issueCommand('save-state', { name }, value);
|
||||||
|
}
|
||||||
|
exports.saveState = saveState;
|
||||||
|
/**
|
||||||
|
* Gets the value of an state set by this action's main execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to get
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
function getState(name) {
|
||||||
|
return process.env[`STATE_${name}`] || '';
|
||||||
|
}
|
||||||
|
exports.getState = getState;
|
||||||
|
//# sourceMappingURL=core.js.map
|
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
Normal file
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAA6C;AAE7C,yBAAwB;AACxB,6BAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IACnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAHD,8BAGC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,eAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzB,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,eAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}
|
68
node_modules/@actions/core/package.json
generated
vendored
Normal file
68
node_modules/@actions/core/package.json
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"@actions/core@1.2.0",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "@actions/core@1.2.0",
|
||||||
|
"_id": "@actions/core@1.2.0",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==",
|
||||||
|
"_location": "/@actions/core",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "@actions/core@1.2.0",
|
||||||
|
"name": "@actions/core",
|
||||||
|
"escapedName": "@actions%2fcore",
|
||||||
|
"scope": "@actions",
|
||||||
|
"rawSpec": "1.2.0",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "1.2.0"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/",
|
||||||
|
"/@actions/tool-cache"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz",
|
||||||
|
"_spec": "1.2.0",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"description": "Actions core lib",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^12.0.2"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"core"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/core.js",
|
||||||
|
"name": "@actions/core",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/core"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"version": "1.2.0"
|
||||||
|
}
|
57
node_modules/@actions/exec/README.md
generated
vendored
Normal file
57
node_modules/@actions/exec/README.md
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
# `@actions/exec`
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
#### Basic
|
||||||
|
|
||||||
|
You can use this package to execute tools in a cross platform way:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
await exec.exec('node index.js');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Args
|
||||||
|
|
||||||
|
You can also pass in arg arrays:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
await exec.exec('node', ['index.js', 'foo=bar']);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Output/options
|
||||||
|
|
||||||
|
Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5):
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
let myOutput = '';
|
||||||
|
let myError = '';
|
||||||
|
|
||||||
|
const options = {};
|
||||||
|
options.listeners = {
|
||||||
|
stdout: (data: Buffer) => {
|
||||||
|
myOutput += data.toString();
|
||||||
|
},
|
||||||
|
stderr: (data: Buffer) => {
|
||||||
|
myError += data.toString();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
options.cwd = './lib';
|
||||||
|
|
||||||
|
await exec.exec('node', ['index.js', 'foo=bar'], options);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Exec tools not in the PATH
|
||||||
|
|
||||||
|
You can specify the full path for tools not in the PATH:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
|
||||||
|
await exec.exec('"/path/to/my-tool"', ['arg1']);
|
||||||
|
```
|
12
node_modules/@actions/exec/lib/exec.d.ts
generated
vendored
Normal file
12
node_modules/@actions/exec/lib/exec.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import * as im from './interfaces';
|
||||||
|
/**
|
||||||
|
* Exec a command.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
|
||||||
|
* @param args optional arguments for tool. Escaping is handled by the lib.
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns Promise<number> exit code
|
||||||
|
*/
|
||||||
|
export declare function exec(commandLine: string, args?: string[], options?: im.ExecOptions): Promise<number>;
|
37
node_modules/@actions/exec/lib/exec.js
generated
vendored
Normal file
37
node_modules/@actions/exec/lib/exec.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const tr = require("./toolrunner");
|
||||||
|
/**
|
||||||
|
* Exec a command.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param commandLine command to execute (can include additional args). Must be correctly escaped.
|
||||||
|
* @param args optional arguments for tool. Escaping is handled by the lib.
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns Promise<number> exit code
|
||||||
|
*/
|
||||||
|
function exec(commandLine, args, options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const commandArgs = tr.argStringToArray(commandLine);
|
||||||
|
if (commandArgs.length === 0) {
|
||||||
|
throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
|
||||||
|
}
|
||||||
|
// Path to tool to execute should be first arg
|
||||||
|
const toolPath = commandArgs[0];
|
||||||
|
args = commandArgs.slice(1).concat(args || []);
|
||||||
|
const runner = new tr.ToolRunner(toolPath, args, options);
|
||||||
|
return runner.exec();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.exec = exec;
|
||||||
|
//# sourceMappingURL=exec.js.map
|
1
node_modules/@actions/exec/lib/exec.js.map
generated
vendored
Normal file
1
node_modules/@actions/exec/lib/exec.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mCAAkC;AAElC;;;;;;;;;GASG;AACH,SAAsB,IAAI,CACxB,WAAmB,EACnB,IAAe,EACf,OAAwB;;QAExB,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;SACpE;QACD,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAkB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACxE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;CAAA;AAdD,oBAcC"}
|
35
node_modules/@actions/exec/lib/interfaces.d.ts
generated
vendored
Normal file
35
node_modules/@actions/exec/lib/interfaces.d.ts
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import * as stream from 'stream';
|
||||||
|
/**
|
||||||
|
* Interface for exec options
|
||||||
|
*/
|
||||||
|
export interface ExecOptions {
|
||||||
|
/** optional working directory. defaults to current */
|
||||||
|
cwd?: string;
|
||||||
|
/** optional envvar dictionary. defaults to current process's env */
|
||||||
|
env?: {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
|
/** optional. defaults to false */
|
||||||
|
silent?: boolean;
|
||||||
|
/** optional out stream to use. Defaults to process.stdout */
|
||||||
|
outStream?: stream.Writable;
|
||||||
|
/** optional err stream to use. Defaults to process.stderr */
|
||||||
|
errStream?: stream.Writable;
|
||||||
|
/** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */
|
||||||
|
windowsVerbatimArguments?: boolean;
|
||||||
|
/** optional. whether to fail if output to stderr. defaults to false */
|
||||||
|
failOnStdErr?: boolean;
|
||||||
|
/** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */
|
||||||
|
ignoreReturnCode?: boolean;
|
||||||
|
/** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */
|
||||||
|
delay?: number;
|
||||||
|
/** optional. Listeners for output. Callback functions that will be called on these events */
|
||||||
|
listeners?: {
|
||||||
|
stdout?: (data: Buffer) => void;
|
||||||
|
stderr?: (data: Buffer) => void;
|
||||||
|
stdline?: (data: string) => void;
|
||||||
|
errline?: (data: string) => void;
|
||||||
|
debug?: (data: string) => void;
|
||||||
|
};
|
||||||
|
}
|
3
node_modules/@actions/exec/lib/interfaces.js
generated
vendored
Normal file
3
node_modules/@actions/exec/lib/interfaces.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
//# sourceMappingURL=interfaces.js.map
|
1
node_modules/@actions/exec/lib/interfaces.js.map
generated
vendored
Normal file
1
node_modules/@actions/exec/lib/interfaces.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
|
37
node_modules/@actions/exec/lib/toolrunner.d.ts
generated
vendored
Normal file
37
node_modules/@actions/exec/lib/toolrunner.d.ts
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import * as events from 'events';
|
||||||
|
import * as im from './interfaces';
|
||||||
|
export declare class ToolRunner extends events.EventEmitter {
|
||||||
|
constructor(toolPath: string, args?: string[], options?: im.ExecOptions);
|
||||||
|
private toolPath;
|
||||||
|
private args;
|
||||||
|
private options;
|
||||||
|
private _debug;
|
||||||
|
private _getCommandString;
|
||||||
|
private _processLineBuffer;
|
||||||
|
private _getSpawnFileName;
|
||||||
|
private _getSpawnArgs;
|
||||||
|
private _endsWith;
|
||||||
|
private _isCmdFile;
|
||||||
|
private _windowsQuoteCmdArg;
|
||||||
|
private _uvQuoteCmdArg;
|
||||||
|
private _cloneExecOptions;
|
||||||
|
private _getSpawnOptions;
|
||||||
|
/**
|
||||||
|
* Exec a tool.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param tool path to tool to exec
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns number
|
||||||
|
*/
|
||||||
|
exec(): Promise<number>;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Convert an arg string to an array of args. Handles escaping
|
||||||
|
*
|
||||||
|
* @param argString string of arguments
|
||||||
|
* @returns string[] array of arguments
|
||||||
|
*/
|
||||||
|
export declare function argStringToArray(argString: string): string[];
|
587
node_modules/@actions/exec/lib/toolrunner.js
generated
vendored
Normal file
587
node_modules/@actions/exec/lib/toolrunner.js
generated
vendored
Normal file
@ -0,0 +1,587 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const os = require("os");
|
||||||
|
const events = require("events");
|
||||||
|
const child = require("child_process");
|
||||||
|
const path = require("path");
|
||||||
|
const io = require("@actions/io");
|
||||||
|
const ioUtil = require("@actions/io/lib/io-util");
|
||||||
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
/*
|
||||||
|
* Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
|
||||||
|
*/
|
||||||
|
class ToolRunner extends events.EventEmitter {
|
||||||
|
constructor(toolPath, args, options) {
|
||||||
|
super();
|
||||||
|
if (!toolPath) {
|
||||||
|
throw new Error("Parameter 'toolPath' cannot be null or empty.");
|
||||||
|
}
|
||||||
|
this.toolPath = toolPath;
|
||||||
|
this.args = args || [];
|
||||||
|
this.options = options || {};
|
||||||
|
}
|
||||||
|
_debug(message) {
|
||||||
|
if (this.options.listeners && this.options.listeners.debug) {
|
||||||
|
this.options.listeners.debug(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_getCommandString(options, noPrefix) {
|
||||||
|
const toolPath = this._getSpawnFileName();
|
||||||
|
const args = this._getSpawnArgs(options);
|
||||||
|
let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
// Windows + cmd file
|
||||||
|
if (this._isCmdFile()) {
|
||||||
|
cmd += toolPath;
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${a}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Windows + verbatim
|
||||||
|
else if (options.windowsVerbatimArguments) {
|
||||||
|
cmd += `"${toolPath}"`;
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${a}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Windows (regular)
|
||||||
|
else {
|
||||||
|
cmd += this._windowsQuoteCmdArg(toolPath);
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${this._windowsQuoteCmdArg(a)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// OSX/Linux - this can likely be improved with some form of quoting.
|
||||||
|
// creating processes on Unix is fundamentally different than Windows.
|
||||||
|
// on Unix, execvp() takes an arg array.
|
||||||
|
cmd += toolPath;
|
||||||
|
for (const a of args) {
|
||||||
|
cmd += ` ${a}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cmd;
|
||||||
|
}
|
||||||
|
_processLineBuffer(data, strBuffer, onLine) {
|
||||||
|
try {
|
||||||
|
let s = strBuffer + data.toString();
|
||||||
|
let n = s.indexOf(os.EOL);
|
||||||
|
while (n > -1) {
|
||||||
|
const line = s.substring(0, n);
|
||||||
|
onLine(line);
|
||||||
|
// the rest of the string ...
|
||||||
|
s = s.substring(n + os.EOL.length);
|
||||||
|
n = s.indexOf(os.EOL);
|
||||||
|
}
|
||||||
|
strBuffer = s;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// streaming lines to console is best effort. Don't fail a build.
|
||||||
|
this._debug(`error processing line. Failed with error ${err}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_getSpawnFileName() {
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
if (this._isCmdFile()) {
|
||||||
|
return process.env['COMSPEC'] || 'cmd.exe';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.toolPath;
|
||||||
|
}
|
||||||
|
_getSpawnArgs(options) {
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
if (this._isCmdFile()) {
|
||||||
|
let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
|
||||||
|
for (const a of this.args) {
|
||||||
|
argline += ' ';
|
||||||
|
argline += options.windowsVerbatimArguments
|
||||||
|
? a
|
||||||
|
: this._windowsQuoteCmdArg(a);
|
||||||
|
}
|
||||||
|
argline += '"';
|
||||||
|
return [argline];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.args;
|
||||||
|
}
|
||||||
|
_endsWith(str, end) {
|
||||||
|
return str.endsWith(end);
|
||||||
|
}
|
||||||
|
_isCmdFile() {
|
||||||
|
const upperToolPath = this.toolPath.toUpperCase();
|
||||||
|
return (this._endsWith(upperToolPath, '.CMD') ||
|
||||||
|
this._endsWith(upperToolPath, '.BAT'));
|
||||||
|
}
|
||||||
|
_windowsQuoteCmdArg(arg) {
|
||||||
|
// for .exe, apply the normal quoting rules that libuv applies
|
||||||
|
if (!this._isCmdFile()) {
|
||||||
|
return this._uvQuoteCmdArg(arg);
|
||||||
|
}
|
||||||
|
// otherwise apply quoting rules specific to the cmd.exe command line parser.
|
||||||
|
// the libuv rules are generic and are not designed specifically for cmd.exe
|
||||||
|
// command line parser.
|
||||||
|
//
|
||||||
|
// for a detailed description of the cmd.exe command line parser, refer to
|
||||||
|
// http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
|
||||||
|
// need quotes for empty arg
|
||||||
|
if (!arg) {
|
||||||
|
return '""';
|
||||||
|
}
|
||||||
|
// determine whether the arg needs to be quoted
|
||||||
|
const cmdSpecialChars = [
|
||||||
|
' ',
|
||||||
|
'\t',
|
||||||
|
'&',
|
||||||
|
'(',
|
||||||
|
')',
|
||||||
|
'[',
|
||||||
|
']',
|
||||||
|
'{',
|
||||||
|
'}',
|
||||||
|
'^',
|
||||||
|
'=',
|
||||||
|
';',
|
||||||
|
'!',
|
||||||
|
"'",
|
||||||
|
'+',
|
||||||
|
',',
|
||||||
|
'`',
|
||||||
|
'~',
|
||||||
|
'|',
|
||||||
|
'<',
|
||||||
|
'>',
|
||||||
|
'"'
|
||||||
|
];
|
||||||
|
let needsQuotes = false;
|
||||||
|
for (const char of arg) {
|
||||||
|
if (cmdSpecialChars.some(x => x === char)) {
|
||||||
|
needsQuotes = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// short-circuit if quotes not needed
|
||||||
|
if (!needsQuotes) {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
// the following quoting rules are very similar to the rules that by libuv applies.
|
||||||
|
//
|
||||||
|
// 1) wrap the string in quotes
|
||||||
|
//
|
||||||
|
// 2) double-up quotes - i.e. " => ""
|
||||||
|
//
|
||||||
|
// this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
|
||||||
|
// doesn't work well with a cmd.exe command line.
|
||||||
|
//
|
||||||
|
// note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
|
||||||
|
// for example, the command line:
|
||||||
|
// foo.exe "myarg:""my val"""
|
||||||
|
// is parsed by a .NET console app into an arg array:
|
||||||
|
// [ "myarg:\"my val\"" ]
|
||||||
|
// which is the same end result when applying libuv quoting rules. although the actual
|
||||||
|
// command line from libuv quoting rules would look like:
|
||||||
|
// foo.exe "myarg:\"my val\""
|
||||||
|
//
|
||||||
|
// 3) double-up slashes that precede a quote,
|
||||||
|
// e.g. hello \world => "hello \world"
|
||||||
|
// hello\"world => "hello\\""world"
|
||||||
|
// hello\\"world => "hello\\\\""world"
|
||||||
|
// hello world\ => "hello world\\"
|
||||||
|
//
|
||||||
|
// technically this is not required for a cmd.exe command line, or the batch argument parser.
|
||||||
|
// the reasons for including this as a .cmd quoting rule are:
|
||||||
|
//
|
||||||
|
// a) this is optimized for the scenario where the argument is passed from the .cmd file to an
|
||||||
|
// external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
|
||||||
|
//
|
||||||
|
// b) it's what we've been doing previously (by deferring to node default behavior) and we
|
||||||
|
// haven't heard any complaints about that aspect.
|
||||||
|
//
|
||||||
|
// note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
|
||||||
|
// escaped when used on the command line directly - even though within a .cmd file % can be escaped
|
||||||
|
// by using %%.
|
||||||
|
//
|
||||||
|
// the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
|
||||||
|
// the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
|
||||||
|
//
|
||||||
|
// one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
|
||||||
|
// often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
|
||||||
|
// variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
|
||||||
|
// to an external program.
|
||||||
|
//
|
||||||
|
// an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
|
||||||
|
// % can be escaped within a .cmd file.
|
||||||
|
let reverse = '"';
|
||||||
|
let quoteHit = true;
|
||||||
|
for (let i = arg.length; i > 0; i--) {
|
||||||
|
// walk the string in reverse
|
||||||
|
reverse += arg[i - 1];
|
||||||
|
if (quoteHit && arg[i - 1] === '\\') {
|
||||||
|
reverse += '\\'; // double the slash
|
||||||
|
}
|
||||||
|
else if (arg[i - 1] === '"') {
|
||||||
|
quoteHit = true;
|
||||||
|
reverse += '"'; // double the quote
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
quoteHit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reverse += '"';
|
||||||
|
return reverse
|
||||||
|
.split('')
|
||||||
|
.reverse()
|
||||||
|
.join('');
|
||||||
|
}
|
||||||
|
_uvQuoteCmdArg(arg) {
|
||||||
|
// Tool runner wraps child_process.spawn() and needs to apply the same quoting as
|
||||||
|
// Node in certain cases where the undocumented spawn option windowsVerbatimArguments
|
||||||
|
// is used.
|
||||||
|
//
|
||||||
|
// Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
|
||||||
|
// see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
|
||||||
|
// pasting copyright notice from Node within this function:
|
||||||
|
//
|
||||||
|
// Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to
|
||||||
|
// deal in the Software without restriction, including without limitation the
|
||||||
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
// sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
// IN THE SOFTWARE.
|
||||||
|
if (!arg) {
|
||||||
|
// Need double quotation for empty argument
|
||||||
|
return '""';
|
||||||
|
}
|
||||||
|
if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
|
||||||
|
// No quotation needed
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
if (!arg.includes('"') && !arg.includes('\\')) {
|
||||||
|
// No embedded double quotes or backslashes, so I can just wrap
|
||||||
|
// quote marks around the whole thing.
|
||||||
|
return `"${arg}"`;
|
||||||
|
}
|
||||||
|
// Expected input/output:
|
||||||
|
// input : hello"world
|
||||||
|
// output: "hello\"world"
|
||||||
|
// input : hello""world
|
||||||
|
// output: "hello\"\"world"
|
||||||
|
// input : hello\world
|
||||||
|
// output: hello\world
|
||||||
|
// input : hello\\world
|
||||||
|
// output: hello\\world
|
||||||
|
// input : hello\"world
|
||||||
|
// output: "hello\\\"world"
|
||||||
|
// input : hello\\"world
|
||||||
|
// output: "hello\\\\\"world"
|
||||||
|
// input : hello world\
|
||||||
|
// output: "hello world\\" - note the comment in libuv actually reads "hello world\"
|
||||||
|
// but it appears the comment is wrong, it should be "hello world\\"
|
||||||
|
let reverse = '"';
|
||||||
|
let quoteHit = true;
|
||||||
|
for (let i = arg.length; i > 0; i--) {
|
||||||
|
// walk the string in reverse
|
||||||
|
reverse += arg[i - 1];
|
||||||
|
if (quoteHit && arg[i - 1] === '\\') {
|
||||||
|
reverse += '\\';
|
||||||
|
}
|
||||||
|
else if (arg[i - 1] === '"') {
|
||||||
|
quoteHit = true;
|
||||||
|
reverse += '\\';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
quoteHit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reverse += '"';
|
||||||
|
return reverse
|
||||||
|
.split('')
|
||||||
|
.reverse()
|
||||||
|
.join('');
|
||||||
|
}
|
||||||
|
_cloneExecOptions(options) {
|
||||||
|
options = options || {};
|
||||||
|
const result = {
|
||||||
|
cwd: options.cwd || process.cwd(),
|
||||||
|
env: options.env || process.env,
|
||||||
|
silent: options.silent || false,
|
||||||
|
windowsVerbatimArguments: options.windowsVerbatimArguments || false,
|
||||||
|
failOnStdErr: options.failOnStdErr || false,
|
||||||
|
ignoreReturnCode: options.ignoreReturnCode || false,
|
||||||
|
delay: options.delay || 10000
|
||||||
|
};
|
||||||
|
result.outStream = options.outStream || process.stdout;
|
||||||
|
result.errStream = options.errStream || process.stderr;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
_getSpawnOptions(options, toolPath) {
|
||||||
|
options = options || {};
|
||||||
|
const result = {};
|
||||||
|
result.cwd = options.cwd;
|
||||||
|
result.env = options.env;
|
||||||
|
result['windowsVerbatimArguments'] =
|
||||||
|
options.windowsVerbatimArguments || this._isCmdFile();
|
||||||
|
if (options.windowsVerbatimArguments) {
|
||||||
|
result.argv0 = `"${toolPath}"`;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Exec a tool.
|
||||||
|
* Output will be streamed to the live console.
|
||||||
|
* Returns promise with return code
|
||||||
|
*
|
||||||
|
* @param tool path to tool to exec
|
||||||
|
* @param options optional exec options. See ExecOptions
|
||||||
|
* @returns number
|
||||||
|
*/
|
||||||
|
exec() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// root the tool path if it is unrooted and contains relative pathing
|
||||||
|
if (!ioUtil.isRooted(this.toolPath) &&
|
||||||
|
(this.toolPath.includes('/') ||
|
||||||
|
(IS_WINDOWS && this.toolPath.includes('\\')))) {
|
||||||
|
// prefer options.cwd if it is specified, however options.cwd may also need to be rooted
|
||||||
|
this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
|
||||||
|
}
|
||||||
|
// if the tool is only a file name, then resolve it from the PATH
|
||||||
|
// otherwise verify it exists (add extension on Windows if necessary)
|
||||||
|
this.toolPath = yield io.which(this.toolPath, true);
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this._debug(`exec tool: ${this.toolPath}`);
|
||||||
|
this._debug('arguments:');
|
||||||
|
for (const arg of this.args) {
|
||||||
|
this._debug(` ${arg}`);
|
||||||
|
}
|
||||||
|
const optionsNonNull = this._cloneExecOptions(this.options);
|
||||||
|
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||||||
|
optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
|
||||||
|
}
|
||||||
|
const state = new ExecState(optionsNonNull, this.toolPath);
|
||||||
|
state.on('debug', (message) => {
|
||||||
|
this._debug(message);
|
||||||
|
});
|
||||||
|
const fileName = this._getSpawnFileName();
|
||||||
|
const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
|
||||||
|
const stdbuffer = '';
|
||||||
|
if (cp.stdout) {
|
||||||
|
cp.stdout.on('data', (data) => {
|
||||||
|
if (this.options.listeners && this.options.listeners.stdout) {
|
||||||
|
this.options.listeners.stdout(data);
|
||||||
|
}
|
||||||
|
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||||||
|
optionsNonNull.outStream.write(data);
|
||||||
|
}
|
||||||
|
this._processLineBuffer(data, stdbuffer, (line) => {
|
||||||
|
if (this.options.listeners && this.options.listeners.stdline) {
|
||||||
|
this.options.listeners.stdline(line);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const errbuffer = '';
|
||||||
|
if (cp.stderr) {
|
||||||
|
cp.stderr.on('data', (data) => {
|
||||||
|
state.processStderr = true;
|
||||||
|
if (this.options.listeners && this.options.listeners.stderr) {
|
||||||
|
this.options.listeners.stderr(data);
|
||||||
|
}
|
||||||
|
if (!optionsNonNull.silent &&
|
||||||
|
optionsNonNull.errStream &&
|
||||||
|
optionsNonNull.outStream) {
|
||||||
|
const s = optionsNonNull.failOnStdErr
|
||||||
|
? optionsNonNull.errStream
|
||||||
|
: optionsNonNull.outStream;
|
||||||
|
s.write(data);
|
||||||
|
}
|
||||||
|
this._processLineBuffer(data, errbuffer, (line) => {
|
||||||
|
if (this.options.listeners && this.options.listeners.errline) {
|
||||||
|
this.options.listeners.errline(line);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
cp.on('error', (err) => {
|
||||||
|
state.processError = err.message;
|
||||||
|
state.processExited = true;
|
||||||
|
state.processClosed = true;
|
||||||
|
state.CheckComplete();
|
||||||
|
});
|
||||||
|
cp.on('exit', (code) => {
|
||||||
|
state.processExitCode = code;
|
||||||
|
state.processExited = true;
|
||||||
|
this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
|
||||||
|
state.CheckComplete();
|
||||||
|
});
|
||||||
|
cp.on('close', (code) => {
|
||||||
|
state.processExitCode = code;
|
||||||
|
state.processExited = true;
|
||||||
|
state.processClosed = true;
|
||||||
|
this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
|
||||||
|
state.CheckComplete();
|
||||||
|
});
|
||||||
|
state.on('done', (error, exitCode) => {
|
||||||
|
if (stdbuffer.length > 0) {
|
||||||
|
this.emit('stdline', stdbuffer);
|
||||||
|
}
|
||||||
|
if (errbuffer.length > 0) {
|
||||||
|
this.emit('errline', errbuffer);
|
||||||
|
}
|
||||||
|
cp.removeAllListeners();
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(exitCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.ToolRunner = ToolRunner;
|
||||||
|
/**
|
||||||
|
* Convert an arg string to an array of args. Handles escaping
|
||||||
|
*
|
||||||
|
* @param argString string of arguments
|
||||||
|
* @returns string[] array of arguments
|
||||||
|
*/
|
||||||
|
function argStringToArray(argString) {
|
||||||
|
const args = [];
|
||||||
|
let inQuotes = false;
|
||||||
|
let escaped = false;
|
||||||
|
let arg = '';
|
||||||
|
function append(c) {
|
||||||
|
// we only escape double quotes.
|
||||||
|
if (escaped && c !== '"') {
|
||||||
|
arg += '\\';
|
||||||
|
}
|
||||||
|
arg += c;
|
||||||
|
escaped = false;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < argString.length; i++) {
|
||||||
|
const c = argString.charAt(i);
|
||||||
|
if (c === '"') {
|
||||||
|
if (!escaped) {
|
||||||
|
inQuotes = !inQuotes;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
append(c);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c === '\\' && escaped) {
|
||||||
|
append(c);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c === '\\' && inQuotes) {
|
||||||
|
escaped = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c === ' ' && !inQuotes) {
|
||||||
|
if (arg.length > 0) {
|
||||||
|
args.push(arg);
|
||||||
|
arg = '';
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
append(c);
|
||||||
|
}
|
||||||
|
if (arg.length > 0) {
|
||||||
|
args.push(arg.trim());
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
exports.argStringToArray = argStringToArray;
|
||||||
|
class ExecState extends events.EventEmitter {
|
||||||
|
constructor(options, toolPath) {
|
||||||
|
super();
|
||||||
|
this.processClosed = false; // tracks whether the process has exited and stdio is closed
|
||||||
|
this.processError = '';
|
||||||
|
this.processExitCode = 0;
|
||||||
|
this.processExited = false; // tracks whether the process has exited
|
||||||
|
this.processStderr = false; // tracks whether stderr was written to
|
||||||
|
this.delay = 10000; // 10 seconds
|
||||||
|
this.done = false;
|
||||||
|
this.timeout = null;
|
||||||
|
if (!toolPath) {
|
||||||
|
throw new Error('toolPath must not be empty');
|
||||||
|
}
|
||||||
|
this.options = options;
|
||||||
|
this.toolPath = toolPath;
|
||||||
|
if (options.delay) {
|
||||||
|
this.delay = options.delay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CheckComplete() {
|
||||||
|
if (this.done) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.processClosed) {
|
||||||
|
this._setResult();
|
||||||
|
}
|
||||||
|
else if (this.processExited) {
|
||||||
|
this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_debug(message) {
|
||||||
|
this.emit('debug', message);
|
||||||
|
}
|
||||||
|
_setResult() {
|
||||||
|
// determine whether there is an error
|
||||||
|
let error;
|
||||||
|
if (this.processExited) {
|
||||||
|
if (this.processError) {
|
||||||
|
error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
|
||||||
|
}
|
||||||
|
else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
|
||||||
|
error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
|
||||||
|
}
|
||||||
|
else if (this.processStderr && this.options.failOnStdErr) {
|
||||||
|
error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// clear the timeout
|
||||||
|
if (this.timeout) {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
this.timeout = null;
|
||||||
|
}
|
||||||
|
this.done = true;
|
||||||
|
this.emit('done', error, this.processExitCode);
|
||||||
|
}
|
||||||
|
static HandleTimeout(state) {
|
||||||
|
if (state.done) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!state.processClosed && state.processExited) {
|
||||||
|
const message = `The STDIO streams did not close within ${state.delay /
|
||||||
|
1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
|
||||||
|
state._debug(message);
|
||||||
|
}
|
||||||
|
state._setResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=toolrunner.js.map
|
1
node_modules/@actions/exec/lib/toolrunner.js.map
generated
vendored
Normal file
1
node_modules/@actions/exec/lib/toolrunner.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
70
node_modules/@actions/exec/package.json
generated
vendored
Normal file
70
node_modules/@actions/exec/package.json
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"@actions/exec@1.0.3",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "@actions/exec@1.0.3",
|
||||||
|
"_id": "@actions/exec@1.0.3",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-TogJGnueOmM7ntCi0ASTUj4LapRRtDfj57Ja4IhPmg2fls28uVOPbAn8N+JifaOumN2UG3oEO/Ixek2A4NcYSA==",
|
||||||
|
"_location": "/@actions/exec",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "@actions/exec@1.0.3",
|
||||||
|
"name": "@actions/exec",
|
||||||
|
"escapedName": "@actions%2fexec",
|
||||||
|
"scope": "@actions",
|
||||||
|
"rawSpec": "1.0.3",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "1.0.3"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/",
|
||||||
|
"/@actions/tool-cache"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.3.tgz",
|
||||||
|
"_spec": "1.0.3",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/io": "^1.0.1"
|
||||||
|
},
|
||||||
|
"description": "Actions exec lib",
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"exec"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/exec.js",
|
||||||
|
"name": "@actions/exec",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/exec"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"types": "lib/exec.d.ts",
|
||||||
|
"version": "1.0.3"
|
||||||
|
}
|
21
node_modules/@actions/http-client/LICENSE
generated
vendored
Normal file
21
node_modules/@actions/http-client/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
Actions Http Client for Node.js
|
||||||
|
|
||||||
|
Copyright (c) GitHub, Inc.
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||||
|
associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||||
|
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||||
|
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
73
node_modules/@actions/http-client/README.md
generated
vendored
Normal file
73
node_modules/@actions/http-client/README.md
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="actions.png">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# Actions Http-Client
|
||||||
|
|
||||||
|
[![Http Status](https://github.com/actions/http-client/workflows/http-tests/badge.svg)](https://github.com/actions/http-client/actions)
|
||||||
|
|
||||||
|
A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- HTTP client with TypeScript generics and async/await/Promises
|
||||||
|
- Typings included so no need to acquire separately (great for intellisense and no versioning drift)
|
||||||
|
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
||||||
|
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
|
||||||
|
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
||||||
|
- Redirects supported
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install @actions/http-client --save
|
||||||
|
```
|
||||||
|
|
||||||
|
## Samples
|
||||||
|
|
||||||
|
See the [HTTP](./__tests__) tests for detailed examples.
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
|
||||||
|
### HTTP
|
||||||
|
|
||||||
|
The HTTP client does not throw unless truly exceptional.
|
||||||
|
|
||||||
|
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
||||||
|
* Redirects (3xx) will be followed by default.
|
||||||
|
|
||||||
|
See [HTTP tests](./__tests__) for detailed examples.
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
||||||
|
|
||||||
|
```
|
||||||
|
export NODE_DEBUG=http
|
||||||
|
```
|
||||||
|
|
||||||
|
## Node support
|
||||||
|
|
||||||
|
The http-client is built using the latest LTS version of Node 12. We also support the latest LTS for Node 6, 8 and Node 10.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome PRs. Please create an issue and if applicable, a design before proceeding with code.
|
||||||
|
|
||||||
|
once:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
To build:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
To run all tests:
|
||||||
|
```bash
|
||||||
|
$ npm test
|
||||||
|
```
|
BIN
node_modules/@actions/http-client/actions.png
generated
vendored
Normal file
BIN
node_modules/@actions/http-client/actions.png
generated
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
23
node_modules/@actions/http-client/auth.d.ts
generated
vendored
Normal file
23
node_modules/@actions/http-client/auth.d.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import ifm = require('./interfaces');
|
||||||
|
export declare class BasicCredentialHandler implements ifm.IRequestHandler {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
constructor(username: string, password: string);
|
||||||
|
prepareRequest(options: any): void;
|
||||||
|
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||||
|
}
|
||||||
|
export declare class BearerCredentialHandler implements ifm.IRequestHandler {
|
||||||
|
token: string;
|
||||||
|
constructor(token: string);
|
||||||
|
prepareRequest(options: any): void;
|
||||||
|
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||||
|
}
|
||||||
|
export declare class PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler {
|
||||||
|
token: string;
|
||||||
|
constructor(token: string);
|
||||||
|
prepareRequest(options: any): void;
|
||||||
|
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||||
|
}
|
55
node_modules/@actions/http-client/auth.js
generated
vendored
Normal file
55
node_modules/@actions/http-client/auth.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
class BasicCredentialHandler {
|
||||||
|
constructor(username, password) {
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] = 'Basic ' + Buffer.from(this.username + ':' + this.password).toString('base64');
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.BasicCredentialHandler = BasicCredentialHandler;
|
||||||
|
class BearerCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] = 'Bearer ' + this.token;
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.BearerCredentialHandler = BearerCredentialHandler;
|
||||||
|
class PersonalAccessTokenCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] = 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
95
node_modules/@actions/http-client/index.d.ts
generated
vendored
Normal file
95
node_modules/@actions/http-client/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import http = require("http");
|
||||||
|
import ifm = require('./interfaces');
|
||||||
|
export declare enum HttpCodes {
|
||||||
|
OK = 200,
|
||||||
|
MultipleChoices = 300,
|
||||||
|
MovedPermanently = 301,
|
||||||
|
ResourceMoved = 302,
|
||||||
|
SeeOther = 303,
|
||||||
|
NotModified = 304,
|
||||||
|
UseProxy = 305,
|
||||||
|
SwitchProxy = 306,
|
||||||
|
TemporaryRedirect = 307,
|
||||||
|
PermanentRedirect = 308,
|
||||||
|
BadRequest = 400,
|
||||||
|
Unauthorized = 401,
|
||||||
|
PaymentRequired = 402,
|
||||||
|
Forbidden = 403,
|
||||||
|
NotFound = 404,
|
||||||
|
MethodNotAllowed = 405,
|
||||||
|
NotAcceptable = 406,
|
||||||
|
ProxyAuthenticationRequired = 407,
|
||||||
|
RequestTimeout = 408,
|
||||||
|
Conflict = 409,
|
||||||
|
Gone = 410,
|
||||||
|
InternalServerError = 500,
|
||||||
|
NotImplemented = 501,
|
||||||
|
BadGateway = 502,
|
||||||
|
ServiceUnavailable = 503,
|
||||||
|
GatewayTimeout = 504
|
||||||
|
}
|
||||||
|
export declare class HttpClientResponse implements ifm.IHttpClientResponse {
|
||||||
|
constructor(message: http.IncomingMessage);
|
||||||
|
message: http.IncomingMessage;
|
||||||
|
readBody(): Promise<string>;
|
||||||
|
}
|
||||||
|
export declare function isHttps(requestUrl: string): boolean;
|
||||||
|
export declare class HttpClient {
|
||||||
|
userAgent: string | undefined;
|
||||||
|
handlers: ifm.IRequestHandler[];
|
||||||
|
requestOptions: ifm.IRequestOptions;
|
||||||
|
private _ignoreSslError;
|
||||||
|
private _socketTimeout;
|
||||||
|
private _allowRedirects;
|
||||||
|
private _allowRedirectDowngrade;
|
||||||
|
private _maxRedirects;
|
||||||
|
private _allowRetries;
|
||||||
|
private _maxRetries;
|
||||||
|
private _agent;
|
||||||
|
private _proxyAgent;
|
||||||
|
private _keepAlive;
|
||||||
|
private _disposed;
|
||||||
|
constructor(userAgent?: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions);
|
||||||
|
options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
post(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
patch(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
/**
|
||||||
|
* Makes a raw http request.
|
||||||
|
* All other methods such as get, post, patch, and request ultimately call this.
|
||||||
|
* Prefer get, del, post and patch
|
||||||
|
*/
|
||||||
|
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
/**
|
||||||
|
* Needs to be called if keepAlive is set to true in request options.
|
||||||
|
*/
|
||||||
|
dispose(): void;
|
||||||
|
/**
|
||||||
|
* Raw request.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
requestRaw(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream): Promise<ifm.IHttpClientResponse>;
|
||||||
|
/**
|
||||||
|
* Raw request with callback.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
* @param onResult
|
||||||
|
*/
|
||||||
|
requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void;
|
||||||
|
/**
|
||||||
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||||
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
getAgent(serverUrl: string): http.Agent;
|
||||||
|
private _prepareRequest;
|
||||||
|
private _mergeHeaders;
|
||||||
|
private _getAgent;
|
||||||
|
private _performExponentialBackoff;
|
||||||
|
}
|
377
node_modules/@actions/http-client/index.js
generated
vendored
Normal file
377
node_modules/@actions/http-client/index.js
generated
vendored
Normal file
@ -0,0 +1,377 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const url = require("url");
|
||||||
|
const http = require("http");
|
||||||
|
const https = require("https");
|
||||||
|
const pm = require("./proxy");
|
||||||
|
let tunnel;
|
||||||
|
var HttpCodes;
|
||||||
|
(function (HttpCodes) {
|
||||||
|
HttpCodes[HttpCodes["OK"] = 200] = "OK";
|
||||||
|
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
|
||||||
|
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
|
||||||
|
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
|
||||||
|
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
|
||||||
|
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
|
||||||
|
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
|
||||||
|
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
|
||||||
|
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
||||||
|
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
|
||||||
|
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
|
||||||
|
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
|
||||||
|
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
|
||||||
|
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
|
||||||
|
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
|
||||||
|
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
||||||
|
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
|
||||||
|
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
||||||
|
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
|
||||||
|
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
|
||||||
|
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
|
||||||
|
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
|
||||||
|
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
|
||||||
|
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
|
||||||
|
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
||||||
|
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
||||||
|
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
||||||
|
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
|
||||||
|
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
|
||||||
|
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
||||||
|
const ExponentialBackoffCeiling = 10;
|
||||||
|
const ExponentialBackoffTimeSlice = 5;
|
||||||
|
class HttpClientResponse {
|
||||||
|
constructor(message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
readBody() {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
let output = Buffer.alloc(0);
|
||||||
|
this.message.on('data', (chunk) => {
|
||||||
|
output = Buffer.concat([output, chunk]);
|
||||||
|
});
|
||||||
|
this.message.on('end', () => {
|
||||||
|
resolve(output.toString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.HttpClientResponse = HttpClientResponse;
|
||||||
|
function isHttps(requestUrl) {
|
||||||
|
let parsedUrl = url.parse(requestUrl);
|
||||||
|
return parsedUrl.protocol === 'https:';
|
||||||
|
}
|
||||||
|
exports.isHttps = isHttps;
|
||||||
|
class HttpClient {
|
||||||
|
constructor(userAgent, handlers, requestOptions) {
|
||||||
|
this._ignoreSslError = false;
|
||||||
|
this._allowRedirects = true;
|
||||||
|
this._allowRedirectDowngrade = false;
|
||||||
|
this._maxRedirects = 50;
|
||||||
|
this._allowRetries = false;
|
||||||
|
this._maxRetries = 1;
|
||||||
|
this._keepAlive = false;
|
||||||
|
this._disposed = false;
|
||||||
|
this.userAgent = userAgent;
|
||||||
|
this.handlers = handlers || [];
|
||||||
|
this.requestOptions = requestOptions;
|
||||||
|
if (requestOptions) {
|
||||||
|
if (requestOptions.ignoreSslError != null) {
|
||||||
|
this._ignoreSslError = requestOptions.ignoreSslError;
|
||||||
|
}
|
||||||
|
this._socketTimeout = requestOptions.socketTimeout;
|
||||||
|
if (requestOptions.allowRedirects != null) {
|
||||||
|
this._allowRedirects = requestOptions.allowRedirects;
|
||||||
|
}
|
||||||
|
if (requestOptions.allowRedirectDowngrade != null) {
|
||||||
|
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
||||||
|
}
|
||||||
|
if (requestOptions.maxRedirects != null) {
|
||||||
|
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
||||||
|
}
|
||||||
|
if (requestOptions.keepAlive != null) {
|
||||||
|
this._keepAlive = requestOptions.keepAlive;
|
||||||
|
}
|
||||||
|
if (requestOptions.allowRetries != null) {
|
||||||
|
this._allowRetries = requestOptions.allowRetries;
|
||||||
|
}
|
||||||
|
if (requestOptions.maxRetries != null) {
|
||||||
|
this._maxRetries = requestOptions.maxRetries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options(requestUrl, additionalHeaders) {
|
||||||
|
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
|
||||||
|
}
|
||||||
|
get(requestUrl, additionalHeaders) {
|
||||||
|
return this.request('GET', requestUrl, null, additionalHeaders || {});
|
||||||
|
}
|
||||||
|
del(requestUrl, additionalHeaders) {
|
||||||
|
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
|
||||||
|
}
|
||||||
|
post(requestUrl, data, additionalHeaders) {
|
||||||
|
return this.request('POST', requestUrl, data, additionalHeaders || {});
|
||||||
|
}
|
||||||
|
patch(requestUrl, data, additionalHeaders) {
|
||||||
|
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
|
||||||
|
}
|
||||||
|
put(requestUrl, data, additionalHeaders) {
|
||||||
|
return this.request('PUT', requestUrl, data, additionalHeaders || {});
|
||||||
|
}
|
||||||
|
head(requestUrl, additionalHeaders) {
|
||||||
|
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
|
||||||
|
}
|
||||||
|
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
||||||
|
return this.request(verb, requestUrl, stream, additionalHeaders);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Makes a raw http request.
|
||||||
|
* All other methods such as get, post, patch, and request ultimately call this.
|
||||||
|
* Prefer get, del, post and patch
|
||||||
|
*/
|
||||||
|
async request(verb, requestUrl, data, headers) {
|
||||||
|
if (this._disposed) {
|
||||||
|
throw new Error("Client has already been disposed.");
|
||||||
|
}
|
||||||
|
let parsedUrl = url.parse(requestUrl);
|
||||||
|
let info = this._prepareRequest(verb, parsedUrl, headers);
|
||||||
|
// Only perform retries on reads since writes may not be idempotent.
|
||||||
|
let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
|
||||||
|
let numTries = 0;
|
||||||
|
let response;
|
||||||
|
while (numTries < maxTries) {
|
||||||
|
response = await this.requestRaw(info, data);
|
||||||
|
// Check if it's an authentication challenge
|
||||||
|
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
||||||
|
let authenticationHandler;
|
||||||
|
for (let i = 0; i < this.handlers.length; i++) {
|
||||||
|
if (this.handlers[i].canHandleAuthentication(response)) {
|
||||||
|
authenticationHandler = this.handlers[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (authenticationHandler) {
|
||||||
|
return authenticationHandler.handleAuthentication(this, info, data);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// We have received an unauthorized response but have no handlers to handle it.
|
||||||
|
// Let the response return to the caller.
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let redirectsRemaining = this._maxRedirects;
|
||||||
|
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
|
||||||
|
&& this._allowRedirects
|
||||||
|
&& redirectsRemaining > 0) {
|
||||||
|
const redirectUrl = response.message.headers["location"];
|
||||||
|
if (!redirectUrl) {
|
||||||
|
// if there's no location to redirect to, we won't
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
let parsedRedirectUrl = url.parse(redirectUrl);
|
||||||
|
if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
|
||||||
|
throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
|
||||||
|
}
|
||||||
|
// we need to finish reading the response before reassigning response
|
||||||
|
// which will leak the open socket.
|
||||||
|
await response.readBody();
|
||||||
|
// let's make the request with the new redirectUrl
|
||||||
|
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
||||||
|
response = await this.requestRaw(info, data);
|
||||||
|
redirectsRemaining--;
|
||||||
|
}
|
||||||
|
if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
|
||||||
|
// If not a retry code, return immediately instead of retrying
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
numTries += 1;
|
||||||
|
if (numTries < maxTries) {
|
||||||
|
await response.readBody();
|
||||||
|
await this._performExponentialBackoff(numTries);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Needs to be called if keepAlive is set to true in request options.
|
||||||
|
*/
|
||||||
|
dispose() {
|
||||||
|
if (this._agent) {
|
||||||
|
this._agent.destroy();
|
||||||
|
}
|
||||||
|
this._disposed = true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Raw request.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
requestRaw(info, data) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let callbackForResult = function (err, res) {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
resolve(res);
|
||||||
|
};
|
||||||
|
this.requestRawWithCallback(info, data, callbackForResult);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Raw request with callback.
|
||||||
|
* @param info
|
||||||
|
* @param data
|
||||||
|
* @param onResult
|
||||||
|
*/
|
||||||
|
requestRawWithCallback(info, data, onResult) {
|
||||||
|
let socket;
|
||||||
|
if (typeof (data) === 'string') {
|
||||||
|
info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
|
||||||
|
}
|
||||||
|
let callbackCalled = false;
|
||||||
|
let handleResult = (err, res) => {
|
||||||
|
if (!callbackCalled) {
|
||||||
|
callbackCalled = true;
|
||||||
|
onResult(err, res);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let req = info.httpModule.request(info.options, (msg) => {
|
||||||
|
let res = new HttpClientResponse(msg);
|
||||||
|
handleResult(null, res);
|
||||||
|
});
|
||||||
|
req.on('socket', (sock) => {
|
||||||
|
socket = sock;
|
||||||
|
});
|
||||||
|
// If we ever get disconnected, we want the socket to timeout eventually
|
||||||
|
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
|
||||||
|
if (socket) {
|
||||||
|
socket.end();
|
||||||
|
}
|
||||||
|
handleResult(new Error('Request timeout: ' + info.options.path), null);
|
||||||
|
});
|
||||||
|
req.on('error', function (err) {
|
||||||
|
// err has statusCode property
|
||||||
|
// res should have headers
|
||||||
|
handleResult(err, null);
|
||||||
|
});
|
||||||
|
if (data && typeof (data) === 'string') {
|
||||||
|
req.write(data, 'utf8');
|
||||||
|
}
|
||||||
|
if (data && typeof (data) !== 'string') {
|
||||||
|
data.on('close', function () {
|
||||||
|
req.end();
|
||||||
|
});
|
||||||
|
data.pipe(req);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
req.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||||
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
getAgent(serverUrl) {
|
||||||
|
let parsedUrl = url.parse(serverUrl);
|
||||||
|
return this._getAgent(parsedUrl);
|
||||||
|
}
|
||||||
|
_prepareRequest(method, requestUrl, headers) {
|
||||||
|
const info = {};
|
||||||
|
info.parsedUrl = requestUrl;
|
||||||
|
const usingSsl = info.parsedUrl.protocol === 'https:';
|
||||||
|
info.httpModule = usingSsl ? https : http;
|
||||||
|
const defaultPort = usingSsl ? 443 : 80;
|
||||||
|
info.options = {};
|
||||||
|
info.options.host = info.parsedUrl.hostname;
|
||||||
|
info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
|
||||||
|
info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
||||||
|
info.options.method = method;
|
||||||
|
info.options.headers = this._mergeHeaders(headers);
|
||||||
|
if (this.userAgent != null) {
|
||||||
|
info.options.headers["user-agent"] = this.userAgent;
|
||||||
|
}
|
||||||
|
info.options.agent = this._getAgent(info.parsedUrl);
|
||||||
|
// gives handlers an opportunity to participate
|
||||||
|
if (this.handlers) {
|
||||||
|
this.handlers.forEach((handler) => {
|
||||||
|
handler.prepareRequest(info.options);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
_mergeHeaders(headers) {
|
||||||
|
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
|
||||||
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
|
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
|
||||||
|
}
|
||||||
|
return lowercaseKeys(headers || {});
|
||||||
|
}
|
||||||
|
_getAgent(parsedUrl) {
|
||||||
|
let agent;
|
||||||
|
let proxyUrl = pm.getProxyUrl(parsedUrl);
|
||||||
|
let useProxy = proxyUrl && proxyUrl.hostname;
|
||||||
|
if (this._keepAlive && useProxy) {
|
||||||
|
agent = this._proxyAgent;
|
||||||
|
}
|
||||||
|
if (this._keepAlive && !useProxy) {
|
||||||
|
agent = this._agent;
|
||||||
|
}
|
||||||
|
// if agent is already assigned use that agent.
|
||||||
|
if (!!agent) {
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
const usingSsl = parsedUrl.protocol === 'https:';
|
||||||
|
let maxSockets = 100;
|
||||||
|
if (!!this.requestOptions) {
|
||||||
|
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
|
||||||
|
}
|
||||||
|
if (useProxy) {
|
||||||
|
// If using proxy, need tunnel
|
||||||
|
if (!tunnel) {
|
||||||
|
tunnel = require('tunnel');
|
||||||
|
}
|
||||||
|
const agentOptions = {
|
||||||
|
maxSockets: maxSockets,
|
||||||
|
keepAlive: this._keepAlive,
|
||||||
|
proxy: {
|
||||||
|
proxyAuth: proxyUrl.auth,
|
||||||
|
host: proxyUrl.hostname,
|
||||||
|
port: proxyUrl.port
|
||||||
|
},
|
||||||
|
};
|
||||||
|
let tunnelAgent;
|
||||||
|
const overHttps = proxyUrl.protocol === 'https:';
|
||||||
|
if (usingSsl) {
|
||||||
|
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
|
||||||
|
}
|
||||||
|
agent = tunnelAgent(agentOptions);
|
||||||
|
this._proxyAgent = agent;
|
||||||
|
}
|
||||||
|
// if reusing agent across request and tunneling agent isn't assigned create a new agent
|
||||||
|
if (this._keepAlive && !agent) {
|
||||||
|
const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
|
||||||
|
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
|
||||||
|
this._agent = agent;
|
||||||
|
}
|
||||||
|
// if not using private agent and tunnel agent isn't setup then use global agent
|
||||||
|
if (!agent) {
|
||||||
|
agent = usingSsl ? https.globalAgent : http.globalAgent;
|
||||||
|
}
|
||||||
|
if (usingSsl && this._ignoreSslError) {
|
||||||
|
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
|
||||||
|
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
|
||||||
|
// we have to cast it to any and change it directly
|
||||||
|
agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
|
||||||
|
}
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
_performExponentialBackoff(retryNumber) {
|
||||||
|
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
||||||
|
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
||||||
|
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.HttpClient = HttpClient;
|
44
node_modules/@actions/http-client/interfaces.d.ts
generated
vendored
Normal file
44
node_modules/@actions/http-client/interfaces.d.ts
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import http = require("http");
|
||||||
|
import url = require("url");
|
||||||
|
export interface IHeaders {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
export interface IHttpClient {
|
||||||
|
options(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
get(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
del(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
post(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
patch(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
put(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: IHeaders): Promise<IHttpClientResponse>;
|
||||||
|
requestRaw(info: IRequestInfo, data: string | NodeJS.ReadableStream): Promise<IHttpClientResponse>;
|
||||||
|
requestRawWithCallback(info: IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: IHttpClientResponse) => void): void;
|
||||||
|
}
|
||||||
|
export interface IRequestHandler {
|
||||||
|
prepareRequest(options: http.RequestOptions): void;
|
||||||
|
canHandleAuthentication(response: IHttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: IHttpClient, requestInfo: IRequestInfo, objs: any): Promise<IHttpClientResponse>;
|
||||||
|
}
|
||||||
|
export interface IHttpClientResponse {
|
||||||
|
message: http.IncomingMessage;
|
||||||
|
readBody(): Promise<string>;
|
||||||
|
}
|
||||||
|
export interface IRequestInfo {
|
||||||
|
options: http.RequestOptions;
|
||||||
|
parsedUrl: url.Url;
|
||||||
|
httpModule: any;
|
||||||
|
}
|
||||||
|
export interface IRequestOptions {
|
||||||
|
headers?: IHeaders;
|
||||||
|
socketTimeout?: number;
|
||||||
|
ignoreSslError?: boolean;
|
||||||
|
allowRedirects?: boolean;
|
||||||
|
allowRedirectDowngrade?: boolean;
|
||||||
|
maxRedirects?: number;
|
||||||
|
maxSockets?: number;
|
||||||
|
keepAlive?: boolean;
|
||||||
|
allowRetries?: boolean;
|
||||||
|
maxRetries?: number;
|
||||||
|
}
|
3
node_modules/@actions/http-client/interfaces.js
generated
vendored
Normal file
3
node_modules/@actions/http-client/interfaces.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
;
|
66
node_modules/@actions/http-client/package.json
generated
vendored
Normal file
66
node_modules/@actions/http-client/package.json
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"@actions/http-client@1.0.2",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "@actions/http-client@1.0.2",
|
||||||
|
"_id": "@actions/http-client@1.0.2",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-ngdGx7aXM7i9BFT+7e3RWWAEt3bX4tKrdI5w5hf0wYpHz66u5Nw6AFSFXG5wzQyUQbkgeNRnJZyK2zciGqXgrQ==",
|
||||||
|
"_location": "/@actions/http-client",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "@actions/http-client@1.0.2",
|
||||||
|
"name": "@actions/http-client",
|
||||||
|
"escapedName": "@actions%2fhttp-client",
|
||||||
|
"scope": "@actions",
|
||||||
|
"rawSpec": "1.0.2",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "1.0.2"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/@actions/tool-cache"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.2.tgz",
|
||||||
|
"_spec": "1.0.2",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"author": {
|
||||||
|
"name": "GitHub, Inc."
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/http-client/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tunnel": "0.0.6"
|
||||||
|
},
|
||||||
|
"description": "Actions Http Client",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/jest": "^24.0.25",
|
||||||
|
"@types/node": "^12.12.24",
|
||||||
|
"jest": "^24.9.0",
|
||||||
|
"proxy": "^1.0.1",
|
||||||
|
"ts-jest": "^24.3.0",
|
||||||
|
"typescript": "^3.7.4"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/actions/http-client#readme",
|
||||||
|
"keywords": [
|
||||||
|
"Actions",
|
||||||
|
"Http"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.js",
|
||||||
|
"name": "@actions/http-client",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/http-client.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "rm -Rf ./_out && tsc && cp package*.json ./_out && cp *.md ./_out && cp LICENSE ./_out && cp actions.png ./_out",
|
||||||
|
"test": "jest"
|
||||||
|
},
|
||||||
|
"version": "1.0.2"
|
||||||
|
}
|
3
node_modules/@actions/http-client/proxy.d.ts
generated
vendored
Normal file
3
node_modules/@actions/http-client/proxy.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import * as url from 'url';
|
||||||
|
export declare function getProxyUrl(reqUrl: url.Url): url.Url;
|
39
node_modules/@actions/http-client/proxy.js
generated
vendored
Normal file
39
node_modules/@actions/http-client/proxy.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const url = require("url");
|
||||||
|
function getProxyUrl(reqUrl) {
|
||||||
|
let usingSsl = reqUrl.protocol === 'https:';
|
||||||
|
let noProxy = process.env["no_proxy"] ||
|
||||||
|
process.env["NO_PROXY"];
|
||||||
|
let bypass;
|
||||||
|
if (noProxy && typeof noProxy === 'string') {
|
||||||
|
let bypassList = noProxy.split(',');
|
||||||
|
for (let i = 0; i < bypassList.length; i++) {
|
||||||
|
let item = bypassList[i];
|
||||||
|
if (item &&
|
||||||
|
typeof item === "string" &&
|
||||||
|
reqUrl.host.toLocaleLowerCase() == item.trim().toLocaleLowerCase()) {
|
||||||
|
bypass = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let proxyUrl;
|
||||||
|
if (bypass) {
|
||||||
|
return proxyUrl;
|
||||||
|
}
|
||||||
|
let proxyVar;
|
||||||
|
if (usingSsl) {
|
||||||
|
proxyVar = process.env["https_proxy"] ||
|
||||||
|
process.env["HTTPS_PROXY"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
proxyVar = process.env["http_proxy"] ||
|
||||||
|
process.env["HTTP_PROXY"];
|
||||||
|
}
|
||||||
|
if (proxyVar) {
|
||||||
|
proxyUrl = url.parse(proxyVar);
|
||||||
|
}
|
||||||
|
return proxyUrl;
|
||||||
|
}
|
||||||
|
exports.getProxyUrl = getProxyUrl;
|
53
node_modules/@actions/io/README.md
generated
vendored
Normal file
53
node_modules/@actions/io/README.md
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# `@actions/io`
|
||||||
|
|
||||||
|
> Core functions for cli filesystem scenarios
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
#### mkdir -p
|
||||||
|
|
||||||
|
Recursively make a directory. Follows rules specified in [man mkdir](https://linux.die.net/man/1/mkdir) with the `-p` option specified:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const io = require('@actions/io');
|
||||||
|
|
||||||
|
await io.mkdirP('path/to/make');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### cp/mv
|
||||||
|
|
||||||
|
Copy or move files or folders. Follows rules specified in [man cp](https://linux.die.net/man/1/cp) and [man mv](https://linux.die.net/man/1/mv):
|
||||||
|
|
||||||
|
```js
|
||||||
|
const io = require('@actions/io');
|
||||||
|
|
||||||
|
// Recursive must be true for directories
|
||||||
|
const options = { recursive: true, force: false }
|
||||||
|
|
||||||
|
await io.cp('path/to/directory', 'path/to/dest', options);
|
||||||
|
await io.mv('path/to/file', 'path/to/dest');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rm -rf
|
||||||
|
|
||||||
|
Remove a file or folder recursively. Follows rules specified in [man rm](https://linux.die.net/man/1/rm) with the `-r` and `-f` rules specified.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const io = require('@actions/io');
|
||||||
|
|
||||||
|
await io.rmRF('path/to/directory');
|
||||||
|
await io.rmRF('path/to/file');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### which
|
||||||
|
|
||||||
|
Get the path to a tool and resolves via paths. Follows the rules specified in [man which](https://linux.die.net/man/1/which).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const exec = require('@actions/exec');
|
||||||
|
const io = require('@actions/io');
|
||||||
|
|
||||||
|
const pythonPath: string = await io.which('python', true)
|
||||||
|
|
||||||
|
await exec.exec(`"${pythonPath}"`, ['main.py']);
|
||||||
|
```
|
29
node_modules/@actions/io/lib/io-util.d.ts
generated
vendored
Normal file
29
node_modules/@actions/io/lib/io-util.d.ts
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import * as fs from 'fs';
|
||||||
|
export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink;
|
||||||
|
export declare const IS_WINDOWS: boolean;
|
||||||
|
export declare function exists(fsPath: string): Promise<boolean>;
|
||||||
|
export declare function isDirectory(fsPath: string, useStat?: boolean): Promise<boolean>;
|
||||||
|
/**
|
||||||
|
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
|
||||||
|
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
|
||||||
|
*/
|
||||||
|
export declare function isRooted(p: string): boolean;
|
||||||
|
/**
|
||||||
|
* Recursively create a directory at `fsPath`.
|
||||||
|
*
|
||||||
|
* This implementation is optimistic, meaning it attempts to create the full
|
||||||
|
* path first, and backs up the path stack from there.
|
||||||
|
*
|
||||||
|
* @param fsPath The path to create
|
||||||
|
* @param maxDepth The maximum recursion depth
|
||||||
|
* @param depth The current recursion depth
|
||||||
|
*/
|
||||||
|
export declare function mkdirP(fsPath: string, maxDepth?: number, depth?: number): Promise<void>;
|
||||||
|
/**
|
||||||
|
* Best effort attempt to determine whether a file exists and is executable.
|
||||||
|
* @param filePath file path to check
|
||||||
|
* @param extensions additional file extensions to try
|
||||||
|
* @return if file exists and is executable, returns the file path. otherwise empty string.
|
||||||
|
*/
|
||||||
|
export declare function tryGetExecutablePath(filePath: string, extensions: string[]): Promise<string>;
|
195
node_modules/@actions/io/lib/io-util.js
generated
vendored
Normal file
195
node_modules/@actions/io/lib/io-util.js
generated
vendored
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var _a;
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const assert_1 = require("assert");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
||||||
|
exports.IS_WINDOWS = process.platform === 'win32';
|
||||||
|
function exists(fsPath) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
yield exports.stat(fsPath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
if (err.code === 'ENOENT') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.exists = exists;
|
||||||
|
function isDirectory(fsPath, useStat = false) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
|
||||||
|
return stats.isDirectory();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.isDirectory = isDirectory;
|
||||||
|
/**
|
||||||
|
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
|
||||||
|
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
|
||||||
|
*/
|
||||||
|
function isRooted(p) {
|
||||||
|
p = normalizeSeparators(p);
|
||||||
|
if (!p) {
|
||||||
|
throw new Error('isRooted() parameter "p" cannot be empty');
|
||||||
|
}
|
||||||
|
if (exports.IS_WINDOWS) {
|
||||||
|
return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
|
||||||
|
); // e.g. C: or C:\hello
|
||||||
|
}
|
||||||
|
return p.startsWith('/');
|
||||||
|
}
|
||||||
|
exports.isRooted = isRooted;
|
||||||
|
/**
|
||||||
|
* Recursively create a directory at `fsPath`.
|
||||||
|
*
|
||||||
|
* This implementation is optimistic, meaning it attempts to create the full
|
||||||
|
* path first, and backs up the path stack from there.
|
||||||
|
*
|
||||||
|
* @param fsPath The path to create
|
||||||
|
* @param maxDepth The maximum recursion depth
|
||||||
|
* @param depth The current recursion depth
|
||||||
|
*/
|
||||||
|
function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
assert_1.ok(fsPath, 'a path argument must be provided');
|
||||||
|
fsPath = path.resolve(fsPath);
|
||||||
|
if (depth >= maxDepth)
|
||||||
|
return exports.mkdir(fsPath);
|
||||||
|
try {
|
||||||
|
yield exports.mkdir(fsPath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
switch (err.code) {
|
||||||
|
case 'ENOENT': {
|
||||||
|
yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
|
||||||
|
yield exports.mkdir(fsPath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
let stats;
|
||||||
|
try {
|
||||||
|
stats = yield exports.stat(fsPath);
|
||||||
|
}
|
||||||
|
catch (err2) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
if (!stats.isDirectory())
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.mkdirP = mkdirP;
|
||||||
|
/**
|
||||||
|
* Best effort attempt to determine whether a file exists and is executable.
|
||||||
|
* @param filePath file path to check
|
||||||
|
* @param extensions additional file extensions to try
|
||||||
|
* @return if file exists and is executable, returns the file path. otherwise empty string.
|
||||||
|
*/
|
||||||
|
function tryGetExecutablePath(filePath, extensions) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let stats = undefined;
|
||||||
|
try {
|
||||||
|
// test file exists
|
||||||
|
stats = yield exports.stat(filePath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
if (err.code !== 'ENOENT') {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stats && stats.isFile()) {
|
||||||
|
if (exports.IS_WINDOWS) {
|
||||||
|
// on Windows, test for valid extension
|
||||||
|
const upperExt = path.extname(filePath).toUpperCase();
|
||||||
|
if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (isUnixExecutable(stats)) {
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// try each extension
|
||||||
|
const originalFilePath = filePath;
|
||||||
|
for (const extension of extensions) {
|
||||||
|
filePath = originalFilePath + extension;
|
||||||
|
stats = undefined;
|
||||||
|
try {
|
||||||
|
stats = yield exports.stat(filePath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
if (err.code !== 'ENOENT') {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stats && stats.isFile()) {
|
||||||
|
if (exports.IS_WINDOWS) {
|
||||||
|
// preserve the case of the actual file (since an extension was appended)
|
||||||
|
try {
|
||||||
|
const directory = path.dirname(filePath);
|
||||||
|
const upperName = path.basename(filePath).toUpperCase();
|
||||||
|
for (const actualName of yield exports.readdir(directory)) {
|
||||||
|
if (upperName === actualName.toUpperCase()) {
|
||||||
|
filePath = path.join(directory, actualName);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
|
||||||
|
}
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (isUnixExecutable(stats)) {
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.tryGetExecutablePath = tryGetExecutablePath;
|
||||||
|
function normalizeSeparators(p) {
|
||||||
|
p = p || '';
|
||||||
|
if (exports.IS_WINDOWS) {
|
||||||
|
// convert slashes on Windows
|
||||||
|
p = p.replace(/\//g, '\\');
|
||||||
|
// remove redundant slashes
|
||||||
|
return p.replace(/\\\\+/g, '\\');
|
||||||
|
}
|
||||||
|
// remove redundant slashes
|
||||||
|
return p.replace(/\/\/+/g, '/');
|
||||||
|
}
|
||||||
|
// on Mac/Linux, test the execute bit
|
||||||
|
// R W X R W X R W X
|
||||||
|
// 256 128 64 32 16 8 4 2 1
|
||||||
|
function isUnixExecutable(stats) {
|
||||||
|
return ((stats.mode & 1) > 0 ||
|
||||||
|
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
|
||||||
|
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=io-util.js.map
|
1
node_modules/@actions/io/lib/io-util.js.map
generated
vendored
Normal file
1
node_modules/@actions/io/lib/io-util.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyB;AACzB,yBAAwB;AACxB,6BAA4B;AAEf,gBAYE,qTAAA;AAEF,QAAA,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAEtD,SAAsB,MAAM,CAAC,MAAc;;QACzC,IAAI;YACF,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;SACnB;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO,KAAK,CAAA;aACb;YAED,MAAM,GAAG,CAAA;SACV;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AAZD,wBAYC;AAED,SAAsB,WAAW,CAC/B,MAAc,EACd,UAAmB,KAAK;;QAExB,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,YAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;QAChE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC5B,CAAC;CAAA;AAND,kCAMC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CAAC,CAAS;IAChC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAC1B,IAAI,CAAC,CAAC,EAAE;QACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;KAC5D;IAED,IAAI,kBAAU,EAAE;QACd,OAAO,CACL,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,8BAA8B;SACxE,CAAA,CAAC,sBAAsB;KACzB;IAED,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAbD,4BAaC;AAED;;;;;;;;;GASG;AACH,SAAsB,MAAM,CAC1B,MAAc,EACd,WAAmB,IAAI,EACvB,QAAgB,CAAC;;QAEjB,WAAE,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAA;QAE9C,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE7B,IAAI,KAAK,IAAI,QAAQ;YAAE,OAAO,aAAK,CAAC,MAAM,CAAC,CAAA;QAE3C,IAAI;YACF,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;YACnB,OAAM;SACP;QAAC,OAAO,GAAG,EAAE;YACZ,QAAQ,GAAG,CAAC,IAAI,EAAE;gBAChB,KAAK,QAAQ,CAAC,CAAC;oBACb,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;oBACvD,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;oBACnB,OAAM;iBACP;gBACD,OAAO,CAAC,CAAC;oBACP,IAAI,KAAe,CAAA;oBAEnB,IAAI;wBACF,KAAK,GAAG,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;qBAC3B;oBAAC,OAAO,IAAI,EAAE;wBACb,MAAM,GAAG,CAAA;qBACV;oBAED,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;wBAAE,MAAM,GAAG,CAAA;iBACpC;aACF;SACF;IACH,CAAC;CAAA;AAlCD,wBAkCC;AAED;;;;;GAKG;AACH,SAAsB,oBAAoB,CACxC,QAAgB,EAChB,UAAoB;;QAEpB,IAAI,KAAK,GAAyB,SAAS,CAAA;QAC3C,IAAI;YACF,mBAAmB;YACnB,KAAK,GAAG,MAAM,YAAI,CAAC,QAAQ,CAAC,CAAA;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CACT,uEAAuE,QAAQ,MAAM,GAAG,EAAE,CAC3F,CAAA;aACF;SACF;QACD,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;YAC3B,IAAI,kBAAU,EAAE;gBACd,uCAAuC;gBACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;gBACrD,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,EAAE;oBACpE,OAAO,QAAQ,CAAA;iBAChB;aACF;iBAAM;gBACL,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;oBAC3B,OAAO,QAAQ,CAAA;iBAChB;aACF;SACF;QAED,qBAAqB;QACrB,MAAM,gBAAgB,GAAG,QAAQ,CAAA;QACjC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,QAAQ,GAAG,gBAAgB,GAAG,SAAS,CAAA;YAEvC,KAAK,GAAG,SAAS,CAAA;YACjB,IAAI;gBACF,KAAK,GAAG,MAAM,YAAI,CAAC,QAAQ,CAAC,CAAA;aAC7B;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;oBACzB,sCAAsC;oBACtC,OAAO,CAAC,GAAG,CACT,uEAAuE,QAAQ,MAAM,GAAG,EAAE,CAC3F,CAAA;iBACF;aACF;YAED,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;gBAC3B,IAAI,kBAAU,EAAE;oBACd,yEAAyE;oBACzE,IAAI;wBACF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;wBACxC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;wBACvD,KAAK,MAAM,UAAU,IAAI,MAAM,eAAO,CAAC,SAAS,CAAC,EAAE;4BACjD,IAAI,SAAS,KAAK,UAAU,CAAC,WAAW,EAAE,EAAE;gCAC1C,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;gCAC3C,MAAK;6BACN;yBACF;qBACF;oBAAC,OAAO,GAAG,EAAE;wBACZ,sCAAsC;wBACtC,OAAO,CAAC,GAAG,CACT,yEAAyE,QAAQ,MAAM,GAAG,EAAE,CAC7F,CAAA;qBACF;oBAED,OAAO,QAAQ,CAAA;iBAChB;qBAAM;oBACL,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;wBAC3B,OAAO,QAAQ,CAAA;qBAChB;iBACF;aACF;SACF;QAED,OAAO,EAAE,CAAA;IACX,CAAC;CAAA;AA5ED,oDA4EC;AAED,SAAS,mBAAmB,CAAC,CAAS;IACpC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACX,IAAI,kBAAU,EAAE;QACd,6BAA6B;QAC7B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAE1B,2BAA2B;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;KACjC;IAED,2BAA2B;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,qCAAqC;AACrC,6BAA6B;AAC7B,6BAA6B;AAC7B,SAAS,gBAAgB,CAAC,KAAe;IACvC,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAC1D,CAAA;AACH,CAAC"}
|
56
node_modules/@actions/io/lib/io.d.ts
generated
vendored
Normal file
56
node_modules/@actions/io/lib/io.d.ts
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/**
|
||||||
|
* Interface for cp/mv options
|
||||||
|
*/
|
||||||
|
export interface CopyOptions {
|
||||||
|
/** Optional. Whether to recursively copy all subdirectories. Defaults to false */
|
||||||
|
recursive?: boolean;
|
||||||
|
/** Optional. Whether to overwrite existing files in the destination. Defaults to true */
|
||||||
|
force?: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Interface for cp/mv options
|
||||||
|
*/
|
||||||
|
export interface MoveOptions {
|
||||||
|
/** Optional. Whether to overwrite existing files in the destination. Defaults to true */
|
||||||
|
force?: boolean;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Copies a file or folder.
|
||||||
|
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
|
||||||
|
*
|
||||||
|
* @param source source path
|
||||||
|
* @param dest destination path
|
||||||
|
* @param options optional. See CopyOptions.
|
||||||
|
*/
|
||||||
|
export declare function cp(source: string, dest: string, options?: CopyOptions): Promise<void>;
|
||||||
|
/**
|
||||||
|
* Moves a path.
|
||||||
|
*
|
||||||
|
* @param source source path
|
||||||
|
* @param dest destination path
|
||||||
|
* @param options optional. See MoveOptions.
|
||||||
|
*/
|
||||||
|
export declare function mv(source: string, dest: string, options?: MoveOptions): Promise<void>;
|
||||||
|
/**
|
||||||
|
* Remove a path recursively with force
|
||||||
|
*
|
||||||
|
* @param inputPath path to remove
|
||||||
|
*/
|
||||||
|
export declare function rmRF(inputPath: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* Make a directory. Creates the full path with folders in between
|
||||||
|
* Will throw if it fails
|
||||||
|
*
|
||||||
|
* @param fsPath path to create
|
||||||
|
* @returns Promise<void>
|
||||||
|
*/
|
||||||
|
export declare function mkdirP(fsPath: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
|
||||||
|
* If you check and the tool does not exist, it will throw.
|
||||||
|
*
|
||||||
|
* @param tool name of the tool
|
||||||
|
* @param check whether to check if tool exists
|
||||||
|
* @returns Promise<string> path to tool
|
||||||
|
*/
|
||||||
|
export declare function which(tool: string, check?: boolean): Promise<string>;
|
290
node_modules/@actions/io/lib/io.js
generated
vendored
Normal file
290
node_modules/@actions/io/lib/io.js
generated
vendored
Normal file
@ -0,0 +1,290 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const childProcess = require("child_process");
|
||||||
|
const path = require("path");
|
||||||
|
const util_1 = require("util");
|
||||||
|
const ioUtil = require("./io-util");
|
||||||
|
const exec = util_1.promisify(childProcess.exec);
|
||||||
|
/**
|
||||||
|
* Copies a file or folder.
|
||||||
|
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
|
||||||
|
*
|
||||||
|
* @param source source path
|
||||||
|
* @param dest destination path
|
||||||
|
* @param options optional. See CopyOptions.
|
||||||
|
*/
|
||||||
|
function cp(source, dest, options = {}) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const { force, recursive } = readCopyOptions(options);
|
||||||
|
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
|
||||||
|
// Dest is an existing file, but not forcing
|
||||||
|
if (destStat && destStat.isFile() && !force) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// If dest is an existing directory, should copy inside.
|
||||||
|
const newDest = destStat && destStat.isDirectory()
|
||||||
|
? path.join(dest, path.basename(source))
|
||||||
|
: dest;
|
||||||
|
if (!(yield ioUtil.exists(source))) {
|
||||||
|
throw new Error(`no such file or directory: ${source}`);
|
||||||
|
}
|
||||||
|
const sourceStat = yield ioUtil.stat(source);
|
||||||
|
if (sourceStat.isDirectory()) {
|
||||||
|
if (!recursive) {
|
||||||
|
throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield cpDirRecursive(source, newDest, 0, force);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (path.relative(source, newDest) === '') {
|
||||||
|
// a file cannot be copied to itself
|
||||||
|
throw new Error(`'${newDest}' and '${source}' are the same file`);
|
||||||
|
}
|
||||||
|
yield copyFile(source, newDest, force);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.cp = cp;
|
||||||
|
/**
|
||||||
|
* Moves a path.
|
||||||
|
*
|
||||||
|
* @param source source path
|
||||||
|
* @param dest destination path
|
||||||
|
* @param options optional. See MoveOptions.
|
||||||
|
*/
|
||||||
|
function mv(source, dest, options = {}) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (yield ioUtil.exists(dest)) {
|
||||||
|
let destExists = true;
|
||||||
|
if (yield ioUtil.isDirectory(dest)) {
|
||||||
|
// If dest is directory copy src into dest
|
||||||
|
dest = path.join(dest, path.basename(source));
|
||||||
|
destExists = yield ioUtil.exists(dest);
|
||||||
|
}
|
||||||
|
if (destExists) {
|
||||||
|
if (options.force == null || options.force) {
|
||||||
|
yield rmRF(dest);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new Error('Destination already exists');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yield mkdirP(path.dirname(dest));
|
||||||
|
yield ioUtil.rename(source, dest);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.mv = mv;
|
||||||
|
/**
|
||||||
|
* Remove a path recursively with force
|
||||||
|
*
|
||||||
|
* @param inputPath path to remove
|
||||||
|
*/
|
||||||
|
function rmRF(inputPath) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (ioUtil.IS_WINDOWS) {
|
||||||
|
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
|
||||||
|
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
|
||||||
|
try {
|
||||||
|
if (yield ioUtil.isDirectory(inputPath, true)) {
|
||||||
|
yield exec(`rd /s /q "${inputPath}"`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield exec(`del /f /a "${inputPath}"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
|
// other errors are valid
|
||||||
|
if (err.code !== 'ENOENT')
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
|
||||||
|
try {
|
||||||
|
yield ioUtil.unlink(inputPath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
|
// other errors are valid
|
||||||
|
if (err.code !== 'ENOENT')
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let isDir = false;
|
||||||
|
try {
|
||||||
|
isDir = yield ioUtil.isDirectory(inputPath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
|
// other errors are valid
|
||||||
|
if (err.code !== 'ENOENT')
|
||||||
|
throw err;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isDir) {
|
||||||
|
yield exec(`rm -rf "${inputPath}"`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield ioUtil.unlink(inputPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.rmRF = rmRF;
|
||||||
|
/**
|
||||||
|
* Make a directory. Creates the full path with folders in between
|
||||||
|
* Will throw if it fails
|
||||||
|
*
|
||||||
|
* @param fsPath path to create
|
||||||
|
* @returns Promise<void>
|
||||||
|
*/
|
||||||
|
function mkdirP(fsPath) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
yield ioUtil.mkdirP(fsPath);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.mkdirP = mkdirP;
|
||||||
|
/**
|
||||||
|
* Returns path of a tool had the tool actually been invoked. Resolves via paths.
|
||||||
|
* If you check and the tool does not exist, it will throw.
|
||||||
|
*
|
||||||
|
* @param tool name of the tool
|
||||||
|
* @param check whether to check if tool exists
|
||||||
|
* @returns Promise<string> path to tool
|
||||||
|
*/
|
||||||
|
function which(tool, check) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!tool) {
|
||||||
|
throw new Error("parameter 'tool' is required");
|
||||||
|
}
|
||||||
|
// recursive when check=true
|
||||||
|
if (check) {
|
||||||
|
const result = yield which(tool, false);
|
||||||
|
if (!result) {
|
||||||
|
if (ioUtil.IS_WINDOWS) {
|
||||||
|
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// build the list of extensions to try
|
||||||
|
const extensions = [];
|
||||||
|
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
|
||||||
|
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
|
||||||
|
if (extension) {
|
||||||
|
extensions.push(extension);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if it's rooted, return it if exists. otherwise return empty.
|
||||||
|
if (ioUtil.isRooted(tool)) {
|
||||||
|
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||||||
|
if (filePath) {
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// if any path separators, return empty
|
||||||
|
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// build the list of directories
|
||||||
|
//
|
||||||
|
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
||||||
|
// it feels like we should not do this. Checking the current directory seems like more of a use
|
||||||
|
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
||||||
|
// across platforms.
|
||||||
|
const directories = [];
|
||||||
|
if (process.env.PATH) {
|
||||||
|
for (const p of process.env.PATH.split(path.delimiter)) {
|
||||||
|
if (p) {
|
||||||
|
directories.push(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// return the first match
|
||||||
|
for (const directory of directories) {
|
||||||
|
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
|
||||||
|
if (filePath) {
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
throw new Error(`which failed with message ${err.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.which = which;
|
||||||
|
function readCopyOptions(options) {
|
||||||
|
const force = options.force == null ? true : options.force;
|
||||||
|
const recursive = Boolean(options.recursive);
|
||||||
|
return { force, recursive };
|
||||||
|
}
|
||||||
|
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// Ensure there is not a run away recursive copy
|
||||||
|
if (currentDepth >= 255)
|
||||||
|
return;
|
||||||
|
currentDepth++;
|
||||||
|
yield mkdirP(destDir);
|
||||||
|
const files = yield ioUtil.readdir(sourceDir);
|
||||||
|
for (const fileName of files) {
|
||||||
|
const srcFile = `${sourceDir}/${fileName}`;
|
||||||
|
const destFile = `${destDir}/${fileName}`;
|
||||||
|
const srcFileStat = yield ioUtil.lstat(srcFile);
|
||||||
|
if (srcFileStat.isDirectory()) {
|
||||||
|
// Recurse
|
||||||
|
yield cpDirRecursive(srcFile, destFile, currentDepth, force);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield copyFile(srcFile, destFile, force);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Change the mode for the newly created directory
|
||||||
|
yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Buffered file copy
|
||||||
|
function copyFile(srcFile, destFile, force) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
|
||||||
|
// unlink/re-link it
|
||||||
|
try {
|
||||||
|
yield ioUtil.lstat(destFile);
|
||||||
|
yield ioUtil.unlink(destFile);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// Try to override file permission
|
||||||
|
if (e.code === 'EPERM') {
|
||||||
|
yield ioUtil.chmod(destFile, '0666');
|
||||||
|
yield ioUtil.unlink(destFile);
|
||||||
|
}
|
||||||
|
// other errors = it doesn't exist, no work to do
|
||||||
|
}
|
||||||
|
// Copy over symlink
|
||||||
|
const symlinkFull = yield ioUtil.readlink(srcFile);
|
||||||
|
yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
|
||||||
|
}
|
||||||
|
else if (!(yield ioUtil.exists(destFile)) || force) {
|
||||||
|
yield ioUtil.copyFile(srcFile, destFile);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=io.js.map
|
1
node_modules/@actions/io/lib/io.js.map
generated
vendored
Normal file
1
node_modules/@actions/io/lib/io.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
67
node_modules/@actions/io/package.json
generated
vendored
Normal file
67
node_modules/@actions/io/package.json
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"@actions/io@1.0.2",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "@actions/io@1.0.2",
|
||||||
|
"_id": "@actions/io@1.0.2",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg==",
|
||||||
|
"_location": "/@actions/io",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "@actions/io@1.0.2",
|
||||||
|
"name": "@actions/io",
|
||||||
|
"escapedName": "@actions%2fio",
|
||||||
|
"scope": "@actions",
|
||||||
|
"rawSpec": "1.0.2",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "1.0.2"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/@actions/exec",
|
||||||
|
"/@actions/tool-cache"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz",
|
||||||
|
"_spec": "1.0.2",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"description": "Actions io lib",
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/io",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"io"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/io.js",
|
||||||
|
"name": "@actions/io",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/io"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"types": "lib/io.d.ts",
|
||||||
|
"version": "1.0.2"
|
||||||
|
}
|
82
node_modules/@actions/tool-cache/README.md
generated
vendored
Normal file
82
node_modules/@actions/tool-cache/README.md
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
# `@actions/tool-cache`
|
||||||
|
|
||||||
|
> Functions necessary for downloading and caching tools.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
#### Download
|
||||||
|
|
||||||
|
You can use this to download tools (or other files) from a download URL:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const tc = require('@actions/tool-cache');
|
||||||
|
|
||||||
|
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Extract
|
||||||
|
|
||||||
|
These can then be extracted in platform specific ways:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const tc = require('@actions/tool-cache');
|
||||||
|
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip');
|
||||||
|
const node12ExtractedFolder = await tc.extractZip(node12Path, 'path/to/extract/to');
|
||||||
|
|
||||||
|
// Or alternately
|
||||||
|
const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z');
|
||||||
|
const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz');
|
||||||
|
const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Cache
|
||||||
|
|
||||||
|
Finally, you can cache these directories in our tool-cache. This is useful if you want to switch back and forth between versions of a tool, or save a tool between runs for private runners (private runners are still in development but are on the roadmap).
|
||||||
|
|
||||||
|
You'll often want to add it to the path as part of this step:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const tc = require('@actions/tool-cache');
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz');
|
||||||
|
const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to');
|
||||||
|
|
||||||
|
const cachedPath = await tc.cacheDir(node12ExtractedFolder, 'node', '12.7.0');
|
||||||
|
core.addPath(cachedPath);
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also cache files for reuse.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const tc = require('@actions/tool-cache');
|
||||||
|
|
||||||
|
const cachedPath = await tc.cacheFile('path/to/exe', 'destFileName.exe', 'myExeName', '1.1.0');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Find
|
||||||
|
|
||||||
|
Finally, you can find directories and files you've previously cached:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const tc = require('@actions/tool-cache');
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
const nodeDirectory = tc.find('node', '12.x', 'x64');
|
||||||
|
core.addPath(nodeDirectory);
|
||||||
|
```
|
||||||
|
|
||||||
|
You can even find all cached versions of a tool:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const tc = require('@actions/tool-cache');
|
||||||
|
|
||||||
|
const allNodeVersions = tc.findAllVersions('node');
|
||||||
|
console.log(`Versions of node available: ${allNodeVersions}`);
|
||||||
|
```
|
80
node_modules/@actions/tool-cache/lib/tool-cache.d.ts
generated
vendored
Normal file
80
node_modules/@actions/tool-cache/lib/tool-cache.d.ts
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
export declare class HTTPError extends Error {
|
||||||
|
readonly httpStatusCode: number | undefined;
|
||||||
|
constructor(httpStatusCode: number | undefined);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Download a tool from an url and stream it into a file
|
||||||
|
*
|
||||||
|
* @param url url of tool to download
|
||||||
|
* @param dest path to download tool
|
||||||
|
* @returns path to downloaded tool
|
||||||
|
*/
|
||||||
|
export declare function downloadTool(url: string, dest?: string): Promise<string>;
|
||||||
|
/**
|
||||||
|
* Extract a .7z file
|
||||||
|
*
|
||||||
|
* @param file path to the .7z file
|
||||||
|
* @param dest destination directory. Optional.
|
||||||
|
* @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
|
||||||
|
* problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
|
||||||
|
* gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
|
||||||
|
* bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
|
||||||
|
* interface, it is smaller than the full command line interface, and it does support long paths. At the
|
||||||
|
* time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
|
||||||
|
* Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
|
||||||
|
* to 7zr.exe can be pass to this function.
|
||||||
|
* @returns path to the destination directory
|
||||||
|
*/
|
||||||
|
export declare function extract7z(file: string, dest?: string, _7zPath?: string): Promise<string>;
|
||||||
|
/**
|
||||||
|
* Extract a compressed tar archive
|
||||||
|
*
|
||||||
|
* @param file path to the tar
|
||||||
|
* @param dest destination directory. Optional.
|
||||||
|
* @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
|
||||||
|
* @returns path to the destination directory
|
||||||
|
*/
|
||||||
|
export declare function extractTar(file: string, dest?: string, flags?: string): Promise<string>;
|
||||||
|
/**
|
||||||
|
* Extract a zip
|
||||||
|
*
|
||||||
|
* @param file path to the zip
|
||||||
|
* @param dest destination directory. Optional.
|
||||||
|
* @returns path to the destination directory
|
||||||
|
*/
|
||||||
|
export declare function extractZip(file: string, dest?: string): Promise<string>;
|
||||||
|
/**
|
||||||
|
* Caches a directory and installs it into the tool cacheDir
|
||||||
|
*
|
||||||
|
* @param sourceDir the directory to cache into tools
|
||||||
|
* @param tool tool name
|
||||||
|
* @param version version of the tool. semver format
|
||||||
|
* @param arch architecture of the tool. Optional. Defaults to machine architecture
|
||||||
|
*/
|
||||||
|
export declare function cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>;
|
||||||
|
/**
|
||||||
|
* Caches a downloaded file (GUID) and installs it
|
||||||
|
* into the tool cache with a given targetName
|
||||||
|
*
|
||||||
|
* @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
|
||||||
|
* @param targetFile the name of the file name in the tools directory
|
||||||
|
* @param tool tool name
|
||||||
|
* @param version version of the tool. semver format
|
||||||
|
* @param arch architecture of the tool. Optional. Defaults to machine architecture
|
||||||
|
*/
|
||||||
|
export declare function cacheFile(sourceFile: string, targetFile: string, tool: string, version: string, arch?: string): Promise<string>;
|
||||||
|
/**
|
||||||
|
* Finds the path to a tool version in the local installed tool cache
|
||||||
|
*
|
||||||
|
* @param toolName name of the tool
|
||||||
|
* @param versionSpec version of the tool
|
||||||
|
* @param arch optional arch. defaults to arch of computer
|
||||||
|
*/
|
||||||
|
export declare function find(toolName: string, versionSpec: string, arch?: string): string;
|
||||||
|
/**
|
||||||
|
* Finds the paths to all versions of a tool that are installed in the local tool cache
|
||||||
|
*
|
||||||
|
* @param toolName name of the tool
|
||||||
|
* @param arch optional arch. defaults to arch of computer
|
||||||
|
*/
|
||||||
|
export declare function findAllVersions(toolName: string, arch?: string): string[];
|
465
node_modules/@actions/tool-cache/lib/tool-cache.js
generated
vendored
Normal file
465
node_modules/@actions/tool-cache/lib/tool-cache.js
generated
vendored
Normal file
@ -0,0 +1,465 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core = require("@actions/core");
|
||||||
|
const io = require("@actions/io");
|
||||||
|
const fs = require("fs");
|
||||||
|
const os = require("os");
|
||||||
|
const path = require("path");
|
||||||
|
const httpm = require("@actions/http-client");
|
||||||
|
const semver = require("semver");
|
||||||
|
const uuidV4 = require("uuid/v4");
|
||||||
|
const exec_1 = require("@actions/exec/lib/exec");
|
||||||
|
const assert_1 = require("assert");
|
||||||
|
class HTTPError extends Error {
|
||||||
|
constructor(httpStatusCode) {
|
||||||
|
super(`Unexpected HTTP response: ${httpStatusCode}`);
|
||||||
|
this.httpStatusCode = httpStatusCode;
|
||||||
|
Object.setPrototypeOf(this, new.target.prototype);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.HTTPError = HTTPError;
|
||||||
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
const userAgent = 'actions/tool-cache';
|
||||||
|
// On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
|
||||||
|
let tempDirectory = process.env['RUNNER_TEMP'] || '';
|
||||||
|
let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
|
||||||
|
// If directories not found, place them in common temp locations
|
||||||
|
if (!tempDirectory || !cacheRoot) {
|
||||||
|
let baseLocation;
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
// On windows use the USERPROFILE env variable
|
||||||
|
baseLocation = process.env['USERPROFILE'] || 'C:\\';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
baseLocation = '/Users';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
baseLocation = '/home';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!tempDirectory) {
|
||||||
|
tempDirectory = path.join(baseLocation, 'actions', 'temp');
|
||||||
|
}
|
||||||
|
if (!cacheRoot) {
|
||||||
|
cacheRoot = path.join(baseLocation, 'actions', 'cache');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Download a tool from an url and stream it into a file
|
||||||
|
*
|
||||||
|
* @param url url of tool to download
|
||||||
|
* @param dest path to download tool
|
||||||
|
* @returns path to downloaded tool
|
||||||
|
*/
|
||||||
|
function downloadTool(url, dest) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// Wrap in a promise so that we can resolve from within stream callbacks
|
||||||
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
const http = new httpm.HttpClient(userAgent, [], {
|
||||||
|
allowRetries: true,
|
||||||
|
maxRetries: 3
|
||||||
|
});
|
||||||
|
dest = dest || path.join(tempDirectory, uuidV4());
|
||||||
|
yield io.mkdirP(path.dirname(dest));
|
||||||
|
core.debug(`Downloading ${url}`);
|
||||||
|
core.debug(`Downloading ${dest}`);
|
||||||
|
if (fs.existsSync(dest)) {
|
||||||
|
throw new Error(`Destination file path ${dest} already exists`);
|
||||||
|
}
|
||||||
|
const response = yield http.get(url);
|
||||||
|
if (response.message.statusCode !== 200) {
|
||||||
|
const err = new HTTPError(response.message.statusCode);
|
||||||
|
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
const file = fs.createWriteStream(dest);
|
||||||
|
file.on('open', () => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
try {
|
||||||
|
const stream = response.message.pipe(file);
|
||||||
|
stream.on('close', () => {
|
||||||
|
core.debug('download complete');
|
||||||
|
resolve(dest);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
file.on('error', err => {
|
||||||
|
file.end();
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.downloadTool = downloadTool;
|
||||||
|
/**
|
||||||
|
* Extract a .7z file
|
||||||
|
*
|
||||||
|
* @param file path to the .7z file
|
||||||
|
* @param dest destination directory. Optional.
|
||||||
|
* @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
|
||||||
|
* problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
|
||||||
|
* gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
|
||||||
|
* bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
|
||||||
|
* interface, it is smaller than the full command line interface, and it does support long paths. At the
|
||||||
|
* time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
|
||||||
|
* Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
|
||||||
|
* to 7zr.exe can be pass to this function.
|
||||||
|
* @returns path to the destination directory
|
||||||
|
*/
|
||||||
|
function extract7z(file, dest, _7zPath) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
|
||||||
|
assert_1.ok(file, 'parameter "file" is required');
|
||||||
|
dest = yield _createExtractFolder(dest);
|
||||||
|
const originalCwd = process.cwd();
|
||||||
|
process.chdir(dest);
|
||||||
|
if (_7zPath) {
|
||||||
|
try {
|
||||||
|
const args = [
|
||||||
|
'x',
|
||||||
|
'-bb1',
|
||||||
|
'-bd',
|
||||||
|
'-sccUTF-8',
|
||||||
|
file
|
||||||
|
];
|
||||||
|
const options = {
|
||||||
|
silent: true
|
||||||
|
};
|
||||||
|
yield exec_1.exec(`"${_7zPath}"`, args, options);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
process.chdir(originalCwd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const escapedScript = path
|
||||||
|
.join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
|
||||||
|
.replace(/'/g, "''")
|
||||||
|
.replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
|
||||||
|
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
|
||||||
|
const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
|
||||||
|
const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
|
||||||
|
const args = [
|
||||||
|
'-NoLogo',
|
||||||
|
'-Sta',
|
||||||
|
'-NoProfile',
|
||||||
|
'-NonInteractive',
|
||||||
|
'-ExecutionPolicy',
|
||||||
|
'Unrestricted',
|
||||||
|
'-Command',
|
||||||
|
command
|
||||||
|
];
|
||||||
|
const options = {
|
||||||
|
silent: true
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const powershellPath = yield io.which('powershell', true);
|
||||||
|
yield exec_1.exec(`"${powershellPath}"`, args, options);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
process.chdir(originalCwd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.extract7z = extract7z;
|
||||||
|
/**
|
||||||
|
* Extract a compressed tar archive
|
||||||
|
*
|
||||||
|
* @param file path to the tar
|
||||||
|
* @param dest destination directory. Optional.
|
||||||
|
* @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
|
||||||
|
* @returns path to the destination directory
|
||||||
|
*/
|
||||||
|
function extractTar(file, dest, flags = 'xz') {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!file) {
|
||||||
|
throw new Error("parameter 'file' is required");
|
||||||
|
}
|
||||||
|
// Create dest
|
||||||
|
dest = yield _createExtractFolder(dest);
|
||||||
|
// Determine whether GNU tar
|
||||||
|
let versionOutput = '';
|
||||||
|
yield exec_1.exec('tar --version', [], {
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => (versionOutput += data.toString()),
|
||||||
|
stderr: (data) => (versionOutput += data.toString())
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
|
||||||
|
// Initialize args
|
||||||
|
const args = [flags];
|
||||||
|
let destArg = dest;
|
||||||
|
let fileArg = file;
|
||||||
|
if (IS_WINDOWS && isGnuTar) {
|
||||||
|
args.push('--force-local');
|
||||||
|
destArg = dest.replace(/\\/g, '/');
|
||||||
|
// Technically only the dest needs to have `/` but for aesthetic consistency
|
||||||
|
// convert slashes in the file arg too.
|
||||||
|
fileArg = file.replace(/\\/g, '/');
|
||||||
|
}
|
||||||
|
if (isGnuTar) {
|
||||||
|
// Suppress warnings when using GNU tar to extract archives created by BSD tar
|
||||||
|
args.push('--warning=no-unknown-keyword');
|
||||||
|
}
|
||||||
|
args.push('-C', destArg, '-f', fileArg);
|
||||||
|
yield exec_1.exec(`tar`, args);
|
||||||
|
return dest;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.extractTar = extractTar;
|
||||||
|
/**
|
||||||
|
* Extract a zip
|
||||||
|
*
|
||||||
|
* @param file path to the zip
|
||||||
|
* @param dest destination directory. Optional.
|
||||||
|
* @returns path to the destination directory
|
||||||
|
*/
|
||||||
|
function extractZip(file, dest) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!file) {
|
||||||
|
throw new Error("parameter 'file' is required");
|
||||||
|
}
|
||||||
|
dest = yield _createExtractFolder(dest);
|
||||||
|
if (IS_WINDOWS) {
|
||||||
|
yield extractZipWin(file, dest);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield extractZipNix(file, dest);
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.extractZip = extractZip;
|
||||||
|
function extractZipWin(file, dest) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// build the powershell command
|
||||||
|
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
|
||||||
|
const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
|
||||||
|
const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
|
||||||
|
// run powershell
|
||||||
|
const powershellPath = yield io.which('powershell');
|
||||||
|
const args = [
|
||||||
|
'-NoLogo',
|
||||||
|
'-Sta',
|
||||||
|
'-NoProfile',
|
||||||
|
'-NonInteractive',
|
||||||
|
'-ExecutionPolicy',
|
||||||
|
'Unrestricted',
|
||||||
|
'-Command',
|
||||||
|
command
|
||||||
|
];
|
||||||
|
yield exec_1.exec(`"${powershellPath}"`, args);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function extractZipNix(file, dest) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const unzipPath = yield io.which('unzip');
|
||||||
|
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Caches a directory and installs it into the tool cacheDir
|
||||||
|
*
|
||||||
|
* @param sourceDir the directory to cache into tools
|
||||||
|
* @param tool tool name
|
||||||
|
* @param version version of the tool. semver format
|
||||||
|
* @param arch architecture of the tool. Optional. Defaults to machine architecture
|
||||||
|
*/
|
||||||
|
function cacheDir(sourceDir, tool, version, arch) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
version = semver.clean(version) || version;
|
||||||
|
arch = arch || os.arch();
|
||||||
|
core.debug(`Caching tool ${tool} ${version} ${arch}`);
|
||||||
|
core.debug(`source dir: ${sourceDir}`);
|
||||||
|
if (!fs.statSync(sourceDir).isDirectory()) {
|
||||||
|
throw new Error('sourceDir is not a directory');
|
||||||
|
}
|
||||||
|
// Create the tool dir
|
||||||
|
const destPath = yield _createToolPath(tool, version, arch);
|
||||||
|
// copy each child item. do not move. move can fail on Windows
|
||||||
|
// due to anti-virus software having an open handle on a file.
|
||||||
|
for (const itemName of fs.readdirSync(sourceDir)) {
|
||||||
|
const s = path.join(sourceDir, itemName);
|
||||||
|
yield io.cp(s, destPath, { recursive: true });
|
||||||
|
}
|
||||||
|
// write .complete
|
||||||
|
_completeToolPath(tool, version, arch);
|
||||||
|
return destPath;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.cacheDir = cacheDir;
|
||||||
|
/**
|
||||||
|
* Caches a downloaded file (GUID) and installs it
|
||||||
|
* into the tool cache with a given targetName
|
||||||
|
*
|
||||||
|
* @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
|
||||||
|
* @param targetFile the name of the file name in the tools directory
|
||||||
|
* @param tool tool name
|
||||||
|
* @param version version of the tool. semver format
|
||||||
|
* @param arch architecture of the tool. Optional. Defaults to machine architecture
|
||||||
|
*/
|
||||||
|
function cacheFile(sourceFile, targetFile, tool, version, arch) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
version = semver.clean(version) || version;
|
||||||
|
arch = arch || os.arch();
|
||||||
|
core.debug(`Caching tool ${tool} ${version} ${arch}`);
|
||||||
|
core.debug(`source file: ${sourceFile}`);
|
||||||
|
if (!fs.statSync(sourceFile).isFile()) {
|
||||||
|
throw new Error('sourceFile is not a file');
|
||||||
|
}
|
||||||
|
// create the tool dir
|
||||||
|
const destFolder = yield _createToolPath(tool, version, arch);
|
||||||
|
// copy instead of move. move can fail on Windows due to
|
||||||
|
// anti-virus software having an open handle on a file.
|
||||||
|
const destPath = path.join(destFolder, targetFile);
|
||||||
|
core.debug(`destination file ${destPath}`);
|
||||||
|
yield io.cp(sourceFile, destPath);
|
||||||
|
// write .complete
|
||||||
|
_completeToolPath(tool, version, arch);
|
||||||
|
return destFolder;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.cacheFile = cacheFile;
|
||||||
|
/**
|
||||||
|
* Finds the path to a tool version in the local installed tool cache
|
||||||
|
*
|
||||||
|
* @param toolName name of the tool
|
||||||
|
* @param versionSpec version of the tool
|
||||||
|
* @param arch optional arch. defaults to arch of computer
|
||||||
|
*/
|
||||||
|
function find(toolName, versionSpec, arch) {
|
||||||
|
if (!toolName) {
|
||||||
|
throw new Error('toolName parameter is required');
|
||||||
|
}
|
||||||
|
if (!versionSpec) {
|
||||||
|
throw new Error('versionSpec parameter is required');
|
||||||
|
}
|
||||||
|
arch = arch || os.arch();
|
||||||
|
// attempt to resolve an explicit version
|
||||||
|
if (!_isExplicitVersion(versionSpec)) {
|
||||||
|
const localVersions = findAllVersions(toolName, arch);
|
||||||
|
const match = _evaluateVersions(localVersions, versionSpec);
|
||||||
|
versionSpec = match;
|
||||||
|
}
|
||||||
|
// check for the explicit version in the cache
|
||||||
|
let toolPath = '';
|
||||||
|
if (versionSpec) {
|
||||||
|
versionSpec = semver.clean(versionSpec) || '';
|
||||||
|
const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
|
||||||
|
core.debug(`checking cache: ${cachePath}`);
|
||||||
|
if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
|
||||||
|
core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
|
||||||
|
toolPath = cachePath;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.debug('not found');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return toolPath;
|
||||||
|
}
|
||||||
|
exports.find = find;
|
||||||
|
/**
|
||||||
|
* Finds the paths to all versions of a tool that are installed in the local tool cache
|
||||||
|
*
|
||||||
|
* @param toolName name of the tool
|
||||||
|
* @param arch optional arch. defaults to arch of computer
|
||||||
|
*/
|
||||||
|
function findAllVersions(toolName, arch) {
|
||||||
|
const versions = [];
|
||||||
|
arch = arch || os.arch();
|
||||||
|
const toolPath = path.join(cacheRoot, toolName);
|
||||||
|
if (fs.existsSync(toolPath)) {
|
||||||
|
const children = fs.readdirSync(toolPath);
|
||||||
|
for (const child of children) {
|
||||||
|
if (_isExplicitVersion(child)) {
|
||||||
|
const fullPath = path.join(toolPath, child, arch || '');
|
||||||
|
if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
|
||||||
|
versions.push(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return versions;
|
||||||
|
}
|
||||||
|
exports.findAllVersions = findAllVersions;
|
||||||
|
function _createExtractFolder(dest) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!dest) {
|
||||||
|
// create a temp dir
|
||||||
|
dest = path.join(tempDirectory, uuidV4());
|
||||||
|
}
|
||||||
|
yield io.mkdirP(dest);
|
||||||
|
return dest;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function _createToolPath(tool, version, arch) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
|
||||||
|
core.debug(`destination ${folderPath}`);
|
||||||
|
const markerPath = `${folderPath}.complete`;
|
||||||
|
yield io.rmRF(folderPath);
|
||||||
|
yield io.rmRF(markerPath);
|
||||||
|
yield io.mkdirP(folderPath);
|
||||||
|
return folderPath;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function _completeToolPath(tool, version, arch) {
|
||||||
|
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
|
||||||
|
const markerPath = `${folderPath}.complete`;
|
||||||
|
fs.writeFileSync(markerPath, '');
|
||||||
|
core.debug('finished caching tool');
|
||||||
|
}
|
||||||
|
function _isExplicitVersion(versionSpec) {
|
||||||
|
const c = semver.clean(versionSpec) || '';
|
||||||
|
core.debug(`isExplicit: ${c}`);
|
||||||
|
const valid = semver.valid(c) != null;
|
||||||
|
core.debug(`explicit? ${valid}`);
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
|
function _evaluateVersions(versions, versionSpec) {
|
||||||
|
let version = '';
|
||||||
|
core.debug(`evaluating ${versions.length} versions`);
|
||||||
|
versions = versions.sort((a, b) => {
|
||||||
|
if (semver.gt(a, b)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
});
|
||||||
|
for (let i = versions.length - 1; i >= 0; i--) {
|
||||||
|
const potential = versions[i];
|
||||||
|
const satisfied = semver.satisfies(potential, versionSpec);
|
||||||
|
if (satisfied) {
|
||||||
|
version = potential;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (version) {
|
||||||
|
core.debug(`matched: ${version}`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.debug('match not found');
|
||||||
|
}
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=tool-cache.js.map
|
1
node_modules/@actions/tool-cache/lib/tool-cache.js.map
generated
vendored
Normal file
1
node_modules/@actions/tool-cache/lib/tool-cache.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
81
node_modules/@actions/tool-cache/package.json
generated
vendored
Normal file
81
node_modules/@actions/tool-cache/package.json
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"@actions/tool-cache@1.3.0",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "@actions/tool-cache@1.3.0",
|
||||||
|
"_id": "@actions/tool-cache@1.3.0",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-pbv32I89niDShw1YTDo0OFQmWPkZPElE7e3So1jfEzjIyzGRfYIzshwOVhemJZLcDtzo3kxO3GFDAmuVvub/6w==",
|
||||||
|
"_location": "/@actions/tool-cache",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "@actions/tool-cache@1.3.0",
|
||||||
|
"name": "@actions/tool-cache",
|
||||||
|
"escapedName": "@actions%2ftool-cache",
|
||||||
|
"scope": "@actions",
|
||||||
|
"rawSpec": "1.3.0",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "1.3.0"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.3.0.tgz",
|
||||||
|
"_spec": "1.3.0",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/core": "^1.2.0",
|
||||||
|
"@actions/exec": "^1.0.0",
|
||||||
|
"@actions/http-client": "^1.0.1",
|
||||||
|
"@actions/io": "^1.0.1",
|
||||||
|
"semver": "^6.1.0",
|
||||||
|
"uuid": "^3.3.2"
|
||||||
|
},
|
||||||
|
"description": "Actions tool-cache lib",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/nock": "^10.0.3",
|
||||||
|
"@types/semver": "^6.0.0",
|
||||||
|
"@types/uuid": "^3.4.4",
|
||||||
|
"nock": "^10.0.6"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"lib": "lib",
|
||||||
|
"test": "__tests__"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"scripts"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"exec"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/tool-cache.js",
|
||||||
|
"name": "@actions/tool-cache",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/tool-cache"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||||
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
|
"tsc": "tsc"
|
||||||
|
},
|
||||||
|
"types": "lib/tool-cache.d.ts",
|
||||||
|
"version": "1.3.0"
|
||||||
|
}
|
60
node_modules/@actions/tool-cache/scripts/Invoke-7zdec.ps1
generated
vendored
Normal file
60
node_modules/@actions/tool-cache/scripts/Invoke-7zdec.ps1
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Source,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Target)
|
||||||
|
|
||||||
|
# This script translates the output from 7zdec into UTF8. Node has limited
|
||||||
|
# built-in support for encodings.
|
||||||
|
#
|
||||||
|
# 7zdec uses the system default code page. The system default code page varies
|
||||||
|
# depending on the locale configuration. On an en-US box, the system default code
|
||||||
|
# page is Windows-1252.
|
||||||
|
#
|
||||||
|
# Note, on a typical en-US box, testing with the 'ç' character is a good way to
|
||||||
|
# determine whether data is passed correctly between processes. This is because
|
||||||
|
# the 'ç' character has a different code point across each of the common encodings
|
||||||
|
# on a typical en-US box, i.e.
|
||||||
|
# 1) the default console-output code page (IBM437)
|
||||||
|
# 2) the system default code page (i.e. CP_ACP) (Windows-1252)
|
||||||
|
# 3) UTF8
|
||||||
|
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
|
# Redefine the wrapper over STDOUT to use UTF8. Node expects UTF8 by default.
|
||||||
|
$stdout = [System.Console]::OpenStandardOutput()
|
||||||
|
$utf8 = New-Object System.Text.UTF8Encoding($false) # do not emit BOM
|
||||||
|
$writer = New-Object System.IO.StreamWriter($stdout, $utf8)
|
||||||
|
[System.Console]::SetOut($writer)
|
||||||
|
|
||||||
|
# All subsequent output must be written using [System.Console]::WriteLine(). In
|
||||||
|
# PowerShell 4, Write-Host and Out-Default do not consider the updated stream writer.
|
||||||
|
|
||||||
|
Set-Location -LiteralPath $Target
|
||||||
|
|
||||||
|
# Print the ##command.
|
||||||
|
$_7zdec = Join-Path -Path "$PSScriptRoot" -ChildPath "externals/7zdec.exe"
|
||||||
|
[System.Console]::WriteLine("##[command]$_7zdec x `"$Source`"")
|
||||||
|
|
||||||
|
# The $OutputEncoding variable instructs PowerShell how to interpret the output
|
||||||
|
# from the external command.
|
||||||
|
$OutputEncoding = [System.Text.Encoding]::Default
|
||||||
|
|
||||||
|
# Note, the output from 7zdec.exe needs to be iterated over. Otherwise PowerShell.exe
|
||||||
|
# will launch the external command in such a way that it inherits the streams.
|
||||||
|
& $_7zdec x $Source 2>&1 |
|
||||||
|
ForEach-Object {
|
||||||
|
if ($_ -is [System.Management.Automation.ErrorRecord]) {
|
||||||
|
[System.Console]::WriteLine($_.Exception.Message)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[System.Console]::WriteLine($_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[System.Console]::WriteLine("##[debug]7zdec.exe exit code '$LASTEXITCODE'")
|
||||||
|
[System.Console]::Out.Flush()
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
exit $LASTEXITCODE
|
||||||
|
}
|
BIN
node_modules/@actions/tool-cache/scripts/externals/7zdec.exe
generated
vendored
Normal file
BIN
node_modules/@actions/tool-cache/scripts/externals/7zdec.exe
generated
vendored
Normal file
Binary file not shown.
70
node_modules/semver/CHANGELOG.md
generated
vendored
Normal file
70
node_modules/semver/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
# changes log
|
||||||
|
|
||||||
|
## 6.2.0
|
||||||
|
|
||||||
|
* Coerce numbers to strings when passed to semver.coerce()
|
||||||
|
* Add `rtl` option to coerce from right to left
|
||||||
|
|
||||||
|
## 6.1.3
|
||||||
|
|
||||||
|
* Handle X-ranges properly in includePrerelease mode
|
||||||
|
|
||||||
|
## 6.1.2
|
||||||
|
|
||||||
|
* Do not throw when testing invalid version strings
|
||||||
|
|
||||||
|
## 6.1.1
|
||||||
|
|
||||||
|
* Add options support for semver.coerce()
|
||||||
|
* Handle undefined version passed to Range.test
|
||||||
|
|
||||||
|
## 6.1.0
|
||||||
|
|
||||||
|
* Add semver.compareBuild function
|
||||||
|
* Support `*` in semver.intersects
|
||||||
|
|
||||||
|
## 6.0
|
||||||
|
|
||||||
|
* Fix `intersects` logic.
|
||||||
|
|
||||||
|
This is technically a bug fix, but since it is also a change to behavior
|
||||||
|
that may require users updating their code, it is marked as a major
|
||||||
|
version increment.
|
||||||
|
|
||||||
|
## 5.7
|
||||||
|
|
||||||
|
* Add `minVersion` method
|
||||||
|
|
||||||
|
## 5.6
|
||||||
|
|
||||||
|
* Move boolean `loose` param to an options object, with
|
||||||
|
backwards-compatibility protection.
|
||||||
|
* Add ability to opt out of special prerelease version handling with
|
||||||
|
the `includePrerelease` option flag.
|
||||||
|
|
||||||
|
## 5.5
|
||||||
|
|
||||||
|
* Add version coercion capabilities
|
||||||
|
|
||||||
|
## 5.4
|
||||||
|
|
||||||
|
* Add intersection checking
|
||||||
|
|
||||||
|
## 5.3
|
||||||
|
|
||||||
|
* Add `minSatisfying` method
|
||||||
|
|
||||||
|
## 5.2
|
||||||
|
|
||||||
|
* Add `prerelease(v)` that returns prerelease components
|
||||||
|
|
||||||
|
## 5.1
|
||||||
|
|
||||||
|
* Add Backus-Naur for ranges
|
||||||
|
* Remove excessively cute inspection methods
|
||||||
|
|
||||||
|
## 5.0
|
||||||
|
|
||||||
|
* Remove AMD/Browserified build artifacts
|
||||||
|
* Fix ltr and gtr when using the `*` range
|
||||||
|
* Fix for range `*` with a prerelease identifier
|
15
node_modules/semver/LICENSE
generated
vendored
Normal file
15
node_modules/semver/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
The ISC License
|
||||||
|
|
||||||
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
443
node_modules/semver/README.md
generated
vendored
Normal file
443
node_modules/semver/README.md
generated
vendored
Normal file
@ -0,0 +1,443 @@
|
|||||||
|
semver(1) -- The semantic versioner for npm
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install semver
|
||||||
|
````
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
As a node module:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const semver = require('semver')
|
||||||
|
|
||||||
|
semver.valid('1.2.3') // '1.2.3'
|
||||||
|
semver.valid('a.b.c') // null
|
||||||
|
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||||
|
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||||
|
semver.gt('1.2.3', '9.8.7') // false
|
||||||
|
semver.lt('1.2.3', '9.8.7') // true
|
||||||
|
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||||
|
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||||
|
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||||
|
```
|
||||||
|
|
||||||
|
As a command-line utility:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ semver -h
|
||||||
|
|
||||||
|
A JavaScript implementation of the https://semver.org/ specification
|
||||||
|
Copyright Isaac Z. Schlueter
|
||||||
|
|
||||||
|
Usage: semver [options] <version> [<version> [...]]
|
||||||
|
Prints valid versions sorted by SemVer precedence
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-r --range <range>
|
||||||
|
Print versions that match the specified range.
|
||||||
|
|
||||||
|
-i --increment [<level>]
|
||||||
|
Increment a version by the specified level. Level can
|
||||||
|
be one of: major, minor, patch, premajor, preminor,
|
||||||
|
prepatch, or prerelease. Default level is 'patch'.
|
||||||
|
Only one version may be specified.
|
||||||
|
|
||||||
|
--preid <identifier>
|
||||||
|
Identifier to be used to prefix premajor, preminor,
|
||||||
|
prepatch or prerelease version increments.
|
||||||
|
|
||||||
|
-l --loose
|
||||||
|
Interpret versions and ranges loosely
|
||||||
|
|
||||||
|
-p --include-prerelease
|
||||||
|
Always include prerelease versions in range matching
|
||||||
|
|
||||||
|
-c --coerce
|
||||||
|
Coerce a string into SemVer if possible
|
||||||
|
(does not imply --loose)
|
||||||
|
|
||||||
|
--rtl
|
||||||
|
Coerce version strings right to left
|
||||||
|
|
||||||
|
--ltr
|
||||||
|
Coerce version strings left to right (default)
|
||||||
|
|
||||||
|
Program exits successfully if any valid version satisfies
|
||||||
|
all supplied ranges, and prints all satisfying versions.
|
||||||
|
|
||||||
|
If no satisfying versions are found, then exits failure.
|
||||||
|
|
||||||
|
Versions are printed in ascending order, so supplying
|
||||||
|
multiple versions to the utility will just sort them.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Versions
|
||||||
|
|
||||||
|
A "version" is described by the `v2.0.0` specification found at
|
||||||
|
<https://semver.org/>.
|
||||||
|
|
||||||
|
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||||
|
|
||||||
|
## Ranges
|
||||||
|
|
||||||
|
A `version range` is a set of `comparators` which specify versions
|
||||||
|
that satisfy the range.
|
||||||
|
|
||||||
|
A `comparator` is composed of an `operator` and a `version`. The set
|
||||||
|
of primitive `operators` is:
|
||||||
|
|
||||||
|
* `<` Less than
|
||||||
|
* `<=` Less than or equal to
|
||||||
|
* `>` Greater than
|
||||||
|
* `>=` Greater than or equal to
|
||||||
|
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||||
|
so this operator is optional, but MAY be included.
|
||||||
|
|
||||||
|
For example, the comparator `>=1.2.7` would match the versions
|
||||||
|
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||||
|
or `1.1.0`.
|
||||||
|
|
||||||
|
Comparators can be joined by whitespace to form a `comparator set`,
|
||||||
|
which is satisfied by the **intersection** of all of the comparators
|
||||||
|
it includes.
|
||||||
|
|
||||||
|
A range is composed of one or more comparator sets, joined by `||`. A
|
||||||
|
version matches a range if and only if every comparator in at least
|
||||||
|
one of the `||`-separated comparator sets is satisfied by the version.
|
||||||
|
|
||||||
|
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||||
|
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||||
|
or `1.1.0`.
|
||||||
|
|
||||||
|
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||||
|
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||||
|
|
||||||
|
### Prerelease Tags
|
||||||
|
|
||||||
|
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||||
|
it will only be allowed to satisfy comparator sets if at least one
|
||||||
|
comparator with the same `[major, minor, patch]` tuple also has a
|
||||||
|
prerelease tag.
|
||||||
|
|
||||||
|
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||||
|
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||||
|
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||||
|
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||||
|
range only accepts prerelease tags on the `1.2.3` version. The
|
||||||
|
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||||
|
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||||
|
|
||||||
|
The purpose for this behavior is twofold. First, prerelease versions
|
||||||
|
frequently are updated very quickly, and contain many breaking changes
|
||||||
|
that are (by the author's design) not yet fit for public consumption.
|
||||||
|
Therefore, by default, they are excluded from range matching
|
||||||
|
semantics.
|
||||||
|
|
||||||
|
Second, a user who has opted into using a prerelease version has
|
||||||
|
clearly indicated the intent to use *that specific* set of
|
||||||
|
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||||
|
the user is indicating that they are aware of the risk. However, it
|
||||||
|
is still not appropriate to assume that they have opted into taking a
|
||||||
|
similar risk on the *next* set of prerelease versions.
|
||||||
|
|
||||||
|
Note that this behavior can be suppressed (treating all prerelease
|
||||||
|
versions as if they were normal versions, for the purpose of range
|
||||||
|
matching) by setting the `includePrerelease` flag on the options
|
||||||
|
object to any
|
||||||
|
[functions](https://github.com/npm/node-semver#functions) that do
|
||||||
|
range matching.
|
||||||
|
|
||||||
|
#### Prerelease Identifiers
|
||||||
|
|
||||||
|
The method `.inc` takes an additional `identifier` string argument that
|
||||||
|
will append the value of the string as a prerelease identifier:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||||
|
// '1.2.4-beta.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
command-line example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ semver 1.2.3 -i prerelease --preid beta
|
||||||
|
1.2.4-beta.0
|
||||||
|
```
|
||||||
|
|
||||||
|
Which then can be used to increment further:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ semver 1.2.4-beta.0 -i prerelease
|
||||||
|
1.2.4-beta.1
|
||||||
|
```
|
||||||
|
|
||||||
|
### Advanced Range Syntax
|
||||||
|
|
||||||
|
Advanced range syntax desugars to primitive comparators in
|
||||||
|
deterministic ways.
|
||||||
|
|
||||||
|
Advanced ranges may be combined in the same way as primitive
|
||||||
|
comparators using white space or `||`.
|
||||||
|
|
||||||
|
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||||
|
|
||||||
|
Specifies an inclusive set.
|
||||||
|
|
||||||
|
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||||
|
|
||||||
|
If a partial version is provided as the first version in the inclusive
|
||||||
|
range, then the missing pieces are replaced with zeroes.
|
||||||
|
|
||||||
|
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||||
|
|
||||||
|
If a partial version is provided as the second version in the
|
||||||
|
inclusive range, then all versions that start with the supplied parts
|
||||||
|
of the tuple are accepted, but nothing that would be greater than the
|
||||||
|
provided tuple parts.
|
||||||
|
|
||||||
|
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
||||||
|
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
||||||
|
|
||||||
|
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||||
|
|
||||||
|
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||||
|
numeric values in the `[major, minor, patch]` tuple.
|
||||||
|
|
||||||
|
* `*` := `>=0.0.0` (Any version satisfies)
|
||||||
|
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
||||||
|
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
||||||
|
|
||||||
|
A partial version range is treated as an X-Range, so the special
|
||||||
|
character is in fact optional.
|
||||||
|
|
||||||
|
* `""` (empty string) := `*` := `>=0.0.0`
|
||||||
|
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
||||||
|
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
||||||
|
|
||||||
|
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||||
|
|
||||||
|
Allows patch-level changes if a minor version is specified on the
|
||||||
|
comparator. Allows minor-level changes if not.
|
||||||
|
|
||||||
|
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
||||||
|
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
||||||
|
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
||||||
|
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
||||||
|
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
||||||
|
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
||||||
|
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
||||||
|
the `1.2.3` version will be allowed, if they are greater than or
|
||||||
|
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||||
|
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||||
|
different `[major, minor, patch]` tuple.
|
||||||
|
|
||||||
|
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||||
|
|
||||||
|
Allows changes that do not modify the left-most non-zero element in the
|
||||||
|
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||||
|
minor updates for versions `1.0.0` and above, patch updates for
|
||||||
|
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||||
|
|
||||||
|
Many authors treat a `0.x` version as if the `x` were the major
|
||||||
|
"breaking-change" indicator.
|
||||||
|
|
||||||
|
Caret ranges are ideal when an author may make breaking changes
|
||||||
|
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||||
|
However, it presumes that there will *not* be breaking changes between
|
||||||
|
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||||
|
additive (but non-breaking), according to commonly observed practices.
|
||||||
|
|
||||||
|
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
||||||
|
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
||||||
|
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
||||||
|
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
||||||
|
the `1.2.3` version will be allowed, if they are greater than or
|
||||||
|
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||||
|
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||||
|
different `[major, minor, patch]` tuple.
|
||||||
|
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
||||||
|
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||||
|
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||||
|
|
||||||
|
When parsing caret ranges, a missing `patch` value desugars to the
|
||||||
|
number `0`, but will allow flexibility within that value, even if the
|
||||||
|
major and minor versions are both `0`.
|
||||||
|
|
||||||
|
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
||||||
|
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
||||||
|
* `^0.0` := `>=0.0.0 <0.1.0`
|
||||||
|
|
||||||
|
A missing `minor` and `patch` values will desugar to zero, but also
|
||||||
|
allow flexibility within those values, even if the major version is
|
||||||
|
zero.
|
||||||
|
|
||||||
|
* `^1.x` := `>=1.0.0 <2.0.0`
|
||||||
|
* `^0.x` := `>=0.0.0 <1.0.0`
|
||||||
|
|
||||||
|
### Range Grammar
|
||||||
|
|
||||||
|
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||||
|
for the benefit of parser authors:
|
||||||
|
|
||||||
|
```bnf
|
||||||
|
range-set ::= range ( logical-or range ) *
|
||||||
|
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||||
|
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||||
|
hyphen ::= partial ' - ' partial
|
||||||
|
simple ::= primitive | partial | tilde | caret
|
||||||
|
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||||
|
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||||
|
xr ::= 'x' | 'X' | '*' | nr
|
||||||
|
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||||
|
tilde ::= '~' partial
|
||||||
|
caret ::= '^' partial
|
||||||
|
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||||
|
pre ::= parts
|
||||||
|
build ::= parts
|
||||||
|
parts ::= part ( '.' part ) *
|
||||||
|
part ::= nr | [-0-9A-Za-z]+
|
||||||
|
```
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
All methods and classes take a final `options` object argument. All
|
||||||
|
options in this object are `false` by default. The options supported
|
||||||
|
are:
|
||||||
|
|
||||||
|
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||||
|
(Any resulting output will always be 100% strict compliant, of
|
||||||
|
course.) For backwards compatibility reasons, if the `options`
|
||||||
|
argument is a boolean value instead of an object, it is interpreted
|
||||||
|
to be the `loose` param.
|
||||||
|
- `includePrerelease` Set to suppress the [default
|
||||||
|
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||||
|
excluding prerelease tagged versions from ranges unless they are
|
||||||
|
explicitly opted into.
|
||||||
|
|
||||||
|
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||||
|
strings that they parse.
|
||||||
|
|
||||||
|
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||||
|
* `inc(v, release)`: Return the version incremented by the release
|
||||||
|
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||||
|
`prepatch`, or `prerelease`), or null if it's not valid
|
||||||
|
* `premajor` in one call will bump the version up to the next major
|
||||||
|
version and down to a prerelease of that major version.
|
||||||
|
`preminor`, and `prepatch` work the same way.
|
||||||
|
* If called from a non-prerelease version, the `prerelease` will work the
|
||||||
|
same as `prepatch`. It increments the patch version, then makes a
|
||||||
|
prerelease. If the input version is already a prerelease it simply
|
||||||
|
increments it.
|
||||||
|
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||||
|
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||||
|
* `major(v)`: Return the major version number.
|
||||||
|
* `minor(v)`: Return the minor version number.
|
||||||
|
* `patch(v)`: Return the patch version number.
|
||||||
|
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||||
|
or comparators intersect.
|
||||||
|
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||||
|
a `SemVer` object or `null`.
|
||||||
|
|
||||||
|
### Comparison
|
||||||
|
|
||||||
|
* `gt(v1, v2)`: `v1 > v2`
|
||||||
|
* `gte(v1, v2)`: `v1 >= v2`
|
||||||
|
* `lt(v1, v2)`: `v1 < v2`
|
||||||
|
* `lte(v1, v2)`: `v1 <= v2`
|
||||||
|
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||||
|
even if they're not the exact same string. You already know how to
|
||||||
|
compare strings.
|
||||||
|
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||||
|
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||||
|
the corresponding function above. `"==="` and `"!=="` do simple
|
||||||
|
string comparison, but are included for completeness. Throws if an
|
||||||
|
invalid comparison string is provided.
|
||||||
|
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||||
|
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||||
|
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||||
|
in descending order when passed to `Array.sort()`.
|
||||||
|
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
||||||
|
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
||||||
|
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||||
|
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||||
|
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||||
|
or null if the versions are the same.
|
||||||
|
|
||||||
|
### Comparators
|
||||||
|
|
||||||
|
* `intersects(comparator)`: Return true if the comparators intersect
|
||||||
|
|
||||||
|
### Ranges
|
||||||
|
|
||||||
|
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||||
|
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||||
|
range.
|
||||||
|
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||||
|
that satisfies the range, or `null` if none of them do.
|
||||||
|
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||||
|
that satisfies the range, or `null` if none of them do.
|
||||||
|
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||||
|
the given range.
|
||||||
|
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||||
|
versions possible in the range.
|
||||||
|
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||||
|
versions possible in the range.
|
||||||
|
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||||
|
the bounds of the range in either the high or low direction. The
|
||||||
|
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||||
|
the function called by `gtr` and `ltr`.)
|
||||||
|
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||||
|
|
||||||
|
Note that, since ranges may be non-contiguous, a version might not be
|
||||||
|
greater than a range, less than a range, *or* satisfy a range! For
|
||||||
|
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||||
|
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||||
|
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||||
|
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||||
|
satisfy the range.
|
||||||
|
|
||||||
|
If you want to know if a version satisfies or does not satisfy a
|
||||||
|
range, use the `satisfies(version, range)` function.
|
||||||
|
|
||||||
|
### Coercion
|
||||||
|
|
||||||
|
* `coerce(version, options)`: Coerces a string to semver if possible
|
||||||
|
|
||||||
|
This aims to provide a very forgiving translation of a non-semver string to
|
||||||
|
semver. It looks for the first digit in a string, and consumes all
|
||||||
|
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||||
|
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||||
|
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||||
|
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||||
|
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||||
|
is not valid). The maximum length for any semver component considered for
|
||||||
|
coercion is 16 characters; longer components will be ignored
|
||||||
|
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||||
|
semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||||
|
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||||
|
|
||||||
|
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||||
|
coercible tuple that does not share an ending index with a longer coercible
|
||||||
|
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||||
|
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||||
|
any other overlapping SemVer tuple.
|
||||||
|
|
||||||
|
### Clean
|
||||||
|
|
||||||
|
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||||
|
|
||||||
|
This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges.
|
||||||
|
|
||||||
|
ex.
|
||||||
|
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||||
|
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
||||||
|
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||||
|
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||||
|
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||||
|
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||||
|
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||||
|
* `s.clean('~1.0.0')`: `null`
|
174
node_modules/semver/bin/semver.js
generated
vendored
Normal file
174
node_modules/semver/bin/semver.js
generated
vendored
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
// Standalone semver comparison program.
|
||||||
|
// Exits successfully and prints matching version(s) if
|
||||||
|
// any supplied version is valid and passes all tests.
|
||||||
|
|
||||||
|
var argv = process.argv.slice(2)
|
||||||
|
|
||||||
|
var versions = []
|
||||||
|
|
||||||
|
var range = []
|
||||||
|
|
||||||
|
var inc = null
|
||||||
|
|
||||||
|
var version = require('../package.json').version
|
||||||
|
|
||||||
|
var loose = false
|
||||||
|
|
||||||
|
var includePrerelease = false
|
||||||
|
|
||||||
|
var coerce = false
|
||||||
|
|
||||||
|
var rtl = false
|
||||||
|
|
||||||
|
var identifier
|
||||||
|
|
||||||
|
var semver = require('../semver')
|
||||||
|
|
||||||
|
var reverse = false
|
||||||
|
|
||||||
|
var options = {}
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
|
function main () {
|
||||||
|
if (!argv.length) return help()
|
||||||
|
while (argv.length) {
|
||||||
|
var a = argv.shift()
|
||||||
|
var indexOfEqualSign = a.indexOf('=')
|
||||||
|
if (indexOfEqualSign !== -1) {
|
||||||
|
a = a.slice(0, indexOfEqualSign)
|
||||||
|
argv.unshift(a.slice(indexOfEqualSign + 1))
|
||||||
|
}
|
||||||
|
switch (a) {
|
||||||
|
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||||
|
reverse = true
|
||||||
|
break
|
||||||
|
case '-l': case '--loose':
|
||||||
|
loose = true
|
||||||
|
break
|
||||||
|
case '-p': case '--include-prerelease':
|
||||||
|
includePrerelease = true
|
||||||
|
break
|
||||||
|
case '-v': case '--version':
|
||||||
|
versions.push(argv.shift())
|
||||||
|
break
|
||||||
|
case '-i': case '--inc': case '--increment':
|
||||||
|
switch (argv[0]) {
|
||||||
|
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||||
|
case 'premajor': case 'preminor': case 'prepatch':
|
||||||
|
inc = argv.shift()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
inc = 'patch'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case '--preid':
|
||||||
|
identifier = argv.shift()
|
||||||
|
break
|
||||||
|
case '-r': case '--range':
|
||||||
|
range.push(argv.shift())
|
||||||
|
break
|
||||||
|
case '-c': case '--coerce':
|
||||||
|
coerce = true
|
||||||
|
break
|
||||||
|
case '--rtl':
|
||||||
|
rtl = true
|
||||||
|
break
|
||||||
|
case '--ltr':
|
||||||
|
rtl = false
|
||||||
|
break
|
||||||
|
case '-h': case '--help': case '-?':
|
||||||
|
return help()
|
||||||
|
default:
|
||||||
|
versions.push(a)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
|
||||||
|
|
||||||
|
versions = versions.map(function (v) {
|
||||||
|
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
||||||
|
}).filter(function (v) {
|
||||||
|
return semver.valid(v)
|
||||||
|
})
|
||||||
|
if (!versions.length) return fail()
|
||||||
|
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
||||||
|
|
||||||
|
for (var i = 0, l = range.length; i < l; i++) {
|
||||||
|
versions = versions.filter(function (v) {
|
||||||
|
return semver.satisfies(v, range[i], options)
|
||||||
|
})
|
||||||
|
if (!versions.length) return fail()
|
||||||
|
}
|
||||||
|
return success(versions)
|
||||||
|
}
|
||||||
|
|
||||||
|
function failInc () {
|
||||||
|
console.error('--inc can only be used on a single version with no range')
|
||||||
|
fail()
|
||||||
|
}
|
||||||
|
|
||||||
|
function fail () { process.exit(1) }
|
||||||
|
|
||||||
|
function success () {
|
||||||
|
var compare = reverse ? 'rcompare' : 'compare'
|
||||||
|
versions.sort(function (a, b) {
|
||||||
|
return semver[compare](a, b, options)
|
||||||
|
}).map(function (v) {
|
||||||
|
return semver.clean(v, options)
|
||||||
|
}).map(function (v) {
|
||||||
|
return inc ? semver.inc(v, inc, options, identifier) : v
|
||||||
|
}).forEach(function (v, i, _) { console.log(v) })
|
||||||
|
}
|
||||||
|
|
||||||
|
function help () {
|
||||||
|
console.log(['SemVer ' + version,
|
||||||
|
'',
|
||||||
|
'A JavaScript implementation of the https://semver.org/ specification',
|
||||||
|
'Copyright Isaac Z. Schlueter',
|
||||||
|
'',
|
||||||
|
'Usage: semver [options] <version> [<version> [...]]',
|
||||||
|
'Prints valid versions sorted by SemVer precedence',
|
||||||
|
'',
|
||||||
|
'Options:',
|
||||||
|
'-r --range <range>',
|
||||||
|
' Print versions that match the specified range.',
|
||||||
|
'',
|
||||||
|
'-i --increment [<level>]',
|
||||||
|
' Increment a version by the specified level. Level can',
|
||||||
|
' be one of: major, minor, patch, premajor, preminor,',
|
||||||
|
" prepatch, or prerelease. Default level is 'patch'.",
|
||||||
|
' Only one version may be specified.',
|
||||||
|
'',
|
||||||
|
'--preid <identifier>',
|
||||||
|
' Identifier to be used to prefix premajor, preminor,',
|
||||||
|
' prepatch or prerelease version increments.',
|
||||||
|
'',
|
||||||
|
'-l --loose',
|
||||||
|
' Interpret versions and ranges loosely',
|
||||||
|
'',
|
||||||
|
'-p --include-prerelease',
|
||||||
|
' Always include prerelease versions in range matching',
|
||||||
|
'',
|
||||||
|
'-c --coerce',
|
||||||
|
' Coerce a string into SemVer if possible',
|
||||||
|
' (does not imply --loose)',
|
||||||
|
'',
|
||||||
|
'--rtl',
|
||||||
|
' Coerce version strings right to left',
|
||||||
|
'',
|
||||||
|
'--ltr',
|
||||||
|
' Coerce version strings left to right (default)',
|
||||||
|
'',
|
||||||
|
'Program exits successfully if any valid version satisfies',
|
||||||
|
'all supplied ranges, and prints all satisfying versions.',
|
||||||
|
'',
|
||||||
|
'If no satisfying versions are found, then exits failure.',
|
||||||
|
'',
|
||||||
|
'Versions are printed in ascending order, so supplying',
|
||||||
|
'multiple versions to the utility will just sort them.'
|
||||||
|
].join('\n'))
|
||||||
|
}
|
66
node_modules/semver/package.json
generated
vendored
Normal file
66
node_modules/semver/package.json
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"semver@6.3.0",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "semver@6.3.0",
|
||||||
|
"_id": "semver@6.3.0",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||||
|
"_location": "/semver",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "semver@6.3.0",
|
||||||
|
"name": "semver",
|
||||||
|
"escapedName": "semver",
|
||||||
|
"rawSpec": "6.3.0",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "6.3.0"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/@actions/tool-cache",
|
||||||
|
"/@typescript-eslint/typescript-estree",
|
||||||
|
"/istanbul-lib-instrument",
|
||||||
|
"/jest-snapshot"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
|
"_spec": "6.3.0",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"bin": {
|
||||||
|
"semver": "./bin/semver.js"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/npm/node-semver/issues"
|
||||||
|
},
|
||||||
|
"description": "The semantic version parser used by npm.",
|
||||||
|
"devDependencies": {
|
||||||
|
"tap": "^14.3.1"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"bin",
|
||||||
|
"range.bnf",
|
||||||
|
"semver.js"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/npm/node-semver#readme",
|
||||||
|
"license": "ISC",
|
||||||
|
"main": "semver.js",
|
||||||
|
"name": "semver",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/npm/node-semver.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"postpublish": "git push origin --follow-tags",
|
||||||
|
"postversion": "npm publish",
|
||||||
|
"preversion": "npm test",
|
||||||
|
"test": "tap"
|
||||||
|
},
|
||||||
|
"tap": {
|
||||||
|
"check-coverage": true
|
||||||
|
},
|
||||||
|
"version": "6.3.0"
|
||||||
|
}
|
16
node_modules/semver/range.bnf
generated
vendored
Normal file
16
node_modules/semver/range.bnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
range-set ::= range ( logical-or range ) *
|
||||||
|
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||||
|
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||||
|
hyphen ::= partial ' - ' partial
|
||||||
|
simple ::= primitive | partial | tilde | caret
|
||||||
|
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||||
|
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||||
|
xr ::= 'x' | 'X' | '*' | nr
|
||||||
|
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||||
|
tilde ::= '~' partial
|
||||||
|
caret ::= '^' partial
|
||||||
|
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||||
|
pre ::= parts
|
||||||
|
build ::= parts
|
||||||
|
parts ::= part ( '.' part ) *
|
||||||
|
part ::= nr | [-0-9A-Za-z]+
|
1596
node_modules/semver/semver.js
generated
vendored
Normal file
1596
node_modules/semver/semver.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
node_modules/tunnel/.idea/encodings.xml
generated
vendored
Normal file
6
node_modules/tunnel/.idea/encodings.xml
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
node_modules/tunnel/.idea/modules.xml
generated
vendored
Normal file
8
node_modules/tunnel/.idea/modules.xml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/node-tunnel.iml" filepath="$PROJECT_DIR$/.idea/node-tunnel.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
12
node_modules/tunnel/.idea/node-tunnel.iml
generated
vendored
Normal file
12
node_modules/tunnel/.idea/node-tunnel.iml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
node_modules/tunnel/.idea/vcs.xml
generated
vendored
Normal file
6
node_modules/tunnel/.idea/vcs.xml
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
797
node_modules/tunnel/.idea/workspace.xml
generated
vendored
Normal file
797
node_modules/tunnel/.idea/workspace.xml
generated
vendored
Normal file
@ -0,0 +1,797 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="3caed8aa-31ae-4b3d-ad18-6f9796663516" name="Default" comment="">
|
||||||
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.travis.yml" afterPath="$PROJECT_DIR$/.travis.yml" />
|
||||||
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/CHANGELOG.md" afterPath="$PROJECT_DIR$/CHANGELOG.md" />
|
||||||
|
</list>
|
||||||
|
<ignored path="$PROJECT_DIR$/.tmp/" />
|
||||||
|
<ignored path="$PROJECT_DIR$/temp/" />
|
||||||
|
<ignored path="$PROJECT_DIR$/tmp/" />
|
||||||
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
|
<option name="TRACKING_ENABLED" value="true" />
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="FileEditorManager">
|
||||||
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||||
|
<file leaf-file-name="package.json" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/package.json">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="34">
|
||||||
|
<caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="2312">
|
||||||
|
<caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
|
||||||
|
<folding>
|
||||||
|
<marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="601:644" ph="{"host": 'localhost'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="674:737" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="884:1330" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="964:1328" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1290:1324" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1357:1419" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1514:2209" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1842:2207" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2168:2202" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2237:2300" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2395:3180" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2475:3178" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2802:2836" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3207:3269" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3366:4398" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3694:4396" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4021:4055" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4426:4489" ph="{"host": 'example.com'...}" />
|
||||||
|
</folding>
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name=".travis.yml" pinned="false" current-in-tab="true">
|
||||||
|
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="102">
|
||||||
|
<caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="tunnel.js" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/lib/tunnel.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="697">
|
||||||
|
<caret line="41" column="19" lean-forward="false" selection-start-line="41" selection-start-column="19" selection-end-line="41" selection-end-column="19" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="http-over-http-error.js" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="935">
|
||||||
|
<caret line="55" column="26" lean-forward="true" selection-start-line="55" selection-start-column="26" selection-end-line="55" selection-end-column="26" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="http-over-http-error2.js" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http-error2.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1207">
|
||||||
|
<caret line="71" column="0" lean-forward="false" selection-start-line="71" selection-start-column="0" selection-end-line="71" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="https-over-http.js" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-http.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1479">
|
||||||
|
<caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="https-over-https.js" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-https.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="http-over-http.js" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1088">
|
||||||
|
<caret line="64" column="26" lean-forward="true" selection-start-line="64" selection-start-column="26" selection-end-line="64" selection-end-column="26" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="102">
|
||||||
|
<caret line="6" column="0" lean-forward="false" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
</leaf>
|
||||||
|
</component>
|
||||||
|
<component name="FileTemplateManagerImpl">
|
||||||
|
<option name="RECENT_TEMPLATES">
|
||||||
|
<list>
|
||||||
|
<option value="JavaScript File" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="FindInProjectRecents">
|
||||||
|
<findStrings>
|
||||||
|
<find>max</find>
|
||||||
|
<find>onconne</find>
|
||||||
|
</findStrings>
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="IdeDocumentHistory">
|
||||||
|
<option name="CHANGED_PATHS">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/test/http-over-http-error.js" />
|
||||||
|
<option value="$PROJECT_DIR$/README.md" />
|
||||||
|
<option value="$PROJECT_DIR$/package.json" />
|
||||||
|
<option value="$PROJECT_DIR$/test/http-over-http-error2.js" />
|
||||||
|
<option value="$PROJECT_DIR$/test/https-over-http-localaddress.js" />
|
||||||
|
<option value="$PROJECT_DIR$/test/https-over-http.js" />
|
||||||
|
<option value="$PROJECT_DIR$/lib/tunnel.js" />
|
||||||
|
<option value="$PROJECT_DIR$/CHANGELOG.md" />
|
||||||
|
<option value="$PROJECT_DIR$/.travis.yml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||||
|
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER">
|
||||||
|
<package-json value="$PROJECT_DIR$/package.json" />
|
||||||
|
</component>
|
||||||
|
<component name="JsFlowSettings">
|
||||||
|
<service-enabled>false</service-enabled>
|
||||||
|
<exe-path />
|
||||||
|
<annotation-enable>false</annotation-enable>
|
||||||
|
<other-services-enabled>false</other-services-enabled>
|
||||||
|
<auto-save>true</auto-save>
|
||||||
|
</component>
|
||||||
|
<component name="JsGulpfileManager">
|
||||||
|
<detection-done>true</detection-done>
|
||||||
|
<sorting>DEFINITION_ORDER</sorting>
|
||||||
|
</component>
|
||||||
|
<component name="NodeModulesDirectoryManager">
|
||||||
|
<handled-path value="$PROJECT_DIR$/node_modules" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectFrameBounds">
|
||||||
|
<option name="x" value="785" />
|
||||||
|
<option name="y" value="40" />
|
||||||
|
<option name="width" value="1788" />
|
||||||
|
<option name="height" value="1407" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectView">
|
||||||
|
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||||
|
<flattenPackages />
|
||||||
|
<showMembers />
|
||||||
|
<showModules />
|
||||||
|
<showLibraryContents />
|
||||||
|
<hideEmptyPackages />
|
||||||
|
<abbreviatePackageNames />
|
||||||
|
<autoscrollToSource />
|
||||||
|
<autoscrollFromSource ProjectPane="true" />
|
||||||
|
<sortByType />
|
||||||
|
<manualOrder />
|
||||||
|
<foldersAlwaysOnTop value="true" />
|
||||||
|
</navigator>
|
||||||
|
<panes>
|
||||||
|
<pane id="Scope" />
|
||||||
|
<pane id="Scratches" />
|
||||||
|
<pane id="ProjectPane">
|
||||||
|
<subPane>
|
||||||
|
<expand>
|
||||||
|
<path>
|
||||||
|
<item name="node-tunnel" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="node-tunnel" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="node-tunnel" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="node-tunnel" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<item name="node-tunnel" type="b2602c69:ProjectViewProjectNode" />
|
||||||
|
<item name="node-tunnel" type="462c0819:PsiDirectoryNode" />
|
||||||
|
<item name="test" type="462c0819:PsiDirectoryNode" />
|
||||||
|
</path>
|
||||||
|
</expand>
|
||||||
|
<select />
|
||||||
|
</subPane>
|
||||||
|
</pane>
|
||||||
|
</panes>
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent">
|
||||||
|
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||||
|
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||||
|
<property name="HbShouldOpenHtmlAsHb" value="" />
|
||||||
|
<property name="nodejs_interpreter_path" value="$PROJECT_DIR$/../../nvmw/v6.10.3/node" />
|
||||||
|
</component>
|
||||||
|
<component name="RecentsManager">
|
||||||
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
|
<recent name="C:\Users\koichik\git\koichik\node-tunnel\test" />
|
||||||
|
</key>
|
||||||
|
</component>
|
||||||
|
<component name="RunDashboard">
|
||||||
|
<option name="ruleStates">
|
||||||
|
<list>
|
||||||
|
<RuleState>
|
||||||
|
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||||
|
</RuleState>
|
||||||
|
<RuleState>
|
||||||
|
<option name="name" value="StatusDashboardGroupingRule" />
|
||||||
|
</RuleState>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="RunManager">
|
||||||
|
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
||||||
|
<node-interpreter>project</node-interpreter>
|
||||||
|
<node-options />
|
||||||
|
<gulpfile />
|
||||||
|
<tasks />
|
||||||
|
<arguments />
|
||||||
|
<envs />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test">
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
|
||||||
|
<node-interpreter value="project" />
|
||||||
|
<working-dir value="" />
|
||||||
|
<envs />
|
||||||
|
<scope-kind value="ALL" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma">
|
||||||
|
<config-file value="" />
|
||||||
|
<node-interpreter value="project" />
|
||||||
|
<envs />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
|
||||||
|
<config-file value="" />
|
||||||
|
<node-interpreter value="project" />
|
||||||
|
<envs />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
|
||||||
|
<option name="cucumberJsArguments" value="" />
|
||||||
|
<option name="executablePath" />
|
||||||
|
<option name="filePath" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
|
||||||
|
<command value="run" />
|
||||||
|
<scripts />
|
||||||
|
<node-interpreter value="project" />
|
||||||
|
<envs />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
|
||||||
|
<node-interpreter>project</node-interpreter>
|
||||||
|
<node-options />
|
||||||
|
<working-directory />
|
||||||
|
<pass-parent-env>true</pass-parent-env>
|
||||||
|
<envs />
|
||||||
|
<ui />
|
||||||
|
<extra-mocha-options />
|
||||||
|
<test-kind>DIRECTORY</test-kind>
|
||||||
|
<test-directory />
|
||||||
|
<recursive>false</recursive>
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
|
<component name="ShelveChangesManager" show_recycled="false">
|
||||||
|
<option name="remove_strategy" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="SvnConfiguration">
|
||||||
|
<configuration />
|
||||||
|
</component>
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="3caed8aa-31ae-4b3d-ad18-6f9796663516" name="Default" comment="" />
|
||||||
|
<created>1497256565348</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1497256565348</updated>
|
||||||
|
<workItem from="1497256566573" duration="8794000" />
|
||||||
|
<workItem from="1497272051717" duration="2328000" />
|
||||||
|
<workItem from="1536577850117" duration="8708000" />
|
||||||
|
<workItem from="1536636907096" duration="739000" />
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
<component name="TimeTrackingManager">
|
||||||
|
<option name="totallyTimeSpent" value="20569000" />
|
||||||
|
</component>
|
||||||
|
<component name="ToolWindowManager">
|
||||||
|
<frame x="785" y="40" width="1788" height="1407" extended-state="0" />
|
||||||
|
<editor active="true" />
|
||||||
|
<layout>
|
||||||
|
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||||
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="SvgViewer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
||||||
|
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32967034" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||||
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||||
|
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||||
|
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||||
|
</layout>
|
||||||
|
</component>
|
||||||
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
|
<option name="version" value="1" />
|
||||||
|
</component>
|
||||||
|
<component name="VcsContentAnnotationSettings">
|
||||||
|
<option name="myLimit" value="2678400000" />
|
||||||
|
</component>
|
||||||
|
<component name="XDebuggerManager">
|
||||||
|
<breakpoint-manager />
|
||||||
|
<watches-manager />
|
||||||
|
</component>
|
||||||
|
<component name="editorHistoryManager">
|
||||||
|
<entry file="file://$PROJECT_DIR$/package.json">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="34">
|
||||||
|
<caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="2312">
|
||||||
|
<caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
|
||||||
|
<folding>
|
||||||
|
<marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="601:644" ph="{"host": 'localhost'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="674:737" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="884:1330" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="964:1328" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1290:1324" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1357:1419" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1514:2209" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1842:2207" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2168:2202" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2237:2300" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2395:3180" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2475:3178" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2802:2836" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3207:3269" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3366:4398" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3694:4396" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4021:4055" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4426:4489" ph="{"host": 'example.com'...}" />
|
||||||
|
</folding>
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="102">
|
||||||
|
<caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="935">
|
||||||
|
<caret line="55" column="26" lean-forward="true" selection-start-line="55" selection-start-column="26" selection-end-line="55" selection-end-column="26" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http-error2.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1207">
|
||||||
|
<caret line="71" column="0" lean-forward="false" selection-start-line="71" selection-start-column="0" selection-end-line="71" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-http.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1479">
|
||||||
|
<caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-https.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1088">
|
||||||
|
<caret line="64" column="26" lean-forward="true" selection-start-line="64" selection-start-column="26" selection-end-line="64" selection-end-column="26" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/lib/tunnel.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="697">
|
||||||
|
<caret line="41" column="19" lean-forward="false" selection-start-line="41" selection-start-column="19" selection-end-line="41" selection-end-column="19" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/package.json">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="34">
|
||||||
|
<caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="2312">
|
||||||
|
<caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
|
||||||
|
<folding>
|
||||||
|
<marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="601:644" ph="{"host": 'localhost'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="674:737" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="884:1330" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="964:1328" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1290:1324" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1357:1419" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1514:2209" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1842:2207" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2168:2202" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2237:2300" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2395:3180" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2475:3178" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2802:2836" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3207:3269" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3366:4398" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3694:4396" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4021:4055" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4426:4489" ph="{"host": 'example.com'...}" />
|
||||||
|
</folding>
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/lib/tunnel.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="2550">
|
||||||
|
<caret line="150" column="0" lean-forward="false" selection-start-line="150" selection-start-column="0" selection-end-line="150" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="51">
|
||||||
|
<caret line="3" column="21" lean-forward="false" selection-start-line="3" selection-start-column="21" selection-end-line="3" selection-end-column="21" />
|
||||||
|
<folding />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="119">
|
||||||
|
<caret line="7" column="0" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/package.json">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
<folding>
|
||||||
|
<marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="601:644" ph="{"host": 'localhost'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="674:737" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="884:1330" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="964:1328" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1290:1324" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1357:1419" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1514:2209" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1842:2207" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2168:2202" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2237:2300" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2395:3180" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2475:3178" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2802:2836" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3207:3269" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3366:4398" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3694:4396" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4021:4055" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4426:4489" ph="{"host": 'example.com'...}" />
|
||||||
|
</folding>
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/lib/tunnel.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="2550">
|
||||||
|
<caret line="150" column="0" lean-forward="false" selection-start-line="150" selection-start-column="0" selection-end-line="150" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-https.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-https-error.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="136">
|
||||||
|
<caret line="8" column="0" lean-forward="false" selection-start-line="7" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1309">
|
||||||
|
<caret line="77" column="0" lean-forward="false" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-https.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-https.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-https-error.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/README.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="2312">
|
||||||
|
<caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
|
||||||
|
<folding>
|
||||||
|
<marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="601:644" ph="{"host": 'localhost'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="674:737" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="884:1330" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="964:1328" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1290:1324" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1357:1419" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1514:2209" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1842:2207" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2168:2202" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2237:2300" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2395:3180" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2475:3178" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="2802:2836" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3207:3269" ph="{"host": 'example.com'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3366:4398" ph="{"maxSockets": poolSize...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3694:4396" ph="{"host": proxyHost...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4021:4055" ph="{"User-Agent": 'Node'...}" />
|
||||||
|
<marker date="1497272379133" expanded="true" signature="4426:4489" ph="{"host": 'example.com'...}" />
|
||||||
|
</folding>
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/package.json">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="34">
|
||||||
|
<caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="935">
|
||||||
|
<caret line="55" column="26" lean-forward="true" selection-start-line="55" selection-start-column="26" selection-end-line="55" selection-end-column="26" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http-error2.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1207">
|
||||||
|
<caret line="71" column="0" lean-forward="false" selection-start-line="71" selection-start-column="0" selection-end-line="71" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-http-localaddress.js" />
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-https.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/http-over-http.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1088">
|
||||||
|
<caret line="64" column="26" lean-forward="true" selection-start-line="64" selection-start-column="26" selection-end-line="64" selection-end-column="26" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/test/https-over-http.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="1479">
|
||||||
|
<caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/lib/tunnel.js">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="697">
|
||||||
|
<caret line="41" column="19" lean-forward="false" selection-start-line="41" selection-start-column="19" selection-end-line="41" selection-end-column="19" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||||
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||||
|
<state split_layout="SPLIT">
|
||||||
|
<first_editor relative-caret-position="102">
|
||||||
|
<caret line="6" column="0" lean-forward="false" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</first_editor>
|
||||||
|
<second_editor />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="102">
|
||||||
|
<caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
node_modules/tunnel/.travis.yml
generated
vendored
Normal file
6
node_modules/tunnel/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "4"
|
||||||
|
- "6"
|
||||||
|
- "8"
|
||||||
|
- "10"
|
22
node_modules/tunnel/CHANGELOG.md
generated
vendored
Normal file
22
node_modules/tunnel/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
- 0.0.6 (2018/09/11)
|
||||||
|
- Fix `localAddress` not working (#25)
|
||||||
|
- Fix `Host:` header for CONNECT method by @tmurakam (#29, #30)
|
||||||
|
- Fix default port for https (#32)
|
||||||
|
- Fix error handling when the proxy send illegal response body (#33)
|
||||||
|
|
||||||
|
- 0.0.5 (2017/06/12)
|
||||||
|
- Fix socket leak.
|
||||||
|
|
||||||
|
- 0.0.4 (2016/01/23)
|
||||||
|
- supported Node v0.12 or later.
|
||||||
|
|
||||||
|
- 0.0.3 (2014/01/20)
|
||||||
|
- fixed package.json
|
||||||
|
|
||||||
|
- 0.0.1 (2012/02/18)
|
||||||
|
- supported Node v0.6.x (0.6.11 or later).
|
||||||
|
|
||||||
|
- 0.0.0 (2012/02/11)
|
||||||
|
- first release.
|
21
node_modules/tunnel/LICENSE
generated
vendored
Normal file
21
node_modules/tunnel/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2012 Koichi Kobayashi
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
185
node_modules/tunnel/README.md
generated
vendored
Normal file
185
node_modules/tunnel/README.md
generated
vendored
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
# node-tunnel - HTTP/HTTPS Agents for tunneling proxies
|
||||||
|
|
||||||
|
[![Build Status](https://img.shields.io/travis/koichik/node-tunnel.svg?style=flat)](https://travis-ci.org/koichik/node-tunnel)
|
||||||
|
[![Dependency Status](http://img.shields.io/david/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=dependencies)
|
||||||
|
[![DevDependency Status](http://img.shields.io/david/dev/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=devDependencies)
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var tunnel = require('tunnel');
|
||||||
|
|
||||||
|
var tunnelingAgent = tunnel.httpsOverHttp({
|
||||||
|
proxy: {
|
||||||
|
host: 'localhost',
|
||||||
|
port: 3128
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var req = https.request({
|
||||||
|
host: 'example.com',
|
||||||
|
port: 443,
|
||||||
|
agent: tunnelingAgent
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
$ npm install tunnel
|
||||||
|
|
||||||
|
## Usages
|
||||||
|
|
||||||
|
### HTTP over HTTP tunneling
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var tunnelingAgent = tunnel.httpOverHttp({
|
||||||
|
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||||
|
|
||||||
|
proxy: { // Proxy settings
|
||||||
|
host: proxyHost, // Defaults to 'localhost'
|
||||||
|
port: proxyPort, // Defaults to 80
|
||||||
|
localAddress: localAddress, // Local interface if necessary
|
||||||
|
|
||||||
|
// Basic authorization for proxy server if necessary
|
||||||
|
proxyAuth: 'user:password',
|
||||||
|
|
||||||
|
// Header fields for proxy server if necessary
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Node'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var req = http.request({
|
||||||
|
host: 'example.com',
|
||||||
|
port: 80,
|
||||||
|
agent: tunnelingAgent
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### HTTPS over HTTP tunneling
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var tunnelingAgent = tunnel.httpsOverHttp({
|
||||||
|
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||||
|
|
||||||
|
// CA for origin server if necessary
|
||||||
|
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||||
|
|
||||||
|
// Client certification for origin server if necessary
|
||||||
|
key: fs.readFileSync('origin-server-key.pem'),
|
||||||
|
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||||
|
|
||||||
|
proxy: { // Proxy settings
|
||||||
|
host: proxyHost, // Defaults to 'localhost'
|
||||||
|
port: proxyPort, // Defaults to 80
|
||||||
|
localAddress: localAddress, // Local interface if necessary
|
||||||
|
|
||||||
|
// Basic authorization for proxy server if necessary
|
||||||
|
proxyAuth: 'user:password',
|
||||||
|
|
||||||
|
// Header fields for proxy server if necessary
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Node'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var req = https.request({
|
||||||
|
host: 'example.com',
|
||||||
|
port: 443,
|
||||||
|
agent: tunnelingAgent
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### HTTP over HTTPS tunneling
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var tunnelingAgent = tunnel.httpOverHttps({
|
||||||
|
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||||
|
|
||||||
|
proxy: { // Proxy settings
|
||||||
|
host: proxyHost, // Defaults to 'localhost'
|
||||||
|
port: proxyPort, // Defaults to 443
|
||||||
|
localAddress: localAddress, // Local interface if necessary
|
||||||
|
|
||||||
|
// Basic authorization for proxy server if necessary
|
||||||
|
proxyAuth: 'user:password',
|
||||||
|
|
||||||
|
// Header fields for proxy server if necessary
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Node'
|
||||||
|
},
|
||||||
|
|
||||||
|
// CA for proxy server if necessary
|
||||||
|
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||||
|
|
||||||
|
// Server name for verification if necessary
|
||||||
|
servername: 'example.com',
|
||||||
|
|
||||||
|
// Client certification for proxy server if necessary
|
||||||
|
key: fs.readFileSync('origin-server-key.pem'),
|
||||||
|
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var req = http.request({
|
||||||
|
host: 'example.com',
|
||||||
|
port: 80,
|
||||||
|
agent: tunnelingAgent
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### HTTPS over HTTPS tunneling
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var tunnelingAgent = tunnel.httpsOverHttps({
|
||||||
|
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||||
|
|
||||||
|
// CA for origin server if necessary
|
||||||
|
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||||
|
|
||||||
|
// Client certification for origin server if necessary
|
||||||
|
key: fs.readFileSync('origin-server-key.pem'),
|
||||||
|
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||||
|
|
||||||
|
proxy: { // Proxy settings
|
||||||
|
host: proxyHost, // Defaults to 'localhost'
|
||||||
|
port: proxyPort, // Defaults to 443
|
||||||
|
localAddress: localAddress, // Local interface if necessary
|
||||||
|
|
||||||
|
// Basic authorization for proxy server if necessary
|
||||||
|
proxyAuth: 'user:password',
|
||||||
|
|
||||||
|
// Header fields for proxy server if necessary
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Node'
|
||||||
|
}
|
||||||
|
|
||||||
|
// CA for proxy server if necessary
|
||||||
|
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||||
|
|
||||||
|
// Server name for verification if necessary
|
||||||
|
servername: 'example.com',
|
||||||
|
|
||||||
|
// Client certification for proxy server if necessary
|
||||||
|
key: fs.readFileSync('origin-server-key.pem'),
|
||||||
|
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var req = https.request({
|
||||||
|
host: 'example.com',
|
||||||
|
port: 443,
|
||||||
|
agent: tunnelingAgent
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## CONTRIBUTORS
|
||||||
|
* [Aleksis Brezas (abresas)](https://github.com/abresas)
|
||||||
|
* [Jackson Tian (JacksonTian)](https://github.com/JacksonTian)
|
||||||
|
* [Dmitry Sorin (1999)](https://github.com/1999)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Licensed under the [MIT](https://github.com/koichik/node-tunnel/blob/master/LICENSE) license.
|
1
node_modules/tunnel/index.js
generated
vendored
Normal file
1
node_modules/tunnel/index.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = require('./lib/tunnel');
|
264
node_modules/tunnel/lib/tunnel.js
generated
vendored
Normal file
264
node_modules/tunnel/lib/tunnel.js
generated
vendored
Normal file
@ -0,0 +1,264 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var net = require('net');
|
||||||
|
var tls = require('tls');
|
||||||
|
var http = require('http');
|
||||||
|
var https = require('https');
|
||||||
|
var events = require('events');
|
||||||
|
var assert = require('assert');
|
||||||
|
var util = require('util');
|
||||||
|
|
||||||
|
|
||||||
|
exports.httpOverHttp = httpOverHttp;
|
||||||
|
exports.httpsOverHttp = httpsOverHttp;
|
||||||
|
exports.httpOverHttps = httpOverHttps;
|
||||||
|
exports.httpsOverHttps = httpsOverHttps;
|
||||||
|
|
||||||
|
|
||||||
|
function httpOverHttp(options) {
|
||||||
|
var agent = new TunnelingAgent(options);
|
||||||
|
agent.request = http.request;
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
function httpsOverHttp(options) {
|
||||||
|
var agent = new TunnelingAgent(options);
|
||||||
|
agent.request = http.request;
|
||||||
|
agent.createSocket = createSecureSocket;
|
||||||
|
agent.defaultPort = 443;
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
function httpOverHttps(options) {
|
||||||
|
var agent = new TunnelingAgent(options);
|
||||||
|
agent.request = https.request;
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
function httpsOverHttps(options) {
|
||||||
|
var agent = new TunnelingAgent(options);
|
||||||
|
agent.request = https.request;
|
||||||
|
agent.createSocket = createSecureSocket;
|
||||||
|
agent.defaultPort = 443;
|
||||||
|
return agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function TunnelingAgent(options) {
|
||||||
|
var self = this;
|
||||||
|
self.options = options || {};
|
||||||
|
self.proxyOptions = self.options.proxy || {};
|
||||||
|
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
|
||||||
|
self.requests = [];
|
||||||
|
self.sockets = [];
|
||||||
|
|
||||||
|
self.on('free', function onFree(socket, host, port, localAddress) {
|
||||||
|
var options = toOptions(host, port, localAddress);
|
||||||
|
for (var i = 0, len = self.requests.length; i < len; ++i) {
|
||||||
|
var pending = self.requests[i];
|
||||||
|
if (pending.host === options.host && pending.port === options.port) {
|
||||||
|
// Detect the request to connect same origin server,
|
||||||
|
// reuse the connection.
|
||||||
|
self.requests.splice(i, 1);
|
||||||
|
pending.request.onSocket(socket);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
socket.destroy();
|
||||||
|
self.removeSocket(socket);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
util.inherits(TunnelingAgent, events.EventEmitter);
|
||||||
|
|
||||||
|
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
|
||||||
|
var self = this;
|
||||||
|
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
|
||||||
|
|
||||||
|
if (self.sockets.length >= this.maxSockets) {
|
||||||
|
// We are over limit so we'll add it to the queue.
|
||||||
|
self.requests.push(options);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we are under maxSockets create a new one.
|
||||||
|
self.createSocket(options, function(socket) {
|
||||||
|
socket.on('free', onFree);
|
||||||
|
socket.on('close', onCloseOrRemove);
|
||||||
|
socket.on('agentRemove', onCloseOrRemove);
|
||||||
|
req.onSocket(socket);
|
||||||
|
|
||||||
|
function onFree() {
|
||||||
|
self.emit('free', socket, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCloseOrRemove(err) {
|
||||||
|
self.removeSocket(socket);
|
||||||
|
socket.removeListener('free', onFree);
|
||||||
|
socket.removeListener('close', onCloseOrRemove);
|
||||||
|
socket.removeListener('agentRemove', onCloseOrRemove);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
|
||||||
|
var self = this;
|
||||||
|
var placeholder = {};
|
||||||
|
self.sockets.push(placeholder);
|
||||||
|
|
||||||
|
var connectOptions = mergeOptions({}, self.proxyOptions, {
|
||||||
|
method: 'CONNECT',
|
||||||
|
path: options.host + ':' + options.port,
|
||||||
|
agent: false,
|
||||||
|
headers: {
|
||||||
|
host: options.host + ':' + options.port
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (options.localAddress) {
|
||||||
|
connectOptions.localAddress = options.localAddress;
|
||||||
|
}
|
||||||
|
if (connectOptions.proxyAuth) {
|
||||||
|
connectOptions.headers = connectOptions.headers || {};
|
||||||
|
connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
|
||||||
|
new Buffer(connectOptions.proxyAuth).toString('base64');
|
||||||
|
}
|
||||||
|
|
||||||
|
debug('making CONNECT request');
|
||||||
|
var connectReq = self.request(connectOptions);
|
||||||
|
connectReq.useChunkedEncodingByDefault = false; // for v0.6
|
||||||
|
connectReq.once('response', onResponse); // for v0.6
|
||||||
|
connectReq.once('upgrade', onUpgrade); // for v0.6
|
||||||
|
connectReq.once('connect', onConnect); // for v0.7 or later
|
||||||
|
connectReq.once('error', onError);
|
||||||
|
connectReq.end();
|
||||||
|
|
||||||
|
function onResponse(res) {
|
||||||
|
// Very hacky. This is necessary to avoid http-parser leaks.
|
||||||
|
res.upgrade = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onUpgrade(res, socket, head) {
|
||||||
|
// Hacky.
|
||||||
|
process.nextTick(function() {
|
||||||
|
onConnect(res, socket, head);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onConnect(res, socket, head) {
|
||||||
|
connectReq.removeAllListeners();
|
||||||
|
socket.removeAllListeners();
|
||||||
|
|
||||||
|
if (res.statusCode !== 200) {
|
||||||
|
debug('tunneling socket could not be established, statusCode=%d',
|
||||||
|
res.statusCode);
|
||||||
|
socket.destroy();
|
||||||
|
var error = new Error('tunneling socket could not be established, ' +
|
||||||
|
'statusCode=' + res.statusCode);
|
||||||
|
error.code = 'ECONNRESET';
|
||||||
|
options.request.emit('error', error);
|
||||||
|
self.removeSocket(placeholder);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (head.length > 0) {
|
||||||
|
debug('got illegal response body from proxy');
|
||||||
|
socket.destroy();
|
||||||
|
var error = new Error('got illegal response body from proxy');
|
||||||
|
error.code = 'ECONNRESET';
|
||||||
|
options.request.emit('error', error);
|
||||||
|
self.removeSocket(placeholder);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
debug('tunneling connection has established');
|
||||||
|
self.sockets[self.sockets.indexOf(placeholder)] = socket;
|
||||||
|
return cb(socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onError(cause) {
|
||||||
|
connectReq.removeAllListeners();
|
||||||
|
|
||||||
|
debug('tunneling socket could not be established, cause=%s\n',
|
||||||
|
cause.message, cause.stack);
|
||||||
|
var error = new Error('tunneling socket could not be established, ' +
|
||||||
|
'cause=' + cause.message);
|
||||||
|
error.code = 'ECONNRESET';
|
||||||
|
options.request.emit('error', error);
|
||||||
|
self.removeSocket(placeholder);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
|
||||||
|
var pos = this.sockets.indexOf(socket)
|
||||||
|
if (pos === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.sockets.splice(pos, 1);
|
||||||
|
|
||||||
|
var pending = this.requests.shift();
|
||||||
|
if (pending) {
|
||||||
|
// If we have pending requests and a socket gets closed a new one
|
||||||
|
// needs to be created to take over in the pool for the one that closed.
|
||||||
|
this.createSocket(pending, function(socket) {
|
||||||
|
pending.request.onSocket(socket);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function createSecureSocket(options, cb) {
|
||||||
|
var self = this;
|
||||||
|
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
|
||||||
|
var hostHeader = options.request.getHeader('host');
|
||||||
|
var tlsOptions = mergeOptions({}, self.options, {
|
||||||
|
socket: socket,
|
||||||
|
servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
|
||||||
|
});
|
||||||
|
|
||||||
|
// 0 is dummy port for v0.6
|
||||||
|
var secureSocket = tls.connect(0, tlsOptions);
|
||||||
|
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
|
||||||
|
cb(secureSocket);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function toOptions(host, port, localAddress) {
|
||||||
|
if (typeof host === 'string') { // since v0.10
|
||||||
|
return {
|
||||||
|
host: host,
|
||||||
|
port: port,
|
||||||
|
localAddress: localAddress
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return host; // for v0.11 or later
|
||||||
|
}
|
||||||
|
|
||||||
|
function mergeOptions(target) {
|
||||||
|
for (var i = 1, len = arguments.length; i < len; ++i) {
|
||||||
|
var overrides = arguments[i];
|
||||||
|
if (typeof overrides === 'object') {
|
||||||
|
var keys = Object.keys(overrides);
|
||||||
|
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
|
||||||
|
var k = keys[j];
|
||||||
|
if (overrides[k] !== undefined) {
|
||||||
|
target[k] = overrides[k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var debug;
|
||||||
|
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
||||||
|
debug = function() {
|
||||||
|
var args = Array.prototype.slice.call(arguments);
|
||||||
|
if (typeof args[0] === 'string') {
|
||||||
|
args[0] = 'TUNNEL: ' + args[0];
|
||||||
|
} else {
|
||||||
|
args.unshift('TUNNEL:');
|
||||||
|
}
|
||||||
|
console.error.apply(console, args);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
debug = function() {};
|
||||||
|
}
|
||||||
|
exports.debug = debug; // for test
|
67
node_modules/tunnel/package.json
generated
vendored
Normal file
67
node_modules/tunnel/package.json
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"tunnel@0.0.6",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "tunnel@0.0.6",
|
||||||
|
"_id": "tunnel@0.0.6",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
||||||
|
"_location": "/tunnel",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "tunnel@0.0.6",
|
||||||
|
"name": "tunnel",
|
||||||
|
"escapedName": "tunnel",
|
||||||
|
"rawSpec": "0.0.6",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "0.0.6"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/@actions/http-client"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||||
|
"_spec": "0.0.6",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"author": {
|
||||||
|
"name": "Koichi Kobayashi",
|
||||||
|
"email": "koichik@improvement.jp"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/koichik/node-tunnel/issues"
|
||||||
|
},
|
||||||
|
"description": "Node HTTP/HTTPS Agents for tunneling proxies",
|
||||||
|
"devDependencies": {
|
||||||
|
"mocha": "^5.2.0",
|
||||||
|
"should": "^13.2.3"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"lib": "./lib"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/koichik/node-tunnel/",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"https",
|
||||||
|
"agent",
|
||||||
|
"proxy",
|
||||||
|
"tunnel"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "./index.js",
|
||||||
|
"name": "tunnel",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/koichik/node-tunnel.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "mocha"
|
||||||
|
},
|
||||||
|
"version": "0.0.6"
|
||||||
|
}
|
5
node_modules/uuid/AUTHORS
generated
vendored
Normal file
5
node_modules/uuid/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Robert Kieffer <robert@broofa.com>
|
||||||
|
Christoph Tavan <dev@tavan.de>
|
||||||
|
AJ ONeal <coolaj86@gmail.com>
|
||||||
|
Vincent Voyer <vincent@zeroload.net>
|
||||||
|
Roman Shtylman <shtylman@gmail.com>
|
112
node_modules/uuid/CHANGELOG.md
generated
vendored
Normal file
112
node_modules/uuid/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [3.3.3](https://github.com/kelektiv/node-uuid/compare/v3.3.2...v3.3.3) (2019-08-19)
|
||||||
|
|
||||||
|
<a name="3.3.2"></a>
|
||||||
|
## [3.3.2](https://github.com/kelektiv/node-uuid/compare/v3.3.1...v3.3.2) (2018-06-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* typo ([305d877](https://github.com/kelektiv/node-uuid/commit/305d877))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.3.1"></a>
|
||||||
|
## [3.3.1](https://github.com/kelektiv/node-uuid/compare/v3.3.0...v3.3.1) (2018-06-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix [#284](https://github.com/kelektiv/node-uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/kelektiv/node-uuid/commit/f2a60f2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.3.0"></a>
|
||||||
|
# [3.3.0](https://github.com/kelektiv/node-uuid/compare/v3.2.1...v3.3.0) (2018-06-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* assignment to readonly property to allow running in strict mode ([#270](https://github.com/kelektiv/node-uuid/issues/270)) ([d062fdc](https://github.com/kelektiv/node-uuid/commit/d062fdc))
|
||||||
|
* fix [#229](https://github.com/kelektiv/node-uuid/issues/229) ([c9684d4](https://github.com/kelektiv/node-uuid/commit/c9684d4))
|
||||||
|
* Get correct version of IE11 crypto ([#274](https://github.com/kelektiv/node-uuid/issues/274)) ([153d331](https://github.com/kelektiv/node-uuid/commit/153d331))
|
||||||
|
* mem issue when generating uuid ([#267](https://github.com/kelektiv/node-uuid/issues/267)) ([c47702c](https://github.com/kelektiv/node-uuid/commit/c47702c))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* enforce Conventional Commit style commit messages ([#282](https://github.com/kelektiv/node-uuid/issues/282)) ([cc9a182](https://github.com/kelektiv/node-uuid/commit/cc9a182))
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.2.1"></a>
|
||||||
|
## [3.2.1](https://github.com/kelektiv/node-uuid/compare/v3.2.0...v3.2.1) (2018-01-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* use msCrypto if available. Fixes [#241](https://github.com/kelektiv/node-uuid/issues/241) ([#247](https://github.com/kelektiv/node-uuid/issues/247)) ([1fef18b](https://github.com/kelektiv/node-uuid/commit/1fef18b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="3.2.0"></a>
|
||||||
|
# [3.2.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.2.0) (2018-01-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/kelektiv/node-uuid/commit/09fa824))
|
||||||
|
* use msCrypto if available. Fixes [#241](https://github.com/kelektiv/node-uuid/issues/241) ([#247](https://github.com/kelektiv/node-uuid/issues/247)) ([1fef18b](https://github.com/kelektiv/node-uuid/commit/1fef18b))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add v3 Support ([#217](https://github.com/kelektiv/node-uuid/issues/217)) ([d94f726](https://github.com/kelektiv/node-uuid/commit/d94f726))
|
||||||
|
|
||||||
|
|
||||||
|
# [3.1.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.0.1) (2017-06-17)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183)
|
||||||
|
* Fix typo (#178)
|
||||||
|
* Simple typo fix (#165)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
* v5 support in CLI (#197)
|
||||||
|
* V5 support (#188)
|
||||||
|
|
||||||
|
|
||||||
|
# 3.0.1 (2016-11-28)
|
||||||
|
|
||||||
|
* split uuid versions into separate files
|
||||||
|
|
||||||
|
|
||||||
|
# 3.0.0 (2016-11-17)
|
||||||
|
|
||||||
|
* remove .parse and .unparse
|
||||||
|
|
||||||
|
|
||||||
|
# 2.0.0
|
||||||
|
|
||||||
|
* Removed uuid.BufferClass
|
||||||
|
|
||||||
|
|
||||||
|
# 1.4.0
|
||||||
|
|
||||||
|
* Improved module context detection
|
||||||
|
* Removed public RNG functions
|
||||||
|
|
||||||
|
|
||||||
|
# 1.3.2
|
||||||
|
|
||||||
|
* Improve tests and handling of v1() options (Issue #24)
|
||||||
|
* Expose RNG option to allow for perf testing with different generators
|
||||||
|
|
||||||
|
|
||||||
|
# 1.3.0
|
||||||
|
|
||||||
|
* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
|
||||||
|
* Support for node.js crypto API
|
||||||
|
* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
|
21
node_modules/uuid/LICENSE.md
generated
vendored
Normal file
21
node_modules/uuid/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2010-2016 Robert Kieffer and other contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
293
node_modules/uuid/README.md
generated
vendored
Normal file
293
node_modules/uuid/README.md
generated
vendored
Normal file
@ -0,0 +1,293 @@
|
|||||||
|
<!--
|
||||||
|
-- This file is auto-generated from README_js.md. Changes should be made there.
|
||||||
|
-->
|
||||||
|
|
||||||
|
# uuid [![Build Status](https://secure.travis-ci.org/kelektiv/node-uuid.svg?branch=master)](http://travis-ci.org/kelektiv/node-uuid) #
|
||||||
|
|
||||||
|
Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.
|
||||||
|
|
||||||
|
Features:
|
||||||
|
|
||||||
|
* Support for version 1, 3, 4 and 5 UUIDs
|
||||||
|
* Cross-platform
|
||||||
|
* Uses cryptographically-strong random number APIs (when available)
|
||||||
|
* Zero-dependency, small footprint (... but not [this small](https://gist.github.com/982883))
|
||||||
|
|
||||||
|
[**Deprecation warning**: The use of `require('uuid')` is deprecated and will not be
|
||||||
|
supported after version 3.x of this module. Instead, use `require('uuid/[v1|v3|v4|v5]')` as shown in the examples below.]
|
||||||
|
|
||||||
|
## Quickstart - CommonJS (Recommended)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm install uuid
|
||||||
|
```
|
||||||
|
|
||||||
|
Then generate your uuid version of choice ...
|
||||||
|
|
||||||
|
Version 1 (timestamp):
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv1 = require('uuid/v1');
|
||||||
|
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Version 3 (namespace):
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv3 = require('uuid/v3');
|
||||||
|
|
||||||
|
// ... using predefined DNS namespace (for domain names)
|
||||||
|
uuidv3('hello.example.com', uuidv3.DNS); // ⇨ '9125a8dc-52ee-365b-a5aa-81b0b3681cf6'
|
||||||
|
|
||||||
|
// ... using predefined URL namespace (for, well, URLs)
|
||||||
|
uuidv3('http://example.com/hello', uuidv3.URL); // ⇨ 'c6235813-3ba4-3801-ae84-e0a6ebb7d138'
|
||||||
|
|
||||||
|
// ... using a custom namespace
|
||||||
|
//
|
||||||
|
// Note: Custom namespaces should be a UUID string specific to your application!
|
||||||
|
// E.g. the one here was generated using this modules `uuid` CLI.
|
||||||
|
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
|
||||||
|
uuidv3('Hello, World!', MY_NAMESPACE); // ⇨ 'e8b5a51d-11c8-3310-a6ab-367563f20686'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Version 4 (random):
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv4 = require('uuid/v4');
|
||||||
|
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Version 5 (namespace):
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv5 = require('uuid/v5');
|
||||||
|
|
||||||
|
// ... using predefined DNS namespace (for domain names)
|
||||||
|
uuidv5('hello.example.com', uuidv5.DNS); // ⇨ 'fdda765f-fc57-5604-a269-52a7df8164ec'
|
||||||
|
|
||||||
|
// ... using predefined URL namespace (for, well, URLs)
|
||||||
|
uuidv5('http://example.com/hello', uuidv5.URL); // ⇨ '3bbcee75-cecc-5b56-8031-b6641c1ed1f1'
|
||||||
|
|
||||||
|
// ... using a custom namespace
|
||||||
|
//
|
||||||
|
// Note: Custom namespaces should be a UUID string specific to your application!
|
||||||
|
// E.g. the one here was generated using this modules `uuid` CLI.
|
||||||
|
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
|
||||||
|
uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quickstart - Browser-ready Versions
|
||||||
|
|
||||||
|
Browser-ready versions of this module are available via [wzrd.in](https://github.com/jfhbrook/wzrd.in).
|
||||||
|
|
||||||
|
For version 1 uuids:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="http://wzrd.in/standalone/uuid%2Fv1@latest"></script>
|
||||||
|
<script>
|
||||||
|
uuidv1(); // -> v1 UUID
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
For version 3 uuids:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="http://wzrd.in/standalone/uuid%2Fv3@latest"></script>
|
||||||
|
<script>
|
||||||
|
uuidv3('http://example.com/hello', uuidv3.URL); // -> v3 UUID
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
For version 4 uuids:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="http://wzrd.in/standalone/uuid%2Fv4@latest"></script>
|
||||||
|
<script>
|
||||||
|
uuidv4(); // -> v4 UUID
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
For version 5 uuids:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="http://wzrd.in/standalone/uuid%2Fv5@latest"></script>
|
||||||
|
<script>
|
||||||
|
uuidv5('http://example.com/hello', uuidv5.URL); // -> v5 UUID
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### Version 1
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv1 = require('uuid/v1');
|
||||||
|
|
||||||
|
// Incantations
|
||||||
|
uuidv1();
|
||||||
|
uuidv1(options);
|
||||||
|
uuidv1(options, buffer, offset);
|
||||||
|
```
|
||||||
|
|
||||||
|
Generate and return a RFC4122 v1 (timestamp-based) UUID.
|
||||||
|
|
||||||
|
* `options` - (Object) Optional uuid state to apply. Properties may include:
|
||||||
|
|
||||||
|
* `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.
|
||||||
|
* `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.
|
||||||
|
* `msecs` - (Number) Time in milliseconds since unix Epoch. Default: The current time is used.
|
||||||
|
* `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.
|
||||||
|
|
||||||
|
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
||||||
|
* `offset` - (Number) Starting index in `buffer` at which to begin writing.
|
||||||
|
|
||||||
|
Returns `buffer`, if specified, otherwise the string form of the UUID
|
||||||
|
|
||||||
|
Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
|
||||||
|
|
||||||
|
Example: Generate string UUID with fully-specified options
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const v1options = {
|
||||||
|
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
||||||
|
clockseq: 0x1234,
|
||||||
|
msecs: new Date('2011-11-01').getTime(),
|
||||||
|
nsecs: 5678
|
||||||
|
};
|
||||||
|
uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Example: In-place generation of two binary IDs
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Generate two ids in an array
|
||||||
|
const arr = new Array();
|
||||||
|
uuidv1(null, arr, 0); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ]
|
||||||
|
uuidv1(null, arr, 16); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125, 44, 94, 164, 193, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ]
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Version 3
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv3 = require('uuid/v3');
|
||||||
|
|
||||||
|
// Incantations
|
||||||
|
uuidv3(name, namespace);
|
||||||
|
uuidv3(name, namespace, buffer);
|
||||||
|
uuidv3(name, namespace, buffer, offset);
|
||||||
|
```
|
||||||
|
|
||||||
|
Generate and return a RFC4122 v3 UUID.
|
||||||
|
|
||||||
|
* `name` - (String | Array[]) "name" to create UUID with
|
||||||
|
* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values
|
||||||
|
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
||||||
|
* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0
|
||||||
|
|
||||||
|
Returns `buffer`, if specified, otherwise the string form of the UUID
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
uuidv3('hello world', MY_NAMESPACE); // ⇨ '042ffd34-d989-321c-ad06-f60826172424'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Version 4
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv4 = require('uuid/v4')
|
||||||
|
|
||||||
|
// Incantations
|
||||||
|
uuidv4();
|
||||||
|
uuidv4(options);
|
||||||
|
uuidv4(options, buffer, offset);
|
||||||
|
```
|
||||||
|
|
||||||
|
Generate and return a RFC4122 v4 UUID.
|
||||||
|
|
||||||
|
* `options` - (Object) Optional uuid state to apply. Properties may include:
|
||||||
|
* `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values
|
||||||
|
* `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255)
|
||||||
|
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
||||||
|
* `offset` - (Number) Starting index in `buffer` at which to begin writing.
|
||||||
|
|
||||||
|
Returns `buffer`, if specified, otherwise the string form of the UUID
|
||||||
|
|
||||||
|
Example: Generate string UUID with predefined `random` values
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const v4options = {
|
||||||
|
random: [
|
||||||
|
0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
|
||||||
|
0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
|
||||||
|
]
|
||||||
|
};
|
||||||
|
uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Example: Generate two IDs in a single buffer
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const buffer = new Array();
|
||||||
|
uuidv4(null, buffer, 0); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109 ]
|
||||||
|
uuidv4(null, buffer, 16); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109, 27, 157, 107, 205, 187, 253, 75, 45, 155, 93, 171, 141, 251, 189, 75, 237 ]
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Version 5
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const uuidv5 = require('uuid/v5');
|
||||||
|
|
||||||
|
// Incantations
|
||||||
|
uuidv5(name, namespace);
|
||||||
|
uuidv5(name, namespace, buffer);
|
||||||
|
uuidv5(name, namespace, buffer, offset);
|
||||||
|
```
|
||||||
|
|
||||||
|
Generate and return a RFC4122 v5 UUID.
|
||||||
|
|
||||||
|
* `name` - (String | Array[]) "name" to create UUID with
|
||||||
|
* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values
|
||||||
|
* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
|
||||||
|
* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0
|
||||||
|
|
||||||
|
Returns `buffer`, if specified, otherwise the string form of the UUID
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
uuidv5('hello world', MY_NAMESPACE); // ⇨ '9f282611-e0fd-5650-8953-89c8e342da0b'
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Command Line
|
||||||
|
|
||||||
|
UUIDs can be generated from the command line with the `uuid` command.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ uuid
|
||||||
|
ddeb27fb-d9a0-4624-be4d-4615062daed4
|
||||||
|
|
||||||
|
$ uuid v1
|
||||||
|
02d37060-d446-11e7-a9fa-7bdae751ebe1
|
||||||
|
```
|
||||||
|
|
||||||
|
Type `uuid --help` for usage details
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
----
|
||||||
|
Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd)
|
65
node_modules/uuid/bin/uuid
generated
vendored
Normal file
65
node_modules/uuid/bin/uuid
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
var assert = require('assert');
|
||||||
|
|
||||||
|
function usage() {
|
||||||
|
console.log('Usage:');
|
||||||
|
console.log(' uuid');
|
||||||
|
console.log(' uuid v1');
|
||||||
|
console.log(' uuid v3 <name> <namespace uuid>');
|
||||||
|
console.log(' uuid v4');
|
||||||
|
console.log(' uuid v5 <name> <namespace uuid>');
|
||||||
|
console.log(' uuid --help');
|
||||||
|
console.log('\nNote: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122');
|
||||||
|
}
|
||||||
|
|
||||||
|
var args = process.argv.slice(2);
|
||||||
|
|
||||||
|
if (args.indexOf('--help') >= 0) {
|
||||||
|
usage();
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
var version = args.shift() || 'v4';
|
||||||
|
|
||||||
|
switch (version) {
|
||||||
|
case 'v1':
|
||||||
|
var uuidV1 = require('../v1');
|
||||||
|
console.log(uuidV1());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'v3':
|
||||||
|
var uuidV3 = require('../v3');
|
||||||
|
|
||||||
|
var name = args.shift();
|
||||||
|
var namespace = args.shift();
|
||||||
|
assert(name != null, 'v3 name not specified');
|
||||||
|
assert(namespace != null, 'v3 namespace not specified');
|
||||||
|
|
||||||
|
if (namespace == 'URL') namespace = uuidV3.URL;
|
||||||
|
if (namespace == 'DNS') namespace = uuidV3.DNS;
|
||||||
|
|
||||||
|
console.log(uuidV3(name, namespace));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'v4':
|
||||||
|
var uuidV4 = require('../v4');
|
||||||
|
console.log(uuidV4());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'v5':
|
||||||
|
var uuidV5 = require('../v5');
|
||||||
|
|
||||||
|
var name = args.shift();
|
||||||
|
var namespace = args.shift();
|
||||||
|
assert(name != null, 'v5 name not specified');
|
||||||
|
assert(namespace != null, 'v5 namespace not specified');
|
||||||
|
|
||||||
|
if (namespace == 'URL') namespace = uuidV5.URL;
|
||||||
|
if (namespace == 'DNS') namespace = uuidV5.DNS;
|
||||||
|
|
||||||
|
console.log(uuidV5(name, namespace));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
usage();
|
||||||
|
process.exit(1);
|
||||||
|
}
|
8
node_modules/uuid/index.js
generated
vendored
Normal file
8
node_modules/uuid/index.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
var v1 = require('./v1');
|
||||||
|
var v4 = require('./v4');
|
||||||
|
|
||||||
|
var uuid = v4;
|
||||||
|
uuid.v1 = v1;
|
||||||
|
uuid.v4 = v4;
|
||||||
|
|
||||||
|
module.exports = uuid;
|
24
node_modules/uuid/lib/bytesToUuid.js
generated
vendored
Normal file
24
node_modules/uuid/lib/bytesToUuid.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Convert array of 16 byte values to UUID string format of the form:
|
||||||
|
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
||||||
|
*/
|
||||||
|
var byteToHex = [];
|
||||||
|
for (var i = 0; i < 256; ++i) {
|
||||||
|
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function bytesToUuid(buf, offset) {
|
||||||
|
var i = offset || 0;
|
||||||
|
var bth = byteToHex;
|
||||||
|
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
||||||
|
return ([bth[buf[i++]], bth[buf[i++]],
|
||||||
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
|
bth[buf[i++]], bth[buf[i++]], '-',
|
||||||
|
bth[buf[i++]], bth[buf[i++]],
|
||||||
|
bth[buf[i++]], bth[buf[i++]],
|
||||||
|
bth[buf[i++]], bth[buf[i++]]]).join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = bytesToUuid;
|
216
node_modules/uuid/lib/md5-browser.js
generated
vendored
Normal file
216
node_modules/uuid/lib/md5-browser.js
generated
vendored
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
/*
|
||||||
|
* Browser-compatible JavaScript MD5
|
||||||
|
*
|
||||||
|
* Modification of JavaScript MD5
|
||||||
|
* https://github.com/blueimp/JavaScript-MD5
|
||||||
|
*
|
||||||
|
* Copyright 2011, Sebastian Tschan
|
||||||
|
* https://blueimp.net
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
*
|
||||||
|
* Based on
|
||||||
|
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||||
|
* Digest Algorithm, as defined in RFC 1321.
|
||||||
|
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||||
|
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||||
|
* Distributed under the BSD License
|
||||||
|
* See http://pajhome.org.uk/crypt/md5 for more info.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
function md5(bytes) {
|
||||||
|
if (typeof(bytes) == 'string') {
|
||||||
|
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||||
|
bytes = new Array(msg.length);
|
||||||
|
for (var i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return md5ToHexEncodedArray(
|
||||||
|
wordsToMd5(
|
||||||
|
bytesToWords(bytes)
|
||||||
|
, bytes.length * 8)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert an array of little-endian words to an array of bytes
|
||||||
|
*/
|
||||||
|
function md5ToHexEncodedArray(input) {
|
||||||
|
var i;
|
||||||
|
var x;
|
||||||
|
var output = [];
|
||||||
|
var length32 = input.length * 32;
|
||||||
|
var hexTab = '0123456789abcdef';
|
||||||
|
var hex;
|
||||||
|
|
||||||
|
for (i = 0; i < length32; i += 8) {
|
||||||
|
x = (input[i >> 5] >>> (i % 32)) & 0xFF;
|
||||||
|
|
||||||
|
hex = parseInt(hexTab.charAt((x >>> 4) & 0x0F) + hexTab.charAt(x & 0x0F), 16);
|
||||||
|
|
||||||
|
output.push(hex);
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
||||||
|
*/
|
||||||
|
function wordsToMd5(x, len) {
|
||||||
|
/* append padding */
|
||||||
|
x[len >> 5] |= 0x80 << (len % 32);
|
||||||
|
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
||||||
|
|
||||||
|
var i;
|
||||||
|
var olda;
|
||||||
|
var oldb;
|
||||||
|
var oldc;
|
||||||
|
var oldd;
|
||||||
|
var a = 1732584193;
|
||||||
|
var b = -271733879;
|
||||||
|
var c = -1732584194;
|
||||||
|
|
||||||
|
var d = 271733878;
|
||||||
|
|
||||||
|
for (i = 0; i < x.length; i += 16) {
|
||||||
|
olda = a;
|
||||||
|
oldb = b;
|
||||||
|
oldc = c;
|
||||||
|
oldd = d;
|
||||||
|
|
||||||
|
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
||||||
|
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
||||||
|
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
||||||
|
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
||||||
|
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
||||||
|
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
||||||
|
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
||||||
|
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
||||||
|
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
||||||
|
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
||||||
|
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
||||||
|
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
||||||
|
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
||||||
|
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
||||||
|
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
||||||
|
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
||||||
|
|
||||||
|
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
||||||
|
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
||||||
|
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
||||||
|
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
||||||
|
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
||||||
|
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
||||||
|
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
||||||
|
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
||||||
|
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
||||||
|
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
||||||
|
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
||||||
|
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
||||||
|
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
||||||
|
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
||||||
|
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
||||||
|
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
||||||
|
|
||||||
|
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
||||||
|
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
||||||
|
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
||||||
|
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
||||||
|
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
||||||
|
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
||||||
|
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
||||||
|
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
||||||
|
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
||||||
|
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
||||||
|
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
||||||
|
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
||||||
|
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
||||||
|
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
||||||
|
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
||||||
|
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
||||||
|
|
||||||
|
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
||||||
|
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
||||||
|
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
||||||
|
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
||||||
|
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
||||||
|
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
||||||
|
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
||||||
|
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
||||||
|
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
||||||
|
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
||||||
|
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
||||||
|
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
||||||
|
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
||||||
|
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
||||||
|
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
||||||
|
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
||||||
|
|
||||||
|
a = safeAdd(a, olda);
|
||||||
|
b = safeAdd(b, oldb);
|
||||||
|
c = safeAdd(c, oldc);
|
||||||
|
d = safeAdd(d, oldd);
|
||||||
|
}
|
||||||
|
return [a, b, c, d];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert an array bytes to an array of little-endian words
|
||||||
|
* Characters >255 have their high-byte silently ignored.
|
||||||
|
*/
|
||||||
|
function bytesToWords(input) {
|
||||||
|
var i;
|
||||||
|
var output = [];
|
||||||
|
output[(input.length >> 2) - 1] = undefined;
|
||||||
|
for (i = 0; i < output.length; i += 1) {
|
||||||
|
output[i] = 0;
|
||||||
|
}
|
||||||
|
var length8 = input.length * 8;
|
||||||
|
for (i = 0; i < length8; i += 8) {
|
||||||
|
output[i >> 5] |= (input[(i / 8)] & 0xFF) << (i % 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||||
|
* to work around bugs in some JS interpreters.
|
||||||
|
*/
|
||||||
|
function safeAdd(x, y) {
|
||||||
|
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
||||||
|
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||||
|
return (msw << 16) | (lsw & 0xFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bitwise rotate a 32-bit number to the left.
|
||||||
|
*/
|
||||||
|
function bitRotateLeft(num, cnt) {
|
||||||
|
return (num << cnt) | (num >>> (32 - cnt));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These functions implement the four basic operations the algorithm uses.
|
||||||
|
*/
|
||||||
|
function md5cmn(q, a, b, x, s, t) {
|
||||||
|
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
||||||
|
}
|
||||||
|
function md5ff(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn((b & c) | ((~b) & d), a, b, x, s, t);
|
||||||
|
}
|
||||||
|
function md5gg(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn((b & d) | (c & (~d)), a, b, x, s, t);
|
||||||
|
}
|
||||||
|
function md5hh(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
||||||
|
}
|
||||||
|
function md5ii(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn(c ^ (b | (~d)), a, b, x, s, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = md5;
|
25
node_modules/uuid/lib/md5.js
generated
vendored
Normal file
25
node_modules/uuid/lib/md5.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var crypto = require('crypto');
|
||||||
|
|
||||||
|
function md5(bytes) {
|
||||||
|
if (typeof Buffer.from === 'function') {
|
||||||
|
// Modern Buffer API
|
||||||
|
if (Array.isArray(bytes)) {
|
||||||
|
bytes = Buffer.from(bytes);
|
||||||
|
} else if (typeof bytes === 'string') {
|
||||||
|
bytes = Buffer.from(bytes, 'utf8');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Pre-v4 Buffer API
|
||||||
|
if (Array.isArray(bytes)) {
|
||||||
|
bytes = new Buffer(bytes);
|
||||||
|
} else if (typeof bytes === 'string') {
|
||||||
|
bytes = new Buffer(bytes, 'utf8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return crypto.createHash('md5').update(bytes).digest();
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = md5;
|
34
node_modules/uuid/lib/rng-browser.js
generated
vendored
Normal file
34
node_modules/uuid/lib/rng-browser.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Unique ID creation requires a high quality random # generator. In the
|
||||||
|
// browser this is a little complicated due to unknown quality of Math.random()
|
||||||
|
// and inconsistent support for the `crypto` API. We do the best we can via
|
||||||
|
// feature-detection
|
||||||
|
|
||||||
|
// getRandomValues needs to be invoked in a context where "this" is a Crypto
|
||||||
|
// implementation. Also, find the complete implementation of crypto on IE11.
|
||||||
|
var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
|
||||||
|
(typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
|
||||||
|
|
||||||
|
if (getRandomValues) {
|
||||||
|
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
||||||
|
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
||||||
|
|
||||||
|
module.exports = function whatwgRNG() {
|
||||||
|
getRandomValues(rnds8);
|
||||||
|
return rnds8;
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// Math.random()-based (RNG)
|
||||||
|
//
|
||||||
|
// If all else fails, use Math.random(). It's fast, but is of unspecified
|
||||||
|
// quality.
|
||||||
|
var rnds = new Array(16);
|
||||||
|
|
||||||
|
module.exports = function mathRNG() {
|
||||||
|
for (var i = 0, r; i < 16; i++) {
|
||||||
|
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
||||||
|
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rnds;
|
||||||
|
};
|
||||||
|
}
|
8
node_modules/uuid/lib/rng.js
generated
vendored
Normal file
8
node_modules/uuid/lib/rng.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Unique ID creation requires a high quality random # generator. In node.js
|
||||||
|
// this is pretty straight-forward - we use the crypto API.
|
||||||
|
|
||||||
|
var crypto = require('crypto');
|
||||||
|
|
||||||
|
module.exports = function nodeRNG() {
|
||||||
|
return crypto.randomBytes(16);
|
||||||
|
};
|
89
node_modules/uuid/lib/sha1-browser.js
generated
vendored
Normal file
89
node_modules/uuid/lib/sha1-browser.js
generated
vendored
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
// Adapted from Chris Veness' SHA1 code at
|
||||||
|
// http://www.movable-type.co.uk/scripts/sha1.html
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
function f(s, x, y, z) {
|
||||||
|
switch (s) {
|
||||||
|
case 0: return (x & y) ^ (~x & z);
|
||||||
|
case 1: return x ^ y ^ z;
|
||||||
|
case 2: return (x & y) ^ (x & z) ^ (y & z);
|
||||||
|
case 3: return x ^ y ^ z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ROTL(x, n) {
|
||||||
|
return (x << n) | (x>>> (32 - n));
|
||||||
|
}
|
||||||
|
|
||||||
|
function sha1(bytes) {
|
||||||
|
var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
||||||
|
var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
||||||
|
|
||||||
|
if (typeof(bytes) == 'string') {
|
||||||
|
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||||
|
bytes = new Array(msg.length);
|
||||||
|
for (var i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
bytes.push(0x80);
|
||||||
|
|
||||||
|
var l = bytes.length/4 + 2;
|
||||||
|
var N = Math.ceil(l/16);
|
||||||
|
var M = new Array(N);
|
||||||
|
|
||||||
|
for (var i=0; i<N; i++) {
|
||||||
|
M[i] = new Array(16);
|
||||||
|
for (var j=0; j<16; j++) {
|
||||||
|
M[i][j] =
|
||||||
|
bytes[i * 64 + j * 4] << 24 |
|
||||||
|
bytes[i * 64 + j * 4 + 1] << 16 |
|
||||||
|
bytes[i * 64 + j * 4 + 2] << 8 |
|
||||||
|
bytes[i * 64 + j * 4 + 3];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
M[N - 1][14] = ((bytes.length - 1) * 8) /
|
||||||
|
Math.pow(2, 32); M[N - 1][14] = Math.floor(M[N - 1][14]);
|
||||||
|
M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;
|
||||||
|
|
||||||
|
for (var i=0; i<N; i++) {
|
||||||
|
var W = new Array(80);
|
||||||
|
|
||||||
|
for (var t=0; t<16; t++) W[t] = M[i][t];
|
||||||
|
for (var t=16; t<80; t++) {
|
||||||
|
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var a = H[0];
|
||||||
|
var b = H[1];
|
||||||
|
var c = H[2];
|
||||||
|
var d = H[3];
|
||||||
|
var e = H[4];
|
||||||
|
|
||||||
|
for (var t=0; t<80; t++) {
|
||||||
|
var s = Math.floor(t/20);
|
||||||
|
var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
||||||
|
e = d;
|
||||||
|
d = c;
|
||||||
|
c = ROTL(b, 30) >>> 0;
|
||||||
|
b = a;
|
||||||
|
a = T;
|
||||||
|
}
|
||||||
|
|
||||||
|
H[0] = (H[0] + a) >>> 0;
|
||||||
|
H[1] = (H[1] + b) >>> 0;
|
||||||
|
H[2] = (H[2] + c) >>> 0;
|
||||||
|
H[3] = (H[3] + d) >>> 0;
|
||||||
|
H[4] = (H[4] + e) >>> 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff,
|
||||||
|
H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff,
|
||||||
|
H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff,
|
||||||
|
H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff,
|
||||||
|
H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = sha1;
|
25
node_modules/uuid/lib/sha1.js
generated
vendored
Normal file
25
node_modules/uuid/lib/sha1.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var crypto = require('crypto');
|
||||||
|
|
||||||
|
function sha1(bytes) {
|
||||||
|
if (typeof Buffer.from === 'function') {
|
||||||
|
// Modern Buffer API
|
||||||
|
if (Array.isArray(bytes)) {
|
||||||
|
bytes = Buffer.from(bytes);
|
||||||
|
} else if (typeof bytes === 'string') {
|
||||||
|
bytes = Buffer.from(bytes, 'utf8');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Pre-v4 Buffer API
|
||||||
|
if (Array.isArray(bytes)) {
|
||||||
|
bytes = new Buffer(bytes);
|
||||||
|
} else if (typeof bytes === 'string') {
|
||||||
|
bytes = new Buffer(bytes, 'utf8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return crypto.createHash('sha1').update(bytes).digest();
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = sha1;
|
57
node_modules/uuid/lib/v35.js
generated
vendored
Normal file
57
node_modules/uuid/lib/v35.js
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
var bytesToUuid = require('./bytesToUuid');
|
||||||
|
|
||||||
|
function uuidToBytes(uuid) {
|
||||||
|
// Note: We assume we're being passed a valid uuid string
|
||||||
|
var bytes = [];
|
||||||
|
uuid.replace(/[a-fA-F0-9]{2}/g, function(hex) {
|
||||||
|
bytes.push(parseInt(hex, 16));
|
||||||
|
});
|
||||||
|
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
function stringToBytes(str) {
|
||||||
|
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
||||||
|
var bytes = new Array(str.length);
|
||||||
|
for (var i = 0; i < str.length; i++) {
|
||||||
|
bytes[i] = str.charCodeAt(i);
|
||||||
|
}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function(name, version, hashfunc) {
|
||||||
|
var generateUUID = function(value, namespace, buf, offset) {
|
||||||
|
var off = buf && offset || 0;
|
||||||
|
|
||||||
|
if (typeof(value) == 'string') value = stringToBytes(value);
|
||||||
|
if (typeof(namespace) == 'string') namespace = uuidToBytes(namespace);
|
||||||
|
|
||||||
|
if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');
|
||||||
|
if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values');
|
||||||
|
|
||||||
|
// Per 4.3
|
||||||
|
var bytes = hashfunc(namespace.concat(value));
|
||||||
|
bytes[6] = (bytes[6] & 0x0f) | version;
|
||||||
|
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
||||||
|
|
||||||
|
if (buf) {
|
||||||
|
for (var idx = 0; idx < 16; ++idx) {
|
||||||
|
buf[off+idx] = bytes[idx];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf || bytesToUuid(bytes);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Function#name is not settable on some platforms (#270)
|
||||||
|
try {
|
||||||
|
generateUUID.name = name;
|
||||||
|
} catch (err) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pre-defined namespaces, per Appendix C
|
||||||
|
generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
||||||
|
generateUUID.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
||||||
|
|
||||||
|
return generateUUID;
|
||||||
|
};
|
99
node_modules/uuid/package.json
generated
vendored
Normal file
99
node_modules/uuid/package.json
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"uuid@3.3.3",
|
||||||
|
"C:\\users\\timheuer\\documents\\github\\setup-msbuild"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_from": "uuid@3.3.3",
|
||||||
|
"_id": "uuid@3.3.3",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==",
|
||||||
|
"_location": "/uuid",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "uuid@3.3.3",
|
||||||
|
"name": "uuid",
|
||||||
|
"escapedName": "uuid",
|
||||||
|
"rawSpec": "3.3.3",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "3.3.3"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/@actions/tool-cache",
|
||||||
|
"/request"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||||
|
"_spec": "3.3.3",
|
||||||
|
"_where": "C:\\users\\timheuer\\documents\\github\\setup-msbuild",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "./bin/uuid"
|
||||||
|
},
|
||||||
|
"browser": {
|
||||||
|
"./lib/rng.js": "./lib/rng-browser.js",
|
||||||
|
"./lib/sha1.js": "./lib/sha1-browser.js",
|
||||||
|
"./lib/md5.js": "./lib/md5-browser.js"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/kelektiv/node-uuid/issues"
|
||||||
|
},
|
||||||
|
"commitlint": {
|
||||||
|
"extends": [
|
||||||
|
"@commitlint/config-conventional"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Robert Kieffer",
|
||||||
|
"email": "robert@broofa.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Christoph Tavan",
|
||||||
|
"email": "dev@tavan.de"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "AJ ONeal",
|
||||||
|
"email": "coolaj86@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Vincent Voyer",
|
||||||
|
"email": "vincent@zeroload.net"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Roman Shtylman",
|
||||||
|
"email": "shtylman@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "RFC4122 (v1, v4, and v5) UUIDs",
|
||||||
|
"devDependencies": {
|
||||||
|
"@commitlint/cli": "8.1.0",
|
||||||
|
"@commitlint/config-conventional": "8.1.0",
|
||||||
|
"eslint": "6.2.0",
|
||||||
|
"husky": "3.0.4",
|
||||||
|
"mocha": "6.2.0",
|
||||||
|
"runmd": "1.2.1",
|
||||||
|
"standard-version": "7.0.0"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/kelektiv/node-uuid#readme",
|
||||||
|
"keywords": [
|
||||||
|
"uuid",
|
||||||
|
"guid",
|
||||||
|
"rfc4122"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"name": "uuid",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/kelektiv/node-uuid.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"commitmsg": "commitlint -E HUSKY_GIT_PARAMS",
|
||||||
|
"md": "runmd --watch --output=README.md README_js.md",
|
||||||
|
"prepare": "runmd --output=README.md README_js.md",
|
||||||
|
"release": "standard-version",
|
||||||
|
"test": "mocha test/test.js"
|
||||||
|
},
|
||||||
|
"version": "3.3.3"
|
||||||
|
}
|
109
node_modules/uuid/v1.js
generated
vendored
Normal file
109
node_modules/uuid/v1.js
generated
vendored
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
var rng = require('./lib/rng');
|
||||||
|
var bytesToUuid = require('./lib/bytesToUuid');
|
||||||
|
|
||||||
|
// **`v1()` - Generate time-based UUID**
|
||||||
|
//
|
||||||
|
// Inspired by https://github.com/LiosK/UUID.js
|
||||||
|
// and http://docs.python.org/library/uuid.html
|
||||||
|
|
||||||
|
var _nodeId;
|
||||||
|
var _clockseq;
|
||||||
|
|
||||||
|
// Previous uuid creation time
|
||||||
|
var _lastMSecs = 0;
|
||||||
|
var _lastNSecs = 0;
|
||||||
|
|
||||||
|
// See https://github.com/broofa/node-uuid for API details
|
||||||
|
function v1(options, buf, offset) {
|
||||||
|
var i = buf && offset || 0;
|
||||||
|
var b = buf || [];
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
var node = options.node || _nodeId;
|
||||||
|
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
|
||||||
|
|
||||||
|
// node and clockseq need to be initialized to random values if they're not
|
||||||
|
// specified. We do this lazily to minimize issues related to insufficient
|
||||||
|
// system entropy. See #189
|
||||||
|
if (node == null || clockseq == null) {
|
||||||
|
var seedBytes = rng();
|
||||||
|
if (node == null) {
|
||||||
|
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
||||||
|
node = _nodeId = [
|
||||||
|
seedBytes[0] | 0x01,
|
||||||
|
seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
if (clockseq == null) {
|
||||||
|
// Per 4.2.2, randomize (14 bit) clockseq
|
||||||
|
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
||||||
|
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
||||||
|
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
||||||
|
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
||||||
|
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
|
||||||
|
|
||||||
|
// Per 4.2.1.2, use count of uuid's generated during the current clock
|
||||||
|
// cycle to simulate higher resolution clock
|
||||||
|
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
|
||||||
|
|
||||||
|
// Time since last uuid creation (in msecs)
|
||||||
|
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
|
||||||
|
|
||||||
|
// Per 4.2.1.2, Bump clockseq on clock regression
|
||||||
|
if (dt < 0 && options.clockseq === undefined) {
|
||||||
|
clockseq = clockseq + 1 & 0x3fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
||||||
|
// time interval
|
||||||
|
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
||||||
|
nsecs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Per 4.2.1.2 Throw error if too many uuids are requested
|
||||||
|
if (nsecs >= 10000) {
|
||||||
|
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
|
||||||
|
}
|
||||||
|
|
||||||
|
_lastMSecs = msecs;
|
||||||
|
_lastNSecs = nsecs;
|
||||||
|
_clockseq = clockseq;
|
||||||
|
|
||||||
|
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
||||||
|
msecs += 12219292800000;
|
||||||
|
|
||||||
|
// `time_low`
|
||||||
|
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
||||||
|
b[i++] = tl >>> 24 & 0xff;
|
||||||
|
b[i++] = tl >>> 16 & 0xff;
|
||||||
|
b[i++] = tl >>> 8 & 0xff;
|
||||||
|
b[i++] = tl & 0xff;
|
||||||
|
|
||||||
|
// `time_mid`
|
||||||
|
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
|
||||||
|
b[i++] = tmh >>> 8 & 0xff;
|
||||||
|
b[i++] = tmh & 0xff;
|
||||||
|
|
||||||
|
// `time_high_and_version`
|
||||||
|
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
||||||
|
b[i++] = tmh >>> 16 & 0xff;
|
||||||
|
|
||||||
|
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
||||||
|
b[i++] = clockseq >>> 8 | 0x80;
|
||||||
|
|
||||||
|
// `clock_seq_low`
|
||||||
|
b[i++] = clockseq & 0xff;
|
||||||
|
|
||||||
|
// `node`
|
||||||
|
for (var n = 0; n < 6; ++n) {
|
||||||
|
b[i + n] = node[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf ? buf : bytesToUuid(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = v1;
|
4
node_modules/uuid/v3.js
generated
vendored
Normal file
4
node_modules/uuid/v3.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
var v35 = require('./lib/v35.js');
|
||||||
|
var md5 = require('./lib/md5');
|
||||||
|
|
||||||
|
module.exports = v35('v3', 0x30, md5);
|
29
node_modules/uuid/v4.js
generated
vendored
Normal file
29
node_modules/uuid/v4.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
var rng = require('./lib/rng');
|
||||||
|
var bytesToUuid = require('./lib/bytesToUuid');
|
||||||
|
|
||||||
|
function v4(options, buf, offset) {
|
||||||
|
var i = buf && offset || 0;
|
||||||
|
|
||||||
|
if (typeof(options) == 'string') {
|
||||||
|
buf = options === 'binary' ? new Array(16) : null;
|
||||||
|
options = null;
|
||||||
|
}
|
||||||
|
options = options || {};
|
||||||
|
|
||||||
|
var rnds = options.random || (options.rng || rng)();
|
||||||
|
|
||||||
|
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
||||||
|
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
||||||
|
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
||||||
|
|
||||||
|
// Copy bytes to buffer, if provided
|
||||||
|
if (buf) {
|
||||||
|
for (var ii = 0; ii < 16; ++ii) {
|
||||||
|
buf[i + ii] = rnds[ii];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf || bytesToUuid(rnds);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = v4;
|
3
node_modules/uuid/v5.js
generated
vendored
Normal file
3
node_modules/uuid/v5.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
var v35 = require('./lib/v35.js');
|
||||||
|
var sha1 = require('./lib/sha1');
|
||||||
|
module.exports = v35('v5', 0x50, sha1);
|
Loading…
Reference in New Issue
Block a user