'use strict';

////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2026 ArangoDB GmbH, Cologne, Germany
///
/// The Programs (which include both the software and documentation) contain
/// proprietary information of ArangoDB GmbH; they are provided under a license
/// agreement containing restrictions on use and disclosure and are also
/// protected by copyright, patent and other intellectual and industrial
/// property laws. Reverse engineering, disassembly or decompilation of the
/// Programs, except to the extent required to obtain interoperability with
/// other independently created software or as specified by law, is prohibited.
///
/// It shall be the licensee's responsibility to take all appropriate fail-safe,
/// backup, redundancy, and other measures to ensure the safe use of
/// applications if the Programs are used for purposes such as nuclear,
/// aviation, mass transit, medical, or other inherently dangerous applications,
/// and ArangoDB GmbH disclaims liability for any damages caused by such use of
/// the Programs.
///
/// This software is the confidential and proprietary information of ArangoDB
/// GmbH. You shall not disclose such confidential and proprietary information
/// and shall use it only in accordance with the terms of the license agreement
/// you entered into with ArangoDB GmbH.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
////////////////////////////////////////////////////////////////////////////////

const {ArangoError, errors} = require('@arangodb');
const GeneralGraph = require('@arangodb/general-graph');
const {ERROR_BAD_PARAMETER} = errors;

exports._create = function (name, edgeDefinition, orphans, options) {
  options = options || {};
  if (!options.isSmart) {
    throw new ArangoError({
      errorNum: ERROR_BAD_PARAMETER.code,
      errorMessage: `An Enterprise Graph requires the option isSmart: true`
    });
  }
  if (options.hasOwnProperty("smartGraphAttribute")) {
    throw new ArangoError({
      errorNum: ERROR_BAD_PARAMETER.code,
      errorMessage: `An Enterprise Graph disallows a smartGraphAttribute to be given`
    });
  }
  return GeneralGraph._create(name, edgeDefinition, orphans, options);
};

exports._drop = GeneralGraph._drop;
exports._exists = GeneralGraph._exists;
exports._graph = GeneralGraph._graph;
exports._list = GeneralGraph._list;
exports._listObjects = GeneralGraph._listObjects;
exports._renameCollection = GeneralGraph._renameCollection;

exports._relation = GeneralGraph._relation;
exports._edgeDefinitions = GeneralGraph._edgeDefinitions;
exports._extendEdgeDefinitions = GeneralGraph._extendEdgeDefinitions;
