fix(core): update

This commit is contained in:
Philipp Kunz 2019-01-02 01:00:53 +01:00
parent 55eb01c425
commit 8900619bc9
30 changed files with 1945 additions and 2658 deletions

View File

@ -3,69 +3,145 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
testLEGACY:
stage: test
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
- npmci git mirror
tags:
- docker
- docker
- notpriv
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
sast:
stage: security
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
artifacts:
reports:
sast: gl-sast-report.json
tags:
- docker
- priv
# ====================
# test stage
# ====================
testLTS:
stage: test
script:
- npmci test lts
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci command yarn global add npmpage
- npmci command npmpage --publish gitlab
- npmci command npm install -g typedoc typescript
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -1,13 +1,16 @@
# smartstatus
status information in TypeScript
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartstatus)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartstatus)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartstatus)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartstatus/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartstatus/badges/master/build.svg)](https://GitLab.com/pushrocks/smartstatus/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartstatus/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartstatus/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartstatus.svg)](https://www.npmjs.com/package/smartstatus)
@ -19,11 +22,12 @@ status information in TypeScript
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

6
dist/index.d.ts vendored
View File

@ -1,6 +0,0 @@
export { HttpStatus } from './smartstatus.classes.http';
export * from './smartstatus.classes.http.1xx';
export * from './smartstatus.classes.http.2xx';
export * from './smartstatus.classes.http.3xx';
export * from './smartstatus.classes.http.4xx';
export * from './smartstatus.classes.http.5xx';

13
dist/index.js vendored
View File

@ -1,13 +0,0 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var smartstatus_classes_http_1 = require("./smartstatus.classes.http");
exports.HttpStatus = smartstatus_classes_http_1.HttpStatus;
__export(require("./smartstatus.classes.http.1xx"));
__export(require("./smartstatus.classes.http.2xx"));
__export(require("./smartstatus.classes.http.3xx"));
__export(require("./smartstatus.classes.http.4xx"));
__export(require("./smartstatus.classes.http.5xx"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHVFQUF1RDtBQUE5QyxnREFBQSxVQUFVLENBQUE7QUFFbkIsb0RBQThDO0FBQzlDLG9EQUE4QztBQUM5QyxvREFBOEM7QUFDOUMsb0RBQThDO0FBQzlDLG9EQUE4QyJ9

View File

@ -1,10 +0,0 @@
import { HttpStatus } from './smartstatus.classes.http';
export declare class status100 extends HttpStatus {
constructor();
}
export declare class status101 extends HttpStatus {
constructor();
}
export declare class status102 extends HttpStatus {
constructor();
}

View File

@ -1,46 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const smartstatus_classes_http_1 = require("./smartstatus.classes.http");
class status100 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 100,
text: 'Continue',
description: `The server has received the request headers and the client
should proceed to send the request body
(in the case of a request for which a body needs to be sent; for example, a POST request).
Sending a large request body to a server after a request has been rejected
for inappropriate headers would be inefficient.
To have a server check the request's headers,
a client must send Expect: 100-continue as a header in its initial request and receive
a 100 Continue status code in response before sending the body.
The response 417 Expectation Failed indicates the request should not be continued.`
});
}
}
exports.status100 = status100;
class status101 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 101,
text: 'Switching Protocols',
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`
});
}
}
exports.status101 = status101;
class status102 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 102,
text: 'Non-Authoritative Information',
description: `A WebDAV request may contain many sub-requests involving file operations,
requiring a long time to complete the request.
This code indicates that the server has received and is processing the request,
but no response is available yet.[6]
This prevents the client from timing out and assuming the request was lost.`
});
}
}
exports.status102 = status102;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjF4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RhdHVzLmNsYXNzZXMuaHR0cC4xeHgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5RUFBcUU7QUFFckUsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLFVBQVU7WUFDaEIsV0FBVyxFQUFFOzs7Ozs7OzsrRkFRMEU7U0FDeEYsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBaEJELDhCQWdCQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxxQkFBcUI7WUFDM0IsV0FBVyxFQUFFLDRGQUE0RjtTQUMxRyxDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFSRCw4QkFRQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSwrQkFBK0I7WUFDckMsV0FBVyxFQUFFOzs7O29GQUkrRDtTQUM3RSxDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFaRCw4QkFZQyJ9

View File

@ -1,31 +0,0 @@
import { HttpStatus } from './smartstatus.classes.http';
export declare class status200 extends HttpStatus {
constructor();
}
export declare class status201 extends HttpStatus {
constructor();
}
export declare class status202 extends HttpStatus {
constructor();
}
export declare class status203 extends HttpStatus {
constructor();
}
export declare class status204 extends HttpStatus {
constructor();
}
export declare class status205 extends HttpStatus {
constructor();
}
export declare class status206 extends HttpStatus {
constructor();
}
export declare class status207 extends HttpStatus {
constructor();
}
export declare class status208 extends HttpStatus {
constructor();
}
export declare class status226 extends HttpStatus {
constructor();
}

View File

@ -1,119 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const smartstatus_classes_http_1 = require("./smartstatus.classes.http");
class status200 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 200,
text: 'OK',
description: `Standard response for successful HTTP requests.
The actual response will depend on the request method used.
In a GET request, the response will contain an entity corresponding to the requested resource.
In a POST request, the response will contain an entity describing or containing the result of the action.`
});
}
}
exports.status200 = status200;
class status201 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 201,
text: 'Created',
description: `The request has been fulfilled, resulting in the creation of a new resource.`
});
}
}
exports.status201 = status201;
class status202 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 202,
text: 'Accepted',
description: `The request has been accepted for processing, but the processing has not been completed.
The request might or might not be eventually acted upon, and may be disallowed when processing occurs.`
});
}
}
exports.status202 = status202;
class status203 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 203,
text: 'Non-Authoritative Information',
description: `The server is a transforming proxy (e.g. a Web accelerator)
that received a 200 OK from its origin, but is returning a modified version of the origin's response.`
});
}
}
exports.status203 = status203;
class status204 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 204,
text: 'Non-Authoritative Information',
description: `The server successfully processed the request and is not returning any content.`
});
}
}
exports.status204 = status204;
class status205 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 205,
text: 'Reset Content',
description: `The server successfully processed the request, but is not returning any content.
Unlike a 204 response, this response requires that the requester reset the document view.`
});
}
}
exports.status205 = status205;
class status206 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 206,
text: 'Partial Content',
description: `The server is delivering only part of the resource (byte serving)
due to a range header sent by the client.
The range header is used by HTTP clients to enable resuming of interrupted downloads,
or split a download into multiple simultaneous streams.`
});
}
}
exports.status206 = status206;
class status207 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 207,
text: 'Multi-Status',
description: `The message body that follows is an XML message
and can contain a number of separate response codes,
depending on how many sub-requests were made.`
});
}
}
exports.status207 = status207;
class status208 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 208,
text: 'Already Reported',
description: `The members of a DAV binding have already been enumerated
in a preceding part of the (multistatus) response,
and are not being included again.`
});
}
}
exports.status208 = status208;
class status226 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 226,
text: 'IM Used',
description: `The server has fulfilled a request for the resource,
and the response is a representation of the result of one or more instance-manipulations
applied to the current instance.`
});
}
}
exports.status226 = status226;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjJ4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3Rz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RCw4QkFVQyJ9

