Install Hurl with npm.

This commit is contained in:
jcamiel 2022-04-29 10:11:52 +02:00 committed by jcamiel
parent e8fc1800f2
commit a1488db335
12 changed files with 1244 additions and 0 deletions

2
.gitignore vendored
View File

@ -6,4 +6,6 @@ target/
.idea/
.venv/
build/
node_modules/
**/npm/bin/
integration/*.log

89
contrib/npm/README.md Normal file
View File

@ -0,0 +1,89 @@
# Hurl
Hurl is a command line tool written in Rust that runs <b>HTTP requests</b> defined in a simple <b>plain text format</b>.
The `@orangeopensource/hurl` package allows JavaScript developers to use Hurl in npm scripts.
Hurl can perform requests, capture values and evaluate queries on headers and body response. Hurl is very
versatile: it can be used for both <b>fetching data</b> and <b>testing HTTP</b> sessions.
```hurl
# Get home:
GET https://example.net
HTTP/1.1 200
[Captures]
csrf_token: xpath "string(//meta[@name='_csrf_token']/@content)"
# Do login!
POST https://example.net/login?user=toto&password=1234
X-CSRF-TOKEN: {{csrf_token}}
HTTP/1.1 302
```
Hurl can run HTTP requests but can also be used to <b>test HTTP responses</b>.
Different types of queries and predicates are supported, from [XPath](https://en.wikipedia.org/wiki/XPath) and
[JSONPath](https://goessner.net/articles/JsonPath/) on body response, to assert on status code and response headers.
It is well adapted for <b>REST / JSON apis</b>
```hurl
POST https://api.example.net/tests
{
"id": "4568",
"evaluate": true
}
HTTP/1.1 200
[Asserts]
header "X-Frame-Options" == "SAMEORIGIN"
jsonpath "$.status" == "RUNNING" # Check the status code
jsonpath "$.tests" count == 25 # Check the number of items
jsonpath "$.id" matches /\d{4}/ # Check the format of the id
```
and <b>HTML content</b>
```hurl
GET https://example.net
HTTP/1.1 200
[Asserts]
xpath "normalize-space(//head/title)" == "Hello world!"
```
## Installation
```
npm install --save-dev @orangeopensource/hurl
```
This will download the appropriate Hurl binaries for your platform. `hurlmft` binary is also installed, which
you can use for [exporting Hurl files to JSON files](https://hurl.dev/docs/frequently-asked-questions.html#how-can-i-use-my-hurl-files-outside-hurl).
## Usage
In your `package.json` file:
```
{
"name": "sample-app",
"scripts": {
"test": "hurl --test --glob test/*.hurl",
...
},
...
```
## Documentation
See <https://hurl.dev>
## Samples
See <https://hurl.dev/docs/samples.html>

113
contrib/npm/archive.js Normal file
View File

@ -0,0 +1,113 @@
/*
* Hurl (https://hurl.dev)
* Copyright (C) 2022 Orange
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
const fs = require("fs");
const path = require("path");
const crypto = require("crypto");
const rimraf = require("rimraf");
const axios = require("axios");
const tar = require("tar");
const extract = require("extract-zip")
/**
* Install executables in a folder.
* @param url url of a tar archive (or zip archive on Windows) containing executable
* @param dir installation folder
* @param checksum SHA256 checksum of the archive
*/
function install(url, dir, checksum) {
console.log(`Downloading release from ${url} to ${dir}`);
// Install a fresh bin directory.
if (fs.existsSync(dir)) {
rimraf.sync(dir);
}
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
axios({url: url, responseType: "stream" })
.then(res => {
return new Promise((resolve, reject) => {
// Linux, macOS archives are tar.gz files.
if (url.endsWith(".tar.gz")) {
const archive = path.join(dir, "archive.tar.gz");
const sink = res.data.pipe(
fs.createWriteStream(archive)
)
sink.on("finish", () => {
verifyCheckSum(archive, checksum);
tar.x({ strip: 1, C: dir, file: archive });
resolve();
});
sink.on("error", err => reject(err));
}
// Windows archive is a zip archive.
else if (url.endsWith(".zip")) {
const archive = path.join(dir, "archive.zip");
const sink = res.data.pipe(
fs.createWriteStream(archive)
)
sink.on("finish", () => {
verifyCheckSum(archive, checksum);
extract(archive, {dir: dir})
.then( () => resolve())
.catch( err => reject(err));
});
sink.on("error", err => reject(err));
} else {
console.error("Error unsupported archive");
process.exit(1);
}
});
})
.then(() => {
console.log(`Archive has been installed to ${dir}!`);
})
.catch(e => {
console.error(`Error fetching release: ${e.message}`);
process.exit(1);
});
}
/**
* Exits process with error if the SHA256 checksum of file is not equal to the expected checksum.
* @param file input file
* @param expectedChecksum expected checksum
*/
function verifyCheckSum(file, expectedChecksum) {
const checksum = sha256(file);
if (expectedChecksum !== checksum) {
console.error(`Downloaded archive checksum didn't match the expected checksum (actual: ${checksum}, expected ${expectedChecksum}`);
process.exit(1)
}
}
/**
* Returns the SHA256 checksum of a file.
* @param file input file
* @returns checksum as a string of hex digits
*/
function sha256(file) {
const data = fs.readFileSync(file);
return crypto.createHash("sha256").update(data).digest("hex").toLowerCase();
}
exports.install = install;

