lnlink-server 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +129 -129
- package/dist/build-info.json +2 -1
- package/dist/index.js +89 -41
- package/dist/index.js.map +2 -2
- package/dist/package.json +2 -1
- package/package.json +2 -1
- package/dist/node_modules/debug/.coveralls.yml +0 -1
- package/dist/node_modules/debug/.eslintrc +0 -11
- package/dist/node_modules/debug/.travis.yml +0 -14
- package/dist/node_modules/debug/CHANGELOG.md +0 -362
- package/dist/node_modules/debug/LICENSE +0 -19
- package/dist/node_modules/debug/Makefile +0 -50
- package/dist/node_modules/debug/README.md +0 -312
- package/dist/node_modules/debug/component.json +0 -19
- package/dist/node_modules/debug/karma.conf.js +0 -70
- package/dist/node_modules/debug/node.js +0 -1
- package/dist/node_modules/debug/package.json +0 -49
- package/dist/node_modules/debug/src/browser.js +0 -185
- package/dist/node_modules/debug/src/debug.js +0 -202
- package/dist/node_modules/debug/src/index.js +0 -10
- package/dist/node_modules/debug/src/inspector-log.js +0 -15
- package/dist/node_modules/debug/src/node.js +0 -248
- package/dist/node_modules/depd/History.md +0 -96
- package/dist/node_modules/depd/LICENSE +0 -22
- package/dist/node_modules/depd/Readme.md +0 -280
- package/dist/node_modules/depd/index.js +0 -522
- package/dist/node_modules/depd/lib/browser/index.js +0 -77
- package/dist/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
- package/dist/node_modules/depd/lib/compat/event-listener-count.js +0 -22
- package/dist/node_modules/depd/lib/compat/index.js +0 -79
- package/dist/node_modules/depd/package.json +0 -41
- package/dist/node_modules/http-errors/HISTORY.md +0 -132
- package/dist/node_modules/http-errors/LICENSE +0 -23
- package/dist/node_modules/http-errors/README.md +0 -135
- package/dist/node_modules/http-errors/index.js +0 -260
- package/dist/node_modules/http-errors/package.json +0 -48
- package/dist/node_modules/inherits/LICENSE +0 -16
- package/dist/node_modules/inherits/README.md +0 -42
- package/dist/node_modules/inherits/inherits.js +0 -7
- package/dist/node_modules/inherits/inherits_browser.js +0 -23
- package/dist/node_modules/inherits/package.json +0 -29
- package/dist/node_modules/ms/index.js +0 -152
- package/dist/node_modules/ms/license.md +0 -21
- package/dist/node_modules/ms/package.json +0 -37
- package/dist/node_modules/ms/readme.md +0 -51
- package/dist/node_modules/setprototypeof/LICENSE +0 -13
- package/dist/node_modules/setprototypeof/README.md +0 -26
- package/dist/node_modules/setprototypeof/index.d.ts +0 -2
- package/dist/node_modules/setprototypeof/index.js +0 -15
- package/dist/node_modules/setprototypeof/package.json +0 -25
- package/dist/node_modules/statuses/HISTORY.md +0 -65
- package/dist/node_modules/statuses/LICENSE +0 -23
- package/dist/node_modules/statuses/README.md +0 -127
- package/dist/node_modules/statuses/codes.json +0 -66
- package/dist/node_modules/statuses/index.js +0 -113
- package/dist/node_modules/statuses/package.json +0 -48
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Statuses
|
|
2
|
-
|
|
3
|
-
[![NPM Version][npm-image]][npm-url]
|
|
4
|
-
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
|
-
[![Node.js Version][node-version-image]][node-version-url]
|
|
6
|
-
[![Build Status][travis-image]][travis-url]
|
|
7
|
-
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
8
|
-
|
|
9
|
-
HTTP status utility for node.
|
|
10
|
-
|
|
11
|
-
This module provides a list of status codes and messages sourced from
|
|
12
|
-
a few different projects:
|
|
13
|
-
|
|
14
|
-
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
|
15
|
-
* The [Node.js project](https://nodejs.org/)
|
|
16
|
-
* The [NGINX project](https://www.nginx.com/)
|
|
17
|
-
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
22
|
-
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
23
|
-
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
$ npm install statuses
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## API
|
|
30
|
-
|
|
31
|
-
<!-- eslint-disable no-unused-vars -->
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
var status = require('statuses')
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### var code = status(Integer || String)
|
|
38
|
-
|
|
39
|
-
If `Integer` or `String` is a valid HTTP code or status message, then the
|
|
40
|
-
appropriate `code` will be returned. Otherwise, an error will be thrown.
|
|
41
|
-
|
|
42
|
-
<!-- eslint-disable no-undef -->
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
status(403) // => 403
|
|
46
|
-
status('403') // => 403
|
|
47
|
-
status('forbidden') // => 403
|
|
48
|
-
status('Forbidden') // => 403
|
|
49
|
-
status(306) // throws, as it's not supported by node.js
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### status.STATUS_CODES
|
|
53
|
-
|
|
54
|
-
Returns an object which maps status codes to status messages, in
|
|
55
|
-
the same format as the
|
|
56
|
-
[Node.js http module](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
|
57
|
-
|
|
58
|
-
### status.codes
|
|
59
|
-
|
|
60
|
-
Returns an array of all the status codes as `Integer`s.
|
|
61
|
-
|
|
62
|
-
### var msg = status[code]
|
|
63
|
-
|
|
64
|
-
Map of `code` to `status message`. `undefined` for invalid `code`s.
|
|
65
|
-
|
|
66
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
67
|
-
|
|
68
|
-
```js
|
|
69
|
-
status[404] // => 'Not Found'
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### var code = status[msg]
|
|
73
|
-
|
|
74
|
-
Map of `status message` to `code`. `msg` can either be title-cased or
|
|
75
|
-
lower-cased. `undefined` for invalid `status message`s.
|
|
76
|
-
|
|
77
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
78
|
-
|
|
79
|
-
```js
|
|
80
|
-
status['not found'] // => 404
|
|
81
|
-
status['Not Found'] // => 404
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### status.redirect[code]
|
|
85
|
-
|
|
86
|
-
Returns `true` if a status code is a valid redirect status.
|
|
87
|
-
|
|
88
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
89
|
-
|
|
90
|
-
```js
|
|
91
|
-
status.redirect[200] // => undefined
|
|
92
|
-
status.redirect[301] // => true
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### status.empty[code]
|
|
96
|
-
|
|
97
|
-
Returns `true` if a status code expects an empty body.
|
|
98
|
-
|
|
99
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
100
|
-
|
|
101
|
-
```js
|
|
102
|
-
status.empty[200] // => undefined
|
|
103
|
-
status.empty[204] // => true
|
|
104
|
-
status.empty[304] // => true
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### status.retry[code]
|
|
108
|
-
|
|
109
|
-
Returns `true` if you should retry the rest.
|
|
110
|
-
|
|
111
|
-
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
112
|
-
|
|
113
|
-
```js
|
|
114
|
-
status.retry[501] // => undefined
|
|
115
|
-
status.retry[503] // => true
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
[npm-image]: https://img.shields.io/npm/v/statuses.svg
|
|
119
|
-
[npm-url]: https://npmjs.org/package/statuses
|
|
120
|
-
[node-version-image]: https://img.shields.io/node/v/statuses.svg
|
|
121
|
-
[node-version-url]: https://nodejs.org/en/download
|
|
122
|
-
[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg
|
|
123
|
-
[travis-url]: https://travis-ci.org/jshttp/statuses
|
|
124
|
-
[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg
|
|
125
|
-
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
|
126
|
-
[downloads-image]: https://img.shields.io/npm/dm/statuses.svg
|
|
127
|
-
[downloads-url]: https://npmjs.org/package/statuses
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"100": "Continue",
|
|
3
|
-
"101": "Switching Protocols",
|
|
4
|
-
"102": "Processing",
|
|
5
|
-
"103": "Early Hints",
|
|
6
|
-
"200": "OK",
|
|
7
|
-
"201": "Created",
|
|
8
|
-
"202": "Accepted",
|
|
9
|
-
"203": "Non-Authoritative Information",
|
|
10
|
-
"204": "No Content",
|
|
11
|
-
"205": "Reset Content",
|
|
12
|
-
"206": "Partial Content",
|
|
13
|
-
"207": "Multi-Status",
|
|
14
|
-
"208": "Already Reported",
|
|
15
|
-
"226": "IM Used",
|
|
16
|
-
"300": "Multiple Choices",
|
|
17
|
-
"301": "Moved Permanently",
|
|
18
|
-
"302": "Found",
|
|
19
|
-
"303": "See Other",
|
|
20
|
-
"304": "Not Modified",
|
|
21
|
-
"305": "Use Proxy",
|
|
22
|
-
"306": "(Unused)",
|
|
23
|
-
"307": "Temporary Redirect",
|
|
24
|
-
"308": "Permanent Redirect",
|
|
25
|
-
"400": "Bad Request",
|
|
26
|
-
"401": "Unauthorized",
|
|
27
|
-
"402": "Payment Required",
|
|
28
|
-
"403": "Forbidden",
|
|
29
|
-
"404": "Not Found",
|
|
30
|
-
"405": "Method Not Allowed",
|
|
31
|
-
"406": "Not Acceptable",
|
|
32
|
-
"407": "Proxy Authentication Required",
|
|
33
|
-
"408": "Request Timeout",
|
|
34
|
-
"409": "Conflict",
|
|
35
|
-
"410": "Gone",
|
|
36
|
-
"411": "Length Required",
|
|
37
|
-
"412": "Precondition Failed",
|
|
38
|
-
"413": "Payload Too Large",
|
|
39
|
-
"414": "URI Too Long",
|
|
40
|
-
"415": "Unsupported Media Type",
|
|
41
|
-
"416": "Range Not Satisfiable",
|
|
42
|
-
"417": "Expectation Failed",
|
|
43
|
-
"418": "I'm a teapot",
|
|
44
|
-
"421": "Misdirected Request",
|
|
45
|
-
"422": "Unprocessable Entity",
|
|
46
|
-
"423": "Locked",
|
|
47
|
-
"424": "Failed Dependency",
|
|
48
|
-
"425": "Unordered Collection",
|
|
49
|
-
"426": "Upgrade Required",
|
|
50
|
-
"428": "Precondition Required",
|
|
51
|
-
"429": "Too Many Requests",
|
|
52
|
-
"431": "Request Header Fields Too Large",
|
|
53
|
-
"451": "Unavailable For Legal Reasons",
|
|
54
|
-
"500": "Internal Server Error",
|
|
55
|
-
"501": "Not Implemented",
|
|
56
|
-
"502": "Bad Gateway",
|
|
57
|
-
"503": "Service Unavailable",
|
|
58
|
-
"504": "Gateway Timeout",
|
|
59
|
-
"505": "HTTP Version Not Supported",
|
|
60
|
-
"506": "Variant Also Negotiates",
|
|
61
|
-
"507": "Insufficient Storage",
|
|
62
|
-
"508": "Loop Detected",
|
|
63
|
-
"509": "Bandwidth Limit Exceeded",
|
|
64
|
-
"510": "Not Extended",
|
|
65
|
-
"511": "Network Authentication Required"
|
|
66
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* statuses
|
|
3
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
4
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
5
|
-
* MIT Licensed
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Module dependencies.
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
var codes = require('./codes.json')
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Module exports.
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
module.exports = status
|
|
23
|
-
|
|
24
|
-
// status code to message map
|
|
25
|
-
status.STATUS_CODES = codes
|
|
26
|
-
|
|
27
|
-
// array of status codes
|
|
28
|
-
status.codes = populateStatusesMap(status, codes)
|
|
29
|
-
|
|
30
|
-
// status codes for redirects
|
|
31
|
-
status.redirect = {
|
|
32
|
-
300: true,
|
|
33
|
-
301: true,
|
|
34
|
-
302: true,
|
|
35
|
-
303: true,
|
|
36
|
-
305: true,
|
|
37
|
-
307: true,
|
|
38
|
-
308: true
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// status codes for empty bodies
|
|
42
|
-
status.empty = {
|
|
43
|
-
204: true,
|
|
44
|
-
205: true,
|
|
45
|
-
304: true
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// status codes for when you should retry the request
|
|
49
|
-
status.retry = {
|
|
50
|
-
502: true,
|
|
51
|
-
503: true,
|
|
52
|
-
504: true
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Populate the statuses map for given codes.
|
|
57
|
-
* @private
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
function populateStatusesMap (statuses, codes) {
|
|
61
|
-
var arr = []
|
|
62
|
-
|
|
63
|
-
Object.keys(codes).forEach(function forEachCode (code) {
|
|
64
|
-
var message = codes[code]
|
|
65
|
-
var status = Number(code)
|
|
66
|
-
|
|
67
|
-
// Populate properties
|
|
68
|
-
statuses[status] = message
|
|
69
|
-
statuses[message] = status
|
|
70
|
-
statuses[message.toLowerCase()] = status
|
|
71
|
-
|
|
72
|
-
// Add to array
|
|
73
|
-
arr.push(status)
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
return arr
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Get the status code.
|
|
81
|
-
*
|
|
82
|
-
* Given a number, this will throw if it is not a known status
|
|
83
|
-
* code, otherwise the code will be returned. Given a string,
|
|
84
|
-
* the string will be parsed for a number and return the code
|
|
85
|
-
* if valid, otherwise will lookup the code assuming this is
|
|
86
|
-
* the status message.
|
|
87
|
-
*
|
|
88
|
-
* @param {string|number} code
|
|
89
|
-
* @returns {number}
|
|
90
|
-
* @public
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
function status (code) {
|
|
94
|
-
if (typeof code === 'number') {
|
|
95
|
-
if (!status[code]) throw new Error('invalid status code: ' + code)
|
|
96
|
-
return code
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (typeof code !== 'string') {
|
|
100
|
-
throw new TypeError('code must be a number or string')
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// '403'
|
|
104
|
-
var n = parseInt(code, 10)
|
|
105
|
-
if (!isNaN(n)) {
|
|
106
|
-
if (!status[n]) throw new Error('invalid status code: ' + n)
|
|
107
|
-
return n
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
n = status[code.toLowerCase()]
|
|
111
|
-
if (!n) throw new Error('invalid status message: "' + code + '"')
|
|
112
|
-
return n
|
|
113
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "statuses",
|
|
3
|
-
"description": "HTTP status utility",
|
|
4
|
-
"version": "1.5.0",
|
|
5
|
-
"contributors": [
|
|
6
|
-
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
|
-
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
8
|
-
],
|
|
9
|
-
"repository": "jshttp/statuses",
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"keywords": [
|
|
12
|
-
"http",
|
|
13
|
-
"status",
|
|
14
|
-
"code"
|
|
15
|
-
],
|
|
16
|
-
"files": [
|
|
17
|
-
"HISTORY.md",
|
|
18
|
-
"index.js",
|
|
19
|
-
"codes.json",
|
|
20
|
-
"LICENSE"
|
|
21
|
-
],
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"csv-parse": "1.2.4",
|
|
24
|
-
"eslint": "4.19.1",
|
|
25
|
-
"eslint-config-standard": "11.0.0",
|
|
26
|
-
"eslint-plugin-import": "2.9.0",
|
|
27
|
-
"eslint-plugin-markdown": "1.0.0-beta.6",
|
|
28
|
-
"eslint-plugin-node": "6.0.1",
|
|
29
|
-
"eslint-plugin-promise": "3.7.0",
|
|
30
|
-
"eslint-plugin-standard": "3.0.1",
|
|
31
|
-
"istanbul": "0.4.5",
|
|
32
|
-
"mocha": "1.21.5",
|
|
33
|
-
"raw-body": "2.3.2",
|
|
34
|
-
"stream-to-array": "2.3.0"
|
|
35
|
-
},
|
|
36
|
-
"engines": {
|
|
37
|
-
"node": ">= 0.6"
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "node scripts/build.js",
|
|
41
|
-
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
|
|
42
|
-
"lint": "eslint --plugin markdown --ext js,md .",
|
|
43
|
-
"test": "mocha --reporter spec --check-leaks --bail test/",
|
|
44
|
-
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
|
45
|
-
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
|
46
|
-
"update": "npm run fetch && npm run build"
|
|
47
|
-
}
|
|
48
|
-
}
|