View File

@ -1,28 +0,0 @@
import { HttpStatus } from './smartstatus.classes.http';
export declare class status300 extends HttpStatus {
constructor();
}
export declare class status301 extends HttpStatus {
constructor();
}
export declare class status302 extends HttpStatus {
constructor();
}
export declare class status303 extends HttpStatus {
constructor();
}
export declare class status304 extends HttpStatus {
constructor();
}
export declare class status305 extends HttpStatus {
constructor();
}
export declare class status306 extends HttpStatus {
constructor();
}
export declare class status307 extends HttpStatus {
constructor();
}
export declare class status308 extends HttpStatus {
constructor();
}

View File

@ -1,117 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const smartstatus_classes_http_1 = require("./smartstatus.classes.http");
class status300 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 300,
text: ' Multiple Choices',
description: `Indicates multiple options for the resource from which the client may choose
(via agent-driven content negotiation).
For example, this code could be used to present multiple video format options,
to list files with different filename extensions, or to suggest word-sense disambiguation.`
});
}
}
exports.status300 = status300;
class status301 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 301,
text: 'Moved Permanently',
description: `This and all future requests should be directed to the given URI.`
});
}
}
exports.status301 = status301;
class status302 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 302,
text: 'Found',
description: `This is an example of industry practice contradicting the standard.
The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
(the original describing phrase was "Moved Temporarily"),
[20] but popular browsers implemented 302 with the functionality of a 303 See Other.
Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.[21]
However, some Web applications and frameworks use the 302 status code as if it were the 303.`
});
}
}
exports.status302 = status302;
class status303 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 303,
text: 'See Other',
description: `The response to the request can be found under another URI using a GET method.
When received in response to a POST (or PUT/DELETE),
the client should presume that the server has received the data and should issue a redirect
with a separate GET message.`
});
}
}
exports.status303 = status303;
class status304 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 304,
text: 'Not Modified',
description: `Indicates that the resource has not been modified
since the version specified by the request headers If-Modified-Since or If-None-Match.
In such case, there is no need to retransmit the resource since the client
still has a previously-downloaded copy.`
});
}
}
exports.status304 = status304;
class status305 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 305,
text: 'Use Proxy',
description: `The requested resource is available only through a proxy,
the address for which is provided in the response. Many HTTP clients (such as Mozilla[25]
and Internet Explorer) do not correctly handle responses with this status code,
primarily for security reasons.`
});
}
}
exports.status305 = status305;
class status306 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 306,
text: 'Switch Proxy',
description: `No longer used. Originally meant "Subsequent requests should use the specified proxy."`
});
}
}
exports.status306 = status306;
class status307 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 307,
text: 'Temporary Redirect',
description: `In this case, the request should be repeated with another URI;
however, future requests should still use the original URI.
In contrast to how 302 was historically implemented,
the request method is not allowed to be changed when reissuing the original request.
For example, a POST request should be repeated using another POST request.`
});
}
}
exports.status307 = status307;
class status308 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 308,
text: 'Permanent Redirect',
description: `The request and all future requests should be repeated using another URI.
307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
So, for example, submitting a form to a permanently redirected resource may continue smoothly.`
});
}
}
exports.status308 = status308;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjN4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RhdHVzLmNsYXNzZXMuaHR0cC4zeHgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5RUFBcUU7QUFFckUsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNFLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFL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FQUFFOzs7d0NBR3FCO1NBQ25DLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDRjtBQVhELDhCQVdDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNFLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGNBQWM7WUFDcEIsV0FBVyxFQUFFLHdGQUF3RjtTQUN0RyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ0Y7QUFSRCw4QkFRQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDRSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxvQkFBb0I7WUFDMUIsV0FBVyxFQUFFOzs7O2lGQUk4RDtTQUM1RSxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ0Y7QUFaRCw4QkFZQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDRSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxvQkFBb0I7WUFDMUIsV0FBVyxFQUFFOztxR0FFa0Y7U0FDaEcsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNGO0FBVkQsOEJBVUMifQ==

