Skip to content

Commit

Permalink
feat: add http-status-codes dep (#212)
Browse files Browse the repository at this point in the history
* feat: add http-status-codes dep

* chore: pin dep

* chore: update lock file
  • Loading branch information
juanpicado authored Oct 25, 2019
1 parent dd78a8d commit 00b66af
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
3 changes: 2 additions & 1 deletion core/commons-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"node": ">=8"
},
"dependencies": {
"http-errors": "1.7.3"
"http-errors": "1.7.3",
"http-status-codes": "1.3.2"
},
"devDependencies": {
"@verdaccio/babel-preset": "^8.2.0",
Expand Down
27 changes: 14 additions & 13 deletions core/commons-api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import createError, { HttpError } from 'http-errors';
import httpCodes from 'http-status-codes';

export const DEFAULT_MIN_LIMIT_PASSWORD = 3;

export const HTTP_STATUS = {
OK: 200,
CREATED: 201,
MULTIPLE_CHOICES: 300,
NOT_MODIFIED: 304,
BAD_REQUEST: 400,
UNAUTHORIZED: 401,
FORBIDDEN: 403,
NOT_FOUND: 404,
CONFLICT: 409,
UNSUPPORTED_MEDIA: 415,
BAD_DATA: 422,
INTERNAL_ERROR: 500,
SERVICE_UNAVAILABLE: 503,
OK: httpCodes.OK,
CREATED: httpCodes.CREATED,
MULTIPLE_CHOICES: httpCodes.MULTIPLE_CHOICES,
NOT_MODIFIED: httpCodes.NOT_MODIFIED,
BAD_REQUEST: httpCodes.BAD_REQUEST,
UNAUTHORIZED: httpCodes.UNAUTHORIZED,
FORBIDDEN: httpCodes.FORBIDDEN,
NOT_FOUND: httpCodes.NOT_FOUND,
CONFLICT: httpCodes.CONFLICT,
UNSUPPORTED_MEDIA: httpCodes.UNSUPPORTED_MEDIA_TYPE,
BAD_DATA: httpCodes.UNPROCESSABLE_ENTITY,
INTERNAL_ERROR: httpCodes.INTERNAL_SERVER_ERROR,
SERVICE_UNAVAILABLE: httpCodes.SERVICE_UNAVAILABLE,
LOOP_DETECTED: 508,
};

Expand Down
14 changes: 9 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4414,10 +4414,10 @@ domexception@^1.0.1:
dependencies:
webidl-conversions "^4.0.2"

dompurify@2.0.6:
version "2.0.6"
resolved "https://registry.verdaccio.org/dompurify/-/dompurify-2.0.6.tgz#0a4196c211ce00e848240e52b1d49261af12a3be"
integrity sha512-1+AOpCYIKoLER/Ykd/Q/i11slhYy6T29/mmDrTsALH0JcMPB0pt9++8eDTGT70tv6ofmmeptrdqzZpmjMfFLRg==
dompurify@2.0.7:
version "2.0.7"
resolved "https://registry.verdaccio.org/dompurify/-/dompurify-2.0.7.tgz#f8266ad38fe1602fb5b3222f31eedbf5c16c4fd5"
integrity sha512-S3O0lk6rFJtO01ZTzMollCOGg+WAtCwS3U5E2WSDY/x/sy7q70RjEC4Dmrih5/UqzLLB9XoKJ8KqwBxaNvBu4A==

dot-prop@^3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -5901,6 +5901,11 @@ http-signature@~1.2.0:
jsprim "^1.2.2"
sshpk "^1.7.0"

http-status-codes@1.3.2:
version "1.3.2"
resolved "https://registry.verdaccio.org/http-status-codes/-/http-status-codes-1.3.2.tgz#181dfa4455ef454e5e4d827718fca3936680d10d"
integrity sha512-nDUtj0ltIt08tGi2VWSpSzNNFye0v3YSe9lX3lIqLTuVvvRiYCvs4QQBSHo0eomFYw1wlUuofurUAlTm+vHnXg==

https-proxy-agent@^2.2.1:
version "2.2.2"
resolved "https://registry.verdaccio.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793"
Expand Down Expand Up @@ -10155,7 +10160,6 @@ snyk@^1.231.0:
needle "^2.2.4"
opn "^5.5.0"
os-name "^3.0.0"
proxy-agent "*"
proxy-from-env "^1.0.0"
semver "^6.0.0"
snyk-config "^2.2.1"
Expand Down

0 comments on commit 00b66af

Please sign in to comment.