fix(core): update

This commit is contained in:
Philipp Kunz 2021-08-16 15:36:41 +02:00
parent aa78c3465a
commit 5734ca9444
14 changed files with 25164 additions and 839 deletions

19
.gitignore vendored
View File

@ -1,3 +1,20 @@
node_modules/
.nogit/
# artifacts
coverage/
public/
pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_*/
# custom

View File

@ -1,16 +1,16 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: "$CI_BUILD_STAGE"
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
- security
- test
- release
- metadata
# ====================
# security stage
@ -18,124 +18,114 @@ stages:
mirror:
stage: security
script:
- npmci git mirror
- npmci git mirror
only:
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
snyk:
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
- notpriv
- docker
sast:
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
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
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
- priv
- docker
allow_failure: true
# ====================
# test stage
# ====================
testLTS:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
only:
- tags
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]
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- docker
- priv
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: metadata
script:
- npmci command npm install -g typedoc typescript
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
@ -143,5 +133,5 @@ pages:
artifacts:
expire_in: 1 week
paths:
- public
- public
allow_failure: true

29
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}
}
}
}
]
}

View File

@ -1,33 +0,0 @@
# 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)
[![Dependency Status](https://david-dm.org/pushrocks/smartstatus.svg)](https://david-dm.org/pushrocks/smartstatus)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartstatus/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartstatus/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartstatus/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartstatus)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![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)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@ -1,7 +1,18 @@
{
"npmci": {
"globalNpmTools": [],
"npmRegistryUrl": "verdaccio.lossless.one",
"npmAccessLevel": "public"
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartstatus",
"shortDescription": "status information in TypeScript",
"npmPackagename": "@pushrocks/smartstatus",
"license": "MIT"
}
},
"npmci": {
"globalNpmTools": [],
"npmRegistryUrl": "verdaccio.lossless.one",
"npmAccessLevel": "public"
}
}

25617
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@
"version": "1.0.7",
"private": false,
"description": "status information in TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"scripts": {
"test": "(tstest test/)",
"build": "tsbuild"
@ -20,11 +20,25 @@
},
"homepage": "https://gitlab.com/pkunz/smartstatus#README",
"devDependencies": {
"@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"
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.54",
"@pushrocks/tapbundle": "^3.2.14",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {}
}
"browserslist": [
"last 1 chrome versions"
],
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
]
}

View File

@ -13,7 +13,7 @@ export class Status100 extends HttpStatus {
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.`
The response 417 Expectation Failed indicates the request should not be continued.`,
});
}
}
@ -24,7 +24,7 @@ export class Status101 extends HttpStatus {
super({
code: 101,
text: 'Switching Protocols',
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`,
});
}
}
@ -39,7 +39,7 @@ export class Status102 extends HttpStatus {
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.`
This prevents the client from timing out and assuming the request was lost.`,
});
}
}

View File

@ -8,7 +8,7 @@ export class Status200 extends HttpStatus {
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.`
In a POST request, the response will contain an entity describing or containing the result of the action.`,
});
}
}
@ -20,7 +20,7 @@ export class Status201 extends HttpStatus {
super({
code: 201,
text: 'Created',
description: `The request has been fulfilled, resulting in the creation of a new resource.`
description: `The request has been fulfilled, resulting in the creation of a new resource.`,
});
}
}
@ -33,7 +33,7 @@ export class Status202 extends HttpStatus {
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.`
The request might or might not be eventually acted upon, and may be disallowed when processing occurs.`,
});
}
}
@ -46,7 +46,7 @@ export class Status203 extends HttpStatus {
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.`
that received a 200 OK from its origin, but is returning a modified version of the origin's response.`,
});
}
}
@ -58,7 +58,7 @@ export class Status204 extends HttpStatus {
super({
code: 204,
text: 'Non-Authoritative Information',
description: `The server successfully processed the request and is not returning any content.`
description: `The server successfully processed the request and is not returning any content.`,
});
}
}
@ -71,7 +71,7 @@ export class Status205 extends HttpStatus {
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.`
Unlike a 204 response, this response requires that the requester reset the document view.`,
});
}
}
@ -86,7 +86,7 @@ export class Status206 extends HttpStatus {
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.`
or split a download into multiple simultaneous streams.`,
});
}
}
@ -100,7 +100,7 @@ export class Status207 extends HttpStatus {
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.`
depending on how many sub-requests were made.`,
});
}
}
@ -114,7 +114,7 @@ export class Status208 extends HttpStatus {
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.`
and are not being included again.`,
});
}
}
@ -128,7 +128,7 @@ export class Status226 extends HttpStatus {
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.`
applied to the current instance.`,
});
}
}

View File

