"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.robotArmResolver = void 0;
const robotics_types_1 = require("../../../controllers/robotics-types");
const integration_base_1 = require("@things-factory/integration-base");
const debug = require('debug')('aidoop:robotics:robot-arm-resolver');
exports.robotArmResolver = {
    async robotArm(_, { name }, context) {
        const { domain } = context.state;
        var connection = integration_base_1.ConnectionManager.getConnectionInstanceByName(domain, name);
        debug('connection', connection);
        if (!connection || connection.discriminator !== robotics_types_1.ROBOTICS_OBJECT_TYPES.ROBOT_ARM) {
            debug(`RobotArm '${name}' Not Found`);
            throw Error(`RobotArm '${name}' Not Found`);
        }
        var { markerOffset, toolOffset } = connection.params || {};
        debug('result', markerOffset, toolOffset);
        return Object.assign(Object.assign({}, connection), { markerOffset,
            toolOffset });
    }
};
//# sourceMappingURL=robot-arm.js.map