39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
|
"use strict";
|
||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||
|
};
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
var Status_ts_1 = __importDefault(require("./Status.ts"));
|
||
|
var Transaction = /** @class */ (function () {
|
||
|
/* constructor */
|
||
|
function Transaction(req, res) {
|
||
|
this._req = req;
|
||
|
this._res = res;
|
||
|
this._status = new Status_ts_1.default;
|
||
|
}
|
||
|
Object.defineProperty(Transaction.prototype, "req", {
|
||
|
/* public */
|
||
|
get: function () { return this._req; },
|
||
|
enumerable: true,
|
||
|
configurable: true
|
||
|
});
|
||
|
Object.defineProperty(Transaction.prototype, "res", {
|
||
|
get: function () { return this._res; },
|
||
|
enumerable: true,
|
||
|
configurable: true
|
||
|
});
|
||
|
Object.defineProperty(Transaction.prototype, "status", {
|
||
|
get: function () { return this._status; },
|
||
|
enumerable: true,
|
||
|
configurable: true
|
||
|
});
|
||
|
/* methods */
|
||
|
Transaction.prototype.finalize = function () {
|
||
|
if (this._status.has_status())
|
||
|
this._res.status(this.status.status);
|
||
|
this._res.end(data);
|
||
|
};
|
||
|
return Transaction;
|
||
|
}());
|
||
|
exports.default = Transaction;
|