View File

@ -1,16 +0,0 @@
import { HttpStatus } from './smartstatus.classes.http';
export declare class status400 extends HttpStatus {
constructor();
}
export declare class status401 extends HttpStatus {
constructor();
}
export declare class status402 extends HttpStatus {
constructor();
}
export declare class status403 extends HttpStatus {
constructor();
}
export declare class status404 extends HttpStatus {
constructor();
}

View File

@ -1,55 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const smartstatus_classes_http_1 = require("./smartstatus.classes.http");
class status400 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 400,
text: 'Bad Request',
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
});
}
}
exports.status400 = status400;
class status401 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 401,
text: 'Unauthorized',
description: `Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. See Basic access authentication and Digest access authentication.[32] 401 semantically means "unauthenticated",[33] i.e. the user does not have the necessary credentials.
Note: Some sites issue HTTP 401 when an IP address is banned from the website (usually the website domain) and that specific address is refused permission to access a website.`
});
}
}
exports.status401 = status401;
class status402 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 402,
text: 'Payment Required',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
exports.status402 = status402;
class status403 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 403,
text: 'Forbidden',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
exports.status403 = status403;
class status404 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 404,
text: 'Not Found',
description: `The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.`
});
}
}
exports.status404 = status404;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjR4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RhdHVzLmNsYXNzZXMuaHR0cC40eHgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5RUFBcUU7QUFFckUsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGFBQWE7WUFDbkIsV0FBVyxFQUFFLG9NQUFvTTtTQUNsTixDQUFDLENBQUE7SUFDTixDQUFDO0NBRUY7QUFURCw4QkFTQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxjQUFjO1lBQ3BCLFdBQVcsRUFBRTt3TEFDbUs7U0FDakwsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUVGO0FBVkQsOEJBVUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsa0JBQWtCO1lBQ3hCLFdBQVcsRUFBRSw2SEFBNkg7U0FDM0ksQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsV0FBVztZQUNqQixXQUFXLEVBQUUsNkhBQTZIO1NBQzNJLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVJELDhCQVFDO0FBSUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLFdBQVc7WUFDakIsV0FBVyxFQUFFLGtJQUFrSTtTQUNoSixDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFSRCw4QkFRQyJ9

