pegasys-orchestrate
Version:
The PegaSys Orchestrate library provides convenient access to the Codefi Orchestrate API from applications written in server-side JavaScript
37 lines (36 loc) • 1.33 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResponseMessage = void 0;
/**
* Class representing a response message from Orchestrate
*/
class ResponseMessage {
constructor(consumer, message) {
this.consumer = consumer;
this.message = message;
}
/**
* Commits the message offset
*/
commit() {
return __awaiter(this, void 0, void 0, function* () {
yield this.consumer.commit(this.message);
});
}
/**
* Gets the message
*/
content() {
return this.message;
}
}
exports.ResponseMessage = ResponseMessage;