@ -8,7 +8,7 @@ export class Status300 extends HttpStatus {
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.`
to list files with different filename extensions, or to suggest word-sense disambiguation.`,
});
}
}
@ -20,7 +20,7 @@ export class Status301 extends HttpStatus {
super({
code: 301,
text: 'Moved Permanently',
description: `This and all future requests should be directed to the given URI.`
description: `This and all future requests should be directed to the given URI.`,
});
}
}
@ -37,7 +37,7 @@ export class Status302 extends HttpStatus {
(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.`
However, some Web applications and frameworks use the 302 status code as if it were the 303.`,
});
}
}
@ -52,7 +52,7 @@ export class Status303 extends HttpStatus {
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.`
with a separate GET message.`,
});
}
}
@ -67,7 +67,7 @@ export class Status304 extends HttpStatus {
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.`
still has a previously-downloaded copy.`,
});
}
}
@ -82,7 +82,7 @@ export class Status305 extends HttpStatus {
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.`
primarily for security reasons.`,
});
}
}
@ -94,7 +94,7 @@ export class Status306 extends HttpStatus {
super({
code: 306,
text: 'Switch Proxy',
description: `No longer used. Originally meant "Subsequent requests should use the specified proxy."`
description: `No longer used. Originally meant "Subsequent requests should use the specified proxy."`,
});
}
}
@ -110,7 +110,7 @@ export class Status307 extends HttpStatus {
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.`
For example, a POST request should be repeated using another POST request.`,
});
}
}
@ -124,7 +124,7 @@ export class Status308 extends HttpStatus {
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.`
So, for example, submitting a form to a permanently redirected resource may continue smoothly.`,
});
}
}

View File

@ -5,7 +5,7 @@ export class Status400 extends HttpStatus {
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).`
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).`,
});
}
}
@ -18,7 +18,7 @@ export class Status401 extends HttpStatus {
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.`
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.`,
});
}
}
@ -30,7 +30,7 @@ export class Status402 extends HttpStatus {
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.`
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
});
}
}
@ -42,7 +42,7 @@ export class Status403 extends HttpStatus {
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.`
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
});
}
}
@ -54,7 +54,7 @@ export class Status404 extends HttpStatus {
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.`
description: `The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.`,
});
}
}
@ -66,7 +66,7 @@ export class Status429 extends HttpStatus {
super({
code: 429,
text: 'Too Many Requests',
description: `The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.`
description: `The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.`,
});
}
}

View File

@ -6,7 +6,7 @@ export class Status500 extends HttpStatus {
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.'
'A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.',
});
}
}
@ -18,7 +18,7 @@ export class Status501 extends HttpStatus {
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).`
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).`,
});
}
}
@ -30,7 +30,7 @@ export class Status502 extends HttpStatus {
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.`
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
});
}
}
@ -42,7 +42,7 @@ export class Status503 extends HttpStatus {
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.`
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
});
}
}
@ -55,7 +55,7 @@ export class Status504 extends HttpStatus {
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.`
and did not receive a timely response from the upstream server.`,
});
}
}
@ -67,7 +67,7 @@ export class Status505 extends HttpStatus {
super({
code: 505,
text: 'HTTP Version Not Supported',
description: `The server does not support the HTTP protocol version used in the request.`
description: `The server does not support the HTTP protocol version used in the request.`,
});
}
}
@ -79,7 +79,7 @@ export class Status506 extends HttpStatus {
super({
code: 506,
text: 'Variant Also Negotiates',
description: `Transparent content negotiation for the request results in a circular reference.`
description: `Transparent content negotiation for the request results in a circular reference.`,
});
}
}
@ -92,7 +92,7 @@ export class Status507 extends HttpStatus {
super({
code: 507,
text: 'Insufficient Storage',
description: `The server is unable to store the representation needed to complete the request.`
description: `The server is unable to store the representation needed to complete the request.`,
});
}
}
@ -105,7 +105,7 @@ export class Status508 extends HttpStatus {
super({
code: 508,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
description: `The server detected an infinite loop while processing the request`,
});
}
}
@ -117,7 +117,7 @@ export class Status510 extends HttpStatus {
super({
code: 510,
text: 'Loop Detected',
description: `The server detected an infinite loop while processing the request`
description: `The server detected an infinite loop while processing the request`,
});
}
}
@ -130,7 +130,7 @@ export class Status511 extends HttpStatus {
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)`
(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,12 +1,12 @@
export type TStatusGroup = 'clientError' | 'serverError';
export class HttpStatus {
public static statusMap: {[key:string]: any} = {};
public static addStatus (statusStringArg: string, statusArg: any) {
public static statusMap: { [key: string]: any } = {};
public static addStatus(statusStringArg: string, statusArg: any) {
HttpStatus.statusMap[statusStringArg] = statusArg;
}
public static getHttpStatusByString (codeStringArg: string): HttpStatus {
const statusInstance = new (HttpStatus.statusMap[codeStringArg])();
public static getHttpStatusByString(codeStringArg: string): HttpStatus {
const statusInstance = new HttpStatus.statusMap[codeStringArg]();
return statusInstance;
}
public code: number;