0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-04 02:02:39 -05:00
verdaccio/src/lib/constants.js

71 lines
1.8 KiB
JavaScript
Raw Normal View History

// @flow
export const HEADERS = {
JSON: 'application/json',
JSON_CHARSET: 'application/json; charset=utf-8',
2018-06-25 07:59:35 +02:00
OCTET_STREAM: 'application/octet-stream; charset=utf-8',
TEXT_CHARSET: 'text/plain; charset=utf-8',
2018-06-22 07:49:10 +02:00
GZIP: 'gzip',
};
export const HEADER_TYPE = {
CONTENT_ENCODING: 'content-encoding',
2018-06-23 01:03:25 +02:00
CONTENT_TYPE: 'content-type',
CONTENT_LENGTH: 'content-length',
2018-06-22 07:49:10 +02:00
ACCEPT_ENCODING: 'accept-encoding',
};
export const ERROR_CODE = {
token_required: 'token is required',
};
export const TOKEN_BASIC = 'Basic';
export const TOKEN_BEARER = 'Bearer';
export const DEFAULT_REGISTRY = 'https://registry.npmjs.org/';
export const HTTP_STATUS = {
OK: 200,
CREATED: 201,
2018-06-23 01:03:25 +02:00
MULTIPLE_CHOICES: 300,
2018-06-24 22:39:35 +02:00
NOT_MODIFIED: 304,
BAD_REQUEST: 400,
UNAUTHORIZED: 401,
FORBIDDEN: 403,
NOT_FOUND: 404,
CONFLICT: 409,
2018-06-23 01:03:25 +02:00
UNSUPORTED_MEDIA: 415,
BAD_DATA: 422,
2018-06-23 01:03:25 +02:00
INTERNAL_ERROR: 500,
SERVICE_UNAVAILABLE: 503,
LOOP_DETECTED: 508,
};
2018-06-22 07:49:10 +02:00
2018-06-23 16:34:22 +02:00
export const API_MESSAGE = {
PKG_CREATED: 'created new package',
PKG_CHANGED: 'package changed',
PKG_REMOVED: 'package removed',
PKG_PUBLISHED: 'package published',
TARBALL_REMOVED: 'tarball removed',
2018-06-25 07:59:35 +02:00
TAG_UPDATED: 'tags updated',
TAG_REMOVED: 'tag removed',
TAG_ADDED: 'package tagged',
2018-06-23 16:34:22 +02:00
};
2018-06-23 01:03:25 +02:00
export const API_ERROR = {
2018-06-22 20:31:43 +02:00
NO_PACKAGE: 'no such package available',
NOT_ALLOWED: 'not allowed to access package',
2018-06-23 01:03:25 +02:00
INTERNAL_SERVER_ERROR: 'internal server error',
UNKNOWN_ERROR: 'unknown error',
2018-06-24 10:11:52 +02:00
NOT_PACKAGE_UPLINK: 'package does not exist on uplink',
2018-06-23 01:03:25 +02:00
CONTENT_MISMATCH: 'content length mismatch',
NOT_FILE_UPLINK: 'file doesn\'t exist on uplink',
MAX_USERS_REACHED: 'maximum amount of users reached',
2018-06-23 11:51:58 +02:00
VERSION_NOT_EXIST: 'this version doesn\'t exist',
2018-06-24 22:39:35 +02:00
FILE_NOT_FOUND: 'File not found',
WEB_DISABLED: 'Web interface is disabled in the config file',
2018-06-22 20:31:43 +02:00
};
export const DEFAULT_NO_README = 'ERROR: No README data found!';