var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
/*
 * this class is the base class that all the component can implement
 *
 */
import BadDataException from "../../../Types/Exception/BadDataException";
import CaptureSpan from "../../Utils/Telemetry/CaptureSpan";
/**
 * Maximum depth of nested workflow invocations (Execute Workflow component).
 * Catches pathological fanout even when no direct cycle exists.
 */
export const MAX_WORKFLOW_CALL_DEPTH = 10;
export default class ComponentCode {
    constructor() {
        this.metadata = null;
    }
    setMetadata(metadata) {
        this.metadata = metadata;
    }
    getMetadata() {
        if (!this.metadata) {
            throw new BadDataException("ComponentMetadata not found");
        }
        return this.metadata;
    }
    async run(_args, _options) {
        return await Promise.resolve({
            returnValues: {},
            port: undefined,
        });
    }
}
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], ComponentCode.prototype, "run", null);
//# sourceMappingURL=ComponentCode.js.map