56
contrib/npm/bin.js Normal file
View File

@ -0,0 +1,56 @@
/*
* Hurl (https://hurl.dev)
* Copyright (C) 2022 Orange
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
const path = require("path");
const child_process = require("child_process");
const os = require("os");
const fs = require("fs");
/**
* Execute a binary by name uniformly on Windows and Unix*
* @param name name of the binary (without extension)
*/
function run(name) {
const execPath = path.join(__dirname, "bin", os.platform() === "win32" ? name + ".exe" : name);
try {
const result = child_process.spawnSync(
execPath,
process.argv.slice(2),
{ stdio: "inherit" },
);
if (result.status !== 0) {
throwIfNoExePath(execPath);
}
process.exitCode = result.status;
} catch (err) {
throwIfNoExePath(execPath);
throw err;
}
}
function throwIfNoExePath(execPath) {
if (!fs.existsSync(execPath)) {
throw new Error("Could not find exe at path '" + exePath + "'. Please ensure the hurl 'postinstall' script runs on install.");
}
}
exports.run = run;

340
contrib/npm/docs/hurl.1 Normal file
View File

@ -0,0 +1,340 @@
.TH hurl 1 "15 Feb 2022" "hurl 1.7.0-snapshot" " Hurl Manual"
.SH NAME
hurl - run and test HTTP requests.
.SH SYNOPSIS
.B hurl
[options] [FILE...]
.SH DESCRIPTION
.B Hurl
is an HTTP client that performs HTTP requests defined in a simple plain text format.
Hurl is very versatile, it enables to chain HTTP requests, capture values from HTTP responses and make asserts.
$ hurl session.hurl
If no input-files are specified, input is read from stdin.
$ echo GET http://httpbin.org/get | hurl
{
"args": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip",
"Content-Length": "0",
"Host": "httpbin.org",
"User-Agent": "hurl/0.99.10",
"X-Amzn-Trace-Id": "Root=1-5eedf4c7-520814d64e2f9249ea44e0"
},
"origin": "1.2.3.4",
"url": "http://httpbin.org/get"
}
Output goes to stdout by default. For output to a file, use the -o option:
$ hurl -o output input.hurl
By default, Hurl executes all HTTP requests and outputs the response body of the last HTTP call.
.SH HURL FILE FORMAT
The Hurl file format is fully documented in \fIhttps://hurl.dev/docs/hurl-file.html\fP
It consists of one or several HTTP requests
GET http:/example.net/endpoint1
GET http:/example.net/endpoint2
.IP "Capturing values"
A value from an HTTP response can be-reused for successive HTTP requests.
A typical example occurs with csrf tokens.
GET https://example.net
HTTP/1.1 200
# Capture the CSRF token value from html body.
[Captures]
csrf_token: xpath "normalize-space(//meta[@name='_csrf_token']/@content)"
# Do the login !
POST https://example.net/login?user=toto&password=1234
X-CSRF-TOKEN: {{csrf_token}}
.IP "Asserts"
The HTTP response defined in the Hurl session are used to make asserts.
At the minimum, the response includes the asserts on the HTTP version and status code.
GET http:/google.com
HTTP/1.1 301
It can also include asserts on the response headers
GET http:/google.com
HTTP/1.1 301
Location: http://www.google.com
You can also include explicit asserts combining query and predicate
GET http:/google.com
HTTP/1.1 301
[Asserts]
xpath "string(//title)" == "301 Moved"
Thanks to asserts, Hurl can be used as a testing tool to run scenarii.
.SH OPTIONS
Options that exist in curl have exactly the same semantic.
.IP "--cacert "
Tells curl to use the specified certificate file to verify the peer.
The file may contain multiple CA certificates.
The certificate(s) must be in PEM format.
Normally curl is built to use a default file for this, so this option is typically used to alter that default file.
.IP "--color "
Colorize Output
.IP "--compressed "
Request a compressed response using one of the algorithms br, gzip, deflate and automatically decompress the content.
.IP "--connect-timeout <seconds> "
Maximum time in seconds that you allow Hurl's connection to take.
See also \fI-m, --max-time\fP option.
.IP "-b, --cookie <file> "
Read cookies from file (using the Netscape cookie file format).
Combined with \fI-c, --cookie-jar\fP, you can simulate a cookie storage between successive Hurl runs.
.IP "-c, --cookie-jar <file> "
Write cookies to FILE after running the session (only for one session).
The file will be written using the Netscape cookie file format.
Combined with \fI-b, --cookie\fP, you can simulate a cookie storage between successive Hurl runs.
.IP "--fail-at-end "
Continue executing requests to the end of the Hurl file even when an assert error occurs.
By default, Hurl exits after an assert error in the HTTP response.
Note that this option does not affect the behavior with multiple input Hurl files.
All the input files are executed independently. The result of one file does not affect the execution of the other Hurl files.
.IP "--file-root <dir> "
Set root filesystem to import files in Hurl. This is used for both files in multipart form data and request body.
When this is not explicitly defined, the files are relative to the current directory in which Hurl is running.
.IP "-L, --location "
Follow redirect. You can limit the amount of redirects to follow by using the \fI--max-redirs\fP option.
.IP "--glob <glob> "
Specify input files that match the given blob.
Multiple glob flags may be used. This flag supports common Unix glob patterns like *, ? and [].
However, to avoid your shell accidentally expanding glob patterns before Hurl handles them, you must use single quotes or double quotes around each pattern.
.IP "-i, --include "
Include the HTTP headers in the output (last entry).
.IP "--ignore-asserts "
Ignore all asserts defined in the Hurl file.
.IP "-k, --insecure "
This option explicitly allows Hurl to perform "insecure" SSL connections and transfers.
.IP "--interactive "
Stop between requests.
This is similar to a break point, You can then continue (Press C) or quit (Press Q).
.IP "--json "
Output each hurl file result to JSON. The format is very closed to HAR format.
.IP "--max-redirs <num> "
Set maximum number of redirection-followings allowed
By default, the limit is set to 50 redirections. Set this option to -1 to make it unlimited.
.IP "-m, --max-time <seconds> "
Maximum time in seconds that you allow a request/response to take. This is the standard timeout.
See also \fI--connect-timeout\fP option.
.IP "--no-color "
Do not colorize Output
.IP "--no-output "
Suppress output. By default, Hurl outputs the body of the last response.
.IP "--noproxy <no-proxy-list> "
Comma-separated list of hosts which do not use a proxy.
Override value from Environment variable no_proxy.
.IP "-o, --output <file> "
Write output to <file> instead of stdout.
.IP "--progress "
Print filename and status for each test (on stderr)
.IP "-x, --proxy [protocol://]host[:port] "
Use the specified proxy.
.IP "--report-junit <file> "
Generate JUNIT <file>.
If the <file> report already exists, it will be updated with the new test results.
.IP "--report-html <dir> "
Generate HTML report in dir.
If the HTML report already exists, it will be updated with the new test results.
.IP "--summary "
Print test metrics at the end of the run (on stderr)
.IP "--test "
Activate test mode; equals \fI--no-output](#no-output) [--progress](#progress) [--summary\fP
.IP "--to-entry <entry-number> "
Execute Hurl file to ENTRY_NUMBER (starting at 1).
Ignore the remaining of the file. It is useful for debugging a session.
.IP "-u, --user <user:password> "
Add basic Authentication header to each request.
.IP "-A, --user-agent <name> "
Specify the User-Agent string to send to the HTTP server.
.IP "--variable <name=value> "
Define variable (name/value) to be used in Hurl templates.
.IP "--variables-file <file> "
Set properties file in which your define your variables.
Each variable is defined as name=value exactly as with \fI--variable\fP option.
Note that defining a variable twice produces an error.
.IP "-v, --verbose "
Turn on verbose output on standard error stream
Useful for debugging.
A line starting with '>' means data sent by Hurl.
A line staring with '<' means data received by Hurl.
A line starting with '*' means additional info provided by Hurl.
If you only want HTTP headers in the output, -i, --include might be the option you're looking for.
.IP "-h, --help "
Usage help. This lists all current command line options with a short description.
.IP "-V, --version "
Prints version information
.SH ENVIRONMENT
Environment variables can only be specified in lowercase.
Using an environment variable to set the proxy has the same effect as using the \fI-x, --proxy\fP option.
.IP "http_proxy [protocol://]<host>[:port]"
Sets the proxy server to use for HTTP.
.IP "https_proxy [protocol://]<host>[:port]"
Sets the proxy server to use for HTTPS.
.IP "all_proxy [protocol://]<host>[:port]"
Sets the proxy server to use if no protocol-specific proxy is set.
.IP "no_proxy <comma-separated list of hosts>"
list of host names that shouldn't go through any proxy.
.IP "HURL_name value"
Define variable (name/value) to be used in Hurl templates. This is similar than \fI--variable](#variable) and [--variables-file\fP options.
.SH EXIT CODES
.IP "1"
Failed to parse command-line options.
.IP "2"
Input File Parsing Error.
.IP "3"
Runtime error (such as failure to connect to host).
.IP "4"
Assert Error.
.SH WWW
\fIhttps://hurl.dev\fP
.SH SEE ALSO
curl(1) hurlfmt(1)

140
contrib/npm/docs/hurlfmt.1 Normal file
View File

@ -0,0 +1,140 @@
.TH hurl 1 "15 Feb 2022" "hurl 1.7.0-snapshot" " Hurl Manual"
.SH NAME
hurlfmt - format Hurl files
.SH SYNOPSIS
.B hurlfmt
[options] [FILE]
.SH DESCRIPTION
.B hurlfmt
formats Hurl files and converts to other formats.
With no FILE, read standard input.
By default, hurlfmt outputs a formatted and colorized version of the input hurl file.
$ hurl hello.hurl
GET http://localhost:8000/hello
HTTP/1.0 200
hurlfmt can be used to convert to other format.
$ hurl hello.hurl --output json | jq
{
"entries": [
{
"request": {
"method": "GET",
"url": "http://localhost:8000/hello"
},
"response": {
"version": "HTTP/1.0",
"status": 200
}
}
]
}
.SH OPTIONS
.IP "--check "
Run in 'check' mode. Exits with 0 if input is formatted correctly, 1 otherwise.
This can not be used with \fI--output\fP.
This option is not stable yet.
.IP "--color "
Colorize Output.
This can not be used \fI--in-place\fP.
.IP "--format "
Specify output format: text (default), json or html.
.IP "-h, --help "
Usage help.
.IP "--inplace "
Modify file in place.
This can be used only with text output.
.IP "--no-color "
Do not colorize Output.
.IP "--no-format "
Do not format output.
By default text output is automatically formatted.
.IP "-o, --output <file> "
Write output to <file> instead of stdout.
.IP "--standalone "
Output full html file with css instead of html fragment (default).
This can be used only with html output.
.IP "-V, --version "
Prints version information
.SH EXIT CODES
.IP "1"
Failed to parse command-line options.
.IP "2"
Input File Parsing Error.
.SH WWW
\fIhttps://hurl.dev\fP
.SH SEE ALSO
hurl(1)

5
contrib/npm/hurl.js Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env node
const bin = require("./bin")
bin.run("hurl");

5
contrib/npm/hurlfmt.js Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env node
const bin = require("./bin")
bin.run("hurlfmt");

39
contrib/npm/install.js Normal file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env node
const os = require("os");
const path = require("path");
const cTable = require("console.table");
const archive = require("./archive");
//const {version} = require("./package.json");
// FIXME: temporary fix to test npm installation, we use an "hard coded" version of Hurl
const version = "1.6.1";
const supportedPlatforms = require("./platform.json")
function error(msg) {
console.error(msg);
process.exit(1);
}
function getPlatformMetadata() {
const type = os.type();
const architecture = os.arch();
for (let supportedPlatform of supportedPlatforms) {
if (type === supportedPlatform.type &&
architecture === supportedPlatform.architecture
) {
return supportedPlatform;
}
}
error(
`Platform with type "${type}" and architecture "${architecture}" is not supported.
Your system must be one of the following:
${cTable.getTable(supportedPlatforms)}`
);
}
const metadata = getPlatformMetadata();
const url = `https://github.com/Orange-OpenSource/hurl/releases/download/${version}/hurl-${version}-${metadata.rust_target}${metadata.archive_extension}`;
archive.install(url, path.join(__dirname, "bin"), metadata.checksum);

376
contrib/npm/package-lock.json generated Normal file
View File

@ -0,0 +1,376 @@
{
"name": "@orangeopensource/hurl",
"version": "1.6.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/node": {
"version": "17.0.31",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz",
"integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==",
"dev": true,
"optional": true
},
"@types/yauzl": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==",
"dev": true,
"optional": true,
"requires": {
"@types/node": "*"
}
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
"dev": true
},
"axios": {
"version": "0.27.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
"integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
"dev": true,
"requires": {
"follow-redirects": "^1.14.9",
"form-data": "^4.0.0"
}
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"buffer-crc32": {
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
"dev": true
},
"chownr": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
"dev": true
},
"clone": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
"dev": true,
"optional": true
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"requires": {
"delayed-stream": "~1.0.0"
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"console.table": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz",
"integrity": "sha1-CRcCVYiHW+/XDPLv9L7yxuLXXQQ=",
"dev": true,
"requires": {
"easy-table": "1.1.0"
}
},
"debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
},
"defaults": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
"integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
"dev": true,
"optional": true,
"requires": {
"clone": "^1.0.2"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"dev": true
},
"easy-table": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz",
"integrity": "sha1-hvmrTBAvA3G3KXuSplHVgkvIy3M=",
"dev": true,
"requires": {
"wcwidth": ">=1.0.1"
}
},
"end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"requires": {
"once": "^1.4.0"
}
},
"extract-zip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
"integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==",
"dev": true,
"requires": {
"@types/yauzl": "^2.9.1",
"debug": "^4.1.1",
"get-stream": "^5.1.0",
"yauzl": "^2.10.0"
}
},
"fd-slicer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
"integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
"dev": true,
"requires": {
"pend": "~1.2.0"
}
},
"follow-redirects": {
"version": "1.14.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==",
"dev": true
},
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dev": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"fs-minipass": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
"integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
"dev": true,
"requires": {
"minipass": "^3.0.0"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"get-stream": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
"integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
"dev": true,
"requires": {
"pump": "^3.0.0"
}
},
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"dev": true
},
"mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dev": true,
"requires": {
"mime-db": "1.52.0"
}
},
"minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minipass": {
"version": "3.1.6",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz",
"integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
}
},
"minizlib": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
"dev": true,
"requires": {
"minipass": "^3.0.0",
"yallist": "^4.0.0"
}
},
"mkdirp": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
"wrappy": "1"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"pend": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=",
"dev": true
},
"pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"dev": true,
"requires": {
"glob": "^7.1.3"
}
},
"tar": {
"version": "6.1.11",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
"integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
"dev": true,
"requires": {
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",
"minipass": "^3.0.0",
"minizlib": "^2.1.1",
"mkdirp": "^1.0.3",
"yallist": "^4.0.0"
}
},
"wcwidth": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
"integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=",
"dev": true,
"optional": true,
"requires": {
"defaults": "^1.0.3"
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"yauzl": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
"dev": true,
"requires": {
"buffer-crc32": "~0.2.3",
"fd-slicer": "~1.1.0"
}
}
}
}

