protected function getTypeDefinitionInternal($repositoryId, $typeId)
    {
        if (empty($repositoryId)) {
            throw new CmisInvalidArgumentException('Repository id must not be empty!');
        }

        if (empty($typeId)) {
            throw new CmisInvalidArgumentException('Type id must not be empty!');
        }

        // build URL
        $url = $this->getRepositoryUrl($repositoryId, Constants::SELECTOR_TYPE_DEFINITION);
        $url->getQuery()->modify([Constants::PARAM_TYPE_ID => $typeId]);

        return $this->getJsonConverter()->convertTypeDefinition(
            (array) $this->readJson($url)
        );
    }