all files / lib/ metadata.js

100% Statements 55/55
80% Branches 8/10
100% Functions 9/9
100% Lines 54/54
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92                                      13×           11×   11× 11× 11× 11× 11×               30×   30× 30× 30×          
"use strict";
 
var _map = require("babel-runtime/core-js/map");
 
var _map2 = _interopRequireDefault(_map);
 
var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
 
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
 
var _createClass2 = require("babel-runtime/helpers/createClass");
 
var _createClass3 = _interopRequireDefault(_createClass2);
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
var ServiceClass = function () {
    function ServiceClass(targetClass) {
        (0, _classCallCheck3.default)(this, ServiceClass);
 
        this.targetClass = targetClass;
        this.methods = new _map2.default();
    }
 
    (0, _createClass3.default)(ServiceClass, [{
        key: "addProperty",
        value: function addProperty(key, paramType) {
            Eif (!this.hasProperties()) {
                this.properties = new _map2.default();
            }
            this.properties.set(key, paramType);
        }
    }, {
        key: "hasProperties",
        value: function hasProperties() {
            return this.properties && this.properties.size > 0;
        }
    }]);
    return ServiceClass;
}();
 
exports.ServiceClass = ServiceClass;
 
var ServiceMethod = function ServiceMethod() {
    (0, _classCallCheck3.default)(this, ServiceMethod);
 
    this.parameters = new Array();
    this.mustParseCookies = false;
    this.files = new Array();
    this.mustParseBody = false;
    this.mustParseForms = false;
};
 
exports.ServiceMethod = ServiceMethod;
 
var FileParam = function FileParam(name, singleFile) {
    (0, _classCallCheck3.default)(this, FileParam);
 
    this.name = name;
    this.singleFile = singleFile;
};
 
exports.FileParam = FileParam;
 
var MethodParam = function MethodParam(name, type, paramType) {
    (0, _classCallCheck3.default)(this, MethodParam);
 
    this.name = name;
    this.type = type;
    this.paramType = paramType;
};
 
exports.MethodParam = MethodParam;
(function (ParamType) {
    ParamType[ParamType["path"] = 0] = "path";
    ParamType[ParamType["query"] = 1] = "query";
    ParamType[ParamType["header"] = 2] = "header";
    ParamType[ParamType["cookie"] = 3] = "cookie";
    ParamType[ParamType["form"] = 4] = "form";
    ParamType[ParamType["body"] = 5] = "body";
    ParamType[ParamType["file"] = 6] = "file";
    ParamType[ParamType["files"] = 7] = "files";
    ParamType[ParamType["context"] = 8] = "context";
    ParamType[ParamType["context_request"] = 9] = "context_request";
    ParamType[ParamType["context_response"] = 10] = "context_response";
    ParamType[ParamType["context_next"] = 11] = "context_next";
    ParamType[ParamType["context_accept"] = 12] = "context_accept";
    ParamType[ParamType["context_accept_language"] = 13] = "context_accept_language";
})(exports.ParamType || (exports.ParamType = {}));
var ParamType = exports.ParamType;
//# sourceMappingURL=metadata.js.map