UNPKG

airship-server

Version:

Airship is a framework for Node.JS & TypeScript that helps you to write big, scalable and maintainable API servers.

23 lines 935 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const ClassScheme_1 = require("../../codeGen/domain/schema/ClassScheme"); const ApiMethodScheme_1 = require("../../codeGen/domain/schema/ApiMethodScheme"); class ApiSchema { constructor(models, methods, responses) { this.models = models; this.methods = methods; this.responses = responses; } serialize() { return { models: this.models.map(m => m.serialize()), methods: this.methods.map(m => m.serialize()), responses: this.responses.map(r => r.serialize()) }; } static deserialize(raw) { return new ApiSchema(raw['models'].map(ClassScheme_1.default.deserialize), raw['methods'].map(ApiMethodScheme_1.default.deserialize), raw['responses'].map(ClassScheme_1.default.deserialize)); } } exports.default = ApiSchema; //# sourceMappingURL=ApiSchema.js.map