@n1k1t/mock-server
Version:
Powerful util to setup mocks over HTTP APIs
27 lines • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalSocketIoRequestContext = void 0;
const models_1 = require("../../../models");
const reply_1 = require("./reply");
class InternalSocketIoRequestContext extends models_1.RequestContext {
constructor(server, request) {
super(server.providers.default, { transport: 'io', event: 'message' });
this.server = server;
this.request = request;
this.incoming = {
type: 'json',
data: this.request.data,
path: this.request.path,
method: 'NONE',
headers: {},
query: {},
};
this.reply = reply_1.InternalSocketIoReply.build(this);
this.snapshot = this.compileSnapshot();
}
static build(server, request) {
return new InternalSocketIoRequestContext(server, request);
}
}
exports.InternalSocketIoRequestContext = InternalSocketIoRequestContext;
//# sourceMappingURL=context.js.map