Skip to content

Commit 634b1a2

Browse files
committed
documentation
1 parent 9e08510 commit 634b1a2

2 files changed

Lines changed: 73 additions & 1 deletion

File tree

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,66 @@ reflection[0].line //--> 3
373373
reflection[0].method //--> <none>
374374
reflection[0].self //--> undefined
375375
reflection[0].toObject()
376+
```
377+
378+
<a name="status"></a>
379+
380+
## Status Codes
381+
382+
Status codes inherit from http status codes and can be used to report
383+
statuses after major actions within your app has been executed.
384+
385+
```js
386+
import { Status, getStatus } from '@stackpress/lib';
387+
388+
getStatus(200) //--> { code: 200, status: 'OK' }
389+
390+
Status.CONTINUE //--> { code: 100, status: 'Continue' }
391+
Status.PROCESSING //--> { code: 102, status: 'Processing' }
392+
Status.OK //--> { code: 200, status: 'OK' }
393+
Status.CREATED //--> { code: 201, status: 'Created' }
394+
Status.ACCEPTED //--> { code: 202, status: 'Accepted' }
395+
Status.EMPTY //--> { code: 204, status: 'No Content' }
396+
Status.RESET //--> { code: 205, status: 'Reset Content' }
397+
Status.PARTIAL //--> { code: 206, status: 'Partial Content' }
398+
Status.MOVED //--> { code: 301, status: 'Moved Permanently' }
399+
Status.FOUND //--> { code: 302, status: 'Found' }
400+
Status.REDIRECT //--> { code: 303, status: 'See Other' }
401+
Status.CACHE //--> { code: 304, status: 'Not Modified' }
402+
Status.TEMPORARY //--> { code: 307, status: 'Temporary Redirect' }
403+
Status.PERMANENT //--> { code: 308, status: 'Permanent Redirect' }
404+
Status.ABORT //--> { code: 309, status: 'Aborted' }
405+
Status.BAD_REQUEST //--> { code: 400, status: 'Bad Request' }
406+
Status.UNAUTHORIZED //--> { code: 401, status: 'Unauthorized' }
407+
Status.FORBIDDEN //--> { code: 403, status: 'Forbidden' }
408+
Status.NOT_FOUND //--> { code: 404, status: 'Not Found' }
409+
Status.BAD_METHOD //--> { code: 405, status: 'Method Not Allowed' }
410+
Status.NOT_ACCEPTABLE //--> { code: 406, status: 'Not Acceptable' }
411+
Status.REQUEST_TIMEOUT //--> { code: 408, status: 'Request Timeout' }
412+
Status.CONFLICT //--> { code: 409, status: 'Conflict' }
413+
Status.GONE //--> { code: 410, status: 'Gone' }
414+
Status.LENGTH_REQUIRED //--> { code: 411, status: 'Length Required' }
415+
Status.TOO_LARGE //--> { code: 413, status: 'Payload Too Large' }
416+
Status.TOO_LONG //--> { code: 414, status: 'URI Too Long' }
417+
Status.UNSUPPORTED_TYPE //--> { code: 415, status: 'Unsupported Media Type' }
418+
Status.BAD_RANGE //--> { code: 416, status: 'Range Not Satisfiable' }
419+
Status.BAD_EXPECTATION //--> { code: 417, status: 'Expectation Failed' }
420+
Status.MISDIRECTED //--> { code: 421, status: 'Misdirected Request' }
421+
Status.UNPROCESSABLE //--> { code: 422, status: 'Unprocessable Content' }
422+
Status.LOCKED //--> { code: 423, status: 'Locked' }
423+
Status.BAD_DEPENDENCY //--> { code: 424, status: 'Failed Dependency' }
424+
Status.UPGRADE_REQUIRED //--> { code: 426, status: 'Upgrade Required' }
425+
Status.BAD_PRECONDITION //--> { code: 428, status: 'Precondition Required' }
426+
Status.TOO_MANY //--> { code: 429, status: 'Too Many Requests' }
427+
Status.HEADER_TOO_LARGE //--> { code: 431, status: 'Request Header Fields Too Large' }
428+
Status.LEGAL_REASONS //--> { code: 451, status: 'Unavailable For Legal Reasons' }
429+
Status.ERROR //--> { code: 500, status: 'Internal Server Error' }
430+
Status.NOT_IMPLEMENTED //--> { code: 501, status: 'Not Implemented' }
431+
Status.BAD_GATEWAY //--> { code: 502, status: 'Bad Gateway' }
432+
Status.UNAVAILABLE //--> { code: 503, status: 'Service Unavailable' }
433+
Status.RESPONSE_TIMEOUT //--> { code: 504, status: 'Gateway Timeout' }
434+
Status.BAD_VERSION //--> { code: 505, status: 'HTTP Version Not Supported' }
435+
Status.INSUFFICIENT_STORAGE //--> { code: 507, status: 'Insufficient Storage' }
436+
Status.INFINITE_LOOP //--> { code: 508, status: 'Loop Detected' }
437+
Status.NETWORK_AUTHENTICATION_REQUIRED //--> { code: 511, status: 'Network Authentication Required' }
376438
```

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
{
22
"name": "@stackpress/lib",
3-
"version": "0.3.20",
3+
"version": "0.3.21",
44
"license": "Apache-2.0",
55
"description": "Shared library used across stackpress projects",
66
"author": "Chris <chris@incept.asia>",
77
"homepage": "https://github.com/stackpress/lib",
88
"bugs": "https://github.com/stackpress/lib/issues",
99
"repository": "stackpress/lib",
10+
"keywords": [
11+
"ts",
12+
"typescript",
13+
"event driven",
14+
"queue",
15+
"data management",
16+
"fs",
17+
"file system",
18+
"stackpress"
19+
],
1020
"main": "index.js",
1121
"files": [
1222
"dist",

0 commit comments

Comments
 (0)