View File

@ -1,34 +0,0 @@
import { HttpStatus } from './smartstatus.classes.http';
export declare class status500 extends HttpStatus {
constructor();
}
export declare class status501 extends HttpStatus {
constructor();
}
export declare class status502 extends HttpStatus {
constructor();
}
export declare class status503 extends HttpStatus {
constructor();
}
export declare class status504 extends HttpStatus {
constructor();
}
export declare class status505 extends HttpStatus {
constructor();
}
export declare class status506 extends HttpStatus {
constructor();
}
export declare class status507 extends HttpStatus {
constructor();
}
export declare class status508 extends HttpStatus {
constructor();
}
export declare class status510 extends HttpStatus {
constructor();
}
export declare class status511 extends HttpStatus {
constructor();
}

View File

@ -1,117 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const smartstatus_classes_http_1 = require("./smartstatus.classes.http");
class status500 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 500,
text: 'Internal Server Error',
description: 'A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.'
});
}
}
exports.status500 = status500;
class status501 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 501,
text: 'Bad Request',
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
});
}
}
exports.status501 = status501;
class status502 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 502,
text: 'Payment Required',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
exports.status502 = status502;
class status503 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 503,
text: 'Forbidden',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
exports.status503 = status503;
class status504 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 504,
text: 'Gateway Time-out',
description: `The server was acting as a gateway or proxy
and did not receive a timely response from the upstream server.`
});
}
}
exports.status504 = status504;
class status505 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 505,
text: 'HTTP Version Not Supported',
description: `The server does not support the HTTP protocol version used in the request.`
});
}
}
exports.status505 = status505;
class status506 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 506,
text: 'Variant Also Negotiates',
description: `Transparent content negotiation for the request results in a circular reference.`
});
}
}
exports.status506 = status506;
class status507 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 507,
text: 'Insufficient Storage',
description: `The server is unable to store the representation needed to complete the request.`
});
}
}
exports.status507 = status507;
class status508 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 508,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
});
}
}
exports.status508 = status508;
class status510 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 510,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
});
}
}
exports.status510 = status510;
class status511 extends smartstatus_classes_http_1.HttpStatus {
constructor() {
super({
code: 511,
text: 'Network Authentication Required',
description: `The client needs to authenticate to gain network access.
Intended for use by intercepting proxies used to control access to the network
(e.g., "captive portals" used to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot)`
});
}
}
exports.status511 = status511;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjV4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RhdHVzLmNsYXNzZXMuaHR0cC41eHgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5RUFBcUU7QUFFckUsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLHVCQUF1QjtZQUM3QixXQUFXLEVBQUUsdUhBQXVIO1NBQ3JJLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVJELDhCQVFDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGFBQWE7WUFDbkIsV0FBVyxFQUFFLG9NQUFvTTtTQUNsTixDQUFDLENBQUE7SUFDTixDQUFDO0NBRUY7QUFURCw4QkFTQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxrQkFBa0I7WUFDeEIsV0FB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0FDaEcsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsZUFBZTtZQUNyQixXQUFXLEVBQUUsbUVBQW1FO1NBQ2pGLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVJELDhCQVFDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGVBQWU7WUFDckIsV0FBVyxFQUFFLG1FQUFtRTtTQUNqRixDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFSRCw4QkFRQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxpQ0FBaUM7WUFDdkMsV0FBVyxFQUFFOzsySUFFc0g7U0FDcEksQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBVkQsOEJBVUMifQ==

View File

@ -1,16 +0,0 @@
export declare type TStatusGroup = 'clientError' | 'serverError';
export declare class HttpStatus {
code: number;
text: string;
description: string;
constructor(optionsArg: {
code: number;
text: string;
description: string;
});
}
export * from './smartstatus.classes.http.1xx';
export * from './smartstatus.classes.http.2xx';
export * from './smartstatus.classes.http.3xx';
export * from './smartstatus.classes.http.4xx';
export * from './smartstatus.classes.http.5xx';

