furystack-core
Version:
FuryStack framework, Core package
22 lines • 854 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../");
class ActionOwnerAbstract {
constructor() {
this.customActions = [];
}
CustomAction(name, requestType, bodyType, returnsType) {
const existing = this.customActions.find((a) => a.name === name);
if (existing) {
return existing;
}
if (!requestType || !bodyType || !returnsType) {
throw Error("RequestType, BodyType and ReturnsType are required, when you define a custom action");
}
const newAction = new _1.CustomAction(name, requestType, bodyType, returnsType);
this.customActions.push(newAction);
return newAction;
}
}
exports.ActionOwnerAbstract = ActionOwnerAbstract;
//# sourceMappingURL=ActionOwnerAbstract.js.map