@methodus/server
Version:
Server components for @methodus workflow
45 lines • 1.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class MethodResult {
constructor(result, total, page) {
this.page = 1;
this.total = 0;
this.statusCode = 200;
this.headers = {};
this._on = {};
this.result = result;
if (total) {
this.total = total;
}
if (page) {
this.page = page;
}
}
pipe(streamToPipe) {
this.stream = streamToPipe;
return this.stream;
}
setHeader(key, value) {
this.headers[key] = value;
}
on(key, value) {
this._on[key] = value;
}
}
exports.MethodResult = MethodResult;
class MethodResultStatus {
constructor(result, statusCode, total, page) {
this.page = 1;
this.total = 0;
this.statusCode = statusCode;
this.result = result;
if (total) {
this.total = total;
}
if (page) {
this.page = page;
}
}
}
exports.MethodResultStatus = MethodResultStatus;
//# sourceMappingURL=methodResult.js.map