View File

@ -1,16 +0,0 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
class HttpStatus {
constructor(optionsArg) {
}
}
exports.HttpStatus = HttpStatus;
__export(require("./smartstatus.classes.http.1xx"));
__export(require("./smartstatus.classes.http.2xx"));
__export(require("./smartstatus.classes.http.3xx"));
__export(require("./smartstatus.classes.http.4xx"));
__export(require("./smartstatus.classes.http.5xx"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBRUE7SUFJRSxZQUFhLFVBSVo7SUFFRCxDQUFDO0NBQ0Y7QUFYRCxnQ0FXQztBQUVELG9EQUE4QztBQUM5QyxvREFBOEM7QUFDOUMsb0RBQThDO0FBQzlDLG9EQUE4QztBQUM5QyxvREFBOEMifQ==

View File

@ -1,13 +1,16 @@
# smartstatus
status information in TypeScript
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartstatus)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartstatus)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartstatus)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartstatus/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartstatus/badges/master/build.svg)](https://GitLab.com/pushrocks/smartstatus/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartstatus/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartstatus/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartstatus.svg)](https://www.npmjs.com/package/smartstatus)
@ -19,11 +22,12 @@ status information in TypeScript
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

1591
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,13 @@
{
"name": "smartstatus",
"name": "@pushrocks/smartstatus",
"version": "1.0.1",
"private": false,
"description": "status information in TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
"test": "(tstest test/)",
"build": "tsbuild"
},
"repository": {
"type": "git",
@ -18,6 +20,11 @@
},
"homepage": "https://gitlab.com/pkunz/smartstatus#README",
"devDependencies": {
"tapbundle": "^1.0.5"
}
"@gitzone/tsbuild": "^2.1.4",
"@gitzone/tstest": "^1.0.18",
"@pushrocks/tapbundle": "^3.0.7",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0"
},
"dependencies": {}
}

View File

@ -1,8 +1,13 @@
import { expect, tap } from 'tapbundle'
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartstatus from '../dist/index'
import * as smartstatus from '../ts/index';
tap.test('should create valid status classes', async () => {
let myStatus301 = new smartstatus.status301()
return expect(myStatus301).to.be.instanceOf(smartstatus.HttpStatus)
})
const myStatus301 = new smartstatus.status301();
console.log(myStatus301.code);
console.log(myStatus301.text);
console.log(myStatus301.description);
return expect(myStatus301).to.be.instanceOf(smartstatus.HttpStatus);
});
tap.start();

View File

@ -1,7 +1 @@
export { HttpStatus } from './smartstatus.classes.http'
export * from './smartstatus.classes.http.1xx'
export * from './smartstatus.classes.http.2xx'
export * from './smartstatus.classes.http.3xx'
export * from './smartstatus.classes.http.4xx'
export * from './smartstatus.classes.http.5xx'
export * from './smartstatus.classes.http';

View File

