// --- Dependencies ---

var join = require('path').join;

var debug = require('debug')('zotero:library');

var Client = require('./client');

/** @module zotero/library */

function Library(options) {
  options = options || {};

  this.client = options.client || new Client();

  if (options.group) this.group = options.group;
  if (options.user)  this.user  = options.user;
}

Object.defineProperties(Library.prototype, {

  /** @property {'user'|'group'|undefined} type - the library type. */
  type: {
    get: function () {
      if (this.user  != null) return 'user';
      if (this.group != null) return 'group';

      return undefined;
    }
  },

  /** @property {number} id - the library id. */
  id: {
    get: function () { return this.user || this.group; }
  },

  prefix: {
    get: function () {
      return this.id ? join(this.type + 's', this.id.toString()) : '';
    }
  }
});

// --- Exports ---
exports = module.exports = Library;

@@ -136,16 +136,72 @@
 ent');%0A%0A
+var utils = require('./utils');%0Avar omit = utils.omit;%0A%0A
 /** @mod
@@ -424,16 +424,76 @@
 ns.user;
+%0A%0A  this.options = omit(options, 'client', 'user', 'group');
 %0A%7D%0A%0AObje
@@ -886,16 +886,78 @@
 %7D%0A  %7D,%0A%0A
+  /** @property %7Bstring%7D prefix - the library path prefix. */%0A
   prefix
@@ -1068,13 +1068,188 @@
   %7D%0A
-
 %7D);%0A%0A
+%0ALibrary.prototype.get = function (path, options, callback) %7B%0A  if (arguments.length === 2 && typeof options === 'function') %7B%0A    callback = options; options = null;%0A  %7D%0A%7D;%0A%0A
 // -

add library #get