@n1k1t/mock-server
Version:
Powerful util to setup mocks over HTTP APIs
13 lines • 577 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const models_1 = require("../models");
exports.default = models_1.Endpoint
.build()
.bindToHttp({ method: 'GET', path: '/history' })
.bindToIo({ path: 'history:get-list' })
.assignHandler(({ reply, server }) => reply.ok(server.providers
.extract()
.reduce((acc, provider) => acc.concat([...provider.storages.history.values()]), [])
.sort((a, b) => b.timestamp - a.timestamp)
.map((history) => history.toPlain())));
//# sourceMappingURL=history.get-list.endpoint.js.map