@ -1,11 +1,11 @@
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http';
export class status100 extends HttpStatus {
constructor () {
super({
code: 100,
text: 'Continue',
description: `The server has received the request headers and the client
constructor() {
super({
code: 100,
text: 'Continue',
description: `The server has received the request headers and the client
should proceed to send the request body
(in the case of a request for which a body needs to be sent; for example, a POST request).
Sending a large request body to a server after a request has been rejected
@ -14,30 +14,30 @@ export class status100 extends HttpStatus {
a client must send Expect: 100-continue as a header in its initial request and receive
a 100 Continue status code in response before sending the body.
The response 417 Expectation Failed indicates the request should not be continued.`
})
});
}
}
export class status101 extends HttpStatus {
constructor () {
super({
code: 101,
text: 'Switching Protocols',
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`
})
constructor() {
super({
code: 101,
text: 'Switching Protocols',
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`
});
}
}
export class status102 extends HttpStatus {
constructor () {
super({
code: 102,
text: 'Non-Authoritative Information',
description: `A WebDAV request may contain many sub-requests involving file operations,
constructor() {
super({
code: 102,
text: 'Non-Authoritative Information',
description: `A WebDAV request may contain many sub-requests involving file operations,
requiring a long time to complete the request.
This code indicates that the server has received and is processing the request,
but no response is available yet.[6]
This prevents the client from timing out and assuming the request was lost.`
})
});
}
}
}

View File

@ -1,116 +1,116 @@
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http';
export class status200 extends HttpStatus {
constructor () {
super({
code: 200,
text: 'OK',
description: `Standard response for successful HTTP requests.
constructor() {
super({
code: 200,
text: 'OK',
description: `Standard response for successful HTTP requests.
The actual response will depend on the request method used.
In a GET request, the response will contain an entity corresponding to the requested resource.
In a POST request, the response will contain an entity describing or containing the result of the action.`
})
});
}
}
export class status201 extends HttpStatus {
constructor () {
super({
code: 201,
text: 'Created',
description: `The request has been fulfilled, resulting in the creation of a new resource.`
})
constructor() {
super({
code: 201,
text: 'Created',
description: `The request has been fulfilled, resulting in the creation of a new resource.`
});
}
}
export class status202 extends HttpStatus {
constructor () {
super({
code: 202,
text: 'Accepted',
description: `The request has been accepted for processing, but the processing has not been completed.
constructor() {
super({
code: 202,
text: 'Accepted',
description: `The request has been accepted for processing, but the processing has not been completed.
The request might or might not be eventually acted upon, and may be disallowed when processing occurs.`
})
});
}
}
export class status203 extends HttpStatus {
constructor () {
super({
code: 203,
text: 'Non-Authoritative Information',
description: `The server is a transforming proxy (e.g. a Web accelerator)
constructor() {
super({
code: 203,
text: 'Non-Authoritative Information',
description: `The server is a transforming proxy (e.g. a Web accelerator)
that received a 200 OK from its origin, but is returning a modified version of the origin's response.`
})
});
}
}
export class status204 extends HttpStatus {
constructor () {
super({
code: 204,
text: 'Non-Authoritative Information',
description: `The server successfully processed the request and is not returning any content.`
})
constructor() {
super({
code: 204,
text: 'Non-Authoritative Information',
description: `The server successfully processed the request and is not returning any content.`
});
}
}
export class status205 extends HttpStatus {
constructor () {
super({
code: 205,
text: 'Reset Content',
description: `The server successfully processed the request, but is not returning any content.
constructor() {
super({
code: 205,
text: 'Reset Content',
description: `The server successfully processed the request, but is not returning any content.
Unlike a 204 response, this response requires that the requester reset the document view.`
})
});
}
}
export class status206 extends HttpStatus {
constructor () {
super({
code: 206,
text: 'Partial Content',
description: `The server is delivering only part of the resource (byte serving)
constructor() {
super({
code: 206,
text: 'Partial Content',
description: `The server is delivering only part of the resource (byte serving)
due to a range header sent by the client.
The range header is used by HTTP clients to enable resuming of interrupted downloads,
or split a download into multiple simultaneous streams.`
})
});
}
}
export class status207 extends HttpStatus {
constructor () {
super({
code: 207,
text: 'Multi-Status',
description: `The message body that follows is an XML message
constructor() {
super({
code: 207,
text: 'Multi-Status',
description: `The message body that follows is an XML message
and can contain a number of separate response codes,
depending on how many sub-requests were made.`
})
});
}
}
export class status208 extends HttpStatus {
constructor () {
super({
code: 208,
text: 'Already Reported',
description: `The members of a DAV binding have already been enumerated
constructor() {
super({
code: 208,
text: 'Already Reported',
description: `The members of a DAV binding have already been enumerated
in a preceding part of the (multistatus) response,
and are not being included again.`
})
});
}
}
export class status226 extends HttpStatus {
constructor () {
super({
code: 226,
text: 'IM Used',
description: `The server has fulfilled a request for the resource,
constructor() {
super({
code: 226,
text: 'IM Used',
description: `The server has fulfilled a request for the resource,
and the response is a representation of the result of one or more instance-manipulations
applied to the current instance.`
})
});
}
}

View File

@ -1,4 +1,4 @@
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http';
export class status300 extends HttpStatus {
constructor() {
@ -9,7 +9,7 @@ export class status300 extends HttpStatus {
(via agent-driven content negotiation).
For example, this code could be used to present multiple video format options,
to list files with different filename extensions, or to suggest word-sense disambiguation.`
})
});
}
}
@ -19,7 +19,7 @@ export class status301 extends HttpStatus {
code: 301,
text: 'Moved Permanently',
description: `This and all future requests should be directed to the given URI.`
})
});
}
}
@ -34,7 +34,7 @@ export class status302 extends HttpStatus {
[20] but popular browsers implemented 302 with the functionality of a 303 See Other.
Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.[21]
However, some Web applications and frameworks use the 302 status code as if it were the 303.`
})
});
}
}
@ -47,7 +47,7 @@ export class status303 extends HttpStatus {
When received in response to a POST (or PUT/DELETE),
the client should presume that the server has received the data and should issue a redirect
with a separate GET message.`
})
});
}
}
@ -60,7 +60,7 @@ export class status304 extends HttpStatus {
since the version specified by the request headers If-Modified-Since or If-None-Match.
In such case, there is no need to retransmit the resource since the client
still has a previously-downloaded copy.`
})
});
}
}
@ -73,7 +73,7 @@ export class status305 extends HttpStatus {
the address for which is provided in the response. Many HTTP clients (such as Mozilla[25]
and Internet Explorer) do not correctly handle responses with this status code,
primarily for security reasons.`
})
});
}
}
@ -83,7 +83,7 @@ export class status306 extends HttpStatus {
code: 306,
text: 'Switch Proxy',
description: `No longer used. Originally meant "Subsequent requests should use the specified proxy."`
})
});
}
}
@ -97,7 +97,7 @@ export class status307 extends HttpStatus {
In contrast to how 302 was historically implemented,
the request method is not allowed to be changed when reissuing the original request.
For example, a POST request should be repeated using another POST request.`
})
});
}
}
@ -109,6 +109,6 @@ export class status308 extends HttpStatus {
description: `The request and all future requests should be repeated using another URI.
307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
So, for example, submitting a form to a permanently redirected resource may continue smoothly.`
})
});
}
}

View File

@ -1,56 +1,52 @@
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http';
export class status400 extends HttpStatus {
constructor () {
super({
code: 400,
text: 'Bad Request',
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
})
constructor() {
super({
code: 400,
text: 'Bad Request',
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
});
}
}
export class status401 extends HttpStatus {
constructor () {
super({
code: 401,
text: 'Unauthorized',
description: `Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. See Basic access authentication and Digest access authentication.[32] 401 semantically means "unauthenticated",[33] i.e. the user does not have the necessary credentials.
constructor() {
super({
code: 401,
text: 'Unauthorized',
description: `Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. See Basic access authentication and Digest access authentication.[32] 401 semantically means "unauthenticated",[33] i.e. the user does not have the necessary credentials.
Note: Some sites issue HTTP 401 when an IP address is banned from the website (usually the website domain) and that specific address is refused permission to access a website.`
})
});
}
}
export class status402 extends HttpStatus {
constructor () {
super({
code: 402,
text: 'Payment Required',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
})
constructor() {
super({
code: 402,
text: 'Payment Required',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
export class status403 extends HttpStatus {
constructor () {
super({
code: 403,
text: 'Forbidden',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
})
constructor() {
super({
code: 403,
text: 'Forbidden',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
export class status404 extends HttpStatus {
constructor () {
super({
code: 404,
text: 'Not Found',
description: `The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.`
})
constructor() {
super({
code: 404,
text: 'Not Found',
description: `The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.`
});
}
}

View File

@ -1,115 +1,115 @@
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http';
export class status500 extends HttpStatus {
constructor () {
super({
code: 500,
text: 'Internal Server Error',
description: 'A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.'
})
constructor() {
super({
code: 500,
text: 'Internal Server Error',
description:
'A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.'
});
}
}
export class status501 extends HttpStatus {
constructor () {
super({
code: 501,
text: 'Bad Request',
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
})
constructor() {
super({
code: 501,
text: 'Bad Request',
description: `The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).`
});
}
}
export class status502 extends HttpStatus {
constructor () {
super({
code: 502,
text: 'Payment Required',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
})
constructor() {
super({
code: 502,
text: 'Payment Required',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
export class status503 extends HttpStatus {
constructor () {
super({
code: 503,
text: 'Forbidden',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
})
constructor() {
super({
code: 503,
text: 'Forbidden',
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
});
}
}
export class status504 extends HttpStatus {
constructor () {
super({
code: 504,
text: 'Gateway Time-out',
description: `The server was acting as a gateway or proxy
constructor() {
super({
code: 504,
text: 'Gateway Time-out',
description: `The server was acting as a gateway or proxy
and did not receive a timely response from the upstream server.`
})
});
}
}
export class status505 extends HttpStatus {
constructor () {
super({
code: 505,
text: 'HTTP Version Not Supported',
description: `The server does not support the HTTP protocol version used in the request.`
})
constructor() {
super({
code: 505,
text: 'HTTP Version Not Supported',
description: `The server does not support the HTTP protocol version used in the request.`
});
}
}
export class status506 extends HttpStatus {
constructor () {
super({
code: 506,
text: 'Variant Also Negotiates',
description: `Transparent content negotiation for the request results in a circular reference.`
})
constructor() {
super({
code: 506,
text: 'Variant Also Negotiates',
description: `Transparent content negotiation for the request results in a circular reference.`
});
}
}
export class status507 extends HttpStatus {
constructor () {
super({
code: 507,
text: 'Insufficient Storage',
description: `The server is unable to store the representation needed to complete the request.`
})
constructor() {
super({
code: 507,
text: 'Insufficient Storage',
description: `The server is unable to store the representation needed to complete the request.`
});
}
}
export class status508 extends HttpStatus {
constructor () {
super({
code: 508,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
})
constructor() {
super({
code: 508,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
});
}
}
export class status510 extends HttpStatus {
constructor () {
super({
code: 510,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
})
constructor() {
super({
code: 510,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
});
}
}
export class status511 extends HttpStatus {
constructor () {
super({
code: 511,
text: 'Network Authentication Required',
description: `The client needs to authenticate to gain network access.
constructor() {
super({
code: 511,
text: 'Network Authentication Required',
description: `The client needs to authenticate to gain network access.
Intended for use by intercepting proxies used to control access to the network
(e.g., "captive portals" used to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot)`
})
});
}
}
}

View File

@ -1,20 +1,23 @@
export type TStatusGroup = 'clientError' | 'serverError'
export type TStatusGroup = 'clientError' | 'serverError';
export class HttpStatus {
code: number
text: string
description: string
constructor (optionsArg: {
code: number,
text: string,
description: string
}) {
protected static statusMap: {[key:string]: HttpStatus} = {};
public static getHttpStatusByString (codeArg: number) {
return HttpStatus.statusMap[codeArg.toString()];
}
code: number;
text: string;
description: string;
constructor(optionsArg: { code: number; text: string; description: string }) {
this.code = optionsArg.code;
this.text = optionsArg.text;
this.description = optionsArg.description;
HttpStatus.statusMap[this.code.toString()] = this;
}
}
export * from './smartstatus.classes.http.1xx'
export * from './smartstatus.classes.http.2xx'
export * from './smartstatus.classes.http.3xx'
export * from './smartstatus.classes.http.4xx'
export * from './smartstatus.classes.http.5xx'
export * from './smartstatus.classes.http.1xx';
export * from './smartstatus.classes.http.2xx';
export * from './smartstatus.classes.http.3xx';
export * from './smartstatus.classes.http.4xx';
export * from './smartstatus.classes.http.5xx';

View File

@ -1,3 +1,17 @@
{
"extends": "tslint-config-standard"
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}

View File

@ -1,56 +0,0 @@
Arguments:
/home/phil/.nvm/versions/node/v7.5.0/bin/node /usr/share/yarn/bin/yarn.js add --dev tapbundle
PATH:
/home/phil/.nvm/versions/node/v7.5.0/bin:/home/phil/bin:/home/phil/.local/bin:/home/phil/bin:/home/phil/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
Yarn version:
0.22.0
Node version:
7.5.0
Platform:
linux x64
npm manifest:
{
"name": "smartstatus",
"version": "1.0.0",
"description": "status information in TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
},
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com/pkunz/smartstatus.git"
},
"author": "Lossless GmbH",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/pkunz/smartstatus/issues"
},
"homepage": "https://gitlab.com/pkunz/smartstatus#README"
}
yarn manifest:
No manifest
Lockfile:
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
Trace:
Error: https://registry.yarnpkg.com/@types/chai/-/chai-3.5.0.tgz: Request failed "503 Service Unavailable"
at Request.handleRequestError (/usr/share/yarn/lib/fetchers/tarball-fetcher.js:231:20)
at emitOne (events.js:96:13)
at Request.emit (events.js:189:7)
at Request.onRequestResponse (/usr/share/yarn/node_modules/request/request.js:1029:10)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:189:7)
at HTTPParser.parserOnIncomingClient (_http_client.js:522:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
at TLSSocket.socketOnData (_http_client.js:411:20)
at emitOne (events.js:96:13)

1727
yarn.lock

File diff suppressed because it is too large Load Diff