UNPKG

@fabric-es/fabric-cqrs

Version:

Hyperledger Fabric middleware for event sourcing and cqrs pattern

22 lines 843 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.commandGetByEntityId = void 0; const command_1 = require("../store/command"); const _1 = require("."); const commandGetByEntityId = (entityName, isPrivateData, { store, logger, connectionProfile, channelName, wallet }) => _1.dispatcher(({ tx_id, args: { id } }) => command_1.action.queryByEntityId({ tx_id, connectionProfile, wallet, channelName, args: { entityName, id, isPrivateData }, }), { name: 'queryByEntityId', store, slice: 'write', SuccessAction: command_1.action.QUERY_SUCCESS, ErrorAction: command_1.action.QUERY_ERROR, logger, typeGuard: _1.isCommitRecord, }, (result) => Object.values(result)); exports.commandGetByEntityId = commandGetByEntityId; //# sourceMappingURL=commandGetByEntityId.js.map