45
contrib/npm/package.json Normal file
View File

@ -0,0 +1,45 @@
{
"name": "@orangeopensource/hurl",
"version": "1.6.5",
"description": "Run and Test HTTP Requests with plain text and curl",
"author": "Jean-Christophe Amiel <jeanchristophe.amiel@orange.com>",
"contributors": [
"Fabrice Reix <fabrice.reix@orange.com>",
"Filipe Pinto <filipe.pinto@orange.com>",
"Jean-Christophe Amiel <jeanchristophe.amiel@orange.com>"
],
"repository": {
"type": "git",
"url": "git+https://github.com/Orange-OpenSource/hurl.git"
},
"homepage": "https://hurl.dev",
"license": "Apache-2.0",
"bin": {
"hurl": "hurl.js",
"hurlfmt": "hurlfmt.js"
},
"scripts": {
"postinstall": "node ./install.js"
},
"dependencies": {
"axios": "0.27.2",
"console.table": "0.10.0",
"extract-zip": "2.0.1",
"rimraf": "3.0.2",
"tar": "6.1.11"
},
"devDependencies": {},
"keywords": [
"cli",
"http",
"curl",
"integration-testing",
"http-client",
"testing-tools",
"api-testing"
],
"man": [
"./docs/hurl.1",
"./docs/hurlfmt.1"
]
}

34
contrib/npm/platform.json Normal file
View File

@ -0,0 +1,34 @@
[
{
"type": "Windows_NT",
"architecture": "x64",
"rust_target": "win64",
"binary_name": "hurl.exe",
"archive_extension": ".zip",
"checksum": "e9c56c9361f4de28f3cdcf2036cb648b54c0ef207b576a10dfbd57e34d99b24b"
},
{
"type": "Linux",
"architecture": "x64",
"rust_target": "x86_64-linux",
"binary_name": "hurl",
"archive_extension": ".tar.gz",
"checksum": "d445448350e28f73e71f4ee10e2bb29aac84536d7f492dfe74c1a603a7fc4f0a"
},
{
"type": "Darwin",
"architecture": "x64",
"rust_target": "x86_64-osx",
"binary_name": "hurl",
"archive_extension": ".tar.gz",
"checksum": "d1111c4e45395a6015d2e37b42a249b2042e1a89e4d2defd73b976d35cff8ef3"
},
{
"type": "Darwin",
"architecture": "arm64",
"rust_target": "arm64-osx",
"binary_name": "hurl",
"archive_extension": ".tar.gz",
"checksum": "5db7614951ec8e39d430cae5eba47a8e574ce0b91e74e97db7e39accf1172570"
}
]