Compare commits
No commits in common. "master" and "v1.0.1" have entirely different histories.
@ -1,66 +0,0 @@
|
|||||||
name: Default (not tags)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags-ignore:
|
|
||||||
- '**'
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
|
|
||||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
|
||||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
|
||||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
|
||||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
security:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
continue-on-error: true
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install pnpm and npmci
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @ship.zone/npmci
|
|
||||||
|
|
||||||
- name: Run npm prepare
|
|
||||||
run: npmci npm prepare
|
|
||||||
|
|
||||||
- name: Audit production dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --prod
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Audit development dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --dev
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
test:
|
|
||||||
if: ${{ always() }}
|
|
||||||
needs: security
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Test stable
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm test
|
|
||||||
|
|
||||||
- name: Test build
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm build
|
|
@ -1,124 +0,0 @@
|
|||||||
name: Default (tags)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
|
|
||||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
|
||||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
|
||||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
|
||||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
security:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
continue-on-error: true
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @ship.zone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Audit production dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --prod
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Audit development dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --dev
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
test:
|
|
||||||
if: ${{ always() }}
|
|
||||||
needs: security
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @ship.zone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Test stable
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm test
|
|
||||||
|
|
||||||
- name: Test build
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm build
|
|
||||||
|
|
||||||
release:
|
|
||||||
needs: test
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @ship.zone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Release
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm publish
|
|
||||||
|
|
||||||
metadata:
|
|
||||||
needs: test
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @ship.zone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Code quality
|
|
||||||
run: |
|
|
||||||
npmci command npm install -g typescript
|
|
||||||
npmci npm install
|
|
||||||
|
|
||||||
- name: Trigger
|
|
||||||
run: npmci trigger
|
|
||||||
|
|
||||||
- name: Build docs and upload artifacts
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
pnpm install -g @git.zone/tsdoc
|
|
||||||
npmci command tsdoc
|
|
||||||
continue-on-error: true
|
|
18
.gitignore
vendored
18
.gitignore
vendored
@ -1,19 +1,3 @@
|
|||||||
.nogit/
|
node_modules/
|
||||||
|
|
||||||
# artifacts
|
|
||||||
coverage/
|
coverage/
|
||||||
public/
|
public/
|
||||||
|
|
||||||
# installs
|
|
||||||
node_modules/
|
|
||||||
|
|
||||||
# caches
|
|
||||||
.yarn/
|
|
||||||
.cache/
|
|
||||||
.rpt2_cache
|
|
||||||
|
|
||||||
# builds
|
|
||||||
dist/
|
|
||||||
dist_*/
|
|
||||||
|
|
||||||
#------# custom
|
|
71
.gitlab-ci.yml
Normal file
71
.gitlab-ci.yml
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
# gitzone standard
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .yarn/
|
||||||
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- release
|
||||||
|
- trigger
|
||||||
|
- pages
|
||||||
|
|
||||||
|
testLEGACY:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test legacy
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
testLTS:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test lts
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
testSTABLE:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test stable
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
script:
|
||||||
|
- npmci publish
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: trigger
|
||||||
|
script:
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
pages:
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
stage: pages
|
||||||
|
script:
|
||||||
|
- npmci command yarn global add npmpage
|
||||||
|
- npmci command npmpage --publish gitlab
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"command": "npm test",
|
|
||||||
"name": "Run npm test",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "node-terminal"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
26
.vscode/settings.json
vendored
26
.vscode/settings.json
vendored
@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"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"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
29
README.md
Normal file
29
README.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# smartstatus
|
||||||
|
status information in TypeScript
|
||||||
|
|
||||||
|
## Availabililty
|
||||||
|
[](https://www.npmjs.com/package/smartstatus)
|
||||||
|
[](https://GitLab.com/pushrocks/smartstatus)
|
||||||
|
[](https://github.com/pushrocks/smartstatus)
|
||||||
|
[](https://pushrocks.gitlab.io/smartstatus/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://GitLab.com/pushrocks/smartstatus/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/smartstatus/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/smartstatus)
|
||||||
|
[](https://david-dm.org/pushrocks/smartstatus)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartstatus/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartstatus)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](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)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
35
changelog.md
35
changelog.md
@ -1,35 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
## 2024-12-25 - 1.1.1 - fix(smartstatus)
|
|
||||||
Remove all tslint:disable-next-line comments for max-classes-per-file rule
|
|
||||||
|
|
||||||
- Code cleanup by removing unnecessary tslint comments for disabling max-classes-per-file rule.
|
|
||||||
|
|
||||||
## 2024-12-25 - 1.1.0 - feat(ci)
|
|
||||||
Set up GitHub Actions workflows for CI/CD
|
|
||||||
|
|
||||||
- Replaced GitLab CI with GitHub Actions for both tag and non-tag pushes.
|
|
||||||
- Implemented npm audit for security checks on both production and development dependencies.
|
|
||||||
- Enabled npm test and build steps as part of the CI workflow.
|
|
||||||
|
|
||||||
## 2024-05-29 - 1.0.12 - Documentation & Configuration
|
|
||||||
Minor updates focusing on project configuration and descriptive metadata.
|
|
||||||
|
|
||||||
- Updated project description.
|
|
||||||
- Updated tsconfig multiple times for improved TypeScript configurations.
|
|
||||||
- Adjusted npmextra.json configuration for host consistency.
|
|
||||||
|
|
||||||
## 2021-08-19 to 2024-04-14 - 1.0.11 to 1.0.12 - Core Fixes & Maintenance
|
|
||||||
A range of updates focused on core functionality and essential maintenance fixes across versions.
|
|
||||||
|
|
||||||
- Multiple core updates distributed across versions 1.0.7 to 1.0.12.
|
|
||||||
|
|
||||||
## 2019-01-02 to 2021-08-19 - 1.0.5 to 1.0.10 - Core Updates
|
|
||||||
Core functionality was reviewed and updated multiple times to ensure stability and improved performance.
|
|
||||||
|
|
||||||
## 2017-04-06 to 2019-01-02 - 1.0.0 to 1.0.4 - Initial Development & Feature Implementations
|
|
||||||
The initial stages of development including major feature implementations across status codes and basic framework setup.
|
|
||||||
|
|
||||||
- Initial setup completed with basic framework and configuration.
|
|
||||||
- Implemented handling of 1xx to 5xx range of status codes.
|
|
||||||
- Added continuous integration and initial testing protocols.
|
|
6
dist/index.d.ts
vendored
Normal file
6
dist/index.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
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
Normal file
13
dist/index.js
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
"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
|
10
dist/smartstatus.classes.http.1xx.d.ts
vendored
Normal file
10
dist/smartstatus.classes.http.1xx.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
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();
|
||||||
|
}
|
46
dist/smartstatus.classes.http.1xx.js
vendored
Normal file
46
dist/smartstatus.classes.http.1xx.js
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
"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
|
31
dist/smartstatus.classes.http.2xx.d.ts
vendored
Normal file
31
dist/smartstatus.classes.http.2xx.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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();
|
||||||
|
}
|
119
dist/smartstatus.classes.http.2xx.js
vendored
Normal file
119
dist/smartstatus.classes.http.2xx.js
vendored
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
"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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjJ4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RhdHVzLmNsYXNzZXMuaHR0cC4yeHgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5RUFBcUU7QUFFckUsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLElBQUk7WUFDVixXQUFXLEVBQUU7OztrSEFHNkY7U0FDM0csQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBWEQsOEJBV0M7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsU0FBUztZQUNmLFdBQVcsRUFBRSw4RUFBOEU7U0FDNUYsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsVUFBVTtZQUNoQixXQUFXLEVBQUU7K0dBQzBGO1NBQ3hHLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVRELDhCQVNDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLCtCQUErQjtZQUNyQyxXQUFXLEVBQUU7OEdBQ3lGO1NBQ3ZHLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVRELDhCQVNDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLCtCQUErQjtZQUNyQyxXQUFXLEVBQUUsaUZBQWlGO1NBQy9GLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVJELDhCQVFDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGVBQWU7WUFDckIsV0FBVyxFQUFFO2tHQUM2RTtTQUMzRixDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFURCw4QkFTQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxpQkFBaUI7WUFDdkIsV0FBVyxFQUFFOzs7Z0VBRzJDO1NBQ3pELENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVhELDhCQVdDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGNBQWM7WUFDcEIsV0FBVyxFQUFFOztzREFFaUM7U0FDL0MsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBVkQsOEJBVUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsa0JBQWtCO1lBQ3hCLFdBQVcsRUFBRTs7MENBRXFCO1NBQ25DLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVZELDhCQVVDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLFNBQVM7WUFDZixXQUFXLEVBQUU7O3lDQUVvQjtTQUNsQyxDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFWRCw4QkFVQyJ9
|
28
dist/smartstatus.classes.http.3xx.d.ts
vendored
Normal file
28
dist/smartstatus.classes.http.3xx.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
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();
|
||||||
|
}
|
117
dist/smartstatus.classes.http.3xx.js
vendored
Normal file
117
dist/smartstatus.classes.http.3xx.js
vendored
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
"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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjN4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RhdHVzLmNsYXNzZXMuaHR0cC4zeHgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5RUFBcUU7QUFFckUsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNFLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLG1CQUFtQjtZQUN6QixXQUFXLEVBQUU7OzttR0FHZ0Y7U0FDOUYsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNGO0FBWEQsOEJBV0M7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0UsS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsbUJBQW1CO1lBQ3pCLFdBQVcsRUFBRSxtRUFBbUU7U0FDakYsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0UsS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsT0FBTztZQUNiLFdBQVcsRUFBRTs7Ozs7cUdBS2tGO1NBQ2hHLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDRjtBQWJELDhCQWFDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNFLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLFdBQVc7WUFDakIsV0FBVyxFQUFFOzs7cUNBR2tCO1NBQ2hDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDRjtBQVhELDhCQVdDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNFLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGNBQWM7WUFDcEIsV0FBVyxFQUFFOzs7Z0RBRzZCO1NBQzNDLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDRjtBQVhELDhCQVdDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNFLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLFdBQVc7WUFDakIsV0FBVyxFQUFFOzs7d0NBR3FCO1NBQ25DLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDRjtBQVhELDhCQVdDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNFLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGNBQWM7WUFDcEIsV0FBVyxFQUFFLHdGQUF3RjtTQUN0RyxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ0Y7QUFSRCw4QkFRQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDRSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxvQkFBb0I7WUFDMUIsV0FBVyxFQUFFOzs7O2lGQUk4RDtTQUM1RSxDQUFDLENBQUE7SUFDSixDQUFDO0NBQ0Y7QUFaRCw4QkFZQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDRSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxvQkFBb0I7WUFDMUIsV0FBVyxFQUFFOztxR0FFa0Y7U0FDaEcsQ0FBQyxDQUFBO0lBQ0osQ0FBQztDQUNGO0FBVkQsOEJBVUMifQ==
|
16
dist/smartstatus.classes.http.4xx.d.ts
vendored
Normal file
16
dist/smartstatus.classes.http.4xx.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
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();
|
||||||
|
}
|
55
dist/smartstatus.classes.http.4xx.js
vendored
Normal file
55
dist/smartstatus.classes.http.4xx.js
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
"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
|
34
dist/smartstatus.classes.http.5xx.d.ts
vendored
Normal file
34
dist/smartstatus.classes.http.5xx.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
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();
|
||||||
|
}
|
117
dist/smartstatus.classes.http.5xx.js
vendored
Normal file
117
dist/smartstatus.classes.http.5xx.js
vendored
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
"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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdGF0dXMuY2xhc3Nlcy5odHRwLjV4eC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RhdHVzLmNsYXNzZXMuaHR0cC41eHgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5RUFBcUU7QUFFckUsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLHVCQUF1QjtZQUM3QixXQUFXLEVBQUUsdUhBQXVIO1NBQ3JJLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVJELDhCQVFDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGFBQWE7WUFDbkIsV0FBVyxFQUFFLG9NQUFvTTtTQUNsTixDQUFDLENBQUE7SUFDTixDQUFDO0NBRUY7QUFURCw4QkFTQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxrQkFBa0I7WUFDeEIsV0FBVyxFQUFFLDZIQUE2SDtTQUMzSSxDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFSRCw4QkFRQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxXQUFXO1lBQ2pCLFdBQVcsRUFBRSw2SEFBNkg7U0FDM0ksQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsa0JBQWtCO1lBQ3hCLFdBQVcsRUFBRTswRUFDcUQ7U0FDbkUsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBVEQsOEJBU0M7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsNEJBQTRCO1lBQ2xDLFdBQVcsRUFBRSw0RUFBNEU7U0FDMUYsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUseUJBQXlCO1lBQy9CLFdBQVcsRUFBRSxrRkFBa0Y7U0FDaEcsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsc0JBQXNCO1lBQzVCLFdBQVcsRUFBRSxrRkFBa0Y7U0FDaEcsQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBUkQsOEJBUUM7QUFFRCxlQUF1QixTQUFRLHFDQUFVO0lBQ3ZDO1FBQ0ksS0FBSyxDQUFDO1lBQ0osSUFBSSxFQUFFLEdBQUc7WUFDVCxJQUFJLEVBQUUsZUFBZTtZQUNyQixXQUFXLEVBQUUsbUVBQW1FO1NBQ2pGLENBQUMsQ0FBQTtJQUNOLENBQUM7Q0FDRjtBQVJELDhCQVFDO0FBRUQsZUFBdUIsU0FBUSxxQ0FBVTtJQUN2QztRQUNJLEtBQUssQ0FBQztZQUNKLElBQUksRUFBRSxHQUFHO1lBQ1QsSUFBSSxFQUFFLGVBQWU7WUFDckIsV0FBVyxFQUFFLG1FQUFtRTtTQUNqRixDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0Y7QUFSRCw4QkFRQztBQUVELGVBQXVCLFNBQVEscUNBQVU7SUFDdkM7UUFDSSxLQUFLLENBQUM7WUFDSixJQUFJLEVBQUUsR0FBRztZQUNULElBQUksRUFBRSxpQ0FBaUM7WUFDdkMsV0FBVyxFQUFFOzsySUFFc0g7U0FDcEksQ0FBQyxDQUFBO0lBQ04sQ0FBQztDQUNGO0FBVkQsOEJBVUMifQ==
|
16
dist/smartstatus.classes.http.d.ts
vendored
Normal file
16
dist/smartstatus.classes.http.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
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';
|
16
dist/smartstatus.classes.http.js
vendored
Normal file
16
dist/smartstatus.classes.http.js
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
"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==
|
29
docs/index.md
Normal file
29
docs/index.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# smartstatus
|
||||||
|
status information in TypeScript
|
||||||
|
|
||||||
|
## Availabililty
|
||||||
|
[](https://www.npmjs.com/package/smartstatus)
|
||||||
|
[](https://GitLab.com/pushrocks/smartstatus)
|
||||||
|
[](https://github.com/pushrocks/smartstatus)
|
||||||
|
[](https://pushrocks.gitlab.io/smartstatus/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://GitLab.com/pushrocks/smartstatus/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/smartstatus/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/smartstatus)
|
||||||
|
[](https://david-dm.org/pushrocks/smartstatus)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartstatus/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartstatus)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](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)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
@ -1,37 +1,7 @@
|
|||||||
{
|
{
|
||||||
"gitzone": {
|
"npmci": {
|
||||||
"projectType": "npm",
|
"globalNpmTools": [
|
||||||
"module": {
|
"npmts"
|
||||||
"githost": "code.foss.global",
|
]
|
||||||
"gitscope": "push.rocks",
|
|
||||||
"gitrepo": "smartstatus",
|
|
||||||
"shortDescription": "status information in TypeScript",
|
|
||||||
"npmPackagename": "@push.rocks/smartstatus",
|
|
||||||
"license": "MIT",
|
|
||||||
"description": "A TypeScript library for managing HTTP status codes, providing detailed classes for each status to enhance HTTP error and response handling.",
|
|
||||||
"keywords": [
|
|
||||||
"TypeScript",
|
|
||||||
"HTTP",
|
|
||||||
"status codes",
|
|
||||||
"error handling",
|
|
||||||
"client errors",
|
|
||||||
"server errors",
|
|
||||||
"response management",
|
|
||||||
"error management",
|
|
||||||
"API development",
|
|
||||||
"express.js",
|
|
||||||
"web applications",
|
|
||||||
"network services",
|
|
||||||
"custom status codes"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"npmci": {
|
|
||||||
"globalNpmTools": [],
|
|
||||||
"npmRegistryUrl": "verdaccio.lossless.one",
|
|
||||||
"npmAccessLevel": "public"
|
|
||||||
},
|
|
||||||
"tsdoc": {
|
|
||||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
|
||||||
}
|
|
||||||
}
|
}
|
60
package.json
60
package.json
@ -1,61 +1,23 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartstatus",
|
"name": "smartstatus",
|
||||||
"version": "1.1.1",
|
"version": "1.0.1",
|
||||||
"private": false,
|
"description": "status information in TypeScript",
|
||||||
"description": "A TypeScript library for managing HTTP status codes, providing detailed classes for each status to enhance HTTP error and response handling.",
|
"main": "dist/index.js",
|
||||||
"type": "module",
|
"typings": "dist/index.d.ts",
|
||||||
"exports": {
|
|
||||||
".": "./dist_ts/index.js"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(npmts)"
|
||||||
"build": "tsbuild --web",
|
|
||||||
"buildDocs": "tsdoc"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://code.foss.global/push.rocks/smartstatus.git"
|
"url": "git+ssh://git@gitlab.com/pkunz/smartstatus.git"
|
||||||
},
|
},
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://code.foss.global/push.rocks/smartstatus/issues"
|
"url": "https://gitlab.com/pkunz/smartstatus/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://code.foss.global/push.rocks/smartstatus#readme",
|
"homepage": "https://gitlab.com/pkunz/smartstatus#README",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.25",
|
"tapbundle": "^1.0.5"
|
||||||
"@git.zone/tsrun": "^1.3.3",
|
}
|
||||||
"@git.zone/tstest": "^1.0.54",
|
|
||||||
"@push.rocks/tapbundle": "^5.5.3"
|
|
||||||
},
|
|
||||||
"browserslist": [
|
|
||||||
"last 1 chrome versions"
|
|
||||||
],
|
|
||||||
"files": [
|
|
||||||
"ts/**/*",
|
|
||||||
"ts_web/**/*",
|
|
||||||
"dist/**/*",
|
|
||||||
"dist_*/**/*",
|
|
||||||
"dist_ts/**/*",
|
|
||||||
"dist_ts_web/**/*",
|
|
||||||
"assets/**/*",
|
|
||||||
"cli.js",
|
|
||||||
"npmextra.json",
|
|
||||||
"readme.md"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"TypeScript",
|
|
||||||
"HTTP",
|
|
||||||
"status codes",
|
|
||||||
"error handling",
|
|
||||||
"client errors",
|
|
||||||
"server errors",
|
|
||||||
"response management",
|
|
||||||
"error management",
|
|
||||||
"API development",
|
|
||||||
"express.js",
|
|
||||||
"web applications",
|
|
||||||
"network services",
|
|
||||||
"custom status codes"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
9627
pnpm-lock.yaml
generated
9627
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
|
|
220
readme.md
220
readme.md
@ -1,220 +0,0 @@
|
|||||||
# @push.rocks/smartstatus
|
|
||||||
|
|
||||||
A TypeScript library for managing HTTP status information, with detailed status classes.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
To install `@push.rocks/smartstatus`, use npm (or yarn, or pnpm) by running the following command in your terminal:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install @push.rocks/smartstatus --save
|
|
||||||
```
|
|
||||||
|
|
||||||
Ensure you have TypeScript and a package to work with TypeScript in your project. If not, you might want to install TypeScript and ts-node (for development purposes) to your project:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install typescript ts-node --save-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
The `@push.rocks/smartstatus` library provides a structured and comprehensive way to handle HTTP status codes in TypeScript, enhancing your ability to manage HTTP responses effectively. Below, we outline an extensive set of scenarios demonstrating how you can leverage this module's capabilities to streamline and enrich your response handling from server-side applications to API endpoints.
|
|
||||||
|
|
||||||
### Getting Started
|
|
||||||
|
|
||||||
To start using `@push.rocks/smartstatus`, ensure you import the module into your TypeScript files. Here's a basic import statement you can use:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import * as smartstatus from '@push.rocks/smartstatus';
|
|
||||||
```
|
|
||||||
|
|
||||||
For more specific imports, such as obtaining particular HTTP status code classes, you may use:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { HttpStatus, Status404, Status200 } from '@push.rocks/smartstatus';
|
|
||||||
```
|
|
||||||
|
|
||||||
### Retrieving a Specific Status
|
|
||||||
|
|
||||||
The library allows you to retrieve any HTTP status code with its corresponding information quickly. You can do this by using either a class representation for known statuses or using a method that fetches the status by its status code string.
|
|
||||||
|
|
||||||
#### Example: Fetching 404 Not Found Status
|
|
||||||
|
|
||||||
Let's say you wish to work with the HTTP 404 "Not Found" status. You can retrieve its details as follows:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { HttpStatus } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
const notFoundStatus = HttpStatus.getHttpStatusByString('404');
|
|
||||||
console.log(notFoundStatus.code); // 404
|
|
||||||
console.log(notFoundStatus.text); // Not Found
|
|
||||||
console.log(notFoundStatus.description); // The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.
|
|
||||||
```
|
|
||||||
|
|
||||||
The `getHttpStatusByString` function dynamically returns an instance of the respective status class with fields like HTTP code, textual representation, and an insightful description of the status.
|
|
||||||
|
|
||||||
### Handling Errors Using HTTP Statuses
|
|
||||||
|
|
||||||
One of the most valuable features of `@push.rocks/smartstatus` is enriching error handling protocols in web applications or APIs. Let's illustrate how smartstatus can be used with an Express.js framework to enhance HTTP response management, specifically handling different HTTP error statuses.
|
|
||||||
|
|
||||||
#### Example: Implementing with Express.js
|
|
||||||
|
|
||||||
Imagine you are developing a web service, and a specific operation fails due to an authorization issue. Here's how you might use smartstatus to handle this error gracefully:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import express from 'express';
|
|
||||||
import { HttpStatus } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
const app = express();
|
|
||||||
|
|
||||||
app.get('/secure/data', (req, res) => {
|
|
||||||
// Simulating an authorization failure condition
|
|
||||||
const userIsAuthorized = false;
|
|
||||||
|
|
||||||
if (!userIsAuthorized) {
|
|
||||||
const unauthorizedStatus = HttpStatus.getHttpStatusByString('401');
|
|
||||||
res.status(unauthorizedStatus.code).json({
|
|
||||||
error: unauthorizedStatus.text,
|
|
||||||
message: unauthorizedStatus.description,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.status(200).send('Secure Data');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(3000, () => {
|
|
||||||
console.log('Server running on port 3000');
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
In this express app endpoint, if the user is not authorized to access the resource, it responds with a 401 Unauthorized status. This status code is enriched with a detailed message derived from smartstatus, providing a helpful explanation to API consumers.
|
|
||||||
|
|
||||||
### Extending with Custom Statuses
|
|
||||||
|
|
||||||
While `@push.rocks/smartstatus` covers standard HTTP statuses, the library also allows you to define and manage custom status codes tailored to specific application needs. This is particularly useful for internal APIs requiring bespoke statuses.
|
|
||||||
|
|
||||||
#### Example: Creating a Custom HTTP Status
|
|
||||||
|
|
||||||
Let's say you want to create a unique status for indicating a special condition encountered by your application, such as a "Processing Error" that is represented by code 499. Define a custom status class as follows:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { HttpStatus } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
class Status499 extends HttpStatus {
|
|
||||||
constructor() {
|
|
||||||
super({
|
|
||||||
code: 499,
|
|
||||||
text: 'Processing Error',
|
|
||||||
description:
|
|
||||||
'The server encountered a processing error which prevented it from completing the request.',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register the custom status for use
|
|
||||||
HttpStatus.addStatus('499', Status499);
|
|
||||||
|
|
||||||
// Usage of the custom status
|
|
||||||
const processingErrorStatus = HttpStatus.getHttpStatusByString('499');
|
|
||||||
console.log(`${processingErrorStatus.code} ${processingErrorStatus.text}`); // 499 Processing Error
|
|
||||||
```
|
|
||||||
|
|
||||||
This custom status can then be used in the same way as predefined statuses in the library, allowing you to handle unique responses efficiently.
|
|
||||||
|
|
||||||
### Comprehensive Examples Across HTTP Status Ranges
|
|
||||||
|
|
||||||
The `smartstatus` library classifies statuses across different ranges (1xx, 2xx, 3xx, 4xx, and 5xx). Here, we will demonstrate how to handle each of these categories to provide robustness in response management.
|
|
||||||
|
|
||||||
#### Informational Responses (1xx)
|
|
||||||
|
|
||||||
Status codes in the 1xx range inform the client about the progress of the request. These are mostly used in scenarios involving continuation or switching protocols.
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { Status100 } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
// Handling 100 Continue status
|
|
||||||
const continueStatus = new Status100();
|
|
||||||
console.log(continueStatus.code, continueStatus.text, continueStatus.description);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Successful Responses (2xx)
|
|
||||||
|
|
||||||
The 2xx successes indicate that the client's request was received, understood, and accepted. Utilizing these codes effectively can aid in confirming successful API operations.
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { Status200, Status201 } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
// 200 OK status for successfully processed requests
|
|
||||||
const okStatus = new Status200();
|
|
||||||
console.log(okStatus.code, okStatus.text, okStatus.description);
|
|
||||||
|
|
||||||
// 201 Created status for resource creation
|
|
||||||
const createdStatus = new Status201();
|
|
||||||
console.log(createdStatus.code, createdStatus.text, createdStatus.description);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Redirection Messages (3xx)
|
|
||||||
|
|
||||||
Statuses in the 3xx range indicate redirection, offering guidance on how the client can access different resources or follow up with another request.
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { Status301, Status302 } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
// Permanent and Temporary redirects
|
|
||||||
const movedPermanentlyStatus = new Status301();
|
|
||||||
console.log(movedPermanentlyStatus.text); // Moved Permanently
|
|
||||||
|
|
||||||
const foundStatus = new Status302();
|
|
||||||
console.log(foundStatus.text); // Found
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Client Error Responses (4xx)
|
|
||||||
|
|
||||||
This class of status codes is intended to inform the client that the error seems to have been caused by the client, such as a malformed request.
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { Status400, Status404 } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
// Using 400 Bad Request for malformed requests
|
|
||||||
const badRequestStatus = new Status400();
|
|
||||||
console.log(badRequestStatus.description);
|
|
||||||
|
|
||||||
// Handling 404 Not Found for missing resources
|
|
||||||
const notFoundStatus = new Status404();
|
|
||||||
console.log(notFoundStatus.description);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Server Error Responses (5xx)
|
|
||||||
|
|
||||||
5xx indicates server-side errors, signaling the server is aware it encountered an error or is otherwise incapable of performing the request.
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { Status500, Status503 } from '@push.rocks/smartstatus';
|
|
||||||
|
|
||||||
// Internal server error handling
|
|
||||||
const internalServerErrorStatus = new Status500();
|
|
||||||
console.log(internalServerErrorStatus.text);
|
|
||||||
|
|
||||||
// Service unavailable handling with a 503 response
|
|
||||||
const serviceUnavailableStatus = new Status503();
|
|
||||||
console.log(serviceUnavailableStatus.description);
|
|
||||||
```
|
|
||||||
|
|
||||||
## License and Legal Information
|
|
||||||
|
|
||||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
||||||
|
|
||||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
### Trademarks
|
|
||||||
|
|
||||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
|
||||||
|
|
||||||
### Company Information
|
|
||||||
|
|
||||||
Task Venture Capital GmbH
|
|
||||||
Registered at District court Bremen HRB 35230 HB, Germany
|
|
||||||
|
|
||||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
|
||||||
|
|
||||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
14
test/test.ts
14
test/test.ts
@ -1,10 +1,8 @@
|
|||||||
import { expect, tap } from '@push.rocks/tapbundle';
|
import { expect, tap } from 'tapbundle'
|
||||||
|
|
||||||
import * as smartstatus from '../ts/index.js';
|
import * as smartstatus from '../dist/index'
|
||||||
|
|
||||||
tap.test('should get a status by codeString', async () => {
|
tap.test('should create valid status classes', async () => {
|
||||||
const status = smartstatus.HttpStatus.getHttpStatusByString('404');
|
let myStatus301 = new smartstatus.status301()
|
||||||
console.log(status);
|
return expect(myStatus301).to.be.instanceOf(smartstatus.HttpStatus)
|
||||||
});
|
})
|
||||||
|
|
||||||
tap.start();
|
|
@ -1,8 +0,0 @@
|
|||||||
/**
|
|
||||||
* autocreated commitinfo by @push.rocks/commitinfo
|
|
||||||
*/
|
|
||||||
export const commitinfo = {
|
|
||||||
name: '@push.rocks/smartstatus',
|
|
||||||
version: '1.1.1',
|
|
||||||
description: 'A TypeScript library for managing HTTP status codes, providing detailed classes for each status to enhance HTTP error and response handling.'
|
|
||||||
}
|
|
12
ts/index.ts
12
ts/index.ts
@ -1,7 +1,7 @@
|
|||||||
export * from './smartstatus.classes.http.1xx.js';
|
export { HttpStatus } from './smartstatus.classes.http'
|
||||||
export * from './smartstatus.classes.http.2xx.js';
|
|
||||||
export * from './smartstatus.classes.http.3xx.js';
|
|
||||||
export * from './smartstatus.classes.http.4xx.js';
|
|
||||||
export * from './smartstatus.classes.http.5xx.js';
|
|
||||||
|
|
||||||
export * from './smartstatus.classes.http.js';
|
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'
|
@ -1,11 +1,11 @@
|
|||||||
import { HttpStatus, type TStatusGroup } from './smartstatus.classes.http.js';
|
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
|
||||||
|
|
||||||
export class Status100 extends HttpStatus {
|
export class status100 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 100,
|
code: 100,
|
||||||
text: 'Continue',
|
text: 'Continue',
|
||||||
description: `The server has received the request headers and the client
|
description: `The server has received the request headers and the client
|
||||||
should proceed to send the request body
|
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).
|
(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
|
Sending a large request body to a server after a request has been rejected
|
||||||
@ -13,34 +13,31 @@ export class Status100 extends HttpStatus {
|
|||||||
To have a server check the request's headers,
|
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 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.
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('100', Status100);
|
|
||||||
|
|
||||||
export class Status101 extends HttpStatus {
|
export class status101 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 101,
|
code: 101,
|
||||||
text: 'Switching Protocols',
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('101', Status101);
|
|
||||||
|
|
||||||
export class Status102 extends HttpStatus {
|
export class status102 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 102,
|
code: 102,
|
||||||
text: 'Non-Authoritative Information',
|
text: 'Non-Authoritative Information',
|
||||||
description: `A WebDAV request may contain many sub-requests involving file operations,
|
description: `A WebDAV request may contain many sub-requests involving file operations,
|
||||||
requiring a long time to complete the request.
|
requiring a long time to complete the request.
|
||||||
This code indicates that the server has received and is processing the request,
|
This code indicates that the server has received and is processing the request,
|
||||||
but no response is available yet.[6]
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('102', Status102);
|
|
||||||
|
@ -1,126 +1,116 @@
|
|||||||
import { HttpStatus, type TStatusGroup } from './smartstatus.classes.http.js';
|
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
|
||||||
|
|
||||||
export class Status200 extends HttpStatus {
|
export class status200 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 200,
|
code: 200,
|
||||||
text: 'OK',
|
text: 'OK',
|
||||||
description: `Standard response for successful HTTP requests.
|
description: `Standard response for successful HTTP requests.
|
||||||
The actual response will depend on the request method used.
|
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 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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('200', Status200);
|
|
||||||
|
|
||||||
export class Status201 extends HttpStatus {
|
export class status201 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 201,
|
code: 201,
|
||||||
text: 'Created',
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('201', Status201);
|
|
||||||
|
|
||||||
export class Status202 extends HttpStatus {
|
export class status202 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 202,
|
code: 202,
|
||||||
text: 'Accepted',
|
text: 'Accepted',
|
||||||
description: `The request has been accepted for processing, but the processing has not been completed.
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('202', Status202);
|
|
||||||
|
|
||||||
export class Status203 extends HttpStatus {
|
export class status203 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 203,
|
code: 203,
|
||||||
text: 'Non-Authoritative Information',
|
text: 'Non-Authoritative Information',
|
||||||
description: `The server is a transforming proxy (e.g. a Web accelerator)
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('203', Status203);
|
|
||||||
|
|
||||||
export class Status204 extends HttpStatus {
|
export class status204 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 204,
|
code: 204,
|
||||||
text: 'Non-Authoritative Information',
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('204', Status204);
|
|
||||||
|
|
||||||
export class Status205 extends HttpStatus {
|
export class status205 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 205,
|
code: 205,
|
||||||
text: 'Reset Content',
|
text: 'Reset Content',
|
||||||
description: `The server successfully processed the request, but is not returning any 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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('205', Status205);
|
|
||||||
|
|
||||||
export class Status206 extends HttpStatus {
|
export class status206 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 206,
|
code: 206,
|
||||||
text: 'Partial Content',
|
text: 'Partial Content',
|
||||||
description: `The server is delivering only part of the resource (byte serving)
|
description: `The server is delivering only part of the resource (byte serving)
|
||||||
due to a range header sent by the client.
|
due to a range header sent by the client.
|
||||||
The range header is used by HTTP clients to enable resuming of interrupted downloads,
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('206', Status206);
|
|
||||||
|
|
||||||
export class Status207 extends HttpStatus {
|
export class status207 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 207,
|
code: 207,
|
||||||
text: 'Multi-Status',
|
text: 'Multi-Status',
|
||||||
description: `The message body that follows is an XML message
|
description: `The message body that follows is an XML message
|
||||||
and can contain a number of separate response codes,
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('207', Status207);
|
|
||||||
|
|
||||||
export class Status208 extends HttpStatus {
|
export class status208 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 208,
|
code: 208,
|
||||||
text: 'Already Reported',
|
text: 'Already Reported',
|
||||||
description: `The members of a DAV binding have already been enumerated
|
description: `The members of a DAV binding have already been enumerated
|
||||||
in a preceding part of the (multistatus) response,
|
in a preceding part of the (multistatus) response,
|
||||||
and are not being included again.`,
|
and are not being included again.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('208', Status208);
|
|
||||||
|
|
||||||
export class Status226 extends HttpStatus {
|
export class status226 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 226,
|
code: 226,
|
||||||
text: 'IM Used',
|
text: 'IM Used',
|
||||||
description: `The server has fulfilled a request for the resource,
|
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
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('226', Status226);
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { HttpStatus, type TStatusGroup } from './smartstatus.classes.http.js';
|
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
|
||||||
|
|
||||||
export class Status300 extends HttpStatus {
|
export class status300 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 300,
|
code: 300,
|
||||||
@ -8,24 +8,22 @@ export class Status300 extends HttpStatus {
|
|||||||
description: `Indicates multiple options for the resource from which the client may choose
|
description: `Indicates multiple options for the resource from which the client may choose
|
||||||
(via agent-driven content negotiation).
|
(via agent-driven content negotiation).
|
||||||
For example, this code could be used to present multiple video format options,
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('300', Status300);
|
|
||||||
|
|
||||||
export class Status301 extends HttpStatus {
|
export class status301 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 301,
|
code: 301,
|
||||||
text: 'Moved Permanently',
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('301', Status301);
|
|
||||||
|
|
||||||
export class Status302 extends HttpStatus {
|
export class status302 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 302,
|
code: 302,
|
||||||
@ -35,13 +33,12 @@ export class Status302 extends HttpStatus {
|
|||||||
(the original describing phrase was "Moved Temporarily"),
|
(the original describing phrase was "Moved Temporarily"),
|
||||||
[20] but popular browsers implemented 302 with the functionality of a 303 See Other.
|
[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]
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('302', Status302);
|
|
||||||
|
|
||||||
export class Status303 extends HttpStatus {
|
export class status303 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 303,
|
code: 303,
|
||||||
@ -49,13 +46,12 @@ export class Status303 extends HttpStatus {
|
|||||||
description: `The response to the request can be found under another URI using a GET method.
|
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),
|
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
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('303', Status303);
|
|
||||||
|
|
||||||
export class Status304 extends HttpStatus {
|
export class status304 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 304,
|
code: 304,
|
||||||
@ -63,13 +59,12 @@ export class Status304 extends HttpStatus {
|
|||||||
description: `Indicates that the resource has not been 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.
|
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
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('304', Status304);
|
|
||||||
|
|
||||||
export class Status305 extends HttpStatus {
|
export class status305 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 305,
|
code: 305,
|
||||||
@ -77,24 +72,22 @@ export class Status305 extends HttpStatus {
|
|||||||
description: `The requested resource is available only through a 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]
|
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,
|
and Internet Explorer) do not correctly handle responses with this status code,
|
||||||
primarily for security reasons.`,
|
primarily for security reasons.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('305', Status305);
|
|
||||||
|
|
||||||
export class Status306 extends HttpStatus {
|
export class status306 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 306,
|
code: 306,
|
||||||
text: 'Switch Proxy',
|
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."`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('306', Status306);
|
|
||||||
|
|
||||||
export class Status307 extends HttpStatus {
|
export class status307 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 307,
|
code: 307,
|
||||||
@ -103,21 +96,19 @@ export class Status307 extends HttpStatus {
|
|||||||
however, future requests should still use the original URI.
|
however, future requests should still use the original URI.
|
||||||
In contrast to how 302 was historically implemented,
|
In contrast to how 302 was historically implemented,
|
||||||
the request method is not allowed to be changed when reissuing the original request.
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('307', Status307);
|
|
||||||
|
|
||||||
export class Status308 extends HttpStatus {
|
export class status308 extends HttpStatus {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
code: 308,
|
code: 308,
|
||||||
text: 'Permanent Redirect',
|
text: 'Permanent Redirect',
|
||||||
description: `The request and all future requests should be repeated using another URI.
|
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.
|
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.`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('308', Status308);
|
|
||||||
|
@ -1,68 +1,56 @@
|
|||||||
import { HttpStatus, type TStatusGroup } from './smartstatus.classes.http.js';
|
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
|
||||||
|
|
||||||
export class Status400 extends HttpStatus {
|
export class status400 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 400,
|
code: 400,
|
||||||
text: 'Bad Request',
|
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).`
|
||||||
});
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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.
|
||||||
|
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.`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('400', Status400);
|
|
||||||
|
|
||||||
export class Status401 extends HttpStatus {
|
export class status403 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 401,
|
code: 403,
|
||||||
text: 'Unauthorized',
|
text: 'Forbidden',
|
||||||
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.
|
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
|
||||||
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.`,
|
})
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('401', Status401);
|
|
||||||
|
|
||||||
export class Status402 extends HttpStatus {
|
|
||||||
constructor() {
|
|
||||||
super({
|
export class status404 extends HttpStatus {
|
||||||
code: 402,
|
constructor () {
|
||||||
text: 'Payment Required',
|
super({
|
||||||
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`,
|
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.`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('402', Status402);
|
|
||||||
|
|
||||||
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.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('403', Status403);
|
|
||||||
|
|
||||||
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.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('404', Status404);
|
|
||||||
|
|
||||||
export class Status429 extends HttpStatus {
|
|
||||||
constructor() {
|
|
||||||
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.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('429', Status429);
|
|
||||||
|
@ -1,127 +1,115 @@
|
|||||||
import { HttpStatus, type TStatusGroup } from './smartstatus.classes.http.js';
|
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http'
|
||||||
|
|
||||||
export class Status500 extends HttpStatus {
|
export class status500 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 500,
|
code: 500,
|
||||||
text: 'Internal Server Error',
|
text: 'Internal Server Error',
|
||||||
description:
|
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.',
|
})
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('500', Status500);
|
|
||||||
|
|
||||||
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).`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('501', Status501);
|
|
||||||
|
|
||||||
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.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('502', Status502);
|
|
||||||
|
|
||||||
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.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('503', Status503);
|
|
||||||
|
|
||||||
export class Status504 extends 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.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('504', Status504);
|
|
||||||
|
|
||||||
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.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('505', Status505);
|
|
||||||
|
|
||||||
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.`,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpStatus.addStatus('506', Status506);
|
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).`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export class Status507 extends HttpStatus {
|
}
|
||||||
constructor() {
|
|
||||||
super({
|
export class status502 extends HttpStatus {
|
||||||
code: 507,
|
constructor () {
|
||||||
text: 'Insufficient Storage',
|
super({
|
||||||
description: `The server is unable to store the representation needed to complete the request.`,
|
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.`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HttpStatus.addStatus('507', Status507);
|
export class status503 extends HttpStatus {
|
||||||
|
constructor () {
|
||||||
export class Status508 extends HttpStatus {
|
super({
|
||||||
constructor() {
|
code: 503,
|
||||||
super({
|
text: 'Forbidden',
|
||||||
code: 508,
|
description: `The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.`
|
||||||
text: 'Loop Detected',
|
})
|
||||||
description: `The server detected an infinite loop while processing the request`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpStatus.addStatus('508', Status508);
|
|
||||||
|
|
||||||
export class Status510 extends HttpStatus {
|
|
||||||
constructor() {
|
|
||||||
super({
|
|
||||||
code: 510,
|
|
||||||
text: 'Loop Detected',
|
|
||||||
description: `The server detected an infinite loop while processing the request`,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Status511 extends HttpStatus {
|
export class status504 extends HttpStatus {
|
||||||
constructor() {
|
constructor () {
|
||||||
super({
|
super({
|
||||||
code: 511,
|
code: 504,
|
||||||
text: 'Network Authentication Required',
|
text: 'Gateway Time-out',
|
||||||
description: `The client needs to authenticate to gain network access.
|
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.`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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.`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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.`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class status508 extends HttpStatus {
|
||||||
|
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`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class status511 extends 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
|
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)`
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HttpStatus.addStatus('511', Status511);
|
|
||||||
|
@ -1,30 +1,20 @@
|
|||||||
export type TStatusGroup = 'clientError' | 'serverError';
|
export type TStatusGroup = 'clientError' | 'serverError'
|
||||||
|
|
||||||
export class HttpStatus {
|
export class HttpStatus {
|
||||||
public static statusMap: { [key: string]: any } = {};
|
code: number
|
||||||
public static addStatus(statusStringArg: string, statusArg: any) {
|
text: string
|
||||||
HttpStatus.statusMap[statusStringArg] = statusArg;
|
description: string
|
||||||
}
|
constructor (optionsArg: {
|
||||||
public static getHttpStatusByString(codeStringArg: string): HttpStatus {
|
code: number,
|
||||||
let statusInstance: HttpStatus;
|
text: string,
|
||||||
try {
|
description: string
|
||||||
statusInstance = new HttpStatus.statusMap[codeStringArg]();
|
}) {
|
||||||
} catch {
|
|
||||||
console.log('unknown status');
|
|
||||||
return new HttpStatus({
|
|
||||||
code: 0,
|
|
||||||
text: 'unknown status',
|
|
||||||
description: `The status ${codeStringArg} is not known.`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return statusInstance;
|
|
||||||
}
|
|
||||||
public code: number;
|
|
||||||
public text: string;
|
|
||||||
public description: string;
|
|
||||||
constructor(optionsArg: { code: number; text: string; description: string }) {
|
|
||||||
this.code = optionsArg.code;
|
|
||||||
this.text = optionsArg.text;
|
|
||||||
this.description = optionsArg.description;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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'
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"useDefineForClassFields": false,
|
|
||||||
"target": "ES2022",
|
|
||||||
"module": "NodeNext",
|
|
||||||
"moduleResolution": "NodeNext",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"verbatimModuleSyntax": true,
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {}
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"dist_*/**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
3
tslint.json
Normal file
3
tslint.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "tslint-config-standard"
|
||||||
|
}
|
56
yarn-error.log
Normal file
56
yarn-error.log
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
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)
|
Loading…
x
Reference in New Issue
Block a user