/*
 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
 *
 * A brief overview of this source file: what is its purpose.
 */


var util = require('./util');
var validation = require('./validation');
var vmcommon = require('./vm-common');
var errors = require('./errors');


// TODO dynamiclally load-export these things

module.exports = {

    // Util
    clone: util.clone,
    simpleMerge: util.simpleMerge,
    shallowEqual: util.shallowEqual,
    objectDiff: util.objectDiff,
    timestamp: util.timestamp,

    // Validation helpers
    validUUID: validation.validUUID,
    validUUIDs: validation.validUUIDs,
    validMetadata: validation.validMetadata,
    validAlias: validation.validAlias,
    validBrand: validation.validBrand,
    validNumber: validation.validNumber,
    validOwner: validation.validOwner,

    // VM validation
    validateVm: validation.validateVm,
    validateParams: validation.validateParams,
    validateUniqueAlias: validation.validateUniqueAlias,
    validateUpdate: validation.validateUpdate,
    setDefaultValues: validation.setDefaultValues,

    // VM common
    vmOwner: vmcommon.vmOwner,
    translateVm: vmcommon.translateVm,
    translateJob: vmcommon.translateJob,
    keyValueToObject: vmcommon.keyValueToObject,
    objectToKeyValue: vmcommon.objectToKeyValue,
    vmToUfds: vmcommon.vmToUfds,
    vmToHash: vmcommon.vmToHash,
    setMetadata: vmcommon.setMetadata,
    addMetadata: vmcommon.addMetadata,
    deleteMetadata: vmcommon.deleteMetadata,
    deleteAllMetadata: vmcommon.deleteAllMetadata,
    addTagsFilter: vmcommon.addTagsFilter,
    getStatuses: vmcommon.getStatuses,

    // Custom Errors
    UnallocatedVMError: errors.UnallocatedVMError

};
/*
 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
 *
 * A brief overview of this source file: what is its purpose.
 */


var util = require('./util');
var validation = require('./validation');
var vmcommon = require('./vm-common');
var errors = require('./errors');

var i;

var utilFunctions = Object.keys(util);
for (i = 0; i < utilFunctions.length; i++) {
    exports[utilFunctions[i]] = util[utilFunctions[i]];
}

var validationFunctions = Object.keys(validation);
for (i = 0; i < validationFunctions.length; i++) {
    exports[validationFunctions[i]] = validation[validationFunctions[i]];
}

var vmcommonFunctions = Object.keys(vmcommon);
for (i = 0; i < vmcommonFunctions.length; i++) {
    exports[vmcommonFunctions[i]] = vmcommon[vmcommonFunctions[i]];
}

var errorFunctions = Object.keys(errors);
for (i = 0; i < errorFunctions.length; i++) {
    exports[errorFunctions[i]] = errors[errorFunctions[i]];
}
Refactor exports in common/index.js