all files / generators/api/commons/ constants.js

100% Statements 9/9
100% Branches 0/0
100% Functions 3/3
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                         
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Class which contains all constants generated content.
 *
 * @export
 * @class Constants
 */
var Constants = (function () {
    function Constants() {
    }
    /**
     * Generate StatusCode string content class
     * @return {string}
     */
    Constants.prototype.getStatusCode = function () {
        var statuses = {
            OK: 200,
            CREATED: 201,
            NO_CONTENT: 204,
            FOUND: 302,
            SEE_OTHER: 303,
            BAD_REQUEST: 400,
            UNAUTHORIZED: 401,
            FORBIDDEN: 403,
            NOT_FOUND: 404,
            METHOD_NOT_ALLOWED: 405,
            CONFLICT: 409,
            INTERNAL_SERVER_ERROR: 500,
            BAD_GATEWAY: 502,
        };
        return "module.exports = " + JSON.stringify(statuses, undefined, 2) + ";";
    };
    return Constants;
}());
exports.Constants = Constants;
exports.default = new Constants();